From 10d1e20c6a979be8253cfb73c4024e92beef81c0 Mon Sep 17 00:00:00 2001 From: David Hara Date: Fri, 26 Feb 2016 02:29:45 -0800 Subject: [PATCH 001/797] 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 002/797] 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 003/797] 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 004/797] 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 005/797] 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 006/797] 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 007/797] 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 008/797] 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 009/797] 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 010/797] 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 011/797] 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 f3138d91708b23678516cc84a54f976da81735c4 Mon Sep 17 00:00:00 2001 From: Dave Allen Date: Tue, 14 Jun 2016 11:49:26 -0700 Subject: [PATCH 012/797] Deprecated, fixed tests to pass --- meteor/README.md | 11 ++++++++++- meteor/meteor-tests.ts | 6 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/meteor/README.md b/meteor/README.md index d9d7898ffb..3c0b669314 100644 --- a/meteor/README.md +++ b/meteor/README.md @@ -1,4 +1,13 @@ -# Meteor Type Definitions +# Meteor Type Definitions [DEPRECATED] + +## Deprecated + +These definitions for Meteor are now deprecated. They should still work for versions of Meteor up to 1.2.1. + +The canonical TypeScript definitions for Meteor can now be found using the NPM [Typings definition manager](https://www.npmjs.com/package/typings). If you prefer to are the meteor definitions used by that tool: . + + +## Description These are the definitions for version 1.3 of Meteor. These definitions were generated from the from the same [Meteor data.js file] (https://github.com/meteor/meteor/blob/devel/docs/client/data.js) that is used to generate the official [Meteor docs] (http://docs.meteor.com/). The code that generates these definitions can be found [here](https://github.com/meteor-typescript/meteor-typescript-libs/). diff --git a/meteor/meteor-tests.ts b/meteor/meteor-tests.ts index bc877bdea0..4b5a154794 100644 --- a/meteor/meteor-tests.ts +++ b/meteor/meteor-tests.ts @@ -650,16 +650,16 @@ Accounts.emailTemplates.siteName = "AwesomeSite"; Accounts.emailTemplates.from = "AwesomeSite Admin "; Accounts.emailTemplates.headers = { asdf: 'asdf', qwer: 'qwer' }; -Accounts.emailTemplates.enrollAccount.subject = function (user) { +Accounts.emailTemplates.enrollAccount.subject = function (user: Meteor.User) { return "Welcome to Awesome Town, " + user.profile.name; }; -Accounts.emailTemplates.enrollAccount.html = function (user, url) { +Accounts.emailTemplates.enrollAccount.html = function (user: Meteor.User, url: string) { return "

Some html here

"; }; Accounts.emailTemplates.enrollAccount.from = function() { return "asdf@asdf.com"; }; -Accounts.emailTemplates.enrollAccount.text = function (user, url) { +Accounts.emailTemplates.enrollAccount.text = function (user: Meteor.User, url: string) { return "You have been selected to participate in building a better future!" + " To activate your account, simply click the link below:\n\n" + url; From ba5a120b99623910962f75970a265752d7877559 Mon Sep 17 00:00:00 2001 From: Dave Allen Date: Tue, 14 Jun 2016 11:54:31 -0700 Subject: [PATCH 013/797] Improved deprecation message in README --- meteor/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meteor/README.md b/meteor/README.md index 3c0b669314..7c8aa5cb1d 100644 --- a/meteor/README.md +++ b/meteor/README.md @@ -4,7 +4,7 @@ These definitions for Meteor are now deprecated. They should still work for versions of Meteor up to 1.2.1. -The canonical TypeScript definitions for Meteor can now be found using the NPM [Typings definition manager](https://www.npmjs.com/package/typings). If you prefer to are the meteor definitions used by that tool: . +The canonical TypeScript definitions for Meteor can now be found using the NPM [Typings definition manager](https://www.npmjs.com/package/typings). If you prefer to view the definitions directly, or contribute to them, they can be found here: . ## Description From 853deb1f46ba82f9feff2c0184e1cdd533c0ff8b Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Tue, 17 Jan 2017 00:41:59 +0000 Subject: [PATCH 014/797] Initial commit of typings for OpenFin API --- openfin/index.d.ts | 1493 ++++++++++++++++++++++++++++++++++++++ openfin/openfin-tests.ts | 718 ++++++++++++++++++ openfin/tsconfig.json | 20 + openfin/tslint.json | 1 + 4 files changed, 2232 insertions(+) create mode 100644 openfin/index.d.ts create mode 100644 openfin/openfin-tests.ts create mode 100644 openfin/tsconfig.json create mode 100644 openfin/tslint.json diff --git a/openfin/index.d.ts b/openfin/index.d.ts new file mode 100644 index 0000000000..2c37e6f9b2 --- /dev/null +++ b/openfin/index.d.ts @@ -0,0 +1,1493 @@ +// Type definitions for OpenFin API 15.0 +// Project: https://openfin.co/ +// Definitions by: Chris Barker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// based on v6.49.15.18 +// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean + + +/** + * JavaScript API + * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, can communicate with other applications and has access to sandboxed system-level features. + * + * API Ready + * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. + * + * Overview + * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. + **/ +declare namespace fin { + const desktop: OpenFinDesktop; + + interface OpenFinDesktop { + main(f: () => any): void; + Application: OpenFinApplication; + ExternalApp: OpenFinExternalApplication; + InterApplicationBus: OpenFinInterApplicationBus; + Notification: OpenFinNotification; + System: OpenFinSystem; + Window: OpenFinWindow; + } + + /** + * Application + * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. + */ + interface OpenFinApplication { + /** + * Creates a new Application. + * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. + */ + new (options: ApplicationOptions, callback?: (successObj: { httpResponseCode: number }) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + getCurrent(): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + wrap(uuid: string): OpenFinApplication; + /** + * Returns an instance of the main Window of the application + */ + getWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener(type: OpenFinApplicationEventType, listener: (event: ApplicationBaseEvent | TrayIconClickedEvent | WindowEvent | WindowAlertRequestedEvent | WindowAuthRequested | WindowNavigationRejectedEvent | WindowEndLoadEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application and any child windows created by the application. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of wrapped fin.desktop.Windows for each of the application’s child windows. + */ + getChildWindows(callback?: (children: OpenFinWindow[]) => any, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. + */ + getGroups(callback?: (groups: OpenFinWindow[][]) => any, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. + */ + getManifest(callback?: (manifest: any) => any, errorCallback?: (reason: string) => void): void; + /** + * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. + */ + getParentUuid(callback?: (uuid: string) => any, errorCallback?: (reason: string) => void): void; + /** + * Retrieves current configuration of application's shortcuts. + */ + getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the application is currently running. + */ + isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Passes in custom data that will be relayed to the RVM + */ + registerCustomData(data: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener(type: OpenFinApplicationEventType, previouslyRegisteredListener: (event: ApplicationBaseEvent | TrayIconClickedEvent | WindowEvent | WindowAlertRequestedEvent | WindowAuthRequested | WindowNavigationRejectedEvent | WindowEndLoadEvent) => any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes the application’s icon from the tray. + */ + removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restarts the application. + */ + restart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Runs the application. When the application is created, run must be called. + */ + run(callback?: (successObj: SuccessObj) => any, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => any): void; + /** + * Tells the rvm to relaunch the main application once upon a complete shutdown + */ + scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets new shortcut configuration for current application. Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to be able to change shortcut states. + */ + setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Adds a customizable icon in the system tray and notifies the application when clicked. + */ + setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application by terminating its process. + */ + terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application to continue and to generate another "not-responding" message after a certain period of time. + */ + wait(callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ShortCutConfig { + /** + * application has a shortcut on the desktop + */ + desktop: boolean; + /** + * application has no shortcut in the start menu + */ + startMenu: boolean; + /** + * application will be launched on system startup + */ + systemStartup: boolean; + } + + interface SuccessObj { + httpResponseCode: number; + } + + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } + + interface ErrorInfo { + stack: string; + message: string; + } + + interface ApplicationOptions { + url: string; + uuid: string; + name: string; + mainWindowOptions: WindowOptions; + } + + interface WindowOptions { + /** + * Enable keyboard shortcuts for devtools and zoom. Default: false for both. + */ + accelerator?: { + devtools?: boolean, + zoom?: boolean + }; + /** + * A flag to always position the window at the top of the window stack. Default: false. + */ + alwaysOnTop?: boolean; + /** + * A flag to automatically show the Window when it is created. Default: false. + */ + autoShow?: boolean; + /** + * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + */ + contextMenu?: boolean; + /** + * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + */ + cornerRounding?: { + width: number; + height: number; + }; + /** + * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. + */ + customData?: any; + /** + * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the position from before the window was closed is used. This option overrides defaultLeft and defaultTop. Default: false. + */ + defaultCentered?: boolean; + /** + * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. + */ + defaultHeight?: number; + /** + * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. + */ + defaultWidth?: number; + /** + * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. + */ + defaultTop?: number; + /** + * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. + */ + defaultLeft?: number; + /** + * A flag to show the frame. Default: true. + */ + frame?: boolean; + /** + * A flag to allow a window to be hidden when the close button is clicked.Default: false. + */ + hideOnClose?: boolean; + /** + * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + */ + icon?: string; + /** + * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + */ + maxHeight?: number; + /** + * A flag that lets the window be maximized.Default: true. + */ + maximizable?: boolean; + /** + * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + */ + maxWidth?: number; + /** + * The minimum height of a window.Default: 0. + */ + minHeight?: number; + /** + * A flag that lets the window be minimized.Default: true. + */ + minimizable?: boolean; + /** + * The minimum width of a window.Default: 0. + */ + minWidth?: number; + /** + * The name for the window which must be unique within the context of the invoking Application. + */ + name?: string; + /** + * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + */ + opacity?: number; + /** + * A flag to drop to allow the user to resize the window.Default: true. + */ + resizable?: boolean; + /** + * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + */ + resizeRegion?: { + /** + * The size in pixels (Default: 2), + */ + size: number; + /** + * The size in pixels of an additional + * square resizable region located at the + * bottom right corner of a + * frameless window. (Default: 4) + */ + bottomRightCorner: number; + }; + /** + * A flag to show the Window's icon in the taskbar. Default: true. + */ + showTaskbarIcon?: boolean; + /** + * A flag to cache the location of the window or not. Default: true. + */ + saveWindowState?: boolean; + /** + * Specify a taskbar group for the window. Default: app's uuid. + */ + taskbarIconGroup?: string; + /** + * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". + */ + state?: string; + /** + * The URL of the window. Default: "about:blank". + */ + url?: string; + /** + * When set to false, the window will render before the "load" event is fired on the content's window. Caution, when false you will see an initial empty white window. Default: true. + */ + waitForPageLoad?: boolean; + } + + /** + * Clipboard + * Clipboard API allows reading and writting to the clipboard in multiple formats. + */ + interface OpenFinClipboard { + /** + * Reads available formats for the clipboard type + */ + availableFormats(type: string | null, callback?: (formats: string[]) => any, errorCallback?: (reason: string, error: ErrorInfo) => any): void; + /** + * Reads available formats for the clipboard type + */ + readHtml(type: string | null, callback?: (html: string) => any, errorCallback?: (reason: string, error: ErrorInfo) => any): void; + /** + * Read the content of the clipboard as Rtf + */ + readRtf(type: string | null, callback?: (rtf: string) => any, errorCallback?: (reason: string, error: ErrorInfo) => any): void; + /** + * Read the content of the clipboard as plain text + */ + readText(type: string | null, callback?: (text: string) => any, errorCallback?: (reason: string, error: ErrorInfo) => any): void; + /** + * Writes data into the clipboard + */ + write(data: any, type: string | null, callback?: () => any, errorCallback?: (reason: string, error: ErrorInfo) => any): void; + /** + * Writes data into the clipboard as Html + */ + writeHtml(data: string, type: string | null, callback?: () => any, errorCallback?: (reason: string, error: ErrorInfo) => any): void; + /** + * Writes data into the clipboard as Rtf + */ + writeRtf(data: string, type: string | null, callback?: () => any, errorCallback?: (reason: string, error: ErrorInfo) => any): void; + /** + * Writes data into the clipboard as plain text + */ + writeText(data: string, type: string | null, callback?: () => any, errorCallback?: (reason: string, error: ErrorInfo) => any): void; + } + + /** + * ExternalApplication + * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. + */ + interface OpenFinExternalApplication { + /** + * Returns an External Application object that represents an existing external application. + */ + wrap(uuid: string): OpenFinExternalApplication; + /** + * Registers an event listener on the specified event. + */ + addEventListener(type: OpenFinExternalApplicationEventType, listener: () => any, callback?: () => any, errorCallback?: (reason: string, error: ErrorInfo) => any): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener(type: OpenFinExternalApplicationEventType, listener: () => any, callback?: () => any, errorCallback?: (reason: string, error: ErrorInfo) => any): void; + } + + /** + * InterApplicationBus + * A messaging bus that allows for pub/sub messaging between different applications. + */ + interface OpenFinInterApplicationBus { + /** + * Adds a listener that gets called when applications subscribe to the current application's messages. + */ + addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Adds a listener that gets called when applications unsubscribe to the current application's messages. + */ + addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered subscribe listener. + */ + removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered unsubscribe listener. + */ + removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. + */ + publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sends a message to a specific application on a specific topic. + */ + send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. + */ + subscribe(senderUuid: string, name: string, topic: string, listener: (message: any, uuid: string, name: string) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + subscribe(senderUuid: string, topic: string, listener: (message: any, uuid: string, name: string) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Unsubscribes to messages from the specified application on the specified topic. + */ + unsubscribe(senderUuid: string, name: string, topic: string, listener: (message: any, uuid: string, name: string) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + unsubscribe(senderUuid: string, topic: string, listener: (message: any, uuid: string, name: string) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + /** + * Notification + * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. A notification is typically used to alert the user of some important event which requires his or her attention. Notifications are a child or your application that are controlled by the runtime. + */ + interface OpenFinNotification { + /** + * + */ + new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; + /** + * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. + */ + getCurrent(): OpenFinNotification; + /** + * Closes the notification. + */ + close(callback?: () => void): void; + /** + * Sends a message to the notification. + */ + sendMessage(message: any, callback?: () => void): void; + /** + * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. + */ + sendMessageToApplication(message: any, callback?: () => void): void; + } + + interface NotificationOptions { + /** + * A boolean that will force dismissal even if the mouse is hovering over the notification + */ + ignoreMouseOver?: boolean; + /** + * A message of any primitive or composite-primitive type to be passed to the notification upon creation. + */ + message: any; + /** + * The timeout for displaying a notification.Can be in milliseconds or "never". + */ + duration?: number | "never"; + /** + * The url of the notification + */ + url: string; + /** + * A function that is called when a notification is clicked. + */ + onClick?(callback: () => void): void; + /** + * Invoked when the notification is closed via .close() method on the created notification instance or the by the notification itself via fin.desktop.Notification.getCurrent().close(). NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss + */ + onClose?(callback: () => void): void; + /** + * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. + */ + onDismiss?(callback: () => void): void; + /** + * A function that is called when an error occurs.The reason for the error is passed as an argument. + */ + onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * The onMessage function will respond to messages sent from notification.sendMessageToApplication.The function is passed the message, which can be of any primitive or composite-primitive type. + */ + onMessage?(callback: (message: any) => void): void; + /** + * A function that is called when a notification is shown. + */ + onShow?(callback: (successObj: SuccessObj) => void): void; + } + + /** + * System + * An object representing the core of OpenFin Runtime. Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. + */ + interface OpenFinSystem { + /** + * + */ + Clipboard: OpenFinClipboard; + /** + * Registers an event listener on the specified event. + */ + addEventListener(type: OpenFinSystemEventType, listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears cached data containing window state/positions, application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. + */ + clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears all cached data when OpenFin Runtime exits. + */ + deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Downloads the given application asset + */ + downloadAsset(assetObj: AppAssetInfo, progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, callback?: (successObj: { path: string }) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Exits the Runtime. + */ + exit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all applications. + */ + getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all external applications. + */ + getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data (name, ids, bounds) for all application windows. + */ + getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the command line argument string that started OpenFin Runtime. + */ + getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the configuration object that started the OpenFin Runtime. + */ + getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the value of a given environment variable on the computer on which the runtime is installed. + */ + getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the contents of the log with the specified filename. + */ + getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing information for each log file. + */ + getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. + */ + getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the mouse in virtual screen coordinates (left, top). + */ + getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of all of the runtime processes that are currently running. Each element in the array is an object containing the uuid and the name of the application to which the process belongs. + */ + getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the Proxy settings. + */ + getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the running RVM in an object. + */ + getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. + */ + getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Runs an executable or batch file. + */ + launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Writes the passed message into both the log file and the console. + */ + log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Monitors a running process. + */ + monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * This function call will register a unique id and produce a token. The token can be used to broker an external connection. + */ + registerExternalConnection(uuid: string, callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, errorCallback?: (reason: string) => void): void; + /** + * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). + */ + releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener(type: OpenFinSystemEventType, listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the Chrome Developer Tools for the specified window. + */ + showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. + */ + terminateExternalProcess(processUuid: string, timeout: number, killTree: boolean, callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, errorCallback?: (reason: string) => void): void; + terminateExternalProcess(processUuid: string, timeout: number, callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, errorCallback?: (reason: string) => void): void; + /** + * Update the OpenFin Runtime Proxy settings. + */ + updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + + } + + interface CacheOptions { + cache?: boolean; + cookies?: boolean; + localStorage?: boolean; + appcache?: boolean; + userData?: boolean; + } + + interface AppAssetInfo { + 'src': string; + 'alias': string; + 'version': string; + 'target': string; + 'args': string; + } + + interface ApplicationInfo { + /** + * true when the application is running. + */ + isRunning: boolean; + /** + * uuid of the application. + */ + uuid: string; + /** + * uuid of the application that launches this application. + */ + parentUuid: string; + } + + interface WindowDetails { + uuid: string; + mainWindow: WindowInfo; + childWindows: WindowInfo[]; + } + + interface WindowInfo { + /** + * name of the child window + */ + name: string; + /** + * top-most coordinate of the child window + */ + top: number; + /** + * right-most coordinate of the child window + */ + right: number; + /** + * bottom-most coordinate of the child window + */ + bottom: number; + /** + * left-most coordinate of the child window + */ + left: number; + } + + interface LogInfo { + /** + * the filename of the log + */ + name: string; + /** + * the size of the log in bytes + */ + size: number; + /** + * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" + */ + date: string; + } + + interface ProcessInfo { + /** + * the percentage of total CPU usage + */ + cpuUsage?: number; + /** + * the application name + */ + name?: string; + /** + * the current nonpaged pool usage in bytes + */ + nonPagedPoolUsage?: number; + /** + * the number of page faults + */ + pageFaultCount?: number; + /** + * the current paged pool usage in bytes + */ + pagedPoolUsage?: number; + /** + * the total amount of memory in bytes that the memory manager has committed + */ + pagefileUsage?: number; + /** + * the peak nonpaged pool usage in bytes + */ + peakNonPagedPoolUsage?: number; + /** + * the peak paged pool usage in bytes + */ + peakPagedPoolUsage?: number; + /** + * the peak value in bytes of pagefileUsage during the lifetime of this process + */ + peakPagefileUsage?: number; + /** + * the peak working set size in bytes + */ + peakWorkingSetSize?: number; + /** + * the native process identifier + */ + processId?: number; + /** + * the application UUID + */ + uuid?: string; + /** + * the current working set size (both shared and private data) in bytes + */ + workingSetSize?: number; + } + + interface ProxyInfo { + /** + * the configured Proxy Address + */ + proxyAddress: string; + /** + * the configured Proxy port + */ + proxyPort: number; + /** + * Proxy Type + */ + type: string; + } + + interface RvmInfo { + version: string; + "start-time": string; + } + + interface ExternalProcessLaunchInfo { + path?: string; + /** + * Additionally note that the executable found in the zip file specified in appAssets + * will default to the one mentioned by appAssets.target + * If the the path below refers to a specific path it will override this default + */ + alias?: string; + /** + * When using alias; if no arguments are passed then the arguments (if any) + * are taken from the 'app.json' file, from the 'args' parameter + * of the 'appAssets' Object with the relevant 'alias'. + * If 'arguments' is passed as a parameter it takes precedence + * over any 'args' set in the 'app.json'. + */ + arguments?: string; + listener?: (result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid: string; + /* + * Process exit code + */ + exitCode: number; + }) => void; + certificate?: CertificationInfo; + } + + interface CertificationInfo { + /** + * A hex string with or without spaces + */ + serial?: string; + /** + * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields + */ + subject: string; + /** + * A hex string with or without spaces + */ + publickey?: string; + /** + * A hex string with or without spaces + */ + thumbprint: string; + /** + * A boolean indicating that the certificate is trusted and not revoked + */ + trusted: boolean; + } + + interface ExternalProcessInfo { + pid: number; + listener?: (result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid: string; + /* + * Process exit code + */ + exitCode: number; + }) => void; + } + + /** + * Window + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. The new window appears in the same process as the parent window. + */ + interface OpenFinWindow { + /** + * Class: Window + * + * new Window(options, callbackopt, errorCallbackopt) + * + * Creates a new OpenFin Window + * + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. The new window appears in the same process as the parent window. + * @param {any} options - The options of the window + * @param {Function} [callback] - Called if the window creation was successful + * @param {number} [callback.successObj] - httpResponseCode + */ + new (options: WindowOptions, callback?: (successObj: { httpResponseCode: number }) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; + /** + * Name of window + */ + name: string; + /** + * Returns an instance of the current window. + * @returns {OpenFinWindow} Current window + */ + getCurrent(): OpenFinWindow; + /** + * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). + * @returns {Window} Native window + */ + getNativeWindow(): Window; + /** + * Gets the parent application. + * @returns {OpenFinApplication} Parent application + */ + getParentApplication(): OpenFinApplication; + /** + * Gets the parent window. + */ + getParentWindow(): OpenFinWindow; + /** + * Returns a Window object that wraps an existing window. + */ + wrap(appUuid: string, windowName: string): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener(type: OpenFinWindowEventType, listener: (event: WindowBaseEvent | WindowAuthRequestedEvent | WindowBoundsEvent | WindowExternalProcessStartedEvent | WindowExternalProcessExited | WindowGroupChangedEvent | WindowHiddenEvent | Window_NavigationRejectedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Performs the specified window transitions + */ + animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Provides credentials to authentication requests + */ + authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes focus from the window. + */ + blur(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Brings the window to the front of the OpenFin window stack. + */ + bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the window. + * @param {force} Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Prevents a user from changing a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-disabled' is generated when an enabled frame becomes disabled. + */ + disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Re-enables user changes to a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-enabled' is generated when a disabled frame has becomes enabled. + */ + enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Flashes the window’s frame and taskbar icon until the window is activated. + */ + flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gives focus to the window. + */ + focus(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current bounds (top, left, width, height) of the window. + */ + getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. Please note that calling window is included in the result array. + */ + getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current settings of the window. + */ + getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets a base64 encoded PNG snapshot of the window. + */ + getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current state ("minimized", "maximized", or "restored") of the window. + */ + getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the zoom level of the window. + */ + getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; + /** + * Hides the window. + */ + hide(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the window is currently showing. + */ + isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Joins the same window group as the specified window. + */ + joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Leaves the current window group so that the window can be move independently of those in the group. + */ + leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Maximizes the window. + */ + maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Merges the instance's window group with the same window group as the specified window + */ + mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Minimizes the window. + */ + minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window by a specified amount. + */ + moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window to a specified location. + */ + moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener(type: OpenFinWindowEventType, listener: (event: WindowBaseEvent | WindowAuthRequestedEvent | WindowBoundsEvent | WindowExternalProcessStartedEvent | WindowExternalProcessExited | WindowGroupChangedEvent | WindowHiddenEvent | Window_NavigationRejectedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restores the window to its normal state (i.e., unminimized, unmaximized). + */ + restore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Will bring the window to the front of the entire stack and give it focus. + */ + setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the window's size and position + */ + setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the zoom level of the window. + */ + setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden. + * @param {force} Show will be prevented from closing when force is false and ‘show-requested’ has been subscribed to for application’s main window. + */ + show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. + */ + showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Stops the taskbar icon from flashing. + */ + stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Updates the window using the passed options + */ + updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ApplicationBaseEvent { + topic: string; + type: OpenFinApplicationEventType; + uuid: string; + } + + interface TrayIconClickedEvent extends ApplicationBaseEvent { + button: number; // 0 for left, 1 for middle, 2 for right + monitorInfo: MonitorInfo; + x: number; // the cursor x coordinate + y: number; // the cursor y coordinate + } + + interface WindowEvent extends ApplicationBaseEvent { + name: string; + } + + interface WindowAlertRequestedEvent extends WindowEvent { + message: string; + url: string; + } + + interface WindowAuthRequested extends WindowEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowNavigationRejectedEvent extends WindowEvent { + sourceName: string; + url: string; + } + + interface WindowEndLoadEvent extends WindowEvent { + documentName: string; + isMain: boolean; + } + + interface MonitorInfoChangedEvent extends MonitorInfo { + topic: "system"; + type: "monitor-info-changed"; + } + + interface MonitorInfo { + nonPrimaryMonitors: MonitorInfoDetail[]; + primaryMonitor: MonitorInfoDetail; + reason: string; + taskbar: { + edge: "left" | "right" | "top" | "bottom", + rect: MontiorCoordinates + }; + topic: "system"; + type: "monitor-info-changed"; + virtualScreen: MontiorCoordinates; + } + + interface MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } + + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } + + interface VirtualScreenCoordinates { + left: number; + top: number; + } + + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } + + interface DesktopIconClickedEvent { + mouse: { + /** + * the left virtual screen coordinate of the mouse + */ + left: number, + /** + * the top virtual screen coordinate of the mouse + */ + top: number + }; + /** + * the number of milliseconds that have elapsed since the system was started, + */ + tickCount: number; + topic: "system"; + type: "desktop-icon-clicked"; + } + + interface IdleStateChangedEvent { + /** + * How long in milliseconds since the user has been idle. + */ + elapsedTime: number; + /** + * true when the user is idle,false when the user has returned; + */ + isIdle: boolean; + topic: "system"; + type: "idle-state-changed"; + } + + interface WindowBaseEvent { + /** + * the name of the window + */ + name: string; + /** + * always window + */ + topic: "window"; + /** + * window event type + */ + type: OpenFinWindowEventType; + /** + * the UUID of the application the window belongs to + */ + uuid: string; + } + + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowBoundsEvent extends WindowBaseEvent { + /** + * describes what kind of change occurred. + * 0 means a change in position. + * 1 means a change in size. + * 2 means a change in position and size. + */ + changeType: number; + /** + * true when pending changes have been applied to the window. + */ + deferred: boolean; + /** + * the new height of the window. + */ + height: number; + /** + * the left-most coordinate of the window. + */ + left: number; + /** + * the top-most coordinate of the window. + */ + top: number; + /** + * + */ + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } + + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } + + interface WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } + + interface WindowGroupChangedEvent extends WindowBaseEvent { + /** + * Which group array the window that the event listener was registered on is included in: + * 'source' The window is included in sourceGroup. + * 'target' The window is included in targetGroup. + * 'nothing' The window is not included in sourceGroup nor targetGroup. + */ + memberOf: "source" | "target" | "nothing"; + /** + * The reason this event was triggered. + * 'leave' A window has left the group due to a leave or merge with group. + * 'join' A window has joined the group. + * 'merge' Two groups have been merged together. + * 'disband' There are no other windows in the group. + */ + reason: "leave" | "join" | "merge" | "disband"; + /** + * All the windows in the group the sourceWindow originated from. + */ + sourceGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. + */ + sourceWindowAppUuid: string; + /** + * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. + */ + sourceWindowName: string; + /** + * All the windows in the group the targetWindow orginated from + */ + targetGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowAppUuid: string; + /** + * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowName: string; + type: "group-changed"; + } + + interface WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } + + interface WindowHiddenEvent extends WindowBaseEvent { + /** + * What action prompted the close. + * The reasons are: "hide", "hide-on-close" + */ + reason: "hide" | "hide-on-close"; + type: "hidden"; + } + + interface Window_NavigationRejectedEvent { + name: string; + /** + * source of navigation window name + */ + sourceName: string; + topic: "navigation-rejected"; + /** + * Url that was not reached "http://blocked-content.url" + */ + url: string; + /** + * the UUID of the application the window belongs to. + */ + uuid: string; + } + + interface AnimationTransition { + opacity?: { + /** + * This value is clamped from 0.0 to 1.0 + */ + opacity: number; + /** + * The total time in milliseconds this transition should take. + */ + duration: number; + /** + * Treat 'opacity' as absolute or as a delta. Defaults to false. + */ + relative?: boolean; + }; + position?: { + /** + * Defaults to the window's current left position in virtual screen coordinates. + */ + left?: number; + /** + * Defaults to the window's current top position in virtual screen coordinates. + */ + top?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration: number; + /** + * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + size?: { + /** + * Optional if height is present. Defaults to the window's current width. + */ + width?: number; + /** + * Optional if width is present. Defaults to the window's current height. + */ + height?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration: number; + /** + * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + } + + interface AnimationOptions { + /** + * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. + */ + interrupt?: boolean; + /** + * Transition effect. Defaults to 'ease-in-out'. + */ + tween?: OpenFinTweenType; + } + + interface WindowBounds { + /** + * the height of the window. + */ + height: number; + /** + * left-most coordinate of the window. + */ + left: number; + /** + * top-most coordinate of the window. + */ + top: number; + /** + * the width of the window. + */ + width: number; + } + + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } + + type OpenFinTweenType = "linear" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-out-bounce" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-elastic" + | "ease-out-elastic" + | "ease-in-out-elastic"; + + type OpenFinApplicationEventType = "closed" + | "connected" + | "crashed" + | "initialized" + | "manifest-changed" + | "not-responding" + | "out-of-memory" + | "responding" + | "run-requested" + | "started" + | "tray-icon-clicked" + | "window-alert-requested" + | "window-auth-requested" + | "window-closed" + | "window-created" + | "window-end-load" + | "window-navigation-rejected" + | "window-show-requested" + | "window-start-load"; + + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; + + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; + + type OpenFinWindowEventType = "auth-requested" + | "blurred" + | "bounds-changed" + | "bounds-changing" + | "close-requested" + | "closed" + | "disabled-frame-bounds-changed" + | "disabled-frame-bounds-changing" + | "embedded" + | "external-process-exited" + | "external-process-started" + | "focused" + | "frame-disabled" + | "frame-enabled" + | "group-changed" + | "hidden" + | "initialized" + | "maximized" + | "minimized" + | "navigation-rejected" + | "restored" + | "show-requested" + | "shown"; + + type OpenFinAnchor = "top-left" + | "top-right" + | "bottom-left" + | "bottom-right"; +} \ No newline at end of file diff --git a/openfin/openfin-tests.ts b/openfin/openfin-tests.ts new file mode 100644 index 0000000000..7aa2930089 --- /dev/null +++ b/openfin/openfin-tests.ts @@ -0,0 +1,718 @@ + +function test_application() { + let application: fin.OpenFinApplication; + // constructor + application = new fin.desktop.Application({ + url: "application.html", + uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", + name: "Application Name", + mainWindowOptions: { + defaultHeight: 600, + defaultWidth: 800, + defaultTop: 300, + defaultLeft: 300, + autoShow: true + } + }, function (successObj) { + console.log("Application successfully created, HTTP response code:", successObj); + application.run(); + }, function (error) { + console.log("Error creating application:", error); + }); + // getCurrent + application = fin.desktop.Application.getCurrent(); + // wrap + application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); + // getWindow + application.getWindow(); + // addEventListener + application.addEventListener("closed", function (event) { + console.log("The application has closed"); + }, function () { + console.log("The registration was successful"); + }, function (reason) { + console.log("failure: " + reason); + }); + // close + application.close(); + // getChildWindows + application.getChildWindows(function (children) { + children.forEach(function (childWindow) { + console.log("Showing child: " + childWindow.name); + childWindow.show(); + }); + }); + // getGroups + application.getGroups(function (allGroups) { + console.log("There are a total of " + allGroups.length + " groups."); + + var groupCounter = 1; + allGroups.forEach(function (windowGroup) { + console.log("Group " + groupCounter + " contains " + + windowGroup.length + " windows."); + ++groupCounter; + }); + }); + // getManifest + application.getManifest(function (manifest) { + console.log("Application manifest:"); + console.log(manifest); + }); + // getParentUuid + application.getParentUuid(function (parentUuid) { + console.log("UUID of parent application:"); + console.log(parentUuid); + }); + // getShortcuts + application.getShortcuts(function (config) { + console.log("Desktop shortcut is enabled: ", config.desktop); + console.log("Start Menu shortcut is enabled: ", config.startMenu); + console.log("System Startup shortcut is enabled: ", config.systemStartup); + }); + // isRunning + application.isRunning(function (running) { + console.log("the application is", running ? "running" : "not running"); + }); + // registerCustomData + application.registerCustomData({ + someData: "this is custom" + }, function () { + console.log("You will not read this."); + }, function (err) { + console.log("failure:", err); + }); + // removeEventListener + let previousCallback = function (event: fin.WindowEvent) { }; + application.removeEventListener("closed", previousCallback, function () { + console.log("The unregistration was successful"); + }, function (err) { + console.log("failure:", err); + }); + // removeTrayIcon + application.removeTrayIcon(function () { + console.log("Removed the tray icon."); + }, function (err) { + console.log("failure:", err); + }); + // restart + application.restart(function () { + console.log("You will not read this."); + }, function (err) { + console.log("failure:", err); + }); + // schedule restart + application.scheduleRestart(function () { + console.log("You will not read this."); + }, function (err) { + console.log("failure:", err); + }); + // setShortcuts + application.setShortcuts({ + desktop: true, + startMenu: false, + systemStartup: true + }, function () { + console.log("Successfully set new shortcut states"); + }, function (error) { + console.log("Failed to set new shortcut states. Error: ", error); + }); + // setTrayIcon + application.setTrayIcon("https://developer.openf.in/download/openfin.png", function (clickInfo) { + console.log("The mouse has clicked at (" + clickInfo.x + "," + clickInfo.y + ")"); + }); + // terminate + application.terminate(); + // wait + application.addEventListener("not-responding", function () { + console.log("waiting for hung application"); + application.wait(); + }); +} + +function test_external_application() { + let externalApp: fin.OpenFinExternalApplication; + // wrap + externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); + // addEventListener + externalApp.addEventListener('connected', () => { + console.log('external app connected'); + }, () => { + console.log('The registration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + // removeEventListener + let previousCallback = function () { }; + externalApp.removeEventListener('connected', previousCallback, () => { + console.log('The unregistration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); +} + +function test_inter_application_bus() { + // addSubscribeListener + fin.desktop.InterApplicationBus.addSubscribeListener(function (uuid, topic, name) { + console.log("The application " + uuid + " has subscribed to " + topic); + }); + // addUnsubscribeListener + fin.desktop.InterApplicationBus.addUnsubscribeListener(function (uuid, topic, name) { + console.log("The application " + uuid + " has unsubscribed to " + topic); + }); + // removeSubscribeListener + let aRegisteredListener = function (uuid: string, topic: string, name: string) { }; + fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); + // removeUnsubscribeListener + fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); + // publish + fin.desktop.InterApplicationBus.publish("a topic", { + field1: "value1", + field2: "value2" + }); + // send + fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { + field1: "value1", + field2: "value2" + }); + // subscribe + fin.desktop.InterApplicationBus.subscribe("*", "a topic", function (message, uuid, name) { + console.log("The application " + uuid + " sent this message: " + message); + }); + // unsubscribe + let aRegisteredMessageListener = function (message: any, senderUuid: string) { + console.log(message, senderUuid); + }; + fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); +} + +function test_notification() { + let notification: fin.OpenFinNotification; + // getCurrent + notification = fin.desktop.Notification.getCurrent(); + // close + notification.close(); + // sendMessage + notification = new fin.desktop.Notification({ + duration: 10, + url: "http://localhost:5000/Account/Register", + message: "Hello", + onShow: () => { }, + //onClose: () => { }, + onDismiss: () => { }, + //onClick: () => { }, + onMessage: () => { }, + onError: () => { } + }); + // sendMessageToApplication + notification.sendMessageToApplication("some message"); +} + +function test_system() { + // addEventListener + fin.desktop.System.addEventListener('monitor-info-changed', function (event) { + console.log("The monitor information has changed to: ", event); + }, function () { + console.log("The registration was successful"); + }, function (err) { + console.log("failure: " + err); + }); + // clearCache + fin.desktop.System.clearCache({ + cache: true, + cookies: true, + localStorage: true, + appcache: true, + userData: true + }); + // deleteCacheOnExit + fin.desktop.System.deleteCacheOnExit(function () { + console.log("successful"); + }, function (err) { + console.log("failure: " + err); + }); + // downloadAsset + let dirAppAsset = { + 'src': 'http://local:8000/dir.zip', + 'alias': 'dirApp', + 'version': '1.23.24', + 'target': 'dir.bat', + 'args': '' + }; + fin.desktop.System.downloadAsset(dirAppAsset, progress => { + let downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); + console.log(`Downloaded ${downloadedPercent}%`); + }, p => { + console.log(`Downlod complete, can be found on ${p.path}`); + //lets launch our application asset. + //launchDirApp(); + }, (reason, err) => { + console.log(reason, err); + }); + // exit + fin.desktop.System.exit(function () { + console.log("successful"); + }, function (err) { + console.log("failure: " + err); + }); + // getAllApplications + fin.desktop.System.getAllApplications(function (applicationInfoList) { + applicationInfoList.forEach(function (applicationInfo) { + console.log("Showing information for application with uuid: " + + applicationInfo.uuid); + console.log("isRunning: ", applicationInfo.isRunning); + }); + }); + // getAllExternalApplications + fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { + externalAppsInfoList.forEach(appInfo => { + console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); + }); + }); + // getAllWindows + fin.desktop.System.getAllWindows(function (windowInfoList) { + windowInfoList.forEach(function (windowInfo) { + console.log("Showing information for application with uuid: ", windowInfo.uuid); + console.log("Main window: ", windowInfo.mainWindow); + console.log("Child windows: ", windowInfo.childWindows); + }); + }); + // getCommandLineArguments + fin.desktop.System.getCommandLineArguments(function (args) { + console.log("The command line arguments are " + args); + }); + // getDeviceId + fin.desktop.System.getDeviceId(function (id) { + console.log("The id of the device is: " + id); + }); + // getEnvironmentVariable + fin.desktop.System.getEnvironmentVariable("APPDATA", function (variable) { + console.log("this is the APPDATA value", variable); + }); + // getLog + fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', function (log) { + console.log(log); + }); + // getLogList + fin.desktop.System.getLogList(function (logList) { + logList.forEach(function (logInfo) { + console.log("The filename of the log is " + + logInfo.name + ", the size is " + + logInfo.size + ", and the date of creation is " + + logInfo.date); + }); + }); + // getMonitorInfo + fin.desktop.System.getMonitorInfo(function (monitorInfo) { + console.log("This object contains information about all monitors: ", monitorInfo); + }); + // getMousePosition + fin.desktop.System.getMousePosition(function (mousePosition) { + console.log("The mouse is located at left: " + mousePosition.left + ", top: " + mousePosition.top); + }); + // getProcessList + fin.desktop.System.getProcessList(function (list) { + list.forEach(function (process) { + console.log("UUID: " + process.uuid + ", Application Name: " + process.name); + }); + }); + // getProxySettings + fin.desktop.System.getProxySettings(function (proxy) { + console.log(proxy); + }); + // getRvmInfo + fin.desktop.System.getRvmInfo(function (rvmInfoObject) { + console.log("RVM version:", rvmInfoObject.version); + console.log("RVM has been running since:", rvmInfoObject["start-time"]); + }, function (err) { + console.log("Failed to get rvm info, error message:", err); + }); + // getVersion + fin.desktop.System.getVersion(function (version) { + console.log("The version is " + version); + }); + // launchExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener: function (result) { + console.log('the exit code', result.exitCode); + } + }, function (payload) { + console.log('Success:', payload.uuid); + }, function (error) { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + //Additionally note that the executable found in the zip file specified in appAssets + //will default to the one mentioned by appAssets.target + //If the the path below refers to a specific path it will override this default + alias: "myApp", + listener: function (result) { + console.log('the exit code', result.exitCode); + } + }, function (payload) { + console.log('Success:', payload.uuid); + }, function (error) { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + alias: "myApp", + arguments: "e f g", + listener: function (result) { + console.log('the exit code', result.exitCode); + } + }, function (payload) { + console.log('Success:', payload.uuid); + }, function (error) { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", + arguments: "--version", + certificate: { + trusted: true, + subject: 'O=OpenFin INC., L=New York, S=NY, C=US', + thumbprint: '‎3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' + }, + listener: function (result) { + console.log('the exit code', result.exitCode); + } + }, function (payload) { + console.log('Success:', payload.uuid); + }, function (error) { + console.log('Error:', error); + }); + // log + fin.desktop.System.log("info", "An example log message", function () { + console.log("message successfully logged"); + }, function (err) { + console.log(err); + }); + // monitorExternalProcess + fin.desktop.System.monitorExternalProcess({ + pid: 2508, + listener: function (result) { + console.log('the exit code', result.exitCode); + } + }, function (payload) { + console.log("The process is now being monitored: ", payload.uuid); + }, function (error) { + console.log("Error:", error); + }); + // openUrlWithBrowser + fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", function () { + console.log("successful"); + }, function (err) { + console.log("failure: " + err); + }); + // registerExternalConnection + fin.desktop.System.registerExternalConnection("remote-connection-uuid", function () { + console.log(arguments); + }); + // releaseExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener: function (result) { + console.log("The exit code", result.exitCode); + } + }, function (result) { + console.log("Result UUID is " + result.uuid); + + //release it. + fin.desktop.System.releaseExternalProcess(result.uuid, function () { + console.log("Process has been unmapped!"); + }, function (reason) { + console.log("failure: " + reason); + }); + }); + // removeEventListener + let aRegisteredListener = (event: fin.SystemBaseEvent) => { }; + fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, function () { + console.log("successful"); + }, function (err) { + console.log("failure: " + err); + }); + // showDeveloperTools + fin.desktop.System.showDeveloperTools("uuid", "name", function () { + console.log("successful"); + }, function (err) { + console.log("failure: " + err); + }); + // terminateExternalProcess + fin.desktop.System.launchExternalProcess({ + // notepad is in the system’s PATH + path: "notepad", + arguments: "", + listener: function (result) { + console.log("The exit code", result.exitCode); + } + }, function (result) { + console.log("Result UUID is " + result.uuid); + + // Attempt to close the process. Terminate after 4 seconds if it + // has not done so. + fin.desktop.System.terminateExternalProcess(result.uuid, 4000, function (info) { + console.log("Termination result " + info.result); + }, function (reason) { + console.log("failure: " + reason); + }); + }); + // updateProxySettings + fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, function () { + console.log('success'); + }, function (err) { + console.log(err); + }); +} + +function test_system_clipboard() { + // availableFormats + fin.desktop.System.Clipboard.availableFormats(null, formats => { + formats.forEach(format => console.log(`The format ${format} is available to read`)); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readHtml + fin.desktop.System.Clipboard.readHtml(null, html => { + console.log(`This is the html from the clipboard: ${html}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readRtf + fin.desktop.System.Clipboard.readRtf(null, rtf => { + console.log(`This is the rtf from the clipboard: ${rtf}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readText + fin.desktop.System.Clipboard.readText(null, text => { + console.log(`This is the text from the clipboard: ${text}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // write + fin.desktop.System.Clipboard.write({ + text: 'Hello Text!', + html: '

Hello Html

', + rtf: 'Hello Rtf' + }, null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeHtml + fin.desktop.System.Clipboard.writeHtml('

Hello World

', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeRtf + fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeText + fin.desktop.System.Clipboard.writeText('Hello World', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); +} + +function test_window() { + let finWindow: fin.OpenFinWindow; + // constructor + finWindow = new fin.desktop.Window({ + name: "childWindow", + url: "child.html", + defaultWidth: 320, + defaultHeight: 320, + defaultTop: 10, + defaultLeft: 300, + frame: false, + resizable: false, + state: "normal" + }, function () { + var _win = finWindow.getNativeWindow(); + _win.addEventListener("DOMContentLoaded", function () { finWindow.show(); }); + }, function (error) { + console.log("Error creating window:", error); + }); + // getCurrent + finWindow = fin.desktop.Window.getCurrent(); + // getNativeWindow + let nativeWindow: Window; + nativeWindow = finWindow.getNativeWindow(); + // getParentApplication + let parentApp: fin.OpenFinApplication; + parentApp = finWindow.getParentApplication(); + // getParentWindow + let parentFinWindow: fin.OpenFinWindow; + parentFinWindow = finWindow.getParentWindow(); + // wrap + finWindow = fin.desktop.Window.wrap("uuid", "name"); + // addEventListener + finWindow.addEventListener("bounds-changed", function (event) { + console.log("The window has been moved or resized"); + }, function () { + console.log("The registration was successful"); + }, function (reason) { + console.log("failure:" + reason); + }); + // animate + finWindow.animate({ + opacity: { + opacity: 0.15, + duration: 1000 + }, + position: { + left: 10, + top: 10, + duration: 3000 + } + }, { + interrupt: false + }, function (evt) { + // Callback will only fire after both "opacity" and "position" have finished animating. + }); + // authenticate + finWindow.addEventListener('auth-requested', evt => { + finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { + console.log("failure:", err); + }); + }); + // blur + finWindow.blur(); + // bringToFront + finWindow.bringToFront(); + // close + finWindow.close(); + // disableFrame + finWindow.disableFrame(); + // enableFrame + finWindow.enableFrame(); + // flash + finWindow.flash(); + // focus + finWindow.focus(); + // getBounds + finWindow.getBounds(function (bounds) { + console.log("top: " + bounds.top + + "left: " + bounds.left + + "height: " + bounds.height + + "width: " + bounds.width); + }); + // getOptions + finWindow.getOptions(function (options) { + console.log(options); + }); + // getSnapshot + finWindow.getSnapshot(function (base64Snapshot) { + console.log("data:image/png;base64," + base64Snapshot); + }); + // getState + finWindow.getState(function (state) { + console.log("state: " + state); + }); + // getZoomLevel + finWindow.getZoomLevel(function (level) { + console.log("zoom level: " + level); + }, function (error) { + console.log('error:', error); + }); + // hide + finWindow.hide(); + // isShowing + finWindow.isShowing(function (showing) { + console.log("the window is " + (showing ? "showing" : "hidden")); + }); + // joinGroup + let secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, function () { + // When mainWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow); + }); + // leaveGroup + secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, function () { + // When finWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow, function () { + //once we are in the group, lets leave it. + secondWindow.leaveGroup(); + }); + }); + // maximize + finWindow.maximize(); + // mergeGroups + { + let finWindowOne = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowOne", + autoShow: true + }); + let finWindowTwo = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowTwo", + autoShow: true + }); + let finWindowThree = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowThree", + autoShow: true + }); + let finWindowFour = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowFour", + autoShow: true + }); + // When finWindowOne moves or is moved, finWindowTwo moves by the same amount + finWindowOne.joinGroup(finWindowTwo); + // When finWindowThree moves or is moved, finWindowFour moves by the same amount + finWindowThree.joinGroup(finWindowFour); + // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group + finWindowOne.mergeGroups(finWindowThree); + } + // minimize + finWindow.minimize(); + // moveBy + finWindow.moveBy(10, 10); + // moveTo + finWindow.moveTo(100, 200); + // removeEventListener + let aRegisteredListener = (event: fin.WindowBaseEvent) => { }; + finWindow.removeEventListener("bounds-changed", aRegisteredListener); + // resizeBy + finWindow.resizeBy(10, 10, "top-right"); + // resizeTo + finWindow.resizeTo(10, 10, "top-right"); + // restore + finWindow.restore(); + // setAsForeground + finWindow.setAsForeground(); + // setBounds + finWindow.setBounds(100, 200, 400, 400); + // setZoomLevel + finWindow.setZoomLevel(10); + // show + finWindow.show(); + // showAt + finWindow.showAt(10, 10, false); + // stopFlashing + finWindow.stopFlashing(); + // updateOptions + finWindow.updateOptions({ + frame: false, + maxWidth: 500 + }); +} \ No newline at end of file diff --git a/openfin/tsconfig.json b/openfin/tsconfig.json new file mode 100644 index 0000000000..8785bdb90f --- /dev/null +++ b/openfin/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", + "openfin-tests.ts" + ] +} diff --git a/openfin/tslint.json b/openfin/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/openfin/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 8a2cb9b0377b5d56d6b6a8d0ed6f948dd24697c5 Mon Sep 17 00:00:00 2001 From: Tsvetomir Tsonev Date: Fri, 20 Jan 2017 13:04:03 +0200 Subject: [PATCH 015/797] feat: upgrade Kendo UI definitions to 2017.1.118 --- kendo-ui/index.d.ts | 1428 ++++++++++++++++++++++++------------------- 1 file changed, 808 insertions(+), 620 deletions(-) diff --git a/kendo-ui/index.d.ts b/kendo-ui/index.d.ts index 5d6e4ec0a8..4665502af3 100644 --- a/kendo-ui/index.d.ts +++ b/kendo-ui/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Kendo UI Professional v2016.3.1029 +// Type definitions for Kendo UI Professional v2017.1.118 // Project: http://www.telerik.com/kendo-ui // Definitions by: Telerik // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -678,8 +678,8 @@ declare namespace kendo.data { static fields: DataSourceSchemaModelFields; id: any; - predecessorId: any; - successorId: any; + predecessorId: number; + successorId: number; type: number; static define(options: DataSourceSchemaModelWithFieldsObject): typeof GanttDependency; @@ -1135,7 +1135,7 @@ declare namespace kendo.data { interface DataSourceFilters extends DataSourceFilter { logic?: string; - filters?: DataSourceFilter[]; + filters?: DataSourceFilter[]; } interface DataSourceGroupItemAggregate { @@ -1656,6 +1656,7 @@ declare namespace kendo.ui { interface AutoCompleteOptions { name?: string; animation?: boolean|AutoCompleteAnimation; + autoWidth?: boolean; dataSource?: any|any|kendo.data.DataSource; clearButton?: boolean; dataTextField?: string; @@ -1790,6 +1791,7 @@ declare namespace kendo.ui { interface CalendarMonth { content?: string; + weekNumber?: string; empty?: string; } @@ -1804,6 +1806,7 @@ declare namespace kendo.ui { max?: Date; min?: Date; month?: CalendarMonth; + weekNumber?: boolean; start?: string; value?: Date; change?(e: CalendarEvent): void; @@ -1898,6 +1901,7 @@ declare namespace kendo.ui { interface ColorPickerOptions { name?: string; buttons?: boolean; + clearButton?: boolean; columns?: number; tileSize?: ColorPickerTileSize; messages?: ColorPickerMessages; @@ -2000,6 +2004,7 @@ declare namespace kendo.ui { name?: string; animation?: ComboBoxAnimation; autoBind?: boolean; + autoWidth?: boolean; cascadeFrom?: string; cascadeFromField?: string; clearButton?: boolean; @@ -2022,6 +2027,7 @@ declare namespace kendo.ui { placeholder?: string; popup?: ComboBoxPopup; suggest?: boolean; + syncValueAndText?: boolean; headerTemplate?: string|Function; template?: string|Function; text?: string; @@ -2159,6 +2165,7 @@ declare namespace kendo.ui { name?: string; alignToAnchor?: boolean; animation?: boolean|ContextMenuAnimation; + appendTo?: string|JQuery; closeOnClick?: boolean; dataSource?: any|any; direction?: string; @@ -2263,6 +2270,7 @@ declare namespace kendo.ui { interface DatePickerMonth { content?: string; + weekNumber?: string; empty?: string; } @@ -2279,6 +2287,7 @@ declare namespace kendo.ui { max?: Date; min?: Date; month?: DatePickerMonth; + weekNumber?: boolean; parseFormats?: any; start?: string; value?: Date; @@ -2353,6 +2362,7 @@ declare namespace kendo.ui { interface DateTimePickerMonth { content?: string; + weekNumber?: string; empty?: string; } @@ -2370,6 +2380,7 @@ declare namespace kendo.ui { max?: Date; min?: Date; month?: DateTimePickerMonth; + weekNumber?: boolean; parseFormats?: any; start?: string; timeFormat?: string; @@ -2558,6 +2569,7 @@ declare namespace kendo.ui { name?: string; animation?: boolean|DropDownListAnimation; autoBind?: boolean; + autoWidth?: boolean; cascadeFrom?: string; cascadeFromField?: string; dataSource?: any|any|kendo.data.DataSource; @@ -2986,6 +2998,7 @@ declare namespace kendo.ui { tooltip?: string; exec?: Function; items?: EditorToolItem[]; + palette?: string|any; template?: string; } @@ -3065,6 +3078,9 @@ declare namespace kendo.ui { clear?: string; filter?: string; info?: string; + additionalValue?: string; + additionalOperator?: string; + logic?: string; isFalse?: string; isTrue?: string; or?: string; @@ -3625,6 +3641,7 @@ declare namespace kendo.ui { } interface GridColumnCommandItem { + visible?: Function; name?: string; text?: GridColumnCommandItemText; className?: string; @@ -3659,6 +3676,7 @@ declare namespace kendo.ui { interface GridColumnSortable { compare?: Function; + initialDirection?: string; } interface GridColumn { @@ -3666,6 +3684,7 @@ declare namespace kendo.ui { attributes?: any; columns?: any; command?: GridColumnCommandItem[]; + editable?: Function; encoded?: boolean; field?: string; filterable?: boolean|GridColumnFilterable; @@ -3680,6 +3699,7 @@ declare namespace kendo.ui { hidden?: boolean; locked?: boolean; lockable?: boolean; + minResizableWidth?: number; minScreenWidth?: number; sortable?: boolean|GridColumnSortable; template?: string|Function; @@ -3779,8 +3799,8 @@ declare namespace kendo.ui { interface GridFilterable { extra?: boolean; messages?: GridFilterableMessages; - operators?: GridFilterableOperators; mode?: string; + operators?: GridFilterableOperators; } interface GridGroupableMessages { @@ -3873,6 +3893,7 @@ declare namespace kendo.ui { interface GridSortable { allowUnsort?: boolean; + initialDirection?: string; mode?: string; } @@ -4428,6 +4449,7 @@ declare namespace kendo.ui { animation?: boolean|MultiSelectAnimation; autoBind?: boolean; autoClose?: boolean; + autoWidth?: boolean; clearButton?: boolean; dataSource?: any|any|kendo.data.DataSource; dataTextField?: string; @@ -4797,15 +4819,30 @@ declare namespace kendo.ui { expand?: PanelBarAnimationExpand; } + interface PanelBarMessages { + loading?: string; + requestFailed?: string; + retry?: string; + } + interface PanelBarOptions { name?: string; animation?: boolean|PanelBarAnimation; + autoBind?: boolean; contentUrls?: any; - dataSource?: any|any; + dataImageUrlField?: string; + dataSource?: any|any|kendo.data.HierarchicalDataSource; + dataSpriteCssClassField?: string; + dataTextField?: string|any; + dataUrlField?: string; expandMode?: string; + loadOnDemand?: boolean; + messages?: PanelBarMessages; + template?: string|Function; activate?(e: PanelBarActivateEvent): void; collapse?(e: PanelBarCollapseEvent): void; contentLoad?(e: PanelBarContentLoadEvent): void; + dataBound?(e: PanelBarDataBoundEvent): void; error?(e: PanelBarErrorEvent): void; expand?(e: PanelBarExpandEvent): void; select?(e: PanelBarSelectEvent): void; @@ -4829,6 +4866,10 @@ declare namespace kendo.ui { contentElement?: Element; } + interface PanelBarDataBoundEvent extends PanelBarEvent { + node?: JQuery; + } + interface PanelBarErrorEvent extends PanelBarEvent { xhr?: JQueryXHR; status?: string; @@ -5629,6 +5670,7 @@ declare namespace kendo.ui { eventTemplate?: string|Function; footer?: boolean|SchedulerFooter; group?: SchedulerGroup; + groupHeaderTemplate?: string|Function; height?: number|string; majorTick?: number; majorTimeHeaderTemplate?: string|Function; @@ -5647,7 +5689,6 @@ declare namespace kendo.ui { timezone?: string; toolbar?: SchedulerToolbarItem[]; views?: SchedulerView[]; - groupHeaderTemplate?: string|Function; width?: number|string; workDayStart?: Date; workDayEnd?: Date; @@ -6021,6 +6062,9 @@ declare namespace kendo.ui { activeSheet(): kendo.spreadsheet.Sheet; activeSheet(sheet?: kendo.spreadsheet.Sheet): void; + cellContextMenu(): kendo.ui.ContextMenu; + rowHeaderContextMenu(): kendo.ui.ContextMenu; + colHeaderContextMenu(): kendo.ui.ContextMenu; sheets(): any; fromFile(blob: Blob): JQueryPromise; fromFile(blob: File): JQueryPromise; @@ -6040,6 +6084,17 @@ declare namespace kendo.ui { } + interface SpreadsheetDefaultCellStyle { + background?: string; + color?: string; + fontFamily?: string; + fontSize?: string; + Italic?: boolean; + bold?: boolean; + underline?: boolean; + wrap?: boolean; + } + interface SpreadsheetExcel { fileName?: string; forceProxy?: boolean; @@ -6209,6 +6264,7 @@ declare namespace kendo.ui { activeSheet?: string; columnWidth?: number; columns?: number; + defaultCellStyle?: SpreadsheetDefaultCellStyle; headerHeight?: number; headerWidth?: number; excel?: SpreadsheetExcel; @@ -6218,6 +6274,20 @@ declare namespace kendo.ui { sheets?: SpreadsheetSheet[]; sheetsbar?: boolean; toolbar?: boolean|SpreadsheetToolbar; + insertSheet?(e: SpreadsheetInsertSheetEvent): void; + removeSheet?(e: SpreadsheetRemoveSheetEvent): void; + renameSheet?(e: SpreadsheetRenameSheetEvent): void; + selectSheet?(e: SpreadsheetSelectSheetEvent): void; + unhideColumn?(e: SpreadsheetUnhideColumnEvent): void; + unhideRow?(e: SpreadsheetUnhideRowEvent): void; + hideColumn?(e: SpreadsheetHideColumnEvent): void; + hideRow?(e: SpreadsheetHideRowEvent): void; + deleteColumn?(e: SpreadsheetDeleteColumnEvent): void; + deleteRow?(e: SpreadsheetDeleteRowEvent): void; + insertColumn?(e: SpreadsheetInsertColumnEvent): void; + insertRow?(e: SpreadsheetInsertRowEvent): void; + select?(e: SpreadsheetSelectEvent): void; + changeFormat?(e: SpreadsheetChangeFormatEvent): void; change?(e: SpreadsheetChangeEvent): void; render?(e: SpreadsheetRenderEvent): void; excelExport?(e: SpreadsheetExcelExportEvent): void; @@ -6230,6 +6300,70 @@ declare namespace kendo.ui { isDefaultPrevented(): boolean; } + interface SpreadsheetInsertSheetEvent extends SpreadsheetEvent { + } + + interface SpreadsheetRemoveSheetEvent extends SpreadsheetEvent { + sheet?: kendo.spreadsheet.Sheet; + } + + interface SpreadsheetRenameSheetEvent extends SpreadsheetEvent { + sheet?: kendo.spreadsheet.Sheet; + newSheetName?: string; + } + + interface SpreadsheetSelectSheetEvent extends SpreadsheetEvent { + sheet?: kendo.spreadsheet.Sheet; + } + + interface SpreadsheetUnhideColumnEvent extends SpreadsheetEvent { + sheet?: kendo.spreadsheet.Sheet; + index?: number; + } + + interface SpreadsheetUnhideRowEvent extends SpreadsheetEvent { + sheet?: kendo.spreadsheet.Sheet; + index?: number; + } + + interface SpreadsheetHideColumnEvent extends SpreadsheetEvent { + sheet?: kendo.spreadsheet.Sheet; + index?: number; + } + + interface SpreadsheetHideRowEvent extends SpreadsheetEvent { + sheet?: kendo.spreadsheet.Sheet; + index?: number; + } + + interface SpreadsheetDeleteColumnEvent extends SpreadsheetEvent { + sheet?: kendo.spreadsheet.Sheet; + index?: number; + } + + interface SpreadsheetDeleteRowEvent extends SpreadsheetEvent { + sheet?: kendo.spreadsheet.Sheet; + index?: number; + } + + interface SpreadsheetInsertColumnEvent extends SpreadsheetEvent { + sheet?: kendo.spreadsheet.Sheet; + index?: number; + } + + interface SpreadsheetInsertRowEvent extends SpreadsheetEvent { + sheet?: kendo.spreadsheet.Sheet; + index?: number; + } + + interface SpreadsheetSelectEvent extends SpreadsheetEvent { + range?: kendo.spreadsheet.Range; + } + + interface SpreadsheetChangeFormatEvent extends SpreadsheetEvent { + range?: kendo.spreadsheet.Range; + } + interface SpreadsheetChangeEvent extends SpreadsheetEvent { range?: kendo.spreadsheet.Range; } @@ -6616,6 +6750,7 @@ declare namespace kendo.ui { options: TooltipOptions; + popup: kendo.ui.Popup; element: JQuery; wrapper: JQuery; @@ -6774,6 +6909,7 @@ declare namespace kendo.ui { interface TouchSwipeEvent extends TouchEvent { touch?: kendo.mobile.ui.TouchEventOptions; event?: JQueryEventObject; + direction?: string; } interface TouchGesturestartEvent extends TouchEvent { @@ -6873,6 +7009,7 @@ declare namespace kendo.ui { interface TreeListColumnCommandItem { className?: string; + imageClass?: string; click?: Function; name?: string; text?: string; @@ -7344,15 +7481,16 @@ declare namespace kendo.ui { clearAllFiles(): void; - clearFile(): void; + clearFile(callback: Function): void; clearFileByUid(uid: string): void; destroy(): void; disable(): void; enable(enable?: boolean): void; + focus(): void; getFiles(): any; removeAllFiles(): void; - removeFile(): void; - removeFileByUid(): void; + removeFile(callback: Function): void; + removeFileByUid(uid: string): void; toggle(enable: boolean): void; upload(): void; @@ -7412,6 +7550,7 @@ declare namespace kendo.ui { template?: string|Function; validation?: UploadValidation; cancel?(e: UploadCancelEvent): void; + clear?(e: UploadClearEvent): void; complete?(e: UploadEvent): void; error?(e: UploadErrorEvent): void; progress?(e: UploadProgressEvent): void; @@ -7427,39 +7566,43 @@ declare namespace kendo.ui { } interface UploadCancelEvent extends UploadEvent { - files?: UploadFile[]; + files?: any[]; + } + + interface UploadClearEvent extends UploadEvent { + e?: any; } interface UploadErrorEvent extends UploadEvent { - files?: UploadFile[]; + files?: any[]; operation?: string; XMLHttpRequest?: any; } interface UploadProgressEvent extends UploadEvent { - files?: UploadFile[]; + files?: any[]; percentComplete?: number; } interface UploadRemoveEvent extends UploadEvent { - files?: UploadFile[]; + files?: any[]; data?: any; } interface UploadSelectEvent extends UploadEvent { e?: any; - files?: UploadFile[]; + files?: any[]; } interface UploadSuccessEvent extends UploadEvent { - files?: UploadFile[]; + files?: any[]; operation?: string; response?: any; XMLHttpRequest?: any; } interface UploadUploadEvent extends UploadEvent { - files?: UploadFile[]; + files?: any[]; data?: any; formData?: any; XMLHttpRequest?: any; @@ -7496,6 +7639,7 @@ declare namespace kendo.ui { rules?: any; validateOnBlur?: boolean; validate?(e: ValidatorValidateEvent): void; + validateInput?(e: ValidatorValidateInputEvent): void; } interface ValidatorEvent { sender: Validator; @@ -7507,6 +7651,11 @@ declare namespace kendo.ui { valid?: boolean; } + interface ValidatorValidateInputEvent extends ValidatorEvent { + input?: JQuery; + valid?: boolean; + } + class Window extends kendo.ui.Widget { @@ -7629,6 +7778,274 @@ declare namespace kendo.ui { } +} +declare namespace kendo.geometry { + class Arc extends Observable { + + + options: ArcOptions; + + anticlockwise: boolean; + center: kendo.geometry.Point; + endAngle: number; + radiusX: number; + radiusY: number; + startAngle: number; + + constructor(center: any|kendo.geometry.Point, options?: ArcOptions); + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + getAnticlockwise(): boolean; + getCenter(): kendo.geometry.Point; + getEndAngle(): number; + getRadiusX(): number; + getRadiusY(): number; + getStartAngle(): number; + pointAt(angle: number): kendo.geometry.Point; + setAnticlockwise(value: boolean): kendo.geometry.Arc; + setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; + setEndAngle(value: number): kendo.geometry.Arc; + setRadiusX(value: number): kendo.geometry.Arc; + setRadiusY(value: number): kendo.geometry.Arc; + setStartAngle(value: number): kendo.geometry.Arc; + + } + + interface ArcOptions { + name?: string; + } + interface ArcEvent { + sender: Arc; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Circle extends Observable { + + + options: CircleOptions; + + center: kendo.geometry.Point; + radius: number; + + constructor(center: any|kendo.geometry.Point, radius: number); + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + clone(): kendo.geometry.Circle; + equals(other: kendo.geometry.Circle): boolean; + getCenter(): kendo.geometry.Point; + getRadius(): number; + pointAt(angle: number): kendo.geometry.Point; + setCenter(value: kendo.geometry.Point): kendo.geometry.Point; + setCenter(value: any): kendo.geometry.Point; + setRadius(value: number): kendo.geometry.Circle; + + } + + interface CircleOptions { + name?: string; + } + interface CircleEvent { + sender: Circle; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Matrix extends Observable { + + + options: MatrixOptions; + + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + + + static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; + static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; + static translate(x: number, y: number): kendo.geometry.Matrix; + static unit(): kendo.geometry.Matrix; + + clone(): kendo.geometry.Matrix; + equals(other: kendo.geometry.Matrix): boolean; + round(digits: number): kendo.geometry.Matrix; + multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + + } + + interface MatrixOptions { + name?: string; + } + interface MatrixEvent { + sender: Matrix; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Point extends Observable { + + + options: PointOptions; + + x: number; + y: number; + + constructor(x: number, y: number); + + static create(x: number, y: number): kendo.geometry.Point; + static create(x: any, y: number): kendo.geometry.Point; + static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; + static min(): kendo.geometry.Point; + static max(): kendo.geometry.Point; + static minPoint(): kendo.geometry.Point; + static maxPoint(): kendo.geometry.Point; + + clone(): kendo.geometry.Point; + distanceTo(point: kendo.geometry.Point): number; + equals(other: kendo.geometry.Point): boolean; + getX(): number; + getY(): number; + move(x: number, y: number): kendo.geometry.Point; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; + rotate(angle: number, center: any): kendo.geometry.Point; + round(digits: number): kendo.geometry.Point; + scale(scaleX: number, scaleY: number): kendo.geometry.Point; + scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; + setX(value: number): kendo.geometry.Point; + setY(value: number): kendo.geometry.Point; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + translate(dx: number, dy: number): kendo.geometry.Point; + translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; + translateWith(vector: any): kendo.geometry.Point; + + } + + interface PointOptions { + name?: string; + } + interface PointEvent { + sender: Point; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Rect extends Observable { + + + options: RectOptions; + + origin: kendo.geometry.Point; + size: kendo.geometry.Size; + + constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); + + static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; + static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + bottomLeft(): kendo.geometry.Point; + bottomRight(): kendo.geometry.Point; + center(): kendo.geometry.Point; + clone(): kendo.geometry.Rect; + equals(other: kendo.geometry.Rect): boolean; + getOrigin(): kendo.geometry.Point; + getSize(): kendo.geometry.Size; + height(): number; + setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; + setOrigin(value: any): kendo.geometry.Rect; + setSize(value: kendo.geometry.Size): kendo.geometry.Rect; + setSize(value: any): kendo.geometry.Rect; + topLeft(): kendo.geometry.Point; + topRight(): kendo.geometry.Point; + width(): number; + + } + + interface RectOptions { + name?: string; + } + interface RectEvent { + sender: Rect; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Size extends Observable { + + + options: SizeOptions; + + width: number; + height: number; + + + static create(width: number, height: number): kendo.geometry.Size; + static create(width: any, height: number): kendo.geometry.Size; + static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; + + clone(): kendo.geometry.Size; + equals(other: kendo.geometry.Size): boolean; + getWidth(): number; + getHeight(): number; + setWidth(value: number): kendo.geometry.Size; + setHeight(value: number): kendo.geometry.Size; + + } + + interface SizeOptions { + name?: string; + } + interface SizeEvent { + sender: Size; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Transformation extends Observable { + + + options: TransformationOptions; + + + + + clone(): kendo.geometry.Transformation; + equals(other: kendo.geometry.Transformation): boolean; + matrix(): kendo.geometry.Matrix; + multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; + rotate(angle: number, center: any): kendo.geometry.Transformation; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; + scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; + translate(x: number, y: number): kendo.geometry.Transformation; + + } + + interface TransformationOptions { + name?: string; + } + interface TransformationEvent { + sender: Transformation; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + } declare namespace kendo.drawing { class Arc extends kendo.drawing.Element { @@ -8419,274 +8836,6 @@ declare namespace kendo.drawing { -} -declare namespace kendo.geometry { - class Arc extends Observable { - - - options: ArcOptions; - - anticlockwise: boolean; - center: kendo.geometry.Point; - endAngle: number; - radiusX: number; - radiusY: number; - startAngle: number; - - constructor(center: any|kendo.geometry.Point, options?: ArcOptions); - - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - getAnticlockwise(): boolean; - getCenter(): kendo.geometry.Point; - getEndAngle(): number; - getRadiusX(): number; - getRadiusY(): number; - getStartAngle(): number; - pointAt(angle: number): kendo.geometry.Point; - setAnticlockwise(value: boolean): kendo.geometry.Arc; - setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; - setEndAngle(value: number): kendo.geometry.Arc; - setRadiusX(value: number): kendo.geometry.Arc; - setRadiusY(value: number): kendo.geometry.Arc; - setStartAngle(value: number): kendo.geometry.Arc; - - } - - interface ArcOptions { - name?: string; - } - interface ArcEvent { - sender: Arc; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Circle extends Observable { - - - options: CircleOptions; - - center: kendo.geometry.Point; - radius: number; - - constructor(center: any|kendo.geometry.Point, radius: number); - - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - clone(): kendo.geometry.Circle; - equals(other: kendo.geometry.Circle): boolean; - getCenter(): kendo.geometry.Point; - getRadius(): number; - pointAt(angle: number): kendo.geometry.Point; - setCenter(value: kendo.geometry.Point): kendo.geometry.Point; - setCenter(value: any): kendo.geometry.Point; - setRadius(value: number): kendo.geometry.Circle; - - } - - interface CircleOptions { - name?: string; - } - interface CircleEvent { - sender: Circle; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Matrix extends Observable { - - - options: MatrixOptions; - - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - - - static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; - static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; - static translate(x: number, y: number): kendo.geometry.Matrix; - static unit(): kendo.geometry.Matrix; - - clone(): kendo.geometry.Matrix; - equals(other: kendo.geometry.Matrix): boolean; - round(digits: number): kendo.geometry.Matrix; - multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; - toArray(digits: number): any; - toString(digits?: number, separator?: string): string; - - } - - interface MatrixOptions { - name?: string; - } - interface MatrixEvent { - sender: Matrix; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Point extends Observable { - - - options: PointOptions; - - x: number; - y: number; - - constructor(x: number, y: number); - - static create(x: number, y: number): kendo.geometry.Point; - static create(x: any, y: number): kendo.geometry.Point; - static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; - static min(): kendo.geometry.Point; - static max(): kendo.geometry.Point; - static minPoint(): kendo.geometry.Point; - static maxPoint(): kendo.geometry.Point; - - clone(): kendo.geometry.Point; - distanceTo(point: kendo.geometry.Point): number; - equals(other: kendo.geometry.Point): boolean; - getX(): number; - getY(): number; - move(x: number, y: number): kendo.geometry.Point; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; - rotate(angle: number, center: any): kendo.geometry.Point; - round(digits: number): kendo.geometry.Point; - scale(scaleX: number, scaleY: number): kendo.geometry.Point; - scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; - setX(value: number): kendo.geometry.Point; - setY(value: number): kendo.geometry.Point; - toArray(digits: number): any; - toString(digits?: number, separator?: string): string; - transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - translate(dx: number, dy: number): kendo.geometry.Point; - translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; - translateWith(vector: any): kendo.geometry.Point; - - } - - interface PointOptions { - name?: string; - } - interface PointEvent { - sender: Point; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Rect extends Observable { - - - options: RectOptions; - - origin: kendo.geometry.Point; - size: kendo.geometry.Size; - - constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); - - static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; - static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - bottomLeft(): kendo.geometry.Point; - bottomRight(): kendo.geometry.Point; - center(): kendo.geometry.Point; - clone(): kendo.geometry.Rect; - equals(other: kendo.geometry.Rect): boolean; - getOrigin(): kendo.geometry.Point; - getSize(): kendo.geometry.Size; - height(): number; - setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; - setOrigin(value: any): kendo.geometry.Rect; - setSize(value: kendo.geometry.Size): kendo.geometry.Rect; - setSize(value: any): kendo.geometry.Rect; - topLeft(): kendo.geometry.Point; - topRight(): kendo.geometry.Point; - width(): number; - - } - - interface RectOptions { - name?: string; - } - interface RectEvent { - sender: Rect; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Size extends Observable { - - - options: SizeOptions; - - width: number; - height: number; - - - static create(width: number, height: number): kendo.geometry.Size; - static create(width: any, height: number): kendo.geometry.Size; - static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; - - clone(): kendo.geometry.Size; - equals(other: kendo.geometry.Size): boolean; - getWidth(): number; - getHeight(): number; - setWidth(value: number): kendo.geometry.Size; - setHeight(value: number): kendo.geometry.Size; - - } - - interface SizeOptions { - name?: string; - } - interface SizeEvent { - sender: Size; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Transformation extends Observable { - - - options: TransformationOptions; - - - - - clone(): kendo.geometry.Transformation; - equals(other: kendo.geometry.Transformation): boolean; - matrix(): kendo.geometry.Matrix; - multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; - rotate(angle: number, center: any): kendo.geometry.Transformation; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; - scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; - translate(x: number, y: number): kendo.geometry.Transformation; - - } - - interface TransformationOptions { - name?: string; - } - interface TransformationEvent { - sender: Transformation; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - } declare namespace kendo.dataviz.ui { class Barcode extends kendo.ui.Widget { @@ -9681,6 +9830,7 @@ declare namespace kendo.dataviz.ui { margin?: ChartSeriesItemLabelsMargin; padding?: ChartSeriesItemLabelsPadding; position?: string|Function; + rotation?: string|number; template?: string|Function; visible?: boolean|Function; visual?: Function; @@ -9833,6 +9983,7 @@ declare namespace kendo.dataviz.ui { aggregate?: string|Function; axis?: string; border?: ChartSeriesItemBorder; + categoryAxis?: string; categoryField?: string; closeField?: string; color?: string|Function; @@ -10009,6 +10160,7 @@ declare namespace kendo.dataviz.ui { format?: string; margin?: ChartSeriesDefaultsLabelsMargin; padding?: ChartSeriesDefaultsLabelsPadding; + rotation?: string|number; template?: string|Function; visible?: boolean; visual?: Function; @@ -14295,7 +14447,7 @@ declare namespace kendo.dataviz.ui { inactiveItems?: StockChartLegendInactiveItems; } - interface StockChartNavigatorCategoryAxisItemAutoBaseUnitSteps { + interface StockChartNavigatorCategoryAxisAutoBaseUnitSteps { seconds?: any; minutes?: any; hours?: any; @@ -14305,45 +14457,45 @@ declare namespace kendo.dataviz.ui { years?: any; } - interface StockChartNavigatorCategoryAxisItemCrosshairTooltipBorder { + interface StockChartNavigatorCategoryAxisCrosshairTooltipBorder { color?: string; dashType?: string; width?: number; } - interface StockChartNavigatorCategoryAxisItemCrosshairTooltipPadding { + interface StockChartNavigatorCategoryAxisCrosshairTooltipPadding { bottom?: number; left?: number; right?: number; top?: number; } - interface StockChartNavigatorCategoryAxisItemCrosshairTooltip { + interface StockChartNavigatorCategoryAxisCrosshairTooltip { background?: string; - border?: StockChartNavigatorCategoryAxisItemCrosshairTooltipBorder; + border?: StockChartNavigatorCategoryAxisCrosshairTooltipBorder; color?: string; font?: string; format?: string; - padding?: StockChartNavigatorCategoryAxisItemCrosshairTooltipPadding; + padding?: StockChartNavigatorCategoryAxisCrosshairTooltipPadding; template?: string|Function; visible?: boolean; } - interface StockChartNavigatorCategoryAxisItemCrosshair { + interface StockChartNavigatorCategoryAxisCrosshair { color?: string; opacity?: number; - tooltip?: StockChartNavigatorCategoryAxisItemCrosshairTooltip; + tooltip?: StockChartNavigatorCategoryAxisCrosshairTooltip; visible?: boolean; width?: number; } - interface StockChartNavigatorCategoryAxisItemLabelsBorder { + interface StockChartNavigatorCategoryAxisLabelsBorder { color?: string; dashType?: string; width?: number; } - interface StockChartNavigatorCategoryAxisItemLabelsDateFormats { + interface StockChartNavigatorCategoryAxisLabelsDateFormats { days?: string; hours?: string; months?: string; @@ -14351,31 +14503,31 @@ declare namespace kendo.dataviz.ui { years?: string; } - interface StockChartNavigatorCategoryAxisItemLabelsMargin { + interface StockChartNavigatorCategoryAxisLabelsMargin { bottom?: number; left?: number; right?: number; top?: number; } - interface StockChartNavigatorCategoryAxisItemLabelsPadding { + interface StockChartNavigatorCategoryAxisLabelsPadding { bottom?: number; left?: number; right?: number; top?: number; } - interface StockChartNavigatorCategoryAxisItemLabels { + interface StockChartNavigatorCategoryAxisLabels { background?: string; - border?: StockChartNavigatorCategoryAxisItemLabelsBorder; + border?: StockChartNavigatorCategoryAxisLabelsBorder; color?: string; culture?: string; - dateFormats?: StockChartNavigatorCategoryAxisItemLabelsDateFormats; + dateFormats?: StockChartNavigatorCategoryAxisLabelsDateFormats; font?: string; format?: string; - margin?: StockChartNavigatorCategoryAxisItemLabelsMargin; + margin?: StockChartNavigatorCategoryAxisLabelsMargin; mirror?: boolean; - padding?: StockChartNavigatorCategoryAxisItemLabelsPadding; + padding?: StockChartNavigatorCategoryAxisLabelsPadding; rotation?: number; skip?: number; step?: number; @@ -14383,14 +14535,14 @@ declare namespace kendo.dataviz.ui { visible?: boolean; } - interface StockChartNavigatorCategoryAxisItemLine { + interface StockChartNavigatorCategoryAxisLine { color?: string; dashType?: string; visible?: boolean; width?: number; } - interface StockChartNavigatorCategoryAxisItemMajorGridLines { + interface StockChartNavigatorCategoryAxisMajorGridLines { color?: string; dashType?: string; visible?: boolean; @@ -14399,7 +14551,7 @@ declare namespace kendo.dataviz.ui { skip?: number; } - interface StockChartNavigatorCategoryAxisItemMajorTicks { + interface StockChartNavigatorCategoryAxisMajorTicks { color?: string; size?: number; visible?: boolean; @@ -14408,7 +14560,7 @@ declare namespace kendo.dataviz.ui { skip?: number; } - interface StockChartNavigatorCategoryAxisItemMinorGridLines { + interface StockChartNavigatorCategoryAxisMinorGridLines { color?: string; dashType?: string; visible?: boolean; @@ -14417,7 +14569,7 @@ declare namespace kendo.dataviz.ui { skip?: number; } - interface StockChartNavigatorCategoryAxisItemMinorTicks { + interface StockChartNavigatorCategoryAxisMinorTicks { color?: string; size?: number; visible?: boolean; @@ -14426,28 +14578,28 @@ declare namespace kendo.dataviz.ui { skip?: number; } - interface StockChartNavigatorCategoryAxisItemNotesDataItemIconBorder { + interface StockChartNavigatorCategoryAxisNotesDataItemIconBorder { color?: string; width?: number; } - interface StockChartNavigatorCategoryAxisItemNotesDataItemIcon { + interface StockChartNavigatorCategoryAxisNotesDataItemIcon { background?: string; - border?: StockChartNavigatorCategoryAxisItemNotesDataItemIconBorder; + border?: StockChartNavigatorCategoryAxisNotesDataItemIconBorder; size?: number; type?: string; visible?: boolean; } - interface StockChartNavigatorCategoryAxisItemNotesDataItemLabelBorder { + interface StockChartNavigatorCategoryAxisNotesDataItemLabelBorder { color?: string; dashType?: string; width?: number; } - interface StockChartNavigatorCategoryAxisItemNotesDataItemLabel { + interface StockChartNavigatorCategoryAxisNotesDataItemLabel { background?: string; - border?: StockChartNavigatorCategoryAxisItemNotesDataItemLabelBorder; + border?: StockChartNavigatorCategoryAxisNotesDataItemLabelBorder; color?: string; font?: string; template?: string|Function; @@ -14458,42 +14610,42 @@ declare namespace kendo.dataviz.ui { position?: string; } - interface StockChartNavigatorCategoryAxisItemNotesDataItemLine { + interface StockChartNavigatorCategoryAxisNotesDataItemLine { width?: number; color?: string; length?: number; } - interface StockChartNavigatorCategoryAxisItemNotesDataItem { + interface StockChartNavigatorCategoryAxisNotesDataItem { value?: any; position?: string; - icon?: StockChartNavigatorCategoryAxisItemNotesDataItemIcon; - label?: StockChartNavigatorCategoryAxisItemNotesDataItemLabel; - line?: StockChartNavigatorCategoryAxisItemNotesDataItemLine; + icon?: StockChartNavigatorCategoryAxisNotesDataItemIcon; + label?: StockChartNavigatorCategoryAxisNotesDataItemLabel; + line?: StockChartNavigatorCategoryAxisNotesDataItemLine; } - interface StockChartNavigatorCategoryAxisItemNotesIconBorder { + interface StockChartNavigatorCategoryAxisNotesIconBorder { color?: string; width?: number; } - interface StockChartNavigatorCategoryAxisItemNotesIcon { + interface StockChartNavigatorCategoryAxisNotesIcon { background?: string; - border?: StockChartNavigatorCategoryAxisItemNotesIconBorder; + border?: StockChartNavigatorCategoryAxisNotesIconBorder; size?: number; type?: string; visible?: boolean; } - interface StockChartNavigatorCategoryAxisItemNotesLabelBorder { + interface StockChartNavigatorCategoryAxisNotesLabelBorder { color?: string; dashType?: string; width?: number; } - interface StockChartNavigatorCategoryAxisItemNotesLabel { + interface StockChartNavigatorCategoryAxisNotesLabel { background?: string; - border?: StockChartNavigatorCategoryAxisItemNotesLabelBorder; + border?: StockChartNavigatorCategoryAxisNotesLabelBorder; color?: string; font?: string; template?: string|Function; @@ -14503,87 +14655,87 @@ declare namespace kendo.dataviz.ui { position?: string; } - interface StockChartNavigatorCategoryAxisItemNotesLine { + interface StockChartNavigatorCategoryAxisNotesLine { width?: number; color?: string; length?: number; } - interface StockChartNavigatorCategoryAxisItemNotes { + interface StockChartNavigatorCategoryAxisNotes { position?: string; - icon?: StockChartNavigatorCategoryAxisItemNotesIcon; - label?: StockChartNavigatorCategoryAxisItemNotesLabel; - line?: StockChartNavigatorCategoryAxisItemNotesLine; - data?: StockChartNavigatorCategoryAxisItemNotesDataItem[]; + icon?: StockChartNavigatorCategoryAxisNotesIcon; + label?: StockChartNavigatorCategoryAxisNotesLabel; + line?: StockChartNavigatorCategoryAxisNotesLine; + data?: StockChartNavigatorCategoryAxisNotesDataItem[]; } - interface StockChartNavigatorCategoryAxisItemPlotBand { + interface StockChartNavigatorCategoryAxisPlotBand { color?: string; from?: number; opacity?: number; to?: number; } - interface StockChartNavigatorCategoryAxisItemTitleBorder { + interface StockChartNavigatorCategoryAxisTitleBorder { color?: string; dashType?: string; width?: number; } - interface StockChartNavigatorCategoryAxisItemTitleMargin { + interface StockChartNavigatorCategoryAxisTitleMargin { bottom?: number; left?: number; right?: number; top?: number; } - interface StockChartNavigatorCategoryAxisItemTitlePadding { + interface StockChartNavigatorCategoryAxisTitlePadding { bottom?: number; left?: number; right?: number; top?: number; } - interface StockChartNavigatorCategoryAxisItemTitle { + interface StockChartNavigatorCategoryAxisTitle { background?: string; - border?: StockChartNavigatorCategoryAxisItemTitleBorder; + border?: StockChartNavigatorCategoryAxisTitleBorder; color?: string; font?: string; - margin?: StockChartNavigatorCategoryAxisItemTitleMargin; - padding?: StockChartNavigatorCategoryAxisItemTitlePadding; + margin?: StockChartNavigatorCategoryAxisTitleMargin; + padding?: StockChartNavigatorCategoryAxisTitlePadding; position?: string; rotation?: number; text?: string; visible?: boolean; } - interface StockChartNavigatorCategoryAxisItem { - autoBaseUnitSteps?: StockChartNavigatorCategoryAxisItemAutoBaseUnitSteps; + interface StockChartNavigatorCategoryAxis { + autoBaseUnitSteps?: StockChartNavigatorCategoryAxisAutoBaseUnitSteps; axisCrossingValue?: any|Date|any; background?: string; baseUnit?: string; baseUnitStep?: any; categories?: any; color?: string; - crosshair?: StockChartNavigatorCategoryAxisItemCrosshair; + crosshair?: StockChartNavigatorCategoryAxisCrosshair; field?: string; justified?: boolean; - labels?: StockChartNavigatorCategoryAxisItemLabels; - line?: StockChartNavigatorCategoryAxisItemLine; - majorGridLines?: StockChartNavigatorCategoryAxisItemMajorGridLines; - majorTicks?: StockChartNavigatorCategoryAxisItemMajorTicks; + labels?: StockChartNavigatorCategoryAxisLabels; + line?: StockChartNavigatorCategoryAxisLine; + majorGridLines?: StockChartNavigatorCategoryAxisMajorGridLines; + majorTicks?: StockChartNavigatorCategoryAxisMajorTicks; max?: any; maxDateGroups?: number; min?: any; - minorGridLines?: StockChartNavigatorCategoryAxisItemMinorGridLines; - minorTicks?: StockChartNavigatorCategoryAxisItemMinorTicks; - plotBands?: StockChartNavigatorCategoryAxisItemPlotBand[]; + minorGridLines?: StockChartNavigatorCategoryAxisMinorGridLines; + minorTicks?: StockChartNavigatorCategoryAxisMinorTicks; + plotBands?: StockChartNavigatorCategoryAxisPlotBand[]; reverse?: boolean; roundToBaseUnit?: boolean; - title?: StockChartNavigatorCategoryAxisItemTitle; + title?: StockChartNavigatorCategoryAxisTitle; visible?: boolean; weekStartDay?: number; - notes?: StockChartNavigatorCategoryAxisItemNotes; + notes?: StockChartNavigatorCategoryAxisNotes; } interface StockChartNavigatorHint { @@ -14781,7 +14933,7 @@ declare namespace kendo.dataviz.ui { } interface StockChartNavigator { - categoryAxis?: StockChartNavigatorCategoryAxisItem[]; + categoryAxis?: StockChartNavigatorCategoryAxis; dataSource?: any; autoBind?: boolean; dateField?: string; @@ -16959,6 +17111,27 @@ declare namespace kendo { } + namespace date { + function setDayOfWeek(targetDate: Date, dayOfWeek: number, direction: number): void; + function dayOfWeek(targetDate: Date, dayOfWeek: number, direction: number): Date; + function weekInYear(date: Date, weekStart?: Date): number; + function getDate(date: Date): Date; + function isInDateRange(targetDate: Date, lowerLimitDate: Date, upperLimitDate: Date): boolean; + function isInTimeRange(targetDate: Date, lowerLimitDate: Date, upperLimitDate: Date): boolean; + function isToday(targetDate: Date): boolean; + function nextDay(targetDate: Date): Date; + function previousDay(targetDate: Date): Date; + function toUtcTime(targetDate: Date): number; + function setTime(targetDate: Date, millisecondsToAdd: number, ignoreDST: boolean): void; + function setHours(targetDate: Date, sourceDate: number): Date; + function addDays(targetDate: Date, numberOfDaysToAdd: number): Date; + function today(): Date; + function toInvariantTime(targetDate: Date): Date; + function firstDayOfMonth(targetDate: Date): Date; + function lastDayOfMonth(targetDate: Date): Date; + function getMilliseconds(targetDate: Date): Date; + } + namespace drawing { function align(elements: any, rect: kendo.geometry.Rect, alignment: string): void; function drawDOM(element: JQuery, options: any): JQueryPromise; @@ -17022,6 +17195,22 @@ declare namespace kendo { function defineFont(map: any): void; } + namespace timezone { + function offset(utcTime: Date, timezone: string): number; + function offset(utcTime: number, timezone: string): number; + function convert(targetDate: Date, fromOffset: number, toOffset: number): Date; + function convert(targetDate: Date, fromOffset: number, toOffset: string): Date; + function convert(targetDate: Date, fromOffset: string, toOffset: number): Date; + function convert(targetDate: Date, fromOffset: string, toOffset: string): Date; + function apply(targetDate: Date, offset: number): Date; + function apply(targetDate: Date, offset: string): Date; + function remove(targetDate: Date, offset: number): Date; + function remove(targetDate: Date, offset: string): Date; + function abbr(targetDate: Date, timezone: string): string; + function toLocalDate(targetDate: Date): Date; + function toLocalDate(targetDate: number): Date; + } + } declare namespace kendo.spreadsheet { class CustomFilter extends Observable { @@ -18307,7 +18496,6 @@ declare namespace kendo.ooxml { cells?: WorkbookSheetRowCell[]; index?: number; height?: number; - type?: "header" | "footer" | "groupHeader" | "groupFooter" | "data"; } interface WorkbookSheet { @@ -18337,6 +18525,274 @@ declare namespace kendo.ooxml { } +declare namespace kendo.dataviz.geometry { + class Arc extends Observable { + + + options: ArcOptions; + + anticlockwise: boolean; + center: kendo.geometry.Point; + endAngle: number; + radiusX: number; + radiusY: number; + startAngle: number; + + constructor(center: any|kendo.geometry.Point, options?: ArcOptions); + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + getAnticlockwise(): boolean; + getCenter(): kendo.geometry.Point; + getEndAngle(): number; + getRadiusX(): number; + getRadiusY(): number; + getStartAngle(): number; + pointAt(angle: number): kendo.geometry.Point; + setAnticlockwise(value: boolean): kendo.geometry.Arc; + setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; + setEndAngle(value: number): kendo.geometry.Arc; + setRadiusX(value: number): kendo.geometry.Arc; + setRadiusY(value: number): kendo.geometry.Arc; + setStartAngle(value: number): kendo.geometry.Arc; + + } + + interface ArcOptions { + name?: string; + } + interface ArcEvent { + sender: Arc; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Circle extends Observable { + + + options: CircleOptions; + + center: kendo.geometry.Point; + radius: number; + + constructor(center: any|kendo.geometry.Point, radius: number); + + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + clone(): kendo.geometry.Circle; + equals(other: kendo.geometry.Circle): boolean; + getCenter(): kendo.geometry.Point; + getRadius(): number; + pointAt(angle: number): kendo.geometry.Point; + setCenter(value: kendo.geometry.Point): kendo.geometry.Point; + setCenter(value: any): kendo.geometry.Point; + setRadius(value: number): kendo.geometry.Circle; + + } + + interface CircleOptions { + name?: string; + } + interface CircleEvent { + sender: Circle; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Matrix extends Observable { + + + options: MatrixOptions; + + a: number; + b: number; + c: number; + d: number; + e: number; + f: number; + + + static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; + static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; + static translate(x: number, y: number): kendo.geometry.Matrix; + static unit(): kendo.geometry.Matrix; + + clone(): kendo.geometry.Matrix; + equals(other: kendo.geometry.Matrix): boolean; + round(digits: number): kendo.geometry.Matrix; + multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + + } + + interface MatrixOptions { + name?: string; + } + interface MatrixEvent { + sender: Matrix; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Point extends Observable { + + + options: PointOptions; + + x: number; + y: number; + + constructor(x: number, y: number); + + static create(x: number, y: number): kendo.geometry.Point; + static create(x: any, y: number): kendo.geometry.Point; + static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; + static min(): kendo.geometry.Point; + static max(): kendo.geometry.Point; + static minPoint(): kendo.geometry.Point; + static maxPoint(): kendo.geometry.Point; + + clone(): kendo.geometry.Point; + distanceTo(point: kendo.geometry.Point): number; + equals(other: kendo.geometry.Point): boolean; + getX(): number; + getY(): number; + move(x: number, y: number): kendo.geometry.Point; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; + rotate(angle: number, center: any): kendo.geometry.Point; + round(digits: number): kendo.geometry.Point; + scale(scaleX: number, scaleY: number): kendo.geometry.Point; + scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; + setX(value: number): kendo.geometry.Point; + setY(value: number): kendo.geometry.Point; + toArray(digits: number): any; + toString(digits: number, separator: string): string; + transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; + translate(dx: number, dy: number): kendo.geometry.Point; + translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; + translateWith(vector: any): kendo.geometry.Point; + + } + + interface PointOptions { + name?: string; + } + interface PointEvent { + sender: Point; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Rect extends Observable { + + + options: RectOptions; + + origin: kendo.geometry.Point; + size: kendo.geometry.Size; + + constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); + + static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; + static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; + + bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; + bottomLeft(): kendo.geometry.Point; + bottomRight(): kendo.geometry.Point; + center(): kendo.geometry.Point; + clone(): kendo.geometry.Rect; + equals(other: kendo.geometry.Rect): boolean; + getOrigin(): kendo.geometry.Point; + getSize(): kendo.geometry.Size; + height(): number; + setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; + setOrigin(value: any): kendo.geometry.Rect; + setSize(value: kendo.geometry.Size): kendo.geometry.Rect; + setSize(value: any): kendo.geometry.Rect; + topLeft(): kendo.geometry.Point; + topRight(): kendo.geometry.Point; + width(): number; + + } + + interface RectOptions { + name?: string; + } + interface RectEvent { + sender: Rect; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Size extends Observable { + + + options: SizeOptions; + + width: number; + height: number; + + + static create(width: number, height: number): kendo.geometry.Size; + static create(width: any, height: number): kendo.geometry.Size; + static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; + + clone(): kendo.geometry.Size; + equals(other: kendo.geometry.Size): boolean; + getWidth(): number; + getHeight(): number; + setWidth(value: number): kendo.geometry.Size; + setHeight(value: number): kendo.geometry.Size; + + } + + interface SizeOptions { + name?: string; + } + interface SizeEvent { + sender: Size; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + + class Transformation extends Observable { + + + options: TransformationOptions; + + + + + clone(): kendo.geometry.Transformation; + equals(other: kendo.geometry.Transformation): boolean; + matrix(): kendo.geometry.Matrix; + multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; + rotate(angle: number, center: any): kendo.geometry.Transformation; + rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; + scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; + translate(x: number, y: number): kendo.geometry.Transformation; + + } + + interface TransformationOptions { + name?: string; + } + interface TransformationEvent { + sender: Transformation; + preventDefault: Function; + isDefaultPrevented(): boolean; + } + + +} declare namespace kendo.dataviz.drawing { class Arc extends kendo.drawing.Element { @@ -19126,274 +19582,6 @@ declare namespace kendo.dataviz.drawing { -} -declare namespace kendo.dataviz.geometry { - class Arc extends Observable { - - - options: ArcOptions; - - anticlockwise: boolean; - center: kendo.geometry.Point; - endAngle: number; - radiusX: number; - radiusY: number; - startAngle: number; - - constructor(center: any|kendo.geometry.Point, options?: ArcOptions); - - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - getAnticlockwise(): boolean; - getCenter(): kendo.geometry.Point; - getEndAngle(): number; - getRadiusX(): number; - getRadiusY(): number; - getStartAngle(): number; - pointAt(angle: number): kendo.geometry.Point; - setAnticlockwise(value: boolean): kendo.geometry.Arc; - setCenter(value: kendo.geometry.Point): kendo.geometry.Arc; - setEndAngle(value: number): kendo.geometry.Arc; - setRadiusX(value: number): kendo.geometry.Arc; - setRadiusY(value: number): kendo.geometry.Arc; - setStartAngle(value: number): kendo.geometry.Arc; - - } - - interface ArcOptions { - name?: string; - } - interface ArcEvent { - sender: Arc; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Circle extends Observable { - - - options: CircleOptions; - - center: kendo.geometry.Point; - radius: number; - - constructor(center: any|kendo.geometry.Point, radius: number); - - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - clone(): kendo.geometry.Circle; - equals(other: kendo.geometry.Circle): boolean; - getCenter(): kendo.geometry.Point; - getRadius(): number; - pointAt(angle: number): kendo.geometry.Point; - setCenter(value: kendo.geometry.Point): kendo.geometry.Point; - setCenter(value: any): kendo.geometry.Point; - setRadius(value: number): kendo.geometry.Circle; - - } - - interface CircleOptions { - name?: string; - } - interface CircleEvent { - sender: Circle; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Matrix extends Observable { - - - options: MatrixOptions; - - a: number; - b: number; - c: number; - d: number; - e: number; - f: number; - - - static rotate(angle: number, x: number, y: number): kendo.geometry.Matrix; - static scale(scaleX: number, scaleY: number): kendo.geometry.Matrix; - static translate(x: number, y: number): kendo.geometry.Matrix; - static unit(): kendo.geometry.Matrix; - - clone(): kendo.geometry.Matrix; - equals(other: kendo.geometry.Matrix): boolean; - round(digits: number): kendo.geometry.Matrix; - multiplyCopy(matrix: kendo.geometry.Matrix): kendo.geometry.Matrix; - toArray(digits: number): any; - toString(digits?: number, separator?: string): string; - - } - - interface MatrixOptions { - name?: string; - } - interface MatrixEvent { - sender: Matrix; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Point extends Observable { - - - options: PointOptions; - - x: number; - y: number; - - constructor(x: number, y: number); - - static create(x: number, y: number): kendo.geometry.Point; - static create(x: any, y: number): kendo.geometry.Point; - static create(x: kendo.geometry.Point, y: number): kendo.geometry.Point; - static min(): kendo.geometry.Point; - static max(): kendo.geometry.Point; - static minPoint(): kendo.geometry.Point; - static maxPoint(): kendo.geometry.Point; - - clone(): kendo.geometry.Point; - distanceTo(point: kendo.geometry.Point): number; - equals(other: kendo.geometry.Point): boolean; - getX(): number; - getY(): number; - move(x: number, y: number): kendo.geometry.Point; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Point; - rotate(angle: number, center: any): kendo.geometry.Point; - round(digits: number): kendo.geometry.Point; - scale(scaleX: number, scaleY: number): kendo.geometry.Point; - scaleCopy(scaleX: number, scaleY: number): kendo.geometry.Point; - setX(value: number): kendo.geometry.Point; - setY(value: number): kendo.geometry.Point; - toArray(digits: number): any; - toString(digits: number, separator: string): string; - transform(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - transformCopy(tansformation: kendo.geometry.Transformation): kendo.geometry.Point; - translate(dx: number, dy: number): kendo.geometry.Point; - translateWith(vector: kendo.geometry.Point): kendo.geometry.Point; - translateWith(vector: any): kendo.geometry.Point; - - } - - interface PointOptions { - name?: string; - } - interface PointEvent { - sender: Point; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Rect extends Observable { - - - options: RectOptions; - - origin: kendo.geometry.Point; - size: kendo.geometry.Size; - - constructor(origin: kendo.geometry.Point|any, size: kendo.geometry.Size|any); - - static fromPoints(pointA: kendo.geometry.Point, pointB: kendo.geometry.Point): kendo.geometry.Rect; - static union(rectA: kendo.geometry.Rect, rectB: kendo.geometry.Rect): kendo.geometry.Rect; - - bbox(matrix: kendo.geometry.Matrix): kendo.geometry.Rect; - bottomLeft(): kendo.geometry.Point; - bottomRight(): kendo.geometry.Point; - center(): kendo.geometry.Point; - clone(): kendo.geometry.Rect; - equals(other: kendo.geometry.Rect): boolean; - getOrigin(): kendo.geometry.Point; - getSize(): kendo.geometry.Size; - height(): number; - setOrigin(value: kendo.geometry.Point): kendo.geometry.Rect; - setOrigin(value: any): kendo.geometry.Rect; - setSize(value: kendo.geometry.Size): kendo.geometry.Rect; - setSize(value: any): kendo.geometry.Rect; - topLeft(): kendo.geometry.Point; - topRight(): kendo.geometry.Point; - width(): number; - - } - - interface RectOptions { - name?: string; - } - interface RectEvent { - sender: Rect; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Size extends Observable { - - - options: SizeOptions; - - width: number; - height: number; - - - static create(width: number, height: number): kendo.geometry.Size; - static create(width: any, height: number): kendo.geometry.Size; - static create(width: kendo.geometry.Size, height: number): kendo.geometry.Size; - - clone(): kendo.geometry.Size; - equals(other: kendo.geometry.Size): boolean; - getWidth(): number; - getHeight(): number; - setWidth(value: number): kendo.geometry.Size; - setHeight(value: number): kendo.geometry.Size; - - } - - interface SizeOptions { - name?: string; - } - interface SizeEvent { - sender: Size; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - - class Transformation extends Observable { - - - options: TransformationOptions; - - - - - clone(): kendo.geometry.Transformation; - equals(other: kendo.geometry.Transformation): boolean; - matrix(): kendo.geometry.Matrix; - multiply(transformation: kendo.geometry.Transformation): kendo.geometry.Transformation; - rotate(angle: number, center: any): kendo.geometry.Transformation; - rotate(angle: number, center: kendo.geometry.Point): kendo.geometry.Transformation; - scale(scaleX: number, scaleY: number): kendo.geometry.Transformation; - translate(x: number, y: number): kendo.geometry.Transformation; - - } - - interface TransformationOptions { - name?: string; - } - interface TransformationEvent { - sender: Transformation; - preventDefault: Function; - isDefaultPrevented(): boolean; - } - - } interface HTMLElement { From 0063c1aba5f0ab6a385d73cccb940cdada6aba09 Mon Sep 17 00:00:00 2001 From: Kamil Szostak Date: Fri, 27 Jan 2017 09:52:53 -0800 Subject: [PATCH 016/797] Update applicationInsights-js - v1.0.7 --- .../applicationinsights-js-tests.ts | 12 ++++++--- applicationinsights-js/index.d.ts | 26 +++++++++++-------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/applicationinsights-js/applicationinsights-js-tests.ts b/applicationinsights-js/applicationinsights-js-tests.ts index f77bab2b0a..f493c13bf3 100644 --- a/applicationinsights-js/applicationinsights-js-tests.ts +++ b/applicationinsights-js/applicationinsights-js-tests.ts @@ -1,4 +1,3 @@ - // More samples on: https://github.com/Microsoft/ApplicationInsights-JS/blob/master/API-reference.md var config: Microsoft.ApplicationInsights.IConfig = { @@ -24,7 +23,11 @@ var config: Microsoft.ApplicationInsights.IConfig = { disableCorrelationHeaders: true, disableFlushOnBeforeUnload: false, enableSessionStorageBuffer: false, - cookieDomain: "" + cookieDomain: "", + isCookieUseDisabled: true, + isRetryDisabled: true, + isPerfAnalyzerEnabled: true, + isStorageUseDisabled: true }; var appInsights: Microsoft.ApplicationInsights.IAppInsights = { @@ -38,7 +41,7 @@ var appInsights: Microsoft.ApplicationInsights.IAppInsights = { startTrackEvent(name: string) { return null }, stopTrackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null }, trackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null }, - trackAjax(id: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number, method?: string) { return null }, + trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number) { return null }, trackException(exception: Error, handledAt?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, severityLevel?: AI.SeverityLevel) { return null }, trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: { [name: string]: string; }) { return null }, trackTrace(message: string, properties?: { [name: string]: string; }) { return null }, @@ -75,6 +78,9 @@ appInsights.trackException(new Error("sample error"), "handledAt", null, null); appInsights.trackTrace("message"); appInsights.trackTrace("message", null); +// trackDependency +appInsights.trackDependency("id", "POST", "http://example.com/test/abc", "/test/abc", null, true, null); + // flush appInsights.flush(); diff --git a/applicationinsights-js/index.d.ts b/applicationinsights-js/index.d.ts index ba154e5fe6..e99763d983 100644 --- a/applicationinsights-js/index.d.ts +++ b/applicationinsights-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ApplicationInsights-JS v0.23.2 +// Type definitions for ApplicationInsights-JS v1.0.7 // Project: https://github.com/Microsoft/ApplicationInsights-JS // Definitions by: Kamil Szostak // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -567,8 +567,12 @@ declare module Microsoft.ApplicationInsights { disableCorrelationHeaders?: boolean; disableFlushOnBeforeUnload?: boolean; enableSessionStorageBuffer?: boolean; + isCookieUseDisabled?: boolean; cookieDomain?: string; + isRetryDisabled?: boolean; + isPerfAnalyzerEnabled?: boolean; url?: string; + isStorageUseDisabled?: boolean; } /** @@ -717,16 +721,16 @@ declare module Microsoft.ApplicationInsights { [name: string]: number; }): any; /** - * Log an AJAX request - * @param id Event id - * @param absoluteUrl Full url - * @param pathName Leave this parameter blank - * @param totalTime Total time it took for AJAX request to complete - * @param success Whether AJAX request succeeded or failed - * @param resultCode Result code returned from AJAX call - * @param method HTTP verb that was used (GET, POST) - */ - trackAjax(id: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number, method?: string): any; + * Log a dependency call + * @param id unique id, this is used by the backend o correlate server requests. Use Util.newId() to generate a unique Id. + * @param method represents request verb (GET, POST, etc.) + * @param absoluteUrl absolute url used to make the dependency request + * @param pathName the path part of the absolute url + * @param totalTime total request time + * @param success indicates if the request was sessessful + * @param resultCode response code returned by the dependency request + */ + trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number): any; /** * Log an exception you have caught. * @param exception An Error from a catch clause, or the string error message. From d4c58f6b197b54a9eaa4f6b5864b269fce516d7f Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Sun, 29 Jan 2017 17:39:10 -0500 Subject: [PATCH 017/797] Update ComponentLifecycle for Readonly --- react/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/react/index.d.ts b/react/index.d.ts index 8bf7bb21af..d57774e84d 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -239,10 +239,10 @@ declare namespace React { interface ComponentLifecycle { componentWillMount?(): void; componentDidMount?(): void; - componentWillReceiveProps?(nextProps: P, nextContext: any): void; - shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; - componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; - componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; + componentWillReceiveProps?(nextProps: Readonly

, nextContext: any): void; + shouldComponentUpdate?(nextProps: Readonly

, nextState: Readonly, nextContext: any): boolean; + componentWillUpdate?(nextProps: Readonly

, nextState: Readonly, nextContext: any): void; + componentDidUpdate?(prevProps: Readonly

, prevState: Readonly, prevContext: any): void; componentWillUnmount?(): void; } From 75ad809fe407fee75e12f6016974706381429bc0 Mon Sep 17 00:00:00 2001 From: Richard Fox Date: Mon, 30 Jan 2017 02:25:21 +0100 Subject: [PATCH 018/797] Remove invalid greensock typings greensock isn't an actual node module. Instead we'll merge greensock's typings into gsap --- greensock/index.d.ts | 352 ---------------------------------------- greensock/tsconfig.json | 21 --- 2 files changed, 373 deletions(-) delete mode 100644 greensock/index.d.ts delete mode 100644 greensock/tsconfig.json diff --git a/greensock/index.d.ts b/greensock/index.d.ts deleted file mode 100644 index 65f7ee52e7..0000000000 --- a/greensock/index.d.ts +++ /dev/null @@ -1,352 +0,0 @@ -// Type definitions for GreenSock Animation Platform 1.15.1 -// Project: http://www.greensock.com/get-started-js/ -// Definitions by: Robert S -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -// JavaScript Docs http://api.greensock.com/js/ -// Version 1.15.1 (TypeScript 1.4) - -interface IDispatcher { - addEventListener(type:string, callback:Function, scope?:Object, useParam?:boolean, priority?:number):void; - removeEventListener(type:string, callback:Function):void; -} - -declare type Tween = TweenLite | TweenMax; -declare type Timeline = SimpleTimeline | TimelineLite | TimelineMax; -declare type TweenConfig = { - [tweenProp: string]: any; - delay?: number; - ease?: Ease; - repeat?: number; - repeatDelay?: number; - yoyo?: boolean; - paused?: boolean; - overwrite?: string|number; - onComplete?: Function; - immediateRender?: boolean; - onCompleteParams?: any[]; - onCompleteScope?: Object; - onRepeat?: Function; - onRepeatScope?: Object; - onReverseComplete?: Function; - onReverseCompleteParams?: any[]; - onReverseCompleteScope?: Object; - onStart?: Function; - onStartParams?: any[]; - onStartScope?: Object; - onUpdate?: Function; - onUpdateParams?: any[]; - onUpdateScope?: Object; - startAt?: Object; - useFrames?: boolean; - lazy?: boolean; - onOverwrite?: Function; - autoCSS?: boolean; - callbackScope?: Object; -} - -//com.greensock.core -declare class Animation { - static ticker: IDispatcher; - data: any; - timeline: SimpleTimeline; - vars: Object; - - constructor(duration?: number, vars?: Object); - - delay(): number; - delay(value: number): Animation; - duration(): number; - duration(value: number): Animation; - eventCallback(type: string): Function; - eventCallback(type: string, callback: Function, params?: any[], scope?: any): Animation; - invalidate(): Animation; - isActive(): boolean; - kill(vars?: Object, target?: Object): Animation; - pause(atTime?: any, suppressEvents?: boolean): Animation; - paused(): boolean; - paused(value: boolean): Animation; - play(from?: any, suppressEvents?: boolean): Animation; - progress(): number; - progress(value: number, supressEvents?: boolean): Animation; - restart(includeDelay?: boolean, suppressEvents?: boolean): Animation; - resume(from?: any, suppressEvents?: boolean): Animation; - reverse(from?: any, suppressEvents?: boolean): Animation; - reversed(): boolean; - reversed(value: boolean): Animation; - seek(time: any, suppressEvents?: boolean): Animation; - startTime(): number; - startTime(value: number): Animation; - time(): number; - time(value: number, suppressEvents?: boolean): Animation; - timeScale(): number; - timeScale(value: number): Animation; - totalDuration(): number; - totalDuration(value: number): Animation; - totalProgress(): number; - totalProgress(value: number): Animation; - totalTime(): number; - totalTime(time: number, suppressEvents?: boolean): Animation; -} - -declare class SimpleTimeline extends Animation { - autoRemoveChildren: boolean; - smoothChildTiming: boolean; - - constructor(vars?: Object); - - add(value: any, position?: any, align?: string, stagger?: number): SimpleTimeline; - render(time: number, suppressEvents?: boolean, force?: boolean): void; -} - -//com.greensock -declare class TweenLite extends Animation { - static defaultEase: Ease; - static defaultOverwrite: string; - static selector: any; - target: Object; - - constructor(target: Object, duration: number, vars: Object); - - static delayedCall(delay: number, callback: Function, params?: any[], scope?: any, useFrames?: boolean): TweenLite; - endTime(includeRepeats?: boolean): number; - static from(target: Object | Object[], duration: number, vars: Object): TweenLite; - static fromTo(target: Object | Object[], duration: number, fromVars: Object, toVars: Object): TweenLite; - static getTweensOf(target: Object, onlyActive: boolean): Tween[]; - static killDelayedCallsTo(func: Function): void; - static killTweensOf(target: Object, onlyActive?: boolean, vars?: Object): void; - static lagSmoothing(threshold: number, adjustedLag: number): void; - static set(target: Object, vars: Object): TweenLite; - static to(target: Object, duration: number, vars: TweenConfig): TweenLite; -} - -declare class TweenMax extends TweenLite { - constructor(target: Object, duration: number, vars: Object); - - static delayedCall(delay: number, callback: Function, params?: any[], scope?: Object, useFrames?: boolean): TweenMax; - static from(target: Object, duration: number, vars: Object): TweenMax; - static fromTo(target: Object, duration: number, fromVars: Object, toVars: Object): TweenMax; - static getAllTweens(includeTimelines?: boolean): Tween[]; - static getTweensOf(target: Object): Tween[]; - static isTweening(target: Object): boolean; - static killAll(complete?: boolean, tweens?: boolean, delayedCalls?: boolean, timelines?: boolean): void; - static killChildTweensOf(parent: any, complete?: boolean): void; - static killDelayedCallsTo(func: Function): void; - static killTweensOf(target: Object, vars?: Object): void; - static pauseAll(tweens?: boolean, delayedCalls?: boolean, timelines?: boolean): void; - repeat(): number; - repeat(value: number): TweenMax; - repeatDelay(): number; - repeatDelay(value: number): TweenMax; - static resumeAll(tweens?: boolean, delayedCalls?: boolean, timelines?: boolean): void; - static set(target: Object, vars: Object): TweenMax; - static staggerFrom(targets: any, duration: number, vars: Object, stagger: number, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteAllScope?: any): any[]; - static staggerFromTo(targets: any, duration: number, fromVars: Object, toVars: Object, stagger: number, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteAllScope?: any): any[]; - static staggerTo(targets: any, duration: number, vars: Object, stagger: number, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteAllScope?: any): any[]; - static to(target:Object, duration:number, vars:TweenConfig):TweenMax; - updateTo(vars: Object, resetDuration?: boolean): TweenMax; - yoyo(): boolean; - yoyo(value?: boolean): TweenMax; -} - -declare class TimelineLite extends SimpleTimeline { - constructor(vars?: Object); - - add(value: any, position?: any, align?: string, stagger?: number): TimelineLite; - addLabel(label: string, position: any): TimelineLite; - addPause(position?: any, callback?: Function, params?: any[], scope?: any): TimelineLite; - call(callback: Function, params?: any[], scope?: any, position?: any): TimelineLite; - clear(labels?: boolean): TimelineLite; - endTime(includeRepeats?: boolean): number; - static exportRoot(vars?: Object, omitDelayedCalls?: boolean): TimelineLite; - from(target: Object, duration: number, vars: Object, position?: any): TimelineLite; - fromTo(target: Object, duration: number, fromVars: Object, toVars: Object, position?: any): TimelineLite; - getChildren(nested?: boolean, tweens?: boolean, timelines?: boolean, ignoreBeforeTime?: number): (Tween | Timeline)[]; - getLabelTime(label: string): number; - getTweensOf(target: Object, nested?: boolean): Tween[]; - recent(): Animation; - remove(value: any): TimelineLite; - removeLabel(label: string): any; - set(target: Object, vars: Object, position?: any): TimelineLite; - shiftChildren(amount: number, adjustLabels?: boolean, ignoreBeforeTime?: number): TimelineLite; - staggerFrom(targets: any, duration: number, vars: Object, stagger?: number, position?: any, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteScope?: any): TimelineLite; - staggerFromTo(targets: any, duration: number, fromVars: Object, toVars: Object, stagger?: number, position?: any, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteAllScope?: any): TimelineLite; - staggerTo(targets: any, duration: number, vars: Object, stagger: number, position?: any, onCompleteAll?: Function, onCompleteAllParams?: any[], onCompleteAllScope?: any): TimelineLite; - to(target: Object, duration: number, vars: Object, position?: any): TimelineLite; - usesFrames(): boolean; -} - -declare class TimelineMax extends TimelineLite { - constructor(vars?: Object); - - addCallback(callback: Function, position: any, params?: any[], scope?: any): TimelineMax; - currentLabel(): string; - currentLabel(value: string): TimelineMax; - getActive(nested?: boolean, tweens?: boolean, timelines?: boolean): Tween | Timeline[]; - getLabelAfter(time: number): string; - getLabelBefore(time: number): string; - getLabelsArray(): {name: string; time: number;}[]; - removeCallback(callback: Function, timeOrLabel?: any): TimelineMax; - removePause(position: any): TimelineMax; - repeat(): number; - repeat(value: number): TimelineMax; - repeatDelay(): number; - repeatDelay(value: number): TimelineMax; - tweenFromTo(fromPosition: any, toPosition: any, vars?: Object): TweenLite; - tweenTo(position: any, vars?: Object): TweenLite; - yoyo(): boolean; - yoyo(value: boolean): TimelineMax; -} - -//com.greensock.easing -declare class Ease { - constructor(func:Function, extraParams:any[], type:number, power:number); - public getRatio(p: number): number; -} - -declare class EaseLookup { - public static find(name: string): Ease; -} - -declare class Back extends Ease { - public static easeIn: Back; - public static easeInOut: Back; - public static easeOut: Back; - public config(overshoot: number): Elastic; - -} -declare class Bounce extends Ease { - public static easeIn: Bounce; - public static easeInOut: Bounce; - public static easeOut: Bounce; -} -declare class Circ extends Ease { - public static easeIn: Circ; - public static easeInOut: Circ; - public static easeOut: Circ; -} -declare class Cubic extends Ease { - public static easeIn: Cubic; - public static easeInOut: Cubic; - public static easeOut: Cubic; -} - -declare class Elastic extends Ease { - public static easeIn: Elastic; - public static easeInOut: Elastic; - public static easeOut: Elastic; - public config(amplitude: number, period: number): Elastic; -} - -declare class Expo extends Ease { - public static easeIn: Expo; - public static easeInOut: Expo; - public static easeOut: Expo; -} - -declare class Linear extends Ease { - public static ease: Linear; - public static easeIn: Linear; - public static easeInOut: Linear; - public static easeNone: Linear; - public static easeOut: Linear; -} - -declare class Quad extends Ease { - public static easeIn: Quad; - public static easeInOut: Quad; - public static easeOut: Quad; -} - -declare class Quart extends Ease { - public static easeIn: Quart; - public static easeInOut: Quart; - public static easeOut: Quart; -} - -declare class Quint extends Ease { - public static easeIn: Quint; - public static easeInOut: Quint; - public static easeOut: Quint; -} - -declare class Sine extends Ease { - public static easeIn: Sine; - public static easeInOut: Sine; - public static easeOut: Sine; -} - -declare class SlowMo extends Ease { - public static ease: SlowMo; - public config(linearRatio: number, power: number, yoyoMode: boolean): SlowMo; -} - -declare class SteppedEase extends Ease { - constructor(staps: number); - public config(steps: number): SteppedEase; -} - -declare type RoughEaseConfig = { - clamp?: boolean; - points?: number; - randomize?: boolean; - strength?: number; - taper?: string; /* one of "in" | "out" | "both" | "none" */ - template?: Ease; -} - -declare class RoughEase extends Ease { - public static ease: RoughEase; - constructor(vars: RoughEaseConfig); - public config(steps: number): SteppedEase; -} - -//com.greensock.plugins -interface BezierPlugin extends TweenPlugin { - bezierThrough(values:any[], curviness?:number, quadratic?:boolean, correlate?:string, prepend?:Object, calcDifs?:boolean):Object; - cubicToQuadratic(a:number, b:number, c:number, d:number):any[]; - quadraticToCubic(a:number, b:number, c:number):Object; -} -interface ColorPropsPlugin extends TweenPlugin { - -} -interface CSSPlugin extends TweenPlugin { - -} -interface CSSRulePlugin extends TweenPlugin { - getRule(selector:string):Object; -} -interface EaselPlugin extends TweenPlugin { - -} -interface RaphaelPlugin extends TweenPlugin { - -} -interface RoundPropsPlugin extends TweenPlugin { - -} -interface ScrollToPlugin extends TweenPlugin { - -} -interface TweenPlugin { - activate(plugins:any[]):boolean; -} - -//com.greensock.easing -declare var Power0: typeof Linear; -declare var Power1: typeof Quad; -declare var Power2: typeof Cubic; -declare var Power3: typeof Quart; -declare var Power4: typeof Quint; -declare var Strong: typeof Quint; - -//com.greensock.plugins -declare var BezierPlugin:BezierPlugin; -declare var ColorPropsPlugin:ColorPropsPlugin; -declare var CSSPlugin:CSSPlugin; -declare var CSSRulePlugin:CSSRulePlugin; -declare var EaselPlugin:EaselPlugin; -declare var RaphaelPlugin:RaphaelPlugin; -declare var RoundPropsPlugin:RoundPropsPlugin; -declare var ScrollToPlugin:ScrollToPlugin; -declare var TweenPlugin:TweenPlugin; diff --git a/greensock/tsconfig.json b/greensock/tsconfig.json deleted file mode 100644 index 27e01ecd7b..0000000000 --- a/greensock/tsconfig.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts" - ] -} \ No newline at end of file From a134b0d05156a02d4119c1e0c790c6fe4e9f896a Mon Sep 17 00:00:00 2001 From: Richard Fox Date: Mon, 30 Jan 2017 03:06:06 +0100 Subject: [PATCH 019/797] Update gsap typings to match whole api --- gsap/Animation.d.ts | 90 +++++++++++++++++++++ gsap/Core.d.ts | 179 ------------------------------------------ gsap/Ease.d.ts | 117 +++++++++++++++++++++++++-- gsap/Plugins.d.ts | 15 ++++ gsap/Timeline.d.ts | 119 ++++++++++++++++++++++++++++ gsap/Tween.d.ts | 127 ++++++++++++++++++++++++++++++ gsap/TweenConfig.d.ts | 82 +++++++++++++++++++ gsap/TweenLite.d.ts | 122 ---------------------------- gsap/gsap-tests.ts | 4 +- gsap/index.d.ts | 15 ++-- gsap/tslint.json | 6 ++ 11 files changed, 563 insertions(+), 313 deletions(-) create mode 100644 gsap/Animation.d.ts delete mode 100644 gsap/Core.d.ts create mode 100644 gsap/Plugins.d.ts create mode 100644 gsap/Timeline.d.ts create mode 100644 gsap/Tween.d.ts create mode 100644 gsap/TweenConfig.d.ts delete mode 100644 gsap/TweenLite.d.ts create mode 100644 gsap/tslint.json diff --git a/gsap/Animation.d.ts b/gsap/Animation.d.ts new file mode 100644 index 0000000000..3c58f9b12a --- /dev/null +++ b/gsap/Animation.d.ts @@ -0,0 +1,90 @@ +declare namespace gsap { + export class Animation { + /** Base class for all TweenLite, TweenMax, TimelineLite, and TimelineMax classes, providing core methods/properties/() => voidality, but there is no reason to create an instance of this class directly. */ + constructor(duration?: number, vars?: any); + + /** A place to store any data you want (initially populated with vars.data if it exists). */ + data: any; + + /** [Read-only] Parent timeline. */ + timeline: SimpleTimeline; + + /** The vars object passed into the constructor which stores configuration variables like onComplete, onUpdate, etc. */ + vars: {}; + + /** Gets or sets the animation's initial delay which is the length of time in seconds (or frames for frames-based tweens) before the animation should begin. */ + delay(): number; + delay(value: number): Animation; + + /** Gets or sets the animation's duration, not including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */ + duration(): number; + duration(value: number): Animation; + + /** Gets or sets an event callback like "onComplete", "onUpdate", "onStart", "onReverseComplete" or "onRepeat" (onRepeat only applies to TweenMax or TimelineMax instances) along with any parameters that should be passed to that callback. */ + eventCallback(type: string): () => void; + eventCallback(type: string, callback: () => void, params?: any[], scope?: any): Animation; + + /** Clears any initialization data (like starting/ending values in tweens) which can be useful if, for example, you want to restart a tween without reverting to any previously recorded starting values. */ + invalidate(): Animation; + + /** Indicates whether or not the animation is currently active (meaning the virtual playhead is actively moving across this instance's time span and it is not paused, nor are any of its ancestor timelines). */ + isActive(): boolean; + + /** Kills the animation entirely or in part depending on the parameters. */ + kill(vars?: {}, target?: {}): Animation; + + /** Pauses the instance, optionally jumping to a specific time. */ + pause(atTime?: any, suppressEvents?: boolean): Animation; + + /** Gets or sets the animation's paused state which indicates whether or not the animation is currently paused. */ + paused(): boolean; + paused(value: boolean): Animation; + + /** Begins playing forward, optionally from a specific time (by default playback begins from wherever the playhead currently is). */ + play(from?: any, suppressEvents?: boolean): Animation; + + /** Gets or sets the animations's progress which is a value between 0 and 1 indicating the position of the virtual playhead (excluding repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). */ + progress(): number; + progress(value: number, suppressEvents?: boolean): Animation; + + /** Restarts and begins playing forward from the beginning. */ + restart(includeDelay?: boolean, suppressEvents?: boolean): Animation; + + /** Resumes playing without altering direction (forward or reversed), optionally jumping to a specific time first. */ + resume(from?: any, suppressEvents?: boolean): Animation; + + /** Reverses playback so that all aspects of the animation are oriented backwards including, for example, a tween's ease. */ + reverse(from?: any, suppressEvents?: boolean): Animation; + + /** Gets or sets the animation's reversed state which indicates whether or not the animation should be played backwards. */ + reversed(): boolean; + reversed(value: boolean): Animation; + + /** Jumps to a specific time without affecting whether or not the instance is paused or reversed. */ + seek(time: any, suppressEvents?: boolean): Animation; + + /** Gets or sets the time at which the animation begins on its parent timeline (after any delay that was defined). */ + startTime(): number; + startTime(value: number): Animation; + + /** Gets or sets the local position of the playhead (essentially the current time), described in seconds (or frames for frames-based animations) which will never be less than 0 or greater than the animation's duration. */ + time(): number; + time(value: number, suppressEvents?: boolean): Animation; + + /** Factor that's used to scale time in the animation where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. */ + timeScale(): number; + timeScale(value: number): Animation; + + /** Gets or sets the animation's total duration including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */ + totalDuration(): number; + totalDuration(value: number): Animation; + + /** Gets or sets the animation's total progress which is a value between 0 and 1 indicating the position of the virtual playhead (including repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). */ + totalProgress(): number; + totalProgress(value: number, suppressEvents?: boolean): Animation; + + /** Gets or sets the position of the playhead according to the totalDuration which includes any repeats and repeatDelays (only available in TweenMax and TimelineMax). */ + totalTime(): number; + totalTime(time: number, suppressEvents?: boolean): Animation; + } +} diff --git a/gsap/Core.d.ts b/gsap/Core.d.ts deleted file mode 100644 index 30b07a3e19..0000000000 --- a/gsap/Core.d.ts +++ /dev/null @@ -1,179 +0,0 @@ -declare class Animation { - /** Base class for all TweenLite, TweenMax, TimelineLite, and TimelineMax classes, providing core methods/properties/functionality, but there is no reason to create an instance of this class directly. */ - constructor(duration?: number, vars?: any); - - /** A place to store any data you want (initially populated with vars.data if it exists). */ - data: any; - - /** [Read-only] Parent timeline. */ - timeline: SimpleTimeLine; - - /** The vars object passed into the constructor which stores configuration variables like onComplete, onUpdate, etc. */ - vars: any; - - /** Gets or sets the animation's initial delay which is the length of time in seconds (or frames for frames-based tweens) before the animation should begin. */ - delay(): number; - delay(value: number): Animation; - - /** Gets or sets the animation's duration, not including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */ - duration(): number; - duration(value: number): Animation; - - /** Gets or sets an event callback like "onComplete", "onUpdate", "onStart", "onReverseComplete" or "onRepeat" (onRepeat only applies to TweenMax or TimelineMax instances) along with any parameters that should be passed to that callback. */ - eventCallback(type: string): Function; - eventCallback(type: string, callback: Function, params?: any[], scope?: any): Animation; - - /** Clears any initialization data (like starting/ending values in tweens) which can be useful if, for example, you want to restart a tween without reverting to any previously recorded starting values. */ - invalidate(): Animation; - - /** Indicates whether or not the animation is currently active (meaning the virtual playhead is actively moving across this instance's time span and it is not paused, nor are any of its ancestor timelines). */ - isActive(): boolean; - - /** Kills the animation entirely or in part depending on the parameters. */ - kill(vars?: any, target?: any): Animation; - - /** Pauses the instance, optionally jumping to a specific time. */ - pause(atTime?: any, suppressEvents?: boolean): Animation; - - /** Gets or sets the animation's paused state which indicates whether or not the animation is currently paused. */ - paused(): boolean; - paused(value: boolean): Animation; - - /** Begins playing forward, optionally from a specific time (by default playback begins from wherever the playhead currently is). */ - play(from?: any, suppressEvents?: boolean): Animation; - - /** Gets or sets the animations's progress which is a value between 0 and 1 indicating the position of the virtual playhead (excluding repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). */ - progress(): number; - progress(value: number, suppressEvents?: boolean): Animation; - - /** Restarts and begins playing forward from the beginning. */ - restart(includeDelay?: boolean, suppressEvents?: boolean): Animation; - - /** Resumes playing without altering direction (forward or reversed), optionally jumping to a specific time first. */ - resume(from?: any, suppressEvents?: boolean): Animation; - - /** Reverses playback so that all aspects of the animation are oriented backwards including, for example, a tween's ease. */ - reverse(from?: any, suppressEvents?: boolean): Animation; - - /** Gets or sets the animation's reversed state which indicates whether or not the animation should be played backwards. */ - reversed(): boolean; - reversed(value: boolean): Animation; - - /** Jumps to a specific time without affecting whether or not the instance is paused or reversed. */ - seek(time: any, suppressEvents?: boolean): Animation; - - /** Gets or sets the time at which the animation begins on its parent timeline (after any delay that was defined). */ - startTime(): number; - startTime(value: number): Animation; - - /** Gets or sets the local position of the playhead (essentially the current time), described in seconds (or frames for frames-based animations) which will never be less than 0 or greater than the animation's duration. */ - time(): number; - time(value: number, suppressEvents?: boolean): Animation; - - /** Factor that's used to scale time in the animation where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. */ - timeScale(): number; - timeScale(value: number): Animation; - - /** Gets or sets the animation's total duration including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */ - totalDuration(): number; - totalDuration(value: number): Animation; - - /** Gets or sets the animation's total progress which is a value between 0 and 1 indicating the position of the virtual playhead (including repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). */ - totalProgress(): number; - totalProgress(value: number, suppressEvents?: boolean): Animation; - - /** Gets or sets the position of the playhead according to the totalDuration which includes any repeats and repeatDelays (only available in TweenMax and TimelineMax). */ - totalTime(): number; - totalTime(time: number, suppressEvents?: boolean): Animation; -} - -declare class SimpleTimeLine extends Animation { - /** SimpleTimeline is the base class for TimelineLite and TimelineMax, providing the most basic timeline functionality and it is used for the root timelines in TweenLite but is only intended for internal use in the GreenSock tweening platform. It is meant to be very fast and lightweight. */ - constructor(vars?: any); - - /** If true, child tweens/timelines will be removed as soon as they complete. */ - autoRemoveChildren: boolean; - - /** Controls whether or not child tweens/timelines are repositioned automatically (changing their startTime) in order to maintain smooth playback when properties are changed on-the-fly. */ - smoothChildTiming: boolean; - - /** Adds a TweenLite, TweenMax, TimelineLite, or TimelineMax instance to the timeline at a specific time. */ - add(child: any, position?: any, align?: string, stagger?: number): SimpleTimeLine; - - /** renders */ - render(time: number, suppressEvents?: boolean, force?: boolean): SimpleTimeLine; - - // INHERITANCE FROM ANIMATION - - /** Gets or sets the animation's initial delay which is the length of time in seconds (or frames for frames-based tweens) before the animation should begin. */ - delay(): number; - delay(value: number): SimpleTimeLine; - - /** Gets or sets the animation's duration, not including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */ - duration(): number; - duration(value: number): SimpleTimeLine; - - /** Gets or sets an event callback like "onComplete", "onUpdate", "onStart", "onReverseComplete" or "onRepeat" (onRepeat only applies to TweenMax or TimelineMax instances) along with any parameters that should be passed to that callback. */ - eventCallback(type: string): Function; - eventCallback(type: string, callback: Function, params?: any[], scope?: any): SimpleTimeLine; - - /** Clears any initialization data (like starting/ending values in tweens) which can be useful if, for example, you want to restart a tween without reverting to any previously recorded starting values. */ - invalidate(): SimpleTimeLine; - - /** Kills the animation entirely or in part depending on the parameters. */ - kill(vars?: any, target?: any): SimpleTimeLine; - - /** Pauses the instance, optionally jumping to a specific time. */ - pause(atTime?: any, suppressEvents?: boolean): SimpleTimeLine; - - /** Gets or sets the animation's paused state which indicates whether or not the animation is currently paused. */ - paused(): boolean; - paused(value: boolean): SimpleTimeLine; - - /** Begins playing forward, optionally from a specific time (by default playback begins from wherever the playhead currently is). */ - play(from?: any, suppressEvents?: boolean): SimpleTimeLine; - - /** Gets or sets the animations's progress which is a value between 0 and 1 indicating the position of the virtual playhead (excluding repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). */ - progress(): number; - progress(value: number, suppressEvents?: boolean): SimpleTimeLine; - - /** Restarts and begins playing forward from the beginning. */ - restart(includeDelay?: boolean, suppressEvents?: boolean): SimpleTimeLine; - - /** Resumes playing without altering direction (forward or reversed), optionally jumping to a specific time first. */ - resume(from?: any, suppressEvents?: boolean): SimpleTimeLine; - - /** Reverses playback so that all aspects of the animation are oriented backwards including, for example, a tween's ease. */ - reverse(from?: any, suppressEvents?: boolean): SimpleTimeLine; - - /** Gets or sets the animation's reversed state which indicates whether or not the animation should be played backwards. */ - reversed(): boolean; - reversed(value: boolean): SimpleTimeLine; - - /** Jumps to a specific time without affecting whether or not the instance is paused or reversed. */ - seek(time: any, suppressEvents?: boolean): SimpleTimeLine; - - /** Gets or sets the time at which the animation begins on its parent timeline (after any delay that was defined). */ - startTime(): number; - startTime(value: number): SimpleTimeLine; - - /** Gets or sets the local position of the playhead (essentially the current time), described in seconds (or frames for frames-based animations) which will never be less than 0 or greater than the animation's duration. */ - time(): number; - time(value: number, suppressEvents?: boolean): SimpleTimeLine; - - /** Factor that's used to scale time in the animation where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. */ - timeScale(): number; - timeScale(value: number): SimpleTimeLine; - - /** Gets or sets the animation's total duration including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */ - totalDuration(): number; - totalDuration(value: number): SimpleTimeLine; - - /** Gets or sets the animation's total progress which is a value between 0 and 1 indicating the position of the virtual playhead (including repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). */ - totalProgress(): number; - totalProgress(value: number, suppressEvents?: boolean): SimpleTimeLine; - - /** Gets or sets the position of the playhead according to the totalDuration which includes any repeats and repeatDelays (only available in TweenMax and TimelineMax). */ - totalTime(): number; - totalTime(time: number, suppressEvents?: boolean): SimpleTimeLine; -} \ No newline at end of file diff --git a/gsap/Ease.d.ts b/gsap/Ease.d.ts index 932222ff56..e29c69c0db 100644 --- a/gsap/Ease.d.ts +++ b/gsap/Ease.d.ts @@ -1,6 +1,113 @@ -declare class Ease { - constructor(func?: Function, extraParams?: any[], type?: number, power?: number); +declare namespace gsap { + export class Ease { + constructor(func?: () => void, extraParams?: any[], type?: number, power?: number); - /** Translates the tween's progress ratio into the corresponding ease ratio. */ - getRatio(p: number): number; -} \ No newline at end of file + /** Translates the tween's progress ratio into the corresponding ease ratio. */ + getRatio(p: number): number; + } + + export class EaseLookup { + static find(name: string): Ease; + } + + export class Back extends Ease { + static easeIn: Back; + static easeInOut: Back; + static easeOut: Back; + config(overshoot: number): Elastic; + + } + export class Bounce extends Ease { + static easeIn: Bounce; + static easeInOut: Bounce; + static easeOut: Bounce; + } + export class Circ extends Ease { + static easeIn: Circ; + static easeInOut: Circ; + static easeOut: Circ; + } + export class Cubic extends Ease { + static easeIn: Cubic; + static easeInOut: Cubic; + static easeOut: Cubic; + } + + export class Elastic extends Ease { + static easeIn: Elastic; + static easeInOut: Elastic; + static easeOut: Elastic; + config(amplitude: number, period: number): Elastic; + } + + export class Expo extends Ease { + static easeIn: Expo; + static easeInOut: Expo; + static easeOut: Expo; + } + + export class Linear extends Ease { + static ease: Linear; + static easeIn: Linear; + static easeInOut: Linear; + static easeNone: Linear; + static easeOut: Linear; + } + + export class Quad extends Ease { + static easeIn: Quad; + static easeInOut: Quad; + static easeOut: Quad; + } + + export class Quart extends Ease { + static easeIn: Quart; + static easeInOut: Quart; + static easeOut: Quart; + } + + export class Quint extends Ease { + static easeIn: Quint; + static easeInOut: Quint; + static easeOut: Quint; + } + + export class Sine extends Ease { + static easeIn: Sine; + static easeInOut: Sine; + static easeOut: Sine; + } + + export class SlowMo extends Ease { + static ease: SlowMo; + config(linearRatio: number, power: number, yoyoMode: boolean): SlowMo; + } + + export class SteppedEase extends Ease { + constructor(staps: number); + config(steps: number): SteppedEase; + } + + export interface RoughEaseConfig { + clamp?: boolean; + points?: number; + randomize?: boolean; + strength?: number; + taper?: 'in' | 'out' | 'both' | 'none'; + template?: Ease; + }; + + export class RoughEase extends Ease { + static ease: RoughEase; + constructor(vars: RoughEaseConfig); + config(steps: number): SteppedEase; + } + + + export var Power0: typeof Linear; + export var Power1: typeof Quad; + export var Power2: typeof Cubic; + export var Power3: typeof Quart; + export var Power4: typeof Quint; + export var Strong: typeof Quint; +} diff --git a/gsap/Plugins.d.ts b/gsap/Plugins.d.ts new file mode 100644 index 0000000000..d7ceca7bf8 --- /dev/null +++ b/gsap/Plugins.d.ts @@ -0,0 +1,15 @@ +declare namespace gsap { + export interface BezierPlugin extends TweenPlugin { + bezierThrough(values: any[], curviness?: number, quadratic?: boolean, correlate?: string, prepend?: {}, calcDifs?: boolean): {}; + cubicToQuadratic(a: number, b: number, c: number, d: number): any[]; + quadraticToCubic(a: number, b: number, c: number): {}; + } + + export interface CSSRulePlugin extends TweenPlugin { + getRule(selector: string): {}; + } + + export interface TweenPlugin { + activate(plugins: any[]): boolean; + } +} diff --git a/gsap/Timeline.d.ts b/gsap/Timeline.d.ts new file mode 100644 index 0000000000..9d14b2d4c5 --- /dev/null +++ b/gsap/Timeline.d.ts @@ -0,0 +1,119 @@ +declare namespace gsap { + export type Timeline = SimpleTimeline | TimelineLite | TimelineMax; + + export class SimpleTimeline extends Animation { + /** SimpleTimeline is the base class for TimelineLite and TimelineMax, providing the most basic timeline () => voidality and it is used for the root timelines in TweenLite but is only intended for internal use in the GreenSock tweening platform. It is meant to be very fast and lightweight. */ + constructor(vars?: any); + + /** If true, child tweens/timelines will be removed as soon as they complete. */ + autoRemoveChildren: boolean; + + /** Controls whether or not child tweens/timelines are repositioned automatically (changing their startTime) in order to maintain smooth playback when properties are changed on-the-fly. */ + smoothChildTiming: boolean; + + /** Adds a TweenLite, TweenMax, TimelineLite, or TimelineMax instance to the timeline at a specific time. */ + add(child: any, position?: any, align?: string, stagger?: number): SimpleTimeline; + + /** renders */ + render(time: number, suppressEvents?: boolean, force?: boolean): SimpleTimeline; + } + + export class TimelineLite extends SimpleTimeline { + constructor(vars?: {}); + + /** Adds a tween, timeline, callback, or label (or an array of them) to the timeline. */ + add(value: any, position?: any, align?: string, stagger?: number): TimelineLite; + + /** Adds a label to the timeline, making it easy to mark important positions/times. */ + addLabel(label: string, position: any): TimelineLite; + + /** Inserts a special callback that pauses playback of the timeline at a particular time or label. */ + addPause(position?: any, callback?: () => void, params?: any[], scope?: any): TimelineLite; + + /** Adds a callback to the end of the timeline (or elsewhere using the "position" parameter) - this is a convenience method that accomplishes exactly the same thing as add( TweenLite.delayedCall(...) ) but with less code. */ + call(callback: () => void, params?: any[], scope?: any, position?: any): TimelineLite; + + /** Empties the timeline of all tweens, timelines, and callbacks (and optionally labels too). */ + clear(labels?: boolean): TimelineLite; + + /** Returns the time at which the animation will finish according to the parent timeline's local time. */ + endTime(includeRepeats?: boolean): number; + + /** Seamlessly transfers all tweens, timelines, and [optionally] delayed calls from the root timeline into a new TimelineLite so that you can perform advanced tasks on a seemingly global basis without affecting tweens/timelines that you create after the export. */ + static exportRoot(vars?: {}, omitDelayedCalls?: boolean): TimelineLite; + + /** Adds a TweenLite.from() tween to the end of the timeline (or elsewhere using the "position" parameter) - this is a convenience method that accomplishes exactly the same thing as add( TweenLite.from(...) ) but with less code. */ + from(target: {}, duration: number, vars: {}, position?: any): TimelineLite; + + /** Adds a TweenLite.fromTo() tween to the end of the timeline - this is a convenience method that accomplishes exactly the same thing as add( TweenLite.fromTo(...) ) but with less code. */ + fromTo(target: {}, duration: number, fromVars: {}, toVars: {}, position?: any): TimelineLite; + + /** Returns an array containing all the tweens and/or timelines nested in this timeline. */ + getChildren(nested?: boolean, tweens?: boolean, timelines?: boolean, ignoreBeforeTime?: number): Array; + + /** Returns the time associated with a particular label. */ + getLabelTime(label: string): number; + + /** Returns the tweens of a particular object that are inside this timeline. */ + getTweensOf(target: {}, nested?: boolean): Tween[]; + + /** Clears any initialization data (like starting/ending values in tweens) which can be useful if, for example, you want to restart a tween without reverting to any previously recorded starting values. */ + invalidate(): TimelineLite; + + /** Returns the most recently added child tween/timeline/callback regardless of its position in the timeline. */ + recent(): Animation; + + /** Removes a tween, timeline, callback, or label (or array of them) from the timeline. */ + remove(value: any): TimelineLite; + + /** Removes a label from the timeline and returns the time of that label. */ + removeLabel(label: string): any; + + /** Jumps to a specific time (or label) without affecting whether or not the instance is paused or reversed. */ + seek(position: string | number, supressEvents: boolean): TimelineLite; + + /** Adds a zero-duration tween to the end of the timeline (or elsewhere using the "position" parameter) that sets values immediately (when the virtual playhead reaches that position on the timeline) - this is a convenience method that accomplishes exactly the same thing as add( TweenLite.to(target, 0, {...}) ) but with less code. */ + set(target: {}, vars: {}, position?: any): TimelineLite; + + /** Shifts the startTime of the timeline's children by a certain amount and optionally adjusts labels too. */ + shiftChildren(amount: number, adjustLabels?: boolean, ignoreBeforeTime?: number): TimelineLite; + + /** Tweens an array of targets from a common set of destination values (using the current values as the destination), but staggers their start times by a specified amount of time, creating an evenly-spaced sequence with a surprisingly small amount of code. */ + staggerFrom(targets: any, duration: number, vars: {}, stagger?: number, position?: any, onCompleteAll?: () => void, onCompleteAllParams?: any[], onCompleteScope?: any): TimelineLite; + + /** Tweens an array of targets from and to a common set of values, but staggers their start times by a specified amount of time, creating an evenly-spaced sequence with a surprisingly small amount of code. */ + staggerFromTo(targets: any, duration: number, fromVars: {}, toVars: {}, stagger?: number, position?: any, onCompleteAll?: () => void, onCompleteAllParams?: any[], onCompleteAllScope?: any): TimelineLite; + + /** Tweens an array of targets to a common set of destination values, but staggers their start times by a specified amount of time, creating an evenly-spaced sequence with a surprisingly small amount of code. */ + staggerTo(targets: any, duration: number, vars: {}, stagger: number, position?: any, onCompleteAll?: () => void, onCompleteAllParams?: any[], onCompleteAllScope?: any): TimelineLite; + + /** Adds a TweenLite.to() tween to the end of the timeline (or elsewhere using the "position" parameter) - this is a convenience method that accomplishes exactly the same thing as add( TweenLite.to(...) ) but with less code. */ + to(target: {}, duration: number, vars: {}, position?: any): TimelineLite; + usesFrames(): boolean; + + /** If true, the timeline's timing mode is frames-based instead of seconds. */ + useFrames(): boolean; + } + + export class TimelineMax extends TimelineLite { + constructor(vars?: {}); + + addCallback(callback: () => void, position: any, params?: any[], scope?: any): TimelineMax; + currentLabel(): string; + currentLabel(value: string): TimelineMax; + getActive(nested?: boolean, tweens?: boolean, timelines?: boolean): Tween | Timeline[]; + getLabelAfter(time: number): string; + getLabelBefore(time: number): string; + getLabelsArray(): Array<{ name: string; time: number; }>; + removeCallback(callback: () => void, timeOrLabel?: any): TimelineMax; + removePause(position: any): TimelineMax; + repeat(): number; + repeat(value: number): TimelineMax; + repeatDelay(): number; + repeatDelay(value: number): TimelineMax; + tweenFromTo(fromPosition: any, toPosition: any, vars?: {}): TweenLite; + tweenTo(position: any, vars?: {}): TweenLite; + yoyo(): boolean; + yoyo(value: boolean): TimelineMax; + } +} diff --git a/gsap/Tween.d.ts b/gsap/Tween.d.ts new file mode 100644 index 0000000000..b11260ef4c --- /dev/null +++ b/gsap/Tween.d.ts @@ -0,0 +1,127 @@ +declare namespace gsap { + export type Tween = TweenLite | TweenMax; + export class TweenLite extends Animation { + constructor(target: any, duration: number, vars: any); + + /** Provides An easy way to change the default easing equation. */ + static defaultEase: Ease; + + /** Provides An easy way to change the default overwrite mode. */ + static defaultOverwrite: string; + + /** The selector engine (like jQuery) that should be used when a tween receives a string as its target, like TweenLite.to("#myID", 1, {x:"100px"}). */ + static selector: (query: string) => any; + + /** Target object (or array of objects) whose properties the tween affects. */ + readonly target: any; + + /** The object that dispatches a "tick" event each time the engine updates, making it easy for you to add your own listener(s) to run custom logic after each update (great for game developers). */ + static ticker: any; + + /** Provides a simple way to call a () => void after a set amount of time (or frames). */ + static delayedCall(delay: number, callback: () => void, params?: any[], scope?: any, useFrames?: boolean): TweenLite; + + /** Static method for creating a TweenLite instance that tweens backwards - you define the BEGINNING values and the current values are used as the destination values which is great for doing things like animating objects onto the screen because you can set them up initially the way you want them to look at the end of the tween and then animate in from elsewhere. */ + static from(target: any, duration: number, vars: any): TweenLite; + + /** Static method for creating a TweenLite instance that allows you to define both the starting and ending values (as opposed to to() and from() tweens which are based on the target's current values at one end or the other). */ + static fromTo(target: any, duration: number, fromVars: any, toVars: any): TweenLite; + + /** Returns an array containing all the tweens of a particular target (or group of targets) that have not been released for garbage collection yet which typically happens within a few seconds after the tween completes. */ + static getTweensOf(target: any, onlyActive?: boolean): TweenLite[]; + + /** [override] Clears any initialization data (like starting/ending values in tweens) which can be useful if, for example, you want to restart a tween without reverting to any previously recorded starting values. */ + invalidate(): TweenLite; + + /** Immediately kills all of the delayedCalls to a particular () => void. */ + static killDelayedCallsTo(func: () => void): void; + + /** Kills all the tweens (or specific tweening properties) of a particular object or delayedCalls to a particular () => void. */ + static killTweensOf(target: any, onlyActive?: boolean, vars?: any): void; + + /** Permits you to control what happens when too much time elapses between two ticks (updates) of the engine, adjusting the core timing mechanism to compensate and avoid "jumps". */ + static lagSmoothing(threshold: number, adjustedLag: number): void; + + /** Forces a render of all active tweens which can be useful if, for example, you set up a bunch of from() tweens and then you need to force an immediate render (even of "lazy" tweens) to avoid a brief delay before things render on the very next tick. */ + static render(): void; + + /** Immediately sets properties of the target accordingly - essentially a zero-duration to() tween with a more intuitive name. */ + static set(target: any, vars: any): TweenLite; + + /** Static method for creating a TweenLite instance that animates to the specified destination values (from the current values). */ + static to(target: any, duration: number, vars: any): TweenLite; + } + + export class TweenMax extends TweenLite { + constructor(target: {}, duration: number, vars: {}); + + /** Provides a simple way to call a () => void after a set amount of time (or frames). */ + static delayedCall(delay: number, callback: () => void, params?: any[], scope?: {}, useFrames?: boolean): TweenMax; + + /** Static method for creating a TweenMax instance that tweens backwards - you define the BEGINNING values and the current values are used as the destination values which is great for doing things like animating objects onto the screen because you can set them up initially the way you want them to look at the end of the tween and then animate in from elsewhere. */ + static from(target: {}, duration: number, vars: {}): TweenMax; + + /** Static method for creating a TweenMax instance that allows you to define both the starting and ending values (as opposed to to() and from() tweens which are based on the target's current values at one end or the other). */ + static fromTo(target: {}, duration: number, fromVars: {}, toVars: {}): TweenMax; + + /** Returns an array containing all tweens (and optionally timelines too, excluding the root timelines). */ + static getAllTweens(includeTimelines?: boolean): Tween[]; + + /** Returns an array containing all the tweens of a particular target (or group of targets) that have not been released for garbage collection yet which typically happens within a few seconds after the tween completes. */ + static getTweensOf(target: {}): Tween[]; + + /** Gets or sets the global timeScale which is a multiplier that affects ALL animations equally. This is a great way to globally speed up or slow down all animations at once. */ + static globalTimeScale(value: number): void; + + /** Reports whether or not a particular object is actively tweening. */ + static isTweening(target: {}): boolean; + + /** Kills all tweens and/or delayedCalls/callbacks, and/or timelines, optionally forcing them to completion first. */ + static killAll(complete?: boolean, tweens?: boolean, delayedCalls?: boolean, timelines?: boolean): void; + + /** Kills all tweens of the children of a particular DOM element, optionally forcing them to completion first. */ + static killChildTweensOf(parent: any, complete?: boolean): void; + + /** Immediately kills all of the delayedCalls to a particular () => void. */ + static killDelayedCallsTo(func: () => void): void; + + /** Kills all the tweens (or specific tweening properties) of a particular object or the delayedCalls to a particular () => void. */ + static killTweensOf(target: {}, vars?: {}): void; + + /** Pauses all tweens and/or delayedCalls/callbacks and/or timelines. */ + static pauseAll(tweens?: boolean, delayedCalls?: boolean, timelines?: boolean): void; + + /** Gets or sets the tween's progress which is a value between 0 and 1 indicating the position of the virtual playhead (excluding repeats) where 0 is at the beginning, 0.5 is halfway complete, and 1 is complete. */ + repeat(): number; + repeat(value: number): TweenMax; + + /** Gets or sets the amount of time in seconds (or frames for frames-based tweens) between repeats. */ + repeatDelay(): number; + repeatDelay(value: number): TweenMax; + + /** Resumes all paused tweens and/or delayedCalls/callbacks and/or timelines. */ + static resumeAll(tweens?: boolean, delayedCalls?: boolean, timelines?: boolean): void; + + /** Immediately sets properties of the target accordingly - essentially a zero-duration to() tween with a more intuitive name. */ + static set(target: {}, vars: {}): TweenMax; + + /** Tweens an array of targets from a common set of destination values (using the current values as the destination), but staggers their start times by a specified amount of time, creating an evenly-spaced sequence with a surprisingly small amount of code. */ + static staggerFrom(targets: any, duration: number, vars: {}, stagger: number, onCompleteAll?: () => void, onCompleteAllParams?: any[], onCompleteAllScope?: any): any[]; + + /** Tweens an array of targets from a common set of destination values to a common set of destination values, but staggers their start times by a specified amount of time, creating an evenly-spaced sequence with a surprisingly small amount of code. */ + static staggerFromTo(targets: any, duration: number, fromVars: {}, toVars: {}, stagger: number, onCompleteAll?: () => void, onCompleteAllParams?: any[], onCompleteAllScope?: any): any[]; + + /** Tweens an array of targets to a common set of destination values, but staggers their start times by a specified amount of time, creating an evenly-spaced sequence with a surprisingly small amount of code. */ + static staggerTo(targets: any, duration: number, vars: {}, stagger: number, onCompleteAll?: () => void, onCompleteAllParams?: any[], onCompleteAllScope?: any): any[]; + + /** Static method for creating a TweenMax instance that animates to the specified destination values (from the current values). */ + static to(target: {}, duration: number, vars: TweenConfig): TweenMax; + + /** Updates tweening values on the fly so that they appear to seamlessly change course even if the tween is in-progress. */ + updateTo(vars: {}, resetDuration?: boolean): TweenMax; + + /** Gets or sets the tween's yoyo state, where true causes the tween to go back and forth, alternating backward and forward on each repeat. */ + yoyo(): boolean; + yoyo(value?: boolean): TweenMax; + } +} diff --git a/gsap/TweenConfig.d.ts b/gsap/TweenConfig.d.ts new file mode 100644 index 0000000000..59c472bea2 --- /dev/null +++ b/gsap/TweenConfig.d.ts @@ -0,0 +1,82 @@ +declare namespace gsap { + export interface TweenConfig { + + /** Amount of delay in seconds (or frames for frames-based tweens) before the animation should begin.*/ + delay?: number; + + /** Ease (or () => void or String) - You can choose from various eases to control the rate of change during the animation, giving it a specific "feel". */ + ease?: Ease; + + yoyo?: boolean; + + /** If true, the tween will pause itself immediately upon creation. */ + paused?: boolean; + + /** Controls how (and if) other tweens of the same target are overwritten. There are several modes to choose from, but "auto" is the default (although you can change the default mode using theTweenLite.defaultOverwrite property) */ + overwrite?: string | number; + + /** A () => void that should be called when the animation has completed. */ + onComplete?: () => void; + + /** An Array of parameters to pass the onComplete () => void */ + onCompleteParams?: any[]; + + /** Defines the scope of the onComplete () => void (what "this" refers to inside that () => void). */ + onCompleteScope?: {}; + + /** Normally when you create a tween, it begins rendering on the very next frame (update cycle) unless you specify a delay. However, if you prefer to force the tween to render immediately when it is created, setimmediateRender to true. Or to prevent a from() from rendering immediately, set immediateRender to false. By default, from() tweens set immediateRender to true. */ + immediateRender?: boolean; + + /** A () => void that should be called when the tween has reached its beginning again from the reverse direction. */ + onReverseComplete?: () => void; + + /** An Array of parameters to pass the onReverseComplete () => void. */ + onReverseCompleteParams?: any[]; + + /** Defines the scope of the onReverseComplete () => void (what "this" refers to inside that () => void). */ + onReverseCompleteScope?: {}; + + /** A () => void that should be called when the tween begins (when its time changes from 0 to some other value which can happen more than once if the tween is restarted multiple times). */ + onStart?: () => void; + + /** An Array of parameters to pass the onStart () => void. */ + onStartParams?: any[]; + + /** Defines the scope of the onStart () => void (what "this" refers to inside that () => void). */ + onStartScope?: {}; + + /** A () => void that should be called every time the animation updates (on every frame while the animation is active). */ + onUpdate?: () => void; + + /** An Array of parameters to pass the onUpdate () => void. */ + onUpdateParams?: any[]; + + /** Defines the scope of the onUpdate () => void (what "this" refers to inside that () => void). */ + onUpdateScope?: {}; + + /** If useFrames is true, the tweens's timing will be based on frames instead of seconds because it is intially added to the root frames-based timeline. This causes both its duration and delay to be based on frames. An animations's timing mode is always determined by its parent timeline. */ + useFrames?: boolean; + + /** When a tween renders for the very first time and reads its starting values, GSAP will automatically "lazy render" that particular tick by default, meaning it will try to delay the rendering (writing of values) until the very end of the "tick" cycle which can improve performance because it avoids the read/write/read/write layout thrashing that some browsers do. If you would like to disable lazy rendering for a particular tween, you can set lazy:false. Or, since zero-duration tweens do not lazy-render by default, you can specifically give it permission to lazy-render by setting lazy:true like TweenLite.set(element, {opacity:0, lazy:true});. In most cases, you won't need to set lazy. */ + lazy?: boolean; + + /** A () => void that should be called when the tween gets overwritten by another tween. */ + onOverwrite?: () => void; + + /** If true atuomatically populates the css property for tween on DOM elements */ + autoCSS?: boolean; + + /** The scope to be used for all of the callbacks (onStart, onUpdate, onComplete, etc.). The scope is what "this" refers to inside any of the callbacks. */ + callbackScope?: {}; + + startAt?: {}; + + repeat?: number; + + repeatDelay?: number; + + onRepeat?: () => void; + + onRepeatScope?: {}; + } +} diff --git a/gsap/TweenLite.d.ts b/gsap/TweenLite.d.ts deleted file mode 100644 index 21150acf22..0000000000 --- a/gsap/TweenLite.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -declare class TweenLite { - constructor(target: any, duration: number, vars: any); - - /** Provides An easy way to change the default easing equation. */ - static defaultEase: Ease; - - /** Provides An easy way to change the default overwrite mode. */ - static defaultOverwrite: string; - - /** The selector engine (like jQuery) that should be used when a tween receives a string as its target, like TweenLite.to("#myID", 1, {x:"100px"}). */ - static selector: (query: string) => any; - - /** [READ-ONLY] Target object (or array of objects) whose properties the tween affects. */ - target: any; - - /** The object that dispatches a "tick" event each time the engine updates, making it easy for you to add your own listener(s) to run custom logic after each update (great for game developers). */ - static ticker: any; - - /** Provides a simple way to call a function after a set amount of time (or frames). */ - static delayedCall(delay: number, callback: Function, params?: any[], scope?: any, useFrames?: boolean): TweenLite; - - /** Static method for creating a TweenLite instance that tweens backwards - you define the BEGINNING values and the current values are used as the destination values which is great for doing things like animating objects onto the screen because you can set them up initially the way you want them to look at the end of the tween and then animate in from elsewhere. */ - static from(target: any, duration: number, vars: any): TweenLite; - - /** Static method for creating a TweenLite instance that allows you to define both the starting and ending values (as opposed to to() and from() tweens which are based on the target's current values at one end or the other). */ - static fromTo(target: any, duration: number, fromVars: any, toVars: any): TweenLite; - - /** Returns an array containing all the tweens of a particular target (or group of targets) that have not been released for garbage collection yet which typically happens within a few seconds after the tween completes. */ - static getTweensOf(target: any, onlyActive?: boolean): TweenLite[]; - - /** [override] Clears any initialization data (like starting/ending values in tweens) which can be useful if, for example, you want to restart a tween without reverting to any previously recorded starting values. */ - invalidate(): TweenLite; - - /** Immediately kills all of the delayedCalls to a particular function. */ - static killDelayedCallsTo(func: Function): void; - - /** Kills all the tweens (or specific tweening properties) of a particular object or delayedCalls to a particular function. */ - static killTweensOf(target: any, onlyActive?: boolean, vars?: any): void; - - /** Permits you to control what happens when too much time elapses between two ticks (updates) of the engine, adjusting the core timing mechanism to compensate and avoid "jumps". */ - static lagSmoothing(threshold: number, adjustedLag: number): void; - - /** Forces a render of all active tweens which can be useful if, for example, you set up a bunch of from() tweens and then you need to force an immediate render (even of "lazy" tweens) to avoid a brief delay before things render on the very next tick. */ - static render(): void; - - /** Immediately sets properties of the target accordingly - essentially a zero-duration to() tween with a more intuitive name. */ - static set(target: any, vars: any): TweenLite; - - /** Static method for creating a TweenLite instance that animates to the specified destination values (from the current values). */ - static to(target: any, duration: number, vars: any): TweenLite; - - // INHERITANCE FROM ANIMATION - - /** Gets or sets the animation's initial delay which is the length of time in seconds (or frames for frames-based tweens) before the animation should begin. */ - delay(): number; - delay(value: number): TweenLite; - - /** Gets or sets the animation's duration, not including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */ - duration(): number; - duration(value: number): TweenLite; - - /** Gets or sets an event callback like "onComplete", "onUpdate", "onStart", "onReverseComplete" or "onRepeat" (onRepeat only applies to TweenMax or TimelineMax instances) along with any parameters that should be passed to that callback. */ - eventCallback(type: string): Function; - eventCallback(type: string, callback: Function, params?: any[], scope?: any): TweenLite; - - /** Kills the animation entirely or in part depending on the parameters. */ - kill(vars?: any, target?: any): TweenLite; - - /** Pauses the instance, optionally jumping to a specific time. */ - pause(atTime?: any, suppressEvents?: boolean): TweenLite; - - /** Gets or sets the animation's paused state which indicates whether or not the animation is currently paused. */ - paused(): boolean; - paused(value: boolean): TweenLite; - - /** Begins playing forward, optionally from a specific time (by default playback begins from wherever the playhead currently is). */ - play(from?: any, suppressEvents?: boolean): TweenLite; - - /** Gets or sets the animations's progress which is a value between 0 and 1 indicating the position of the virtual playhead (excluding repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). */ - progress(): number; - progress(value: number, suppressEvents?: boolean): TweenLite; - - /** Restarts and begins playing forward from the beginning. */ - restart(includeDelay?: boolean, suppressEvents?: boolean): TweenLite; - - /** Resumes playing without altering direction (forward or reversed), optionally jumping to a specific time first. */ - resume(from?: any, suppressEvents?: boolean): TweenLite; - - /** Reverses playback so that all aspects of the animation are oriented backwards including, for example, a tween's ease. */ - reverse(from?: any, suppressEvents?: boolean): TweenLite; - - /** Gets or sets the animation's reversed state which indicates whether or not the animation should be played backwards. */ - reversed(): boolean; - reversed(value: boolean): TweenLite; - - /** Jumps to a specific time without affecting whether or not the instance is paused or reversed. */ - seek(time: any, suppressEvents?: boolean): TweenLite; - - /** Gets or sets the time at which the animation begins on its parent timeline (after any delay that was defined). */ - startTime(): number; - startTime(value: number): TweenLite; - - /** Gets or sets the local position of the playhead (essentially the current time), described in seconds (or frames for frames-based animations) which will never be less than 0 or greater than the animation's duration. */ - time(): number; - time(value: number, suppressEvents?: boolean): TweenLite; - - /** Factor that's used to scale time in the animation where 1 = normal speed (the default), 0.5 = half speed, 2 = double speed, etc. */ - timeScale(): number; - timeScale(value: number): TweenLite; - - /** Gets or sets the animation's total duration including any repeats or repeatDelays (which are only available in TweenMax and TimelineMax). */ - totalDuration(): number; - totalDuration(value: number): TweenLite; - - /** Gets or sets the animation's total progress which is a value between 0 and 1 indicating the position of the virtual playhead (including repeats) where 0 is at the beginning, 0.5 is at the halfway point, and 1 is at the end (complete). */ - totalProgress(): number; - totalProgress(value: number, suppressEvents?: boolean): TweenLite; - - /** Gets or sets the position of the playhead according to the totalDuration which includes any repeats and repeatDelays (only available in TweenMax and TimelineMax). */ - totalTime(): number; - totalTime(time: number, suppressEvents?: boolean): TweenLite; -} \ No newline at end of file diff --git a/gsap/gsap-tests.ts b/gsap/gsap-tests.ts index 49d5ce19d0..f811ac1089 100644 --- a/gsap/gsap-tests.ts +++ b/gsap/gsap-tests.ts @@ -1,8 +1,8 @@ - +import { TweenLite } from 'gsap'; var tween = TweenLite .to(document.getElementById('some-div'), 1, { width: '200px', height: '200px' }) - .seek(0.5); \ No newline at end of file + .seek(0.5); diff --git a/gsap/index.d.ts b/gsap/index.d.ts index eb493dc9ec..cebefcf1c9 100644 --- a/gsap/index.d.ts +++ b/gsap/index.d.ts @@ -1,10 +1,15 @@ -// Type definitions for GSAP v1.19 +// Type definitions for GSAP 1.19 // Project: http://greensock.com/ -// Definitions by: VILIC VANE +// Definitions by: VILIC VANE , Robert S , Richard Fox // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// /// -/// +/// +/// +/// +/// -export = TweenLite; +declare module 'gsap' { + export = gsap; +} diff --git a/gsap/tslint.json b/gsap/tslint.json new file mode 100644 index 0000000000..0b14fdec0d --- /dev/null +++ b/gsap/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "no-single-declare-module": false + } +} From 8826814f37249f56ccd08d19d578ed20b4bf2a24 Mon Sep 17 00:00:00 2001 From: Richard Fox Date: Mon, 30 Jan 2017 03:14:01 +0100 Subject: [PATCH 020/797] Bring in: GreenSock TweenMax fix RoughEase #14193 --- gsap/Ease.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsap/Ease.d.ts b/gsap/Ease.d.ts index e29c69c0db..49dde5fc91 100644 --- a/gsap/Ease.d.ts +++ b/gsap/Ease.d.ts @@ -100,7 +100,7 @@ declare namespace gsap { export class RoughEase extends Ease { static ease: RoughEase; constructor(vars: RoughEaseConfig); - config(steps: number): SteppedEase; + config(steps?: number): RoughEase; } From 2bcf79509ac7665b7a570ede67e9b1f4094296c3 Mon Sep 17 00:00:00 2001 From: Richard Fox Date: Mon, 30 Jan 2017 13:03:08 +0100 Subject: [PATCH 021/797] Correct semi-colon in Ease typings --- gsap/Ease.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsap/Ease.d.ts b/gsap/Ease.d.ts index 49dde5fc91..ea2d7e1d84 100644 --- a/gsap/Ease.d.ts +++ b/gsap/Ease.d.ts @@ -95,7 +95,7 @@ declare namespace gsap { strength?: number; taper?: 'in' | 'out' | 'both' | 'none'; template?: Ease; - }; + } export class RoughEase extends Ease { static ease: RoughEase; From aa0f3acea5765170b6f50a33fb1effcbb5268bee Mon Sep 17 00:00:00 2001 From: Brandon Ayers Date: Wed, 1 Feb 2017 16:20:39 -0800 Subject: [PATCH 022/797] Update AjaxFunction interface The interface was incorrectly defined making it impossible in typescript to use the transport function defined inside the ajax option. Select2 calls the transport function with 3 parameters: 1. The JQueryAjaxSettings object 2. A success callback to notify select2 of a successful response 3. A failure callback to notify select2 of a failed response See https://github.com/select2/select2/blob/062c6c3af5f0f39794c34c0a343a3857e587cc97/src/js/select2/data/ajax.js#L68 --- select2/index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/select2/index.d.ts b/select2/index.d.ts index 2f6fea9063..82b8dfbcf5 100644 --- a/select2/index.d.ts +++ b/select2/index.d.ts @@ -14,8 +14,7 @@ interface Select2QueryOptions { } interface AjaxFunction { - (settings: JQueryAjaxSettings): JQueryXHR; - (url: string, settings?: JQueryAjaxSettings): JQueryXHR; + (settings: JQueryAjaxSettings, success?: (data: any) => null, failure?: () => null): JQueryXHR; } interface Select2AjaxOptions { From b24d2ab7d9003eff940302e77edec81a2375c117 Mon Sep 17 00:00:00 2001 From: Olmo del Corral Date: Thu, 2 Feb 2017 21:14:23 +0100 Subject: [PATCH 023/797] rename language to culture in numbro --- numbro/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numbro/index.d.ts b/numbro/index.d.ts index ccb0892a0d..55234aad81 100644 --- a/numbro/index.d.ts +++ b/numbro/index.d.ts @@ -24,7 +24,7 @@ interface Numbro { (value?: any): Numbro; version: string; isNumbro: boolean; - language(key: string, values?: NumbroLanguage): Numbro; + culture(key: string, values?: NumbroLanguage): Numbro; zeroFormat(format: string): string; clone(): Numbro; format(inputString?: string): string; From d36bcc95df700dd1a0d902355470d9a6d8604116 Mon Sep 17 00:00:00 2001 From: Jonathon Munsell Date: Fri, 3 Feb 2017 15:46:27 -0500 Subject: [PATCH 024/797] Added missing optional `hasTrigger` model option to sequelize type definitions. --- sequelize/index.d.ts | 5 +++++ sequelize/sequelize-tests.ts | 21 +++++++++++++++++++++ sequelize/v3/index.d.ts | 5 +++++ sequelize/v3/sequelize-tests.ts | 21 +++++++++++++++++++++ 4 files changed, 52 insertions(+) diff --git a/sequelize/index.d.ts b/sequelize/index.d.ts index 6ff2c3e6df..e026ac1dcc 100644 --- a/sequelize/index.d.ts +++ b/sequelize/index.d.ts @@ -4879,6 +4879,11 @@ declare namespace sequelize { */ underscoredAll?: boolean; + /** + * Indicates if the model's table has a trigger associated with it. Default false. + */ + hasTrigger?: boolean; + /** * If freezeTableName is true, sequelize will not try to alter the DAO name to get the table name. * Otherwise, the dao name will be pluralized. Default false. diff --git a/sequelize/sequelize-tests.ts b/sequelize/sequelize-tests.ts index 973f98076c..4c404cb0af 100644 --- a/sequelize/sequelize-tests.ts +++ b/sequelize/sequelize-tests.ts @@ -1529,6 +1529,27 @@ s.define( 'User', { paranoid : true } ); +s.define( 'TriggerTest', { + id : { + type : Sequelize.INTEGER, + field : 'test_id', + autoIncrement : true, + primaryKey : true, + validate : { + min : 1 + } + }, + title : { + allowNull : false, + type : Sequelize.STRING( 255 ), + field : 'test_title' + } +}, { + timestamps : false, + underscored : true, + hasTrigger : true +} ); + // // Transaction // ~~~~~~~~~~~~~ diff --git a/sequelize/v3/index.d.ts b/sequelize/v3/index.d.ts index 9142dc9a6c..fb73cd94bf 100644 --- a/sequelize/v3/index.d.ts +++ b/sequelize/v3/index.d.ts @@ -4843,6 +4843,11 @@ declare namespace sequelize { */ underscoredAll?: boolean; + /** + * Indicates if the model's table has a trigger associated with it. Default false. + */ + hasTrigger?: boolean; + /** * If freezeTableName is true, sequelize will not try to alter the DAO name to get the table name. * Otherwise, the dao name will be pluralized. Default false. diff --git a/sequelize/v3/sequelize-tests.ts b/sequelize/v3/sequelize-tests.ts index 04a55062c8..ef90600e91 100644 --- a/sequelize/v3/sequelize-tests.ts +++ b/sequelize/v3/sequelize-tests.ts @@ -1515,6 +1515,27 @@ s.define( 'User', { paranoid : true } ); +s.define( 'TriggerTest', { + id : { + type : Sequelize.INTEGER, + field : 'test_id', + autoIncrement : true, + primaryKey : true, + validate : { + min : 1 + } + }, + title : { + allowNull : false, + type : Sequelize.STRING( 255 ), + field : 'test_title' + } +}, { + timestamps : false, + underscored : true, + hasTrigger : true +} ); + // // Transaction // ~~~~~~~~~~~~~ From e865e6c5cb9d6801d824672e941d5ed2ac52c7ed Mon Sep 17 00:00:00 2001 From: Tom Esterez Date: Sat, 4 Feb 2017 13:21:14 -0500 Subject: [PATCH 025/797] lodash: better definition for `flow` Add a definition for `flow` with first function having 0 arguments. --- lodash/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lodash/index.d.ts b/lodash/index.d.ts index 00de563bbb..d00da77ca6 100644 --- a/lodash/index.d.ts +++ b/lodash/index.d.ts @@ -10387,6 +10387,13 @@ declare namespace _ { * @param funcs Functions to invoke. * @return Returns the new function. */ + // 0-argument first function + flow(f1: () => R1, f2: (a: R1) => R2): () => R2; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): () => R3; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): () => R4; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): () => R5; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): () => R6; + flow(f1: () => R1, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): () => R7; // 1-argument first function flow(f1: (a1: A1) => R1, f2: (a: R1) => R2): (a1: A1) => R2; flow(f1: (a1: A1) => R1, f2: (a: R1) => R2, f3: (a: R2) => R3): (a1: A1) => R3; From 3d7bd59ab883c7cf0e1ada6c22671b2dde591774 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sun, 5 Feb 2017 15:23:43 +0900 Subject: [PATCH 026/797] TSTL, Samchon & Packer --- 3d-bin-packing/3d-bin-packing-tests.ts | 2 +- 3d-bin-packing/index.d.ts | 398 +- samchon-framework/index.d.ts | 10808 +------------------- samchon/index.d.ts | 8403 +++++++++++++++ samchon/samchon-tests.ts | 2 + samchon/tsconfig.json | 23 + tstl/index.d.ts | 11136 ++++++++++++++++++++ tstl/tsconfig.json | 23 + tstl/tstl-tests.ts | 2 + typescript-stl/index.d.ts | 12486 +---------------------- 10 files changed, 19742 insertions(+), 23541 deletions(-) create mode 100644 samchon/index.d.ts create mode 100644 samchon/samchon-tests.ts create mode 100644 samchon/tsconfig.json create mode 100644 tstl/index.d.ts create mode 100644 tstl/tsconfig.json create mode 100644 tstl/tstl-tests.ts diff --git a/3d-bin-packing/3d-bin-packing-tests.ts b/3d-bin-packing/3d-bin-packing-tests.ts index 319624d597..8e394e46bb 100644 --- a/3d-bin-packing/3d-bin-packing-tests.ts +++ b/3d-bin-packing/3d-bin-packing-tests.ts @@ -1,5 +1,5 @@ import packer = require("3d-bin-packing"); -import samchon = require("samchon-framework"); +import samchon = require("samchon"); function main(): void { diff --git a/3d-bin-packing/index.d.ts b/3d-bin-packing/index.d.ts index 14228f3141..19c5a16b28 100644 --- a/3d-bin-packing/index.d.ts +++ b/3d-bin-packing/index.d.ts @@ -1,20 +1,22 @@ -// Type definitions for 3d-bin-packing +// Type definitions for 3d-bin-packing v1.1.2 // Project: https://github.com/betterwaysystems/packer // Definitions by: Jeongho Nam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 -/// -/// -/// -/// -/// +/// declare module "3d-bin-packing" { - export = bws.packer; + export = bws.packer; +} + +/// +/// +declare namespace bws.packer { + export import library = samchon.library; + export import protocol = samchon.protocol; + function _Test(): void; } -declare var ReactDataGrid: typeof AdazzleReactDataGrid.ReactDataGrid; declare namespace boxologic { /** *

An abstract instance of boxologic.

@@ -62,122 +64,6 @@ declare namespace boxologic { constructor(width: number, height: number, length: number); } } -declare namespace bws.packer { - /** - * @brief Packer, a solver of 3d bin packing with multiple wrappers. - * - * @details - *

Packer is a facade class supporting packing operations in user side. You can solve a packing problem - * by constructing Packer class with {@link WrapperArray wrappers} and {@link InstanceArray instances} to - * pack and executing {@link optimize Packer.optimize()} method.

- * - *

In background side, deducting packing solution, those algorithms are used.

- * - * - * @author Jeongho Nam - */ - class Packer extends samchon.protocol.Entity { - /** - * Candidate wrappers who can contain instances. - */ - protected wrapperArray: WrapperArray; - /** - * Instances trying to pack into the wrapper. - */ - protected instanceArray: InstanceArray; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from members. - * - * @param wrapperArray Candidate wrappers who can contain instances. - * @param instanceArray Instances to be packed into some wrappers. - */ - constructor(wrapperArray: WrapperArray, instanceArray: InstanceArray); - /** - * @inheritdoc - */ - construct(xml: samchon.library.XML): void; - /** - * Get wrapperArray. - */ - getWrapperArray(): WrapperArray; - /** - * Get instanceArray. - */ - getInstanceArray(): InstanceArray; - /** - *

Deduct - * - */ - optimize(): WrapperArray; - /** - * @brief Initialize sequence list (gene_array). - * - * @details - *

Deducts initial sequence list by such assumption:

- * - *
    - *
  • Cost of larger wrapper is less than smaller one, within framework of price per volume unit.
  • - *
      - *
    • Wrapper Larger: (price: $1,000, volume: 100cm^3 -> price per volume unit: $10 / cm^3)
    • - *
    • Wrapper Smaller: (price: $700, volume: 50cm^3 -> price per volume unit: $14 / cm^3)
    • - *
    • Larger's cost is less than Smaller, within framework of price per volume unit
    • - *
    - *
- * - *

Method {@link initGenes initGenes()} constructs {@link WrapperGroup WrapperGroups} corresponding - * with the {@link wrapperArray} and allocates {@link instanceArray instances} to a {@link WrapperGroup}, - * has the smallest cost between containbles.

- * - *

After executing packing solution by {@link WrapperGroup.optimize WrapperGroup.optimize()}, trying to - * {@link repack re-pack} each {@link WrapperGroup} to another type of {@link Wrapper}, deducts the best - * solution between them. It's the initial sequence list of genetic algorithm.

- * - * @return Initial sequence list. - */ - protected initGenes(): GAWrapperArray; - /** - * Try to repack each wrappers to another type. - * - * @param $wrappers Wrappers to repack. - * @return Re-packed wrappers. - */ - protected repack($wrappers: WrapperArray): WrapperArray; - /** - * @inheritdoc - */ - TAG(): string; - /** - * @inheritdoc - */ - toXML(): samchon.library.XML; - } -} -declare namespace flex { - class TabNavigator extends React.Component { - render(): JSX.Element; - private handle_change(index, event); - } - class NavigatorContent extends React.Component { - render(): JSX.Element; - } - interface TabNavigatorProps extends React.Props { - selectedIndex?: number; - style?: React.CSSProperties; - } - interface NavigatorContentProps extends React.Props { - label: string; - } -} declare namespace boxologic { /** * A box, trying to pack into a {@link Pallet}. @@ -589,7 +475,7 @@ declare namespace bws.packer { * * @author Jeongho Nam */ - class PackerForm extends samchon.protocol.Entity { + class PackerForm extends protocol.Entity { /** * Form of Instances to pack. */ @@ -609,12 +495,12 @@ declare namespace bws.packer { * @param wrapperArray Type of Wrappers to be used. */ constructor(instanceFormArray: InstanceFormArray, wrapperArray: WrapperArray); - construct(xml: samchon.library.XML): void; + construct(xml: library.XML): void; optimize(): WrapperArray; getInstanceFormArray(): InstanceFormArray; getWrapperArray(): WrapperArray; TAG(): string; - toXML(): samchon.library.XML; + toXML(): library.XML; toPacker(): Packer; } /** @@ -622,12 +508,12 @@ declare namespace bws.packer { * * @author Jeongho Nam */ - class InstanceFormArray extends samchon.protocol.EntityArrayCollection { + class InstanceFormArray extends protocol.EntityArrayCollection { /** * Default Constructor. */ constructor(); - createChild(xml: samchon.library.XML): InstanceForm; + createChild(xml: library.XML): InstanceForm; TAG(): string; CHILD_TAG(): string; /** @@ -645,7 +531,7 @@ declare namespace bws.packer { * * @author Jeongho Nam */ - class InstanceForm extends samchon.protocol.Entity { + class InstanceForm extends protocol.Entity { /** * A duplicated Instance. */ @@ -661,7 +547,7 @@ declare namespace bws.packer { /** * @inheritdoc */ - construct(xml: samchon.library.XML): void; + construct(xml: library.XML): void; private createInstance(xml); key(): any; getInstance(): Instance; @@ -679,7 +565,7 @@ declare namespace bws.packer { /** * @inheritdoc */ - toXML(): samchon.library.XML; + toXML(): library.XML; /** *

Repeated {@link instance} to {@link InstanceArray}. * @@ -694,7 +580,7 @@ declare namespace bws.packer { } } declare namespace bws.packer { - class WrapperArray extends samchon.protocol.EntityArrayCollection { + class WrapperArray extends protocol.EntityArrayCollection { /** * Default Constructor. */ @@ -702,7 +588,7 @@ declare namespace bws.packer { /** * @inheritdoc */ - createChild(xml: samchon.library.XML): Wrapper; + createChild(xml: library.XML): Wrapper; /** * Get (calculate) price. */ @@ -756,7 +642,7 @@ declare namespace bws.packer { * * @author Jeongho Nam */ - interface Instance extends samchon.protocol.IEntity { + interface Instance extends protocol.IEntity { /** * Get name. */ @@ -813,7 +699,7 @@ declare namespace bws.packer { * * @author Jeongho Nam */ - class InstanceArray extends samchon.protocol.EntityArray { + class InstanceArray extends protocol.EntityArray { /** * Default Constructor. */ @@ -821,7 +707,7 @@ declare namespace bws.packer { /** * @inheritdoc */ - createChild(xml: samchon.library.XML): Instance; + createChild(xml: library.XML): Instance; /** * @inheritdoc */ @@ -832,13 +718,113 @@ declare namespace bws.packer { CHILD_TAG(): string; } } +declare namespace bws.packer { + /** + * @brief Packer, a solver of 3d bin packing with multiple wrappers. + * + * @details + *

Packer is a facade class supporting packing operations in user side. You can solve a packing problem + * by constructing Packer class with {@link WrapperArray wrappers} and {@link InstanceArray instances} to + * pack and executing {@link optimize Packer.optimize()} method.

+ * + *

In background side, deducting packing solution, those algorithms are used.

+ * + * + * @author Jeongho Nam + */ + class Packer extends protocol.Entity { + /** + * Candidate wrappers who can contain instances. + */ + protected wrapperArray: WrapperArray; + /** + * Instances trying to pack into the wrapper. + */ + protected instanceArray: InstanceArray; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from members. + * + * @param wrapperArray Candidate wrappers who can contain instances. + * @param instanceArray Instances to be packed into some wrappers. + */ + constructor(wrapperArray: WrapperArray, instanceArray: InstanceArray); + /** + * @inheritdoc + */ + construct(xml: library.XML): void; + /** + * Get wrapperArray. + */ + getWrapperArray(): WrapperArray; + /** + * Get instanceArray. + */ + getInstanceArray(): InstanceArray; + /** + *

Deduct + * + */ + optimize(): WrapperArray; + /** + * @brief Initialize sequence list (gene_array). + * + * @details + *

Deducts initial sequence list by such assumption:

+ * + *
    + *
  • Cost of larger wrapper is less than smaller one, within framework of price per volume unit.
  • + *
      + *
    • Wrapper Larger: (price: $1,000, volume: 100cm^3 -> price per volume unit: $10 / cm^3)
    • + *
    • Wrapper Smaller: (price: $700, volume: 50cm^3 -> price per volume unit: $14 / cm^3)
    • + *
    • Larger's cost is less than Smaller, within framework of price per volume unit
    • + *
    + *
+ * + *

Method {@link initGenes initGenes()} constructs {@link WrapperGroup WrapperGroups} corresponding + * with the {@link wrapperArray} and allocates {@link instanceArray instances} to a {@link WrapperGroup}, + * has the smallest cost between containbles.

+ * + *

After executing packing solution by {@link WrapperGroup.optimize WrapperGroup.optimize()}, trying to + * {@link repack re-pack} each {@link WrapperGroup} to another type of {@link Wrapper}, deducts the best + * solution between them. It's the initial sequence list of genetic algorithm.

+ * + * @return Initial sequence list. + */ + protected initGenes(): GAWrapperArray; + /** + * Try to repack each wrappers to another type. + * + * @param $wrappers Wrappers to repack. + * @return Re-packed wrappers. + */ + protected repack($wrappers: WrapperArray): WrapperArray; + /** + * @inheritdoc + */ + TAG(): string; + /** + * @inheritdoc + */ + toXML(): library.XML; + } +} declare namespace bws.packer { /** * A product. * * @author Jeongho Nam */ - class Product extends samchon.protocol.Entity implements Instance { + class Product extends protocol.Entity implements Instance { /** *

Name, key of the Product.

* @@ -921,7 +907,7 @@ declare namespace bws.packer { /** * @inheritdoc */ - toXML(): samchon.library.XML; + toXML(): library.XML; } } declare namespace bws.packer { @@ -937,7 +923,7 @@ declare namespace bws.packer { * * @author Jeongho Nam */ - class Wrap extends samchon.protocol.Entity { + class Wrap extends protocol.Entity { /** * A wrapper wrapping the {@link instance}. */ @@ -962,10 +948,6 @@ declare namespace bws.packer { * Placement orientation of wrapped {@link instance}. */ protected orientation: number; - /** - * - */ - protected color: number; /** * Construct from a Wrapper. * @@ -996,7 +978,7 @@ declare namespace bws.packer { /** * @inheritdoc */ - construct(xml: samchon.library.XML): void; + construct(xml: library.XML): void; /** * Factory method of wrapped Instance. * @@ -1058,11 +1040,11 @@ declare namespace bws.packer { /** * Get width. */ - getWidth(): number; + getLayoutWidth(): number; /** * Get height. */ - getHeight(): number; + getLayoutHeight(): number; /** * Get length. */ @@ -1071,9 +1053,9 @@ declare namespace bws.packer { * Get volume. */ getVolume(): number; - $instanceName: string; - $layoutScale: string; - $position: string; + readonly $instanceName: string; + readonly $layoutScale: string; + readonly $position: string; /** * @inheritdoc */ @@ -1081,19 +1063,7 @@ declare namespace bws.packer { /** * @inheritdoc */ - toXML(): samchon.library.XML; - /** - * Thickness of boundary lines of a shape represents the {@link instance}. - */ - private static BOUNDARY_THICKNESS; - /** - * - * - * @param geometry - * - * @return A shape and its boundary lines as 3D-objects. - */ - toDisplayObjects(geometry: THREE.Geometry): std.Vector; + toXML(): library.XML; } } declare namespace bws.packer { @@ -1102,7 +1072,7 @@ declare namespace bws.packer { * * @author Jeongho Nam */ - class Wrapper extends samchon.protocol.EntityDeque implements Instance { + class Wrapper extends protocol.EntityDeque implements Instance { /** *

Name, key of the Wrapper.

* @@ -1151,11 +1121,10 @@ declare namespace bws.packer { * @param thickness A thickness causes shrinkness on containable volume. */ constructor(name: string, price: number, width: number, height: number, length: number, thickness: number); - construct(xml: samchon.library.XML): void; /** * @inheritdoc */ - createChild(xml: samchon.library.XML): Wrap; + createChild(xml: library.XML): Wrap; /** * Key of a Wrapper is its name. */ @@ -1232,7 +1201,7 @@ declare namespace bws.packer { * @return utilization ratio. */ getUtilization(): number; - equal_to(obj: Wrapper): boolean; + equals(obj: Wrapper): boolean; /** *

Wrapper is enough greater?

* @@ -1272,8 +1241,8 @@ declare namespace bws.packer { $height: string; $length: string; $thickness: string; - $scale: string; - $spaceUtilization: string; + readonly $scale: string; + readonly $spaceUtilization: string; /** * @inheritdoc */ @@ -1289,25 +1258,7 @@ declare namespace bws.packer { /** * @inheritdoc */ - toXML(): samchon.library.XML; - private static scene; - private static renderer; - private static camera; - private static trackball; - private static mouse; - private static BOUNDARY_THICKNESS; - /** - *

Convert to a canvas containing 3D elements.

- * - * @param endIndex - * - * @return A 3D-canvans printing the Wrapper and its children {@link Wrap wrapped} - * {@link Instance instances} with those boundary lines. - */ - toCanvas(endIndex?: number): HTMLCanvasElement; - private static handleMouseMove(event); - private static animate(); - private static render(); + toXML(): library.XML; } } declare namespace bws.packer { @@ -1430,72 +1381,3 @@ declare namespace bws.packer { TAG(): string; } } -declare namespace bws.packer { - abstract class Editor extends React.Component<{ - dataProvider: samchon.protocol.EntityArrayCollection; - }, {}> { - private columns; - private selected_index; - /** - * Default Constructor. - */ - constructor(); - protected abstract createColumns(): AdazzleReactDataGrid.Column[]; - private get_row(index); - private insert_instance(event); - private erase_instances(event); - private handle_data_change(event); - private handle_row_change(event); - private handle_select(event); - render(): JSX.Element; - } -} -declare namespace bws.packer { - interface ItemEditorProps extends React.Props { - application: PackerApplication; - instances: InstanceFormArray; - wrappers: WrapperArray; - } - class ItemEditor extends React.Component { - private clear(event); - private open(event); - private save(event); - private pack(event); - render(): JSX.Element; - } - class InstanceEditor extends Editor { - protected createColumns(): AdazzleReactDataGrid.Column[]; - } - class WrapperEditor extends Editor { - protected createColumns(): AdazzleReactDataGrid.Column[]; - } -} -declare namespace bws.packer { - class PackerApplication extends React.Component<{}, {}> { - private instances; - private wrappers; - private result; - /** - * Default Constructor. - */ - constructor(); - pack(): void; - drawWrapper(wrapper: Wrapper, index?: number): void; - render(): JSX.Element; - static main(): void; - } -} -declare namespace bws.packer { - class ResultViewer extends React.Component { - drawWrapper(wrapper: Wrapper, index?: number): void; - private clear(event); - private open(event); - private save(event); - refresh(): void; - render(): JSX.Element; - } - interface WrapperViewerProps extends React.Props { - application: PackerApplication; - wrappers: WrapperArray; - } -} diff --git a/samchon-framework/index.d.ts b/samchon-framework/index.d.ts index 558efd674a..fa540e033d 100644 --- a/samchon-framework/index.d.ts +++ b/samchon-framework/index.d.ts @@ -1,10811 +1,13 @@ -// Type definitions for Samchon Framework 2.0 +// Type definitions for Samchon Framework v2.0.x // Project: https://github.com/samchon/framework // Definitions by: Jeongho Nam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// +// Samchon-Framework is renamed to Samchon declare module "samchon-framework" { + import samchon = require("samchon"); export = samchon; -} - -/** - * # Samchon-Framework - * - * - * - * - * Samchon, a OON (Object-Oriented Network) framework. - * - * With Samchon Framework, you can implement distributed processing system within framework of OOD like handling S/W - * objects (classes). You can realize cloud and distributed system very easily with provided system templates and even - * integration with C++ is possible. - * - * The goal, ultimate utilization model of Samchon Framework is, building cloud system with NodeJS and taking heavy works - * to C++ distributed systems with provided modules (those are system templates). - * - * @git https://github.com/samchon/framework - * @author Jeongho Nam - */ -declare namespace samchon { - /** - * Running on Node. - * - * Test whether the JavaScript is running on Node. - * - * @references http://stackoverflow.com/questions/17575790/environment-detection-node-js-or-browser - */ - function is_node(): boolean; -} -declare namespace samchon.collections { - /** - * A {@link Vector} who can detect element I/O events. - * - * Below is the list of methods who are dispatching {@link CollectionEvent}: - * - *insert* typed events: - * - {@link assign} - * - {@link insert} - * - {@link push} - * - {@link push_back} - * - {@link unshift} - * - *erase* typed events: - * - {@link assign} - * - {@link clear} - * - {@link erase} - * - {@link pop_back} - * - {@link shift} - * - {@link pop} - * - {@link splice} - * - *refresh* typed events: - * - {@link refresh} - * - * #### [Inherited] {@link Vector} - * {@link Vector Vectors}s are sequence containers representing arrays that can change in size. - * - * Just like arrays, {@link Vector}s use contiguous storage locations for their elements, which means that their - * elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently as in - * arrays. But unlike arrays, their size can change dynamically, with their storage being handled automatically - * by the container. - * - * Internally, {@link Vector}s use a dynamically allocated array to store their elements. This array may need to - * be reallocated in order to grow in size when new elements are inserted, which implies allocating a new array - * and moving all elements to it. This is a relatively expensive task in terms of processing time, and thus, - * {@link Vector}s do not reallocate each time an element is added to the container. - * - * Instead, {@link Vector} containers may allocate some extra storage to accommodate for possible growth, and - * thus the container may have an actual {@link capacity} greater than the storage strictly needed to contain its - * elements (i.e., its {@link size}). Libraries can implement different strategies for growth to balance between - * memory usage and reallocations, but in any case, reallocations should only happen at logarithmically growing - * intervals of {@link size} so that the insertion of individual elements at the end of the {@link Vector} can be - * provided with amortized constant time complexity (see {@link push_back push_back()}). - * - * Therefore, compared to arrays, {@link Vector}s consume more memory in exchange for the ability to manage - * storage and grow dynamically in an efficient way. - * - * Compared to the other dynamic sequence containers ({@link Deque}s, {@link List}s), {@link Vector Vectors} are - * very efficient accessing its elements (just like arrays) and relatively efficient adding or removing elements - * from its end. For operations that involve inserting or removing elements at positions other than the end, they - * perform worse than the others, and have less consistent iterators and references than {@link List}s. - * - * - * - * - * - *

Container properties

- *
- *
Sequence
- *
- * Elements in sequence containers are ordered in a strict linear sequence. Individual elements are - * accessed by their position in this sequence. - *
- * - *
Dynamic array
- *
- * Allows direct access to any element in the sequence, even through pointer arithmetics, and provides - * relatively fast addition/removal of elements at the end of the sequence. - *
- *
- * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/vector/vector - * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) - * @author Jeongho Nam - */ - class ArrayCollection extends std.Vector implements ICollection { - /** - * A chain object taking responsibility of dispatching events. - */ - private event_dispatcher_; - /** - * @inheritdoc - */ - push(...items: T[]): number; - /** - * @inheritdoc - */ - push_back(val: T): void; - /** - * @hidden - */ - protected _Insert_by_repeating_val(position: std.VectorIterator, n: number, val: T): std.VectorIterator; - /** - * @hidden - */ - protected _Insert_by_range>(position: std.VectorIterator, begin: InputIterator, end: InputIterator): std.VectorIterator; - /** - * @hidden - */ - protected _Erase_by_range(first: std.VectorIterator, last: std.VectorIterator): std.VectorIterator; - /** - * @hidden - */ - private notify_insert(first, last); - /** - * @hidden - */ - private notify_erase(first, last); - /** - * @inheritdoc - */ - hasEventListener(type: string): boolean; - /** - * @inheritdoc - */ - dispatchEvent(event: library.BasicEvent): boolean; - /** - * @inheritdoc - */ - refresh(): void; - /** - * @inheritdoc - */ - refresh(it: std.VectorIterator): void; - /** - * @inheritdoc - */ - refresh(first: std.VectorIterator, last: std.VectorIterator): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener): void; - addEventListener(type: "insert", listener: CollectionEventListener): void; - addEventListener(type: "erase", listener: CollectionEventListener): void; - addEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener): void; - removeEventListener(type: "insert", listener: CollectionEventListener): void; - removeEventListener(type: "erase", listener: CollectionEventListener): void; - removeEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - /** - * @inheritdoc - */ - unshift(...items: U[]): number; - /** - * @inheritdoc - */ - pop(): T; - /** - * @inheritdoc - */ - splice(start: number): T[]; - /** - * @inheritdoc - */ - splice(start: number, deleteCount: number, ...items: T[]): T[]; - } -} -declare namespace samchon.library { - /** - * A basic event class of Samchon Framework. - * - * @reference https://developer.mozilla.org/en-US/docs/Web/API/Event - * @handbook https://github.com/samchon/framework/wiki/TypeScript-Library-EventDispatcher - * @author Jeongho Nam - */ - class BasicEvent { - protected type_: string; - protected target_: IEventDispatcher; - private currentTarget_; - protected trusted_: boolean; - protected bubbles_: boolean; - protected cancelable_: boolean; - protected defaultPrevented_: boolean; - protected cancelBubble_: boolean; - private timeStamp_; - constructor(type: string, bubbles?: boolean, cancelable?: boolean); - /** - * @inheritdoc - */ - initEvent(type: string, bubbles: boolean, cancelable: boolean): void; - /** - * @inheritdoc - */ - /** - * @inheritdoc - */ - stopImmediatePropagation(): void; - /** - * @inheritdoc - */ - stopPropagation(): void; - /** - * @inheritdoc - */ - readonly type: string; - /** - * @inheritdoc - */ - target: IEventDispatcher; - /** - * @inheritdoc - */ - readonly currentTarget: IEventDispatcher; - /** - * @inheritdoc - */ - readonly isTrusted: boolean; - /** - * @inheritdoc - */ - readonly bubbles: boolean; - /** - * @inheritdoc - */ - readonly cancelable: boolean; - /** - * @inheritdoc - */ - readonly eventPhase: number; - /** - * @inheritdoc - */ - readonly defaultPrevented: boolean; - /** - * @inheritdoc - */ - readonly srcElement: Element; - /** - * @inheritdoc - */ - readonly cancelBubble: boolean; - /** - * @inheritdoc - */ - readonly timeStamp: number; - /** - * Don't know what it is. - */ - readonly returnValue: boolean; - } -} -declare namespace samchon.collections { - /** - * Type of function pointer for listener of {@link CollectionEvent CollectionEvents}. - */ - type CollectionEventListener = (event: CollectionEvent) => void; -} -declare namespace samchon.collections { - /** - * An event occured in a {@link ICollection collection} object. - * - * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) - * @author Jeongho Nam - */ - class CollectionEvent extends library.BasicEvent { - /** - * @hidden - */ - private first_; - /** - * @hidden - */ - private last_; - /** - * @hidden - */ - private temporary_container_; - /** - * @hidden - */ - private origin_first_; - /** - * Initialization Constructor. - * - * @param type Type of collection event. - * @param first An {@link Iterator} to the initial position in this {@link CollectionEvent}. - * @param last An {@link Iterator} to the final position in this {@link CollectionEvent}. - */ - constructor(type: string, first: std.Iterator, last: std.Iterator); - constructor(type: "insert", first: std.Iterator, last: std.Iterator); - constructor(type: "erase", first: std.Iterator, last: std.Iterator); - constructor(type: "refresh", first: std.Iterator, last: std.Iterator); - /** - * Associative target, the {@link ICollection collection}. - */ - readonly target: ICollection; - /** - * An {@link Iterator} to the initial position in this {@link CollectionEvent}. - */ - readonly first: std.Iterator; - /** - * An {@link Iterator} to the final position in this {@link CollectionEvent}. - */ - readonly last: std.Iterator; - /** - * @inheritdoc - */ - preventDefault(): void; - } -} -declare namespace samchon.collections.CollectionEvent { - const INSERT: "insert"; - const ERASE: "erase"; - const REFRESH: "refresh"; -} -declare namespace samchon.collections { - /** - * A {@link Deque} who can detect element I/O events. - * - * Below is the list of methods who are dispatching {@link CollectionEvent}: - * - *insert* typed events: - * - {@link assign} - * - {@link insert} - * - {@link push} - * - {@link push_front} - * - {@link push_back} - * - *erase* typed events: - * - {@link assign} - * - {@link clear} - * - {@link erase} - * - {@link pop_front} - * - {@link pop_back} - * - *refresh* typed events: - * - {@link refresh} - * - * #### [Inherited] {@link Deque} - * {@link Deque} (usually pronounced like "*deck*") is an irregular acronym of **d**ouble-**e**nded **q**ueue. - * Double-ended queues are sequence containers with dynamic sizes that can be expanded or contracted on both ends - * (either its front or its back). - * - * Specific libraries may implement deques in different ways, generally as some form of dynamic array. But in any - * case, they allow for the individual elements to be accessed directly through random access iterators, with - * storage handled automatically by expanding and contracting the container as needed. - * - * Therefore, they provide a functionality similar to vectors, but with efficient insertion and deletion of - * elements also at the beginning of the sequence, and not only at its end. But, unlike {@link Vector Vectors}, - * {@link Deque Deques} are not guaranteed to store all its elements in contiguous storage locations: accessing - * elements in a deque by offsetting a pointer to another element causes undefined behavior. - * - * Both {@link Vector}s and {@link Deque}s provide a very similar interface and can be used for similar purposes, - * but internally both work in quite different ways: While {@link Vector}s use a single array that needs to be - * occasionally reallocated for growth, the elements of a {@link Deque} can be scattered in different chunks of - * storage, with the container keeping the necessary information internally to provide direct access to any of its - * elements in constant time and with a uniform sequential interface (through iterators). Therefore, - * {@link Deque Deques} are a little more complex internally than {@link Vector}s, but this allows them to grow - * more efficiently under certain circumstances, especially with very long sequences, where reallocations become - * more expensive. - * - * For operations that involve frequent insertion or removals of elements at positions other than the beginning or - * the end, {@link Deque Deques} perform worse and have less consistent iterators and references than - * {@link List Lists}. - * - * - * - * - * - *

Container properties

- *
- *
Sequence
- *
Elements in sequence containers are ordered in a strict linear sequence. Individual elements - * are accessed by their position in this sequence.
- * - *
Dynamic array
- *
Generally implemented as a dynamic array, it allows direct access to any element in the - * sequence and provides relatively fast addition/removal of elements at the beginning or the end - * of the sequence.
- *
- * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/deque/deque/ - * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) - * @author Jeongho Nam - */ - class DequeCollection extends std.Deque implements ICollection { - /** - * A chain object taking responsibility of dispatching events. - */ - private event_dispatcher_; - /** - * @inheritdoc - */ - push(...items: T[]): number; - /** - * @inheritdoc - */ - push_back(val: T): void; - /** - * @hidden - */ - protected _Insert_by_repeating_val(position: std.DequeIterator, n: number, val: T): std.DequeIterator; - /** - * @hidden - */ - protected _Insert_by_range>(position: std.DequeIterator, begin: InputIterator, end: InputIterator): std.DequeIterator; - /** - * @inheritdoc - */ - pop_back(): void; - /** - * @hidden - */ - protected _Erase_by_range(first: std.DequeIterator, last: std.DequeIterator): std.DequeIterator; - /** - * @hidden - */ - private notify_insert(first, last); - /** - * @hidden - */ - private notify_erase(first, last); - /** - * @inheritdoc - */ - hasEventListener(type: string): boolean; - /** - * @inheritdoc - */ - dispatchEvent(event: library.BasicEvent): boolean; - /** - * @inheritdoc - */ - refresh(): void; - /** - * @inheritdoc - */ - refresh(it: std.DequeIterator): void; - /** - * @inheritdoc - */ - refresh(first: std.DequeIterator, last: std.DequeIterator): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener): void; - addEventListener(type: "insert", listener: CollectionEventListener): void; - addEventListener(type: "erase", listener: CollectionEventListener): void; - addEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener): void; - removeEventListener(type: "insert", listener: CollectionEventListener): void; - removeEventListener(type: "erase", listener: CollectionEventListener): void; - removeEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - } -} -declare namespace samchon.collections { - /** - * A {@link HashMap} who can detect element I/O events. - * - * Below is the list of methods who are dispatching {@link MapCollectionEvent}: - * - *insert* typed events: - * - {@link assign} - * - {@link insert} - * - {@link insert_or_assign} - * - {@link emplace} - * - {@link set} - * - {@link push} - * - *erase* typed events: - * - {@link assign} - * - {@link clear} - * - {@link erase} - * - {@link extract} - * - *refresh* typed events: - * - {@link refresh} - * - * #### [Inherited] {@link HashMap} - * {@link HashMap HashMaps} are associative containers that store elements formed by the combination of a - * *key value* and a *mapped value*, and which allows for fast retrieval of individual elements based on their - * *keys*. - * - * In an {@link HashMap}, the *key value* is generally used to uniquely identify the element, while the - * *mapped value* is an object with the content associated to this *key*. Types of *key* and *mapped value* may - * differ. - * - * Internally, the elements in the {@link HashMap} are not sorted in any particular order with respect to either - * their *key* or *mapped values*, but organized into *buckets* depending on their hash values to allow for fast - * access to individual elements directly by their *key values* (with a constant average time complexity on - * average). - * - * {@link HashMap} containers are faster than {@link TreeMap} containers to access individual elements by their - * *key*, although they are generally less efficient for range iteration through a subset of their elements. - * - * - * - * - * - *

Container properties

- *
- *
Associative
- *
Elements in associative containers are referenced by their *key* and not by their absolute - * position in the container.
- * - *
Hashed
- *
Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their *key*.
- * - *
Map
- *
Each element associates a *key* to a *mapped value*: - * *Keys* are meant to identify the elements whose main content is the *mapped value*.
- * - *
Unique keys
- *
No two elements in the container can have equivalent keys.
- *
- * - * @param Type of the key values. - * Each element in an {@link HashMap} is uniquely identified by its key value. - * @param Type of the mapped value. - * Each element in an {@link HashMap} is used to store some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/unordered_map/unordered_map - * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) - * @author Jeongho Nam - */ - class HashMapCollection extends std.HashMap implements ICollection> { - /** - * A chain object taking responsibility of dispatching events. - */ - private event_dispatcher_; - /** - * @inheritdoc - */ - protected _Handle_insert(first: std.MapIterator, last: std.MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: std.MapIterator, last: std.MapIterator): void; - /** - * @inheritdoc - */ - hasEventListener(type: string): boolean; - /** - * @inheritdoc - */ - dispatchEvent(event: library.BasicEvent): boolean; - /** - * @inheritdoc - */ - refresh(): void; - /** - * @inheritdoc - */ - refresh(it: std.MapIterator): void; - /** - * @inheritdoc - */ - refresh(first: std.MapIterator, last: std.MapIterator): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener): void; - addEventListener(type: "insert", listener: MapCollectionEventListener): void; - addEventListener(type: "erase", listener: MapCollectionEventListener): void; - addEventListener(type: "refresh", listener: MapCollectionEventListener): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; - addEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; - addEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener): void; - removeEventListener(type: "insert", listener: MapCollectionEventListener): void; - removeEventListener(type: "erase", listener: MapCollectionEventListener): void; - removeEventListener(type: "refresh", listener: MapCollectionEventListener): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; - removeEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; - removeEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; - } -} -declare namespace samchon.collections { - /** - * A {@link HashMultiMap} who can detect element I/O events. - * - * Below is the list of methods who are dispatching {@link MapCollectionEvent}: - * - *insert* typed events: - * - {@link assign} - * - {@link insert} - * - {@link emplace} - * - {@link push} - * - *erase* typed events: - * - {@link assign} - * - {@link clear} - * - {@link erase} - * - *refresh* typed events: - * - {@link refresh} - * - * #### [Inherited] {@link HashMultiMap} - * {@link HashMultiMap HashMultiMap}s are associative containers that store elements formed by the combination of - * a *key value* and a *mapped value*, much like {@link HashMultiMap} containers, but allowing different elements - * to have equivalent *keys*. - * - * In an {@link HashMultiMap}, the *key value* is generally used to uniquely identify the element, while the - * *mapped value* is an object with the content associated to this *key*. Types of *key* and *mapped value* may - * differ. - * - * Internally, the elements in the {@link HashMultiMap} are not sorted in any particular order with respect to - * either their *key* or *mapped values*, but organized into *buckets* depending on their hash values to allow for - * fast access to individual elements directly by their *key values* (with a constant average time complexity on - * average). - * - * Elements with equivalent *keys* are grouped together in the same bucket and in such a way that an iterator can - * iterate through all of them. Iterators in the container are doubly linked iterators. - * - * - * - * - * - *

Container properties

- *
- *
Associative
- *
Elements in associative containers are referenced by their *key* and not by their absolute - * position in the container.
- * - *
Hashed
- *
Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their *key*.
- * - *
Map
- *
Each element associates a *key* to a *mapped value*: - * *Keys* are meant to identify the elements whose main content is the *mapped value*.
- * - *
Multiple equivalent keys
- *
The container can hold multiple elements with equivalent *keys*.
- *
- * - * @param Type of the key values. - * Each element in an {@link HashMultiMap} is identified by a key value. - * @param Type of the mapped value. - * Each element in an {@link HashMultiMap} is used to store some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/unordered_map/unordered_multimap - * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) - * @author Jeongho Nam - */ - class HashMultiMapCollection extends std.HashMap implements ICollection> { - /** - * A chain object taking responsibility of dispatching events. - */ - private event_dispatcher_; - /** - * @inheritdoc - */ - protected _Handle_insert(first: std.MapIterator, last: std.MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: std.MapIterator, last: std.MapIterator): void; - /** - * @inheritdoc - */ - hasEventListener(type: string): boolean; - /** - * @inheritdoc - */ - dispatchEvent(event: library.BasicEvent): boolean; - /** - * @inheritdoc - */ - refresh(): void; - /** - * @inheritdoc - */ - refresh(it: std.MapIterator): void; - /** - * @inheritdoc - */ - refresh(first: std.MapIterator, last: std.MapIterator): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener): void; - addEventListener(type: "insert", listener: MapCollectionEventListener): void; - addEventListener(type: "erase", listener: MapCollectionEventListener): void; - addEventListener(type: "refresh", listener: MapCollectionEventListener): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; - addEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; - addEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener): void; - removeEventListener(type: "insert", listener: MapCollectionEventListener): void; - removeEventListener(type: "erase", listener: MapCollectionEventListener): void; - removeEventListener(type: "refresh", listener: MapCollectionEventListener): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; - removeEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; - removeEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; - } -} -declare namespace samchon.collections { - /** - * A {@link HashMultiSet} who can detect element I/O events. - * - * Below is the list of methods who are dispatching {@link CollectionEvent}: - * - *insert* typed events: - * - {@link assign} - * - {@link insert} - * - {@link push} - * - *erase* typed events: - * - {@link assign} - * - {@link clear} - * - {@link erase} - * - *refresh* typed events: - * - {@link refresh} - * - * #### [Inherited] {@link HashMultiSet} - * {@link HashMultiSet HashMultiSets} are containers that store elements in no particular order, allowing fast - * retrieval of individual elements based on their value, much like {@link HashMultiSet} containers, but allowing - * different elements to have equivalent values. - * - * In an {@link HashMultiSet}, the value of an element is at the same time its *key*, used to identify it. *Keys* - * are immutable, therefore, the elements in an {@link HashMultiSet} cannot be modified once in the container - - * they can be inserted and removed, though. - * - * Internally, the elements in the {@link HashMultiSet} are not sorted in any particular, but organized into - * *buckets* depending on their hash values to allow for fast access to individual elements directly by their - * *values* (with a constant average time complexity on average). - * - * Elements with equivalent values are grouped together in the same bucket and in such a way that an iterator can - * iterate through all of them. Iterators in the container are doubly linked iterators. - * - * - * - * - * - *

Container properties

- *
- *
Associative
- *
Elements in associative containers are referenced by their *key* and not by their absolute - * position in the container.
- * - *
Hashed
- *
Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their *key*.
- * - *
Set
- *
The value of an element is also the *key* used to identify it.
- * - *
Multiple equivalent keys
- *
The container can hold multiple elements with equivalent *keys*.
- *
- * - * @param Type of the elements. - * Each element in an {@link UnorderedMultiSet} is also identified by this value.. - * - * @reference http://www.cplusplus.com/reference/unordered_set/unordered_multiset - * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) - * @author Jeongho Nam - */ - class HashMultiSetCollection extends std.HashMultiSet implements ICollection { - /** - * A chain object taking responsibility of dispatching events. - */ - private event_dispatcher_; - /** - * @inheritdoc - */ - protected _Handle_insert(first: std.SetIterator, last: std.SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: std.SetIterator, last: std.SetIterator): void; - /** - * @inheritdoc - */ - hasEventListener(type: string): boolean; - /** - * @inheritdoc - */ - dispatchEvent(event: library.BasicEvent): boolean; - /** - * @inheritdoc - */ - refresh(): void; - /** - * @inheritdoc - */ - refresh(it: std.SetIterator): void; - /** - * @inheritdoc - */ - refresh(first: std.SetIterator, last: std.SetIterator): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener): void; - addEventListener(type: "insert", listener: CollectionEventListener): void; - addEventListener(type: "erase", listener: CollectionEventListener): void; - addEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener): void; - removeEventListener(type: "insert", listener: CollectionEventListener): void; - removeEventListener(type: "erase", listener: CollectionEventListener): void; - removeEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - } -} -declare namespace samchon.collections { - /** - * A {@link HashSet} who can detect element I/O events. - * - * Below is the list of methods who are dispatching {@link CollectionEvent}: - * - *insert* typed events: - * - {@link assign} - * - {@link insert} - * - {@link push} - * - {@link insert_or_assign} - * - *erase* typed events: - * - {@link assign} - * - {@link clear} - * - {@link erase} - * - {@link extract} - * - *refresh* typed events: - * - {@link refresh} - * - * #### [Inherited] {@link HashSet} - * {@link HashSet HashSets} are containers that store unique elements in no particular order, and which allow for - * fast retrieval of individual elements based on their value. - * - * In an {@link HashSet}, the value of an element is at the same time its *key*, that identifies it uniquely. - * Keys are immutable, therefore, the elements in an {@link HashSet} cannot be modified once in the container - - * they can be inserted and removed, though. - * - * Internally, the elements in the {@link HashSet} are not sorted in any particular order, but organized into - * buckets depending on their hash values to allow for fast access to individual elements directly by their - * *values* (with a constant average time complexity on average). - * - * {@link HashSet} containers are faster than {@link TreeSet} containers to access individual elements by their - * *key*, although they are generally less efficient for range iteration through a subset of their elements. - * - * - * - * - * - *

Container properties

- *
- *
Associative
- *
Elements in associative containers are referenced by their *key* and not by their absolute - * position in the container.
- * - *
Hashed
- *
Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their *key*.
- * - *
Set
- *
The value of an element is also the *key* used to identify it.
- * - *
Unique keys
- *
No two elements in the container can have equivalent *keys*.
- *
- * - * @param Type of the elements. - * Each element in an {@link HashSet} is also uniquely identified by this value. - * - * @reference http://www.cplusplus.com/reference/unordered_set/unordered_set - * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) - * @author Jeongho Nam - */ - class HashSetCollection extends std.HashSet implements ICollection { - /** - * A chain object taking responsibility of dispatching events. - */ - private event_dispatcher_; - /** - * @inheritdoc - */ - protected _Handle_insert(first: std.SetIterator, last: std.SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: std.SetIterator, last: std.SetIterator): void; - /** - * @inheritdoc - */ - hasEventListener(type: string): boolean; - /** - * @inheritdoc - */ - dispatchEvent(event: library.BasicEvent): boolean; - /** - * @inheritdoc - */ - refresh(): void; - /** - * @inheritdoc - */ - refresh(it: std.SetIterator): void; - /** - * @inheritdoc - */ - refresh(first: std.SetIterator, last: std.SetIterator): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener): void; - addEventListener(type: "insert", listener: CollectionEventListener): void; - addEventListener(type: "erase", listener: CollectionEventListener): void; - addEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener): void; - removeEventListener(type: "insert", listener: CollectionEventListener): void; - removeEventListener(type: "erase", listener: CollectionEventListener): void; - removeEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - } -} -/** - * Collections, elements I/O detectable STL containers. - * - * STL Containers | Collections - * ---------------------|------------------- - * {@link Vector} | {@link ArrayCollection} - * {@link List} | {@link ListCollection} - * {@link Deque} | {@link DequeCollection} - * | - * {@link TreeSet} | {@link TreeSetCollection} - * {@link HashSet} | {@link HashSetCollection} - * {@link TreeMultiSet} | {@link TreeMultiSetCollection} - * {@link HashMultiSet} | {@link HashMultiSetCollection} - * | - * {@link TreeMap} | {@link TreeMapCollection} - * {@link HashMap} | {@link HashMapCollection} - * {@link TreeMultiMap} | {@link TreeMultiMapCollection} - * {@link HashMultiMap} | {@link HashMultiMapCollection} - * - * @author Jeongho Nam - */ -declare namespace samchon.collections { - /** - * An interface for {@link IContainer containers} who can detect element I/O events. - * - * Below are list of methods who are dispatching {@link CollectionEvent}: - * - *insert* typed events: - * - {@link assign} - * - {@link insert} - * - {@link push} - * - *erase* typed events: - * - {@link assign} - * - {@link clear} - * - {@link erase} - * - *refresh* typed events: - * - {@link refresh} - * - * @author Jeongho Nam - */ - interface ICollection extends std.base.IContainer, library.IEventDispatcher { - /** - * Dispatch a {@link CollectionEvent} with *refresh* typed. - * - * {@link ICollection} dispatches {@link CollectionEvent} typed *insert* or *erase* whenever elements I/O has - * occured. However, unlike those elements I/O events, content change in element level can't be detected. - * There's no way to detect those events automatically by {@link IContainer}. - * - * If you want to dispatch those typed events (notifying change on contents in element level), you've to - * dispatch *refresh* typed event manually, by yourself. Call {@link refresh refresh()} with specified - * iterators who're pointing the elements whose content have changed. Then a {@link CollectionEvent} with - * *refresh* typed will be dispatched. - * - * If you don't specify any iterator, then the range of the *refresh* event will be all elements in this - * {@link ICollection collection}; {@link begin begin()} to {@link end end()}. - */ - refresh(): void; - /** - * Dispatch a {@link CollectionEvent} with *refresh* typed. - * - * {@link ICollection} dispatches {@link CollectionEvent} typed *insert* or *erase* whenever elements I/O has - * occured. However, unlike those elements I/O events, content change in element level can't be detected. - * There's no way to detect those events automatically by {@link IContainer}. - * - * If you want to dispatch those typed events (notifying change on contents in element level), you've to - * dispatch *refresh* typed event manually, by yourself. Call {@link refresh refresh()} with specified - * iterators who're pointing the elements whose content have changed. Then a {@link CollectionEvent} with - * *refresh* typed will be dispatched. - * - * @param it An iterator targeting the content changed element. - */ - refresh(it: std.Iterator): void; - /** - * Dispatch a {@link CollectionEvent} with *refresh* typed. - * - * {@link ICollection} dispatches {@link CollectionEvent} typed *insert* or *erase* whenever elements I/O has - * occured. However, unlike those elements I/O events, content change in element level can't be detected. - * There's no way to detect those events automatically by {@link IContainer}. - * - * If you want to dispatch those typed events (notifying change on contents in element level), you've to - * dispatch *refresh* typed event manually, by yourself. Call {@link refresh refresh()} with specified - * iterators who're pointing the elements whose content have changed. Then a {@link CollectionEvent} with - * *refresh* typed will be dispatched. - * - * @param first An Iterator to the initial position in a sequence of the content changed elmeents. - * @param last An {@link Iterator} to the final position in a sequence of the content changed elements. The range - * used is [*first*, *last*), which contains all the elements between *first* and - * *last*, including the element pointed by *first* but not the element pointed by - * *last*. - */ - refresh(first: std.Iterator, last: std.Iterator): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener): void; - addEventListener(type: "insert", listener: CollectionEventListener): void; - addEventListener(type: "erase", listener: CollectionEventListener): void; - addEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener): void; - removeEventListener(type: "insert", listener: CollectionEventListener): void; - removeEventListener(type: "erase", listener: CollectionEventListener): void; - removeEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - } - /** - * @hidden - */ - namespace ICollection { - /** - * @hidden - */ - function _Dispatch_CollectionEvent(collection: ICollection, type: string, first: std.Iterator, last: std.Iterator): void; - /** - * @hidden - */ - function _Dispatch_MapCollectionEvent(collection: ICollection>, type: string, first: std.MapIterator, last: std.MapIterator): void; - } -} -declare namespace samchon.collections { - /** - * A {@link List} who can detect element I/O events. - * - * Below is the list of methods who are dispatching {@link CollectionEvent}: - * - *insert* typed events: - * - {@link assign} - * - {@link insert} - * - {@link push} - * - {@link push_front} - * - {@link push_back} - * - {@link merge} - * - *erase* typed events: - * - {@link assign} - * - {@link clear} - * - {@link erase} - * - {@link pop_front} - * - {@link pop_back} - * - {@link unique} - * - {@link remove} - * - {@link remove_if} - * - {@link splice} - * - *refresh* typed events: - * - {@link refresh} - * - {@link sort} - * - * #### [Inherited] {@link List} - * {@link List Lists} are sequence containers that allow constant time insert and erase operations anywhere within - * the sequence, and iteration in both directions. - * - * List containers are implemented as doubly-linked lists; Doubly linked lists can store each of the elements they - * contain in different and unrelated storage locations. The ordering is kept internally by the association to - * each element of a link to the element preceding it and a link to the element following it. - * - * They are very similar to forward_list: The main difference being that forward_list objects are single-linked - * lists, and thus they can only be iterated forwards, in exchange for being somewhat smaller and more efficient. - * - * Compared to other base standard sequence containers (array, vector and deque), lists perform generally better - * in inserting, extracting and moving elements in any position within the container for which an iterator has - * already been obtained, and therefore also in algorithms that make intensive use of these, like sorting - * algorithms. - * - * The main drawback of lists and forward_lists compared to these other sequence containers is that they lack - * direct access to the elements by their position; For example, to access the sixth element in a list, one has to - * iterate from a known position (like the beginning or the end) to that position, which takes linear time in the - * distance between these. They also consume some extra memory to keep the linking information associated to each - * element (which may be an important factor for large lists of small-sized elements). - * - * - * - * - * - *

Container properties

- *
- *
Sequence
- *
Elements in sequence containers are ordered in a strict linear sequence. Individual elements are accessed by - * their position in this sequence.
- * - *
Doubly-linked list
- *
Each element keeps information on how to locate the next and the previous elements, allowing constant time - * insert and erase operations before or after a specific element (even of entire ranges), but no direct random - * access.
- *
- * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/list/list/ - * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) - * @author Jeongho Nam - */ - class ListCollection extends std.List implements ICollection { - /** - * A chain object taking responsibility of dispatching events. - */ - private event_dispatcher_; - /** - * @inheritdoc - */ - push(...items: T[]): number; - /** - * @inheritdoc - */ - push_front(val: T): void; - /** - * @inheritdoc - */ - push_back(val: T): void; - /** - * @hidden - */ - protected _Insert_by_repeating_val(position: std.ListIterator, n: number, val: T): std.ListIterator; - /** - * @hidden - */ - protected _Insert_by_range>(position: std.ListIterator, begin: InputIterator, end: InputIterator): std.ListIterator; - /** - * @inheritdoc - */ - pop_front(): void; - /** - * @inheritdoc - */ - pop_back(): void; - /** - * @hidden - */ - protected _Erase_by_range(first: std.ListIterator, last: std.ListIterator): std.ListIterator; - /** - * @hidden - */ - private notify_insert(first, last); - /** - * @hidden - */ - private notify_erase(first, last); - /** - * @inheritdoc - */ - hasEventListener(type: string): boolean; - /** - * @inheritdoc - */ - dispatchEvent(event: library.BasicEvent): boolean; - /** - * @inheritdoc - */ - refresh(): void; - /** - * @inheritdoc - */ - refresh(it: std.ListIterator): void; - /** - * @inheritdoc - */ - refresh(first: std.ListIterator, last: std.ListIterator): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener): void; - addEventListener(type: "insert", listener: CollectionEventListener): void; - addEventListener(type: "erase", listener: CollectionEventListener): void; - addEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener): void; - removeEventListener(type: "insert", listener: CollectionEventListener): void; - removeEventListener(type: "erase", listener: CollectionEventListener): void; - removeEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - } -} -declare namespace samchon.collections { - type MapCollectionEventListener = (event: MapCollectionEvent) => void; - /** - * An event occured in a {@link MapContainer map container} object. - * - * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) - * @author Jeongho Nam - */ - class MapCollectionEvent extends CollectionEvent> { - /** - * @inheritdoc - */ - readonly first: std.MapIterator; - /** - * @inheritdoc - */ - readonly last: std.MapIterator; - } -} -declare namespace samchon.collections { - /** - * A {@link TreeMap} who can detect element I/O events. - * - * Below is the list of methods who are dispatching {@link MapCollectionEvent}: - * - *insert* typed events: - * - {@link assign} - * - {@link insert} - * - {@link insert_or_assign} - * - {@link emplace} - * - {@link set} - * - {@link push} - * - *erase* typed events: - * - {@link assign} - * - {@link clear} - * - {@link erase} - * - {@link extract} - * - *refresh* typed events: - * - {@link refresh} - * - * #### [Inherited] {@link TreeMap} - * {@link TreeMap TreeMaps} are associative containers that store elements formed by a combination of a - * *key value* (*Key*) and a *mapped value* (*T*), following order. - * - * In a {@link TreeMap}, the *key values* are generally used to sort and uniquely identify the elements, while the - * *mapped values* store the content associated to this key. The types of *key* and *mapped value* may differ, and - * are grouped together in member type *value_type*, which is a {@link Pair} type combining both: - * - * ```typedef Pair value_type;``` - * - * Internally, the elements in a {@link TreeMap} are always sorted by its *key* following a *strict weak ordering* - * criterion indicated by its internal comparison method {@link less}. - * - * {@link TreeMap} containers are generally slower than {@link HashMap HashMap} containers to access individual - * elements by their *key*, but they allow the direct iteration on subsets based on their order. - * - * {@link TreeMap}s are typically implemented as binary search trees. - * - * - * - * - * - *

Container properties

- *
- *
Associative
- *
Elements in associative containers are referenced by their *key* and not by their absolute - * position in the container.
- * - *
Ordered
- *
The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order.
- * - *
Map
- *
Each element associates a *key* to a *mapped value*: - * *Keys* are meant to identify the elements whose main content is the *mapped value*.
- * - *
Unique keys
- *
No two elements in the container can have equivalent *keys*.
- *
- * - * @param Type of the keys. Each element in a map is uniquely identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/map/map - * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) - * @author Jeongho Nam - */ - class TreeMapCollection extends std.TreeMap implements ICollection> { - /** - * A chain object taking responsibility of dispatching events. - */ - private event_dispatcher_; - /** - * @inheritdoc - */ - protected _Handle_insert(first: std.MapIterator, last: std.MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: std.MapIterator, last: std.MapIterator): void; - /** - * @inheritdoc - */ - hasEventListener(type: string): boolean; - /** - * @inheritdoc - */ - dispatchEvent(event: library.BasicEvent): boolean; - /** - * @inheritdoc - */ - refresh(): void; - /** - * @inheritdoc - */ - refresh(it: std.MapIterator): void; - /** - * @inheritdoc - */ - refresh(first: std.MapIterator, last: std.MapIterator): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener): void; - addEventListener(type: "insert", listener: MapCollectionEventListener): void; - addEventListener(type: "erase", listener: MapCollectionEventListener): void; - addEventListener(type: "refresh", listener: MapCollectionEventListener): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; - addEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; - addEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener): void; - removeEventListener(type: "insert", listener: MapCollectionEventListener): void; - removeEventListener(type: "erase", listener: MapCollectionEventListener): void; - removeEventListener(type: "refresh", listener: MapCollectionEventListener): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; - removeEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; - removeEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; - } -} -declare namespace samchon.collections { - /** - * A {@link TreeMultiMap} who can detect element I/O events. - * - * Below is the list of methods who are dispatching {@link MapCollectionEvent}: - * - *insert* typed events: - * - {@link assign} - * - {@link insert} - * - {@link emplace} - * - {@link push} - * - *erase* typed events: - * - {@link assign} - * - {@link clear} - * - {@link erase} - * - *refresh* typed events: - * - {@link refresh} - * - * #### [Inherited] {@link TreeMultiMap} - * {@link TreeMultiMap TreeMultiMaps} are associative containers that store elements formed by a combination of a - * *key value* and a *mapped value*, following a specific order, and where multiple elements can have equivalent - * keys. - * - * In a {@link TreeMultiMap}, the *key values* are generally used to sort and uniquely identify the elements, - * while the *mapped values* store the content associated to this *key*. The types of *key* and *mapped value* may - * differ, and are grouped together in member type ```value_type```, which is a {@link Pair} type combining both: - * - * ```typedef Pair value_type;``` - * - * Internally, the elements in a {@link TreeMultiMap}are always sorted by its key following a strict weak ordering - * criterion indicated by its internal comparison method (of {@link less}). - * - * {@link TreeMultiMap}containers are generally slower than {@link HashMap} containers to access individual - * elements by their *key*, but they allow the direct iteration on subsets based on their order. - * - * {@link TreeMultiMap TreeMultiMaps} are typically implemented as binary search trees. - * - * < - * img src="http://samchon.github.io/typescript-stl/images/design/class_diagram/map_containers.png" style="max-width: 100%" /> - * - * - *

Container properties

- *
- *
Associative
- *
- * Elements in associative containers are referenced by their *key* and not by their absolute - * position in the container. - *
- * - *
Ordered
- *
- * The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order. - *
- * - *
Map
- *
- * Each element associates a *key* to a *mapped value*: - * *Keys* are meant to identify the elements whose main content is the *mapped value*. - *
- * - *
Multiple equivalent keys
- *
Multiple elements in the container can have equivalent *keys*.
- *
- * - * @param Type of the keys. Each element in a map is uniquely identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/map/multimap - * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) - * @author Jeongho Nam - */ - class TreeMultiMapCollection extends std.TreeMultiMap implements ICollection> { - /** - * A chain object taking responsibility of dispatching events. - */ - private event_dispatcher_; - /** - * @inheritdoc - */ - protected _Handle_insert(first: std.MapIterator, last: std.MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: std.MapIterator, last: std.MapIterator): void; - /** - * @inheritdoc - */ - hasEventListener(type: string): boolean; - /** - * @inheritdoc - */ - dispatchEvent(event: library.BasicEvent): boolean; - /** - * @inheritdoc - */ - refresh(): void; - /** - * @inheritdoc - */ - refresh(it: std.MapIterator): void; - /** - * @inheritdoc - */ - refresh(first: std.MapIterator, last: std.MapIterator): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener): void; - addEventListener(type: "insert", listener: MapCollectionEventListener): void; - addEventListener(type: "erase", listener: MapCollectionEventListener): void; - addEventListener(type: "refresh", listener: MapCollectionEventListener): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; - addEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; - addEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener): void; - removeEventListener(type: "insert", listener: MapCollectionEventListener): void; - removeEventListener(type: "erase", listener: MapCollectionEventListener): void; - removeEventListener(type: "refresh", listener: MapCollectionEventListener): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; - removeEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; - removeEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; - } -} -declare namespace samchon.collections { - /** - * A {@link TreeMultiSet} who can detect element I/O events. - * - * Below is the list of methods who are dispatching {@link CollectionEvent}: - * - *insert* typed events: - * - {@link assign} - * - {@link insert} - * - {@link push} - * - *erase* typed events: - * - {@link assign} - * - {@link clear} - * - {@link erase} - * - *refresh* typed events: - * - {@link refresh} - * - * #### [Inherited] {@link TreeMultiSet} - * {@link TreeMultiSet TreeMultiSets} are containers that store elements following a specific order, and where - * multiple elements can have equivalent values. - * - * In a {@link TreeMultiSet}, the value of an element also identifies it (the value is itself the *key*, of type - * *T*). The value of the elements in a {@link TreeMultiSet} cannot be modified once in the container (the - * elements are always const), but they can be inserted or removed from the container. - * - * Internally, the elements in a {@link TreeMultiSet TreeMultiSets} are always sorted following a strict weak - * ordering criterion indicated by its internal comparison method (of {@link IComparable.less less}). - * - * {@link TreeMultiSet} containers are generally slower than {@link HashMultiSet} containers to access individual - * elements by their *key*, but they allow the direct iteration on subsets based on their order. - * - *

{@link TreeMultiSet TreeMultiSets} are typically implemented as binary search trees.

- * - *

- *

- * - *

Container properties

- *
- *
Associative
- *
- * Elements in associative containers are referenced by their *key* and not by their absolute - * position in the container. - *
- * - *
Ordered
- *
- * The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order. - *
- * - *
Set
- *
The value of an element is also the *key* used to identify it.
- * - *
Multiple equivalent keys
- *
Multiple elements in the container can have equivalent *keys*.
- *
- * - * @param Type of the elements. Each element in a {@link TreeMultiSet} container is also identified - * by this value (each value is itself also the element's *key*). - * - * @reference http://www.cplusplus.com/reference/set/multiset - * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) - * @author Jeongho Nam - */ - class TreeMultiSetCollection extends std.TreeMultiSet implements ICollection { - /** - * A chain object taking responsibility of dispatching events. - */ - private event_dispatcher_; - /** - * @inheritdoc - */ - protected _Handle_insert(first: std.SetIterator, last: std.SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: std.SetIterator, last: std.SetIterator): void; - /** - * @inheritdoc - */ - hasEventListener(type: string): boolean; - /** - * @inheritdoc - */ - dispatchEvent(event: library.BasicEvent): boolean; - /** - * @inheritdoc - */ - refresh(): void; - /** - * @inheritdoc - */ - refresh(it: std.SetIterator): void; - /** - * @inheritdoc - */ - refresh(first: std.SetIterator, last: std.SetIterator): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener): void; - addEventListener(type: "insert", listener: CollectionEventListener): void; - addEventListener(type: "erase", listener: CollectionEventListener): void; - addEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener): void; - removeEventListener(type: "insert", listener: CollectionEventListener): void; - removeEventListener(type: "erase", listener: CollectionEventListener): void; - removeEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - } -} -declare namespace samchon.collections { - /** - * A {@link TreeMap} who can detect element I/O events. - * - * Below is the list of methods who are dispatching {@link CollectionEvent}: - * - *insert* typed events: - * - {@link assign} - * - {@link insert} - * - {@link insert_or_assign} - * - {@link push} - * - *erase* typed events: - * - {@link assign} - * - {@link clear} - * - {@link erase} - * - {@link extract} - * - *refresh* typed events: - * - {@link refresh} - * - * #### [Inherited] {@link TreeSet} - * {@link TreeSet TreeSets} are containers that store unique elements following a specific order. - * - * In a {@link TreeSet}, the value of an element also identifies it (the value is itself the *key*, of type *T*), - * and each value must be unique. The value of the elements in a {@link TreeSet} cannot be modified once in the - * container (the elements are always const), but they can be inserted or removed from the container. - * - * Internally, the elements in a {@link TreeSet} are always sorted following a specific strict weak ordering - * criterion indicated by its internal comparison method (of {@link less}). - * - * {@link TreeSet} containers are generally slower than {@link HashSet} containers to access individual elements - * by their *key*, but they allow the direct iteration on subsets based on their order. - * - * {@link TreeSet}s are typically implemented as binary search trees. - * - * - * - * - * - *

Container properties

- *
- *
Associative
- *
- * Elements in associative containers are referenced by their *key* and not by their absolute - * position in the container. - *
- * - *
Ordered
- *
- * The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order. - *
- * - *
Set
- *
The value of an element is also the *key* used to identify it.
- * - *
Unique keys
- *
No two elements in the container can have equivalent *keys*.
- *
- * - * @param Type of the elements. - * Each element in an {@link TreeSet} is also uniquely identified by this value. - * - * @reference http://www.cplusplus.com/reference/set/set - * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) - * @author Jeongho Nam - */ - class TreeSetCollection extends std.TreeSet implements ICollection { - /** - * A chain object taking responsibility of dispatching events. - */ - private event_dispatcher_; - /** - * @inheritdoc - */ - protected _Handle_insert(first: std.SetIterator, last: std.SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: std.SetIterator, last: std.SetIterator): void; - /** - * @inheritdoc - */ - hasEventListener(type: string): boolean; - /** - * @inheritdoc - */ - dispatchEvent(event: library.BasicEvent): boolean; - /** - * @inheritdoc - */ - refresh(): void; - /** - * @inheritdoc - */ - refresh(it: std.SetIterator): void; - /** - * @inheritdoc - */ - refresh(first: std.SetIterator, last: std.SetIterator): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener): void; - addEventListener(type: "insert", listener: CollectionEventListener): void; - addEventListener(type: "erase", listener: CollectionEventListener): void; - addEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener): void; - removeEventListener(type: "insert", listener: CollectionEventListener): void; - removeEventListener(type: "erase", listener: CollectionEventListener): void; - removeEventListener(type: "refresh", listener: CollectionEventListener): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; - removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; - } -} -declare namespace samchon.library { - /** - * Case generator. - * - * {@link CaseGenerator} is an abstract case generator being used like a matrix. - *
    - *
  • n��r(n^r) -> {@link CombinedPermutationGenerator}
  • - *
  • nPr -> {@link PermutationGenerator}
  • - *
  • n! -> {@link FactorialGenerator}
  • - *
- * - * @author Jeongho Nam - */ - abstract class CaseGenerator { - /** - * Size, the number of all cases. - */ - protected size_: number; - /** - * N, size of the candidates. - */ - protected n_: number; - /** - * R, size of elements of each case. - */ - protected r_: number; - /** - * Construct from size of N and R. - * - * @param n Size of candidates. - * @param r Size of elements of each case. - */ - constructor(n: number, r: number); - /** - * Get size of all cases. - * - * @return Get a number of the all cases. - */ - size(): number; - /** - * Get size of the N. - */ - n(): number; - /** - * Get size of the R. - */ - r(): number; - /** - * Get index'th case. - * - * @param index Index number - * @return The row of the index'th in combined permuation case - */ - abstract at(index: number): number[]; - } - /** - * A combined-permutation case generator. - * - * n��r - * - * @author Jeongho Nam - */ - class CombinedPermutationGenerator extends CaseGenerator { - /** - * An array using for dividing each element index. - */ - private divider_array; - /** - * Construct from size of N and R. - * - * @param n Size of candidates. - * @param r Size of elements of each case. - */ - constructor(n: number, r: number); - at(index: number): number[]; - } - /** - * A permutation case generator. - * - * nPr - * - * @author Jeongho Nam - */ - class PermuationGenerator extends CaseGenerator { - /** - * Construct from size of N and R. - * - * @param n Size of candidates. - * @param r Size of elements of each case. - */ - constructor(n: number, r: number); - /** - * @inheritdoc - */ - at(index: number): number[]; - } - /** - * Factorial case generator. - * - * n! = nPn - * - * @author Jeongho Nam - */ - class FactorialGenerator extends PermuationGenerator { - /** - * Construct from factorial size N. - * - * @param n Factoria size N. - */ - constructor(n: number); - } -} -declare namespace samchon.library { - type BasicEventListener = (event: BasicEvent) => void; - /** - * The IEventDispatcher interface defines methods for adding or removing event listeners, checks whether specific - * types of event listeners are registered, and dispatches events. - * - * The event target serves as the local point for how events flow through the display list hierarchy. When an - * event such as a mouse click or a key press occurs, an event object is dispatched into the event flow from the - * root of the display list. The event object makes a round-trip journey to the event target, which is - * conceptually divided into three phases: the capture phase includes the journey from the root to the last node - * before the event target's node; the target phase includes only the event target node; and the bubbling phase - * includes any subsequent nodes encountered on the return trip to the root of the display list. - * - * In general, the easiest way for a user-defined class to gain event dispatching capabilities is to extend - * {@link EventDispatcher}. If this is impossible (that is, if the class is already extending another class), you - * can instead implement the {@link IEventDispatcher} interface, create an {@link EventDispatcher} member, and - * write simple hooks to route calls into the aggregated {@link EventDispatcher}. - * - * @reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/IEventDispatcher.html - * @handbook https://github.com/samchon/framework/wiki/TypeScript-Library-EventDispatcher - * @author Migrated by Jeongho Nam - */ - interface IEventDispatcher { - /** - * Checks whether the {@link EventDispatcher} object has any listeners registered for a specific type of event. - * This allows you to determine where an {@link EventDispatcher} object has altered handling of an event type - * in the event flow hierarchy. To determine whether a specific event type actually triggers an event listener, - * use {@link willTrigger willTrigger()}. - * - * The difference between {@link hasEventListener hasEventListener()} and {@link willTrigger willTrigger()} is - * that {@link hasEventListener} examines only the object to which it belongs, whereas {@link willTrigger} - * examines the entire event flow for the event specified by the type parameter. - * - * @param type The type of event. - */ - hasEventListener(type: string): boolean; - /** - * Dispatches an event into the event flow. - * - * The event target is the {@link EventDispatcher} object upon which the {@link dispatchEvent dispatchEvent()} - * method is called. - * - * @param event The {@link BasicEvent} object that is dispatched into the event flow. If the event is being - * redispatched, a clone of the event is created automatically. After an event is dispatched, its - * target property cannot be changed, so you must create a new copy - * of the event for redispatching to work. - */ - dispatchEvent(event: library.BasicEvent): boolean; - /** - * Registers an event listener object with an {@link EventDispatcher} object so that the listener receives - * notification of an event. You can register event listeners on all nodes in the display list for a specific - * type of event, phase, and priority. - * - * After you successfully register an event listener, you cannot change its priority through additional calls - * to {@link addEventListener addEventListener()|} To change a listener's priority, you must first call - * {@link removeEventListener removeEventListener()}. Then you can register the listener again with the new - * priority level. - * - * Keep in mind that after the listener is registered, subsequent calls to {@link addEventListener} with a - * different type or useCapture value result in the creation of a separate listener registration. For example, - * if you first register a listener with useCapture set to true, it listens only during the capture phase. If - * you call {@link addEventListener} again using the same listener object, but with useCapture set to false, - * you have two separate listeners: one that listens during the capture phase and another that listens during - * the target and bubbling phases. - * - * You cannot register an event listener for only the target phase or the bubbling phase. Those phases are - * coupled during registration because bubbling applies only to the ancestors of the target node. - * - * If you no longer need an event listener, remove it by calling {@link removeEventListener}, or memory - * problems could result. Event listeners are not automatically removed from memory because the garbage - * collector does not remove the listener as long as the dispatching object exists (unless the - * useWeakReference parameter is set to true). - * - * Copying an {@link EventDispatcher} instance does not copy the event listeners attached to it. (If your n - * ewly created node needs an event listener, you must attach the listener after creating the node.) However, - * if you move an {@link EventDispatcher} instance, the event listeners attached to it move along with it. - * - * If the event listener is being registered on a node while an event is also being processed on this node, - * the event listener is not triggered during the current phase but may be triggered during a later phase in - * the event flow, such as the bubbling phase. - * - * If an event listener is removed from a node while an event is being processed on the node, it is still - * triggered by the current actions. After it is removed, the event listener is never invoked again (unless it - * is registered again for future processing). - * - * @param event The type of event. - * @param listener The listener function that processes the event. - * This function must accept an Event object as its only parameter and must return - * nothing. - */ - addEventListener(type: string, listener: library.BasicEventListener): void; - /** - * Registers an event listener object with an {@link EventDispatcher} object so that the listener receives - * notification of an event. You can register event listeners on all nodes in the display list for a specific - * type of event, phase, and priority. - * - * After you successfully register an event listener, you cannot change its priority through additional calls - * to {@link addEventListener addEventListener()|} To change a listener's priority, you must first call - * {@link removeEventListener removeEventListener()}. Then you can register the listener again with the new - * priority level. - * - * Keep in mind that after the listener is registered, subsequent calls to {@link addEventListener} with a - * different type or useCapture value result in the creation of a separate listener registration. For example, - * if you first register a listener with useCapture set to true, it listens only during the capture phase. If - * you call {@link addEventListener} again using the same listener object, but with useCapture set to false, - * you have two separate listeners: one that listens during the capture phase and another that listens during - * the target and bubbling phases. - * - * You cannot register an event listener for only the target phase or the bubbling phase. Those phases are - * coupled during registration because bubbling applies only to the ancestors of the target node. - * - * If you no longer need an event listener, remove it by calling {@link removeEventListener}, or memory - * problems could result. Event listeners are not automatically removed from memory because the garbage - * collector does not remove the listener as long as the dispatching object exists (unless the - * useWeakReference parameter is set to true). - * - * Copying an {@link EventDispatcher} instance does not copy the event listeners attached to it. (If your n - * ewly created node needs an event listener, you must attach the listener after creating the node.) However, - * if you move an {@link EventDispatcher} instance, the event listeners attached to it move along with it. - * - * If the event listener is being registered on a node while an event is also being processed on this node, - * the event listener is not triggered during the current phase but may be triggered during a later phase in - * the event flow, such as the bubbling phase. - * - * If an event listener is removed from a node while an event is being processed on the node, it is still - * triggered by the current actions. After it is removed, the event listener is never invoked again (unless it - * is registered again for future processing). - * - * @param event The type of event. - * @param listener The listener function that processes the event. - * This function must accept an Event object as its only parameter and must return - * nothing. - * @param thisArg The object to be used as the **this** object. - */ - addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - /** - * Removes a listener from the {@link EventDispatcher} object. If there is no matching listener registered - * with the {@link EventDispatcher} object, a call to this method has no effect. - * - * @param type The type of event. - * @param listener The listener object to remove. - */ - removeEventListener(type: string, listener: library.BasicEventListener): void; - /** - * Removes a listener from the {@link EventDispatcher} object. If there is no matching listener registered - * with the {@link EventDispatcher} object, a call to this method has no effect. - * - * @param type The type of event. - * @param listener The listener object to remove. - * @param thisArg The object to be used as the **this** object. - */ - removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - } - /** - * The {@link EventDispatcher} class is the base class for all classes that dispatch events. The - * {@link EventDispatcher} class implements the {@link IEventDispatcher} interface and is the base class for the - * {@link DisplayObject} class. The {@link EventDispatcher} class allows any object on the display list to be an - * event target and as such, to use the methods of the {@link IEventDispatcher} interface. - * - * The event target serves as the local point for how events flow through the display list hierarchy. When an - * event such as a mouse click or a key press occurs, an event object is dispatched into the event flow from the - * root of the display list. The event object makes a round-trip journey to the event target, which is - * conceptually divided into three phases: the capture phase includes the journey from the root to the last node - * before the event target's node; the target phase includes only the event target node; and the bubbling phase - * includes any subsequent nodes encountered on the return trip to the root of the display list. - * - * In general, the easiest way for a user-defined class to gain event dispatching capabilities is to extend - * {@link EventDispatcher}. If this is impossible (that is, if the class is already extending another class), you - * can instead implement the {@link IEventDispatcher} interface, create an {@link EventDispatcher} member, and - * write simple hooks to route calls into the aggregated {@link EventDispatcher}. - * - * @reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/EventDispatcher.html - * @author Migrated by Jeongho Nam - */ - class EventDispatcher implements IEventDispatcher { - /** - * @hidden - */ - private event_dispatcher_; - /** - * @hidden - */ - private event_listeners_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from the origin event dispatcher. - * - * @param dispatcher The origin object who issuing events. - */ - constructor(dispatcher: IEventDispatcher); - /** - * @inheritdoc - */ - hasEventListener(type: string): boolean; - /** - * @inheritdoc - */ - dispatchEvent(event: library.BasicEvent): boolean; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener): void; - /** - * @inheritdoc - */ - addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener): void; - /** - * @inheritdoc - */ - removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; - } -} -declare namespace samchon.library { - /** - * The {@link FileReference} class provides a means to load and save files in browser level. - * - * The {@link FileReference} class provides a means to {@link load} and {@link save} files in browser level. A - * browser-system dialog box prompts the user to select a file to {@link load} or a location for {@link svae}. Each - * {@link FileReference} object refers to a single file on the user's disk and has properties that contain - * information about the file's size, type, name, creation date, modification date, and creator type (Macintosh only). - * - * - * FileReference instances are created in the following ways: - *
    - *
  • - * When you use the new operator with the {@link FileReference} constructor: - * let myFileReference: FileReference = new FileReference(); - *
  • - *
  • - * When you call the {@link FileReferenceList.browse} method, which creates an array of {@link FileReference} - * objects. - *
  • - *
- * - * During a load operation, all the properties of a {@link FileReference} object are populated by calls to the - * {@link FileReference.browse} or {@link FileReferenceList.browse} methods. During a save operation, the name - * property is populated when the select event is dispatched; all other properties are populated when the complete - * event is dispatched. - * - * The {@link browse browse()} method opens an browser-system dialog box that prompts the user to select a file - * for {@link load}. The {@link FileReference.browse} method lets the user select a single file; the - * {@link FileReferenceList.browse} method lets the user select multiple files. After a successful call to the - * {@link browse browse()} method, call the {@link FileReference.load} method to load one file at a time. The - * {@link FileReference.save} method prompts the user for a location to save the file and initiates downloading from - * a binary or string data. - * - * The {@link FileReference} and {@link FileReferenceList} classes do not let you set the default file location - * for the dialog box that the {@link browse} or {@link save} methods generate. The default location shown in the - * dialog box is the most recently browsed folder, if that location can be determined, or the desktop. The classes do - * not allow you to read from or write to the transferred file. They do not allow the browser that initiated the - * {@link load} or {@link save} to access the loaded or saved file or the file's location on the user's disk. - * - * @references http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html - * @author Jeongho Nam - */ - class FileReference extends EventDispatcher { - /** - * @hidden - */ - private file_; - /** - * @hidden - */ - private data_; - /** - * Default Constructor. - */ - constructor(); - /** - * The data from the loaded file after a successful call to the {@link load load()} method. - * - * If the {@link FileReference} object was not populated (by a valid call to {@link FileReference.browse}), - * an {@link LogicError exception} will be thrown when you try to get the value of this property. - * - * All the properties of a {@link FileReference} object are populated by calling the {@link browse browse()}. - * - */ - readonly data: any; - /** - * The name of the file on the local disk. - * - * If the {@link FileReference} object was not populated (by a valid call to {@link FileReference.browse}), - * an {@link LogicError exception} will be thrown when you try to get the value of this property. - * - * All the properties of a {@link FileReference} object are populated by calling the {@link browse browse()}. - * - */ - readonly name: string; - /** - * The filename extension. - * - * A file's extension is the part of the name following (and not including) the final dot ("."). If - * there is no dot in the filename, the extension is null. - * - * If the {@link FileReference} object was not populated (by a valid call to {@link FileReference.browse}), - * an {@link LogicError exception} will be thrown when you try to get the value of this property. - * - * All the properties of a {@link FileReference} object are populated by calling the {@link browse browse()}. - * - */ - readonly extension: string; - /** - * The file type, metadata of the {@link extension}. - * - * If the {@link FileReference} object was not populated (by a valid call to {@link FileReference.browse}), - * an {@link LogicError exception} will be thrown when you try to get the value of this property. - * - * All the properties of a {@link FileReference} object are populated by calling the {@link browse browse()}. - * - */ - readonly type: string; - /** - * The size of the file on the local disk in bytes. - * - * If the {@link FileReference} object was not populated (by a valid call to {@link FileReference.browse}), - * an {@link LogicError exception} will be thrown when you try to get the value of this property. - * - * All the properties of a {@link FileReference} object are populated by calling the {@link browse browse()}. - * - */ - readonly size: number; - /** - * The date that the file on the local disk was last modified. - * - * If the {@link FileReference} object was not populated (by a valid call to {@link FileReference.browse}), - * an {@link LogicError exception} will be thrown when you try to get the value of this property. - * - * All the properties of a {@link FileReference} object are populated by calling the {@link browse browse()}. - * - */ - readonly modificationDate: Date; - /** - * Displays a file-browsing dialog box that lets the user select a file to upload. The dialog box is native - * to the user's browser system. The user can select a file on the local computer or from other systems, for - * example, through a UNC path on Windows. - * - * When you call this method and the user successfully selects a file, the properties of this - * {@link FileReference} object are populated with the properties of that file. Each subsequent time that the - * {@link FileReference.browse} method is called, the {@link FileReference} object's properties are reset to - * the file that the user selects in the dialog box. Only one {@link browse browse()} can be performed at a time - * (because only one dialog box can be invoked at a time). - * - * Using the *typeFilter parameter*, you can determine which files the dialog box displays. - * - * @param typeFilter An array of filter strings used to filter the files that are displayed in the dialog box. - * If you omit this parameter, all files are displayed. - */ - browse(...typeFilter: string[]): void; - /** - * Starts the load of a local file selected by a user. - * - * You must call the {@link FileReference.browse} or {@link FileReferenceList.browse} method before you call - * the {@link load load()} method. - * - * Listeners receive events to indicate the progress, success, or failure of the load. Although you can use - * the {@link FileReferenceList} object to let users select multiple files to load, you must {@link load} the - * {@link FileReferenceList files} one by one. To {@link load} the files one by one, iterate through the - * {@link FileReferenceList.fileList} array of {@link FileReference} objects. - * - * If the file finishes loading successfully, its contents are stored in the {@link data} property. - */ - load(): void; - /** - * Save a file to local filesystem. - * - * {@link FileReference.save} implemented the save function by downloading a file from a hidden anchor tag. - * However, the plan, future's {@link FileReference} will follow such rule: - * - * Opens a dialog box that lets the user save a file to the local filesystem. - * - * The {@link save save()} method first opens an browser-system dialog box that asks the user to enter a - * filename and select a location on the local computer to save the file. When the user selects a location and - * confirms the save operation (for example, by clicking Save), the save process begins. Listeners receive events - * to indicate the progress, success, or failure of the save operation. To ascertain the status of the dialog box - * and the save operation after calling {@link save save()}, your code must listen for events such as cancel, - * open, progress, and complete. - * - * When the file is saved successfully, the properties of the {@link FileReference} object are populated with - * the properties of the local file. The complete event is dispatched if the save is successful. - * - * Only one {@link browse browse()} or {@link save()} session can be performed at a time (because only one - * dialog box can be invoked at a time). - * - * @param data The data to be saved. The data can be in one of several formats, and will be treated appropriately. - * @param fileName File name to be saved. - */ - save(data: string, fileName: string): void; - /** - * Save a file to local filesystem. - * - * {@link FileReference.save} implemented the save function by downloading a file from a hidden anchor tag. - * However, the plan, future's {@link FileReference} will follow such rule: - * - * Opens a dialog box that lets the user save a file to the local filesystem. - * - * The {@link save save()} method first opens an browser-system dialog box that asks the user to enter a - * filename and select a location on the local computer to save the file. When the user selects a location and - * confirms the save operation (for example, by clicking Save), the save process begins. Listeners receive events - * to indicate the progress, success, or failure of the save operation. To ascertain the status of the dialog box - * and the save operation after calling {@link save save()}, your code must listen for events such as cancel, - * open, progress, and complete. - * - * When the file is saved successfully, the properties of the {@link FileReference} object are populated with - * the properties of the local file. The complete event is dispatched if the save is successful. - * - * Only one {@link browse browse()} or {@link save()} session can be performed at a time (because only one - * dialog box can be invoked at a time). - * - * @param data The data to be saved. The data can be in one of several formats, and will be treated appropriately. - * @param fileName File name to be saved. - */ - static save(data: string, fileName: string): void; - } - /** - * The {@link FileReferenceList} class provides a means to let users select one or more files for - * {@link FileReference.load loading}. A {@link FileReferenceList} object represents a group of one or more local - * files on the user's disk as an array of {@link FileReference} objects. For detailed information and important - * considerations about {@link FileReference} objects and the FileReference class, which you use with - * {@link FileReferenceList}, see the {@link FileReference} class. - * - * To work with the {@link FileReferenceList} class: - *
    - *
  • Instantiate the class: var myFileRef = new FileReferenceList();
  • - *
  • - * Call the {@link FileReferenceList.browse} method, which opens a dialog box that lets the user select one or - * more files for upload: myFileRef.browse(); - *
  • - *
  • - * After the {@link browse browse()} method is called successfully, the {@link fileList} property of the - * {@link FileReferenceList} object is populated with an array of {@link FileReference} objects. - *
  • - *
  • Call {@link FileReference.load} on each element in the {@link fileList} array.
  • - *
- * - * The {@link FileReferenceList} class includes a {@link browse browse()} method and a {@link fileList} property - * for working with multiple files. - * - * @reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReferenceList.html - * @author Jeongho Nam - */ - class FileReferenceList extends EventDispatcher { - /** - * @hidden - */ - file_list: std.Vector; - /** - * Default Constructor. - */ - constructor(); - /** - * An array of {@link FileReference} objects. - * - * When the {@link FileReferenceList.browse} method is called and the user has selected one or more files - * from the dialog box that the {@link browse browse()} method opens, this property is populated with an array of - * {@link FileReference} objects, each of which represents the files the user selected. - * - * The {@link fileList} property is populated anew each time {@link browse browse()} is called on that - * {@link FileReferenceList} object. - */ - readonly fileList: std.Vector; - /** - * Displays a file-browsing dialog box that lets the user select one or more local files to upload. The - * dialog box is native to the user's browser system. - * - * When you call this method and the user successfully selects files, the {@link fileList} property of this - * {@link FileReferenceList} object is populated with an array of {@link FileReference} objects, one for each - * file that the user selects. Each subsequent time that the {@link FileReferenceList.browse} method is called, - * the {@link FileReferenceList.fileList} property is reset to the file(s) that the user selects in the dialog - * box. - * - * Using the *typeFilter* parameter, you can determine which files the dialog box displays. - * - * Only one {@link FileReference.browse}, {@link FileReference.load}, or {@link FileReferenceList.browse} - * session can be performed at a time on a {@link FileReferenceList} object (because only one dialog box can be - * opened at a time). - * - * @param typeFilter An array of filter strings used to filter the files that are displayed in the dialog box. - * If you omit this parameter, all files are displayed. - */ - browse(...typeFilter: string[]): void; - } -} -declare namespace samchon.library { - /** - * A genetic algorithm class. - * - * In the field of artificial intelligence, a genetic algorithm (GA) is a search heuristic that mimics the - * process of natural selection. This heuristic (also sometimes called a metaheuristic) is routinely used to generate - * useful solutions to optimization and search problems. - * - * Genetic algorithms belong to the larger class of evolutionary algorithms (EA), which generate solutions to - * optimization problems using techniques inspired by natural evolution, such as inheritance, {@link mutate mutation}, - * {@link selection}, and {@link crossover}. - * - * @reference https://en.wikipedia.org/wiki/Genetic_algorithm - * @author Jeongho Nam - */ - class GeneticAlgorithm { - /** - * Whether each element (Gene) is unique in their GeneArray. - */ - private unique_; - /** - * Rate of mutation. - * - * The {@link mutation_rate} determines the percentage of occurence of mutation in GeneArray. - * - *
    - *
  • When {@link mutation_rate} is too high, it is hard to ancitipate studying on genetic algorithm.
  • - *
  • - * When {@link mutation_rate} is too low and initial set of genes (GeneArray) is far away from optimal, the - * evolution tends to wandering outside of he optimal. - *
  • - *
- */ - private mutation_rate_; - /** - * Number of tournaments in selection. - */ - private tournament_; - /** - * Initialization Constructor. - * - * @param unique Whether each Gene is unique in their GeneArray. - * @param mutation_rate Rate of mutation. - * @param tournament Number of tournaments in selection. - */ - constructor(unique?: boolean, mutation_rate?: number, tournament?: number); - /** - * Evolove *GeneArray*. - * - * Convenient method accessing to {@link evolvePopulation evolvePopulation()}. - * - * @param individual An initial set of genes; sequence listing. - * @param population Size of population in a generation. - * @param generation Size of generation in evolution. - * @param compare A comparison function returns whether left gene is more optimal. - * - * @return An evolved *GeneArray*, optimally. - * - * @see {@link GAPopulation.compare} - */ - evolveGeneArray>(individual: GeneArray, population: number, generation: number, compare?: (left: T, right: T) => boolean): GeneArray; - /** - * Evolve *population*, a mass of *GeneArraies*. - * - * @param population An initial population. - * @param compare A comparison function returns whether left gene is more optimal. - * - * @return An evolved population. - * - * @see {@link GAPopulation.compare} - */ - evolvePopulation>(population: GAPopulation, compare?: (left: T, right: T) => boolean): GAPopulation; - /** - * Select the best GeneArray in *population* from tournament. - * - * {@link selection Selection} is the stage of a genetic algorithm in which individual genomes are chosen - * from a population for later breeding (using {@linlk crossover} operator). A generic {@link selection} - * procedure may be implemented as follows: - * - *
    - *
  1. - * The fitness function is evaluated for each individual, providing fitness values, which are then - * normalized. ization means dividing the fitness value of each individual by the sum of all fitness - * values, so that the sum of all resulting fitness values equals 1. - *
  2. - *
  3. The population is sorted by descending fitness values.
  4. - *
  5. - * Accumulated normalized fitness values are computed (the accumulated fitness value of an individual is the - * sum of its own fitness value plus the fitness values of all the previous individuals). The accumulated - * fitness of the last individual should be 1 (otherwise something went wrong in the normalization step). - *
  6. - *
  7. A random number R between 0 and 1 is chosen.
  8. - *
  9. The selected individual is the first one whose accumulated normalized value is greater than R.
  10. - *
- * - * @param population The target of tournament. - * @return The best genes derived by the tournament. - * - * @reference https://en.wikipedia.org/wiki/Selection_(genetic_algorithm) - */ - private selection(population); - /** - * Create a new GeneArray by crossing over two *GeneArray*(s). - * - * {@link crossover} is a genetic operator used to vary the programming of a chromosome or chromosomes from - * one generation to the next. It is analogous to reproduction and biological crossover, upon which genetic - * algorithms are based. - * - * {@link crossover Cross over} is a process of taking more than one parent solutions and producing a child - * solution from them. There are methods for selection of the chromosomes. - * - * @param parent1 A parent sequence listing - * @param parent2 A parent sequence listing - * - * @reference https://en.wikipedia.org/wiki/Crossover_(genetic_algorithm) - */ - private crossover(parent1, parent2); - /** - * Cause a mutation on the *GeneArray*. - * - * {@link mutate Mutation} is a genetic operator used to maintain genetic diversity from one generation of a - * population of genetic algorithm chromosomes to the next. It is analogous to biological mutation. - * - * {@link mutate Mutation} alters one or more gene values in a chromosome from its initial state. In - * {@link mutate mutation}, the solution may change entirely from the previous solution. Hence GA can come to - * better solution by using {@link mutate mutation}. - * - * {@link mutate Mutation} occurs during evolution according to a user-definable mutation probability. This - * probability should be set low. If it is set too high, the search will turn into a primitive random search. - * - *

Note

- * Muttion is pursuing diversity. Mutation is useful for avoiding the following problem. - * - * When initial set of genes(GeneArray) is far away from optimail, without mutation (only with selection and - * crossover), the genetic algorithm has a tend to wandering outside of the optimal. - * - * Genes in the GeneArray will be swapped following percentage of the {@link mutation_rate}. - * - * @param individual A container of genes to mutate - * - * @reference https://en.wikipedia.org/wiki/Mutation_(genetic_algorithm) - * @see {@link mutation_rate} - */ - private mutate(individual); - } - /** - * A population in a generation. - * - * {@link GAPopulation} is a class representing population of candidate genes (sequence listing) having an array - * of GeneArray as a member. {@link GAPopulation} also manages initial set of genes and handles fitting test direclty - * by the method {@link fitTest fitTest()}. - * - * The success of evolution of genetic algorithm is depend on the {@link GAPopulation}'s initial set and fitting - * test. (*GeneArray* and {@link compare}.) - * - *

Warning

- * Be careful for the mistakes of direction or position of the {@link compare}. - * Most of logical errors failed to access optimal solution are occured from those mistakes. - * - * @param Type of gene elements. - * @param An array containing genes as elments; sequnce listing. - * - * @author Jeongho Nam - */ - class GAPopulation> { - /** - * Genes representing the population. - */ - private children_; - /** - * A comparison function returns whether left gene is more optimal, greater. - * - * Default value of this {@link compare} is {@link std.greater}. It means to compare two array - * (GeneArray must be a type of {@link std.base.IArrayContainer}). Thus, you've to keep follwing rule. - * - *
    - *
  • GeneArray is implemented from {@link std.base.IArrayContainer}.
  • - *
      - *
    • {@link std.Vector}
    • - *
    • {@link std.Deque}
    • - *
    - *
  • GeneArray has custom public less(obj: T): boolean; function.
  • - *
- * - * If you don't want to follow the rule or want a custom comparison function, you have to realize a - * comparison function. - */ - private compare_; - /** - * Private constructor with population. - * - * Private constructor of GAPopulation does not create {@link children}. (candidate genes) but only assigns - * *null* repeatedly following the *population size*. - * - * This private constructor is designed only for {@link GeneticAlgorithm}. Don't create {@link GAPopulation} - * with this constructor, by yourself. - * - * @param size Size of the population. - */ - constructor(size: number); - /** - * Construct from a {@link GeneArray} and *size of the population*. - * - * This public constructor creates *GeneArray(s)* as population (size) having shuffled genes which are - * came from the initial set of genes (*geneArray*). It uses {@link std.greater} as default comparison function. - * - * - * @param geneArray An initial sequence listing. - * @param size The size of population to have as children. - */ - constructor(geneArray: GeneArray, size: number); - /** - * Constructor from a GeneArray, size of the poluation and custom comparison function. - * - * This public constructor creates *GeneArray(s)* as population (size) having shuffled genes which are - * came from the initial set of genes (*geneArray*). The *compare* is used for comparison function. - * - * - * @param geneArray An initial sequence listing. - * @param size The size of population to have as children. - * @param compare A comparison function returns whether left gene is more optimal. - */ - constructor(geneArray: GeneArray, size: number, compare: (left: GeneArray, right: GeneArray) => boolean); - children(): std.Vector; - /** - * Test fitness of each *GeneArray* in the {@link population}. - * - * @return The best *GeneArray* in the {@link population}. - */ - fitTest(): GeneArray; - /** - * @hidden - */ - private clone(obj); - } -} -declare namespace samchon.library { - /** - * A utility class supporting static methods of string. - * - * The {@link StringUtil} utility class is an all-static class with methods for working with string objects. - * You do not create instances of {@link StringUtil}; instead you call methods such as the - * ```StringUtil.substitute()``` method. - * - * @reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/utils/StringUtil.html - * @author Jeongho Nam - */ - class StringUtil { - /** - * Generate a substring. - * - * Extracts a substring consisting of the characters from specified start to end. - * It's same with str.substring( ? = (str.find(start) + start.size()), str.find(end, ?) ) - * - * ```typescript - * let str: string = StringUtil.between("ABCD(EFGH)IJK", "(", ")"); - * console.log(str); // PRINTS "EFGH" - * ``` - * - * - If start is not specified, extracts from begin of the string to end. - * - If end is not specified, extracts from start to end of the string. - * - If start and end are all omitted, returns str, itself. - * - * @param str Target string to be applied between. - * @param start A string for separating substring at the front. - * @param end A string for separating substring at the end. - * - * @return substring by specified terms. - */ - static between(str: string, start?: string, end?: string): string; - /** - * Fetch substrings. - * - * Splits a string into an array of substrings dividing by specified delimeters of start and end. - * It's the array of substrings adjusted the between. - * - *
    - *
  • If startStr is omitted, it's same with the split by endStr not having last item.
  • - *
  • If endStr is omitted, it's same with the split by startStr not having first item.
  • - *
  • If startStr and endStar are all omitted, returns *str*.
  • - *
- * - * @param str Target string to split by between. - * @param start A string for separating substring at the front. - * If omitted, it's same with split(end) not having last item. - * @param end A string for separating substring at the end. - * If omitted, it's same with split(start) not having first item. - * @return An array of substrings. - */ - static betweens(str: string, start?: string, end?: string): Array; - /** - * An array containing whitespaces. - */ - private static SPACE_ARRAY; - /** - * Remove all designated characters from the beginning and end of the specified string. - * - * @param str The string whose designated characters should be trimmed. - * @param args Designated character(s). - * - * @return Updated string where designated characters was removed from the beginning and end. - */ - static trim(str: string, ...args: string[]): string; - /** - * Remove all designated characters from the beginning of the specified string. - * - * @param str The string should be trimmed. - * @param delims Designated character(s). - * - * @return Updated string where designated characters was removed from the beginning - */ - static ltrim(str: string, ...args: string[]): string; - /** - * Remove all designated characters from the end of the specified string. - * - * @param str The string should be trimmed. - * @param delims Designated character(s). - * - * @return Updated string where designated characters was removed from the end. - */ - static rtrim(str: string, ...args: string[]): string; - /** - * Substitute {n} tokens within the specified string. - * - * @param format The string to make substitutions in. This string can contain special tokens of the form - * {n}, where n is a zero based index, that will be replaced with the - * additional parameters found at that index if specified. - * @param args Additional parameters that can be substituted in the *format* parameter at each - * {n} location, where n is an integer (zero based) index value into - * the array of values specified. - * - * @return New string with all of the {n} tokens replaced with the respective arguments specified. - */ - static substitute(format: string, ...args: any[]): string; - /** - * Returns a string specified word is replaced. - * - * @param str Target string to replace - * @param before Specific word you want to be replaced - * @param after Specific word you want to replace - * - * @return A string specified word is replaced - */ - static replaceAll(str: string, before: string, after: string): string; - /** - * Returns a string specified words are replaced. - * - * @param str Target string to replace - * @param pairs A specific word's pairs you want to replace and to be replaced - * - * @return A string specified words are replaced - */ - static replaceAll(str: string, ...pairs: std.Pair[]): string; - /** - * Replace all HTML spaces to a literal space. - * - * @param str Target string to replace. - */ - static removeHTMLSpaces(str: string): string; - /** - * Repeat a string. - * - * Returns a string consisting of a specified string concatenated with itself a specified number of times. - * - * @param str The string to be repeated. - * @param n The repeat count. - * - * @return The repeated string. - */ - static repeat(str: string, n: number): string; - /** - * Number to formatted string with "," sign. - * - * Returns a string converted from the number rounded off from specified precision with "," symbols. - * - * @param val A number wants to convert to string. - * @param precision Target precision of round off. - * - * @return A string who represents the number with roundoff and "," symbols. - */ - static numberFormat(val: number, precision?: number): string; - static percentFormat(val: number, precision?: number): string; - } -} -declare namespace samchon.library { - /** - * URLVariables class is for representing variables of HTTP. - * - * {@link URLVariables} class allows you to transfer variables between an application and server. - * - * When transfering, {@link URLVariables} will be converted to a *URI* string. - * - URI: Uniform Resource Identifier - * - * @reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLVariables.html - * @author Migrated by Jeongho Nam - */ - class URLVariables extends std.HashMap { - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from a URL-encoded string. - * - * The {@link decode decode()} method is automatically called to convert the string to properties of the {@link URLVariables} object. - * - * @param str A URL-encoded string containing name/value pairs. - */ - constructor(str: string); - /** - * Converts the variable string to properties of the specified URLVariables object. - * - * @param str A URL-encoded query string containing name/value pairs. - */ - decode(str: string): void; - /** - * Returns a string containing all enumerable variables, in the MIME content encoding application/x-www-form-urlencoded. - */ - toString(): string; - } -} -declare namespace samchon.library { - /** - * A tree-structured XML object. - * - * The {@link XML| class contains methods and properties for working with XML objects. The {@link XML} class (along - * with the {@link XMLList}) implements the powerful XML-handling standards defined in ECMAScript for XML (E4X) - * specification (ECMA-357 edition 2). - * - * An XML object, it is composed with three members; {@link getTag tag}, {@link getProperty properties} and - * {@link getValue value}. As you know, XML is a tree structured data expression method. The tree-stucture; - * {@link XML} class realizes it by extending ```std.HashMap```. Child {@link XML} objects are - * contained in the matched {@link XMLList} object being grouped by their {@link getTag tag name}. The - * {@link XMLList} objects, they're stored in the {@link std.HashMap} ({@link XML} itself) with its **key**; common - * {@link getTag tag name} of children {@link XML} objects. - * - * ```typescript - * class XML extends std.HashMap - * { - * private tag_: string; - * private properties_: std.HashMap; - * private value_: string; - * } - * ``` - * - * ```xml - * - * - * - * {value} - * {value} - * {value} - * - * - * - * - * ``` - * - * Use the {@link toString toString()} method to return a string representation of the {@link XML} object regardless - * of whether the {@link XML} object has simple content or complex content. - * - * @reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/XML.html - * @handbook https://github.com/samchon/framework/wiki/TypeScript-Library-XML - * @author Jeongho Nam - */ - class XML extends std.HashMap { - /** - * @hidden - */ - private tag_; - /** - * @hidden - */ - private value_; - /** - * @hidden - */ - private property_map_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from string. - * - * Creates {@link XML} object by parsing a string who represents xml structure. - * - * @param str A string represents XML structure. - */ - constructor(str: string); - /** - * @hidden - */ - private parse(str); - /** - * @hidden - */ - private parse_tag(str); - /** - * @hidden - */ - private parse_properties(str); - /** - * @hidden - */ - private parse_value(str); - /** - * @hidden - */ - private parse_children(str); - /** - * Get tag. - * - * ```xml - * {value} - * ``` - * - * @return tag. - */ - getTag(): string; - /** - * Get value. - * - * ```xml - * {VALUE} - * ``` - * - * @return value. - */ - getValue(): string; - /** - * Get iterator to property element. - * - * Searches the {@link getPropertyMap properties} for an element with a identifier equivalent to key - * and returns an iterator to it if found, otherwise it returns an iterator to {@link HashMap.end end()}. - * - *

Two keys are considered equivalent if the properties' comparison object returns false reflexively - * (i.e., no matter the order in which the elements are passed as arguments).

- * - * Another member function, {@link hasProperty hasProperty()} can be used to just check whether a particular - * key exists. - * - * ```xml - * {value} - * ``` - * - * @param key Key to be searched for - * @return An iterator to the element, if an element with specified key is found, or - * {@link end HashMap.end()} otherwise. - */ - findProperty(key: string): std.MapIterator; - /** - * Test whether a property exists. - * - * ```xml - * {value} - * ``` - * - * @return Whether a property has the *key* exists or not. - */ - hasProperty(key: string): boolean; - /** - * Get property. - * - * Get property by its *key*, property name. If the matched *key* does not exist, then exception - * {@link std.OutOfRange} is thrown. Thus, it would better to test whether the *key* exits or not by calling the - * {@link hasProperty hasProperty()} method before calling this {@link getProperty getProperty()}. - * - * This method can be substituted by {@link getPropertyMap getPropertyMap()} such below: - * - ```getPropertyMap().get(key, value);``` - * - ```getPropertyMap().find(key).second;``` - * - * ```xml - * {value} - * ``` - * - * @return Value of the matched property. - */ - getProperty(key: string): string; - /** - * Get property map. - * - * ```xml - * {value} - * ``` - * - * @return {@link HashMap} containing properties' keys and values. - */ - getPropertyMap(): std.HashMap; - /** - * Set tag. - * - * Set tag name, identifier of this {@link XML} object. - * - * If this {@link XML} object is belonged to, a child of, an {@link XMLList} and its related {@link XML} objects, - * then calling this {@link setTag setTag()} method direclty is not recommended. Erase this {@link XML} object - * from parent objects and insert this object again. - * - * ```xml - * {value} - * ``` - * - * @param val To be new {@link getTag tag}. - */ - setTag(val: string): void; - /** - * Set value. - * - * ```xml - * {VALUE} - * ``` - * - * @param val To be new {@link getValue value}. - */ - setValue(val: string): void; - /** - * Set property. - * - * Set a property *value* with its *key*. If the *key* already exists, then the *value* will be overwritten to - * the property. Otherwise the *key* is not exist yet, then insert the *key* and *value* {@link Pair pair} to - * {@link getPropertyMao property map}. - * - * This method can be substituted by {@link getPropertyMap getPropertyMap()} such below: - * - ```getPropertyMap().set(key, value);``` - * - ```getPropertyMap().emplace(key, value);``` - * - ```getPropertyMap().insert([key, value]);``` - * - ```getPropertyMap().insert(std.make_pair(key, value));``` - * - * ```xml - * {value} - * ``` - * - * @param key Key, identifier of property to be newly inserted. - * @param value Value of new property to be newly inserted. - */ - setProperty(key: string, value: string): void; - /** - * Erase property. - * - * Erases a property by its *key*, property name. If the matched *key* does not exist, then exception - * {@link std.OutOfRange} is thrown. Thus, it would better to test whether the *key* exits or not by calling the - * {@link hasProperty hasProperty()} method before calling this {@link eraseProperty eraseProperty()}. - * - * This method can be substituted by ``getPropertyMap().erase(key)````. - * - * ```xml - * {value} - * ``` - * - * @param key Key of the property to erase - * @throw {@link std.OutOfRange} - */ - eraseProperty(key: string): void; - /** - * @hidden - */ - push(...args: std.Pair[]): number; - /** - * @hidden - */ - push(...args: [string, XMLList][]): number; - push(...xmls: XML[]): number; - push(...xmlLists: XMLList[]): number; - /** - * Add all properties from other {@link XML} object. - * - * All the properties in the *obj* are copied to this {@link XML} object. If this {@link XML} object has same - * property key in the *obj*, then value of the property will be replaced to *obj*'s own. If you don't want to - * overwrite properties with same key, then use {@link getPropertyMap getPropertyMap()} method. - * - * ```typescript - * let x: library.XML; - * let y: library.XML; - * - * x.addAllProperties(y); // duplicated key exists, then overwrites - * x.getPropertyMap().insert(y.getPropertyMap().begin(), y.getPropertyMap().end()); - * // ducpliated key, then ignores. only non-duplicateds are copied. - * ``` - * - * ```xml - * {value} - * ``` - * - * @param obj Target {@link XML} object to copy properties. - */ - insertAllProperties(obj: XML): void; - /** - * Clear properties. - * - * Remove all properties. It's same with calling ```getPropertyMap().clear()```. - * - * ```xml - * {value} - * ``` - */ - clearProperties(): void; - /** - * @hidden - */ - private compute_min_index(...args); - /** - * @hidden - */ - private decode_value(str); - /** - * @hidden - */ - private encode_value(str); - /** - * @hidden - */ - private decode_property(str); - /** - * @hidden - */ - private encode_property(str); - /** - * {@link XML} object to xml string. - * - * Returns a string representation of the {@link XML} object. - * - * @param tab Number of tabs to spacing. - * @return The string representation of the {@link XML} object. - */ - toString(tab?: number): string; - } -} -declare namespace samchon.library { - /** - * List of {@link XML} objects with same tag. - * - * @reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/XMLList.html - * @handbook https://github.com/samchon/framework/wiki/TypeScript-Library-XML - * @author Jeongho Nam - */ - class XMLList extends std.Deque { - /** - * Get tag. - */ - getTag(): string; - /** - * {@link XMLList XML objects} to string. - * - * Returns a string representation of the {@link XMLList XML objects}. - * - * @param tab Number of tabs to spacing. - * @return The string representation of the {@link XMLList XML objects}. - */ - toString(level?: number): string; - } -} -declare namespace samchon.protocol { - /** - * An interface of entity. - * - * Entity is a class for standardization of expression method using on network I/O by XML. If - * Invoke is a standard message protocol of Samchon Framework which must be kept, Entity is a - * recommended semi-protocol of message for expressing a data class. Following the semi-protocol - * Entity is not imposed but encouraged. - * - * As we could get advantages from standardization of message for network I/O with Invoke, - * we can get additional advantage from standardizing expression method of data class with Entity. - * We do not need to know a part of network communication. Thus, with the Entity, we can only - * concentrate on entity's own logics and relationships between another entities. Entity does not - * need to how network communications are being done. - * - * I say repeatedly. Expression method of Entity is recommended, but not imposed. It's a semi - * protocol for network I/O but not a essential protocol must be kept. The expression method of - * Entity, using on network I/O, is expressed by XML string. - * - * If your own network system has a critical performance issue on communication data class, - * it would be better to using binary communication (with ByteArray). - * Don't worry about the problem! Invoke also provides methods for binary data (ByteArray). - * - * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_message_protocol.png) - * - * @author Jeongho Nam - */ - interface IEntity { - /** - * Construct data of the Entity from a XML object. - * - * Overrides the construct() method and fetch data of member variables from the XML. - * - * By recommended guidance, data representing member variables are contained in properties - * of the put XML object. - * - * @param xml An xml used to contruct data of entity. - */ - construct(xml: library.XML): void; - /** - * Get a key that can identify the Entity uniquely. - * - * If identifier of the Entity is not atomic value, returns a paired or tuple object - * that can represents the composite identifier. - * - * - * class Point extends Entity - * { - * private x: number; - * private y: number; - * - * public key(): std.Pair - * { - * return std.make_pair(this.x, this.y); - * } - * } - * - */ - key(): any; - /** - * A tag name when represented by XML. - * - * - */ - TAG(): string; - /** - * Get a XML object represents the Entity. - * - * A member variable (not object, but atomic value like number, string or date) is categorized - * as a property within the framework of entity side. Thus, when overriding a toXML() method and - * archiving member variables to an XML object to return, puts each variable to be a property - * belongs to only a XML object. - * - * Don't archive the member variable of atomic value to XML::value causing enormouse creation - * of XML objects to number of member variables. An Entity must be represented by only a XML - * instance (tag). - * - *

Standard Usage.

- * - * - * - * - * - * - * - *

Non-standard usage abusing value.

- * - * - * jhnam88 - * Jeongho Nam - * 1988-03-11 - * - * - * master - * Administartor - * 2011-07-28 - * - * - * - * @return An XML object representing the Entity. - */ - toXML(): library.XML; - } - /** - * @hidden - */ - namespace IEntity { - function construct(entity: IEntity, xml: library.XML, ...prohibited_names: string[]): void; - function toXML(entity: IEntity, ...prohibited_names: string[]): library.XML; - } - /** - * An entity, a standard data class. - * - * Entity is a class for standardization of expression method using on network I/O by XML. If - * Invoke is a standard message protocol of Samchon Framework which must be kept, Entity is a - * recommended semi-protocol of message for expressing a data class. Following the semi-protocol - * Entity is not imposed but encouraged. - * - * As we could get advantages from standardization of message for network I/O with Invoke, - * we can get additional advantage from standardizing expression method of data class with Entity. - * We do not need to know a part of network communication. Thus, with the Entity, we can only - * concentrate on entity's own logics and relationships between another entities. Entity does not - * need to how network communications are being done. - * - * I say repeatedly. Expression method of Entity is recommended, but not imposed. It's a semi - * protocol for network I/O but not a essential protocol must be kept. The expression method of - * Entity, using on network I/O, is expressed by XML string. - * - * If your own network system has a critical performance issue on communication data class, - * it would be better to using binary communication (with ByteArray). - * Don't worry about the problem! Invoke also provides methods for binary data (ByteArray). - * - * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_message_protocol.png) - * - * @author Jeongho Nam - */ - abstract class Entity implements IEntity { - /** - * Default Constructor. - */ - constructor(); - construct(xml: library.XML): void; - /** - * @inheritdoc - */ - key(): any; - /** - * @inheritdoc - */ - abstract TAG(): string; - /** - * @inheritdoc - */ - toXML(): library.XML; - } -} -declare namespace samchon.protocol { - /** - * @inheritdoc - */ - interface IEntityCollection extends IEntityGroup, collections.ICollection { - } -} -declare namespace samchon.protocol { - /** - * @inheritdoc - */ - abstract class EntityArrayCollection extends collections.ArrayCollection implements IEntityCollection { - /** - * @inheritdoc - */ - construct(xml: library.XML): void; - /** - * @inheritdoc - */ - abstract createChild(xml: library.XML): T; - /** - * @inheritdoc - */ - key(): any; - /** - * @inheritdoc - */ - has(key: any): boolean; - /** - * @inheritdoc - */ - count(key: any): number; - /** - * @inheritdoc - */ - get(key: any): T; - /** - * @inheritdoc - */ - abstract TAG(): string; - /** - * @inheritdoc - */ - abstract CHILD_TAG(): string; - /** - * @inheritdoc - */ - toXML(): library.XML; - } -} -declare namespace samchon.protocol { - /** - * @inheritdoc - */ - abstract class EntityListCollection extends collections.ListCollection implements IEntityCollection { - /** - * @inheritdoc - */ - construct(xml: library.XML): void; - /** - * @inheritdoc - */ - abstract createChild(xml: library.XML): T; - /** - * @inheritdoc - */ - key(): any; - /** - * @inheritdoc - */ - has(key: any): boolean; - /** - * @inheritdoc - */ - count(key: any): number; - /** - * @inheritdoc - */ - get(key: any): T; - /** - * @inheritdoc - */ - abstract TAG(): string; - /** - * @inheritdoc - */ - abstract CHILD_TAG(): string; - /** - * @inheritdoc - */ - toXML(): library.XML; - } -} -declare namespace samchon.protocol { - /** - * @inheritdoc - */ - abstract class EntityDequeCollection extends collections.DequeCollection implements IEntityCollection { - /** - * @inheritdoc - */ - construct(xml: library.XML): void; - /** - * @inheritdoc - */ - abstract createChild(xml: library.XML): T; - /** - * @inheritdoc - */ - key(): any; - /** - * @inheritdoc - */ - has(key: any): boolean; - /** - * @inheritdoc - */ - count(key: any): number; - /** - * @inheritdoc - */ - get(key: any): T; - /** - * @inheritdoc - */ - abstract TAG(): string; - /** - * @inheritdoc - */ - abstract CHILD_TAG(): string; - /** - * @inheritdoc - */ - toXML(): library.XML; - } -} -/** - * A template for External Systems Manager. - * - * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) - * @author Jeongho Nam - */ -declare namespace samchon.templates.external { - /** - * An array and manager of {@link ExternalSystem external system drivers}. - * - * The {@link ExternalSystemArray} is an abstract class containing and managing external system drivers, - * {@link ExternalSystem} objects. Within framewokr of network, {@link ExternalSystemArray} represents your system - * and children {@link ExternalSystem} objects represent remote, external systems connected with your system. - * With this {@link ExternalSystemArray}, you can manage multiple external systems as a group. - * - * You can specify this {@link ExternalSystemArray} class to be *a server accepting external clients* or - * *a client connecting to external servers*. Even both of them is also possible. - * - * - {@link ExternalClientArray}: A server accepting {@link ExternalSystem external clients}. - * - {@link ExternalServerArray}: A client connecting to {@link ExternalServer external servers}. - * - {@link ExternalServerClientArray}: Both of them. Accepts {@link ExternalSystem external clients} and connects to - * {@link ExternalServer external servers} at the same time. - * - * - * - * - * - * #### Proxy Pattern - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) - * @author Jeongho Nam - */ - abstract class ExternalSystemArray extends protocol.EntityDequeCollection implements protocol.IProtocol { - /** - * Default Constructor. - */ - constructor(); - /** - * @hidden - */ - private handle_system_erase(event); - /** - * Test whether the role exists. - * - * @param name Name, identifier of target {@link ExternalSystemRole role}. - * - * @return Whether the role has or not. - */ - hasRole(name: string): boolean; - /** - * Get a role. - * - * @param name Name, identifier of target {@link ExternalSystemRole role}. - * - * @return The specified role. - */ - getRole(name: string): ExternalSystemRole; - /** - * Send an {@link Invoke} message. - * - * @param invoke An {@link Invoke} message to send. - */ - sendData(invoke: protocol.Invoke): void; - /** - * Handle an {@Invoke} message have received. - * - * @param invoke An {@link Invoke} message have received. - */ - replyData(invoke: protocol.Invoke): void; - /** - * Tag name of the {@link ExternalSytemArray} in {@link XML}. - * - * @return *systemArray*. - */ - TAG(): string; - /** - * Tag name of {@link ExternalSystem children elements} belonged to the {@link ExternalSytemArray} in {@link XML}. - * - * @return *system*. - */ - CHILD_TAG(): string; - } -} -/** - * A template for Parallel Processing System. - * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) - * @author Jeongho Nam - */ -declare namespace samchon.templates.parallel { - /** - * Master of Parallel Processing System. - * - * The {@link ParallelSystemArray} is an abstract class containing and managing remote parallel **slave** system - * drivers, {@link ParallelSystem} objects. Within framework of network, {@link ParallelSystemArray} represents your - * system, a **Master** of *Parallel Processing System* that requesting *parallel process* to **slave** systems and the - * children {@link ParallelSystem} objects represent the remote **slave** systems, who is being requested the - * *parallel processes*. - * - * You can specify this {@link ParallelSystemArray} class to be *a server accepting parallel clients* or - * *a client connecting to parallel servers*. Even both of them is possible. Extends one of them below and overrides - * abstract factory method(s) creating the child {@link ParallelSystem} object. - * - * - {@link ParallelClientArray}: A server accepting {@link ParallelSystem parallel clients}. - * - {@link ParallelServerArray}: A client connecting to {@link ParallelServer parallel servers}. - * - {@link ParallelServerClientArray}: Both of them. Accepts {@link ParallelSystem parallel clients} and connects to - * {@link ParallelServer parallel servers} at the same time. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices - * will be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * - * - * - * - * #### Proxy Pattern - * This class {@link ParallelSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link ParallelSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) - * @author Jeongho Nam - */ - abstract class ParallelSystemArray extends external.ExternalSystemArray { - /** - * @hidden - */ - private history_sequence_; - /** - * Default Constructor. - */ - constructor(); - /** - * Send an {@link Invoke} message with segment size. - * - * Sends an {@link Invoke} message requesting a **parallel process** with its *segment size*. The {@link Invoke} - * message will be delivered to children {@link ParallelSystem} objects with the *piece size*, which is divided - * from the *segment size*, basis on their {@link ParallelSystem.getPerformance performance indices}. - * - * - If segment size is 100, - * - The segment will be allocated such below: - * - * Name | Performance index | Number of pieces to be allocated | Formula - * --------|-------------------|----------------------------------|-------------- - * Snail | 1 | 10 | 100 / 10 * 1 - * Cheetah | 4 | 40 | 100 / 10 * 4 - * Rabbit | 3 | 30 | 100 / 10 * 3 - * Turtle | 2 | 20 | 100 / 10 * 2 - * - * When the **parallel process** has completed, then this {@link ParallelSystemArraY} will estimate - * {@link ParallelSystem.getPerformance performance indices} of {@link ParallelSystem} objects basis on their - * execution time. - * - * @param invoke An {@link Invoke} message requesting parallel process. - * @param size Number of pieces to segment. - * - * @return Number of {@link ParallelSystem slave systems} participating in the *Parallel Process*. - * - * @see {@link sendPieceData}, {@link ParallelSystem.getPerformacen} - */ - sendSegmentData(invoke: protocol.Invoke, size: number): number; - /** - * Send an {@link Invoke} message with range of pieces. - * - * Sends an {@link Invoke} message requesting a **parallel process** with its *range of pieces [first, last)*. - * The {@link Invoke} will be delivered to children {@link ParallelSystem} objects with the newly computed - * *range of sub-pieces*, which is divided from the *range of pieces (first to last)*, basis on their - * {@link ParallelSystem.getPerformance performance indices}. - * - * - If indices of pieces are 0 to 50, - * - The sub-pieces will be allocated such below: - * - * Name | Performance index | Range of sub-pieces to be allocated | Formula - * --------|-------------------|-------------------------------------|------------------------ - * Snail | 1 | ( 0, 5] | (50 - 0) / 10 * 1 - * Cheetah | 4 | ( 5, 25] | (50 - 0) / 10 * 4 + 5 - * Rabbit | 3 | (25, 40] | (50 - 0) / 10 * 3 + 25 - * Turtle | 2 | (40, 50] | (50 - 0) / 10 * 2 + 40 - * - * When the **parallel process** has completed, then this {@link ParallelSystemArraY} will estimate - * {@link ParallelSystem.getPerformance performance indices} of {@link ParallelSystem} objects basis on their - * execution time. - * - * @param invoke An {@link Invoke} message requesting parallel process. - * @param first Initial piece's index in a section. - * @param last Final piece's index in a section. The range used is [*first*, *last*), which contains - * all the pieces' indices between *first* and *last*, including the piece pointed by index - * *first*, but not the piece pointed by the index *last*. - * - * @return Number of {@link ParallelSystem slave systems} participating in the *Parallel Process*. - * - * @see {@link sendSegmentData}, {@link ParallelSystem.getPerformacen} - */ - sendPieceData(invoke: protocol.Invoke, first: number, last: number): number; - /** - * @hidden - */ - protected _Complete_history(history: protocol.InvokeHistory): boolean; - /** - * @hidden - */ - protected _Normalize_performance(): void; - } -} -/** - * A template for Distributed Processing System. - * - * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ -declare namespace samchon.templates.distributed { - /** - * Master of Distributed Processing System. - * - * The {@link DistributedSystemArray} is an abstract class containing and managing remote distributed **slave** system - * drivers, {@link DistributedSystem} objects. Within framework of network, {@link DistributedSystemArray} represents - * your system, a **Master** of *Distributed Processing System* that requesting *distributed process* to **slave** - * systems and the children {@link DistributedSystem} objects represent the remote **slave** systems, who is being - * requested the *distributed processes*. - * - * You can specify this {@link DistributedSystemArray} class to be *a server accepting distributed clients* or - * *a client connecting to distributed servers*. Even both of them is possible. Extends one of them below and overrides - * abstract factory method(s) creating the child {@link DistributedSystem} object. - * - * - {@link DistributedClientArray}: A server accepting {@link DistributedSystem distributed clients}. - * - {@link DistributedServerArray}: A client connecting to {@link DistributedServer distributed servers}. - * - {@link DistributedServerClientArray}: Both of them. Accepts {@link DistributedSystem distributed clients} and - * connects to {@link DistributedServer distributed servers} at the same time. - * - * The {@link DistributedSystemArray} contains {@link DistributedProcess} objects directly. You can request a - * **distributed process** through the {@link DistributedProcess} object. You can access the - * {@link DistributedProcess} object(s) with those methods: - * - * - {@link hasProcess} - * - {@link getProcess} - * - {@link insertProcess} - * - {@link eraseProcess} - * - {@link getProcessMap} - * - * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the - * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed - * **slave **system. The {@link Invoke} message will be sent to the most idle {@link DistributedSystem} object. When - * the **distributed process** has completed, then {@link DistributedSystem.getPerformance performance index} and - * {@link DistributedProcess.getResource resource index} of related objects will be revaluated. - * - * - * - * - * - * #### Parallel Process - * This {@link DistributedSystemArray} class is derived from the {@link ParallelSystemArray} class, so you can request - * a **parallel process**, too. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices will - * be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * #### Proxy Pattern - * This class {@link DistributedSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link DistributedSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - abstract class DistributedSystemArray extends parallel.ParallelSystemArray { - /** - * @hidden - */ - private process_map_; - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - construct(xml: library.XML): void; - /** - * Factory method creating a child {@link DistributedProcess process} object. - * - * @param xml {@link XML} represents the {@link DistributedProcess child} object. - * @return A new {@link DistributedProcess} object. - */ - protected abstract createProcess(xml: library.XML): DistributedProcess; - /** - * Get process map. - * - * Gets an {@link HashMap} containing {@link DistributedProcess} objects with their *key*. - * - * @return An {@link HasmMap> containing pairs of string and {@link DistributedProcess} object. - */ - getProcessMap(): std.HashMap; - /** - * Test whether the process exists. - * - * @param name Name, identifier of target {@link DistributedProcess process}. - * - * @return Whether the process has or not. - */ - hasProcess(name: string): boolean; - /** - * Get a process. - * - * @param name Name, identifier of target {@link DistributedProcess process}. - * - * @return The specified process. - */ - getProcess(name: string): DistributedProcess; - /** - * Insert a process. - * - * @param process A process to be inserted. - * @return Success flag. - */ - insertProcess(process: DistributedProcess): boolean; - /** - * Erase a process. - * - * @param name Name, identifier of target {@link DistributedProcess process}. - */ - eraseProcess(name: string): boolean; - /** - * @hidden - */ - protected _Complete_history(history: protocol.InvokeHistory): boolean; - /** - * @hidden - */ - private estimate_process_resource(history); - /** - * @hidden - */ - private estimate_system_performance(history); - /** - * @hidden - */ - protected _Normalize_performance(): void; - /** - * @inheritdoc - */ - toXML(): library.XML; - } -} -declare namespace samchon.templates.distributed { - /** - * Mediator of Distributed Processing System. - * - * The {@link DistributedSystemArrayMediator} class be a master for its slave systems, and be a slave to its master - * system at the same time. This {@link DistributedSystemArrayMediator} be a master system, containing and managing - * {@link DistributedSystem} objects, which represent distributed slave systems, by extending - * {@link DistributedSystemArray} class. Also, be a slave system through {@link getMediator mediator} object, which is - * derived from the {@link SlaveSystem} class. - * - * As a master, you can specify this {@link DistributedSystemArrayMediator} class to be a master server accepting - * slave clients or a master client to connecting slave servers. Even both of them is possible. Extends one - * of them below and overrides abstract factory method(s) creating the child {@link DistributedSystem} object. - * - * - {@link DistributedClientArrayMediator}: A server accepting {@link DistributedSystem distributed clients}. - * - {@link DistributedServerArrayMediator}: A client connecting to {@link DistributedServer distributed servers}. - * - {@link DistributedServerClientArrayMediator}: Both of them. Accepts {@link DistributedSystem distributed clients} and - * connects to {@link DistributedServer distributed servers} at the same time. - * - * As a slave, you can specify this {@link DistributedSystemArrayMediator} to be a client slave connecting to master - * server or a server slave accepting master client by overriding the {@link createMediator} method. - * Overrides the {@link createMediator createMediator()} method and return one of them: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * #### [Inherited] {@link DistributedSystemArray} - * The {@link DistributedSystemArray} is an abstract class containing and managing remote distributed **slave** system - * drivers, {@link DistributedSystem} objects. Within framework of network, {@link DistributedSystemArray} represents - * your system, a **Master** of *Distributed Processing System* that requesting *distributed process* to **slave** - * systems and the children {@link DistributedSystem} objects represent the remote **slave** systems, who is being - * requested the *distributed processes*. - * - * The {@link DistributedSystemArray} contains {@link DistributedProcess} objects directly. You can request a - * **distributed process** through the {@link DistributedProcess} object. You can access the - * {@link DistributedProcess} object(s) with those methods: - * - * - {@link hasProcess} - * - {@link getProcess} - * - {@link insertProcess} - * - {@link eraseProcess} - * - {@link getProcessMap} - * - * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the - * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed - * **slave **system. The {@link Invoke} message will be sent to the most idle {@link DistributedSystem} object. When - * the **distributed process** has completed, then {@link DistributedSystem.getPerformance performance index} and - * {@link DistributedProcess.getResource resource index} of related objects will be revaluated. - * - * - * - * - * - * #### Parallel Process - * This {@link DistributedSystemArray} class is derived from the {@link ParallelSystemArray} class, so you can request - * a **parallel process**, too. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices will - * be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * #### Proxy Pattern - * This class {@link DistributedSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link DistributedSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - abstract class DistributedSystemArrayMediator extends DistributedSystemArray { - /** - * @hidden - */ - private mediator_; - /** - * Default Constructor. - */ - constructor(); - /** - * Factory method creating a {@link MediatorSystem} object. - * - * The {@link createMediator createMediator()} is an abstract method creating the {@link MediatorSystem} object. - * - * You know what? this {@link DistributedSystemArrayMediator} class be a master for its slave systems, and be a - * slave to its master system at the same time. The {@link MediatorSystem} object makes it possible; be a slave - * system. This {@link createMediator} determines specific type of the {@link MediatorSystem}. - * - * Overrides the {@link createMediator createMediator()} method to create and return one of them following which - * protocol and which type of remote connection (server or client) will be used: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * @return A newly created {@link MediatorSystem} object. - */ - protected abstract createMediator(): parallel.MediatorSystem; - /** - * Start mediator. - * - * If the {@link getMediator mediator} is a type of server, then opens the server accepting master client. - * Otherwise, the {@link getMediator mediator} is a type of client, then connects the master server. - */ - protected startMediator(): void; - /** - * Get {@link MediatorSystem} object. - * - * When you need to send an {@link Invoke} message to the master system of this - * {@link DistributedSystemArrayMediator}, then send to the {@link MediatorSystem} through this - * {@link getMediator}. - * - * ```typescript - * this.getMediator().sendData(...); - * ``` - * - * @return The {@link MediatorSystem} object. - */ - getMediator(): parallel.MediatorSystem; - /** - * @hidden - */ - protected _Complete_history(history: parallel.PRInvokeHistory): boolean; - } -} -declare namespace samchon.protocol { - /** - * An interface taking full charge of network communication. - * - * {@link ICommunicator} is an interface for communicator classes who take full charge of network communication with - * remote system, without reference to whether the remote system is a server or a client. Type of the - * {@link ICommunicator} is specified to {@link IServerConnector} and {@link IClientDriver} whether the remote system - * is a server (that I've to connect) or a client (a client connected to my server). - * - * Whenever a replied message comes from the remote system, the message will be converted to an {@link Invoke} class - * and the {@link Invoke} object will be shifted to the {@link IProtocol listener}'s - * {@link IProtocol.replyData IProtocol.replyData()} method. - * - * - * - * - * - * @see {@link IClientDriver}, {@link IServerConnector}, {@link IProtocol} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#icommunicator) - * @author Jeongho Nam - */ - interface ICommunicator extends IProtocol { - /** - * Callback function for connection closed. - */ - onClose: Function; - /** - * Close connection. - */ - close(): void; - /** - * Test connection. - * - * Test whether this {@link ICommunicator communicator} object is connected with the remote system. If the - * connection is alive, then returns ```true```. Otherwise, the connection is not alive or this - * {@link ICommunicator communicator has not connected with the remote system yet, then returns ```false```. - * - * @return true if connected, otherwise false. - */ - isConnected(): boolean; - /** - * Send message. - * - * Send {@link Invoke} message to remote system. - * - * @param invoke An {@link Invoke} message to send. - */ - sendData(invoke: protocol.Invoke): void; - /** - * Handle replied message. - * - * Handles replied {@link Invoke} message recived from remove system. The {@link Invoke} message will be shifted - * to the {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} by this method. - * - * @param invoke An {@link Invoke} message received from remote system. - */ - replyData(invoke: protocol.Invoke): void; - } -} -declare namespace samchon.protocol { - /** - * An abstract, basic class for communicators. - * - * {@link CommunicatorBase} is an abstract class implemented from the {@link ICommunicator}. Mechanism of converting - * raw data to {@link Invoke} messag has realized in this abstract class. Type of this {@link CommunicatorBase} class - * is specified to as below following which protocol is used. - * - * - {@link Communicator}: Samchon Framework's own protocool. - * - {@link WebCommunicator}: Web-socket protocol - * - {@link SharedWorkerCommunicator}: SharedWorker's message protocol. - * - * #### [Inherited] {@link ICommunicator} - * {@link ICommunicator} is an interface for communicator classes who take full charge of network communication with - * remote system, without reference to whether the remote system is a server or a client. Type of the - * {@link ICommunicator} is specified to {@link IServerConnector} and {@link IClientDriver} whether the remote system - * is a server (that I've to connect) or a client (a client connected to my server). - * - * Whenever a replied message comes from the remote system, the message will be converted to an {@link Invoke} class - * and the {@link Invoke} object will be shifted to the {@link IProtocol listener}'s - * {@link IProtocol.replyData IProtocol.replyData()} method. - * - * - * - * - * - * @see {@link IClientDriver}, {@link IServerConnector}, {@link IProtocol} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#icommunicator) - * @author Jeongho Nam - */ - abstract class CommunicatorBase implements ICommunicator { - /** - * @hidden - */ - protected listener_: IProtocol; - /** - * @inheritdoc - */ - onClose: Function; - /** - * @hidden - */ - protected connected_: boolean; - /** - * @hidden - */ - private binary_invoke_; - /** - * @hidden - */ - private binary_parameters_; - /** - * @hidden - */ - private unhandled_invokes; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from *listener*. - * - * @param listener An {@link IProtocol} object to listen {@link Invoke} messages. - */ - constructor(listener: IProtocol); - /** - * @inheritdoc - */ - abstract close(): void; - /** - * @inheritdoc - */ - isConnected(): boolean; - /** - * @hidden - */ - protected is_binary_invoke(): boolean; - /** - * @inheritdoc - */ - abstract sendData(invoke: Invoke): void; - /** - * @inheritdoc - */ - replyData(invoke: Invoke): void; - /** - * @hidden - */ - protected handle_string(str: string): void; - /** - * @hidden - */ - protected handle_binary(binary: Uint8Array): void; - } -} -declare namespace samchon.protocol { - /** - * A communicator following Samchon Framework's own protocol. - * - * {@link Communicator} is an abstract class following Samchon Framework's own protocol. This {@link Communicator} - * class is specified to {@link ServerConnector} and {@link ClientDriver} whether the remote system is a server (that - * my system is connecting to) or a client (a client conneting to to my server). - * - * Note that, if one of this or remote system is web-browser based, then you don't have to use this - * {@link Communicator} class who follows Samchon Framework's own protocol. Web-browser supports only Web-socket - * protocol. Thus in that case, you have to use {@link WebCommunicator} instead. - * - * #### [Inherited] {@link ICommunicator} - * {@link ICommunicator} is an interface for communicator classes who take full charge of network communication with - * remote system, without reference to whether the remote system is a server or a client. Type of the - * {@link ICommunicator} is specified to {@link IServerConnector} and {@link IClientDriver} whether the remote system - * is a server (that I've to connect) or a client (a client connected to my server). - * - * Whenever a replied message comes from the remote system, the message will be converted to an {@link Invoke} class - * and the {@link Invoke} object will be shifted to the {@link IProtocol listener}'s - * {@link IProtocol.replyData IProtocol.replyData()} method. - * - * - * - * - * - * @see {@link ClientDriver}, {@link ServerConnector}, {@link IProtocol} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#icommunicator) - * @author Jeongho Nam - */ - abstract class Communicator extends CommunicatorBase { - /** - * @hidden - */ - protected socket_: socket.socket; - /** - * @hidden - */ - private header_bytes_; - /** - * @hidden - */ - private data_; - /** - * @hidden - */ - private data_index_; - /** - * @hidden - */ - private listening_; - /** - * @inheritdoc - */ - close(): void; - /** - * @hidden - */ - protected start_listen(): void; - /** - * @hidden - */ - private handle_error(); - /** - * @hidden - */ - private handle_close(); - /** - * @inheritdoc - */ - sendData(invoke: Invoke): void; - /** - * @hidden - */ - private listen_piece(piece); - /** - * @hidden - */ - private listen_header(piece, piece_index); - /** - * @hidden - */ - private listen_data(piece, piece_index); - } -} -declare namespace samchon.protocol { - /** - * A communicator following Web-socket protocol. - * - * {@link WebCommunicator} is an abstract class following Web-socket protocol. This {@link WebCommunicator} class is - * specified to {@link WebServerConnector} and {@link WebClientDriver} whether the remote system is a server (that my - * system is connecting to) or a client (a client conneting to to my server). - * - * Note that, one of this or remote system is web-browser based, then there's not any alternative choice. Web browser - * supports only Web-socket protocol. In that case, you've use this {@link WebCommunicator} class. - * - * #### [Inherited] {@link ICommunicator} - * {@link ICommunicator} is an interface for communicator classes who take full charge of network communication with - * remote system, without reference to whether the remote system is a server or a client. Type of the - * {@link ICommunicator} is specified to {@link IServerConnector} and {@link IClientDriver} whether the remote system - * is a server (that I've to connect) or a client (a client connected to my server). - * - * Whenever a replied message comes from the remote system, the message will be converted to an {@link Invoke} class - * and the {@link Invoke} object will be shifted to the {@link IProtocol listener}'s - * {@link IProtocol.replyData IProtocol.replyData()} method. - * - * - * - * - * - * @see {@link WebClientDriver}, {@link WebServerConnector}, {@link IProtocol} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#icommunicator) - * @author Jeongho Nam - */ - abstract class WebCommunicator extends CommunicatorBase { - /** - * @hidden - */ - protected connection_: websocket.connection; - /** - * @inheritdoc - */ - close(): void; - /** - * @inheritdoc - */ - sendData(invoke: Invoke): void; - /** - * @hidden - */ - protected handle_message(message: websocket.IMessage): void; - /** - * @hidden - */ - protected handle_close(): void; - } -} -declare namespace samchon.protocol { - /** - * A communicator for shared worker. - * - * {@link DedicatedWorkerCommunicator} is an abstract class for communication between DedicatedWorker and Web-browser. - * This {@link DedicatedWorkerCommunicator} is specified to {@link DedicatedWorkerServerConnector} and - * {@link DedicatedWorkerClientDriver} whether the remote system is a server (that my system is connecting to) or a - * client (a client conneting to to my server). - * - * #### Why DedicatedWorker be a server? - * In JavaScript environment, there's no way to implement multi-threading function. Instead, JavaScript supports the - * **Worker**, creating a new process. However, the **Worker** does not shares memory addresses. To integrate the - * **Worker** with its master, only communication with string or binary data is allowed. Doesn't it seem like a network - * communication? Furthermore, there's not any difference between the worker communication and network communication. - * It's the reason why Samchon Framework considers the **Worker** as a network node. - * - * The class {@link DedicatedWorkerCommunicator} is designed make such relationship. From now on, DedicatedWorker is a - * {@link DedicatedWorkerServer server} and {@link DedicatedWorkerServerConnector browser} is a client. Integrate the - * server and clients with this {@link DedicatedWorkerCommunicator}. - * - * #### [Inherited] {@link ICommunicator} - * {@link ICommunicator} is an interface for communicator classes who take full charge of network communication with - * remote system, without reference to whether the remote system is a server or a client. Type of the - * {@link ICommunicator} is specified to {@link IServerConnector} and {@link IClientDriver} whether the remote system - * is a server (that I've to connect) or a client (a client connected to my server). - * - * Whenever a replied message comes from the remote system, the message will be converted to an {@link Invoke} class - * and the {@link Invoke} object will be shifted to the {@link IProtocol listener}'s - * {@link IProtocol.replyData IProtocol.replyData()} method. - * - * - * - * - * - * @see {@link DedicatedWorkerClientDriver}, {@link DedicatedWorkerServerConnector}, {@link IProtocol} - * @reference https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorker - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#icommunicator) - * @author Jeongho Nam - */ - abstract class DedicatedWorkerCommunicator extends CommunicatorBase { - /** - * @hidden - */ - protected handle_message(event: MessageEvent): void; - } -} -declare namespace samchon.protocol { - /** - * A communicator for shared worker. - * - * {@link SharedWorkerCommunicator} is an abstract class for communication between SharedWorker and Web-browser. This - * {@link SharedWorkerCommunicator} is specified to {@link SharedWorkerServerConnector} and - * {@link SharedWorkerClientDriver} whether the remote system is a server (that my system is connecting to) or a client - * (a client conneting to to my server). - * - * Note that, SharedWorker is a conception only existed in web-browser. This {@link SharedWorkerCommunicator} is not - * supported in NodeJS. Only web-browser environment can utilize this {@link SharedWorkerCommunicator}. - * - * #### Why SharedWorker be a server? - * SharedWorker, it allows only an instance (process) to be created whether the SharedWorker is declared in a browser - * or multiple browsers. To integrate them, messages are being sent and received. Doesn't it seem like a relationship - * between a server and clients? Thus, Samchon Framework consider the SharedWorker as a server and browsers as - * clients. - * - * The class {@link SharedWorkerCommunicator} is designed make such relationship. From now on, SharedWorker is a - * {@link SharedWorkerServer server} and {@link SharedWorkerServerConnector browsers} are clients. Integrate the - * server and clients with this {@link SharedWorkerCommunicator}. - * - * #### [Inherited] {@link ICommunicator} - * {@link ICommunicator} is an interface for communicator classes who take full charge of network communication with - * remote system, without reference to whether the remote system is a server or a client. Type of the - * {@link ICommunicator} is specified to {@link IServerConnector} and {@link IClientDriver} whether the remote system - * is a server (that I've to connect) or a client (a client connected to my server). - * - * Whenever a replied message comes from the remote system, the message will be converted to an {@link Invoke} class - * and the {@link Invoke} object will be shifted to the {@link IProtocol listener}'s - * {@link IProtocol.replyData IProtocol.replyData()} method. - * - * - * - * - * - * @see {@link SharedWorkerClientDriver}, {@link SharedWorkerServerConnector}, {@link IProtocol} - * @reference https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#icommunicator) - * @author Jeongho Nam - */ - abstract class SharedWorkerCommunicator extends CommunicatorBase { - /** - * @hidden - */ - protected port_: MessagePort; - /** - * @inheritdoc - */ - close(): void; - /** - * @inheritdoc - */ - sendData(invoke: Invoke): void; - /** - * @hidden - */ - protected handle_message(event: MessageEvent): void; - } -} -declare namespace samchon.protocol { - /** - * An interface for communicator with remote client. - * - * {@link IClientDriver} is a type of {@link ICommunicator}, specified for communication with remote client who has - * connected in a {@link IServer server}. It takes full charge of network communication with the remote client. - * - * The {@link IClientDriver} object is created and delivered from {@link IServer} and - * {@link IServer.addClient IServer.addClient()}. Those are derived types from this {@link IClientDriver}, being - * created by the matched {@link IServer} object. - * - * Protocol | Derived Type | Created By - * ------------------------|-------------------------------------|---------------------------- - * Samchon Framework's own | {@link ClientDriver} | {@link Server} - * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} - * DedicatedWorker | {@link DedicatedWorkerClinetDriver} | {@link DedicatedWorkerServer} - * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} - * - * When you've got an {@link IClientDriver} object from the {@link IServer.addClient IServer.addClient()}, then - * specify {@link IProtocol listener} with {@link IClient.listen IClient.listen()}. Whenever a replied message comes - * from the remote system, the message will be converted to an {@link Invoke} class and the {@link Invoke} object - * will be shifted to the {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} method. - * Below code is an example specifying and managing the {@link IProtocol listener} objects. - * - * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts - * - * - * - * - * - * @see {@link IServer}, {@link IProtocol} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iclientdriver) - * @author Jeongho Nam - */ - interface IClientDriver extends ICommunicator { - /** - * Listen message from the newly connected client. - * - * Starts listening message from the newly connected client. Replied message from the connected client will be - * converted to {@link Invoke} classes and shifted to the *listener*'s {@link IProtocol.replyData replyData()} - * method. - * - * @param listener A listener object to listen replied message from newly connected client in - * {@link IProtocol.replyData replyData()} as an {@link Invoke} object. - */ - listen(listener: IProtocol): void; - } -} -declare namespace samchon.protocol { - /** - * Communicator with remote client. - * - * {@link ClientDriver} is a class taking full charge of network communication with remote client who follows Samchon - * Framework's own protocol. This {@link ClientDriver} object is always created by {@link Server} class. When you got - * this {@link ClientDriver} object from the {@link Server.addClient Server.addClient()}, then specify - * {@link IProtocol listener} with the {@link ClientDriver.listen ClientDriver.listen()} method. - * - * #### [Inherited] {@link IClientDriver} - * {@link IClientDriver} is a type of {@link ICommunicator}, specified for communication with remote client who has - * connected in a {@link IServer server}. It takes full charge of network communication with the remote client. - * - * The {@link IClientDriver} object is created and delivered from {@link IServer} and - * {@link IServer.addClient IServer.addClient()}. Those are derived types from this {@link IClientDriver}, being - * created by the matched {@link IServer} object. - * - * Protocol | Derived Type | Created By - * ------------------------|-------------------------------------|---------------------------- - * Samchon Framework's own | {@link ClientDriver} | {@link Server} - * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} - * DedicatedWorker | {@link DedicatedWorkerClinetDriver} | {@link DedicatedWorkerServer} - * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} - * - * When you've got an {@link IClientDriver} object from the {@link IServer.addClient IServer.addClient()}, then - * specify {@link IProtocol listener} with {@link IClient.listen IClient.listen()}. Whenever a replied message comes - * from the remote system, the message will be converted to an {@link Invoke} class and the {@link Invoke} object - * will be shifted to the {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} method. - * Below code is an example specifying and managing the {@link IProtocol listener} objects. - * - * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts - * - * - * - * - * - * @see {@link Server}, {@link IProtocol} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iclientdriver) - * @author Jeongho Nam - */ - class ClientDriver extends Communicator implements IClientDriver { - /** - * Construct from a socket. - */ - constructor(socket: socket.socket); - /** - * @inheritdoc - */ - listen(listener: IProtocol): void; - } -} -declare namespace samchon.protocol { - /** - * Communicator with remote web-client. - * - * {@link WebClientDriver} is a class taking full charge of network communication with remote client who follows - * Web-socket protocol. This {@link WebClientDriver} object is always created by {@link WebServer} class. When you - * got this {@link WebClientDriver} object from the {@link WebServer.addClient WebServer.addClient()}, then specify - * {@link IProtocol listener} with the {@link WebClientDriver.listen WebClientDriver.listen()} method. - * - * Unlike other protocol, Web-socket protocol's clients notify two parameters on their connection; - * {@link getSessionID session-id} and {@link getPath path}. The {@link getSessionID session-id} can be used to - * identify *user* of each client, and the {@link getPath path} can be used which type of *service* that client wants. - * In {@link service} module, you can see the best utilization case of them. - * - {@link service.User}: utlization of the {@link getSessionID session-id}. - * - {@link service.Service}: utilization of the {@link getPath path}. - * - * #### [Inherited] {@link IClientDriver} - * {@link IClientDriver} is a type of {@link ICommunicator}, specified for communication with remote client who has - * connected in a {@link IServer server}. It takes full charge of network communication with the remote client. - * - * The {@link IClientDriver} object is created and delivered from {@link IServer} and - * {@link IServer.addClient IServer.addClient()}. Those are derived types from this {@link IClientDriver}, being - * created by the matched {@link IServer} object. - * - * Protocol | Derived Type | Created By - * ------------------------|-------------------------------------|---------------------------- - * Samchon Framework's own | {@link ClientDriver} | {@link Server} - * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} - * DedicatedWorker | {@link DedicatedWorkerClinetDriver} | {@link DedicatedWorkerServer} - * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} - * - * When you've got an {@link IClientDriver} object from the {@link IServer.addClient IServer.addClient()}, then - * specify {@link IProtocol listener} with {@link IClient.listen IClient.listen()}. Whenever a replied message comes - * from the remote system, the message will be converted to an {@link Invoke} class and the {@link Invoke} object - * will be shifted to the {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} method. - * Below code is an example specifying and managing the {@link IProtocol listener} objects. - * - * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts - * - * - * - * - * - * @see {@link WebServer}, {@link IProtocol} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iclientdriver) - * @author Jeongho Nam - */ - class WebClientDriver extends WebCommunicator implements IClientDriver { - /** - * @hidden - */ - private path_; - /** - * @hidden - */ - private session_id_; - /** - * @hidden - */ - private listening_; - /** - * Initialization Constructor. - * - * @param connection Connection driver, a socket for web-socket. - * @param path Requested path. - * @param session_id Session ID, an identifier of the remote client. - */ - constructor(connection: websocket.connection, path: string, session_id: string); - /** - * @inheritdoc - */ - listen(listener: IProtocol): void; - /** - * Get requested path. - */ - getPath(): string; - /** - * Get session ID, an identifier of the remote client. - */ - getSessionID(): string; - } -} -declare namespace samchon.protocol { - /** - * Communicator with master web-browser. - * - * {@link DedicatedWorkerClientDriver} is a class taking full charge of network communication with web browsers. This - * {@link DedicatedWorkerClientDriver} object is always created by {@link DedicatedWorkerServer} class. When you got - * this {@link DedicatedWorkerClientDriver} object from - * {@link DedicatedWorkerServer.addClient DedicatedWorkerServer.addClient()}, then specify {@link IProtocol listener} - * with the {@link DedicatedWorkerClientDriver.listen DedicatedWorkerClientDriver.listen()} method. - * - * #### Why DedicatedWorker be a server? - * In JavaScript environment, there's no way to implement multi-threading function. Instead, JavaScript supports the - * **Worker**, creating a new process. However, the **Worker** does not shares memory addresses. To integrate the - * **Worker** with its master, only communication with string or binary data is allowed. Doesn't it seem like a network - * communication? Furthermore, there's not any difference between the worker communication and network communication. - * It's the reason why Samchon Framework considers the **Worker** as a network node. - * - * The class {@link DedicatedWorkerCommunicator} is designed make such relationship. From now on, DedicatedWorker is a - * {@link DedicatedWorkerServer server} and {@link DedicatedWorkerServerConnector browser} is a client. Integrate the - * server and clients with this {@link DedicatedWorkerCommunicator}. - * - * #### [Inherited] {@link IClientDriver} - * {@link IClientDriver} is a type of {@link ICommunicator}, specified for communication with remote client who has - * connected in a {@link IServer server}. It takes full charge of network communication with the remote client. - * - * The {@link IClientDriver} object is created and delivered from {@link IServer} and - * {@link IServer.addClient IServer.addClient()}. Those are derived types from this {@link IClientDriver}, being - * created by the matched {@link IServer} object. - * - * Protocol | Derived Type | Created By - * ------------------------|-------------------------------------|---------------------------- - * Samchon Framework's own | {@link ClientDriver} | {@link Server} - * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} - * DedicatedWorker | {@link DedicatedWorkerClinetDriver} | {@link DedicatedWorkerServer} - * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} - * - * When you've got an {@link IClientDriver} object from the {@link IServer.addClient IServer.addClient()}, then - * specify {@link IProtocol listener} with {@link IClient.listen IClient.listen()}. Whenever a replied message comes - * from the remote system, the message will be converted to an {@link Invoke} class and the {@link Invoke} object - * will be shifted to the {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} method. - * Below code is an example specifying and managing the {@link IProtocol listener} objects. - * - * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts - * - * - * - * - * - * @see {@link DedicatedWorkerServer}, {@link IProtocol} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iclientdriver) - * @author Jeongho Nam - */ - class DedicatedWorkerClientDriver extends DedicatedWorkerCommunicator implements IClientDriver { - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - listen(listener: IProtocol): void; - /** - * @inheritdoc - */ - close(): void; - /** - * @inheritdoc - */ - sendData(invoke: Invoke): void; - } -} -declare namespace samchon.protocol { - /** - * Communicator with remote web-browser. - * - * {@link SharedWorkerClientDriver} is a class taking full charge of network communication with web browsers. This - * {@link SharedWorkerClientDriver} object is always created by {@link SharedWorkerServer} class. When you got this - * {@link SharedWorkerClientDriver} object from {@link SharedWorkerServer.addClient SharedWorkerServer.addClient()}, - * then specify {@link IProtocol listener} with the - * {@link SharedWorkerClientDriver.listen SharedWorkerClientDriver.listen()} method. - * - * #### Why SharedWorker be a server? - * SharedWorker, it allows only an instance (process) to be created whether the SharedWorker is declared in a browser - * or multiple browsers. To integrate them, messages are being sent and received. Doesn't it seem like a relationship - * between a server and clients? Thus, Samchon Framework consider the SharedWorker as a server and browsers as - * clients. - * - * The class {@link SharedWorkerCommunicator} is designed make such relationship. From now on, SharedWorker is a - * {@link SharedWorkerServer server} and {@link SharedWorkerServerConnector browsers} are clients. Integrate the - * server and clients with this {@link SharedWorkerCommunicator}. - * - * #### [Inherited] {@link IClientDriver} - * {@link IClientDriver} is a type of {@link ICommunicator}, specified for communication with remote client who has - * connected in a {@link IServer server}. It takes full charge of network communication with the remote client. - * - * The {@link IClientDriver} object is created and delivered from {@link IServer} and - * {@link IServer.addClient IServer.addClient()}. Those are derived types from this {@link IClientDriver}, being - * created by the matched {@link IServer} object. - * - * Protocol | Derived Type | Created By - * ------------------------|-------------------------------------|---------------------------- - * Samchon Framework's own | {@link ClientDriver} | {@link Server} - * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} - * DedicatedWorker | {@link DedicatedWorkerClinetDriver} | {@link DedicatedWorkerServer} - * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} - * - * When you've got an {@link IClientDriver} object from the {@link IServer.addClient IServer.addClient()}, then - * specify {@link IProtocol listener} with {@link IClient.listen IClient.listen()}. Whenever a replied message comes - * from the remote system, the message will be converted to an {@link Invoke} class and the {@link Invoke} object - * will be shifted to the {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} method. - * Below code is an example specifying and managing the {@link IProtocol listener} objects. - * - * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts - * - * - * - * - * - * @see {@link SharedWorkerServer}, {@link IProtocol} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iclientdriver) - * @author Jeongho Nam - */ - class SharedWorkerClientDriver extends SharedWorkerCommunicator implements IClientDriver { - private listening_; - /** - * Construct from a MessagePort object. - */ - constructor(port: MessagePort); - /** - * @inheritdoc - */ - listen(listener: IProtocol): void; - } -} -declare namespace samchon.protocol { - /** - * A container of entity, and it's a type of entity, too. - * - * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_message_protocol.png) - * - * @handbook [Protocol - Standard Message](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Standard_Message) - * @author Jeongho Nam - */ - interface IEntityGroup extends IEntity, std.base.IContainer { - /** - * Construct data of the Entity from an XML object. - * - * Constructs the EntityArray's own member variables only from the input XML object. - * - * Do not consider about constructing children Entity objects' data in EntityArray::construct(). - * Those children Entity objects' data will constructed by their own construct() method. Even insertion - * of XML objects representing children are done by abstract method of EntityArray::toXML(). - * - * Constructs only data of EntityArray's own. - */ - construct(xml: library.XML): void; - /** - * Factory method of a child Entity. - * - * EntityArray::createChild() is a factory method creating a new child Entity which is belonged - * to the EntityArray. This method is called by EntityArray::construct(). The children construction - * methods Entity::construct() will be called by abstract method of the EntityArray::construct(). - * - * @return A new child Entity belongs to EntityArray. - */ - createChild(xml: library.XML): T; - /** - * Get iterator to element. - * - * Searches the container for an element with a identifier equivalent to *key* and returns an - * iterator to it if found, otherwise it returns an iterator to {@link end end()}. - * - * Two keys are considered equivalent if the container's comparison object returns false reflexively - * (i.e., no matter the order in which the elements are passed as arguments). - * - * Another member functions, {@link has has()} and {@link count count()}, can be used to just check - * whether a particular *key* exists. - * - * @param key Key to be searched for - * @return An iterator to the element, if an element with specified *key* is found, or - * {@link end end()} otherwise. - */ - /** - * Whether have the item or not. - * - * Indicates whether a map has an item having the specified identifier. - * - * @param key Key value of the element whose mapped value is accessed. - * - * @return Whether the map has an item having the specified identifier. - */ - has(key: any): boolean; - /** - * Count elements with a specific key. - * - * Searches the container for elements whose key is *key* and returns the number of elements found. - * - * @param key Key value to be searched for. - * - * @return The number of elements in the container with a *key*. - */ - count(key: any): number; - /** - * Get an element - * - * Returns a reference to the mapped value of the element identified with *key*. - * - * @param key Key value of the element whose mapped value is accessed. - * - * @throw exception out of range - * - * @return A reference object of the mapped value (_Ty) - */ - get(key: any): T; - /** - * A tag name of children objects. - */ - CHILD_TAG(): string; - /** - * Get an XML object represents the EntityArray. - * - * Archives the EntityArray's own member variables only to the returned XML object. - * - * Do not consider about archiving children Entity objects' data in EntityArray::toXML(). - * Those children Entity objects will converted to XML object by their own toXML() method. The - * insertion of XML objects representing children are done by abstract method of - * EntityArray::toXML(). - * - * Archives only data of EntityArray's own. - */ - toXML(): library.XML; - } - /** - * @hidden - */ - namespace IEntityGroup { - /** - * @hidden - */ - function construct(entityGroup: IEntityGroup, xml: library.XML, ...prohibited_names: string[]): void; - /** - * @hidden - */ - function toXML(entityGroup: IEntityGroup, ...prohibited_names: string[]): library.XML; - function has(entityGroup: IEntityGroup, key: any): boolean; - function count(entityGroup: IEntityGroup, key: any): number; - function get(entityGroup: IEntityGroup, key: any): T; - } -} -declare namespace samchon.protocol { - /** - * @inheritdoc - */ - abstract class EntityArray extends std.Vector implements IEntityGroup { - /** - * @inheritdoc - */ - construct(xml: library.XML): void; - /** - * @inheritdoc - */ - abstract createChild(xml: library.XML): T; - /** - * @inheritdoc - */ - key(): any; - /** - * @inheritdoc - */ - has(key: any): boolean; - /** - * @inheritdoc - */ - count(key: any): number; - /** - * @inheritdoc - */ - get(key: any): T; - /** - * @inheritdoc - */ - abstract TAG(): string; - /** - * @inheritdoc - */ - abstract CHILD_TAG(): string; - /** - * @inheritdoc - */ - toXML(): library.XML; - } -} -declare namespace samchon.protocol { - /** - * @inheritdoc - */ - abstract class EntityList extends std.List implements IEntityGroup { - /** - * @inheritdoc - */ - construct(xml: library.XML): void; - /** - * @inheritdoc - */ - abstract createChild(xml: library.XML): T; - /** - * @inheritdoc - */ - key(): any; - /** - * @inheritdoc - */ - has(key: any): boolean; - /** - * @inheritdoc - */ - count(key: any): number; - /** - * @inheritdoc - */ - get(key: any): T; - /** - * @inheritdoc - */ - abstract TAG(): string; - /** - * @inheritdoc - */ - abstract CHILD_TAG(): string; - /** - * @inheritdoc - */ - toXML(): library.XML; - } -} -declare namespace samchon.protocol { - /** - * @inheritdoc - */ - abstract class EntityDeque extends std.Deque implements IEntityGroup { - /** - * @inheritdoc - */ - construct(xml: library.XML): void; - /** - * @inheritdoc - */ - abstract createChild(xml: library.XML): T; - /** - * @inheritdoc - */ - key(): any; - /** - * @inheritdoc - */ - has(key: any): boolean; - /** - * @inheritdoc - */ - count(key: any): number; - /** - * @inheritdoc - */ - get(key: any): T; - /** - * @inheritdoc - */ - abstract TAG(): string; - /** - * @inheritdoc - */ - abstract CHILD_TAG(): string; - /** - * @inheritdoc - */ - toXML(): library.XML; - } -} -declare namespace samchon.protocol { - /** - * Standard message of network I/O. - * - * {@link Invoke} is a class used in network I/O in protocol package of Samchon Framework. - * - * The Invoke message has an XML structure like the result screen of provided example in below. - * We can enjoy lots of benefits by the normalized and standardized message structure used in - * network I/O. - * - * The greatest advantage is that we can make any type of network system, even how the system - * is enourmously complicated. As network communication message is standardized, we only need to - * concentrate on logical relationships between network systems. We can handle each network system - * like a object (class) in OOD. And those relationships can be easily designed by using design - * pattern. - * - * In Samchon Framework, you can make any type of network system with basic componenets - * (IProtocol, IServer and ICommunicator) by implemens or inherits them, like designing - * classes of S/W architecture. - * - * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_message_protocol.png) - * - * @see {@link IProtocol} - * @author Jeongho Nam - */ - class Invoke extends EntityArray { - /** - * Listener, represent function's name. - */ - private listener; - /** - * Default Constructor. - */ - constructor(); - constructor(listener: string); - /** - * Copy Constructor. - * - * @param invoke - */ - constructor(invoke: Invoke); - /** - * Construct from listener and parametric values. - * - * @param listener - * @param parameters - */ - constructor(listener: string, ...parameters: Array); - /** - * @inheritdoc - */ - createChild(xml: library.XML): InvokeParameter; - /** - * Get listener. - */ - getListener(): string; - /** - * Get arguments for Function.apply(). - * - * @return An array containing values of the contained parameters. - */ - getArguments(): Array; - /** - * Apply to a matched function. - * - * @param obj Target {@link IProtocol} object to find matched function. - * @return Whether succeded to find matched function. - */ - apply(obj: IProtocol): boolean; - /** - * Apply to a function. - * - * @param thisArg Owner of the function. - * @param func Function to call. - */ - apply(thisArg: IProtocol, func: Function): void; - /** - * @inheritdoc - */ - TAG(): string; - /** - * @inheritdoc - */ - CHILD_TAG(): string; - } -} -declare namespace samchon.protocol { - /** - * A parameter belongs to an Invoke. - * - * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_message_protocol.png) - * - * @author Jeongho Nam - */ - class InvokeParameter extends Entity { - /** - * Name of the parameter. - * - * @details Optional property, can be omitted. - */ - protected name: string; - /** - * Type of the parameter. - */ - protected type: string; - /** - * Value of the parameter. - */ - protected value: string | number | library.XML | Uint8Array; - /** - * Default Constructor. - */ - constructor(); - constructor(val: number); - constructor(val: string); - constructor(val: library.XML); - constructor(val: Uint8Array); - /** - * Construct from variable name and number value. - * - * @param name - * @param val - */ - constructor(name: string, val: number); - constructor(name: string, val: string); - constructor(name: string, val: library.XML); - constructor(name: string, val: Uint8Array); - /** - * @inheritdoc - */ - construct(xml: library.XML): void; - setValue(value: number): void; - setValue(value: string): void; - setValue(value: library.XML): void; - setValue(value: Uint8Array): void; - /** - * @inheritdoc - */ - key(): any; - /** - * Get name. - */ - getName(): string; - /** - * Get type. - */ - getType(): string; - /** - * Get value. - */ - getValue(): any; - /** - * @inheritdoc - */ - TAG(): string; - /** - * @inheritdoc - */ - toXML(): library.XML; - } -} -declare namespace samchon.protocol { - /** - * History of an {@link Invoke} message. - * - * The {@link InvokeHistory} is a class archiving history log of an {@link Invoke} message with elapsed time. This - * {@link InvokeHistory} class is used to report elapsed time of handling a requested process from **slave** to - * **master** system. - * - * The **master** system utilizes derived {@link InvokeHistory} objects to compute performance indices. - * - {@link ParallelSytem.getPerformance} - * - {@link DistributedProcess.getResource} - * - * @author Jeongho Nam - */ - class InvokeHistory extends protocol.Entity { - /** - * @hidden - */ - private uid; - /** - * @hidden - */ - private listener; - /** - * @hidden - */ - private start_time_; - /** - * @hidden - */ - private end_time_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from an {@link Invoke} message. - * - * @param invoke An {@link Invoke} message requesting a *parallel or distributed process*. - */ - constructor(invoke: protocol.Invoke); - /** - * @inheritdoc - */ - construct(xml: library.XML): void; - /** - * Complete the history. - * - * Completes the history and determines the {@link getEndTime end time}. - */ - complete(): void; - key(): number; - /** - * Get unique ID. - */ - getUID(): number; - /** - * Get {@link Invoke.getListener listener} of the {@link Invoke} message. - */ - getListener(): string; - /** - * Get start time. - */ - getStartTime(): Date; - /** - * Get end time. - */ - getEndTime(): Date; - /** - * Compute elapsed time. - * - * @return nanoseconds. - */ - computeElapsedTime(): number; - /** - * @inheritdoc - */ - TAG(): string; - /** - * @inheritdoc - */ - toXML(): library.XML; - /** - * Convert to an {@link Invoke} message. - * - * Creates and returns an {@link Invoke} message that is used to reporting to the **master**. - */ - toInvoke(): protocol.Invoke; - } -} -declare namespace samchon.protocol { - /** - * An interface for {@link Invoke} message chain. - * - * {@link IProtocol} is an interface for {@link Invoke} message, which is standard message of network I/O in - * *Samchon Framework*, chain. The {@link IProtocol} interface is used to network drivers and some classes which are - * in a relationship of *Chain of Responsibility Pattern* with those network drivers. - * - * Implements {@link IProtocol} if the class sends and handles {@link Invoke} messages. Looking around source codes of - * the *Samchon Framework*, especially *Templates*, you can find out that all the classes and modules handling - * {@link Invoke} messages are always implementing this {@link IProtocol}. - * - * - * - * - * - * @see {@link Invoke} - * @handbook https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iprotocol - * @author Jeongho Nam - */ - interface IProtocol { - /** - * Sending message. - * - * Sends message to related system or shifts the responsibility to chain. - * - * @param invoke Invoke message to send - */ - replyData(invoke: Invoke): void; - /** - * Handling replied message. - * - * Handles replied message or shifts the responsibility to chain. - * - * @param invoke An {@link Invoke} message has received. - */ - sendData(invoke: Invoke): void; - } -} -declare namespace samchon.protocol { - /** - * An interface for a server. - * - * {@link IServer} is an interfaec for server classes who are providing methods for {@link open opening a server} and - * {@link IClientDriver accepting clients}. - * - * To open a server, extends one of derived class under below considedring which protocol to follow first. At next, - * overrides {@link addClient addClient()} method who accepts a newly connected client as an {@link IClientDriver} - * object. Then at last, call {@link open open()} method with specified port number. - * - * Protocol | Derived Type | Related {@link IClientDriver} - * ------------------------|-------------------------------|------------------------------------- - * Samchon Framework's own | {@link Server} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} - * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} - * - * Below codes and classes will be good examples for comprehending how to open a server and handle remote clients. - * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts - * - https://github.com/samchon/framework/blob/master/ts/examples/chat-server/server.ts - * - {@link service.Server} - * - {@link external.ExternalClientArray} - * - {@link slave.SlaveServer} - * - * If you're embarrased because your class already extended another one, then use {@link IServerBase}. - * - * - * - * - * - * @see {@link IClientDriver}, {@link IServerBase} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserver) - * @author Jeongho Nam - */ - interface IServer { - /** - * Open server. - * - * @param port Port number to open. - */ - open(port: number): void; - /** - * Close server. - * - * Close opened server. All remote clients, have connected with this server, are also closed and their call back - * functions, for closed connection, {@link IClientDriver.onClose} are also called. - */ - close(): void; - /** - * Add a newly connected remote client. - * - * The {@link addClient addClient()} is an abstract method being called when a remote client is newly connected - * with {@link IClientDriver} object who communicates with the remote system. Overrides this method and defines - * what to do with the *driver*, a newly connected remote client. - * - * Below methods and example codes may be good for comprehending how to utilize this {@link addClient} method. - * - * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts - * - https://github.com/samchon/framework/blob/master/ts/examples/chat-server/server.ts - * - {@link service.Server.addClient} - * - {@link external.ExternalClientArray.addClient} - * - {@link slave.SlaveServer.addClient} - * - * @param driver A {@link ICommunicator communicator} with (newly connected) remote client. - */ - addClient(driver: IClientDriver): void; - } -} -declare namespace samchon.protocol { - /** - * A server. - * - * The {@link Server} is an abstract class designed to open a server and accept clients who are following Samchon - * Framework's own protocol. Extends this {@link Server} class and overrides {@link addClient addClient()} method to - * define what to do with newly connected {@link ClientDriver remote clients}. - * - * #### [Inherited] {@link IServer} - * {@link IServer} is an interfaec for server classes who are providing methods for {@link open opening a server} and - * {@link IClientDriver accepting clients}. - * - * To open a server, extends one of derived class under below considedring which protocol to follow first. At next, - * overrides {@link addClient addClient()} method who accepts a newly connected client as an {@link IClientDriver} - * object. Then at last, call {@link open open()} method with specified port number. - * - * Protocol | Derived Type | Related {@link IClientDriver} - * ------------------------|-------------------------------|------------------------------------- - * Samchon Framework's own | {@link Server} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} - * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} - * - * Below codes and classes will be good examples for comprehending how to open a server and handle remote clients. - * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts - * - https://github.com/samchon/framework/blob/master/ts/examples/chat-server/server.ts - * - {@link service.Server} - * - {@link external.ExternalClientArray} - * - {@link slave.SlaveServer} - * - * If you're embarrased because your class already extended another one, then use {@link IServerBase}. - * - * - * - * - * - * @see {@link ClientDriver}, {@link ServerBase} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserver) - * @author Jeongho Nam - */ - abstract class Server implements IServer { - /** - * @hidden - */ - private server; - /** - * @inheritdoc - */ - abstract addClient(driver: ClientDriver): void; - /** - * @inheritdoc - */ - open(port: number): void; - /** - * @inheritdoc - */ - close(): void; - /** - * @hidden - */ - private handle_connect(socket); - } -} -declare namespace samchon.protocol { - /** - * A web server. - * - * The {@link WebServer} is an abstract class designed to open a server and accept clients who are following - * web-socket protocol. Extends this {@link WebServer} class and overrides {@link addClient addClient()} method to - * define what to do with newly connected {@link WebClientDriver remote clients}. - * - * #### [Inherited] {@link IServer} - * {@link IServer} is an interfaec for server classes who are providing methods for {@link open opening a server} and - * {@link IClientDriver accepting clients}. - * - * To open a server, extends one of derived class under below considedring which protocol to follow first. At next, - * overrides {@link addClient addClient()} method who accepts a newly connected client as an {@link IClientDriver} - * object. Then at last, call {@link open open()} method with specified port number. - * - * Protocol | Derived Type | Related {@link IClientDriver} - * ------------------------|-------------------------------|------------------------------------- - * Samchon Framework's own | {@link Server} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} - * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} - * - * Below codes and classes will be good examples for comprehending how to open a server and handle remote clients. - * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts - * - https://github.com/samchon/framework/blob/master/ts/examples/chat-server/server.ts - * - {@link service.Server} - * - {@link external.ExternalClientArray} - * - {@link slave.SlaveServer} - * - * If you're embarrased because your class already extended another one, then use {@link IServerBase}. - * - * - * - * - * - * @see {@link WebClientDriver}, {@link WebServerBase} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserver) - * @author Jeongho Nam - */ - abstract class WebServer implements IServer { - /** - * @hidden - */ - private http_server_; - /** - * @hidden - */ - private sequence_; - /** - * @hidden - */ - private my_port_; - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - open(port: number): void; - /** - * @inheritdoc - */ - close(): void; - /** - * @inheritdoc - */ - abstract addClient(driver: WebClientDriver): void; - /** - * @hidden - */ - private handle_request(request); - /** - * @hidden - */ - private get_session_id(cookies); - /** - * @hidden - */ - private issue_session_id(); - } -} -declare namespace samchon.protocol { - /** - * A SharedWorker server. - * - * The {@link DedicatedWorkerServer} is an abstract class is realized to open a DedicatedWorker server and accept - * web-browser client (master). Extends this {@link DedicatedWorkerServer} class and overrides - * {@link addClient addClient()} method to define what to do with a newly connected - * {@link DedicatedWorkerClientDriver remote client}. - * - * #### Why DedicatedWorker be a server? - * In JavaScript environment, there's no way to implement multi-threading function. Instead, JavaScript supports the - * **Worker**, creating a new process. However, the **Worker** does not shares memory addresses. To integrate the - * **Worker** with its master, only communication with string or binary data is allowed. Doesn't it seem like a network - * communication? Furthermore, there's not any difference between the worker communication and network communication. - * It's the reason why Samchon Framework considers the **Worker** as a network node. - * - * The class {@link DedicatedWorkerCommunicator} is designed make such relationship. From now on, DedicatedWorker is a - * {@link DedicatedWorkerServer server} and {@link DedicatedWorkerServerConnector browser} is a client. Integrate the - * server and clients with this {@link DedicatedWorkerCommunicator}. - * - * #### [Inherited] {@link IServer} - * {@link IServer} is an interfaec for server classes who are providing methods for {@link open opening a server} and - * {@link IClientDriver accepting clients}. - * - * To open a server, extends one of derived class under below considedring which protocol to follow first. At next, - * overrides {@link addClient addClient()} method who accepts a newly connected client as an {@link IClientDriver} - * object. Then at last, call {@link open open()} method with specified port number. - * - * Protocol | Derived Type | Related {@link IClientDriver} - * ------------------------|-------------------------------|------------------------------------- - * Samchon Framework's own | {@link Server} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} - * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} - * - * Below codes and classes will be good examples for comprehending how to open a server and handle remote clients. - * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts - * - https://github.com/samchon/framework/blob/master/ts/examples/chat-server/server.ts - * - {@link service.Server} - * - {@link external.ExternalClientArray} - * - {@link slave.SlaveServer} - * - * If you're embarrased because your class already extended another one, then use {@link IServerBase}. - * - * - * - * - * - * @see {@link DedicatedWorkerClientDriver}, {@link DedicatedWorkerServerBase} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserver) - * @author Jeongho Nam - */ - abstract class DedicatedWorkerServer implements IServer { - /** - * @inheritdoc - */ - open(): void; - /** - * @inheritdoc - */ - close(): void; - /** - * @inheritdoc - */ - abstract addClient(driver: DedicatedWorkerClientDriver): void; - } -} -declare namespace samchon.protocol { - /** - * A SharedWorker server. - * - * The {@link SharedWorker} is an abstract class is realized to open a SharedWorker server and accept web-browser - * clients. Extends this {@link SharedWorkerServer} class and overrides {@link addClient addClient()} method to - * define what to do with newly connected {@link SharedWorkerClientDriver remote clients}. - * - * #### Why SharedWorker be a server? - * SharedWorker, it allows only an instance (process) to be created whether the SharedWorker is declared in a browser - * or multiple browsers. To integrate them, messages are being sent and received. Doesn't it seem like a relationship - * between a server and clients? Thus, Samchon Framework consider the SharedWorker as a server and browsers as - * clients. - * - * The class {@link SharedWorkerCommunicator} is designed make such relationship. From now on, SharedWorker is a - * {@link SharedWorkerServer server} and {@link SharedWorkerServerConnector browsers} are clients. Integrate the - * server and clients with this {@link SharedWorkerCommunicator}. - * - * #### [Inherited] {@link IServer} - * {@link IServer} is an interfaec for server classes who are providing methods for {@link open opening a server} and - * {@link IClientDriver accepting clients}. - * - * To open a server, extends one of derived class under below considedring which protocol to follow first. At next, - * overrides {@link addClient addClient()} method who accepts a newly connected client as an {@link IClientDriver} - * object. Then at last, call {@link open open()} method with specified port number. - * - * Protocol | Derived Type | Related {@link IClientDriver} - * ------------------------|-------------------------------|------------------------------------- - * Samchon Framework's own | {@link Server} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} - * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} - * - * Below codes and classes will be good examples for comprehending how to open a server and handle remote clients. - * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-server.ts - * - https://github.com/samchon/framework/blob/master/ts/examples/chat-server/server.ts - * - {@link service.Server} - * - {@link external.ExternalClientArray} - * - {@link slave.SlaveServer} - * - * If you're embarrased because your class already extended another one, then use {@link IServerBase}. - * - * - * - * - * - * @see {@link SharedWorkerClientDriver}, {@link SharedWorkerServerBase} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserver) - * @author Jeongho Nam - */ - abstract class SharedWorkerServer implements IServer { - /** - * @inheritdoc - */ - abstract addClient(driver: SharedWorkerClientDriver): void; - /** - * @inheritdoc - */ - open(): void; - /** - * @inheritdoc - */ - close(): void; - /** - * @hidden - */ - private handle_connect(event); - } -} -declare namespace samchon.protocol { - /** - * An interface for substitute server classes. - * - * {@link IServerBase} is an interface for substitue server classes who subrogate server's role. - * - * The easiest way to defining a server class is to extending one of them below, who implemented the {@link IServer}. - * However, it is impossible (that is, if the class is already extending another class), you can instead implement - * the {@link IServer} interface, create an {@link IServerBase} member, and write simple hooks to route calls into - * the aggregated {@link IServerBase}. - * - * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} - * ------------------------|-------------------------------|-----------------------------------|------------------------------------- - * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} - * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerServerBase} | {@link DedicatedWorkerClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} - * - * After the hooking to aggregated {@link IServerBase} object, overrides {@link addClient addClient()} method who - * accepts a newly connected client as an {@link IClientDriver} object. At last, call {@link open open()} method with - * specified port number. - * - * ```typescript - * class MyServer extends Something implements IServer - * { - * private server_base_: IServerBase = new WebServerBase(this); - * - * public addClient(driver: IClientDriver): void - * { - * // WHAT TO DO WHEN A CLIENT HAS CONNECTED - * } - * - * public open(port: number): void - * { - * this.server_base_.open(); - * } - * public close(): void - * { - * this.server_base_.close(); - * } - * } - * ``` - * - * - * - * - * - * @see {@link IServer}, {@link IClientDriver} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserverbase) - * @author Jeongho Nam - */ - interface IServerBase extends IServer { - } -} -declare namespace samchon.protocol { - /** - * A substitute {@link Server}. - * - * The {@link ServerBase} is a substitute class who subrogates {@link Server}'s responsibility. - * - * #### [Inherited] {@link IServerBase} - * {@link IServerBase} is an interface for substitue server classes who subrogate server's role. - * - * The easiest way to defining a server class is to extending one of them below, who implemented the {@link IServer}. - * However, it is impossible (that is, if the class is already extending another class), you can instead implement - * the {@link IServer} interface, create an {@link IServerBase} member, and write simple hooks to route calls into - * the aggregated {@link IServerBase}. - * - * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} - * ------------------------|-------------------------------|-----------------------------------|------------------------------------- - * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} - * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerServerBase} | {@link DedicatedWorkerClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} - * - * After the hooking to aggregated {@link IServerBase} object, overrides {@link addClient addClient()} method who - * accepts a newly connected client as an {@link IClientDriver} object. At last, call {@link open open()} method with - * specified port number. - * - * ```typescript - * class MyServer extends Something implements IServer - * { - * private server_base_: IServerBase = new WebServerBase(this); - * - * public addClient(driver: IClientDriver): void - * { - * // WHAT TO DO WHEN A CLIENT HAS CONNECTED - * } - * - * public open(port: number): void - * { - * this.server_base_.open(); - * } - * public close(): void - * { - * this.server_base_.close(); - * } - * } - * ``` - * - * - * - * - * - * - * @see {@link Server}, {@link ClientDriver} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserverbase) - * @author Jeongho Nam - */ - class ServerBase extends Server implements IServerBase { - /** - * @hidden - */ - private hooker_; - /** - * Construct from a *hooker*. - * - * @param hooker A hooker throwing responsibility of server's role. - */ - constructor(hooker: IServer); - /** - * @inheritdoc - */ - addClient(driver: IClientDriver): void; - } -} -declare namespace samchon.protocol { - /** - * A substitute {@link WebServer}. - * - * The {@link WebServerBase} is a substitute class who subrogates {@link WebServer}'s responsibility. - * - * #### [Inherited] {@link IServerBase} - * {@link IServerBase} is an interface for substitue server classes who subrogate server's role. - * - * The easiest way to defining a server class is to extending one of them below, who implemented the {@link IServer}. - * However, it is impossible (that is, if the class is already extending another class), you can instead implement - * the {@link IServer} interface, create an {@link IServerBase} member, and write simple hooks to route calls into - * the aggregated {@link IServerBase}. - * - * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} - * ------------------------|-------------------------------|-----------------------------------|------------------------------------- - * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} - * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerServerBase} | {@link DedicatedWorkerClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} - * - * After the hooking to aggregated {@link IServerBase} object, overrides {@link addClient addClient()} method who - * accepts a newly connected client as an {@link IClientDriver} object. At last, call {@link open open()} method with - * specified port number. - * - * ```typescript - * class MyServer extends Something implements IServer - * { - * private server_base_: IServerBase = new WebServerBase(this); - * - * public addClient(driver: IClientDriver): void - * { - * // WHAT TO DO WHEN A CLIENT HAS CONNECTED - * } - * - * public open(port: number): void - * { - * this.server_base_.open(); - * } - * public close(): void - * { - * this.server_base_.close(); - * } - * } - * ``` - * - * - * - * - * - * @see {@link WebServer}, {@link WebClientDriver} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserverbase) - * @author Jeongho Nam - */ - class WebServerBase extends WebServer implements IServerBase { - /** - * @hidden - */ - private hooker_; - /** - * Construct from a *hooker*. - * - * @param hooker A hooker throwing responsibility of server's role. - */ - constructor(hooker: IServer); - /** - * @inheritdoc - */ - addClient(driver: IClientDriver): void; - } -} -declare namespace samchon.protocol { - /** - * A substitute {@link DedicatedWorkerServer}. - * - * The {@link DedicatedWorkerServerBase} is a substitute class who subrogates {@link DedicatedWorkerServer}'s - * responsibility. - * - * #### [Inherited] {@link IServerBase} - * {@link IServerBase} is an interface for substitue server classes who subrogate server's role. - * - * The easiest way to defining a server class is to extending one of them below, who implemented the {@link IServer}. - * However, it is impossible (that is, if the class is already extending another class), you can instead implement - * the {@link IServer} interface, create an {@link IServerBase} member, and write simple hooks to route calls into - * the aggregated {@link IServerBase}. - * - * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} - * ------------------------|-------------------------------|-----------------------------------|------------------------------------- - * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} - * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerServerBase} | {@link DedicatedWorkerClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} - * - * After the hooking to aggregated {@link IServerBase} object, overrides {@link addClient addClient()} method who - * accepts a newly connected client as an {@link IClientDriver} object. At last, call {@link open open()} method with - * specified port number. - * - * ```typescript - * class MyServer extends Something implements IServer - * { - * private server_base_: IServerBase = new WebServerBase(this); - * - * public addClient(driver: IClientDriver): void - * { - * // WHAT TO DO WHEN A CLIENT HAS CONNECTED - * } - * - * public open(port: number): void - * { - * this.server_base_.open(); - * } - * public close(): void - * { - * this.server_base_.close(); - * } - * } - * ``` - * - * - * - * - * - * @see {@link DedicatedWorkerServer}, {@link DedicatedWorkerClientDriver} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserverbase) - * @author Jeongho Nam - */ - class DedicatedWorkerServerBase extends DedicatedWorkerServer implements IServerBase { - /** - * @hidden - */ - private hooker_; - /** - * Construct from a *hooker*. - * - * @param hooker A hooker throwing responsibility of server's role. - */ - constructor(hooker: IServer); - /** - * @inheritdoc - */ - addClient(driver: IClientDriver): void; - } -} -declare namespace samchon.protocol { - /** - * A substitute {@link SharedWorkerServer}. - * - * The {@link SharedWorkerServerBase} is a substitute class who subrogates {@link SharedWorkerServer}'s - * responsibility. - * - * #### [Inherited] {@link IServerBase} - * {@link IServerBase} is an interface for substitue server classes who subrogate server's role. - * - * The easiest way to defining a server class is to extending one of them below, who implemented the {@link IServer}. - * However, it is impossible (that is, if the class is already extending another class), you can instead implement - * the {@link IServer} interface, create an {@link IServerBase} member, and write simple hooks to route calls into - * the aggregated {@link IServerBase}. - * - * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} - * ------------------------|-------------------------------|-----------------------------------|------------------------------------- - * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} - * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} - * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerServerBase} | {@link DedicatedWorkerClientDriver} - * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} - * - * After the hooking to aggregated {@link IServerBase} object, overrides {@link addClient addClient()} method who - * accepts a newly connected client as an {@link IClientDriver} object. At last, call {@link open open()} method with - * specified port number. - * - * ```typescript - * class MyServer extends Something implements IServer - * { - * private server_base_: IServerBase = new WebServerBase(this); - * - * public addClient(driver: IClientDriver): void - * { - * // WHAT TO DO WHEN A CLIENT HAS CONNECTED - * } - * - * public open(port: number): void - * { - * this.server_base_.open(); - * } - * public close(): void - * { - * this.server_base_.close(); - * } - * } - * ``` - * - * - * - * - * - * @see {@link SharedWorkerServer}, {@link SharedWorkerClientDriver} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserverbase) - * @author Jeongho Nam - */ - class SharedWorkerServerBase extends SharedWorkerServer implements IServerBase { - /** - * @hidden - */ - private hooker_; - /** - * Construct from a *hooker*. - * - * @param hooker A hooker throwing responsibility of server's role. - */ - constructor(hooker: IServer); - /** - * @inheritdoc - */ - addClient(driver: IClientDriver): void; - } -} -declare namespace samchon.protocol { - /** - * An interface for server connector. - * - * {@link IServerConnector} is a type of {@link ICommunicator}, specified for server connector classes who connect to - * the remote server as a client. {@link IServerConnector} provides {@link connect connection method} and takes full - * charge of network communication with the remote server. - * - * Declare specific type of {@link IServerConnector} from {@link IProtocol listener} and call the - * {@link connect connect()} method. Then whenever a replied message comes from the remote system, the message will - * be converted to an {@link Invoke} object and the {@link Invoke} object will be shifted to the - * {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} method. Below code is an example - * connecting to remote server and interacting with it. - * - * - https://github.com/samchon/framework/blob/master/ts/examples/calculator/calculator-application.ts - * - * Note that, protocol of this client and remote server must be matched. Thus, before determining specific type of - * this {@link IServerConnector}, you've to consider which protocol and type the remote server follows. - * - * Protocol | Derived Type | Connect to - * ------------------------|----------------------------------------|------------------------------- - * Samchon Framework's own | {@link ServerConnector} | {@link Server} - * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} - * DedicatedWorker | {@link DedicatedWorkerServerConnector} | {@link DedicatedWorkerServer} - * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} - * - * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_basic_components.png) - * - * @see {@link IServer}, {@link IProtocol} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserverconnector) - * @author Jeongho Nam - */ - interface IServerConnector extends ICommunicator { - /** - * Callback function for connection completed. - * - * When you call {@link connect connect()} and the connection has completed, then this call back function - * {@link onConnect} will be called. Note that, if the listener of this {@link onConnect} is a member method of - * some class, then you've use the ```bind```. - */ - onConnect: Function; - /** - * Connect to a server. - * - * Connects to a server with specified *host* address and *port* number. After the connection has - * succeeded, callback function {@link onConnect} is called. Listening data from the connected server also begins. - * Replied messages from the connected server will be converted to {@link Invoke} classes and will be shifted to - * the {@link WebCommunicator.listener listener}'s {@link IProtocol.replyData replyData()} method. - * - * If the connection fails immediately, either an event is dispatched or an exception is thrown: an error - * event is dispatched if a host was specified, and an exception is thrown if no host was specified. Otherwise, - * the status of the connection is reported by an event. If the socket is already connected, the existing - * connection is closed first. - * - * @param ip The name or IP address of the host to connect to. - * If no host is specified, the host that is contacted is the host where the calling file resides. - * If you do not specify a host, use an event listener to determine whether the connection was - * successful. - * @param port The port number to connect to. - */ - connect(ip: string, port: number): void; - } -} -declare namespace samchon.protocol { - /** - * Server connnector. - * - * {@link ServerConnector} is a class connecting to remote server who follows Samchon Framework's own protocol and - * taking full charge of network communication with the remote server. Create a {@link ServerConnector} instance from - * the {@IProtocol listener} and call the {@link connect connect()} method. - * - * #### [Inherited] {@link IServerConnector} - * {@link IServerConnector} is a type of {@link ICommunicator}, specified for server connector classes who connect to - * the remote server as a client. {@link IServerConnector} provides {@link connect connection method} and takes full - * charge of network communication with the remote server. - * - * Declare specific type of {@link IServerConnector} from {@link IProtocol listener} and call the - * {@link connect connect()} method. Then whenever a replied message comes from the remote system, the message will - * be converted to an {@link Invoke} object and the {@link Invoke} object will be shifted to the - * {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} method. - * - * Note that, protocol of this client and remote server must be matched. Thus, before determining specific type of - * this {@link IServerConnector}, you've to consider which protocol and type the remote server follows. - * - * Protocol | Derived Type | Connect to - * ------------------------|----------------------------------------|------------------------------- - * Samchon Framework's own | {@link ServerConnector} | {@link Server} - * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} - * DedicatedWorker | {@link DedicatedWorkerServerConnector} | {@link DedicatedWorkerServer} - * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} - * - * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_basic_components.png) - * - * @see {@link Server}, {@link IProtocol} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserverconnector) - * @author Jeongho Nam - */ - class ServerConnector extends Communicator implements IServerConnector { - /** - * @inheritdoc - */ - onConnect: Function; - /** - * Construct from *listener*. - * - * @param listener A listener object to listen replied message from newly connected client in - * {@link IProtocol.replyData replyData()} as an {@link Invoke} object. - */ - constructor(listener: IProtocol); - /** - * @inheritdoc - */ - connect(ip: string, port: number): void; - /** - * @hidden - */ - private handle_connect(...arg); - } -} -declare namespace samchon.protocol { - /** - * A server connector for web-socket protocol. - * - * {@link WebServerConnector} is a class connecting to remote server who follows Web-socket protocol and taking full - * charge of network communication with the remote server. Create an {@link WebServerConnector} instance from the - * {@IProtocol listener} and call the {@link connect connect()} method. - * - * #### [Inherited] {@link IServerConnector} - * {@link IServerConnector} is a type of {@link ICommunicator}, specified for server connector classes who connect to - * the remote server as a client. {@link IServerConnector} provides {@link connect connection method} and takes full - * charge of network communication with the remote server. - * - * Declare specific type of {@link IServerConnector} from {@link IProtocol listener} and call the - * {@link connect connect()} method. Then whenever a replied message comes from the remote system, the message will - * be converted to an {@link Invoke} class and the {@link Invoke} object will be shifted to the - * {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} method. - * - * Note that, protocol of this client and remote server must be matched. Thus, before determining specific type of - * this {@link IServerConnector}, you've to consider which protocol and type the remote server follows. - * - * Protocol | Derived Type | Connect to - * ------------------------|----------------------------------------|------------------------------- - * Samchon Framework's own | {@link ServerConnector} | {@link Server} - * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} - * DedicatedWorker | {@link DedicatedWorkerServerConnector} | {@link DedicatedWorkerServer} - * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} - * - * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_basic_components.png) - * - * @see {@link WebServer}, {@link IProtocol} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserverconnector) - * @author Jeongho Nam - */ - class WebServerConnector extends WebCommunicator implements IServerConnector { - /** - * @hidden - */ - private browser_socket_; - /** - * @hidden - */ - private node_client_; - /** - * @inheritdoc - */ - onConnect: Function; - /** - * Construct from *listener*. - * - * @param listener A listener object to listen replied message from newly connected client in - * {@link IProtocol.replyData replyData()} as an {@link Invoke} object. - */ - constructor(listener: IProtocol); - /** - * Connect to a web server. - * - * Connects to a server with specified *host* address, *port* number and *path*. After the connection has - * succeeded, callback function {@link onConnect} is called. Listening data from the connected server also begins. - * Replied messages from the connected server will be converted to {@link Invoke} classes and will be shifted to - * the {@link WebCommunicator.listener listener}'s {@link IProtocol.replyData replyData()} method. - * - * If the connection fails immediately, either an event is dispatched or an exception is thrown: an error - * event is dispatched if a host was specified, and an exception is thrown if no host was specified. Otherwise, - * the status of the connection is reported by an event. If the socket is already connected, the existing - * connection is closed first. - * - * @param ip The name or IP address of the host to connect to. - * If no host is specified, the host that is contacted is the host where the calling file resides. - * If you do not specify a host, use an event listener to determine whether the connection was - * successful. - * @param port The port number to connect to. - * @param path Path of service which you want. - */ - connect(ip: string, port: number, path?: string): void; - /** - * @inheritdoc - */ - close(): void; - /** - * @inheritdoc - */ - sendData(invoke: Invoke): void; - /** - * @hidden - */ - private handle_browser_connect(event); - /** - * @hidden - */ - private handle_browser_message(event); - /** - * @hidden - */ - private handle_node_connect(connection); - } -} -declare namespace samchon.protocol { - /** - * A server connector for DedicatedWorker. - * - * {@link DedicatedWorkerServerConnector} is a class connecting to SharedWorker and taking full charge of network - * communication with the SharedWorker. Create an {@link DedicatedWorkerServer} instance from the - * {@IProtocol listener} and call the {@link connect connect()} method. - * - * #### Why DedicatedWorker be a server? - * In JavaScript environment, there's no way to implement multi-threading function. Instead, JavaScript supports the - * **Worker**, creating a new process. However, the **Worker** does not shares memory addresses. To integrate the - * **Worker** with its master, only communication with string or binary data is allowed. Doesn't it seem like a network - * communication? Furthermore, there's not any difference between the worker communication and network communication. - * It's the reason why Samchon Framework considers the **Worker** as a network node. - * - * The class {@link DedicatedWorkerCommunicator} is designed make such relationship. From now on, DedicatedWorker is a - * {@link DedicatedWorkerServer server} and {@link DedicatedWorkerServerConnector browser} is a client. Integrate the - * server and clients with this {@link DedicatedWorkerCommunicator}. - * - * #### [Inherited] {@link IServerConnector} - * {@link IServerConnector} is a type of {@link ICommunicator}, specified for server connector classes who connect to - * the remote server as a client. {@link IServerConnector} provides {@link connect connection method} and takes full - * charge of network communication with the remote server. - * - * Declare specific type of {@link IServerConnector} from {@link IProtocol listener} and call the - * {@link connect connect()} method. Then whenever a replied message comes from the remote system, the message will - * be converted to an {@link Invoke} class and the {@link Invoke} object will be shifted to the - * {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} method. - * - * Note that, protocol of this client and remote server must be matched. Thus, before determining specific type of - * this {@link IServerConnector}, you've to consider which protocol and type the remote server follows. - * - * Protocol | Derived Type | Connect to - * ------------------------|----------------------------------------|------------------------------- - * Samchon Framework's own | {@link ServerConnector} | {@link Server} - * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} - * DedicatedWorker | {@link DedicatedWorkerServerConnector} | {@link DedicatedWorkerServer} - * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} - * - * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_basic_components.png) - * - * @see {@link DedicatedWorkerServer}, {@link IProtocol} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserverconnector) - * @author Jeongho Nam - */ - class DedicatedWorkerServerConnector extends DedicatedWorkerCommunicator implements IServerConnector { - /** - * @hidden - */ - private worker; - /** - * @inheritdoc - */ - onConnect: Function; - /** - * Construct from *listener*. - * - * @param listener A listener object to listen replied message from newly connected client in - * {@link IProtocol.replyData replyData()} as an {@link Invoke} object. - */ - constructor(listener: IProtocol); - /** - * @inheritdoc - */ - connect(jsFile: string): void; - /** - * @inheritdoc - */ - close(): void; - /** - * @inheritdoc - */ - sendData(invoke: Invoke): void; - } -} -declare namespace samchon.protocol { - /** - * A server connector for SharedWorker. - * - * {@link SharedWorkerServerConnector} is a class connecting to SharedWorker and taking full charge of network - * communication with the SharedWorker. Create an {@link SharedWorkerServerConnector} instance from the - * {@IProtocol listener} and call the {@link connect connect()} method. - * - * #### Why SharedWorker be a server? - * SharedWorker, it allows only an instance (process) to be created whether the SharedWorker is declared in a browser - * or multiple browsers. To integrate them, messages are being sent and received. Doesn't it seem like a relationship - * between a server and clients? Thus, Samchon Framework consider the SharedWorker as a server and browsers as - * clients. - * - * The class {@link SharedWorkerCommunicator} is designed make such relationship. From now on, SharedWorker is a - * {@link SharedWorkerServer server} and {@link SharedWorkerServerConnector browsers} are clients. Integrate the - * server and clients with this {@link SharedWorkerCommunicator}. - * - * #### [Inherited] {@link IServerConnector} - * {@link IServerConnector} is a type of {@link ICommunicator}, specified for server connector classes who connect to - * the remote server as a client. {@link IServerConnector} provides {@link connect connection method} and takes full - * charge of network communication with the remote server. - * - * Declare specific type of {@link IServerConnector} from {@link IProtocol listener} and call the - * {@link connect connect()} method. Then whenever a replied message comes from the remote system, the message will - * be converted to an {@link Invoke} class and the {@link Invoke} object will be shifted to the - * {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} method. - * - * Note that, protocol of this client and remote server must be matched. Thus, before determining specific type of - * this {@link IServerConnector}, you've to consider which protocol and type the remote server follows. - * - * Protocol | Derived Type | Connect to - * ------------------------|----------------------------------------|------------------------------- - * Samchon Framework's own | {@link ServerConnector} | {@link Server} - * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} - * DedicatedWorker | {@link DedicatedWorkerServerConnector} | {@link DedicatedWorkerServer} - * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} - * - * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_basic_components.png) - * - * @see {@link SharedWorkerServer}, {@link IProtocol} - * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserverconnector) - * @author Jeongho Nam - */ - class SharedWorkerServerConnector extends SharedWorkerCommunicator implements IServerConnector { - /** - * @inheritdoc - */ - onConnect: Function; - /** - * Construct from *listener*. - * - * @param listener A listener object to listen replied message from newly connected client in - * {@link IProtocol.replyData replyData()} as an {@link Invoke} object. - */ - constructor(listener: IProtocol); - /** - * Connect to a SharedWorker. - * - * Connects to a server with specified *jstFile* path. If a SharedWorker instance of the *jsFile* is not - * constructed yet, then the SharedWorker will be newly constructed. Otherwise the SharedWorker already exists, - * then connect to the SharedWorker. After those processes, callback function {@link onConnect} is called. - * Listening data from the connected server also begins. Replied messages from the connected server will be - * converted to {@link Invoke} classes and will be shifted to the {@link WebCommunicator.listener listener}'s - * {@link IProtocol.replyData replyData()} method. - * - * If the connection fails immediately, either an event is dispatched or an exception is thrown: an error - * event is dispatched if a host was specified, and an exception is thrown if no host was specified. Otherwise, - * the status of the connection is reported by an event. If the socket is already connected, the existing - * connection is closed first. - * - * @param jsFile Path of JavaScript file to execute who defines SharedWorker. - */ - connect(jsFile: string): void; - } -} -declare namespace samchon.protocol { - /** - * @hidden - */ - namespace socket { - type socket = any; - type server = any; - type http_server = any; - } - /** - * @hidden - */ - namespace websocket { - type connection = any; - type request = any; - type IMessage = any; - type ICookie = any; - type client = any; - } -} -declare namespace samchon.templates.distributed { - /** - * Master of Distributed Processing System, a server accepting slave clients. - * - * The {@link DistributedClientArray} is an abstract class, derived from the {@link DistributedSystemArray} class, - * opening a server accepting {@link DistributedSystem distributed clients}. - * - * Extends this {@link DistributedClientArray}, overrides {@link createServerBase createServerBase()} to determine - * which protocol to follow and {@link createExternalClient createExternalClient()} creating child - * {@link DistributedSystem} object. After the extending and overridings, open this server using the - * {@link open open()} method. - * - * #### [Inherited] {@link DistributedSystemArray} - * The {@link DistributedSystemArray} is an abstract class containing and managing remote distributed **slave** system - * drivers, {@link DistributedSystem} objects. Within framework of network, {@link DistributedSystemArray} represents - * your system, a **Master** of *Distributed Processing System* that requesting *distributed process* to **slave** - * systems and the children {@link DistributedSystem} objects represent the remote **slave** systems, who is being - * requested the *distributed processes*. - * - * The {@link DistributedSystemArray} contains {@link DistributedProcess} objects directly. You can request a - * **distributed process** through the {@link DistributedProcess} object. You can access the - * {@link DistributedProcess} object(s) with those methods: - * - * - {@link hasProcess} - * - {@link getProcess} - * - {@link insertProcess} - * - {@link eraseProcess} - * - {@link getProcessMap} - * - * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the - * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed - * **slave **system. The {@link Invoke} message will be sent to the most idle {@link DistributedSystem} object. When - * the **distributed process** has completed, then {@link DistributedSystem.getPerformance performance index} and - * {@link DistributedProcess.getResource resource index} of related objects will be revaluated. - * - * - * - * - * - * #### Parallel Process - * This {@link DistributedSystemArray} class is derived from the {@link ParallelSystemArray} class, so you can request - * a **parallel process**, too. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices will - * be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * #### Proxy Pattern - * This class {@link DistributedSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link DistributedSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - abstract class DistributedClientArray extends DistributedSystemArray implements external.IExternalClientArray { - /** - * @hidden - */ - private server_base_; - /** - * Default Constructor. - */ - constructor(); - /** - * Factory method creating {@link IServerBase} object. - * - * This method {@link createServerBase createServerBase()} determines which protocol is used in this server, - * {@link ExternalClientArray}. If the protocol is determined, then {@link ExternalSystem external clients} who - * may connect to {@link ExternalClientArray this server} must follow the specified protocol. - * - * Overrides the {@link createServerBase createServerBase()} method to create and return one of them: - * - * - {@link ServerBase} - * - {@link WebServerBase} - * - {@link SharedWorkerServerBase} - * - * @return A new {@link IServerBase} object. - */ - protected abstract createServerBase(): protocol.IServerBase; - /** - * Add a newly connected remote client. - * - * When a {@link IClientDriver remote client} connects to this *master server of parallel processing system*, - * then this {@link ParallelClientArray} creates a child {@link ParallelSystem parallel client} object through - * the {@link createExternalClient createExternalClient()} method and {@link insert inserts} it. - * - * @param driver A communicator for external client. - */ - addClient(driver: protocol.IClientDriver): void; - /** - * (Deprecated) Factory method creating child object. - * - * The method {@link createChild createChild()} is deprecated. Don't use and override this. - * - * Note that, the {@link ParallelClientArray} is a server accepting {@link ParallelSystem parallel clients}. - * There's no way to creating the {@link ParallelSystem parallel clients} in advance before opening the server. - * - * @param xml An {@link XML} object represents the child {@link ParallelSystem} object. - * @return ```null``` - */ - createChild(xml: library.XML): System; - /** - * Factory method creating {@link DistributedSystem} object. - * - * The method {@link createExternalClient createExternalClient()} is a factory method creating a child - * {@link ParallelSystem} object, that is called whenever a parallel client has connected, by - * {@link addClient addClient()}. - * - * Overrides this {@link createExternalClient} method and creates a type of {@link DistributedSystem} object with - * the *driver* that communicates with the parallel client. After the creation, returns the object. Then whenever - * a parallel client has connected, matched {@link DistributedSystem} object will be constructed and - * {@link insert inserted} into this {@link DistributedSystemArray} object. - * - * @param driver A communicator with the parallel client. - * @return A newly created {@link ParallelSystem} object. - */ - protected abstract createExternalClient(driver: protocol.IClientDriver): System; - /** - * @inheritdoc - */ - open(port: number): void; - /** - * @inheritdoc - */ - close(): void; - } -} -declare namespace samchon.templates.distributed { - /** - * Mediator of Distributed Processing System, a server accepting slave clients. - * - * The {@link DistributedClientArrayMediator} is an abstract class, derived from {@link DistributedSystemArrayMediator} - * class, opening a server accepting {@link DistributedSystem distributed clients} as a **master**. - * - * Extends this {@link DistributedClientArrayMediator}, overrides {@link createServerBase createServerBase()} to - * determine which protocol to follow and {@link createExternalClient createExternalClient()} creating child - * {@link DistributedSystem} object. After the extending and overridings, open this server using the - * {@link open open()} method. - * - * #### [Inherited] {@link DistributedSystemArrayMediator} - * The {@link DistributedSystemArrayMediator} class be a master for its slave systems, and be a slave to its master - * system at the same time. This {@link DistributedSystemArrayMediator} be a master system, containing and managing - * {@link DistributedSystem} objects, which represent distributed slave systems, by extending - * {@link DistributedSystemArray} class. Also, be a slave system through {@link getMediator mediator} object, which is - * derived from the {@link SlaveSystem} class. - * - * As a slave, you can specify this {@link DistributedSystemArrayMediator} to be a client slave connecting to master - * server or a server slave accepting master client by overriding the {@link createMediator} method. - * Overrides the {@link createMediator createMediator()} method and return one of them: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * #### [Inherited] {@link DistributedSystemArray} - * The {@link DistributedSystemArray} is an abstract class containing and managing remote distributed **slave** system - * drivers, {@link DistributedSystem} objects. Within framework of network, {@link DistributedSystemArray} represents - * your system, a **Master** of *Distributed Processing System* that requesting *distributed process* to **slave** - * systems and the children {@link DistributedSystem} objects represent the remote **slave** systems, who is being - * requested the *distributed processes*. - * - * The {@link DistributedSystemArray} contains {@link DistributedProcess} objects directly. You can request a - * **distributed process** through the {@link DistributedProcess} object. You can access the - * {@link DistributedProcess} object(s) with those methods: - * - * - {@link hasProcess} - * - {@link getProcess} - * - {@link insertProcess} - * - {@link eraseProcess} - * - {@link getProcessMap} - * - * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the - * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed - * **slave **system. The {@link Invoke} message will be sent to the most idle {@link DistributedSystem} object. When - * the **distributed process** has completed, then {@link DistributedSystem.getPerformance performance index} and - * {@link DistributedProcess.getResource resource index} of related objects will be revaluated. - * - * - * - * - * - * #### Parallel Process - * This {@link DistributedSystemArray} class is derived from the {@link ParallelSystemArray} class, so you can request - * a **parallel process**, too. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices will - * be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * #### Proxy Pattern - * This class {@link DistributedSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link DistributedSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - abstract class DistributedClientArrayMediator extends DistributedSystemArrayMediator implements external.IExternalClientArray { - /** - * A subrogator of {@link IServer server}'s role instead of this {@link ExternalClientArray}. - */ - private server_base_; - /** - * Default Constructor. - */ - constructor(); - /** - * Factory method creating {@link IServerBase} object. - * - * This method {@link createServerBase createServerBase()} determines which protocol is used in this - * {@link DistributedClientArrayMediator} object as a **master**. If the protocol is determined, then - * {@link DistributedSystem distributed clients} who may connect to {@link DistributedClientArrayMediator this - * server} must follow the specified protocol. - * - * Overrides the {@link createServerBase createServerBase()} method to create and return one of them: - * - * - {@link ServerBase} - * - {@link WebServerBase} - * - {@link SharedWorkerServerBase} - * - * @return A new {@link IServerBase} object. - */ - protected abstract createServerBase(): protocol.IServerBase; - /** - * Add a newly connected remote client. - * - * When a {@link IClientDriver remote client} connects to this *master server of distributed processing system*, - * then this {@link DistributedClientArrayMediator} creates a child {@link Distributed distributed client} object - * through the {@link createExternalClient createExternalClient()} method. - * - * @param driver A communicator for external client. - */ - addClient(driver: protocol.IClientDriver): void; - /** - * (Deprecated) Factory method creating child object. - * - * The method {@link createChild createChild()} is deprecated. Don't use and override this. - * - * Note that, the {@link DistributedClientArrayMediator} is a server accepting {@link DistributedSystem distributed - * clients} as a master. There's no way to creating the {@link DistributedSystem distributed clients} in advance - * before opening the server. - * - * @param xml An {@link XML} object represents the child {@link DistributedSystem} object. - * @return null - */ - createChild(xml: library.XML): System; - /** - * Factory method creating {@link DistributedSystem} object. - * - * The method {@link createExternalClient createExternalClient()} is a factory method creating a child - * {@link DistributedSystem} object, that is called whenever a distributed client has connected, by - * {@link addClient addClient()}. - * - * Overrides this {@link createExternalClient} method and creates a type of {@link DistributedSystem} object with - * the *driver* that communicates with the distributed client. After the creation, returns the object. Then whenever - * a distributed client has connected, matched {@link DistributedSystem} object will be constructed and - * {@link insert inserted} into this {@link DistributedClientArrayMediator} object. - * - * @param driver A communicator with the distributed client. - * @return A newly created {@link DistributedSystem} object. - */ - protected abstract createExternalClient(driver: protocol.IClientDriver): System; - /** - * @inheritdoc - */ - open(port: number): void; - /** - * @inheritdoc - */ - close(): void; - } -} -declare namespace samchon.templates.distributed { - /** - * A process of Distributed Processing System. - * - * The {@link DistributedProcess} is an abstract class who represents a **process**, *SOMETHING TO DISTRIBUTE* in a Distributed - * Processing System. Overrides the {@link DistributedProcess} and defines the *SOMETHING TO DISTRIBUTE*. - * - * Relationship between {@link DistributedSystem} and {@link DistributedProcess} objects are **M: N Associative**. - * Unlike {@link ExternalSystemRole}, the {@link DistributedProcess} objects are not belonged to a specific - * {@link DistributedSystem} object. The {@link DistributedProcess} objects are belonged to the - * {@link DistributedSystemArrayMediator} directly. - * - * When you need the **distributed process**, then call {@link sendData sendData()}. The {@link sendData} will find - * the most idle {@link DistributedSystem slave system} considering not only number of processes on progress, but also - * {@link DistributedSystem.getPerformance performance index} of each {@link DistributedSystem} object and - * {@link getResource resource index} of this {@link DistributedProcess} object. The {@link Invoke} message - * requesting the **distributed process** will be sent to the most idle {@link DistributedSystem slave system}. - * - * Those {@link DistributedSystem.getPerformance performance index} and {@link getResource resource index} are - * revaluated whenever the **distributed process** has completed basis on the execution time. - * - * - * - * - * - * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - abstract class DistributedProcess extends protocol.Entity implements protocol.IProtocol { - /** - * @hidden - */ - private system_array_; - /** - * A name, represents and identifies this {@link DistributedProcess process}. - * - * This {@link name} is an identifier represents this {@link DistributedProcess process}. This {@link name} is - * used in {@link DistributedSystemArray.getProcess} and {@link DistributedSystemArray.getProcess}, as a key elements. - * Thus, this {@link name} should be unique in its parent {@link DistributedSystemArray} object. - */ - protected name: string; - /** - * @hidden - */ - private progress_list_; - /** - * @hidden - */ - private history_list_; - /** - * @hidden - */ - private resource; - /** - * @hidden - */ - private enforced_; - /** - * Constrct from parent {@link DistributedSystemArray} object. - * - * @param systemArray The parent {@link DistributedSystemArray} object. - */ - constructor(systemArray: DistributedSystemArray); - /** - * Identifier of {@link ParallelProcess} is its {@link name}. - */ - key(): string; - /** - * Get parent {@link DistributedSystemArray} object. - * - * @return The parent {@link DistributedSystemArray} object. - */ - getSystemArray(): DistributedSystemArray; - /** - * Get parent {@link DistributedSystemArray} object. - * - * @return The parent {@link DistributedSystemArray} object. - */ - getSystemArray>(): SystemArray; - /** - * Get name, who represents and identifies this process. - */ - getName(): string; - /** - * Get resource index. - * - * Get *resource index* that indicates how much this {@link DistributedProcess process} is heavy. - * - * If this {@link DistributedProcess process} does not have any {@link Invoke} message had handled, then the - * *resource index* will be ```1.0```, which means default and average value between all - * {@link DistributedProcess} instances (that are belonged to a same {@link DistributedSystemArray} object). - * - * You can specify the *resource index* by yourself, but notice that, if the *resource index* is higher than - * other {@link DistributedProcess} objects, then this {@link DistributedProcess process} will be ordered to - * handle less processes than other {@link DistributedProcess} objects. Otherwise, the *resource index* is - * lower than others, of course, much processes will be requested. - * - * - {@link setResource setResource()} - * - {@link enforceResource enforceResource()} - * - * Unless {@link enforceResource enforceResource()} is called, This *resource index* is **revaluated** whenever - * {@link sendData sendData()} is called. - * - * @return Resource index. - */ - getResource(): number; - /** - * Set resource index. - * - * Set *resource index* that indicates how much this {@link DistributedProcess process} is heavy. This - * *resource index* can be **revaulated**. - * - * Note that, initial and average *resource index* of {@link DistributedProcess} objects are ```1.0```. If the - * *resource index* is higher than other {@link DistributedProcess} objects, then this - * {@link DistributedProcess} will be ordered to handle more processes than other {@link DistributedProcess} - * objects. Otherwise, the *resource index* is lower than others, of course, less processes will be requested. - * - * Unlike {@link enforceResource}, configuring *resource index* by this {@link setResource} allows the - * **revaluation**. This **revaluation** prevents wrong valuation from user. For example, you *mis-valuated* the - * *resource index*. The {@link DistributedProcess process} is much heavier than any other, but you estimated it - * to the lightest one. It looks like a terrible case that causes - * {@link DistributedSystemArray entire distributed processing system} to be slower, however, don't mind. The - * {@link DistributedProcess process} will the direct to the *propriate resource index* eventually with the - * **revaluation**. - * - * - The **revaluation** is caused by the {@link sendData sendData()} method. - * - * @param val New resource index, but can be revaluated. - */ - setResource(val: number): void; - /** - * Enforce resource index. - * - * Enforce *resource index* that indicates how much heavy the {@link DistributedProcess process is}. The - * *resource index* will be fixed, never be **revaluated**. - * - * Note that, initial and average *resource index* of {@link DistributedProcess} objects are ```1.0```. If the - * *resource index* is higher than other {@link DistributedProcess} objects, then this - * {@link DistributedProcess} will be ordered to handle more processes than other {@link DistributedProcess} - * objects. Otherwise, the *resource index* is lower than others, of course, less processes will be requested. - * - * The difference between {@link setResource} and this {@link enforceResource} is allowing **revaluation** or not. - * This {@link enforceResource} does not allow the **revaluation**. The *resource index* is clearly fixed and - * never be changed by the **revaluation**. But you've to keep in mind that, you can't avoid the **mis-valuation** - * with this {@link enforceResource}. - * - * For example, there's a {@link DistributedProcess process} much heavier than any other, but you - * **mis-estimated** it to the lightest. In that case, there's no way. The - * {@link DistributedSystemArray entire distributed processing system} will be slower by the **mis-valuation**. - * By the reason, using {@link enforceResource}, it's recommended only when you can clearly certain the - * *resource index*. If you can't certain the *resource index* but want to recommend, then use {@link setResource} - * instead. - * - * @param val New resource index to be fixed. - */ - enforceResource(val: number): void; - /** - * @hidden - */ - private compute_average_elapsed_time(); - /** - * @inheritdoc - */ - abstract replyData(invoke: protocol.Invoke): void; - /** - * Send an {@link Invoke} message. - * - * Sends an {@link Invoke} message requesting a **distributed process**. The {@link Invoke} message will be sent - * to the most idle {@link DistributedSystem} object, which represents a slave system, and the most idle - * {@link DistributedSystem} object will be returned. - * - * When the **distributed process** has completed, then the {@link DistributedSystemArray} object will revaluate - * {@link getResource resource index} and {@link DistributedSystem.getPerformance performance index} of this - * {@link DistributedSystem} and the most idle {@link DistributedSystem} objects basis on the execution time. - * - * @param invoke An {@link Invoke} message requesting distributed process. - * @return The most idle {@link DistributedSystem} object who may send the {@link Invoke} message. - */ - sendData(invoke: protocol.Invoke): DistributedSystem; - /** - * Send an {@link Invoke} message. - * - * Sends an {@link Invoke} message requesting a **distributed process**. The {@link Invoke} message will be sent - * to the most idle {@link DistributedSystem} object, which represents a slave system, and the most idle - * {@link DistributedSystem} object will be returned. - * - * When the **distributed process** has completed, then the {@link DistributedSystemArray} object will revaluate - * {@link getResource resource index} and {@link DistributedSystem.getPerformance performance index} of this - * {@link DistributedSystem} and the most idle {@link DistributedSystem} objects basis on the execution time. - * - * @param invoke An {@link Invoke} message requesting distributed process. - * @param weight Weight of resource which indicates how heavy this {@link Invoke} message is. Default is 1. - * - * @return The most idle {@link DistributedSystem} object who may send the {@link Invoke} message. - */ - sendData(invoke: protocol.Invoke, weight: number): DistributedSystem; - /** - * @hidden - */ - private complete_history(history); - /** - * @inheritdoc - */ - TAG(): string; - } -} -declare namespace samchon.templates.external { - /** - * An external system driver. - * - * The {@link ExternalSystem} class represents an external system, connected and interact with this system. - * {@link ExternalSystem} takes full charge of network communication with the remote, external system have connected. - * Replied {@link Invoke} messages from the external system is shifted to and processed in, children elements of this - * class, {@link ExternalSystemRole} objects. - * - * - * - * - * - * #### Bridge & Proxy Pattern - * The {@link ExternalSystem} class can be a *bridge* for *logical proxy*. In framework within user, - * which {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Bridge Pattern* and *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) - * @author Jeongho Nam - */ - abstract class ExternalSystem extends protocol.EntityDequeCollection implements protocol.IProtocol { - /** - * The name represents external system have connected. - */ - protected name: string; - /** - * @hidden - */ - private system_array_; - /** - * @hidden - */ - private communicator_; - /** - * Construct from parent {@link ExternalSystemArray}. - * - * @param systemArray The parent {@link ExternalSystemArray} object. - */ - constructor(systemArray: ExternalSystemArray); - /** - * Constrct from parent {@link ExternalSystemArray} and communicator. - * - * @param systemArray The parent {@link ExternalSystemArray} object. - * @param communicator Communicator with the remote, external system. - */ - constructor(systemArray: ExternalSystemArray, communicator: protocol.IClientDriver); - /** - * Default Destructor. - * - * This {@link destructor destructor()} method is called when the {@link ExternalSystem} object is destructed and - * the {@link ExternalSystem} object is destructed when connection with the remote system is closed or this - * {@link ExternalSystem} object is {@link ExternalSystemArray.erase erased} from its parent - * {@link ExternalSystemArray} object. - * - * Note that, don't call this {@link destructor destructor()} method by yourself. It must be called automatically - * by those *destruction* cases. Also, if your derived {@link ExternalSystem} class has something to do on the - * *destruction*, then overrides this {@link destructor destructor()} method and defines the something to do. - * Overriding this {@link destructor destructor()}, don't forget to calling ```super.destructor();``` on tail. - * - * ```typescript - * class SomeSystem extends templates.external.ExternalSystem - * { - * protected destructor(): void - * { - * // DO SOMETHING - * this.do_something(); - * - * // CALL SUPER.DESTRUCTOR() ON TAIL. DON'T FORGET THIS - * super.destructor(); - * } - * } - * ``` - */ - protected destructor(): void; - /** - * @hidden - */ - private handle_close(); - /** - * Get parent {@link ExternalSystemArray} object. - */ - getSystemArray(): ExternalSystemArray; - /** - * Get parent {@link ExternalSystemArray} object. - */ - getSystemArray>(): SystemArray; - /** - * Identifier of {@link ExternalSystem} is its {@link name}. - * - * @return name. - */ - key(): string; - /** - * Get {@link name}. - */ - getName(): string; - /** - * @hidden - */ - /** - * @hidden - */ - protected communicator: protocol.ICommunicator; - /** - * Close connection. - */ - close(): void; - /** - * Send {@link Invoke} message to external system. - * - * @param invoke An {@link Invoke} message to send. - */ - sendData(invoke: protocol.Invoke): void; - /** - * Handle an {@Invoke} message has received. - * - * @param invoke An {@link Invoke} message have received. - */ - replyData(invoke: protocol.Invoke): void; - /** - * Tag name of the {@link ExternalSystem} in {@link XML}. - * - * @return *system*. - */ - TAG(): string; - /** - * Tag name of {@link ExternalSystemRole children elements} belonged to the {@link ExternalSystem} in {@link XML}. - * - * @return *role*. - */ - CHILD_TAG(): string; - } -} -declare namespace samchon.templates.parallel { - /** - * A driver for a parallel slave system. - * - * The {@link ParallelSystem} is an abstract class represents a **slave** system in *Parallel Processing System*, - * connected with this **master** system. This {@link ParallelSystem} takes full charge of network communication with - * the remote, parallel **slave** system has connected. - * - * When a *parallel process* is requested (by {@link ParallelSystemArray.sendSegmentData} or - * {@link ParallelSystemArray.sendPieceData}), the number of pieces to be allocated to a {@link ParallelSystem} is - * turn on its {@link getPerformance performance index}. Higher {@link getPerformance performance index}, then - * more pieces are requested. The {@link getPerformance performance index} is revaluated whenever a *parallel process* - * has completed, basic on the execution time and number of pieces. You can sugguest or enforce the - * {@link getPerformance performance index} with {@link setPerformance} or {@link enforcePerformance}. - * - * - * - * - * - * #### Bridge & Proxy Pattern - * This class {@link ParallelSystem} is derived from the {@link ExternalSystem} class. Thus, you can take advantage - * of the *Bridge & Proxy Pattern* in this {@link ParallelSystem} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Bridge & Proxy Pattern*: - * - * The {@link ExternalSystem} class can be a *bridge* for *logical proxy*. In framework within user, - * which {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Bridge Pattern* and *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) - * @author Jeongho Nam - */ - abstract class ParallelSystem extends external.ExternalSystem { - /** - * @hidden - */ - private progress_list_; - /** - * @hidden - */ - private history_list_; - /** - * @hidden - */ - private exclude_; - /** - * @hidden - */ - private performance; - /** - * @hidden - */ - private enforced_; - /** - * Construct from parent {@link ParallelSystemArray}. - * - * @param systemArray The parent {@link ParallelSystemArray} object. - */ - constructor(systemArray: ParallelSystemArray); - /** - * Construct from parent {@link ParallelSystemArray} and communicator. - * - * @param systemArray The parent {@link ParallelSystemArray} object. - * @param communicator A communicator communicates with remote, the external system. - */ - constructor(systemArray: ParallelSystemArray, communicator: protocol.IClientDriver); - /** - * Default Destructor. - * - * This {@link destructor destructor()} method is called when the {@link ParallelSystem} object is destructed and - * the {@link ParallelSystem} object is destructed when connection with the remote system is closed or this - * {@link ParallelSystem} object is {@link ParallelSystemArray.erase erased} from its parent - * {@link ParallelSystemArray} object. - * - * You may think if there're some *parallel processes* have requested but not completed yet, then it would be a - * critical problem because the *parallel processes* will not complete forever. Do not worry. The critical problem - * does not happen. After the destruction, the remained *parallel processes* will be shifted to and proceeded in - * other {@link ParallelSystem} objects. - * - * Note that, don't call this {@link destructor destructor()} method by yourself. It must be called automatically - * by those *destruction* cases. Also, if your derived {@link ParallelSystem} class has something to do on the - * *destruction*, then overrides this {@link destructor destructor()} method and defines the something to do. - * Overriding this {@link destructor destructor()}, don't forget to calling ```super.destructor();``` on tail. - * - * ```typescript - * class SomeSystem extends protocol.external.ExternalSystem - * { - * protected destructor(): void - * { - * // DO SOMETHING - * this.do_something(); - * - * // CALL SUPER.DESTRUCTOR() ON TAIL. DON'T FORGET THIS - * super.destructor(); - * } - * } - * ``` - */ - protected destructor(): void; - /** - * Get manager of this object. - * - * @return The parent {@link ParallelSystemArray} object. - */ - getSystemArray(): ParallelSystemArray; - /** - * Get manager of this object. - * - * @return The parent {@link ParallelSystemArray} object. - */ - getSystemArray>(): SystemArray; - /** - * Get performance index. - * - * Get *performance index* that indicates how much fast the remote system is. - * - * If this {@link ParallelSystem parallel system} does not have any {@link Invoke} message had handled, then the - * *performance index* will be ```1.0```, which means default and average value between all {@link ParallelSystem} - * instances (that are belonged to a same {@link ParallelSystemArray} object). - * - * You can specify this *performance index* by yourself but notice that, if the *performance index* is higher - * than other {@link ParallelSystem} objects, then this {@link ParallelSystem parallel system} will be ordered to - * handle more processes than other {@link ParallelSystem} objects. Otherwise, the *performance index* is lower - * than others, of course, less processes will be delivered. - * - * - {@link setPerformance setPerformance()} - * - {@link enforcePerformance enforcePerformance()} - * - * Unless {@link enforcePerformance enforcePerformance()} is called, This *performance index* is **revaluated** - * whenever user calls one of them below. - * - * - {@link ParallelSystemArray.sendSegmentData ParallelSystemArray.sendSegmentData()} - * - {@link ParallelSystemArray.sendPieceData ParallelSystemArray.sendPieceData()} - * - {@link DistributedProcess.sendData DistributedProcess.sendData()}. - * - * @return Performance index. - */ - getPerformance(): number; - /** - * Set performance index. - * - * Set *performance index* that indicates how much fast the remote system is. This *performance index* can be - * **revaulated**. - * - * Note that, initial and average *performance index* of {@link ParallelSystem} objects are ```1.0```. If the - * *performance index* is higher than other {@link ParallelSystem} objects, then this {@link ParallelSystem} will - * be ordered to handle more processes than other {@link ParallelSystem} objects. Otherwise, the - * *performance index* is lower than others, of course, less processes will be delivered. - * - * Unlike {@link enforcePerformance}, configuring *performance index* by this {@link setPerformance} allows - * **revaluation**. This **revaluation** prevents wrong valuation from user. For example, you *mis-valuated* the - * *performance index*. The remote system is much faster than any other, but you estimated it to the slowest one. - * It looks like a terrible case that causes {@link ParallelSystemArray entire parallel systems} to be slower, - * however, don't mind. The system will direct to the *propriate performance index* eventually with the - * **revaluation** by following methods. - * - * - {@link ParallelSystemArray.sendSegmentData ParallelSystemArray.sendSegmentData()} - * - {@link ParallelSystemArray.sendPieceData ParallelSystemArray.sendPieceData()} - * - {@link DistributedProcess.sendData DistributedProcess.sendData()}. - * - * @param val New performance index, but can be revaluated. - */ - setPerformance(val: number): void; - /** - * Enforce performance index. - * - * Enforce *performance index* that indicates how much fast the remote system is. The *performance index* will be - * fixed, never be **revaluated**. - * - * Note that, initial and average *performance index* of {@link ParallelSystem} objects are ```1.0```. If the - * *performance index* is higher than other {@link ParallelSystem} objects, then this {@link ParallelSystem} will - * be ordered to handle more processes than other {@link ParallelSystem} objects. Otherwise, the - * *performance index* is lower than others, of course, less processes will be delivered. - * - * The difference between {@link setPerformance} and this {@link enforcePerformance} is allowing **revaluation** - * or not. This {@link enforcePerformance} does not allow the **revaluation**. The *performance index* is clearly - * fixed and never be changed by the **revaluation**. But you've to keep in mind that, you can't avoid the - * **mis-valuation** with this {@link enforcePerformance}. - * - * For example, there's a remote system much faster than any other, but you **mis-estimated** it to the slowest. - * In that case, there's no way. The {@link ParallelSystemArray entire parallel systems} will be slower by the - * **mis-valuation**. By the reason, using {@link enforcePerformance}, it's recommended only when you can clearly - * certain the *performance index*. If you can't certain the *performance index* but want to recommend, then use - * {@link setPerformance} instead. - * - * @param val New performance index to be fixed. - */ - enforcePerformance(val: number): void; - /** - * @hidden - */ - private send_piece_data(invoke, first, last); - /** - * @hidden - */ - private _replyData(invoke); - /** - * @hidden - */ - protected _Report_history(xml: library.XML): void; - /** - * @hidden - */ - protected _Send_back_history(invoke: protocol.Invoke, history: protocol.InvokeHistory): void; - } -} -declare namespace samchon.templates.distributed { - /** - * A driver for a distributed slave system. - * - * The {@link DistributedSystem} is an abstract class represents a **slave** system in *Distributed Processing System*, - * connected with this **master** system. This {@link DistributedSystem} takes full charge of network communication - * with the remote, distributed **slave** system has connected. - * - * This {@link DistributedSystem} has a {@link getPerformance performance index} that indicates how much the **slave** - * system is fast. The {@link getPerformance performance index} is referenced and revaluated whenever those methods - * are called: - * - * - Requesting a *parallel process* - * - {@link DistributedSystemArray.sendSegmentData} - * - {@link DistributedSystemArray.sendPieceData} - * - Requesting a *distributed process*: {@link DistributedProcess.sendData} - * - * Note that, this {@link DistributedSystem} class derived from the {@link ExternalSystem} class. Thus, this - * {@link DistributedSystem} can also have children {@link ExternalSystemRole} objects exclusively. However, the - * children {@link ExternalSystemRole roles} objects are different with the {@link DistributedProcess}. The - * domestic {@link ExternalSystemRole roles} are belonged to only a specific {@link DistributedSystem} object. - * Otherwise, the {@link DistributedProcess} objects are belonged to a {@link DistributedSystemArray} object. - * Furthermore, the relationship between this {@link DistributedSystem} and {@link DistributedProcess} classes are - * **M: N Associative**. - * - * Articles | {@link DistributedProcess} | {@link ExternalSystemRole} - * -------------|--------------------------------|---------------------------- - * Belonged to | {@link DistributedSystemArray} | {@link DistributedSystem} - * Relationship | M: N Associative | 1: N Composite - * Ownership | References | Exclusive possession - * - * - * - * - * - * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - abstract class DistributedSystem extends parallel.ParallelSystem { - /** - * Construct from parent {@link DistributedSystemArray}. - * - * @param systemArray The parent {@link DistributedSystemArray} object. - */ - constructor(systemArray: DistributedSystemArray); - /** - * Constrct from parent {@link DistributedSystemArray} and communicator. - * - * @param systemArray The parent {@link DistributedSystemArray} object. - * @param communicator A communicator communicates with remote, the external system. - */ - constructor(systemArray: DistributedSystemArray, communicator: protocol.IClientDriver); - /** - * Factory method creating a {@link ExternalSystemRole child} object. - * - * In {@link distributed} module, the process class {@link DistributedProcess} is not belonged to a specific - * {@link DistributedSystem} object. It only belongs to a {@link DistributedSystemArray} object and has a - * **M: N Associative Relationship** between this {@link DistributedSystem} class. - * - * By that reason, it's the normal case that the {@link DistributedSystem} object does not have any children - * {@link ExternalSystemRole} object. Thus, default {@link createChild} returns ```null```. - * - * However, if you want a {@link DistributedSystem} to have its own domestic {@link ExternalSystemRole} objects - * without reference to the {@link DistributedProcess} objects, it is possible. Creates and returns the - * domestic {@link ExternalSystemRole} object. - * - * @param xml {@link XML} represents the {@link ExternalSystemRole child} object. - * @return A newly created {@link ExternalSystemRole} object or ```null```. - */ - createChild(xml: library.XML): external.ExternalSystemRole; - /** - * Get manager of this object. - * - * @return The parent {@link DistributedSystemArray} object. - */ - getSystemArray(): DistributedSystemArray; - /** - * Get manager of this object. - * - * @return The parent {@link DistributedSystemArray} object. - */ - getSystemArray>(): SystemArray; - /** - * @hidden - */ - private compute_average_elapsed_time(); - /** - * @inheritdoc - */ - replyData(invoke: protocol.Invoke): void; - /** - * @hidden - */ - protected _Report_history(xml: library.XML): void; - /** - * @hidden - */ - protected _Send_back_history(invoke: protocol.Invoke, history: protocol.InvokeHistory): void; - } -} -declare namespace samchon.templates.distributed { - /** - * An interface for a distributed slave server driver. - * - * The easiest way to defining a driver for distributed **slave** server is extending {@link DistributedServer} class. - * However, if you've to interact with a prallel **slave** system who can be both server and client, them make a class - * (let's name it **BaseSystem**) extending the {@link DistributedServer} class. At next, make a new class (now, I name - * it **BaseServer**) extending the **BaseSystem** and implements this interface {@link IParallelServer}. Define the - * **BaseServer** following those codes on below: - * - * - * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) - * @author Jeongho Nam - */ - interface IDistributedServer extends DistributedSystem { - /** - * Connect to external server. - */ - connect(): void; - } - /** - * A driver for distributed slave server. - * - * The {@link DistributedServer} is an abstract class, derived from the {@link DistributedSystem} class, connecting to - * remote, distributed **slave** server. Extends this {@link DistributedServer} class and overrides the - * {@link createServerConnector createServerConnector()} method following which protocol the **slave** server uses. - * - * #### [Inheritdoc] {@link DistributedSystem} - * The {@link DistributedSystem} is an abstract class represents a **slave** system in *Distributed Processing System*, - * connected with this **master** system. This {@link DistributedSystem} takes full charge of network communication - * with the remote, distributed **slave** system has connected. - * - * This {@link DistributedSystem} has a {@link getPerformance performance index} that indicates how much the **slave** - * system is fast. The {@link getPerformance performance index} is referenced and revaluated whenever those methods - * are called: - * - * - Requesting a *parallel process* - * - {@link DistributedSystemArray.sendSegmentData} - * - {@link DistributedSystemArray.sendPieceData} - * - Requesting a *distributed process*: {@link DistributedProcess.sendData} - * - * Note that, this {@link DistributedSystem} class derived from the {@link ExternalSystem} class. Thus, this - * {@link DistributedSystem} can also have children {@link ExternalSystemRole} objects exclusively. However, the - * children {@link ExternalSystemRole roles} objects are different with the {@link DistributedProcess}. The - * domestic {@link ExternalSystemRole roles} are belonged to only a specific {@link DistributedSystem} object. - * Otherwise, the {@link DistributedProcess} objects are belonged to a {@link DistributedSystemArray} object. - * Furthermore, the relationship between this {@link DistributedSystem} and {@link DistributedProcess} classes are - * **M: N Associative**. - * - * Articles | {@link DistributedProcess} | {@link ExternalSystemRole} - * -------------|--------------------------------|---------------------------- - * Belonged to | {@link DistributedSystemArray} | {@link DistributedSystem} - * Relationship | M: N Associative | 1: N Composite - * Ownership | References | Exclusive possession - * - * - * - * - * - * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - abstract class DistributedServer extends DistributedSystem implements external.IExternalServer { - /** - * IP address of target external system to connect. - */ - protected ip: string; - /** - * Port number of target external system to connect. - */ - protected port: number; - /** - * Construct from parent {@link DistributedSystemArray}. - * - * @param systemArray The parent {@link DistributedSystemArray} object. - */ - constructor(systemArray: DistributedSystemArray); - /** - * Factory method creating {@link IServerConnector} object. - * - * The {@link createServerConnector createServerConnector()} is an abstract method creating - * {@link IServerConnector} object. Overrides and returns one of them, considering which protocol the slave server - * follows: - * - * - {@link ServerConnector} - * - {@link WebServerConnector} - * - {@link DedicatedWorkerServerConnector} - * - {@link SharedWorkerServerConnector} - * - * @return A newly created {@link IServerConnector} object. - */ - protected abstract createServerConnector(): protocol.IServerConnector; - /** - * @inheritdoc - */ - connect(): void; - } -} -declare namespace samchon.templates.distributed { - /** - * Master of Distributed Processing System, a client connecting to slave servers. - * - * The {@link DistributedServerArray} is an abstract class, derived from the {@link DistributedSystemArray} class, - * connecting to {@link IDistributedServer distributed servers}. - * - * Extends this {@link DistributedServerArray} and overrides {@link createChild createChild()} method creating child - * {@link IDistributedServer} object. After the extending and overriding, construct children {@link IDistributedServer} - * objects and call the {@link connect connect()} method. - * - * #### [Inherited] {@link DistributedSystemArray} - * The {@link DistributedSystemArray} is an abstract class containing and managing remote distributed **slave** system - * drivers, {@link DistributedSystem} objects. Within framework of network, {@link DistributedSystemArray} represents - * your system, a **Master** of *Distributed Processing System* that requesting *distributed process* to **slave** - * systems and the children {@link DistributedSystem} objects represent the remote **slave** systems, who is being - * requested the *distributed processes*. - * - * The {@link DistributedSystemArray} contains {@link DistributedProcess} objects directly. You can request a - * **distributed process** through the {@link DistributedProcess} object. You can access the - * {@link DistributedProcess} object(s) with those methods: - * - * - {@link hasProcess} - * - {@link getProcess} - * - {@link insertProcess} - * - {@link eraseProcess} - * - {@link getProcessMap} - * - * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the - * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed - * **slave **system. The {@link Invoke} message will be sent to the most idle {@link DistributedSystem} object. When - * the **distributed process** has completed, then {@link DistributedSystem.getPerformance performance index} and - * {@link DistributedProcess.getResource resource index} of related objects will be revaluated. - * - * - * - * - * - * #### Parallel Process - * This {@link DistributedSystemArray} class is derived from the {@link ParallelSystemArray} class, so you can request - * a **parallel process**, too. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices will - * be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * #### Proxy Pattern - * This class {@link DistributedSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link DistributedSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - abstract class DistributedServerArray extends DistributedSystemArray implements external.IExternalServerArray { - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - connect(): void; - } -} -declare namespace samchon.templates.distributed { - /** - * Mediator of Distributed Processing System, a client connecting to slave servers. - * - * The {@link DistributedServerArrayMediator} is an abstract class, derived from {@link DistributedSystemArrayMediator} - * class, connecting to {@link IDistributedServer distributed servers}. - * - * Extends this {@link DistributedServerArrayMediator} and overrides {@link createChild createChild()} method creating - * child {@link IDistributedServer} object. After the extending and overriding, construct children - * {@link IDistributedServer} objects and call the {@link connect connect()} method. - * - * #### [Inherited] {@link DistributedSystemArrayMediator} - * The {@link DistributedSystemArrayMediator} class be a master for its slave systems, and be a slave to its master - * system at the same time. This {@link DistributedSystemArrayMediator} be a master system, containing and managing - * {@link DistributedSystem} objects, which represent distributed slave systems, by extending - * {@link DistributedSystemArray} class. Also, be a slave system through {@link getMediator mediator} object, which is - * derived from the {@link SlaveSystem} class. - * - * As a slave, you can specify this {@link DistributedSystemArrayMediator} to be a client slave connecting to master - * server or a server slave accepting master client by overriding the {@link createMediator} method. - * Overrides the {@link createMediator createMediator()} method and return one of them: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * #### [Inherited] {@link DistributedSystemArray} - * The {@link DistributedSystemArray} is an abstract class containing and managing remote distributed **slave** system - * drivers, {@link DistributedSystem} objects. Within framework of network, {@link DistributedSystemArray} represents - * your system, a **Master** of *Distributed Processing System* that requesting *distributed process* to **slave** - * systems and the children {@link DistributedSystem} objects represent the remote **slave** systems, who is being - * requested the *distributed processes*. - * - * The {@link DistributedSystemArray} contains {@link DistributedProcess} objects directly. You can request a - * **distributed process** through the {@link DistributedProcess} object. You can access the - * {@link DistributedProcess} object(s) with those methods: - * - * - {@link hasProcess} - * - {@link getProcess} - * - {@link insertProcess} - * - {@link eraseProcess} - * - {@link getProcessMap} - * - * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the - * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed - * **slave **system. The {@link Invoke} message will be sent to the most idle {@link DistributedSystem} object. When - * the **distributed process** has completed, then {@link DistributedSystem.getPerformance performance index} and - * {@link DistributedProcess.getResource resource index} of related objects will be revaluated. - * - * - * - * - * - * #### Parallel Process - * This {@link DistributedSystemArray} class is derived from the {@link ParallelSystemArray} class, so you can request - * a **parallel process**, too. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices will - * be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * #### Proxy Pattern - * This class {@link DistributedSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link DistributedSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - abstract class DistributedServerArrayMediator extends DistributedSystemArrayMediator implements external.IExternalServerArray { - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - connect(): void; - } -} -declare namespace samchon.templates.distributed { - /** - * Master of Distributed Processing System, be a server and client at the same time. - * - * The {@link DistributedServerClientArray} is an abstract class, derived from the {@link DistributedSystemArray} - * class, opening a server accepting {@link Distributed distributed clients} and being a client connecting to - * {@link IDistributedServer distributed servers} at the same time. - * - * Extends this {@link DistributedServerClientArray} and overrides below methods. After the overridings, open server - * with {@link open open()} method and connect to {@link IDistributedServer distributed servers} through the - * {@link connect connect()} method. - * - * - {@link createServerBase createServerBase()} - * - {@link createExternalClient createExternalClient()} - * - {@link createExternalServer createExternalServer()} - * - * #### [Inherited] {@link DistributedSystemArray} - * The {@link DistributedSystemArray} is an abstract class containing and managing remote distributed **slave** system - * drivers, {@link DistributedSystem} objects. Within framework of network, {@link DistributedSystemArray} represents - * your system, a **Master** of *Distributed Processing System* that requesting *distributed process* to **slave** - * systems and the children {@link DistributedSystem} objects represent the remote **slave** systems, who is being - * requested the *distributed processes*. - * - * The {@link DistributedSystemArray} contains {@link DistributedProcess} objects directly. You can request a - * **distributed process** through the {@link DistributedProcess} object. You can access the - * {@link DistributedProcess} object(s) with those methods: - * - * - {@link hasProcess} - * - {@link getProcess} - * - {@link insertProcess} - * - {@link eraseProcess} - * - {@link getProcessMap} - * - * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the - * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed - * **slave **system. The {@link Invoke} message will be sent to the most idle {@link DistributedSystem} object. When - * the **distributed process** has completed, then {@link DistributedSystem.getPerformance performance index} and - * {@link DistributedProcess.getResource resource index} of related objects will be revaluated. - * - * - * - * - * - * #### Parallel Process - * This {@link DistributedSystemArray} class is derived from the {@link ParallelSystemArray} class, so you can request - * a **parallel process**, too. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices will - * be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * #### Proxy Pattern - * This class {@link DistributedSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link DistributedSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - abstract class DistributedServerClientArray extends DistributedClientArray implements external.IExternalServerClientArray { - /** - * Default Constructor. - */ - constructor(); - /** - * Factory method of a child Entity. - * - * This method is migrated to {@link createExternalServer}. Override the {@link createExternalServer} method. - * - * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. - * @return A new child Entity via {@link createExternalServer createExternalServer()}. - */ - createChild(xml: library.XML): System; - /** - * Factory method creating an {@link IDistributedServer} object. - * - * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. - * @return A newly created {@link IDistributedServer} object. - */ - protected abstract createExternalServer(xml: library.XML): System; - /** - * @inheritdoc - */ - connect(): void; - } -} -declare namespace samchon.templates.distributed { - /** - * Mediator of Distributed Processing System, be a server and client at the same time as a **master**. - * - * The {@link DistributedServerClientArrayMediator} is an abstract class, derived from the - * {@link DistributedSystemArrayMediator} class, opening a server accepting {@link DistributedSystem distributed - * clients} and being a client connecting to {@link IDistributedServer distributed servers} at the same time. - * - * Extends this {@link DistributedServerClientArrayMediator} and overrides below methods. After the overridings, open - * server with {@link open open()} method and connect to {@link IDistributedServer distributed servers} through the - * {@link connect connect()} method. - * - * - {@link createServerBase createServerBase()} - * - {@link createExternalClient createExternalClient()} - * - {@link createExternalServer createExternalServer()} - * - * #### [Inherited] {@link DistributedSystemArrayMediator} - * The {@link DistributedSystemArrayMediator} class be a master for its slave systems, and be a slave to its master - * system at the same time. This {@link DistributedSystemArrayMediator} be a master system, containing and managing - * {@link DistributedSystem} objects, which represent distributed slave systems, by extending - * {@link DistributedSystemArray} class. Also, be a slave system through {@link getMediator mediator} object, which is - * derived from the {@link SlaveSystem} class. - * - * As a slave, you can specify this {@link DistributedSystemArrayMediator} to be a client slave connecting to master - * server or a server slave accepting master client by overriding the {@link createMediator} method. - * Overrides the {@link createMediator createMediator()} method and return one of them: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * #### [Inherited] {@link DistributedSystemArray} - * The {@link DistributedSystemArray} is an abstract class containing and managing remote distributed **slave** system - * drivers, {@link DistributedSystem} objects. Within framework of network, {@link DistributedSystemArray} represents - * your system, a **Master** of *Distributed Processing System* that requesting *distributed process* to **slave** - * systems and the children {@link DistributedSystem} objects represent the remote **slave** systems, who is being - * requested the *distributed processes*. - * - * The {@link DistributedSystemArray} contains {@link DistributedProcess} objects directly. You can request a - * **distributed process** through the {@link DistributedProcess} object. You can access the - * {@link DistributedProcess} object(s) with those methods: - * - * - {@link hasProcess} - * - {@link getProcess} - * - {@link insertProcess} - * - {@link eraseProcess} - * - {@link getProcessMap} - * - * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the - * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed - * **slave **system. The {@link Invoke} message will be sent to the most idle {@link DistributedSystem} object. When - * the **distributed process** has completed, then {@link DistributedSystem.getPerformance performance index} and - * {@link DistributedProcess.getResource resource index} of related objects will be revaluated. - * - * - * - * - * - * #### Parallel Process - * This {@link DistributedSystemArray} class is derived from the {@link ParallelSystemArray} class, so you can request - * a **parallel process**, too. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices will - * be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * #### Proxy Pattern - * This class {@link DistributedSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link DistributedSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - abstract class DistributedServerClientArrayMediator extends DistributedClientArrayMediator implements external.IExternalServerClientArray { - /** - * Default Constructor. - */ - constructor(); - /** - * Factory method of a child Entity. - * - * This method is migrated to {@link createExternalServer}. Override the {@link createExternalServer} method. - * - * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. - * @return A new child Entity via {@link createExternalServer createExternalServer()}. - */ - createChild(xml: library.XML): System; - /** - * Factory method creating an {@link IDistributedServer} object. - * - * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. - * @return A newly created {@link IDistributedServer} object. - */ - protected abstract createExternalServer(xml: library.XML): System; - /** - * @inheritdoc - */ - connect(): void; - } -} -declare namespace samchon.templates.distributed { - /** - * History of an {@link Invoke} message. - * - * The {@link PRInvokeHistory} is a class archiving history log of an {@link Invoke} message which requests the - * *distributed process*, created whenever {@link DistributedProcess.sendData} is called. - * - * When the *distributed process* has completed, then {@link complete complete()} is called and the *elapsed time* is - * determined. The elapsed time is utilized for computation of {@link DistributedSystem.getPerformance performance index} - * and {@link DistributedProcess.getResource resource index} of related objects. - * - * - * - * - * - * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - class DSInvokeHistory extends protocol.InvokeHistory { - /** - * @hidden - */ - private system_; - /** - * @hidden - */ - private process_; - /** - * @hidden - */ - private weight_; - /** - * Construct from a DistributedSystem. - * - * @param system The {@link DistributedSystem} object who sent the {@link Invoke} message. - */ - constructor(system: DistributedSystem); - /** - * Initilizer Constructor. - * - * @param system The {@link DistributedSystem} object who sent the {@link Invoke} message. - * @param process The {@link DistributedProcess} object who sent the {@link Invoke} message. - * @param invoke An {@link Invoke} message requesting the *distributed process*. - * @param weight Weight of resource which indicates how heavy this {@link Invoke} message is. - */ - constructor(system: DistributedSystem, process: DistributedProcess, invoke: protocol.Invoke, weight: number); - /** - * @inheritdoc - */ - construct(xml: library.XML): void; - /** - * Get the related {@link DistributedSystem} object. - */ - getSystem(): DistributedSystem; - /** - * Get the related {@link DistributedProcess} object. - */ - getProcess(): DistributedProcess; - /** - * Get weight. - * - * Gets weight of resource which indicates how heavy this {@link Invoke} message is. Default is 1. - */ - getWeight(): number; - /** - * @inheritdoc - */ - toXML(): library.XML; - } -} -declare namespace samchon.templates.external { - /** - * An interface for an {@link ExternalSystemArray} accepts {@link ExternalSystem external clients} as a - * {@link IServer server}. - * - * The easiest way to defining an {@link ExternalSystemArray} who opens server and accepts - * {@link ExternalSystem external clients} is to extending one of below, who are derived from this interface - * {@link IExternalClientArray}. However, if you can't specify an {@link ExternalSystemArray} to be whether server or - * client, then make a class (let's name it as **BaseSystemArray**) extending {@link ExternalSystemArray} and make - * a new class (now, I name it **BaseClientArray**) extending **BaseSystemArray** and implementing this - * interface {@link IExternalClientArray}. Define the **BaseClientArray** following those codes on below: - * - * - * - * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) - * @author Jeongho Nam - */ - interface IExternalClientArray extends ExternalSystemArray, protocol.IServer { - } - /** - * An array and manager of {@link ExternalSystem external clients} as a server. - * - * The {@link ExternalClientArray} is an abstract class, derived from the {@link ExternalSystemArray} class, opening - * a server accepting {@link ExternalSystem external clients}. - * - * Extends this {@link ExternalClientArray}, overrides {@link createServerBase createServerBase()} to determine which - * protocol to follow and {@link createExternalClient createExternalClient()} creating child {@link ExternalSystem} - * object. After the extending and overridings, open this server using the {@link open open()} method. - * - * #### [Inherited] {@link ExternalSystemArray} - * The {@link ExternalSystemArray} is an abstract class containing and managing external system drivers, - * {@link ExternalSystem} objects. Within framewokr of network, {@link ExternalSystemArray} represents your system - * and children {@link ExternalSystem} objects represent remote, external systems connected with your system. - * With this {@link ExternalSystemArray}, you can manage multiple external systems as a group. - * - * - * - * - * - * #### Proxy Pattern - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) - * @author Jeongho Nam - */ - abstract class ExternalClientArray extends ExternalSystemArray implements IExternalClientArray { - /** - * @hidden - */ - private server_base_; - /** - * Default Constructor. - */ - constructor(); - /** - * Factory method creating {@link IServerBase} object. - * - * This method {@link createServerBase createServerBase()} determines which templates is used in this server, - * {@link ExternalClientArray}. If the templates is determined, then {@link ExternalSystem external clients} who - * may connect to {@link ExternalClientArray this server} must follow the specified templates. - * - * Creates and returns one of them: - * - * - {@link ServerBase} - * - {@link WebServerBase} - * - {@link SharedWorkerServerBase} - * - * @return A new {@link IServerBase} object. - */ - protected abstract createServerBase(): protocol.IServerBase; - /** - * Add a newly connected remote client. - * - * When a {@link IClientDriver remote client} connects to this *server* {@link ExternalClientArray} object, - * then this {@link ExternalClientArray} creates a child {@link ExternalSystem external client} object through - * the {@link createExternalClient createExternalClient()} method and {@link insert inserts} it. - * - * @param driver A communicator for external client. - */ - addClient(driver: protocol.IClientDriver): void; - /** - * (Deprecated) Factory method creating child object. - * - * The method {@link createChild createChild()} is deprecated. Don't use and override this. - * - * Note that, the {@link ExternalClientArray} is a server accepting {@link ExternalSystem external clients}. - * There's no way to creating the {@link ExternalSystem external clients} in advance before opening the server. - * - * @param xml An {@link XML} object represents the child {@link ExternalSystem} object. - * @return null - */ - createChild(xml: library.XML): T; - /** - * Factory method creating a child {@link ExternalSystem} object. - * - * @param driver A communicator with connected client. - * @return A newly created {@link ExternalSystem} object. - */ - protected abstract createExternalClient(driver: protocol.IClientDriver): T; - /** - * @inheritdoc - */ - open(port: number): void; - /** - * @inheritdoc - */ - close(): void; - } -} -declare namespace samchon.templates.external { - /** - * An interface for an external server driver. - * - * The easiest way to defining an external server driver is to extending one of below, who are derived from this - * interface {@link IExternalServer}. However, if you've to interact with an external system who can be both server - * and client, then make a class (let's name it as **BaseSystem**) extending {@link ExternalSystem} and make a - * new class (now, I name it **BaseServer**) extending **BaseSystem** and implementing this interface - * {@link IExternalServer}. Define the **BaseServer** following those codes on below: - * - * - * - * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) - * @author Jeongho Nam - */ - interface IExternalServer extends ExternalSystem { - /** - * Connect to external server. - */ - connect(): void; - } - /** - * An external server driver. - * - * The {@link ExternalServer} is an abstract class, derived from the {@link ExternalSystem} class, connecting to - * remote, external server. Extends this {@link ExternalServer} class and overrides the - * {@link createServerConnector createServerConnector()} method following which protocol the external server uses. - * - * #### [Inherited] {@link ExternalSystem} - * The {@link ExternalSystem} class represents an external system, connected and interact with this system. - * {@link ExternalSystem} takes full charge of network communication with the remote, external system have connected. - * Replied {@link Invoke} messages from the external system is shifted to and processed in, children elements of this - * class, {@link ExternalSystemRole} objects. - * - * - * - * - * - * #### Bridge & Proxy Pattern - * The {@link ExternalSystem} class can be a *bridge* for *logical proxy*. In framework within user, - * which {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Bridge Pattern* and *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) - * @author Jeongho Nam - */ - abstract class ExternalServer extends ExternalSystem implements IExternalServer { - /** - * IP address of target external system to connect. - */ - protected ip: string; - /** - * Port number of target external system to connect. - */ - protected port: number; - /** - * Construct from parent {@link ExternalSystemArray}. - * - * @param systemArray The parent {@link ExternalSystemArray} object. - */ - constructor(systemArray: ExternalSystemArray); - /** - * Factory method creating {@link IServerConnector} object. - * - * The {@link createServerConnector createServerConnector()} is an abstract method creating - * {@link IServerConnector} object. Overrides and returns one of them, considering which templates the external - * system follows: - * - * - {@link ServerConnector} - * - {@link WebServerConnector} - * - {@link DedicatedWorkerServerConnector} - * - {@link SharedWorkerServerConnector} - * - * @return A newly created {@link IServerConnector} object. - */ - protected abstract createServerConnector(): protocol.IServerConnector; - /** - * @inheritdoc - */ - connect(): void; - } -} -declare namespace samchon.templates.external { - /** - * An interface for an {@link ExternalSystemArray} connects to {@link IExternalServer external servers} as a - * **client**. - * - * The easiest way to defining an {@link ExternalSystemArray} who connects to - * {@link IExternalServer external servers} is to extending one of below, who are derived from this interface - * {@link IExternalServerArray}. However, if you can't specify an {@link ExternalSystemArray} to be whether server or - * client, then make a class (let's name it as **BaseSystemArray**) extending {@link ExternalSystemArray} and make - * a new class (now, I name it **BaseServerArray**) extending **BaseSystemArray** and implementing this - * interface {@link IExternalServerArray}. Define the **BaseServerArray** following those codes on below: - * - * - * - * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) - * @author Jeongho Nam - */ - interface IExternalServerArray extends ExternalSystemArray { - /** - * Connect to {@link IExternalServer external servers}. - * - * This method calls children elements' method {@link IExternalServer.connect} gradually. - */ - connect(): void; - } - /** - * An array and manager of {@link IExternalServer external servers}. - * - * The {@link ExternalServerArray} is an abstract class, derived from the {@link ExternalSystemArray} class, - * connecting to {@link IExternalServer external servers}. - * - * Extends this {@link ExternalServerArray} and overrides {@link createChild createChild()} method creating child - * {@link IExternalServer} object. After the extending and overriding, construct children {@link IExternalServer} - * objects and call the {@link connect connect()} method. - * - * #### [Inherited] {@link ExternalSystemArray} - * The {@link ExternalSystemArray} is an abstract class containing and managing external system drivers, - * {@link ExternalSystem} objects. Within framewokr of network, {@link ExternalSystemArray} represents your system - * and children {@link ExternalSystem} objects represent remote, external systems connected with your system. - * With this {@link ExternalSystemArray}, you can manage multiple external systems as a group. - * - * - * - * - * - * #### Proxy Pattern - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) - * @author Jeongho Nam - */ - abstract class ExternalServerArray extends ExternalSystemArray implements IExternalServerArray { - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - connect(): void; - } -} -declare namespace samchon.templates.external { - /** - * An interface for an {@link ExternalSystemArray} accepts {@link ExternalSystem external clients} as a - * {@link IServer server} and connects to {@link IExternalServer} as **client**, at the same time. - * - * The easiest way to defining an {@link IExternalServerClientArray} who opens server, accepts - * {@link ExternalSystem external clients} and connects to {@link IExternalServer external servers} is to extending - * one of below, who are derived from this interface {@link IExternalServerClientArray}. However, if you can't - * specify an {@link ExternalSystemArray} to be whether server or client or even can both them, then make a class - * (let's name it as **BaseSystemArray**) extending {@link ExternalSystemArray} and make a new class (now, I name - * it **BaseServerClientArray**) extending **BaseSystemArray** and implementing this interface - * {@link IExternalServerClientArray}. Define the **BaseServerClientArray** following those codes on below: - * - * - * - * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) - * @author Jeongho Nam - */ - interface IExternalServerClientArray extends IExternalClientArray { - /** - * Connect to {@link IExternalServer external servers}. - * - * This method calls children elements' method {@link IExternalServer.connect} gradually. - */ - connect(): void; - } - /** - * An array and manager of {@link IExternalServer external servers} and {@link ExternalSystem external clients}. - * - * The {@link ExternalServerClientArray} is an abstract class, derived from the {@link ExternalSystemArray} class, - * opening a server accepting {@link ExternalSystem external clients} and being a client connecting to - * {@link IExternalServer external servers} at the same time. - * - * Extends this {@link ExternalServerClientArray} and overrides below methods. After the overridings, open server - * with {@link open open()} method and connect to {@link IExternalServer external servers} through the - * {@link connect connect()} method. - * - * - {@link createServerBase createServerBase()} - * - {@link createExternalClient createExternalClient()} - * - {@link createExternalServer createExternalServer()} - * - * #### [Inherited] {@link ExternalSystemArray} - * The {@link ExternalSystemArray} is an abstract class containing and managing external system drivers, - * {@link ExternalSystem} objects. Within framewokr of network, {@link ExternalSystemArray} represents your system - * and children {@link ExternalSystem} objects represent remote, external systems connected with your system. - * With this {@link ExternalSystemArray}, you can manage multiple external systems as a group. - * - * - * - * - * - * #### Proxy Pattern - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) - * @author Jeongho Nam - */ - abstract class ExternalServerClientArray extends ExternalClientArray implements IExternalServerClientArray { - /** - * Default Constructor. - */ - constructor(); - /** - * Factory method of a child Entity. - * - * This method is migrated to {@link createExternalServer}. Override the {@link createExternalServer} method. - * - * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. - * @return A new child Entity via {@link createExternalServer createExternalServer()}. - */ - createChild(xml: library.XML): T; - /** - * Factory method creating an {@link IExternalServer} object. - * - * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. - * @return A newly created {@link IExternalServer} object. - */ - protected abstract createExternalServer(xml: library.XML): T; - /** - * @inheritdoc - */ - connect(): void; - } -} -declare namespace samchon.templates.external { - /** - * A role of an external system. - * - * The {@link ExternalSystemRole} class represents a role, *WHAT TO DO*. Extends the {@link ExternalSystemRole} class - * and overrides {@link replyData replyData()} to define the *WHAT TO DO*. And assign this {@link ExternalSystemRole} - * object to related {@link ExternalSystem} object. - * - * - * - * - * - * #### Proxy Pattern - * The {@link ExternalSystemRole} class can be an *logical proxy*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem} object, via {@link ExternalSystemArray.getRole ExternalSystemArray.getRole()}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) - * @author Jeongho Nam - */ - abstract class ExternalSystemRole extends protocol.Entity implements protocol.IProtocol { - /** - * @hidden - */ - private system; - /** - * A name, represents and identifies this {@link ExternalSystemRole role}. - * - * This {@link name} is an identifier represents this {@link ExternalSystemRole role}. This {@link name} is - * used in {@link ExternalSystemArray.getRole} and {@link ExternalSystem.get}, as a key elements. Thus, this - * {@link name} should be unique in an {@link ExternalSystemArray}. - */ - protected name: string; - /** - * Constructor from a system. - * - * @param system An external system containing this role. - */ - constructor(system: ExternalSystem); - /** - * Identifier of {@link ExternalSystemRole} is its {@link name}. - */ - key(): string; - /** - * Get grandparent {@link ExternalSystemArray}. - * - * Get the grandparent {@link ExternalSystemArray} object through this parent {@link ExternalSystem}, - * {@link ExternalSystem.getSystemArray ExternalSystem.getSystemArray()}. - * - * @return The grandparent {@link ExternalSystemArray} object. - */ - getSystemArray(): ExternalSystemArray; - /** - * Get parent {@link ExternalSystemRole} object. - */ - getSystem(): ExternalSystem; - /** - * Get name, who represents and identifies this role. - */ - getName(): string; - /** - * Send an {@link Invoke} message. - * - * Sends an {@link Invoke} message to remote system through the parent {@link ExternalSystem} object. - * - * @param invoke An {@link Invoke} message to send to the external system. - */ - sendData(invoke: protocol.Invoke): void; - /** - * Handle replied {@link Invoke} message. - * - * {@link ExternalSystemRole.replyData ExternalSystemRole.replyData()} is an abstract method handling a replied - * {@link Invoke message} gotten from remote system via parent {@link ExternalSystem} object. Overrides this - * method and defines the *WHAT TO DO* with the {@link Invoke message}. - * - * @param invoke An {@link Invoke} message received from the {@link ExternalSystem external system}. - */ - abstract replyData(invoke: protocol.Invoke): void; - /** - * Tag name of the {@link ExternalSytemRole} in {@link XML}. - * - * @return *role*. - */ - TAG(): string; - } -} -declare namespace samchon.templates.slave { - abstract class SlaveSystem implements protocol.IProtocol { - /** - * @hidden - */ - protected communicator_: protocol.ICommunicator; - /** - * Default Constructor. - */ - constructor(); - sendData(invoke: protocol.Invoke): void; - /** - * @hidden - */ - protected _replyData(invoke: protocol.Invoke): void; - replyData(invoke: protocol.Invoke): void; - } -} -declare namespace samchon.templates.parallel { - /** - * A mediator, the master driver. - * - * The {@link MediatorSystem} is an abstract class helping {@link ParallelSystemArrayMediator} can be a **slave** - * system. The {@link MediatorSystem} interacts and communicates with the **master** system as a role of **slave**. - * - * This {@link MediatorSystem} object is created in {@link ParallelSystemArrayMediator.createMediator}. Override the - * method and return one of them, which are derived from this {@link MediatorSystem} class, considering which - * type and protocol the **master** system follows: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the - * *parallel process* to its parent {@link ParallelSystemArrayMediator} object. The - * {@link ParallelSystemArrayMediator} object distributes the *parallel process* to its slaves system, - * {@link ParallelSystem} objects. When the *parallel process* has completed, then {@link MediatorSystem} reports the - * result to its **master**. - * - * - * - * - * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System), - * [Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - abstract class MediatorSystem extends slave.SlaveSystem { - /** - * @hidden - */ - private system_array_; - /** - * @hidden - */ - private progress_list_; - /** - * Construct from parent {@link ParallelSystemArrayMediator} object. - * - * @param systemArray The parent {@link ParallelSystemArrayMediator} object. - */ - constructor(systemArray: ParallelSystemArrayMediator); - /** - * Construct from parent {@link DistributedSystemArrayMediator} object. - * - * @param systemArray The parent {@link DistributedSystemArrayMediator} object. - */ - constructor(systemArray: distributed.DistributedSystemArrayMediator); - /** - * Start interaction. - * - * The {@link start start()} is an abstract method starting interaction with the **master** system. If the - * **master** is a server, then connects to the **master**. Otherwise, the **master** is client, then this - * {@link MediatorSystem} object wil open a server accepting the **master**. - */ - abstract start(): void; - /** - * Get parent {@link ParallelSystemArrayMediator} or {@link DistributedSystemArrayMediator} object. - */ - getSystemArray(): ParallelSystemArrayMediator | distributed.DistributedSystemArrayMediator; - /** - * Get parent {@link ParallelSystemArrayMediator} object. - */ - getSystemArray>(): SystemArray; - /** - * Get parent {@link DistributedSystemArrayMediator} object. - */ - getSystemArray>(): SystemArray; - /** - * @hidden - */ - private complete_history(uid); - /** - * @hidden - */ - protected _replyData(invoke: protocol.Invoke): void; - /** - * @inheritdoc - */ - replyData(invoke: protocol.Invoke): void; - } -} -declare namespace samchon.templates.parallel { - /** - * A mediator server, driver for the master client. - * - * The {@link MediatorServer} is a class opening a server accepting the **master** client, following the protocol of - * Samchon Framework's own. - * - * #### [Inherited] {@link MediatorSystem} - * The {@link MediatorSystem} is an abstract class helping {@link ParallelSystemArrayMediator} can be a **slave** - * system. The {@link MediatorSystem} interacts and communicates with the **master** system as a role of **slave**. - * - * This {@link MediatorSystem} object is created in {@link ParallelSystemArrayMediator.createMediator}. Override the - * method and return one of them, which are derived from this {@link MediatorSystem} class, considering which - * type and protocol the **master** system follows: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the - * *parallel process* to its parent {@link ParallelSystemArrayMediator} object. The - * {@link ParallelSystemArrayMediator} object distributes the *parallel process* to its slaves system, - * {@link ParallelSystem} objects. When the *parallel process* has completed, then {@link MediatorSystem} reports the - * result to its **master**. - * - * - * - * - * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System), - * [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - class MediatorServer extends MediatorSystem implements slave.ISlaveServer { - /** - * @hidden - */ - private server_base_; - /** - * @hidden - */ - private port; - /** - * Initializer Constructor. - * - * @param systemArray The parent {@link ParallelSystemArrayMediator} object. - * @param port Port number of server to open. - */ - constructor(systemArray: ParallelSystemArrayMediator, port: number); - /** - * Initializer Constructor. - * - * @param systemArray The parent {@link DistributedSystemArrayMediator} object. - * @param port Port number of server to open. - */ - constructor(systemArray: distributed.DistributedSystemArrayMediator, port: number); - /** - * Factory method creating {@link IServerBase} object. - * - * This method {@link createServerBase createServerBase()} determines which protocol is used in this server, - * {@link MediatorServer}. Note that, **slave** (this {@link MediatorServer} object) must follow the **master**'s - * protocol. - * - * Overrides and return one of them considering the which protocol to follow: - * - * - {@link ServerBase} - * - {@link WebServerBase} - * - {@link SharedWorkerServerBase} - */ - protected createServerBase(): protocol.IServerBase; - /** - * Add a newly connected remote client. - * - * {@link MediatorServer} represents a **slave** dedicating to its **master**. In that reason, the - * {@link MediatorServer} does not accept multiple **master** clients. It accepts only one. Thus, *listener* of - * the *communicator* is {@link MediatorSystem} object, itself. - * - * @param driver A communicator with remote client. - */ - addClient(driver: protocol.IClientDriver): void; - /** - * @inheritdoc - */ - start(): void; - /** - * @inheritdoc - */ - open(port: number): void; - /** - * @inheritdoc - */ - close(): void; - } - /** - * A mediator server, driver for the master client. - * - * The {@link MediatorWebServer} is a class opening a server accepting the **master** client, following the - * web-socket protocol. - * - * #### [Inherited] {@link MediatorSystem} - * The {@link MediatorSystem} is an abstract class helping {@link ParallelSystemArrayMediator} can be a **slave** - * system. The {@link MediatorSystem} interacts and communicates with the **master** system as a role of **slave**. - * - * This {@link MediatorSystem} object is created in {@link ParallelSystemArrayMediator.createMediator}. Override the - * method and return one of them, which are derived from this {@link MediatorSystem} class, considering which - * type and protocol the **master** system follows: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the - * *parallel process* to its parent {@link ParallelSystemArrayMediator} object. The - * {@link ParallelSystemArrayMediator} object distributes the *parallel process* to its slaves system, - * {@link ParallelSystem} objects. When the *parallel process* has completed, then {@link MediatorSystem} reports the - * result to its **master**. - * - * - * - * - * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System), - * [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - class MediatorWebServer extends MediatorServer { - /** - * @inheritdoc - */ - protected createServerBase(): protocol.IServerBase; - } - /** - * A mediator server, driver for the master client. - * - * The {@link MediatorDedicatedWorkerServer} is a class opening a server accepting the **master** client, following - * the DedicatedWorker's protocol. - * - * #### [Inherited] {@link MediatorSystem} - * The {@link MediatorSystem} is an abstract class helping {@link ParallelSystemArrayMediator} can be a **slave** - * system. The {@link MediatorSystem} interacts and communicates with the **master** system as a role of **slave**. - * - * This {@link MediatorSystem} object is created in {@link ParallelSystemArrayMediator.createMediator}. Override the - * method and return one of them, which are derived from this {@link MediatorSystem} class, considering which - * type and protocol the **master** system follows: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the - * *parallel process* to its parent {@link ParallelSystemArrayMediator} object. The - * {@link ParallelSystemArrayMediator} object distributes the *parallel process* to its slaves system, - * {@link ParallelSystem} objects. When the *parallel process* has completed, then {@link MediatorSystem} reports the - * result to its **master**. - * - * - * - * - * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System), - * [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - class MediatorDedicatedWorkerServer extends MediatorServer { - /** - * @inheritdoc - */ - protected createServerBase(): protocol.IServerBase; - } - /** - * A mediator server, driver for the master client. - * - * The {@link MediatorSharedWorkerServer} is a class opening a server accepting the **master** client, following the - * SharedWorker's protocol. - * - * #### [Inherited] {@link MediatorSystem} - * The {@link MediatorSystem} is an abstract class helping {@link ParallelSystemArrayMediator} can be a **slave** - * system. The {@link MediatorSystem} interacts and communicates with the **master** system as a role of **slave**. - * - * This {@link MediatorSystem} object is created in {@link ParallelSystemArrayMediator.createMediator}. Override the - * method and return one of them, which are derived from this {@link MediatorSystem} class, considering which - * type and protocol the **master** system follows: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the - * *parallel process* to its parent {@link ParallelSystemArrayMediator} object. The - * {@link ParallelSystemArrayMediator} object distributes the *parallel process* to its slaves system, - * {@link ParallelSystem} objects. When the *parallel process* has completed, then {@link MediatorSystem} reports the - * result to its **master**. - * - * - * - * - * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System), - * [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - class MediatorSharedWorkerServer extends MediatorServer { - /** - * @inheritdoc - */ - protected createServerBase(): protocol.IServerBase; - } -} -declare namespace samchon.templates.parallel { - /** - * A mediator client, driver for the master server. - * - * The {@link MediatorServer} is a class being a client connecting to the **master** server, following the protocol - * of Samchon Framework's own. - * - * #### [Inherited] {@link MediatorSystem} - * The {@link MediatorSystem} is an abstract class helping {@link ParallelSystemArrayMediator} can be a **slave** - * system. The {@link MediatorSystem} interacts and communicates with the **master** system as a role of **slave**. - * - * This {@link MediatorSystem} object is created in {@link ParallelSystemArrayMediator.createMediator}. Override the - * method and return one of them, which are derived from this {@link MediatorSystem} class, considering which - * type and protocol the **master** system follows: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the - * *parallel process* to its parent {@link ParallelSystemArrayMediator} object. The - * {@link ParallelSystemArrayMediator} object distributes the *parallel process* to its slaves system, - * {@link ParallelSystem} objects. When the *parallel process* has completed, then {@link MediatorSystem} reports the - * result to its **master**. - * - * - * - * - * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System), - * [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - class MediatorClient extends MediatorSystem implements slave.ISlaveClient { - /** - * @hidden - */ - private ip; - /** - * @hidden - */ - private port; - /** - * Initializer Constructor. - * - * @param systemArray The parent {@link ParallelSystemArrayMediator} object. - * @param ip IP address to connect. - * @param port Port number to connect. - */ - constructor(systemArray: ParallelSystemArrayMediator, ip: string, port: number); - /** - * Initializer Constructor. - * - * @param systemArray The parent {@link DistributedSystemArrayMediator} object. - * @param ip IP address to connect. - * @param port Port number to connect. - */ - constructor(systemArray: distributed.DistributedSystemArrayMediator, ip: string, port: number); - /** - * Factory method creating {@link IServerConnector} object. - * - * The {@link createServerConnector createServerConnector()} is an abstract method creating - * {@link IServerConnector} object. Overrides and returns one of them, considering which protocol the **master** - * server follows: - * - * - {@link ServerConnector} - * - {@link WebServerConnector} - * - {@link SharedWorkerServerConnector} - * - * @return A newly created {@link IServerConnector} object. - */ - protected createServerConnector(): protocol.IServerConnector; - /** - * @inheritdoc - */ - start(): void; - /** - * @inheritdoc - */ - connect(): void; - } - /** - * A mediator client, driver for the master server. - * - * The {@link MediatorWebClient} is a class being a client connecting to the **master** server, following the - * web-socket protocol. - * - * #### [Inherited] {@link MediatorSystem} - * The {@link MediatorSystem} is an abstract class helping {@link ParallelSystemArrayMediator} can be a **slave** - * system. The {@link MediatorSystem} interacts and communicates with the **master** system as a role of **slave**. - * - * This {@link MediatorSystem} object is created in {@link ParallelSystemArrayMediator.createMediator}. Override the - * method and return one of them, which are derived from this {@link MediatorSystem} class, considering which - * type and protocol the **master** system follows: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the - * *parallel process* to its parent {@link ParallelSystemArrayMediator} object. The - * {@link ParallelSystemArrayMediator} object distributes the *parallel process* to its slaves system, - * {@link ParallelSystem} objects. When the *parallel process* has completed, then {@link MediatorSystem} reports the - * result to its **master**. - * - * - * - * - * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System), - * [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - class MediatorWebClient extends MediatorClient { - /** - * @inheritdoc - */ - protected createServerConnector(): protocol.IServerConnector; - } - /** - * A mediator client, driver for the master server. - * - * The {@link MediatorSharedWorkerClient} is a class being a client connecting to the **master** server, following - * the SharedWorker's protocol. - * - * #### [Inherited] {@link MediatorSystem} - * The {@link MediatorSystem} is an abstract class helping {@link ParallelSystemArrayMediator} can be a **slave** - * system. The {@link MediatorSystem} interacts and communicates with the **master** system as a role of **slave**. - * - * This {@link MediatorSystem} object is created in {@link ParallelSystemArrayMediator.createMediator}. Override the - * method and return one of them, which are derived from this {@link MediatorSystem} class, considering which - * type and protocol the **master** system follows: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the - * *parallel process* to its parent {@link ParallelSystemArrayMediator} object. The - * {@link ParallelSystemArrayMediator} object distributes the *parallel process* to its slaves system, - * {@link ParallelSystem} objects. When the *parallel process* has completed, then {@link MediatorSystem} reports the - * result to its **master**. - * - * - * - * - * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System), - * [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) - * @author Jeongho Nam - */ - class MediatorSharedWorkerClient extends MediatorClient { - /** - * @inheritdoc - */ - protected createServerConnector(): protocol.IServerConnector; - } -} -declare namespace samchon.templates.parallel { - /** - * Master of Parallel Processing System, a server accepting slave clients. - * - * The {@link ParallelClientArray} is an abstract class, derived from the {@link ParallelSystemArray} class, opening - * a server accepting {@link ParallelSystem parallel clients}. - * - * Extends this {@link ParallelClientArray}, overrides {@link createServerBase createServerBase()} to determine which - * protocol to follow and {@link createExternalClient createExternalClient()} creating child {@link ParallelSystem} - * object. After the extending and overridings, open this server using the {@link open open()} method. - * - * #### [Inherited] {@link ParallelSystemArray} - * The {@link ParallelSystemArray} is an abstract class containing and managing remote parallel **slave** system - * drivers, {@link ParallelSystem} objects. Within framework of network, {@link ParallelSystemArray} represents your - * system, a **Master** of *Parallel Processing System* that requesting *parallel process* to slave systems and the - * children {@link ParallelSystem} objects represent the remote slave systems, who is being requested the - * *parallel processes*. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices - * will be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * - * - * - * - * #### Proxy Pattern - * This class {@link ParallelSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link ParallelSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) - * @author Jeongho Nam - */ - abstract class ParallelClientArray extends ParallelSystemArray implements external.IExternalClientArray { - /** - * @hidden - */ - private server_base_; - /** - * Default Constructor. - */ - constructor(); - /** - * Factory method creating {@link IServerBase} object. - * - * This method {@link createServerBase createServerBase()} determines which protocol is used in this server, - * {@link ExternalClientArray}. If the protocol is determined, then {@link ExternalSystem external clients} who - * may connect to {@link ExternalClientArray this server} must follow the specified protocol. - * - * Overrides the {@link createServerBase createServerBase()} method to create and return one of them: - * - * - {@link ServerBase} - * - {@link WebServerBase} - * - {@link SharedWorkerServerBase} - * - * @return A new {@link IServerBase} object. - */ - protected abstract createServerBase(): protocol.IServerBase; - /** - * Add a newly connected remote client. - * - * When a {@link IClientDriver remote client} connects to this *master server of parallel processing system*, - * then this {@link ParallelClientArray} creates a child {@link ParallelSystem parallel client} object through - * the {@link createExternalClient createExternalClient()} method and {@link insert inserts} it. - * - * @param driver A communicator for external client. - */ - addClient(driver: protocol.IClientDriver): void; - /** - * (Deprecated) Factory method creating child object. - * - * The method {@link createChild createChild()} is deprecated. Don't use and override this. - * - * Note that, the {@link ParallelClientArray} is a server accepting {@link ParallelSystem parallel clients}. - * There's no way to creating the {@link ParallelSystem parallel clients} in advance before opening the server. - * - * @param xml An {@link XML} object represents the child {@link ParallelSystem} object. - * @return ```null``` - */ - createChild(xml: library.XML): System; - /** - * Factory method creating {@link ParallelSystem} object. - * - * The method {@link createExternalClient createExternalClient()} is a factory method creating a child - * {@link ParallelSystem} object, that is called whenever a parallel client has connected, by - * {@link addClient addClient()}. - * - * Overrides this {@link createExternalClient} method and creates a type of {@link ParallelSystem} object with - * the *driver* that communicates with the parallel client. After the creation, returns the {@link ParallelSystem} - * object. Then whenever a parallel client has connected, matched {@link ParallelSystem} object will be - * constructed and {@link insert inserted} into this {@link ParallelClientArray} object. - * - * @param driver A communicator with the parallel client. - * @return A newly created {@link ParallelSystem} object. - */ - protected abstract createExternalClient(driver: protocol.IClientDriver): System; - /** - * @inheritdoc - */ - open(port: number): void; - /** - * @inheritdoc - */ - close(): void; - } -} -declare namespace samchon.templates.parallel { - /** - * Mediator of Parallel Processing System. - * - * The {@link ParallelSystemArrayMediator} class be a **master** for its slave systems, and be a **slave** to its - * master system at the same time. This {@link ParallelSystemArrayMediator} be a **master **system, containing and - * managing {@link ParallelSystem} objects, which represent parallel slave systems, by extending - * {@link ParallelSystemArray} class. Also, be a **slave** system through {@link getMediator mediator} object, which is - * derived from the {@link SlaveSystem} class. - * - * As a **master**, you can specify this {@link ParallelSystemArrayMediator} class to be a master server accepting - * slave clients or a master client to connecting slave servers. Even both of them is possible. Extends one - * of them below and overrides abstract factory method(s) creating the child {@link ParallelSystem} object. - * - * - {@link ParallelClientArrayMediator}: A server accepting {@link ParallelSystem parallel clients}. - * - {@link ParallelServerArrayMediator}: A client connecting to {@link ParallelServer parallel servers}. - * - {@link ParallelServerClientArrayMediator}: Both of them. Accepts {@link ParallelSystem parallel clients} and - * connects to {@link ParallelServer parallel servers} at the same time. - * - * As a **slave**, you can specify this {@link ParallelSystemArrayMediator} to be a client slave connecting to - * master server or a server slave accepting master client by overriding the {@link createMediator} method. - * Overrides the {@link createMediator createMediator()} method and return one of them: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * #### [Inherited] {@link ParallelSystemArray} - * The {@link ParallelSystemArray} is an abstract class containing and managing remote parallel **slave** system - * drivers, {@link ParallelSystem} objects. Within framework of network, {@link ParallelSystemArray} represents your - * system, a **Master** of *Parallel Processing System* that requesting *parallel process* to slave systems and the - * children {@link ParallelSystem} objects represent the remote slave systems, who is being requested the - * *parallel processes*. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices - * will be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * - * - * - * - * #### Proxy Pattern - * This class {@link ParallelSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link ParallelSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) - * @author Jeongho Nam - */ - abstract class ParallelSystemArrayMediator extends ParallelSystemArray { - /** - * @hidden - */ - private mediator_; - /** - * Default Constructor. - */ - constructor(); - /** - * Factory method creating a {@link MediatorSystem} object. - * - * The {@link createMediator createMediator()} is an abstract method creating the {@link MediatorSystem} object. - * - * You know what? this {@link ParallelSystemArrayMediator} class be a **master** for its slave systems, and be a - * **slave** to its master system at the same time. The {@link MediatorSystem} object makes it possible; be a - * **slave** system. This {@link createMediator} determines specific type of the {@link MediatorSystem}. - * - * Overrides the {@link createMediator createMediator()} method to create and return one of them following which - * protocol and which type of remote connection (server or client) will be used: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * @return A newly created {@link MediatorSystem} object. - */ - protected abstract createMediator(): MediatorSystem; - /** - * Start mediator. - * - * If the {@link getMediator mediator} is a type of server, then opens the server accepting master client. - * Otherwise, the {@link getMediator mediator} is a type of client, then connects the master server. - */ - protected startMediator(): void; - /** - * Get {@link MediatorSystem} object. - * - * When you need to send an {@link Invoke} message to the master system of this - * {@link ParallelSystemArrayMediator}, then send to the {@link MediatorSystem} through this {@link getMediator}. - * - * ```typescript - * this.getMediator().sendData(...); - * ``` - * - * @return The {@link MediatorSystem} object. - */ - getMediator(): MediatorSystem; - /** - * @hidden - */ - protected _Complete_history(history: PRInvokeHistory): boolean; - } -} -declare namespace samchon.templates.parallel { - /** - * Mediator of Parallel Processing System, a server accepting slave clients. - * - * The {@link ParallelClientArrayMediator} is an abstract class, derived from the {@link ParallelSystemArrayMediator} - * class, opening a server accepting {@link ParallelSystem parallel clients} as a **master**. - * - * Extends this {@link ParallelClientArrayMediator}, overrides {@link createServerBase createServerBase()} to - * determine which protocol to follow and {@link createExternalClient createExternalClient()} creating child - * {@link ParallelSystem} object. After the extending and overridings, open this server using the - * {@link open open()} method. - * - * #### [Inherited] {@link ParallelSystemArrayMediator} - * The {@link ParallelSystemArrayMediator} class be a **master** for its slave systems, and be a **slave** to its - * master system at the same time. This {@link ParallelSystemArrayMediator} be a **master **system, containing and - * managing {@link ParallelSystem} objects, which represent parallel slave systems, by extending - * {@link ParallelSystemArray} class. Also, be a **slave** system through {@link getMediator mediator} object, which is - * derived from the {@link SlaveSystem} class. - * - * As a **slave**, you can specify this {@link ParallelSystemArrayMediator} to be a client slave connecting to - * master server or a server slave accepting master client by overriding the {@link createMediator} method. - * Overrides the {@link createMediator createMediator()} method and return one of them: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * #### [Inherited] {@link ParallelSystemArray} - * The {@link ParallelSystemArray} is an abstract class containing and managing remote parallel **slave** system - * drivers, {@link ParallelSystem} objects. Within framework of network, {@link ParallelSystemArray} represents your - * system, a **Master** of *Parallel Processing System* that requesting *parallel process* to slave systems and the - * children {@link ParallelSystem} objects represent the remote slave systems, who is being requested the - * *parallel processes*. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices - * will be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * - * - * - * - * #### Proxy Pattern - * This class {@link ParallelSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link ParallelSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) - * @author Jeongho Nam - */ - abstract class ParallelClientArrayMediator extends ParallelSystemArrayMediator implements external.IExternalClientArray { - /** - * @hidden - */ - private server_base_; - /** - * Default Constructor. - */ - constructor(); - /** - * Factory method creating {@link IServerBase} object. - * - * This method {@link createServerBase createServerBase()} determines which protocol is used in this server, - * {@link ParallelClientArrayMediator}. If the protocol is determined, then - * {@link ParallelSystem parallel clients} who may connect to {@link ParallelClientArrayMediator this server} - * must follow the specified protocol. - * - * Overrides the {@link createServerBase createServerBase()} method to create and return one of them: - * - * - {@link ServerBase} - * - {@link WebServerBase} - * - {@link SharedWorkerServerBase} - * - * @return A new {@link IServerBase} object. - */ - protected abstract createServerBase(): protocol.IServerBase; - /** - * Add a newly connected remote client. - * - * When a {@link IClientDriver remote client} connects to this *master server of parallel processing system*, - * then this {@link ParallelClientArrayMediator} creates a child {@link ParallelSystem parallel client} object - * through the {@link createExternalClient createExternalClient()} method and {@link insert inserts} it. - * - * @param driver A communicator for parallel client. - */ - addClient(driver: protocol.IClientDriver): void; - /** - * (Deprecated) Factory method creating child object. - * - * The method {@link createChild createChild()} is deprecated. Don't use and override this. - * - * Note that, the {@link ParallelClientArrayMediator} is a server accepting {@link ParallelSystem parallel - * clients} as a master. There's no way to creating the {@link ParallelSystem parallel clients} in advance before - * opening the server. - * - * @param xml An {@link XML} object represents the child {@link ParallelSystem} object. - * @return null - */ - createChild(xml: library.XML): System; - /** - * Factory method creating {@link ParallelSystem} object. - * - * The method {@link createExternalClient createExternalClient()} is a factory method creating a child - * {@link ParallelSystem} object, that is called whenever a parallel client has connected, by - * {@link addClient addClient()}. - * - * Overrides this {@link createExternalClient} method and creates a type of {@link ParallelSystem} object with - * the *driver* that communicates with the parallel client. After the creation, returns the {@link ParallelSystem} - * object. Then whenever a parallel client has connected, matched {@link ParallelSystem} object will be - * constructed and {@link insert inserted} into this {@link ParallelClientArrayMediator} object. - * - * @param driver A communicator with the parallel client. - * @return A newly created {@link ParallelSystem} object. - */ - protected abstract createExternalClient(driver: protocol.IClientDriver): System; - /** - * @inheritdoc - */ - open(port: number): void; - /** - * @inheritdoc - */ - close(): void; - } -} -declare namespace samchon.templates.parallel { - /** - * An interface for a parallel slave server driver. - * - * The easiest way to defining a driver for parallel **slave** server is extending {@link ParallelServer} class. - * However, if you've to interact with a prallel **slave** system who can be both server and client, them make a class - * (let's name it **BaseSystem**) extending the {@link ParallelSystem} class. At next, make a new class (now, I name it - * **BaseServer**) extending the **BaseSystem** and implements this interface {@link IParallelServer}. Define the - * **BaseServer** following those codes on below: - * - * - * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) - * @author Jeongho Nam - */ - interface IParallelServer extends ParallelSystem { - /** - * Connect to slave server. - */ - connect(): void; - } - /** - * A driver for parallel slave server. - * - * The {@link ParallelServer} is an abstract class, derived from the {@link ParallelSystem} class, connecting to - * remote, parallel **slave** server. Extends this {@link ParallelServer} class and overrides the - * {@link createServerConnector createServerConnector()} method following which protocol the **slave** server uses. - * - * #### [Inherited] {@link ParallelSystem} - * The {@link ParallelSystem} is an abstract class represents a **slave** system in *Parallel Processing System*, - * connected with this **master** system. This {@link ParallelSystem} takes full charge of network communication with - * the remote, parallel **slave** system has connected. - * - * When a *parallel process* is requested (by {@link ParallelSystemArray.sendSegmentData} or - * {@link ParallelSystemArray.sendPieceData}), the number of pieces to be allocated to a {@link ParallelSystem} is - * turn on its {@link getPerformance performance index}. Higher {@link getPerformance performance index}, then - * more pieces are requested. The {@link getPerformance performance index} is revaluated whenever a *parallel process* - * has completed, basic on the execution time and number of pieces. You can sugguest or enforce the - * {@link getPerformance performance index} with {@link setPerformance} or {@link enforcePerformance}. - * - * - * - * - * - * #### Bridge & Proxy Pattern - * This class {@link ParallelSystem} is derived from the {@link ExternalSystem} class. Thus, you can take advantage - * of the *Bridge & Proxy Pattern* in this {@link ParallelSystem} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Bridge & Proxy Pattern*: - * - * The {@link ExternalSystem} class can be a *bridge* for *logical proxy*. In framework within user, - * which {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Bridge Pattern* and *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) - * @author Jeongho Nam - */ - abstract class ParallelServer extends ParallelSystem implements IParallelServer { - /** - * IP address of target external system to connect. - */ - protected ip: string; - /** - * Port number of target external system to connect. - */ - protected port: number; - /** - * Construct from parent {@link ParallelSystemArray}. - * - * @param systemArray The parent {@link ParallelSystemArray} object. - */ - constructor(systemArray: ParallelSystemArray); - /** - * Factory method creating {@link IServerConnector} object. - * - * The {@link createServerConnector createServerConnector()} is an abstract method creating - * {@link IServerConnector} object. Overrides and returns one of them, considering which protocol the slave server - * follows: - * - * - {@link ServerConnector} - * - {@link WebServerConnector} - * - {@link DedicatedWorkerServerConnector} - * - {@link SharedWorkerServerConnector} - * - * @return A newly created {@link IServerConnector} object. - */ - protected abstract createServerConnector(): protocol.IServerConnector; - /** - * @inheritdoc - */ - connect(): void; - } -} -declare namespace samchon.templates.parallel { - /** - * Master of Parallel Processing System, a client connecting to slave servers. - * - * The {@link ParallelServerArray} is an abstract class, derived from the {@link ParallelSystemArray} class, - * connecting to {@link IParallelServer parallel servers}. - * - * Extends this {@link ParallelServerArray} and overrides {@link createChild createChild()} method creating child - * {@link IParallelServer} object. After the extending and overriding, construct children {@link IParallelServer} - * objects and call the {@link connect connect()} method. - * - * #### [Inherited] {@link ParallelSystemArray} - * The {@link ParallelSystemArray} is an abstract class containing and managing remote parallel **slave** system - * drivers, {@link ParallelSystem} objects. Within framework of network, {@link ParallelSystemArray} represents your - * system, a **Master** of *Parallel Processing System* that requesting *parallel process* to slave systems and the - * children {@link ParallelSystem} objects represent the remote slave systems, who is being requested the - * *parallel processes*. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices - * will be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * - * - * - * - * #### Proxy Pattern - * This class {@link ParallelSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link ParallelSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) - * @author Jeongho Nam - */ - abstract class ParallelServerArray extends ParallelSystemArray implements external.IExternalServerArray { - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - connect(): void; - } -} -declare namespace samchon.templates.parallel { - /** - * Mediator of Parallel Processing System, a client connecting to slave servers. - * - * The {@link ParallelServerArrayMediator} is an abstract class, derived from the {@link ParallelSystemArrayMediator} - * class, connecting to {@link IParallelServer parallel servers}. - * - * Extends this {@link ParallelServerArrayMediator} and overrides {@link createChild createChild()} method creating - * child {@link IParallelServer} object. After the extending and overriding, construct children - * {@link IParallelServer} objects and call the {@link connect connect()} method. - * - * #### [Inherited] {@link ParallelSystemArrayMediator} - * The {@link ParallelSystemArrayMediator} class be a **master** for its slave systems, and be a **slave** to its - * master system at the same time. This {@link ParallelSystemArrayMediator} be a **master **system, containing and - * managing {@link ParallelSystem} objects, which represent parallel slave systems, by extending - * {@link ParallelSystemArray} class. Also, be a **slave** system through {@link getMediator mediator} object, which is - * derived from the {@link SlaveSystem} class. - * - * As a **master**, you can specify this {@link ParallelSystemArrayMediator} class to be a master server accepting - * slave clients or a master client to connecting slave servers. Even both of them is possible. Extends one - * of them below and overrides abstract factory method(s) creating the child {@link ParallelSystem} object. - * - * - {@link ParallelClientArrayMediator}: A server accepting {@link ParallelSystem parallel clients}. - * - {@link ParallelServerArrayMediator}: A client connecting to {@link ParallelServer parallel servers}. - * - {@link ParallelServerClientArrayMediator}: Both of them. Accepts {@link ParallelSystem parallel clients} and - * connects to {@link ParallelServer parallel servers} at the same time. - * - * As a **slave**, you can specify this {@link ParallelSystemArrayMediator} to be a client slave connecting to - * master server or a server slave accepting master client by overriding the {@link createMediator} method. - * Overrides the {@link createMediator createMediator()} method and return one of them: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * #### [Inherited] {@link ParallelSystemArray} - * The {@link ParallelSystemArray} is an abstract class containing and managing remote parallel **slave** system - * drivers, {@link ParallelSystem} objects. Within framework of network, {@link ParallelSystemArray} represents your - * system, a **Master** of *Parallel Processing System* that requesting *parallel process* to slave systems and the - * children {@link ParallelSystem} objects represent the remote slave systems, who is being requested the - * *parallel processes*. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices - * will be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * - * - * - * - * #### Proxy Pattern - * This class {@link ParallelSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link ParallelSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) - * @author Jeongho Nam - */ - abstract class ParallelServerArrayMediator extends ParallelSystemArrayMediator implements external.IExternalServerArray { - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - connect(): void; - } -} -declare namespace samchon.templates.parallel { - /** - * Master of Parallel Processing System, be a server and client at the same time. - * - * The {@link ParallelServerClientArray} is an abstract class, derived from the {@link ParallelSystemArray} class, - * opening a server accepting {@link ParallelSystem parallel clients} and being a client connecting to - * {@link IParallelServer parallel servers} at the same time. - * - * Extends this {@link ParallelServerClientArray} and overrides below methods. After the overridings, open server - * with {@link open open()} method and connect to {@link IParallelServer parallel servers} through the - * {@link connect connect()} method. - * - * - {@link createServerBase createServerBase()} - * - {@link createExternalClient createExternalClient()} - * - {@link createExternalServer createExternalServer()} - * - * #### [Inherited] {@link ParallelSystemArray} - * The {@link ParallelSystemArray} is an abstract class containing and managing remote parallel **slave** system - * drivers, {@link ParallelSystem} objects. Within framework of network, {@link ParallelSystemArray} represents your - * system, a **Master** of *Parallel Processing System* that requesting *parallel process* to slave systems and the - * children {@link ParallelSystem} objects represent the remote slave systems, who is being requested the - * *parallel processes*. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices - * will be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * - * - * - * - * #### Proxy Pattern - * This class {@link ParallelSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link ParallelSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) - * @author Jeongho Nam - */ - abstract class ParallelServerClientArray extends ParallelClientArray implements external.IExternalServerClientArray { - /** - * Default Constructor. - */ - constructor(); - /** - * Factory method of a child Entity. - * - * This method is migrated to {@link createExternalServer}. Override the {@link createExternalServer} method. - * - * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. - * @return A new child Entity via {@link createExternalServer createExternalServer()}. - */ - createChild(xml: library.XML): System; - /** - * Factory method creating an {@link IParallelServer} object. - * - * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. - * @return A newly created {@link IParallelServer} object. - */ - protected abstract createExternalServer(xml: library.XML): System; - /** - * @inheritdoc - */ - connect(): void; - } -} -declare namespace samchon.templates.parallel { - /** - * Mediator of Parallel Processing System, be a server and client at the same time as a **master**. - * - * The {@link ParallelServerClientArrayMediator} is an abstract class, derived from the - * {@link ParallelSystemArrayMediator} class, opening a server accepting {@link ParallelSystem parallel clients} and - * being a client connecting to {@link IParallelServer parallel servers} at the same time. - * - * Extends this {@link ParallelServerClientArrayMediator} and overrides below methods. After the overridings, open - * server with {@link open open()} method and connect to {@link IParallelServer parallel servers} through the - * {@link connect connect()} method. - * - * - {@link createServerBase createServerBase()} - * - {@link createExternalClient createExternalClient()} - * - {@link createExternalServer createExternalServer()} - * - * #### [Inherited] {@link ParallelSystemArrayMediator} - * The {@link ParallelSystemArrayMediator} class be a **master** for its slave systems, and be a **slave** to its - * master system at the same time. This {@link ParallelSystemArrayMediator} be a **master **system, containing and - * managing {@link ParallelSystem} objects, which represent parallel slave systems, by extending - * {@link ParallelSystemArray} class. Also, be a **slave** system through {@link getMediator mediator} object, which is - * derived from the {@link SlaveSystem} class. - * - * As a **master**, you can specify this {@link ParallelSystemArrayMediator} class to be a master server accepting - * slave clients or a master client to connecting slave servers. Even both of them is possible. Extends one - * of them below and overrides abstract factory method(s) creating the child {@link ParallelSystem} object. - * - * - {@link ParallelClientArrayMediator}: A server accepting {@link ParallelSystem parallel clients}. - * - {@link ParallelServerArrayMediator}: A client connecting to {@link ParallelServer parallel servers}. - * - {@link ParallelServerClientArrayMediator}: Both of them. Accepts {@link ParallelSystem parallel clients} and - * connects to {@link ParallelServer parallel servers} at the same time. - * - * As a **slave**, you can specify this {@link ParallelSystemArrayMediator} to be a client slave connecting to - * master server or a server slave accepting master client by overriding the {@link createMediator} method. - * Overrides the {@link createMediator createMediator()} method and return one of them: - * - * - A client slave connecting to master server: - * - {@link MediatorClient} - * - {@link MediatorWebClient} - * - {@link MediatorSharedWorkerClient} - * - A server slave accepting master client: - * - {@link MediatorServer} - * - {@link MediatorWebServer} - * - {@link MediatorDedicatedWorkerServer} - * - {@link MediatorSharedWorkerServer} - * - * #### [Inherited] {@link ParallelSystemArray} - * The {@link ParallelSystemArray} is an abstract class containing and managing remote parallel **slave** system - * drivers, {@link ParallelSystem} objects. Within framework of network, {@link ParallelSystemArray} represents your - * system, a **Master** of *Parallel Processing System* that requesting *parallel process* to slave systems and the - * children {@link ParallelSystem} objects represent the remote slave systems, who is being requested the - * *parallel processes*. - * - * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. - * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s - * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices - * will be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. - * - * - * - * - * - * #### Proxy Pattern - * This class {@link ParallelSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take - * advantage of the *Proxy Pattern* in the {@link ParallelSystemArray} class. If a process to request is not the - * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it - * may better to utilizing the *Proxy Pattern*: - * - * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which - * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not - * important. Only interested in user's perspective is *which can be done*. - * - * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged - * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. - * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. - * - *
    - *
  • - * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring - * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. - *
  • - *
  • - * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call - * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the - * external system. - *
  • - *
  • Those strategy is called *Proxy Pattern*.
  • - *
- * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) - * @author Jeongho Nam - */ - abstract class ParallelServerClientArrayMediator extends ParallelClientArrayMediator implements external.IExternalServerClientArray { - /** - * Default Constructor. - */ - constructor(); - /** - * Factory method of a child Entity. - * - * This method is migrated to {@link createExternalServer}. Override the {@link createExternalServer} method. - * - * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. - * @return A new child Entity via {@link createExternalServer createExternalServer()}. - */ - createChild(xml: library.XML): System; - /** - * Factory method creating an {@link IParallelServer} object. - * - * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. - * @return A newly created {@link IParallelServer} object. - */ - protected abstract createExternalServer(xml: library.XML): System; - /** - * @inheritdoc - */ - connect(): void; - } -} -declare namespace samchon.templates.parallel { - /** - * History of an {@link Invoke} message. - * - * The {@link PRInvokeHistory} is a class archiving history log of an {@link Invoke} message which requests the - * *parallel process*, created whenever {@link ParallelSystemArray.sendSegmentData} or - * {@link ParallelSystemArray.sendSegmentData} is called. - * - * When the *parallel process* has completed, then {@link complete complete()} is called and the *elapsed time* is - * determined. The elapsed time is utilized for computation of {@link ParallelSystem.getPerformance performance index} - * of each {@link ParallelSystem parallel slave system}. - * - * - * - * - * - * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) - * @author Jeongho Nam - */ - class PRInvokeHistory extends protocol.InvokeHistory { - /** - * @hidden - */ - private first; - /** - * @hidden - */ - private last; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from an {@link Invoke} message. - * - * @param invoke An {@link Invoke} message requesting a *parallel process*. - */ - constructor(invoke: protocol.Invoke); - /** - * Get initial piece's index. - * - * Returns initial piece's index in the section of requested *parallel process*. - * - * @return The initial index. - */ - getFirst(): number; - /** - * Get final piece's index. - * - * Returns initial piece's index in the section of requested *parallel process*. The range used is - * [*first*, *last*), which contains all the pieces' indices between *first* and *last*, including the piece - * pointed by index *first*, but not the piece pointed by the index *last*. - * - * @return The final index. - */ - getLast(): number; - /** - * Compute number of allocated pieces. - */ - computeSize(): number; - } -} -declare namespace samchon.templates.service { - /** - * A driver of remote client. - * - * The {@link Client} is an abstract class representing and interacting with a remote client. It deals the network - * communication with the remote client and shifts {@link Invoke} message to related {@link User} and {@link Service} - * objects. - * - * Extends this {@link Client} class and override the {@link createService} method, a factory method creating a child - * {@link Service} object. Note that, {@link Client} represents a remote client, not *an user*, a specific *web page* - * or *service*. Do not define logics about user or account information. It must be declared in the parent - * {@link User} class. Also, don't define processes of a specific a web page or service. Defines them in the child - * {@link Service} class. - * - * - * - * - * - * @handbook [Templates - Cloud Service](https://github.com/samchon/framework/wiki/TypeScript-Templates-Cloud_Service) - * @author Jeongho Nam - */ - abstract class Client implements protocol.IProtocol { - /** - * @hidden - */ - private user_; - /** - * @hidden - */ - private no_; - /** - * @hidden - */ - private communicator_; - /** - * @hidden - */ - private service_; - /** - * Construct from parent {@link User} and communicator. - * - * @param user Parent {@link User} object. - * @param driver Communicator with remote client. - */ - constructor(user: User, driver: protocol.WebClientDriver); - /** - * Default Destructor. - * - * This {@link destructor destructor()} method is called when the {@link Client} object is destructed and this - * {@link Client} object is destructed when connection with the remote client is closed or this {@link Client} - * object is {@link User.erase erased} from its parent {@link User} object. - * - * Note that, don't call this {@link destructor destructor()} method by yourself. It must be called automatically - * by those *destruction* cases. Also, if your derived {@link Client} class has something to do on the - * *destruction*, then overrides this {@link destructor destructor()} method and defines the something to do. - * Overriding this {@link destructor destructor()}, don't forget to calling ```super.destructor();``` on tail. - * - * ```typescript - * class MyUser extends protocol.service.Client - * { - * protected destructor(): void - * { - * // DO SOMETHING - * this.do_something(); - * - * // CALL SUPER.DESTRUCTOR() ON TAIL. DON'T FORGET THIS - * super.destructor(); - * } - * } - * ``` - */ - protected destructor(): void; - /** - * Factory method creating {@link Service} object. - * - * @param path Requested path. - * @return A newly created {@link Service} object or ```null```. - */ - protected abstract createService(path: string): Service; - /** - * Close connection. - */ - close(): void; - /** - * Get parent {@link User} object. - * - * Get the parent {@link User} object, who is groupping {@link Client} objects with same session id. - * - * @return The parent {@link User} object. - */ - getUser(): User; - /** - * Get child {@link Service} object. - * - * @return The child {@link Service} object. - */ - getService(): Service; - /** - * Get sequence number. - * - * Get sequence number of this {@link Client} object in the parent {@link User} object. This sequence number also - * be a *key* in the parent {@link User} object, who extended the ```std.HashMap```. - * - * @return Sequence number. - */ - getNo(): number; - /** - * Change related {@link Service} object. - * - * @param path Requested, identifier path. - */ - protected changeService(path: string): void; - /** - * Change {@link Service} to another. - * - * @param service {@link service} object to newly assigned. - */ - protected changeService(service: Service): void; - /** - * Send an {@link Invoke} message. - * - * Sends an {@link Invoke} message to remote client. - * - * @param invoke An {@link Invoke} messgae to send to remote client. - */ - sendData(invoke: protocol.Invoke): void; - /** - * Handle a replied {@link Invoke} message. - * - * The default {@link Client.replyData Client.replyData()} shifts chain to its parent {@link User} and belonged - * {@link Service} objects, by calling the the {@link User.replyData User.replyData()} and - * {@link Service.replyData Service.replyData()} methods. - * - * Note that, {@link Client} represents a remote client, not *an user*, a specific *web page* or *service*. Do not - * define logics about user or account information. It must be declared in the parent {@link User} class. Also, - * don't define processes of a specific a web page or service. Defines them in the child {@link Service} class. - * - * ```typescript - * class protocol.service.Client - * { - * public replyData(invoke: protocol.Invoke): void - * { - * // SHIFT TO PARENT USER - * // THE PARENT USER ALSO MAY SHIFT TO ITS PARENT SERVER - * this.getUser().replyData(invoke); - * - * // SHIFT TO BELOGED SERVICE - * if (this.getService() != null) - * this.getService().replyData(invoke); - * } - * } - * - * class MyClient extends protocol.service.Client - * { - * public replyData(invoke: protocol.Invoke): void - * { - * if (invoke.getListener() == "do_something_in_client_level") - * this.do_something_in_client_level(); - * else - * super.replyData(invoke); - * } - * } - * ``` - * - * @param invoke An {@link Invoke invoke} message to be handled in {@link Client} level. - */ - replyData(invoke: protocol.Invoke): void; - } -} -/** - * A system template for Cloud Service. - * - * @handbook [Templates - Cloud Service](https://github.com/samchon/framework/wiki/TypeScript-Templates-Cloud_Service) - * @author Jeongho Nam - */ -declare namespace samchon.templates.service { - /** - * A cloud server. - * - * The {@link Server} is an abstract server class, who can build a real-time cloud server, that is following the - * web-socket protocol. Extends this {@link Server} and related classes and overrides abstract methods under below. - * After the overridings, open this {@link Server cloud server} using the {@link open open()} method. - * - * - Objects in composite relationship and their factory methods - * - {@link User}: {@link Server.createUser Server.createUser()} - * - {@link Client}: {@link User.createClient User.createClient()} - * - {@link Service}: {@link Client.createService Client.createService()} - * - {@link Invoke} message chains; {@link IProtocol.replyData replyData} - * - {@link Server.replyData} - * - {@link User.replyData} - * - {@link Client.replyData} - * - {@link Service.replyData} - * - * - * - * - * - * @handbook [Templates - Cloud Service](https://github.com/samchon/framework/wiki/TypeScript-Templates-Cloud_Service) - * @author Jeongho Nam - */ - abstract class Server extends protocol.WebServer implements protocol.IProtocol { - /** - * @hidden - */ - private session_map_; - /** - * @hidden - */ - private account_map_; - /** - * Default Constructor. - */ - constructor(); - /** - * Factory method creating {@link User} object. - * - * @return A newly created {@link User} object. - */ - protected abstract createUser(): User; - /** - * Test wheter an {@link User} exists with the *accountID*. - * - * @param accountID Account id of {@link User} to find. - * @return Exists or not. - */ - has(accountID: string): boolean; - /** - * Get an {@link User} object by its *accountID*. - * - * @param accountID Account id of {@link User} to get. - * @return An {@link User} object. - */ - get(accountID: string): User; - /** - * Send an {@link Invoke} message. - * - * Sends an {@link Invoke} message to all remote clients through the belonged {@link User} and {@link Client} - * objects. Sending the {@link Invoke} message to all remote clients, it's came true by passing through - * {@link User.sendData User.sendData()}. And the {@link User.sendData} also pass through the - * {@link Client.sendData Client.sendData()}. - * - * ```typescript - * class protocol.service.Server - * { - * public sendData(invoke: Invoke): void - * { - * for (user: User in this) - * for (client: Client in user) - * client.sendData(invoke); - * } - * } - * ``` - * - * @param invoke {@link Invoke} message to send to all remote clients. - */ - sendData(invoke: protocol.Invoke): void; - /** - * Handle a replied {@link Invoke} message. - * - * The {@link Server.replyData Server.replyData()} is an abstract method that handling {@link Invoke} message - * that should be handled in the {@link Server} level. Overrides this {@link replyData replyData()} method and - * defines what to do with the {@link Invoke} message in this {@link Server} level. - * - * @param invoke An {@link Invoke invoke} message to be handled in {@link Server} level. - */ - abstract replyData(invoke: protocol.Invoke): void; - /** - * Add a newly connected remote client. - * - * When a {@link WebClientDriver remote client} connects to this cloud server, then {@link Server} queries the - * {WebClientDriver.getSessionID session id} of the {@link WebClientDriver remote client}. If the - * {WebClientDriver.getSessionID session id} is new one, then creates a new {@link User} object. - * - * At next, creates a {@link Client} object who represents the newly connected remote client and insert the - * {@link Client} object to the matched {@link User} object which is new or ordinary one following the - * {WebClientDriver.getSessionID session id}. At last, a {@link Service} object can be created with referencing - * the {@link WebClientDriver.getPath path}. - * - * List of objects can be created by this method. - * - {@link User} by {@link createUser createUser()}. - * - {@link Client} by {@link User.createClient User.createClient()}. - * - {@link Service} by {@link Client.createService Client.createService()}. - * - * @param driver A web communicator for remote client. - */ - addClient(driver: protocol.WebClientDriver): void; - /** - * @hidden - */ - private erase_user(user); - } -} -declare namespace samchon.templates.service { - /** - * A service. - * - * The {@link Service} is an abstract class who represents a service, that is providing functions a specific page. - * - * Extends the {@link Service} class and defines its own service, which to be provided for the specific weg page, - * by overriding the {@link replyData replyData()} method. Note that, the service, functions for the specific page - * should be defined in this {@link Service} class, not its parent {@link Client} class who represents a remote client - * and takes communication responsibility. - * - * - * - * - * - * @handbook [Templates - Cloud Service](https://github.com/samchon/framework/wiki/TypeScript-Templates-Cloud_Service) - * @author Jeongho Nam - */ - abstract class Service implements protocol.IProtocol { - /** - * @hidden - */ - private client_; - /** - * @hidden - */ - private path_; - /** - * Construct from parent {@link Client} and requested path. - * - * @param client Driver of remote client. - * @param path Requested path that identifies this {@link Service}. - */ - constructor(client: Client, path: string); - /** - * Default Destructor. - * - * This {@link destructor destructor()} method is call when the {@link Service} object is destructed and the - * {@link Service} object is destructed when its parent {@link Client} object has - * {@link Client.destructor destructed} or the {@link Client} object {@link Client.changeService changed} its - * child {@link Service service} object to another one. - * - * Note that, don't call this {@link destructor destructor()} method by yourself. It must be called automatically - * by those *destruction* cases. Also, if your derived {@link Service} class has something to do on the - * *destruction*, then overrides this {@link destructor destructor()} method and defines the something to do. - */ - protected destructor(): void; - /** - * Get client. - */ - getClient(): Client; - /** - * Get requested path. - */ - getPath(): string; - /** - * Send an {@link Invoke} message. - * - * Sends an {@link Invoke} message to remote system through parent {@link Client} object ({@link Client.sendData}). - * - * @param invoke An {@link Invoke} message to send to the remte system. - */ - sendData(invoke: protocol.Invoke): void; - /** - * @inheritdoc - */ - abstract replyData(invoke: protocol.Invoke): void; - } -} -declare namespace samchon.templates.service { - /** - * An user. - * - * The {@link User} is an abstract class groupping {@link Client} objects, who communicates with remote client, with - * same *session id*. This {@link User} represents a *remote user* literally. Within framework of remote system, - * an {@link User} corresponds to a web-browser and a {@link Client} represents a window in the web-browser. - * - * Extends this {@link User} class and override the {@link createClient} method, a factory method creating a child - * {@link Client} object. I repeat, the {@link User} class represents a *remote user*, groupping {@link Client} - * objects with same *session id*. If your cloud server has some processes to be handled in the **user level**, then - * defines method in this {@link User} class. Methods managing **account** under below are some of them: - * - * - {@link setAccount setAccount()} - * - {@link getAccountID getAccountID()} - * - {@link getAuthority getAuthority()} - * - * The children {@link Client} objects, they're contained with their key, the {@link Client.getNo sequence number}. - * If you {@link User.erase erase} the children {@link Client} object by yourself, then their connection with the - * remote clients will be {@link Client.close closed} and their {@link Client.destructor destruction method} will be - * called. If you remove {@link clear all children}, then this {@link User} object will be also - * {@link destructor destructed} and erased from the parent {@link Server} object. - * - * - * - * - * - * @handbook [Templates - Cloud Service](https://github.com/samchon/framework/wiki/TypeScript-Templates-Cloud_Service) - * @author Jeongho Nam - */ - abstract class User extends collections.HashMapCollection implements protocol.IProtocol { - /** - * @hidden - */ - private server_; - /** - * @hidden - */ - private session_id_; - /** - * @hidden - */ - private sequence_; - /** - * @hidden - */ - private account_id_; - /** - * @hidden - */ - private authority_; - /** - * Construct from its parent {@link Server}. - * - * @param server The parent {@link Server} object. - */ - constructor(server: Server); - /** - * Default Destructor. - * - * This {@link destructor destructor()} method is called when the {@link User} object is destructed. The - * {@link User} object is destructed when connections with the remote clients are all closed, that is all the - * children {@link Client} objects are all removed, and 30 seconds has left. If some remote client connects - * within the 30 seconds, then the {@link User} object doesn't be destructed. - * - * Note that, don't call this {@link destructor destructor()} method by yourself. It must be called automatically - * by those *destruction* cases. Also, if your derived {@link User} class has something to do on the - * *destruction*, then overrides this {@link destructor destructor()} method and defines the something to do. - * Overriding this {@link destructor destructor()}, don't forget to calling ```super.destructor();``` on tail. - * - * ```typescript - * class MyUser extends protocol.service.User - * { - * protected destructor(): void - * { - * // DO SOMETHING - * this.do_something(); - * - * // CALL SUPER.DESTRUCTOR() ON TAIL. DON'T FORGET THIS - * super.destructor(); - * } - * } - * ``` - */ - protected destructor(): void; - /** - * Factory method creating a {@link Client} object. - * - * @param driver A web communicator for remote client. - * @return A newly created {@link Client} object. - */ - protected abstract createClient(driver: protocol.WebClientDriver): Client; - /** - * @hidden - */ - private handle_erase_client(event); - /** - * Get parent {@lin Server} object. - * - * @return Parent {@link Server} object. - */ - getServer(): Server; - /** - * Get account id. - * - * @return Account ID. - */ - getAccountID(): string; - /** - * Get authority. - * - * @return Authority - */ - getAuthority(): number; - /** - * Set *account id* and *authority*. - * - * The {@link setAccount setAccount()} is a method configuring *account id* and *authority* of this {@link User}. - * - * After the configuring, the {@link getAccountID account id} is enrolled into the parent {@link Server} as a - * **key** for this {@link User} object. You can test existence and access this {@link User} object from - * {@link Server.has Server.has()} and {@link Server.get Server.get()} with the {@link getAccountID account id}. - * Of course, if ordinary {@link getAccountID account id} had existed, then the ordinary **key** will be - * replaced. - * - * As you suggest, this {@link setAccount setAccount()} is something like a **log-in** function. If what you want - * is not **logging-in**, but **logging-out**, then configure the *account id* to empty string ``""```` or call - * the {@link lgout logout()} method. - * - * @param id To be account id. - * @param authority To be authority. - */ - setAccount(id: string, authority: number): void; - /** - * Log-out. - * - * This {@link logout logout()} method configures {@link getAccountID account id} to empty string and - * {@link getAuthority authority} to zero. - * - * The ordinary {@link getAccountID account id} will be also erased from the parent {@link Server} object. You - * can't access this {@link User} object from {@link Server.has Server.has()} and {@link Server.get Server.get()} - * with the ordinary {@link getAccountID account id} more. - */ - logout(): void; - /** - * Send an {@link Invoke} message. - * - * Sends an {@link Invoke} message to all remote clients through the belonged {@link Client} objects. Sending the - * {@link Invoke} message to all remote clients, it's came true by passing through the - * {@link Client.sendData Client.sendData()} methods. - * - * ```typescript - * class protocol.service.User - * { - * public sendData(invoke: Invoke): void - * { - * for (let it = this.begin(); !it.equal_to(this.end()); it = it.next()) - * it.second.sendData(invoke); - * } - * } - * ``` - * - * @param invoke {@link Invoke} message to send to all remote clients. - */ - sendData(invoke: protocol.Invoke): void; - /** - * Handle a replied {@link Invoke} message. - * - * The default {@link User.replyData User.replyData()} shifts chain to its parent {@link Server} object, by - * calling the {@link Server.replyData Server.replyData()} method. If there're some {@link Invoke} message to be - * handled in this {@link User} level, then override this method and defines what to do with the {@link Invoke} - * message in this {@link User} level. - * - * ```typescript - * class protocol.service.User - * { - * public replyData(invoke: protocol.Invoke): void - * { - * this.getServer().replyData(invoke); - * } - * } - * - * class MyUser extends protocol.service.User - * { - * public replyData(invoke: protocol.Invoke): void - * { - * if (invoke.apply(this) == false) // IS TARGET TO BE HANDLED IN THIS USER LEVEL - * super.replyData(invoke); // SHIFT TO SERVER - * } - * } - * ``` - * - * @param invoke An {@link Invoke invoke} message to be handled in {@link User} level. - */ - replyData(invoke: protocol.Invoke): void; - } -} -declare namespace samchon.templates.slave { - interface ISlaveClient extends SlaveSystem { - connect(ip: string, port: number): void; - } - abstract class SlaveClient extends SlaveSystem implements ISlaveClient { - /** - * Default Constructor. - */ - constructor(); - /** - * @inheritdoc - */ - protected abstract createServerConnector(): protocol.IServerConnector; - /** - * @inheritdoc - */ - connect(ip: string, port: number): void; - } -} -declare namespace samchon.templates.slave { - interface ISlaveServer extends SlaveSystem, protocol.IServer { - } - abstract class SlaveServer extends SlaveSystem implements ISlaveServer { - private server_base_; - constructor(); - protected abstract createServerBase(): protocol.IServerBase; - open(port: number): void; - close(): void; - addClient(driver: protocol.IClientDriver): void; - } -} +} \ No newline at end of file diff --git a/samchon/index.d.ts b/samchon/index.d.ts new file mode 100644 index 0000000000..6f2bc17b43 --- /dev/null +++ b/samchon/index.d.ts @@ -0,0 +1,8403 @@ +// Type definitions for Samchon Framework v2.0.7 +// Project: https://github.com/samchon/framework +// Definitions by: Jeongho Nam +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "samchon" +{ + export = samchon; +} + +/** + * # Samchon Framework + * + * + * + * + * Samchon, a OON (Object-Oriented Network) framework. + * + * With Samchon Framework, you can implement distributed processing system within framework of OOD like handling S/W + * objects (classes). You can realize cloud and distributed system very easily with provided system templates and even + * integration with C++ is possible. + * + * The goal, ultimate utilization model of Samchon Framework is, building cloud system with NodeJS and taking heavy works + * to C++ distributed systems with provided modules (those are system templates). + * + * @git https://github.com/samchon/framework + * @author Jeongho Nam + */ +declare namespace samchon { +} +declare namespace samchon.collections { + /** + * A {@link Vector} who can detect element I/O events. + * + * Below is the list of methods who are dispatching {@link CollectionEvent}: + * - *insert* typed events: + * - {@link assign} + * - {@link insert} + * - {@link push} + * - {@link push_back} + * - *erase* typed events: + * - {@link assign} + * - {@link clear} + * - {@link erase} + * - {@link pop_back} + * - *refresh* typed events: + * - {@link refresh} + * + * #### [Inherited] {@link Vector} + * @copydoc Vector + */ + class ArrayCollection extends std.Vector implements ICollection { + /** + * @hidden + */ + private event_dispatcher_; + /** + * @inheritdoc + */ + push(...items: T[]): number; + /** + * @inheritdoc + */ + push_back(val: T): void; + /** + * @hidden + */ + protected _Insert_by_range>(position: std.VectorIterator, begin: InputIterator, end: InputIterator): std.VectorIterator; + /** + * @hidden + */ + protected _Erase_by_range(first: std.VectorIterator, last: std.VectorIterator): std.VectorIterator; + /** + * @hidden + */ + private _Notify_insert(first, last); + /** + * @hidden + */ + private _Notify_erase(first, last); + /** + * @inheritdoc + */ + hasEventListener(type: string): boolean; + /** + * @inheritdoc + */ + dispatchEvent(event: library.BasicEvent): boolean; + /** + * @inheritdoc + */ + refresh(): void; + /** + * @inheritdoc + */ + refresh(it: std.VectorIterator): void; + /** + * @inheritdoc + */ + refresh(first: std.VectorIterator, last: std.VectorIterator): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: CollectionEventListener): void; + addEventListener(type: "erase", listener: CollectionEventListener): void; + addEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: CollectionEventListener): void; + removeEventListener(type: "erase", listener: CollectionEventListener): void; + removeEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + } +} +declare namespace samchon.library { + /** + * A basic event class of Samchon Framework. + * + * @reference https://developer.mozilla.org/en-US/docs/Web/API/Event + * @handbook https://github.com/samchon/framework/wiki/TypeScript-Library-EventDispatcher + * @author Jeongho Nam + */ + class BasicEvent { + protected type_: string; + protected target_: IEventDispatcher; + private currentTarget_; + protected trusted_: boolean; + protected bubbles_: boolean; + protected cancelable_: boolean; + protected defaultPrevented_: boolean; + protected cancelBubble_: boolean; + private timeStamp_; + constructor(type: string, bubbles?: boolean, cancelable?: boolean); + /** + * @inheritdoc + */ + initEvent(type: string, bubbles: boolean, cancelable: boolean): void; + /** + * @inheritdoc + */ + /** + * @inheritdoc + */ + stopImmediatePropagation(): void; + /** + * @inheritdoc + */ + stopPropagation(): void; + /** + * @inheritdoc + */ + readonly type: string; + /** + * @inheritdoc + */ + target: IEventDispatcher; + /** + * @inheritdoc + */ + readonly currentTarget: IEventDispatcher; + /** + * @inheritdoc + */ + readonly bubbles: boolean; + /** + * @inheritdoc + */ + readonly cancelable: boolean; + /** + * @inheritdoc + */ + readonly eventPhase: number; + /** + * @inheritdoc + */ + readonly defaultPrevented: boolean; + /** + * @inheritdoc + */ + readonly srcElement: Element; + /** + * @inheritdoc + */ + readonly cancelBubble: boolean; + /** + * @inheritdoc + */ + readonly timeStamp: number; + /** + * Don't know what it is. + */ + readonly returnValue: boolean; + } +} +declare namespace samchon.collections { + /** + * Type of function pointer for listener of {@link CollectionEvent CollectionEvents}. + */ + type CollectionEventListener = (event: CollectionEvent) => void; +} +declare namespace samchon.collections { + /** + * An event occured in a {@link ICollection collection} object. + * + * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) + * @author Jeongho Nam + */ + class CollectionEvent extends library.BasicEvent { + /** + * @hidden + */ + private first_; + /** + * @hidden + */ + private last_; + /** + * @hidden + */ + private temporary_container_; + /** + * @hidden + */ + private origin_first_; + /** + * Initialization Constructor. + * + * @param type Type of collection event. + * @param first An {@link Iterator} to the initial position in this {@link CollectionEvent}. + * @param last An {@link Iterator} to the final position in this {@link CollectionEvent}. + */ + constructor(type: string, first: std.Iterator, last: std.Iterator); + constructor(type: "insert", first: std.Iterator, last: std.Iterator); + constructor(type: "erase", first: std.Iterator, last: std.Iterator); + constructor(type: "refresh", first: std.Iterator, last: std.Iterator); + /** + * Associative target, the {@link ICollection collection}. + */ + readonly target: ICollection; + /** + * An {@link Iterator} to the initial position in this {@link CollectionEvent}. + */ + readonly first: std.Iterator; + /** + * An {@link Iterator} to the final position in this {@link CollectionEvent}. + */ + readonly last: std.Iterator; + /** + * @inheritdoc + */ + preventDefault(): void; + } +} +declare namespace samchon.collections.CollectionEvent { + const INSERT: "insert"; + const ERASE: "erase"; + const REFRESH: "refresh"; +} +declare namespace samchon.collections { + /** + * A {@link Deque} who can detect element I/O events. + * + * Below is the list of methods who are dispatching {@link CollectionEvent}: + * - *insert* typed events: + * - {@link assign} + * - {@link insert} + * - {@link push} + * - {@link push_front} + * - {@link push_back} + * - *erase* typed events: + * - {@link assign} + * - {@link clear} + * - {@link erase} + * - {@link pop_front} + * - {@link pop_back} + * - *refresh* typed events: + * - {@link refresh} + * + * #### [Inherited] {@link Deque} + * @copydoc Deque + */ + class DequeCollection extends std.Deque implements ICollection { + /** + * @hidden + */ + private event_dispatcher_; + /** + * @inheritdoc + */ + push_front(val: T): void; + /** + * @inheritdoc + */ + push_back(val: T): void; + /** + * @hidden + */ + protected _Insert_by_range>(position: std.DequeIterator, begin: InputIterator, end: InputIterator): std.DequeIterator; + /** + * @inheritdoc + */ + pop_front(): void; + /** + * @inheritdoc + */ + pop_back(): void; + /** + * @hidden + */ + protected _Erase_by_range(first: std.DequeIterator, last: std.DequeIterator): std.DequeIterator; + /** + * @hidden + */ + private _Notify_insert(first, last); + /** + * @hidden + */ + private _Notify_erase(first, last); + /** + * @inheritdoc + */ + hasEventListener(type: string): boolean; + /** + * @inheritdoc + */ + dispatchEvent(event: library.BasicEvent): boolean; + /** + * @inheritdoc + */ + refresh(): void; + /** + * @inheritdoc + */ + refresh(it: std.DequeIterator): void; + /** + * @inheritdoc + */ + refresh(first: std.DequeIterator, last: std.DequeIterator): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: CollectionEventListener): void; + addEventListener(type: "erase", listener: CollectionEventListener): void; + addEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: CollectionEventListener): void; + removeEventListener(type: "erase", listener: CollectionEventListener): void; + removeEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + } +} +declare namespace samchon.collections { + /** + * A {@link HashMap} who can detect element I/O events. + * + * Below is the list of methods who are dispatching {@link MapCollectionEvent}: + * - *insert* typed events: + * - {@link assign} + * - {@link insert} + * - {@link insert_or_assign} + * - {@link emplace} + * - {@link set} + * - {@link push} + * - *erase* typed events: + * - {@link assign} + * - {@link clear} + * - {@link erase} + * - {@link extract} + * - *refresh* typed events: + * - {@link refresh} + * + * #### [Inherited] {@link HashMap} + * @copydoc HashMap + */ + class HashMapCollection extends std.HashMap implements ICollection> { + /** + * @hidden + */ + private event_dispatcher_; + /** + * @hidden + */ + protected _Handle_insert(first: std.MapIterator, last: std.MapIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: std.MapIterator, last: std.MapIterator): void; + /** + * @inheritdoc + */ + hasEventListener(type: string): boolean; + /** + * @inheritdoc + */ + dispatchEvent(event: library.BasicEvent): boolean; + /** + * @inheritdoc + */ + refresh(): void; + /** + * @inheritdoc + */ + refresh(it: std.MapIterator): void; + /** + * @inheritdoc + */ + refresh(first: std.MapIterator, last: std.MapIterator): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: MapCollectionEventListener): void; + addEventListener(type: "erase", listener: MapCollectionEventListener): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; + } +} +declare namespace samchon.collections { + /** + * A {@link HashMultiMap} who can detect element I/O events. + * + * Below is the list of methods who are dispatching {@link MapCollectionEvent}: + * - *insert* typed events: + * - {@link assign} + * - {@link insert} + * - {@link emplace} + * - {@link push} + * - *erase* typed events: + * - {@link assign} + * - {@link clear} + * - {@link erase} + * - *refresh* typed events: + * - {@link refresh} + * + * #### [Inherited] {@link HashMultiMap} + * @copydoc HashMultiMap + */ + class HashMultiMapCollection extends std.HashMultiMap implements ICollection> { + /** + * @hidden + */ + private event_dispatcher_; + /** + * @hidden + */ + protected _Handle_insert(first: std.MapIterator, last: std.MapIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: std.MapIterator, last: std.MapIterator): void; + /** + * @inheritdoc + */ + hasEventListener(type: string): boolean; + /** + * @inheritdoc + */ + dispatchEvent(event: library.BasicEvent): boolean; + /** + * @inheritdoc + */ + refresh(): void; + /** + * @inheritdoc + */ + refresh(it: std.MapIterator): void; + /** + * @inheritdoc + */ + refresh(first: std.MapIterator, last: std.MapIterator): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: MapCollectionEventListener): void; + addEventListener(type: "erase", listener: MapCollectionEventListener): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; + } +} +declare namespace samchon.collections { + /** + * A {@link HashMultiSet} who can detect element I/O events. + * + * Below is the list of methods who are dispatching {@link CollectionEvent}: + * - *insert* typed events: + * - {@link assign} + * - {@link insert} + * - {@link push} + * - *erase* typed events: + * - {@link assign} + * - {@link clear} + * - {@link erase} + * - *refresh* typed events: + * - {@link refresh} + * + * #### [Inherited] {@link HashMultiSet} + * @copydoc HashMultiSet + */ + class HashMultiSetCollection extends std.HashMultiSet implements ICollection { + /** + * @hidden + */ + private event_dispatcher_; + /** + * @hidden + */ + protected _Handle_insert(first: std.SetIterator, last: std.SetIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: std.SetIterator, last: std.SetIterator): void; + /** + * @inheritdoc + */ + hasEventListener(type: string): boolean; + /** + * @inheritdoc + */ + dispatchEvent(event: library.BasicEvent): boolean; + /** + * @inheritdoc + */ + refresh(): void; + /** + * @inheritdoc + */ + refresh(it: std.SetIterator): void; + /** + * @inheritdoc + */ + refresh(first: std.SetIterator, last: std.SetIterator): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: CollectionEventListener): void; + addEventListener(type: "erase", listener: CollectionEventListener): void; + addEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: CollectionEventListener): void; + removeEventListener(type: "erase", listener: CollectionEventListener): void; + removeEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + } +} +declare namespace samchon.collections { + /** + * A {@link HashSet} who can detect element I/O events. + * + * Below is the list of methods who are dispatching {@link CollectionEvent}: + * - *insert* typed events: + * - {@link assign} + * - {@link insert} + * - {@link push} + * - {@link insert_or_assign} + * - *erase* typed events: + * - {@link assign} + * - {@link clear} + * - {@link erase} + * - {@link extract} + * - *refresh* typed events: + * - {@link refresh} + * + * #### [Inherited] {@link HashSet} + * @copydoc HashSet + */ + class HashSetCollection extends std.HashSet implements ICollection { + /** + * @hidden + */ + private event_dispatcher_; + /** + * @hidden + */ + protected _Handle_insert(first: std.SetIterator, last: std.SetIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: std.SetIterator, last: std.SetIterator): void; + /** + * @inheritdoc + */ + hasEventListener(type: string): boolean; + /** + * @inheritdoc + */ + dispatchEvent(event: library.BasicEvent): boolean; + /** + * @inheritdoc + */ + refresh(): void; + /** + * @inheritdoc + */ + refresh(it: std.SetIterator): void; + /** + * @inheritdoc + */ + refresh(first: std.SetIterator, last: std.SetIterator): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: CollectionEventListener): void; + addEventListener(type: "erase", listener: CollectionEventListener): void; + addEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: CollectionEventListener): void; + removeEventListener(type: "erase", listener: CollectionEventListener): void; + removeEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + } +} +/** + * Collections, elements I/O detectable STL containers. + * + * STL Containers | Collections + * ---------------------|------------------- + * {@link Vector} | {@link ArrayCollection} + * {@link List} | {@link ListCollection} + * {@link Deque} | {@link DequeCollection} + * | + * {@link TreeSet} | {@link TreeSetCollection} + * {@link HashSet} | {@link HashSetCollection} + * {@link TreeMultiSet} | {@link TreeMultiSetCollection} + * {@link HashMultiSet} | {@link HashMultiSetCollection} + * | + * {@link TreeMap} | {@link TreeMapCollection} + * {@link HashMap} | {@link HashMapCollection} + * {@link TreeMultiMap} | {@link TreeMultiMapCollection} + * {@link HashMultiMap} | {@link HashMultiMapCollection} + * + * @author Jeongho Nam + */ +declare namespace samchon.collections { + /** + * An interface for {@link IContainer containers} who can detect element I/O events. + * + * Below are list of methods who are dispatching {@link CollectionEvent}: + * - *insert* typed events: + * - {@link assign} + * - {@link insert} + * - {@link push} + * - *erase* typed events: + * - {@link assign} + * - {@link clear} + * - {@link erase} + * - *refresh* typed events: + * - {@link refresh} + * + * @author Jeongho Nam + */ + interface ICollection extends std.base.Container, library.IEventDispatcher { + /** + * Dispatch a {@link CollectionEvent} with *refresh* typed. + * + * {@link ICollection} dispatches {@link CollectionEvent} typed *insert* or *erase* whenever elements I/O has + * occured. However, unlike those elements I/O events, content change in element level can't be detected. + * There's no way to detect those events automatically by {@link IContainer}. + * + * If you want to dispatch those typed events (notifying change on contents in element level), you've to + * dispatch *refresh* typed event manually, by yourself. Call {@link refresh refresh()} with specified + * iterators who're pointing the elements whose content have changed. Then a {@link CollectionEvent} with + * *refresh* typed will be dispatched. + * + * If you don't specify any iterator, then the range of the *refresh* event will be all elements in this + * {@link ICollection collection}; {@link begin begin()} to {@link end end()}. + */ + refresh(): void; + /** + * Dispatch a {@link CollectionEvent} with *refresh* typed. + * + * {@link ICollection} dispatches {@link CollectionEvent} typed *insert* or *erase* whenever elements I/O has + * occured. However, unlike those elements I/O events, content change in element level can't be detected. + * There's no way to detect those events automatically by {@link IContainer}. + * + * If you want to dispatch those typed events (notifying change on contents in element level), you've to + * dispatch *refresh* typed event manually, by yourself. Call {@link refresh refresh()} with specified + * iterators who're pointing the elements whose content have changed. Then a {@link CollectionEvent} with + * *refresh* typed will be dispatched. + * + * @param it An iterator targeting the content changed element. + */ + refresh(it: std.Iterator): void; + /** + * Dispatch a {@link CollectionEvent} with *refresh* typed. + * + * {@link ICollection} dispatches {@link CollectionEvent} typed *insert* or *erase* whenever elements I/O has + * occured. However, unlike those elements I/O events, content change in element level can't be detected. + * There's no way to detect those events automatically by {@link IContainer}. + * + * If you want to dispatch those typed events (notifying change on contents in element level), you've to + * dispatch *refresh* typed event manually, by yourself. Call {@link refresh refresh()} with specified + * iterators who're pointing the elements whose content have changed. Then a {@link CollectionEvent} with + * *refresh* typed will be dispatched. + * + * @param first An Iterator to the initial position in a sequence of the content changed elmeents. + * @param last An {@link Iterator} to the final position in a sequence of the content changed elements. The range + * used is [*first*, *last*), which contains all the elements between *first* and + * *last*, including the element pointed by *first* but not the element pointed by + * *last*. + */ + refresh(first: std.Iterator, last: std.Iterator): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: CollectionEventListener): void; + addEventListener(type: "erase", listener: CollectionEventListener): void; + addEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: CollectionEventListener): void; + removeEventListener(type: "erase", listener: CollectionEventListener): void; + removeEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + } + /** + * @hidden + */ + namespace ICollection { + /** + * @hidden + */ + function _Dispatch_CollectionEvent(collection: ICollection, type: string, first: std.Iterator, last: std.Iterator): void; + /** + * @hidden + */ + function _Dispatch_MapCollectionEvent(collection: ICollection>, type: string, first: std.MapIterator, last: std.MapIterator): void; + } +} +declare namespace samchon.collections { + /** + * A {@link List} who can detect element I/O events. + * + * Below is the list of methods who are dispatching {@link CollectionEvent}: + * - *insert* typed events: + * - {@link assign} + * - {@link insert} + * - {@link push} + * - {@link push_front} + * - {@link push_back} + * - {@link merge} + * - *erase* typed events: + * - {@link assign} + * - {@link clear} + * - {@link erase} + * - {@link pop_front} + * - {@link pop_back} + * - {@link unique} + * - {@link remove} + * - {@link remove_if} + * - {@link splice} + * - *refresh* typed events: + * - {@link refresh} + * - {@link sort} + * + * #### [Inherited] {@link List} + * @copydoc List + */ + class ListCollection extends std.List implements ICollection { + /** + * @hidden + */ + private event_dispatcher_; + /** + * @hidden + */ + protected _Insert_by_range>(position: std.ListIterator, begin: InputIterator, end: InputIterator): std.ListIterator; + /** + * @hidden + */ + protected _Erase_by_range(first: std.ListIterator, last: std.ListIterator): std.ListIterator; + /** + * @hidden + */ + private _Notify_insert(first, last); + /** + * @hidden + */ + private _Notify_erase(first, last); + /** + * @inheritdoc + */ + hasEventListener(type: string): boolean; + /** + * @inheritdoc + */ + dispatchEvent(event: library.BasicEvent): boolean; + /** + * @inheritdoc + */ + refresh(): void; + /** + * @inheritdoc + */ + refresh(it: std.ListIterator): void; + /** + * @inheritdoc + */ + refresh(first: std.ListIterator, last: std.ListIterator): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: CollectionEventListener): void; + addEventListener(type: "erase", listener: CollectionEventListener): void; + addEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: CollectionEventListener): void; + removeEventListener(type: "erase", listener: CollectionEventListener): void; + removeEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + } +} +declare namespace samchon.collections { + type MapCollectionEventListener = (event: MapCollectionEvent) => void; + /** + * An event occured in a {@link MapContainer map container} object. + * + * @handbook [Collections](https://github.com/samchon/framework/wiki/TypeScript-STL#collections) + * @author Jeongho Nam + */ + class MapCollectionEvent extends CollectionEvent> { + /** + * @inheritdoc + */ + readonly first: std.MapIterator; + /** + * @inheritdoc + */ + readonly last: std.MapIterator; + } +} +declare namespace samchon.collections { + /** + * A {@link TreeMap} who can detect element I/O events. + * + * Below is the list of methods who are dispatching {@link MapCollectionEvent}: + * - *insert* typed events: + * - {@link assign} + * - {@link insert} + * - {@link insert_or_assign} + * - {@link emplace} + * - {@link set} + * - {@link push} + * - *erase* typed events: + * - {@link assign} + * - {@link clear} + * - {@link erase} + * - {@link extract} + * - *refresh* typed events: + * - {@link refresh} + * + * #### [Inherited] {@link TreeMap} + * @copydoc TreeMap + */ + class TreeMapCollection extends std.TreeMap implements ICollection> { + /** + * @hidden + */ + private event_dispatcher_; + /** + * @hidden + */ + protected _Handle_insert(first: std.MapIterator, last: std.MapIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: std.MapIterator, last: std.MapIterator): void; + /** + * @inheritdoc + */ + hasEventListener(type: string): boolean; + /** + * @inheritdoc + */ + dispatchEvent(event: library.BasicEvent): boolean; + /** + * @inheritdoc + */ + refresh(): void; + /** + * @inheritdoc + */ + refresh(it: std.MapIterator): void; + /** + * @inheritdoc + */ + refresh(first: std.MapIterator, last: std.MapIterator): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: MapCollectionEventListener): void; + addEventListener(type: "erase", listener: MapCollectionEventListener): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; + } +} +declare namespace samchon.collections { + /** + * A {@link TreeMultiMap} who can detect element I/O events. + * + * Below is the list of methods who are dispatching {@link MapCollectionEvent}: + * - *insert* typed events: + * - {@link assign} + * - {@link insert} + * - {@link emplace} + * - {@link push} + * - *erase* typed events: + * - {@link assign} + * - {@link clear} + * - {@link erase} + * - *refresh* typed events: + * - {@link refresh} + * + * #### [Inherited] {@link TreeMultiMap} + * @copydoc TreeMultiMap + */ + class TreeMultiMapCollection extends std.TreeMultiMap implements ICollection> { + /** + * @hidden + */ + private event_dispatcher_; + /** + * @hidden + */ + protected _Handle_insert(first: std.MapIterator, last: std.MapIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: std.MapIterator, last: std.MapIterator): void; + /** + * @inheritdoc + */ + hasEventListener(type: string): boolean; + /** + * @inheritdoc + */ + dispatchEvent(event: library.BasicEvent): boolean; + /** + * @inheritdoc + */ + refresh(): void; + /** + * @inheritdoc + */ + refresh(it: std.MapIterator): void; + /** + * @inheritdoc + */ + refresh(first: std.MapIterator, last: std.MapIterator): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: MapCollectionEventListener): void; + addEventListener(type: "erase", listener: MapCollectionEventListener): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: MapCollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: MapCollectionEventListener, thisArg: Object): void; + } +} +declare namespace samchon.collections { + /** + * A {@link TreeMultiSet} who can detect element I/O events. + * + * Below is the list of methods who are dispatching {@link CollectionEvent}: + * - *insert* typed events: + * - {@link assign} + * - {@link insert} + * - {@link push} + * - *erase* typed events: + * - {@link assign} + * - {@link clear} + * - {@link erase} + * - *refresh* typed events: + * - {@link refresh} + * + * #### [Inherited] {@link TreeMultiSet} + * @copydoc TreeMultiSet + */ + class TreeMultiSetCollection extends std.TreeMultiSet implements ICollection { + /** + * @hidden + */ + private event_dispatcher_; + /** + * @hidden + */ + protected _Handle_insert(first: std.SetIterator, last: std.SetIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: std.SetIterator, last: std.SetIterator): void; + /** + * @inheritdoc + */ + hasEventListener(type: string): boolean; + /** + * @inheritdoc + */ + dispatchEvent(event: library.BasicEvent): boolean; + /** + * @inheritdoc + */ + refresh(): void; + /** + * @inheritdoc + */ + refresh(it: std.SetIterator): void; + /** + * @inheritdoc + */ + refresh(first: std.SetIterator, last: std.SetIterator): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: CollectionEventListener): void; + addEventListener(type: "erase", listener: CollectionEventListener): void; + addEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: CollectionEventListener): void; + removeEventListener(type: "erase", listener: CollectionEventListener): void; + removeEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + } +} +declare namespace samchon.collections { + /** + * A {@link TreeMap} who can detect element I/O events. + * + * Below is the list of methods who are dispatching {@link CollectionEvent}: + * - *insert* typed events: + * - {@link assign} + * - {@link insert} + * - {@link insert_or_assign} + * - {@link push} + * - *erase* typed events: + * - {@link assign} + * - {@link clear}7 + * - {@link erase} + * - {@link extract} + * - *refresh* typed events: + * - {@link refresh} + * + * #### [Inherited] {@link TreeSet} + * @copydoc TreeSet + */ + class TreeSetCollection extends std.TreeSet implements ICollection { + /** + * @hidden + */ + private event_dispatcher_; + /** + * @hidden + */ + protected _Handle_insert(first: std.SetIterator, last: std.SetIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: std.SetIterator, last: std.SetIterator): void; + /** + * @inheritdoc + */ + hasEventListener(type: string): boolean; + /** + * @inheritdoc + */ + dispatchEvent(event: library.BasicEvent): boolean; + /** + * @inheritdoc + */ + refresh(): void; + /** + * @inheritdoc + */ + refresh(it: std.SetIterator): void; + /** + * @inheritdoc + */ + refresh(first: std.SetIterator, last: std.SetIterator): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener): void; + addEventListener(type: "insert", listener: CollectionEventListener): void; + addEventListener(type: "erase", listener: CollectionEventListener): void; + addEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + addEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + addEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener): void; + removeEventListener(type: "insert", listener: CollectionEventListener): void; + removeEventListener(type: "erase", listener: CollectionEventListener): void; + removeEventListener(type: "refresh", listener: CollectionEventListener): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + removeEventListener(type: "insert", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "erase", listener: CollectionEventListener, thisArg: Object): void; + removeEventListener(type: "refresh", listener: CollectionEventListener, thisArg: Object): void; + } +} +declare namespace samchon.library { + /** + * Case generator. + * + * {@link CaseGenerator} is an abstract case generator being used like a matrix. + *
    + *
  • n��r(n^r) -> {@link CombinedPermutationGenerator}
  • + *
  • nPr -> {@link PermutationGenerator}
  • + *
  • n! -> {@link FactorialGenerator}
  • + *
+ * + * @author Jeongho Nam + */ + abstract class CaseGenerator { + /** + * Size, the number of all cases. + */ + protected size_: number; + /** + * N, size of the candidates. + */ + protected n_: number; + /** + * R, size of elements of each case. + */ + protected r_: number; + /** + * Construct from size of N and R. + * + * @param n Size of candidates. + * @param r Size of elements of each case. + */ + constructor(n: number, r: number); + /** + * Get size of all cases. + * + * @return Get a number of the all cases. + */ + size(): number; + /** + * Get size of the N. + */ + n(): number; + /** + * Get size of the R. + */ + r(): number; + /** + * Get index'th case. + * + * @param index Index number + * @return The row of the index'th in combined permuation case + */ + abstract at(index: number): number[]; + } + /** + * A combined-permutation case generator. + * + * n��r + * + * @author Jeongho Nam + */ + class CombinedPermutationGenerator extends CaseGenerator { + /** + * An array using for dividing each element index. + */ + private divider_array; + /** + * Construct from size of N and R. + * + * @param n Size of candidates. + * @param r Size of elements of each case. + */ + constructor(n: number, r: number); + at(index: number): number[]; + } + /** + * A permutation case generator. + * + * nPr + * + * @author Jeongho Nam + */ + class PermuationGenerator extends CaseGenerator { + /** + * Construct from size of N and R. + * + * @param n Size of candidates. + * @param r Size of elements of each case. + */ + constructor(n: number, r: number); + /** + * @inheritdoc + */ + at(index: number): number[]; + } + /** + * Factorial case generator. + * + * n! = nPn + * + * @author Jeongho Nam + */ + class FactorialGenerator extends PermuationGenerator { + /** + * Construct from factorial size N. + * + * @param n Factoria size N. + */ + constructor(n: number); + } +} +declare namespace samchon.library { + type BasicEventListener = (event: BasicEvent) => void; + /** + * The IEventDispatcher interface defines methods for adding or removing event listeners, checks whether specific + * types of event listeners are registered, and dispatches events. + * + * The event target serves as the local point for how events flow through the display list hierarchy. When an + * event such as a mouse click or a key press occurs, an event object is dispatched into the event flow from the + * root of the display list. The event object makes a round-trip journey to the event target, which is + * conceptually divided into three phases: the capture phase includes the journey from the root to the last node + * before the event target's node; the target phase includes only the event target node; and the bubbling phase + * includes any subsequent nodes encountered on the return trip to the root of the display list. + * + * In general, the easiest way for a user-defined class to gain event dispatching capabilities is to extend + * {@link EventDispatcher}. If this is impossible (that is, if the class is already extending another class), you + * can instead implement the {@link IEventDispatcher} interface, create an {@link EventDispatcher} member, and + * write simple hooks to route calls into the aggregated {@link EventDispatcher}. + * + * @reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/IEventDispatcher.html + * @handbook https://github.com/samchon/framework/wiki/TypeScript-Library-EventDispatcher + * @author Migrated by Jeongho Nam + */ + interface IEventDispatcher { + /** + * Checks whether the {@link EventDispatcher} object has any listeners registered for a specific type of event. + * This allows you to determine where an {@link EventDispatcher} object has altered handling of an event type + * in the event flow hierarchy. To determine whether a specific event type actually triggers an event listener, + * use {@link willTrigger willTrigger()}. + * + * The difference between {@link hasEventListener hasEventListener()} and {@link willTrigger willTrigger()} is + * that {@link hasEventListener} examines only the object to which it belongs, whereas {@link willTrigger} + * examines the entire event flow for the event specified by the type parameter. + * + * @param type The type of event. + */ + hasEventListener(type: string): boolean; + /** + * Dispatches an event into the event flow. + * + * The event target is the {@link EventDispatcher} object upon which the {@link dispatchEvent dispatchEvent()} + * method is called. + * + * @param event The {@link BasicEvent} object that is dispatched into the event flow. If the event is being + * redispatched, a clone of the event is created automatically. After an event is dispatched, its + * target property cannot be changed, so you must create a new copy + * of the event for redispatching to work. + */ + dispatchEvent(event: library.BasicEvent): boolean; + /** + * Registers an event listener object with an {@link EventDispatcher} object so that the listener receives + * notification of an event. You can register event listeners on all nodes in the display list for a specific + * type of event, phase, and priority. + * + * After you successfully register an event listener, you cannot change its priority through additional calls + * to {@link addEventListener addEventListener()|} To change a listener's priority, you must first call + * {@link removeEventListener removeEventListener()}. Then you can register the listener again with the new + * priority level. + * + * Keep in mind that after the listener is registered, subsequent calls to {@link addEventListener} with a + * different type or useCapture value result in the creation of a separate listener registration. For example, + * if you first register a listener with useCapture set to true, it listens only during the capture phase. If + * you call {@link addEventListener} again using the same listener object, but with useCapture set to false, + * you have two separate listeners: one that listens during the capture phase and another that listens during + * the target and bubbling phases. + * + * You cannot register an event listener for only the target phase or the bubbling phase. Those phases are + * coupled during registration because bubbling applies only to the ancestors of the target node. + * + * If you no longer need an event listener, remove it by calling {@link removeEventListener}, or memory + * problems could result. Event listeners are not automatically removed from memory because the garbage + * collector does not remove the listener as long as the dispatching object exists (unless the + * useWeakReference parameter is set to true). + * + * Copying an {@link EventDispatcher} instance does not copy the event listeners attached to it. (If your n + * ewly created node needs an event listener, you must attach the listener after creating the node.) However, + * if you move an {@link EventDispatcher} instance, the event listeners attached to it move along with it. + * + * If the event listener is being registered on a node while an event is also being processed on this node, + * the event listener is not triggered during the current phase but may be triggered during a later phase in + * the event flow, such as the bubbling phase. + * + * If an event listener is removed from a node while an event is being processed on the node, it is still + * triggered by the current actions. After it is removed, the event listener is never invoked again (unless it + * is registered again for future processing). + * + * @param event The type of event. + * @param listener The listener function that processes the event. + * This function must accept an Event object as its only parameter and must return + * nothing. + */ + addEventListener(type: string, listener: library.BasicEventListener): void; + /** + * Registers an event listener object with an {@link EventDispatcher} object so that the listener receives + * notification of an event. You can register event listeners on all nodes in the display list for a specific + * type of event, phase, and priority. + * + * After you successfully register an event listener, you cannot change its priority through additional calls + * to {@link addEventListener addEventListener()|} To change a listener's priority, you must first call + * {@link removeEventListener removeEventListener()}. Then you can register the listener again with the new + * priority level. + * + * Keep in mind that after the listener is registered, subsequent calls to {@link addEventListener} with a + * different type or useCapture value result in the creation of a separate listener registration. For example, + * if you first register a listener with useCapture set to true, it listens only during the capture phase. If + * you call {@link addEventListener} again using the same listener object, but with useCapture set to false, + * you have two separate listeners: one that listens during the capture phase and another that listens during + * the target and bubbling phases. + * + * You cannot register an event listener for only the target phase or the bubbling phase. Those phases are + * coupled during registration because bubbling applies only to the ancestors of the target node. + * + * If you no longer need an event listener, remove it by calling {@link removeEventListener}, or memory + * problems could result. Event listeners are not automatically removed from memory because the garbage + * collector does not remove the listener as long as the dispatching object exists (unless the + * useWeakReference parameter is set to true). + * + * Copying an {@link EventDispatcher} instance does not copy the event listeners attached to it. (If your n + * ewly created node needs an event listener, you must attach the listener after creating the node.) However, + * if you move an {@link EventDispatcher} instance, the event listeners attached to it move along with it. + * + * If the event listener is being registered on a node while an event is also being processed on this node, + * the event listener is not triggered during the current phase but may be triggered during a later phase in + * the event flow, such as the bubbling phase. + * + * If an event listener is removed from a node while an event is being processed on the node, it is still + * triggered by the current actions. After it is removed, the event listener is never invoked again (unless it + * is registered again for future processing). + * + * @param event The type of event. + * @param listener The listener function that processes the event. + * This function must accept an Event object as its only parameter and must return + * nothing. + * @param thisArg The object to be used as the **this** object. + */ + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + /** + * Removes a listener from the {@link EventDispatcher} object. If there is no matching listener registered + * with the {@link EventDispatcher} object, a call to this method has no effect. + * + * @param type The type of event. + * @param listener The listener object to remove. + */ + removeEventListener(type: string, listener: library.BasicEventListener): void; + /** + * Removes a listener from the {@link EventDispatcher} object. If there is no matching listener registered + * with the {@link EventDispatcher} object, a call to this method has no effect. + * + * @param type The type of event. + * @param listener The listener object to remove. + * @param thisArg The object to be used as the **this** object. + */ + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + } + /** + * The {@link EventDispatcher} class is the base class for all classes that dispatch events. The + * {@link EventDispatcher} class implements the {@link IEventDispatcher} interface and is the base class for the + * {@link DisplayObject} class. The {@link EventDispatcher} class allows any object on the display list to be an + * event target and as such, to use the methods of the {@link IEventDispatcher} interface. + * + * The event target serves as the local point for how events flow through the display list hierarchy. When an + * event such as a mouse click or a key press occurs, an event object is dispatched into the event flow from the + * root of the display list. The event object makes a round-trip journey to the event target, which is + * conceptually divided into three phases: the capture phase includes the journey from the root to the last node + * before the event target's node; the target phase includes only the event target node; and the bubbling phase + * includes any subsequent nodes encountered on the return trip to the root of the display list. + * + * In general, the easiest way for a user-defined class to gain event dispatching capabilities is to extend + * {@link EventDispatcher}. If this is impossible (that is, if the class is already extending another class), you + * can instead implement the {@link IEventDispatcher} interface, create an {@link EventDispatcher} member, and + * write simple hooks to route calls into the aggregated {@link EventDispatcher}. + * + * @reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/EventDispatcher.html + * @author Migrated by Jeongho Nam + */ + class EventDispatcher implements IEventDispatcher { + /** + * @hidden + */ + private event_dispatcher_; + /** + * @hidden + */ + private event_listeners_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from the origin event dispatcher. + * + * @param dispatcher The origin object who issuing events. + */ + constructor(dispatcher: IEventDispatcher); + /** + * @inheritdoc + */ + hasEventListener(type: string): boolean; + /** + * @inheritdoc + */ + dispatchEvent(event: library.BasicEvent): boolean; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener): void; + /** + * @inheritdoc + */ + addEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener): void; + /** + * @inheritdoc + */ + removeEventListener(type: string, listener: library.BasicEventListener, thisArg: Object): void; + } +} +declare namespace samchon.library { + /** + * The {@link FileReference} class provides a means to load and save files in browser level. + * + * The {@link FileReference} class provides a means to {@link load} and {@link save} files in browser level. A + * browser-system dialog box prompts the user to select a file to {@link load} or a location for {@link svae}. Each + * {@link FileReference} object refers to a single file on the user's disk and has properties that contain + * information about the file's size, type, name, creation date, modification date, and creator type (Macintosh only). + * + * + * FileReference instances are created in the following ways: + *
    + *
  • + * When you use the new operator with the {@link FileReference} constructor: + * let myFileReference: FileReference = new FileReference(); + *
  • + *
  • + * When you call the {@link FileReferenceList.browse} method, which creates an array of {@link FileReference} + * objects. + *
  • + *
+ * + * During a load operation, all the properties of a {@link FileReference} object are populated by calls to the + * {@link FileReference.browse} or {@link FileReferenceList.browse} methods. During a save operation, the name + * property is populated when the select event is dispatched; all other properties are populated when the complete + * event is dispatched. + * + * The {@link browse browse()} method opens an browser-system dialog box that prompts the user to select a file + * for {@link load}. The {@link FileReference.browse} method lets the user select a single file; the + * {@link FileReferenceList.browse} method lets the user select multiple files. After a successful call to the + * {@link browse browse()} method, call the {@link FileReference.load} method to load one file at a time. The + * {@link FileReference.save} method prompts the user for a location to save the file and initiates downloading from + * a binary or string data. + * + * The {@link FileReference} and {@link FileReferenceList} classes do not let you set the default file location + * for the dialog box that the {@link browse} or {@link save} methods generate. The default location shown in the + * dialog box is the most recently browsed folder, if that location can be determined, or the desktop. The classes do + * not allow you to read from or write to the transferred file. They do not allow the browser that initiated the + * {@link load} or {@link save} to access the loaded or saved file or the file's location on the user's disk. + * + * @references http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html + * @author Jeongho Nam + */ + class FileReference extends EventDispatcher { + /** + * @hidden + */ + private file_; + /** + * @hidden + */ + private data_; + /** + * Default Constructor. + */ + constructor(); + /** + * The data from the loaded file after a successful call to the {@link load load()} method. + * + * If the {@link FileReference} object was not populated (by a valid call to {@link FileReference.browse}), + * an {@link LogicError exception} will be thrown when you try to get the value of this property. + * + * All the properties of a {@link FileReference} object are populated by calling the {@link browse browse()}. + * + */ + readonly data: any; + /** + * The name of the file on the local disk. + * + * If the {@link FileReference} object was not populated (by a valid call to {@link FileReference.browse}), + * an {@link LogicError exception} will be thrown when you try to get the value of this property. + * + * All the properties of a {@link FileReference} object are populated by calling the {@link browse browse()}. + * + */ + readonly name: string; + /** + * The filename extension. + * + * A file's extension is the part of the name following (and not including) the final dot ("."). If + * there is no dot in the filename, the extension is null. + * + * If the {@link FileReference} object was not populated (by a valid call to {@link FileReference.browse}), + * an {@link LogicError exception} will be thrown when you try to get the value of this property. + * + * All the properties of a {@link FileReference} object are populated by calling the {@link browse browse()}. + * + */ + readonly extension: string; + /** + * The file type, metadata of the {@link extension}. + * + * If the {@link FileReference} object was not populated (by a valid call to {@link FileReference.browse}), + * an {@link LogicError exception} will be thrown when you try to get the value of this property. + * + * All the properties of a {@link FileReference} object are populated by calling the {@link browse browse()}. + * + */ + readonly type: string; + /** + * The size of the file on the local disk in bytes. + * + * If the {@link FileReference} object was not populated (by a valid call to {@link FileReference.browse}), + * an {@link LogicError exception} will be thrown when you try to get the value of this property. + * + * All the properties of a {@link FileReference} object are populated by calling the {@link browse browse()}. + * + */ + readonly size: number; + /** + * The date that the file on the local disk was last modified. + * + * If the {@link FileReference} object was not populated (by a valid call to {@link FileReference.browse}), + * an {@link LogicError exception} will be thrown when you try to get the value of this property. + * + * All the properties of a {@link FileReference} object are populated by calling the {@link browse browse()}. + * + */ + readonly modificationDate: Date; + /** + * Displays a file-browsing dialog box that lets the user select a file to upload. The dialog box is native + * to the user's browser system. The user can select a file on the local computer or from other systems, for + * example, through a UNC path on Windows. + * + * When you call this method and the user successfully selects a file, the properties of this + * {@link FileReference} object are populated with the properties of that file. Each subsequent time that the + * {@link FileReference.browse} method is called, the {@link FileReference} object's properties are reset to + * the file that the user selects in the dialog box. Only one {@link browse browse()} can be performed at a time + * (because only one dialog box can be invoked at a time). + * + * Using the *typeFilter parameter*, you can determine which files the dialog box displays. + * + * @param typeFilter An array of filter strings used to filter the files that are displayed in the dialog box. + * If you omit this parameter, all files are displayed. + */ + browse(...typeFilter: string[]): void; + /** + * Starts the load of a local file selected by a user. + * + * You must call the {@link FileReference.browse} or {@link FileReferenceList.browse} method before you call + * the {@link load load()} method. + * + * Listeners receive events to indicate the progress, success, or failure of the load. Although you can use + * the {@link FileReferenceList} object to let users select multiple files to load, you must {@link load} the + * {@link FileReferenceList files} one by one. To {@link load} the files one by one, iterate through the + * {@link FileReferenceList.fileList} array of {@link FileReference} objects. + * + * If the file finishes loading successfully, its contents are stored in the {@link data} property. + */ + load(): void; + /** + * Save a file to local filesystem. + * + * {@link FileReference.save} implemented the save function by downloading a file from a hidden anchor tag. + * However, the plan, future's {@link FileReference} will follow such rule: + * + * Opens a dialog box that lets the user save a file to the local filesystem. + * + * The {@link save save()} method first opens an browser-system dialog box that asks the user to enter a + * filename and select a location on the local computer to save the file. When the user selects a location and + * confirms the save operation (for example, by clicking Save), the save process begins. Listeners receive events + * to indicate the progress, success, or failure of the save operation. To ascertain the status of the dialog box + * and the save operation after calling {@link save save()}, your code must listen for events such as cancel, + * open, progress, and complete. + * + * When the file is saved successfully, the properties of the {@link FileReference} object are populated with + * the properties of the local file. The complete event is dispatched if the save is successful. + * + * Only one {@link browse browse()} or {@link save()} session can be performed at a time (because only one + * dialog box can be invoked at a time). + * + * @param data The data to be saved. The data can be in one of several formats, and will be treated appropriately. + * @param fileName File name to be saved. + */ + save(data: string, fileName: string): void; + /** + * Save a file to local filesystem. + * + * {@link FileReference.save} implemented the save function by downloading a file from a hidden anchor tag. + * However, the plan, future's {@link FileReference} will follow such rule: + * + * Opens a dialog box that lets the user save a file to the local filesystem. + * + * The {@link save save()} method first opens an browser-system dialog box that asks the user to enter a + * filename and select a location on the local computer to save the file. When the user selects a location and + * confirms the save operation (for example, by clicking Save), the save process begins. Listeners receive events + * to indicate the progress, success, or failure of the save operation. To ascertain the status of the dialog box + * and the save operation after calling {@link save save()}, your code must listen for events such as cancel, + * open, progress, and complete. + * + * When the file is saved successfully, the properties of the {@link FileReference} object are populated with + * the properties of the local file. The complete event is dispatched if the save is successful. + * + * Only one {@link browse browse()} or {@link save()} session can be performed at a time (because only one + * dialog box can be invoked at a time). + * + * @param data The data to be saved. The data can be in one of several formats, and will be treated appropriately. + * @param fileName File name to be saved. + */ + static save(data: string, fileName: string): void; + } + /** + * The {@link FileReferenceList} class provides a means to let users select one or more files for + * {@link FileReference.load loading}. A {@link FileReferenceList} object represents a group of one or more local + * files on the user's disk as an array of {@link FileReference} objects. For detailed information and important + * considerations about {@link FileReference} objects and the FileReference class, which you use with + * {@link FileReferenceList}, see the {@link FileReference} class. + * + * To work with the {@link FileReferenceList} class: + *
    + *
  • Instantiate the class: var myFileRef = new FileReferenceList();
  • + *
  • + * Call the {@link FileReferenceList.browse} method, which opens a dialog box that lets the user select one or + * more files for upload: myFileRef.browse(); + *
  • + *
  • + * After the {@link browse browse()} method is called successfully, the {@link fileList} property of the + * {@link FileReferenceList} object is populated with an array of {@link FileReference} objects. + *
  • + *
  • Call {@link FileReference.load} on each element in the {@link fileList} array.
  • + *
+ * + * The {@link FileReferenceList} class includes a {@link browse browse()} method and a {@link fileList} property + * for working with multiple files. + * + * @reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReferenceList.html + * @author Jeongho Nam + */ + class FileReferenceList extends EventDispatcher { + /** + * @hidden + */ + file_list: std.Vector; + /** + * Default Constructor. + */ + constructor(); + /** + * An array of {@link FileReference} objects. + * + * When the {@link FileReferenceList.browse} method is called and the user has selected one or more files + * from the dialog box that the {@link browse browse()} method opens, this property is populated with an array of + * {@link FileReference} objects, each of which represents the files the user selected. + * + * The {@link fileList} property is populated anew each time {@link browse browse()} is called on that + * {@link FileReferenceList} object. + */ + readonly fileList: std.Vector; + /** + * Displays a file-browsing dialog box that lets the user select one or more local files to upload. The + * dialog box is native to the user's browser system. + * + * When you call this method and the user successfully selects files, the {@link fileList} property of this + * {@link FileReferenceList} object is populated with an array of {@link FileReference} objects, one for each + * file that the user selects. Each subsequent time that the {@link FileReferenceList.browse} method is called, + * the {@link FileReferenceList.fileList} property is reset to the file(s) that the user selects in the dialog + * box. + * + * Using the *typeFilter* parameter, you can determine which files the dialog box displays. + * + * Only one {@link FileReference.browse}, {@link FileReference.load}, or {@link FileReferenceList.browse} + * session can be performed at a time on a {@link FileReferenceList} object (because only one dialog box can be + * opened at a time). + * + * @param typeFilter An array of filter strings used to filter the files that are displayed in the dialog box. + * If you omit this parameter, all files are displayed. + */ + browse(...typeFilter: string[]): void; + } +} +declare namespace samchon.library { + /** + * A genetic algorithm class. + * + * In the field of artificial intelligence, a genetic algorithm (GA) is a search heuristic that mimics the + * process of natural selection. This heuristic (also sometimes called a metaheuristic) is routinely used to generate + * useful solutions to optimization and search problems. + * + * Genetic algorithms belong to the larger class of evolutionary algorithms (EA), which generate solutions to + * optimization problems using techniques inspired by natural evolution, such as inheritance, {@link mutate mutation}, + * {@link selection}, and {@link crossover}. + * + * @reference https://en.wikipedia.org/wiki/Genetic_algorithm + * @author Jeongho Nam + */ + class GeneticAlgorithm { + /** + * Whether each element (Gene) is unique in their GeneArray. + */ + private unique_; + /** + * Rate of mutation. + * + * The {@link mutation_rate} determines the percentage of occurence of mutation in GeneArray. + * + *
    + *
  • When {@link mutation_rate} is too high, it is hard to ancitipate studying on genetic algorithm.
  • + *
  • + * When {@link mutation_rate} is too low and initial set of genes (GeneArray) is far away from optimal, the + * evolution tends to wandering outside of he optimal. + *
  • + *
+ */ + private mutation_rate_; + /** + * Number of tournaments in selection. + */ + private tournament_; + /** + * Initialization Constructor. + * + * @param unique Whether each Gene is unique in their GeneArray. + * @param mutation_rate Rate of mutation. + * @param tournament Number of tournaments in selection. + */ + constructor(unique?: boolean, mutation_rate?: number, tournament?: number); + /** + * Evolove *GeneArray*. + * + * Convenient method accessing to {@link evolvePopulation evolvePopulation()}. + * + * @param individual An initial set of genes; sequence listing. + * @param population Size of population in a generation. + * @param generation Size of generation in evolution. + * @param compare A comparison function returns whether left gene is more optimal. + * + * @return An evolved *GeneArray*, optimally. + * + * @see {@link GAPopulation.compare} + */ + evolveGeneArray>(individual: GeneArray, population: number, generation: number, compare?: (left: T, right: T) => boolean): GeneArray; + /** + * Evolve *population*, a mass of *GeneArraies*. + * + * @param population An initial population. + * @param compare A comparison function returns whether left gene is more optimal. + * + * @return An evolved population. + * + * @see {@link GAPopulation.compare} + */ + evolvePopulation>(population: GAPopulation, compare?: (left: T, right: T) => boolean): GAPopulation; + /** + * Select the best GeneArray in *population* from tournament. + * + * {@link selection Selection} is the stage of a genetic algorithm in which individual genomes are chosen + * from a population for later breeding (using {@linlk crossover} operator). A generic {@link selection} + * procedure may be implemented as follows: + * + *
    + *
  1. + * The fitness function is evaluated for each individual, providing fitness values, which are then + * normalized. ization means dividing the fitness value of each individual by the sum of all fitness + * values, so that the sum of all resulting fitness values equals 1. + *
  2. + *
  3. The population is sorted by descending fitness values.
  4. + *
  5. + * Accumulated normalized fitness values are computed (the accumulated fitness value of an individual is the + * sum of its own fitness value plus the fitness values of all the previous individuals). The accumulated + * fitness of the last individual should be 1 (otherwise something went wrong in the normalization step). + *
  6. + *
  7. A random number R between 0 and 1 is chosen.
  8. + *
  9. The selected individual is the first one whose accumulated normalized value is greater than R.
  10. + *
+ * + * @param population The target of tournament. + * @return The best genes derived by the tournament. + * + * @reference https://en.wikipedia.org/wiki/Selection_(genetic_algorithm) + */ + private selection(population); + /** + * Create a new GeneArray by crossing over two *GeneArray*(s). + * + * {@link crossover} is a genetic operator used to vary the programming of a chromosome or chromosomes from + * one generation to the next. It is analogous to reproduction and biological crossover, upon which genetic + * algorithms are based. + * + * {@link crossover Cross over} is a process of taking more than one parent solutions and producing a child + * solution from them. There are methods for selection of the chromosomes. + * + * @param parent1 A parent sequence listing + * @param parent2 A parent sequence listing + * + * @reference https://en.wikipedia.org/wiki/Crossover_(genetic_algorithm) + */ + private crossover(parent1, parent2); + /** + * Cause a mutation on the *GeneArray*. + * + * {@link mutate Mutation} is a genetic operator used to maintain genetic diversity from one generation of a + * population of genetic algorithm chromosomes to the next. It is analogous to biological mutation. + * + * {@link mutate Mutation} alters one or more gene values in a chromosome from its initial state. In + * {@link mutate mutation}, the solution may change entirely from the previous solution. Hence GA can come to + * better solution by using {@link mutate mutation}. + * + * {@link mutate Mutation} occurs during evolution according to a user-definable mutation probability. This + * probability should be set low. If it is set too high, the search will turn into a primitive random search. + * + *

Note

+ * Muttion is pursuing diversity. Mutation is useful for avoiding the following problem. + * + * When initial set of genes(GeneArray) is far away from optimail, without mutation (only with selection and + * crossover), the genetic algorithm has a tend to wandering outside of the optimal. + * + * Genes in the GeneArray will be swapped following percentage of the {@link mutation_rate}. + * + * @param individual A container of genes to mutate + * + * @reference https://en.wikipedia.org/wiki/Mutation_(genetic_algorithm) + * @see {@link mutation_rate} + */ + private mutate(individual); + } + /** + * A population in a generation. + * + * {@link GAPopulation} is a class representing population of candidate genes (sequence listing) having an array + * of GeneArray as a member. {@link GAPopulation} also manages initial set of genes and handles fitting test direclty + * by the method {@link fitTest fitTest()}. + * + * The success of evolution of genetic algorithm is depend on the {@link GAPopulation}'s initial set and fitting + * test. (*GeneArray* and {@link compare}.) + * + *

Warning

+ * Be careful for the mistakes of direction or position of the {@link compare}. + * Most of logical errors failed to access optimal solution are occured from those mistakes. + * + * @param Type of gene elements. + * @param An array containing genes as elments; sequnce listing. + * + * @author Jeongho Nam + */ + class GAPopulation> { + /** + * Genes representing the population. + */ + private children_; + /** + * A comparison function returns whether left gene is more optimal, greater. + * + * Default value of this {@link compare} is {@link std.greater}. It means to compare two array + * (GeneArray must be a type of {@link std.base.IArrayContainer}). Thus, you've to keep follwing rule. + * + *
    + *
  • GeneArray is implemented from {@link std.base.IArrayContainer}.
  • + *
      + *
    • {@link std.Vector}
    • + *
    • {@link std.Deque}
    • + *
    + *
  • GeneArray has custom public less(obj: T): boolean; function.
  • + *
+ * + * If you don't want to follow the rule or want a custom comparison function, you have to realize a + * comparison function. + */ + private compare_; + /** + * Private constructor with population. + * + * Private constructor of GAPopulation does not create {@link children}. (candidate genes) but only assigns + * *null* repeatedly following the *population size*. + * + * This private constructor is designed only for {@link GeneticAlgorithm}. Don't create {@link GAPopulation} + * with this constructor, by yourself. + * + * @param size Size of the population. + */ + constructor(size: number); + /** + * Construct from a {@link GeneArray} and *size of the population*. + * + * This public constructor creates *GeneArray(s)* as population (size) having shuffled genes which are + * came from the initial set of genes (*geneArray*). It uses {@link std.greater} as default comparison function. + * + * + * @param geneArray An initial sequence listing. + * @param size The size of population to have as children. + */ + constructor(geneArray: GeneArray, size: number); + /** + * Constructor from a GeneArray, size of the poluation and custom comparison function. + * + * This public constructor creates *GeneArray(s)* as population (size) having shuffled genes which are + * came from the initial set of genes (*geneArray*). The *compare* is used for comparison function. + * + * + * @param geneArray An initial sequence listing. + * @param size The size of population to have as children. + * @param compare A comparison function returns whether left gene is more optimal. + */ + constructor(geneArray: GeneArray, size: number, compare: (left: GeneArray, right: GeneArray) => boolean); + children(): std.Vector; + /** + * Test fitness of each *GeneArray* in the {@link population}. + * + * @return The best *GeneArray* in the {@link population}. + */ + fitTest(): GeneArray; + /** + * @hidden + */ + private clone(obj); + } +} +declare namespace samchon.library { + /** + * A utility class supporting static methods of string. + * + * The {@link StringUtil} utility class is an all-static class with methods for working with string objects. + * You do not create instances of {@link StringUtil}; instead you call methods such as the + * ```StringUtil.substitute()``` method. + * + * @reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/utils/StringUtil.html + * @author Jeongho Nam + */ + class StringUtil { + /** + * Generate a substring. + * + * Extracts a substring consisting of the characters from specified start to end. + * It's same with str.substring( ? = (str.find(start) + start.size()), str.find(end, ?) ) + * + * ```typescript + * let str: string = StringUtil.between("ABCD(EFGH)IJK", "(", ")"); + * console.log(str); // PRINTS "EFGH" + * ``` + * + * - If start is not specified, extracts from begin of the string to end. + * - If end is not specified, extracts from start to end of the string. + * - If start and end are all omitted, returns str, itself. + * + * @param str Target string to be applied between. + * @param start A string for separating substring at the front. + * @param end A string for separating substring at the end. + * + * @return substring by specified terms. + */ + static between(str: string, start?: string, end?: string): string; + /** + * Fetch substrings. + * + * Splits a string into an array of substrings dividing by specified delimeters of start and end. + * It's the array of substrings adjusted the between. + * + *
    + *
  • If startStr is omitted, it's same with the split by endStr not having last item.
  • + *
  • If endStr is omitted, it's same with the split by startStr not having first item.
  • + *
  • If startStr and endStar are all omitted, returns *str*.
  • + *
+ * + * @param str Target string to split by between. + * @param start A string for separating substring at the front. + * If omitted, it's same with split(end) not having last item. + * @param end A string for separating substring at the end. + * If omitted, it's same with split(start) not having first item. + * @return An array of substrings. + */ + static betweens(str: string, start?: string, end?: string): Array; + /** + * An array containing whitespaces. + */ + private static SPACE_ARRAY; + /** + * Remove all designated characters from the beginning and end of the specified string. + * + * @param str The string whose designated characters should be trimmed. + * @param args Designated character(s). + * + * @return Updated string where designated characters was removed from the beginning and end. + */ + static trim(str: string, ...args: string[]): string; + /** + * Remove all designated characters from the beginning of the specified string. + * + * @param str The string should be trimmed. + * @param delims Designated character(s). + * + * @return Updated string where designated characters was removed from the beginning + */ + static ltrim(str: string, ...args: string[]): string; + /** + * Remove all designated characters from the end of the specified string. + * + * @param str The string should be trimmed. + * @param delims Designated character(s). + * + * @return Updated string where designated characters was removed from the end. + */ + static rtrim(str: string, ...args: string[]): string; + /** + * Substitute `{n}` tokens within the specified string. + * + * @param format The string to make substitutions in. This string can contain special tokens of the form + * `{n}`, where *n* is a zero based index, that will be replaced with the additional parameters + * found at that index if specified. + * @param args Additional parameters that can be substituted in the *format* parameter at each + * `{n}` location, where *n* is an integer (zero based) index value into the array of values + * specified. + * + * @return New string with all of the `{n}` tokens replaced with the respective arguments specified. + */ + static substitute(format: string, ...args: any[]): string; + /** + * Substitute `{n}` tokens within the specified SQL-string. + * + * @param format The string to make substitutions in. This string can contain special tokens of the form + * `{n}`, where *n* is a zero based index, that will be replaced with the additional parameters + * found at that index if specified. + * @param args Additional parameters that can be substituted in the *format* parameter at each + * `{n}` location, where *n* is an integer (zero based) index value into the array of values + * specified. + * + * @return New SQL-string with all of the `{n}` tokens replaced with the respective arguments specified. + */ + static substituteSQL(format: string, ...args: any[]): string; + /** + * @hidden + */ + private static _Fetch_substitute_index(format); + /** + * Returns a string specified word is replaced. + * + * @param str Target string to replace + * @param before Specific word you want to be replaced + * @param after Specific word you want to replace + * + * @return A string specified word is replaced + */ + static replaceAll(str: string, before: string, after: string): string; + /** + * Returns a string specified words are replaced. + * + * @param str Target string to replace + * @param pairs A specific word's pairs you want to replace and to be replaced + * + * @return A string specified words are replaced + */ + static replaceAll(str: string, ...pairs: std.Pair[]): string; + /** + * Replace all HTML spaces to a literal space. + * + * @param str Target string to replace. + */ + static removeHTMLSpaces(str: string): string; + /** + * Repeat a string. + * + * Returns a string consisting of a specified string concatenated with itself a specified number of times. + * + * @param str The string to be repeated. + * @param n The repeat count. + * + * @return The repeated string. + */ + static repeat(str: string, n: number): string; + /** + * Number to formatted string with "," sign. + * + * Returns a string converted from the number rounded off from specified precision with "," symbols. + * + * @param val A number wants to convert to string. + * @param precision Target precision of round off. + * + * @return A string who represents the number with roundoff and "," symbols. + */ + static numberFormat(val: number, precision?: number): string; + static percentFormat(val: number, precision?: number): string; + } +} +declare namespace samchon.library { + /** + * URLVariables class is for representing variables of HTTP. + * + * {@link URLVariables} class allows you to transfer variables between an application and server. + * + * When transfering, {@link URLVariables} will be converted to a *URI* string. + * - URI: Uniform Resource Identifier + * + * @reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLVariables.html + * @author Migrated by Jeongho Nam + */ + class URLVariables extends std.HashMap { + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from a URL-encoded string. + * + * The {@link decode decode()} method is automatically called to convert the string to properties of the {@link URLVariables} object. + * + * @param str A URL-encoded string containing name/value pairs. + */ + constructor(str: string); + /** + * Converts the variable string to properties of the specified URLVariables object. + * + * @param str A URL-encoded query string containing name/value pairs. + */ + decode(str: string): void; + /** + * Returns a string containing all enumerable variables, in the MIME content encoding application/x-www-form-urlencoded. + */ + toString(): string; + } +} +declare namespace samchon.library { + /** + * A tree-structured XML object. + * + * The {@link XML| class contains methods and properties for working with XML objects. The {@link XML} class (along + * with the {@link XMLList}) implements the powerful XML-handling standards defined in ECMAScript for XML (E4X) + * specification (ECMA-357 edition 2). + * + * An XML object, it is composed with three members; {@link getTag tag}, {@link getProperty properties} and + * {@link getValue value}. As you know, XML is a tree structured data expression method. The tree-stucture; + * {@link XML} class realizes it by extending ```std.HashMap```. Child {@link XML} objects are + * contained in the matched {@link XMLList} object being grouped by their {@link getTag tag name}. The + * {@link XMLList} objects, they're stored in the {@link std.HashMap} ({@link XML} itself) with its **key**; common + * {@link getTag tag name} of children {@link XML} objects. + * + * ```typescript + * class XML extends std.HashMap + * { + * private tag_: string; + * private properties_: std.HashMap; + * private value_: string; + * } + * ``` + * + * ```xml + * + * + * + * {value} + * {value} + * {value} + * + * + * + * + * ``` + * + * Use the {@link toString toString()} method to return a string representation of the {@link XML} object regardless + * of whether the {@link XML} object has simple content or complex content. + * + * @reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/XML.html + * @handbook https://github.com/samchon/framework/wiki/TypeScript-Library-XML + * @author Jeongho Nam + */ + class XML extends std.HashMap { + /** + * @hidden + */ + private tag_; + /** + * @hidden + */ + private value_; + /** + * @hidden + */ + private property_map_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from string. + * + * Creates {@link XML} object by parsing a string who represents xml structure. + * + * @param str A string represents XML structure. + */ + constructor(str: string); + /** + * @hidden + */ + private _Parse(str); + /** + * @hidden + */ + private _Parse_tag(str); + /** + * @hidden + */ + private _Parse_properties(str); + /** + * @hidden + */ + private _Parse_value(str); + /** + * @hidden + */ + private _Parse_children(str); + /** + * Get tag. + * + * ```xml + * {value} + * ``` + * + * @return tag. + */ + getTag(): string; + /** + * Get value. + * + * ```xml + * {VALUE} + * ``` + * + * @return value. + */ + getValue(): string; + /** + * Get iterator to property element. + * + * Searches the {@link getPropertyMap properties} for an element with a identifier equivalent to key + * and returns an iterator to it if found, otherwise it returns an iterator to {@link HashMap.end end()}. + * + *

Two keys are considered equivalent if the properties' comparison object returns false reflexively + * (i.e., no matter the order in which the elements are passed as arguments).

+ * + * Another member function, {@link hasProperty hasProperty()} can be used to just check whether a particular + * key exists. + * + * ```xml + * {value} + * ``` + * + * @param key Key to be searched for + * @return An iterator to the element, if an element with specified key is found, or + * {@link end HashMap.end()} otherwise. + */ + findProperty(key: string): std.MapIterator; + /** + * Test whether a property exists. + * + * ```xml + * {value} + * ``` + * + * @return Whether a property has the *key* exists or not. + */ + hasProperty(key: string): boolean; + /** + * Get property. + * + * Get property by its *key*, property name. If the matched *key* does not exist, then exception + * {@link std.OutOfRange} is thrown. Thus, it would better to test whether the *key* exits or not by calling the + * {@link hasProperty hasProperty()} method before calling this {@link getProperty getProperty()}. + * + * This method can be substituted by {@link getPropertyMap getPropertyMap()} such below: + * - ```getPropertyMap().get(key, value);``` + * - ```getPropertyMap().find(key).second;``` + * + * ```xml + * {value} + * ``` + * + * @return Value of the matched property. + */ + getProperty(key: string): string; + /** + * Get property map. + * + * ```xml + * {value} + * ``` + * + * @return {@link HashMap} containing properties' keys and values. + */ + getPropertyMap(): std.HashMap; + /** + * Set tag. + * + * Set tag name, identifier of this {@link XML} object. + * + * If this {@link XML} object is belonged to, a child of, an {@link XMLList} and its related {@link XML} objects, + * then calling this {@link setTag setTag()} method direclty is not recommended. Erase this {@link XML} object + * from parent objects and insert this object again. + * + * ```xml + * {value} + * ``` + * + * @param val To be new {@link getTag tag}. + */ + setTag(val: string): void; + /** + * Set value. + * + * ```xml + * {VALUE} + * ``` + * + * @param val To be new {@link getValue value}. + */ + setValue(val: string): void; + /** + * Set property. + * + * Set a property *value* with its *key*. If the *key* already exists, then the *value* will be overwritten to + * the property. Otherwise the *key* is not exist yet, then insert the *key* and *value* {@link Pair pair} to + * {@link getPropertyMao property map}. + * + * This method can be substituted by {@link getPropertyMap getPropertyMap()} such below: + * - ```getPropertyMap().set(key, value);``` + * - ```getPropertyMap().emplace(key, value);``` + * - ```getPropertyMap().insert([key, value]);``` + * - ```getPropertyMap().insert(std.make_pair(key, value));``` + * + * ```xml + * {value} + * ``` + * + * @param key Key, identifier of property to be newly inserted. + * @param value Value of new property to be newly inserted. + */ + setProperty(key: string, value: string): void; + /** + * Erase property. + * + * Erases a property by its *key*, property name. If the matched *key* does not exist, then exception + * {@link std.OutOfRange} is thrown. Thus, it would better to test whether the *key* exits or not by calling the + * {@link hasProperty hasProperty()} method before calling this {@link eraseProperty eraseProperty()}. + * + * This method can be substituted by ``getPropertyMap().erase(key)````. + * + * ```xml + * {value} + * ``` + * + * @param key Key of the property to erase + * @throw {@link std.OutOfRange} + */ + eraseProperty(key: string): void; + /** + * @hidden + */ + push(...args: std.Pair[]): number; + /** + * @hidden + */ + push(...args: [string, XMLList][]): number; + push(...xmls: XML[]): number; + push(...xmlLists: XMLList[]): number; + /** + * Add all properties from other {@link XML} object. + * + * All the properties in the *obj* are copied to this {@link XML} object. If this {@link XML} object has same + * property key in the *obj*, then value of the property will be replaced to *obj*'s own. If you don't want to + * overwrite properties with same key, then use {@link getPropertyMap getPropertyMap()} method. + * + * ```typescript + * let x: library.XML; + * let y: library.XML; + * + * x.addAllProperties(y); // duplicated key exists, then overwrites + * x.getPropertyMap().insert(y.getPropertyMap().begin(), y.getPropertyMap().end()); + * // ducpliated key, then ignores. only non-duplicateds are copied. + * ``` + * + * ```xml + * {value} + * ``` + * + * @param obj Target {@link XML} object to copy properties. + */ + insertAllProperties(obj: XML): void; + /** + * Clear properties. + * + * Remove all properties. It's same with calling ```getPropertyMap().clear()```. + * + * ```xml + * {value} + * ``` + */ + clearProperties(): void; + /** + * @hidden + */ + private _Compute_min_index(...args); + /** + * @hidden + */ + private _Decode_value(str); + /** + * @hidden + */ + private _Encode_value(str); + /** + * @hidden + */ + private _Decode_property(str); + /** + * @hidden + */ + private _Encode_property(str); + /** + * {@link XML} object to xml string. + * + * Returns a string representation of the {@link XML} object. + * + * @param tab Number of tabs to spacing. + * @return The string representation of the {@link XML} object. + */ + toString(tab?: number): string; + } +} +declare namespace samchon.library { + /** + * List of {@link XML} objects with same tag. + * + * @reference http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/XMLList.html + * @handbook https://github.com/samchon/framework/wiki/TypeScript-Library-XML + * @author Jeongho Nam + */ + class XMLList extends std.Deque { + /** + * Get tag. + */ + getTag(): string; + /** + * {@link XMLList XML objects} to string. + * + * Returns a string representation of the {@link XMLList XML objects}. + * + * @param tab Number of tabs to spacing. + * @return The string representation of the {@link XMLList XML objects}. + */ + toString(level?: number): string; + } +} +declare namespace samchon.protocol { + /** + * An interface of entity. + * + * Entity is a class for standardization of expression method using on network I/O by XML. If + * Invoke is a standard message protocol of Samchon Framework which must be kept, Entity is a + * recommended semi-protocol of message for expressing a data class. Following the semi-protocol + * Entity is not imposed but encouraged. + * + * As we could get advantages from standardization of message for network I/O with Invoke, + * we can get additional advantage from standardizing expression method of data class with Entity. + * We do not need to know a part of network communication. Thus, with the Entity, we can only + * concentrate on entity's own logics and relationships between another entities. Entity does not + * need to how network communications are being done. + * + * I say repeatedly. Expression method of Entity is recommended, but not imposed. It's a semi + * protocol for network I/O but not a essential protocol must be kept. The expression method of + * Entity, using on network I/O, is expressed by XML string. + * + * If your own network system has a critical performance issue on communication data class, + * it would be better to using binary communication (with ByteArray). + * Don't worry about the problem! Invoke also provides methods for binary data (ByteArray). + * + * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_message_protocol.png) + * + * @author Jeongho Nam + */ + interface IEntity { + /** + * Construct data of the Entity from a XML object. + * + * Overrides the construct() method and fetch data of member variables from the XML. + * + * By recommended guidance, data representing member variables are contained in properties + * of the put XML object. + * + * @param xml An xml used to contruct data of entity. + */ + construct(xml: library.XML): void; + /** + * Get a key that can identify the Entity uniquely. + * + * If identifier of the Entity is not atomic value, returns a paired or tuple object + * that can represents the composite identifier. + * + * + * class Point extends Entity + * { + * private x: number; + * private y: number; + * + * public key(): std.Pair + * { + * return std.make_pair(this.x, this.y); + * } + * } + * + */ + key(): any; + /** + * A tag name when represented by XML. + * + * + */ + TAG(): string; + /** + * Get a XML object represents the Entity. + * + * A member variable (not object, but atomic value like number, string or date) is categorized + * as a property within the framework of entity side. Thus, when overriding a toXML() method and + * archiving member variables to an XML object to return, puts each variable to be a property + * belongs to only a XML object. + * + * Don't archive the member variable of atomic value to XML::value causing enormouse creation + * of XML objects to number of member variables. An Entity must be represented by only a XML + * instance (tag). + * + *

Standard Usage.

+ * + * + * + * + * + * + * + *

Non-standard usage abusing value.

+ * + * + * jhnam88 + * Jeongho Nam + * 1988-03-11 + * + * + * master + * Administartor + * 2011-07-28 + * + * + * + * @return An XML object representing the Entity. + */ + toXML(): library.XML; + } + /** + * @hidden + */ + namespace IEntity { + function construct(entity: IEntity, xml: library.XML, ...prohibited_names: string[]): void; + function toXML(entity: IEntity, ...prohibited_names: string[]): library.XML; + } + /** + * An entity, a standard data class. + * + * Entity is a class for standardization of expression method using on network I/O by XML. If + * Invoke is a standard message protocol of Samchon Framework which must be kept, Entity is a + * recommended semi-protocol of message for expressing a data class. Following the semi-protocol + * Entity is not imposed but encouraged. + * + * As we could get advantages from standardization of message for network I/O with Invoke, + * we can get additional advantage from standardizing expression method of data class with Entity. + * We do not need to know a part of network communication. Thus, with the Entity, we can only + * concentrate on entity's own logics and relationships between another entities. Entity does not + * need to how network communications are being done. + * + * I say repeatedly. Expression method of Entity is recommended, but not imposed. It's a semi + * protocol for network I/O but not a essential protocol must be kept. The expression method of + * Entity, using on network I/O, is expressed by XML string. + * + * If your own network system has a critical performance issue on communication data class, + * it would be better to using binary communication (with ByteArray). + * Don't worry about the problem! Invoke also provides methods for binary data (ByteArray). + * + * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_message_protocol.png) + * + * @author Jeongho Nam + */ + abstract class Entity implements IEntity { + /** + * Default Constructor. + */ + constructor(); + construct(xml: library.XML): void; + /** + * @inheritdoc + */ + key(): any; + /** + * @inheritdoc + */ + abstract TAG(): string; + /** + * @inheritdoc + */ + toXML(): library.XML; + } +} +declare namespace samchon.protocol { + /** + * @inheritdoc + */ + interface IEntityCollection extends IEntityGroup, collections.ICollection { + } +} +declare namespace samchon.protocol { + /** + * @inheritdoc + */ + abstract class EntityArrayCollection extends collections.ArrayCollection implements IEntityCollection { + /** + * @inheritdoc + */ + construct(xml: library.XML): void; + /** + * @inheritdoc + */ + abstract createChild(xml: library.XML): T; + /** + * @inheritdoc + */ + key(): any; + /** + * @inheritdoc + */ + has(key: any): boolean; + /** + * @inheritdoc + */ + count(key: any): number; + /** + * @inheritdoc + */ + get(key: any): T; + /** + * @inheritdoc + */ + abstract TAG(): string; + /** + * @inheritdoc + */ + abstract CHILD_TAG(): string; + /** + * @inheritdoc + */ + toXML(): library.XML; + } +} +declare namespace samchon.protocol { + /** + * @inheritdoc + */ + abstract class EntityListCollection extends collections.ListCollection implements IEntityCollection { + /** + * @inheritdoc + */ + construct(xml: library.XML): void; + /** + * @inheritdoc + */ + abstract createChild(xml: library.XML): T; + /** + * @inheritdoc + */ + key(): any; + /** + * @inheritdoc + */ + has(key: any): boolean; + /** + * @inheritdoc + */ + count(key: any): number; + /** + * @inheritdoc + */ + get(key: any): T; + /** + * @inheritdoc + */ + abstract TAG(): string; + /** + * @inheritdoc + */ + abstract CHILD_TAG(): string; + /** + * @inheritdoc + */ + toXML(): library.XML; + } +} +declare namespace samchon.protocol { + /** + * @inheritdoc + */ + abstract class EntityDequeCollection extends collections.DequeCollection implements IEntityCollection { + /** + * @inheritdoc + */ + construct(xml: library.XML): void; + /** + * @inheritdoc + */ + abstract createChild(xml: library.XML): T; + /** + * @inheritdoc + */ + key(): any; + /** + * @inheritdoc + */ + has(key: any): boolean; + /** + * @inheritdoc + */ + count(key: any): number; + /** + * @inheritdoc + */ + get(key: any): T; + /** + * @inheritdoc + */ + abstract TAG(): string; + /** + * @inheritdoc + */ + abstract CHILD_TAG(): string; + /** + * @inheritdoc + */ + toXML(): library.XML; + } +} +/** + * A template for External Systems Manager. + * + * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) + * @author Jeongho Nam + */ +declare namespace samchon.templates.external { + /** + * An array and manager of {@link ExternalSystem external system drivers}. + * + * The {@link ExternalSystemArray} is an abstract class containing and managing external system drivers, + * {@link ExternalSystem} objects. Within framewokr of network, {@link ExternalSystemArray} represents your system + * and children {@link ExternalSystem} objects represent remote, external systems connected with your system. + * With this {@link ExternalSystemArray}, you can manage multiple external systems as a group. + * + * You can specify this {@link ExternalSystemArray} class to be *a server accepting external clients* or + * *a client connecting to external servers*. Even both of them is also possible. + * + * - {@link ExternalClientArray}: A server accepting {@link ExternalSystem external clients}. + * - {@link ExternalServerArray}: A client connecting to {@link ExternalServer external servers}. + * - {@link ExternalServerClientArray}: Both of them. Accepts {@link ExternalSystem external clients} and connects to + * {@link ExternalServer external servers} at the same time. + * + * + * + * + * + * #### Proxy Pattern + * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which + * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not + * important. Only interested in user's perspective is *which can be done*. + * + * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged + * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. + * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. + * + *
    + *
  • + * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring + * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. + *
  • + *
  • + * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call + * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the + * external system. + *
  • + *
  • Those strategy is called *Proxy Pattern*.
  • + *
+ * + * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) + * @author Jeongho Nam + */ + abstract class ExternalSystemArray extends protocol.EntityDequeCollection implements protocol.IProtocol { + /** + * Default Constructor. + */ + constructor(); + /** + * @hidden + */ + private _Handle_system_erase(event); + /** + * Test whether the role exists. + * + * @param name Name, identifier of target {@link ExternalSystemRole role}. + * + * @return Whether the role has or not. + */ + hasRole(name: string): boolean; + /** + * Get a role. + * + * @param name Name, identifier of target {@link ExternalSystemRole role}. + * + * @return The specified role. + */ + getRole(name: string): ExternalSystemRole; + /** + * Send an {@link Invoke} message. + * + * @param invoke An {@link Invoke} message to send. + */ + sendData(invoke: protocol.Invoke): void; + /** + * Handle an {@Invoke} message have received. + * + * @param invoke An {@link Invoke} message have received. + */ + abstract replyData(invoke: protocol.Invoke): void; + /** + * Tag name of the {@link ExternalSytemArray} in {@link XML}. + * + * @return *systemArray*. + */ + TAG(): string; + /** + * Tag name of {@link ExternalSystem children elements} belonged to the {@link ExternalSytemArray} in {@link XML}. + * + * @return *system*. + */ + CHILD_TAG(): string; + } +} +/** + * A template for Parallel Processing System. + * + * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) + * @author Jeongho Nam + */ +declare namespace samchon.templates.parallel { + /** + * Master of Parallel Processing System. + * + * The {@link ParallelSystemArray} is an abstract class containing and managing remote parallel **slave** system + * drivers, {@link ParallelSystem} objects. Within framework of network, {@link ParallelSystemArray} represents your + * system, a **Master** of *Parallel Processing System* that requesting *parallel process* to **slave** systems and the + * children {@link ParallelSystem} objects represent the remote **slave** systems, who is being requested the + * *parallel processes*. + * + * You can specify this {@link ParallelSystemArray} class to be *a server accepting parallel clients* or + * *a client connecting to parallel servers*. Even both of them is possible. Extends one of them below and overrides + * abstract factory method(s) creating the child {@link ParallelSystem} object. + * + * - {@link ParallelClientArray}: A server accepting {@link ParallelSystem parallel clients}. + * - {@link ParallelServerArray}: A client connecting to {@link ParallelServer parallel servers}. + * - {@link ParallelServerClientArray}: Both of them. Accepts {@link ParallelSystem parallel clients} and connects to + * {@link ParallelServer parallel servers} at the same time. + * + * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. + * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s + * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices + * will be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. + * + * + * + * + * + * #### Proxy Pattern + * This class {@link ParallelSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take + * advantage of the *Proxy Pattern* in the {@link ParallelSystemArray} class. If a process to request is not the + * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it + * may better to utilizing the *Proxy Pattern*: + * + * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which + * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not + * important. Only interested in user's perspective is *which can be done*. + * + * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged + * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. + * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. + * + *
    + *
  • + * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring + * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. + *
  • + *
  • + * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call + * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the + * external system. + *
  • + *
  • Those strategy is called *Proxy Pattern*.
  • + *
+ * + * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) + * @author Jeongho Nam + */ + abstract class ParallelSystemArray extends external.ExternalSystemArray { + /** + * @hidden + */ + private history_sequence_; + /** + * Default Constructor. + */ + constructor(); + /** + * Send an {@link Invoke} message with segment size. + * + * Sends an {@link Invoke} message requesting a **parallel process** with its *segment size*. The {@link Invoke} + * message will be delivered to children {@link ParallelSystem} objects with the *piece size*, which is divided + * from the *segment size*, basis on their {@link ParallelSystem.getPerformance performance indices}. + * + * - If segment size is 100, + * - The segment will be allocated such below: + * + * Name | Performance index | Number of pieces to be allocated | Formula + * --------|-------------------|----------------------------------|-------------- + * Snail | 1 | 10 | 100 / 10 * 1 + * Cheetah | 4 | 40 | 100 / 10 * 4 + * Rabbit | 3 | 30 | 100 / 10 * 3 + * Turtle | 2 | 20 | 100 / 10 * 2 + * + * When the **parallel process** has completed, then this {@link ParallelSystemArraY} will estimate + * {@link ParallelSystem.getPerformance performance indices} of {@link ParallelSystem} objects basis on their + * execution time. + * + * @param invoke An {@link Invoke} message requesting parallel process. + * @param size Number of pieces to segment. + * + * @return Number of {@link ParallelSystem slave systems} participating in the *Parallel Process*. + * + * @see {@link sendPieceData}, {@link ParallelSystem.getPerformacen} + */ + sendSegmentData(invoke: protocol.Invoke, size: number): number; + /** + * Send an {@link Invoke} message with range of pieces. + * + * Sends an {@link Invoke} message requesting a **parallel process** with its *range of pieces [first, last)*. + * The {@link Invoke} will be delivered to children {@link ParallelSystem} objects with the newly computed + * *range of sub-pieces*, which is divided from the *range of pieces (first to last)*, basis on their + * {@link ParallelSystem.getPerformance performance indices}. + * + * - If indices of pieces are 0 to 50, + * - The sub-pieces will be allocated such below: + * + * Name | Performance index | Range of sub-pieces to be allocated | Formula + * --------|-------------------|-------------------------------------|------------------------ + * Snail | 1 | ( 0, 5] | (50 - 0) / 10 * 1 + * Cheetah | 4 | ( 5, 25] | (50 - 0) / 10 * 4 + 5 + * Rabbit | 3 | (25, 40] | (50 - 0) / 10 * 3 + 25 + * Turtle | 2 | (40, 50] | (50 - 0) / 10 * 2 + 40 + * + * When the **parallel process** has completed, then this {@link ParallelSystemArraY} will estimate + * {@link ParallelSystem.getPerformance performance indices} of {@link ParallelSystem} objects basis on their + * execution time. + * + * @param invoke An {@link Invoke} message requesting parallel process. + * @param first Initial piece's index in a section. + * @param last Final piece's index in a section. The range used is [*first*, *last*), which contains + * all the pieces' indices between *first* and *last*, including the piece pointed by index + * *first*, but not the piece pointed by the index *last*. + * + * @return Number of {@link ParallelSystem slave systems} participating in the *Parallel Process*. + * + * @see {@link sendSegmentData}, {@link ParallelSystem.getPerformacen} + */ + sendPieceData(invoke: protocol.Invoke, first: number, last: number): number; + /** + * @hidden + */ + protected _Complete_history(history: slave.InvokeHistory): boolean; + /** + * @hidden + */ + protected _Normalize_performance(): void; + } +} +/** + * A template for Distributed Processing System. + * + * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) + * @author Jeongho Nam + */ +declare namespace samchon.templates.distributed { + /** + * Master of Distributed Processing System. + * + * The {@link DistributedSystemArray} is an abstract class containing and managing remote distributed **slave** system + * drivers, {@link DistributedSystem} objects. Within framework of network, {@link DistributedSystemArray} represents + * your system, a **Master** of *Distributed Processing System* that requesting *distributed process* to **slave** + * systems and the children {@link DistributedSystem} objects represent the remote **slave** systems, who is being + * requested the *distributed processes*. + * + * You can specify this {@link DistributedSystemArray} class to be *a server accepting distributed clients* or + * *a client connecting to distributed servers*. Even both of them is possible. Extends one of them below and overrides + * abstract factory method(s) creating the child {@link DistributedSystem} object. + * + * - {@link DistributedClientArray}: A server accepting {@link DistributedSystem distributed clients}. + * - {@link DistributedServerArray}: A client connecting to {@link DistributedServer distributed servers}. + * - {@link DistributedServerClientArray}: Both of them. Accepts {@link DistributedSystem distributed clients} and + * connects to {@link DistributedServer distributed servers} at the same time. + * + * The {@link DistributedSystemArray} contains {@link DistributedProcess} objects directly. You can request a + * **distributed process** through the {@link DistributedProcess} object. You can access the + * {@link DistributedProcess} object(s) with those methods: + * + * - {@link hasProcess} + * - {@link getProcess} + * - {@link insertProcess} + * - {@link eraseProcess} + * - {@link getProcessMap} + * + * When you need the **distributed process**, call the {@link DistributedProcess.sendData} method. Then the + * {@link DistributedProcess} will find the most idle {@link DistributedSystem} object who represents a distributed + * **slave **system. The {@link Invoke} message will be sent to the most idle {@link DistributedSystem} object. When + * the **distributed process** has completed, then {@link DistributedSystem.getPerformance performance index} and + * {@link DistributedProcess.getResource resource index} of related objects will be revaluated. + * + * + * + * + * + * #### Parallel Process + * This {@link DistributedSystemArray} class is derived from the {@link ParallelSystemArray} class, so you can request + * a **parallel process**, too. + * + * When you need the **parallel process**, then call one of them: {@link sendSegmentData} or {@link sendPieceData}. + * When the **parallel process** has completed, {@link ParallelSystemArray} estimates each {@link ParallelSystem}'s + * {@link ParallelSystem.getPerformance performance index} basis on their execution time. Those performance indices will + * be reflected to the next **parallel process**, how much pieces to allocate to each {@link ParallelSystem}. + * + * #### Proxy Pattern + * This class {@link DistributedSystemArray} is derived from the {@link ExternalSystemArray} class. Thus, you can take + * advantage of the *Proxy Pattern* in the {@link DistributedSystemArray} class. If a process to request is not the + * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it + * may better to utilizing the *Proxy Pattern*: + * + * The {@link ExternalSystemArray} class can use *Proxy Pattern*. In framework within user, which + * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not + * important. Only interested in user's perspective is *which can be done*. + * + * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged + * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. + * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. + * + *
    + *
  • + * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring + * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. + *
  • + *
  • + * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call + * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the + * external system. + *
  • + *
  • Those strategy is called *Proxy Pattern*.
  • + *
+ * + * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) + * @author Jeongho Nam + */ + abstract class DistributedSystemArray extends parallel.ParallelSystemArray { + /** + * @hidden + */ + private process_map_; + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + construct(xml: library.XML): void; + /** + * Factory method creating a child {@link DistributedProcess process} object. + * + * @param xml {@link XML} represents the {@link DistributedProcess child} object. + * @return A new {@link DistributedProcess} object. + */ + protected abstract createProcess(xml: library.XML): DistributedProcess; + /** + * Get process map. + * + * Gets an {@link HashMap} containing {@link DistributedProcess} objects with their *key*. + * + * @return An {@link HasmMap> containing pairs of string and {@link DistributedProcess} object. + */ + getProcessMap(): std.HashMap; + /** + * Test whether the process exists. + * + * @param name Name, identifier of target {@link DistributedProcess process}. + * + * @return Whether the process has or not. + */ + hasProcess(name: string): boolean; + /** + * Get a process. + * + * @param name Name, identifier of target {@link DistributedProcess process}. + * + * @return The specified process. + */ + getProcess(name: string): DistributedProcess; + /** + * Insert a process. + * + * @param process A process to be inserted. + * @return Success flag. + */ + insertProcess(process: DistributedProcess): boolean; + /** + * Erase a process. + * + * @param name Name, identifier of target {@link DistributedProcess process}. + */ + eraseProcess(name: string): boolean; + /** + * @hidden + */ + protected _Complete_history(history: slave.InvokeHistory): boolean; + /** + * @hidden + */ + private estimate_process_resource(history); + /** + * @hidden + */ + private estimate_system_performance(history); + /** + * @hidden + */ + protected _Normalize_performance(): void; + /** + * @inheritdoc + */ + toXML(): library.XML; + } +} +declare namespace samchon.templates.distributed { + /** + * Mediator of Distributed Processing System. + * + * The {@link DistributedSystemArrayMediator} class be a master for its slave systems, and be a slave to its master + * system at the same time. This {@link DistributedSystemArrayMediator} be a master system, containing and managing + * {@link DistributedSystem} objects, which represent distributed slave systems, by extending + * {@link DistributedSystemArray} class. Also, be a slave system through {@link getMediator mediator} object, which is + * derived from the {@link SlaveSystem} class. + * + * As a master, you can specify this {@link DistributedSystemArrayMediator} class to be a master server accepting + * slave clients or a master client to connecting slave servers. Even both of them is possible. Extends one + * of them below and overrides abstract factory method(s) creating the child {@link DistributedSystem} object. + * + * - {@link DistributedClientArrayMediator}: A server accepting {@link DistributedSystem distributed clients}. + * - {@link DistributedServerArrayMediator}: A client connecting to {@link DistributedServer distributed servers}. + * - {@link DistributedServerClientArrayMediator}: Both of them. Accepts {@link DistributedSystem distributed clients} and + * connects to {@link DistributedServer distributed servers} at the same time. + * + * As a slave, you can specify this {@link DistributedSystemArrayMediator} to be a client slave connecting to master + * server or a server slave accepting master client by overriding the {@link createMediator} method. + * Overrides the {@link createMediator createMediator()} method and return one of them: + * + * - A client slave connecting to master server: + * - {@link MediatorClient} + * - {@link MediatorWebClient} + * - {@link MediatorSharedWorkerClient} + * - A server slave accepting master client: + * - {@link MediatorServer} + * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} + * - {@link MediatorSharedWorkerServer} + * + * #### [Inherited] {@link DistributedSystemArray} + * @copydoc DistributedSystemArray + */ + abstract class DistributedSystemArrayMediator extends DistributedSystemArray { + /** + * @hidden + */ + private mediator_; + /** + * Default Constructor. + */ + constructor(); + /** + * Factory method creating a {@link MediatorSystem} object. + * + * The {@link createMediator createMediator()} is an abstract method creating the {@link MediatorSystem} object. + * + * You know what? this {@link DistributedSystemArrayMediator} class be a master for its slave systems, and be a + * slave to its master system at the same time. The {@link MediatorSystem} object makes it possible; be a slave + * system. This {@link createMediator} determines specific type of the {@link MediatorSystem}. + * + * Overrides the {@link createMediator createMediator()} method to create and return one of them following which + * protocol and which type of remote connection (server or client) will be used: + * + * - A client slave connecting to master server: + * - {@link MediatorClient} + * - {@link MediatorWebClient} + * - {@link MediatorSharedWorkerClient} + * - A server slave accepting master client: + * - {@link MediatorServer} + * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} + * - {@link MediatorSharedWorkerServer} + * + * @return A newly created {@link MediatorSystem} object. + */ + protected abstract createMediator(): parallel.MediatorSystem; + /** + * Start mediator. + * + * If the {@link getMediator mediator} is a type of server, then opens the server accepting master client. + * Otherwise, the {@link getMediator mediator} is a type of client, then connects the master server. + */ + protected startMediator(): void; + /** + * Get {@link MediatorSystem} object. + * + * When you need to send an {@link Invoke} message to the master system of this + * {@link DistributedSystemArrayMediator}, then send to the {@link MediatorSystem} through this + * {@link getMediator}. + * + * ```typescript + * this.getMediator().sendData(...); + * ``` + * + * @return The {@link MediatorSystem} object. + */ + getMediator(): parallel.MediatorSystem; + /** + * @hidden + */ + protected _Complete_history(history: slave.InvokeHistory): boolean; + } +} +declare namespace samchon.protocol { + /** + * @hidden + */ + namespace socket { + type socket = any; + type server = any; + type http_server = any; + } + /** + * @hidden + */ + namespace websocket { + type connection = any; + type request = any; + type IMessage = any; + type ICookie = any; + type client = any; + } +} +declare namespace samchon.protocol { + /** + * @hidden + */ + abstract class _CommunicatorBase implements ICommunicator { + /** + * @hidden + */ + protected listener_: IProtocol; + /** + * @inheritdoc + */ + onClose: Function; + /** + * @hidden + */ + protected connected_: boolean; + /** + * @hidden + */ + private binary_invoke_; + /** + * @hidden + */ + private binary_parameters_; + /** + * @hidden + */ + private unhandled_invokes_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from *listener*. + * + * @param listener An {@link IProtocol} object to listen {@link Invoke} messages. + */ + constructor(listener: IProtocol); + /** + * @inheritdoc + */ + abstract close(): void; + /** + * @inheritdoc + */ + isConnected(): boolean; + /** + * @hidden + */ + protected _Is_binary_invoke(): boolean; + /** + * @inheritdoc + */ + abstract sendData(invoke: Invoke): void; + /** + * @inheritdoc + */ + replyData(invoke: Invoke): void; + /** + * @hidden + */ + protected _Handle_string(str: string): void; + /** + * @hidden + */ + protected _Handle_binary(binary: Uint8Array): void; + } +} +declare namespace samchon.protocol { + /** + * A communicator following Samchon Framework's own protocol. + * + * {@link Communicator} is an abstract class following Samchon Framework's own protocol. This {@link Communicator} + * class is specified to {@link ServerConnector} and {@link ClientDriver} whether the remote system is a server (that + * my system is connecting to) or a client (a client conneting to to my server). + * + * Note that, if one of this or remote system is web-browser based, then you don't have to use this + * {@link Communicator} class who follows Samchon Framework's own protocol. Web-browser supports only Web-socket + * protocol. Thus in that case, you have to use {@link WebCommunicator} instead. + * + * #### [Inherited] {@link ICommunicator} + * @copydoc ICommunicator + */ + abstract class Communicator extends _CommunicatorBase { + /** + * @hidden + */ + protected socket_: socket.socket; + /** + * @hidden + */ + private header_bytes_; + /** + * @hidden + */ + private data_; + /** + * @hidden + */ + private data_index_; + /** + * @hidden + */ + private listening_; + /** + * @inheritdoc + */ + close(): void; + /** + * @hidden + */ + protected _Start_listen(): void; + /** + * @hidden + */ + private _Handle_error(); + /** + * @hidden + */ + private _Handle_close(); + /** + * @inheritdoc + */ + sendData(invoke: Invoke): void; + /** + * @hidden + */ + private _Listen_piece(piece); + /** + * @hidden + */ + private _Listen_header(piece, piece_index); + /** + * @hidden + */ + private _Listen_data(piece, piece_index); + } +} +declare namespace samchon.protocol { + /** + * Communicator with remote client. + * + * {@link ClientDriver} is a class taking full charge of network communication with remote client who follows Samchon + * Framework's own protocol. This {@link ClientDriver} object is always created by {@link Server} class. When you got + * this {@link ClientDriver} object from the {@link Server.addClient Server.addClient()}, then specify + * {@link IProtocol listener} with the {@link ClientDriver.listen ClientDriver.listen()} method. + * + * #### [Inherited] {@link IClientDriver} + * @copydoc IClientDriver + */ + class ClientDriver extends Communicator implements IClientDriver { + /** + * Construct from a socket. + */ + constructor(socket: socket.socket); + /** + * @inheritdoc + */ + listen(listener: IProtocol): void; + } +} +declare namespace samchon.protocol { + /** + * A communicator for shared worker. + * + * {@link DedicatedWorkerCommunicator} is an abstract class for communication between DedicatedWorker and Web-browser. + * This {@link DedicatedWorkerCommunicator} is specified to {@link DedicatedWorkerServerConnector} and + * {@link DedicatedWorkerClientDriver} whether the remote system is a server (that my system is connecting to) or a + * client (a client conneting to to my server). + * + * #### Why DedicatedWorker be a server? + * In JavaScript environment, there's no way to implement multi-threading function. Instead, JavaScript supports the + * **Worker**, creating a new process. However, the **Worker** does not shares memory addresses. To integrate the + * **Worker** with its master, only communication with string or binary data is allowed. Doesn't it seem like a network + * communication? Furthermore, there's not any difference between the worker communication and network communication. + * It's the reason why Samchon Framework considers the **Worker** as a network node. + * + * The class {@link DedicatedWorkerCommunicator} is designed make such relationship. From now on, DedicatedWorker is a + * {@link DedicatedWorkerServer server} and {@link DedicatedWorkerServerConnector browser} is a client. Integrate the + * server and clients with this {@link DedicatedWorkerCommunicator}. + * + * #### [Inherited] {@link ICommunicator} + * @copydoc ICommunicator + */ + abstract class DedicatedWorkerCommunicator extends _CommunicatorBase { + /** + * @hidden + */ + protected _Handle_message(event: MessageEvent): void; + } +} +declare namespace samchon.protocol { + /** + * Communicator with master web-browser. + * + * {@link DedicatedWorkerClientDriver} is a class taking full charge of network communication with web browsers. This + * {@link DedicatedWorkerClientDriver} object is always created by {@link DedicatedWorkerServer} class. When you got + * this {@link DedicatedWorkerClientDriver} object from + * {@link DedicatedWorkerServer.addClient DedicatedWorkerServer.addClient()}, then specify {@link IProtocol listener} + * with the {@link DedicatedWorkerClientDriver.listen DedicatedWorkerClientDriver.listen()} method. + * + * #### Why DedicatedWorker be a server? + * In JavaScript environment, there's no way to implement multi-threading function. Instead, JavaScript supports the + * **Worker**, creating a new process. However, the **Worker** does not shares memory addresses. To integrate the + * **Worker** with its master, only communication with string or binary data is allowed. Doesn't it seem like a network + * communication? Furthermore, there's not any difference between the worker communication and network communication. + * It's the reason why Samchon Framework considers the **Worker** as a network node. + * + * The class {@link DedicatedWorkerCommunicator} is designed make such relationship. From now on, DedicatedWorker is a + * {@link DedicatedWorkerServer server} and {@link DedicatedWorkerServerConnector browser} is a client. Integrate the + * server and clients with this {@link DedicatedWorkerCommunicator}. + * + * #### [Inherited] {@link IClientDriver} + * @copydoc IClientDriver + */ + class DedicatedWorkerClientDriver extends DedicatedWorkerCommunicator implements IClientDriver { + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + listen(listener: IProtocol): void; + /** + * @inheritdoc + */ + close(): void; + /** + * @inheritdoc + */ + sendData(invoke: Invoke): void; + } +} +declare namespace samchon.protocol { + /** + * A communicator for shared worker. + * + * {@link SharedWorkerCommunicator} is an abstract class for communication between SharedWorker and Web-browser. This + * {@link SharedWorkerCommunicator} is specified to {@link SharedWorkerServerConnector} and + * {@link SharedWorkerClientDriver} whether the remote system is a server (that my system is connecting to) or a client + * (a client conneting to to my server). + * + * Note that, SharedWorker is a conception only existed in web-browser. This {@link SharedWorkerCommunicator} is not + * supported in NodeJS. Only web-browser environment can utilize this {@link SharedWorkerCommunicator}. + * + * #### Why SharedWorker be a server? + * SharedWorker, it allows only an instance (process) to be created whether the SharedWorker is declared in a browser + * or multiple browsers. To integrate them, messages are being sent and received. Doesn't it seem like a relationship + * between a server and clients? Thus, Samchon Framework consider the SharedWorker as a server and browsers as + * clients. + * + * The class {@link SharedWorkerCommunicator} is designed make such relationship. From now on, SharedWorker is a + * {@link SharedWorkerServer server} and {@link SharedWorkerServerConnector browsers} are clients. Integrate the + * server and clients with this {@link SharedWorkerCommunicator}. + * + * #### [Inherited] {@link ICommunicator} + * @copydoc ICommunicator + */ + abstract class SharedWorkerCommunicator extends _CommunicatorBase { + /** + * @hidden + */ + protected port_: MessagePort; + /** + * @inheritdoc + */ + close(): void; + /** + * @inheritdoc + */ + sendData(invoke: Invoke): void; + /** + * @hidden + */ + protected _Handle_message(event: MessageEvent): void; + } +} +declare namespace samchon.protocol { + /** + * Communicator with remote web-browser. + * + * {@link SharedWorkerClientDriver} is a class taking full charge of network communication with web browsers. This + * {@link SharedWorkerClientDriver} object is always created by {@link SharedWorkerServer} class. When you got this + * {@link SharedWorkerClientDriver} object from {@link SharedWorkerServer.addClient SharedWorkerServer.addClient()}, + * then specify {@link IProtocol listener} with the + * {@link SharedWorkerClientDriver.listen SharedWorkerClientDriver.listen()} method. + * + * #### Why SharedWorker be a server? + * SharedWorker, it allows only an instance (process) to be created whether the SharedWorker is declared in a browser + * or multiple browsers. To integrate them, messages are being sent and received. Doesn't it seem like a relationship + * between a server and clients? Thus, Samchon Framework consider the SharedWorker as a server and browsers as + * clients. + * + * The class {@link SharedWorkerCommunicator} is designed make such relationship. From now on, SharedWorker is a + * {@link SharedWorkerServer server} and {@link SharedWorkerServerConnector browsers} are clients. Integrate the + * server and clients with this {@link SharedWorkerCommunicator}. + * + * #### [Inherited] {@link IClientDriver} + * @copydoc IClientDriver + */ + class SharedWorkerClientDriver extends SharedWorkerCommunicator implements IClientDriver { + /** + * @hidden + */ + private listening_; + /** + * Construct from a MessagePort object. + */ + constructor(port: MessagePort); + /** + * @inheritdoc + */ + listen(listener: IProtocol): void; + } +} +declare namespace samchon.protocol { + /** + * A communicator following Web-socket protocol. + * + * {@link WebCommunicator} is an abstract class following Web-socket protocol. This {@link WebCommunicator} class is + * specified to {@link WebServerConnector} and {@link WebClientDriver} whether the remote system is a server (that my + * system is connecting to) or a client (a client conneting to to my server). + * + * Note that, one of this or remote system is web-browser based, then there's not any alternative choice. Web browser + * supports only Web-socket protocol. In that case, you've use this {@link WebCommunicator} class. + * + * #### [Inherited] {@link ICommunicator} + * @copydoc ICommunicator + */ + abstract class WebCommunicator extends _CommunicatorBase { + /** + * @hidden + */ + protected connection_: websocket.connection; + /** + * @inheritdoc + */ + close(): void; + /** + * @inheritdoc + */ + sendData(invoke: Invoke): void; + /** + * @hidden + */ + protected _Handle_message(message: websocket.IMessage): void; + /** + * @hidden + */ + protected _Handle_close(): void; + } +} +declare namespace samchon.protocol { + /** + * Communicator with remote web-client. + * + * {@link WebClientDriver} is a class taking full charge of network communication with remote client who follows + * Web-socket protocol. This {@link WebClientDriver} object is always created by {@link WebServer} class. When you + * got this {@link WebClientDriver} object from the {@link WebServer.addClient WebServer.addClient()}, then specify + * {@link IProtocol listener} with the {@link WebClientDriver.listen WebClientDriver.listen()} method. + * + * Unlike other protocol, Web-socket protocol's clients notify two parameters on their connection; + * {@link getSessionID session-id} and {@link getPath path}. The {@link getSessionID session-id} can be used to + * identify *user* of each client, and the {@link getPath path} can be used which type of *service* that client wants. + * In {@link service} module, you can see the best utilization case of them. + * - {@link service.User}: utlization of the {@link getSessionID session-id}. + * - {@link service.Service}: utilization of the {@link getPath path}. + * + * #### [Inherited] {@link IClientDriver} + * @copydoc IClientDriver + */ + class WebClientDriver extends WebCommunicator implements IClientDriver { + /** + * @hidden + */ + private path_; + /** + * @hidden + */ + private session_id_; + /** + * @hidden + */ + private listening_; + /** + * Initialization Constructor. + * + * @param connection Connection driver, a socket for web-socket. + * @param path Requested path. + * @param session_id Session ID, an identifier of the remote client. + */ + constructor(connection: websocket.connection, path: string, session_id: string); + /** + * @inheritdoc + */ + listen(listener: IProtocol): void; + /** + * Get requested path. + */ + getPath(): string; + /** + * Get session ID, an identifier of the remote client. + */ + getSessionID(): string; + } +} +declare namespace samchon.protocol { + /** + * An interface for communicator with remote client. + * + * {@link IClientDriver} is a type of {@link ICommunicator}, specified for communication with remote client who has + * connected in a {@link IServer server}. It takes full charge of network communication with the remote client. + * + * The {@link IClientDriver} object is created and delivered from {@link IServer} and + * {@link IServer.addClient IServer.addClient()}. Those are derived types from this {@link IClientDriver}, being + * created by the matched {@link IServer} object. + * + * Protocol | Derived Type | Created By + * ------------------------|-------------------------------------|---------------------------- + * Samchon Framework's own | {@link ClientDriver} | {@link Server} + * Web-socket protocol | {@link WebClientDriver} | {@link WebServer} + * DedicatedWorker | {@link DedicatedWorkerClinetDriver} | {@link DedicatedWorkerServer} + * SharedWorker | {@link SharedWorkerClientDriver} | {@link SharedWorkerServer} + * + * When you've got an {@link IClientDriver} object from the {@link IServer.addClient IServer.addClient()}, then + * specify {@link IProtocol listener} with {@link IClient.listen IClient.listen()}. Whenever a replied message comes + * from the remote system, the message will be converted to an {@link Invoke} class and the {@link Invoke} object + * will be shifted to the {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} method. + * Below code is an example specifying and managing the {@link IProtocol listener} objects. + * + * - https://github.com/samchon/framework-examples/blob/master/calculator/calculator-server.ts + * + * + * + * + * + * @see {@link IServer}, {@link IProtocol} + * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iclientdriver) + * @author Jeongho Nam + */ + interface IClientDriver extends ICommunicator { + /** + * Listen message from the newly connected client. + * + * Starts listening message from the newly connected client. Replied message from the connected client will be + * converted to {@link Invoke} classes and shifted to the *listener*'s {@link IProtocol.replyData replyData()} + * method. + * + * @param listener A listener object to listen replied message from newly connected client in + * {@link IProtocol.replyData replyData()} as an {@link Invoke} object. + */ + listen(listener: IProtocol): void; + } +} +declare namespace samchon.protocol { + /** + * An interface taking full charge of network communication. + * + * {@link ICommunicator} is an interface for communicator classes who take full charge of network communication with + * remote system, without reference to whether the remote system is a server or a client. Type of the + * {@link ICommunicator} is specified to {@link IServerConnector} and {@link IClientDriver} whether the remote system + * is a server (that I've to connect) or a client (a client connected to my server). + * + * Whenever a replied message comes from the remote system, the message will be converted to an {@link Invoke} class + * and the {@link Invoke} object will be shifted to the {@link IProtocol listener}'s + * {@link IProtocol.replyData IProtocol.replyData()} method. + * + * + * + * + * + * @see {@link IClientDriver}, {@link IServerConnector}, {@link IProtocol} + * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#icommunicator) + * @author Jeongho Nam + */ + interface ICommunicator extends IProtocol { + /** + * Callback function for connection closed. + */ + onClose: Function; + /** + * Close connection. + */ + close(): void; + /** + * Test connection. + * + * Test whether this {@link ICommunicator communicator} object is connected with the remote system. If the + * connection is alive, then returns ```true```. Otherwise, the connection is not alive or this + * {@link ICommunicator communicator has not connected with the remote system yet, then returns ```false```. + * + * @return true if connected, otherwise false. + */ + isConnected(): boolean; + /** + * Send message. + * + * Send {@link Invoke} message to remote system. + * + * @param invoke An {@link Invoke} message to send. + */ + sendData(invoke: protocol.Invoke): void; + /** + * Handle replied message. + * + * Handles replied {@link Invoke} message recived from remove system. The {@link Invoke} message will be shifted + * to the {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} by this method. + * + * @param invoke An {@link Invoke} message received from remote system. + */ + replyData(invoke: protocol.Invoke): void; + } +} +declare namespace samchon.protocol { + /** + * An interface for server connector. + * + * {@link IServerConnector} is a type of {@link ICommunicator}, specified for server connector classes who connect to + * the remote server as a client. {@link IServerConnector} provides {@link connect connection method} and takes full + * charge of network communication with the remote server. + * + * Declare specific type of {@link IServerConnector} from {@link IProtocol listener} and call the + * {@link connect connect()} method. Then whenever a replied message comes from the remote system, the message will + * be converted to an {@link Invoke} object and the {@link Invoke} object will be shifted to the + * {@link IProtocol listener}'s {@link IProtocol.replyData IProtocol.replyData()} method. Below code is an example + * connecting to remote server and interacting with it. + * + * - https://github.com/samchon/framework-examples/blob/master/calculator/calculator-application.ts + * + * Note that, protocol of this client and remote server must be matched. Thus, before determining specific type of + * this {@link IServerConnector}, you've to consider which protocol and type the remote server follows. + * + * Protocol | Derived Type | Connect to + * ------------------------|----------------------------------------|------------------------------- + * Samchon Framework's own | {@link ServerConnector} | {@link Server} + * Web-socket protocol | {@link WebServerConnector} | {@link WebServer} + * DedicatedWorker | {@link DedicatedWorkerServerConnector} | {@link DedicatedWorkerServer} + * SharedWorker | {@link SharedWorkerServerConnector} | {@link SharedWorkerServer} + * + * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_basic_components.png) + * + * @see {@link IServer}, {@link IProtocol} + * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserverconnector) + * @author Jeongho Nam + */ + interface IServerConnector extends ICommunicator { + /** + * Callback function for connection completed. + * + * When you call {@link connect connect()} and the connection has completed, then this call back function + * {@link onConnect} will be called. Note that, if the listener of this {@link onConnect} is a member method of + * some class, then you've use the ```bind```. + */ + onConnect: Function; + /** + * Connect to a server. + * + * Connects to a server with specified *host* address and *port* number. After the connection has + * succeeded, callback function {@link onConnect} is called. Listening data from the connected server also begins. + * Replied messages from the connected server will be converted to {@link Invoke} classes and will be shifted to + * the {@link WebCommunicator.listener listener}'s {@link IProtocol.replyData replyData()} method. + * + * If the connection fails immediately, either an event is dispatched or an exception is thrown: an error + * event is dispatched if a host was specified, and an exception is thrown if no host was specified. Otherwise, + * the status of the connection is reported by an event. If the socket is already connected, the existing + * connection is closed first. + * + * @param ip The name or IP address of the host to connect to. + * If no host is specified, the host that is contacted is the host where the calling file resides. + * If you do not specify a host, use an event listener to determine whether the connection was + * successful. + * @param port The port number to connect to. + */ + connect(ip: string, port: number): void; + } +} +declare namespace samchon.protocol { + /** + * A server connector for DedicatedWorker. + * + * {@link DedicatedWorkerServerConnector} is a class connecting to SharedWorker and taking full charge of network + * communication with the SharedWorker. Create an {@link DedicatedWorkerServer} instance from the + * {@IProtocol listener} and call the {@link connect connect()} method. + * + * #### Why DedicatedWorker be a server? + * In JavaScript environment, there's no way to implement multi-threading function. Instead, JavaScript supports the + * **Worker**, creating a new process. However, the **Worker** does not shares memory addresses. To integrate the + * **Worker** with its master, only communication with string or binary data is allowed. Doesn't it seem like a network + * communication? Furthermore, there's not any difference between the worker communication and network communication. + * It's the reason why Samchon Framework considers the **Worker** as a network node. + * + * The class {@link DedicatedWorkerCommunicator} is designed make such relationship. From now on, DedicatedWorker is a + * {@link DedicatedWorkerServer server} and {@link DedicatedWorkerServerConnector browser} is a client. Integrate the + * server and clients with this {@link DedicatedWorkerCommunicator}. + * + * #### [Inherited] {@link IServerConnector} + * @copydoc IServerConnector + */ + class DedicatedWorkerServerConnector extends DedicatedWorkerCommunicator implements IServerConnector { + /** + * @hidden + */ + private worker_; + /** + * @inheritdoc + */ + onConnect: Function; + /** + * Construct from *listener*. + * + * @param listener A listener object to listen replied message from newly connected client in + * {@link IProtocol.replyData replyData()} as an {@link Invoke} object. + */ + constructor(listener: IProtocol); + /** + * @inheritdoc + */ + connect(jsFile: string): void; + /** + * @inheritdoc + */ + close(): void; + /** + * @inheritdoc + */ + sendData(invoke: Invoke): void; + } +} +declare namespace samchon.protocol { + /** + * Server connnector. + * + * {@link ServerConnector} is a class connecting to remote server who follows Samchon Framework's own protocol and + * taking full charge of network communication with the remote server. Create a {@link ServerConnector} instance from + * the {@IProtocol listener} and call the {@link connect connect()} method. + * + * #### [Inherited] {@link IServerConnector} + * @copydoc IServerConnector + */ + class ServerConnector extends Communicator implements IServerConnector { + /** + * @inheritdoc + */ + onConnect: Function; + /** + * Construct from *listener*. + * + * @param listener A listener object to listen replied message from newly connected client in + * {@link IProtocol.replyData replyData()} as an {@link Invoke} object. + */ + constructor(listener: IProtocol); + /** + * @inheritdoc + */ + connect(ip: string, port: number): void; + /** + * @hidden + */ + private _Handle_connect(...arg); + /** + * @hidden + */ + private _Send_dummy_packet_repeatedly(); + } +} +declare namespace samchon.protocol { + /** + * A server connector for SharedWorker. + * + * {@link SharedWorkerServerConnector} is a class connecting to SharedWorker and taking full charge of network + * communication with the SharedWorker. Create an {@link SharedWorkerServerConnector} instance from the + * {@IProtocol listener} and call the {@link connect connect()} method. + * + * #### Why SharedWorker be a server? + * SharedWorker, it allows only an instance (process) to be created whether the SharedWorker is declared in a browser + * or multiple browsers. To integrate them, messages are being sent and received. Doesn't it seem like a relationship + * between a server and clients? Thus, Samchon Framework consider the SharedWorker as a server and browsers as + * clients. + * + * The class {@link SharedWorkerCommunicator} is designed make such relationship. From now on, SharedWorker is a + * {@link SharedWorkerServer server} and {@link SharedWorkerServerConnector browsers} are clients. Integrate the + * server and clients with this {@link SharedWorkerCommunicator}. + * + * #### [Inherited] {@link IServerConnector} + * @copydoc IServerConnector + */ + class SharedWorkerServerConnector extends SharedWorkerCommunicator implements IServerConnector { + /** + * @inheritdoc + */ + onConnect: Function; + /** + * Construct from *listener*. + * + * @param listener A listener object to listen replied message from newly connected client in + * {@link IProtocol.replyData replyData()} as an {@link Invoke} object. + */ + constructor(listener: IProtocol); + /** + * Connect to a SharedWorker. + * + * Connects to a server with specified *jstFile* path. If a SharedWorker instance of the *jsFile* is not + * constructed yet, then the SharedWorker will be newly constructed. Otherwise the SharedWorker already exists, + * then connect to the SharedWorker. After those processes, callback function {@link onConnect} is called. + * Listening data from the connected server also begins. Replied messages from the connected server will be + * converted to {@link Invoke} classes and will be shifted to the {@link WebCommunicator.listener listener}'s + * {@link IProtocol.replyData replyData()} method. + * + * If the connection fails immediately, either an event is dispatched or an exception is thrown: an error + * event is dispatched if a host was specified, and an exception is thrown if no host was specified. Otherwise, + * the status of the connection is reported by an event. If the socket is already connected, the existing + * connection is closed first. + * + * @param jsFile Path of JavaScript file to execute who defines SharedWorker. + */ + connect(jsFile: string): void; + } +} +declare namespace samchon.protocol { + /** + * A server connector for web-socket protocol. + * + * {@link WebServerConnector} is a class connecting to remote server who follows Web-socket protocol and taking full + * charge of network communication with the remote server. Create an {@link WebServerConnector} instance from the + * {@IProtocol listener} and call the {@link connect connect()} method. + * + * #### [Inherited] {@link IServerConnector} + * @copydoc IServerConnector + */ + class WebServerConnector extends WebCommunicator implements IServerConnector { + /** + * @hidden + */ + private browser_socket_; + /** + * @hidden + */ + private node_client_; + /** + * @inheritdoc + */ + onConnect: Function; + /** + * Construct from *listener*. + * + * @param listener A listener object to listen replied message from newly connected client in + * {@link IProtocol.replyData replyData()} as an {@link Invoke} object. + */ + constructor(listener: IProtocol); + /** + * Connect to a web server. + * + * Connects to a server with specified *host* address, *port* number and *path*. After the connection has + * succeeded, callback function {@link onConnect} is called. Listening data from the connected server also begins. + * Replied messages from the connected server will be converted to {@link Invoke} classes and will be shifted to + * the {@link WebCommunicator.listener listener}'s {@link IProtocol.replyData replyData()} method. + * + * If the connection fails immediately, either an event is dispatched or an exception is thrown: an error + * event is dispatched if a host was specified, and an exception is thrown if no host was specified. Otherwise, + * the status of the connection is reported by an event. If the socket is already connected, the existing + * connection is closed first. + * + * @param ip The name or IP address of the host to connect to. + * If no host is specified, the host that is contacted is the host where the calling file resides. + * If you do not specify a host, use an event listener to determine whether the connection was + * successful. + * @param port The port number to connect to. + * @param path Path of service which you want. + */ + connect(ip: string, port: number, path?: string): void; + /** + * @inheritdoc + */ + close(): void; + /** + * @inheritdoc + */ + sendData(invoke: Invoke): void; + /** + * @hidden + */ + private _Handle_browser_connect(event); + /** + * @hidden + */ + private _Handle_browser_message(event); + /** + * @hidden + */ + private _Handle_node_connect(connection); + } +} +declare namespace samchon.protocol { + /** + * A container of entity, and it's a type of entity, too. + * + * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_message_protocol.png) + * + * @handbook [Protocol - Standard Message](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Standard_Message) + * @author Jeongho Nam + */ + interface IEntityGroup extends IEntity, std.base.Container { + /** + * Construct data of the Entity from an XML object. + * + * Constructs the EntityArray's own member variables only from the input XML object. + * + * Do not consider about constructing children Entity objects' data in EntityArray::construct(). + * Those children Entity objects' data will constructed by their own construct() method. Even insertion + * of XML objects representing children are done by abstract method of EntityArray::toXML(). + * + * Constructs only data of EntityArray's own. + */ + construct(xml: library.XML): void; + /** + * Factory method of a child Entity. + * + * EntityArray::createChild() is a factory method creating a new child Entity which is belonged + * to the EntityArray. This method is called by EntityArray::construct(). The children construction + * methods Entity::construct() will be called by abstract method of the EntityArray::construct(). + * + * @return A new child Entity belongs to EntityArray. + */ + createChild(xml: library.XML): T; + /** + * Get iterator to element. + * + * Searches the container for an element with a identifier equivalent to *key* and returns an + * iterator to it if found, otherwise it returns an iterator to {@link end end()}. + * + * Two keys are considered equivalent if the container's comparison object returns false reflexively + * (i.e., no matter the order in which the elements are passed as arguments). + * + * Another member functions, {@link has has()} and {@link count count()}, can be used to just check + * whether a particular *key* exists. + * + * @param key Key to be searched for + * @return An iterator to the element, if an element with specified *key* is found, or + * {@link end end()} otherwise. + */ + /** + * Whether have the item or not. + * + * Indicates whether a map has an item having the specified identifier. + * + * @param key Key value of the element whose mapped value is accessed. + * + * @return Whether the map has an item having the specified identifier. + */ + has(key: any): boolean; + /** + * Count elements with a specific key. + * + * Searches the container for elements whose key is *key* and returns the number of elements found. + * + * @param key Key value to be searched for. + * + * @return The number of elements in the container with a *key*. + */ + count(key: any): number; + /** + * Get an element + * + * Returns a reference to the mapped value of the element identified with *key*. + * + * @param key Key value of the element whose mapped value is accessed. + * + * @throw exception out of range + * + * @return A reference object of the mapped value (_Ty) + */ + get(key: any): T; + /** + * A tag name of children objects. + */ + CHILD_TAG(): string; + /** + * Get an XML object represents the EntityArray. + * + * Archives the EntityArray's own member variables only to the returned XML object. + * + * Do not consider about archiving children Entity objects' data in EntityArray::toXML(). + * Those children Entity objects will converted to XML object by their own toXML() method. The + * insertion of XML objects representing children are done by abstract method of + * EntityArray::toXML(). + * + * Archives only data of EntityArray's own. + */ + toXML(): library.XML; + } + /** + * @hidden + */ + namespace IEntityGroup { + /** + * @hidden + */ + function construct(entityGroup: IEntityGroup, xml: library.XML, ...prohibited_names: string[]): void; + /** + * @hidden + */ + function toXML(group: IEntityGroup, ...prohibited_names: string[]): library.XML; + function has(entityGroup: IEntityGroup, key: any): boolean; + function count(entityGroup: IEntityGroup, key: any): number; + function get(entityGroup: IEntityGroup, key: any): T; + } +} +declare namespace samchon.protocol { + /** + * @inheritdoc + */ + abstract class EntityArray extends std.Vector implements IEntityGroup { + /** + * @inheritdoc + */ + construct(xml: library.XML): void; + /** + * @inheritdoc + */ + abstract createChild(xml: library.XML): T; + /** + * @inheritdoc + */ + key(): any; + /** + * @inheritdoc + */ + has(key: any): boolean; + /** + * @inheritdoc + */ + count(key: any): number; + /** + * @inheritdoc + */ + get(key: any): T; + /** + * @inheritdoc + */ + abstract TAG(): string; + /** + * @inheritdoc + */ + abstract CHILD_TAG(): string; + /** + * @inheritdoc + */ + toXML(): library.XML; + } +} +declare namespace samchon.protocol { + /** + * @inheritdoc + */ + abstract class EntityList extends std.List implements IEntityGroup { + /** + * @inheritdoc + */ + construct(xml: library.XML): void; + /** + * @inheritdoc + */ + abstract createChild(xml: library.XML): T; + /** + * @inheritdoc + */ + key(): any; + /** + * @inheritdoc + */ + has(key: any): boolean; + /** + * @inheritdoc + */ + count(key: any): number; + /** + * @inheritdoc + */ + get(key: any): T; + /** + * @inheritdoc + */ + abstract TAG(): string; + /** + * @inheritdoc + */ + abstract CHILD_TAG(): string; + /** + * @inheritdoc + */ + toXML(): library.XML; + } +} +declare namespace samchon.protocol { + /** + * @inheritdoc + */ + abstract class EntityDeque extends std.Deque implements IEntityGroup { + /** + * @inheritdoc + */ + construct(xml: library.XML): void; + /** + * @inheritdoc + */ + abstract createChild(xml: library.XML): T; + /** + * @inheritdoc + */ + key(): any; + /** + * @inheritdoc + */ + has(key: any): boolean; + /** + * @inheritdoc + */ + count(key: any): number; + /** + * @inheritdoc + */ + get(key: any): T; + /** + * @inheritdoc + */ + abstract TAG(): string; + /** + * @inheritdoc + */ + abstract CHILD_TAG(): string; + /** + * @inheritdoc + */ + toXML(): library.XML; + } +} +declare namespace samchon.protocol { + /** + * Standard message of network I/O. + * + * {@link Invoke} is a class used in network I/O in protocol package of Samchon Framework. + * + * The Invoke message has an XML structure like the result screen of provided example in below. + * We can enjoy lots of benefits by the normalized and standardized message structure used in + * network I/O. + * + * The greatest advantage is that we can make any type of network system, even how the system + * is enourmously complicated. As network communication message is standardized, we only need to + * concentrate on logical relationships between network systems. We can handle each network system + * like a object (class) in OOD. And those relationships can be easily designed by using design + * pattern. + * + * In Samchon Framework, you can make any type of network system with basic componenets + * (IProtocol, IServer and ICommunicator) by implemens or inherits them, like designing + * classes of S/W architecture. + * + * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_message_protocol.png) + * + * @see {@link IProtocol} + * @author Jeongho Nam + */ + class Invoke extends EntityArray { + /** + * Listener, represent function's name. + */ + private listener; + /** + * Default Constructor. + */ + constructor(); + constructor(listener: string); + /** + * Copy Constructor. + * + * @param invoke + */ + constructor(invoke: Invoke); + /** + * Construct from listener and parametric values. + * + * @param listener + * @param parameters + */ + constructor(listener: string, ...parameters: Array); + /** + * @inheritdoc + */ + createChild(xml: library.XML): InvokeParameter; + /** + * Get listener. + */ + getListener(): string; + /** + * Get arguments for Function.apply(). + * + * @return An array containing values of the contained parameters. + */ + getArguments(): Array; + /** + * Apply to a matched function. + * + * @param obj Target object to find matched function. + * @return Whether succeded to find matched function. + */ + apply(obj: Object): boolean; + /** + * Apply to a function. + * + * @param thisArg Owner of the function. + * @param func Function to call. + */ + apply(thisArg: Object, func: Function): void; + /** + * @inheritdoc + */ + TAG(): string; + /** + * @inheritdoc + */ + CHILD_TAG(): string; + } +} +declare namespace samchon.protocol { + /** + * A parameter belongs to an Invoke. + * + * ![Class Diagram](http://samchon.github.io/framework/images/design/ts_class_diagram/protocol_message_protocol.png) + * + * @author Jeongho Nam + */ + class InvokeParameter extends Entity { + /** + * Name of the parameter. + * + * @details Optional property, can be omitted. + */ + protected name: string; + /** + * Type of the parameter. + */ + protected type: string; + /** + * Value of the parameter. + */ + protected value: boolean | number | string | library.XML | Uint8Array; + /** + * Default Constructor. + */ + constructor(); + constructor(val: boolean); + constructor(val: number); + constructor(val: string); + constructor(val: library.XML); + constructor(val: Uint8Array); + /** + * Construct from variable name and number value. + * + * @param name + * @param val + */ + constructor(name: string, val: boolean); + constructor(name: string, val: number); + constructor(name: string, val: string); + constructor(name: string, val: library.XML); + constructor(name: string, val: Uint8Array); + /** + * @inheritdoc + */ + construct(xml: library.XML): void; + setValue(value: boolean): void; + setValue(value: number): void; + setValue(value: string): void; + setValue(value: library.XML): void; + setValue(value: Uint8Array): void; + /** + * @inheritdoc + */ + key(): any; + /** + * Get name. + */ + getName(): string; + /** + * Get type. + */ + getType(): string; + /** + * Get value. + */ + getValue(): any; + /** + * @inheritdoc + */ + TAG(): string; + /** + * @inheritdoc + */ + toXML(): library.XML; + } +} +declare namespace samchon.protocol { + /** + * An interface for {@link Invoke} message chain. + * + * {@link IProtocol} is an interface for {@link Invoke} message, which is standard message of network I/O in + * *Samchon Framework*, chain. The {@link IProtocol} interface is used to network drivers and some classes which are + * in a relationship of *Chain of Responsibility Pattern* with those network drivers. + * + * Implements {@link IProtocol} if the class sends and handles {@link Invoke} messages. Looking around source codes of + * the *Samchon Framework*, especially *Templates*, you can find out that all the classes and modules handling + * {@link Invoke} messages are always implementing this {@link IProtocol}. + * + * + * + * + * + * @see {@link Invoke} + * @handbook https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iprotocol + * @author Jeongho Nam + */ + interface IProtocol { + /** + * Sending message. + * + * Sends message to related system or shifts the responsibility to chain. + * + * @param invoke Invoke message to send + */ + replyData(invoke: Invoke): void; + /** + * Handling replied message. + * + * Handles replied message or shifts the responsibility to chain. + * + * @param invoke An {@link Invoke} message has received. + */ + sendData(invoke: Invoke): void; + } +} +declare namespace samchon.protocol { + /** + * A DeidcatedWorker server. + * + * The {@link DedicatedWorkerServer} is an abstract class is realized to open a DedicatedWorker server and accept + * web-browser client (master). Extends this {@link DedicatedWorkerServer} class and overrides + * {@link addClient addClient()} method to define what to do with a newly connected + * {@link DedicatedWorkerClientDriver remote client}. + * + * #### Why DedicatedWorker be a server? + * In JavaScript environment, there's no way to implement multi-threading function. Instead, JavaScript supports the + * **Worker**, creating a new process. However, the **Worker** does not shares memory addresses. To integrate the + * **Worker** with its master, only communication with string or binary data is allowed. Doesn't it seem like a network + * communication? Furthermore, there's not any difference between the worker communication and network communication. + * It's the reason why Samchon Framework considers the **Worker** as a network node. + * + * The class {@link DedicatedWorkerCommunicator} is designed make such relationship. From now on, DedicatedWorker is a + * {@link DedicatedWorkerServer server} and {@link DedicatedWorkerServerConnector browser} is a client. Integrate the + * server and clients with this {@link DedicatedWorkerCommunicator}. + * + * #### [Inherited] {@link IServer} + * @copydoc IServer + */ + abstract class DedicatedWorkerServer implements IServer { + /** + * @inheritdoc + */ + abstract addClient(driver: DedicatedWorkerClientDriver): void; + /** + * @inheritdoc + */ + open(): void; + /** + * @inheritdoc + */ + close(): void; + } +} +declare namespace samchon.protocol { + /** + * A substitute {@link DedicatedWorkerServer}. + * + * The {@link DedicatedWorkerServerBase} is a substitute class who subrogates {@link DedicatedWorkerServer}'s + * responsibility. + * + * #### [Inherited] {@link IServerBase} + * @copydoc IServerBase + */ + class DedicatedWorkerServerBase extends DedicatedWorkerServer implements IServerBase { + /** + * @hidden + */ + private hooker_; + /** + * Construct from a *hooker*. + * + * @param hooker A hooker throwing responsibility of server's role. + */ + constructor(hooker: IServer); + /** + * @inheritdoc + */ + addClient(driver: IClientDriver): void; + } +} +declare namespace samchon.protocol { + /** + * An interface for substitute server classes. + * + * {@link IServerBase} is an interface for substitue server classes who subrogate server's role. + * + * The easiest way to defining a server class is to extending one of them below, who implemented the {@link IServer}. + * However, it is impossible (that is, if the class is already extending another class), you can instead implement + * the {@link IServer} interface, create an {@link IServerBase} member, and write simple hooks to route calls into + * the aggregated {@link IServerBase}. + * + * Protocol | {@link IServer} | {@link IServerBase} | {@link IClientDriver} + * ------------------------|-------------------------------|-----------------------------------|------------------------------------- + * Samchon Framework's own | {@link Server} | {@link ServerBase} | {@link ClientDriver} + * Web-socket protocol | {@link WebServer} | {@link WebServerBase} | {@link WebClientDriver} + * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerServerBase} | {@link DedicatedWorkerClientDriver} + * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerServerBase} | {@link SharedWorkerClientDriver} + * + * After the hooking to aggregated {@link IServerBase} object, overrides {@link addClient addClient()} method who + * accepts a newly connected client as an {@link IClientDriver} object. At last, call {@link open open()} method with + * specified port number. + * + * ```typescript + * class MyServer extends Something implements IServer + * { + * private server_base_: IServerBase = new WebServerBase(this); + * + * public addClient(driver: IClientDriver): void + * { + * // WHAT TO DO WHEN A CLIENT HAS CONNECTED + * } + * + * public open(port: number): void + * { + * this.server_base_.open(); + * } + * public close(): void + * { + * this.server_base_.close(); + * } + * } + * ``` + * + * + * + * + * + * @see {@link IServer}, {@link IClientDriver} + * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserverbase) + * @author Jeongho Nam + */ + interface IServerBase extends IServer { + } +} +declare namespace samchon.protocol { + /** + * A server. + * + * The {@link Server} is an abstract class designed to open a server and accept clients who are following Samchon + * Framework's own protocol. Extends this {@link Server} class and overrides {@link addClient addClient()} method to + * define what to do with newly connected {@link ClientDriver remote clients}. + * + * #### [Inherited] {@link IServer} + * @copydoc Server + */ + abstract class Server implements IServer { + /** + * @hidden + */ + private net_driver_; + /** + * @inheritdoc + */ + abstract addClient(driver: ClientDriver): void; + /** + * @inheritdoc + */ + open(port: number): void; + /** + * @inheritdoc + */ + close(): void; + /** + * @hidden + */ + private _Handle_connect(socket); + } +} +declare namespace samchon.protocol { + /** + * A substitute {@link Server}. + * + * The {@link ServerBase} is a substitute class who subrogates {@link Server}'s responsibility. + * + * #### [Inherited] {@link IServerBase} + * @copydoc IServerBase + */ + class ServerBase extends Server implements IServerBase { + /** + * @hidden + */ + private hooker_; + /** + * Construct from a *hooker*. + * + * @param hooker A hooker throwing responsibility of server's role. + */ + constructor(hooker: IServer); + /** + * @inheritdoc + */ + addClient(driver: IClientDriver): void; + } +} +declare namespace samchon.protocol { + /** + * A SharedWorker server. + * + * The {@link SharedWorker} is an abstract class is realized to open a SharedWorker server and accept web-browser + * clients. Extends this {@link SharedWorkerServer} class and overrides {@link addClient addClient()} method to + * define what to do with newly connected {@link SharedWorkerClientDriver remote clients}. + * + * #### Why SharedWorker be a server? + * SharedWorker, it allows only an instance (process) to be created whether the SharedWorker is declared in a browser + * or multiple browsers. To integrate them, messages are being sent and received. Doesn't it seem like a relationship + * between a server and clients? Thus, Samchon Framework consider the SharedWorker as a server and browsers as + * clients. + * + * The class {@link SharedWorkerCommunicator} is designed make such relationship. From now on, SharedWorker is a + * {@link SharedWorkerServer server} and {@link SharedWorkerServerConnector browsers} are clients. Integrate the + * server and clients with this {@link SharedWorkerCommunicator}. + * + * #### [Inherited] {@link IServer} + * @copydoc IServer + */ + abstract class SharedWorkerServer implements IServer { + /** + * @inheritdoc + */ + abstract addClient(driver: SharedWorkerClientDriver): void; + /** + * @inheritdoc + */ + open(): void; + /** + * @inheritdoc + */ + close(): void; + /** + * @hidden + */ + private _Handle_connect(event); + } +} +declare namespace samchon.protocol { + /** + * A substitute {@link SharedWorkerServer}. + * + * The {@link SharedWorkerServerBase} is a substitute class who subrogates {@link SharedWorkerServer}'s + * responsibility. + * + * #### [Inherited] {@link IServerBase} + * @copydoc IServerBase + */ + class SharedWorkerServerBase extends SharedWorkerServer implements IServerBase { + /** + * @hidden + */ + private hooker_; + /** + * Construct from a *hooker*. + * + * @param hooker A hooker throwing responsibility of server's role. + */ + constructor(hooker: IServer); + /** + * @inheritdoc + */ + addClient(driver: IClientDriver): void; + } +} +declare namespace samchon.protocol { + /** + * A web server. + * + * The {@link WebServer} is an abstract class designed to open a server and accept clients who are following + * web-socket protocol. Extends this {@link WebServer} class and overrides {@link addClient addClient()} method to + * define what to do with newly connected {@link WebClientDriver remote clients}. + * + * #### [Inherited] {@link IServer} + * @copydoc IServer + */ + abstract class WebServer implements IServer { + /** + * @hidden + */ + private http_server_; + /** + * @hidden + */ + private sequence_; + /** + * @hidden + */ + private my_port_; + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + abstract addClient(driver: WebClientDriver): void; + /** + * @inheritdoc + */ + open(port: number): void; + /** + * @inheritdoc + */ + close(): void; + /** + * @hidden + */ + private _Handle_request(request); + /** + * @hidden + */ + private _Fetch_session_id(cookies); + /** + * @hidden + */ + private _Issue_session_id(); + } +} +declare namespace samchon.protocol { + /** + * A substitute {@link WebServer}. + * + * The {@link WebServerBase} is a substitute class who subrogates {@link WebServer}'s responsibility. + * + * #### [Inherited] {@link IServerBase} + * @copydoc IServerBase + */ + class WebServerBase extends WebServer implements IServerBase { + /** + * @hidden + */ + private hooker_; + /** + * Construct from a *hooker*. + * + * @param hooker A hooker throwing responsibility of server's role. + */ + constructor(hooker: IServer); + /** + * @inheritdoc + */ + addClient(driver: IClientDriver): void; + } +} +declare namespace samchon.protocol { + /** + * An interface for a server. + * + * {@link IServer} is an interfaec for server classes who are providing methods for {@link open opening a server} and + * {@link IClientDriver accepting clients}. + * + * To open a server, extends one of derived class under below considedring which protocol to follow first. At next, + * overrides {@link addClient addClient()} method who accepts a newly connected client as an {@link IClientDriver} + * object. Then at last, call {@link open open()} method with specified port number. + * + * Protocol | Derived Type | Related {@link IClientDriver} + * ------------------------|-------------------------------|------------------------------------- + * Samchon Framework's own | {@link Server} | {@link ClientDriver} + * Web-socket protocol | {@link WebServer} | {@link WebClientDriver} + * DedicatedWorker | {@link DedicatedWorkerServer} | {@link DedicatedWorkerClientDriver} + * SharedWorker | {@link SharedWorkerServer} | {@link SharedWorkerClientDriver} + * + * Below codes and classes will be good examples for comprehending how to open a server and handle remote clients. + * - https://github.com/samchon/framework-examples/blob/master/calculator/calculator-server.ts + * - https://github.com/samchon/framework-examples/blob/master/chat-server/server.ts + * - {@link service.Server} + * - {@link external.ExternalClientArray} + * - {@link slave.SlaveServer} + * + * If you're embarrased because your class already extended another one, then use {@link IServerBase}. + * + * + * + * + * + * @see {@link IClientDriver}, {@link IServerBase} + * @handbook [Protocol - Basic Components](https://github.com/samchon/framework/wiki/TypeScript-Protocol-Basic_Components#iserver) + * @author Jeongho Nam + */ + interface IServer { + /** + * Open server. + * + * @param port Port number to open. + */ + open(port: number): void; + /** + * Close server. + * + * Close opened server. All remote clients, have connected with this server, are also closed and their call back + * functions, for closed connection, {@link IClientDriver.onClose} are also called. + */ + close(): void; + /** + * Add a newly connected remote client. + * + * The {@link addClient addClient()} is an abstract method being called when a remote client is newly connected + * with {@link IClientDriver} object who communicates with the remote system. Overrides this method and defines + * what to do with the *driver*, a newly connected remote client. + * + * Below methods and example codes may be good for comprehending how to utilize this {@link addClient} method. + * + * - https://github.com/samchon/framework-examples/blob/master/calculator/calculator-server.ts + * - https://github.com/samchon/framework-examples/blob/master/chat-server/server.ts + * - {@link service.Server.addClient} + * - {@link external.ExternalClientArray.addClient} + * - {@link slave.SlaveServer.addClient} + * + * @param driver A {@link ICommunicator communicator} with (newly connected) remote client. + */ + addClient(driver: IClientDriver): void; + } +} +declare namespace samchon.templates.distributed { + /** + * Master of Distributed Processing System, a server accepting slave clients. + * + * The {@link DistributedClientArray} is an abstract class, derived from the {@link DistributedSystemArray} class, + * opening a server accepting {@link DistributedSystem distributed clients}. + * + * Extends this {@link DistributedClientArray}, overrides {@link createServerBase createServerBase()} to determine + * which protocol to follow and {@link createExternalClient createExternalClient()} creating child + * {@link DistributedSystem} object. After the extending and overridings, open this server using the + * {@link open open()} method. + * + * #### [Inherited] {@link DistributedSystemArray} + * @copydoc DistributedSystemArray + */ + abstract class DistributedClientArray extends DistributedSystemArray implements external.IExternalClientArray { + /** + * @hidden + */ + private server_base_; + /** + * Default Constructor. + */ + constructor(); + /** + * Factory method creating {@link IServerBase} object. + * + * This method {@link createServerBase createServerBase()} determines which protocol is used in this server, + * {@link ExternalClientArray}. If the protocol is determined, then {@link ExternalSystem external clients} who + * may connect to {@link ExternalClientArray this server} must follow the specified protocol. + * + * Overrides the {@link createServerBase createServerBase()} method to create and return one of them: + * + * - {@link ServerBase} + * - {@link WebServerBase} + * - {@link SharedWorkerServerBase} + * + * @return A new {@link IServerBase} object. + */ + protected abstract createServerBase(): protocol.IServerBase; + /** + * Add a newly connected remote client. + * + * When a {@link IClientDriver remote client} connects to this *master server of parallel processing system*, + * then this {@link ParallelClientArray} creates a child {@link ParallelSystem parallel client} object through + * the {@link createExternalClient createExternalClient()} method and {@link insert inserts} it. + * + * @param driver A communicator for external client. + */ + addClient(driver: protocol.IClientDriver): void; + /** + * (Deprecated) Factory method creating child object. + * + * The method {@link createChild createChild()} is deprecated. Don't use and override this. + * + * Note that, the {@link ParallelClientArray} is a server accepting {@link ParallelSystem parallel clients}. + * There's no way to creating the {@link ParallelSystem parallel clients} in advance before opening the server. + * + * @param xml An {@link XML} object represents the child {@link ParallelSystem} object. + * @return ```null``` + */ + createChild(xml: library.XML): System; + /** + * Factory method creating {@link DistributedSystem} object. + * + * The method {@link createExternalClient createExternalClient()} is a factory method creating a child + * {@link ParallelSystem} object, that is called whenever a parallel client has connected, by + * {@link addClient addClient()}. + * + * Overrides this {@link createExternalClient} method and creates a type of {@link DistributedSystem} object with + * the *driver* that communicates with the parallel client. After the creation, returns the object. Then whenever + * a parallel client has connected, matched {@link DistributedSystem} object will be constructed and + * {@link insert inserted} into this {@link DistributedSystemArray} object. + * + * @param driver A communicator with the parallel client. + * @return A newly created {@link ParallelSystem} object. + */ + protected abstract createExternalClient(driver: protocol.IClientDriver): System; + /** + * @inheritdoc + */ + open(port: number): void; + /** + * @inheritdoc + */ + close(): void; + } +} +declare namespace samchon.templates.distributed { + /** + * Mediator of Distributed Processing System, a server accepting slave clients. + * + * The {@link DistributedClientArrayMediator} is an abstract class, derived from {@link DistributedSystemArrayMediator} + * class, opening a server accepting {@link DistributedSystem distributed clients} as a **master**. + * + * Extends this {@link DistributedClientArrayMediator}, overrides {@link createServerBase createServerBase()} to + * determine which protocol to follow and {@link createExternalClient createExternalClient()} creating child + * {@link DistributedSystem} object. After the extending and overridings, open this server using the + * {@link open open()} method. + * + * #### [Inherited] {@link DistributedSystemArrayMediator} + * @copydoc DistributedSystemArrayMediator + */ + abstract class DistributedClientArrayMediator extends DistributedSystemArrayMediator implements external.IExternalClientArray { + /** + * A subrogator of {@link IServer server}'s role instead of this {@link ExternalClientArray}. + */ + private server_base_; + /** + * Default Constructor. + */ + constructor(); + /** + * Factory method creating {@link IServerBase} object. + * + * This method {@link createServerBase createServerBase()} determines which protocol is used in this + * {@link DistributedClientArrayMediator} object as a **master**. If the protocol is determined, then + * {@link DistributedSystem distributed clients} who may connect to {@link DistributedClientArrayMediator this + * server} must follow the specified protocol. + * + * Overrides the {@link createServerBase createServerBase()} method to create and return one of them: + * + * - {@link ServerBase} + * - {@link WebServerBase} + * - {@link SharedWorkerServerBase} + * + * @return A new {@link IServerBase} object. + */ + protected abstract createServerBase(): protocol.IServerBase; + /** + * Add a newly connected remote client. + * + * When a {@link IClientDriver remote client} connects to this *master server of distributed processing system*, + * then this {@link DistributedClientArrayMediator} creates a child {@link Distributed distributed client} object + * through the {@link createExternalClient createExternalClient()} method. + * + * @param driver A communicator for external client. + */ + addClient(driver: protocol.IClientDriver): void; + /** + * (Deprecated) Factory method creating child object. + * + * The method {@link createChild createChild()} is deprecated. Don't use and override this. + * + * Note that, the {@link DistributedClientArrayMediator} is a server accepting {@link DistributedSystem distributed + * clients} as a master. There's no way to creating the {@link DistributedSystem distributed clients} in advance + * before opening the server. + * + * @param xml An {@link XML} object represents the child {@link DistributedSystem} object. + * @return null + */ + createChild(xml: library.XML): System; + /** + * Factory method creating {@link DistributedSystem} object. + * + * The method {@link createExternalClient createExternalClient()} is a factory method creating a child + * {@link DistributedSystem} object, that is called whenever a distributed client has connected, by + * {@link addClient addClient()}. + * + * Overrides this {@link createExternalClient} method and creates a type of {@link DistributedSystem} object with + * the *driver* that communicates with the distributed client. After the creation, returns the object. Then whenever + * a distributed client has connected, matched {@link DistributedSystem} object will be constructed and + * {@link insert inserted} into this {@link DistributedClientArrayMediator} object. + * + * @param driver A communicator with the distributed client. + * @return A newly created {@link DistributedSystem} object. + */ + protected abstract createExternalClient(driver: protocol.IClientDriver): System; + /** + * @inheritdoc + */ + open(port: number): void; + /** + * @inheritdoc + */ + close(): void; + } +} +declare namespace samchon.templates.external { + /** + * An external system driver. + * + * The {@link ExternalSystem} class represents an external system, connected and interact with this system. + * {@link ExternalSystem} takes full charge of network communication with the remote, external system have connected. + * Replied {@link Invoke} messages from the external system is shifted to and processed in, children elements of this + * class, {@link ExternalSystemRole} objects. + * + * + * + * + * + * #### Bridge & Proxy Pattern + * The {@link ExternalSystem} class can be a *bridge* for *logical proxy*. In framework within user, + * which {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not + * important. Only interested in user's perspective is *which can be done*. + * + * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged + * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. + * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. + * + *
    + *
  • + * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring + * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. + *
  • + *
  • + * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call + * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the + * external system. + *
  • + *
  • Those strategy is called *Bridge Pattern* and *Proxy Pattern*.
  • + *
+ * + * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) + * @author Jeongho Nam + */ + abstract class ExternalSystem extends protocol.EntityDequeCollection implements protocol.IProtocol { + /** + * The name represents external system have connected. + */ + protected name: string; + /** + * @hidden + */ + private system_array_; + /** + * @hidden + */ + private communicator_; + /** + * Construct from parent {@link ExternalSystemArray}. + * + * @param systemArray The parent {@link ExternalSystemArray} object. + */ + constructor(systemArray: ExternalSystemArray); + /** + * Constrct from parent {@link ExternalSystemArray} and communicator. + * + * @param systemArray The parent {@link ExternalSystemArray} object. + * @param communicator Communicator with the remote, external system. + */ + constructor(systemArray: ExternalSystemArray, communicator: protocol.IClientDriver); + /** + * Default Destructor. + * + * This {@link destructor destructor()} method is called when the {@link ExternalSystem} object is destructed and + * the {@link ExternalSystem} object is destructed when connection with the remote system is closed or this + * {@link ExternalSystem} object is {@link ExternalSystemArray.erase erased} from its parent + * {@link ExternalSystemArray} object. + * + * Note that, don't call this {@link destructor destructor()} method by yourself. It must be called automatically + * by those *destruction* cases. Also, if your derived {@link ExternalSystem} class has something to do on the + * *destruction*, then overrides this {@link destructor destructor()} method and defines the something to do. + * Overriding this {@link destructor destructor()}, don't forget to calling ```super.destructor();``` on tail. + * + * ```typescript + * class SomeSystem extends templates.external.ExternalSystem + * { + * protected destructor(): void + * { + * // DO SOMETHING + * this.do_something(); + * + * // CALL SUPER.DESTRUCTOR() ON TAIL. DON'T FORGET THIS + * super.destructor(); + * } + * } + * ``` + */ + protected destructor(): void; + /** + * @hidden + */ + private _Handle_close(); + /** + * Get parent {@link ExternalSystemArray} object. + */ + getSystemArray(): ExternalSystemArray; + /** + * Get parent {@link ExternalSystemArray} object. + */ + getSystemArray>(): SystemArray; + /** + * Identifier of {@link ExternalSystem} is its {@link name}. + * + * @return name. + */ + key(): string; + /** + * Get {@link name}. + */ + getName(): string; + /** + * @hidden + */ + /** + * @hidden + */ + protected communicator: protocol.ICommunicator; + /** + * Close connection. + */ + close(): void; + /** + * Send {@link Invoke} message to external system. + * + * @param invoke An {@link Invoke} message to send. + */ + sendData(invoke: protocol.Invoke): void; + /** + * Handle an {@Invoke} message has received. + * + * @param invoke An {@link Invoke} message have received. + */ + replyData(invoke: protocol.Invoke): void; + /** + * Tag name of the {@link ExternalSystem} in {@link XML}. + * + * @return *system*. + */ + TAG(): string; + /** + * Tag name of {@link ExternalSystemRole children elements} belonged to the {@link ExternalSystem} in {@link XML}. + * + * @return *role*. + */ + CHILD_TAG(): string; + } +} +declare namespace samchon.templates.parallel { + /** + * A driver for a parallel slave system. + * + * The {@link ParallelSystem} is an abstract class represents a **slave** system in *Parallel Processing System*, + * connected with this **master** system. This {@link ParallelSystem} takes full charge of network communication with + * the remote, parallel **slave** system has connected. + * + * When a *parallel process* is requested (by {@link ParallelSystemArray.sendSegmentData} or + * {@link ParallelSystemArray.sendPieceData}), the number of pieces to be allocated to a {@link ParallelSystem} is + * turn on its {@link getPerformance performance index}. Higher {@link getPerformance performance index}, then + * more pieces are requested. The {@link getPerformance performance index} is revaluated whenever a *parallel process* + * has completed, basic on the execution time and number of pieces. You can sugguest or enforce the + * {@link getPerformance performance index} with {@link setPerformance} or {@link enforcePerformance}. + * + * + * + * + * + * #### Bridge & Proxy Pattern + * This class {@link ParallelSystem} is derived from the {@link ExternalSystem} class. Thus, you can take advantage + * of the *Bridge & Proxy Pattern* in this {@link ParallelSystem} class. If a process to request is not the + * *parallel process* (to be distrubted to all slaves), but the **exclusive process** handled in a system, then it + * may better to utilizing the *Bridge & Proxy Pattern*: + * + * The {@link ExternalSystem} class can be a *bridge* for *logical proxy*. In framework within user, + * which {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not + * important. Only interested in user's perspective is *which can be done*. + * + * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged + * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. + * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. + * + *
    + *
  • + * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring + * from {@link ExternalSystem}, with {@link ExternalSystemArray.getRole}. + *
  • + *
  • + * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call + * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the + * external system. + *
  • + *
  • Those strategy is called *Bridge Pattern* and *Proxy Pattern*.
  • + *
+ * + * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) + * @author Jeongho Nam + */ + abstract class ParallelSystem extends external.ExternalSystem { + /** + * @hidden + */ + private progress_list_; + /** + * @hidden + */ + private history_list_; + /** + * @hidden + */ + private exclude_; + /** + * @hidden + */ + private performance; + /** + * @hidden + */ + private enforced_; + /** + * Construct from parent {@link ParallelSystemArray}. + * + * @param systemArray The parent {@link ParallelSystemArray} object. + */ + constructor(systemArray: ParallelSystemArray); + /** + * Construct from parent {@link ParallelSystemArray} and communicator. + * + * @param systemArray The parent {@link ParallelSystemArray} object. + * @param communicator A communicator communicates with remote, the external system. + */ + constructor(systemArray: ParallelSystemArray, communicator: protocol.IClientDriver); + /** + * Default Destructor. + * + * This {@link destructor destructor()} method is called when the {@link ParallelSystem} object is destructed and + * the {@link ParallelSystem} object is destructed when connection with the remote system is closed or this + * {@link ParallelSystem} object is {@link ParallelSystemArray.erase erased} from its parent + * {@link ParallelSystemArray} object. + * + * You may think if there're some *parallel processes* have requested but not completed yet, then it would be a + * critical problem because the *parallel processes* will not complete forever. Do not worry. The critical problem + * does not happen. After the destruction, the remained *parallel processes* will be shifted to and proceeded in + * other {@link ParallelSystem} objects. + * + * Note that, don't call this {@link destructor destructor()} method by yourself. It must be called automatically + * by those *destruction* cases. Also, if your derived {@link ParallelSystem} class has something to do on the + * *destruction*, then overrides this {@link destructor destructor()} method and defines the something to do. + * Overriding this {@link destructor destructor()}, don't forget to calling ```super.destructor();``` on tail. + * + * ```typescript + * class SomeSystem extends protocol.external.ExternalSystem + * { + * protected destructor(): void + * { + * // DO SOMETHING + * this.do_something(); + * + * // CALL SUPER.DESTRUCTOR() ON TAIL. DON'T FORGET THIS + * super.destructor(); + * } + * } + * ``` + */ + protected destructor(): void; + /** + * Get manager of this object. + * + * @return The parent {@link ParallelSystemArray} object. + */ + getSystemArray(): ParallelSystemArray; + /** + * Get manager of this object. + * + * @return The parent {@link ParallelSystemArray} object. + */ + getSystemArray>(): SystemArray; + /** + * Get performance index. + * + * Get *performance index* that indicates how much fast the remote system is. + * + * If this {@link ParallelSystem parallel system} does not have any {@link Invoke} message had handled, then the + * *performance index* will be ```1.0```, which means default and average value between all {@link ParallelSystem} + * instances (that are belonged to a same {@link ParallelSystemArray} object). + * + * You can specify this *performance index* by yourself but notice that, if the *performance index* is higher + * than other {@link ParallelSystem} objects, then this {@link ParallelSystem parallel system} will be ordered to + * handle more processes than other {@link ParallelSystem} objects. Otherwise, the *performance index* is lower + * than others, of course, less processes will be delivered. + * + * - {@link setPerformance setPerformance()} + * - {@link enforcePerformance enforcePerformance()} + * + * Unless {@link enforcePerformance enforcePerformance()} is called, This *performance index* is **revaluated** + * whenever user calls one of them below. + * + * - {@link ParallelSystemArray.sendSegmentData ParallelSystemArray.sendSegmentData()} + * - {@link ParallelSystemArray.sendPieceData ParallelSystemArray.sendPieceData()} + * - {@link DistributedProcess.sendData DistributedProcess.sendData()}. + * + * @return Performance index. + */ + getPerformance(): number; + /** + * Set performance index. + * + * Set *performance index* that indicates how much fast the remote system is. This *performance index* can be + * **revaulated**. + * + * Note that, initial and average *performance index* of {@link ParallelSystem} objects are ```1.0```. If the + * *performance index* is higher than other {@link ParallelSystem} objects, then this {@link ParallelSystem} will + * be ordered to handle more processes than other {@link ParallelSystem} objects. Otherwise, the + * *performance index* is lower than others, of course, less processes will be delivered. + * + * Unlike {@link enforcePerformance}, configuring *performance index* by this {@link setPerformance} allows + * **revaluation**. This **revaluation** prevents wrong valuation from user. For example, you *mis-valuated* the + * *performance index*. The remote system is much faster than any other, but you estimated it to the slowest one. + * It looks like a terrible case that causes {@link ParallelSystemArray entire parallel systems} to be slower, + * however, don't mind. The system will direct to the *propriate performance index* eventually with the + * **revaluation** by following methods. + * + * - {@link ParallelSystemArray.sendSegmentData ParallelSystemArray.sendSegmentData()} + * - {@link ParallelSystemArray.sendPieceData ParallelSystemArray.sendPieceData()} + * - {@link DistributedProcess.sendData DistributedProcess.sendData()}. + * + * @param val New performance index, but can be revaluated. + */ + setPerformance(val: number): void; + /** + * Enforce performance index. + * + * Enforce *performance index* that indicates how much fast the remote system is. The *performance index* will be + * fixed, never be **revaluated**. + * + * Note that, initial and average *performance index* of {@link ParallelSystem} objects are ```1.0```. If the + * *performance index* is higher than other {@link ParallelSystem} objects, then this {@link ParallelSystem} will + * be ordered to handle more processes than other {@link ParallelSystem} objects. Otherwise, the + * *performance index* is lower than others, of course, less processes will be delivered. + * + * The difference between {@link setPerformance} and this {@link enforcePerformance} is allowing **revaluation** + * or not. This {@link enforcePerformance} does not allow the **revaluation**. The *performance index* is clearly + * fixed and never be changed by the **revaluation**. But you've to keep in mind that, you can't avoid the + * **mis-valuation** with this {@link enforcePerformance}. + * + * For example, there's a remote system much faster than any other, but you **mis-estimated** it to the slowest. + * In that case, there's no way. The {@link ParallelSystemArray entire parallel systems} will be slower by the + * **mis-valuation**. By the reason, using {@link enforcePerformance}, it's recommended only when you can clearly + * certain the *performance index*. If you can't certain the *performance index* but want to recommend, then use + * {@link setPerformance} instead. + * + * @param val New performance index to be fixed. + */ + enforcePerformance(val: number): void; + /** + * @hidden + */ + private _Send_piece_data(invoke, first, last); + /** + * @hidden + */ + private _Reply_data(invoke); + /** + * @hidden + */ + protected _Report_history(xml: library.XML): void; + /** + * @hidden + */ + protected _Send_back_history(invoke: protocol.Invoke, history: slave.InvokeHistory): void; + } +} +declare namespace samchon.templates.distributed { + /** + * A driver for a distributed slave system. + * + * The {@link DistributedSystem} is an abstract class represents a **slave** system in *Distributed Processing System*, + * connected with this **master** system. This {@link DistributedSystem} takes full charge of network communication + * with the remote, distributed **slave** system has connected. + * + * This {@link DistributedSystem} has a {@link getPerformance performance index} that indicates how much the **slave** + * system is fast. The {@link getPerformance performance index} is referenced and revaluated whenever those methods + * are called: + * + * - Requesting a *parallel process* + * - {@link DistributedSystemArray.sendSegmentData} + * - {@link DistributedSystemArray.sendPieceData} + * - Requesting a *distributed process*: {@link DistributedProcess.sendData} + * + * Note that, this {@link DistributedSystem} class derived from the {@link ExternalSystem} class. Thus, this + * {@link DistributedSystem} can also have children {@link ExternalSystemRole} objects exclusively. However, the + * children {@link ExternalSystemRole roles} objects are different with the {@link DistributedProcess}. The + * domestic {@link ExternalSystemRole roles} are belonged to only a specific {@link DistributedSystem} object. + * Otherwise, the {@link DistributedProcess} objects are belonged to a {@link DistributedSystemArray} object. + * Furthermore, the relationship between this {@link DistributedSystem} and {@link DistributedProcess} classes are + * **M: N Associative**. + * + * Articles | {@link DistributedProcess} | {@link ExternalSystemRole} + * -------------|--------------------------------|---------------------------- + * Belonged to | {@link DistributedSystemArray} | {@link DistributedSystem} + * Relationship | M: N Associative | 1: N Composite + * Ownership | References | Exclusive possession + * + * + * + * + * + * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) + * @author Jeongho Nam + */ + abstract class DistributedSystem extends parallel.ParallelSystem { + /** + * Construct from parent {@link DistributedSystemArray}. + * + * @param systemArray The parent {@link DistributedSystemArray} object. + */ + constructor(systemArray: DistributedSystemArray); + /** + * Constrct from parent {@link DistributedSystemArray} and communicator. + * + * @param systemArray The parent {@link DistributedSystemArray} object. + * @param communicator A communicator communicates with remote, the external system. + */ + constructor(systemArray: DistributedSystemArray, communicator: protocol.IClientDriver); + /** + * Factory method creating a {@link ExternalSystemRole child} object. + * + * In {@link distributed} module, the process class {@link DistributedProcess} is not belonged to a specific + * {@link DistributedSystem} object. It only belongs to a {@link DistributedSystemArray} object and has a + * **M: N Associative Relationship** between this {@link DistributedSystem} class. + * + * By that reason, it's the normal case that the {@link DistributedSystem} object does not have any children + * {@link ExternalSystemRole} object. Thus, default {@link createChild} returns ```null```. + * + * However, if you want a {@link DistributedSystem} to have its own domestic {@link ExternalSystemRole} objects + * without reference to the {@link DistributedProcess} objects, it is possible. Creates and returns the + * domestic {@link ExternalSystemRole} object. + * + * @param xml {@link XML} represents the {@link ExternalSystemRole child} object. + * @return A newly created {@link ExternalSystemRole} object or ```null```. + */ + createChild(xml: library.XML): external.ExternalSystemRole; + /** + * Get manager of this object. + * + * @return The parent {@link DistributedSystemArray} object. + */ + getSystemArray(): DistributedSystemArray; + /** + * Get manager of this object. + * + * @return The parent {@link DistributedSystemArray} object. + */ + getSystemArray>(): SystemArray; + /** + * @hidden + */ + private _Compute_average_elapsed_time(); + /** + * @inheritdoc + */ + replyData(invoke: protocol.Invoke): void; + /** + * @hidden + */ + protected _Report_history(xml: library.XML): void; + /** + * @hidden + */ + protected _Send_back_history(invoke: protocol.Invoke, history: slave.InvokeHistory): void; + } +} +declare namespace samchon.templates.distributed { + /** + * A driver for distributed slave server. + * + * The {@link DistributedServer} is an abstract class, derived from the {@link DistributedSystem} class, connecting to + * remote, distributed **slave** server. Extends this {@link DistributedServer} class and overrides the + * {@link createServerConnector createServerConnector()} method following which protocol the **slave** server uses. + * + * #### [Inheritdoc] {@link DistributedSystem} + * @copydoc DistributedSystem + */ + abstract class DistributedServer extends DistributedSystem implements external.IExternalServer { + /** + * IP address of target external system to connect. + */ + protected ip: string; + /** + * Port number of target external system to connect. + */ + protected port: number; + /** + * Construct from parent {@link DistributedSystemArray}. + * + * @param systemArray The parent {@link DistributedSystemArray} object. + */ + constructor(systemArray: DistributedSystemArray); + /** + * Factory method creating {@link IServerConnector} object. + * + * The {@link createServerConnector createServerConnector()} is an abstract method creating + * {@link IServerConnector} object. Overrides and returns one of them, considering which protocol the slave server + * follows: + * + * - {@link ServerConnector} + * - {@link WebServerConnector} + * - {@link DedicatedWorkerServerConnector} + * - {@link SharedWorkerServerConnector} + * + * @return A newly created {@link IServerConnector} object. + */ + protected abstract createServerConnector(): protocol.IServerConnector; + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.templates.distributed { + /** + * Master of Distributed Processing System, a client connecting to slave servers. + * + * The {@link DistributedServerArray} is an abstract class, derived from the {@link DistributedSystemArray} class, + * connecting to {@link IDistributedServer distributed servers}. + * + * Extends this {@link DistributedServerArray} and overrides {@link createChild createChild()} method creating child + * {@link IDistributedServer} object. After the extending and overriding, construct children {@link IDistributedServer} + * objects and call the {@link connect connect()} method. + * + * #### [Inherited] {@link DistributedSystemArray} + * @copydoc DistributedSystemArray + */ + abstract class DistributedServerArray extends DistributedSystemArray implements external.IExternalServerArray { + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.templates.distributed { + /** + * Mediator of Distributed Processing System, a client connecting to slave servers. + * + * The {@link DistributedServerArrayMediator} is an abstract class, derived from {@link DistributedSystemArrayMediator} + * class, connecting to {@link IDistributedServer distributed servers}. + * + * Extends this {@link DistributedServerArrayMediator} and overrides {@link createChild createChild()} method creating + * child {@link IDistributedServer} object. After the extending and overriding, construct children + * {@link IDistributedServer} objects and call the {@link connect connect()} method. + * + * #### [Inherited] {@link DistributedSystemArrayMediator} + * @copydoc DistributedSystemArrayMediator + */ + abstract class DistributedServerArrayMediator extends DistributedSystemArrayMediator implements external.IExternalServerArray { + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.templates.distributed { + /** + * Master of Distributed Processing System, be a server and client at the same time. + * + * The {@link DistributedServerClientArray} is an abstract class, derived from the {@link DistributedSystemArray} + * class, opening a server accepting {@link Distributed distributed clients} and being a client connecting to + * {@link IDistributedServer distributed servers} at the same time. + * + * Extends this {@link DistributedServerClientArray} and overrides below methods. After the overridings, open server + * with {@link open open()} method and connect to {@link IDistributedServer distributed servers} through the + * {@link connect connect()} method. + * + * - {@link createServerBase createServerBase()} + * - {@link createExternalClient createExternalClient()} + * - {@link createExternalServer createExternalServer()} + * + * #### [Inherited] {@link DistributedSystemArray} + * @copydoc DistributedSystemArray + */ + abstract class DistributedServerClientArray extends DistributedClientArray implements external.IExternalServerClientArray { + /** + * Default Constructor. + */ + constructor(); + /** + * Factory method of a child Entity. + * + * This method is migrated to {@link createExternalServer}. Override the {@link createExternalServer} method. + * + * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. + * @return A new child Entity via {@link createExternalServer createExternalServer()}. + */ + createChild(xml: library.XML): System; + /** + * Factory method creating an {@link IDistributedServer} object. + * + * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. + * @return A newly created {@link IDistributedServer} object. + */ + protected abstract createExternalServer(xml: library.XML): System; + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.templates.distributed { + /** + * Mediator of Distributed Processing System, be a server and client at the same time as a **master**. + * + * The {@link DistributedServerClientArrayMediator} is an abstract class, derived from the + * {@link DistributedSystemArrayMediator} class, opening a server accepting {@link DistributedSystem distributed + * clients} and being a client connecting to {@link IDistributedServer distributed servers} at the same time. + * + * Extends this {@link DistributedServerClientArrayMediator} and overrides below methods. After the overridings, open + * server with {@link open open()} method and connect to {@link IDistributedServer distributed servers} through the + * {@link connect connect()} method. + * + * - {@link createServerBase createServerBase()} + * - {@link createExternalClient createExternalClient()} + * - {@link createExternalServer createExternalServer()} + * + * #### [Inherited] {@link DistributedSystemArrayMediator} + * @copydoc DistributedSystemArrayMediator + */ + abstract class DistributedServerClientArrayMediator extends DistributedClientArrayMediator implements external.IExternalServerClientArray { + /** + * Default Constructor. + */ + constructor(); + /** + * Factory method of a child Entity. + * + * This method is migrated to {@link createExternalServer}. Override the {@link createExternalServer} method. + * + * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. + * @return A new child Entity via {@link createExternalServer createExternalServer()}. + */ + createChild(xml: library.XML): System; + /** + * Factory method creating an {@link IDistributedServer} object. + * + * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. + * @return A newly created {@link IDistributedServer} object. + */ + protected abstract createExternalServer(xml: library.XML): System; + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.templates.distributed { + /** + * A process of Distributed Processing System. + * + * The {@link DistributedProcess} is an abstract class who represents a **process**, *SOMETHING TO DISTRIBUTE* in a Distributed + * Processing System. Overrides the {@link DistributedProcess} and defines the *SOMETHING TO DISTRIBUTE*. + * + * Relationship between {@link DistributedSystem} and {@link DistributedProcess} objects are **M: N Associative**. + * Unlike {@link ExternalSystemRole}, the {@link DistributedProcess} objects are not belonged to a specific + * {@link DistributedSystem} object. The {@link DistributedProcess} objects are belonged to the + * {@link DistributedSystemArrayMediator} directly. + * + * When you need the **distributed process**, then call {@link sendData sendData()}. The {@link sendData} will find + * the most idle {@link DistributedSystem slave system} considering not only number of processes on progress, but also + * {@link DistributedSystem.getPerformance performance index} of each {@link DistributedSystem} object and + * {@link getResource resource index} of this {@link DistributedProcess} object. The {@link Invoke} message + * requesting the **distributed process** will be sent to the most idle {@link DistributedSystem slave system}. + * + * Those {@link DistributedSystem.getPerformance performance index} and {@link getResource resource index} are + * revaluated whenever the **distributed process** has completed basis on the execution time. + * + * + * + * + * + * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) + * @author Jeongho Nam + */ + abstract class DistributedProcess extends protocol.Entity implements protocol.IProtocol { + /** + * @hidden + */ + private system_array_; + /** + * A name, represents and identifies this {@link DistributedProcess process}. + * + * This {@link name} is an identifier represents this {@link DistributedProcess process}. This {@link name} is + * used in {@link DistributedSystemArray.getProcess} and {@link DistributedSystemArray.getProcess}, as a key elements. + * Thus, this {@link name} should be unique in its parent {@link DistributedSystemArray} object. + */ + protected name: string; + /** + * @hidden + */ + private progress_list_; + /** + * @hidden + */ + private history_list_; + /** + * @hidden + */ + private resource; + /** + * @hidden + */ + private enforced_; + /** + * Constrct from parent {@link DistributedSystemArray} object. + * + * @param systemArray The parent {@link DistributedSystemArray} object. + */ + constructor(systemArray: DistributedSystemArray); + /** + * Identifier of {@link ParallelProcess} is its {@link name}. + */ + key(): string; + /** + * Get parent {@link DistributedSystemArray} object. + * + * @return The parent {@link DistributedSystemArray} object. + */ + getSystemArray(): DistributedSystemArray; + /** + * Get parent {@link DistributedSystemArray} object. + * + * @return The parent {@link DistributedSystemArray} object. + */ + getSystemArray>(): SystemArray; + /** + * Get name, who represents and identifies this process. + */ + getName(): string; + /** + * Get resource index. + * + * Get *resource index* that indicates how much this {@link DistributedProcess process} is heavy. + * + * If this {@link DistributedProcess process} does not have any {@link Invoke} message had handled, then the + * *resource index* will be ```1.0```, which means default and average value between all + * {@link DistributedProcess} instances (that are belonged to a same {@link DistributedSystemArray} object). + * + * You can specify the *resource index* by yourself, but notice that, if the *resource index* is higher than + * other {@link DistributedProcess} objects, then this {@link DistributedProcess process} will be ordered to + * handle less processes than other {@link DistributedProcess} objects. Otherwise, the *resource index* is + * lower than others, of course, much processes will be requested. + * + * - {@link setResource setResource()} + * - {@link enforceResource enforceResource()} + * + * Unless {@link enforceResource enforceResource()} is called, This *resource index* is **revaluated** whenever + * {@link sendData sendData()} is called. + * + * @return Resource index. + */ + getResource(): number; + /** + * Set resource index. + * + * Set *resource index* that indicates how much this {@link DistributedProcess process} is heavy. This + * *resource index* can be **revaulated**. + * + * Note that, initial and average *resource index* of {@link DistributedProcess} objects are ```1.0```. If the + * *resource index* is higher than other {@link DistributedProcess} objects, then this + * {@link DistributedProcess} will be ordered to handle more processes than other {@link DistributedProcess} + * objects. Otherwise, the *resource index* is lower than others, of course, less processes will be requested. + * + * Unlike {@link enforceResource}, configuring *resource index* by this {@link setResource} allows the + * **revaluation**. This **revaluation** prevents wrong valuation from user. For example, you *mis-valuated* the + * *resource index*. The {@link DistributedProcess process} is much heavier than any other, but you estimated it + * to the lightest one. It looks like a terrible case that causes + * {@link DistributedSystemArray entire distributed processing system} to be slower, however, don't mind. The + * {@link DistributedProcess process} will the direct to the *propriate resource index* eventually with the + * **revaluation**. + * + * - The **revaluation** is caused by the {@link sendData sendData()} method. + * + * @param val New resource index, but can be revaluated. + */ + setResource(val: number): void; + /** + * Enforce resource index. + * + * Enforce *resource index* that indicates how much heavy the {@link DistributedProcess process is}. The + * *resource index* will be fixed, never be **revaluated**. + * + * Note that, initial and average *resource index* of {@link DistributedProcess} objects are ```1.0```. If the + * *resource index* is higher than other {@link DistributedProcess} objects, then this + * {@link DistributedProcess} will be ordered to handle more processes than other {@link DistributedProcess} + * objects. Otherwise, the *resource index* is lower than others, of course, less processes will be requested. + * + * The difference between {@link setResource} and this {@link enforceResource} is allowing **revaluation** or not. + * This {@link enforceResource} does not allow the **revaluation**. The *resource index* is clearly fixed and + * never be changed by the **revaluation**. But you've to keep in mind that, you can't avoid the **mis-valuation** + * with this {@link enforceResource}. + * + * For example, there's a {@link DistributedProcess process} much heavier than any other, but you + * **mis-estimated** it to the lightest. In that case, there's no way. The + * {@link DistributedSystemArray entire distributed processing system} will be slower by the **mis-valuation**. + * By the reason, using {@link enforceResource}, it's recommended only when you can clearly certain the + * *resource index*. If you can't certain the *resource index* but want to recommend, then use {@link setResource} + * instead. + * + * @param val New resource index to be fixed. + */ + enforceResource(val: number): void; + /** + * @hidden + */ + private _Compute_average_elapsed_time(); + /** + * @inheritdoc + */ + abstract replyData(invoke: protocol.Invoke): void; + /** + * Send an {@link Invoke} message. + * + * Sends an {@link Invoke} message requesting a **distributed process**. The {@link Invoke} message will be sent + * to the most idle {@link DistributedSystem} object, which represents a slave system, and the most idle + * {@link DistributedSystem} object will be returned. + * + * When the **distributed process** has completed, then the {@link DistributedSystemArray} object will revaluate + * {@link getResource resource index} and {@link DistributedSystem.getPerformance performance index} of this + * {@link DistributedSystem} and the most idle {@link DistributedSystem} objects basis on the execution time. + * + * @param invoke An {@link Invoke} message requesting distributed process. + * @return The most idle {@link DistributedSystem} object who may send the {@link Invoke} message. + */ + sendData(invoke: protocol.Invoke): DistributedSystem; + /** + * Send an {@link Invoke} message. + * + * Sends an {@link Invoke} message requesting a **distributed process**. The {@link Invoke} message will be sent + * to the most idle {@link DistributedSystem} object, which represents a slave system, and the most idle + * {@link DistributedSystem} object will be returned. + * + * When the **distributed process** has completed, then the {@link DistributedSystemArray} object will revaluate + * {@link getResource resource index} and {@link DistributedSystem.getPerformance performance index} of this + * {@link DistributedSystem} and the most idle {@link DistributedSystem} objects basis on the execution time. + * + * @param invoke An {@link Invoke} message requesting distributed process. + * @param weight Weight of resource which indicates how heavy this {@link Invoke} message is. Default is 1. + * + * @return The most idle {@link DistributedSystem} object who may send the {@link Invoke} message. + */ + sendData(invoke: protocol.Invoke, weight: number): DistributedSystem; + /** + * @hidden + */ + private _Complete_history(history); + /** + * @inheritdoc + */ + TAG(): string; + } +} +declare namespace samchon.templates.slave { + /** + * History of an {@link Invoke} message. + * + * The {@link InvokeHistory} is a class archiving history log of an {@link Invoke} message with elapsed time. This + * {@link InvokeHistory} class is used to report elapsed time of handling a requested process from **slave** to + * **master** system. + * + * The **master** system utilizes derived {@link InvokeHistory} objects to compute performance indices. + * - {@link ParallelSytem.getPerformance} + * - {@link DistributedProcess.getResource} + * + * @author Jeongho Nam + */ + class InvokeHistory extends protocol.Entity { + /** + * @hidden + */ + private uid; + /** + * @hidden + */ + private listener; + /** + * @hidden + */ + private start_time_; + /** + * @hidden + */ + private end_time_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from an {@link Invoke} message. + * + * @param invoke An {@link Invoke} message requesting a *parallel or distributed process*. + */ + constructor(invoke: protocol.Invoke); + /** + * @inheritdoc + */ + construct(xml: library.XML): void; + /** + * Complete the history. + * + * Completes the history and determines the {@link getEndTime end time}. + */ + complete(): void; + key(): number; + /** + * Get unique ID. + */ + getUID(): number; + /** + * Get {@link Invoke.getListener listener} of the {@link Invoke} message. + */ + getListener(): string; + /** + * Get start time. + */ + getStartTime(): Date; + /** + * Get end time. + */ + getEndTime(): Date; + /** + * Compute elapsed time. + * + * @return nanoseconds. + */ + computeElapsedTime(): number; + /** + * @inheritdoc + */ + TAG(): string; + /** + * @inheritdoc + */ + toXML(): library.XML; + /** + * Convert to an {@link Invoke} message. + * + * Creates and returns an {@link Invoke} message that is used to reporting to the **master**. + */ + toInvoke(): protocol.Invoke; + } +} +declare namespace samchon.templates.distributed { + /** + * History of an {@link Invoke} message. + * + * The {@link PRInvokeHistory} is a class archiving history log of an {@link Invoke} message which requests the + * *distributed process*, created whenever {@link DistributedProcess.sendData} is called. + * + * When the *distributed process* has completed, then {@link complete complete()} is called and the *elapsed time* is + * determined. The elapsed time is utilized for computation of {@link DistributedSystem.getPerformance performance index} + * and {@link DistributedProcess.getResource resource index} of related objects. + * + * + * + * + * + * @handbook [Templates - Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) + * @author Jeongho Nam + */ + class DSInvokeHistory extends slave.InvokeHistory { + /** + * @hidden + */ + private system_; + /** + * @hidden + */ + private process_; + /** + * @hidden + */ + private weight_; + /** + * Construct from a DistributedSystem. + * + * @param system The {@link DistributedSystem} object who sent the {@link Invoke} message. + */ + constructor(system: DistributedSystem); + /** + * Initilizer Constructor. + * + * @param system The {@link DistributedSystem} object who sent the {@link Invoke} message. + * @param process The {@link DistributedProcess} object who sent the {@link Invoke} message. + * @param invoke An {@link Invoke} message requesting the *distributed process*. + * @param weight Weight of resource which indicates how heavy this {@link Invoke} message is. + */ + constructor(system: DistributedSystem, process: DistributedProcess, invoke: protocol.Invoke, weight: number); + /** + * @inheritdoc + */ + construct(xml: library.XML): void; + /** + * Get the related {@link DistributedSystem} object. + */ + getSystem(): DistributedSystem; + /** + * Get the related {@link DistributedProcess} object. + */ + getProcess(): DistributedProcess; + /** + * Get weight. + * + * Gets weight of resource which indicates how heavy this {@link Invoke} message is. Default is 1. + */ + getWeight(): number; + /** + * @inheritdoc + */ + toXML(): library.XML; + } +} +declare namespace samchon.templates.distributed { + /** + * An interface for a distributed slave server driver. + * + * The easiest way to defining a driver for distributed **slave** server is extending {@link DistributedServer} class. + * However, if you've to interact with a prallel **slave** system who can be both server and client, them make a class + * (let's name it **BaseSystem**) extending the {@link DistributedServer} class. At next, make a new class (now, I name + * it **BaseServer**) extending the **BaseSystem** and implements this interface {@link IParallelServer}. Define the + * **BaseServer** following those codes on below: + * + * + * + * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) + * @author Jeongho Nam + */ + interface IDistributedServer extends DistributedSystem { + /** + * Connect to external server. + */ + connect(): void; + } +} +declare namespace samchon.templates.external { + /** + * An array and manager of {@link ExternalSystem external clients} as a server. + * + * The {@link ExternalClientArray} is an abstract class, derived from the {@link ExternalSystemArray} class, opening + * a server accepting {@link ExternalSystem external clients}. + * + * Extends this {@link ExternalClientArray}, overrides {@link createServerBase createServerBase()} to determine which + * protocol to follow and {@link createExternalClient createExternalClient()} creating child {@link ExternalSystem} + * object. After the extending and overridings, open this server using the {@link open open()} method. + * + * #### [Inherited] {@link ExternalSystemArray} + * @copydoc ExternalSystemArray + */ + abstract class ExternalClientArray extends ExternalSystemArray implements IExternalClientArray { + /** + * @hidden + */ + private server_base_; + /** + * Default Constructor. + */ + constructor(); + /** + * Factory method creating {@link IServerBase} object. + * + * This method {@link createServerBase createServerBase()} determines which templates is used in this server, + * {@link ExternalClientArray}. If the templates is determined, then {@link ExternalSystem external clients} who + * may connect to {@link ExternalClientArray this server} must follow the specified templates. + * + * Creates and returns one of them: + * + * - {@link ServerBase} + * - {@link WebServerBase} + * - {@link SharedWorkerServerBase} + * + * @return A new {@link IServerBase} object. + */ + protected abstract createServerBase(): protocol.IServerBase; + /** + * Add a newly connected remote client. + * + * When a {@link IClientDriver remote client} connects to this *server* {@link ExternalClientArray} object, + * then this {@link ExternalClientArray} creates a child {@link ExternalSystem external client} object through + * the {@link createExternalClient createExternalClient()} method and {@link insert inserts} it. + * + * @param driver A communicator for external client. + */ + addClient(driver: protocol.IClientDriver): void; + /** + * (Deprecated) Factory method creating child object. + * + * The method {@link createChild createChild()} is deprecated. Don't use and override this. + * + * Note that, the {@link ExternalClientArray} is a server accepting {@link ExternalSystem external clients}. + * There's no way to creating the {@link ExternalSystem external clients} in advance before opening the server. + * + * @param xml An {@link XML} object represents the child {@link ExternalSystem} object. + * @return null + */ + createChild(xml: library.XML): T; + /** + * Factory method creating a child {@link ExternalSystem} object. + * + * @param driver A communicator with connected client. + * @return A newly created {@link ExternalSystem} object. + */ + protected abstract createExternalClient(driver: protocol.IClientDriver): T; + /** + * @inheritdoc + */ + open(port: number): void; + /** + * @inheritdoc + */ + close(): void; + } +} +declare namespace samchon.templates.external { + /** + * An external server driver. + * + * The {@link ExternalServer} is an abstract class, derived from the {@link ExternalSystem} class, connecting to + * remote, external server. Extends this {@link ExternalServer} class and overrides the + * {@link createServerConnector createServerConnector()} method following which protocol the external server uses. + * + * #### [Inherited] {@link ExternalSystem} + * @copydoc ExternalSystem + */ + abstract class ExternalServer extends ExternalSystem implements IExternalServer { + /** + * IP address of target external system to connect. + */ + protected ip: string; + /** + * Port number of target external system to connect. + */ + protected port: number; + /** + * Construct from parent {@link ExternalSystemArray}. + * + * @param systemArray The parent {@link ExternalSystemArray} object. + */ + constructor(systemArray: ExternalSystemArray); + /** + * Factory method creating {@link IServerConnector} object. + * + * The {@link createServerConnector createServerConnector()} is an abstract method creating + * {@link IServerConnector} object. Overrides and returns one of them, considering which templates the external + * system follows: + * + * - {@link ServerConnector} + * - {@link WebServerConnector} + * - {@link DedicatedWorkerServerConnector} + * - {@link SharedWorkerServerConnector} + * + * @return A newly created {@link IServerConnector} object. + */ + protected abstract createServerConnector(): protocol.IServerConnector; + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.templates.external { + /** + * An array and manager of {@link IExternalServer external servers}. + * + * The {@link ExternalServerArray} is an abstract class, derived from the {@link ExternalSystemArray} class, + * connecting to {@link IExternalServer external servers}. + * + * Extends this {@link ExternalServerArray} and overrides {@link createChild createChild()} method creating child + * {@link IExternalServer} object. After the extending and overriding, construct children {@link IExternalServer} + * objects and call the {@link connect connect()} method. + * + * #### [Inherited] {@link ExternalSystemArray} + * @copydoc ExternalSystemArray + */ + abstract class ExternalServerArray extends ExternalSystemArray implements IExternalServerArray { + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.templates.external { + /** + * An array and manager of {@link IExternalServer external servers} and {@link ExternalSystem external clients}. + * + * The {@link ExternalServerClientArray} is an abstract class, derived from the {@link ExternalSystemArray} class, + * opening a server accepting {@link ExternalSystem external clients} and being a client connecting to + * {@link IExternalServer external servers} at the same time. + * + * Extends this {@link ExternalServerClientArray} and overrides below methods. After the overridings, open server + * with {@link open open()} method and connect to {@link IExternalServer external servers} through the + * {@link connect connect()} method. + * + * - {@link createServerBase createServerBase()} + * - {@link createExternalClient createExternalClient()} + * - {@link createExternalServer createExternalServer()} + * + * #### [Inherited] {@link ExternalSystemArray} + * @copydoc ExternalSystemArray + */ + abstract class ExternalServerClientArray extends ExternalClientArray implements IExternalServerClientArray { + /** + * Default Constructor. + */ + constructor(); + /** + * Factory method of a child Entity. + * + * This method is migrated to {@link createExternalServer}. Override the {@link createExternalServer} method. + * + * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. + * @return A new child Entity via {@link createExternalServer createExternalServer()}. + */ + createChild(xml: library.XML): T; + /** + * Factory method creating an {@link IExternalServer} object. + * + * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. + * @return A newly created {@link IExternalServer} object. + */ + protected abstract createExternalServer(xml: library.XML): T; + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.templates.external { + /** + * A role of an external system. + * + * The {@link ExternalSystemRole} class represents a role, *WHAT TO DO*. Extends the {@link ExternalSystemRole} class + * and overrides {@link replyData replyData()} to define the *WHAT TO DO*. And assign this {@link ExternalSystemRole} + * object to related {@link ExternalSystem} object. + * + * + * + * + * + * #### Proxy Pattern + * The {@link ExternalSystemRole} class can be an *logical proxy*. In framework within user, which + * {@link ExternalSystem external system} is connected with {@link ExternalSystemArray this system}, it's not + * important. Only interested in user's perspective is *which can be done*. + * + * By using the *logical proxy*, user dont't need to know which {@link ExternalSystemRole role} is belonged + * to which {@link ExternalSystem system}. Just access to a role directly from {@link ExternalSystemArray.getRole}. + * Sends and receives {@link Invoke} message via the {@link ExternalSystemRole role}. + * + *
    + *
  • + * {@link ExternalSystemRole} can be accessed from {@link ExternalSystemArray} directly, without inteferring + * from {@link ExternalSystem} object, via {@link ExternalSystemArray.getRole ExternalSystemArray.getRole()}. + *
  • + *
  • + * When you want to send an {@link Invoke} message to the belonged {@link ExternalSystem system}, just call + * {@link ExternalSystemRole.sendData ExternalSystemRole.sendData()}. Then, the message will be sent to the + * external system. + *
  • + *
  • Those strategy is called *Proxy Pattern*.
  • + *
+ * + * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) + * @author Jeongho Nam + */ + abstract class ExternalSystemRole extends protocol.Entity implements protocol.IProtocol { + /** + * @hidden + */ + private system; + /** + * A name, represents and identifies this {@link ExternalSystemRole role}. + * + * This {@link name} is an identifier represents this {@link ExternalSystemRole role}. This {@link name} is + * used in {@link ExternalSystemArray.getRole} and {@link ExternalSystem.get}, as a key elements. Thus, this + * {@link name} should be unique in an {@link ExternalSystemArray}. + */ + protected name: string; + /** + * Constructor from a system. + * + * @param system An external system containing this role. + */ + constructor(system: ExternalSystem); + /** + * Identifier of {@link ExternalSystemRole} is its {@link name}. + */ + key(): string; + /** + * Get grandparent {@link ExternalSystemArray}. + * + * Get the grandparent {@link ExternalSystemArray} object through this parent {@link ExternalSystem}, + * {@link ExternalSystem.getSystemArray ExternalSystem.getSystemArray()}. + * + * @return The grandparent {@link ExternalSystemArray} object. + */ + getSystemArray(): ExternalSystemArray; + /** + * Get parent {@link ExternalSystemRole} object. + */ + getSystem(): ExternalSystem; + /** + * Get name, who represents and identifies this role. + */ + getName(): string; + /** + * Send an {@link Invoke} message. + * + * Sends an {@link Invoke} message to remote system through the parent {@link ExternalSystem} object. + * + * @param invoke An {@link Invoke} message to send to the external system. + */ + sendData(invoke: protocol.Invoke): void; + /** + * Handle replied {@link Invoke} message. + * + * {@link ExternalSystemRole.replyData ExternalSystemRole.replyData()} is an abstract method handling a replied + * {@link Invoke message} gotten from remote system via parent {@link ExternalSystem} object. Overrides this + * method and defines the *WHAT TO DO* with the {@link Invoke message}. + * + * @param invoke An {@link Invoke} message received from the {@link ExternalSystem external system}. + */ + abstract replyData(invoke: protocol.Invoke): void; + /** + * Tag name of the {@link ExternalSytemRole} in {@link XML}. + * + * @return *role*. + */ + TAG(): string; + } +} +declare namespace samchon.templates.external { + /** + * An interface for an {@link ExternalSystemArray} accepts {@link ExternalSystem external clients} as a + * {@link IServer server}. + * + * The easiest way to defining an {@link ExternalSystemArray} who opens server and accepts + * {@link ExternalSystem external clients} is to extending one of below, who are derived from this interface + * {@link IExternalClientArray}. However, if you can't specify an {@link ExternalSystemArray} to be whether server or + * client, then make a class (let's name it as **BaseSystemArray**) extending {@link ExternalSystemArray} and make + * a new class (now, I name it **BaseClientArray**) extending **BaseSystemArray** and implementing this + * interface {@link IExternalClientArray}. Define the **BaseClientArray** following those codes on below: + * + * + * + * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) + * @author Jeongho Nam + */ + interface IExternalClientArray extends ExternalSystemArray, protocol.IServer { + } +} +declare namespace samchon.templates.external { + /** + * An interface for an external server driver. + * + * The easiest way to defining an external server driver is to extending one of below, who are derived from this + * interface {@link IExternalServer}. However, if you've to interact with an external system who can be both server + * and client, then make a class (let's name it as **BaseSystem**) extending {@link ExternalSystem} and make a + * new class (now, I name it **BaseServer**) extending **BaseSystem** and implementing this interface + * {@link IExternalServer}. Define the **BaseServer** following those codes on below: + * + * + * + * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) + * @author Jeongho Nam + */ + interface IExternalServer extends ExternalSystem { + /** + * Connect to the external server. + */ + connect(): void; + } +} +declare namespace samchon.templates.external { + /** + * An interface for an {@link ExternalSystemArray} connects to {@link IExternalServer external servers} as a + * **client**. + * + * The easiest way to defining an {@link ExternalSystemArray} who connects to + * {@link IExternalServer external servers} is to extending one of below, who are derived from this interface + * {@link IExternalServerArray}. However, if you can't specify an {@link ExternalSystemArray} to be whether server or + * client, then make a class (let's name it as **BaseSystemArray**) extending {@link ExternalSystemArray} and make + * a new class (now, I name it **BaseServerArray**) extending **BaseSystemArray** and implementing this + * interface {@link IExternalServerArray}. Define the **BaseServerArray** following those codes on below: + * + * + * + * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) + * @author Jeongho Nam + */ + interface IExternalServerArray extends ExternalSystemArray { + /** + * Connect to {@link IExternalServer external servers}. + * + * This method calls children elements' method {@link IExternalServer.connect} gradually. + */ + connect(): void; + } +} +declare namespace samchon.templates.external { + /** + * An interface for an {@link ExternalSystemArray} accepts {@link ExternalSystem external clients} as a + * {@link IServer server} and connects to {@link IExternalServer} as **client**, at the same time. + * + * The easiest way to defining an {@link IExternalServerClientArray} who opens server, accepts + * {@link ExternalSystem external clients} and connects to {@link IExternalServer external servers} is to extending + * one of below, who are derived from this interface {@link IExternalServerClientArray}. However, if you can't + * specify an {@link ExternalSystemArray} to be whether server or client or even can both them, then make a class + * (let's name it as **BaseSystemArray**) extending {@link ExternalSystemArray} and make a new class (now, I name + * it **BaseServerClientArray**) extending **BaseSystemArray** and implementing this interface + * {@link IExternalServerClientArray}. Define the **BaseServerClientArray** following those codes on below: + * + * + * + * @handbook [Templates - External System](https://github.com/samchon/framework/wiki/TypeScript-Templates-External_System) + * @author Jeongho Nam + */ + interface IExternalServerClientArray extends IExternalClientArray { + /** + * Connect to {@link IExternalServer external servers}. + * + * This method calls children elements' method {@link IExternalServer.connect} gradually. + */ + connect(): void; + } +} +declare namespace samchon.templates.slave { + /** + * A slave system. + * + * @author Jeongho Nam + */ + abstract class SlaveSystem implements protocol.IProtocol { + /** + * @hidden + */ + protected communicator_: protocol.ICommunicator; + /** + * Default Constructor. + */ + constructor(); + sendData(invoke: protocol.Invoke): void; + abstract replyData(invoke: protocol.Invoke): void; + /** + * @hidden + */ + protected _Reply_data(invoke: protocol.Invoke): void; + } +} +declare namespace samchon.templates.parallel { + /** + * A mediator, the master driver. + * + * The {@link MediatorSystem} is an abstract class helping {@link ParallelSystemArrayMediator} can be a **slave** + * system. The {@link MediatorSystem} interacts and communicates with the **master** system as a role of **slave**. + * + * This {@link MediatorSystem} object is created in {@link ParallelSystemArrayMediator.createMediator}. Override the + * method and return one of them, which are derived from this {@link MediatorSystem} class, considering which + * type and protocol the **master** system follows: + * + * - A client slave connecting to master server: + * - {@link MediatorClient} + * - {@link MediatorWebClient} + * - {@link MediatorSharedWorkerClient} + * - A server slave accepting master client: + * - {@link MediatorServer} + * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} + * - {@link MediatorSharedWorkerServer} + * + * When the **master** orders a *parallel process* to this **slave**, then the {@link MediatorSystem} delivers the + * *parallel process* to its parent {@link ParallelSystemArrayMediator} object. The + * {@link ParallelSystemArrayMediator} object distributes the *parallel process* to its slaves system, + * {@link ParallelSystem} objects. When the *parallel process* has completed, then {@link MediatorSystem} reports the + * result to its **master**. + * + * + * + * + * + * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System), + * [Distributed System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Distributed_System) + * @author Jeongho Nam + */ + abstract class MediatorSystem extends slave.SlaveSystem { + /** + * @hidden + */ + private system_array_; + /** + * @hidden + */ + private progress_list_; + /** + * Construct from parent {@link ParallelSystemArrayMediator} object. + * + * @param systemArray The parent {@link ParallelSystemArrayMediator} object. + */ + constructor(systemArray: ParallelSystemArrayMediator); + /** + * Construct from parent {@link DistributedSystemArrayMediator} object. + * + * @param systemArray The parent {@link DistributedSystemArrayMediator} object. + */ + constructor(systemArray: distributed.DistributedSystemArrayMediator); + /** + * Start interaction. + * + * The {@link start start()} is an abstract method starting interaction with the **master** system. If the + * **master** is a server, then connects to the **master**. Otherwise, the **master** is client, then this + * {@link MediatorSystem} object wil open a server accepting the **master**. + */ + abstract start(): void; + /** + * Get parent {@link ParallelSystemArrayMediator} or {@link DistributedSystemArrayMediator} object. + */ + getSystemArray(): ParallelSystemArrayMediator | distributed.DistributedSystemArrayMediator; + /** + * Get parent {@link ParallelSystemArrayMediator} object. + */ + getSystemArray>(): SystemArray; + /** + * Get parent {@link DistributedSystemArrayMediator} object. + */ + getSystemArray>(): SystemArray; + /** + * @hidden + */ + private _Complete_history(uid); + /** + * @hidden + */ + protected _Reply_data(invoke: protocol.Invoke): void; + /** + * @inheritdoc + */ + replyData(invoke: protocol.Invoke): void; + } +} +declare namespace samchon.templates.parallel { + /** + * A mediator client, driver for the master server. + * + * The {@link MediatorServer} is a class being a client connecting to the **master** server, following the protocol + * of Samchon Framework's own. + * + * #### [Inherited] {@link MediatorSystem} + * @copydoc MediatorSystem + */ + class MediatorClient extends MediatorSystem implements slave.ISlaveClient { + /** + * @hidden + */ + private ip; + /** + * @hidden + */ + private port; + /** + * Initializer Constructor. + * + * @param systemArray The parent {@link ParallelSystemArrayMediator} object. + * @param ip IP address to connect. + * @param port Port number to connect. + */ + constructor(systemArray: ParallelSystemArrayMediator, ip: string, port: number); + /** + * Initializer Constructor. + * + * @param systemArray The parent {@link DistributedSystemArrayMediator} object. + * @param ip IP address to connect. + * @param port Port number to connect. + */ + constructor(systemArray: distributed.DistributedSystemArrayMediator, ip: string, port: number); + /** + * Factory method creating {@link IServerConnector} object. + * + * The {@link createServerConnector createServerConnector()} is an abstract method creating + * {@link IServerConnector} object. Overrides and returns one of them, considering which protocol the **master** + * server follows: + * + * - {@link ServerConnector} + * - {@link WebServerConnector} + * - {@link SharedWorkerServerConnector} + * + * @return A newly created {@link IServerConnector} object. + */ + protected createServerConnector(): protocol.IServerConnector; + /** + * @inheritdoc + */ + start(): void; + /** + * @inheritdoc + */ + connect(): void; + } + /** + * A mediator client, driver for the master server. + * + * The {@link MediatorWebClient} is a class being a client connecting to the **master** server, following the + * web-socket protocol. + * + * #### [Inherited] {@link MediatorSystem} + * @copydoc MediatorSystem + */ + class MediatorWebClient extends MediatorClient { + /** + * @inheritdoc + */ + protected createServerConnector(): protocol.IServerConnector; + } + /** + * A mediator client, driver for the master server. + * + * The {@link MediatorSharedWorkerClient} is a class being a client connecting to the **master** server, following + * the SharedWorker's protocol. + * + * #### [Inherited] {@link MediatorSystem} + * @copydoc MediatorSystem + */ + class MediatorSharedWorkerClient extends MediatorClient { + /** + * @inheritdoc + */ + protected createServerConnector(): protocol.IServerConnector; + } +} +declare namespace samchon.templates.parallel { + /** + * A mediator server, driver for the master client. + * + * The {@link MediatorServer} is a class opening a server accepting the **master** client, following the protocol of + * Samchon Framework's own. + * + * #### [Inherited] {@link MediatorSystem} + * @copydoc MediatorSystem + */ + class MediatorServer extends MediatorSystem implements slave.ISlaveServer { + /** + * @hidden + */ + private server_base_; + /** + * @hidden + */ + private port; + /** + * Initializer Constructor. + * + * @param systemArray The parent {@link ParallelSystemArrayMediator} object. + * @param port Port number of server to open. + */ + constructor(systemArray: ParallelSystemArrayMediator, port: number); + /** + * Initializer Constructor. + * + * @param systemArray The parent {@link DistributedSystemArrayMediator} object. + * @param port Port number of server to open. + */ + constructor(systemArray: distributed.DistributedSystemArrayMediator, port: number); + /** + * Factory method creating {@link IServerBase} object. + * + * This method {@link createServerBase createServerBase()} determines which protocol is used in this server, + * {@link MediatorServer}. Note that, **slave** (this {@link MediatorServer} object) must follow the **master**'s + * protocol. + * + * Overrides and return one of them considering the which protocol to follow: + * + * - {@link ServerBase} + * - {@link WebServerBase} + * - {@link SharedWorkerServerBase} + */ + protected createServerBase(): protocol.IServerBase; + /** + * Add a newly connected remote client. + * + * {@link MediatorServer} represents a **slave** dedicating to its **master**. In that reason, the + * {@link MediatorServer} does not accept multiple **master** clients. It accepts only one. Thus, *listener* of + * the *communicator* is {@link MediatorSystem} object, itself. + * + * @param driver A communicator with remote client. + */ + addClient(driver: protocol.IClientDriver): void; + /** + * @inheritdoc + */ + start(): void; + /** + * @inheritdoc + */ + open(port: number): void; + /** + * @inheritdoc + */ + close(): void; + } + /** + * A mediator server, driver for the master client. + * + * The {@link MediatorWebServer} is a class opening a server accepting the **master** client, following the + * web-socket protocol. + * + * #### [Inherited] {@link MediatorSystem} + * @copydoc MediatorSystem + */ + class MediatorWebServer extends MediatorServer { + /** + * @inheritdoc + */ + protected createServerBase(): protocol.IServerBase; + } + /** + * A mediator server, driver for the master client. + * + * The {@link MediatorDedicatedWorkerServer} is a class opening a server accepting the **master** client, following + * the DedicatedWorker's protocol. + * + * #### [Inherited] {@link MediatorSystem} + * @copydoc MediatorSystem + */ + class MediatorDedicatedWorkerServer extends MediatorServer { + /** + * @inheritdoc + */ + protected createServerBase(): protocol.IServerBase; + } + /** + * A mediator server, driver for the master client. + * + * The {@link MediatorSharedWorkerServer} is a class opening a server accepting the **master** client, following the + * SharedWorker's protocol. + * + * #### [Inherited] {@link MediatorSystem} + * @copydoc MediatorSystem + */ + class MediatorSharedWorkerServer extends MediatorServer { + /** + * @inheritdoc + */ + protected createServerBase(): protocol.IServerBase; + } +} +declare namespace samchon.templates.parallel { + /** + * Master of Parallel Processing System, a server accepting slave clients. + * + * The {@link ParallelClientArray} is an abstract class, derived from the {@link ParallelSystemArray} class, opening + * a server accepting {@link ParallelSystem parallel clients}. + * + * Extends this {@link ParallelClientArray}, overrides {@link createServerBase createServerBase()} to determine which + * protocol to follow and {@link createExternalClient createExternalClient()} creating child {@link ParallelSystem} + * object. After the extending and overridings, open this server using the {@link open open()} method. + * + * #### [Inherited] {@link ParallelSystemArray} + * @copydoc ParallelSystemArray + */ + abstract class ParallelClientArray extends ParallelSystemArray implements external.IExternalClientArray { + /** + * @hidden + */ + private server_base_; + /** + * Default Constructor. + */ + constructor(); + /** + * Factory method creating {@link IServerBase} object. + * + * This method {@link createServerBase createServerBase()} determines which protocol is used in this server, + * {@link ExternalClientArray}. If the protocol is determined, then {@link ExternalSystem external clients} who + * may connect to {@link ExternalClientArray this server} must follow the specified protocol. + * + * Overrides the {@link createServerBase createServerBase()} method to create and return one of them: + * + * - {@link ServerBase} + * - {@link WebServerBase} + * - {@link SharedWorkerServerBase} + * + * @return A new {@link IServerBase} object. + */ + protected abstract createServerBase(): protocol.IServerBase; + /** + * Add a newly connected remote client. + * + * When a {@link IClientDriver remote client} connects to this *master server of parallel processing system*, + * then this {@link ParallelClientArray} creates a child {@link ParallelSystem parallel client} object through + * the {@link createExternalClient createExternalClient()} method and {@link insert inserts} it. + * + * @param driver A communicator for external client. + */ + addClient(driver: protocol.IClientDriver): void; + /** + * (Deprecated) Factory method creating child object. + * + * The method {@link createChild createChild()} is deprecated. Don't use and override this. + * + * Note that, the {@link ParallelClientArray} is a server accepting {@link ParallelSystem parallel clients}. + * There's no way to creating the {@link ParallelSystem parallel clients} in advance before opening the server. + * + * @param xml An {@link XML} object represents the child {@link ParallelSystem} object. + * @return ```null``` + */ + createChild(xml: library.XML): System; + /** + * Factory method creating {@link ParallelSystem} object. + * + * The method {@link createExternalClient createExternalClient()} is a factory method creating a child + * {@link ParallelSystem} object, that is called whenever a parallel client has connected, by + * {@link addClient addClient()}. + * + * Overrides this {@link createExternalClient} method and creates a type of {@link ParallelSystem} object with + * the *driver* that communicates with the parallel client. After the creation, returns the {@link ParallelSystem} + * object. Then whenever a parallel client has connected, matched {@link ParallelSystem} object will be + * constructed and {@link insert inserted} into this {@link ParallelClientArray} object. + * + * @param driver A communicator with the parallel client. + * @return A newly created {@link ParallelSystem} object. + */ + protected abstract createExternalClient(driver: protocol.IClientDriver): System; + /** + * @inheritdoc + */ + open(port: number): void; + /** + * @inheritdoc + */ + close(): void; + } +} +declare namespace samchon.templates.parallel { + /** + * Mediator of Parallel Processing System. + * + * The {@link ParallelSystemArrayMediator} class be a **master** for its slave systems, and be a **slave** to its + * master system at the same time. This {@link ParallelSystemArrayMediator} be a **master **system, containing and + * managing {@link ParallelSystem} objects, which represent parallel slave systems, by extending + * {@link ParallelSystemArray} class. Also, be a **slave** system through {@link getMediator mediator} object, which is + * derived from the {@link SlaveSystem} class. + * + * As a **master**, you can specify this {@link ParallelSystemArrayMediator} class to be a master server accepting + * slave clients or a master client to connecting slave servers. Even both of them is possible. Extends one + * of them below and overrides abstract factory method(s) creating the child {@link ParallelSystem} object. + * + * - {@link ParallelClientArrayMediator}: A server accepting {@link ParallelSystem parallel clients}. + * - {@link ParallelServerArrayMediator}: A client connecting to {@link ParallelServer parallel servers}. + * - {@link ParallelServerClientArrayMediator}: Both of them. Accepts {@link ParallelSystem parallel clients} and + * connects to {@link ParallelServer parallel servers} at the same time. + * + * As a **slave**, you can specify this {@link ParallelSystemArrayMediator} to be a client slave connecting to + * master server or a server slave accepting master client by overriding the {@link createMediator} method. + * Overrides the {@link createMediator createMediator()} method and return one of them: + * + * - A client slave connecting to master server: + * - {@link MediatorClient} + * - {@link MediatorWebClient} + * - {@link MediatorSharedWorkerClient} + * - A server slave accepting master client: + * - {@link MediatorServer} + * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} + * - {@link MediatorSharedWorkerServer} + * + * #### [Inherited] {@link ParallelSystemArray} + * @copydoc ParallelSystemArray + */ + abstract class ParallelSystemArrayMediator extends ParallelSystemArray { + /** + * @hidden + */ + private mediator_; + /** + * Default Constructor. + */ + constructor(); + /** + * Factory method creating a {@link MediatorSystem} object. + * + * The {@link createMediator createMediator()} is an abstract method creating the {@link MediatorSystem} object. + * + * You know what? this {@link ParallelSystemArrayMediator} class be a **master** for its slave systems, and be a + * **slave** to its master system at the same time. The {@link MediatorSystem} object makes it possible; be a + * **slave** system. This {@link createMediator} determines specific type of the {@link MediatorSystem}. + * + * Overrides the {@link createMediator createMediator()} method to create and return one of them following which + * protocol and which type of remote connection (server or client) will be used: + * + * - A client slave connecting to master server: + * - {@link MediatorClient} + * - {@link MediatorWebClient} + * - {@link MediatorSharedWorkerClient} + * - A server slave accepting master client: + * - {@link MediatorServer} + * - {@link MediatorWebServer} + * - {@link MediatorDedicatedWorkerServer} + * - {@link MediatorSharedWorkerServer} + * + * @return A newly created {@link MediatorSystem} object. + */ + protected abstract createMediator(): MediatorSystem; + /** + * Start mediator. + * + * If the {@link getMediator mediator} is a type of server, then opens the server accepting master client. + * Otherwise, the {@link getMediator mediator} is a type of client, then connects the master server. + */ + protected startMediator(): void; + /** + * Get {@link MediatorSystem} object. + * + * When you need to send an {@link Invoke} message to the master system of this + * {@link ParallelSystemArrayMediator}, then send to the {@link MediatorSystem} through this {@link getMediator}. + * + * ```typescript + * this.getMediator().sendData(...); + * ``` + * + * @return The {@link MediatorSystem} object. + */ + getMediator(): MediatorSystem; + /** + * @hidden + */ + protected _Complete_history(history: slave.InvokeHistory): boolean; + } +} +declare namespace samchon.templates.parallel { + /** + * Mediator of Parallel Processing System, a server accepting slave clients. + * + * The {@link ParallelClientArrayMediator} is an abstract class, derived from the {@link ParallelSystemArrayMediator} + * class, opening a server accepting {@link ParallelSystem parallel clients} as a **master**. + * + * Extends this {@link ParallelClientArrayMediator}, overrides {@link createServerBase createServerBase()} to + * determine which protocol to follow and {@link createExternalClient createExternalClient()} creating child + * {@link ParallelSystem} object. After the extending and overridings, open this server using the + * {@link open open()} method. + * + * #### [Inherited] {@link ParallelSystemArrayMediator} + * @copydoc ParallelSystemArrayMediator + */ + abstract class ParallelClientArrayMediator extends ParallelSystemArrayMediator implements external.IExternalClientArray { + /** + * @hidden + */ + private server_base_; + /** + * Default Constructor. + */ + constructor(); + /** + * Factory method creating {@link IServerBase} object. + * + * This method {@link createServerBase createServerBase()} determines which protocol is used in this server, + * {@link ParallelClientArrayMediator}. If the protocol is determined, then + * {@link ParallelSystem parallel clients} who may connect to {@link ParallelClientArrayMediator this server} + * must follow the specified protocol. + * + * Overrides the {@link createServerBase createServerBase()} method to create and return one of them: + * + * - {@link ServerBase} + * - {@link WebServerBase} + * - {@link SharedWorkerServerBase} + * + * @return A new {@link IServerBase} object. + */ + protected abstract createServerBase(): protocol.IServerBase; + /** + * Add a newly connected remote client. + * + * When a {@link IClientDriver remote client} connects to this *master server of parallel processing system*, + * then this {@link ParallelClientArrayMediator} creates a child {@link ParallelSystem parallel client} object + * through the {@link createExternalClient createExternalClient()} method and {@link insert inserts} it. + * + * @param driver A communicator for parallel client. + */ + addClient(driver: protocol.IClientDriver): void; + /** + * (Deprecated) Factory method creating child object. + * + * The method {@link createChild createChild()} is deprecated. Don't use and override this. + * + * Note that, the {@link ParallelClientArrayMediator} is a server accepting {@link ParallelSystem parallel + * clients} as a master. There's no way to creating the {@link ParallelSystem parallel clients} in advance before + * opening the server. + * + * @param xml An {@link XML} object represents the child {@link ParallelSystem} object. + * @return null + */ + createChild(xml: library.XML): System; + /** + * Factory method creating {@link ParallelSystem} object. + * + * The method {@link createExternalClient createExternalClient()} is a factory method creating a child + * {@link ParallelSystem} object, that is called whenever a parallel client has connected, by + * {@link addClient addClient()}. + * + * Overrides this {@link createExternalClient} method and creates a type of {@link ParallelSystem} object with + * the *driver* that communicates with the parallel client. After the creation, returns the {@link ParallelSystem} + * object. Then whenever a parallel client has connected, matched {@link ParallelSystem} object will be + * constructed and {@link insert inserted} into this {@link ParallelClientArrayMediator} object. + * + * @param driver A communicator with the parallel client. + * @return A newly created {@link ParallelSystem} object. + */ + protected abstract createExternalClient(driver: protocol.IClientDriver): System; + /** + * @inheritdoc + */ + open(port: number): void; + /** + * @inheritdoc + */ + close(): void; + } +} +declare namespace samchon.templates.parallel { + /** + * A driver for parallel slave server. + * + * The {@link ParallelServer} is an abstract class, derived from the {@link ParallelSystem} class, connecting to + * remote, parallel **slave** server. Extends this {@link ParallelServer} class and overrides the + * {@link createServerConnector createServerConnector()} method following which protocol the **slave** server uses. + * + * #### [Inherited] {@link ParallelSystem} + * @copydoc ParallelSystem + */ + abstract class ParallelServer extends ParallelSystem implements IParallelServer { + /** + * IP address of target external system to connect. + */ + protected ip: string; + /** + * Port number of target external system to connect. + */ + protected port: number; + /** + * Construct from parent {@link ParallelSystemArray}. + * + * @param systemArray The parent {@link ParallelSystemArray} object. + */ + constructor(systemArray: ParallelSystemArray); + /** + * Factory method creating {@link IServerConnector} object. + * + * The {@link createServerConnector createServerConnector()} is an abstract method creating + * {@link IServerConnector} object. Overrides and returns one of them, considering which protocol the slave server + * follows: + * + * - {@link ServerConnector} + * - {@link WebServerConnector} + * - {@link DedicatedWorkerServerConnector} + * - {@link SharedWorkerServerConnector} + * + * @return A newly created {@link IServerConnector} object. + */ + protected abstract createServerConnector(): protocol.IServerConnector; + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.templates.parallel { + /** + * Master of Parallel Processing System, a client connecting to slave servers. + * + * The {@link ParallelServerArray} is an abstract class, derived from the {@link ParallelSystemArray} class, + * connecting to {@link IParallelServer parallel servers}. + * + * Extends this {@link ParallelServerArray} and overrides {@link createChild createChild()} method creating child + * {@link IParallelServer} object. After the extending and overriding, construct children {@link IParallelServer} + * objects and call the {@link connect connect()} method. + * + * #### [Inherited] {@link ParallelSystemArray} + * @copydoc ParallelSystemArray + */ + abstract class ParallelServerArray extends ParallelSystemArray implements external.IExternalServerArray { + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.templates.parallel { + /** + * Mediator of Parallel Processing System, a client connecting to slave servers. + * + * The {@link ParallelServerArrayMediator} is an abstract class, derived from the {@link ParallelSystemArrayMediator} + * class, connecting to {@link IParallelServer parallel servers}. + * + * Extends this {@link ParallelServerArrayMediator} and overrides {@link createChild createChild()} method creating + * child {@link IParallelServer} object. After the extending and overriding, construct children + * {@link IParallelServer} objects and call the {@link connect connect()} method. + * + * #### [Inherited] {@link ParallelSystemArrayMediator} + * @copydoc ParallelSystemArrayMediator + */ + abstract class ParallelServerArrayMediator extends ParallelSystemArrayMediator implements external.IExternalServerArray { + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.templates.parallel { + /** + * Master of Parallel Processing System, be a server and client at the same time. + * + * The {@link ParallelServerClientArray} is an abstract class, derived from the {@link ParallelSystemArray} class, + * opening a server accepting {@link ParallelSystem parallel clients} and being a client connecting to + * {@link IParallelServer parallel servers} at the same time. + * + * Extends this {@link ParallelServerClientArray} and overrides below methods. After the overridings, open server + * with {@link open open()} method and connect to {@link IParallelServer parallel servers} through the + * {@link connect connect()} method. + * + * - {@link createServerBase createServerBase()} + * - {@link createExternalClient createExternalClient()} + * - {@link createExternalServer createExternalServer()} + * + * #### [Inherited] {@link ParallelSystemArray} + * @copydoc ParallelClientArray + */ + abstract class ParallelServerClientArray extends ParallelClientArray implements external.IExternalServerClientArray { + /** + * Default Constructor. + */ + constructor(); + /** + * Factory method of a child Entity. + * + * This method is migrated to {@link createExternalServer}. Override the {@link createExternalServer} method. + * + * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. + * @return A new child Entity via {@link createExternalServer createExternalServer()}. + */ + createChild(xml: library.XML): System; + /** + * Factory method creating an {@link IParallelServer} object. + * + * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. + * @return A newly created {@link IParallelServer} object. + */ + protected abstract createExternalServer(xml: library.XML): System; + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.templates.parallel { + /** + * Mediator of Parallel Processing System, be a server and client at the same time as a **master**. + * + * The {@link ParallelServerClientArrayMediator} is an abstract class, derived from the + * {@link ParallelSystemArrayMediator} class, opening a server accepting {@link ParallelSystem parallel clients} and + * being a client connecting to {@link IParallelServer parallel servers} at the same time. + * + * Extends this {@link ParallelServerClientArrayMediator} and overrides below methods. After the overridings, open + * server with {@link open open()} method and connect to {@link IParallelServer parallel servers} through the + * {@link connect connect()} method. + * + * - {@link createServerBase createServerBase()} + * - {@link createExternalClient createExternalClient()} + * - {@link createExternalServer createExternalServer()} + * + * #### [Inherited] {@link ParallelSystemArrayMediator} + * @copydoc ParallelClientArrayMediator + */ + abstract class ParallelServerClientArrayMediator extends ParallelClientArrayMediator implements external.IExternalServerClientArray { + /** + * Default Constructor. + */ + constructor(); + /** + * Factory method of a child Entity. + * + * This method is migrated to {@link createExternalServer}. Override the {@link createExternalServer} method. + * + * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. + * @return A new child Entity via {@link createExternalServer createExternalServer()}. + */ + createChild(xml: library.XML): System; + /** + * Factory method creating an {@link IParallelServer} object. + * + * @param xml An {@link XML} object represents child element, so that can identify the type of child to create. + * @return A newly created {@link IParallelServer} object. + */ + protected abstract createExternalServer(xml: library.XML): System; + /** + * @inheritdoc + */ + connect(): void; + } +} +declare namespace samchon.templates.parallel { + /** + * An interface for a parallel slave server driver. + * + * The easiest way to defining a driver for parallel **slave** server is extending {@link ParallelServer} class. + * However, if you've to interact with a prallel **slave** system who can be both server and client, them make a class + * (let's name it **BaseSystem**) extending the {@link ParallelSystem} class. At next, make a new class (now, I name it + * **BaseServer**) extending the **BaseSystem** and implements this interface {@link IParallelServer}. Define the + * **BaseServer** following those codes on below: + * + * + * + * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) + * @author Jeongho Nam + */ + interface IParallelServer extends ParallelSystem { + /** + * Connect to slave server. + */ + connect(): void; + } +} +declare namespace samchon.templates.parallel { + /** + * History of an {@link Invoke} message. + * + * The {@link PRInvokeHistory} is a class archiving history log of an {@link Invoke} message which requests the + * *parallel process*, created whenever {@link ParallelSystemArray.sendSegmentData} or + * {@link ParallelSystemArray.sendSegmentData} is called. + * + * When the *parallel process* has completed, then {@link complete complete()} is called and the *elapsed time* is + * determined. The elapsed time is utilized for computation of {@link ParallelSystem.getPerformance performance index} + * of each {@link ParallelSystem parallel slave system}. + * + * + * + * + * + * @handbook [Templates - Parallel System](https://github.com/samchon/framework/wiki/TypeScript-Templates-Parallel_System) + * @author Jeongho Nam + */ + class PRInvokeHistory extends slave.InvokeHistory { + /** + * @hidden + */ + private first; + /** + * @hidden + */ + private last; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from an {@link Invoke} message. + * + * @param invoke An {@link Invoke} message requesting a *parallel process*. + */ + constructor(invoke: protocol.Invoke); + /** + * Get initial piece's index. + * + * Returns initial piece's index in the section of requested *parallel process*. + * + * @return The initial index. + */ + getFirst(): number; + /** + * Get final piece's index. + * + * Returns initial piece's index in the section of requested *parallel process*. The range used is + * [*first*, *last*), which contains all the pieces' indices between *first* and *last*, including the piece + * pointed by index *first*, but not the piece pointed by the index *last*. + * + * @return The final index. + */ + getLast(): number; + /** + * Compute number of allocated pieces. + */ + computeSize(): number; + } +} +declare namespace samchon.templates.service { + /** + * A driver of remote client. + * + * The {@link Client} is an abstract class representing and interacting with a remote client. It deals the network + * communication with the remote client and shifts {@link Invoke} message to related {@link User} and {@link Service} + * objects. + * + * Extends this {@link Client} class and override the {@link createService} method, a factory method creating a child + * {@link Service} object. Note that, {@link Client} represents a remote client, not *an user*, a specific *web page* + * or *service*. Do not define logics about user or account information. It must be declared in the parent + * {@link User} class. Also, don't define processes of a specific a web page or service. Defines them in the child + * {@link Service} class. + * + * + * + * + * + * @handbook [Templates - Cloud Service](https://github.com/samchon/framework/wiki/TypeScript-Templates-Cloud_Service) + * @author Jeongho Nam + */ + abstract class Client implements protocol.IProtocol { + /** + * @hidden + */ + private user_; + /** + * @hidden + */ + private no_; + /** + * @hidden + */ + private communicator_; + /** + * @hidden + */ + private service_; + /** + * Construct from parent {@link User} and communicator. + * + * @param user Parent {@link User} object. + * @param driver Communicator with remote client. + */ + constructor(user: User, driver: protocol.WebClientDriver); + /** + * Default Destructor. + * + * This {@link destructor destructor()} method is called when the {@link Client} object is destructed and this + * {@link Client} object is destructed when connection with the remote client is closed or this {@link Client} + * object is {@link User.erase erased} from its parent {@link User} object. + * + * Note that, don't call this {@link destructor destructor()} method by yourself. It must be called automatically + * by those *destruction* cases. Also, if your derived {@link Client} class has something to do on the + * *destruction*, then overrides this {@link destructor destructor()} method and defines the something to do. + * Overriding this {@link destructor destructor()}, don't forget to calling ```super.destructor();``` on tail. + * + * ```typescript + * class MyUser extends protocol.service.Client + * { + * protected destructor(): void + * { + * // DO SOMETHING + * this.do_something(); + * + * // CALL SUPER.DESTRUCTOR() ON TAIL. DON'T FORGET THIS + * super.destructor(); + * } + * } + * ``` + */ + protected destructor(): void; + /** + * Factory method creating {@link Service} object. + * + * @param path Requested path. + * @return A newly created {@link Service} object or ```null```. + */ + protected abstract createService(path: string): Service; + /** + * Close connection. + */ + close(): void; + /** + * Get parent {@link User} object. + * + * Get the parent {@link User} object, who is groupping {@link Client} objects with same session id. + * + * @return The parent {@link User} object. + */ + getUser(): User; + /** + * Get child {@link Service} object. + * + * @return The child {@link Service} object. + */ + getService(): Service; + /** + * Get sequence number. + * + * Get sequence number of this {@link Client} object in the parent {@link User} object. This sequence number also + * be a *key* in the parent {@link User} object, who extended the ```std.HashMap```. + * + * @return Sequence number. + */ + getNo(): number; + /** + * Change related {@link Service} object. + * + * @param path Requested, identifier path. + */ + protected changeService(path: string): void; + /** + * Change {@link Service} to another. + * + * @param service {@link service} object to newly assigned. + */ + protected changeService(service: Service): void; + /** + * Send an {@link Invoke} message. + * + * Sends an {@link Invoke} message to remote client. + * + * @param invoke An {@link Invoke} messgae to send to remote client. + */ + sendData(invoke: protocol.Invoke): void; + /** + * Handle a replied {@link Invoke} message. + * + * The default {@link Client.replyData Client.replyData()} shifts chain to its parent {@link User} and belonged + * {@link Service} objects, by calling the the {@link User.replyData User.replyData()} and + * {@link Service.replyData Service.replyData()} methods. + * + * Note that, {@link Client} represents a remote client, not *an user*, a specific *web page* or *service*. Do not + * define logics about user or account information. It must be declared in the parent {@link User} class. Also, + * don't define processes of a specific a web page or service. Defines them in the child {@link Service} class. + * + * ```typescript + * class protocol.service.Client + * { + * public replyData(invoke: protocol.Invoke): void + * { + * // SHIFT TO PARENT USER + * // THE PARENT USER ALSO MAY SHIFT TO ITS PARENT SERVER + * this.getUser().replyData(invoke); + * + * // SHIFT TO BELOGED SERVICE + * if (this.getService() != null) + * this.getService().replyData(invoke); + * } + * } + * + * class MyClient extends protocol.service.Client + * { + * public replyData(invoke: protocol.Invoke): void + * { + * if (invoke.getListener() == "do_something_in_client_level") + * this.do_something_in_client_level(); + * else + * super.replyData(invoke); + * } + * } + * ``` + * + * @param invoke An {@link Invoke invoke} message to be handled in {@link Client} level. + */ + replyData(invoke: protocol.Invoke): void; + } +} +/** + * A system template for Cloud Service. + * + * @handbook [Templates - Cloud Service](https://github.com/samchon/framework/wiki/TypeScript-Templates-Cloud_Service) + * @author Jeongho Nam + */ +declare namespace samchon.templates.service { + /** + * A cloud server. + * + * The {@link Server} is an abstract server class, who can build a real-time cloud server, that is following the + * web-socket protocol. Extends this {@link Server} and related classes and overrides abstract methods under below. + * After the overridings, open this {@link Server cloud server} using the {@link open open()} method. + * + * - Objects in composite relationship and their factory methods + * - {@link User}: {@link Server.createUser Server.createUser()} + * - {@link Client}: {@link User.createClient User.createClient()} + * - {@link Service}: {@link Client.createService Client.createService()} + * - {@link Invoke} message chains; {@link IProtocol.replyData replyData} + * - {@link Server.replyData} + * - {@link User.replyData} + * - {@link Client.replyData} + * - {@link Service.replyData} + * + * + * + * + * + * @handbook [Templates - Cloud Service](https://github.com/samchon/framework/wiki/TypeScript-Templates-Cloud_Service) + * @author Jeongho Nam + */ + abstract class Server extends protocol.WebServer implements protocol.IProtocol { + /** + * @hidden + */ + private session_map_; + /** + * @hidden + */ + private account_map_; + /** + * Default Constructor. + */ + constructor(); + /** + * Factory method creating {@link User} object. + * + * @return A newly created {@link User} object. + */ + protected abstract createUser(): User; + /** + * Test wheter an {@link User} exists with the *accountID*. + * + * @param accountID Account id of {@link User} to find. + * @return Exists or not. + */ + has(accountID: string): boolean; + /** + * Get an {@link User} object by its *accountID*. + * + * @param accountID Account id of {@link User} to get. + * @return An {@link User} object. + */ + get(accountID: string): User; + /** + * Send an {@link Invoke} message. + * + * Sends an {@link Invoke} message to all remote clients through the belonged {@link User} and {@link Client} + * objects. Sending the {@link Invoke} message to all remote clients, it's came true by passing through + * {@link User.sendData User.sendData()}. And the {@link User.sendData} also pass through the + * {@link Client.sendData Client.sendData()}. + * + * ```typescript + * class protocol.service.Server + * { + * public sendData(invoke: Invoke): void + * { + * for (user: User in this) + * for (client: Client in user) + * client.sendData(invoke); + * } + * } + * ``` + * + * @param invoke {@link Invoke} message to send to all remote clients. + */ + sendData(invoke: protocol.Invoke): void; + /** + * Handle a replied {@link Invoke} message. + * + * The {@link Server.replyData Server.replyData()} is an abstract method that handling {@link Invoke} message + * that should be handled in the {@link Server} level. Overrides this {@link replyData replyData()} method and + * defines what to do with the {@link Invoke} message in this {@link Server} level. + * + * @param invoke An {@link Invoke invoke} message to be handled in {@link Server} level. + */ + abstract replyData(invoke: protocol.Invoke): void; + /** + * Add a newly connected remote client. + * + * When a {@link WebClientDriver remote client} connects to this cloud server, then {@link Server} queries the + * {WebClientDriver.getSessionID session id} of the {@link WebClientDriver remote client}. If the + * {WebClientDriver.getSessionID session id} is new one, then creates a new {@link User} object. + * + * At next, creates a {@link Client} object who represents the newly connected remote client and insert the + * {@link Client} object to the matched {@link User} object which is new or ordinary one following the + * {WebClientDriver.getSessionID session id}. At last, a {@link Service} object can be created with referencing + * the {@link WebClientDriver.getPath path}. + * + * List of objects can be created by this method. + * - {@link User} by {@link createUser createUser()}. + * - {@link Client} by {@link User.createClient User.createClient()}. + * - {@link Service} by {@link Client.createService Client.createService()}. + * + * @param driver A web communicator for remote client. + */ + addClient(driver: protocol.WebClientDriver): void; + /** + * @hidden + */ + private _Erase_user(user); + } +} +declare namespace samchon.templates.service { + /** + * A service. + * + * The {@link Service} is an abstract class who represents a service, that is providing functions a specific page. + * + * Extends the {@link Service} class and defines its own service, which to be provided for the specific weg page, + * by overriding the {@link replyData replyData()} method. Note that, the service, functions for the specific page + * should be defined in this {@link Service} class, not its parent {@link Client} class who represents a remote client + * and takes communication responsibility. + * + * + * + * + * + * @handbook [Templates - Cloud Service](https://github.com/samchon/framework/wiki/TypeScript-Templates-Cloud_Service) + * @author Jeongho Nam + */ + abstract class Service implements protocol.IProtocol { + /** + * @hidden + */ + private client_; + /** + * @hidden + */ + private path_; + /** + * Construct from parent {@link Client} and requested path. + * + * @param client Driver of remote client. + * @param path Requested path that identifies this {@link Service}. + */ + constructor(client: Client, path: string); + /** + * Default Destructor. + * + * This {@link destructor destructor()} method is call when the {@link Service} object is destructed and the + * {@link Service} object is destructed when its parent {@link Client} object has + * {@link Client.destructor destructed} or the {@link Client} object {@link Client.changeService changed} its + * child {@link Service service} object to another one. + * + * Note that, don't call this {@link destructor destructor()} method by yourself. It must be called automatically + * by those *destruction* cases. Also, if your derived {@link Service} class has something to do on the + * *destruction*, then overrides this {@link destructor destructor()} method and defines the something to do. + */ + protected destructor(): void; + /** + * Get client. + */ + getClient(): Client; + /** + * Get requested path. + */ + getPath(): string; + /** + * Send an {@link Invoke} message. + * + * Sends an {@link Invoke} message to remote system through parent {@link Client} object ({@link Client.sendData}). + * + * @param invoke An {@link Invoke} message to send to the remte system. + */ + sendData(invoke: protocol.Invoke): void; + /** + * @inheritdoc + */ + abstract replyData(invoke: protocol.Invoke): void; + } +} +declare namespace samchon.templates.service { + /** + * An user. + * + * The {@link User} is an abstract class groupping {@link Client} objects, who communicates with remote client, with + * same *session id*. This {@link User} represents a *remote user* literally. Within framework of remote system, + * an {@link User} corresponds to a web-browser and a {@link Client} represents a window in the web-browser. + * + * Extends this {@link User} class and override the {@link createClient} method, a factory method creating a child + * {@link Client} object. I repeat, the {@link User} class represents a *remote user*, groupping {@link Client} + * objects with same *session id*. If your cloud server has some processes to be handled in the **user level**, then + * defines method in this {@link User} class. Methods managing **account** under below are some of them: + * + * - {@link setAccount setAccount()} + * - {@link getAccountID getAccountID()} + * - {@link getAuthority getAuthority()} + * + * The children {@link Client} objects, they're contained with their key, the {@link Client.getNo sequence number}. + * If you {@link User.erase erase} the children {@link Client} object by yourself, then their connection with the + * remote clients will be {@link Client.close closed} and their {@link Client.destructor destruction method} will be + * called. If you remove {@link clear all children}, then this {@link User} object will be also + * {@link destructor destructed} and erased from the parent {@link Server} object. + * + * + * + * + * + * @handbook [Templates - Cloud Service](https://github.com/samchon/framework/wiki/TypeScript-Templates-Cloud_Service) + * @author Jeongho Nam + */ + abstract class User extends collections.HashMapCollection implements protocol.IProtocol { + /** + * @hidden + */ + private server_; + /** + * @hidden + */ + private session_id_; + /** + * @hidden + */ + private sequence_; + /** + * @hidden + */ + private account_id_; + /** + * @hidden + */ + private authority_; + /** + * Construct from its parent {@link Server}. + * + * @param server The parent {@link Server} object. + */ + constructor(server: Server); + /** + * Default Destructor. + * + * This {@link destructor destructor()} method is called when the {@link User} object is destructed. The + * {@link User} object is destructed when connections with the remote clients are all closed, that is all the + * children {@link Client} objects are all removed, and 30 seconds has left. If some remote client connects + * within the 30 seconds, then the {@link User} object doesn't be destructed. + * + * Note that, don't call this {@link destructor destructor()} method by yourself. It must be called automatically + * by those *destruction* cases. Also, if your derived {@link User} class has something to do on the + * *destruction*, then overrides this {@link destructor destructor()} method and defines the something to do. + * Overriding this {@link destructor destructor()}, don't forget to calling ```super.destructor();``` on tail. + * + * ```typescript + * class MyUser extends protocol.service.User + * { + * protected destructor(): void + * { + * // DO SOMETHING + * this.do_something(); + * + * // CALL SUPER.DESTRUCTOR() ON TAIL. DON'T FORGET THIS + * super.destructor(); + * } + * } + * ``` + */ + protected destructor(): void; + /** + * Factory method creating a {@link Client} object. + * + * @param driver A web communicator for remote client. + * @return A newly created {@link Client} object. + */ + protected abstract createClient(driver: protocol.WebClientDriver): Client; + /** + * @hidden + */ + private _Handle_erase_client(event); + /** + * Get parent {@lin Server} object. + * + * @return Parent {@link Server} object. + */ + getServer(): Server; + /** + * Get account id. + * + * @return Account ID. + */ + getAccountID(): string; + /** + * Get authority. + * + * @return Authority + */ + getAuthority(): number; + /** + * Set *account id* and *authority*. + * + * The {@link setAccount setAccount()} is a method configuring *account id* and *authority* of this {@link User}. + * + * After the configuring, the {@link getAccountID account id} is enrolled into the parent {@link Server} as a + * **key** for this {@link User} object. You can test existence and access this {@link User} object from + * {@link Server.has Server.has()} and {@link Server.get Server.get()} with the {@link getAccountID account id}. + * Of course, if ordinary {@link getAccountID account id} had existed, then the ordinary **key** will be + * replaced. + * + * As you suggest, this {@link setAccount setAccount()} is something like a **log-in** function. If what you want + * is not **logging-in**, but **logging-out**, then configure the *account id* to empty string ``""```` or call + * the {@link lgout logout()} method. + * + * @param id To be account id. + * @param authority To be authority. + */ + setAccount(id: string, authority: number): void; + /** + * Log-out. + * + * This {@link logout logout()} method configures {@link getAccountID account id} to empty string and + * {@link getAuthority authority} to zero. + * + * The ordinary {@link getAccountID account id} will be also erased from the parent {@link Server} object. You + * can't access this {@link User} object from {@link Server.has Server.has()} and {@link Server.get Server.get()} + * with the ordinary {@link getAccountID account id} more. + */ + logout(): void; + /** + * Send an {@link Invoke} message. + * + * Sends an {@link Invoke} message to all remote clients through the belonged {@link Client} objects. Sending the + * {@link Invoke} message to all remote clients, it's came true by passing through the + * {@link Client.sendData Client.sendData()} methods. + * + * ```typescript + * class protocol.service.User + * { + * public sendData(invoke: Invoke): void + * { + * for (let it = this.begin(); !it.equals(this.end()); it = it.next()) + * it.second.sendData(invoke); + * } + * } + * ``` + * + * @param invoke {@link Invoke} message to send to all remote clients. + */ + sendData(invoke: protocol.Invoke): void; + /** + * Handle a replied {@link Invoke} message. + * + * The default {@link User.replyData User.replyData()} shifts chain to its parent {@link Server} object, by + * calling the {@link Server.replyData Server.replyData()} method. If there're some {@link Invoke} message to be + * handled in this {@link User} level, then override this method and defines what to do with the {@link Invoke} + * message in this {@link User} level. + * + * ```typescript + * class protocol.service.User + * { + * public replyData(invoke: protocol.Invoke): void + * { + * this.getServer().replyData(invoke); + * } + * } + * + * class MyUser extends protocol.service.User + * { + * public replyData(invoke: protocol.Invoke): void + * { + * if (invoke.apply(this) == false) // IS TARGET TO BE HANDLED IN THIS USER LEVEL + * super.replyData(invoke); // SHIFT TO SERVER + * } + * } + * ``` + * + * @param invoke An {@link Invoke invoke} message to be handled in {@link User} level. + */ + replyData(invoke: protocol.Invoke): void; + } +} +declare namespace samchon.templates.slave { + /** + * An {@link Invoke} message which represents a **process**. + * + * + * + * #### [Inherited] {@link Invoke} + * @copydoc Invoke + */ + class PInvoke extends protocol.Invoke { + /** + * @hidden + */ + private history_; + /** + * @hidden + */ + private slave_system_; + /** + * @hidden + */ + private hold_; + /** + * Initializer Constructor. + * + * @param invoke Original {@link Invoke} message. + * @param history {@link InvokeHistory} object archiving execution time. + * @param slaveSystem Related {@link SlaveSystem} object who gets those processes from its master. + */ + constructor(invoke: protocol.Invoke, history: InvokeHistory, slaveSystem: SlaveSystem); + /** + * Get history object. + * + * Get {@link InvokeHistory} object who is archiving execution time of this process. + */ + getHistory(): InvokeHistory; + /** + * Is the reporting hold? + */ + isHold(): boolean; + /** + * Hold reporting completion to master. + */ + hold(): void; + /** + * Report completion. + */ + complete(): void; + } +} +declare namespace samchon.templates.slave { + interface ISlaveClient extends SlaveSystem { + connect(ip: string, port: number): void; + } + abstract class SlaveClient extends SlaveSystem implements ISlaveClient { + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + protected abstract createServerConnector(): protocol.IServerConnector; + /** + * @inheritdoc + */ + connect(ip: string, port: number): void; + } +} +declare namespace samchon.templates.slave { + interface ISlaveServer extends SlaveSystem, protocol.IServer { + } + abstract class SlaveServer extends SlaveSystem implements ISlaveServer { + /** + * @hidden + */ + private server_base_; + /** + * Default Constructor. + */ + constructor(); + /** + * @inheritdoc + */ + protected abstract createServerBase(): protocol.IServerBase; + /** + * @inheritdoc + */ + open(port: number): void; + /** + * @inheritdoc + */ + close(): void; + /** + * @inheritdoc + */ + addClient(driver: protocol.IClientDriver): void; + } +} diff --git a/samchon/samchon-tests.ts b/samchon/samchon-tests.ts new file mode 100644 index 0000000000..3c805025ac --- /dev/null +++ b/samchon/samchon-tests.ts @@ -0,0 +1,2 @@ +import samchon = require("samchon"); +console.log(samchon); \ No newline at end of file diff --git a/samchon/tsconfig.json b/samchon/tsconfig.json new file mode 100644 index 0000000000..ec6c511b01 --- /dev/null +++ b/samchon/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": false, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "samchon-tests.ts" + ] +} \ No newline at end of file diff --git a/tstl/index.d.ts b/tstl/index.d.ts new file mode 100644 index 0000000000..c1bd7d7aeb --- /dev/null +++ b/tstl/index.d.ts @@ -0,0 +1,11136 @@ +// Type definitions for TSTL v1.3.10 +// Project: https://github.com/samchon/tstl +// Definitions by: Jeongho Nam +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "tstl" +{ + export = std; +} + +/** + * # TypeScript-STL + * + * + * + * + * STL (Standard Template Library) Containers and Algorithms for TypeScript. + * + * **T**ypeScript-**STL** is a TypeScript's Standard Template Library who is migrated from C++ STL. Most of classes + * and functions of STL have implemented. Just enjoy it. + * + * @git https://github.com/samchon/tstl + * @author Jeongho Nam + */ +declare namespace std { +} +/** + * Base classes composing STL in background. + * + * @author Jeongho Nam + */ +declare namespace std.base { +} +declare namespace std { + /** + * Apply function to range. + * + * Applies function fn to each of the elements in the range [first, last). + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param fn Unary function that accepts an element in the range as argument. This can either be a function p + * ointer or a move constructible function object. Its return value, if any, is ignored. + */ + function for_each, Func extends (val: T) => any>(first: InputIterator, last: InputIterator, fn: Func): Func; + /** + * Apply function to range. + * + * Applies function *fn* to each of the elements in the range [*first*, *first + n*). + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param n the number of elements to apply the function to + * @param fn Unary function that accepts an element in the range as argument. This can either be a function p + * ointer or a move constructible function object. Its return value, if any, is ignored. + * + * @return first + n + */ + function for_each_n>(first: InputIterator, n: number, fn: (val: T) => any): InputIterator; + /** + * Test condition on all elements in range. + * + * Returns true if pred returns true for all the elements in the range + * [first, last) or if the range is {@link Container.empty empty}, and false otherwise. + * + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param pred Unary function that accepts an element in the range as argument and returns a value convertible to + * boolean. The value returned indicates whether the element fulfills the condition + * checked by this function. The function shall not modify its argument. + * + * @return true if pred returns true for all the elements in the range or if the range is + * {@link Container.empty empty}, and false otherwise. + */ + function all_of>(first: InputIterator, last: InputIterator, pred: (val: T) => boolean): boolean; + /** + * Test if any element in range fulfills condition. + * + * Returns true if pred returns true for any of the elements in the range + * [first, last), and false otherwise. + * + * If [first, last) is an {@link Container.empty empty} range, the function returns + * false. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param pred Unary function that accepts an element in the range as argument and returns a value convertible to + * boolean. The value returned indicates whether the element fulfills the condition + * checked by this function. The function shall not modify its argument. + * + * @return true if pred returns true for any of the elements in the range + * [first, last), and false otherwise. If [first, last) is an + * {@link Container.empty empty} range, the function returns false. + */ + function any_of>(first: InputIterator, last: InputIterator, pred: (val: T) => boolean): boolean; + /** + * Test if no elements fulfill condition. + * + * Returns true if pred returns false for all the elements in the range + * [first, last) or if the range is {@link Container.empty empty}, and false otherwise. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param pred Unary function that accepts an element in the range as argument and returns a value convertible to + * boolean. The value returned indicates whether the element fulfills the condition + * checked by this function. The function shall not modify its argument. + * + * @return true if pred returns false for all the elements in the range + * [first, last) or if the range is {@link Container.empty empty}, and false + * otherwise. + */ + function none_of>(first: InputIterator, last: InputIterator, pred: (val: T) => boolean): boolean; + /** + * Test whether the elements in two ranges are equal. + * + * Compares the elements in the range [first1, last1) with those in the range beginning at + * first2, and returns true if all of the elements in both ranges match. + * + * @param first1 An {@link Iterator} to the initial position of the first sequence. + * @param last1 An {@link Iterator} to the final position in a sequence. The range used is + * [first1, last1), including the element pointed by first1, but not the element + * pointed by last1. + * @param first2 An {@link Iterator} to the initial position of the second sequence. The comparison includes up to + * as many elements of this sequence as those in the range [first1, last1). + * + * @return true if all the elements in the range [first1, last1) compare equal to those + * of the range starting at first2, and false otherwise. + */ + function equal>(first1: InputIterator, last1: InputIterator, first2: Iterator): boolean; + /** + * Test whether the elements in two ranges are equal. + * + * Compares the elements in the range [first1, last1) with those in the range beginning at + * first2, and returns true if all of the elements in both ranges match. + * + * @param first1 An {@link Iterator} to the initial position of the first sequence. + * @param last1 An {@link Iterator} to the final position in a sequence. The range used is + * [first1, last1), including the element pointed by first1, but not the element + * pointed by last1. + * @param first2 An {@link Iterator} to the initial position of the second sequence. The comparison includes up to + * as many elements of this sequence as those in the range [first1, last1). + * @param pred Binary function that accepts two elements as argument (one of each of the two sequences, in the same + * order), and returns a value convertible to bool. The value returned indicates whether + * the elements are considered to match in the context of this function. + * + * @return true if all the elements in the range [first1, last1) compare equal to those + * of the range starting at first2, and false otherwise. + */ + function equal>(first1: InputIterator, last1: InputIterator, first2: Iterator, pred: (x: T, y: T) => boolean): boolean; + /** + * Lexicographical less-than comparison. + * + * Returns true if the range [first1, last1) compares lexicographically less + * than the range [first2, last2). + * + * A lexicographical comparison is the kind of comparison generally used to sort words alphabetically in + * dictionaries; It involves comparing sequentially the elements that have the same position in both ranges against + * each other until one element is not equivalent to the other. The result of comparing these first non-matching + * elements is the result of the lexicographical comparison. + * + * If both sequences compare equal until one of them ends, the shorter sequence is lexicographically less + * than the longer one. + * + * @param first1 An {@link Iterator} to the initial position of the first sequence. + * @param last1 An {@link Iterator} to the final position in a sequence. The range used is + * [first1, last1), including the element pointed by first1, but not the element + * pointed by last1. + * @param first2 An {@link Iterator} to the initial position of the second sequence. + * @param last2 An {@link Iterator} to the final position of the second sequence. The ranged used is + * [first2, last2). + * + * @return true if the first range compares lexicographically less than than the second. + * false otherwise (including when all the elements of both ranges are equivalent). + */ + function lexicographical_compare, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2): boolean; + /** + * Lexicographical comparison. + * + * Returns true if the range [first1, last1) compares lexicographically + * relationship than the range [first2, last2). + * + * A lexicographical comparison is the kind of comparison generally used to sort words alphabetically in + * dictionaries; It involves comparing sequentially the elements that have the same position in both ranges against + * each other until one element is not equivalent to the other. The result of comparing these first non-matching + * elements is the result of the lexicographical comparison. + * + * If both sequences compare equal until one of them ends, the shorter sequence is lexicographically + * relationship than the longer one. + * + * @param first1 An {@link Iterator} to the initial position of the first sequence. + * @param last1 An {@link Iterator} to the final position in a sequence. The range used is + * [first1, last1), including the element pointed by first1, but not the element + * pointed by last1. + * @param first2 An {@link Iterator} to the initial position of the second sequence. + * @param last2 An {@link Iterator} to the final position of the second sequence. The ranged used is + * [first2, last2). + * @param compare Binary function that accepts two arguments of the types pointed by the iterators, and returns a + * value convertible to bool. The value returned indicates whether the first argument is + * considered to go before the second in the specific strict weak ordering it defines. + * + * @return true if the first range compares lexicographically relationship than than the + * second. false otherwise (including when all the elements of both ranges are equivalent). + */ + function lexicographical_compare, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2, compare: (x: T, y: T) => boolean): boolean; + /** + * Find value in range. + * + * Returns an iterator to the first element in the range [first, last) that compares equal to + * val. If no such element is found, the function returns last. + * + * The function uses {@link equal_to equal_to} to compare the individual elements to val. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param val Value to search for in the range. + * + * @return An {@link Iterator} to the first element in the range that compares equal to val. If no elements + * match, the function returns last. + */ + function find>(first: InputIterator, last: InputIterator, val: T): InputIterator; + /** + * Find element in range. + * + * Returns an iterator to the first element in the range [first, last) for which pred returns + * true. If no such element is found, the function returns last. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param pred Unary function that accepts an element in the range as argument and returns a value convertible + * to bool. The value returned indicates whether the element is considered a match in + * the context of this function. The function shall not modify its argument. + * + * @return An {@link Iterator} to the first element in the range for which pred does not return + * false. If pred is false for all elements, the function returns + * last. + */ + function find_if>(first: InputIterator, last: InputIterator, pred: (val: T) => boolean): InputIterator; + /** + * Find element in range. + * + * Returns an iterator to the first element in the range [first, last) for which pred returns + * true. If no such element is found, the function returns last. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param pred Unary function that accepts an element in the range as argument and returns a value convertible + * to bool. The value returned indicates whether the element is considered a match in + * the context of this function. The function shall not modify its argument. + * + * @return An {@link Iterator} to the first element in the range for which pred returns false. + * If pred is true for all elements, the function returns last. + */ + function find_if_not>(first: InputIterator, last: InputIterator, pred: (val: T) => boolean): InputIterator; + /** + * Find last subsequence in range. + * + * Searches the range [first1, last1) for the last occurrence of the sequence defined by + * [first2, last2), and returns an {@link Iterator} to its first element, or last1,/i> if no + * occurrences are found. + * + * The elements in both ranges are compared sequentially using {@link equal_to}: A subsequence of + * [first1, last1) is considered a match only when this is true for all the elements of + * [first2, last2). + * + * This function returns the last of such occurrences. For an algorithm that returns the first instead, see + * {@link search}. + * + * @param first1 An {@link Iterator} to the initial position of the first sequence. + * @param last1 An {@link Iterator} to the final position in a sequence. The range used is + * [first1, last1), including the element pointed by first1, but not the element + * pointed by last1. + * @param first2 An {@link Iterator} to the initial position of the element values to be searched for. + * @param last2 An {@link Iterator} to the final position of the element values to be searched for. The range used + * is [first2, last2). + * @param pred Binary function that accepts two elements as arguments (one of each of the two sequences, in the + * same order), and returns a value convertible to bool. The value returned indicates + * whether the elements are considered to match in the context of this function. + * + * @return An {@link Iterator} to the first element of the last occurrence of [first2, last2) in + * [first1, last1). If the sequence is not found, the function returns ,i>last1. Otherwise + * [first2, last2) is an empty range, the function returns last1. + */ + function find_end, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2): Iterator1; + /** + * Find last subsequence in range. + * + * Searches the range [first1, last1) for the last occurrence of the sequence defined by + * [first2, last2), and returns an {@link Iterator} to its first element, or last1,/i> if no + * occurrences are found. + * + * The elements in both ranges are compared sequentially using pred: A subsequence of + * [first1, last1) is considered a match only when this is true for all the elements of + * [first2, last2). + * + * This function returns the last of such occurrences. For an algorithm that returns the first instead, see + * {@link search}. + * + * @param first1 An {@link Iterator} to the initial position of the first sequence. + * @param last1 An {@link Iterator} to the final position in a sequence. The range used is + * [first1, last1), including the element pointed by first1, but not the element + * pointed by last1. + * @param first2 An {@link Iterator} to the initial position of the element values to be searched for. + * @param last2 An {@link Iterator} to the final position of the element values to be searched for. The range used + * is [first2, last2). + * @param pred Binary function that accepts two elements as arguments (one of each of the two sequences, in the + * same order), and returns a value convertible to bool. The value returned indicates + * whether the elements are considered to match in the context of this function. + * + * @return An {@link Iterator} to the first element of the last occurrence of [first2, last2) in + * [first1, last1). If the sequence is not found, the function returns ,i>last1. Otherwise + * [first2, last2) is an empty range, the function returns last1. + */ + function find_end, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2, pred: (x: T, y: T) => boolean): Iterator1; + /** + * Find element from set in range. + * + * Returns an iterator to the first element in the range [first1, last1) that matches any of the + * elements in [first2, last2). If no such element is found, the function returns last1. + * + * The elements in [first1, last1) are sequentially compared to each of the values in + * [first2, last2) using {@link equal_to}, until a pair matches. + * + * @param first1 An {@link Iterator} to the initial position of the first sequence. + * @param last1 An {@link Iterator} to the final position in a sequence. The range used is + * [first1, last1), including the element pointed by first1, but not the element + * pointed by last1. + * @param first2 An {@link Iterator} to the initial position of the element values to be searched for. + * @param last2 An {@link Iterator} to the final position of the element values to be searched for. The range used + * is [first2, last2). + * + * @return An {@link Iterator} to the first element in [first1, last1) that is part of + * [first2, last2). If no matches are found, the function returns last1. + */ + function find_first_of, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2): Iterator1; + /** + * Find element from set in range. + * + * Returns an iterator to the first element in the range [first1, last1) that matches any of the + * elements in [first2, last2). If no such element is found, the function returns last1. + * + * The elements in [first1, last1) are sequentially compared to each of the values in + * [first2, last2) using pred, until a pair matches. + * + * @param first1 An {@link Iterator} to the initial position of the first sequence. + * @param last1 An {@link Iterator} to the final position in a sequence. The range used is + * [first1, last1), including the element pointed by first1, but not the element + * pointed by last1. + * @param first2 An {@link Iterator} to the initial position of the element values to be searched for. + * @param last2 An {@link Iterator} to the final position of the element values to be searched for. The range used + * is [first2, last2). + * @param pred Binary function that accepts two elements as arguments (one of each of the two sequences, in the + * same order), and returns a value convertible to bool. The value returned indicates + * whether the elements are considered to match in the context of this function. + * + * @return An {@link Iterator} to the first element in [first1, last1) that is part of + * [first2, last2). If no matches are found, the function returns last1. + */ + function find_first_of, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2, pred: (x: T, y: T) => boolean): Iterator1; + /** + * Find equal adjacent elements in range. + * + * Searches the range [first, last) for the first occurrence of two consecutive elements that match, + * and returns an {@link Iterator} to the first of these two elements, or last if no such pair is found. + * + * Two elements match if they compare equal using {@link equal_to}. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * + * @return An {@link Iterator} to the first element of the first pair of matching consecutive elements in the range + * [first, last). If no such pair is found, the function returns last. + */ + function adjacent_find>(first: InputIterator, last: InputIterator): InputIterator; + /** + * Find equal adjacent elements in range. + * + * Searches the range [first, last) for the first occurrence of two consecutive elements that match, + * and returns an {@link Iterator} to the first of these two elements, or last if no such pair is found. + * + * Two elements match if they compare equal using pred. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param pred Unary function that accepts an element in the range as argument and returns a value convertible to + * bool. The value returned indicates whether the element is considered a match in the + * context of this function. The function shall not modify its argument. + * + * @return An {@link Iterator} to the first element of the first pair of matching consecutive elements in the range + * [first, last). If no such pair is found, the function returns last. + */ + function adjacent_find>(first: InputIterator, last: InputIterator, pred: (x: T, y: T) => boolean): InputIterator; + /** + * Search range for subsequence. + * + * Searches the range [first1, last1) for the first occurrence of the sequence defined by + * [first2, last2), and returns an iterator to its first element, or last1 if no occurrences are + * found. + * + * The elements in both ranges are compared sequentially using {@link equal_to}: A subsequence of + * [first1, last1) is considered a match only when this is true for all the elements of + * [first2, last2). + * + * This function returns the first of such occurrences. For an algorithm that returns the last instead, see + * {@link find_end}. + * + * @param first1 {@link Iterator Forward iterator} to the initial position of the searched sequence. + * @param last1 {@link Iterator Forward iterator} to the final position of the searched sequence. The range used is + * [first1, last1), which contains all the elements between first1 and last1, + * including the element pointed by first1 but not the element pointed by last1. + * @param first2 {@link Iterator Forward iterator} to the initial position of the sequence to be searched for. + * @param last2 {@link Iterator Forward iterator} to the final position of the sequence to be searched for. The range + * used is [first2, last2). + * + * @return An iterator to the first element of the first occurrence of [first2, last2) in first1 + * and last1. If the sequence is not found, the function returns last1. Otherwise + * [first2, last2) is an empty range, the function returns first1. + */ + function search, ForwardIterator2 extends Iterator>(first1: ForwardIterator1, last1: ForwardIterator1, first2: ForwardIterator2, last2: ForwardIterator2): ForwardIterator1; + /** + * Search range for subsequence. + * + * Searches the range [first1, last1) for the first occurrence of the sequence defined by + * [first2, last2), and returns an iterator to its first element, or last1 if no occurrences are + * found. + * + * The elements in both ranges are compared sequentially using pred: A subsequence of + * [first1, last1) is considered a match only when this is true for all the elements of + * [first2, last2). + * + * This function returns the first of such occurrences. For an algorithm that returns the last instead, see + * {@link find_end}. + * + * @param first1 {@link Iterator Forward iterator} to the initial position of the searched sequence. + * @param last1 {@link Iterator Forward iterator} to the final position of the searched sequence. The range used is + * [first1, last1), which contains all the elements between first1 and last1, + * including the element pointed by first1 but not the element pointed by last1. + * @param first2 {@link Iterator Forward iterator} to the initial position of the sequence to be searched for. + * @param last2 {@link Iterator Forward iterator} to the final position of the sequence to be searched for. The range + * used is [first2, last2). + * @param pred Binary function that accepts two elements as arguments (one of each of the two sequences, in the same + * order), and returns a value convertible to bool. The returned value indicates whether the elements are + * considered to match in the context of this function. The function shall not modify any of its + * arguments. + * + * @return An iterator to the first element of the first occurrence of [first2, last2) in + * [first1, last1). If the sequence is not found, the function returns last1. Otherwise + * [first2, last2) is an empty range, the function returns first1. + */ + function search, ForwardIterator2 extends Iterator>(first1: ForwardIterator1, last1: ForwardIterator1, first2: ForwardIterator2, last2: ForwardIterator2, pred: (x: T, y: T) => boolean): ForwardIterator1; + /** + * Search range for elements. + * + * Searches the range [first, last) for a sequence of count elements, each comparing equal to + * val. + * + * The function returns an iterator to the first of such elements, or last if no such sequence is found. + * + * @param first {@link Iterator Forward iterator} to the initial position of the searched sequence. + * @param last {@link Iterator Forward iterator} to the final position of the searched sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param count Minimum number of successive elements to match. + * @param val Individual value to be compared, or to be used as argument for {@link equal_to}. + * + * @return An iterator to the first element of the sequence. If no such sequence is found, the function returns + * last. + */ + function search_n>(first: ForwardIterator, last: ForwardIterator, count: number, val: T): ForwardIterator; + /** + * Search range for elements. + * + * Searches the range [first, last) for a sequence of count elements, each comparing equal to + * val. + * + * The function returns an iterator to the first of such elements, or last if no such sequence is found. + * + * + * @param first {@link Iterator Forward iterator} to the initial position of the searched sequence. + * @param last {@link Iterator Forward iterator} to the final position of the searched sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param count Minimum number of successive elements to match. + * @param val Individual value to be compared, or to be used as argument for pred. + * @param pred Binary function that accepts two arguments (one element from the sequence as first, and val as + * second), and returns a value convertible to bool. The value returned indicates whether the + * element is considered a match in the context of this function. The function shall not modify any of its + * arguments. + * + * @return An {@link Iterator} to the first element of the sequence. If no such sequence is found, the function + * returns last. + */ + function search_n>(first: ForwardIterator, last: ForwardIterator, count: number, val: T, pred: (x: T, y: T) => boolean): ForwardIterator; + /** + * Return first position where two ranges differ. + * + * Compares the elements in the range [first1, last1) with those in the range beginning at + * first2, and returns the first element of both sequences that does not match. + * + * The function returns a {@link Pair} of {@link iterators Iterator} to the first element in each range that + * does not match. + * + * @param first1 An {@link Iterator} to the initial position of the first sequence. + * @param last1 An {@link Iterator} to the final position in a sequence. The range used is + * [first1, last1), including the element pointed by first1, but not the element + * pointed by last1. + * @param first2 An {@link Iterator} to the initial position of the second sequence. The comparison includes up to + * as many elements of this sequence as those in the range [first1, last1). + * + * @return A {@link Pair}, where its members {@link Pair.first first} and {@link Pair.second second} point to the + * first element in both sequences that did not compare equal to each other. If the elements compared in + * both sequences have all matched, the function returns a {@link Pair} with {@link Pair.first first} set + * to last1 and {@link Pair.second second} set to the element in that same relative position in the + * second sequence. If none matched, it returns {@link make_pair}(first1, first2). + */ + function mismatch, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2): Pair; + /** + * Return first position where two ranges differ. + * + * Compares the elements in the range [first1, last1) with those in the range beginning at + * first2, and returns the first element of both sequences that does not match. + * + * The function returns a {@link Pair} of {@link iterators Iterator} to the first element in each range that + * does not match. + * + * @param first1 An {@link Iterator} to the initial position of the first sequence. + * @param last1 An {@link Iterator} to the final position in a sequence. The range used is + * [first1, last1), including the element pointed by first1, but not the element + * pointed by last1. + * @param first2 An {@link Iterator} to the initial position of the second sequence. The comparison includes up to + * as many elements of this sequence as those in the range [first1, last1). + * @param pred Binary function that accepts two elements as argument (one of each of the two sequences, in the same + * order), and returns a value convertible to bool. The value returned indicates whether + * the elements are considered to match in the context of this function. + * + * @return A {@link Pair}, where its members {@link Pair.first first} and {@link Pair.second second} point to the + * first element in both sequences that did not compare equal to each other. If the elements compared in + * both sequences have all matched, the function returns a {@link Pair} with {@link Pair.first first} set + * to last1 and {@link Pair.second second} set to the element in that same relative position in the + * second sequence. If none matched, it returns {@link make_pair}(first1, first2). + */ + function mismatch, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, compare: (x: T, y: T) => boolean): Pair; + /** + * Count appearances of value in range. + * + * Returns the number of elements in the range [first, last) that compare equal to val. + * + * The function uses {@link equal_to} to compare the individual elements to val. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param val Value to match. + * + * @return The number of elements in the range [first, last) that compare equal to val. + */ + function count>(first: InputIterator, last: InputIterator, val: T): number; + /** + * Return number of elements in range satisfying condition. + * + * Returns the number of elements in the range [first, last) for which pred is true. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible + * to bool. The value returned indicates whether the element is counted by this function. + * The function shall not modify its argument. This can either be a function pointer or a function + * object. + */ + function count_if>(first: InputIterator, last: InputIterator, pred: (val: T) => boolean): number; +} +declare namespace std { + /** + * Copy range of elements. + * + * Copies the elements in the range [first, last) into the range beginning at result. + * + * The function returns an iterator to the end of the destination range (which points to the element following the + * last element copied). + * + * The ranges shall not overlap in such a way that result points to an element in the range + * [first, last). For such cases, see {@link copy_backward}. + * + * @param first {@link Iterator Input iterator} to the initial position in a sequence to be copied. + * @param last {@link Iterator Input iterator} to the initial position in a sequence to be copied. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param result {@link Iterator Output iterator} to the initial position in the destination sequence. This shall not + * point to any element in the range [first, last). + * + * @return An iterator to the end of the destination range where elements have been copied. + */ + function copy, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator): OutputIterator; + /** + * Copy elements. + * + * Copies the first n elements from the range beginning at first into the range beginning at + * result. + * + * The function returns an iterator to the end of the destination range (which points to one past the last element + * copied). + * + * If n is negative, the function does nothing. + * + * If the ranges overlap, some of the elements in the range pointed by result may have undefined but valid values. + * + * @param first {@link Iterator Input iterator} to the initial position in a sequence of at least n elements to + * be copied. InputIterator shall point to a type assignable to the elements pointed by + * OutputIterator. + * @param n Number of elements to copy. If this value is negative, the function does nothing. + * @param result {@link Iterator Output iterator} to the initial position in the destination sequence of at least + * n elements. This shall not point to any element in the range [first, last]. + * + * @return An iterator to the end of the destination range where elements have been copied. + */ + function copy_n, OutputIterator extends base.ILinearIterator>(first: InputIterator, n: number, result: OutputIterator): OutputIterator; + /** + * Copy certain elements of range. + * + * Copies the elements in the range [first, last) for which pred returns true to the + * range beginning at result. + * + * @param first {@link Iterator Input iterator} to the initial position in a sequence to be copied. + * @param last {@link Iterator Input iterator} to the initial position in a sequence to be copied. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param result {@link Iterator Output iterator} to the initial position in the destination sequence. This shall not + * point to any element in the range [first, last). + * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to + * bool. The value returned indicates whether the element is to be copied (if + * true, it is copied). The function shall not modify any of its arguments. + * + * @return An iterator to the end of the destination range where elements have been copied. + */ + function copy_if, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator, pred: (x: T) => boolean): OutputIterator; + /** + * Copy range of elements backward. + * + * Copies the elements in the range [first, last) starting from the end into the range terminating + * at result. + * + * The function returns an iterator to the first element in the destination range. + * + * The resulting range has the elements in the exact same order as [first, last). To reverse their + * order, see {@link reverse_copy}. + * + * The function begins by copying *(last-1) into *(result-1), and then follows backward + * by the elements preceding these, until first is reached (and including it). + * + * The ranges shall not overlap in such a way that result (which is the past-the-end element in the + * destination range) points to an element in the range (first,last]. For such cases, see {@link copy}. + * + * @param first {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied. + * @param last {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied. The range + * used is [first, last), which contains all the elements between first and + * last, including the element pointed by first but not the element pointed by last. + * @param result {@link Iterator Bidirectional iterator} to the initial position in the destination sequence. This + * shall not point to any element in the range [first, last). + * + * @return An iterator to the first element of the destination sequence where elements have been copied. + */ + function copy_backward, BidirectionalIterator2 extends base.ILinearIterator>(first: BidirectionalIterator1, last: BidirectionalIterator1, result: BidirectionalIterator2): BidirectionalIterator2; + /** + * Fill range with value. + * + * Assigns val to all the elements in the range [first, last). + * + * @param first {@link Iterator Forward iterator} to the initial position in a sequence of elements that support being + * assigned a value of type T. + * @param last {@link Iterator Forward iterator} to the final position in a sequence of elements that support being + * assigned a value of type T.. The range filled is [first, last), which contains + * all the elements between first and last, including the element pointed by first + * but not the element pointed by last. + * @param val Value to assign to the elements in the filled range. + */ + function fill>(first: ForwardIterator, last: ForwardIterator, val: T): void; + /** + * Fill sequence with value. + * + * Assigns val to the first n elements of the sequence pointed by first. + * + * @param first {@link Iterator Output iterator} to the initial position in a sequence of elements that support being + * assigned a value of type T. + * @param n Number of elements to fill. If negative, the function does nothing. + * @param val Value to be used to fill the range. + * + * @return An iterator pointing to the element that follows the last element filled. + */ + function fill_n>(first: OutputIterator, n: number, val: T): OutputIterator; + /** + * Transform range. + * + * Applies op to each of the elements in the range [first, last) and stores the value returned + * by each operation in the range that begins at result. + * + * @param first {@link Iterator Input iterator} to the initial position in a sequence to be transformed. + * @param last {@link Iterator Input iterator} to the initial position in a sequence to be transformed. The range + * used is [first, last), which contains all the elements between first and + * last, including the element pointed by first but not the element pointed by last. + * @param result {@link Iterator Output} iterator to the initial position of the range where the operation results are + * stored. The range includes as many elements as [first, last). + * @param op Unary function that accepts one element of the type pointed to by InputIterator as argument, and + * returns some result value convertible to the type pointed to by OutputIterator. + * + * @return An iterator pointing to the element that follows the last element written in the result sequence. + */ + function transform, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator, op: (val: T) => T): OutputIterator; + /** + * Transform range. + * + * Calls binary_op using each of the elements in the range [first1, last1) as first argument, + * and the respective argument in the range that begins at first2 as second argument. The value returned by + * each call is stored in the range that begins at result. + * + * @param first1 {@link Iterator Input iterator} to the initial position of the first sequence. + * @param last1 {@link Iterator Input iterator} to the final position of the first sequence. The range used is + * [first1, last1), including the element pointed by first1, but not the element + * pointed by last1. + * @param first2 {@link Iterator Input iterator} to the initial position of the second range. The range includes as + * many elements as [first1, last1). + * @param result {@link Iterator Output} iterator to the initial position of the range where the operation results are + * stored. The range includes as many elements as [first1, last1). + * @param binary_op Binary function that accepts two elements as argument (one of each of the two sequences), and + * returns some result value convertible to the type pointed to by OutputIterator. + * + * @return An iterator pointing to the element that follows the last element written in the result sequence. + */ + function transform, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, result: OutputIterator, binary_op: (x: T, y: T) => T): OutputIterator; + /** + * Generate values for range with function. + * + * Assigns the value returned by successive calls to gen to the elements in the range [first, last). + * + * @param first {@link Iterator Forward iterator} to the initial position in a sequence. + * @param last {@link Iterator Forward iterator} to the final position in a sequence. The range affected is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param gen Generator function that is called with no arguments and returns some value of a type convertible to + * those pointed by the iterators. + */ + function generate>(first: ForwardIterator, last: ForwardIterator, gen: () => T): void; + /** + * Generate values for sequence with function. + * + * Assigns the value returned by successive calls to gen to the first n elements of the sequence + * pointed by first. + * + * @param first {@link Iterator Output iterator} to the initial position in a sequence of at least n elements + * that support being assigned a value of the type returned by gen. + * @param n Number of values to generate. If negative, the function does nothing. + * @param gen Generator function that is called with no arguments and returns some value of a type convertible to + * those pointed by the iterators. + * + * @return An iterator pointing to the element that follows the last element whose value has been generated. + */ + function generate_n>(first: ForwardIterator, n: number, gen: () => T): ForwardIterator; + /** + * Remove consecutive duplicates in range. + * + * Removes all but the first element from every consecutive group of equivalent elements in the range + * [first, last). + * + * The function cannot alter the properties of the object containing the range of elements (i.e., it cannot + * alter the size of an array or a container): The removal is done by replacing the duplicate elements by the next + * element that is not a duplicate, and signaling the new size of the shortened range by returning an iterator to + * the element that should be considered its new past-the-last element. + * + * The relative order of the elements not removed is preserved, while the elements between the returned + * iterator and last are left in a valid but unspecified state. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * + * @return An iterator to the element that follows the last element not removed. The range between first and + * this iterator includes all the elements in the sequence that were not considered duplicates. + */ + function unique>(first: InputIterator, last: InputIterator): InputIterator; + /** + * Remove consecutive duplicates in range. + * + * Removes all but the first element from every consecutive group of equivalent elements in the range + * [first, last). + * + * The function cannot alter the properties of the object containing the range of elements (i.e., it cannot + * alter the size of an array or a container): The removal is done by replacing the duplicate elements by the next + * element that is not a duplicate, and signaling the new size of the shortened range by returning an iterator to + * the element that should be considered its new past-the-last element. + * + * The relative order of the elements not removed is preserved, while the elements between the returned + * iterator and last are left in a valid but unspecified state. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param pred Binary function that accepts two elements in the range as argument, and returns a value convertible + * to bool. The value returned indicates whether both arguments are considered equivalent + * (if true, they are equivalent and one of them is removed). The function shall not modify + * any of its arguments. + * + * @return An iterator to the element that follows the last element not removed. The range between first and + * this iterator includes all the elements in the sequence that were not considered duplicates. + */ + function unique>(first: InputIterator, last: InputIterator, pred: (left: t, right: t) => boolean): InputIterator; + /** + * Copy range removing duplicates. + * + * Copies the elements in the range [first, last) to the range beginning at result, except + * consecutive duplicates (elements that compare equal to the element preceding). + * + * Only the first element from every consecutive group of equivalent elements in the range + * [first, last) is copied. + * + * The comparison between elements is performed by applying {@lnk equal_to}. + * + * @param first {@link Iterator Forward iterator} to the initial position in a sequence. + * @param last {@link Iterator Forward iterator} to the final position in a sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param result Output iterator to the initial position of the range where the resulting range of values is stored. + * The pointed type shall support being assigned the value of an element in the range + * [first, last). + * + * @return An iterator pointing to the end of the copied range, which contains no consecutive duplicates. + */ + function unique_copy, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator): OutputIterator; + /** + * Copy range removing duplicates. + * + * Copies the elements in the range [first, last) to the range beginning at result, except + * consecutive duplicates (elements that compare equal to the element preceding). + * + * Only the first element from every consecutive group of equivalent elements in the range + * [first, last) is copied. + * + * The comparison between elements is performed by applying pred. + * + * @param first {@link Iterator Forward iterator} to the initial position in a sequence. + * @param last {@link Iterator Forward iterator} to the final position in a sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param result Output iterator to the initial position of the range where the resulting range of values is stored. + * The pointed type shall support being assigned the value of an element in the range + * [first, last). + * @param pred Binary function that accepts two elements in the range as argument, and returns a value convertible to + * bool. The value returned indicates whether both arguments are considered equivalent (if + * true, they are equivalent and one of them is removed). The function shall not modify any + * of its arguments. + * + * @return An iterator pointing to the end of the copied range, which contains no consecutive duplicates. + */ + function unique_copy, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator, pred: (x: T, y: T) => boolean): OutputIterator; + /** + * Remove value from range. + * + * Transforms the range [first, last) into a range with all the elements that compare equal to + * val removed, and returns an iterator to the new last of that range. + * + * The function cannot alter the properties of the object containing the range of elements (i.e., it cannot alter + * the size of an array or a container): The removal is done by replacing the elements that compare equal to + * val by the next element that does not, and signaling the new size of the shortened range by returning an + * iterator to the element that should be considered its new past-the-last element. + * + * The relative order of the elements not removed is preserved, while the elements between the returned iterator + * and last are left in a valid but unspecified state. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param val Value to be removed. + */ + function remove>(first: InputIterator, last: InputIterator, val: T): InputIterator; + /** + * Remove elements from range. + * + * Transforms the range [first, last) into a range with all the elements for which pred returns + * true removed, and returns an iterator to the new last of that range. + * + * The function cannot alter the properties of the object containing the range of elements (i.e., it cannot + * alter the size of an array or a container): The removal is done by replacing the elements for which pred returns + * true by the next element for which it does not, and signaling the new size of the shortened range + * by returning an iterator to the element that should be considered its new past-the-last element. + * + * The relative order of the elements not removed is preserved, while the elements between the returned + * iterator and last are left in a valid but unspecified state. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to + * bool. The value returned indicates whether the element is to be removed (if + * true, it is removed). The function shall not modify its argument. + */ + function remove_if>(first: InputIterator, last: InputIterator, pred: (left: T) => boolean): InputIterator; + /** + * Copy range removing value. + * + * Copies the elements in the range [first, last) to the range beginning at result, except + * those elements that compare equal to val. + * + * The resulting range is shorter than [first, last) by as many elements as matches in the sequence, + * which are "removed". + * + * The function uses {@link equal_to} to compare the individual elements to val. + * + * @param first {@link Iterator InputIterator} to the initial position in a sequence. + * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is + * stored. The pointed type shall support being assigned the value of an element in the range + * [first, last). + * @param val Value to be removed. + * + * @return An iterator pointing to the end of the copied range, which includes all the elements in + * [first, last) except those that compare equal to val. + */ + function remove_copy, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator, val: T): OutputIterator; + /** + * Copy range removing values. + * + * Copies the elements in the range [first, last) to the range beginning at result, except + * those elements for which pred returns true. + * + * The resulting range is shorter than [first, last) by as many elements as matches, which are + * "removed". + * + * @param first {@link Iterator InputIterator} to the initial position in a sequence. + * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is + * stored. The pointed type shall support being assigned the value of an element in the range + * [first, last). + * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to + * bool. The value returned indicates whether the element is to be removed from the copy (if + * true, it is not copied). The function shall not modify its argument. + * + * @return An iterator pointing to the end of the copied range, which includes all the elements in + * [first, last) except those for which pred returns true. + */ + function remove_copy_if, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator, pred: (val: T) => boolean): OutputIterator; + /** + * Replace value in range. + * + * Assigns new_val to all the elements in the range [first, last) that compare equal to + * old_val. + * + * The function uses {@link equal_to} to compare the individual elements to old_val. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param old_val Value to be replaced. + * @param new_val Replacement value. + */ + function replace>(first: InputIterator, last: InputIterator, old_val: T, new_val: T): void; + /** + * Replace value in range. + * + * Assigns new_val to all the elements in the range [first, last) for which pred returns + * true. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to + * bool. The value returned indicates whether the element is to be replaced (if + * true, it is replaced). The function shall not modify its argument. + * @param new_val Value to assign to replaced elements. + */ + function replace_if>(first: InputIterator, last: InputIterator, pred: (val: T) => boolean, new_val: T): void; + /** + * Copy range replacing value. + * + * Copies the elements in the range [first, last) to the range beginning at result, replacing + * the appearances of old_value by new_value. + * + * The function uses {@link equal_to} to compare the individual elements to old_value. + * + * The ranges shall not overlap in such a way that result points to an element in the range + * [first, last). + * + * @param first {@link Iterator InputIterator} to the initial position in a sequence. + * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is + * stored. The pointed type shall support being assigned the value of an element in the range + * [first, last). + * @param old_val Value to be replaced. + * @param new_val Replacement value. + * + * @return An iterator pointing to the element that follows the last element written in the result sequence. + */ + function replace_copy, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator, old_val: T, new_val: T): OutputIterator; + /** + * Copy range replacing value. + * + * Copies the elements in the range [first, last) to the range beginning at result, replacing + * those for which pred returns true by new_value. + * + * @param first {@link Iterator InputIterator} to the initial position in a sequence. + * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is + * stored. The pointed type shall support being assigned the value of an element in the range + * [first, last). + * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to + * bool. The value returned indicates whether the element is to be removed from the copy (if + * true, it is not copied). The function shall not modify its argument. + * @param new_val Value to assign to replaced values. + * + * @return An iterator pointing to the element that follows the last element written in the result sequence. + */ + function replace_copy_if, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator, pred: (val: T) => boolean, new_val: T): OutputIterator; + /** + * Exchange values of objects pointed to by two iterators. + * + * Swaps the elements pointed to by x and y. + * + * The function calls {@link Iterator.swap} to exchange the elements. + * + * @param x {@link Iterator Forward iterator} to the objects to swap. + * @param y {@link Iterator Forward iterator} to the objects to swap. + */ + function iter_swap(x: Iterator, y: Iterator): void; + /** + * Exchange values of two ranges. + * + * Exchanges the values of each of the elements in the range [first1, last1) with those of their + * respective elements in the range beginning at first2. + * + * The function calls {@link Iterator.swap} to exchange the elements. + * + * @param first1 {@link Iterator Forward iterator} to the initial position of the first sequence. + * @param last1 {@link Iterator Forward iterator} to the final position of the first sequence. The range used is + * [first1, last1), including the element pointed by first1, but not the element + * pointed by last1. + * @param first2 {@link Iterator Forward iterator} to the initial position of the second range. The range includes as + * many elements as [first1, last1). The two ranges shall not overlap. + * + * @return An iterator to the last element swapped in the second sequence. + */ + function swap_ranges, ForwardIterator2 extends Iterator>(first1: ForwardIterator1, last1: ForwardIterator1, first2: ForwardIterator2): ForwardIterator2; + /** + * Reverse range. + * + * Reverses the order of the elements in the range [first, last). + * + * The function calls {@link iter_swap} to swap the elements to their new locations. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + */ + function reverse>(first: InputIterator, last: InputIterator): void; + /** + * Copy range reversed. + * + * Copies the elements in the range [first, last) to the range beginning at result, but in + * reverse order. + * + * @param first {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied. + * @param last {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied. The range + * used is [first, last), which contains all the elements between first and + * last, including the element pointed by first but not the element pointed by last. + * @param result {@link Iterator Output iterator} to the initial position of the range where the reserved range is + * stored. The pointed type shall support being assigned the value of an element in the range + * [first, last). + * + * @return An output iterator pointing to the end of the copied range, which contains the same elements in reverse + * order. + */ + function reverse_copy, OutputIterator extends base.ILinearIterator>(first: BidirectionalIterator, last: BidirectionalIterator, result: OutputIterator): OutputIterator; + /** + * Rotate left the elements in range. + * + * Rotates the order of the elements in the range [first, last), in such a way that the element + * pointed by middle becomes the new first element. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param middle An {@link Iterator} pointing to the element within the range [first, last) that is + * moved to the first position in the range. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * + * @return An iterator pointing to the element that now contains the value previously pointed by first. + */ + function rotate>(first: InputIterator, middle: InputIterator, last: InputIterator): InputIterator; + /** + * Copy range rotated left. + * + * Copies the elements in the range [first, last) to the range beginning at result, but + * rotating the order of the elements in such a way that the element pointed by middle becomes the first + * element in the resulting range. + * + * @param first {@link Iterator Forward iterator} to the initial position of the range to be copy-rotated. + * @param middle Forward iterator pointing to the element within the range [first, last) that is copied as the first element in the resulting range. + * @param last {@link Iterator Forward iterator} to the final positions of the range to be copy-rotated. The range + * used is [first, last), which contains all the elements between first and + * last, including the element pointed by first but not the element pointed by last. + * Notice that in this function, these are not consecutive parameters, but the first and third ones. + * @param result {@link Iterator Output iterator} to the initial position of the range where the reserved range is + * stored. The pointed type shall support being assigned the value of an element in the range + * [first, last). + * + * @return An output iterator pointing to the end of the copied range. + */ + function rotate_copy, OutputIterator extends base.ILinearIterator>(first: ForwardIterator, middle: ForwardIterator, last: ForwardIterator, result: OutputIterator): OutputIterator; + /** + * Randomly rearrange elements in range. + * + * Rearranges the elements in the range [first, last) randomly. + * + * The function swaps the value of each element with that of some other randomly picked element. When provided, + * the function gen determines which element is picked in every case. Otherwise, the function uses some unspecified + * source of randomness. + * + * To specify a uniform random generator, see {@link shuffle}. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + */ + function random_shuffle>(first: RandomAccessIterator, last: RandomAccessIterator): void; + /** + * Randomly rearrange elements in range using generator. + * + * Rearranges the elements in the range [first, last) randomly, using g as uniform random + * number generator. + * + * The function swaps the value of each element with that of some other randomly picked element. The function + * determines the element picked by calling g(). + * + * To shuffle the elements of the range without such a generator, see {@link random_shuffle} instead. + * + *
Note
+ * Using random generator engine is not implemented yet. + * + * @param first An {@link Iterator} to the initial position in a sequence. + * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), + * which contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + */ + function shuffle>(first: RandomAccessIterator, last: RandomAccessIterator): void; +} +declare namespace std { + /** + * Sort elements in range. + * + * Sorts the elements in the range [first, last) into ascending order. The elements are compared + * using {@link less}. + * + * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be sorted. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. + * The range used is [first, last), which contains all the elements between first + * and last, including the element pointed by first but not the element pointed by + * last. {@link IArrayIterator RandomAccessIterator} shall point to a type for which + * {@link Iterator.swap swap} is properly defined. + */ + function sort>(first: RandomAccessIterator, last: RandomAccessIterator): void; + /** + * Sort elements in range. + * + * Sorts the elements in the range [first, last) into specific order. The elements are compared + * using compare. + * + * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be sorted. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. + * The range used is [first, last), which contains all the elements between first + * and last, including the element pointed by first but not the element pointed by + * last. {@link IArrayIterator RandomAccessIterator} shall point to a type for which + * {@link Iterator.swap swap} is properly defined. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value + * convertible to boolean. The value returned indicates whether the element passed as first + * argument is considered to go before the second in the specific strict weak ordering it defines. The + * function shall not modify any of its arguments. This can either be a function pointer or a function + * object. + */ + function sort>(first: RandomAccessIterator, last: RandomAccessIterator, compare: (left: T, right: T) => boolean): void; + /** + * Partially sort elements in range. + * + * Rearranges the elements in the range [first, last), in such a way that the elements before + * middle are the smallest elements in the entire range and are sorted in ascending order, while the remaining + * elements are left without any specific order. + * + * The elements are compared using {@link less}. + * + * @param last {@link IArrayIterator Random-access iterator} to the first position of the sequence to be sorted. + * @param middle {@link IArrayIterator Random-access iterator} pointing to the element within the range [first, last) that is used as the upper boundary of the elements that are fully sorted. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. + * The range used is [first, last), which contains all the elements between first + * and last, including the element pointed by first but not the element pointed by + * last. + */ + function partial_sort>(first: RandomAccessIterator, middle: RandomAccessIterator, last: RandomAccessIterator): void; + /** + * Partially sort elements in range. + * + * Rearranges the elements in the range [first, last), in such a way that the elements before + * middle are the smallest elements in the entire range and are sorted in ascending order, while the remaining + * elements are left without any specific order. + * + * The elements are compared using comp. + * + * @param last {@link IArrayIterator Random-access iterator} to the first position of the sequence to be sorted. + * @param middle {@link IArrayIterator Random-access iterator} pointing to the element within the range [first, last) that is used as the upper boundary of the elements that are fully sorted. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. + * The range used is [first, last), which contains all the elements between first + * and last, including the element pointed by first but not the element pointed by + * last. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value + * convertible to boolean. The value returned indicates whether the element passed as + * first argument is considered to go before the second in the specific strict weak ordering it + * defines. The function shall not modify any of its arguments. + */ + function partial_sort>(first: RandomAccessIterator, middle: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): void; + /** + * Copy and partially sort range. + * + * Copies the smallest elements in the range [first, last) to + * [result_first, result_last), sorting the elements copied. The number of elements copied is the same + * as the {@link distance} between result_first and result_last (unless this is more than the amount of + * elements in [first, last)). + * + * The range [first, last) is not modified. + * + * The elements are compared using {@link less}. + * + * @param first {@link Iterator Input iterator} to the initial position of the sequence to copy from. + * @param last {@link Iterator Input iterator} to the final position of the sequence to copy from. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * InputIterator shall point to a type assignable to the elements pointed by + * RandomAccessIterator. + * @param result_first {@link Iterator Random-access iterator} to the initial position of the destination sequence. + * @param result_last {@link Iterator Random-access iterator} to the final position of the destination sequence. + * The range used is [result_first, result_last). + * @param compare Binary function that accepts two elements in the result range as arguments, and returns a value + * convertible to bool. The value returned indicates whether the element passed as first + * argument is considered to go before the second in the specific strict weak ordering it + * defines. The function shall not modify any of its arguments. + * + * @return An iterator pointing to the element that follows the last element written in the result sequence. + */ + function partial_sort_copy, RandomAccessIterator extends Iterator>(first: InputIterator, last: InputIterator, result_first: RandomAccessIterator, result_last: RandomAccessIterator): RandomAccessIterator; + /** + * Copy and partially sort range. + * + * Copies the smallest (or largest) elements in the range [first, last) to + * [result_first, result_last), sorting the elements copied. The number of elements copied is the same + * as the {@link distance} between result_first and result_last (unless this is more than the amount of + * elements in [first, last)). + * + * The range [first, last) is not modified. + * + * The elements are compared using compare. + * + * @param first {@link Iterator Input iterator} to the initial position of the sequence to copy from. + * @param last {@link Iterator Input iterator} to the final position of the sequence to copy from. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * InputIterator shall point to a type assignable to the elements pointed by + * RandomAccessIterator. + * @param result_first {@link Iterator Random-access iterator} to the initial position of the destination sequence. + * @param result_last {@link Iterator Random-access iterator} to the final position of the destination sequence. + * The range used is [result_first, result_last). + * @param compare Binary function that accepts two elements in the result range as arguments, and returns a value + * convertible to bool. The value returned indicates whether the element passed as first + * argument is considered to go before the second in the specific strict weak ordering it + * defines. The function shall not modify any of its arguments. + * + * @return An iterator pointing to the element that follows the last element written in the result sequence. + */ + function partial_sort_copy, RandomAccessIterator extends Iterator>(first: InputIterator, last: InputIterator, result_first: RandomAccessIterator, result_last: RandomAccessIterator, compare: (x: T, y: T) => boolean): RandomAccessIterator; + /** + * Check whether range is sorted. + * + * Returns true if the range [first, last) is sorted into ascending order. + * + * The elements are compared using {@link less}. + * + * @param first {@link Iterator Forward iterator} to the initial position of the sequence. + * @param last {@link Iterator Forward iterator} to the final position of the sequence. The range checked is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * + * @return true if the range [first, last) is sorted into ascending order, + * false otherwise. If the range [first, last) contains less than two elements, + * the function always returns true. + */ + function is_sorted>(first: ForwardIterator, last: ForwardIterator): boolean; + /** + * Check whether range is sorted. + * + * Returns true if the range [first, last) is sorted into ascending order. + * + * The elements are compared using compare. + * + * @param first {@link Iterator Forward iterator} to the initial position of the sequence. + * @param last {@link Iterator Forward iterator} to the final position of the sequence. The range checked is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value convertible + * to bool. The value returned indicates whether the element passed as first argument is + * considered to go before the second in the specific strict weak ordering it defines. The function + * shall not modify any of its arguments. + * + * @return true if the range [first, last) is sorted into ascending order, + * false otherwise. If the range [first, last) contains less than two elements, + * the function always returns true. + */ + function is_sorted>(first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): boolean; + /** + * Find first unsorted element in range. + * + * Returns an iterator to the first element in the range [first, last) which does not follow an + * ascending order. + * + * The range between first and the iterator returned {@link is_sorted is sorted}. + * + * If the entire range is sorted, the function returns last. + * + * The elements are compared using {@link equal_to}. + * + * @param first {@link Iterator Forward iterator} to the initial position of the sequence. + * @param last {@link Iterator Forward iterator} to the final position of the sequence. The range checked is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value convertible + * to bool. The value returned indicates whether the element passed as first argument is + * considered to go before the second in the specific strict weak ordering it defines. The function + * shall not modify any of its arguments. + * + * @return An iterator to the first element in the range which does not follow an ascending order, or last if + * all elements are sorted or if the range contains less than two elements. + */ + function is_sorted_until>(first: ForwardIterator, last: ForwardIterator): ForwardIterator; + /** + * Find first unsorted element in range. + * + * Returns an iterator to the first element in the range [first, last) which does not follow an + * ascending order. + * + * The range between first and the iterator returned {@link is_sorted is sorted}. + * + * If the entire range is sorted, the function returns last. + * + * The elements are compared using compare. + * + * @param first {@link Iterator Forward iterator} to the initial position of the sequence. + * @param last {@link Iterator Forward iterator} to the final position of the sequence. The range checked is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value convertible + * to bool. The value returned indicates whether the element passed as first argument is + * considered to go before the second in the specific strict weak ordering it defines. The function + * shall not modify any of its arguments. + * + * @return An iterator to the first element in the range which does not follow an ascending order, or last if + * all elements are sorted or if the range contains less than two elements. + */ + function is_sorted_until>(first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): ForwardIterator; +} +declare namespace std { + /** + * Make heap from range. + * + * Rearranges the elements in the range [first, last) in such a way that they form a heap. + * + * A heap is a way to organize the elements of a range that allows for fast retrieval of the element with the + * highest value at any moment (with {@link pop_heap}), even repeatedly, while allowing for fast insertion of new + * elements (with {@link push_heap}). + * + * The element with the highest value is always pointed by first. The order of the other elements depends on the + * particular implementation, but it is consistent throughout all heap-related functions of this header. + * + * The elements are compared using {@link less}: The element with the highest value is an element for which this + * would return false when compared to every other element in the range. + * + * The standard container adaptor {@link PriorityQueue} calls {@link make_heap}, {@link push_heap} and + * {@link pop_heap} automatically to maintain heap properties for a container. + * + * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be + * transformed into a heap. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be transformed + * into a heap. The range used is [first, last), which contains all the elements between + * first and last, including the element pointed by first but not the element pointed + * by last. {@link IArrayIterator RandomAccessIterator} shall point to a type for which + * {@link Iterator.swap swap} is properly defined. + */ + function make_heap>(first: RandomAccessIterator, last: RandomAccessIterator): void; + /** + * Make heap from range. + * + * Rearranges the elements in the range [first, last) in such a way that they form a heap. + * + * A heap is a way to organize the elements of a range that allows for fast retrieval of the element with the + * highest value at any moment (with {@link pop_heap}), even repeatedly, while allowing for fast insertion of new + * elements (with {@link push_heap}). + * + * The element with the highest value is always pointed by first. The order of the other elements depends on the + * particular implementation, but it is consistent throughout all heap-related functions of this header. + * + * The elements are compared using compare: The element with the highest value is an element for which this + * would return false when compared to every other element in the range. + * + * The standard container adaptor {@link PriorityQueue} calls {@link make_heap}, {@link push_heap} and + * {@link pop_heap} automatically to maintain heap properties for a container. + * + * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be + * transformed into a heap. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be transformed + * into a heap. The range used is [first, last), which contains all the elements between + * first and last, including the element pointed by first but not the element pointed + * by last. {@link IArrayIterator RandomAccessIterator} shall point to a type for which + * {@link Iterator.swap swap} is properly defined. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value + * convertible to boolean. The value returned indicates whether the element passed as + * first argument is considered to go before the second in the specific strict weak ordering it defines. + * The function shall not modify any of its arguments. This can either be a function pointer or a + * function object. + */ + function make_heap>(first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): void; + /** + * Push element into heap range. + * + * Given a heap in the range [first, last - 1), this function extends the range considered a heap to + * [first, last) by placing the value in (last - 1) into its corresponding location within it. + * + * + * A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are + * preserved if elements are added and removed from it using {@link push_heap} and {@link pop_heap}, respectively. + * + * + * @param first {@link IArrayIterator Random-access iterator} to the initial position of the new heap range, including + * the pushed element. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the new heap range, including + * the pushed element. The range used is [first, last), which contains all the elements + * between first and last, including the element pointed by first but not the element + * pointed by last. {@link IArrayIterator RandomAccessIterator} shall point to a type for which + * {@link Iterator.swap swap} is properly defined. + */ + function push_heap>(first: RandomAccessIterator, last: RandomAccessIterator): void; + /** + * Push element into heap range. + * + * Given a heap in the range [first, last - 1), this function extends the range considered a heap to + * [first, last) by placing the value in (last - 1) into its corresponding location within it. + * + * A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are + * preserved if elements are added and removed from it using {@link push_heap} and {@link pop_heap}, respectively. + * + * + * @param first {@link IArrayIterator Random-access iterator} to the initial position of the new heap range, including + * the pushed element. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the new heap range, including + * the pushed element. The range used is [first, last), which contains all the elements + * between first and last, including the element pointed by first but not the element + * pointed by last. {@link IArrayIterator RandomAccessIterator} shall point to a type for which + * {@link Iterator.swap swap} is properly defined. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value + * convertible to boolean. The value returned indicates whether the element passed as + * first argument is considered to go before the second in the specific strict weak ordering it defines. + * The function shall not modify any of its arguments. This can either be a function pointer or a + * function object. + */ + function push_heap>(first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): void; + /** + * Pop element from heap range. + * + * Rearranges the elements in the heap range [first, last) in such a way that the part considered a + * heap is shortened by one: The element with the highest value is moved to (last - 1). + * + * While the element with the highest value is moved from first to (last - 1) (which now is out of the + * heap), the other elements are reorganized in such a way that the range [first, last - 1) preserves + * the properties of a heap. + * + * A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are + * preserved if elements are added and removed from it using {@link push_heap} and {@link pop_heap}, respectively. + * + * @param first {@link IArrayIterator Random-access iterator} to the initial position of the heap to be shrank by one. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the heap to be shrank by one. + * The range used is [first, last), which contains all the elements between first and + * last, including the element pointed by first but not the element pointed by last. + * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} + * is properly defined. + */ + function pop_heap>(first: RandomAccessIterator, last: RandomAccessIterator): void; + /** + * Pop element from heap range. + * + * Rearranges the elements in the heap range [first, last) in such a way that the part considered a + * heap is shortened by one: The element with the highest value is moved to (last - 1). + * + * While the element with the highest value is moved from first to (last - 1) (which now is out of the + * heap), the other elements are reorganized in such a way that the range [first, last - 1) preserves + * the properties of a heap. + * + * A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are + * preserved if elements are added and removed from it using {@link push_heap} and {@link pop_heap}, respectively. + * + * @param first {@link IArrayIterator Random-access iterator} to the initial position of the heap to be shrank by one. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the heap to be shrank by one. + * The range used is [first, last), which contains all the elements between first and + * last, including the element pointed by first but not the element pointed by last. + * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} + * is properly defined. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value + * convertible to boolean. The value returned indicates whether the element passed as + * first argument is considered to go before the second in the specific strict weak ordering it defines. + * The function shall not modify any of its arguments. This can either be a function pointer or a + * function object. + */ + function pop_heap>(first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): void; + /** + * Test if range is heap. + * + * Returns true if the range [first, last) forms a heap, as if constructed with {@link make_heap}. + * + * The elements are compared using {@link less}. + * + * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} + * is properly defined. + * + * @return true if the range [first, last) is a heap (as if constructed with + * {@link make_heap}), false otherwise. If the range [first, last) contains less + * than two elements, the function always returns true. + */ + function is_heap>(first: RandomAccessIterator, last: RandomAccessIterator): boolean; + /** + * Test if range is heap. + * + * Returns true if the range [first, last) forms a heap, as if constructed with {@link make_heap}. + * + * The elements are compared using compare. + * + * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} + * is properly defined. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value + * convertible to boolean. The value returned indicates whether the element passed as + * first argument is considered to go before the second in the specific strict weak ordering it defines. + * The function shall not modify any of its arguments. This can either be a function pointer or a + * function object. + * + * @return true if the range [first, last) is a heap (as if constructed with + * {@link make_heap}), false otherwise. If the range [first, last) contains less + * than two elements, the function always returns true. + */ + function is_heap>(first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): boolean; + /** + * Find first element not in heap order. + * + * Returns an iterator to the first element in the range [first, last) which is not in a valid + * position if the range is considered a heap (as if constructed with {@link make_heap}). + * + * The range between first and the iterator returned is a heap. + * + * If the entire range is a valid heap, the function returns last. + * + * The elements are compared using {@link less}. + * + * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} + * is properly defined. + */ + function is_heap_until>(first: RandomAccessIterator, last: RandomAccessIterator): RandomAccessIterator; + /** + * Find first element not in heap order. + * + * Returns an iterator to the first element in the range [first, last) which is not in a valid + * position if the range is considered a heap (as if constructed with {@link make_heap}). + * + * The range between first and the iterator returned is a heap. + * + * If the entire range is a valid heap, the function returns last. + * + * The elements are compared using {@link less}. + * + * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} + * is properly defined. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value + * convertible to boolean. The value returned indicates whether the element passed as + * first argument is considered to go before the second in the specific strict weak ordering it defines. + * The function shall not modify any of its arguments. This can either be a function pointer or a + * function object. + */ + function is_heap_until>(first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): RandomAccessIterator; + /** + * Sort elements of heap. + * + * Sorts the elements in the heap range [first, last) into ascending order. + * + * The elements are compared using {@link less}, which shall be the same as used to construct the heap. + * + * The range loses its properties as a heap. + * + * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be sorted. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. + * The range used is [first, last), which contains all the elements between first and + * last, including the element pointed by first but not the element pointed by last. + * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} + * is properly defined. + */ + function sort_heap>(first: RandomAccessIterator, last: RandomAccessIterator): void; + /** + * Sort elements of heap. + * + * Sorts the elements in the heap range [first, last) into ascending order. + * + * The elements are compared using compare, which shall be the same as used to construct the heap. + * + * The range loses its properties as a heap. + * + * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be sorted. + * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. + * The range used is [first, last), which contains all the elements between first and + * last, including the element pointed by first but not the element pointed by last. + * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} + * is properly defined. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value + * convertible to boolean. The value returned indicates whether the element passed as + * first argument is considered to go before the second in the specific strict weak ordering it defines. + * The function shall not modify any of its arguments. This can either be a function pointer or a + * function object. + */ + function sort_heap>(first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): void; +} +declare namespace std { + /** + * Return iterator to lower bound. + * + * Returns an iterator pointing to the first element in the range [first, last) which does not + * compare less than val. + * + * The elements are compared using {@link less}. The elements in the range shall already be {@link is_sorted sorted} + * according to this same criterion ({@link less}), or at least {@link is_partitioned partitioned} with respect to + * val. + * + * The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted + * range, which is specially efficient for {@link IArrayIterator random-access iterators}. + * + * Unlike {@link upper_bound}, the value pointed by the iterator returned by this function may also be equivalent + * to val, and not only greater. + * + * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. + * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which + * contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param val Value of the lower bound to search for in the range. T shall be a type supporting being compared + * with elements of the range [first, last) as the left-hand side operand of {@link less}. + * + * @return An iterator to the lower bound of val in the range. If all the element in the range compare less than + * val, the function returns last. + */ + function lower_bound>(first: ForwardIterator, last: ForwardIterator, val: T): ForwardIterator; + /** + * Return iterator to lower bound. + * + * Returns an iterator pointing to the first element in the range [first, last) which does not + * compare less than val. + * + * The elements are compared using compare. The elements in the range shall already be + * {@link is_sorted sorted} according to this same criterion (compare), or at least + * {@link is_partitioned partitioned} with respect to val. + * + * The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted + * range, which is specially efficient for {@link IArrayIterator random-access iterators}. + * + * Unlike {@link upper_bound}, the value pointed by the iterator returned by this function may also be equivalent + * to val, and not only greater. + * + * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. + * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which + * contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param val Value of the lower bound to search for in the range. + * @param compare Binary function that accepts two arguments (the first of the type pointed by ForwardIterator, + * and the second, always val), and returns a value convertible to bool. The value + * returned indicates whether the first argument is considered to go before the second. The function + * shall not modify any of its arguments. + * + * @return An iterator to the lower bound of val in the range. If all the element in the range compare less than + * val, the function returns last. + */ + function lower_bound>(first: ForwardIterator, last: ForwardIterator, val: T, compare: (x: T, y: T) => boolean): ForwardIterator; + /** + * Return iterator to upper bound. + * + * Returns an iterator pointing to the first element in the range [first, last) which compares + * greater than val. + * + * The elements are compared using {@link less}. The elements in the range shall already be {@link is_sorted sorted} + * according to this same criterion ({@link less}), or at least {@link is_partitioned partitioned} with respect to + * val. + * + * The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted + * range, which is specially efficient for {@link IArrayIterator random-access iterators}. + * + * Unlike {@link lower_bound}, the value pointed by the iterator returned by this function cannot be equivalent to + * val, only greater. + * + * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. + * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which + * contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param val Value of the lower bound to search for in the range. T shall be a type supporting being compared + * with elements of the range [first, last) as the left-hand side operand of {@link less}. + * + * @return An iterator to the upper bound of val in the range. If no element in the range comparse greater than + * val, the function returns last. + */ + function upper_bound>(first: ForwardIterator, last: ForwardIterator, val: T): ForwardIterator; + /** + * Return iterator to upper bound. + * + * Returns an iterator pointing to the first element in the range [first, last) which compares + * greater than val. + * + * The elements are compared using compare. The elements in the range shall already be + * {@link is_sorted sorted} according to this same criterion (compare), or at least + * {@link is_partitioned partitioned} with respect to val. + * + * The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted + * range, which is specially efficient for {@link IArrayIterator random-access iterators}. + * + * Unlike {@link lower_bound}, the value pointed by the iterator returned by this function cannot be equivalent to + * val, only greater. + * + * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. + * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which + * contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param val Value of the lower bound to search for in the range. + * @param compare Binary function that accepts two arguments (the first of the type pointed by ForwardIterator, + * and the second, always val), and returns a value convertible to bool. The value + * returned indicates whether the first argument is considered to go before the second. The function + * shall not modify any of its arguments. + * + * @return An iterator to the upper bound of val in the range. If no element in the range comparse greater than + * val, the function returns last. + */ + function upper_bound>(first: ForwardIterator, last: ForwardIterator, val: T, compare: (x: T, y: T) => boolean): ForwardIterator; + /** + * Get subrange of equal elements. + * + * Returns the bounds of the subrange that includes all the elements of the range [first, last) with + * values equivalent to val. + * + * The elements are compared using {@link less}. Two elements, ax/i> and y are considered equivalent + * if (!less(x, y) && !less(y, x)). + * + * The elements in the range shall already be {@link is_sorted sorted} according to this same criterion + * ({@link less}), or at least {@link is_partitioned partitioned} with respect to val. + * + * If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both + * iterators pointing to the nearest value greater than val, if any, or to last, if val compares + * greater than all the elements in the range. + * + * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. + * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which + * contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param val Value of the lower bound to search for in the range. T shall be a type supporting being compared + * with elements of the range [first, last) as the left-hand side operand of {@link less}. + * + * @return A {@link Pair} object, whose member {@link Pair.first} is an iterator to the lower bound of the subrange of + * equivalent values, and {@link Pair.second} its upper bound. The values are the same as those that would be + * returned by functions {@link lower_bound} and {@link upper_bound} respectively. + */ + function equal_range>(first: ForwardIterator, last: ForwardIterator, val: T): Pair; + /** + * Get subrange of equal elements. + * + * Returns the bounds of the subrange that includes all the elements of the range [first, last) with + * values equivalent to val. + * + * The elements are compared using compare. Two elements, ax/i> and y are considered equivalent + * if (!compare(x, y) && !compare(y, x)). + * + * The elements in the range shall already be {@link is_sorted sorted} according to this same criterion + * (compare), or at least {@link is_partitioned partitioned} with respect to val. + * + * If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both + * iterators pointing to the nearest value greater than val, if any, or to last, if val compares + * greater than all the elements in the range. + * + * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. + * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which + * contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param val Value of the lower bound to search for in the range. + * @param compare Binary function that accepts two arguments of the type pointed by ForwardIterator (and of type + * T), and returns a value convertible to bool. The value returned indicates whether + * the first argument is considered to go before the second. The function shall not modify any of its + * arguments. + * + * @return A {@link Pair} object, whose member {@link Pair.first} is an iterator to the lower bound of the subrange of + * equivalent values, and {@link Pair.second} its upper bound. The values are the same as those that would be + * returned by functions {@link lower_bound} and {@link upper_bound} respectively. + */ + function equal_range>(first: ForwardIterator, last: ForwardIterator, val: T, compare: (x: T, y: T) => boolean): Pair; + /** + * Get subrange of equal elements. + * + * Returns the bounds of the subrange that includes all the elements of the range [first, last) with + * values equivalent to val. + * + * The elements are compared using {@link less}. Two elements, x and y are considered equivalent + * if (!less(x, y) && !less(y, x)). + * + * The elements in the range shall already be {@link is_sorted sorted} according to this same criterion + * ({@link less}), or at least {@link is_partitioned partitioned} with respect to val. + * + * If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both + * iterators pointing to the nearest value greater than val, if any, or to last, if val compares + * greater than all the elements in the range. + * + * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. + * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which + * contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param val Value of the lower bound to search for in the range. T shall be a type supporting being compared + * with elements of the range [first, last) as the left-hand side operand of {@link less}. + * + * @return true if an element equivalent to val is found, and false otherwise. + */ + function binary_search>(first: ForwardIterator, last: ForwardIterator, val: T): boolean; + /** + * Get subrange of equal elements. + * + * Returns the bounds of the subrange that includes all the elements of the range [first, last) with + * values equivalent to val. + * + * The elements are compared using {compare}. Two elements, x and y are considered equivalent + * if (!compare(x, y) && !compare(y, x)). + * + * The elements in the range shall already be {@link is_sorted sorted} according to this same criterion + * (compare), or at least {@link is_partitioned partitioned} with respect to val. + * + * If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both + * iterators pointing to the nearest value greater than val, if any, or to last, if val compares + * greater than all the elements in the range. + * + * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. + * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly + * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which + * contains all the elements between first and last, including the element pointed by + * first but not the element pointed by last. + * @param val Value of the lower bound to search for in the range. + * @param compare Binary function that accepts two arguments of the type pointed by ForwardIterator (and of type + * T), and returns a value convertible to bool. The value returned indicates whether + * the first argument is considered to go before the second. The function shall not modify any of its + * arguments. + * + * @return true if an element equivalent to val is found, and false otherwise. + */ + function binary_search>(first: ForwardIterator, last: ForwardIterator, val: T, compare: (x: T, y: T) => boolean): boolean; +} +declare namespace std { + /** + * Test whether range is partitioned. + * + * Returns true if all the elements in the range [first, last) for which pred + * returns true precede those for which it returns false. + * + * If the range is {@link Container.empty empty}, the function returns true. + * + * @param first {@link Iterator Input iterator} to the initial position of the sequence. + * @param last {@link Iterator Input iterator} to the final position of the sequence. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to + * bool. The value returned indicates whether the element belongs to the first group (if + * true, the element is expected before all the elements for which it returns + * false). The function shall not modify its argument. + * + * @return true if all the elements in the range [first, last) for which pred returns + * true precede those for which it returns false. Otherwise it returns + * false. If the range is {@link Container.empty empty}, the function returns true. + */ + function is_partitioned>(first: InputIterator, last: InputIterator, pred: (x: T) => boolean): boolean; + /** + * Partition range in two. + * + * Rearranges the elements from the range [first, last), in such a way that all the elements for + * which pred returns true precede all those for which it returns false. The iterator + * returned points to the first element of the second group. + * + * The relative ordering within each group is not necessarily the same as before the call. See + * {@link stable_partition} for a function with a similar behavior but with stable ordering within each group. + * + * @param first {@link Iterator Forward iterator} to the initial position of the sequence to partition. + * @param last {@link Iterator Forward iterator} to the final position of the sequence to partition. The range used is + * [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to + * bool. The value returned indicates whether the element belongs to the first group (if + * true, the element is expected before all the elements for which it returns + * false). The function shall not modify its argument. + * + * @return An iterator that points to the first element of the second group of elements (those for which pred + * returns false), or last if this group is {@link Container.empty empty}. + */ + function partition>(first: BidirectionalIterator, last: BidirectionalIterator, pred: (x: T) => boolean): BidirectionalIterator; + /** + * Partition range in two - stable ordering. + * + * Rearranges the elements in the range [first, last), in such a way that all the elements for which + * pred returns true precede all those for which it returns false, and, unlike + * function {@link partition}, the relative order of elements within each group is preserved. + * + * This is generally implemented using an internal temporary buffer. + * + * @param first {@link Iterator Bidirectional iterator} to the initial position of the sequence to partition. + * @param last {@link Iterator Bidirectional iterator} to the final position of the sequence to partition. The range + * used is [first, last), which contains all the elements between first and + * last, including the element pointed by first but not the element pointed by last. + * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to + * bool. The value returned indicates whether the element belongs to the first group (if + * true, the element is expected before all the elements for which it returns + * false). The function shall not modify its argument. + * + * @return An iterator that points to the first element of the second group of elements (those for which pred + * returns false), or last if this group is {@link Container.empty empty}. + */ + function stable_partition>(first: BidirectionalIterator, last: BidirectionalIterator, pred: (x: T) => boolean): BidirectionalIterator; + /** + * Partition range into two. + * + * Copies the elements in the range [first, last) for which pred returns true + * into the range pointed by result_true, and those for which it does not into the range pointed by + * result_false. + * + * @param first {@link Iterator Input iterator} to the initial position of the range to be copy-partitioned. + * @param last {@link Iterator Input iterator} to the final position of the range to be copy-partitioned. The range + * used is [first, last), which contains all the elements between first and + * last, including the element pointed by first but not the element pointed by last. + * @param result_true {@link Iterator Output iterator} to the initial position of the range where the elements for + * which pred returns true are stored. + * @param result_false {@link Iterator Output iterator} to the initial position of the range where the elements for + * which pred returns false are stored. + * @param pred Unary function that accepts an element pointed by InputIterator as argument, and returns a value + * convertible to bool. The value returned indicates on which result range the element is + * copied. The function shall not modify its argument. + * + * @return A {@link Pair} of iterators with the end of the generated sequences pointed by result_true and + * result_false, respectivelly. Its member {@link Pair.first first} points to the element that follows + * the last element copied to the sequence of elements for which pred returned true. Its + * member {@link Pair.second second} points to the element that follows the last element copied to the sequence + * of elements for which pred returned false. + */ + function partition_copy, OutputIterator1 extends base.ILinearIterator, OutputIterator2 extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result_true: OutputIterator1, result_false: OutputIterator2, pred: (val: T) => T): Pair; + /** + * Get partition point. + * + * Returns an iterator to the first element in the partitioned range [first, last) for which + * pred is not true, indicating its partition point. + * + * The elements in the range shall already {@link is_partitioned be partitioned}, as if {@link partition} had been + * called with the same arguments. + * + * The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted + * range, which is specially efficient for {@link Iteartor random-access iterators}. + * + * @param first {@link Iterator Forward iterator} to the initial position of the partitioned sequence. + * @param last {@link Iterator Forward iterator} to the final position of the partitioned sequence. The range checked + * is [first, last), which contains all the elements between first an last, + * including the element pointed by first but not the element pointed by last. + * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to + * bool. The value returned indicates whether the element goes before the partition point (if + * true, it goes before; if false goes at or after it). The function shall not + * modify its argument. + * + * @return An iterator to the first element in the partitioned range [first, last) for which pred + * is not true, or last if it is not true for any element. + */ + function partition_point>(first: ForwardIterator, last: ForwardIterator, pred: (x: T) => boolean): ForwardIterator; +} +declare namespace std { + /** + * Merge sorted ranges. + * + * Combines the elements in the sorted ranges [first1, last1) and [first2, last2), into + * a new range beginning at result with all its elements sorted. + * + * The elements are compared using {@link less}. The elements in both ranges shall already be ordered according to + * this same criterion ({@link less}). The resulting range is also sorted according to this. + * + * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. + * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is + * [first1, last1), which contains all the elements between first1 and last1, + * including the element pointed by first1 but not the element pointed by last1. + * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. + * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is + * [first2, last2). + * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting combined + * range is stored. Its size is equal to the sum of both ranges above. + * + * @return An iterator pointing to the past-the-end element in the resulting sequence. + */ + function merge, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator): OutputIterator; + /** + * Merge sorted ranges. + * + * Combines the elements in the sorted ranges [first1, last1) and [first2, last2), into + * a new range beginning at result with all its elements sorted. + * + * The elements are compared using {@link less}. The elements in both ranges shall already be ordered according to + * this same criterion (compare). The resulting range is also sorted according to this. + * + * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. + * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is + * [first1, last1), which contains all the elements between first1 and last1, + * including the element pointed by first1 but not the element pointed by last1. + * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. + * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is + * [first2, last2). + * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting combined + * range is stored. Its size is equal to the sum of both ranges above. + * @param compare Binary function that accepts two arguments of the types pointed by the iterators, and returns a value + * convertible to bool. The value returned indicates whether the first argument is + * considered to go before the second in the specific strict weak ordering it defines. The + * function shall not modify any of its arguments. + * + * @return An iterator pointing to the past-the-end element in the resulting sequence. + */ + function merge, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator, compare: (x: T, y: T) => boolean): OutputIterator; + /** + * Merge consecutive sorted ranges. + * + * Merges two consecutive sorted ranges: [first, middle) and [middle, last), putting + * the result into the combined sorted range [first, last). + * + * The elements are compared using {@link less}. The elements in both ranges shall already be ordered according to + * this same criterion ({@link less}). The resulting range is also sorted according to this. + * + * The function preserves the relative order of elements with equivalent values, with the elements in the first + * range preceding those equivalent in the second. + * + * @param first {@link Iterator Bidirectional iterator} to the initial position in the first sorted sequence to merge. + * This is also the initial position where the resulting merged range is stored. + * @param middle {@link Iterator Bidirectional iterator} to the initial position of the second sorted sequence, which + * because both sequences must be consecutive, matches the past-the-end position of the first + * sequence. + * @param last {@link Iterator Bidirectional iterator} to the past-the-end position of the second sorted + * sequence. This is also the past-the-end position of the range where the resulting merged range is + * stored. + */ + function inplace_merge>(first: BidirectionalIterator, middle: BidirectionalIterator, last: BidirectionalIterator): void; + /** + * Merge consecutive sorted ranges. + * + * Merges two consecutive sorted ranges: [first, middle) and [middle, last), putting + * the result into the combined sorted range [first, last). + * + * The elements are compared using compare. The elements in both ranges shall already be ordered according + * to this same criterion (compare). The resulting range is also sorted according to this. + * + * The function preserves the relative order of elements with equivalent values, with the elements in the first + * range preceding those equivalent in the second. + * + * @param first {@link Iterator Bidirectional iterator} to the initial position in the first sorted sequence to merge. + * This is also the initial position where the resulting merged range is stored. + * @param middle {@link Iterator Bidirectional iterator} to the initial position of the second sorted sequence, which + * because both sequences must be consecutive, matches the past-the-end position of the first + * sequence. + * @param last {@link Iterator Bidirectional iterator} to the past-the-end position of the second sorted + * sequence. This is also the past-the-end position of the range where the resulting merged range is + * stored. + * @param compare Binary function that accepts two arguments of the types pointed by the iterators, and returns a value + * convertible to bool. The value returned indicates whether the first argument is + * considered to go before the second in the specific strict weak ordering it defines. The + * function shall not modify any of its arguments. + */ + function inplace_merge>(first: BidirectionalIterator, middle: BidirectionalIterator, last: BidirectionalIterator, compare: (x: T, y: T) => boolean): void; + /** + * Test whether sorted range includes another sorted range. + * + * Returns true if the sorted range [first1, last1) contains all the elements in the + * sorted range [first2, last2). + * + * The elements are compared using {@link less}. Two elements, x and y are considered equivalent + * if (!less(x, y) && !less(y, x)). + * + * The elements in the range shall already be ordered according to this same criterion ({@link less}). + * + * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. + * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence (which is tested on + * whether it contains the second sequence). The range used is [first1, last1), which + * contains all the elements between first1 and last1, including the element pointed by + * first1 but not the element pointed by last1. + * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. + * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. (which is tested + * on whether it is contained in the first sequence). The range used is [first2, last2). + * + * @return true if every element in the range [first2, last2) is contained in the range + * [first1, last1), false otherwise. If [first2, last2) is an empty + * range, the function returns true. + */ + function includes, InputIterator2 extends Iterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2): boolean; + /** + * Test whether sorted range includes another sorted range. + * + * Returns true if the sorted range [first1, last1) contains all the elements in the + * sorted range [first2, last2). + * + * The elements are compared using compare. Two elements, x and y are considered equivalent + * if (!compare(x, y) && !compare(y, x)). + * + * The elements in the range shall already be ordered according to this same criterion (compare). + * + * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. + * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence (which is tested on + * whether it contains the second sequence). The range used is [first1, last1), which + * contains all the elements between first1 and last1, including the element pointed by + * first1 but not the element pointed by last1. + * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. + * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. (which is tested + * on whether it is contained in the first sequence). The range used is [first2, last2). + * @param compare Binary function that accepts two elements as arguments (one from each of the two sequences, in the + * same order), and returns a value convertible to bool. The value returned indicates + * whether the element passed as first argument is considered to go before the second in the specific + * strict weak ordering it defines. The function shall not modify any of its arguments. + * + * @return true if every element in the range [first2, last2) is contained in the range + * [first1, last1), false otherwise. If [first2, last2) is an empty + * range, the function returns true. + */ + function includes, InputIterator2 extends Iterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, compare: (x: T, y: T) => boolean): boolean; + /** + * Union of two sorted ranges. + * + * Constructs a sorted range beginning in the location pointed by result with the set union of the + * two sorted ranges [first1, last1) and [first2, last2). + * + * The union of two sets is formed by the elements that are present in either one of the sets, or in both. + * Elements from the second range that have an equivalent element in the first range are not copied to the resulting + * range. + * + * The elements are compared using {@link less}. Two elements, x and y are considered equivalent + * if (!less(x, y) && !less(y, x)). + * + * The elements in the ranges shall already be ordered according to this same criterion ({@link less}). The + * resulting range is also sorted according to this. + * + * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. + * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is + * [first1, last1), which contains all the elements between first1 and last1, + * including the element pointed by first1 but not the element pointed by last1. + * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. + * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is + * [first2, last2). + * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is + * stored. The pointed type shall support being assigned the value of an element from the other ranges. + * + * @return An iterator to the end of the constructed range. + */ + function set_union, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator): OutputIterator; + /** + * Union of two sorted ranges. + * + * Constructs a sorted range beginning in the location pointed by result with the set union of the + * two sorted ranges [first1, last1) and [first2, last2). + * + * The union of two sets is formed by the elements that are present in either one of the sets, or in both. + * Elements from the second range that have an equivalent element in the first range are not copied to the resulting + * range. + * + * The elements are compared using compare. Two elements, x and y are considered equivalent + * if (!compare(x, y) && !compare(y, x)). + * + * The elements in the ranges shall already be ordered according to this same criterion (compare). The + * resulting range is also sorted according to this. + * + * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. + * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is + * [first1, last1), which contains all the elements between first1 and last1, + * including the element pointed by first1 but not the element pointed by last1. + * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. + * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is + * [first2, last2). + * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is + * stored. The pointed type shall support being assigned the value of an element from the other ranges. + * @param compare Binary function that accepts two arguments of the types pointed by the input iterators, and returns a + * value convertible to bool. The value returned indicates whether the first argument is + * considered to go before the second in the specific strict weak ordering it defines. The + * function shall not modify any of its arguments. + * + * @return An iterator to the end of the constructed range. + */ + function set_union, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator, compare: (x: T, y: T) => boolean): OutputIterator; + /** + * Intersection of two sorted ranges. + * + * Constructs a sorted range beginning in the location pointed by result with the set intersection of + * the two sorted ranges [first1, last1) and [first2, last2). + * + * The intersection of two sets is formed only by the elements that are present in both sets. The elements + * copied by the function come always from the first range, in the same order. + * + * The elements are compared using {@link less}. Two elements, x and y are considered equivalent + * if (!less(x, y) && !less(y, x)). + * + * The elements in the ranges shall already be ordered according to this same criterion ({@link less}). The + * resulting range is also sorted according to this. + * + * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. + * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is + * [first1, last1), which contains all the elements between first1 and last1, + * including the element pointed by first1 but not the element pointed by last1. + * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. + * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is + * [first2, last2). + * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is + * stored. The pointed type shall support being assigned the value of an element from the first range. + * + * @return An iterator to the end of the constructed range. + */ + function set_intersection, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator): OutputIterator; + /** + * Intersection of two sorted ranges. + * + * Constructs a sorted range beginning in the location pointed by result with the set intersection of + * the two sorted ranges [first1, last1) and [first2, last2). + * + * The intersection of two sets is formed only by the elements that are present in both sets. The elements + * copied by the function come always from the first range, in the same order. + * + * The elements are compared using compare. Two elements, x and y are considered equivalent + * if (!compare(x, y) && !compare(y, x)). + * + * The elements in the ranges shall already be ordered according to this same criterion (compare). The + * resulting range is also sorted according to this. + * + * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. + * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is + * [first1, last1), which contains all the elements between first1 and last1, + * including the element pointed by first1 but not the element pointed by last1. + * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. + * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is + * [first2, last2). + * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is + * stored. The pointed type shall support being assigned the value of an element from the first range. + * @param compare Binary function that accepts two arguments of the types pointed by the input iterators, and returns a + * value convertible to bool. The value returned indicates whether the first argument is + * considered to go before the second in the specific strict weak ordering it defines. The + * function shall not modify any of its arguments. + * + * @return An iterator to the end of the constructed range. + */ + function set_intersection, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator, compare: (x: T, y: T) => boolean): OutputIterator; + /** + * Difference of two sorted ranges. + * + * Constructs a sorted range beginning in the location pointed by result with the set difference of + * the sorted range [first1, last1) with respect to the sorted range [first2, last2). + * + * The difference of two sets is formed by the elements that are present in the first set, but not in the + * second one. The elements copied by the function come always from the first range, in the same order. + * + * For containers supporting multiple occurrences of a value, the difference includes as many occurrences of + * a given value as in the first range, minus the amount of matching elements in the second, preserving order. + * + * Notice that this is a directional operation - for a symmetrical equivalent, see {@link set_symmetric_difference}. + * + * The elements are compared using {@link less}. Two elements, x and y are considered equivalent + * if (!less(x, y) && !less(y, x)). + * + * The elements in the ranges shall already be ordered according to this same criterion ({@link less}). The + * resulting range is also sorted according to this. + * + * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. + * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is + * [first1, last1), which contains all the elements between first1 and last1, + * including the element pointed by first1 but not the element pointed by last1. + * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. + * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is + * [first2, last2). + * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is + * stored. The pointed type shall support being assigned the value of an element from the first range. + * + * @return An iterator to the end of the constructed range. + */ + function set_difference, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator): OutputIterator; + /** + * Difference of two sorted ranges. + * + * Constructs a sorted range beginning in the location pointed by result with the set difference of + * the sorted range [first1, last1) with respect to the sorted range [first2, last2). + * + * The difference of two sets is formed by the elements that are present in the first set, but not in the + * second one. The elements copied by the function come always from the first range, in the same order. + * + * For containers supporting multiple occurrences of a value, the difference includes as many occurrences of + * a given value as in the first range, minus the amount of matching elements in the second, preserving order. + * + * Notice that this is a directional operation - for a symmetrical equivalent, see {@link set_symmetric_difference}. + * + * The elements are compared using compare. Two elements, x and y are considered equivalent + * if (!compare(x, y) && !compare(y, x)). + * + * The elements in the ranges shall already be ordered according to this same criterion (compare). The + * resulting range is also sorted according to this. + * + * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. + * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is + * [first1, last1), which contains all the elements between first1 and last1, + * including the element pointed by first1 but not the element pointed by last1. + * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. + * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is + * [first2, last2). + * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is + * stored. The pointed type shall support being assigned the value of an element from the first range. + * @param compare Binary function that accepts two arguments of the types pointed by the input iterators, and returns a + * value convertible to bool. The value returned indicates whether the first argument is + * considered to go before the second in the specific strict weak ordering it defines. The + * function shall not modify any of its arguments. + * + * @return An iterator to the end of the constructed range. + */ + function set_difference, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator, compare: (x: T, y: T) => boolean): OutputIterator; + /** + * Symmetric difference of two sorted ranges. + * + * Constructs a sorted range beginning in the location pointed by0 result with the set + * symmetric difference of the two sorted ranges [first1, last1) and [first2, last2). + * + * The symmetric difference of two sets is formed by the elements that are present in one of the sets, but + * not in the other. Among the equivalent elements in each range, those discarded are those that appear before in the + * existent order before the call. The existing order is also preserved for the copied elements. + * + * The elements are compared using {@link less}. Two elements, x and y are considered equivalent + * if (!less(x, y) && !less(y, x)). + * + * The elements in the ranges shall already be ordered according to this same criterion ({@link less}). The + * resulting range is also sorted according to this. + * + * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. + * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is + * [first1, last1), which contains all the elements between first1 and last1, + * including the element pointed by first1 but not the element pointed by last1. + * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. + * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is + * [first2, last2). + * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is + * stored. The pointed type shall support being assigned the value of an element from the other ranges. + * @param compare Binary function that accepts two arguments of the types pointed by the input iterators, and returns a + * value convertible to bool. The value returned indicates whether the first argument is + * considered to go before the second in the specific strict weak ordering it defines. The + * function shall not modify any of its arguments. + * + * @return An iterator to the end of the constructed range. + */ + function set_symmetric_difference, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator): OutputIterator; + /** + * Symmetric difference of two sorted ranges. + * + * Constructs a sorted range beginning in the location pointed by0 result with the set + * symmetric difference of the two sorted ranges [first1, last1) and [first2, last2). + * + * The symmetric difference of two sets is formed by the elements that are present in one of the sets, but + * not in the other. Among the equivalent elements in each range, those discarded are those that appear before in the + * existent order before the call. The existing order is also preserved for the copied elements. + * + * The elements are compared using compare. Two elements, x and y are considered equivalent + * if (!compare(x, y) && !compare(y, x)). + * + * The elements in the ranges shall already be ordered according to this same criterion (compare). The + * resulting range is also sorted according to this. + * + * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. + * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is + * [first1, last1), which contains all the elements between first1 and last1, + * including the element pointed by first1 but not the element pointed by last1. + * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. + * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is + * [first2, last2). + * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is + * stored. The pointed type shall support being assigned the value of an element from the other ranges. + * @param compare Binary function that accepts two arguments of the types pointed by the input iterators, and returns a + * value convertible to bool. The value returned indicates whether the first argument is + * considered to go before the second in the specific strict weak ordering it defines. The + * function shall not modify any of its arguments. + * + * @return An iterator to the end of the constructed range. + */ + function set_symmetric_difference, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator, compare: (x: T, y: T) => boolean): OutputIterator; +} +declare namespace std { + /** + * Return the smallest. + * + * Returns the smallest of all the elements in the args. + * + * @param args Values to compare. + * + * @return The lesser of the values passed as arguments. + */ + function min(...args: T[]): T; + /** + * Return the largest. + * + * Returns the largest of all the elements in the args. + * + * @param args Values to compare. + * + * @return The largest of the values passed as arguments. + */ + function max(...args: T[]): T; + /** + * Return smallest and largest elements. + * + * Returns a {@link Pair} with the smallest of all the elements in the args as first element (the first of + * them, if there are more than one), and the largest as second (the last of them, if there are more than one). + * + * @param args Values to compare. + * + * @return The lesser and greatest of the values passed as arguments. + */ + function minmax(...args: T[]): Pair; + /** + * Return smallest element in range. + * + * Returns an iterator pointing to the element with the smallest value in the range [first, last). + * + * The comparisons are performed using either {@link less}; An element is the smallest if no other element + * compares less than it. If more than one element fulfills this condition, the iterator returned points to the first + * of such elements. + * + * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. + * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used + * is [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * + * @return An iterator to smallest value in the range, or last if the range is empty. + */ + function min_element>(first: ForwardIterator, last: ForwardIterator): ForwardIterator; + /** + * Return smallest element in range. + * + * Returns an iterator pointing to the element with the smallest value in the range [first, last). + * + * The comparisons are performed using either compare; An element is the smallest if no other element + * compares less than it. If more than one element fulfills this condition, the iterator returned points to the first + * of such elements. + * + * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. + * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used + * is [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value convertible + * to bool. The value returned indicates whether the element passed as first argument is + * considered less than the second. The function shall not modify any of its arguments. + * + * @return An iterator to smallest value in the range, or last if the range is empty. + */ + function min_element>(first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): ForwardIterator; + /** + * Return largest element in range. + * + * Returns an iterator pointing to the element with the largest value in the range [first, last). + * + * The comparisons are performed using either {@link greater}; An element is the largest if no other element + * compares less than it. If more than one element fulfills this condition, the iterator returned points to the first + * of such elements. + * + * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. + * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used + * is [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * + * @return An iterator to largest value in the range, or last if the range is empty. + */ + function max_element>(first: ForwardIterator, last: ForwardIterator): ForwardIterator; + /** + * Return largest element in range. + * + * Returns an iterator pointing to the element with the largest value in the range [first, last). + * + * The comparisons are performed using either compare; An element is the largest if no other element + * compares less than it. If more than one element fulfills this condition, the iterator returned points to the first + * of such elements. + * + * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. + * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used + * is [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value convertible + * to bool. The value returned indicates whether the element passed as first argument is + * considered less than the second. The function shall not modify any of its arguments. + * + * @return An iterator to largest value in the range, or last if the range is empty. + */ + function max_element>(first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): ForwardIterator; + /** + * Return smallest and largest elements in range. + * + * Returns a {@link Pair} with an iterator pointing to the element with the smallest value in the range + * [first, last) as first element, and the largest as second. + * + * The comparisons are performed using either {@link less} and {@link greater}. + * + * If more than one equivalent element has the smallest value, the first iterator points to the first of such + * elements. + * + * If more than one equivalent element has the largest value, the second iterator points to the last of such + * elements. + * + * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. + * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used + * is [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value convertible + * to bool. The value returned indicates whether the element passed as first argument is + * considered less than the second. The function shall not modify any of its arguments. + * + * @return A {@link Pair} with an iterator pointing to the element with the smallest value in the range + * [first, last) as first element, and the largest as second. + */ + function minmax_element>(first: ForwardIterator, last: ForwardIterator): Pair; + /** + * Return smallest and largest elements in range. + * + * Returns a {@link Pair} with an iterator pointing to the element with the smallest value in the range + * [first, last) as first element, and the largest as second. + * + * The comparisons are performed using either compare. + * + * If more than one equivalent element has the smallest value, the first iterator points to the first of such + * elements. + * + * If more than one equivalent element has the largest value, the second iterator points to the last of such + * elements. + * + * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. + * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used + * is [first, last), which contains all the elements between first and last, + * including the element pointed by first but not the element pointed by last. + * @param compare Binary function that accepts two elements in the range as arguments, and returns a value convertible + * to bool. The value returned indicates whether the element passed as first argument is + * considered less than the second. The function shall not modify any of its arguments. + * + * @return A {@link Pair} with an iterator pointing to the element with the smallest value in the range + * [first, last) as first element, and the largest as second. + */ + function minmax_element>(first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): Pair; + /** + * Clamp a value between a pair of boundary. + * + * @param v The value to clamp. + * @param lo Start of the boundaries to clamp *v* to. + * @param hi Terminal of the boundaries to clamp *v* to. + * + * @return *lo* if *v* is less than *lo*, *hi* if *hi* is less than *v*, otherwise *v*. + */ + function clamp(v: T, lo: T, hi: T): T; + /** + * Clamp a value between a pair of boundary. + * + * @param v The value to clamp. + * @param lo Start of the boundaries to clamp *v* to. + * @param hi Terminal of the boundaries to clamp *v* to. + * @param comp Binary function that accepts two elements as arguments (one of each of the two sequences, in the + * same order), and returns a value convertible to bool. The value returned indicates + * whether the elements are considered to match in the context of this function. + * + * @return *lo* if *v* is less than *lo*, *hi* if *hi* is less than *v*, otherwise *v*. + */ + function clamp(v: T, lo: T, hi: T, comp: (x: T, y: T) => boolean): T; + /** + * Test whether range is permutation of another. + * + * Compares the elements in the range [first1, last1) with those in the range beginning at + * first2, and returns true if all of the elements in both ranges match, even in a different + * order. + * + * @param first1 An {@link Iterator} to the initial position of the first sequence. + * @param last1 An {@link Iterator} to the final position in a sequence. The range used is + * [first1, last1), including the element pointed by first1, but not the element + * pointed by last1. + * @param first2 An {@link Iterator} to the initial position of the second sequence. The comparison includes up to + * as many elements of this sequence as those in the range [first1, last1). + * + * @return true if all the elements in the range [first1, last1) compare equal to those + * of the range starting at first2 in any order, and false otherwise. + */ + function is_permutation, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2): boolean; + /** + * Test whether range is permutation of another. + * + * Compares the elements in the range [first1, last1) with those in the range beginning at + * first2, and returns true if all of the elements in both ranges match, even in a different + * order. + * + * @param first1 An {@link Iterator} to the initial position of the first sequence. + * @param last1 An {@link Iterator} to the final position in a sequence. The range used is + * [first1, last1), including the element pointed by first1, but not the element + * pointed by last1. + * @param first2 An {@link Iterator} to the initial position of the second sequence. The comparison includes up to + * as many elements of this sequence as those in the range [first1, last1). + * @param pred Binary function that accepts two elements as argument (one of each of the two sequences, in the same + * order), and returns a value convertible to bool. The value returned indicates whether + * the elements are considered to match in the context of this function. + * + * @return true if all the elements in the range [first1, last1) compare equal to those + * of the range starting at first2 in any order, and false otherwise. + */ + function is_permutation, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, pred: (x: T, y: T) => boolean): boolean; + /** + * Transform range to previous permutation. + * + * Rearranges the elements in the range [*first*, *last*) into the previous *lexicographically-ordered* permutation. + * + * A *permutation* is each one of the N! possible arrangements the elements can take (where *N* is the number of + * elements in the range). Different permutations can be ordered according to how they compare + * {@link lexicographicaly lexicographical_compare} to each other; The first such-sorted possible permutation (the one + * that would compare *lexicographically smaller* to all other permutations) is the one which has all its elements + * sorted in ascending order, and the largest has all its elements sorted in descending order. + * + * The comparisons of individual elements are performed using the {@link less less()} function. + * + * If the function can determine the previous permutation, it rearranges the elements as such and returns true. If + * that was not possible (because it is already at the lowest possible permutation), it rearranges the elements + * according to the last permutation (sorted in descending order) and returns false. + * + * @param first Bidirectional iterators to the initial positions of the sequence + * @param last Bidirectional iterators to the final positions of the sequence. The range used is [*first*, *last*), + * which contains all the elements between *first* and *last*, including the element pointed by *first* + * but not the element pointed by *last*. + * + * @return true if the function could rearrange the object as a lexicographicaly smaller permutation. Otherwise, the + * function returns false to indicate that the arrangement is not less than the previous, but the largest + * possible (sorted in descending order). + */ + function prev_permutation>(first: BidirectionalIterator, last: BidirectionalIterator): boolean; + /** + * Transform range to previous permutation. + * + * Rearranges the elements in the range [*first*, *last*) into the previous *lexicographically-ordered* permutation. + * + * A *permutation* is each one of the N! possible arrangements the elements can take (where *N* is the number of + * elements in the range). Different permutations can be ordered according to how they compare + * {@link lexicographicaly lexicographical_compare} to each other; The first such-sorted possible permutation (the one + * that would compare *lexicographically smaller* to all other permutations) is the one which has all its elements + * sorted in ascending order, and the largest has all its elements sorted in descending order. + * + * The comparisons of individual elements are performed using the *compare*. + * + * If the function can determine the previous permutation, it rearranges the elements as such and returns true. If + * that was not possible (because it is already at the lowest possible permutation), it rearranges the elements + * according to the last permutation (sorted in descending order) and returns false. + * + * @param first Bidirectional iterators to the initial positions of the sequence + * @param last Bidirectional iterators to the final positions of the sequence. The range used is [*first*, *last*), + * which contains all the elements between *first* and *last*, including the element pointed by *first* + * but not the element pointed by *last*. + * @param compare Binary function that accepts two arguments of the type pointed by BidirectionalIterator, and returns + * a value convertible to bool. The value returned indicates whether the first argument is considered + * to go before the second in the specific strict weak ordering it defines. + * + * @return true if the function could rearrange the object as a lexicographicaly smaller permutation. Otherwise, the + * function returns false to indicate that the arrangement is not less than the previous, but the largest + * possible (sorted in descending order). + */ + function prev_permutation>(first: BidirectionalIterator, last: BidirectionalIterator, compare: (x: T, y: T) => boolean): boolean; + /** + * Transform range to next permutation. + * + * Rearranges the elements in the range [*first*, *last*) into the next *lexicographically greater* permutation. + * + * A permutation is each one of the *N!* possible arrangements the elements can take (where *N* is the number of + * elements in the range). Different permutations can be ordered according to how they compare + * {@link lexicographicaly lexicographical_compare} to each other; The first such-sorted possible permutation (the one + * that would compare *lexicographically smaller* to all other permutations) is the one which has all its elements + * sorted in ascending order, and the largest has all its elements sorted in descending order. + * + * The comparisons of individual elements are performed using the {@link less} function. + * + * If the function can determine the next higher permutation, it rearranges the elements as such and returns true. If + * that was not possible (because it is already at the largest possible permutation), it rearranges the elements + * according to the first permutation (sorted in ascending order) and returns false. + * + * @param first Bidirectional iterators to the initial positions of the sequence + * @param last Bidirectional iterators to the final positions of the sequence. The range used is [*first*, *last*), + * which contains all the elements between *first* and *last*, including the element pointed by *first* + * but not the element pointed by *last*. + * + * @return true if the function could rearrange the object as a lexicographicaly greater permutation. Otherwise, the + * function returns false to indicate that the arrangement is not greater than the previous, but the lowest + * possible (sorted in ascending order). + */ + function next_permutation>(first: BidirectionalIterator, last: BidirectionalIterator): boolean; + /** + * Transform range to next permutation. + * + * Rearranges the elements in the range [*first*, *last*) into the next *lexicographically greater* permutation. + * + * A permutation is each one of the *N!* possible arrangements the elements can take (where *N* is the number of + * elements in the range). Different permutations can be ordered according to how they compare + * {@link lexicographicaly lexicographical_compare} to each other; The first such-sorted possible permutation (the one + * that would compare *lexicographically smaller* to all other permutations) is the one which has all its elements + * sorted in ascending order, and the largest has all its elements sorted in descending order. + * + * The comparisons of individual elements are performed using the *compare*. + * + * If the function can determine the next higher permutation, it rearranges the elements as such and returns true. If + * that was not possible (because it is already at the largest possible permutation), it rearranges the elements + * according to the first permutation (sorted in ascending order) and returns false. + * + * @param first Bidirectional iterators to the initial positions of the sequence + * @param last Bidirectional iterators to the final positions of the sequence. The range used is [*first*, *last*), + * which contains all the elements between *first* and *last*, including the element pointed by *first* + * but not the element pointed by *last*. + * @param compare Binary function that accepts two arguments of the type pointed by BidirectionalIterator, and returns + * a value convertible to bool. The value returned indicates whether the first argument is considered + * to go before the second in the specific strict weak ordering it defines. + * + * @return true if the function could rearrange the object as a lexicographicaly greater permutation. Otherwise, the + * function returns false to indicate that the arrangement is not greater than the previous, but the lowest + * possible (sorted in ascending order). + */ + function next_permutation>(first: BidirectionalIterator, last: BidirectionalIterator, compare: (x: T, y: T) => boolean): boolean; +} +declare namespace std.base { + /** + * An abstract container. + * + * + * + * + * + * ### Container properties + *
+ *
Sequence
+ *
Elements in sequence containers are ordered in a strict linear sequence. Individual elements are + * accessed by their position in this sequence.
+ * + *
Doubly-linked list
+ *
Each element keeps information on how to locate the next and the previous elements, allowing + * constant time insert and erase operations before or after a specific element (even of entire ranges), + * but no direct random access.
+ *
+ * + * @param Type of elements. + * + * @author Jeongho Nam + */ + abstract class Container { + /** + * Default Constructor. + */ + protected constructor(); + /** + * Assign new content to content. + * + * Assigns new contents to the container, replacing its current contents, and modifying its + * {@link size} accordingly. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + abstract assign>(begin: InputIterator, end: InputIterator): void; + /** + * Clear content. + * + * Removes all elements from the Container, leaving the container with a size of 0. + */ + clear(): void; + /** + * Return iterator to beginning. + * + * Returns an iterator referring the first element in the + * + * #### Note + * If the container is {@link empty}, the returned iterator is same with {@link end end()}. + * + * @return An iterator to the first element in the The iterator containes the first element's value. + */ + abstract begin(): Iterator; + /** + * Return iterator to end. + * Returns an iterator referring to the past-the-end element in the + * + * The past-the-end element is the theoretical element that would follow the last element in the + * It does not point to any element, and thus shall not be dereferenced. + * + * Because the ranges used by functions of the Container do not include the element reference by their + * closing iterator, this function is often used in combination with {@link Container}.{@link begin} to + * specify a range including all the elements in the container. + * + * #### Note + * Returned iterator from {@link Container}.{@link end} does not refer any element. Trying to accessing + * element by the iterator will cause throwing exception ({@link OutOfRange}). + * + * If the container is {@link empty}, this function returns the same as {@link Container}.{@link begin}. + * + * + * @return An iterator to the end element in the + */ + abstract end(): Iterator; + /** + * Return {@link ReverseIterator reverse iterator} to reverse beginning. + * + * Returns a {@link ReverseIterator reverse iterator} pointing to the last element in the container (i.e., + * its reverse beginning). + * + * {@link ReverseIterator reverse iterators} iterate backwards: increasing them moves them towards the + * beginning of the + * + * {@link rbegin} points to the element right before the one that would be pointed to by member {@link end}. + * + * + * @return A {@link ReverseIterator reverse iterator} to the reverse beginning of the sequence + */ + abstract rbegin(): IReverseIterator; + /** + * Return {@link ReverseIterator reverse iterator} to reverse end. + * + * Returns a {@link ReverseIterator reverse iterator} pointing to the theoretical element preceding the + * first element in the container (which is considered its reverse end). + * + * The range between {@link Container}.{@link rbegin} and {@link Container}.{@link rend} contains all + * the elements of the container (in reverse order). + * + * @return A {@link ReverseIterator reverse iterator} to the reverse end of the sequence + */ + abstract rend(): IReverseIterator; + /** + * Return the number of elements in the {@link Container}. + * + * @return The number of elements in the container. + */ + abstract size(): number; + /** + * Test whether the container is empty. + * Returns whether the container is empty (i.e. whether its size is 0). + * + * This function does not modify the container in any way. To clear the content of the container, + * see {@link clear clear()}. + * + * @return true if the container size is 0, false otherwise. + */ + empty(): boolean; + /** + * Insert elements. + * + * Appends new elements to the container, and returns the new size of the + * + * @param items New elements to insert. + * + * @return New size of the Container. + */ + abstract push(...items: T[]): number; + /** + * Insert an element. + * + * The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link Container.size container size} by the amount of + * elements inserted. + * + * @param position Position in the {@link Container} where the new element is inserted. + * {@link iterator} is a member type, defined as a {@link Iterator random access iterator} + * type that points to elements. + * @param val Value to be copied to the inserted element. + * + * @re + public abstract insert(position: Iterator, val: T): Iterator; + + /* --------------------------------------------------------- + ERASE + --------------------------------------------------------- */ + /** + * Erase an element. + * + * Removes from the container a single element. + * + * This effectively reduces the container size by the number of element removed. + * + * @param position Iterator pointing to a single element to be removed from the Container. + * + * @return An iterator pointing to the element that followed the last element erased by the function + * call. This is the {@link end Container.end} if the operation erased the last element in the + * sequence. + */ + abstract erase(position: Iterator): Iterator; + /** + * Erase elements. + * + * Removes from the container a range of elements. + * + * This effectively reduces the container size by the number of elements removed. + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the element that followed the last element erased by the function + * call. This is the {@link end Container.end} if the operation erased the last element in + * the sequence. + */ + abstract erase(begin: Iterator, end: Iterator): Iterator; + /** + * Swap content. + * + * Exchanges the content of the container by the content of obj, which is another + * {@link Container container} object with same type of elements. Sizes and container type may differ. + * + * After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects. + * + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. + * + * @param obj Another {@link Container container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link Container container}. + */ + swap(obj: Container): void; + } + interface IReverseIterator extends ReverseIterator, Iterator, IReverseIterator> { + } +} +declare namespace std { + /** + * Bi-directional iterator. + * + * {@link Iterator Bidirectional iterators} are iterators that can be used to access the sequence of elements + * in a range in both directions (towards the end and towards the beginning). + * + * All {@link IArrayIterator random-access iterators} are also valid {@link Iterrator bidirectional iterators}. + * + * There is not a single type of {@link Iterator bidirectional iterator}: {@link Container Each container} + * may define its own specific iterator type able to iterate through it and access its elements. + * + * + * + * + * @reference http://www.cplusplus.com/reference/iterator/BidirectionalIterator + * @author Jeongho Nam + */ + abstract class Iterator { + /** + * @hidden + */ + protected source_: base.Container; + /** + * Construct from the source {@link Container container}. + * + * @param source The source container. + */ + protected constructor(source: base.Container); + /** + * Get iterator to previous element. + * + * If current iterator is the first item(equal with {@link Container.begin Container.begin()}), + * returns {@link Container.end Container.end()}. + * + * @return An iterator of the previous item. + */ + abstract prev(): Iterator; + /** + * Get iterator to next element. + * + * If current iterator is the last item, returns {@link Container.end Container.end()}. + * + * @return An iterator of the next item. + */ + abstract next(): Iterator; + /** + * Advances the {@link Iterator} by n element positions. + * + * @param n Number of element positions to advance. + * @return An advanced iterator. + */ + abstract advance(n: number): Iterator; + /** + * Get source container. + * + * Get source container of this iterator is directing for. + */ + abstract source(): base.Container; + /** + * Whether an iterator is equal with the iterator. + * + * Compare two iterators and returns whether they are equal or not. + * + * #### Note + * Iterator's {@link equals equals()} only compare souce container and index number. + * + * Although elements in a pair, key and value are {@link equal_to equal_to}, if the source map or + * index number is different, then the {@link equals equals()} will return false. If you want to + * compare the elements of a pair, compare them directly by yourself. + * + * @param obj An iterator to compare + * @return Indicates whether equal or not. + */ + equals(obj: Iterator): boolean; + /** + * Get value of the iterator is pointing. + * + * @return A value of the iterator. + */ + readonly abstract value: T; + abstract swap(obj: Iterator): void; + } +} +declare namespace std { + /** + * This class reverses the direction in which a bidirectional or random-access iterator iterates through a range. + * + * A copy of the original iterator (the {@link Iterator base iterator}) is kept internally and used to reflect + * the operations performed on the {@link ReverseIterator}: whenever the {@link ReverseIterator} is incremented, its + * {@link Iterator base iterator} is decreased, and vice versa. A copy of the {@link Iterator base iterator} with the + * current state can be obtained at any time by calling member {@link base}. + * + * Notice however that when an iterator is reversed, the reversed version does not point to the same element in + * the range, but to the one preceding it. This is so, in order to arrange for the past-the-end element of a + * range: An iterator pointing to a past-the-end element in a range, when reversed, is pointing to the last element + * (not past it) of the range (this would be the first element of the reversed range). And if an iterator to the + * first element in a range is reversed, the reversed iterator points to the element before the first element (this + * would be the past-the-end element of the reversed range). + * + * + * + * + * @reference http://www.cplusplus.com/reference/iterator/reverse_iterator + * @author Jeongho Nam + */ + abstract class ReverseIterator, Base extends Iterator, This extends ReverseIterator> extends Iterator { + /** + * @hidden + */ + protected base_: Base; + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + protected constructor(base: Base); + /** + * @hidden + */ + protected abstract _Create_neighbor(base: Base): This; + source(): Source; + /** + * Return base iterator. + * + * Return a reference of the base iteraotr. + * + * The base iterator is an iterator of the same type as the one used to construct the {@link ReverseIterator}, + * but pointing to the element next to the one the {@link ReverseIterator} is currently pointing to + * (a {@link ReverseIterator} has always an offset of -1 with respect to its base iterator). + * + * @return A reference of the base iterator, which iterates in the opposite direction. + */ + base(): Base; + /** + * Get value of the iterator is pointing. + * + * @return A value of the reverse iterator. + */ + readonly value: T; + /** + * @inheritdoc + */ + prev(): This; + /** + * @inheritdoc + */ + next(): This; + /** + * @inheritdoc + */ + advance(n: number): This; + /** + * @inheritdoc + */ + equals(obj: This): boolean; + /** + * @inheritdoc + */ + swap(obj: This): void; + } + /** + * Return the number of elements in the {@link Container}. + * + * @param container A container with a size method. + * @return The number of elements in the container. + */ + function size(container: base.Container): number; + /** + * Test whether the container is empty. + * + * Returns whether the {@link Container} is empty (i.e. whether its {@link size} is 0). + * + * @param container A container with a empty method. + * @return true if the container size is 0, false otherwise. + */ + function empty(container: base.Container): boolean; + /** + * Return distance between {@link Iterator iterators}. + * + * Calculates the number of elements between first and last. + * + * If it is a {@link IArrayIterator random-access iterator}, the function uses operator- to calculate this. + * Otherwise, the function uses the increase operator {@link Iterator.next next()} repeatedly. + * + * @param first Iterator pointing to the initial element. + * @param last Iterator pointing to the final element. This must be reachable from first. + * + * @return The number of elements between first and last. + */ + function distance>(first: InputIterator, last: InputIterator): number; + /** + * Advance iterator. + * + * Advances the iterator it by n elements positions. + * + * @param it Iterator to be advanced. + * @param n Number of element positions to advance. + * + * @return An iterator to the element n positions before it. + */ + function advance>(it: InputIterator, n: number): InputIterator; + /** + * Get iterator to previous element. + * + * Returns an iterator pointing to the element that it would be pointing to if advanced -n positions. + * + * @param it Iterator to base position. + * @param n Number of element positions offset (1 by default). + * + * @return An iterator to the element n positions before it. + */ + function prev>(it: BidirectionalIterator, n?: number): BidirectionalIterator; + /** + * Get iterator to next element. + * + * Returns an iterator pointing to the element that it would be pointing to if advanced n positions. + * + * @param it Iterator to base position. + * @param n Number of element positions offset (1 by default). + * + * @return An iterator to the element n positions away from it. + */ + function next>(it: ForwardIterator, n?: number): ForwardIterator; + /** + * Iterator to beginning. + * + * Returns an iterator pointing to the first element in the sequence. + * + * If the sequence is {@link empty}, the returned value shall not be dereferenced. + * + * @param container A container object of a class type for which member {@link begin} is defined. + * @return The same as returned by {@link begin begin()}. + */ + function begin(container: base.Container): Iterator; + function begin(container: Vector): VectorIterator; + function begin(container: List): ListIterator; + function begin(container: Deque): DequeIterator; + function begin(container: base.SetContainer): SetIterator; + function begin(container: base.MapContainer): MapIterator; + /** + * Iterator to reverse-beginning. + * + * Returns a reverse iterator pointing to the last element in the sequence. + * + * If the sequence is {@link empty}, the returned value shall not be dereferenced. + * + * @param container A container object of a class type for which member {@link rbegin} is defined. + * @return The same as returned by {@link rbegin()}. + */ + function rbegin(container: base.Container): base.IReverseIterator; + function rbegin(container: Vector): VectorReverseIterator; + function rbegin(container: List): ListReverseIterator; + function rbegin(container: Deque): DequeReverseIterator; + function rbegin(container: base.SetContainer): SetReverseIterator; + function rbegin(container: base.MapContainer): MapReverseIterator; + /** + * Iterator to end. + * + * Returns an iterator pointing to the past-the-end element in the sequence. + * + * If the sequence is {@link empty}, the returned value compares equal to the one returned by {@link begin} with the same argument. + * + * @param container A container of a class type for which member {@link end} is defined. + * @return The same as returned by {@link end end()}. + */ + function end(container: base.Container): Iterator; + function end(container: Vector): VectorIterator; + function end(container: List): ListIterator; + function end(container: Deque): DequeIterator; + function end(container: base.SetContainer): SetIterator; + function end(container: base.MapContainer): MapIterator; + /** + * Iterator to end. + * + * Returns an iterator pointing to the past-the-end element in the sequence. + * + * If the sequence is {@link empty}, the returned value compares equal to the one returned by {@link begin} with the same argument. + * + * @param container A container of a class type for which member {@link end} is defined. + * @return The same as returned by {@link end end()}. + */ + function rend(container: base.Container): base.IReverseIterator; + function rend(container: Vector): VectorReverseIterator; + function rend(container: List): ListReverseIterator; + function rend(container: Deque): DequeReverseIterator; + function rend(container: base.SetContainer): SetReverseIterator; + function rend(container: base.MapContainer): MapReverseIterator; + /** + * Make reverse iterator. + * + * @param it A reference of the base iterator, which iterates in the opposite direction. + * @return A {@link ReverseIterator reverse iterator} based on *it*. + */ + function make_reverse_iterator(it: VectorIterator): VectorReverseIterator; + function make_reverse_iterator(it: DequeIterator): DequeReverseIterator; + function make_reverse_iterator(it: ListIterator): ListReverseIterator; + function make_reverse_iterator(it: SetIterator): SetReverseIterator; + function make_reverse_iterator(it: MapIterator): MapReverseIterator; +} +declare namespace std.base { + /** + * @hidden + */ + abstract class _ListContainer> extends Container implements IDequeContainer { + /** + * @hidden + */ + private begin_; + /** + * @hidden + */ + private end_; + /** + * @hidden + */ + private size_; + /** + * Default Constructor. + */ + protected constructor(); + /** + * @hidden + */ + protected abstract _Create_iterator(prev: BidirectionalIterator, next: BidirectionalIterator, val: T): BidirectionalIterator; + /** + * @hidden + */ + protected _Set_begin(it: BidirectionalIterator): void; + /** + * @inheritdoc + */ + assign>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + begin(): BidirectionalIterator; + /** + * @inheritdoc + */ + end(): BidirectionalIterator; + /** + * @inheritdoc + */ + size(): number; + /** + * @inheritdoc + */ + front(): T; + /** + * @inheritdoc + */ + back(): T; + /** + * @inheritdoc + */ + push_front(val: T): void; + /** + * @inheritdoc + */ + push_back(val: T): void; + /** + * @inheritdoc + */ + pop_front(): void; + /** + * @inheritdoc + */ + pop_back(): void; + /** + * @inheritdoc + */ + push(...items: T[]): number; + /** + * Insert an element. + * + * The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted. + * + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. + * + * @param position Position in the container where the new element is inserted. + * {@link iterator}> is a member type, defined as a + * {@link ListIterator bidirectional iterator} type that points to elements. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the newly inserted element; val. + */ + insert(position: BidirectionalIterator, val: T): BidirectionalIterator; + /** + * Insert elements by repeated filling. + * + * The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted. + * + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. + * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListIterator bidirectional iterator} type that points to + * elements. + * @param size Number of elements to insert. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: BidirectionalIterator, size: number, val: T): BidirectionalIterator; + /** + * Insert elements by range iterators. + * + * The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted. + * + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. + * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListIterator bidirectional iterator} type that points to + * elements. + * @param begin An iterator specifying range of the begining element. + * @param end An iterator specifying range of the ending element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: BidirectionalIterator, begin: InputIterator, end: InputIterator): BidirectionalIterator; + /** + * @hidden + */ + private _Insert_by_repeating_val(position, n, val); + /** + * @hidden + */ + protected _Insert_by_range>(position: BidirectionalIterator, begin: InputIterator, end: InputIterator): BidirectionalIterator; + /** + * Erase an element. + * + * Removes from the {@link List} either a single element; position. + * + * This effectively reduces the container size by the number of element removed. + * + * Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence. + * + * @param position Iterator pointing to a single element to be removed from the {@link List}. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link end end()} if the operation erased the last element in the sequence. + */ + erase(position: BidirectionalIterator): BidirectionalIterator; + /** + * Erase elements. + * + * Removes from the {@link List} container a range of elements. + * + * This effectively reduces the container {@link size} by the number of elements removed. + * + * Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence. + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link end end()} if the operation erased the last element in the sequence. + */ + erase(begin: BidirectionalIterator, end: BidirectionalIterator): BidirectionalIterator; + /** + * @hidden + */ + protected _Erase_by_range(first: BidirectionalIterator, last: BidirectionalIterator): BidirectionalIterator; + /** + * Swap content. + * + * Exchanges the content of the container by the content of obj, which is another + * {@link List container} object with same type of elements. Sizes and container type may differ. + * + * After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects. + * + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. + * + * @param obj Another {@link List container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link List container}. + */ + swap(obj: _ListContainer): void; + /** + * @inheritdoc + */ + swap(obj: Container): void; + } +} +declare namespace std.base { + /** + * @hidden + */ + abstract class _ListIteratorBase extends Iterator { + /** + * @hidden + */ + protected prev_: _ListIteratorBase; + /** + * @hidden + */ + protected next_: _ListIteratorBase; + /** + * @hidden + */ + protected value_: T; + /** + * Initializer Constructor. + * + * @param source The source {@link Container} to reference. + * @param prev A refenrece of previous node ({@link ListIterator iterator}). + * @param next A refenrece of next node ({@link ListIterator iterator}). + * @param value Value to be stored in the node (iterator). + */ + protected constructor(source: Container, prev: _ListIteratorBase, next: _ListIteratorBase, value: T); + /** + * @inheritdoc + */ + prev(): _ListIteratorBase; + /** + * @inheritdoc + */ + next(): _ListIteratorBase; + /** + * @inheritdoc + */ + advance(step: number): _ListIteratorBase; + /** + * @inheritdoc + */ + readonly value: T; + /** + * @inheritdoc + */ + equals(obj: _ListIteratorBase): boolean; + /** + * @inheritdoc + */ + swap(obj: _ListIteratorBase): void; + } +} +declare namespace std.base { + /** + * An abstract error instance. + * + * {@link ErrorInstance} is an abstract class of {@link ErrorCode} and {@link ErrorCondition} + * holding an error instance's identifier {@link value}, associated with a {@link category}. + * + * The operating system and other low-level applications and libraries generate numerical error codes to + * represent possible results. These numerical values may carry essential information for a specific platform, + * but be non-portable from one platform to another. + * + * Objects of this class associate such numerical codes to {@link ErrorCategory error categories}, + * so that they can be interpreted when needed as more abstract (and portable) + * {@link ErrorCondition error conditions}. + * + * + * + * + * @author Jeongho Nam + */ + abstract class ErrorInstance { + /** + * @hidden + */ + protected category_: ErrorCategory; + /** + * @hidden + */ + protected value_: number; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from a numeric value and error category. + * + * @param val A numerical value identifying an error instance. + * @param category A reference to an {@link ErrorCategory} object. + */ + constructor(val: number, category: ErrorCategory); + /** + * Assign error instance. + * + * Assigns the {@link ErrorCode} object a value of val associated with the {@link ErrorCategory}. + * + * @param val A numerical value identifying an error instance. + * @param category A reference to an {@link ErrorCategory} object. + */ + assign(val: number, category: ErrorCategory): void; + /** + * Clear error instance. + * + * Clears the value in the {@link ErrorCode} object so that it is set to a value of 0 of the + * {@link ErrorCategory.systemCategory ErrorCategory.systemCategory()} (indicating no error). + */ + clear(): void; + /** + * Get category. + * + * Returns a reference to the {@link ErrorCategory} associated with the {@link ErrorCode} object. + * + * @return A reference to a non-copyable object of a type derived from {@link ErrorCategory}. + */ + category(): ErrorCategory; + /** + * Error value. + * + * Returns the error value associated with the {@link ErrorCode} object. + * + * @return The error value. + */ + value(): number; + /** + * Get message. + * + * Returns the message associated with the error instance. + * + * Error messages are defined by the {@link category} the error instance belongs to. + * + * This function returns the same as if the following member was called: + * + * category().message(value()) + * + * @return A string object with the message associated with the {@link ErrorCode}. + */ + message(): string; + /** + * Default error condition. + * + * Returns the default {@link ErrorCondition}object associated with the {@link ErrorCode} object. + * + * This function returns the same as if the following member was called: + * + * category().default_error_condition(value()) + * + * {@link ErrorCategory.default_error_condition ErrorCategory.default_error_condition()} + * is a virtual member function, that can operate differently for each category. + * + * @return An {@link ErrorCondition}object that corresponds to the {@link ErrorCode} object. + */ + default_error_condition(): ErrorCondition; + /** + * Convert to bool. + * + * Returns whether the error instance has a numerical {@link value} other than 0. + * + * If it is zero (which is generally used to represent no error), the function returns false, otherwise it returns true. + * + * @return true if the error's numerical value is not zero. + * false otherwise. + */ + to_bool(): boolean; + } +} +declare namespace std.base { + /** + * @hidden + */ + enum _Hash { + MIN_SIZE = 10, + RATIO = 1, + MAX_RATIO = 2, + } + /** + * @hidden + */ + abstract class _HashBuckets { + private buckets_; + private item_size_; + protected constructor(); + rehash(size: number): void; + clear(): void; + size(): number; + item_size(): number; + capacity(): number; + at(index: number): Vector; + hash_index(val: T): number; + insert(val: T): void; + erase(val: T): void; + } +} +declare namespace std.base { + /** + * @hidden + */ + class _MapHashBuckets extends _HashBuckets> { + private map_; + constructor(map: IHashMap); + find(key: K): MapIterator; + } +} +declare namespace std.base { + /** + * @hidden + */ + class _SetHashBuckets extends _HashBuckets> { + private set_; + constructor(set: IHashSet); + find(val: T): SetIterator; + } +} +declare namespace std.base { + /** + * Array Container. + * + * {@link IArrayContainer} is an interface for sequence containers representing arrays that can change in + * {@link size}. However, compared to arrays, {@link IArrayContainer} objectss consume more memory in exchange for + * the ability to manage storage and grow dynamically in an efficient way. + * + * Both {@link Vector Vectors} and {@link Deque Deques} who implemented {@link IArrayContainer} provide a very + * similar interface and can be used for similar purposes, but internally both work in quite different ways: + * While {@link Vector Vectors} use a single array that needs to be occasionally reallocated for growth, the + * elements of a {@link Deque} can be scattered in different chunks of storage, with the container keeping the + * necessary information internally to provide direct access to any of its elements in constant time and with a + * uniform sequential interface (through iterators). Therefore, {@link Deque Deques} are a little more complex + * internally than {@link Vector Vectors}, but this allows them to grow more efficiently under certain + * circumstances, especially with very long sequences, where reallocations become more expensive. + * + * Both {@link Vector Vectors} and {@link Deque Deques} provide a very similar interface and can be used for + * similar purposes, but internally both work in quite different ways: While {@link Vector Vectors} use a single + * array that needs to be occasionally reallocated for growth, the elements of a {@link Deque} can be scattered + * in different chunks of storage, with the container keeping the necessary information internally to provide + * direct access to any of its elements in constant time and with a uniform sequential interface (through + * iterators). Therefore, {@link Deque Deques} are a little more complex internally than {@link Vector Vectors}, + * but this allows them to grow more efficiently under certain circumstances, especially with very long + * sequences, where reallocations become more expensive. + * + * For operations that involve frequent insertion or removals of elements at positions other than the + * beginning or the end, {@link IArrayContainer} objects perform worse and have less consistent iterators and references + * than {@link List Lists}. + * + * + * + * + * + * ### Container properties + *
+ *
Sequence
+ *
+ * Elements in sequence containers are ordered in a strict linear sequence. Individual elements are + * accessed by their position in this sequence. + *
+ * + *
Dynamic array
+ *
+ * Allows direct access to any element in the sequence, even through pointer arithmetics, and provides + * relatively fast addition/removal of elements at the end of the sequence. + *
+ *
+ * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + interface IArrayContainer extends ILinearContainer { + /** + * Access element. + * Returns a value to the element at position index in the {@link IArrayContainer container}.

+ * + * The function automatically checks whether index is within the bounds of valid elements + * in the {@link IArrayContainer container}, throwing an {@link OutOfRange} exception if it is not (i.e., + * if index is greater or equal than its {@link size}). + * + * @param index Position of an element in the + * If this is greater than or equal to the {@link IArrayContainer container} {@link size}, an + * exception of type {@link OutOfRange} is thrown. Notice that the first + * element has a position of 0 (not 1). + * + * @return The element at the specified position in the + */ + at(index: number): T; + /** + * Modify element. + * Replaces an element at the specified position (index) in this {@link IArrayContainer container} + * with the specified element (val). + * + * The function automatically checks whether index is within the bounds of valid elements + * in the {@link IArrayContainer container}, throwing an {@link OutOfRange} exception if it is not (i.e., if + * index is greater or equal than its {@link size}). + * + * @.param index A specified position of the value to replace. + * @param val A value to be stored at the specified position. + * + * @return The previous element had stored at the specified position. + */ + set(index: number, val: T): void; + } + /** + * Random-access iterator. + * + * {@link IArrayIterator Random-access iterators} are iterators that can be used to access elements at an + * arbitrary offset position relative to the element they point to, offering the same functionality as pointers. + * + * {@link IArrayIterator Random-access iterators} are the most complete iterators in terms of functionality. + * All pointer types are also valid {@link IArrayIterator random-access iterators}. + * + * There is not a single type of {@link IArrayIterator random-access iterator}: Each container may define its + * own specific iterator type able to iterate through it and access its elements. + * + * + * + * + * + * @reference http://www.cplusplus.com/reference/iterator/RandomAccessIterator + * @author Jeongho Nam + */ + interface IArrayIterator extends ILinearIterator { + /** + * @inheritdoc + */ + source(): IArrayContainer; + /** + * Get index, sequence number of the iterator in the source {@link IArrayContainer array}. + * + * @return Sequence number of the iterator in the source {@link IArrayContainer array}. + */ + index(): number; + /** + * @inheritdoc + */ + prev(): IArrayIterator; + /** + * @inheritdoc + */ + next(): IArrayIterator; + } +} +declare namespace std.base { + /** + * An interface for deque + * + * + * + * + * + * @author Jeongho Nam + */ + interface IDequeContainer extends ILinearContainer { + /** + * Insert element at beginning. + * + * Inserts a new element at the beginning of the {@link IDeque container}, right before its + * current first element. This effectively increases the {@link IDeque container} {@link size} by + * one. + * + * @param val Value to be inserted as an element. + */ + push_front(val: T): void; + /** + * Delete first element. + * + * Removes the first element in the {@link IDeque container}, effectively reducing its + * {@link size} by one. + */ + pop_front(): void; + } +} +declare namespace std.base { + /** + * Common interface for hash map. + * + * {@link IHashMap}s are associative containers that store elements formed by the combination of + * a key value and a mapped value. + * + * In an {@link IHashMap}, the key value is generally used to uniquely identify the + * element, while the mapped value is an object with the content associated to this key. + * Types of key and mapped value may differ. + * + * Internally, the elements in the {@link IHashMap} are not sorted in any particular order with + * respect to either their key or mapped values, but organized into buckets depending on + * their hash values to allow for fast access to individual elements directly by their key values + * (with a constant average time complexity on average). + * + * Elements with equivalent keys are grouped together in the same bucket and in such a way that + * an iterator can iterate through all of them. Iterators in the container are doubly linked iterators. + * + * + * + * + * + * ### Container properties + *
+ *
Associative
+ *
Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
+ * + *
Hashed
+ *
Hashed containers organize their elements using hash tables that allow for fast access to elements + * by their key.
+ * + *
Map
+ *
Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value.
+ *
+ * + * @param Type of the key values. + * Each element in an {@link IHashMap} is identified by a key value. + * @param Type of the mapped value. + * Each element in an {@link IHashMap} is used to store some data as its mapped value. + * + * @reference http://www.cplusplus.com/reference/unordered_map + * @author Jeongho Nam + */ + interface IHashMap extends MapContainer { + /** + * Return number of buckets. + * + * Returns the number of buckets in the {@link IHashMap} container. + * + * A bucket is a slot in the container's internal hash table to which elements are assigned based on the + * hash value of their key. + * + * The number of buckets influences directly the {@link load_factor load factor} of the container's hash + * table (and thus the probability of collision). The container automatically increases the number of buckets to + * keep the load factor below a specific threshold (its {@link max_load_factor}), causing a {@link rehash} each + * time the number of buckets needs to be increased. + * + * @return The current amount of buckets. + */ + bucket_count(): number; + /** + * Return bucket size. + * + * Returns the number of elements in bucket n. + * + * A bucket is a slot in the container's internal hash table to which elements are assigned based on the hash + * value of their key. + * + * The number of elements in a bucket influences the time it takes to access a particular element in the + * bucket. The container automatically increases the number of buckets to keep the {@link load_cator load factor} + * (which is the average bucket size) below its {@link max_load_factor}. + * + * @param n Bucket number. This shall be lower than {@link bucket_count}. + * + * @return The number of elements in bucket n. + */ + bucket_size(n: number): number; + /** + * Get maximum load factor. + * + * Returns the current maximum load factor for the {@link HashMultiMap} container. + * + * The load factor is the ratio between the number of elements in the container (its {@link size}) and the + * number of buckets ({@link bucket_count}). + * + * By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0. + * + * The load factor influences the probability of collision in the hash table (i.e., the probability of two + * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold + * that forces an increase in the number of buckets (and thus causing a {@link rehash}). + * + * Note though, that implementations may impose an upper limit on the number of buckets (see + * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}. + * + * @return The current load factor. + */ + max_load_factor(): number; + /** + * Set maximum load factor. + * + * Sets z as the cnew maximum load factor for the {@link HashMultiMap} container. + * + * The load factor is the ratio between the number of elements in the container (its {@link size}) and the + * number of buckets ({@link bucket_count}). + * + * By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0. + * + * The load factor influences the probability of collision in the hash table (i.e., the probability of two + * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold + * that forces an increase in the number of buckets (and thus causing a {@link rehash}). + * + * Note though, that implementations may impose an upper limit on the number of buckets (see + * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}. + * + * @param z The new maximum load factor. + */ + max_load_factor(z: number): void; + /** + * Locate element's bucket. + * + * Returns the bucket number where the element with key is located. + * + * A bucket is a slot in the container's internal hash table to which elements are assigned based on the + * hash value of their key. Buckets are numbered from 0 to ({@link bucket_count} - 1). + * + * Individual elements in a bucket can be accessed by means of the range iterators returned by + * {@link begin} and {@link end}. + * + * @param key Key whose bucket is to be located. + */ + bucket(key: Key): number; + /** + * Request a capacity change. + * + * Sets the number of buckets in the container ({@link bucket_count}) to the most appropriate to contain at + * least n elements. + * + * If n is greater than the current {@link bucket_count} multiplied by the {@link max_load_factor}, + * the container's {@link bucket_count} is increased and a {@link rehash} is forced. + * + * If n is lower than that, the function may have no effect. + * + * @param n The number of elements requested as minimum capacity. + */ + reserve(n: number): void; + /** + * Set number of buckets. + * + * Sets the number of buckets in the container to n or more. + * + * If n is greater than the current number of buckets in the container ({@link bucket_count}), a + * {@link HashBuckets.rehash rehash} is forced. The new {@link bucket_count bucket count} can either be equal or + * greater than n. + * + * If n is lower than the current number of buckets in the container ({@link bucket_count}), the + * function may have no effect on the {@link bucket_count bucket count} and may not force a + * {@link HashBuckets.rehash rehash}. + * + * A {@link HashBuckets.rehash rehash} is the reconstruction of the hash table: All the elements in the + * container are rearranged according to their hash value into the new set of buckets. This may alter the order + * of iteration of elements within the container. + * + * {@link HashBuckets.rehash Rehashes} are automatically performed by the container whenever its + * {@link load_factor load factor} is going to surpass its {@link max_load_factor} in an operation. + * + * Notice that this function expects the number of buckets as argument. A similar function exists, + * {@link reserve}, that expects the number of elements in the container as argument. + * + * @param n The minimum number of buckets for the container hash table. + */ + rehash(n: number): void; + } +} +declare namespace std.base { + /** + * A common interface for hash set. + * + * {@link IHashSet}s are containers that store unique elements in no particular order, and which + * allow for fast retrieval of individual elements based on their value. + * + * In an {@link IHashSet}, the value of an element is at the same time its key, that + * identifies it uniquely. Keys are immutable, therefore, the elements in an {@link IHashSet} cannot be + * modified once in the container - they can be inserted and removed, though. + * + * Internally, the elements in the {@link IHashSet} are not sorted in any particular order, but + * organized into buckets depending on their hash values to allow for fast access to individual elements + * directly by their values (with a constant average time complexity on average). + * + * {@link IHashSet} containers are faster than {@link TreeSet} containers to access individual + * elements by their key, although they are generally less efficient for range iteration through a + * subset of their elements. + * + * + * + * + * + * ### Container properties + *
+ *
Associative
+ *
Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
+ * + *
Hashed
+ *
Hashed containers organize their elements using hash tables that allow for fast access to elements + * by their key.
+ * + *
Set
+ *
The value of an element is also the key used to identify it.
+ *
+ * + * @param Type of the elements. + * Each element in an {@link IHashSet} is also uniquely identified by this value. + * + * @reference http://www.cplusplus.com/reference/unordered_set/unordered_set + * @author Jeongho Nam + */ + interface IHashSet extends SetContainer { + /** + * Return number of buckets. + * + * Returns the number of buckets in the {@link IHashSet} container. + * + * A bucket is a slot in the container's internal hash table to which elements are assigned based on the + * hash value of their key. + * + * The number of buckets influences directly the {@link load_factor load factor} of the container's hash + * table (and thus the probability of collision). The container automatically increases the number of buckets to + * keep the load factor below a specific threshold (its {@link max_load_factor}), causing a {@link rehash} each + * time the number of buckets needs to be increased. + * + * @return The current amount of buckets. + */ + bucket_count(): number; + /** + * Return bucket size. + * + * Returns the number of elements in bucket n. + * + * A bucket is a slot in the container's internal hash table to which elements are assigned based on the hash + * value of their key. + * + * The number of elements in a bucket influences the time it takes to access a particular element in the + * bucket. The container automatically increases the number of buckets to keep the {@link load_cator load factor} + * (which is the average bucket size) below its {@link max_load_factor}. + * + * @param n Bucket number. This shall be lower than {@link bucket_count}. + * + * @return The number of elements in bucket n. + */ + bucket_size(n: number): number; + /** + * Get maximum load factor. + * + * Returns the current maximum load factor for the {@link HashMultiMap} container. + * + * The load factor is the ratio between the number of elements in the container (its {@link size}) and the + * number of buckets ({@link bucket_count}). + * + * By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0. + * + * The load factor influences the probability of collision in the hash table (i.e., the probability of two + * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold + * that forces an increase in the number of buckets (and thus causing a {@link rehash}). + * + * Note though, that implementations may impose an upper limit on the number of buckets (see + * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}. + * + * @return The current load factor. + */ + max_load_factor(): number; + /** + * Set maximum load factor. + * + * Sets z as the cnew maximum load factor for the {@link HashMultiMap} container. + * + * The load factor is the ratio between the number of elements in the container (its {@link size}) and the + * number of buckets ({@link bucket_count}). + * + * By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0. + * + * The load factor influences the probability of collision in the hash table (i.e., the probability of two + * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold + * that forces an increase in the number of buckets (and thus causing a {@link rehash}). + * + * Note though, that implementations may impose an upper limit on the number of buckets (see + * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}. + * + * @param z The new maximum load factor. + */ + max_load_factor(z: number): void; + /** + * Locate element's bucket. + * + * Returns the bucket number where the element with key is located. + * + * A bucket is a slot in the container's internal hash table to which elements are assigned based on the + * hash value of their key. Buckets are numbered from 0 to ({@link bucket_count} - 1). + * + * Individual elements in a bucket can be accessed by means of the range iterators returned by + * {@link begin} and {@link end}. + * + * @param key Key whose bucket is to be located. + */ + bucket(key: T): number; + /** + * Request a capacity change. + * + * Sets the number of buckets in the container ({@link bucket_count}) to the most appropriate to contain at + * least n elements. + * + * If n is greater than the current {@link bucket_count} multiplied by the {@link max_load_factor}, + * the container's {@link bucket_count} is increased and a {@link rehash} is forced. + * + * If n is lower than that, the function may have no effect. + * + * @param n The number of elements requested as minimum capacity. + */ + reserve(n: number): void; + /** + * Set number of buckets. + * + * Sets the number of buckets in the container to n or more. + * + * If n is greater than the current number of buckets in the container ({@link bucket_count}), a + * {@link HashBuckets.rehash rehash} is forced. The new {@link bucket_count bucket count} can either be equal or + * greater than n. + * + * If n is lower than the current number of buckets in the container ({@link bucket_count}), the + * function may have no effect on the {@link bucket_count bucket count} and may not force a + * {@link HashBuckets.rehash rehash}. + * + * A {@link HashBuckets.rehash rehash} is the reconstruction of the hash table: All the elements in the + * container are rearranged according to their hash value into the new set of buckets. This may alter the order + * of iteration of elements within the container. + * + * {@link HashBuckets.rehash Rehashes} are automatically performed by the container whenever its + * {@link load_factor load factor} is going to surpass its {@link max_load_factor} in an operation. + * + * Notice that this function expects the number of buckets as argument. A similar function exists, + * {@link reserve}, that expects the number of elements in the container as argument. + * + * @param n The minimum number of buckets for the container hash table. + */ + rehash(n: number): void; + } +} +declare namespace std.base { + /** + * An interface for linear containers. + * + * + * + * + * + * @author Jeonngho Nam + */ + interface ILinearContainer extends Container { + /** + * @inheritdoc + */ + assign>(begin: InputIterator, end: InputIterator): void; + /** + * Assign container content. + * + * Assigns new contents to the {@link IList container}, replacing its current contents, + * and modifying its {@link size} accordingly. + * + * @param n New size for the + * @param val Value to fill the container with. Each of the n elements in the container will + * be initialized to a copy of this value. + */ + assign(n: number, val: T): void; + /** + * Access first element. + * Returns a value of the first element in the {@link IList container}. + * + * Unlike member {@link end end()}, which returns an iterator just past this element, + * this function returns a direct value. + * + * Calling this function on an {@link empty} {@link IList container} causes undefined behavior. + * + * @return A value of the first element of the {@link IList container}. + */ + front(): T; + /** + * Access last element. + * Returns a value of the last element in the {@link IList container}. + * + * Unlike member {@link end end()}, which returns an iterator just past this element, + * this function returns a direct value. + * + * Calling this function on an {@link empty} {@link IList container} causes undefined behavior. + * + * @return A value of the last element of the {@link IList container}. + */ + back(): T; + /** + * Add element at the end. + * + * Adds a new element at the end of the {@link IList container}, after its current last element. + * This effectively increases the {@link IList container} {@link size} by one. + * + * @param val Value to be copied to the new element. + */ + push_back(val: T): void; + /** + * Delete last element. + * + * Removes the last element in the {@link IList container}, effectively reducing the + * {@link IList container} {@link size} by one. + */ + pop_back(): void; + /** + * Insert an element. + * + * The {@link IList conatiner} is extended by inserting new element before the element at the + * specified position, effectively increasing the {@link IList container} {@link size} by + * one. + * + * @param position Position in the {@link IList container} where the new elements are inserted. + * {@link iterator} is a member type, defined as a {@link iterator random access iterator} + * type that points to elements. + * @param val Value to be copied to the inserted element. + * + * @return An iterator that points to the newly inserted element. + */ + insert(position: Iterator, val: T): Iterator; + /** + * Insert elements by range iterators. + * + * The {@link IList container} is extended by inserting new elements before the element at the + * specified position, effectively increasing the {@link IList container} {@link size} by + * the number of repeating elements
n
. + * + * @param position Position in the {@link IList container} where the new elements are inserted. + * {@link iterator} is a member type, defined as a {@link iterator random access iterator} + * type that points to elements. + * @param n Number of elements to insert. Each element is initialized to a copy of val. + * @param val Value to be copied (or moved) to the inserted elements. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: Iterator, n: number, val: T): Iterator; + /** + * Insert elements by range iterators. + * + * The {@link IList container} is extended by inserting new elements before the element at the + * specified position, effectively increasing the {@link IList container} {@link size} by + * the number of elements inserted by range iterators. + * + * @param position Position in the {@link IList container} where the new elements are inserted. + * {@link iterator} is a member type, defined as a {@link iterator random access iterator} + * type that points to elements. + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: Iterator, begin: InputIterator, end: InputIterator): Iterator; + } + /** + * An interface for iterators from linear containers. + * + * {@link ILieanerIterator} is an bi-directional iterator which is created from the related + * {@link ILinearContainer linear containers}. Not only accessing to {@link value} of the pointed element from + * this {@link ILieanerIterator}, but also modifying the {@link value} is possible. + * + * @author Jeongho Nam + */ + interface ILinearIterator extends Iterator { + /** + * @inheritdoc + */ + source(): ILinearContainer; + /** + * @inheritdoc + */ + value: T; + /** + * @inheritdoc + */ + prev(): ILinearIterator; + /** + * @inheritdoc + */ + next(): ILinearIterator; + } +} +declare namespace std.base { + /** + * Common interface for tree-structured map. + * + * {@link ITreeMap ITreeMaps} are associative containers that store elements formed by a combination of + * a key value and a mapped value, following a specific order. + * + * In a {@link ITreeMap}, the key values are generally used to sort and uniquely identify + * the elements, while the mapped values store the content associated to this key. The types of + * key and mapped value may differ, and are grouped together in member type + * value_type, which is a {@link Pair} type combining both: + * + * typedef Pair value_type; + * + * Internally, the elements in a {@link ITreeMap}are always sorted by its key following a + * strict weak ordering criterion indicated by its internal comparison method (of {@link less}). + * + * {@link ITreeMap}containers are generally slower than {@link IHashMap} containers + * to access individual elements by their key, but they allow the direct iteration on subsets based + * on their order. + * + * {@link ITreeMap TreeMultiMaps} are typically implemented as binary search trees. + * + * + * + * + * ### Container properties + *
+ *
Associative
+ *
Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
+ * + *
Ordered
+ *
The elements in the container follow a strict order at all times. All inserted elements are + * given a position in this order.
+ * + *
Map
+ *
Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value.
+ *
+ * + * @param Type of the keys. Each element in a map is uniquely identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @reference http://www.cplusplus.com/reference/map + * @author Jeongho Nam + */ + interface ITreeMap extends MapContainer { + /** + * Return key comparison function. + * + * Returns a references of the comparison function used by the container to compare keys. + * + * The comparison object of a {@link ITreeMap tree-map object} is set on + * {@link TreeMap.constructor construction}. Its type (Key) is the last parameter of the + * {@link ITreeMap.constructor constructors}. By default, this is a {@link less} function, which returns the same + * as operator<. + * + * This function determines the order of the elements in the container: it is a function pointer that takes + * two arguments of the same type as the element keys, and returns true if the first argument + * is considered to go before the second in the strict weak ordering it defines, and false otherwise. + * + * + * Two keys are considered equivalent if {@link key_comp} returns false reflexively (i.e., no + * matter the order in which the keys are passed as arguments). + * + * @return The comparison function. + */ + key_comp(): (x: Key, y: Key) => boolean; + /** + * Return value comparison function. + * + * Returns a comparison function that can be used to compare two elements to get whether the key of the first + * one goes before the second. + * + * The arguments taken by this function object are of member type Pair (defined in + * {@link ITreeMap}), but the mapped type (T) part of the value is not taken into consideration in this + * comparison. + * + * This comparison class returns true if the {@link Pair.first key} of the first argument + * is considered to go before that of the second (according to the strict weak ordering specified by the + * container's comparison function, {@link key_comp}), and false otherwise. + * + * @return The comparison function for element values. + */ + value_comp(): (x: Pair, y: Pair) => boolean; + /** + * Return iterator to lower bound. + * + * Returns an iterator pointing to the first element in the container whose key is not considered to + * go before k (i.e., either it is equivalent or goes after). + * + * The function uses its internal comparison object (key_comp) to determine this, returning an + * iterator to the first element for which key_comp(k, element_key) would return false. + * + * If the {@link ITreeMap} class is instantiated with the default comparison type ({@link less}), + * the function returns an iterator to the first element whose key is not less than k. + * + * A similar member function, {@link upper_bound}, has the same behavior as {@link lower_bound}, except + * in the case that the {@link ITreeMap} contains an element with a key equivalent to k: In this + * case, {@link lower_bound} returns an iterator pointing to that element, whereas {@link upper_bound} + * returns an iterator pointing to the next element. + * + * @param k Key to search for. + * + * @return An iterator to the the first element in the container whose key is not considered to go before + * k, or {@link ITreeMap.end} if all keys are considered to go before k. + */ + lower_bound(key: Key): MapIterator; + /** + * Return iterator to upper bound. + * + * Returns an iterator pointing to the first element in the container whose key is considered to + * go after k. + * + * The function uses its internal comparison object (key_comp) to determine this, returning an + * iterator to the first element for which key_comp(k, element_key) would return true. + * + * If the {@link ITreeMap} class is instantiated with the default comparison type ({@link less}), + * the function returns an iterator to the first element whose key is greater than k. + * + * A similar member function, {@link lower_bound}, has the same behavior as {@link upper_bound}, except + * in the case that the map contains an element with a key equivalent to k: In this case + * {@link lower_bound} returns an iterator pointing to that element, whereas {@link upper_bound} returns an + * iterator pointing to the next element. + * + * @param k Key to search for. + * + * @return An iterator to the the first element in the container whose key is considered to go after + * k, or {@link TreeMap.end end} if no keys are considered to go after k. + */ + upper_bound(key: Key): MapIterator; + /** + * Get range of equal elements. + * + * Returns the bounds of a range that includes all the elements in the container which have a key + * equivalent to k. + * + * If no matches are found, the range returned has a length of zero, with both iterators pointing to + * the first element that has a key considered to go after k according to the container's internal + * comparison object (key_comp). + * + * Two keys are considered equivalent if the container's comparison object returns false reflexively + * (i.e., no matter the order in which the keys are passed as arguments). + * + * @param k Key to search for. + * + * @return The function returns a {@link Pair}, whose member {@link Pair.first} is the lower bound of + * the range (the same as {@link lower_bound}), and {@link Pair.second} is the upper bound + * (the same as {@link upper_bound}). + */ + equal_range(key: Key): Pair, MapIterator>; + } +} +declare namespace std.base { + /** + * A common interface for tree-structured set. + * + * {@link ITreeSet TreeMultiSets} are containers that store elements following a specific order. + * + * In a {@link ITreeSet}, the value of an element also identifies it (the value is itself + * the key, of type T). The value of the elements in a {@link ITreeSet} cannot + * be modified once in the container (the elements are always const), but they can be inserted or removed + * from the + * + * Internally, the elements in a {@link ITreeSet TreeMultiSets} are always sorted following a strict + * weak ordering criterion indicated by its internal comparison method (of {@link IComparable.less less}). + * + * {@link ITreeSet} containers are generally slower than {@link IHashSet} containers + * to access individual elements by their key, but they allow the direct iteration on subsets based on + * their order. + * + * {@link ITreeSet TreeMultiSets} are typically implemented as binary search trees. + * + * + * + * + * ### Container properties + *
+ *
Associative
+ *
+ * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
+ * + *
Ordered
+ *
+ * The elements in the container follow a strict order at all times. All inserted elements are + * given a position in this order. + *
+ * + *
Set
+ *
The value of an element is also the key used to identify it.
+ *
+ * + * @param Type of the elements. Each element in a {@link ITreeSet} container is also identified + * by this value (each value is itself also the element's key). + * + * @reference http://www.cplusplus.com/reference/set + * @author Jeongho Nam + */ + interface ITreeSet extends SetContainer { + /** + * Return comparison function. + * + * Returns a copy of the comparison function used by the container. + * + * By default, this is a {@link less} object, which returns the same as operator<. + * + * This object determines the order of the elements in the container: it is a function pointer or a function + * object that takes two arguments of the same type as the container elements, and returns true if + * the first argument is considered to go before the second in the strict weak ordering it + * defines, and false otherwise. + * + * Two elements of a {@link ITreeSet} are considered equivalent if {@link key_comp} returns false + * reflexively (i.e., no matter the order in which the elements are passed as arguments). + * + * In {@link ITreeSet} containers, the keys to sort the elements are the values (T) themselves, + * therefore {@link key_comp} and its sibling member function {@link value_comp} are equivalent. + * + * @return The comparison function. + */ + key_comp(): (x: T, y: T) => boolean; + /** + * Return comparison function. + * + * Returns a copy of the comparison function used by the container. + * + * By default, this is a {@link less} object, which returns the same as operator<. + * + * This object determines the order of the elements in the container: it is a function pointer or a function + * object that takes two arguments of the same type as the container elements, and returns true if + * the first argument is considered to go before the second in the strict weak ordering it + * defines, and false otherwise. + * + * Two elements of a {@link ITreeSet} are considered equivalent if {@link key_comp} returns false + * reflexively (i.e., no matter the order in which the elements are passed as arguments). + * + * In {@link ITreeSet} containers, the keys to sort the elements are the values (T) themselves, + * therefore {@link key_comp} and its sibling member function {@link value_comp} are equivalent. + * + * @return The comparison function. + */ + value_comp(): (x: T, y: T) => boolean; + /** + * Return iterator to lower bound. + * + * Returns an iterator pointing to the first element in the container which is not considered to + * go before val (i.e., either it is equivalent or goes after). + * + * The function uses its internal comparison object (key_comp) to determine this, returning an + * iterator to the first element for which key_comp(element,val) would return false. + * + * If the {@link ITreeSet} class is instantiated with the default comparison type ({@link less}), + * the function returns an iterator to the first element that is not less than val. + + * A similar member function, {@link upper_bound}, has the same behavior as {@link lower_bound}, except + * in the case that the {@link ITreeSet} contains elements equivalent to val: In this case + * {@link lower_bound} returns an iterator pointing to the first of such elements, whereas + * {@link upper_bound} returns an iterator pointing to the element following the last. + * + * @param val Value to compare. + * + * @return An iterator to the the first element in the container which is not considered to go before + * val, or {@link ITreeSet.end} if all elements are considered to go before val. + */ + lower_bound(val: T): SetIterator; + /** + * Return iterator to upper bound. + * + * Returns an iterator pointing to the first element in the container which is considered to go after + * val. + + * The function uses its internal comparison object (key_comp) to determine this, returning an + * iterator to the first element for which key_comp(val,element) would return true. + + * If the {@code ITreeSet} class is instantiated with the default comparison type (less), the + * function returns an iterator to the first element that is greater than val. + * + * A similar member function, {@link lower_bound}, has the same behavior as {@link upper_bound}, except + * in the case that the {@ITreeSet} contains elements equivalent to val: In this case + * {@link lower_bound} returns an iterator pointing to the first of such elements, whereas + * {@link upper_bound} returns an iterator pointing to the element following the last. + * + * @param val Value to compare. + * + * @return An iterator to the the first element in the container which is considered to go after + * val, or {@link TreeSet.end end} if no elements are considered to go after val. + */ + upper_bound(val: T): SetIterator; + /** + * Get range of equal elements. + * + * Returns the bounds of a range that includes all the elements in the container that are equivalent + * to val. + * + * If no matches are found, the range returned has a length of zero, with both iterators pointing to + * the first element that is considered to go after val according to the container's + * internal comparison object (key_comp). + * + * Two elements of a multiset are considered equivalent if the container's comparison object returns + * false reflexively (i.e., no matter the order in which the elements are passed as arguments). + * + * @param key Value to search for. + * + * @return The function returns a {@link Pair}, whose member {@link Pair.first} is the lower bound of + * the range (the same as {@link lower_bound}), and {@link Pair.second} is the upper bound + * (the same as {@link upper_bound}). + */ + equal_range(val: T): Pair, SetIterator>; + } +} +declare namespace std.base { + /** + * @hidden + */ + class _ArrayIterator extends Iterator { + private data_; + private index_; + constructor(data: Array, index: number); + source(): Container; + index(): number; + readonly value: T; + prev(): _ArrayIterator; + next(): _ArrayIterator; + advance(n: number): _ArrayIterator; + equals(obj: _ArrayIterator): boolean; + swap(obj: _ArrayIterator): void; + } +} +declare namespace std.base { + /** + * @hidden + */ + class _Repeater extends Iterator { + private index_; + private value_; + constructor(index: number, value?: T); + source(): base.Container; + index(): number; + readonly value: T; + prev(): _Repeater; + next(): _Repeater; + advance(n: number): _Repeater; + equals(obj: _Repeater): boolean; + swap(obj: _Repeater): void; + } +} +declare namespace std.base { + /** + * An abstract map. + * + * {@link MapContainer MapContainers} are associative containers that store elements formed by a combination + * of a key value (Key) and a mapped value (T), and which allows for fast retrieval + * of individual elements based on their keys. + * + * In a {@link MapContainer}, the key values are generally used to identify the elements, while the + * mapped values store the content associated to this key. The types of key and + * mapped value may differ, and are grouped together in member type value_type, which is a + * {@link Pair} type combining both: + * + * typedef pair value_type; + * + * {@link MapContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}. + * + * + * + * + * ### Container properties + *
+ *
Associative
+ *
+ * Elements in associative containers are referenced by their key and not by their absolute position + * in the container. + *
+ * + *
Map
+ *
+ * Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value. + *
+ *
+ * + * @param Type of the keys. Each element in a map is identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @author Jeongho Nam + */ + abstract class MapContainer extends Container> { + /** + * @hidden + */ + private data_; + /** + * Default Constructor. + */ + protected constructor(); + /** + * @inheritdoc + */ + assign>>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + clear(): void; + /** + * Get iterator to element. + * + * Searches the container for an element with a identifier equivalent to key and returns an + * iterator to it if found, otherwise it returns an iterator to {@link end end()}. + * + * Two keys are considered equivalent if the container's comparison object returns false reflexively + * (i.e., no matter the order in which the elements are passed as arguments). + * + * Another member functions, {@link has has()} and {@link count count()}, can be used to just check + * whether a particular key exists. + * + * @param key Key to be searched for + * @return An iterator to the element, if an element with specified key is found, or + * {@link end end()} otherwise. + */ + abstract find(key: Key): MapIterator; + /** + * Return iterator to beginning. + * + * Returns an iterator referring the first element in the + * + * #### Note + * If the container is {@link empty}, the returned iterator is same with {@link end end()}. + * + * @return An iterator to the first element in the The iterator containes the first element's value. + */ + begin(): MapIterator; + /** + * Return iterator to end. + * Returns an iterator referring to the past-the-end element in the + * + * The past-the-end element is the theoretical element that would follow the last element in the + * It does not point to any element, and thus shall not be dereferenced. + * + * Because the ranges used by functions of the container do not include the element reference by their + * closing iterator, this function is often used in combination with {@link MapContainer}.{@link begin} to + * specify a range including all the elements in the + * + * #### Note + * Returned iterator from {@link MapContainer}.{@link end} does not refer any element. Trying to accessing + * element by the iterator will cause throwing exception ({@link OutOfRange}). + * + * If the container is {@link empty}, this function returns the same as {@link begin}. + * + * @return An iterator to the end element in the + */ + end(): MapIterator; + /** + * Return {@link MapReverseIterator reverse iterator} to reverse beginning. + * + * Returns a {@link MapReverseIterator reverse iterator} pointing to the last element in the container + * (i.e., its reverse beginning). + * + * {@link MapReverseIterator Reverse iterators} iterate backwards: increasing them moves them towards the + * beginning of the container. + * + * {@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}. + *7 + * + * @return A {@link MapReverseIterator reverse iterator} to the reverse beginning of the sequence + * + */ + rbegin(): MapReverseIterator; + /** + * Return {@link MapReverseIterator reverse iterator} to reverse end. + * + * Returns a {@link MapReverseIterator reverse iterator} pointing to the theoretical element right before + * the first element in the {@link MapContainer map container} (which is considered its reverse end). + * + * + * The range between {@link MapContainer}.{@link rbegin} and {@link MapContainer}.{@link rend} contains + * all the elements of the container (in reverse order). + * + * @return A {@link MapReverseIterator reverse iterator} to the reverse end of the sequence + */ + rend(): MapReverseIterator; + /** + * Whether have the item or not. + * + * Indicates whether a map has an item having the specified identifier. + * + * @param key Key value of the element whose mapped value is accessed. + * + * @return Whether the map has an item having the specified identifier. + */ + has(key: Key): boolean; + /** + * Count elements with a specific key. + * + * Searches the container for elements whose key is key and returns the number of elements found. + * + * @param key Key value to be searched for. + * + * @return The number of elements in the container with a key. + */ + abstract count(key: Key): number; + /** + * Return the number of elements in the map. + */ + size(): number; + /** + * @inheritdoc + */ + push(...args: Pair[]): number; + /** + * @inheritdoc + */ + push(...args: [Key, T][]): number; + /** + * Construct and insert element with hint + * + * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in + * place using *args* as the arguments for the element's constructor. *hint* points to a location in the + * container suggested as a hint on where to start the search for its insertion point (the container may or + * may not use this suggestion to optimize the insertion operation). + * + * A similar member function exists, {@link insert}, which either copies or moves an existing object into + * the container, and may also take a position *hint*. + * + * @param hint Hint for the position where the element can be inserted. + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + emplace_hint(hint: MapIterator, key: Key, val: T): MapIterator; + /** + * Construct and insert element with hint + * + * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in + * place using *args* as the arguments for the element's constructor. *hint* points to a location in the + * container suggested as a hint on where to start the search for its insertion point (the container may or + * may not use this suggestion to optimize the insertion operation). + * + * A similar member function exists, {@link insert}, which either copies or moves an existing object into + * the container, and may also take a position *hint*. + * + * @param hint Hint for the position where the element can be inserted. + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An {@link MapIterator iterator} pointing to either the newly inserted element or to the element + * that already had an equivalent key in the {@link MapContainer}. + */ + emplace_hint(hint: MapReverseIterator, key: Key, val: T): MapReverseIterator; + /** + * Construct and insert element with hint + * + * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in + * place using *args* as the arguments for the element's constructor. *hint* points to a location in the + * container suggested as a hint on where to start the search for its insertion point (the container may or + * may not use this suggestion to optimize the insertion operation). + * + * A similar member function exists, {@link insert}, which either copies or moves an existing object into + * the container, and may also take a position *hint*. + * + * @param hint Hint for the position where the element can be inserted. + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + emplace_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * Construct and insert element with hint + * + * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in + * place using *args* as the arguments for the element's constructor. *hint* points to a location in the + * container suggested as a hint on where to start the search for its insertion point (the container may or + * may not use this suggestion to optimize the insertion operation). + * + * A similar member function exists, {@link insert}, which either copies or moves an existing object into + * the container, and may also take a position *hint*. + * + * @param hint Hint for the position where the element can be inserted. + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An {@link MapIterator iterator} pointing to either the newly inserted element or to the element + * that already had an equivalent key in the {@link MapContainer}. + */ + emplace_hint(hint: MapReverseIterator, pair: Pair): MapReverseIterator; + /** + * Insert an element. + * + * Extends the container by inserting a new element, effectively increasing the container {@link size} + * by the number of element inserted (zero or one). + * + * @param hint Hint for the position where the element can be inserted. + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + insert(hint: MapIterator, pair: Pair): MapIterator; + /** + * Insert an element. + * + * Extends the container by inserting a new element, effectively increasing the container {@link size} + * by the number of element inserted (zero or one). + * + * @param hint Hint for the position where the element can be inserted. + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; + /** + * Insert an element. + * + * Extends the container by inserting new elements, effectively increasing the container {@link size} + * by the number of elements inserted. + * + * @param hint Hint for the position where the element can be inserted. + * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + insert(hint: MapIterator, tuple: [L, U]): MapIterator; + /** + * Insert an element. + * + * Extends the container by inserting new elements, effectively increasing the container {@link size} + * by the number of elements inserted. + * + * @param hint Hint for the position where the element can be inserted. + * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link MapContainer}. + */ + insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; + /** + * Insert elements from range iterators. + * + * Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted. + * + * @param begin Input iterator specifying initial position of a range of elements. + * @param end Input iterator specifying final position of a range of elements. + * Notice that the range includes all the elements between begin and end, + * including the element pointed by begin but not the one pointed by end. + */ + insert>>(first: InputIterator, last: InputIterator): void; + /** + * @hidden + */ + protected abstract _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + private _Insert_by_tuple(tuple); + /** + * @hidden + */ + protected abstract _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + private _Insert_by_hint_with_tuple(hint, tuple); + /** + * @hidden + */ + protected abstract _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + * Erase an elemet by key. + * + * Removes from the {@link MapContainer map container} a single element. + * + * This effectively reduces the container {@link size} by the number of element removed (zero or one), + * which are destroyed. + * + * @param key Key of the element to be removed from the {@link MapContainer}. + */ + erase(key: Key): number; + /** + * Erase an elemet by iterator. + * + * Removes from the {@link MapContainer map container} a single element. + * + * This effectively reduces the container {@link size} by the number of element removed (zero or one), + * which are destroyed. + * + * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. + */ + erase(it: MapIterator): MapIterator; + /** + * Erase elements by range iterators. + * + * Removes from the {@link MapContainer map container} a range of elements. + * + * This effectively reduces the container {@link size} by the number of elements removed, which are + * destroyed. + * + * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} + * to be removed. + * @param end An iterator specifying initial position of a range within {@link MApContainer map container} + * to be removed. + * Notice that the range includes all the elements between begin and end, + * including the element pointed by begin but not the one pointed by end. + */ + erase(begin: MapIterator, end: MapIterator): MapIterator; + /** + * Erase an elemet by iterator. + * + * Removes from the {@link MapContainer map container} a single element. + * + * This effectively reduces the container {@link size} by the number of element removed (zero or one), + * which are destroyed. + * + * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. + */ + erase(it: MapReverseIterator): MapReverseIterator; + /** + * Erase elements by range iterators. + * + * Removes from the {@link MapContainer map container} a range of elements. + * + * This effectively reduces the container {@link size} by the number of elements removed, which are + * destroyed. + * + * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} + * to be removed. + * @param end An iterator specifying initial position of a range within {@link MApContainer map container} + * to be removed. + * Notice that the range includes all the elements between begin and end, + * including the element pointed by begin but not the one pointed by end. + */ + erase(begin: MapReverseIterator, end: MapReverseIterator): MapReverseIterator; + /** + * @hidden + */ + private _Erase_by_key(key); + /** + * @hidden + */ + private _Erase_by_iterator(first, last?); + /** + * @hidden + */ + private _Erase_by_range(first, last); + /** + * @hidden + */ + protected _Swap(obj: MapContainer): void; + /** + * Merge two maps. + * + * Extracts and transfers elements from *source* to this container. + * + * @param source A {@link MapContainer map container} to transfer the elements from. + */ + abstract merge(source: MapContainer): void; + /** + * @hidden + */ + protected abstract _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + * @hidden + */ + protected abstract _Handle_erase(first: MapIterator, last: MapIterator): void; + } + /** + * @hidden + */ + class _MapElementList extends _ListContainer, MapIterator> { + private associative_; + private rend_; + constructor(associative: MapContainer); + protected _Create_iterator(prev: MapIterator, next: MapIterator, val: Pair): MapIterator; + protected _Set_begin(it: MapIterator): void; + associative(): MapContainer; + rbegin(): MapReverseIterator; + rend(): MapReverseIterator; + } +} +declare namespace std { + /** + * An iterator of {@link MapContainer map container}. + * + * + * + * + * @author Jeongho Nam + */ + class MapIterator extends base._ListIteratorBase> implements IComparable> { + /** + * Construct from the {@link MapContainer source map} and {@link ListIterator list iterator}. + * + * @param source The source {@link MapContainer}. + * @param list_iterator A {@link ListIterator} pointing {@link Pair} of key and value. + */ + constructor(source: base._MapElementList, prev: MapIterator, next: MapIterator, val: Pair); + /** + * Get iterator to previous element. + */ + prev(): MapIterator; + /** + * Get iterator to next element. + */ + next(): MapIterator; + /** + * Advances the Iterator by n element positions. + * + * @param step Number of element positions to advance. + * @return An advanced Iterator. + */ + advance(step: number): MapIterator; + /** + * @hidden + */ + source(): base.MapContainer; + /** + * Get first, key element. + */ + readonly first: Key; + /** + * Get second, value element. + */ + /** + * Set second value. + */ + second: T; + /** + * @inheritdoc + */ + less(obj: MapIterator): boolean; + /** + * @inheritdoc + */ + equals(obj: MapIterator): boolean; + /** + * @inheritdoc + */ + hashCode(): number; + /** + * @inheritdoc + */ + swap(obj: MapIterator): void; + } + /** + * A reverse-iterator of {@link MapContainer map container}. + * + * + * + * + * @author Jeongho Nam + */ + class MapReverseIterator extends ReverseIterator, base.MapContainer, MapIterator, MapReverseIterator> { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: MapIterator); + /** + * @hidden + */ + protected _Create_neighbor(base: MapIterator): MapReverseIterator; + /** + * Get first, key element. + */ + readonly first: Key; + /** + * Get second, value element. + */ + /** + * Set second value. + */ + second: T; + } +} +declare namespace std.base { + /** + * An abstract multi-map. + * + * {@link MultiMap MultiMaps} are associative containers that store elements formed by a combination of a + * key value (Key) and a mapped value (T), and which allows for fast retrieval of + * individual elements based on their keys. + * + * In a {@link MapContainer}, the key values are generally used to identify the elements, while the + * mapped values store the content associated to this key. The types of key and + * mapped value may differ, and are grouped together in member type value_type, which is a + * {@link Pair} type combining both: + * + * typedef pair value_type; + * + * {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}. + * + * + * + * + * ### Container properties + *
+ *
Associative
+ *
+ * Elements in associative containers are referenced by their key and not by their absolute position + * in the container. + *
+ * + *
Map
+ *
+ * Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value. + *
+ * + *
Multiple equivalent keys
+ *
Multiple elements in the container can have equivalent keys.
+ *
+ * + * @param Type of the keys. Each element in a map is identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @author Jeongho Nam + */ + abstract class MultiMap extends MapContainer { + /** + * Construct and insert element. + * + * Inserts a new element in the {@link MultiMap}. This new element is constructed in place using args + * as the arguments for the element's constructor. + * + * This effectively increases the container {@link size} by one. + * + * A similar member function exists, {@link insert}, which either copies or moves existing objects into the + * container. + * + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An {@link MapIterator iterator} to the newly inserted element. + */ + emplace(key: Key, value: T): MapIterator; + /** + * Construct and insert element. + * + * Inserts a new element in the {@link MultiMap}. This new element is constructed in place using args + * as the arguments for the element's constructor. + * + * This effectively increases the container {@link size} by one. + * + * A similar member function exists, {@link insert}, which either copies or moves existing objects into the + * container. + * + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * @return An {@link MapIterator iterator} to the newly inserted element. + */ + emplace(pair: Pair): MapIterator; + /** + * Insert elements. + * + * Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted. + * + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return An iterator pointing to the newly inserted element. + */ + insert(pair: Pair): MapIterator; + /** + * Insert elements. + * + * Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted. + * + * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. + * + * @return An iterator pointing to the newly inserted element. + */ + insert(tuple: [L, U]): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapIterator, pair: Pair): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; + /** + * @inheritdoc + */ + insert(hint: MapIterator, tuple: [L, U]): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; + /** + * @inheritdoc + */ + insert>>(first: InputIterator, last: InputIterator): void; + /** + * @inheritdoc + */ + merge(source: MapContainer): void; + } +} +declare namespace std.base { + /** + * An abstract set. + * + * {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of + * individual elements based on their value. + * + * In an {@link SetContainer}, the value of an element is at the same time its key, used to + * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be + * modified once in the container - they can be inserted and removed, though. + * + * {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}. + * + * + * + * + * ### Container properties + *
+ *
Associative
+ *
+ * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
+ * + *
Set
+ *
The value of an element is also the key used to identify it.
+ *
+ * + * @param Type of the elements. Each element in a {@link SetContainer} container is also identified + * by this value (each value is itself also the element's key). + * + * @author Jeongho Nam + */ + abstract class SetContainer extends Container { + /** + * {@link List} storing elements. + * + * Storing elements and keeping those sequence of the {@link SetContainer} are implemented by + * {@link data_ this list container}. Implementing index-table is also related with {@link data_ this list} + * by storing {@link ListIterator iterators} ({@link SetIterator} references {@link ListIterator}) who are + * created from {@link data_ here}. + */ + private data_; + /** + * Default Constructor. + */ + protected constructor(); + /** + * @inheritdoc + */ + assign>(begin: Iterator, end: Iterator): void; + /** + * @inheritdoc + */ + clear(): void; + /** + * Get iterator to element. + * + * Searches the container for an element with key as value and returns an iterator to it if found, + * otherwise it returns an iterator to {@link end end()} (the element past the end of the container). + * + * Another member function, {@link count count()}, can be used to just check whether a particular element + * exists. + * + * @param key Key to be searched for. + * + * @return An iterator to the element, if the specified value is found, or {@link end end()} if it is not + * found in the + */ + abstract find(val: T): SetIterator; + /** + * @inheritdoc + */ + begin(): SetIterator; + /** + * @inheritdoc + */ + end(): SetIterator; + /** + * @inheritdoc + */ + rbegin(): SetReverseIterator; + /** + * @inheritdoc + */ + rend(): SetReverseIterator; + /** + * Whether have the item or not. + * + * Indicates whether a set has an item having the specified identifier. + * + * @param key Key value of the element whose mapped value is accessed. + * + * @return Whether the set has an item having the specified identifier. + */ + has(val: T): boolean; + /** + * Count elements with a specific key. + * + * Searches the container for elements with a value of k and returns the number of elements found. + * + * @param key Value of the elements to be counted. + * + * @return The number of elements in the container with a key. + */ + abstract count(val: T): number; + /** + * @inheritdoc + */ + size(): number; + /** + * @inheritdoc + */ + push(...items: T[]): number; + /** + * Insert an element with hint. + * + * Extends the container by inserting new elements, effectively increasing the container size by the + * number of elements inserted. + * + * @param hint Hint for the position where the element can be inserted. + * @param val Value to be inserted as an element. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had its + * same value in the {@link SetContainer}. + */ + insert(hint: SetIterator, val: T): SetIterator; + /** + * Insert an element with hint. + * + * Extends the container by inserting new elements, effectively increasing the container size by the + * number of elements inserted. + * + * @param hint Hint for the position where the element can be inserted. + * @param val Value to be inserted as an element. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had its + * same value in the {@link SetContainer}. + */ + insert(hint: SetReverseIterator, val: T): SetReverseIterator; + /** + * Insert elements with a range of a + * + * Extends the container by inserting new elements, effectively increasing the container size by the + * number of elements inserted. + * + * @param begin An iterator specifying range of the begining element. + * @param end An iterator specifying range of the ending element. + */ + insert>(begin: InputIterator, end: InputIterator): void; + /** + * @hidden + */ + protected abstract _Insert_by_val(val: T): any; + /** + * @hidden + */ + protected abstract _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected abstract _Insert_by_range>(begin: InputIterator, end: InputIterator): void; + /** + * Erase an element. + * Removes from the set container the elements whose value is key. + * + * This effectively reduces the container size by the number of elements removed. + * + * @param key Value of the elements to be erased. + * + * @return Number of elements erased. + */ + erase(val: T): number; + /** + * @inheritdoc + */ + erase(it: SetIterator): SetIterator; + /** + * Erase elements. + * Removes from the set container a range of elements.. + * + * This effectively reduces the container size by the number of elements removed. + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + */ + erase(begin: SetIterator, end: SetIterator): SetIterator; + /** + * @inheritdoc + */ + erase(it: SetReverseIterator): SetReverseIterator; + /** + * Erase elements. + * Removes from the set container a range of elements.. + * + * This effectively reduces the container size by the number of elements removed. + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + */ + erase(begin: SetReverseIterator, end: SetReverseIterator): SetReverseIterator; + /** + * @hidden + */ + private _Erase_by_iterator(first, last?); + /** + * @hidden + */ + private _Erase_by_val(val); + /** + * @hidden + */ + private _Erase_by_range(first, last); + /** + * @hidden + */ + protected _Swap(obj: SetContainer): void; + /** + * Merge two sets. + * + * Extracts and transfers elements from *source* to this container. + * + * @param source A {@link SetContainer set container} to transfer the elements from. + */ + abstract merge(source: SetContainer): void; + /** + * @hidden + */ + protected abstract _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + * @hidden + */ + protected abstract _Handle_erase(first: SetIterator, last: SetIterator): void; + } + /** + * @hidden + */ + class _SetElementList extends _ListContainer> { + private associative_; + private rend_; + constructor(associative: SetContainer); + protected _Create_iterator(prev: SetIterator, next: SetIterator, val: T): SetIterator; + protected _Set_begin(it: SetIterator): void; + associative(): SetContainer; + rbegin(): SetReverseIterator; + rend(): SetReverseIterator; + } +} +declare namespace std { + /** + * An iterator of a Set. + * + * + * + * + * @author Jeongho Nam + */ + class SetIterator extends base._ListIteratorBase implements IComparable> { + /** + * Construct from source and index number. + * + * #### Note + * Do not create iterator directly. + * + * Use begin(), find() or end() in Map instead. + * + * @param map The source Set to reference. + * @param index Sequence number of the element in the source Set. + */ + constructor(source: base._SetElementList, prev: SetIterator, next: SetIterator, val: T); + /** + * @inheritdoc + */ + source(): base.SetContainer; + /** + * @inheritdoc + */ + prev(): SetIterator; + /** + * @inheritdoc + */ + next(): SetIterator; + /** + * @inheritdoc + */ + advance(size: number): SetIterator; + /** + * @inheritdoc + */ + less(obj: SetIterator): boolean; + /** + * @inheritdoc + */ + equals(obj: SetIterator): boolean; + /** + * @inheritdoc + */ + hashCode(): number; + /** + * @inheritdoc + */ + swap(obj: SetIterator): void; + } + /** + * A reverse-iterator of Set. + * + * + * + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class SetReverseIterator extends ReverseIterator, SetIterator, SetReverseIterator> { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: SetIterator); + /** + * @hidden + */ + protected _Create_neighbor(base: SetIterator): SetReverseIterator; + } +} +declare namespace std.base { + /** + * An abstract set. + * + * {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of + * individual elements based on their value. + * + * In an {@link SetContainer}, the value of an element is at the same time its key, used to + * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be + * modified once in the container - they can be inserted and removed, though. + * + * {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}. + * + * + * + * + * ### Container properties + *
+ *
Associative
+ *
+ * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
+ * + *
Set
+ *
The value of an element is also the key used to identify it.
+ * + *
Multiple equivalent keys
+ *
Multiple elements in the container can have equivalent keys.
+ *
+ * + * @param Type of the elements. Each element in a {@link SetContainer} container is also identified + * by this value (each value is itself also the element's key). + * + * @author Jeongho Nam + */ + abstract class MultiSet extends SetContainer { + /** + * Insert an element. + * + * Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of elements inserted. + * + * @param key Value to be inserted as an element. + * + * @return An iterator to the newly inserted element. + */ + insert(val: T): SetIterator; + /** + * @inheritdoc + */ + insert(hint: SetIterator, val: T): SetIterator; + /** + * @inheritdoc + */ + insert(hint: SetReverseIterator, val: T): SetReverseIterator; + /** + * @inheritdoc + */ + insert>(begin: InputIterator, end: InputIterator): void; + /** + * @inheritdoc + */ + merge(source: SetContainer): void; + } +} +declare namespace std.base { + /** + * @hidden + */ + enum _Color { + BLACK = 0, + RED = 1, + } +} +declare namespace std.base { + /** + * @hidden + */ + abstract class _XTree { + protected root_: _XTreeNode; + protected constructor(); + clear(): void; + find(val: T): _XTreeNode; + protected _Fetch_maximum(node: _XTreeNode): _XTreeNode; + abstract is_less(left: T, right: T): boolean; + abstract is_equal_to(left: T, right: T): boolean; + insert(val: T): void; + private _Insert_case1(N); + private _Insert_case2(N); + private _Insert_case3(N); + private _Insert_case4(node); + private _Insert_case5(node); + erase(val: T): void; + private _Erase_case1(N); + private _Erase_case2(N); + private _Erase_case3(N); + private _Erase_case4(N); + private _Erase_case5(N); + private _Erase_case6(node); + protected _Rotate_left(node: _XTreeNode): void; + protected _Rotate_right(node: _XTreeNode): void; + protected _Replace_node(oldNode: _XTreeNode, newNode: _XTreeNode): void; + private _Fetch_color(node); + } +} +declare namespace std.base { + /** + * @hidden + */ + class _MapTree extends _XTree> { + private map_; + private compare_; + constructor(map: ITreeMap, compare?: (x: Key, y: Key) => boolean); + find(key: Key): _XTreeNode>; + find(it: MapIterator): _XTreeNode>; + private _Find_by_key(key); + lower_bound(key: Key): MapIterator; + upper_bound(key: Key): MapIterator; + equal_range(key: Key): Pair, MapIterator>; + key_comp(): (x: Key, y: Key) => boolean; + value_comp(): (x: Pair, y: Pair) => boolean; + is_equal_to(left: MapIterator, right: MapIterator): boolean; + is_less(left: MapIterator, right: MapIterator): boolean; + } +} +declare namespace std.base { + /** + * @hidden + */ + class _SetTree extends _XTree> { + private set_; + private compare_; + /** + * Default Constructor. + */ + constructor(set: ITreeSet, compare?: (x: T, y: T) => boolean); + find(val: T): _XTreeNode>; + find(it: SetIterator): _XTreeNode>; + private _Find_by_val(val); + lower_bound(val: T): SetIterator; + upper_bound(val: T): SetIterator; + equal_range(val: T): Pair, SetIterator>; + key_comp(): (x: T, y: T) => boolean; + value_comp(): (x: T, y: T) => boolean; + is_equal_to(left: SetIterator, right: SetIterator): boolean; + is_less(left: SetIterator, right: SetIterator): boolean; + } +} +declare namespace std.base { + /** + * @hidden + */ + class _XTreeNode { + parent: _XTreeNode; + left: _XTreeNode; + right: _XTreeNode; + value: T; + color: _Color; + constructor(value: T, color: _Color); + readonly grandParent: _XTreeNode; + readonly sibling: _XTreeNode; + readonly uncle: _XTreeNode; + } +} +declare namespace std.base { + /** + * An abstract unique-map. + * + * {@link UniqueMap UniqueMaps} are associative containers that store elements formed by a combination of a + * key value (Key) and a mapped value (T), and which allows for fast retrieval of + * individual elements based on their keys. + * + * In a {@link MapContainer}, the key values are generally used to uniquely identify the elements, + * while the mapped values store the content associated to this key. The types of key and + * mapped value may differ, and are grouped together in member type value_type, which is a + * {@link Pair} type combining both: + * + * typedef pair value_type; + * + * {@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}. + * + * + * + * + * ### Container properties + *
+ *
Associative
+ *
+ * Elements in associative containers are referenced by their key and not by their absolute position + * in the container. + *
+ * + *
Map
+ *
+ * Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value. + *
+ * + *
Unique keys
+ *
No two elements in the container can have equivalent keys.
+ *
+ * + * @param Type of the keys. Each element in a map is uniquely identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @author Jeongho Nam + */ + abstract class UniqueMap extends MapContainer { + /** + * @inheritdoc + */ + count(key: Key): number; + /** + * Get an element + * + * Returns a reference to the mapped value of the element identified with key. + * + * @param key Key value of the element whose mapped value is accessed. + * + * @throw exception out of range + * + * @return A reference object of the mapped value (_Ty) + */ + get(key: Key): T; + /** + * Set an item as the specified identifier. + * + * If the identifier is already in map, change value of the identifier. If not, then insert the object + * with the identifier. + * + * @param key Key value of the element whose mapped value is accessed. + * @param val Value, the item. + */ + set(key: Key, val: T): void; + /** + * Construct and insert element. + * + * Inserts a new element in the {@link UniqueMap} if its *key* is unique. This new element is constructed in + * place using args as the arguments for the construction of a *value_type* (which is an object of a + * {@link Pair} type). + * + * The insertion only takes place if no other element in the container has a *key equivalent* to the one + * being emplaced (*keys* in a {@link UniqueMap} container are unique). + * + * If inserted, this effectively increases the container {@link size} by one. + * + * A similar member function exists, {@link insert}, which either copies or moves existing objects into the + * container. + * + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return If the function successfully inserts the element (because no equivalent element existed already in + * the {@link UniqueMap}), the function returns a {@link Pair} of an {@link MapIterator iterator} to + * the newly inserted element and a value of true. Otherwise, it returns an + * {@link MapIterator iterator} to the equivalent element within the container and a value of false. + */ + emplace(key: Key, value: T): Pair, boolean>; + /** + * Construct and insert element. + * + * Inserts a new element in the {@link UniqueMap} if its *key* is unique. This new element is constructed in + * place using args as the arguments for the construction of a *value_type* (which is an object of a + * {@link Pair} type). + * + * The insertion only takes place if no other element in the container has a *key equivalent* to the one + * being emplaced (*keys* in a {@link UniqueMap} container are unique). + * + * If inserted, this effectively increases the container {@link size} by one. + * + * A similar member function exists, {@link insert}, which either copies or moves existing objects into the + * container. + * + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return If the function successfully inserts the element (because no equivalent element existed already in + * the {@link UniqueMap}), the function returns a {@link Pair} of an {@link MapIterator iterator} to + * the newly inserted element and a value of true. Otherwise, it returns an + * {@link MapIterator iterator} to the equivalent element within the container and a value of false. + */ + emplace(pair: Pair): Pair, boolean>; + /** + * Insert an element. + * + * Extends the container by inserting new elements, effectively increasing the container {@link size} by + * one. + * + * Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is not inserted, returning an iterator to this existing element (if the function + * returns a value). + * + * For a similar container allowing for duplicate elements, see {@link MultiMap}. + * + * @param pair A single argument of a {@link Pair} type with a value for the *key* as + * {@link Pair.first first} member, and a *value* for the mapped value as + * {@link Pair.second second}. + * + * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly + * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The + * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or + * false if an equivalent key already existed. + */ + insert(pair: Pair): Pair, boolean>; + /** + * Insert an element. + * + * Extends the container by inserting a new element, effectively increasing the container size by the + * number of elements inserted. + * + * Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is not inserted, returning an iterator to this existing element (if the function + * returns a value). + * + * For a similar container allowing for duplicate elements, see {@link MultiMap}. + * + * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. + * + * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly + * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The + * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or + * false if an equivalent key already existed. + */ + insert(tuple: [L, U]): Pair, boolean>; + /** + * @inheritdoc + */ + insert(hint: MapIterator, pair: Pair): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; + /** + * @inheritdoc + */ + insert(hint: MapIterator, tuple: [L, U]): MapIterator; + /** + * @inheritdoc + */ + insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; + /** + * @inheritdoc + */ + insert>>(first: InputIterator, last: InputIterator): void; + /** + * Insert or assign an element. + * + * Inserts an element or assigns to the current element if the key already exists. + * + * Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is assigned, returning an iterator to this existing element (if the function returns a + * value). + * + * For a similar container allowing for duplicate elements, see {@link MultiMap}. + * + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly + * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The + * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or + * false if an equivalent key already existed so the value is assigned. + */ + insert_or_assign(key: Key, value: T): Pair, boolean>; + /** + * Insert or assign an element. + * + * Inserts an element or assigns to the current element if the key already exists. + * + * Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is assigned, returning an iterator to this existing element (if the function returns a + * value). + * + * For a similar container allowing for duplicate elements, see {@link MultiMap}. + * + * @param hint Hint for the position where the element can be inserted. + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link UniqueMap}. + */ + insert_or_assign(hint: MapIterator, key: Key, value: T): MapIterator; + /** + * Insert or assign an element. + * + * Inserts an element or assigns to the current element if the key already exists. + * + * Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether + * each inserted element has a key equivalent to the one of an element already in the container, and + * if so, the element is assigned, returning an iterator to this existing element (if the function returns a + * value). + * + * For a similar container allowing for duplicate elements, see {@link MultiMap}. + * + * @param hint Hint for the position where the element can be inserted. + * @param key The key used both to look up and to insert if not found. + * @param value Value, the item. + * + * @return An iterator pointing to either the newly inserted element or to the element that already had an + * equivalent key in the {@link UniqueMap}. + */ + insert_or_assign(hint: MapReverseIterator, key: Key, value: T): MapReverseIterator; + /** + * @hidden + */ + private _Insert_or_assign_with_key_value(key, value); + /** + * @hidden + */ + private _Insert_or_assign_with_hint(hint, key, value); + /** + * Extract an element. + * + * Extracts the element pointed to by key and erases it from the {@link UniqueMap}. + * + * @param key Key value of the element whose mapped value is accessed. + * + * @return A {@link Pair} containing the value pointed to by key. + */ + extract(key: Key): Pair; + /** + * Extract an element. + * + * Extracts the element pointed to by key and erases it from the {@link UniqueMap}. + * + * @param it An iterator pointing an element to extract. + * + * @return An iterator pointing to the element immediately following it prior to the element being + * erased. If no such element exists,returns {@link end end()}. + */ + extract(it: MapIterator): MapIterator; + /** + * Extract an element. + * + * Extracts the element pointed to by key and erases it from the {@link UniqueMap}. + * + * @param it An iterator pointing an element to extract. + * + * @return An iterator pointing to the element immediately following it prior to the element being + * erased. If no such element exists,returns {@link end end()}. + */ + extract(it: MapReverseIterator): MapReverseIterator; + /** + * @hidden + */ + private _Extract_by_key(key); + /** + * @hidden + */ + private _Extract_by_iterator(it); + /** + * @hidden + */ + private _Extract_by_reverse_iterator(it); + /** + * Merge two maps. + * + * Attempts to extract each element in *source* and insert it into this container. If there's an element in this + * container with key equivalent to the key of an element from *source*, tnen that element is not extracted from + * the *source*. Otherwise, no element with same key exists in this container, then that element will be + * transfered from the *source* to this container. + * + * @param source A {@link MapContainer map container} to transfer the elements from. + */ + merge(source: MapContainer): void; + } +} +declare namespace std.base { + /** + * An abstract set. + * + * {@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of + * individual elements based on their value. + * + * In an {@link SetContainer}, the value of an element is at the same time its key, used to uniquely + * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be modified + * once in the container - they can be inserted and removed, though. + * + * {@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a + * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index + * table like {@link RBTree tree} or {@link HashBuckets hash-table}. + * + * + * + * + * ### Container properties + *
+ *
Associative
+ *
+ * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
+ * + *
Set
+ *
The value of an element is also the key used to identify it.
+ * + *
Unique keys
+ *
No two elements in the container can have equivalent keys.
+ *
+ * + * @param Type of the elements. Each element in a {@link SetContainer} container is also identified + * by this value (each value is itself also the element's key). + * + * @author Jeongho Nam + */ + abstract class UniqueSet extends SetContainer { + /** + * @inheritdoc + */ + count(key: T): number; + /** + * Insert an element. + * + * Extends the container by inserting new elements, effectively increasing the container {@link size} by + * the number of element inserted (zero or one). + * + * Because elements in a {@link UniqueSet UniqueSets} are unique, the insertion operation checks whether + * each inserted element is equivalent to an element already in the container, and if so, the element is not + * inserted, returning an iterator to this existing element (if the function returns a value). + * + * For a similar container allowing for duplicate elements, see {@link MultiSet}. + * + * @param key Value to be inserted as an element. + * + * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly + * inserted element or to the equivalent element already in the {@link UniqueSet}. The + * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or + * false if an equivalent element already existed. + */ + insert(val: T): Pair, boolean>; + /** + * @inheritdoc + */ + insert(hint: SetIterator, val: T): SetIterator; + /** + * @inheritdoc + */ + insert(hint: SetReverseIterator, val: T): SetReverseIterator; + /** + * @inheritdoc + */ + insert>(begin: InputIterator, end: InputIterator): void; + /** + * Extract an element. + * + * Extracts the element pointed to by val and erases it from the {@link UniqueSet}. + * + * @param val Value to be extracted. + * + * @return A value. + */ + extract(val: T): T; + /** + * Extract an element. + * + * Extracts the element pointed to by key and erases it from the {@link UniqueMap}. + * + * @param it An iterator pointing an element to extract. + * + * @return An iterator pointing to the element immediately following it prior to the element being + * erased. If no such element exists,returns {@link end end()}. + */ + extract(it: SetIterator): SetIterator; + /** + * Extract an element. + * + * Extracts the element pointed to by key and erases it from the {@link UniqueMap}. + * + * @param it An iterator pointing an element to extract. + * + * @return An iterator pointing to the element immediately following it prior to the element being + * erased. If no such element exists,returns {@link end end()}. + */ + extract(it: SetReverseIterator): SetReverseIterator; + /** + * @hidden + */ + private _Extract_by_key(val); + /** + * @hidden + */ + private _Extract_by_iterator(it); + /** + * @hidden + */ + private _Extract_by_reverse_iterator(it); + /** + * Merge two sets. + * + * Attempts to extract each element in *source* and insert it into this container. If there's an element in this + * container with key equivalent to the key of an element from *source*, tnen that element is not extracted from + * the *source*. Otherwise, no element with same key exists in this container, then that element will be + * transfered from the *source* to this container. + * + * @param source A {@link SetContainer set container} to transfer the elements from. + */ + merge(source: SetContainer): void; + } +} +declare namespace std.Deque { + type iterator = DequeIterator; + type reverse_iterator = DequeReverseIterator; +} +declare namespace std { + /** + * Double ended queue. + * + * {@link Deque} (usually pronounced like "deck") is an irregular acronym of + * double-ended queue. Double-ended queues are sequence containers with dynamic sizes that can be + * expanded or contracted on both ends (either its front or its back). + * + * Specific libraries may implement deques in different ways, generally as some form of dynamic array. But in any + * case, they allow for the individual elements to be accessed directly through random access iterators, with storage + * handled automatically by expanding and contracting the container as needed. + * + * Therefore, they provide a functionality similar to vectors, but with efficient insertion and deletion of + * elements also at the beginning of the sequence, and not only at its end. But, unlike {@link Vector Vectors}, + * {@link Deque Deques} are not guaranteed to store all its elements in contiguous storage locations: accessing + * elements in a deque by offsetting a pointer to another element causes undefined behavior. + * + * Both {@link Vector}s and {@link Deque}s provide a very similar interface and can be used for similar purposes, + * but internally both work in quite different ways: While {@link Vector}s use a single array that needs to be + * occasionally reallocated for growth, the elements of a {@link Deque} can be scattered in different chunks of + * storage, with the container keeping the necessary information internally to provide direct access to any of its + * elements in constant time and with a uniform sequential interface (through iterators). Therefore, + * {@link Deque Deques} are a little more complex internally than {@link Vector}s, but this allows them to grow more + * efficiently under certain circumstances, especially with very long sequences, where reallocations become more + * expensive. + * + * For operations that involve frequent insertion or removals of elements at positions other than the beginning or + * the end, {@link Deque Deques} perform worse and have less consistent iterators and references than + * {@link List Lists}. + * + * + * + * + * + * ### Container properties + *
+ *
Sequence
+ *
Elements in sequence containers are ordered in a strict linear sequence. Individual elements + * are accessed by their position in this sequence.
+ * + *
Dynamic array
+ *
Generally implemented as a dynamic array, it allows direct access to any element in the + * sequence and provides relatively fast addition/removal of elements at the beginning or the end + * of the sequence.
+ *
+ * + * @param Type of the elements. + * + * @reference http://www.cplusplus.com/reference/deque/deque/ + * @author Jeongho Nam + */ + class Deque extends base.Container implements base.IArrayContainer, base.IDequeContainer { + /** + * @hidden + */ + private matrix_; + /** + * @hidden + */ + private size_; + /** + * @hidden + */ + private capacity_; + /** + * @hidden + */ + private begin_; + /** + * @hidden + */ + private end_; + /** + * @hidden + */ + private rend_; + /** + * Default Constructor. + * + * Constructs an empty container, with no elements. + */ + constructor(); + /** + * Initializer list Constructor. + * + * Constructs a container with a copy of each of the elements in array, in the same order. + * + * @param array An array containing elements to be copied and contained. + */ + constructor(items: Array); + /** + * Fill Constructor. + * + * Constructs a container with n elements. Each element is a copy of val (if provided). + * + * @param n Initial container size (i.e., the number of elements in the container at construction). + * @param val Value to fill the container with. Each of the n elements in the container is + * initialized to a copy of this value. + */ + constructor(size: number, val: T); + /** + * Copy Constructor. + * + * Constructs a container with a copy of each of the elements in container, in the same order. + * + * @param container Another container object of the same type (with the same class template + * arguments T), whose contents are either copied or acquired. + */ + constructor(container: Deque); + /** + * Range Constructor. + * + * Constructs a container with as many elements as the range (begin, end), with each + * element emplace-constructed from its corresponding element in that range, in the same order. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @inheritdoc + */ + assign>(begin: InputIterator, end: InputIterator): void; + /** + * @inheritdoc + */ + assign(n: number, val: T): void; + /** + * Request a change in capacity. + * + * Requests that the {@link Deque container} {@link capacity} be at least enough to contain + * n elements. + * + * If n is greater than the current {@link Deque container} {@link capacity}, the + * function causes the {@link Deque container} to reallocate its storage increasing its + * {@link capacity} to n (or greater). + * + * In all other cases, the function call does not cause a reallocation and the + * {@link Deque container} {@link capacity} is not affected. + * + * This function has no effect on the {@link Deque container} {@link size} and cannot alter + * its elements. + * + * @param n Minimum {@link capacity} for the {@link Deque container}. + * Note that the resulting {@link capacity} may be equal or greater than n. + */ + reserve(capacity: number): void; + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + size(): number; + /** + * @inheritdoc + */ + empty(): boolean; + /** + * Return size of allocated storage capacity. + * + * Returns the size of the storage space currently allocated for the {@link Deque container}, + * expressed in terms of elements. + * + * This {@link capacity} is not necessarily equal to the {@link Deque container} {@link size}. + * It can be equal or greater, with the extra space allowing to accommodate for growth without the + * need to reallocate on each insertion. + * + * Notice that this {@link capacity} does not suppose a limit on the {@link size} of the + * {@link Deque container}. When this {@link capacity} is exhausted and more is needed, it is + * automatically expanded by the {@link Deque container} (reallocating it storage space). + * The theoretical limit on the {@link size} of a {@link Deque container} is given by member + * {@link max_size}. + * + * The {@link capacity} of a {@link Deque container} can be explicitly altered by calling member + * {@link Deque.reserve}. + * + * @return The size of the currently allocated storage capacity in the {@link Deque container}, + * measured in terms of the number elements it can hold. + */ + capacity(): number; + /** + * @inheritdoc + */ + front(): T; + /** + * @inheritdoc + */ + back(): T; + /** + * @inheritdoc + */ + begin(): DequeIterator; + /** + * @inheritdoc + */ + end(): DequeIterator; + /** + * @inheritdoc + */ + rbegin(): DequeReverseIterator; + /** + * @inheritdoc + */ + rend(): DequeReverseIterator; + /** + * @inheritdoc + */ + at(index: number): T; + /** + * @inheritdoc + */ + set(index: number, val: T): void; + /** + * @hidden + */ + private _Fetch_index(index); + /** + * @hidden + */ + private _Compute_col_size(capacity?); + /** + * @inheritdoc + */ + push(...items: T[]): number; + /** + * @inheritdoc + */ + push_front(val: T): void; + /** + * @inheritdoc + */ + push_back(val: T): void; + /** + * @inheritdoc + */ + pop_front(): void; + /** + * @inheritdoc + */ + pop_back(): void; + /** + * @inheritdoc + */ + insert(position: DequeIterator, val: T): DequeIterator; + /** + * @inheritdoc + */ + insert(position: DequeIterator, n: number, val: T): DequeIterator; + /** + * @inheritdoc + */ + insert>(position: DequeIterator, begin: InputIterator, end: InputIterator): DequeIterator; + /** + * @inheritdoc + */ + insert(position: DequeReverseIterator, val: T): DequeReverseIterator; + /** + * @inheritdoc + */ + insert(position: DequeReverseIterator, n: number, val: T): DequeReverseIterator; + /** + * @inheritdoc + */ + insert>(position: DequeReverseIterator, begin: InputIterator, end: InputIterator): DequeReverseIterator; + /** + * @hidden + */ + private _Insert_by_val(position, val); + /** + * @hidden + */ + private _Insert_by_repeating_val(position, n, val); + /** + * @hidden + */ + protected _Insert_by_range>(pos: DequeIterator, first: InputIterator, last: InputIterator): DequeIterator; + /** + * @hidden + */ + private _Insert_to_middle(pos, first, last); + /** + * @hidden + */ + private _Insert_to_end(first, last); + /** + * @hidden + */ + private _Try_expand_capacity(size); + /** + * @hidden + */ + private _Try_add_row_at_front(); + /** + * @hidden + */ + private _Try_add_row_at_back(); + /** + * @inheritdoc + */ + erase(position: DequeIterator): DequeIterator; + /** + * @inheritdoc + */ + erase(first: DequeIterator, last: DequeIterator): DequeIterator; + /** + * @inheritdoc + */ + erase(position: DequeReverseIterator): DequeReverseIterator; + /** + * @inheritdoc + */ + erase(first: DequeReverseIterator, last: DequeReverseIterator): DequeReverseIterator; + /** + * @hidden + */ + protected _Erase_by_range(first: DequeIterator, last: DequeIterator): DequeIterator; + /** + * Swap content. + * + * Exchanges the content of the container by the content of obj, which is another + * {@link Deque container} object with same type of elements. Sizes and container type may differ. + * + * After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects. + * + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. + * + * @param obj Another {@link Deque container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link Deque container}. + */ + swap(obj: Deque): void; + /** + * @inheritdoc + */ + swap(obj: base.Container): void; + /** + * @hidden + */ + private static readonly ROW_SIZE; + /** + * @hidden + */ + private static readonly MIN_CAPACITY; + /** + * @hidden + */ + private static readonly MAGNIFIER; + } +} +declare namespace std { + /** + * An iterator of {@link Deque}. + * + * + * + * + * @author Jeongho Nam + */ + class DequeIterator extends Iterator implements base.IArrayIterator { + /** + * @hidden + */ + private index_; + /** + * Construct from the source {@link Deque container}. + * + * #### Note + * Do not create the iterator directly, by yourself. + * + * Use {@link Deque.begin begin()}, {@link Deque.end end()} in {@link Deque container} instead. + * + * @param source The source {@link Deque container} to reference. + * @param index Sequence number of the element in the source {@link Deque}. + */ + constructor(source: Deque, index: number); + /** + * @inheritdoc + */ + source(): Deque; + /** + * @inheritdoc + */ + index(): number; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + /** + * @inheritdoc + */ + prev(): DequeIterator; + /** + * @inheritdoc + */ + next(): DequeIterator; + /** + * @inheritdoc + */ + advance(n: number): DequeIterator; + /** + * @inheritdoc + */ + equals(obj: DequeIterator): boolean; + /** + * @inheritdoc + */ + swap(obj: DequeIterator): void; + } +} +declare namespace std { + /** + * A reverse-iterator of Deque. + * + * + * + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class DequeReverseIterator extends ReverseIterator, DequeIterator, DequeReverseIterator> implements base.IArrayIterator { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: DequeIterator); + /** + * @hidden + */ + protected _Create_neighbor(base: DequeIterator): DequeReverseIterator; + /** + * @inheritdoc + */ + index(): number; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + } +} +declare namespace std { + /** + * Function handling termination on exception + * + * Calls the current terminate handler. + * + * By default, the terminate handler calls abort. But this behavior can be redefined by calling + * {@link set_terminate}. + * + * This function is automatically called when no catch handler can be found for a thrown exception, + * or for some other exceptional circumstance that makes impossible to continue the exception handling process. + * + * This function is provided so that the terminate handler can be explicitly called by a program that needs to + * abnormally terminate, and works even if {@link set_terminate} has not been used to set a custom terminate handler + * (calling abort in this case). + */ + function terminate(): void; + /** + * Set terminate handler function. + * + * A terminate handler function is a function automatically called when the exception handling process has + * to be abandoned for some reason. This happens when no catch handler can be found for a thrown exception, or for + * some other exceptional circumstance that makes impossible to continue the exception handling process. + * + * Before this function is called by the program for the first time, the default behavior is to call abort. + * + * A program may explicitly call the current terminate handler function by calling {@link terminate}. + * + * @param f Function that takes no parameters and returns no value (void). + */ + function set_terminate(f: () => void): void; + /** + * Get terminate handler function. + * + * The terminate handler function is automatically called when no catch handler can be found + * for a thrown exception, or for some other exceptional circumstance that makes impossible to continue the exception + * handling process. + * + * If no such function has been set by a previous call to {@link set_terminate}, the function returns a + * null-pointer. + * + * @return If {@link set_terminate} has previously been called by the program, the function returns the current + * terminate handler function. Otherwise, it returns a null-pointer. + */ + function get_terminate(): () => void; + /** + * Standard exception class. + * + * Base class for standard exceptions. + * + * All objects thrown by components of the standard library are derived from this class. + * Therefore, all standard exceptions can be caught by catching this type by reference. + * + * + * + * + * @reference http://www.cplusplus.com/reference/exception/exception + * @author Jeongho Nam + */ + class Exception { + /** + * @hidden + */ + private message_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from a message. + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + /** + * Get string identifying exception. + * + * Returns a string that may be used to identify the exception. + * + * The particular representation pointed by the returned value is implementation-defined. + * As a virtual function, derived classes may redefine this function so that specify value are + * returned. + */ + what(): string; + } + /** + * Logic error exception. + * + * This class defines the type of objects thrown as exceptions to report errors in the internal + * logical of the program, such as violation of logical preconditions or class invariants. + * + * These errors are presumably detectable before the program executes. + * + * It is used as a base class for several logical error exceptions. + * + * + * + * + * @reference http://www.cplusplus.com/reference/stdexcept/logic_error + * @author Jeongho Nam + */ + class LogicError extends Exception { + /** + * Construct from a message. + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + * Domain error exception. + * + * This class defines the type of objects thrown as exceptions to report domain errors. + * + * Generally, the domain of a mathematical function is the subset of values that it is defined for. + * For example, the square root function is only defined for non-negative numbers. Thus, a negative number + * for such a function would qualify as a domain error. + * + * No component of the standard library throws exceptions of this type. It is designed as a standard + * exception to be thrown by programs. + * + * + *

+ * + * @reference http://www.cplusplus.com/reference/stdexcept/domain_error + * @author Jeongho Nam + */ + class DomainError extends LogicError { + /** + * Construct from a message. + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + * Invalid argument exception. + * + * This class defines the type of objects thrown as exceptions to report an invalid argument. + * + * It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal invalid arguments. + * + * + * + * + * @reference http://www.cplusplus.com/reference/stdexcept/invalid_argument + * @author Jeongho Nam + */ + class InvalidArgument extends LogicError { + /** + * Construct from a message. + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + * Length error exception. + * + * This class defines the type of objects thrown as exceptions to report a length error. + * + * It is a standard exception that can be thrown by programs. Some components of the standard library, + * such as vector and string also throw exceptions of this type to signal errors resizing. + * + * + * + * + * @reference http://www.cplusplus.com/reference/stdexcept/length_error + * @author Jeongho Nam + */ + class LengthError extends LogicError { + /** + * Construct from a message. + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + * Out-of-range exception. + * + * This class defines the type of objects thrown as exceptions to report an out-of-range error. + * + * It is a standard exception that can be thrown by programs. Some components of the standard library, + * such as vector, deque, string and bitset also throw exceptions of this type to signal arguments + * out of range. + * + * + * + * + * @reference http://www.cplusplus.com/reference/stdexcept/out_of_range + * @author Jeongho Nam + */ + class OutOfRange extends LogicError { + /** + * Construct from a message. + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + * Runtime error exception. + * + * This class defines the type of objects thrown as exceptions to report errors that can only be + * detected during runtime. + * + * It is used as a base class for several runtime error exceptions. + * + * + * + * + * @reference http://www.cplusplus.com/reference/stdexcept/runtime_error + * @author Jeongho Nam + */ + class RuntimeError extends Exception { + /** + * Construct from a message. + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + * Overflow error exception. + * + * This class defines the type of objects thrown as exceptions to arithmetic overflow errors. + * + * It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal range errors. + * + * + * + * + * @reference http://www.cplusplus.com/reference/stdexcept/overflow_error + * @author Jeongho Nam + */ + class OverflowError extends RuntimeError { + /** + * Construct from a message. + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + * Underflow error exception. + * + * This class defines the type of objects thrown as exceptions to arithmetic underflow errors. + * + * No component of the standard library throws exceptions of this type. It is designed as a standard + * exception to be thrown by programs. + * + * + * + * + * @reference http://www.cplusplus.com/reference/stdexcept/underflow_error + * @author Jeongho Nam + */ + class UnderflowError extends RuntimeError { + /** + * Construct from a message. + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } + /** + * Range error exception. + * + * This class defines the type of objects thrown as exceptions to report range errors in internal + * computations. + * + * It is a standard exception that can be thrown by programs. Some components of the standard library + * also throw exceptions of this type to signal range errors. + * + * + * + * + * @reference http://www.cplusplus.com/reference/stdexcept/range_error + * @author Jeongho Nam + */ + class RangeError extends RuntimeError { + /** + * Construct from a message. + * + * @param message A message representing specification about the Exception. + */ + constructor(message: string); + } +} +declare namespace std { + /** + * Function object class for equality comparison. + * + * Binary function object class whose call returns whether its two arguments compare equal (as returned by + * operator ==). + * + * Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} + * defined. This member function allows the object to be used with the same syntax as a function call. + * + * @param x First element to compare. + * @param y Second element to compare. + * + * @return Whether the arguments are equal. + */ + function equal_to(x: T, y: T): boolean; + /** + * Function object class for non-equality comparison. + * + * Binary function object class whose call returns whether its two arguments compare not equal (as returned + * by operator operator!=). + * + * Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} + * defined. This member function allows the object to be used with the same syntax as a function call. + * + * @param x First element to compare. + * @param y Second element to compare. + * + * @return Whether the arguments are not equal. + */ + function not_equal_to(x: T, y: T): boolean; + /** + * Function for less-than inequality comparison. + * + * Binary function returns whether the its first argument compares less than the second. + * + * Generically, function objects are instances of a class with member function {@link IComparable.less less} + * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. + * This member function allows the object to be used with the same syntax as a function call. + * + * Objects of this class can be used on standard algorithms such as {@link sort sort()}, + * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}. + * + * @param Type of arguments to compare by the function call. The type shall supporrt the operation + * operator<() or method {@link IComparable.less less}. + * + * @param x First element, the standard of comparison. + * @param y Second element compare with the first. + * + * @return Whether the first parameter is less than the second. + */ + function less(x: T, y: T): boolean; + /** + * Function object class for less-than-or-equal-to comparison. + * + * Binary function object class whose call returns whether the its first argument compares {@link less less than} or + * {@link equal_to equal to} the second (as returned by operator <=). + * + * Generically, function objects are instances of a class with member function {@link IComparable.less less} + * and {@link IComparable.equal_to equal_to} defined. This member function allows the object to be used with the same + * syntax as a function call. + * + * @param x First element, the standard of comparison. + * @param y Second element compare with the first. + * + * @return Whether the x is {@link less less than} or {@link equal_to equal to} the y. + */ + function less_equal(x: T, y: T): boolean; + /** + * Function for greater-than inequality comparison. + * + * Binary function returns whether the its first argument compares greater than the second. + * + * Generically, function objects are instances of a class with member function {@link less} and + * {@link equal_to equal_to()} defined. If an object doesn't have those methods, then its own uid will be used + * to compare insteadly. This member function allows the object to be used with the same syntax as a function + * call. + * + * Objects of this class can be used on standard algorithms such as {@link sort sort()}, + * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}. + * + * @param Type of arguments to compare by the function call. The type shall supporrt the operation + * operator>() or method {@link IComparable.greater greater}. + * + * @return Whether the x is greater than the y. + */ + function greater(x: T, y: T): boolean; + /** + * Function object class for greater-than-or-equal-to comparison. + * + * Binary function object class whose call returns whether the its first argument compares + * {@link greater greater than} or {@link equal_to equal to} the second (as returned by operator >=). + * + * Generically, function objects are instances of a class with member function {@link IComparable.less less} + * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. + * This member function allows the object to be used with the same syntax as a function call. + * + * @param x First element, the standard of comparison. + * @param y Second element compare with the first. + * + * @return Whether the x is {@link greater greater than} or {@link equal_to equal to} the y. + */ + function greater_equal(x: T, y: T): boolean; + /** + * Logical AND function object class. + * + * Binary function object class whose call returns the result of the logical "and" operation between its two + * arguments (as returned by operator &&). + * + * Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call. + * + * @param x First element. + * @param y Second element. + * + * @return Result of logical AND operation. + */ + function logical_and(x: T, y: T): boolean; + /** + * Logical OR function object class. + * + * Binary function object class whose call returns the result of the logical "or" operation between its two + * arguments (as returned by operator ||). + * + * Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call. + * + * @param x First element. + * @param y Second element. + * + * @return Result of logical OR operation. + */ + function logical_or(x: T, y: T): boolean; + /** + * Logical NOT function object class. + * + * Unary function object class whose call returns the result of the logical "not" operation on its argument + * (as returned by operator !). + * + * Generically, function objects are instances of a class with member function operator() defined. This member + * function allows the object to be used with the same syntax as a function call. + * + * @param x Target element. + * + * @return Result of logical NOT operation. + */ + function logical_not(x: T): boolean; + /** + * Bitwise AND function object class. + * + * Binary function object class whose call returns the result of applying the bitwise "and" operation between + * its two arguments (as returned by operator &). + * + * @param x First element. + * @param y Second element. + * + * @return Result of bitwise AND operation. + */ + function bit_and(x: number, y: number): number; + /** + * Bitwise OR function object class. + * + * Binary function object class whose call returns the result of applying the bitwise "and" operation between + * its two arguments (as returned by operator &). + * + * @param x First element. + * @param y Second element. + * + * @return Result of bitwise OR operation. + */ + function bit_or(x: number, y: number): number; + /** + * Bitwise XOR function object class. + * + * Binary function object class whose call returns the result of applying the bitwise "exclusive or" + * operation between its two arguments (as returned by operator ^). + * + * @param x First element. + * @param y Second element. + * + * @return Result of bitwise XOR operation. + */ + function bit_xor(x: number, y: number): number; + /** + * Default hash function for number. + * + * Unary function that defines the default hash function used by the standard library. + * + * The functional call returns a hash value of its argument: A hash value is a value that depends solely on + * its argument, returning always the same value for the same argument (for a given execution of a program). The + * value returned shall have a small likelihood of being the same as the one returned for a different argument. + * + * + * @param val Value to be hashed. + * + * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. + */ + function hash(val: number): number; + /** + * Default hash function for string. + * + * Unary function that defines the default hash function used by the standard library. + * + * The functional call returns a hash value of its argument: A hash value is a value that depends solely on + * its argument, returning always the same value for the same argument (for a given execution of a program). The + * value returned shall have a small likelihood of being the same as the one returned for a different argument. + * + * @param str A string to be hashed. + * + * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. + */ + function hash(str: string): number; + /** + * Default hash function for Object. + * + * Unary function that defines the default hash function used by the standard library. + * + * The functional call returns a hash value of its argument: A hash value is a value that depends solely on + * its argument, returning always the same value for the same argument (for a given execution of a program). The + * value returned shall have a small likelihood of being the same as the one returned for a different argument. + * + * + * The default {@link hash} function of Object returns a value returned from {@link hash hash(number)} with + * an unique id of each Object. If you want to specify {@link hash} function of a specific class, then + * define a member function public hashCode(): number in the class. + * + * @param obj Object to be hashed. + * + * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. + */ + function hash(obj: Object): number; + /** + * Exchange contents of {@link IContainers containers}. + * + * The contents of container left are exchanged with those of right. Both container objects must have + * same type of elements (same template parameters), although sizes may differ. + * + * After the call to this member function, the elements in left are those which were in right before + * the call, and the elements of right are those which were in left. All iterators, references and + * pointers remain valid for the swapped objects. + * + * This is an overload of the generic algorithm swap that improves its performance by mutually transferring + * ownership over their assets to the other container (i.e., the containers exchange references to their data, without + * actually performing any element copy or movement): It behaves as if left. + * {@link Container.swap swap}(right) was called. + * + * @param left A {@link Container container} to swap its contents. + * @param right A {@link Container container} to swap its contents. + */ + function swap(left: base.Container, right: base.Container): void; + /** + * Exchange contents of queues. + * + * Exchanges the contents of left and right. + * + * @param left A {@link Queue} container of the same type. Size may differ. + * @param right A {@link Queue} container of the same type. Size may differ. + */ + function swap(left: Queue, right: Queue): void; + /** + * Exchange contents of {@link PriorityQueue PriorityQueues}. + * + * Exchanges the contents of left and right. + * + * @param left A {@link PriorityQueue} container of the same type. Size may differ. + * @param right A {@link PriorityQueue} container of the same type. Size may differ. + */ + function swap(left: PriorityQueue, right: PriorityQueue): void; + /** + * Exchange contents of {@link Stack Stacks}. + * + * Exchanges the contents of left and right. + * + * @param left A {@link Stack} container of the same type. Size may differ. + * @param right A {@link Stack} container of the same type. Size may differ. + */ + function swap(left: Stack, right: Stack): void; + /** + * Exchanges the contents of two {@link UniqueMap unique maps}. + * + * The contents of container left are exchanged with those of right. Both container objects must + * be of the same type (same template parameters), although sizes may differ. + * + * After the call to this member function, the elements in left are those which were in right + * before the call, and the elements of right are those which were in left. All iterators, references + * and pointers remain valid for the swapped objects. + * + * This is an overload of the generic algorithm swap that improves its performance by mutually transferring + * ownership over their assets to the other container (i.e., the containers exchange references to their data, + * without actually performing any element copy or movement): It behaves as if + * left.{@link UniqueMap.swap swap}(right) was called. + * + * @param left An {@link UniqueMap unique map} to swap its conents. + * @param right An {@link UniqueMap unique map} to swap its conents. + */ + function swap(left: base.UniqueMap, right: base.UniqueMap): void; + /** + * Exchanges the contents of two {@link MultiMap multi maps}. + * + * The contents of container left are exchanged with those of right. Both container objects must + * be of the same type (same template parameters), although sizes may differ. + * + * After the call to this member function, the elements in left are those which were in right + * before the call, and the elements of right are those which were in left. All iterators, references + * and pointers remain valid for the swapped objects. + * + * This is an overload of the generic algorithm swap that improves its performance by mutually transferring + * ownership over their assets to the other container (i.e., the containers exchange references to their data, + * without actually performing any element copy or movement): It behaves as if + * left.{@link MultiMap.swap swap}(right) was called. + * + * @param left A {@link MultiMap multi map} to swap its conents. + * @param right A {@link MultiMap multi map} to swap its conents. + */ + function swap(left: base.MultiMap, right: base.MultiMap): void; +} +declare namespace std { + /** + * Bind function arguments. + * + * Returns a function object based on fn, but with its arguments bound to args. + * + * Each argument may either be bound to a value or be a {@link placeholders placeholder}: + *
    + *
  • If bound to a value, calling the returned function object will always use that value as argument.
  • + *
  • + * If a {@link placeholders placeholder}, calling the returned function object forwards an argument passed to the + * call (the one whose order number is specified by the placeholder). + *
  • + *
+ * + * Calling the returned object returns the same type as fn. + * + * @param fn A function object, pointer to function or pointer to member. + * @param args List of arguments to bind: either values, or {@link placeholders}. + * + * @return A function object that, when called, calls fn with its arguments bound to args. If fn is + * a pointer to member, the first argument expected by the returned function is an object of the class fn + * is a member. + */ + function bind(fn: (...args: any[]) => Ret, ...args: any[]): (...args: any[]) => Ret; + /** + * Bind function arguments. + * + * Returns a function object based on fn, but with its arguments bound to args. + * + * Each argument may either be bound to a value or be a {@link placeholders placeholder}: + *
    + *
  • If bound to a value, calling the returned function object will always use that value as argument.
  • + *
  • + * If a {@link placeholders placeholder}, calling the returned function object forwards an argument passed to the + * call (the one whose order number is specified by the placeholder). + *
  • + *
+ * + * Calling the returned object returns the same type as fn. + * + * @param fn A function object, pointer to function or pointer to member. + * @param thisArg This argument, owner object of the member method fn. + * @param args List of arguments to bind: either values, or {@link placeholders}. + * + * @return A function object that, when called, calls fn with its arguments bound to args. If fn is + * a pointer to member, the first argument expected by the returned function is an object of the class fn + * is a member. + */ + function bind(fn: (...args: any[]) => Ret, thisArg: T, ...args: any[]): (...args: any[]) => Ret; +} +/** + * Bind argument placeholders. + * + * This namespace declares an unspecified number of objects: _1, _2, _3, ...
, which are + * used to specify placeholders in calls to function {@link bind}. + * + * When the function object returned by bind is called, an argument with placeholder {@link _1} is replaced by the + * first argument in the call, {@link _2} is replaced by the second argument in the call, and so on... For example: + * + * + * let vec: Vector = new Vector(); + * + * let bind = bind(Vector.insert, _1, vec.end(), _2, _3); + * bind.apply(vec, 5, 1); // vec.insert(vec.end(), 5, 1); + * // [1, 1, 1, 1, 1] + * + * + * When a call to {@link bind} is used as a subexpression in another call to bind, the {@link placeholders} + * are relative to the outermost {@link bind} expression. + * + * @reference http://www.cplusplus.com/reference/functional/placeholders/ + * @author Jeongho Nam + */ +declare namespace std.placeholders { + /** + * @hidden + */ + class PlaceHolder { + private index_; + constructor(index: number); + index(): number; + } + /** + * Replaced by the first argument in the function call. + */ + const _1: PlaceHolder; + /** + * Replaced by the second argument in the function call. + */ + const _2: PlaceHolder; + /** + * Replaced by the third argument in the function call. + */ + const _3: PlaceHolder; + const _4: PlaceHolder; + const _5: PlaceHolder; + const _6: PlaceHolder; + const _7: PlaceHolder; + const _8: PlaceHolder; + const _9: PlaceHolder; + const _10: PlaceHolder; + const _11: PlaceHolder; + const _12: PlaceHolder; + const _13: PlaceHolder; + const _14: PlaceHolder; + const _15: PlaceHolder; + const _16: PlaceHolder; + const _17: PlaceHolder; + const _18: PlaceHolder; + const _19: PlaceHolder; + const _20: PlaceHolder; +} +declare namespace std.HashMap { + type iterator = MapIterator; + type reverse_iterator = MapReverseIterator; +} +declare namespace std { + /** + * Hashed, unordered map. + * + * {@link HashMap}s are associative containers that store elements formed by the combination of a key value + * and a mapped value, and which allows for fast retrieval of individual elements based on their keys. + * + * In an {@link HashMap}, the key value is generally used to uniquely identify the element, while the + * mapped value is an object with the content associated to this key. Types of key and + * mapped value may differ. + * + * Internally, the elements in the {@link HashMap} are not sorted in any particular order with respect to either + * their key or mapped values, but organized into buckets depending on their hash values to allow + * for fast access to individual elements directly by their key values (with a constant average time complexity + * on average). + * + * {@link HashMap} containers are faster than {@link TreeMap} containers to access individual elements by their + * key, although they are generally less efficient for range iteration through a subset of their elements. + * + * + * + * + * ### Container properties + *
+ *
Associative
+ *
Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
+ * + *
Hashed
+ *
Hashed containers organize their elements using hash tables that allow for fast access to elements + * by their key.
+ * + *
Map
+ *
Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value.
+ * + *
Unique keys
+ *
No two elements in the container can have equivalent keys.
+ *
+ * + * @param Type of the key values. + * Each element in an {@link HashMap} is uniquely identified by its key value. + * @param Type of the mapped value. + * Each element in an {@link HashMap} is used to store some data as its mapped value. + * + * @reference http://www.cplusplus.com/reference/unordered_map/unordered_map + * @author Jeongho Nam + */ + class HashMap extends base.UniqueMap implements base.IHashMap { + /** + * @hidden + */ + private hash_buckets_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from elements. + */ + constructor(items: Pair[]); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + */ + constructor(array: [Key, T][]); + /** + * Copy Constructor. + */ + constructor(container: HashMap); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator>, end: Iterator>); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: Key): MapIterator; + /** + * @inheritdoc + */ + begin(): MapIterator; + /** + * @inheritdoc + */ + begin(index: number): MapIterator; + /** + * @inheritdoc + */ + end(): MapIterator; + /** + * @inheritdoc + */ + end(index: number): MapIterator; + /** + * @inheritdoc + */ + rbegin(): MapReverseIterator; + /** + * @inheritdoc + */ + rbegin(index: number): MapReverseIterator; + /** + * @inheritdoc + */ + rend(): MapReverseIterator; + /** + * @inheritdoc + */ + rend(index: number): MapReverseIterator; + /** + * @inheritdoc + */ + bucket_count(): number; + /** + * @inheritdoc + */ + bucket_size(index: number): number; + /** + * @inheritdoc + */ + max_load_factor(): number; + /** + * @inheritdoc + */ + max_load_factor(z: number): void; + /** + * @inheritdoc + */ + bucket(key: Key): number; + /** + * @inheritdoc + */ + reserve(n: number): void; + /** + * @inheritdoc + */ + rehash(n: number): void; + /** + * @hidden + */ + protected _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + * @hidden + */ + protected _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + * Swap content. + * + * Exchanges the content of the container by the content of obj, which is another + * {@link HashMap map} of the same type. Sizes abd container type may differ. + * + * After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects. + * + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. + * + * @param obj Another {@link HashMap map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashMap container}. + */ + swap(obj: HashMap): void; + /** + * @inheritdoc + */ + swap(obj: base.Container>): void; + } +} +declare namespace std.HashMultiMap { + type iterator = MapIterator; + type reverse_iterator = MapReverseIterator; +} +declare namespace std { + /** + * Hashed, unordered Multimap. + * + * {@link HashMultiMap}s are associative containers that store elements formed by the combination of + * a key value and a mapped value, much like {@link HashMultiMap} containers, but allowing + * different elements to have equivalent keys. + * + * In an {@link HashMultiMap}, the key value is generally used to uniquely identify the + * element, while the mapped value is an object with the content associated to this key. + * Types of key and mapped value may differ. + * + * Internally, the elements in the {@link HashMultiMap} are not sorted in any particular order with + * respect to either their key or mapped values, but organized into buckets depending on + * their hash values to allow for fast access to individual elements directly by their key values + * (with a constant average time complexity on average). + * + * Elements with equivalent keys are grouped together in the same bucket and in such a way that + * an iterator can iterate through all of them. Iterators in the container are doubly linked iterators. + * + * + * + * + * ### Container properties + *
+ *
Associative
+ *
Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
+ * + *
Hashed
+ *
Hashed containers organize their elements using hash tables that allow for fast access to elements + * by their key.
+ * + *
Map
+ *
Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value.
+ * + *
Multiple equivalent keys
+ *
The container can hold multiple elements with equivalent keys.
+ *
+ * + * @param Type of the key values. + * Each element in an {@link HashMultiMap} is identified by a key value. + * @param Type of the mapped value. + * Each element in an {@link HashMultiMap} is used to store some data as its mapped value. + * + * @reference http://www.cplusplus.com/reference/unordered_map/unordered_multimap + * @author Jeongho Nam + */ + class HashMultiMap extends base.MultiMap { + /** + * @hidden + */ + private hash_buckets_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from elements. + */ + constructor(items: Pair[]); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + */ + constructor(array: [Key, T][]); + /** + * Copy Constructor. + */ + constructor(container: HashMultiMap); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator>, end: Iterator>); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: Key): MapIterator; + /** + * @inheritdoc + */ + count(key: Key): number; + /** + * @inheritdoc + */ + begin(): MapIterator; + /** + * @inheritdoc + */ + begin(index: number): MapIterator; + /** + * @inheritdoc + */ + end(): MapIterator; + /** + * @inheritdoc + */ + end(index: number): MapIterator; + /** + * @inheritdoc + */ + rbegin(): MapReverseIterator; + /** + * @inheritdoc + */ + rbegin(index: number): MapReverseIterator; + /** + * @inheritdoc + */ + rend(): MapReverseIterator; + /** + * @inheritdoc + */ + rend(index: number): MapReverseIterator; + /** + * @inheritdoc + */ + bucket_count(): number; + /** + * @inheritdoc + */ + bucket_size(n: number): number; + /** + * @inheritdoc + */ + max_load_factor(): number; + /** + * @inheritdoc + */ + max_load_factor(z: number): void; + /** + * @inheritdoc + */ + bucket(key: Key): number; + /** + * @inheritdoc + */ + reserve(n: number): void; + /** + * @inheritdoc + */ + rehash(n: number): void; + /** + * @hidden + */ + protected _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + * @hidden + */ + protected _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + * Swap content. + * + * Exchanges the content of the container by the content of obj, which is another + * {@link HashMultiMap map} of the same type. Sizes abd container type may differ. + * + * After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects. + * + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. + * + * @param obj Another {@link HashMultiMap map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashMultiMap container}. + */ + swap(obj: HashMultiMap): void; + /** + * @inheritdoc + */ + swap(obj: base.Container>): void; + } +} +declare namespace std.HashMultiSet { + type iterator = SetIterator; + type reverse_iterator = SetReverseIterator; +} +declare namespace std { + /** + * Hashed, unordered Multiset. + * + * {@link HashMultiSet HashMultiSets} are containers that store elements in no particular order, allowing fast + * retrieval of individual elements based on their value, much like {@link HashMultiSet} containers, + * but allowing different elements to have equivalent values. + * + * In an {@link HashMultiSet}, the value of an element is at the same time its key, used to + * identify it. Keys are immutable, therefore, the elements in an {@link HashMultiSet} cannot be + * modified once in the container - they can be inserted and removed, though. + * + * Internally, the elements in the {@link HashMultiSet} are not sorted in any particular, but + * organized into buckets depending on their hash values to allow for fast access to individual + * elements directly by their values (with a constant average time complexity on average). + * + * Elements with equivalent values are grouped together in the same bucket and in such a way that an + * iterator can iterate through all of them. Iterators in the container are doubly linked iterators. + * + * + * + * + * ### Container properties + *
+ *
Associative
+ *
Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
+ * + *
Hashed
+ *
Hashed containers organize their elements using hash tables that allow for fast access to elements + * by their key.
+ * + *
Set
+ *
The value of an element is also the key used to identify it.
+ * + *
Multiple equivalent keys
+ *
The container can hold multiple elements with equivalent keys.
+ *
+ * + * @param Type of the elements. + * Each element in an {@link UnorderedMultiSet} is also identified by this value.. + * + * @reference http://www.cplusplus.com/reference/unordered_set/unordered_multiset + * @author Jeongho Nam + */ + class HashMultiSet extends base.MultiSet { + /** + * @hidden + */ + private hash_buckets_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from elements. + */ + constructor(items: T[]); + /** + * Copy Constructor. + */ + constructor(container: HashMultiSet); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: T): SetIterator; + /** + * @inheritdoc + */ + count(key: T): number; + /** + * @inheritdoc + */ + begin(): SetIterator; + /** + * @inheritdoc + */ + begin(index: number): SetIterator; + /** + * @inheritdoc + */ + end(): SetIterator; + /** + * @inheritdoc + */ + end(index: number): SetIterator; + /** + * @inheritdoc + */ + rbegin(): SetReverseIterator; + /** + * @inheritdoc + */ + rbegin(index: number): SetReverseIterator; + /** + * @inheritdoc + */ + rend(): SetReverseIterator; + /** + * @inheritdoc + */ + rend(index: number): SetReverseIterator; + /** + * @inheritdoc + */ + bucket_count(): number; + /** + * @inheritdoc + */ + bucket_size(n: number): number; + /** + * @inheritdoc + */ + max_load_factor(): number; + /** + * @inheritdoc + */ + max_load_factor(z: number): void; + /** + * @inheritdoc + */ + bucket(key: T): number; + /** + * @inheritdoc + */ + reserve(n: number): void; + /** + * @inheritdoc + */ + rehash(n: number): void; + /** + * @hidden + */ + protected _Insert_by_val(val: T): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; + /** + * @hidden + */ + protected _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + * Swap content. + * + * Exchanges the content of the container by the content of obj, which is another + * {@link HashMultiSet set} of the same type. Sizes abd container type may differ. + * + * After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects. + * + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. + * + * @param obj Another {@link HashMultiSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashMultiSet container}. + */ + swap(obj: HashMultiSet): void; + /** + * @inheritdoc + */ + swap(obj: base.Container): void; + } +} +declare namespace std.HashSet { + type iterator = SetIterator; + type reverse_iterator = SetReverseIterator; +} +declare namespace std { + /** + * Hashed, unordered set. + * + * {@link HashSet}s are containers that store unique elements in no particular order, and which + * allow for fast retrieval of individual elements based on their value. + * + * In an {@link HashSet}, the value of an element is at the same time its key, that + * identifies it uniquely. Keys are immutable, therefore, the elements in an {@link HashSet} cannot be + * modified once in the container - they can be inserted and removed, though. + * + * Internally, the elements in the {@link HashSet} are not sorted in any particular order, but + * organized into buckets depending on their hash values to allow for fast access to individual elements + * directly by their values (with a constant average time complexity on average). + * + * {@link HashSet} containers are faster than {@link TreeSet} containers to access individual + * elements by their key, although they are generally less efficient for range iteration through a + * subset of their elements. + * + * + * + * + * ### Container properties + *
+ *
Associative
+ *
Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
+ * + *
Hashed
+ *
Hashed containers organize their elements using hash tables that allow for fast access to elements + * by their key.
+ * + *
Set
+ *
The value of an element is also the key used to identify it.
+ * + *
Unique keys
+ *
No two elements in the container can have equivalent keys.
+ *
+ * + * @param Type of the elements. + * Each element in an {@link HashSet} is also uniquely identified by this value. + * + * @reference http://www.cplusplus.com/reference/unordered_set/unordered_set + * @author Jeongho Nam + */ + class HashSet extends base.UniqueSet implements base.IHashSet { + /** + * @hidden + */ + private hash_buckets_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from elements. + */ + constructor(items: T[]); + /** + * Copy Constructor. + */ + constructor(container: HashSet); + /** + * Construct from range iterators. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: T): SetIterator; + /** + * @inheritdoc + */ + begin(): SetIterator; + /** + * @inheritdoc + */ + begin(index: number): SetIterator; + /** + * @inheritdoc + */ + end(): SetIterator; + /** + * @inheritdoc + */ + end(index: number): SetIterator; + /** + * @inheritdoc + */ + rbegin(): SetReverseIterator; + /** + * @inheritdoc + */ + rbegin(index: number): SetReverseIterator; + /** + * @inheritdoc + */ + rend(): SetReverseIterator; + /** + * @inheritdoc + */ + rend(index: number): SetReverseIterator; + /** + * @inheritdoc + */ + bucket_count(): number; + /** + * @inheritdoc + */ + bucket_size(n: number): number; + /** + * @inheritdoc + */ + max_load_factor(): number; + /** + * @inheritdoc + */ + max_load_factor(z: number): void; + /** + * @inheritdoc + */ + bucket(key: T): number; + /** + * @inheritdoc + */ + reserve(n: number): void; + /** + * @inheritdoc + */ + rehash(n: number): void; + /** + * @hidden + */ + protected _Insert_by_val(val: T): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; + /** + * @hidden + */ + protected _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + * Swap content. + * + * Exchanges the content of the container by the content of obj, which is another + * {@link HashSet set} of the same type. Sizes abd container type may differ. + * + * After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects. + * + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. + * + * @param obj Another {@link HashSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link HashSet container}. + */ + swap(obj: HashSet): void; + /** + * @inheritdoc + */ + swap(obj: base.Container): void; + } +} +declare namespace std { + /** + * Comparable instance. + * + * {@link IComparable} is a common interface for objects who can compare each other. + * + * @reference https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html + * @author Jeongho Nam + */ + interface IComparable extends Object { + /** + * Indicates whether some other object is "equal to" this one. + * + * The {@link equal_to} method implements an equivalence relation on non-null object references: + * + *
    + *
  • + * It is reflexive: for any non-null reference value x, x.equal_to(x) + * should return true. + *
  • + *
  • + * It is symmetric: for any non-null reference values x and y, + * x.equal_to(y) should return true if and only if y.equal_to(x) + * returns true.
  • + *
  • + * It is transitive: for any non-null reference values x, y, and + * z, if x.equal_to(y) returns true and y.equal_to(z) + * returns true, then x.equal_to(z) should return true. + *
  • + *
  • + * It is consistent: for any non-null reference values x and y, multiple + * invocations of x.equal_to(y) consistently return true or consistently return + * false, provided no information used in equal_to comparisons on the objects is modified. + *
  • + *
  • + * For any non-null reference value x, x.equal_to(null) should return + * false. + *
  • + *
+ * + * The {@link equal_to} method for interface {@link IComparable} implements the most discriminating possible + * equivalence relation on objects; that is, for any non-null reference values x and + * y, this method returns true if and only if x and y + * refer to the same object (x == y has the value true). + * + * Note that it is generally necessary to override the {@link hash_code} method whenever this method is + * overridden, so as to maintain the general contract for the {@link hash_code} method, which states that + * equal objects must have equal hash codes. + * + * - {@link IComparable.equal_to} is called by {@link equal_to}. + * + * @param obj the reference object with which to compare. + * + * @return true if this object is the same as the obj argument; false otherwise. + */ + equals(obj: T): boolean; + /** + * Less-than inequality comparison. + * + * Binary method returns whether the the instance compares less than the obj. + * + *
    + *
  • + * {@link IComparable.less} is called by {@link less}. Also, this method can be used on standard + * algorithms such as {@link sort sort()}, {@link merge merge()} or + * {@link TreeMap.lower_bound lower_bound()}. + *
  • + *
+ * + * @param obj the reference object with which to compare. + * + * @return Whether the first parameter is less than the second. + */ + less(obj: T): boolean; + /** + * Issue a hash code. + * + * Returns a hash code value for the object. This method is supported for the benefit of hash tables such + * as those provided by hash containers; {@link HashSet}, {@link HashMap}, {@link MultiHashSet} and + * {@link MultiHashMap}. + * + * As much as is reasonably practical, the {@link hash_code} method defined by interface + * {@link IComparable} does return distinct integers for distinct objects. (This is typically implemented by + * converting the internal address of the object into an integer, but this implementation technique is not + * required by the JavaScript programming language.) + * + *
    + *
  • + * {@link IComparable.hash_code} is called by {@link hash_code}. If you want to keep basically + * provided hash function, then returns {@link Hash.code}; return Hash.code(this); + *
  • + *
+ * + * @return An hash code who represents the object. + */ + hashCode?(): number; + } +} +declare namespace std.List { + type iterator = ListIterator; + type reverse_iterator = ListReverseIterator; +} +declare namespace std { + /** + * Doubly linked list. + * + * {@link List}s are sequence containers that allow constant time insert and erase operations anywhere within the + * sequence, and iteration in both directions. + * + * List containers are implemented as doubly-linked lists; Doubly linked lists can store each of the elements they + * contain in different and unrelated storage locations. The ordering is kept internally by the association to each + * element of a link to the element preceding it and a link to the element following it. + * + * Compared to other base standard sequence containers (array, vector and deque), lists perform generally better + * in inserting, extracting and moving elements in any position within the container for which an iterator has already + * been obtained, and therefore also in algorithms that make intensive use of these, like sorting algorithms. + * + * The main drawback of lists and forward_lists compared to these other sequence containers is that they lack + * direct access to the elements by their position; For example, to access the sixth element in a list, one has to + * iterate from a known position (like the beginning or the end) to that position, which takes linear time in the + * distance between these. They also consume some extra memory to keep the linking information associated to each + * element (which may be an important factor for large lists of small-sized elements). + * + * + * + * + * + * ### Container properties + *
+ *
Sequence
+ *
Elements in sequence containers are ordered in a strict linear sequence. Individual elements are accessed by + * their position in this sequence.
+ * + *
Doubly-linked list
+ *
Each element keeps information on how to locate the next and the previous elements, allowing constant time + * insert and erase operations before or after a specific element (even of entire ranges), but no direct random + * access.
+ *
+ * + * @param Type of the elements. + * + * @reference http://www.cplusplus.com/reference/list/list/ + * @author Jeongho Nam + */ + class List extends base._ListContainer> { + private rend_; + /** + * Default Constructor. + * + * Constructs an empty container, with no elements. + */ + constructor(); + /** + * Initializer list Constructor. + * + * Constructs a container with a copy of each of the elements in array, in the same order. + * + * @param array An array containing elements to be copied and contained. + */ + constructor(items: Array); + /** + * Fill Constructor. + * + * Constructs a container with n elements. Each element is a copy of val (if provided). + * + * @param n Initial container size (i.e., the number of elements in the container at construction). + * @param val Value to fill the container with. Each of the n elements in the container is + * initialized to a copy of this value. + */ + constructor(size: number, val: T); + /** + * Copy Constructor. + * + * Constructs a container with a copy of each of the elements in container, in the same order. + * + * @param container Another container object of the same type (with the same class template + * arguments T), whose contents are either copied or acquired. + */ + constructor(container: List); + /** + * Range Constructor. + * + * Constructs a container with as many elements as the range (begin, end), with each + * element emplace-constructed from its corresponding element in that range, in the same order. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @hidden + */ + protected _Create_iterator(prev: ListIterator, next: ListIterator, val: T): ListIterator; + /** + * @hidden + */ + protected _Set_begin(it: ListIterator): void; + /** + * @inheritdoc + */ + assign(n: number, val: T): void; + /** + * @inheritdoc + */ + assign>(begin: InputIterator, end: InputIterator): void; + /** + * @inheritdoc + */ + rbegin(): ListReverseIterator; + /** + * @inheritdoc + */ + rend(): ListReverseIterator; + /** + * @inheritdoc + */ + front(): T; + /** + * @inheritdoc + */ + back(): T; + /** + * Insert an element. + * + * The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted. + * + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. + * + * @param position Position in the container where the new element is inserted. + * {@link iterator}> is a member type, defined as a + * {@link ListIterator bidirectional iterator} type that points to elements. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the newly inserted element; val. + */ + insert(position: ListIterator, val: T): ListIterator; + /** + * Insert elements by repeated filling. + * + * The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted. + * + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. + * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListIterator bidirectional iterator} type that points to + * elements. + * @param size Number of elements to insert. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: ListIterator, size: number, val: T): ListIterator; + /** + * Insert elements by range iterators. + * + * The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted. + * + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. + * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListIterator bidirectional iterator} type that points to + * elements. + * @param begin An iterator specifying range of the begining element. + * @param end An iterator specifying range of the ending element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: ListIterator, begin: InputIterator, end: InputIterator): ListIterator; + /** + * Insert an element. + * + * The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted. + * + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. + * + * @param position Position in the container where the new element is inserted. + * {@link iterator}> is a member type, defined as a + * {@link ListReverseIterator bidirectional iterator} type that points to elements. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the newly inserted element; val. + */ + insert(position: ListReverseIterator, val: T): ListReverseIterator; + /** + * Insert elements by repeated filling. + * + * The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted. + * + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. + * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListReverseIterator bidirectional iterator} type that points to + * elements. + * @param size Number of elements to insert. + * @param val Value to be inserted as an element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: ListReverseIterator, size: number, val: T): ListReverseIterator; + /** + * Insert elements by range iterators. + * + * The container is extended by inserting a new element before the element at the specified + * position. This effectively increases the {@link List.size List size} by the amount of elements + * inserted. + * + * Unlike other standard sequence containers, {@link List} is specifically designed to be efficient + * inserting and removing elements in any position, even in the middle of the sequence. + * + * @param position Position in the container where the new elements are inserted. The {@link iterator} is a + * member type, defined as a {@link ListReverseIterator bidirectional iterator} type that points to + * elements. + * @param begin An iterator specifying range of the begining element. + * @param end An iterator specifying range of the ending element. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: ListReverseIterator, begin: InputIterator, end: InputIterator): ListReverseIterator; + /** + * Erase an element. + * + * Removes from the {@link List} either a single element; position. + * + * This effectively reduces the container size by the number of element removed. + * + * Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence. + * + * @param position Iterator pointing to a single element to be removed from the {@link List}. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link end end()} if the operation erased the last element in the sequence. + */ + erase(position: ListIterator): ListIterator; + /** + * Erase elements. + * + * Removes from the {@link List} container a range of elements. + * + * This effectively reduces the container {@link size} by the number of elements removed. + * + * Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence. + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link end end()} if the operation erased the last element in the sequence. + */ + erase(begin: ListIterator, end: ListIterator): ListIterator; + /** + * Erase an element. + * + * Removes from the {@link List} either a single element; position. + * + * This effectively reduces the container size by the number of element removed. + * + * Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence. + * + * @param position Iterator pointing to a single element to be removed from the {@link List}. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link rend rend()} if the operation erased the last element in the sequence. + */ + erase(position: ListReverseIterator): ListReverseIterator; + /** + * Erase elements. + * + * Removes from the {@link List} container a range of elements. + * + * This effectively reduces the container {@link size} by the number of elements removed. + * + * Unlike other standard sequence containers, {@link List} objects are specifically designed to be + * efficient inserting and removing elements in any position, even in the middle of the sequence. + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the element that followed the last element erased by the function call. + * This is the {@link rend rend()} if the operation erased the last element in the sequence. + */ + erase(begin: ListReverseIterator, end: ListReverseIterator): ListReverseIterator; + /** + * Remove duplicate values. + * + * Removes all but the first element from every consecutive group of equal elements in the + * + * Notice that an element is only removed from the {@link List} container if it compares equal to the + * element immediately preceding it. Thus, this function is especially useful for sorted lists. + */ + unique(): void; + /** + * Remove duplicate values. + * + * Removes all but the first element from every consecutive group of equal elements in the + * + * The argument binary_pred is a specific comparison function that determine the uniqueness + * of an element. In fact, any behavior can be implemented (and not only an equality comparison), but notice + * that the function will call binary_pred(it.value, it.prev().value) for all pairs of elements + * (where it is an iterator to an element, starting from the second) and remove it + * from the {@link List} if the predicate returns true. + * + * Notice that an element is only removed from the {@link List} container if it compares equal to the + * element immediately preceding it. Thus, this function is especially useful for sorted lists. + * + * @param binary_pred Binary predicate that, taking two values of the same type than those contained in the + * {@link List}, returns true to remove the element passed as first argument + * from the container, and false otherwise. This shall be a function pointer + * or a function object. + */ + unique(binary_pred: (left: T, right: T) => boolean): void; + /** + * Remove elements with specific value. + * + * Removes from the container all the elements that compare equal to val. This calls the + * destructor of these objects and reduces the container {@link size} by the number of elements removed. + * + * Unlike member function {@link List.erase}, which erases elements by their position (using an + * iterator), this function ({@link List.remove}) removes elements by their value. + * + * A similar function, {@link List.remove_if}, exists, which allows for a condition other than an + * equality comparison to determine whether an element is removed. + * + * @param val Value of the elements to be removed. + */ + remove(val: T): void; + /** + * Remove elements fulfilling condition. + * + * Removes from the container all the elements for which pred returns true. This + * calls the destructor of these objects and reduces the container {@link size} by the number of elements + * removed. + * + * The function calls pred(it.value) for each element (where it is an iterator + * to that element). Any of the elements in the list for which this returns true, are removed + * from the + * + * @param pred Unary predicate that, taking a value of the same type as those contained in the forward_list + * object, returns true for those values to be removed from the container, and + * false for those remaining. This can either be a function pointer or a function + * object. + */ + remove_if(pred: (val: T) => boolean): void; + /** + * Merge sorted {@link List Lists}. + * + * Merges obj into the {@link List} by transferring all of its elements at their respective + * ordered positions into the container (both containers shall already be ordered). + * + * + * This effectively removes all the elements in obj (which becomes {@link empty}), and inserts + * them into their ordered position within container (which expands in {@link size} by the number of elements + * transferred). The operation is performed without constructing nor destroying any element: they are + * transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type supports + * move-construction or not. + * + * This function requires that the {@link List} containers have their elements already ordered by value + * ({@link less}) before the call. For an alternative on unordered {@link List Lists}, see + * {@link List.splice}. + * + * Assuming such ordering, each element of obj is inserted at the position that corresponds to its + * value according to the strict weak ordering defined by {@link less}. The resulting order of equivalent + * elements is stable (i.e., equivalent elements preserve the relative order they had before the call, and + * existing elements precede those equivalent inserted from obj). + * + * The function does nothing if this == obj. + * + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + * Note that this function modifies obj no matter whether an lvalue or rvalue reference is + * passed. + */ + merge(obj: List): void; + /** + * Merge sorted {@link List Lists}. + * + * Merges obj into the {@link List} by transferring all of its elements at their respective + * ordered positions into the container (both containers shall already be ordered). + * + * + * This effectively removes all the elements in obj (which becomes {@link empty}), and inserts + * them into their ordered position within container (which expands in {@link size} by the number of elements + * transferred). The operation is performed without constructing nor destroying any element: they are + * transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type supports + * move-construction or not. + * + * The argument compare is a specific predicate to perform the comparison operation between + * elements. This comparison shall produce a strict weak ordering of the elements (i.e., a consistent + * transitive comparison, without considering its reflexiveness). + * + * This function requires that the {@link List} containers have their elements already ordered by + * compare before the call. For an alternative on unordered {@link List Lists}, see + * {@link List.splice}. + * + * Assuming such ordering, each element of obj is inserted at the position that corresponds to its + * value according to the strict weak ordering defined by compare. The resulting order of equivalent + * elements is stable (i.e., equivalent elements preserve the relative order they had before the call, and + * existing elements precede those equivalent inserted from obj). + * + * The function does nothing if this == obj. + * + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + * Note that this function modifies obj no matter whether an lvalue or rvalue reference is + * passed. + * @param compare Binary predicate that, taking two values of the same type than those contained in the + * {@link list}, returns true if the first argument is considered to go before + * the second in the strict weak ordering it defines, and false otherwise. + * This shall be a function pointer or a function object. + */ + merge(obj: List, compare: (left: T, right: T) => boolean): void; + /** + * Transfer elements from {@link List} to {@link List}. + * + * Transfers elements from obj into the container, inserting them at position. + * + * This effectively inserts all elements into the container and removes them from obj, altering + * the sizes of both containers. The operation does not involve the construction or destruction of any + * element. They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the + * value_type supports move-construction or not. + * + * This first version (1) transfers all the elements of obj into the + * + * @param position Position within the container where the elements of obj are inserted. + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + */ + splice(position: ListIterator, obj: List): void; + /** + * Transfer an element from {@link List} to {@link List}. + * + * Transfers an element from obj, which is pointed by an {@link ListIterator iterator} it, + * into the container, inserting the element at specified position. + * + * This effectively inserts an element into the container and removes it from obj, altering the + * sizes of both containers. The operation does not involve the construction or destruction of any element. + * They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type + * supports move-construction or not. + * + * This second version (2) transfers only the element pointed by it from obj into the + * + * + * @param position Position within the container where the element of obj is inserted. + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + * This parameter may be this if position points to an element not actually + * being spliced. + * @param it {@link ListIterator Iterator} to an element in obj. Only this single element is + * transferred. + */ + splice(position: ListIterator, obj: List, it: ListIterator): void; + /** + * Transfer elements from {@link List} to {@link List}. + * + * Transfers elements from obj into the container, inserting them at position. + * + * This effectively inserts those elements into the container and removes them from obj, altering + * the sizes of both containers. The operation does not involve the construction or destruction of any + * element. They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the + * value_type supports move-construction or not. + * + * This third version (3) transfers the range [begin, end) from obj into the + * + * + * @param position Position within the container where the elements of obj are inserted. + * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). + * This parameter may be this if position points to an element not actually + * being spliced. + * @param begin {@link ListIterator An Iterator} specifying initial position of a range of elements in + * obj. Transfers the elements in the range [begin, end) to + * position. + * @param end {@link ListIterator An Iterator} specifying final position of a range of elements in + * obj. Transfers the elements in the range [begin, end) to + * position. Notice that the range includes all the elements between begin and + * end, including the element pointed by begin but not the one pointed by end. + */ + splice(position: ListIterator, obj: List, begin: ListIterator, end: ListIterator): void; + /** + * Sort elements in + * + * Sorts the elements in the {@link List}, altering their position within the + * + * The sorting is performed by applying an algorithm that uses {@link less}. This comparison shall + * produce a strict weak ordering of the elements (i.e., a consistent transitive comparison, without + * considering its reflexiveness). + * + * The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative + * order they had before the call. + * + * The entire operation does not involve the construction, destruction or copy of any element object. + * Elements are moved within the + */ + sort(): void; + /** + * Sort elements in + * + * Sorts the elements in the {@link List}, altering their position within the + * + * The sorting is performed by applying an algorithm that uses compare. This comparison shall + * produce a strict weak ordering of the elements (i.e., a consistent transitive comparison, without + * considering its reflexiveness). + * + * The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative + * order they had before the call. + * + * The entire operation does not involve the construction, destruction or copy of any element object. + * Elements are moved within the + * + * @param compare Binary predicate that, taking two values of the same type of those contained in the + * {@link List}, returns true if the first argument goes before the second + * argument in the strict weak ordering it defines, and false otherwise. This + * shall be a function pointer or a function object. + */ + sort(compare: (left: T, right: T) => boolean): void; + /** + * @hidden + */ + private _Quick_sort(first, last, compare); + /** + * @hidden + */ + private _Quick_sort_partition(first, last, compare); + /** + * Reverse the order of elements. + * + * Reverses the order of the elements in the list container. + */ + reverse(): void; + /** + * Swap content. + * + * Exchanges the content of the container by the content of obj, which is another + * {@link List container} object with same type of elements. Sizes and container type may differ. + * + * After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects. + * + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. + * + * @param obj Another {@link List container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link List container}. + */ + swap(obj: List): void; + /** + * @inheritdoc + */ + swap(obj: base.Container): void; + } +} +declare namespace std { + /** + * An iterator, node of a List. + * + * + * + * + * @author Jeongho Nam + */ + class ListIterator extends base._ListIteratorBase { + /** + * Initializer Constructor. + * + * #### Note + * Do not create the iterator directly, by yourself. + * + * Use {@link List.begin begin()}, {@link List.end end()} in {@link List container} instead. + * + * @param source The source {@link List container} to reference. + * @param prev A refenrece of previous node ({@link ListIterator iterator}). + * @param next A refenrece of next node ({@link ListIterator iterator}). + * @param value Value to be stored in the node (iterator). + */ + constructor(source: List, prev: ListIterator, next: ListIterator, value: T); + /** + * @inheritdoc + */ + source(): List; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + /** + * @inheritdoc + */ + prev(): ListIterator; + /** + * @inheritdoc + */ + next(): ListIterator; + /** + * @inheritdoc + */ + advance(step: number): ListIterator; + /** + * @inheritdoc + */ + equals(obj: ListIterator): boolean; + /** + * @inheritdoc + */ + swap(obj: ListIterator): void; + } +} +declare namespace std { + /** + * A reverse-iterator of List. + * + * + * + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class ListReverseIterator extends ReverseIterator, ListIterator, ListReverseIterator> implements base.ILinearIterator { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: ListIterator); + /** + * @hidden + */ + protected _Create_neighbor(base: ListIterator): ListReverseIterator; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + } +} +declare namespace std.Vector { + type iterator = VectorIterator; + type reverse_iterator = VectorReverseIterator; +} +declare namespace std { + /** + * Vector, the dynamic array. + * + * {@link Vector}s are sequence containers representing arrays that can change in size. + * + * Just like arrays, {@link Vector}s use contiguous storage locations for their elements, which means that + * their elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently + * as in arrays. But unlike arrays, their size can change dynamically, with their storage being handled + * automatically by the container. + * + * Internally, {@link Vector}s use a dynamically allocated array to store their elements. This array may need + * to be reallocated in order to grow in size when new elements are inserted, which implies allocating a new + * array and moving all elements to it. This is a relatively expensive task in terms of processing time, and + * thus, {@link Vector}s do not reallocate each time an element is added to the container. + * + * Compared to the other dynamic sequence containers ({@link Deque}s, {@link List}s), {@link Vector Vectors} + * are very efficient accessing its elements (just like arrays) and relatively efficient adding or removing + * elements from its end. For operations that involve inserting or removing elements at positions other than the + * end, they perform worse than the others, and have less consistent iterators and references than {@link List}s. + * + * + * + * + * + * ### Container properties + *
+ *
Sequence
+ *
+ * Elements in sequence containers are ordered in a strict linear sequence. Individual elements are + * accessed by their position in this sequence. + *
+ * + *
Dynamic array
+ *
+ * Allows direct access to any element in the sequence, even through pointer arithmetics, and provides + * relatively fast addition/removal of elements at the end of the sequence. + *
+ *
+ * + * @param Type of the elements. + * + * @reference http://www.cplusplus.com/reference/vector/vector + * @author Jeongho Nam + */ + class Vector extends base.Container implements base.IArrayContainer { + /** + * @hidden + */ + private data_; + /** + * @hidden + */ + private begin_; + /** + * @hidden + */ + private end_; + /** + * @hidden + */ + private rend_; + /** + * Default Constructor. + * + * Constructs an empty container, with no elements. + */ + constructor(); + /** + * @inheritdoc + */ + constructor(array: Array); + /** + * Initializer list Constructor. + * + * Constructs a container with a copy of each of the elements in array, in the same order. + * + * @param array An array containing elements to be copied and contained. + */ + constructor(n: number); + /** + * Fill Constructor. + * + * Constructs a container with n elements. Each element is a copy of val (if provided). + * + * @param n Initial container size (i.e., the number of elements in the container at construction). + * @param val Value to fill the container with. Each of the n elements in the container is + * initialized to a copy of this value. + */ + constructor(n: number, val: T); + /** + * Copy Constructor. + * + * Constructs a container with a copy of each of the elements in container, in the same order. + * + * @param container Another container object of the same type (with the same class template + * arguments T), whose contents are either copied or acquired. + */ + constructor(container: Vector); + /** + * Range Constructor. + * + * Constructs a container with as many elements as the range (begin, end), with each + * element emplace-constructed from its corresponding element in that range, in the same order. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * @inheritdoc + */ + assign>(begin: InputIterator, end: InputIterator): void; + /** + * @inheritdoc + */ + assign(n: number, val: T): void; + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + begin(): VectorIterator; + /** + * @inheritdoc + */ + end(): VectorIterator; + /** + * @inheritdoc + */ + rbegin(): VectorReverseIterator; + /** + * @inheritdoc + */ + rend(): VectorReverseIterator; + /** + * @inheritdoc + */ + size(): number; + /** + * @inheritdoc + */ + empty(): boolean; + /** + * @inheritdoc + */ + at(index: number): T; + /** + * @inheritdoc + */ + set(index: number, val: T): T; + /** + * @inheritdoc + */ + front(): T; + /** + * @inheritdoc + */ + back(): T; + /** + * Access data. + * + * Returns a direct array which is used internally by the {@link vector} to store its owned elements. + * + * @returns An array. + */ + data(): Array; + /** + * @inheritdoc + */ + push(...items: T[]): number; + /** + * @inheritdoc + */ + push_back(val: T): void; + /** + * Insert an element. + * + * The {@link Vector} is extended by inserting new element before the element at the specified + * position, effectively increasing the container size by one. + * + * Because {@link Vector}s use an Array as their underlying storage, inserting element in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to its new position. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Position in the {@link Vector} where the new element is inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param val Value to be copied to the inserted element. + * + * @return An iterator that points to the newly inserted element. + */ + insert(position: VectorIterator, val: T): VectorIterator; + /** + * Insert elements by repeated filling. + * + * The {@link Vector} is extended by inserting new elements before the element at the specified + * position, effectively increasing the container size by the number of elements inserted. + * + * Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to their new positions. This is generally an inefficient operation compared to the + * one performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Position in the {@link Vector} where the new elements are inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param n Number of elements to insert. Each element is initialized to a copy of val. + * @param val Value to be copied (or moved) to the inserted elements. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: VectorIterator, n: number, val: T): VectorIterator; + /** + * Insert elements by range iterators. + * + * The {@link Vector} is extended by inserting new elements before the element at the specified + * position, effectively increasing the container size by the number of elements inserted by range + * iterators. + * + * Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to their new positions. This is generally an inefficient operation compared to the + * one performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Position in the {@link Vector} where the new elements are inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: VectorIterator, begin: InputIterator, end: InputIterator): VectorIterator; + /** + * Insert an element. + * + * The {@link Vector} is extended by inserting new element before the element at the specified + * position, effectively increasing the container size by one. + * + * Because {@link Vector}s use an Array as their underlying storage, inserting element in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to its new position. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Position in the {@link Vector} where the new element is inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param val Value to be copied to the inserted element. + * + * @return An iterator that points to the newly inserted element. + */ + insert(position: VectorReverseIterator, val: T): VectorReverseIterator; + /** + * Insert elements by repeated filling. + * + * The {@link Vector} is extended by inserting new elements before the element at the specified + * position, effectively increasing the container size by the number of elements inserted. + * + * Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to their new positions. This is generally an inefficient operation compared to the + * one performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Position in the {@link Vector} where the new elements are inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param n Number of elements to insert. Each element is initialized to a copy of val. + * @param val Value to be copied (or moved) to the inserted elements. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert(position: VectorReverseIterator, n: number, val: T): VectorReverseIterator; + /** + * Insert elements by range iterators. + * + * The {@link Vector} is extended by inserting new elements before the element at the specified + * position, effectively increasing the container size by the number of elements inserted by range + * iterators. + * + * Because {@link Vector}s use an Array as their underlying storage, inserting elements in + * positions other than the {@link end end()} causes the container to relocate all the elements that were + * after position to their new positions. This is generally an inefficient operation compared to the + * one performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Position in the {@link Vector} where the new elements are inserted. + * {@link iterator} is a member type, defined as a + * {@link VectorIterator random access iterator} type that points to elements. + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * + * @return An iterator that points to the first of the newly inserted elements. + */ + insert>(position: VectorReverseIterator, begin: InputIterator, end: InputIterator): VectorReverseIterator; + /** + * @hidden + */ + private _Insert_by_val(position, val); + /** + * @hidden + */ + private _Insert_by_repeating_val(position, n, val); + /** + * @hidden + */ + protected _Insert_by_range>(position: VectorIterator, first: InputIterator, last: InputIterator): VectorIterator; + /** + * @inheritdoc + */ + pop_back(): void; + /** + * Erase element. + * + * Removes from the {@link Vector} either a single element; position. + * + * This effectively reduces the container size by the number of element removed. + * + * Because {@link Vector}s use an Array as their underlying storage, erasing an element in + * position other than the {@link end end()} causes the container to relocate all the elements after the + * segment erased to their new positions. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Iterator pointing to a single element to be removed from the {@link Vector}. + * + * @return An iterator pointing to the new location of the element that followed the last element erased by + * the function call. This is the {@link end end()} if the operation erased the last element in the + * sequence. + */ + erase(position: VectorIterator): VectorIterator; + /** + * Erase element. + * + * Removes from the Vector either a single element; position. + * + * This effectively reduces the container size by the number of elements removed. + * + * Because {@link Vector}s use an Array as their underlying storage, erasing elements in + * position other than the {@link end end()} causes the container to relocate all the elements after the + * segment erased to their new positions. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the new location of the element that followed the last element erased by + * the function call. This is the {@link rend rend()} if the operation erased the last element in the + * sequence. + */ + erase(first: VectorIterator, last: VectorIterator): VectorIterator; + /** + * Erase element. + * + * Removes from the {@link Vector} either a single element; position. + * + * This effectively reduces the container size by the number of element removed. + * + * Because {@link Vector}s use an Array as their underlying storage, erasing an element in + * position other than the {@link end end()} causes the container to relocate all the elements after the + * segment erased to their new positions. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param position Iterator pointing to a single element to be removed from the {@link Vector}. + * + * @return An iterator pointing to the new location of the element that followed the last element erased by + * the function call. This is the {@link rend rend()} if the operation erased the last element in the + * sequence. + */ + erase(position: VectorReverseIterator): VectorReverseIterator; + /** + * Erase element. + * + * Removes from the Vector either a single element; position. + * + * This effectively reduces the container size by the number of elements removed. + * + * Because {@link Vector}s use an Array as their underlying storage, erasing elements in + * position other than the {@link end end()} causes the container to relocate all the elements after the + * segment erased to their new positions. This is generally an inefficient operation compared to the one + * performed for the same operation by other kinds of sequence containers (such as {@link List}). + * + * @param begin An iterator specifying a range of beginning to erase. + * @param end An iterator specifying a range of end to erase. + * + * @return An iterator pointing to the new location of the element that followed the last element erased by + * the function call. This is the {@link end end()} if the operation erased the last element in the + * sequence. + */ + erase(first: VectorReverseIterator, last: VectorReverseIterator): VectorReverseIterator; + /** + * @hidden + */ + protected _Erase_by_range(first: VectorIterator, last: VectorIterator): VectorIterator; + /** + * Swap content. + * + * Exchanges the content of the container by the content of obj, which is another + * {@link Vector container} object with same type of elements. Sizes and container type may differ. + * + * After the call to this member function, the elements in this container are those which were in obj + * before the call, and the elements of obj are those which were in this. All iterators, references and + * pointers remain valid for the swapped objects. + * + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. + * + * @param obj Another {@link Vector container} of the same type of elements (i.e., instantiated + * with the same template parameter, T) whose content is swapped with that of this + * {@link Vector container}. + */ + swap(obj: Vector): void; + /** + * @inheritdoc + */ + swap(obj: base.Container): void; + } +} +declare namespace std { + /** + * An iterator of Vector. + * + * + * + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class VectorIterator extends Iterator implements base.IArrayIterator { + /** + * @hidden + */ + private index_; + /** + * Construct from the source {@link Vector container}. + * + * #### Note + * Do not create the iterator directly, by yourself. + * + * Use {@link Vector.begin begin()}, {@link Vector.end end()} in {@link Vector container} instead. + * + * @param source The source {@link Vector container} to reference. + * @param index Sequence number of the element in the source {@link Vector}. + */ + constructor(source: Vector, index: number); + /** + * @inheritdoc + */ + source(): Vector; + /** + * @inheritdoc + */ + index(): number; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + /** + * @inheritdoc + */ + prev(): VectorIterator; + /** + * @inheritdoc + */ + next(): VectorIterator; + /** + * @inheritdoc + */ + advance(n: number): VectorIterator; + /** + * @inheritdoc + */ + equals(obj: VectorIterator): boolean; + /** + * @inheritdoc + */ + swap(obj: VectorIterator): void; + } +} +declare namespace std { + /** + * A reverse-iterator of Vector. + * + * + * + * + * @param Type of the elements. + * + * @author Jeongho Nam + */ + class VectorReverseIterator extends ReverseIterator, VectorIterator, VectorReverseIterator> implements base.IArrayIterator { + /** + * Construct from base iterator. + * + * @param base A reference of the base iterator, which iterates in the opposite direction. + */ + constructor(base: VectorIterator); + /** + * @hidden + */ + protected _Create_neighbor(base: VectorIterator): VectorReverseIterator; + /** + * @inheritdoc + */ + index(): number; + /** + * @inheritdoc + */ + /** + * Set value of the iterator is pointing to. + * + * @param val Value to set. + */ + value: T; + } +} +declare namespace std { + /** + * FIFO queue. + * + * {@link Queue}s are a type of container adaptor, specifically designed to operate in a FIFO context + * (first-in first-out), where elements are inserted into one end of the container and extracted from the other. + * + * {@link Queue}s are implemented as containers adaptors, which are classes that use an encapsulated object of + * a specific container class as its underlying container, providing a specific set of member functions to access + * its elements. Elements are pushed into the {@link IDeque.back back()} of the specific container and popped from + * its {@link IDeque.front front()}. + * + * {@link container_ The underlying container} may be one of the standard container class template or some + * other specifically designed container class. This underlying container shall support at least the following + * operations: + * + * - {@link IDequeContainer.empty empty} + * - {@link IDequeContainer.size size} + * - {@link IDequeContainer.front front} + * - {@link IDequeContainer.back back} + * - {@link IDequeContainer.push_back push_back} + * - {@link IDequeContainer.pop_front pop_front} + * + * The standard container classes {@link Deque} and {@link List} fulfill these requirements. + * By default, if no container class is specified for a particular {@link Queue} class instantiation, the standard + * container {@link List} is used. + * + * + * + * + * @param Type of elements. + * + * @reference http://www.cplusplus.com/reference/queue/queue + * @author Jeongho Nam + */ + class Queue { + /** + * The underlying object for implementing the FIFO + */ + private container_; + /** + * Default Constructor. + */ + constructor(); + /** + * Copy Constructor. + */ + constructor(container: Queue); + /** + * Return size. + * + * Returns the number of elements in the {@link Queue}. + * + * This member function effectively calls member {@link IDeque.size size()} of the + * {@link container_ underlying container} object. + * + * @return The number of elements in the {@link container_ underlying container}. + */ + size(): number; + /** + * Test whether container is empty. + * + * returns whether the {@link Queue} is empty: i.e. whether its size is zero. + * + * This member function efeectively calls member {@link IDeque.empty empty()} of the + * {@link container_ underlying container} object. + * + * @return true if the {@link container_ underlying container}'s size is 0, + * false otherwise. + */ + empty(): boolean; + /** + * Access next element. + * + * Returns a value of the next element in the {@link Queue}. + * + * The next element is the "oldest" element in the {@link Queue} and the same element that is popped out + * from the queue when {@link pop Queue.pop()} is called. + * + * This member function effectively calls member {@link IDeque.front front()} of the + * {@link container_ underlying container} object. + * + * @return A value of the next element in the {@link Queue}. + */ + front(): T; + /** + * Access last element. + * + * Returns a vaue of the last element in the queue. This is the "newest" element in the queue (i.e. the + * last element pushed into the queue). + * + * This member function effectively calls the member function {@link IDeque.back back()} of the + * {@link container_ underlying container} object. + * + * @return A value of the last element in the {@link Queue}. + */ + back(): T; + /** + * Insert element. + * + * Inserts a new element at the end of the {@link Queue}, after its current last element. + * The content of this new element is initialized to val. + * + * This member function effectively calls the member function {@link IDeque.push_back push_back()} of the + * {@link container_ underlying container} object. + * + * @param val Value to which the inserted element is initialized. + */ + push(val: T): void; + /** + * Remove next element. + * + * Removes the next element in the {@link Queue}, effectively reducing its size by one. + * + * The element removed is the "oldest" element in the {@link Queue} whose value can be retrieved by calling + * member {@link front Queue.front()}. + * + * This member function effectively calls the member function {@link IDeque.pop_front pop_front()} of the + * {@link container_ underlying container} object. + */ + pop(): void; + /** + * Swap contents. + * + * Exchanges the contents of the container adaptor (this) by those of obj. + * + * This member function calls the non-member function {@link Container.swap swap} (unqualified) to swap + * the {@link container_ underlying containers}. + * + * @param obj Another {@link Queue} container adaptor of the same type (i.e., instantiated with the same + * template parameter, T). Sizes may differ. + */ + swap(obj: Queue): void; + } +} +declare namespace std { + /** + * Priority queue. + * + * {@link PriorityQueue Priority queues} are a type of container adaptors, specifically designed such that its + * first element is always the greatest of the elements it contains, according to some strict weak ordering + * criterion. + * + * This context is similar to a heap, where elements can be inserted at any moment, and only the + * max heap element can be retrieved (the one at the top in the {@link PriorityQueue priority queue}). + * + * {@link PriorityQueue Priority queues} are implemented as container adaptors, which are classes that + * use an encapsulated object of a specific container class as its {@link container_ underlying container}, + * providing a specific set of member functions to access its elements. Elements are popped from the "back" + * of the specific container, which is known as the top of the {@link PriorityQueue Priority queue}. + * + * The {@link container_ underlying container} may be any of the standard container class templates or some + * other specifically designed container class. The container shall be accessible through + * {@link IArrayIterator random access iterators} and support the following operations: + * + * - {@link IArrayContainer.empty empty()} + * - {@link IArrayContainer.size size()} + * - {@link IArrayContainer.front front()} + * - {@link IArrayContainer.push_back push_back()} + * - {@link IArrayContainer.pop_back pop_back()} + * + * The standard container classes {@link Vector} and {@link Deque} fulfill these requirements. By default, if + * no container class is specified for a particular {@link PriorityQueue} class instantiation, the standard + * container {@link Vector} is used. + * + * Support of {@link IArrayIterator random access iterators} is required to keep a heap structure internally + * at all times. This is done automatically by the container adaptor by automatically calling the algorithm + * functions make_heap, push_heap and pop_heap when needed. + * + * @param Type of the elements. + * + * @reference http://www.cplusplus.com/reference/queue/priority_queue/ + * @author Jeongho Nam + */ + class PriorityQueue { + /** + * @hidden + */ + private container_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (left: T, right: T) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array); + /** + * Contruct from elements with compare. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array, compare: (left: T, right: T) => boolean); + /** + * Copy Constructor. + */ + constructor(container: base.Container); + /** + * Copy Constructor with compare. + * + * @param container A container to be copied. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: base.Container, compare: (left: T, right: T) => boolean); + /** + * Range Constructor. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * Range Constructor with compare. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator, end: Iterator, compare: (left: T, right: T) => boolean); + /** + * Return size. + * + * Returns the number of elements in the {@link PriorityQueue}. + * + * This member function effectively calls member {@link IArrayContainer.size size} of the + * {@link IArrayContainer underlying container} object. + * + * @return The number of elements in the underlying + */ + size(): number; + /** + * Test whether container is empty. + * + * Returns whether the {@link PriorityQueue} is empty: i.e. whether its {@link size} is zero. + * + * This member function effectively calls member {@link IARray.empty empty} of the + * {@link IArrayContainer underlying container} object. + */ + empty(): boolean; + /** + * Access top element. + * + * Returns a constant reference to the top element in the {@link PriorityQueue}. + * + * The top element is the element that compares higher in the {@link PriorityQueue}, and the next that is + * removed from the container when {@link PriorityQueue.pop} is called. + * + * This member function effectively calls member {@link IArrayContainer.front front} of the + * {@link IArrayContainer underlying container} object. + * + * @return A reference to the top element in the {@link PriorityQueue}. + */ + top(): T; + /** + * Insert element. + * + * Inserts a new element in the {@link PriorityQueue}. The content of this new element is initialized to + * val. + * + * This member function effectively calls the member function {@link IArrayContainer.push_back push_back} of the + * {@link IArrayContainer underlying container} object, and then reorders it to its location in the heap by calling + * the push_heap algorithm on the range that includes all the elements of the + * + * @param val Value to which the inserted element is initialized. + */ + push(val: T): void; + /** + * Remove top element. + * + * Removes the element on top of the {@link PriorityQueue}, effectively reducing its {@link size} by one. + * The element removed is the one with the highest (or lowest) value. + * + * The value of this element can be retrieved before being popped by calling member + * {@link PriorityQueue.top}. + * + * This member function effectively calls the pop_heap algorithm to keep the heap property of + * {@link PriorityQueue PriorityQueues} and then calls the member function {@link IArrayContainer.pop_back pop_back} of + * the {@link IArrayContainer underlying container} object to remove the element. + */ + pop(): void; + /** + * Swap contents. + * + * Exchanges the contents of the container adaptor by those of obj, swapping both the + * {@link IArrayContainer underlying container} value and their comparison function using the corresponding + * {@link swap swap} non-member functions (unqualified). + * + * This member function has a noexcept specifier that matches the combined noexcept of the + * {@link IArrayContainer.swap swap} operations on the {@link IArrayContainer underlying container} and the comparison + * functions. + * + * @param obj {@link PriorityQueue} container adaptor of the same type (i.e., instantiated with the same + * template parameters, T). Sizes may differ. + */ + swap(obj: PriorityQueue): void; + } +} +declare namespace std { + /** + * LIFO stack. + * + * {@link Stack}s are a type of container adaptor, specifically designed to operate in a LIFO context + * (last-in first-out), where elements are inserted and extracted only from one end of the + * + * {@link Stack}s are implemented as containers adaptors, which are classes that use an encapsulated object of + * a specific container class as its underlying container, providing a specific set of member functions to + * access its elements. Elements are pushed/popped from the {@link ILinearContainer.back back()} of the + * {@link ILinearContainer specific container}, which is known as the top of the {@link Stack}. + * + * {@link container_ The underlying container} may be any of the standard container class templates or some + * other specifically designed container class. The container shall support the following operations: + * + * - {@link ILinearContainer.empty empty} + * - {@link ILinearContainer.size size} + * - {@link ILinearContainer.front front} + * - {@link ILinearContainer.back back} + * - {@link ILinearContainer.push_back push_back} + * - {@link ILinearContainer.pop_back pop_back} + * + * The standard container classes {@link Vector}, {@link Deque} and {@link List} fulfill these requirements. + * By default, if no container class is specified for a particular {@link Stack} class instantiation, the standard + * container {@link List} is used. + * + * + * + * + * @param Type of elements. + * + * @reference http://www.cplusplus.com/reference/stack/stack + * @author Jeongho Nam + */ + class Stack { + /** + * The underlying object for implementing the LIFO + */ + private container_; + /** + * Default Constructor. + */ + constructor(); + /** + * Copy Constructor. + */ + constructor(stack: Stack); + /** + * Return size. + * + * Returns the number of elements in the {@link Stack}. + * + * This member function effectively calls member {@link ILinearContainer.size size()} of the + * {@link container_ underlying container} object. + * + * @return The number of elements in the {@link container_ underlying container}. + */ + size(): number; + /** + * Test whether container is empty. + * + * returns whether the {@link Stack} is empty: i.e. whether its size is zero. + * + * This member function effectively calls member {@link ILinearContainer.empty empty()} of the + * {@link container_ underlying container} object. + * + * @return true if the underlying container's size is 0, + * false otherwise. + */ + empty(): boolean; + /** + * Access next element. + * + * Returns a value of the top element in the {@link Stack}. + * + * Since {@link Stack}s are last-in first-out containers, the top element is the last element inserted into + * the {@link Stack}. + * + * This member function effectively calls member {@link ILinearContainer.back back()} of the + * {@link container_ underlying container} object. + * + * @return A value of the top element in the {@link Stack}. + */ + top(): T; + /** + * Insert element. + * + * Inserts a new element at the top of the {@link Stack}, above its current top element. + * + * This member function effectively calls the member function + * {@link ILinearContainer.push_back push_back()} of the {@link container_ underlying container} object. + * + * @param val Value to which the inserted element is initialized. + */ + push(val: T): void; + /** + * Remove top element. + * + * Removes the element on top of the {@link Stack}, effectively reducing its size by one. + * + * The element removed is the latest element inserted into the {@link Stack}, whose value can be retrieved + * by calling member {@link top Stack.top()}. + * + * This member function effectively calls the member function {@link ILinearContainer.pop_back pop_back()} + * of the {@link container_ underlying container} object. + */ + pop(): void; + /** + * Swap contents. + * + * Exchanges the contents of the container adaptor (this) by those of obj. + * + * This member function calls the non-member function {@link Container.swap swap} (unqualified) to swap + * the {@link container_ underlying containers}. + * + * @param obj Another {@link Stack} container adaptor of the same type (i.e., instantiated with the same + * template parameter, T). Sizes may differ. + */ + swap(obj: Stack): void; + } +} +declare namespace std.TreeSet { + type iterator = SetIterator; + type reverse_iterator = SetReverseIterator; +} +declare namespace std { + /** + * Tree-structured set, std::set of STL. + * + * {@link TreeSet}s are containers that store unique elements following a specific order. + * + * In a {@link TreeSet}, the value of an element also identifies it (the value is itself the + * key, of type T), and each value must be unique. The value of the elements in a + * {@link TreeSet} cannot be modified once in the container (the elements are always const), but they + * can be inserted or removed from the container. + * + * Internally, the elements in a {@link TreeSet} are always sorted following a specific strict weak + * ordering criterion indicated by its internal comparison method (of {@link less}). + * + * {@link TreeSet} containers are generally slower than {@link HashSet} containers to access + * individual elements by their key, but they allow the direct iteration on subsets based on their + * order. + * + * {@link TreeSet}s are typically implemented as binary search trees. + * + * + *

+ * + * ### Container properties + *
+ *
Associative
+ *
+ * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
+ * + *
Ordered
+ *
+ * The elements in the container follow a strict order at all times. All inserted elements are + * given a position in this order. + *
+ * + *
Set
+ *
The value of an element is also the key used to identify it.
+ * + *
Unique keys
+ *
No two elements in the container can have equivalent keys.
+ *
+ * + * @param Type of the elements. + * Each element in an {@link TreeSet} is also uniquely identified by this value. + * + * @reference http://www.cplusplus.com/reference/set/set + * @author Jeongho Nam + */ + class TreeSet extends base.UniqueSet implements base.ITreeSet { + /** + * @hidden + */ + private tree_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (x: T, y: T) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array); + /** + * Contruct from elements with compare. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array, compare: (x: T, y: T) => boolean); + /** + * Copy Constructor. + */ + constructor(container: TreeMultiSet); + /** + * Copy Constructor with compare. + * + * @param container A container to be copied. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: TreeMultiSet, compare: (x: T, y: T) => boolean); + /** + * Range Constructor. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * Construct from range and compare. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator, end: Iterator, compare: (x: T, y: T) => boolean); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(val: T): SetIterator; + /** + * @inheritdoc + */ + key_comp(): (x: T, y: T) => boolean; + /** + * @inheritdoc + */ + value_comp(): (x: T, y: T) => boolean; + /** + * @inheritdoc + */ + lower_bound(val: T): SetIterator; + /** + * @inheritdoc + */ + upper_bound(val: T): SetIterator; + /** + * @inheritdoc + */ + equal_range(val: T): Pair, SetIterator>; + /** + * @hidden + */ + protected _Insert_by_val(val: T): any; + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; + /** + * @hidden + */ + protected _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + * Swap content. + * + * Exchanges the content of the container by the content of obj, which is another + * {@link TreeSet set} of the same type. Sizes abd container type may differ. + * + * After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects. + * + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. + * + * @param obj Another {@link TreeSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeSet container}. + */ + swap(obj: TreeSet): void; + /** + * @inheritdoc + */ + swap(obj: base.Container): void; + } +} +declare namespace std.TreeMap { + type iterator = MapIterator; + type reverse_iterator = MapReverseIterator; +} +declare namespace std { + /** + * Tree-structured map, std::map of STL. + * + * {@link TreeMap TreeMaps} are associative containers that store elements formed by a combination of a + * key value (Key) and a mapped value (T), following order. + * + * In a {@link TreeMap}, the key values are generally used to sort and uniquely identify the elements, + * while the mapped values store the content associated to this key. The types of key and + * mapped value may differ, and are grouped together in member type value_type, which is a {@link Pair} + * type combining both: + * + * typedef Pair value_type; + * + * Internally, the elements in a {@link TreeMap} are always sorted by its key following a + * strict weak ordering criterion indicated by its internal comparison method {@link less}. + * + * {@link TreeMap} containers are generally slower than {@link HashMap HashMap} containers to access individual + * elements by their key, but they allow the direct iteration on subsets based on their order. + * + * {@link TreeMap}s are typically implemented as binary search trees. + * + * + *

+ * + * ### Container properties + *
+ *
Associative
+ *
Elements in associative containers are referenced by their key and not by their absolute + * position in the container.
+ * + *
Ordered
+ *
The elements in the container follow a strict order at all times. All inserted elements are + * given a position in this order.
+ * + *
Map
+ *
Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value.
+ * + *
Unique keys
+ *
No two elements in the container can have equivalent keys.
+ *
+ * + * @param Type of the keys. Each element in a map is uniquely identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @reference http://www.cplusplus.com/reference/map/map + * @author Jeongho Nam + */ + class TreeMap extends base.UniqueMap implements base.ITreeMap { + /** + * @hidden + */ + private tree_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (x: Key, y: Key) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array>); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array>, compare: (x: Key, y: Key) => boolean); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + */ + constructor(array: Array<[Key, T]>); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array<[Key, T]>, compare: (x: Key, y: Key) => boolean); + /** + * Copy Constructor. + * + * @param container Another map to copy. + */ + constructor(container: TreeMap); + /** + * Copy Constructor. + * + * @param container Another map to copy. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: TreeMap, compare: (x: Key, y: Key) => boolean); + /** + * Range Constructor. + * + * @param begin nput interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator>, end: Iterator>); + /** + * Range Constructor. + * + * @param begin nput interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator>, end: Iterator>, compare: (x: Key, y: Key) => boolean); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: Key): MapIterator; + /** + * @inheritdoc + */ + key_comp(): (x: Key, y: Key) => boolean; + /** + * @inheritdoc + */ + value_comp(): (x: Pair, y: Pair) => boolean; + /** + * @inheritdoc + */ + lower_bound(key: Key): MapIterator; + /** + * @inheritdoc + */ + upper_bound(key: Key): MapIterator; + /** + * @inheritdoc + */ + equal_range(key: Key): Pair, MapIterator>; + /** + * @hidden + */ + protected _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + * @hidden + */ + protected _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + * Swap content. + * + * Exchanges the content of the container by the content of obj, which is another + * {@link TreeMap map} of the same type. Sizes abd container type may differ. + * + * After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects. + * + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. + * + * @param obj Another {@link TreeMap map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeMap container}. + */ + swap(obj: TreeMap): void; + /** + * @inheritdoc + */ + swap(obj: base.Container>): void; + } +} +declare namespace std.TreeMultiSet { + type iterator = SetIterator; + type reverse_iterator = SetReverseIterator; +} +declare namespace std { + /** + * Tree-structured multiple-key set. + * + * {@link TreeMultiSet TreeMultiSets} are containers that store elements following a specific order, and + * where multiple elements can have equivalent values. + * + * In a {@link TreeMultiSet}, the value of an element also identifies it (the value is itself + * the key, of type T). The value of the elements in a {@link TreeMultiSet} cannot + * be modified once in the container (the elements are always const), but they can be inserted or removed + * from the container. + * + * Internally, the elements in a {@link TreeMultiSet TreeMultiSets} are always sorted following a strict + * weak ordering criterion indicated by its internal comparison method (of {@link IComparable.less less}). + * + * {@link TreeMultiSet} containers are generally slower than {@link HashMultiSet} containers + * to access individual elements by their key, but they allow the direct iteration on subsets based on + * their order. + * + * {@link TreeMultiSet TreeMultiSets} are typically implemented as binary search trees. + * + * + *

+ * + * ### Container properties + *
+ *
Associative
+ *
+ * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
+ * + *
Ordered
+ *
+ * The elements in the container follow a strict order at all times. All inserted elements are + * given a position in this order. + *
+ * + *
Set
+ *
The value of an element is also the key used to identify it.
+ * + *
Multiple equivalent keys
+ *
Multiple elements in the container can have equivalent keys.
+ *
+ * + * @param Type of the elements. Each element in a {@link TreeMultiSet} container is also identified + * by this value (each value is itself also the element's key). + * + * @reference http://www.cplusplus.com/reference/set/multiset + * @author Jeongho Nam + */ + class TreeMultiSet extends base.MultiSet implements base.ITreeSet { + /** + * @hidden + */ + private tree_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (x: T, y: T) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array); + /** + * Contruct from elements with compare. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array, compare: (x: T, y: T) => boolean); + /** + * Copy Constructor. + */ + constructor(container: TreeMultiSet); + /** + * Copy Constructor with compare. + * + * @param container A container to be copied. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: TreeMultiSet, compare: (x: T, y: T) => boolean); + /** + * Range Constructor. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator, end: Iterator); + /** + * Construct from range and compare. + * + * @param begin Input interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator, end: Iterator, compare: (x: T, y: T) => boolean); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(val: T): SetIterator; + /** + * @inheritdoc + */ + count(val: T): number; + /** + * @inheritdoc + */ + key_comp(): (x: T, y: T) => boolean; + /** + * @inheritdoc + */ + value_comp(): (x: T, y: T) => boolean; + /** + * @inheritdoc + */ + lower_bound(val: T): SetIterator; + /** + * @inheritdoc + */ + upper_bound(val: T): SetIterator; + /** + * @inheritdoc + */ + equal_range(val: T): Pair, SetIterator>; + /** + * @hidden + */ + protected _Insert_by_val(val: T): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; + /** + * @hidden + */ + protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; + /** + * @hidden + */ + protected _Handle_insert(first: SetIterator, last: SetIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: SetIterator, last: SetIterator): void; + /** + * Swap content. + * + * Exchanges the content of the container by the content of obj, which is another + * {@link TreeMultiSet set} of the same type. Sizes abd container type may differ. + * + * After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects. + * + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. + * + * @param obj Another {@link TreeMultiSet set container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeMultiSet container}. + */ + swap(obj: TreeMultiSet): void; + /** + * @inheritdoc + */ + swap(obj: base.Container): void; + } +} +declare namespace std.TreeMultiMap { + type iterator = MapIterator; + type reverse_iterator = MapReverseIterator; +} +declare namespace std { + /** + * Tree-structured multiple-key map. + * + * {@link TreeMultiMap TreeMultiMaps} are associative containers that store elements formed by a combination of + * a key value and a mapped value, following a specific order, and where multiple elements can + * have equivalent keys. + * + * In a {@link TreeMultiMap}, the key values are generally used to sort and uniquely identify + * the elements, while the mapped values store the content associated to this key. The types of + * key and mapped value may differ, and are grouped together in member type + * value_type, which is a {@link Pair} type combining both: + * + * typedef Pair value_type; + * + * Internally, the elements in a {@link TreeMultiMap}are always sorted by its key following a + * strict weak ordering criterion indicated by its internal comparison method (of {@link less}). + * + * {@link TreeMultiMap}containers are generally slower than {@link HashMap} containers + * to access individual elements by their key, but they allow the direct iteration on subsets based + * on their order. + * + * {@link TreeMultiMap TreeMultiMaps} are typically implemented as binary search trees. + * + * < + * img src="http://samchon.github.io/tstl/images/design/class_diagram/map_containers.png" style="max-width: 100%" />

+ * + * ### Container properties + *
+ *
Associative
+ *
+ * Elements in associative containers are referenced by their key and not by their absolute + * position in the container. + *
+ * + *
Ordered
+ *
+ * The elements in the container follow a strict order at all times. All inserted elements are + * given a position in this order. + *
+ * + *
Map
+ *
+ * Each element associates a key to a mapped value: + * Keys are meant to identify the elements whose main content is the mapped value. + *
+ * + *
Multiple equivalent keys
+ *
Multiple elements in the container can have equivalent keys.
+ *
+ * + * @param Type of the keys. Each element in a map is uniquely identified by its key value. + * @param Type of the mapped value. Each element in a map stores some data as its mapped value. + * + * @reference http://www.cplusplus.com/reference/map/multimap + * @author Jeongho Nam + */ + class TreeMultiMap extends base.MultiMap implements base.ITreeMap { + /** + * @hidden + */ + private tree_; + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from compare. + * + * @param compare A binary predicate determines order of elements. + */ + constructor(compare: (x: Key, y: Key) => boolean); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + */ + constructor(array: Array>); + /** + * Contruct from elements. + * + * @param array Elements to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array>, compare: (x: Key, y: Key) => boolean); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + */ + constructor(array: Array<[Key, T]>); + /** + * Contruct from tuples. + * + * @param array Tuples to be contained. + * @param compare A binary predicate determines order of elements. + */ + constructor(array: Array<[Key, T]>, compare: (x: Key, y: Key) => boolean); + /** + * Copy Constructor. + * + * @param container Another map to copy. + */ + constructor(container: TreeMultiMap); + /** + * Copy Constructor. + * + * @param container Another map to copy. + * @param compare A binary predicate determines order of elements. + */ + constructor(container: TreeMultiMap, compare: (x: Key, y: Key) => boolean); + /** + * Range Constructor. + * + * @param begin nput interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + */ + constructor(begin: Iterator>, end: Iterator>); + /** + * Range Constructor. + * + * @param begin nput interator of the initial position in a sequence. + * @param end Input interator of the final position in a sequence. + * @param compare A binary predicate determines order of elements. + */ + constructor(begin: Iterator>, end: Iterator>, compare: (x: Key, y: Key) => boolean); + /** + * @inheritdoc + */ + clear(): void; + /** + * @inheritdoc + */ + find(key: Key): MapIterator; + /** + * @inheritdoc + */ + count(key: Key): number; + /** + * @inheritdoc + */ + key_comp(): (x: Key, y: Key) => boolean; + /** + * @inheritdoc + */ + value_comp(): (x: Pair, y: Pair) => boolean; + /** + * @inheritdoc + */ + lower_bound(key: Key): MapIterator; + /** + * @inheritdoc + */ + upper_bound(key: Key): MapIterator; + /** + * @inheritdoc + */ + equal_range(key: Key): Pair, MapIterator>; + /** + * @hidden + */ + protected _Insert_by_pair(pair: Pair): any; + /** + * @hidden + */ + protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; + /** + * @hidden + */ + protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; + /** + * @hidden + */ + protected _Handle_insert(first: MapIterator, last: MapIterator): void; + /** + * @hidden + */ + protected _Handle_erase(first: MapIterator, last: MapIterator): void; + /** + * Swap content. + * + * Exchanges the content of the container by the content of obj, which is another + * {@link TreeMapMulti map} of the same type. Sizes abd container type may differ. + * + * After the call to this member function, the elements in this container are those which were + * in obj before the call, and the elements of obj are those which were in this. All + * iterators, references and pointers remain valid for the swapped objects. + * + * Notice that a non-member function exists with the same name, {@link swap swap}, overloading that + * algorithm with an optimization that behaves like this member function. + * + * @param obj Another {@link TreeMapMulti map container} of the same type of elements as this (i.e., + * with the same template parameters, Key and T) whose content is swapped + * with that of this {@link TreeMapMulti container}. + */ + swap(obj: TreeMultiMap): void; + /** + * @inheritdoc + */ + swap(obj: base.Container>): void; + } +} +declare namespace std { + /** + * System error exception. + * + * This class defines the type of objects thrown as exceptions to report conditions originating during + * runtime from the operating system or other low-level application program interfaces which have an + * associated {@link ErrorCode}. + * + * The class inherits from {@link RuntimeError}, to which it adds an {@link ErrorCode} as + * member code (and defines a specialized what member). + * + * + * + * + * @reference http://www.cplusplus.com/reference/system_error/system_error + * @author Jeongho Nam + */ + class SystemError extends RuntimeError { + /** + * @hidden + */ + protected code_: ErrorCode; + /** + * Construct from an error code. + * + * @param code An {@link ErrorCode} object. + */ + constructor(code: ErrorCode); + /** + * Construct from an error code and message. + * + * @param code An {@link ErrorCode} object. + * @param message A message incorporated in the string returned by member {@link what what()}. + */ + constructor(code: ErrorCode, message: string); + /** + * Construct from a numeric value and error category. + * + * @param val A numerical value identifying an error code. + * @param category A reference to an {@link ErrorCode} object. + */ + constructor(val: number, category: ErrorCategory); + /** + * Construct from a numeric value, error category and message. + * + * @param val A numerical value identifying an error code. + * @param category A reference to an {@link ErrorCode} object. + * @param message A message incorporated in the string returned by member {@link what what()}. + */ + constructor(val: number, category: ErrorCategory, message: string); + /** + * Get error code. + * + * Returns the {@link ErrorCode} object associated with the exception. + * + * This value is either the {@link ErrorCode} passed to the construction or its equivalent + * (if constructed with a value and a {@link category}. + * + * @return The {@link ErrorCode} associated with the object. + */ + code(): ErrorCode; + } +} +declare namespace std { + /** + * Error category. + * + * This type serves as a base class for specific category types. + * + * Category types are used to identify the source of an error. They also define the relation between + * {@link ErrorCode} and {@link ErrorCondition}objects of its category, as well as the message set for {@link ErrorCode} + * objects. + * + * Objects of these types have no distinct values and are not-copyable and not-assignable, and thus can only be + * passed by reference. As such, only one object of each of these types shall exist, each uniquely identifying its own + * category: all error codes and conditions of a same category shall return a reference to same object. + * + * + * + * + * @reference http://www.cplusplus.com/reference/system_error/error_category + * @author Jeongho Nam + */ + abstract class ErrorCategory { + /** + * Default Constructor. + */ + constructor(); + /** + * Return category name. + * + * In derived classes, the function returns a string naming the category. + * + * In {@link ErrorCategory}, it is a pure virtual member function. + * + *
    + *
  • In the {@link GenericCategory} object, it returns "generic".
  • + *
  • In the {@link SystemCategory} object, it returns "system".
  • + *
  • In the {@link IOStreamCategory} object, it returns "iostream".
  • + *
+ * + * @return The category name. + */ + abstract name(): string; + /** + * Error message. + * + * In derived classes, the function returns a string object with a message describing the error condition + * denoted by val. + * + * In {@link ErrorCategory}, it is a pure virtual member function. + * + * This function is called both by {@link ErrorCode.message ErrorCode.message()} and + * {@link ErrorCondition.message ErrorCondition.message()} to obtain the corresponding message in the + * {@link category}. Therefore, numerical values used by custom error codes and + * {@link ErrorCondition error conditions} should only match for a category if they describe the same error. + * + * @param val A numerical value identifying an error condition. + * If the {@link ErrorCategory} object is the {@link GenericCategory}, this argument is equivalent to an + * {@link errno} value. + * + * @return A string object with the message. + */ + abstract message(val: number): string; + /** + * Default error condition. + * + * Returns the default {@link ErrorCondition}object of this category that is associated with the + * {@link ErrorCode} identified by a value of val. + * + * Its definition in the base class {@link ErrorCategory} returns the same as constructing an + * {@link ErrorCondition} object with: + * + * new ErrorCondition(val, *this); + * + * As a virtual member function, this behavior can be overriden in derived classes. + * + * This function is called by the default definition of member {@link equivalent equivalent()}, which is used to + * compare {@link ErrorCondition error conditions} with error codes. + * + * @param val A numerical value identifying an error condition. + * + * @return The default {@link ErrorCondition}object associated with condition value val for this category. + */ + default_error_condition(val: number): ErrorCondition; + /** + * Check error code equivalence. + * + * Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an + * {@link ErrorCondition error condition. + * + * This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is + * compared to an {@link ErrorCode} object to check for equality or inequality. If either one of those objects' + * {@link ErrorCategory categories} considers the other equivalent using this function, they are considered + * equivalent by the operator. + * + * As a virtual member function, this behavior can be overridden in derived classes to define a different + * correspondence mechanism for each {@link ErrorCategory} type. + * + * @param val_code A numerical value identifying an error code. + * @param cond An object of an {@link ErrorCondition} type. + * + * @return true if the arguments are considered equivalent. false otherwise. + */ + equivalent(val_code: number, cond: ErrorCondition): boolean; + /** + * Check error code equivalence. + * + * Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an + * {@link ErrorCondition error condition. + * + * This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is + * compared to an {@link ErrorCode} object to check for equality or inequality. If either one of those objects' + * {@link ErrorCategory categories} considers the other equivalent using this function, they are considered + * equivalent by the operator. + * + * As a virtual member function, this behavior can be overridden in derived classes to define a different + * correspondence mechanism for each {@link ErrorCategory} type. + * + * @param code An object of an {@link ErrorCode} type. + * @param val_cond A numerical value identifying an error code. + * + * @return true if the arguments are considered equivalent. false otherwise. + */ + equivalent(code: ErrorCode, val_cond: number): boolean; + } +} +declare namespace std { + /** + * Error condition. + * + * Objects of this type hold a condition {@link value} associated with a {@link category}. + * + * Objects of this type describe errors in a generic way so that they may be portable across different + * systems. This is in contrast with {@link ErrorCode} objects, that may contain system-specific + * information. + * + * Because {@link ErrorCondition}objects can be compared with error_code objects directly by using + * relational operators, {@link ErrorCondition}objects are generally used to check whether + * a particular {@link ErrorCode} obtained from the system matches a specific error condition no matter + * the system. + * + * The {@link ErrorCategory categories} associated with the {@link ErrorCondition} and the + * {@link ErrorCode} define the equivalences between them. + * + * + * + * + * @reference http://www.cplusplus.com/reference/system_error/error_condition + * @author Jeongho Nam + */ + class ErrorCondition extends base.ErrorInstance { + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from a numeric value and error category. + * + * @param val A numerical value identifying an error condition. + * @param category A reference to an {@link ErrorCategory} object. + */ + constructor(val: number, category: ErrorCategory); + } +} +declare namespace std { + /** + * Error code. + * + * Objects of this type hold an error code {@link value} associated with a {@link category}. + * + * The operating system and other low-level applications and libraries generate numerical error codes to + * represent possible results. These numerical values may carry essential information for a specific platform, + * but be non-portable from one platform to another. + * + * Objects of this class associate such numerical codes to {@link ErrorCategory error categories}, so that they + * can be interpreted when needed as more abstract (and portable) {@link ErrorCondition error conditions}. + * + * + * + * + * @reference http://www.cplusplus.com/reference/system_error/error_code + * @author Jeongho Nam + */ + class ErrorCode extends base.ErrorInstance { + /** + * Default Constructor. + */ + constructor(); + /** + * Construct from a numeric value and error category. + * + * @param val A numerical value identifying an error code. + * @param category A reference to an {@link ErrorCategory} object. + */ + constructor(val: number, category: ErrorCategory); + } +} +declare namespace std { + /** + * Running on Node. + * + * Test whether the JavaScript is running on Node. + * + * @references http://stackoverflow.com/questions/17575790/environment-detection-node-js-or-browser + */ + function is_node(): boolean; + /** + * Pair of values. + * + * This class couples together a pair of values, which may be of different types (T1 and + * T2). The individual values can be accessed through its public members {@link first} and + * {@link second}. + * + * @param Type of member {@link first}. + * @param Type of member {@link second}. + * + * @reference http://www.cplusplus.com/reference/utility/pair + * @author Jeongho Nam + */ + class Pair implements IComparable> { + /** + * A first value in the Pair. + */ + first: T1; + /** + * A second value in the Pair. + */ + second: T2; + /** + * Construct from pair values. + * + * @param first The first value of the Pair + * @param second The second value of the Pair + */ + constructor(first: T1, second: T2); + /** + * Whether a Pair is equal with the Pair. + * + * Compare each first and second value of two Pair(s) and returns whether they are equal or not. + * + * If stored key and value in a Pair are not number or string but an object like a class or struct, + * the comparison will be executed by a member method (SomeObject)::equals(). If the object does not have + * the member method equal_to(), only address of pointer will be compared. + * + * @param obj A Map to compare + * @return Indicates whether equal or not. + */ + equals(pair: Pair): boolean; + /** + * @inheritdoc + */ + less(pair: Pair): boolean; + } + /** + * Construct {@link Pair} object. + * + * Constructs a {@link Pair} object with its {@link Pair.first first} element set to x and its + * {@link Pair.second second} element set to y. + * + * The template types can be implicitly deduced from the arguments passed to {@link make_pair}. + * + * {@link Pair} objects can be constructed from other {@link Pair} objects containing different types, if the + * respective types are implicitly convertible. + * + * @param x Value for member {@link Pair.first first}. + * @param y Value for member {@link Pair.second second}. + * + * @return A {@link Pair} object whose elements {@link Pair.first first} and {@link Pair.second second} are set to + * x and y respectivelly. + */ + function make_pair(x: T1, y: T2): Pair; +} +declare namespace std { + /** + * Type definition of {@link Vector} and it's the original name used in C++. + */ + export import vector = Vector; + /** + * Type definition of {@link List} and it's the original name used in C++. + */ + export import list = List; + /** + * Type definition of {@link Deque} and it's the original name used in C++. + */ + export import deque = Deque; + /** + * Type definition of {@link Stack} and it's the original name used in C++. + */ + type stack = Stack; + /** + * Type definition of {@link Queue} and it's the original name used in C++. + */ + type queue = Queue; + /** + * Type definition of {@link PriorityQueue} and it's the original name used in C++. + */ + type priority_queue = PriorityQueue; + var stack: typeof Stack; + var queue: typeof Queue; + var priority_queue: typeof PriorityQueue; + /** + * Type definition of {@link TreeSet} and it's the original name used in C++. + */ + export import set = TreeSet; + /** + * Type definition of {@link TreeMultiSet} and it's the original name used in C++. + */ + export import multiset = TreeMultiSet; + /** + * Type definition of {@link HashSet} and it's the original name used in C++. + */ + export import unordered_set = HashSet; + /** + * Type definition of {@link HashMultiSet} and it's the original name used in C++. + */ + export import unordered_multiset = HashMultiSet; + /** + * Type definition of {@link TreeMap} and it's the original name used in C++. + */ + export import map = TreeMap; + /** + * Type definition of {@link TreeMultiMap} and it's the original name used in C++. + */ + export import multimap = TreeMultiMap; + /** + * Type definition of {@link HashMap} and it's the original name used in C++. + */ + export import unordered_map = HashMap; + /** + * Type definition of {@link HashMultiMap} and it's the original name used in C++. + */ + export import unordered_multimap = HashMultiMap; + type exception = Exception; + type logic_error = LogicError; + type domain_error = DomainError; + type invalid_argument = InvalidArgument; + type length_error = LengthError; + type out_of_range = OutOfRange; + type runtime_error = RuntimeError; + type overflow_error = OverflowError; + type underflow_error = UnderflowError; + type range_error = RangeError; + type system_error = SystemError; + type error_category = ErrorCategory; + type error_condition = ErrorCondition; + type error_code = ErrorCode; + var exception: typeof Exception; + var logic_error: typeof LogicError; + var domain_error: typeof DomainError; + var invalid_argument: typeof InvalidArgument; + var length_error: typeof LengthError; + var out_of_range: typeof OutOfRange; + var runtime_error: typeof RuntimeError; + var overflow_error: typeof OverflowError; + var underflow_error: typeof UnderflowError; + var range_error: typeof RangeError; + var system_error: typeof SystemError; + var error_category: typeof ErrorCategory; + var error_condition: typeof ErrorCondition; + var error_code: typeof ErrorCode; +} diff --git a/tstl/tsconfig.json b/tstl/tsconfig.json new file mode 100644 index 0000000000..b5f47406d8 --- /dev/null +++ b/tstl/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "tstl-tests.ts" + ] +} \ No newline at end of file diff --git a/tstl/tstl-tests.ts b/tstl/tstl-tests.ts new file mode 100644 index 0000000000..ec42d087b4 --- /dev/null +++ b/tstl/tstl-tests.ts @@ -0,0 +1,2 @@ +import std = require("tstl"); +console.log(std); \ No newline at end of file diff --git a/typescript-stl/index.d.ts b/typescript-stl/index.d.ts index bd6886deed..bbd6c5ca57 100644 --- a/typescript-stl/index.d.ts +++ b/typescript-stl/index.d.ts @@ -1,12485 +1,13 @@ -// Type definitions for TypeScript-STL v1.2.4 -// Project: https://github.com/samchon/typescript-stl +// Type definitions for TSTL v1.3.x +// Project: https://github.com/samchon/tstl // Definitions by: Jeongho Nam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// +// TypeScript-STL is renamed to TSTL + declare module "typescript-stl" { + import std = require("tstl"); export = std; -} - -/** - *

TypeScript-STL

- *

- *

- * - *

STL (Standard Template Library) Containers and Algorithms for TypeScript.

- * - *

TypeScript-STL is a TypeScript's Standard Template Library who is migrated from C++ STL. Most of classes - * and functions of STL have implemented. Just enjoy it.

- * - * @git https://github.com/samchon/typescript-stl - * @author Jeongho Nam - */ -declare namespace std { -} -/** - * Base classes composing STL in background. - * - * @author Jeongho Nam - */ -declare namespace std.base { -} -declare namespace std { - /** - *

Apply function to range.

- * - *

Applies function fn to each of the elements in the range [first, last).

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param fn Unary function that accepts an element in the range as argument. This can either be a function p - * ointer or a move constructible function object. Its return value, if any, is ignored. - */ - function for_each, Func extends (val: T) => any>(first: InputIterator, last: InputIterator, fn: Func): Func; - /** - * Apply function to range. - * - * Applies function *fn* to each of the elements in the range [*first*, *first + n*). - * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param n the number of elements to apply the function to - * @param fn Unary function that accepts an element in the range as argument. This can either be a function p - * ointer or a move constructible function object. Its return value, if any, is ignored. - * - * @return first + n - */ - function for_each_n>(first: InputIterator, n: number, fn: (val: T) => any): InputIterator; - /** - *

Test condition on all elements in range.

- * - *

Returns true if pred returns true for all the elements in the range - * [first, last) or if the range is {@link IContainer.empty empty}, and false otherwise. - *

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param pred Unary function that accepts an element in the range as argument and returns a value convertible to - * boolean. The value returned indicates whether the element fulfills the condition - * checked by this function. The function shall not modify its argument. - * - * @return true if pred returns true for all the elements in the range or if the range is - * {@link IContainer.empty empty}, and false otherwise. - */ - function all_of>(first: InputIterator, last: InputIterator, pred: (val: T) => boolean): boolean; - /** - *

Test if any element in range fulfills condition.

- * - *

Returns true if pred returns true for any of the elements in the range - * [first, last), and false otherwise.

- * - *

If [first, last) is an {@link IContainer.empty empty} range, the function returns - * false.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param pred Unary function that accepts an element in the range as argument and returns a value convertible to - * boolean. The value returned indicates whether the element fulfills the condition - * checked by this function. The function shall not modify its argument. - * - * @return true if pred returns true for any of the elements in the range - * [first, last), and false otherwise. If [first, last) is an - * {@link IContainer.empty empty} range, the function returns false. - */ - function any_of>(first: InputIterator, last: InputIterator, pred: (val: T) => boolean): boolean; - /** - *

Test if no elements fulfill condition.

- * - *

Returns true if pred returns false for all the elements in the range - * [first, last) or if the range is {@link IContainer.empty empty}, and false otherwise. - *

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param pred Unary function that accepts an element in the range as argument and returns a value convertible to - * boolean. The value returned indicates whether the element fulfills the condition - * checked by this function. The function shall not modify its argument. - * - * @return true if pred returns false for all the elements in the range - * [first, last) or if the range is {@link IContainer.empty empty}, and false - * otherwise. - */ - function none_of>(first: InputIterator, last: InputIterator, pred: (val: T) => boolean): boolean; - /** - *

Test whether the elements in two ranges are equal.

- * - *

Compares the elements in the range [first1, last1) with those in the range beginning at - * first2, and returns true if all of the elements in both ranges match.

- * - * @param first1 An {@link Iterator} to the initial position of the first sequence. - * @param last1 An {@link Iterator} to the final position in a sequence. The range used is - * [first1, last1), including the element pointed by first1, but not the element - * pointed by last1. - * @param first2 An {@link Iterator} to the initial position of the second sequence. The comparison includes up to - * as many elements of this sequence as those in the range [first1, last1). - * - * @return true if all the elements in the range [first1, last1) compare equal to those - * of the range starting at first2, and false otherwise. - */ - function equal>(first1: InputIterator, last1: InputIterator, first2: Iterator): boolean; - /** - *

Test whether the elements in two ranges are equal.

- * - *

Compares the elements in the range [first1, last1) with those in the range beginning at - * first2, and returns true if all of the elements in both ranges match.

- * - * @param first1 An {@link Iterator} to the initial position of the first sequence. - * @param last1 An {@link Iterator} to the final position in a sequence. The range used is - * [first1, last1), including the element pointed by first1, but not the element - * pointed by last1. - * @param first2 An {@link Iterator} to the initial position of the second sequence. The comparison includes up to - * as many elements of this sequence as those in the range [first1, last1). - * @param pred Binary function that accepts two elements as argument (one of each of the two sequences, in the same - * order), and returns a value convertible to bool. The value returned indicates whether - * the elements are considered to match in the context of this function. - * - * @return true if all the elements in the range [first1, last1) compare equal to those - * of the range starting at first2, and false otherwise. - */ - function equal>(first1: InputIterator, last1: InputIterator, first2: Iterator, pred: (x: T, y: T) => boolean): boolean; - /** - *

Lexicographical less-than comparison.

- * - *

Returns true if the range [first1, last1) compares lexicographically less - * than the range [first2, last2).

- * - *

A lexicographical comparison is the kind of comparison generally used to sort words alphabetically in - * dictionaries; It involves comparing sequentially the elements that have the same position in both ranges against - * each other until one element is not equivalent to the other. The result of comparing these first non-matching - * elements is the result of the lexicographical comparison.

- * - *

If both sequences compare equal until one of them ends, the shorter sequence is lexicographically less - * than the longer one.

- * - * @param first1 An {@link Iterator} to the initial position of the first sequence. - * @param last1 An {@link Iterator} to the final position in a sequence. The range used is - * [first1, last1), including the element pointed by first1, but not the element - * pointed by last1. - * @param first2 An {@link Iterator} to the initial position of the second sequence. - * @param last2 An {@link Iterator} to the final position of the second sequence. The ranged used is - * [first2, last2). - * - * @return true if the first range compares lexicographically less than than the second. - * false otherwise (including when all the elements of both ranges are equivalent). - */ - function lexicographical_compare, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2): boolean; - /** - *

Lexicographical comparison.

- * - *

Returns true if the range [first1, last1) compares lexicographically - * relationship than the range [first2, last2).

- * - *

A lexicographical comparison is the kind of comparison generally used to sort words alphabetically in - * dictionaries; It involves comparing sequentially the elements that have the same position in both ranges against - * each other until one element is not equivalent to the other. The result of comparing these first non-matching - * elements is the result of the lexicographical comparison.

- * - *

If both sequences compare equal until one of them ends, the shorter sequence is lexicographically - * relationship than the longer one.

- * - * @param first1 An {@link Iterator} to the initial position of the first sequence. - * @param last1 An {@link Iterator} to the final position in a sequence. The range used is - * [first1, last1), including the element pointed by first1, but not the element - * pointed by last1. - * @param first2 An {@link Iterator} to the initial position of the second sequence. - * @param last2 An {@link Iterator} to the final position of the second sequence. The ranged used is - * [first2, last2). - * @param compare Binary function that accepts two arguments of the types pointed by the iterators, and returns a - * value convertible to bool. The value returned indicates whether the first argument is - * considered to go before the second in the specific strict weak ordering it defines. - * - * @return true if the first range compares lexicographically relationship than than the - * second. false otherwise (including when all the elements of both ranges are equivalent). - */ - function lexicographical_compare, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2, compare: (x: T, y: T) => boolean): boolean; - /** - *

Find value in range.

- * - *

Returns an iterator to the first element in the range [first, last) that compares equal to - * val. If no such element is found, the function returns last.

- * - *

The function uses {@link equal_to equal_to} to compare the individual elements to val.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param val Value to search for in the range. - * - * @return An {@link Iterator} to the first element in the range that compares equal to val. If no elements - * match, the function returns last. - */ - function find>(first: InputIterator, last: InputIterator, val: T): InputIterator; - /** - *

Find element in range.

- * - *

Returns an iterator to the first element in the range [first, last) for which pred returns - * true. If no such element is found, the function returns last.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param pred Unary function that accepts an element in the range as argument and returns a value convertible - * to bool. The value returned indicates whether the element is considered a match in - * the context of this function. The function shall not modify its argument. - * - * @return An {@link Iterator} to the first element in the range for which pred does not return - * false. If pred is false for all elements, the function returns - * last. - */ - function find_if>(first: InputIterator, last: InputIterator, pred: (val: T) => boolean): InputIterator; - /** - *

Find element in range.

- * - *

Returns an iterator to the first element in the range [first, last) for which pred returns - * true. If no such element is found, the function returns last.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param pred Unary function that accepts an element in the range as argument and returns a value convertible - * to bool. The value returned indicates whether the element is considered a match in - * the context of this function. The function shall not modify its argument. - * - * @return An {@link Iterator} to the first element in the range for which pred returns false. - * If pred is true for all elements, the function returns last. - */ - function find_if_not>(first: InputIterator, last: InputIterator, pred: (val: T) => boolean): InputIterator; - /** - *

Find last subsequence in range.

- * - *

Searches the range [first1, last1) for the last occurrence of the sequence defined by - * [first2, last2), and returns an {@link Iterator} to its first element, or last1,/i> if no - * occurrences are found.

- * - *

The elements in both ranges are compared sequentially using {@link equal_to}: A subsequence of - * [first1, last1) is considered a match only when this is true for all the elements of - * [first2, last2).

- * - *

This function returns the last of such occurrences. For an algorithm that returns the first instead, see - * {@link search}.

- * - * @param first1 An {@link Iterator} to the initial position of the first sequence. - * @param last1 An {@link Iterator} to the final position in a sequence. The range used is - * [first1, last1), including the element pointed by first1, but not the element - * pointed by last1. - * @param first2 An {@link Iterator} to the initial position of the element values to be searched for. - * @param last2 An {@link Iterator} to the final position of the element values to be searched for. The range used - * is [first2, last2). - * @param pred Binary function that accepts two elements as arguments (one of each of the two sequences, in the - * same order), and returns a value convertible to bool. The value returned indicates - * whether the elements are considered to match in the context of this function. - * - * @return An {@link Iterator} to the first element of the last occurrence of [first2, last2) in - * [first1, last1). If the sequence is not found, the function returns ,i>last1
. Otherwise - * [first2, last2) is an empty range, the function returns last1. - */ - function find_end, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2): Iterator1; - /** - *

Find last subsequence in range.

- * - *

Searches the range [first1, last1) for the last occurrence of the sequence defined by - * [first2, last2), and returns an {@link Iterator} to its first element, or last1,/i> if no - * occurrences are found.

- * - *

The elements in both ranges are compared sequentially using pred: A subsequence of - * [first1, last1) is considered a match only when this is true for all the elements of - * [first2, last2).

- * - *

This function returns the last of such occurrences. For an algorithm that returns the first instead, see - * {@link search}.

- * - * @param first1 An {@link Iterator} to the initial position of the first sequence. - * @param last1 An {@link Iterator} to the final position in a sequence. The range used is - * [first1, last1), including the element pointed by first1, but not the element - * pointed by last1. - * @param first2 An {@link Iterator} to the initial position of the element values to be searched for. - * @param last2 An {@link Iterator} to the final position of the element values to be searched for. The range used - * is [first2, last2). - * @param pred Binary function that accepts two elements as arguments (one of each of the two sequences, in the - * same order), and returns a value convertible to bool. The value returned indicates - * whether the elements are considered to match in the context of this function. - * - * @return An {@link Iterator} to the first element of the last occurrence of [first2, last2) in - * [first1, last1). If the sequence is not found, the function returns ,i>last1
. Otherwise - * [first2, last2) is an empty range, the function returns last1. - */ - function find_end, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2, pred: (x: T, y: T) => boolean): Iterator1; - /** - *

Find element from set in range.

- * - *

Returns an iterator to the first element in the range [first1, last1) that matches any of the - * elements in [first2, last2). If no such element is found, the function returns last1.

- * - *

The elements in [first1, last1) are sequentially compared to each of the values in - * [first2, last2) using {@link equal_to}, until a pair matches.

- * - * @param first1 An {@link Iterator} to the initial position of the first sequence. - * @param last1 An {@link Iterator} to the final position in a sequence. The range used is - * [first1, last1), including the element pointed by first1, but not the element - * pointed by last1. - * @param first2 An {@link Iterator} to the initial position of the element values to be searched for. - * @param last2 An {@link Iterator} to the final position of the element values to be searched for. The range used - * is [first2, last2). - * - * @return An {@link Iterator} to the first element in [first1, last1) that is part of - * [first2, last2). If no matches are found, the function returns last1. - */ - function find_first_of, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2): Iterator1; - /** - *

Find element from set in range.

- * - *

Returns an iterator to the first element in the range [first1, last1) that matches any of the - * elements in [first2, last2). If no such element is found, the function returns last1.

- * - *

The elements in [first1, last1) are sequentially compared to each of the values in - * [first2, last2) using pred, until a pair matches.

- * - * @param first1 An {@link Iterator} to the initial position of the first sequence. - * @param last1 An {@link Iterator} to the final position in a sequence. The range used is - * [first1, last1), including the element pointed by first1, but not the element - * pointed by last1. - * @param first2 An {@link Iterator} to the initial position of the element values to be searched for. - * @param last2 An {@link Iterator} to the final position of the element values to be searched for. The range used - * is [first2, last2). - * @param pred Binary function that accepts two elements as arguments (one of each of the two sequences, in the - * same order), and returns a value convertible to bool. The value returned indicates - * whether the elements are considered to match in the context of this function. - * - * @return An {@link Iterator} to the first element in [first1, last1) that is part of - * [first2, last2). If no matches are found, the function returns last1. - */ - function find_first_of, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, last2: Iterator2, pred: (x: T, y: T) => boolean): Iterator1; - /** - *

Find equal adjacent elements in range.

- * - *

Searches the range [first, last) for the first occurrence of two consecutive elements that match, - * and returns an {@link Iterator} to the first of these two elements, or last if no such pair is found.

- * - *

Two elements match if they compare equal using {@link equal_to}.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * - * @return An {@link Iterator} to the first element of the first pair of matching consecutive elements in the range - * [first, last). If no such pair is found, the function returns last. - */ - function adjacent_find>(first: InputIterator, last: InputIterator): InputIterator; - /** - *

Find equal adjacent elements in range.

- * - *

Searches the range [first, last) for the first occurrence of two consecutive elements that match, - * and returns an {@link Iterator} to the first of these two elements, or last if no such pair is found.

- * - *

Two elements match if they compare equal using pred.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param pred Unary function that accepts an element in the range as argument and returns a value convertible to - * bool. The value returned indicates whether the element is considered a match in the - * context of this function. The function shall not modify its argument. - * - * @return An {@link Iterator} to the first element of the first pair of matching consecutive elements in the range - * [first, last). If no such pair is found, the function returns last. - */ - function adjacent_find>(first: InputIterator, last: InputIterator, pred: (x: T, y: T) => boolean): InputIterator; - /** - *

Search range for subsequence.

- * - *

Searches the range [first1, last1) for the first occurrence of the sequence defined by - * [first2, last2), and returns an iterator to its first element, or last1 if no occurrences are - * found.

- * - *

The elements in both ranges are compared sequentially using {@link equal_to}: A subsequence of - * [first1, last1) is considered a match only when this is true for all the elements of - * [first2, last2).

- * - *

This function returns the first of such occurrences. For an algorithm that returns the last instead, see - * {@link find_end}.

- * - * @param first1 {@link Iterator Forward iterator} to the initial position of the searched sequence. - * @param last1 {@link Iterator Forward iterator} to the final position of the searched sequence. The range used is - * [first1, last1), which contains all the elements between first1 and last1, - * including the element pointed by first1 but not the element pointed by last1. - * @param first2 {@link Iterator Forward iterator} to the initial position of the sequence to be searched for. - * @param last2 {@link Iterator Forward iterator} to the final position of the sequence to be searched for. The range - * used is [first2, last2). - * - * @return An iterator to the first element of the first occurrence of [first2, last2) in first1 - * and last1. If the sequence is not found, the function returns last1. Otherwise - * [first2, last2) is an empty range, the function returns first1. - */ - function search, ForwardIterator2 extends Iterator>(first1: ForwardIterator1, last1: ForwardIterator1, first2: ForwardIterator2, last2: ForwardIterator2): ForwardIterator1; - /** - *

Search range for subsequence.

- * - *

Searches the range [first1, last1) for the first occurrence of the sequence defined by - * [first2, last2), and returns an iterator to its first element, or last1 if no occurrences are - * found.

- * - *

The elements in both ranges are compared sequentially using pred: A subsequence of - * [first1, last1) is considered a match only when this is true for all the elements of - * [first2, last2).

- * - *

This function returns the first of such occurrences. For an algorithm that returns the last instead, see - * {@link find_end}.

- * - * @param first1 {@link Iterator Forward iterator} to the initial position of the searched sequence. - * @param last1 {@link Iterator Forward iterator} to the final position of the searched sequence. The range used is - * [first1, last1), which contains all the elements between first1 and last1, - * including the element pointed by first1 but not the element pointed by last1. - * @param first2 {@link Iterator Forward iterator} to the initial position of the sequence to be searched for. - * @param last2 {@link Iterator Forward iterator} to the final position of the sequence to be searched for. The range - * used is [first2, last2). - * @param pred Binary function that accepts two elements as arguments (one of each of the two sequences, in the same - * order), and returns a value convertible to bool. The returned value indicates whether the elements are - * considered to match in the context of this function. The function shall not modify any of its - * arguments. - * - * @return An iterator to the first element of the first occurrence of [first2, last2) in - * [first1, last1). If the sequence is not found, the function returns last1. Otherwise - * [first2, last2) is an empty range, the function returns first1. - */ - function search, ForwardIterator2 extends Iterator>(first1: ForwardIterator1, last1: ForwardIterator1, first2: ForwardIterator2, last2: ForwardIterator2, pred: (x: T, y: T) => boolean): ForwardIterator1; - /** - *

Search range for elements.

- * - *

Searches the range [first, last) for a sequence of count elements, each comparing equal to - * val.

- * - *

The function returns an iterator to the first of such elements, or last if no such sequence is found. - *

- * - * @param first {@link Iterator Forward iterator} to the initial position of the searched sequence. - * @param last {@link Iterator Forward iterator} to the final position of the searched sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param count Minimum number of successive elements to match. - * @param val Individual value to be compared, or to be used as argument for {@link equal_to}. - * - * @return An iterator to the first element of the sequence. If no such sequence is found, the function returns - * last. - */ - function search_n>(first: ForwardIterator, last: ForwardIterator, count: number, val: T): ForwardIterator; - /** - *

Search range for elements.

- * - *

Searches the range [first, last) for a sequence of count elements, each comparing equal to - * val.

- * - *

The function returns an iterator to the first of such elements, or last if no such sequence is found. - *

- * - * @param first {@link Iterator Forward iterator} to the initial position of the searched sequence. - * @param last {@link Iterator Forward iterator} to the final position of the searched sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param count Minimum number of successive elements to match. - * @param val Individual value to be compared, or to be used as argument for pred. - * @param pred Binary function that accepts two arguments (one element from the sequence as first, and val as - * second), and returns a value convertible to bool. The value returned indicates whether the - * element is considered a match in the context of this function. The function shall not modify any of its - * arguments. - * - * @return An {@link Iterator} to the first element of the sequence. If no such sequence is found, the function - * returns last. - */ - function search_n>(first: ForwardIterator, last: ForwardIterator, count: number, val: T, pred: (x: T, y: T) => boolean): ForwardIterator; - /** - *

Return first position where two ranges differ.

- * - *

Compares the elements in the range [first1, last1) with those in the range beginning at - * first2, and returns the first element of both sequences that does not match.

- * - *

The function returns a {@link Pair} of {@link iterators Iterator} to the first element in each range that - * does not match.

- * - * @param first1 An {@link Iterator} to the initial position of the first sequence. - * @param last1 An {@link Iterator} to the final position in a sequence. The range used is - * [first1, last1), including the element pointed by first1, but not the element - * pointed by last1. - * @param first2 An {@link Iterator} to the initial position of the second sequence. The comparison includes up to - * as many elements of this sequence as those in the range [first1, last1). - * - * @return A {@link Pair}, where its members {@link Pair.first first} and {@link Pair.second second} point to the - * first element in both sequences that did not compare equal to each other. If the elements compared in - * both sequences have all matched, the function returns a {@link Pair} with {@link Pair.first first} set - * to last1 and {@link Pair.second second} set to the element in that same relative position in the - * second sequence. If none matched, it returns {@link make_pair}(first1, first2). - */ - function mismatch, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2): Pair; - /** - *

Return first position where two ranges differ.

- * - *

Compares the elements in the range [first1, last1) with those in the range beginning at - * first2, and returns the first element of both sequences that does not match.

- * - *

The function returns a {@link Pair} of {@link iterators Iterator} to the first element in each range that - * does not match.

- * - * @param first1 An {@link Iterator} to the initial position of the first sequence. - * @param last1 An {@link Iterator} to the final position in a sequence. The range used is - * [first1, last1), including the element pointed by first1, but not the element - * pointed by last1. - * @param first2 An {@link Iterator} to the initial position of the second sequence. The comparison includes up to - * as many elements of this sequence as those in the range [first1, last1). - * @param pred Binary function that accepts two elements as argument (one of each of the two sequences, in the same - * order), and returns a value convertible to bool. The value returned indicates whether - * the elements are considered to match in the context of this function. - * - * @return A {@link Pair}, where its members {@link Pair.first first} and {@link Pair.second second} point to the - * first element in both sequences that did not compare equal to each other. If the elements compared in - * both sequences have all matched, the function returns a {@link Pair} with {@link Pair.first first} set - * to last1 and {@link Pair.second second} set to the element in that same relative position in the - * second sequence. If none matched, it returns {@link make_pair}(first1, first2). - */ - function mismatch, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, compare: (x: T, y: T) => boolean): Pair; - /** - *

Count appearances of value in range.

- * - *

Returns the number of elements in the range [first, last) that compare equal to val.

- * - *

The function uses {@link equal_to} to compare the individual elements to val.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param val Value to match. - * - * @return The number of elements in the range [first, last) that compare equal to val. - */ - function count>(first: InputIterator, last: InputIterator, val: T): number; - /** - *

Return number of elements in range satisfying condition.

- * - *

Returns the number of elements in the range [first, last) for which pred is true. - *

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible - * to bool. The value returned indicates whether the element is counted by this function. - * The function shall not modify its argument. This can either be a function pointer or a function - * object. - */ - function count_if>(first: InputIterator, last: InputIterator, pred: (val: T) => boolean): number; -} -declare namespace std { - /** - *

Copy range of elements.

- * - *

Copies the elements in the range [first, last) into the range beginning at result.

- * - *

The function returns an iterator to the end of the destination range (which points to the element following the - * last element copied).

- * - *

The ranges shall not overlap in such a way that result points to an element in the range - * [first, last). For such cases, see {@link copy_backward}.

- * - * @param first {@link Iterator Input iterator} to the initial position in a sequence to be copied. - * @param last {@link Iterator Input iterator} to the initial position in a sequence to be copied. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param result {@link Iterator Output iterator} to the initial position in the destination sequence. This shall not - * point to any element in the range [first, last). - * - * @return An iterator to the end of the destination range where elements have been copied. - */ - function copy, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator): OutputIterator; - /** - *

Copy elements.

- * - *

Copies the first n elements from the range beginning at first into the range beginning at - * result.

- * - *

The function returns an iterator to the end of the destination range (which points to one past the last element - * copied).

- * - *

If n is negative, the function does nothing.

- * - *

If the ranges overlap, some of the elements in the range pointed by result may have undefined but valid values. - *

- * - * @param first {@link Iterator Input iterator} to the initial position in a sequence of at least n elements to - * be copied. InputIterator shall point to a type assignable to the elements pointed by - * OutputIterator. - * @param n Number of elements to copy. If this value is negative, the function does nothing. - * @param result {@link Iterator Output iterator} to the initial position in the destination sequence of at least - * n elements. This shall not point to any element in the range [first, last]. - * - * @return An iterator to the end of the destination range where elements have been copied. - */ - function copy_n, OutputIterator extends base.ILinearIterator>(first: InputIterator, n: number, result: OutputIterator): OutputIterator; - /** - *

Copy certain elements of range.

- * - *

Copies the elements in the range [first, last) for which pred returns true to the - * range beginning at result.

- * - * @param first {@link Iterator Input iterator} to the initial position in a sequence to be copied. - * @param last {@link Iterator Input iterator} to the initial position in a sequence to be copied. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param result {@link Iterator Output iterator} to the initial position in the destination sequence. This shall not - * point to any element in the range [first, last). - * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to - * bool. The value returned indicates whether the element is to be copied (if - * true, it is copied). The function shall not modify any of its arguments. - * - * @return An iterator to the end of the destination range where elements have been copied. - */ - function copy_if, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator, pred: (x: T) => boolean): OutputIterator; - /** - *

Copy range of elements backward.

- * - *

Copies the elements in the range [first, last) starting from the end into the range terminating - * at result.

- * - *

The function returns an iterator to the first element in the destination range.

- * - *

The resulting range has the elements in the exact same order as [first, last). To reverse their - * order, see {@link reverse_copy}.

- * - *

The function begins by copying *(last-1) into *(result-1), and then follows backward - * by the elements preceding these, until first is reached (and including it).

- * - *

The ranges shall not overlap in such a way that result (which is the past-the-end element in the - * destination range) points to an element in the range (first,last]. For such cases, see {@link copy}.

- * - * @param first {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied. - * @param last {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied. The range - * used is [first, last), which contains all the elements between first and - * last, including the element pointed by first but not the element pointed by last. - * @param result {@link Iterator Bidirectional iterator} to the initial position in the destination sequence. This - * shall not point to any element in the range [first, last). - * - * @return An iterator to the first element of the destination sequence where elements have been copied. - */ - function copy_backward, BidirectionalIterator2 extends base.ILinearIterator>(first: BidirectionalIterator1, last: BidirectionalIterator1, result: BidirectionalIterator2): BidirectionalIterator2; - /** - *

Fill range with value.

- * - *

Assigns val to all the elements in the range [first, last).

- * - * @param first {@link Iterator Forward iterator} to the initial position in a sequence of elements that support being - * assigned a value of type T. - * @param last {@link Iterator Forward iterator} to the final position in a sequence of elements that support being - * assigned a value of type T.. The range filled is [first, last), which contains - * all the elements between first and last, including the element pointed by first - * but not the element pointed by last. - * @param val Value to assign to the elements in the filled range. - */ - function fill>(first: ForwardIterator, last: ForwardIterator, val: T): void; - /** - *

Fill sequence with value.

- * - *

Assigns val to the first n elements of the sequence pointed by first.

- * - * @param first {@link Iterator Output iterator} to the initial position in a sequence of elements that support being - * assigned a value of type T. - * @param n Number of elements to fill. If negative, the function does nothing. - * @param val Value to be used to fill the range. - * - * @return An iterator pointing to the element that follows the last element filled. - */ - function fill_n>(first: OutputIterator, n: number, val: T): OutputIterator; - /** - *

Transform range.

- * - *

Applies op to each of the elements in the range [first, last) and stores the value returned - * by each operation in the range that begins at result.

- * - * @param first {@link Iterator Input iterator} to the initial position in a sequence to be transformed. - * @param last {@link Iterator Input iterator} to the initial position in a sequence to be transformed. The range - * used is [first, last), which contains all the elements between first and - * last, including the element pointed by first but not the element pointed by last. - * @param result {@link Iterator Output} iterator to the initial position of the range where the operation results are - * stored. The range includes as many elements as [first, last). - * @param op Unary function that accepts one element of the type pointed to by InputIterator as argument, and - * returns some result value convertible to the type pointed to by OutputIterator. - * - * @return An iterator pointing to the element that follows the last element written in the result sequence. - */ - function transform, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator, op: (val: T) => T): OutputIterator; - /** - *

Transform range.

- * - *

Calls binary_op using each of the elements in the range [first1, last1) as first argument, - * and the respective argument in the range that begins at first2 as second argument. The value returned by - * each call is stored in the range that begins at result.

- * - * @param first1 {@link Iterator Input iterator} to the initial position of the first sequence. - * @param last1 {@link Iterator Input iterator} to the final position of the first sequence. The range used is - * [first1, last1), including the element pointed by first1, but not the element - * pointed by last1. - * @param first2 {@link Iterator Input iterator} to the initial position of the second range. The range includes as - * many elements as [first1, last1). - * @param result {@link Iterator Output} iterator to the initial position of the range where the operation results are - * stored. The range includes as many elements as [first1, last1). - * @param binary_op Binary function that accepts two elements as argument (one of each of the two sequences), and - * returns some result value convertible to the type pointed to by OutputIterator. - * - * @return An iterator pointing to the element that follows the last element written in the result sequence. - */ - function transform, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, result: OutputIterator, binary_op: (x: T, y: T) => T): OutputIterator; - /** - *

Generate values for range with function.

- * - *

Assigns the value returned by successive calls to gen to the elements in the range [first, last). - *

- * - * @param first {@link Iterator Forward iterator} to the initial position in a sequence. - * @param last {@link Iterator Forward iterator} to the final position in a sequence. The range affected is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param gen Generator function that is called with no arguments and returns some value of a type convertible to - * those pointed by the iterators. - */ - function generate>(first: ForwardIterator, last: ForwardIterator, gen: () => T): void; - /** - *

Generate values for sequence with function.

- * - *

Assigns the value returned by successive calls to gen to the first n elements of the sequence - * pointed by first.

- * - * @param first {@link Iterator Output iterator} to the initial position in a sequence of at least n elements - * that support being assigned a value of the type returned by gen. - * @param n Number of values to generate. If negative, the function does nothing. - * @param gen Generator function that is called with no arguments and returns some value of a type convertible to - * those pointed by the iterators. - * - * @return An iterator pointing to the element that follows the last element whose value has been generated. - */ - function generate_n>(first: ForwardIterator, n: number, gen: () => T): ForwardIterator; - /** - *

Remove consecutive duplicates in range.

- * - *

Removes all but the first element from every consecutive group of equivalent elements in the range - * [first, last).

- * - *

The function cannot alter the properties of the object containing the range of elements (i.e., it cannot - * alter the size of an array or a container): The removal is done by replacing the duplicate elements by the next - * element that is not a duplicate, and signaling the new size of the shortened range by returning an iterator to - * the element that should be considered its new past-the-last element.

- * - *

The relative order of the elements not removed is preserved, while the elements between the returned - * iterator and last are left in a valid but unspecified state.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * - * @return An iterator to the element that follows the last element not removed. The range between first and - * this iterator includes all the elements in the sequence that were not considered duplicates. - */ - function unique>(first: InputIterator, last: InputIterator): InputIterator; - /** - *

Remove consecutive duplicates in range.

- * - *

Removes all but the first element from every consecutive group of equivalent elements in the range - * [first, last).

- * - *

The function cannot alter the properties of the object containing the range of elements (i.e., it cannot - * alter the size of an array or a container): The removal is done by replacing the duplicate elements by the next - * element that is not a duplicate, and signaling the new size of the shortened range by returning an iterator to - * the element that should be considered its new past-the-last element.

- * - *

The relative order of the elements not removed is preserved, while the elements between the returned - * iterator and last are left in a valid but unspecified state.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param pred Binary function that accepts two elements in the range as argument, and returns a value convertible - * to bool. The value returned indicates whether both arguments are considered equivalent - * (if true, they are equivalent and one of them is removed). The function shall not modify - * any of its arguments. - * - * @return An iterator to the element that follows the last element not removed. The range between first and - * this iterator includes all the elements in the sequence that were not considered duplicates. - */ - function unique>(first: InputIterator, last: InputIterator, pred: (left: t, right: t) => boolean): InputIterator; - /** - *

Copy range removing duplicates.

- * - *

Copies the elements in the range [first, last) to the range beginning at result, except - * consecutive duplicates (elements that compare equal to the element preceding).

- * - *

Only the first element from every consecutive group of equivalent elements in the range - * [first, last) is copied.

- * - *

The comparison between elements is performed by applying {@lnk equal_to}.

- * - * @param first {@link Iterator Forward iterator} to the initial position in a sequence. - * @param last {@link Iterator Forward iterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param result Output iterator to the initial position of the range where the resulting range of values is stored. - * The pointed type shall support being assigned the value of an element in the range - * [first, last). - * - * @return An iterator pointing to the end of the copied range, which contains no consecutive duplicates. - */ - function unique_copy, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator): OutputIterator; - /** - *

Copy range removing duplicates.

- * - *

Copies the elements in the range [first, last) to the range beginning at result, except - * consecutive duplicates (elements that compare equal to the element preceding).

- * - *

Only the first element from every consecutive group of equivalent elements in the range - * [first, last) is copied.

- * - *

The comparison between elements is performed by applying pred.

- * - * @param first {@link Iterator Forward iterator} to the initial position in a sequence. - * @param last {@link Iterator Forward iterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param result Output iterator to the initial position of the range where the resulting range of values is stored. - * The pointed type shall support being assigned the value of an element in the range - * [first, last). - * @param pred Binary function that accepts two elements in the range as argument, and returns a value convertible to - * bool. The value returned indicates whether both arguments are considered equivalent (if - * true, they are equivalent and one of them is removed). The function shall not modify any - * of its arguments. - * - * @return An iterator pointing to the end of the copied range, which contains no consecutive duplicates. - */ - function unique_copy, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator, pred: (x: T, y: T) => boolean): OutputIterator; - /** - *

Remove value from range.

- * - *

Transforms the range [first, last) into a range with all the elements that compare equal to - * val removed, and returns an iterator to the new last of that range.

- * - *

The function cannot alter the properties of the object containing the range of elements (i.e., it cannot alter - * the size of an array or a container): The removal is done by replacing the elements that compare equal to - * val by the next element that does not, and signaling the new size of the shortened range by returning an - * iterator to the element that should be considered its new past-the-last element.

- * - *

The relative order of the elements not removed is preserved, while the elements between the returned iterator - * and last are left in a valid but unspecified state.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param val Value to be removed. - */ - function remove>(first: InputIterator, last: InputIterator, val: T): InputIterator; - /** - *

Remove elements from range.

- * - *

Transforms the range [first, last) into a range with all the elements for which pred returns - * true removed, and returns an iterator to the new last of that range.

- * - *

The function cannot alter the properties of the object containing the range of elements (i.e., it cannot - * alter the size of an array or a container): The removal is done by replacing the elements for which pred returns - * true by the next element for which it does not, and signaling the new size of the shortened range - * by returning an iterator to the element that should be considered its new past-the-last element.

- * - *

The relative order of the elements not removed is preserved, while the elements between the returned - * iterator and last are left in a valid but unspecified state.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to - * bool. The value returned indicates whether the element is to be removed (if - * true, it is removed). The function shall not modify its argument. - */ - function remove_if>(first: InputIterator, last: InputIterator, pred: (left: T) => boolean): InputIterator; - /** - *

Copy range removing value.

- * - *

Copies the elements in the range [first, last) to the range beginning at result, except - * those elements that compare equal to val.

- * - *

The resulting range is shorter than [first, last) by as many elements as matches in the sequence, - * which are "removed".

- * - *

The function uses {@link equal_to} to compare the individual elements to val.

- * - * @param first {@link Iterator InputIterator} to the initial position in a sequence. - * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is - * stored. The pointed type shall support being assigned the value of an element in the range - * [first, last). - * @param val Value to be removed. - * - * @return An iterator pointing to the end of the copied range, which includes all the elements in - * [first, last) except those that compare equal to val. - */ - function remove_copy, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator, val: T): OutputIterator; - /** - *

Copy range removing values.

- * - *

Copies the elements in the range [first, last) to the range beginning at result, except - * those elements for which pred returns true.

- * - *

The resulting range is shorter than [first, last) by as many elements as matches, which are - * "removed".

- * - * @param first {@link Iterator InputIterator} to the initial position in a sequence. - * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is - * stored. The pointed type shall support being assigned the value of an element in the range - * [first, last). - * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to - * bool. The value returned indicates whether the element is to be removed from the copy (if - * true, it is not copied). The function shall not modify its argument. - * - * @return An iterator pointing to the end of the copied range, which includes all the elements in - * [first, last) except those for which pred returns true. - */ - function remove_copy_if, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator, pred: (val: T) => boolean): OutputIterator; - /** - *

Replace value in range.

- * - *

Assigns new_val to all the elements in the range [first, last) that compare equal to - * old_val.

- * - *

The function uses {@link equal_to} to compare the individual elements to old_val.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param old_val Value to be replaced. - * @param new_val Replacement value. - */ - function replace>(first: InputIterator, last: InputIterator, old_val: T, new_val: T): void; - /** - *

Replace value in range.

- * - *

Assigns new_val to all the elements in the range [first, last) for which pred returns - * true.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to - * bool. The value returned indicates whether the element is to be replaced (if - * true, it is replaced). The function shall not modify its argument. - * @param new_val Value to assign to replaced elements. - */ - function replace_if>(first: InputIterator, last: InputIterator, pred: (val: T) => boolean, new_val: T): void; - /** - *

Copy range replacing value.

- * - *

Copies the elements in the range [first, last) to the range beginning at result, replacing - * the appearances of old_value by new_value.

- * - *

The function uses {@link std.equal_to} to compare the individual elements to old_value.

- * - *

The ranges shall not overlap in such a way that result points to an element in the range - * [first, last).

- * - * @param first {@link Iterator InputIterator} to the initial position in a sequence. - * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is - * stored. The pointed type shall support being assigned the value of an element in the range - * [first, last). - * @param old_val Value to be replaced. - * @param new_val Replacement value. - * - * @return An iterator pointing to the element that follows the last element written in the result sequence. - */ - function replace_copy, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator, old_val: T, new_val: T): OutputIterator; - /** - *

Copy range replacing value.

- * - *

Copies the elements in the range [first, last) to the range beginning at result, replacing - * those for which pred returns true by new_value.

- * - * @param first {@link Iterator InputIterator} to the initial position in a sequence. - * @param last {@link Iterator InputIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is - * stored. The pointed type shall support being assigned the value of an element in the range - * [first, last). - * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to - * bool. The value returned indicates whether the element is to be removed from the copy (if - * true, it is not copied). The function shall not modify its argument. - * @param new_val Value to assign to replaced values. - * - * @return An iterator pointing to the element that follows the last element written in the result sequence. - */ - function replace_copy_if, OutputIterator extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result: OutputIterator, pred: (val: T) => boolean, new_val: T): OutputIterator; - /** - *

Exchange values of objects pointed to by two iterators.

- * - *

Swaps the elements pointed to by x and y.

- * - *

The function calls {@link Iterator.swap} to exchange the elements.

- * - * @param x {@link Iterator Forward iterator} to the objects to swap. - * @param y {@link Iterator Forward iterator} to the objects to swap. - */ - function iter_swap(x: Iterator, y: Iterator): void; - /** - *

Exchange values of two ranges.

- * - *

Exchanges the values of each of the elements in the range [first1, last1) with those of their - * respective elements in the range beginning at first2.

- * - *

The function calls {@link Iterator.swap} to exchange the elements.

- * - * @param first1 {@link Iterator Forward iterator} to the initial position of the first sequence. - * @param last1 {@link Iterator Forward iterator} to the final position of the first sequence. The range used is - * [first1, last1), including the element pointed by first1, but not the element - * pointed by last1. - * @param first2 {@link Iterator Forward iterator} to the initial position of the second range. The range includes as - * many elements as [first1, last1). The two ranges shall not overlap. - * - * @return An iterator to the last element swapped in the second sequence. - */ - function swap_ranges, ForwardIterator2 extends Iterator>(first1: ForwardIterator1, last1: ForwardIterator1, first2: ForwardIterator2): ForwardIterator2; - /** - *

Reverse range.

- * - *

Reverses the order of the elements in the range [first, last).

- * - *

The function calls {@link iter_swap} to swap the elements to their new locations.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - */ - function reverse>(first: InputIterator, last: InputIterator): void; - /** - *

Copy range reversed.

- * - *

Copies the elements in the range [first, last) to the range beginning at result, but in - * reverse order.

- * - * @param first {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied. - * @param last {@link Iterator Bidirectional iterator} to the initial position in a sequence to be copied. The range - * used is [first, last), which contains all the elements between first and - * last, including the element pointed by first but not the element pointed by last. - * @param result {@link Iterator Output iterator} to the initial position of the range where the reserved range is - * stored. The pointed type shall support being assigned the value of an element in the range - * [first, last). - * - * @return An output iterator pointing to the end of the copied range, which contains the same elements in reverse - * order. - */ - function reverse_copy, OutputIterator extends base.ILinearIterator>(first: BidirectionalIterator, last: BidirectionalIterator, result: OutputIterator): OutputIterator; - /** - *

Rotate left the elements in range.

- * - *

Rotates the order of the elements in the range [first, last), in such a way that the element - * pointed by middle becomes the new first element.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param middle An {@link Iterator} pointing to the element within the range [first, last) that is - * moved to the first position in the range. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * - * @return An iterator pointing to the element that now contains the value previously pointed by first. - */ - function rotate>(first: InputIterator, middle: InputIterator, last: InputIterator): InputIterator; - /** - *

Copy range rotated left.

- * - *

Copies the elements in the range [first, last) to the range beginning at result, but - * rotating the order of the elements in such a way that the element pointed by middle becomes the first - * element in the resulting range.

- * - * @param first {@link Iterator Forward iterator} to the initial position of the range to be copy-rotated. - * @param middle Forward iterator pointing to the element within the range [first, last) that is copied as the first element in the resulting range. - * @param last {@link Iterator Forward iterator} to the final positions of the range to be copy-rotated. The range - * used is [first, last), which contains all the elements between first and - * last, including the element pointed by first but not the element pointed by last. - * Notice that in this function, these are not consecutive parameters, but the first and third ones. - * @param result {@link Iterator Output iterator} to the initial position of the range where the reserved range is - * stored. The pointed type shall support being assigned the value of an element in the range - * [first, last). - * - * @return An output iterator pointing to the end of the copied range. - */ - function rotate_copy, OutputIterator extends base.ILinearIterator>(first: ForwardIterator, middle: ForwardIterator, last: ForwardIterator, result: OutputIterator): OutputIterator; - /** - *

Randomly rearrange elements in range.

- * - *

Rearranges the elements in the range [first, last) randomly.

- * - *

The function swaps the value of each element with that of some other randomly picked element. When provided, - * the function gen determines which element is picked in every case. Otherwise, the function uses some unspecified - * source of randomness.

- * - *

To specify a uniform random generator, see {@link shuffle}.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - */ - function random_shuffle>(first: RandomAccessIterator, last: RandomAccessIterator): void; - /** - *

Randomly rearrange elements in range using generator.

- * - *

Rearranges the elements in the range [first, last) randomly, using g as uniform random - * number generator.

- * - *

The function swaps the value of each element with that of some other randomly picked element. The function - * determines the element picked by calling g().

- * - *

To shuffle the elements of the range without such a generator, see {@link random_shuffle} instead.

- * - *
Note
- *

Using random generator engine is not implemented yet.

- * - * @param first An {@link Iterator} to the initial position in a sequence. - * @param last An {@link Iterator} to the final position in a sequence. The range used is [first, last), - * which contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - */ - function shuffle>(first: RandomAccessIterator, last: RandomAccessIterator): void; -} -declare namespace std { - /** - *

Sort elements in range.

- * - *

Sorts the elements in the range [first, last) into ascending order. The elements are compared - * using {@link less}.

- * - * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be sorted. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. - * The range used is [first, last), which contains all the elements between first - * and last, including the element pointed by first but not the element pointed by - * last. {@link IArrayIterator RandomAccessIterator} shall point to a type for which - * {@link Iterator.swap swap} is properly defined. - */ - function sort>(first: RandomAccessIterator, last: RandomAccessIterator): void; - /** - *

Sort elements in range.

- * - *

Sorts the elements in the range [first, last) into specific order. The elements are compared - * using compare.

- * - * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be sorted. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. - * The range used is [first, last), which contains all the elements between first - * and last, including the element pointed by first but not the element pointed by - * last. {@link IArrayIterator RandomAccessIterator} shall point to a type for which - * {@link Iterator.swap swap} is properly defined. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value - * convertible to boolean. The value returned indicates whether the element passed as first - * argument is considered to go before the second in the specific strict weak ordering it defines. The - * function shall not modify any of its arguments. This can either be a function pointer or a function - * object. - */ - function sort>(first: RandomAccessIterator, last: RandomAccessIterator, compare: (left: T, right: T) => boolean): void; - /** - *

Partially sort elements in range.

- * - *

Rearranges the elements in the range [first, last), in such a way that the elements before - * middle are the smallest elements in the entire range and are sorted in ascending order, while the remaining - * elements are left without any specific order.

- * - *

The elements are compared using {@link less}.

- * - * @param last {@link IArrayIterator Random-access iterator} to the first position of the sequence to be sorted. - * @param middle {@link IArrayIterator Random-access iterator} pointing to the element within the range [first, last) that is used as the upper boundary of the elements that are fully sorted. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. - * The range used is [first, last), which contains all the elements between first - * and last, including the element pointed by first but not the element pointed by - * last. - */ - function partial_sort>(first: RandomAccessIterator, middle: RandomAccessIterator, last: RandomAccessIterator): void; - /** - *

Partially sort elements in range.

- * - *

Rearranges the elements in the range [first, last), in such a way that the elements before - * middle are the smallest elements in the entire range and are sorted in ascending order, while the remaining - * elements are left without any specific order.

- * - *

The elements are compared using comp.

- * - * @param last {@link IArrayIterator Random-access iterator} to the first position of the sequence to be sorted. - * @param middle {@link IArrayIterator Random-access iterator} pointing to the element within the range [first, last) that is used as the upper boundary of the elements that are fully sorted. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. - * The range used is [first, last), which contains all the elements between first - * and last, including the element pointed by first but not the element pointed by - * last. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value - * convertible to boolean. The value returned indicates whether the element passed as - * first argument is considered to go before the second in the specific strict weak ordering it - * defines. The function shall not modify any of its arguments. - */ - function partial_sort>(first: RandomAccessIterator, middle: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): void; - /** - *

Copy and partially sort range.

- * - *

Copies the smallest elements in the range [first, last) to - * [result_first, result_last), sorting the elements copied. The number of elements copied is the same - * as the {@link distance} between result_first and result_last (unless this is more than the amount of - * elements in [first, last)).

- * - *

The range [first, last) is not modified.

- * - *

The elements are compared using {@link less}.

- * - * @param first {@link Iterator Input iterator} to the initial position of the sequence to copy from. - * @param last {@link Iterator Input iterator} to the final position of the sequence to copy from. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * InputIterator shall point to a type assignable to the elements pointed by - * RandomAccessIterator. - * @param result_first {@link Iterator Random-access iterator} to the initial position of the destination sequence. - * @param result_last {@link Iterator Random-access iterator} to the final position of the destination sequence. - * The range used is [result_first, result_last). - * @param compare Binary function that accepts two elements in the result range as arguments, and returns a value - * convertible to bool. The value returned indicates whether the element passed as first - * argument is considered to go before the second in the specific strict weak ordering it - * defines. The function shall not modify any of its arguments. - * - * @return An iterator pointing to the element that follows the last element written in the result sequence. - */ - function partial_sort_copy, RandomAccessIterator extends Iterator>(first: InputIterator, last: InputIterator, result_first: RandomAccessIterator, result_last: RandomAccessIterator): RandomAccessIterator; - /** - *

Copy and partially sort range.

- * - *

Copies the smallest (or largest) elements in the range [first, last) to - * [result_first, result_last), sorting the elements copied. The number of elements copied is the same - * as the {@link distance} between result_first and result_last (unless this is more than the amount of - * elements in [first, last)).

- * - *

The range [first, last) is not modified.

- * - *

The elements are compared using compare.

- * - * @param first {@link Iterator Input iterator} to the initial position of the sequence to copy from. - * @param last {@link Iterator Input iterator} to the final position of the sequence to copy from. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * InputIterator shall point to a type assignable to the elements pointed by - * RandomAccessIterator. - * @param result_first {@link Iterator Random-access iterator} to the initial position of the destination sequence. - * @param result_last {@link Iterator Random-access iterator} to the final position of the destination sequence. - * The range used is [result_first, result_last). - * @param compare Binary function that accepts two elements in the result range as arguments, and returns a value - * convertible to bool. The value returned indicates whether the element passed as first - * argument is considered to go before the second in the specific strict weak ordering it - * defines. The function shall not modify any of its arguments. - * - * @return An iterator pointing to the element that follows the last element written in the result sequence. - */ - function partial_sort_copy, RandomAccessIterator extends Iterator>(first: InputIterator, last: InputIterator, result_first: RandomAccessIterator, result_last: RandomAccessIterator, compare: (x: T, y: T) => boolean): RandomAccessIterator; - /** - *

Check whether range is sorted.

- * - *

Returns true if the range [first, last) is sorted into ascending order.

- * - *

The elements are compared using {@link less}.

- * - * @param first {@link Iterator Forward iterator} to the initial position of the sequence. - * @param last {@link Iterator Forward iterator} to the final position of the sequence. The range checked is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * - * @return true if the range [first, last) is sorted into ascending order, - * false otherwise. If the range [first, last) contains less than two elements, - * the function always returns true. - */ - function is_sorted>(first: ForwardIterator, last: ForwardIterator): boolean; - /** - *

Check whether range is sorted.

- * - *

Returns true if the range [first, last) is sorted into ascending order.

- * - *

The elements are compared using compare.

- * - * @param first {@link Iterator Forward iterator} to the initial position of the sequence. - * @param last {@link Iterator Forward iterator} to the final position of the sequence. The range checked is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value convertible - * to bool. The value returned indicates whether the element passed as first argument is - * considered to go before the second in the specific strict weak ordering it defines. The function - * shall not modify any of its arguments. - * - * @return true if the range [first, last) is sorted into ascending order, - * false otherwise. If the range [first, last) contains less than two elements, - * the function always returns true. - */ - function is_sorted>(first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): boolean; - /** - *

Find first unsorted element in range.

- * - *

Returns an iterator to the first element in the range [first, last) which does not follow an - * ascending order.

- * - *

The range between first and the iterator returned {@link is_sorted is sorted}.

- * - *

If the entire range is sorted, the function returns last.

- * - *

The elements are compared using {@link equal_to}.

- * - * @param first {@link Iterator Forward iterator} to the initial position of the sequence. - * @param last {@link Iterator Forward iterator} to the final position of the sequence. The range checked is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value convertible - * to bool. The value returned indicates whether the element passed as first argument is - * considered to go before the second in the specific strict weak ordering it defines. The function - * shall not modify any of its arguments. - * - * @return An iterator to the first element in the range which does not follow an ascending order, or last if - * all elements are sorted or if the range contains less than two elements. - */ - function is_sorted_until>(first: ForwardIterator, last: ForwardIterator): ForwardIterator; - /** - *

Find first unsorted element in range.

- * - *

Returns an iterator to the first element in the range [first, last) which does not follow an - * ascending order.

- * - *

The range between first and the iterator returned {@link is_sorted is sorted}.

- * - *

If the entire range is sorted, the function returns last.

- * - *

The elements are compared using compare.

- * - * @param first {@link Iterator Forward iterator} to the initial position of the sequence. - * @param last {@link Iterator Forward iterator} to the final position of the sequence. The range checked is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value convertible - * to bool. The value returned indicates whether the element passed as first argument is - * considered to go before the second in the specific strict weak ordering it defines. The function - * shall not modify any of its arguments. - * - * @return An iterator to the first element in the range which does not follow an ascending order, or last if - * all elements are sorted or if the range contains less than two elements. - */ - function is_sorted_until>(first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): ForwardIterator; -} -declare namespace std { - /** - *

Make heap from range.

- * - *

Rearranges the elements in the range [first, last) in such a way that they form a heap.

- * - *

A heap is a way to organize the elements of a range that allows for fast retrieval of the element with the - * highest value at any moment (with {@link pop_heap}), even repeatedly, while allowing for fast insertion of new - * elements (with {@link push_heap}).

- * - *

The element with the highest value is always pointed by first. The order of the other elements depends on the - * particular implementation, but it is consistent throughout all heap-related functions of this header.

- * - *

The elements are compared using {@link less}: The element with the highest value is an element for which this - * would return false when compared to every other element in the range.

- * - *

The standard container adaptor {@link PriorityQueue} calls {@link make_heap}, {@link push_heap} and - * {@link pop_heap} automatically to maintain heap properties for a container.

- * - * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be - * transformed into a heap. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be transformed - * into a heap. The range used is [first, last), which contains all the elements between - * first and last, including the element pointed by first but not the element pointed - * by last. {@link IArrayIterator RandomAccessIterator} shall point to a type for which - * {@link Iterator.swap swap} is properly defined. - */ - function make_heap>(first: RandomAccessIterator, last: RandomAccessIterator): void; - /** - *

Make heap from range.

- * - *

Rearranges the elements in the range [first, last) in such a way that they form a heap.

- * - *

A heap is a way to organize the elements of a range that allows for fast retrieval of the element with the - * highest value at any moment (with {@link pop_heap}), even repeatedly, while allowing for fast insertion of new - * elements (with {@link push_heap}).

- * - *

The element with the highest value is always pointed by first. The order of the other elements depends on the - * particular implementation, but it is consistent throughout all heap-related functions of this header.

- * - *

The elements are compared using compare: The element with the highest value is an element for which this - * would return false when compared to every other element in the range.

- * - *

The standard container adaptor {@link PriorityQueue} calls {@link make_heap}, {@link push_heap} and - * {@link pop_heap} automatically to maintain heap properties for a container.

- * - * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be - * transformed into a heap. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be transformed - * into a heap. The range used is [first, last), which contains all the elements between - * first and last, including the element pointed by first but not the element pointed - * by last. {@link IArrayIterator RandomAccessIterator} shall point to a type for which - * {@link Iterator.swap swap} is properly defined. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value - * convertible to boolean. The value returned indicates whether the element passed as - * first argument is considered to go before the second in the specific strict weak ordering it defines. - * The function shall not modify any of its arguments. This can either be a function pointer or a - * function object. - */ - function make_heap>(first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): void; - /** - *

Push element into heap range.

- * - *

Given a heap in the range [first, last - 1), this function extends the range considered a heap to - * [first, last) by placing the value in (last - 1) into its corresponding location within it. - *

- * - *

A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are - * preserved if elements are added and removed from it using {@link push_heap} and {@link pop_heap}, respectively. - *

- * - * @param first {@link IArrayIterator Random-access iterator} to the initial position of the new heap range, including - * the pushed element. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the new heap range, including - * the pushed element. The range used is [first, last), which contains all the elements - * between first and last, including the element pointed by first but not the element - * pointed by last. {@link IArrayIterator RandomAccessIterator} shall point to a type for which - * {@link Iterator.swap swap} is properly defined. - */ - function push_heap>(first: RandomAccessIterator, last: RandomAccessIterator): void; - /** - *

Push element into heap range.

- * - *

Given a heap in the range [first, last - 1), this function extends the range considered a heap to - * [first, last) by placing the value in (last - 1) into its corresponding location within it. - *

- * - *

A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are - * preserved if elements are added and removed from it using {@link push_heap} and {@link pop_heap}, respectively. - *

- * - * @param first {@link IArrayIterator Random-access iterator} to the initial position of the new heap range, including - * the pushed element. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the new heap range, including - * the pushed element. The range used is [first, last), which contains all the elements - * between first and last, including the element pointed by first but not the element - * pointed by last. {@link IArrayIterator RandomAccessIterator} shall point to a type for which - * {@link Iterator.swap swap} is properly defined. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value - * convertible to boolean. The value returned indicates whether the element passed as - * first argument is considered to go before the second in the specific strict weak ordering it defines. - * The function shall not modify any of its arguments. This can either be a function pointer or a - * function object. - */ - function push_heap>(first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): void; - /** - *

Pop element from heap range.

- * - *

Rearranges the elements in the heap range [first, last) in such a way that the part considered a - * heap is shortened by one: The element with the highest value is moved to (last - 1).

- * - *

While the element with the highest value is moved from first to (last - 1) (which now is out of the - * heap), the other elements are reorganized in such a way that the range [first, last - 1) preserves - * the properties of a heap.

- * - *

A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are - * preserved if elements are added and removed from it using {@link push_heap} and {@link pop_heap}, respectively. - *

- * - * @param first {@link IArrayIterator Random-access iterator} to the initial position of the heap to be shrank by one. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the heap to be shrank by one. - * The range used is [first, last), which contains all the elements between first and - * last, including the element pointed by first but not the element pointed by last. - * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} - * is properly defined. - */ - function pop_heap>(first: RandomAccessIterator, last: RandomAccessIterator): void; - /** - *

Pop element from heap range.

- * - *

Rearranges the elements in the heap range [first, last) in such a way that the part considered a - * heap is shortened by one: The element with the highest value is moved to (last - 1).

- * - *

While the element with the highest value is moved from first to (last - 1) (which now is out of the - * heap), the other elements are reorganized in such a way that the range [first, last - 1) preserves - * the properties of a heap.

- * - *

A range can be organized into a heap by calling {@link make_heap}. After that, its heap properties are - * preserved if elements are added and removed from it using {@link push_heap} and {@link pop_heap}, respectively. - *

- * - * @param first {@link IArrayIterator Random-access iterator} to the initial position of the heap to be shrank by one. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the heap to be shrank by one. - * The range used is [first, last), which contains all the elements between first and - * last, including the element pointed by first but not the element pointed by last. - * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} - * is properly defined. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value - * convertible to boolean. The value returned indicates whether the element passed as - * first argument is considered to go before the second in the specific strict weak ordering it defines. - * The function shall not modify any of its arguments. This can either be a function pointer or a - * function object. - */ - function pop_heap>(first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): void; - /** - *

Test if range is heap.

- * - *

Returns true if the range [first, last) forms a heap, as if constructed with {@link make_heap}. - *

- * - *

The elements are compared using {@link less}.

- * - * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} - * is properly defined. - * - * @return true if the range [first, last) is a heap (as if constructed with - * {@link make_heap}), false otherwise. If the range [first, last) contains less - * than two elements, the function always returns true. - */ - function is_heap>(first: RandomAccessIterator, last: RandomAccessIterator): boolean; - /** - *

Test if range is heap.

- * - *

Returns true if the range [first, last) forms a heap, as if constructed with {@link make_heap}. - *

- * - *

The elements are compared using compare.

- * - * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} - * is properly defined. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value - * convertible to boolean. The value returned indicates whether the element passed as - * first argument is considered to go before the second in the specific strict weak ordering it defines. - * The function shall not modify any of its arguments. This can either be a function pointer or a - * function object. - * - * @return true if the range [first, last) is a heap (as if constructed with - * {@link make_heap}), false otherwise. If the range [first, last) contains less - * than two elements, the function always returns true. - */ - function is_heap>(first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): boolean; - /** - *

Find first element not in heap order.

- * - *

Returns an iterator to the first element in the range [first, last) which is not in a valid - * position if the range is considered a heap (as if constructed with {@link make_heap}).

- * - *

The range between first and the iterator returned is a heap.

- * - *

If the entire range is a valid heap, the function returns last.

- * - *

The elements are compared using {@link less}.

- * - * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} - * is properly defined. - */ - function is_heap_until>(first: RandomAccessIterator, last: RandomAccessIterator): RandomAccessIterator; - /** - *

Find first element not in heap order.

- * - *

Returns an iterator to the first element in the range [first, last) which is not in a valid - * position if the range is considered a heap (as if constructed with {@link make_heap}).

- * - *

The range between first and the iterator returned is a heap.

- * - *

If the entire range is a valid heap, the function returns last.

- * - *

The elements are compared using {@link less}.

- * - * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} - * is properly defined. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value - * convertible to boolean. The value returned indicates whether the element passed as - * first argument is considered to go before the second in the specific strict weak ordering it defines. - * The function shall not modify any of its arguments. This can either be a function pointer or a - * function object. - */ - function is_heap_until>(first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): RandomAccessIterator; - /** - *

Sort elements of heap.

- * - *

Sorts the elements in the heap range [first, last) into ascending order.

- * - *

The elements are compared using {@link less}, which shall be the same as used to construct the heap.

- * - *

The range loses its properties as a heap.

- * - * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be sorted. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. - * The range used is [first, last), which contains all the elements between first and - * last, including the element pointed by first but not the element pointed by last. - * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} - * is properly defined. - */ - function sort_heap>(first: RandomAccessIterator, last: RandomAccessIterator): void; - /** - *

Sort elements of heap.

- * - *

Sorts the elements in the heap range [first, last) into ascending order.

- * - *

The elements are compared using compare, which shall be the same as used to construct the heap.

- * - *

The range loses its properties as a heap.

- * - * @param first {@link IArrayIterator Random-access iterator} to the initial position of the sequence to be sorted. - * @param last {@link IArrayIterator Random-access iterator} to the final position of the sequence to be sorted. - * The range used is [first, last), which contains all the elements between first and - * last, including the element pointed by first but not the element pointed by last. - * {@link IArrayIterator RandomAccessIterator} shall point to a type for which {@link Iterator.swap swap} - * is properly defined. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value - * convertible to boolean. The value returned indicates whether the element passed as - * first argument is considered to go before the second in the specific strict weak ordering it defines. - * The function shall not modify any of its arguments. This can either be a function pointer or a - * function object. - */ - function sort_heap>(first: RandomAccessIterator, last: RandomAccessIterator, compare: (x: T, y: T) => boolean): void; -} -declare namespace std { - /** - *

Return iterator to lower bound.

- * - *

Returns an iterator pointing to the first element in the range [first, last) which does not - * compare less than val.

- * - *

The elements are compared using {@link less}. The elements in the range shall already be {@link is_sorted sorted} - * according to this same criterion ({@link less}), or at least {@link is_partitioned partitioned} with respect to - * val.

- * - *

The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted - * range, which is specially efficient for {@link IArrayIterator random-access iterators}.

- * - *

Unlike {@link upper_bound}, the value pointed by the iterator returned by this function may also be equivalent - * to val, and not only greater.

- * - * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. - * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which - * contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param val Value of the lower bound to search for in the range. T shall be a type supporting being compared - * with elements of the range [first, last) as the left-hand side operand of {@link less}. - * - * @return An iterator to the lower bound of val in the range. If all the element in the range compare less than - * val, the function returns last. - */ - function lower_bound>(first: ForwardIterator, last: ForwardIterator, val: T): ForwardIterator; - /** - *

Return iterator to lower bound.

- * - *

Returns an iterator pointing to the first element in the range [first, last) which does not - * compare less than val.

- * - *

The elements are compared using compare. The elements in the range shall already be - * {@link is_sorted sorted} according to this same criterion (compare), or at least - * {@link is_partitioned partitioned} with respect to val.

- * - *

The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted - * range, which is specially efficient for {@link IArrayIterator random-access iterators}.

- * - *

Unlike {@link upper_bound}, the value pointed by the iterator returned by this function may also be equivalent - * to val, and not only greater.

- * - * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. - * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which - * contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param val Value of the lower bound to search for in the range. - * @param compare Binary function that accepts two arguments (the first of the type pointed by ForwardIterator, - * and the second, always val), and returns a value convertible to bool. The value - * returned indicates whether the first argument is considered to go before the second. The function - * shall not modify any of its arguments. - * - * @return An iterator to the lower bound of val in the range. If all the element in the range compare less than - * val, the function returns last. - */ - function lower_bound>(first: ForwardIterator, last: ForwardIterator, val: T, compare: (x: T, y: T) => boolean): ForwardIterator; - /** - *

Return iterator to upper bound.

- * - *

Returns an iterator pointing to the first element in the range [first, last) which compares - * greater than val.

- * - *

The elements are compared using {@link less}. The elements in the range shall already be {@link is_sorted sorted} - * according to this same criterion ({@link less}), or at least {@link is_partitioned partitioned} with respect to - * val.

- * - *

The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted - * range, which is specially efficient for {@link IArrayIterator random-access iterators}.

- * - *

Unlike {@link lower_bound}, the value pointed by the iterator returned by this function cannot be equivalent to - * val, only greater.

- * - * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. - * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which - * contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param val Value of the lower bound to search for in the range. T shall be a type supporting being compared - * with elements of the range [first, last) as the left-hand side operand of {@link less}. - * - * @return An iterator to the upper bound of val in the range. If no element in the range comparse greater than - * val, the function returns last. - */ - function upper_bound>(first: ForwardIterator, last: ForwardIterator, val: T): ForwardIterator; - /** - *

Return iterator to upper bound.

- * - *

Returns an iterator pointing to the first element in the range [first, last) which compares - * greater than val.

- * - *

The elements are compared using compare. The elements in the range shall already be - * {@link is_sorted sorted} according to this same criterion (compare), or at least - * {@link is_partitioned partitioned} with respect to val.

- * - *

The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted - * range, which is specially efficient for {@link IArrayIterator random-access iterators}.

- * - *

Unlike {@link lower_bound}, the value pointed by the iterator returned by this function cannot be equivalent to - * val, only greater.

- * - * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. - * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which - * contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param val Value of the lower bound to search for in the range. - * @param compare Binary function that accepts two arguments (the first of the type pointed by ForwardIterator, - * and the second, always val), and returns a value convertible to bool. The value - * returned indicates whether the first argument is considered to go before the second. The function - * shall not modify any of its arguments. - * - * @return An iterator to the upper bound of val in the range. If no element in the range comparse greater than - * val, the function returns last. - */ - function upper_bound>(first: ForwardIterator, last: ForwardIterator, val: T, compare: (x: T, y: T) => boolean): ForwardIterator; - /** - *

Get subrange of equal elements.

- * - *

Returns the bounds of the subrange that includes all the elements of the range [first, last) with - * values equivalent to val.

- * - *

The elements are compared using {@link less}. Two elements, ax/i> and y are considered equivalent - * if (!std.less(x, y) && !std.less(y, x)).

- * - *

The elements in the range shall already be {@link is_sorted sorted} according to this same criterion - * ({@link less}), or at least {@link is_partitioned partitioned} with respect to val.

- * - *

If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both - * iterators pointing to the nearest value greater than val, if any, or to last, if val compares - * greater than all the elements in the range.

- * - * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. - * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which - * contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param val Value of the lower bound to search for in the range. T shall be a type supporting being compared - * with elements of the range [first, last) as the left-hand side operand of {@link less}. - * - * @return A {@link Pair} object, whose member {@link Pair.first} is an iterator to the lower bound of the subrange of - * equivalent values, and {@link Pair.second} its upper bound. The values are the same as those that would be - * returned by functions {@link lower_bound} and {@link upper_bound} respectively. - */ - function equal_range>(first: ForwardIterator, last: ForwardIterator, val: T): Pair; - /** - *

Get subrange of equal elements.

- * - *

Returns the bounds of the subrange that includes all the elements of the range [first, last) with - * values equivalent to val.

- * - *

The elements are compared using compare. Two elements, ax/i> and y are considered equivalent - * if (!compare(x, y) && !compare(y, x)).

- * - *

The elements in the range shall already be {@link is_sorted sorted} according to this same criterion - * (compare), or at least {@link is_partitioned partitioned} with respect to val.

- * - *

If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both - * iterators pointing to the nearest value greater than val, if any, or to last, if val compares - * greater than all the elements in the range.

- * - * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. - * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which - * contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param val Value of the lower bound to search for in the range. - * @param compare Binary function that accepts two arguments of the type pointed by ForwardIterator (and of type - * T), and returns a value convertible to bool. The value returned indicates whether - * the first argument is considered to go before the second. The function shall not modify any of its - * arguments. - * - * @return A {@link Pair} object, whose member {@link Pair.first} is an iterator to the lower bound of the subrange of - * equivalent values, and {@link Pair.second} its upper bound. The values are the same as those that would be - * returned by functions {@link lower_bound} and {@link upper_bound} respectively. - */ - function equal_range>(first: ForwardIterator, last: ForwardIterator, val: T, compare: (x: T, y: T) => boolean): Pair; - /** - *

Get subrange of equal elements.

- * - *

Returns the bounds of the subrange that includes all the elements of the range [first, last) with - * values equivalent to val.

- * - *

The elements are compared using {@link less}. Two elements, x and y are considered equivalent - * if (!std.less(x, y) && !std.less(y, x)).

- * - *

The elements in the range shall already be {@link is_sorted sorted} according to this same criterion - * ({@link less}), or at least {@link is_partitioned partitioned} with respect to val.

- * - *

If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both - * iterators pointing to the nearest value greater than val, if any, or to last, if val compares - * greater than all the elements in the range.

- * - * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. - * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which - * contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param val Value of the lower bound to search for in the range. T shall be a type supporting being compared - * with elements of the range [first, last) as the left-hand side operand of {@link less}. - * - * @return true if an element equivalent to val is found, and false otherwise. - */ - function binary_search>(first: ForwardIterator, last: ForwardIterator, val: T): boolean; - /** - *

Get subrange of equal elements.

- * - *

Returns the bounds of the subrange that includes all the elements of the range [first, last) with - * values equivalent to val.

- * - *

The elements are compared using {compare}. Two elements, x and y are considered equivalent - * if (!compare(x, y) && !compare(y, x)).

- * - *

The elements in the range shall already be {@link is_sorted sorted} according to this same criterion - * (compare), or at least {@link is_partitioned partitioned} with respect to val.

- * - *

If val is not equivalent to any value in the range, the subrange returned has a length of zero, with both - * iterators pointing to the nearest value greater than val, if any, or to last, if val compares - * greater than all the elements in the range.

- * - * @param first {@link Iterator Forward iterator} to the initial position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. - * @param last {@link Iterator Forward iterator} to the final position of a {@link is_sorted sorted} (or properly - * {@link is_partitioned partitioned}) sequence. The range used is [first, last), which - * contains all the elements between first and last, including the element pointed by - * first but not the element pointed by last. - * @param val Value of the lower bound to search for in the range. - * @param compare Binary function that accepts two arguments of the type pointed by ForwardIterator (and of type - * T), and returns a value convertible to bool. The value returned indicates whether - * the first argument is considered to go before the second. The function shall not modify any of its - * arguments. - * - * @return true if an element equivalent to val is found, and false otherwise. - */ - function binary_search>(first: ForwardIterator, last: ForwardIterator, val: T, compare: (x: T, y: T) => boolean): boolean; -} -declare namespace std { - /** - *

Test whether range is partitioned.

- * - *

Returns true if all the elements in the range [first, last) for which pred - * returns true precede those for which it returns false.

- * - *

If the range is {@link IContainer.empty empty}, the function returns true.

- * - * @param first {@link Iterator Input iterator} to the initial position of the sequence. - * @param last {@link Iterator Input iterator} to the final position of the sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to - * bool. The value returned indicates whether the element belongs to the first group (if - * true, the element is expected before all the elements for which it returns - * false). The function shall not modify its argument. - * - * @return true if all the elements in the range [first, last) for which pred returns - * true precede those for which it returns false. Otherwise it returns - * false. If the range is {@link IContainer.empty empty}, the function returns true. - */ - function is_partitioned>(first: InputIterator, last: InputIterator, pred: (x: T) => boolean): boolean; - /** - *

Partition range in two.

- * - *

Rearranges the elements from the range [first, last), in such a way that all the elements for - * which pred returns true precede all those for which it returns false. The iterator - * returned points to the first element of the second group.

- * - *

The relative ordering within each group is not necessarily the same as before the call. See - * {@link stable_partition} for a function with a similar behavior but with stable ordering within each group.

- * - * @param first {@link Iterator Forward iterator} to the initial position of the sequence to partition. - * @param last {@link Iterator Forward iterator} to the final position of the sequence to partition. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to - * bool. The value returned indicates whether the element belongs to the first group (if - * true, the element is expected before all the elements for which it returns - * false). The function shall not modify its argument. - * - * @return An iterator that points to the first element of the second group of elements (those for which pred - * returns false), or last if this group is {@link IContainer.empty empty}. - */ - function partition>(first: BidirectionalIterator, last: BidirectionalIterator, pred: (x: T) => boolean): BidirectionalIterator; - /** - *

Partition range in two - stable ordering.

- * - *

Rearranges the elements in the range [first, last), in such a way that all the elements for which - * pred returns true precede all those for which it returns false, and, unlike - * function {@link partition}, the relative order of elements within each group is preserved.

- * - *

This is generally implemented using an internal temporary buffer.

- * - * @param first {@link Iterator Bidirectional iterator} to the initial position of the sequence to partition. - * @param last {@link Iterator Bidirectional iterator} to the final position of the sequence to partition. The range - * used is [first, last), which contains all the elements between first and - * last, including the element pointed by first but not the element pointed by last. - * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to - * bool. The value returned indicates whether the element belongs to the first group (if - * true, the element is expected before all the elements for which it returns - * false). The function shall not modify its argument. - * - * @return An iterator that points to the first element of the second group of elements (those for which pred - * returns false), or last if this group is {@link IContainer.empty empty}. - */ - function stable_partition>(first: BidirectionalIterator, last: BidirectionalIterator, pred: (x: T) => boolean): BidirectionalIterator; - /** - *

Partition range into two.

- * - *

Copies the elements in the range [first, last) for which pred returns true - * into the range pointed by result_true, and those for which it does not into the range pointed by - * result_false.

- * - * @param first {@link Iterator Input iterator} to the initial position of the range to be copy-partitioned. - * @param last {@link Iterator Input iterator} to the final position of the range to be copy-partitioned. The range - * used is [first, last), which contains all the elements between first and - * last, including the element pointed by first but not the element pointed by last. - * @param result_true {@link Iterator Output iterator} to the initial position of the range where the elements for - * which pred returns true are stored. - * @param result_false {@link Iterator Output iterator} to the initial position of the range where the elements for - * which pred returns false are stored. - * @param pred Unary function that accepts an element pointed by InputIterator as argument, and returns a value - * convertible to bool. The value returned indicates on which result range the element is - * copied. The function shall not modify its argument. - * - * @return A {@link Pair} of iterators with the end of the generated sequences pointed by result_true and - * result_false, respectivelly. Its member {@link Pair.first first} points to the element that follows - * the last element copied to the sequence of elements for which pred returned true. Its - * member {@link Pair.second second} points to the element that follows the last element copied to the sequence - * of elements for which pred returned false. - */ - function partition_copy, OutputIterator1 extends base.ILinearIterator, OutputIterator2 extends base.ILinearIterator>(first: InputIterator, last: InputIterator, result_true: OutputIterator1, result_false: OutputIterator2, pred: (val: T) => T): Pair; - /** - *

Get partition point.

- * - *

Returns an iterator to the first element in the partitioned range [first, last) for which - * pred is not true, indicating its partition point.

- * - *

The elements in the range shall already {@link is_partitioned be partitioned}, as if {@link partition} had been - * called with the same arguments.

- * - *

The function optimizes the number of comparisons performed by comparing non-consecutive elements of the sorted - * range, which is specially efficient for {@link Iteartor random-access iterators}.

- * - * @param first {@link Iterator Forward iterator} to the initial position of the partitioned sequence. - * @param last {@link Iterator Forward iterator} to the final position of the partitioned sequence. The range checked - * is [first, last), which contains all the elements between first an last, - * including the element pointed by first but not the element pointed by last. - * @param pred Unary function that accepts an element in the range as argument, and returns a value convertible to - * bool. The value returned indicates whether the element goes before the partition point (if - * true, it goes before; if false goes at or after it). The function shall not - * modify its argument. - * - * @return An iterator to the first element in the partitioned range [first, last) for which pred - * is not true, or last if it is not true for any element. - */ - function partition_point>(first: ForwardIterator, last: ForwardIterator, pred: (x: T) => boolean): ForwardIterator; -} -declare namespace std { - /** - *

Merge sorted ranges.

- * - *

Combines the elements in the sorted ranges [first1, last1) and [first2, last2), into - * a new range beginning at result with all its elements sorted.

- * - *

The elements are compared using {@link less}. The elements in both ranges shall already be ordered according to - * this same criterion ({@link less}). The resulting range is also sorted according to this.

- * - * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. - * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is - * [first1, last1), which contains all the elements between first1 and last1, - * including the element pointed by first1 but not the element pointed by last1. - * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. - * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is - * [first2, last2). - * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting combined - * range is stored. Its size is equal to the sum of both ranges above. - * - * @return An iterator pointing to the past-the-end element in the resulting sequence. - */ - function merge, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator): OutputIterator; - /** - *

Merge sorted ranges.

- * - *

Combines the elements in the sorted ranges [first1, last1) and [first2, last2), into - * a new range beginning at result with all its elements sorted.

- * - *

The elements are compared using {@link less}. The elements in both ranges shall already be ordered according to - * this same criterion (compare). The resulting range is also sorted according to this.

- * - * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. - * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is - * [first1, last1), which contains all the elements between first1 and last1, - * including the element pointed by first1 but not the element pointed by last1. - * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. - * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is - * [first2, last2). - * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting combined - * range is stored. Its size is equal to the sum of both ranges above. - * @param compare Binary function that accepts two arguments of the types pointed by the iterators, and returns a value - * convertible to bool. The value returned indicates whether the first argument is - * considered to go before the second in the specific strict weak ordering it defines. The - * function shall not modify any of its arguments. - * - * @return An iterator pointing to the past-the-end element in the resulting sequence. - */ - function merge, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator, compare: (x: T, y: T) => boolean): OutputIterator; - /** - *

Merge consecutive sorted ranges.

- * - *

Merges two consecutive sorted ranges: [first, middle) and [middle, last), putting - * the result into the combined sorted range [first, last).

- * - *

The elements are compared using {@link less}. The elements in both ranges shall already be ordered according to - * this same criterion ({@link less}). The resulting range is also sorted according to this.

- * - *

The function preserves the relative order of elements with equivalent values, with the elements in the first - * range preceding those equivalent in the second.

- * - * @param first {@link Iterator Bidirectional iterator} to the initial position in the first sorted sequence to merge. - * This is also the initial position where the resulting merged range is stored. - * @param middle {@link Iterator Bidirectional iterator} to the initial position of the second sorted sequence, which - * because both sequences must be consecutive, matches the past-the-end position of the first - * sequence. - * @param last {@link Iterator Bidirectional iterator} to the past-the-end position of the second sorted - * sequence. This is also the past-the-end position of the range where the resulting merged range is - * stored. - */ - function inplace_merge>(first: BidirectionalIterator, middle: BidirectionalIterator, last: BidirectionalIterator): void; - /** - *

Merge consecutive sorted ranges.

- * - *

Merges two consecutive sorted ranges: [first, middle) and [middle, last), putting - * the result into the combined sorted range [first, last).

- * - *

The elements are compared using compare. The elements in both ranges shall already be ordered according - * to this same criterion (compare). The resulting range is also sorted according to this.

- * - *

The function preserves the relative order of elements with equivalent values, with the elements in the first - * range preceding those equivalent in the second.

- * - * @param first {@link Iterator Bidirectional iterator} to the initial position in the first sorted sequence to merge. - * This is also the initial position where the resulting merged range is stored. - * @param middle {@link Iterator Bidirectional iterator} to the initial position of the second sorted sequence, which - * because both sequences must be consecutive, matches the past-the-end position of the first - * sequence. - * @param last {@link Iterator Bidirectional iterator} to the past-the-end position of the second sorted - * sequence. This is also the past-the-end position of the range where the resulting merged range is - * stored. - * @param compare Binary function that accepts two arguments of the types pointed by the iterators, and returns a value - * convertible to bool. The value returned indicates whether the first argument is - * considered to go before the second in the specific strict weak ordering it defines. The - * function shall not modify any of its arguments. - */ - function inplace_merge>(first: BidirectionalIterator, middle: BidirectionalIterator, last: BidirectionalIterator, compare: (x: T, y: T) => boolean): void; - /** - *

Test whether sorted range includes another sorted range.

- * - *

Returns true if the sorted range [first1, last1) contains all the elements in the - * sorted range [first2, last2).

- * - *

The elements are compared using {@link less}. Two elements, x and y are considered equivalent - * if (!std.less(x, y) && !std.less(y, x)).

- * - *

The elements in the range shall already be ordered according to this same criterion ({@link less}).

- * - * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. - * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence (which is tested on - * whether it contains the second sequence). The range used is [first1, last1), which - * contains all the elements between first1 and last1, including the element pointed by - * first1 but not the element pointed by last1. - * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. - * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. (which is tested - * on whether it is contained in the first sequence). The range used is [first2, last2). - * - * @return true if every element in the range [first2, last2) is contained in the range - * [first1, last1), false otherwise. If [first2, last2) is an empty - * range, the function returns true. - */ - function includes, InputIterator2 extends Iterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2): boolean; - /** - *

Test whether sorted range includes another sorted range.

- * - *

Returns true if the sorted range [first1, last1) contains all the elements in the - * sorted range [first2, last2).

- * - *

The elements are compared using compare. Two elements, x and y are considered equivalent - * if (!compare(x, y) && !compare(y, x)).

- * - *

The elements in the range shall already be ordered according to this same criterion (compare).

- * - * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. - * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence (which is tested on - * whether it contains the second sequence). The range used is [first1, last1), which - * contains all the elements between first1 and last1, including the element pointed by - * first1 but not the element pointed by last1. - * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. - * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. (which is tested - * on whether it is contained in the first sequence). The range used is [first2, last2). - * @param compare Binary function that accepts two elements as arguments (one from each of the two sequences, in the - * same order), and returns a value convertible to bool. The value returned indicates - * whether the element passed as first argument is considered to go before the second in the specific - * strict weak ordering it defines. The function shall not modify any of its arguments. - * - * @return true if every element in the range [first2, last2) is contained in the range - * [first1, last1), false otherwise. If [first2, last2) is an empty - * range, the function returns true. - */ - function includes, InputIterator2 extends Iterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, compare: (x: T, y: T) => boolean): boolean; - /** - *

Union of two sorted ranges.

- * - *

Constructs a sorted range beginning in the location pointed by result with the set union of the - * two sorted ranges [first1, last1) and [first2, last2).

- * - *

The union of two sets is formed by the elements that are present in either one of the sets, or in both. - * Elements from the second range that have an equivalent element in the first range are not copied to the resulting - * range.

- * - *

The elements are compared using {@link less}. Two elements, x and y are considered equivalent - * if (!std.less(x, y) && !std.less(y, x)).

- * - *

The elements in the ranges shall already be ordered according to this same criterion ({@link less}). The - * resulting range is also sorted according to this.

- * - * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. - * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is - * [first1, last1), which contains all the elements between first1 and last1, - * including the element pointed by first1 but not the element pointed by last1. - * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. - * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is - * [first2, last2). - * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is - * stored. The pointed type shall support being assigned the value of an element from the other ranges. - * - * @return An iterator to the end of the constructed range. - */ - function set_union, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator): OutputIterator; - /** - *

Union of two sorted ranges.

- * - *

Constructs a sorted range beginning in the location pointed by result with the set union of the - * two sorted ranges [first1, last1) and [first2, last2).

- * - *

The union of two sets is formed by the elements that are present in either one of the sets, or in both. - * Elements from the second range that have an equivalent element in the first range are not copied to the resulting - * range.

- * - *

The elements are compared using compare. Two elements, x and y are considered equivalent - * if (!compare(x, y) && !compare(y, x)).

- * - *

The elements in the ranges shall already be ordered according to this same criterion (compare). The - * resulting range is also sorted according to this.

- * - * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. - * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is - * [first1, last1), which contains all the elements between first1 and last1, - * including the element pointed by first1 but not the element pointed by last1. - * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. - * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is - * [first2, last2). - * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is - * stored. The pointed type shall support being assigned the value of an element from the other ranges. - * @param compare Binary function that accepts two arguments of the types pointed by the input iterators, and returns a - * value convertible to bool. The value returned indicates whether the first argument is - * considered to go before the second in the specific strict weak ordering it defines. The - * function shall not modify any of its arguments. - * - * @return An iterator to the end of the constructed range. - */ - function set_union, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator, compare: (x: T, y: T) => boolean): OutputIterator; - /** - *

Intersection of two sorted ranges.

- * - *

Constructs a sorted range beginning in the location pointed by result with the set intersection of - * the two sorted ranges [first1, last1) and [first2, last2).

- * - *

The intersection of two sets is formed only by the elements that are present in both sets. The elements - * copied by the function come always from the first range, in the same order.

- * - *

The elements are compared using {@link less}. Two elements, x and y are considered equivalent - * if (!std.less(x, y) && !std.less(y, x)).

- * - *

The elements in the ranges shall already be ordered according to this same criterion ({@link less}). The - * resulting range is also sorted according to this.

- * - * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. - * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is - * [first1, last1), which contains all the elements between first1 and last1, - * including the element pointed by first1 but not the element pointed by last1. - * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. - * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is - * [first2, last2). - * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is - * stored. The pointed type shall support being assigned the value of an element from the first range. - * - * @return An iterator to the end of the constructed range. - */ - function set_intersection, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator): OutputIterator; - /** - *

Intersection of two sorted ranges.

- * - *

Constructs a sorted range beginning in the location pointed by result with the set intersection of - * the two sorted ranges [first1, last1) and [first2, last2).

- * - *

The intersection of two sets is formed only by the elements that are present in both sets. The elements - * copied by the function come always from the first range, in the same order.

- * - *

The elements are compared using compare. Two elements, x and y are considered equivalent - * if (!compare(x, y) && !compare(y, x)).

- * - *

The elements in the ranges shall already be ordered according to this same criterion (compare). The - * resulting range is also sorted according to this.

- * - * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. - * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is - * [first1, last1), which contains all the elements between first1 and last1, - * including the element pointed by first1 but not the element pointed by last1. - * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. - * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is - * [first2, last2). - * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is - * stored. The pointed type shall support being assigned the value of an element from the first range. - * @param compare Binary function that accepts two arguments of the types pointed by the input iterators, and returns a - * value convertible to bool. The value returned indicates whether the first argument is - * considered to go before the second in the specific strict weak ordering it defines. The - * function shall not modify any of its arguments. - * - * @return An iterator to the end of the constructed range. - */ - function set_intersection, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator, compare: (x: T, y: T) => boolean): OutputIterator; - /** - *

Difference of two sorted ranges.

- * - *

Constructs a sorted range beginning in the location pointed by result with the set difference of - * the sorted range [first1, last1) with respect to the sorted range [first2, last2).

- * - *

The difference of two sets is formed by the elements that are present in the first set, but not in the - * second one. The elements copied by the function come always from the first range, in the same order.

- * - *

For containers supporting multiple occurrences of a value, the difference includes as many occurrences of - * a given value as in the first range, minus the amount of matching elements in the second, preserving order.

- * - *

Notice that this is a directional operation - for a symmetrical equivalent, see {@link set_symmetric_difference}. - *

- * - *

The elements are compared using {@link less}. Two elements, x and y are considered equivalent - * if (!std.less(x, y) && !std.less(y, x)).

- * - *

The elements in the ranges shall already be ordered according to this same criterion ({@link less}). The - * resulting range is also sorted according to this.

- * - * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. - * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is - * [first1, last1), which contains all the elements between first1 and last1, - * including the element pointed by first1 but not the element pointed by last1. - * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. - * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is - * [first2, last2). - * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is - * stored. The pointed type shall support being assigned the value of an element from the first range. - * - * @return An iterator to the end of the constructed range. - */ - function set_difference, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator): OutputIterator; - /** - *

Difference of two sorted ranges.

- * - *

Constructs a sorted range beginning in the location pointed by result with the set difference of - * the sorted range [first1, last1) with respect to the sorted range [first2, last2).

- * - *

The difference of two sets is formed by the elements that are present in the first set, but not in the - * second one. The elements copied by the function come always from the first range, in the same order.

- * - *

For containers supporting multiple occurrences of a value, the difference includes as many occurrences of - * a given value as in the first range, minus the amount of matching elements in the second, preserving order.

- * - *

Notice that this is a directional operation - for a symmetrical equivalent, see {@link set_symmetric_difference}. - *

- * - *

The elements are compared using compare. Two elements, x and y are considered equivalent - * if (!compare(x, y) && !compare(y, x)).

- * - *

The elements in the ranges shall already be ordered according to this same criterion (compare). The - * resulting range is also sorted according to this.

- * - * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. - * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is - * [first1, last1), which contains all the elements between first1 and last1, - * including the element pointed by first1 but not the element pointed by last1. - * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. - * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is - * [first2, last2). - * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is - * stored. The pointed type shall support being assigned the value of an element from the first range. - * @param compare Binary function that accepts two arguments of the types pointed by the input iterators, and returns a - * value convertible to bool. The value returned indicates whether the first argument is - * considered to go before the second in the specific strict weak ordering it defines. The - * function shall not modify any of its arguments. - * - * @return An iterator to the end of the constructed range. - */ - function set_difference, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator, compare: (x: T, y: T) => boolean): OutputIterator; - /** - *

Symmetric difference of two sorted ranges.

- * - *

Constructs a sorted range beginning in the location pointed by0 result with the set - * symmetric difference of the two sorted ranges [first1, last1) and [first2, last2). - *

- * - *

The symmetric difference of two sets is formed by the elements that are present in one of the sets, but - * not in the other. Among the equivalent elements in each range, those discarded are those that appear before in the - * existent order before the call. The existing order is also preserved for the copied elements.

- * - *

The elements are compared using {@link less}. Two elements, x and y are considered equivalent - * if (!std.less(x, y) && !std.less(y, x)).

- * - *

The elements in the ranges shall already be ordered according to this same criterion ({@link std.less}). The - * resulting range is also sorted according to this.

- * - * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. - * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is - * [first1, last1), which contains all the elements between first1 and last1, - * including the element pointed by first1 but not the element pointed by last1. - * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. - * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is - * [first2, last2). - * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is - * stored. The pointed type shall support being assigned the value of an element from the other ranges. - * @param compare Binary function that accepts two arguments of the types pointed by the input iterators, and returns a - * value convertible to bool. The value returned indicates whether the first argument is - * considered to go before the second in the specific strict weak ordering it defines. The - * function shall not modify any of its arguments. - * - * @return An iterator to the end of the constructed range. - */ - function set_symmetric_difference, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator): OutputIterator; - /** - *

Symmetric difference of two sorted ranges.

- * - *

Constructs a sorted range beginning in the location pointed by0 result with the set - * symmetric difference of the two sorted ranges [first1, last1) and [first2, last2). - *

- * - *

The symmetric difference of two sets is formed by the elements that are present in one of the sets, but - * not in the other. Among the equivalent elements in each range, those discarded are those that appear before in the - * existent order before the call. The existing order is also preserved for the copied elements.

- * - *

The elements are compared using compare. Two elements, x and y are considered equivalent - * if (!compare(x, y) && !compare(y, x)).

- * - *

The elements in the ranges shall already be ordered according to this same criterion (compare). The - * resulting range is also sorted according to this.

- * - * @param first1 {@link Iterator Input iterator} to the initial position of the first sorted sequence. - * @param last1 {@link Iterator Input iterator} to the final position of the first sorted sequence. The range used is - * [first1, last1), which contains all the elements between first1 and last1, - * including the element pointed by first1 but not the element pointed by last1. - * @param first2 {@link Iterator Input iterator} to the initial position of the second sorted sequence. - * @param last2 {@link Iterator Input iterator} to the final position of the second sorted sequence. The range used is - * [first2, last2). - * @param result {@link Iterator Output iterator} to the initial position of the range where the resulting sequence is - * stored. The pointed type shall support being assigned the value of an element from the other ranges. - * @param compare Binary function that accepts two arguments of the types pointed by the input iterators, and returns a - * value convertible to bool. The value returned indicates whether the first argument is - * considered to go before the second in the specific strict weak ordering it defines. The - * function shall not modify any of its arguments. - * - * @return An iterator to the end of the constructed range. - */ - function set_symmetric_difference, InputIterator2 extends Iterator, OutputIterator extends base.ILinearIterator>(first1: InputIterator1, last1: InputIterator1, first2: InputIterator2, last2: InputIterator2, result: OutputIterator, compare: (x: T, y: T) => boolean): OutputIterator; -} -declare namespace std { - /** - *

Return the smallest.

- * - *

Returns the smallest of all the elements in the args.

- * - * @param args Values to compare. - * - * @return The lesser of the values passed as arguments. - */ - function min(...args: T[]): T; - /** - *

Return the largest.

- * - *

Returns the largest of all the elements in the args.

- * - * @param args Values to compare. - * - * @return The largest of the values passed as arguments. - */ - function max(...args: T[]): T; - /** - *

Return smallest and largest elements.

- * - *

Returns a {@link Pair} with the smallest of all the elements in the args as first element (the first of - * them, if there are more than one), and the largest as second (the last of them, if there are more than one).

- * - * @param args Values to compare. - * - * @return The lesser and greatest of the values passed as arguments. - */ - function minmax(...args: T[]): Pair; - /** - *

Return smallest element in range.

- * - *

Returns an iterator pointing to the element with the smallest value in the range [first, last). - *

- * - *

The comparisons are performed using either {@link less}; An element is the smallest if no other element - * compares less than it. If more than one element fulfills this condition, the iterator returned points to the first - * of such elements.

- * - * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. - * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used - * is [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * - * @return An iterator to smallest value in the range, or last if the range is empty. - */ - function min_element>(first: ForwardIterator, last: ForwardIterator): ForwardIterator; - /** - *

Return smallest element in range.

- * - *

Returns an iterator pointing to the element with the smallest value in the range [first, last). - *

- * - *

The comparisons are performed using either compare; An element is the smallest if no other element - * compares less than it. If more than one element fulfills this condition, the iterator returned points to the first - * of such elements.

- * - * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. - * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used - * is [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value convertible - * to bool. The value returned indicates whether the element passed as first argument is - * considered less than the second. The function shall not modify any of its arguments. - * - * @return An iterator to smallest value in the range, or last if the range is empty. - */ - function min_element>(first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): ForwardIterator; - /** - *

Return largest element in range.

- * - *

Returns an iterator pointing to the element with the largest value in the range [first, last). - *

- * - *

The comparisons are performed using either {@link greater}; An element is the largest if no other element - * compares less than it. If more than one element fulfills this condition, the iterator returned points to the first - * of such elements.

- * - * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. - * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used - * is [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * - * @return An iterator to largest value in the range, or last if the range is empty. - */ - function max_element>(first: ForwardIterator, last: ForwardIterator): ForwardIterator; - /** - *

Return largest element in range.

- * - *

Returns an iterator pointing to the element with the largest value in the range [first, last). - *

- * - *

The comparisons are performed using either compare; An element is the largest if no other element - * compares less than it. If more than one element fulfills this condition, the iterator returned points to the first - * of such elements.

- * - * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. - * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used - * is [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value convertible - * to bool. The value returned indicates whether the element passed as first argument is - * considered less than the second. The function shall not modify any of its arguments. - * - * @return An iterator to largest value in the range, or last if the range is empty. - */ - function max_element>(first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): ForwardIterator; - /** - *

Return smallest and largest elements in range.

- * - *

Returns a {@link Pair} with an iterator pointing to the element with the smallest value in the range - * [first, last) as first element, and the largest as second.

- * - *

The comparisons are performed using either {@link less} and {@link greater}.

- * - *

If more than one equivalent element has the smallest value, the first iterator points to the first of such - * elements.

- * - *

If more than one equivalent element has the largest value, the second iterator points to the last of such - * elements.

- * - * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. - * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used - * is [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value convertible - * to bool. The value returned indicates whether the element passed as first argument is - * considered less than the second. The function shall not modify any of its arguments. - * - * @return A {@link Pair} with an iterator pointing to the element with the smallest value in the range - * [first, last) as first element, and the largest as second. - */ - function minmax_element>(first: ForwardIterator, last: ForwardIterator): Pair; - /** - *

Return smallest and largest elements in range.

- * - *

Returns a {@link Pair} with an iterator pointing to the element with the smallest value in the range - * [first, last) as first element, and the largest as second.

- * - *

The comparisons are performed using either compare.

- * - *

If more than one equivalent element has the smallest value, the first iterator points to the first of such - * elements.

- * - *

If more than one equivalent element has the largest value, the second iterator points to the last of such - * elements.

- * - * @param first {@link Iteartor Input iterator} to the initial final position of the sequence to compare. - * @param last {@link Iteartor Input iterator} to the final final position of the sequence to compare. The range used - * is [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - * @param compare Binary function that accepts two elements in the range as arguments, and returns a value convertible - * to bool. The value returned indicates whether the element passed as first argument is - * considered less than the second. The function shall not modify any of its arguments. - * - * @return A {@link Pair} with an iterator pointing to the element with the smallest value in the range - * [first, last) as first element, and the largest as second. - */ - function minmax_element>(first: ForwardIterator, last: ForwardIterator, compare: (x: T, y: T) => boolean): Pair; - /** - *

Test whether range is permutation of another.

- * - *

Compares the elements in the range [first1, last1) with those in the range beginning at - * first2, and returns true if all of the elements in both ranges match, even in a different - * order.

- * - * @param first1 An {@link Iterator} to the initial position of the first sequence. - * @param last1 An {@link Iterator} to the final position in a sequence. The range used is - * [first1, last1), including the element pointed by first1, but not the element - * pointed by last1. - * @param first2 An {@link Iterator} to the initial position of the second sequence. The comparison includes up to - * as many elements of this sequence as those in the range [first1, last1). - * - * @return true if all the elements in the range [first1, last1) compare equal to those - * of the range starting at first2 in any order, and false otherwise. - */ - function is_permutation, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2): boolean; - /** - *

Test whether range is permutation of another.

- * - *

Compares the elements in the range [first1, last1) with those in the range beginning at - * first2, and returns true if all of the elements in both ranges match, even in a different - * order.

- * - * @param first1 An {@link Iterator} to the initial position of the first sequence. - * @param last1 An {@link Iterator} to the final position in a sequence. The range used is - * [first1, last1), including the element pointed by first1, but not the element - * pointed by last1. - * @param first2 An {@link Iterator} to the initial position of the second sequence. The comparison includes up to - * as many elements of this sequence as those in the range [first1, last1). - * @param pred Binary function that accepts two elements as argument (one of each of the two sequences, in the same - * order), and returns a value convertible to bool. The value returned indicates whether - * the elements are considered to match in the context of this function. - * - * @return true if all the elements in the range [first1, last1) compare equal to those - * of the range starting at first2 in any order, and false otherwise. - */ - function is_permutation, Iterator2 extends Iterator>(first1: Iterator1, last1: Iterator1, first2: Iterator2, pred: (x: T, y: T) => boolean): boolean; - /** - * Transform range to previous permutation. - * - * Rearranges the elements in the range [*first*, *last*) into the previous *lexicographically-ordered* permutation. - * - * A *permutation* is each one of the N! possible arrangements the elements can take (where *N* is the number of - * elements in the range). Different permutations can be ordered according to how they compare - * {@link lexicographicaly lexicographical_compare} to each other; The first such-sorted possible permutation (the one - * that would compare *lexicographically smaller* to all other permutations) is the one which has all its elements - * sorted in ascending order, and the largest has all its elements sorted in descending order. - * - * The comparisons of individual elements are performed using the {@link std.less std.less()} function. - * - * If the function can determine the previous permutation, it rearranges the elements as such and returns true. If - * that was not possible (because it is already at the lowest possible permutation), it rearranges the elements - * according to the last permutation (sorted in descending order) and returns false. - * - * @param first Bidirectional iterators to the initial positions of the sequence - * @param last Bidirectional iterators to the final positions of the sequence. The range used is [*first*, *last*), - * which contains all the elements between *first* and *last*, including the element pointed by *first* - * but not the element pointed by *last*. - * - * @return true if the function could rearrange the object as a lexicographicaly smaller permutation. Otherwise, the - * function returns false to indicate that the arrangement is not less than the previous, but the largest - * possible (sorted in descending order). - */ - function prev_permutation>(first: BidirectionalIterator, last: BidirectionalIterator): boolean; - /** - * Transform range to previous permutation. - * - * Rearranges the elements in the range [*first*, *last*) into the previous *lexicographically-ordered* permutation. - * - * A *permutation* is each one of the N! possible arrangements the elements can take (where *N* is the number of - * elements in the range). Different permutations can be ordered according to how they compare - * {@link lexicographicaly lexicographical_compare} to each other; The first such-sorted possible permutation (the one - * that would compare *lexicographically smaller* to all other permutations) is the one which has all its elements - * sorted in ascending order, and the largest has all its elements sorted in descending order. - * - * The comparisons of individual elements are performed using the *compare*. - * - * If the function can determine the previous permutation, it rearranges the elements as such and returns true. If - * that was not possible (because it is already at the lowest possible permutation), it rearranges the elements - * according to the last permutation (sorted in descending order) and returns false. - * - * @param first Bidirectional iterators to the initial positions of the sequence - * @param last Bidirectional iterators to the final positions of the sequence. The range used is [*first*, *last*), - * which contains all the elements between *first* and *last*, including the element pointed by *first* - * but not the element pointed by *last*. - * @param compare Binary function that accepts two arguments of the type pointed by BidirectionalIterator, and returns - * a value convertible to bool. The value returned indicates whether the first argument is considered - * to go before the second in the specific strict weak ordering it defines. - * - * @return true if the function could rearrange the object as a lexicographicaly smaller permutation. Otherwise, the - * function returns false to indicate that the arrangement is not less than the previous, but the largest - * possible (sorted in descending order). - */ - function prev_permutation>(first: BidirectionalIterator, last: BidirectionalIterator, compare: (x: T, y: T) => boolean): boolean; - /** - * Transform range to next permutation. - * - * Rearranges the elements in the range [*first*, *last*) into the next *lexicographically greater* permutation. - * - * A permutation is each one of the *N!* possible arrangements the elements can take (where *N* is the number of - * elements in the range). Different permutations can be ordered according to how they compare - * {@link lexicographicaly lexicographical_compare} to each other; The first such-sorted possible permutation (the one - * that would compare *lexicographically smaller* to all other permutations) is the one which has all its elements - * sorted in ascending order, and the largest has all its elements sorted in descending order. - * - * The comparisons of individual elements are performed using the {@link std.less} function. - * - * If the function can determine the next higher permutation, it rearranges the elements as such and returns true. If - * that was not possible (because it is already at the largest possible permutation), it rearranges the elements - * according to the first permutation (sorted in ascending order) and returns false. - * - * @param first Bidirectional iterators to the initial positions of the sequence - * @param last Bidirectional iterators to the final positions of the sequence. The range used is [*first*, *last*), - * which contains all the elements between *first* and *last*, including the element pointed by *first* - * but not the element pointed by *last*. - * - * @return true if the function could rearrange the object as a lexicographicaly greater permutation. Otherwise, the - * function returns false to indicate that the arrangement is not greater than the previous, but the lowest - * possible (sorted in ascending order). - */ - function next_permutation>(first: BidirectionalIterator, last: BidirectionalIterator): boolean; - /** - * Transform range to next permutation. - * - * Rearranges the elements in the range [*first*, *last*) into the next *lexicographically greater* permutation. - * - * A permutation is each one of the *N!* possible arrangements the elements can take (where *N* is the number of - * elements in the range). Different permutations can be ordered according to how they compare - * {@link lexicographicaly lexicographical_compare} to each other; The first such-sorted possible permutation (the one - * that would compare *lexicographically smaller* to all other permutations) is the one which has all its elements - * sorted in ascending order, and the largest has all its elements sorted in descending order. - * - * The comparisons of individual elements are performed using the *compare*. - * - * If the function can determine the next higher permutation, it rearranges the elements as such and returns true. If - * that was not possible (because it is already at the largest possible permutation), it rearranges the elements - * according to the first permutation (sorted in ascending order) and returns false. - * - * @param first Bidirectional iterators to the initial positions of the sequence - * @param last Bidirectional iterators to the final positions of the sequence. The range used is [*first*, *last*), - * which contains all the elements between *first* and *last*, including the element pointed by *first* - * but not the element pointed by *last*. - * @param compare Binary function that accepts two arguments of the type pointed by BidirectionalIterator, and returns - * a value convertible to bool. The value returned indicates whether the first argument is considered - * to go before the second in the specific strict weak ordering it defines. - * - * @return true if the function could rearrange the object as a lexicographicaly greater permutation. Otherwise, the - * function returns false to indicate that the arrangement is not greater than the previous, but the lowest - * possible (sorted in ascending order). - */ - function next_permutation>(first: BidirectionalIterator, last: BidirectionalIterator, compare: (x: T, y: T) => boolean): boolean; -} -declare namespace std.base { - /** - *

Static class holding enumeration codes of color of Red-black tree.

- * - *

Color codes imposed to nodes of RB-Tree are following those rules:

- * - *
    - *
  1. A node is either red or black.
  2. - *
  3. The root is black. This rule is sometimes omitted. Since the root can - * always be changed from red to black, but not - * necessarily vice versa, this rule has little effect on analysis.
  4. - *
  5. All leaves (NIL; null) are black.
  6. - *
  7. If a node is red, then both its children are - * black.
  8. - *
  9. Every path from a given node to any of its descendant NIL nodes contains the same number of - * black nodes. Some definitions: the number of - * black nodes from the root to a node is the node's - * black depth; the uniform number of black - * nodes in all paths from root to the leaves is called the black-height of - * the red-black tree.
  10. - *
- * - * @author Migrated by Jeongho Nam - */ - enum Color { - /** - *

Code of color black.

- * - *
    - *
  • Those are clearly black: root, leaf nodes or children nodes of red.
  • - *
  • Every path from a given nodes containes the same number of black nodes exclude NIL(s).
  • - *
- */ - BLACK = 0, - /** - *

Code of color red.

- */ - RED = 1, - } -} -declare namespace std.base { - /** - *

An abstract container.

- * - *

- * - *

- * - *

Container properties

- *
- *
Sequence
- *
Elements in sequence containers are ordered in a strict linear sequence. Individual elements are - * accessed by their position in this sequence.
- * - *
Doubly-linked list
- *
Each element keeps information on how to locate the next and the previous elements, allowing - * constant time insert and erase operations before or after a specific element (even of entire ranges), - * but no direct random access.
- *
- * - * @param Type of elements. - * - * @author Jeongho Nam - */ - abstract class Container implements IContainer { - /** - * Default Constructor. - */ - protected constructor(); - /** - * @inheritdoc - */ - abstract assign>(begin: InputIterator, end: InputIterator): void; - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - abstract begin(): Iterator; - /** - * @inheritdoc - */ - abstract end(): Iterator; - /** - * @inheritdoc - */ - abstract rbegin(): base.IReverseIterator; - /** - * @inheritdoc - */ - abstract rend(): base.IReverseIterator; - /** - * @inheritdoc - */ - abstract size(): number; - /** - * @inheritdoc - */ - empty(): boolean; - /** - * @inheritdoc - */ - abstract push(...items: T[]): number; - /** - * @inheritdoc - */ - abstract insert(position: Iterator, val: T): Iterator; - /** - * @inheritdoc - */ - abstract erase(position: Iterator): Iterator; - /** - * @inheritdoc - */ - abstract erase(begin: Iterator, end: Iterator): Iterator; - /** - * @inheritdoc - */ - swap(obj: IContainer): void; - } -} -declare namespace std.base { - /** - *

An abstract error instance.

- * - *

{@link ErrorInstance} is an abstract class of {@link ErrorCode} and {@link ErrorCondition} - * holding an error instance's identifier {@link value}, associated with a {@link category}.

- * - *

The operating system and other low-level applications and libraries generate numerical error codes to - * represent possible results. These numerical values may carry essential information for a specific platform, - * but be non-portable from one platform to another.

- * - *

Objects of this class associate such numerical codes to {@link ErrorCategory error categories}, - * so that they can be interpreted when needed as more abstract (and portable) - * {@link ErrorCondition error conditions}.

- * - *

- *

- * - * @author Jeongho Nam - */ - abstract class ErrorInstance { - /** - * @hidden - */ - protected category_: ErrorCategory; - /** - * @hidden - */ - protected value_: number; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from a numeric value and error category. - * - * @param val A numerical value identifying an error instance. - * @param category A reference to an {@link ErrorCategory} object. - */ - constructor(val: number, category: ErrorCategory); - /** - *

Assign error instance.

- * - *

Assigns the {@link ErrorCode} object a value of val associated with the {@link ErrorCategory}.

- * - * @param val A numerical value identifying an error instance. - * @param category A reference to an {@link ErrorCategory} object. - */ - assign(val: number, category: ErrorCategory): void; - /** - *

Clear error instance.

- * - *

Clears the value in the {@link ErrorCode} object so that it is set to a value of 0 of the - * {@link ErrorCategory.systemCategory ErrorCategory.systemCategory()} (indicating no error).

- */ - clear(): void; - /** - *

Get category.

- * - *

Returns a reference to the {@link ErrorCategory} associated with the {@link ErrorCode} object.

- * - * @return A reference to a non-copyable object of a type derived from {@link ErrorCategory}. - */ - category(): ErrorCategory; - /** - *

Error value.

- * - *

Returns the error value associated with the {@link ErrorCode} object.

- * - * @return The error value. - */ - value(): number; - /** - *

Get message.

- * - *

Returns the message associated with the error instance.

- * - *

Error messages are defined by the {@link category} the error instance belongs to.

- * - *

This function returns the same as if the following member was called:

- * - *

category().message(value())

- * - * @return A string object with the message associated with the {@link ErrorCode}. - */ - message(): string; - /** - *

Default error condition.

- * - *

Returns the default {@link ErrorCondition}object associated with the {@link ErrorCode} object.

- * - *

This function returns the same as if the following member was called:

- * - *

category().default_error_condition(value())

- * - *

{@link ErrorCategory.default_error_condition ErrorCategory.default_error_condition()} - * is a virtual member function, that can operate differently for each category.

- * - * @return An {@link ErrorCondition}object that corresponds to the {@link ErrorCode} object. - */ - default_error_condition(): ErrorCondition; - /** - *

Convert to bool.

- * - *

Returns whether the error instance has a numerical {@link value} other than 0.

- * - *

If it is zero (which is generally used to represent no error), the function returns false, otherwise it returns true.

- * - * @return true if the error's numerical value is not zero. - * false otherwise. - */ - to_bool(): boolean; - } -} -declare namespace std.base { - enum Hash { - MIN_SIZE = 10, - RATIO = 1, - MAX_RATIO = 2, - } - /** - *

Hask buckets.

- * - * @author Jeongho Nam - */ - abstract class HashBuckets { - /** - * @hidden - */ - private buckets_; - /** - * @hidden - */ - private item_size_; - /** - * Default Constructor. - */ - protected constructor(); - /** - *

Reconstruction of hash table.

- * - *

All the elements in the hash buckets are rearranged according to their hash value into the new set of - * buckets. This may alter the order of iteration of elements within the container.

- * - *

Notice that {@link rehash rehashes} are automatically performed whenever its number of elements is going - * to greater than its own {@link capacity}.

- * - * @param size Number of bucket size to rehash. - */ - rehash(size: number): void; - clear(): void; - size(): number; - item_size(): number; - capacity(): number; - at(index: number): Vector; - hash_index(val: T): number; - insert(val: T): void; - erase(val: T): void; - } -} -declare namespace std.base { - /** - *

Common interface for hash map.

- * - *

{@link IHashMap}s are associative containers that store elements formed by the combination of - * a key value and a mapped value.

- * - *

In an {@link IHashMap}, the key value is generally used to uniquely identify the - * element, while the mapped value is an object with the content associated to this key. - * Types of key and mapped value may differ.

- * - *

Internally, the elements in the {@link IHashMap} are not sorted in any particular order with - * respect to either their key or mapped values, but organized into buckets depending on - * their hash values to allow for fast access to individual elements directly by their key values - * (with a constant average time complexity on average).

- * - *

Elements with equivalent keys are grouped together in the same bucket and in such a way that - * an iterator can iterate through all of them. Iterators in the container are doubly linked iterators.

- * - *

- * - *

- * - *

Container properties

- *
- *
Associative
- *
Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
- * - *
Hashed
- *
Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their key.
- * - *
Map
- *
Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value.
- *
- * - * @param Type of the key values. - * Each element in an {@link IHashMap} is identified by a key value. - * @param Type of the mapped value. - * Each element in an {@link IHashMap} is used to store some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/unordered_map - * @author Jeongho Nam - */ - interface IHashMap { - /** - *

Return iterator to beginning.

- * - *

Returns an iterator pointing to the first element in the {@link IHashMap}.

- * - *

Notice that an {@link IHashMap} object makes no guarantees on which specific element is considered its - * first element. But, in any case, the range that goes from its begin to its end covers all the elements in the - * container, until invalidated.

- * - * @return An iterator to the first element in the container. - */ - begin(): MapIterator; - /** - *

Return iterator to beginning.

- * - *

Returns an iterator pointing to the first element in one of buckets in the {@link IHashMap}.

- * - *

Notice that an {@link IHashMap} object makes no guarantees on which specific element is considered its - * first element. But, in any case, the range that goes from its begin to its end covers all the elements in the - * bucket, until invalidated.

- * - * @param index Bucket number. This shall be lower than {@link bucket_count}. - * - * @return An iterator to the first element in the bucket. - */ - begin(index: number): MapIterator; - /** - *

Return iterator to end.

- * - *

Returns an iterator pointing to the past-the-end element in the {@link HaspMap} container.

- * - *

The iterator returned by end does not point to any element, but to the position that follows the last - * element in the {@link HaspMap} container (its past-the-end position). Thus, the value returned shall - * not be dereferenced - it is generally used to describe the open-end of a range, such as - * [begin, end).

- * - *

Notice that an {@link IHashMap} object makes no guarantees on which order its elements follow. But, in any - * case, the range that goes from its begin to its end covers all the elements in the container (or the bucket), - * until invalidated.

- * - * @return An iterator to the element past the end of the container. - */ - end(): MapIterator; - /** - *

Return iterator to end.

- * - *

Returns an iterator pointing to the past-the-end element in the {@link HaspMap} container.

- * - *

The iterator returned by end does not point to any element, but to the position that follows the last - * element in the {@link HaspMap} container (its past-the-end position). Thus, the value returned shall - * not be dereferenced - it is generally used to describe the open-end of a range, such as - * [begin, end).

- * - *

Notice that an {@link IHashMap} object makes no guarantees on which order its elements follow. But, in any - * case, the range that goes from its begin to its end covers all the elements in the container (or the bucket), - * until invalidated.

- * - * @param index Bucket number. This shall be lower than {@link bucket_count}. - * - * @return An iterator to the element past the end of the bucket. - */ - end(index: number): MapIterator; - /** - *

Return {@link MapReverseIterator reverse iterator} to reverse beginning.

- * - *

Returns a {@link MapReverseIterator reverse iterator} pointing to the last element in the {@link IHashMap} - * (i.e., its reverse beginning).

- * - * {@link MapReverseIterator Reverse iterators} iterate backwards: increasing them moves them towards the - * beginning of the container.

- * - *

{@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}.

- * - *

Notice that an {@link IHashMap} object makes no guarantees on which specific element is considered its - * first element. But, in any case, the range that goes from its begin to its end covers all the elements in the - * bucket, until invalidated.

- * - * @return A {@link MapReverseIterator reverse iterator} to the reverse beginning of the sequence - */ - rbegin(): MapReverseIterator; - /** - *

Return {@link MapReverseIterator reverse iterator} to reverse beginning.

- * - *

Returns a {@link MapReverseIterator reverse iterator} pointing to the last element in one of buckets in the - * {@link IHashMap} (i.e., its reverse beginning).

- * - * {@link MapReverseIterator Reverse iterators} iterate backwards: increasing them moves them towards the - * beginning of the container.

- * - *

{@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}.

- * - *

Notice that an {@link IHashMap} object makes no guarantees on which specific element is considered its - * first element. But, in any case, the range that goes from its begin to its end covers all the elements in the - * bucket, until invalidated.

- * - * @param index Bucket number. This shall be lower than {@link bucket_count}. - * - * @return A {@link MapReverseIterator reverse iterator} to the reverse beginning of the sequence - */ - rbegin(index: number): MapReverseIterator; - /** - *

Return {@link MapReverseIterator reverse iterator} to reverse end.

- * - *

Returns a {@link MapReverseIterator reverse iterator} pointing to the theoretical element right before - * the first element in the {@link IHashMap hash map container} (which is considered its reverse end).

- * - *

The range between {@link IHashMap}.{@link rbegin} and {@link IHashMap}.{@link rend} contains all the - * elements of the container (in reverse order).

- * - *

Notice that an {@link IHashMap} object makes no guarantees on which order its elements follow. But, in any - * case, the range that goes from its begin to its end covers all the elements in the container (or the bucket), - * until invalidated.

- * - * @return A {@link MapReverseIterator reverse iterator} to the reverse end of the sequence. - */ - rend(): MapReverseIterator; - /** - *

Return {@link MapReverseIterator reverse iterator} to reverse end.

- * - *

Returns a {@link MapReverseIterator reverse iterator} pointing to the theoretical element right before - * the first element in one of buckets in the {@link IHashMap hash map container} (which is considered its - * reverse end).

- * - *

The range between {@link IHashMap}.{@link rbegin} and {@link IHashMap}.{@link rend} contains all the - * elements of the container (in reverse order).

- * - *

Notice that an {@link IHashMap} object makes no guarantees on which order its elements follow. But, in any - * case, the range that goes from its begin to its end covers all the elements in the container (or the bucket), - * until invalidated.

- * - * @param index Bucket number. This shall be lower than {@link bucket_count}. - * - * @return A {@link MapReverseIterator reverse iterator} to the reverse end of the sequence. - */ - rend(index: number): MapReverseIterator; - /** - *

Return number of buckets.

- * - *

Returns the number of buckets in the {@link IHashMap} container.

- * - *

A bucket is a slot in the container's internal hash table to which elements are assigned based on the - * hash value of their key.

- * - *

The number of buckets influences directly the {@link load_factor load factor} of the container's hash - * table (and thus the probability of collision). The container automatically increases the number of buckets to - * keep the load factor below a specific threshold (its {@link max_load_factor}), causing a {@link rehash} each - * time the number of buckets needs to be increased.

- * - * @return The current amount of buckets. - */ - bucket_count(): number; - /** - *

Return bucket size.

- * - *

Returns the number of elements in bucket n.

- * - *

A bucket is a slot in the container's internal hash table to which elements are assigned based on the hash - * value of their key.

- * - *

The number of elements in a bucket influences the time it takes to access a particular element in the - * bucket. The container automatically increases the number of buckets to keep the {@link load_cator load factor} - * (which is the average bucket size) below its {@link max_load_factor}.

- * - * @param n Bucket number. This shall be lower than {@link bucket_count}. - * - * @return The number of elements in bucket n. - */ - bucket_size(n: number): number; - /** - *

Get maximum load factor.

- * - *

Returns the current maximum load factor for the {@link HashMultiMap} container.

- * - *

The load factor is the ratio between the number of elements in the container (its {@link size}) and the - * number of buckets ({@link bucket_count}).

- * - *

By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0.

- * - *

The load factor influences the probability of collision in the hash table (i.e., the probability of two - * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold - * that forces an increase in the number of buckets (and thus causing a {@link rehash}).

- * - *

Note though, that implementations may impose an upper limit on the number of buckets (see - * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}.

- * - * @return The current load factor. - */ - max_load_factor(): number; - /** - *

Set maximum load factor.

- * - *

Sets z as the cnew maximum load factor for the {@link HashMultiMap} container.

- * - *

The load factor is the ratio between the number of elements in the container (its {@link size}) and the - * number of buckets ({@link bucket_count}).

- * - *

By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0.

- * - *

The load factor influences the probability of collision in the hash table (i.e., the probability of two - * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold - * that forces an increase in the number of buckets (and thus causing a {@link rehash}).

- * - *

Note though, that implementations may impose an upper limit on the number of buckets (see - * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}.

- * - * @param z The new maximum load factor. - */ - max_load_factor(z: number): void; - /** - *

Locate element's bucket.

- * - *

Returns the bucket number where the element with key is located.

- * - *

A bucket is a slot in the container's internal hash table to which elements are assigned based on the - * hash value of their key. Buckets are numbered from 0 to ({@link bucket_count} - 1).

- * - *

Individual elements in a bucket can be accessed by means of the range iterators returned by - * {@link begin} and {@link end}.

- * - * @param key Key whose bucket is to be located. - */ - bucket(key: Key): number; - /** - *

Request a capacity change.

- * - *

Sets the number of buckets in the container ({@link bucket_count}) to the most appropriate to contain at - * least n elements.

- * - *

If n is greater than the current {@link bucket_count} multiplied by the {@link max_load_factor}, - * the container's {@link bucket_count} is increased and a {@link rehash} is forced.

- * - *

If n is lower than that, the function may have no effect.

- * - * @param n The number of elements requested as minimum capacity. - */ - reserve(n: number): void; - /** - *

Set number of buckets.

- * - *

Sets the number of buckets in the container to n or more.

- * - *

If n is greater than the current number of buckets in the container ({@link bucket_count}), a - * {@link HashBuckets.rehash rehash} is forced. The new {@link bucket_count bucket count} can either be equal or - * greater than n.

- * - *

If n is lower than the current number of buckets in the container ({@link bucket_count}), the - * function may have no effect on the {@link bucket_count bucket count} and may not force a - * {@link HashBuckets.rehash rehash}.

- * - *

A {@link HashBuckets.rehash rehash} is the reconstruction of the hash table: All the elements in the - * container are rearranged according to their hash value into the new set of buckets. This may alter the order - * of iteration of elements within the container.

- * - *

{@link HashBuckets.rehash Rehashes} are automatically performed by the container whenever its - * {@link load_factor load factor} is going to surpass its {@link max_load_factor} in an operation.

- * - *

Notice that this function expects the number of buckets as argument. A similar function exists, - * {@link reserve}, that expects the number of elements in the container as argument.

- * - * @param n The minimum number of buckets for the container hash table. - */ - rehash(n: number): void; - } -} -declare namespace std.base { - /** - *

Hash buckets storing {@link MapIterator MapIterators}.

- * - *

- * - *

- * - * @author Jeongho Nam - */ - class MapHashBuckets extends HashBuckets> { - private map; - constructor(map: MapContainer); - find(key: K): MapIterator; - } -} -declare namespace std.base { - /** - *

A common interface for hash set.

- * - *

{@link IHashSet}s are containers that store unique elements in no particular order, and which - * allow for fast retrieval of individual elements based on their value.

- * - *

In an {@link IHashSet}, the value of an element is at the same time its key, that - * identifies it uniquely. Keys are immutable, therefore, the elements in an {@link IHashSet} cannot be - * modified once in the container - they can be inserted and removed, though.

- * - *

Internally, the elements in the {@link IHashSet} are not sorted in any particular order, but - * organized into buckets depending on their hash values to allow for fast access to individual elements - * directly by their values (with a constant average time complexity on average).

- * - *

{@link IHashSet} containers are faster than {@link TreeSet} containers to access individual - * elements by their key, although they are generally less efficient for range iteration through a - * subset of their elements.

- * - *

- * - *

- * - *

Container properties

- *
- *
Associative
- *
Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
- * - *
Hashed
- *
Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their key.
- * - *
Set
- *
The value of an element is also the key used to identify it.
- *
- * - * @param Type of the elements. - * Each element in an {@link IHashSet} is also uniquely identified by this value. - * - * @reference http://www.cplusplus.com/reference/unordered_set/unordered_set - * @author Jeongho Nam - */ - interface IHashSet { - /** - *

Return iterator to beginning.

- * - *

Returns an iterator pointing to the first element in the {@link IHashSet}.

- * - *

Notice that an {@link IHashSet} object makes no guarantees on which specific element is considered its - * first element. But, in any case, the range that goes from its begin to its end covers all the elements in the - * container, until invalidated.

- * - * @return An iterator to the first element in the container. - */ - begin(): SetIterator; - /** - *

Return iterator to beginning.

- * - *

Returns an iterator pointing to the first element in one of buckets in the {@link IHashSet}.

- * - *

Notice that an {@link IHashSet} object makes no guarantees on which specific element is considered its - * first element. But, in any case, the range that goes from its begin to its end covers all the elements in the - * bucket, until invalidated.

- * - * @param index Bucket number. This shall be lower than {@link bucket_count}. - * - * @return An iterator to the first element in the bucket. - */ - begin(index: number): SetIterator; - /** - *

Return iterator to end.

- * - *

Returns an iterator pointing to the past-the-end element in the {@link HaspMap} container.

- * - *

The iterator returned by end does not point to any element, but to the position that follows the last - * element in the {@link HaspMap} container (its past-the-end position). Thus, the value returned shall - * not be dereferenced - it is generally used to describe the open-end of a range, such as - * [begin, end).

- * - *

Notice that an {@link IHashSet} object makes no guarantees on which order its elements follow. But, in any - * case, the range that goes from its begin to its end covers all the elements in the container (or the bucket), - * until invalidated.

- * - * @return An iterator to the element past the end of the container. - */ - end(): SetIterator; - /** - *

Return iterator to end.

- * - *

Returns an iterator pointing to the past-the-end element in the {@link HaspMap} container.

- * - *

The iterator returned by end does not point to any element, but to the position that follows the last - * element in the {@link HaspMap} container (its past-the-end position). Thus, the value returned shall - * not be dereferenced - it is generally used to describe the open-end of a range, such as - * [begin, end).

- * - *

Notice that an {@link IHashSet} object makes no guarantees on which order its elements follow. But, in any - * case, the range that goes from its begin to its end covers all the elements in the container (or the bucket), - * until invalidated.

- * - * @param index Bucket number. This shall be lower than {@link bucket_count}. - * - * @return An iterator to the element past the end of the bucket. - */ - end(index: number): SetIterator; - rbegin(): SetReverseIterator; - rbegin(index: number): SetReverseIterator; - rend(): SetReverseIterator; - rend(index: number): SetReverseIterator; - /** - *

Return number of buckets.

- * - *

Returns the number of buckets in the {@link IHashSet} container.

- * - *

A bucket is a slot in the container's internal hash table to which elements are assigned based on the - * hash value of their key.

- * - *

The number of buckets influences directly the {@link load_factor load factor} of the container's hash - * table (and thus the probability of collision). The container automatically increases the number of buckets to - * keep the load factor below a specific threshold (its {@link max_load_factor}), causing a {@link rehash} each - * time the number of buckets needs to be increased.

- * - * @return The current amount of buckets. - */ - bucket_count(): number; - /** - *

Return bucket size.

- * - *

Returns the number of elements in bucket n.

- * - *

A bucket is a slot in the container's internal hash table to which elements are assigned based on the hash - * value of their key.

- * - *

The number of elements in a bucket influences the time it takes to access a particular element in the - * bucket. The container automatically increases the number of buckets to keep the {@link load_cator load factor} - * (which is the average bucket size) below its {@link max_load_factor}.

- * - * @param n Bucket number. This shall be lower than {@link bucket_count}. - * - * @return The number of elements in bucket n. - */ - bucket_size(n: number): number; - /** - *

Get maximum load factor.

- * - *

Returns the current maximum load factor for the {@link HashMultiMap} container.

- * - *

The load factor is the ratio between the number of elements in the container (its {@link size}) and the - * number of buckets ({@link bucket_count}).

- * - *

By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0.

- * - *

The load factor influences the probability of collision in the hash table (i.e., the probability of two - * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold - * that forces an increase in the number of buckets (and thus causing a {@link rehash}).

- * - *

Note though, that implementations may impose an upper limit on the number of buckets (see - * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}.

- * - * @return The current load factor. - */ - max_load_factor(): number; - /** - *

Set maximum load factor.

- * - *

Sets z as the cnew maximum load factor for the {@link HashMultiMap} container.

- * - *

The load factor is the ratio between the number of elements in the container (its {@link size}) and the - * number of buckets ({@link bucket_count}).

- * - *

By default, {@link HashMultiMap} containers have a {@link max_load_factor} of 1.0.

- * - *

The load factor influences the probability of collision in the hash table (i.e., the probability of two - * elements being located in the same bucket). The container uses the value of max_load_factor as the threshold - * that forces an increase in the number of buckets (and thus causing a {@link rehash}).

- * - *

Note though, that implementations may impose an upper limit on the number of buckets (see - * {@link max_bucket_count}), which may force the container to ignore the {@link max_load_factor}.

- * - * @param z The new maximum load factor. - */ - max_load_factor(z: number): void; - /** - *

Locate element's bucket.

- * - *

Returns the bucket number where the element with key is located.

- * - *

A bucket is a slot in the container's internal hash table to which elements are assigned based on the - * hash value of their key. Buckets are numbered from 0 to ({@link bucket_count} - 1).

- * - *

Individual elements in a bucket can be accessed by means of the range iterators returned by - * {@link begin} and {@link end}.

- * - * @param key Key whose bucket is to be located. - */ - bucket(key: T): number; - /** - *

Request a capacity change.

- * - *

Sets the number of buckets in the container ({@link bucket_count}) to the most appropriate to contain at - * least n elements.

- * - *

If n is greater than the current {@link bucket_count} multiplied by the {@link max_load_factor}, - * the container's {@link bucket_count} is increased and a {@link rehash} is forced.

- * - *

If n is lower than that, the function may have no effect.

- * - * @param n The number of elements requested as minimum capacity. - */ - reserve(n: number): void; - /** - *

Set number of buckets.

- * - *

Sets the number of buckets in the container to n or more.

- * - *

If n is greater than the current number of buckets in the container ({@link bucket_count}), a - * {@link HashBuckets.rehash rehash} is forced. The new {@link bucket_count bucket count} can either be equal or - * greater than n.

- * - *

If n is lower than the current number of buckets in the container ({@link bucket_count}), the - * function may have no effect on the {@link bucket_count bucket count} and may not force a - * {@link HashBuckets.rehash rehash}.

- * - *

A {@link HashBuckets.rehash rehash} is the reconstruction of the hash table: All the elements in the - * container are rearranged according to their hash value into the new set of buckets. This may alter the order - * of iteration of elements within the container.

- * - *

{@link HashBuckets.rehash Rehashes} are automatically performed by the container whenever its - * {@link load_factor load factor} is going to surpass its {@link max_load_factor} in an operation.

- * - *

Notice that this function expects the number of buckets as argument. A similar function exists, - * {@link reserve}, that expects the number of elements in the container as argument.

- * - * @param n The minimum number of buckets for the container hash table. - */ - rehash(n: number): void; - } -} -declare namespace std.base { - /** - *

Hash buckets storing {@link SetIterator SetIterators}.

- * - *

- * - *

- * - * @author Jeongho Nam - */ - class SetHashBuckets extends HashBuckets> { - private set; - constructor(set: SetContainer); - find(val: T): SetIterator; - } -} -declare namespace std.base { - /** - *

Array

- * - *

{@link IArray} is an interface for sequence containers representing arrays that can change in - * {@link size}. However, compared to arrays, {@link IArray} objectss consume more memory in exchange for - * the ability to manage storage and grow dynamically in an efficient way.

- * - *

Both {@link Vector Vectors} and {@link Deque Deques} who implemented {@link IArray} provide a very - * similar interface and can be used for similar purposes, but internally both work in quite different ways: - * While {@link Vector Vectors} use a single array that needs to be occasionally reallocated for growth, the - * elements of a {@link Deque} can be scattered in different chunks of storage, with the container keeping the - * necessary information internally to provide direct access to any of its elements in constant time and with a - * uniform sequential interface (through iterators). Therefore, {@link Deque Deques} are a little more complex - * internally than {@link Vector Vectors}, but this allows them to grow more efficiently under certain - * circumstances, especially with very long sequences, where reallocations become more expensive.

- * - *

Both {@link Vector Vectors} and {@link Deque Deques} provide a very similar interface and can be used for - * similar purposes, but internally both work in quite different ways: While {@link Vector Vectors} use a single - * array that needs to be occasionally reallocated for growth, the elements of a {@link Deque} can be scattered - * in different chunks of storage, with the container keeping the necessary information internally to provide - * direct access to any of its elements in constant time and with a uniform sequential interface (through - * iterators). Therefore, {@link Deque Deques} are a little more complex internally than {@link Vector Vectors}, - * but this allows them to grow more efficiently under certain circumstances, especially with very long - * sequences, where reallocations become more expensive.

- * - *

For operations that involve frequent insertion or removals of elements at positions other than the - * beginning or the end, {@link IArray} objects perform worse and have less consistent iterators and references - * than {@link List Lists}

. - * - *

- * - *

- * - *

Container properties

- *
- *
Sequence
- *
- * Elements in sequence containers are ordered in a strict linear sequence. Individual elements are - * accessed by their position in this sequence. - *
- * - *
Dynamic array
- *
- * Allows direct access to any element in the sequence, even through pointer arithmetics, and provides - * relatively fast addition/removal of elements at the end of the sequence. - *
- *
- * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - interface IArrayContainer extends ILinearContainer { - /** - *

Request a change in capacity.

- * - *

Requests that the {@link IArray container} {@link capacity} be at least enough to contain - * n elements.

- * - *

If n is greater than the current {@link IArray container} {@link capacity}, the - * function causes the {@link IArray container} to reallocate its storage increasing its - * {@link capacity} to n (or greater).

- * - *

In all other cases, the function call does not cause a reallocation and the - * {@link IArray container} {@link capacity} is not affected.

- * - *

This function has no effect on the {@link IArray container} {@link size} and cannot alter - * its elements.

- * - * @param n Minimum {@link capacity} for the {@link IArray container}. - * Note that the resulting {@link capacity} may be equal or greater than n. - */ - reserve(n: number): void; - /** - *

Return size of allocated storage capacity.

- * - *

Returns the size of the storage space currently allocated for the {@link IArray container}, - * expressed in terms of elements.

- * - *

This {@link capacity} is not necessarily equal to the {@link IArray container} {@link size}. - * It can be equal or greater, with the extra space allowing to accommodate for growth without the - * need to reallocate on each insertion.

- * - *

Notice that this {@link capacity} does not suppose a limit on the {@link size} of the - * {@link IArray container}. When this {@link capacity} is exhausted and more is needed, it is - * automatically expanded by the {@link IArray container} (reallocating it storage space). - * The theoretical limit on the {@link size} of a {@link IArray container} is given by member - * {@link max_size}.

- * - *

The {@link capacity} of a {@link IArray container} can be explicitly altered by calling member - * {@link IArray.reserve}.

- * - * @return The size of the currently allocated storage capacity in the {@link IArray container}, - * measured in terms of the number elements it can hold. - */ - capacity(): number; - /** - *

Access element.

- *

Returns a value to the element at position index in the {@link IArray container}.

- * - *

The function automatically checks whether index is within the bounds of valid elements - * in the {@link IArray container}, throwing an {@link OutOfRange} exception if it is not (i.e., - * if index is greater or equal than its {@link size}).

- * - * @param index Position of an element in the - * If this is greater than or equal to the {@link IArray container} {@link size}, an - * exception of type {@link OutOfRange} is thrown. Notice that the first - * element has a position of 0 (not 1). - * - * @return The element at the specified position in the - */ - at(index: number): T; - /** - *

Modify element.

- *

Replaces an element at the specified position (index) in this {@link IArray container} - * with the specified element (val).

- * - *

The function automatically checks whether index is within the bounds of valid elements - * in the {@link IArray container}, throwing an {@link OutOfRange} exception if it is not (i.e., if - * index is greater or equal than its {@link size}).

- * - * @.param index A specified position of the value to replace. - * @param val A value to be stored at the specified position. - * - * @return The previous element had stored at the specified position. - */ - set(index: number, val: T): void; - } - /** - *

Random-access iterator.

- * - *

{@link IArrayIterator Random-access iterators} are iterators that can be used to access elements at an - * arbitrary offset position relative to the element they point to, offering the same functionality as pointers. - *

- * - *

{@link IArrayIterator Random-access iterators} are the most complete iterators in terms of functionality. - * All pointer types are also valid {@link IArrayIterator random-access iterators}.

- * - *

There is not a single type of {@link IArrayIterator random-access iterator}: Each container may define its - * own specific iterator type able to iterate through it and access its elements.

- * - *

- * - *

- * - * @reference http://www.cplusplus.com/reference/iterator/RandomAccessIterator - * @author Jeongho Nam - */ - interface IArrayIterator extends ILinearIterator { - /** - * Get index, sequence number of the iterator in the source {@link IArray array}. - * - * @return Sequence number of the iterator in the source {@link IArray array}. - */ - index: number; - /** - * @inheritdoc - */ - prev(): IArrayIterator; - /** - * @inheritdoc - */ - next(): IArrayIterator; - } -} -declare namespace std.base { - /** - *

An interface of containers.

- * - *

{@link IContainer} is an interface designed for sequence containers. Sequence containers of STL - * (Standard Template Library) are based on the {@link IContainer}.

- * - *

- * - *

- * - *

Container properties

- *
- *
Sequence
- *
Elements in sequence containers are ordered in a strict linear sequence. Individual elements are - * accessed by their position in this sequence.
- * - *
Doubly-linked list
- *
Each element keeps information on how to locate the next and the previous elements, allowing - * constant time insert and erase operations before or after a specific element (even of entire ranges), - * but no direct random access.
- *
- * - * @param Type of elements. - * - * @author Jeongho Nam - */ - interface IContainer { - /** - *

Assign new content to content.

- * - *

Assigns new contents to the container, replacing its current contents, and modifying its - * {@link size} accordingly.

- * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - assign>(begin: InputIterator, end: InputIterator): void; - /** - *

Clear content.

- * - *

Removes all elements from the Container, leaving the container with a size of 0.

- */ - clear(): void; - /** - *

Return iterator to beginning.

- * - *

Returns an iterator referring the first element in the

- * - *

Note

- *

If the container is {@link empty}, the returned iterator is same with {@link end end()}.

- * - * @return An iterator to the first element in the The iterator containes the first element's value. - */ - begin(): Iterator; - /** - *

Return iterator to end.

- *

Returns an iterator referring to the past-the-end element in the

- * - *

The past-the-end element is the theoretical element that would follow the last element in the - * It does not point to any element, and thus shall not be dereferenced.

- * - *

Because the ranges used by functions of the Container do not include the element reference by their - * closing iterator, this function is often used in combination with {@link IContainer}.{@link begin} to - * specify a range including all the elements in the container.

- * - *

Note

- *

Returned iterator from {@link IContainer}.{@link end} does not refer any element. Trying to accessing - * element by the iterator will cause throwing exception ({@link OutOfRange}).

- * - *

If the container is {@link empty}, this function returns the same as {@link Container}.{@link begin}. - *

- * - * @return An iterator to the end element in the - */ - end(): Iterator; - /** - *

Return {@link ReverseIterator reverse iterator} to reverse beginning.

- * - *

Returns a {@link ReverseIterator reverse iterator} pointing to the last element in the container (i.e., - * its reverse beginning).

- * - *

{@link ReverseIterator reverse iterators} iterate backwards: increasing them moves them towards the - * beginning of the

- * - *

{@link rbegin} points to the element right before the one that would be pointed to by member {@link end}. - *

- * - * @return A {@link ReverseIterator reverse iterator} to the reverse beginning of the sequence - */ - rbegin(): base.IReverseIterator; - /** - *

Return {@link ReverseIterator reverse iterator} to reverse end.

- * - *

Returns a {@link ReverseIterator reverse iterator} pointing to the theoretical element preceding the - * first element in the container (which is considered its reverse end).

- * - *

The range between {@link IContainer}.{@link rbegin} and {@link IContainer}.{@link rend} contains all - * the elements of the container (in reverse order). - * - * @return A {@link ReverseIterator reverse iterator} to the reverse end of the sequence - */ - rend(): base.IReverseIterator; - /** - * Return the number of elements in the Container. - * - * @return The number of elements in the - */ - size(): number; - /** - *

Test whether the container is empty.

- *

Returns whether the container is empty (i.e. whether its size is 0).

- * - *

This function does not modify the container in any way. To clear the content of the container, - * see {@link clear clear()}.

- * - * @return true if the container size is 0, false otherwise. - */ - empty(): boolean; - /** - *

Insert elements.

- * - *

Appends new elements to the container, and returns the new size of the

- * - * @param items New elements to insert. - * - * @return New size of the Container. - */ - push(...items: T[]): number; - /** - *

Insert an element.

- * - *

The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link IContainer.size container size} by the amount of - * elements inserted.

- * - * @param position Position in the {@link IContainer} where the new element is inserted. - * {@link iterator} is a member type, defined as a {@link Iterator random access iterator} - * type that points to elements. - * @param val Value to be copied to the inserted element. - * - * @return An iterator that points to the newly inserted element. - */ - insert(position: Iterator, val: T): Iterator; - /** - *

Erase an element.

- * - *

Removes from the container a single element.

- * - *

This effectively reduces the container size by the number of element removed.

- * - * @param position Iterator pointing to a single element to be removed from the Container. - * - * @return An iterator pointing to the element that followed the last element erased by the function - * call. This is the {@link end Container.end} if the operation erased the last element in the - * sequence. - */ - erase(position: Iterator): Iterator; - /** - *

Erase elements.

- * - *

Removes from the container a range of elements.

- * - *

This effectively reduces the container size by the number of elements removed.

- * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - * - * @return An iterator pointing to the element that followed the last element erased by the function - * call. This is the {@link end Container.end} if the operation erased the last element in - * the sequence. - */ - erase(begin: Iterator, end: Iterator): Iterator; - /** - *

Swap content.

- * - *

Exchanges the content of the container by the content of obj, which is another - * {@link IContainer container} object with same type of elements. Sizes and container type may differ.

- * - *

After the call to this member function, the elements in this container are those which were in obj - * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

- * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

- * - * @param obj Another {@link IContainer container} of the same type of elements (i.e., instantiated - * with the same template parameter, T) whose content is swapped with that of this - * {@link container IContainer}. - */ - swap(obj: IContainer): void; - } - interface IReverseIterator extends ReverseIterator, IReverseIterator> { - } -} -declare namespace std.base { - /** - *

An interface for deque

- * - *

- * - *

- * - * @author Jeongho Nam - */ - interface IDequeContainer extends ILinearContainer { - /** - *

Insert element at beginning.

- * - *

Inserts a new element at the beginning of the {@link IDeque container}, right before its - * current first element. This effectively increases the {@link IDeque container} {@link size} by - * one.

- * - * @param val Value to be inserted as an element. - */ - push_front(val: T): void; - /** - *

Delete first element.

- * - *

Removes the first element in the {@link IDeque container}, effectively reducing its - * {@link size} by one.

- */ - pop_front(): void; - } -} -declare namespace std.base { - /** - *

An interface for linear containers.

- * - *

- * - *

- * - * @author Jeonngho Nam - */ - interface ILinearContainer extends IContainer { - /** - * @inheritdoc - */ - assign>(begin: InputIterator, end: InputIterator): void; - /** - *

Assign container content.

- * - *

Assigns new contents to the {@link IList container}, replacing its current contents, - * and modifying its {@link size} accordingly.

- * - * @param n New size for the - * @param val Value to fill the container with. Each of the n elements in the container will - * be initialized to a copy of this value. - */ - assign(n: number, val: T): void; - /** - *

Access first element.

- *

Returns a value of the first element in the {@link IList container}.

- * - *

Unlike member {@link end end()}, which returns an iterator just past this element, - * this function returns a direct value.

- * - *

Calling this function on an {@link empty} {@link IList container} causes undefined behavior.

- * - * @return A value of the first element of the {@link IList container}. - */ - front(): T; - /** - *

Access last element.

- *

Returns a value of the last element in the {@link IList container}.

- * - *

Unlike member {@link end end()}, which returns an iterator just past this element, - * this function returns a direct value.

- * - *

Calling this function on an {@link empty} {@link IList container} causes undefined behavior.

- * - * @return A value of the last element of the {@link IList container}. - */ - back(): T; - /** - *

Add element at the end.

- * - *

Adds a new element at the end of the {@link IList container}, after its current last element. - * This effectively increases the {@link IList container} {@link size} by one.

- * - * @param val Value to be copied to the new element. - */ - push_back(val: T): void; - /** - *

Delete last element.

- * - *

Removes the last element in the {@link IList container}, effectively reducing the - * {@link IList container} {@link size} by one.

- */ - pop_back(): void; - /** - *

Insert an element.

- * - *

The {@link IList conatiner} is extended by inserting new element before the element at the - * specified position, effectively increasing the {@link IList container} {@link size} by - * one.

- * - * @param position Position in the {@link IList container} where the new elements are inserted. - * {@link iterator} is a member type, defined as a {@link iterator random access iterator} - * type that points to elements. - * @param val Value to be copied to the inserted element. - * - * @return An iterator that points to the newly inserted element. - */ - insert(position: Iterator, val: T): Iterator; - /** - *

Insert elements by range iterators.

- * - *

The {@link IList container} is extended by inserting new elements before the element at the - * specified position, effectively increasing the {@link IList container} {@link size} by - * the number of repeating elements n.

- * - * @param position Position in the {@link IList container} where the new elements are inserted. - * {@link iterator} is a member type, defined as a {@link iterator random access iterator} - * type that points to elements. - * @param n Number of elements to insert. Each element is initialized to a copy of val. - * @param val Value to be copied (or moved) to the inserted elements. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert(position: Iterator, n: number, val: T): Iterator; - /** - *

Insert elements by range iterators.

- * - *

The {@link IList container} is extended by inserting new elements before the element at the - * specified position, effectively increasing the {@link IList container} {@link size} by - * the number of elements inserted by range iterators.

- * - * @param position Position in the {@link IList container} where the new elements are inserted. - * {@link iterator} is a member type, defined as a {@link iterator random access iterator} - * type that points to elements. - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert>(position: Iterator, begin: InputIterator, end: InputIterator): Iterator; - } - /** - * An interface for iterators from linear containers. - * - * {@link ILieanerIterator} is an bi-directional iterator which is created from the related - * {@link ILinearContainer linear containers}. Not only accessing to {@link value} of the pointed element from - * this {@link ILieanerIterator}, but also modifying the {@link value} is possible. - * - * @author Jeongho Nam - */ - interface ILinearIterator extends Iterator { - /** - * @inheritdoc - */ - value: T; - /** - * @inheritdoc - */ - prev(): ILinearIterator; - /** - * @inheritdoc - */ - next(): ILinearIterator; - } -} -declare namespace std { - /** - *

Bi-directional iterator.

- * - *

{@link Iterator Bidirectional iterators} are iterators that can be used to access the sequence of elements - * in a range in both directions (towards the end and towards the beginning).

- * - *

All {@link IArrayIterator random-access iterators} are also valid {@link Iterrator bidirectional iterators}. - *

- * - *

There is not a single type of {@link Iterator bidirectional iterator}: {@link IContainer Each container} - * may define its own specific iterator type able to iterate through it and access its elements.

- * - *

- * - *

- * - * @reference http://www.cplusplus.com/reference/iterator/BidirectionalIterator - * @author Jeongho Nam - */ - abstract class Iterator { - /** - * Source container of the iterator is directing for. - */ - protected source_: base.IContainer; - /** - * Construct from the source {@link IContainer container}. - * - * @param source The source container. - */ - protected constructor(source: base.IContainer); - /** - *

Get iterator to previous element.

- *

If current iterator is the first item(equal with {@link IContainer.begin IContainer.begin()}), - * returns {@link IContainer.end IContainer.end()}.

- * - * @return An iterator of the previous item. - */ - abstract prev(): Iterator; - /** - *

Get iterator to next element.

- *

If current iterator is the last item, returns {@link IContainer.end IContainer.end()}.

- * - * @return An iterator of the next item. - */ - abstract next(): Iterator; - /** - * Advances the {@link Iterator} by n element positions. - * - * @param n Number of element positions to advance. - * @return An advanced iterator. - */ - advance(n: number): Iterator; - /** - * Get source - */ - get_source(): base.IContainer; - /** - *

Whether an iterator is equal with the iterator.

- * - *

Compare two iterators and returns whether they are equal or not.

- * - *

Note

- *

Iterator's {@link equals equals()} only compare souce container and index number.

- * - *

Although elements in a pair, key and value are {@link std.equal_to equal_to}, if the source map or - * index number is different, then the {@link equals equals()} will return false. If you want to - * compare the elements of a pair, compare them directly by yourself.

- * - * @param obj An iterator to compare - * @return Indicates whether equal or not. - */ - equals(obj: Iterator): boolean; - /** - *

Get value of the iterator is pointing.

- * - * @return A value of the iterator. - */ - readonly abstract value: T; - abstract swap(obj: Iterator): void; - } -} -declare namespace std { - /** - *

This class reverses the direction in which a bidirectional or random-access iterator iterates through a range. - *

- * - *

A copy of the original iterator (the {@link Iterator base iterator}) is kept internally and used to reflect - * the operations performed on the {@link ReverseIterator}: whenever the {@link ReverseIterator} is incremented, its - * {@link Iterator base iterator} is decreased, and vice versa. A copy of the {@link Iterator base iterator} with the - * current state can be obtained at any time by calling member {@link base}.

- * - *

Notice however that when an iterator is reversed, the reversed version does not point to the same element in - * the range, but to the one preceding it. This is so, in order to arrange for the past-the-end element of a - * range: An iterator pointing to a past-the-end element in a range, when reversed, is pointing to the last element - * (not past it) of the range (this would be the first element of the reversed range). And if an iterator to the - * first element in a range is reversed, the reversed iterator points to the element before the first element (this - * would be the past-the-end element of the reversed range).

- * - *

- * - *

- * - * @reference http://www.cplusplus.com/reference/iterator/reverse_iterator - * @author Jeongho Nam - */ - abstract class ReverseIterator, This extends ReverseIterator> extends Iterator { - /** - * @hidden - */ - protected base_: Base; - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - protected constructor(base: Base); - /** - *

Return base iterator.

- * - *

Return a reference of the base iteraotr.

- * - *

The base iterator is an iterator of the same type as the one used to construct the {@link ReverseIterator}, - * but pointing to the element next to the one the {@link ReverseIterator} is currently pointing to - * (a {@link ReverseIterator} has always an offset of -1 with respect to its base iterator). - * - * @return A reference of the base iterator, which iterates in the opposite direction. - */ - base(): Base; - /** - * @hidden - */ - protected abstract _Create_neighbor(base: Base): This; - /** - *

Get value of the iterator is pointing.

- * - * @return A value of the reverse iterator. - */ - readonly value: T; - /** - * @inheritdoc - */ - prev(): This; - /** - * @inheritdoc - */ - next(): This; - /** - * @inheritdoc - */ - advance(n: number): This; - /** - * @inheritdoc - */ - equals(obj: This): boolean; - /** - * @inheritdoc - */ - swap(obj: This): void; - } - /** - *

Return distance between {@link Iterator iterators}.

- * - *

Calculates the number of elements between first and last.

- * - *

If it is a {@link IArrayIterator random-access iterator}, the function uses operator- to calculate this. - * Otherwise, the function uses the increase operator {@link Iterator.next next()} repeatedly.

- * - * @param first Iterator pointing to the initial element. - * @param last Iterator pointing to the final element. This must be reachable from first. - * - * @return The number of elements between first and last. - */ - function distance>(first: InputIterator, last: InputIterator): number; - /** - *

Advance iterator.

- * - *

Advances the iterator it by n elements positions.

- * - * @param it Iterator to be advanced. - * @param n Number of element positions to advance. - * - * @return An iterator to the element n positions before it. - */ - function advance>(it: InputIterator, n: number): InputIterator; - /** - *

Get iterator to previous element.

- * - *

Returns an iterator pointing to the element that it would be pointing to if advanced -n positions.

- * - * @param it Iterator to base position. - * @param n Number of element positions offset (1 by default). - * - * @return An iterator to the element n positions before it. - */ - function prev>(it: BidirectionalIterator, n?: number): BidirectionalIterator; - /** - *

Get iterator to next element.

- * - *

Returns an iterator pointing to the element that it would be pointing to if advanced n positions.

- * - * @param it Iterator to base position. - * @param n Number of element positions offset (1 by default). - * - * @return An iterator to the element n positions away from it. - */ - function next>(it: ForwardIterator, n?: number): ForwardIterator; - /** - *

Iterator to beginning.

- * - *

Returns an iterator pointing to the first element in the sequence.

- * - *

If the sequence is empty, the returned value shall not be dereferenced.

- * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: Vector): VectorIterator; - /** - *

Iterator to beginning.

- * - *

Returns an iterator pointing to the first element in the sequence.

- * - *

If the sequence is empty, the returned value shall not be dereferenced.

- * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: List): ListIterator; - /** - *

Iterator to beginning.

- * - *

Returns an iterator pointing to the first element in the sequence.

- * - *

If the sequence is empty, the returned value shall not be dereferenced.

- * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: Deque): DequeIterator; - /** - *

Iterator to beginning.

- * - *

Returns an iterator pointing to the first element in the sequence.

- * - *

If the sequence is empty, the returned value shall not be dereferenced.

- * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: base.SetContainer): SetIterator; - /** - *

Iterator to beginning.

- * - *

Returns an iterator pointing to the first element in the sequence.

- * - *

If the sequence is empty, the returned value shall not be dereferenced.

- * - * @param container A container object of a class type for which member {@link IContainer.begin begin} is defined. - * - * @return The same as returned by {@link IContainer.begin container.begin()}. - */ - function begin(container: base.MapContainer): MapIterator; - /** - *

Iterator to end.

- * - *

Returns an iterator pointing to the past-the-end element in the sequence.

- * - *

If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

- * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: Vector): VectorIterator; - /** - *

Iterator to end.

- * - *

Returns an iterator pointing to the past-the-end element in the sequence.

- * - *

If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

- * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: List): ListIterator; - /** - *

Iterator to end.

- * - *

Returns an iterator pointing to the past-the-end element in the sequence.

- * - *

If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

- * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: Deque): DequeIterator; - /** - *

Iterator to end.

- * - *

Returns an iterator pointing to the past-the-end element in the sequence.

- * - *

If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

- * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: base.SetContainer): SetIterator; - /** - *

Iterator to end.

- * - *

Returns an iterator pointing to the past-the-end element in the sequence.

- * - *

If the sequence is {@link IContainer.empty empty}, the returned value compares equal to the one returned by {@link begin} with the same argument.

- * - * @param container A container of a class type for which member {@link IContainer.end end} is defined. - * - * @return The same as returned by {@link IContainer.end container.end()}. - */ - function end(container: base.MapContainer): MapIterator; -} -declare namespace std.base { - /** - * An abstract list. - * - *

{@link ListContainer}s are sequence containers that allow constant time insert and erase operations anywhere - * within the sequence, and iteration in both directions.

- * - *

List containers are implemented as doubly-linked lists; Doubly linked lists can store each of the elements they - * contain in different and unrelated storage locations. The ordering is kept internally by the association to each - * element of a link to the element preceding it and a link to the element following it.

- * - *

Compared to other base standard sequence containers (array, vector and deque), lists perform generally better - * in inserting, extracting and moving elements in any position within the container for which an iterator has already - * been obtained, and therefore also in algorithms that make intensive use of these, like sorting algorithms.

- * - *

The main drawback of lists and forward_lists compared to these other sequence containers is that they lack - * direct access to the elements by their position; For example, to access the sixth element in a list, one has to - * iterate from a known position (like the beginning or the end) to that position, which takes linear time in the - * distance between these. They also consume some extra memory to keep the linking information associated to each - * element (which may be an important factor for large lists of small-sized elements).

- * - *

Container properties

- *
- *
Sequence
- *
Elements in sequence containers are ordered in a strict linear sequence. Individual elements are accessed by - * their position in this sequence.
- * - *
Doubly-linked list
- *
Each element keeps information on how to locate the next and the previous elements, allowing constant time - * insert and erase operations before or after a specific element (even of entire ranges), but no direct random - * access.
- *
- * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/list/list/ - * - * @author Jeongho Nam - */ - abstract class ListContainer> extends Container implements IDequeContainer { - /** - * @hidden - */ - private begin_; - /** - * @hidden - */ - private end_; - /** - * @hidden - */ - private size_; - /** - * Default Constructor. - */ - protected constructor(); - /** - * @hidden - */ - protected abstract _Create_iterator(prev: BidirectionalIterator, next: BidirectionalIterator, val: T): BidirectionalIterator; - /** - * @hidden - */ - protected _Set_begin(it: BidirectionalIterator): void; - /** - * @inheritdoc - */ - assign>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - begin(): BidirectionalIterator; - /** - * @inheritdoc - */ - end(): BidirectionalIterator; - /** - * @inheritdoc - */ - size(): number; - /** - * @inheritdoc - */ - front(): T; - /** - * @inheritdoc - */ - back(): T; - /** - * @inheritdoc - */ - push_front(val: T): void; - /** - * @inheritdoc - */ - push_back(val: T): void; - /** - * @inheritdoc - */ - pop_front(): void; - /** - * @inheritdoc - */ - pop_back(): void; - /** - * @inheritdoc - */ - push(...items: T[]): number; - /** - *

Insert an element.

- * - *

The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

- * - *

Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param position Position in the container where the new element is inserted. - * {@link iterator}> is a member type, defined as a - * {@link ListIterator bidirectional iterator} type that points to elements. - * @param val Value to be inserted as an element. - * - * @return An iterator that points to the newly inserted element; val. - */ - insert(position: BidirectionalIterator, val: T): BidirectionalIterator; - /** - *

Insert elements by repeated filling.

- * - *

The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

- * - *

Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param position Position in the container where the new elements are inserted. The {@link iterator} is a - * member type, defined as a {@link ListIterator bidirectional iterator} type that points to - * elements. - * @param size Number of elements to insert. - * @param val Value to be inserted as an element. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert(position: BidirectionalIterator, size: number, val: T): BidirectionalIterator; - /** - *

Insert elements by range iterators.

- * - *

The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

- * - *

Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param position Position in the container where the new elements are inserted. The {@link iterator} is a - * member type, defined as a {@link ListIterator bidirectional iterator} type that points to - * elements. - * @param begin An iterator specifying range of the begining element. - * @param end An iterator specifying range of the ending element. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert>(position: BidirectionalIterator, begin: InputIterator, end: InputIterator): BidirectionalIterator; - /** - * @hidden - */ - private insert_by_val(position, val); - /** - * @hidden - */ - protected _Insert_by_repeating_val(position: BidirectionalIterator, size: number, val: T): BidirectionalIterator; - /** - * @hidden - */ - protected _Insert_by_range>(position: BidirectionalIterator, begin: InputIterator, end: InputIterator): BidirectionalIterator; - /** - *

Erase an element.

- * - *

Removes from the {@link List} either a single element; position.

- * - *

This effectively reduces the container size by the number of element removed.

- * - *

Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param position Iterator pointing to a single element to be removed from the {@link List}. - * - * @return An iterator pointing to the element that followed the last element erased by the function call. - * This is the {@link end end()} if the operation erased the last element in the sequence. - */ - erase(position: BidirectionalIterator): BidirectionalIterator; - /** - *

Erase elements.

- * - *

Removes from the {@link List} container a range of elements.

- * - *

This effectively reduces the container {@link size} by the number of elements removed.

- * - *

Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - * - * @return An iterator pointing to the element that followed the last element erased by the function call. - * This is the {@link end end()} if the operation erased the last element in the sequence. - */ - erase(begin: BidirectionalIterator, end: BidirectionalIterator): BidirectionalIterator; - /** - * @hidden - */ - protected _Erase_by_range(first: BidirectionalIterator, last: BidirectionalIterator): BidirectionalIterator; - /** - *

Swap content.

- * - *

Exchanges the content of the container by the content of obj, which is another - * {@link List container} object with same type of elements. Sizes and container type may differ.

- * - *

After the call to this member function, the elements in this container are those which were in obj - * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

- * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

- * - * @param obj Another {@link List container} of the same type of elements (i.e., instantiated - * with the same template parameter, T) whose content is swapped with that of this - * {@link container List}. - */ - swap(obj: ListContainer): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std.base { - /** - * An iterator, node of a List-based container. - * - * - * - * - * - * @author Jeongho Nam - */ - abstract class ListIteratorBase extends Iterator { - /** - * @hidden - */ - private prev_; - /** - * @hidden - */ - private next_; - /** - * @hidden - */ - protected value_: T; - /** - * Initializer Constructor. - * - * @param source The source {@link Container} to reference. - * @param prev A refenrece of previous node ({@link ListIterator iterator}). - * @param next A refenrece of next node ({@link ListIterator iterator}). - * @param value Value to be stored in the node (iterator). - */ - protected constructor(source: Container, prev: ListIteratorBase, next: ListIteratorBase, value: T); - /** - * @inheritdoc - */ - prev(): ListIteratorBase; - /** - * @inheritdoc - */ - next(): ListIteratorBase; - /** - * @inheritdoc - */ - advance(step: number): ListIteratorBase; - /** - * @inheritdoc - */ - readonly value: T; - /** - * @inheritdoc - */ - equals(obj: ListIteratorBase): boolean; - /** - * @inheritdoc - */ - swap(obj: ListIteratorBase): void; - } -} -declare namespace std.base { - /** - *

An abstract map.

- * - *

{@link MapContainer MapContainers} are associative containers that store elements formed by a combination - * of a key value (Key) and a mapped value (T), and which allows for fast retrieval - * of individual elements based on their keys.

- * - *

In a {@link MapContainer}, the key values are generally used to identify the elements, while the - * mapped values store the content associated to this key. The types of key and - * mapped value may differ, and are grouped together in member type value_type, which is a - * {@link Pair} type combining both:

- * - *

typedef pair value_type;

- * - *

{@link MapContainer} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

- * - *

- *

- * - *

Container properties

- *
- *
Associative
- *
- * Elements in associative containers are referenced by their key and not by their absolute position - * in the container. - *
- * - *
Map
- *
- * Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value. - *
- *
- * - * @param Type of the keys. Each element in a map is identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @author Jeongho Nam - */ - abstract class MapContainer extends Container> { - /** - *

{@link List} storing elements.

- * - *

Storing elements and keeping those sequence of the {@link MapContainer} are implemented by - * {@link data_ this list container}. Implementing index-table is also related with {@link data_ this list} - * by storing {@link ListIterator iterators} ({@link MapIterator} references {@link ListIterator}) who are - * created from {@link data_ here}.

- */ - private data_; - /** - * Default Constructor. - */ - protected constructor(); - /** - * @inheritdoc - */ - assign>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - clear(): void; - /** - *

Get iterator to element.

- * - *

Searches the container for an element with a identifier equivalent to key and returns an - * iterator to it if found, otherwise it returns an iterator to {@link end end()}.

- * - *

Two keys are considered equivalent if the container's comparison object returns false reflexively - * (i.e., no matter the order in which the elements are passed as arguments).

- * - *

Another member functions, {@link has has()} and {@link count count()}, can be used to just check - * whether a particular key exists.

- * - * @param key Key to be searched for - * @return An iterator to the element, if an element with specified key is found, or - * {@link end end()} otherwise. - */ - abstract find(key: Key): MapIterator; - /** - *

Return iterator to beginning.

- * - *

Returns an iterator referring the first element in the

- * - *

Note

- *

If the container is {@link empty}, the returned iterator is same with {@link end end()}.

- * - * @return An iterator to the first element in the The iterator containes the first element's value. - */ - begin(): MapIterator; - /** - *

Return iterator to end.

- *

Returns an iterator referring to the past-the-end element in the

- * - *

The past-the-end element is the theoretical element that would follow the last element in the - * It does not point to any element, and thus shall not be dereferenced.

- * - *

Because the ranges used by functions of the container do not include the element reference by their - * closing iterator, this function is often used in combination with {@link MapContainer}.{@link begin} to - * specify a range including all the elements in the

- * - *

Note

- *

Returned iterator from {@link MapContainer}.{@link end} does not refer any element. Trying to accessing - * element by the iterator will cause throwing exception ({@link OutOfRange}).

- * - *

If the container is {@link empty}, this function returns the same as {@link begin}.

- * - * @return An iterator to the end element in the - */ - end(): MapIterator; - /** - *

Return {@link MapReverseIterator reverse iterator} to reverse beginning.

- * - *

Returns a {@link MapReverseIterator reverse iterator} pointing to the last element in the container - * (i.e., its reverse beginning).

- * - * {@link MapReverseIterator Reverse iterators} iterate backwards: increasing them moves them towards the - * beginning of the container.

- * - *

{@link rbegin} points to the element preceding the one that would be pointed to by member {@link end}. - *

7 - * - * @return A {@link MapReverseIterator reverse iterator} to the reverse beginning of the sequence - * - */ - rbegin(): MapReverseIterator; - /** - *

Return {@link MapReverseIterator reverse iterator} to reverse end.

- * - *

Returns a {@link MapReverseIterator reverse iterator} pointing to the theoretical element right before - * the first element in the {@link MapContainer map container} (which is considered its reverse end). - *

- * - *

The range between {@link MapContainer}.{@link rbegin} and {@link MapContainer}.{@link rend} contains - * all the elements of the container (in reverse order).

- * - * @return A {@link MapReverseIterator reverse iterator} to the reverse end of the sequence - */ - rend(): MapReverseIterator; - /** - *

Whether have the item or not.

- * - *

Indicates whether a map has an item having the specified identifier.

- * - * @param key Key value of the element whose mapped value is accessed. - * - * @return Whether the map has an item having the specified identifier. - */ - has(key: Key): boolean; - /** - *

Count elements with a specific key.

- * - *

Searches the container for elements whose key is key and returns the number of elements found.

- * - * @param key Key value to be searched for. - * - * @return The number of elements in the container with a key. - */ - abstract count(key: Key): number; - /** - * Return the number of elements in the map. - */ - size(): number; - /** - * @inheritdoc - */ - push(...args: Pair[]): number; - /** - * @inheritdoc - */ - push(...args: [Key, T][]): number; - /** - * Construct and insert element with hint - * - * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in - * place using *args* as the arguments for the element's constructor. *hint* points to a location in the - * container suggested as a hint on where to start the search for its insertion point (the container may or - * may not use this suggestion to optimize the insertion operation). - * - * A similar member function exists, {@link insert}, which either copies or moves an existing object into - * the container, and may also take a position *hint*. - * - * @param hint Hint for the position where the element can be inserted. - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - emplace_hint(hint: MapIterator, key: Key, val: T): MapIterator; - /** - * Construct and insert element with hint - * - * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in - * place using *args* as the arguments for the element's constructor. *hint* points to a location in the - * container suggested as a hint on where to start the search for its insertion point (the container may or - * may not use this suggestion to optimize the insertion operation). - * - * A similar member function exists, {@link insert}, which either copies or moves an existing object into - * the container, and may also take a position *hint*. - * - * @param hint Hint for the position where the element can be inserted. - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return An {@link MapIterator iterator} pointing to either the newly inserted element or to the element - * that already had an equivalent key in the {@link MapContainer}. - */ - emplace_hint(hint: MapReverseIterator, key: Key, val: T): MapReverseIterator; - /** - * Construct and insert element with hint - * - * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in - * place using *args* as the arguments for the element's constructor. *hint* points to a location in the - * container suggested as a hint on where to start the search for its insertion point (the container may or - * may not use this suggestion to optimize the insertion operation). - * - * A similar member function exists, {@link insert}, which either copies or moves an existing object into - * the container, and may also take a position *hint*. - * - * @param hint Hint for the position where the element can be inserted. - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - emplace_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * Construct and insert element with hint - * - * Inserts a new element in the {@link MapContainer map container}. This new element is constructed in - * place using *args* as the arguments for the element's constructor. *hint* points to a location in the - * container suggested as a hint on where to start the search for its insertion point (the container may or - * may not use this suggestion to optimize the insertion operation). - * - * A similar member function exists, {@link insert}, which either copies or moves an existing object into - * the container, and may also take a position *hint*. - * - * @param hint Hint for the position where the element can be inserted. - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return An {@link MapIterator iterator} pointing to either the newly inserted element or to the element - * that already had an equivalent key in the {@link MapContainer}. - */ - emplace_hint(hint: MapReverseIterator, pair: Pair): MapReverseIterator; - /** - *

Insert an element.

- * - *

Extends the container by inserting a new element, effectively increasing the container {@link size} - * by the number of element inserted (zero or one).

- * - * @param hint Hint for the position where the element can be inserted. - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insert(hint: MapIterator, pair: Pair): MapIterator; - /** - *

Insert an element.

- * - *

Extends the container by inserting a new element, effectively increasing the container {@link size} - * by the number of element inserted (zero or one).

- * - * @param hint Hint for the position where the element can be inserted. - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; - /** - *

Insert an element.

- * - *

Extends the container by inserting new elements, effectively increasing the container {@link size} - * by the number of elements inserted.

- * - * @param hint Hint for the position where the element can be inserted. - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insert(hint: MapIterator, tuple: [L, U]): MapIterator; - /** - *

Insert an element.

- * - *

Extends the container by inserting new elements, effectively increasing the container {@link size} - * by the number of elements inserted.

- * - * @param hint Hint for the position where the element can be inserted. - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link MapContainer}. - */ - insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; - /** - *

Insert elements from range iterators.

- * - *

Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

- * - * @param begin Input iterator specifying initial position of a range of elements. - * @param end Input iterator specifying final position of a range of elements. - * Notice that the range includes all the elements between begin and end, - * including the element pointed by begin but not the one pointed by end. - */ - insert>>(first: InputIterator, last: InputIterator): void; - /** - * @hidden - */ - protected abstract _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - private insert_by_tuple(tuple); - /** - * @hidden - */ - protected abstract _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - private insert_by_hint_with_tuple(hint, tuple); - /** - * @hidden - */ - protected abstract _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - *

Erase an elemet by key.

- * - *

Removes from the {@link MapContainer map container} a single element.

- * - *

This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.

- * - * @param key Key of the element to be removed from the {@link MapContainer}. - */ - erase(key: Key): number; - /** - *

Erase an elemet by iterator.

- * - *

Removes from the {@link MapContainer map container} a single element.

- * - *

This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.

- * - * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. - */ - erase(it: MapIterator): MapIterator; - /** - *

Erase elements by range iterators.

- * - *

Removes from the {@link MapContainer map container} a range of elements.

- * - *

This effectively reduces the container {@link size} by the number of elements removed, which are - * destroyed.

- * - * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * @param end An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * Notice that the range includes all the elements between begin and end, - * including the element pointed by begin but not the one pointed by end. - */ - erase(begin: MapIterator, end: MapIterator): MapIterator; - /** - *

Erase an elemet by iterator.

- * - *

Removes from the {@link MapContainer map container} a single element.

- * - *

This effectively reduces the container {@link size} by the number of element removed (zero or one), - * which are destroyed.

- * - * @param it Iterator specifying position winthin the {@link MapContainer map contaier} to be removed. - */ - erase(it: MapReverseIterator): MapReverseIterator; - /** - *

Erase elements by range iterators.

- * - *

Removes from the {@link MapContainer map container} a range of elements.

- * - *

This effectively reduces the container {@link size} by the number of elements removed, which are - * destroyed.

- * - * @param begin An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * @param end An iterator specifying initial position of a range within {@link MApContainer map container} - * to be removed. - * Notice that the range includes all the elements between begin and end, - * including the element pointed by begin but not the one pointed by end. - */ - erase(begin: MapReverseIterator, end: MapReverseIterator): MapReverseIterator; - /** - * @hidden - */ - private erase_by_key(key); - /** - * @hidden - */ - private erase_by_iterator(first, last?); - /** - * @hidden - */ - private erase_by_range(first, last); - /** - * @hidden - */ - protected _Swap(obj: MapContainer): void; - /** - * Merge two maps. - * - * Extracts and transfers elements from *source* to this container. - * - * @param source A {@link MapContainer map container} to transfer the elements from. - */ - abstract merge(source: MapContainer): void; - /** - *

Abstract method handling insertions for indexing.

- * - *

This method, {@link _Handle_insert} is designed to register the first to last to somewhere storing - * those {@link MapIterator iterators} for indexing, fast accessment and retrievalance.

- * - *

When {@link insert} is called, new elements will be inserted into the {@link data_ list container} and new - * {@link MapIterator iterators} first to last, pointing the inserted elements, will be created and the - * newly created iterators first to last will be shifted into this method {@link _Handle_insert} after the - * insertions.

- * - *

If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link MapIterator iterators} - * will be registered into the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the - * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be - * registered into the {@link HashSet.hash_buckets_ hash bucket}.

- * - * @param first An {@link MapIterator} to the initial position in a sequence. - * @param last An {@link MapIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - */ - protected abstract _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - *

Abstract method handling deletions for indexing.

- * - *

This method, {@link _Handle_erase} is designed to unregister the first to last to somewhere storing - * those {@link MapIterator iterators} for indexing, fast accessment and retrievalance.

- * - *

When {@link erase} is called with first to last, {@link MapIterator iterators} positioning somewhere - * place to be deleted, is memorized and shifted to this method {@link _Handle_erase} after the deletion process is - * terminated.

- * - *

If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link MapIterator iterators} - * will be unregistered from the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the - * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be - * unregistered from the {@link HashSet.hash_buckets_ hash bucket}.

- * - * @param first An {@link MapIterator} to the initial position in a sequence. - * @param last An {@link MapIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - */ - protected abstract _Handle_erase(first: MapIterator, last: MapIterator): void; - } - /** - * @hidden - */ - class MapElementList extends ListContainer, MapIterator> { - private associative_; - private rend_; - constructor(associative: MapContainer); - protected _Create_iterator(prev: MapIterator, next: MapIterator, val: Pair): MapIterator; - protected _Set_begin(it: MapIterator): void; - get_associative(): MapContainer; - rbegin(): MapReverseIterator; - rend(): MapReverseIterator; - } -} -declare namespace std { - /** - *

An iterator of {@link MapContainer map container}.

- * - *

- *

- * - * @author Jeongho Nam - */ - class MapIterator extends base.ListIteratorBase> implements IComparable> { - /** - * Construct from the {@link MapContainer source map} and {@link ListIterator list iterator}. - * - * @param source The source {@link MapContainer}. - * @param list_iterator A {@link ListIterator} pointing {@link Pair} of key and value. - */ - constructor(source: base.MapElementList, prev: MapIterator, next: MapIterator, val: Pair); - /** - * Get iterator to previous element. - */ - prev(): MapIterator; - /** - * Get iterator to next element. - */ - next(): MapIterator; - /** - * Advances the Iterator by n element positions. - * - * @param step Number of element positions to advance. - * @return An advanced Iterator. - */ - advance(step: number): MapIterator; - /** - * @hidden - */ - get_source(): base.MapContainer; - /** - * Get first, key element. - */ - readonly first: Key; - /** - * Get second, value element. - */ - /** - * Set second value. - */ - second: T; - /** - * @inheritdoc - */ - less(obj: MapIterator): boolean; - /** - * @inheritdoc - */ - equals(obj: MapIterator): boolean; - /** - * @inheritdoc - */ - hashCode(): number; - /** - * @inheritdoc - */ - swap(obj: MapIterator): void; - } - /** - *

A reverse-iterator of {@link MapContainer map container}.

- * - *

- *

- * - * @author Jeongho Nam - */ - class MapReverseIterator extends ReverseIterator, MapIterator, MapReverseIterator> { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: MapIterator); - /** - * @hidden - */ - protected _Create_neighbor(base: MapIterator): MapReverseIterator; - /** - * Get first, key element. - */ - readonly first: Key; - /** - * Get second, value element. - */ - /** - * Set second value. - */ - second: T; - } -} -declare namespace std.base { - /** - *

An abstract multi-map.

- * - *

{@link MultiMap MultiMaps} are associative containers that store elements formed by a combination of a - * key value (Key) and a mapped value (T), and which allows for fast retrieval of - * individual elements based on their keys.

- * - *

In a {@link MapContainer}, the key values are generally used to identify the elements, while the - * mapped values store the content associated to this key. The types of key and - * mapped value may differ, and are grouped together in member type value_type, which is a - * {@link Pair} type combining both:

- * - *

typedef pair value_type;

- * - *

{@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

- * - *

- *

- * - *

Container properties

- *
- *
Associative
- *
- * Elements in associative containers are referenced by their key and not by their absolute position - * in the container. - *
- * - *
Map
- *
- * Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value. - *
- * - *
Multiple equivalent keys
- *
Multiple elements in the container can have equivalent keys.
- *
- * - * @param Type of the keys. Each element in a map is identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @author Jeongho Nam - */ - abstract class MultiMap extends MapContainer { - /** - * Construct and insert element. - * - * Inserts a new element in the {@link MultiMap}. This new element is constructed in place using args - * as the arguments for the element's constructor. - * - * This effectively increases the container {@link size} by one. - * - * A similar member function exists, {@link insert}, which either copies or moves existing objects into the - * container. - * - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return An {@link MapIterator iterator} to the newly inserted element. - */ - emplace(key: Key, value: T): MapIterator; - /** - * Construct and insert element. - * - * Inserts a new element in the {@link MultiMap}. This new element is constructed in place using args - * as the arguments for the element's constructor. - * - * This effectively increases the container {@link size} by one. - * - * A similar member function exists, {@link insert}, which either copies or moves existing objects into the - * container. - * - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * @return An {@link MapIterator iterator} to the newly inserted element. - */ - emplace(pair: Pair): MapIterator; - /** - *

Insert elements.

- * - *

Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

- * - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return An iterator pointing to the newly inserted element. - */ - insert(pair: Pair): MapIterator; - /** - *

Insert elements.

- * - *

Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

- * - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return An iterator pointing to the newly inserted element. - */ - insert(tuple: [L, U]): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapIterator, pair: Pair): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; - /** - * @inheritdoc - */ - insert(hint: MapIterator, tuple: [L, U]): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; - /** - * @inheritdoc - */ - insert>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - merge(source: MapContainer): void; - } -} -declare namespace std.base { - /** - *

An abstract set.

- * - *

{@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of - * individual elements based on their value.

- * - *

In an {@link SetContainer}, the value of an element is at the same time its key, used to - * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be - * modified once in the container - they can be inserted and removed, though.

- * - *

{@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

- * - *

- *

- * - *

Container properties

- *
- *
Associative
- *
- * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
- * - *
Set
- *
The value of an element is also the key used to identify it.
- *
- * - * @param Type of the elements. Each element in a {@link SetContainer} container is also identified - * by this value (each value is itself also the element's key). - * - * @author Jeongho Nam - */ - abstract class SetContainer extends Container { - /** - *

{@link List} storing elements.

- * - *

Storing elements and keeping those sequence of the {@link SetContainer} are implemented by - * {@link data_ this list container}. Implementing index-table is also related with {@link data_ this list} - * by storing {@link ListIterator iterators} ({@link SetIterator} references {@link ListIterator}) who are - * created from {@link data_ here}.

- */ - private data_; - /** - * Default Constructor. - */ - protected constructor(); - /** - * @inheritdoc - */ - assign>(begin: Iterator, end: Iterator): void; - /** - * @inheritdoc - */ - clear(): void; - /** - *

Get iterator to element.

- * - *

Searches the container for an element with key as value and returns an iterator to it if found, - * otherwise it returns an iterator to {@link end end()} (the element past the end of the container).

- * - *

Another member function, {@link count count()}, can be used to just check whether a particular element - * exists.

- * - * @param key Key to be searched for. - * - * @return An iterator to the element, if the specified value is found, or {@link end end()} if it is not - * found in the - */ - abstract find(val: T): SetIterator; - /** - * @inheritdoc - */ - begin(): SetIterator; - /** - * @inheritdoc - */ - end(): SetIterator; - /** - * @inheritdoc - */ - rbegin(): SetReverseIterator; - /** - * @inheritdoc - */ - rend(): SetReverseIterator; - /** - *

Whether have the item or not.

- * - *

Indicates whether a set has an item having the specified identifier.

- * - * @param key Key value of the element whose mapped value is accessed. - * - * @return Whether the set has an item having the specified identifier. - */ - has(val: T): boolean; - /** - *

Count elements with a specific key.

- * - *

Searches the container for elements with a value of k and returns the number of elements found.

- * - * @param key Value of the elements to be counted. - * - * @return The number of elements in the container with a key. - */ - abstract count(val: T): number; - /** - * @inheritdoc - */ - size(): number; - /** - * @inheritdoc - */ - push(...args: T[]): number; - /** - *

Insert an element with hint.

- * - *

Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.

- * - * @param hint Hint for the position where the element can be inserted. - * @param val Value to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had its - * same value in the {@link SetContainer}. - */ - insert(hint: SetIterator, val: T): SetIterator; - /** - *

Insert an element with hint.

- * - *

Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.

- * - * @param hint Hint for the position where the element can be inserted. - * @param val Value to be inserted as an element. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had its - * same value in the {@link SetContainer}. - */ - insert(hint: SetReverseIterator, val: T): SetReverseIterator; - /** - *

Insert elements with a range of a

- * - *

Extends the container by inserting new elements, effectively increasing the container size by the - * number of elements inserted.

- * - * @param begin An iterator specifying range of the begining element. - * @param end An iterator specifying range of the ending element. - */ - insert>(begin: InputIterator, end: InputIterator): void; - /** - * @hidden - */ - protected abstract _Insert_by_val(val: T): any; - /** - * @hidden - */ - protected abstract _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected abstract _Insert_by_range>(begin: InputIterator, end: InputIterator): void; - /** - *

Erase an element.

- *

Removes from the set container the elements whose value is key.

- * - *

This effectively reduces the container size by the number of elements removed.

- * - * @param key Value of the elements to be erased. - * - * @return Number of elements erased. - */ - erase(val: T): number; - /** - * @inheritdoc - */ - erase(it: SetIterator): SetIterator; - /** - *

Erase elements.

- *

Removes from the set container a range of elements..

- * - *

This effectively reduces the container size by the number of elements removed.

- * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - */ - erase(begin: SetIterator, end: SetIterator): SetIterator; - /** - * @inheritdoc - */ - erase(it: SetReverseIterator): SetReverseIterator; - /** - *

Erase elements.

- *

Removes from the set container a range of elements..

- * - *

This effectively reduces the container size by the number of elements removed.

- * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - */ - erase(begin: SetReverseIterator, end: SetReverseIterator): SetReverseIterator; - /** - * @hidden - */ - private erase_by_iterator(first, last?); - /** - * @hidden - */ - private erase_by_val(val); - /** - * @hidden - */ - private erase_by_range(first, last); - /** - * @hidden - */ - protected _Swap(obj: SetContainer): void; - /** - * Merge two sets. - * - * Extracts and transfers elements from *source* to this container. - * - * @param source A {@link SetContainer set container} to transfer the elements from. - */ - abstract merge(source: SetContainer): void; - /** - *

Abstract method handling insertions for indexing.

- * - *

This method, {@link _Handle_insert} is designed to register the first to last to somewhere storing - * those {@link SetIterator iterators} for indexing, fast accessment and retrievalance.

- * - *

When {@link insert} is called, new elements will be inserted into the {@link data_ list container} and new - * {@link SetIterator iterators} first to last, pointing the inserted elements, will be created and the - * newly created iterators first to last will be shifted into this method {@link _Handle_insert} after the - * insertions.

- * - *

If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link SetIterator iterators} - * will be registered into the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the - * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be - * registered into the {@link HashSet.hash_buckets_ hash bucket}.

- * - * @param first An {@link SetIterator} to the initial position in a sequence. - * @param last An {@link SetIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - */ - protected abstract _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - *

Abstract method handling deletions for indexing.

- * - *

This method, {@link _Handle_erase} is designed to unregister the first to last to somewhere storing - * those {@link SetIterator iterators} for indexing, fast accessment and retrievalance.

- * - *

When {@link erase} is called with first to last, {@link SetIterator iterators} positioning somewhere - * place to be deleted, is memorized and shifted to this method {@link _Handle_erase} after the deletion process is - * terminated.

- * - *

If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link SetIterator iterators} - * will be unregistered from the {@link TreeSet.tree_ tree} as a {@link XTreeNode tree node item}. Else if the - * derived one is {@link HashBuckets hash-based} like {@link HashSet}, the first to last will be - * unregistered from the {@link HashSet.hash_buckets_ hash bucket}.

- * - * @param first An {@link SetIterator} to the initial position in a sequence. - * @param last An {@link SetIterator} to the final position in a sequence. The range used is - * [first, last), which contains all the elements between first and last, - * including the element pointed by first but not the element pointed by last. - */ - protected abstract _Handle_erase(first: SetIterator, last: SetIterator): void; - } - /** - * @hidden - */ - class SetElementList extends ListContainer> { - private associative_; - private rend_; - constructor(associative: SetContainer); - protected _Create_iterator(prev: SetIterator, next: SetIterator, val: T): SetIterator; - protected _Set_begin(it: SetIterator): void; - get_associative(): SetContainer; - rbegin(): SetReverseIterator; - rend(): SetReverseIterator; - } -} -declare namespace std { - /** - *

An iterator of a Set.

- * - *

- *

- * - * @author Jeongho Nam - */ - class SetIterator extends base.ListIteratorBase implements IComparable> { - /** - *

Construct from source and index number.

- * - *

Note

- *

Do not create iterator directly.

- *

Use begin(), find() or end() in Map instead.

- * - * @param map The source Set to reference. - * @param index Sequence number of the element in the source Set. - */ - constructor(source: base.SetElementList, prev: SetIterator, next: SetIterator, val: T); - /** - * @inheritdoc - */ - get_source(): base.SetContainer; - /** - * @inheritdoc - */ - prev(): SetIterator; - /** - * @inheritdoc - */ - next(): SetIterator; - /** - * @inheritdoc - */ - advance(size: number): SetIterator; - /** - * @inheritdoc - */ - less(obj: SetIterator): boolean; - /** - * @inheritdoc - */ - equals(obj: SetIterator): boolean; - /** - * @inheritdoc - */ - hashCode(): number; - /** - * @inheritdoc - */ - swap(obj: SetIterator): void; - } - /** - *

A reverse-iterator of Set.

- * - *

- *

- * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class SetReverseIterator extends ReverseIterator, SetReverseIterator> { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: SetIterator); - /** - * @hidden - */ - protected _Create_neighbor(base: SetIterator): SetReverseIterator; - } -} -declare namespace std.base { - /** - *

An abstract set.

- * - *

{@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of - * individual elements based on their value.

- * - *

In an {@link SetContainer}, the value of an element is at the same time its key, used to - * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be - * modified once in the container - they can be inserted and removed, though.

- * - *

{@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

- * - *

- *

- * - *

Container properties

- *
- *
Associative
- *
- * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
- * - *
Set
- *
The value of an element is also the key used to identify it.
- * - *
Multiple equivalent keys
- *
Multiple elements in the container can have equivalent keys.
- *
- * - * @param Type of the elements. Each element in a {@link SetContainer} container is also identified - * by this value (each value is itself also the element's key). - * - * @author Jeongho Nam - */ - abstract class MultiSet extends SetContainer { - /** - *

Insert an element.

- * - *

Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of elements inserted.

- * - * @param key Value to be inserted as an element. - * - * @return An iterator to the newly inserted element. - */ - insert(val: T): SetIterator; - /** - * @inheritdoc - */ - insert(hint: SetIterator, val: T): SetIterator; - /** - * @inheritdoc - */ - insert(hint: SetReverseIterator, val: T): SetReverseIterator; - /** - * @inheritdoc - */ - insert>(begin: InputIterator, end: InputIterator): void; - /** - * @inheritdoc - */ - merge(source: SetContainer): void; - } -} -declare namespace std.base { - /** - *

Red-black Tree.

- * - *

A red-black tree is a kind of self-balancing - * binary search tree. Each node of the binary tree has an extra bit, and that bit is often interpreted as the - * color (red or black) of the node. These color bits - * are used to ensure the tree remains approximately balanced during insertions and deletions.

- * - *

Balance is preserved by painting each node of the tree with one of two colors (typically called - * 'red' and 'black') in a way that satisfies certain - * properties, which collectively constrain how unbalanced the tree can become in the worst case. When the tree - * is modified, the new tree is subsequently rearranged and repainted to restore the coloring properties. The - * properties are designed in such a way that this rearranging and recoloring can be performed efficiently.

- * - *

The balancing of the tree is not perfect but it is good enough to allow it to guarantee searching in - * O(log n) time, where n is the total number of elements in the tree. The insertion and deletion operations, - * along with the tree rearrangement and recoloring, are also performed in O(log n) time.

- * - *

Tracking the color of each node requires only 1 bit of information per node because there are only two - * colors. The tree does not contain any other data specific to its being a - * red-black tree so its memory footprint is almost - * identical to a classic (uncolored) binary search tree. In many cases the additional bit of information can - * be stored at no additional memory cost.

- * - *

Properties

- *

In addition to the requirements imposed on a binary search tree the following must be satisfied by a - * red-black tree:

- * - *
    - *
  1. A node is either red or black.
  2. - *
  3. - * The root is black. This rule is sometimes omitted. Since the root can - * always be changed from red to black, but not - * necessarily vice versa, this rule has little effect on analysis. - *
  4. - *
  5. All leaves (NIL; null) are black.
  6. - *
  7. - * If a node is red, then both its children are - * black. - *
  8. - *
  9. - * Every path from a given node to any of its descendant NIL nodes contains the same number of - * black nodes. Some definitions: the number of - * black nodes from the root to a node is the node's - * black depth; the uniform number of black - * nodes in all paths from root to the leaves is called the black-height of - * the red-black tree. - *
  10. - *
- * - *

- * - *

These constraints enforce a critical property of red-black trees: the path from the root to the farthest - * leaf is no more than twice as long as the path from the root to the nearest leaf. The result is that the tree - * is roughly height-balanced. Since operations such as inserting, deleting, and finding values require - * worst-case time proportional to the height of the tree, this theoretical upper bound on the height allows - * red-black trees to be efficient in the worst case, unlike ordinary binary search trees.

- * - *

To see why this is guaranteed, it suffices to consider the effect of properties 4 and 5 together. For a - * red-black tree T, let B be the number of black nodes in property 5. Let the - * shortest possible path from the root of T to any leaf consist of B black nodes. - * Longer possible paths may be constructed by inserting red nodes. However, property 4 - * makes it impossible to insert more than one consecutive red node. Therefore, - * ignoring any black NIL leaves, the longest possible path consists of 2*B nodes, - * alternating black and red (this is the worst case). - * Counting the black NIL leaves, the longest possible path consists of 2*B-1 - * nodes.

- * - *

The shortest possible path has all black nodes, and the longest possible - * path alternates between red and black nodes. Since all - * maximal paths have the same number of black nodes, by property 5, this shows - * that no path is more than twice as long as any other path.

- * - * @param Type of elements. - * - * @reference https://en.wikipedia.org/w/index.php?title=Red%E2%80%93black_tree - * @inventor Rudolf Bayer - * @author Migrated by Jeongho Nam - */ - abstract class XTree { - /** - * Root node. - */ - protected root_: XTreeNode; - /** - * Default Constructor. - */ - protected constructor(); - /** - * Clear, removes all tree nodes. - */ - clear(): void; - /** - * Find a node from its contained value. - * - * @param val Value to find. - */ - find(val: T): XTreeNode; - /** - * Fetch maximum (the rightes?) node from one. - * - * @param node A node to fetch its maximum node. - * @return The maximum node. - */ - protected fetch_maximum(node: XTreeNode): XTreeNode; - abstract is_less(left: T, right: T): boolean; - abstract is_equal_to(left: T, right: T): boolean; - /** - *

Insert an element with a new node.

- * - *

Insertion begins by adding the node as any binary search tree insertion does and by coloring it - * red. Whereas in the binary search tree, we always add a leaf, in the red-black - * tree, leaves contain no information, so instead we add a red interior node, with - * two black leaves, in place of an existing - * black leaf.

- * - *

What happens next depends on the color of other nearby nodes. The term uncle node will be used to - * refer to the sibling of a node's parent, as in human family trees. Note that:

- * - *
    - *
  • property 3 (all leaves are black) always holds.
  • - *
  • - * property 4 (both children of every red node are - * black) is threatened only by adding a red - * node, repainting a black node red, or a - * rotation. - *
  • - *
  • - * property 5 (all paths from any given node to its leaf nodes contain the same number of - * black nodes) is threatened only by adding a - * black node, repainting a red node - * black (or vice versa), or a rotation. - *
  • - *
- * - *

Notes

- *
    - *
  1. - * The label N will be used to denote the current node (colored - * red). In the diagrams N carries a blue contour. At the - * beginning, this is the new node being inserted, but the entire procedure may also be applied - * recursively to other nodes (see case 3). {@link XTreeNode.parent P} will denote - * N's parent node, {@link XTreeNode.grand_parent G} will denote N's - * grandparent, and {@link XTreeNode.uncle U} will denote N's uncle. In between - * some cases, the roles and labels of the nodes are exchanged, but in each case, every label continues - * to represent the same node it represented at the beginning of the case. - *
  2. - *
  3. - * If a node in the right (target) half of a diagram carries a blue contour it will become the current - * node in the next iteration and there the other nodes will be newly assigned relative to it. Any - * color shown in the diagram is either assumed in its case or implied by those assumptions. - *
  4. - *
  5. - * A numbered triangle represents a subtree of unspecified depth. A black - * circle atop a triangle means that black-height of subtree is greater - * by one compared to subtree without this circle.
  6. - *
- * - *

There are several cases of red-black tree insertion to handle:

- * - *
    - *
  • N is the root node, i.e., first node of red-black tree.
  • - *
  • - * N's parent ({@link XTreeNode.parent P}) is black. - *
  • - *
  • - * N's parent ({@link XTreeNode.parent P}) and uncle - * ({@link XTreeNode.uncle U}) are red. - *
  • - *
  • - * N is added to right of left child of grandparent, or N is added to left - * of right child of grandparent ({@link XTreeNode.parent P} is red and - * {@link XTreeNode.uncle U} is black). - *
  • - *
  • - * N is added to left of left child of grandparent, or N is added to right - * of right child of grandparent ({@link XTreeNode.parent P} is red and - * {@link XTreeNode.uncle U} is black). - *
  • - *
- * - *

Note

- *

Note that inserting is actually in-place, since all the calls above use tail recursion.

- * - *

In the algorithm above, all cases are chained in order, except in insert case 3 where it can recurse - * to case 1 back to the grandparent node: this is the only case where an iterative implementation will - * effectively loop. Because the problem of repair is escalated to the next higher level but one, it takes - * maximally hâ„2 iterations to repair the tree (where h is the height of the tree). Because the probability - * for escalation decreases exponentially with each iteration the average insertion cost is constant.

- * - * @param val An element to insert. - */ - insert(val: T): void; - /** - *

N is the root node, i.e., first node of red-black tree.

- * - *

The current node N is at the {@link root_ root} of the tree.

- * - *

In this case, it is repainted black to satisfy property 2 (the root is - * black). Since this adds one black node to - * every path at once, property 5 (all paths from any given node to its leaf nodes contain the same number - * of black nodes) is not violated.

- * - * @param N A node to be inserted or swapped. - */ - private insert_case1(N); - /** - *

N's parent ({@link XTreeNode.parent P}) is black.

- * - *

The current node's parent {@link XTreeNode.parent P} is black, - * so property 4 (both children of every red node are - * black) is not invalidated.

- * - *

In this case, the tree is still valid. Property 5 (all paths from any given node to its leaf nodes - * contain the same number of black nodes) is not threatened, because the - * current node N has two black leaf children, but because - * N is red, the paths through each of its children have the same - * number of black nodes as the path through the leaf it replaced, which was - * black, and so this property remains satisfied.

- * - * @param N A node to be inserted or swapped. - */ - private insert_case2(N); - /** - *

N's parent ({@link XTreeNode.parent P}) and uncle - * ({@link XTreeNode.uncle U}) are red.

- * - *

If both the parent {@link XTreeNode.parent P} and the uncle {@link XTreeNode.uncle U} - * are red, then both of them can be repainted black - * and the grandparent {@link XTreeNode.grand_parent G} becomes red (to - * maintain property 5 (all paths from any given node to its leaf nodes contain the same number of - * black nodes)).

- * - *

Now, the current red node N has a - * black parent. Since any path through the parent or uncle must pass through - * the grandparent, the number of black nodes on these paths has not changed. - * - *

However, the grandparent {@link XTreeNode.grand_parent G} may now violate properties 2 (The - * root is black) or 4 (Both children of every red - * node are black) (property 4 possibly being violated since - * {@link XTreeNode.grand_parent G} may have a red parent).

- * - *

To fix this, the entire procedure is recursively performed on {@link XTreeNode.grand_parent G} - * from case 1. Note that this is a tail-recursive call, so it could be rewritten as a loop; since this is - * the only loop, and any rotations occur after this loop, this proves that a constant number of rotations - * occur.

- * - *

- * - * @param N A node to be inserted or swapped. - */ - private insert_case3(N); - /** - *

N is added to right of left child of grandparent, or N is added to left - * of right child of grandparent ({@link XTreeNode.parent P} is red and - * {@link XTreeNode.uncle U} is black).

- * - *

The parent {@link XTreeNode.parent P} is red but the uncle - * {@link XTreeNode.uncle U} is black; also, the current node - * N is the right child of {@link XTreeNode.parent P}, and - * {@link XTreeNode.parent P} in turn is the left child of its parent - * {@link XTreeNode.grand_parent G}.

- * - *

In this case, a left rotation on {@link XTreeNode.parent P} that switches the roles of the - * current node N and its parent {@link XTreeNode.parent P} can be performed; then, - * the former parent node {@link XTreeNode.parent P} is dealt with using case 5 - * (relabeling N and {@link XTreeNode.parent P}) because property 4 (both children of - * every red node are black) is still violated.

- * - *

The rotation causes some paths (those in the sub-tree labelled "1") to pass through the node - * N where they did not before. It also causes some paths (those in the sub-tree labelled "3") - * not to pass through the node {@link XTreeNode.parent P} where they did before. However, both of - * these nodes are red, so property 5 (all paths from any given node to its leaf - * nodes contain the same number of black nodes) is not violated by the - * rotation.

- * - *

After this case has been completed, property 4 (both children of every red - * node are black) is still violated, but now we can resolve this by - * continuing to case 5.

- * - *

- * - * @param N A node to be inserted or swapped. - */ - private insert_case4(node); - /** - *

N is added to left of left child of grandparent, or N is added to right - * of right child of grandparent ({@link XTreeNode.parent P} is red and - * {@link XTreeNode.uncle U} is black).

- * - *

The parent {@link XTreeNode.parent P} is red but the uncle - * {@link XTreeNode.uncle U} is black, the current node N - * is the left child of {@link XTreeNode.parent P}, and {@link XTreeNode.parent P} is the left - * child of its parent {@link XTreeNode.grand_parent G}.

- * - *

In this case, a right rotation on {@link XTreeNode.grand_parent G} is performed; the result is a - * tree where the former parent {@link XTreeNode.parent P} is now the parent of both the current node - * N and the former grandparent {@link XTreeNode.grand_parent G}.

- * - *

{@link XTreeNode.grand_parent G} is known to be black, since its - * former child {@link XTreeNode.parent P} could not have been red otherwise - * (without violating property 4). Then, the colors of {@link XTreeNode.parent P} and - * {@link XTreeNode.grand_parent G} are switched, and the resulting tree satisfies property 4 (both - * children of every red node are black). Property 5 - * (all paths from any given node to its leaf nodes contain the same number of - * black nodes) also remains satisfied, since all paths that went through any - * of these three nodes went through {@link XTreeNode.grand_parent G} before, and now they all go - * through {@link XTreeNode.parent P}. In each case, this is the only - * black node of the three.

- * - *

- * - * @param N A node to be inserted or swapped. - */ - private insert_case5(node); - /** - *

Erase an element with its node.

- * - *

In a regular binary search tree when deleting a node with two non-leaf children, we find either the - * maximum element in its left subtree (which is the in-order predecessor) or the minimum element in its - * right subtree (which is the in-order successor) and move its value into the node being deleted (as shown - * here). We then delete the node we copied the value from, which must have fewer than two non-leaf children. - * (Non-leaf children, rather than all children, are specified here because unlike normal binary search - * trees, red-black trees can have leaf nodes anywhere, so that all nodes are either internal nodes with - * two children or leaf nodes with, by definition, zero children. In effect, internal nodes having two leaf - * children in a red-black tree are like the leaf nodes in a regular binary search tree.) Because merely - * copying a value does not violate any red-black properties, this reduces to the problem of deleting a node - * with at most one non-leaf child. Once we have solved that problem, the solution applies equally to the - * case where the node we originally want to delete has at most one non-leaf child as to the case just - * considered where it has two non-leaf children.

- * - *

Therefore, for the remainder of this discussion we address the deletion of a node with at most one - * non-leaf child. We use the label M to denote the node to be deleted; C will denote a - * selected child of M, which we will also call "its child". If M does have a non-leaf child, - * call that its child, C; otherwise, choose either leaf as its child, C.

- * - *

If M is a red node, we simply replace it with its child C, - * which must be black by property 4. (This can only occur when M has - * two leaf children, because if the red node M had a - * black non-leaf child on one side but just a leaf child on the other side, - * then the count of black nodes on both sides would be different, thus the - * tree would violate property 5.) All paths through the deleted node will simply pass through one fewer - * red node, and both the deleted node's parent and child must be - * black, so property 3 (all leaves are black) - * and property 4 (both children of every red node are - * black) still hold.

- * - *

Another simple case is when M is black and C is - * red. Simply removing a black node could break - * Properties 4 (“Both children of every red node are - * blackâ€) and 5 (“All paths from any given node to its leaf nodes contain the - * same number of black nodesâ€), but if we repaint C - * black, both of these properties are preserved.

- * - *

The complex case is when both M and C are black. (This - * can only occur when deleting a black node which has two leaf children, - * because if the black node M had a black - * non-leaf child on one side but just a leaf child on the other side, then the count of - * black nodes on both sides would be different, thus the tree would have been - * an invalid red-black tree by violation of property 5.) We begin by replacing M with its child - * C. We will relabel this child C (in its new position) N, and its sibling (its - * new parent's other child) {@link XTreeNode.sibling S}. ({@link XTreeNode.sibling S} was - * previously the sibling of M.)

- * - *

In the diagrams below, we will also use {@link XTreeNode.parent P} for N's new - * parent (M's old parent), SL for {@link XTreeNode.sibling S}'s left child, and - * SR for {@link XTreeNode.sibling S}'s right child ({@link XTreeNode.sibling S} cannot - * be a leaf because if M and C were black, then - * {@link XTreeNode.parent P}'s one subtree which included M counted two - * black-height and thus {@link XTreeNode.parent P}'s other subtree - * which includes {@link XTreeNode.sibling S} must also count two - * black-height, which cannot be the case if {@link XTreeNode.sibling S} - * is a leaf node).

- * - *

Notes

- *
    - *
  1. - * The label N will be used to denote the current node (colored - * black). In the diagrams N carries a blue contour. At the - * beginning, this is the replacement node and a leaf, but the entire procedure may also be applied - * recursively to other nodes (see case 3). In between some cases, the roles and labels of the nodes - * are exchanged, but in each case, every label continues to represent the same node it represented at - * the beginning of the case. - *
  2. - *
  3. - * If a node in the right (target) half of a diagram carries a blue contour it will become the current - * node in the next iteration and there the other nodes will be newly assigned relative to it. Any - * color shown in the diagram is either assumed in its case or implied by those assumptions. - * White represents an arbitrary color (either red or - * black), but the same in both halves of the diagram. - *
  4. - *
  5. - * A numbered triangle represents a subtree of unspecified depth. A black - * circle atop a triangle means that black-height of subtree is greater - * by one compared to subtree without this circle. - *
  6. - *
- * - *

If both N and its original parent are black, then - * deleting this original parent causes paths which proceed through N to have one fewer - * black node than paths that do not. As this violates property 5 (all paths - * from any given node to its leaf nodes contain the same number of black - * nodes), the tree must be rebalanced. There are several cases to consider:

- * - *
    - *
  1. N is the new root.
  2. - *
  3. {@link XTreeNode.sibling S} is red.
  4. - *
  5. - * {@link XTreeNode.parent P}, {@link XTreeNode.sibling S}, and - * {@link XTreeNode.sibling S}'s children are black.
  6. - *
  7. - * {@link XTreeNode.sibling S} and {@link XTreeNode.sibling S}'s children are - * black, but {@link XTreeNode.parent P} is - * red. - *
  8. - *
  9. - * {@link XTreeNode.sibling S} is black, - * {@link XTreeNode.sibling S}'s left child is red, - * {@link XTreeNode.sibling S}'s right child is black, and - * N is the left child of its parent. - *
  10. - *
  11. - * {@link XTreeNode.sibling S} is black, - * {@link XTreeNode.sibling S}'s right child is red, and - * N is the left child of its parent {@link XTreeNode.parent P}. - *
  12. - *
- * - *

Again, the function calls all use tail recursion, so the algorithm is in-place.

- * - *

In the algorithm above, all cases are chained in order, except in delete case 3 where it can recurse - * to case 1 back to the parent node: this is the only case where an iterative implementation will - * effectively loop. No more than h loops back to case 1 will occur (where h is the height of the tree). - * And because the probability for escalation decreases exponentially with each iteration the average - * removal cost is constant.

- * - *

Additionally, no tail recursion ever occurs on a child node, so the tail recursion loop can only - * move from a child back to its successive ancestors. If a rotation occurs in case 2 (which is the only - * possibility of rotation within the loop of cases 1–3), then the parent of the node N - * becomes red after the rotation and we will exit the loop. Therefore, at most one - * rotation will occur within this loop. Since no more than two additional rotations will occur after - * exiting the loop, at most three rotations occur in total.

- * - * @param val An element to erase. - */ - erase(val: T): void; - /** - *

N is the new root.

- * - *

In this case, we are done. We removed one black node from every path, - * and the new root is black, so the properties are preserved.

- * - *

Note

- *

In cases 2, 5, and 6, we assume N is the left child of its parent - * {@link XTreeNode.parent P}. If it is the right child, left and right should be reversed throughout - * these three cases. Again, the code examples take both cases into account.

- * - * @param N A node to be erased or swapped. - */ - private erase_case1(N); - /** - *

{@link XTreeNode.sibling S} is red.

- * - *

- * - *

In this case we reverse the colors of {@link XTreeNode.parent P} and - * {@link XTreeNode.sibling S}, and then rotate left at {@link XTreeNode.parent P}, turning - * {@link XTreeNode.sibling S} into N's grandparent.

- * - *

Note that {@link XTreeNode.parent P} has to be black as it had a - * red child. The resulting subtree has a path short one - * black node so we are not done. Now N has a - * black sibling and a red parent, so we can proceed - * to step 4, 5, or 6. (Its new sibling is black because it was once the child - * of the red {@link XTreeNode.sibling S}.) In later cases, we will re-label - * N's new sibling as {@link XTreeNode.sibling S}.

- * - * @param N A node to be erased or swapped. - */ - private erase_case2(N); - /** - *

{@link XTreeNode.parent P}, {@link XTreeNode.sibling S}, and {@link XTreeNode.sibling - * S}'s children are black.

- * - *

- * - *

In this case, we simply repaint {@link XTreeNode.sibling S} red. The - * result is that all paths passing through {@link XTreeNode.sibling S}, which are precisely those - * paths not passing through N, have one less black node. - * Because deleting N's original parent made all paths passing through N have - * one less black node, this evens things up.

- * - *

However, all paths through {@link XTreeNode.parent P} now have one fewer - * black node than paths that do not pass through - * {@link XTreeNode.parent P}, so property 5 (all paths from any given node to its leaf nodes contain - * the same number of black nodes) is still violated.

- * - *

To correct this, we perform the rebalancing procedure on {@link XTreeNode.parent P}, starting - * at case 1.

- * - * @param N A node to be erased or swapped. - */ - private erase_case3(N); - /** - *

{@link XTreeNode.sibling S} and {@link XTreeNode.sibling S}'s children are - * black, but {@link XTreeNode.parent P} is red.

- * - *

- * - *

In this case, we simply exchange the colors of {@link XTreeNode.sibling S} and - * {@link XTreeNode.parent P}. This does not affect the number of black - * nodes on paths going through {@link XTreeNode.sibling S}, but it does add one to the number of - * black nodes on paths going through N, making up for the - * deleted black node on those paths.

- * - * @param N A node to be erased or swapped. - */ - private erase_case4(N); - /** - *

{@link XTreeNode.sibling S} is black, {@link XTreeNode.sibling S}'s - * left child is red, {@link XTreeNode.sibling S}'s right child is - * black, and N is the left child of its parent.

- * - *

- * - *

In this case we rotate right at {@link XTreeNode.sibling S}, so that - * {@link XTreeNode.sibling S}'s left child becomes {@link XTreeNode.sibling S}'s parent and - * N's new sibling. We then exchange the colors of {@link XTreeNode.sibling S} and its - * new parent.

- * - *

All paths still have the same number of black nodes, but now - * N has a black sibling whose right child is - * red, so we fall into case 6. Neither N nor its parent are affected - * by this transformation. (Again, for case 6, we relabel N's new sibling as - * {@link XTreeNode.sibling S}.)

- * - * @param N A node to be erased or swapped. - */ - private erase_case5(N); - /** - *

{@link XTreeNode.sibling S} is black, - * {@link XTreeNode.sibling S}'s right child is red, and N is - * the left child of its parent {@link XTreeNode.parent P}.

- * - *

In this case we rotate left at {@link XTreeNode.parent P}, so that - * {@link XTreeNode.sibling S} becomes the parent of {@link XTreeNode.parent P} and - * {@link XTreeNode.sibling S}'s right child. We then exchange the colors of - * {@link XTreeNode.parent P} and {@link XTreeNode.sibling S}, and make - * {@link XTreeNode.sibling S}'s right child black.

- * - *

The subtree still has the same color at its root, so Properties 4 (Both children of every - * red node are black) and 5 (All paths from any - * given node to its leaf nodes contain the same number of black nodes) are - * not violated. However, N now has one additional black - * ancestor: either {@link XTreeNode.parent P} has become black, or it - * was black and {@link XTreeNode.sibling S} was added as a - * black grandparent.

- * - *

Thus, the paths passing through N pass through one additional - * black node.

- * - *

- * - *

Meanwhile, if a path does not go through N, then there are two possibilities:

- *
    - *
  1. - * It goes through N's new sibling SL, a node with arbitrary color and the root of - * the subtree labeled 3 (s. diagram). Then, it must go through {@link XTreeNode.sibling S} and - * {@link XTreeNode.parent P}, both formerly and currently, as they have only exchanged colors - * and places. Thus the path contains the same number of black nodes. - *
  2. - *
  3. - * It goes through N's new uncle, {@link XTreeNode.sibling S}'s right child. Then, - * it formerly went through {@link XTreeNode.sibling S}, {@link XTreeNode.sibling S}'s - * parent, and {@link XTreeNode.sibling S}'s right child SR (which was - * red), but now only goes through {@link XTreeNode.sibling S}, which - * has assumed the color of its former parent, and {@link XTreeNode.sibling S}'s right child, - * which has changed from red to black (assuming - * {@link XTreeNode.sibling S}'s color: black). The net effect is - * that this path goes through the same number of black nodes. - *
  4. - *
- * - *

Either way, the number of black nodes on these paths does not change. - * Thus, we have restored Properties 4 (Both children of every red node are - * black) and 5 (All paths from any given node to its leaf nodes contain the - * same number of black nodes). The white node in the diagram can be either - * red or black, but must refer to the same color - * both before and after the transformation.

- * - * @param N A node to be erased or swapped. - */ - private erase_case6(node); - /** - * Rotate a node left. - * - * @param node Node to rotate left. - */ - protected rotate_left(node: XTreeNode): void; - /** - * Rotate a node to right. - * - * @param node A node to rotate right. - */ - protected rotate_right(node: XTreeNode): void; - /** - * Replace a node. - * - * @param oldNode Ordinary node to be replaced. - * @param newNode Target node to replace. - */ - protected replace_node(oldNode: XTreeNode, newNode: XTreeNode): void; - /** - * Fetch color from a node. - * - * @param node A node to fetch color. - * @retur color. - */ - private fetch_color(node); - } -} -declare namespace std.base { - /** - *

Common interface for tree-structured map.

- * - *

{@link ITreeMap ITreeMaps} are associative containers that store elements formed by a combination of - * a key value and a mapped value, following a specific order.

- * - *

In a {@link ITreeMap}, the key values are generally used to sort and uniquely identify - * the elements, while the mapped values store the content associated to this key. The types of - * key and mapped value may differ, and are grouped together in member type - * value_type, which is a {@link Pair} type combining both:

- * - *

typedef Pair value_type;

- * - *

Internally, the elements in a {@link ITreeMap}are always sorted by its key following a - * strict weak ordering criterion indicated by its internal comparison method (of {@link less}).

- * - *

{@link ITreeMap}containers are generally slower than {@link IHashMap} containers - * to access individual elements by their key, but they allow the direct iteration on subsets based - * on their order.

- * - *

{@link ITreeMap TreeMultiMaps} are typically implemented as binary search trees.

- * - *

- *

- * - *

Container properties

- *
- *
Associative
- *
Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
- * - *
Ordered
- *
The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order.
- * - *
Map
- *
Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value.
- *
- * - * @param Type of the keys. Each element in a map is uniquely identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/map - * @author Jeongho Nam - */ - interface ITreeMap { - /** - *

Return key comparison function.

- * - *

Returns a references of the comparison function used by the container to compare keys.

- * - *

The comparison object of a {@link ITreeMap tree-map object} is set on - * {@link TreeMap.constructor construction}. Its type (Key) is the last parameter of the - * {@link ITreeMap.constructor constructors}. By default, this is a {@link less} function, which returns the same - * as operator<.

- * - *

This function determines the order of the elements in the container: it is a function pointer that takes - * two arguments of the same type as the element keys, and returns true if the first argument - * is considered to go before the second in the strict weak ordering it defines, and false otherwise. - *

- * - *

Two keys are considered equivalent if {@link key_comp} returns false reflexively (i.e., no - * matter the order in which the keys are passed as arguments).

- * - * @return The comparison function. - */ - key_comp(): (x: Key, y: Key) => boolean; - /** - *

Return value comparison function.

- * - *

Returns a comparison function that can be used to compare two elements to get whether the key of the first - * one goes before the second.

- * - *

The arguments taken by this function object are of member type std.Pair (defined in - * {@link ITreeMap}), but the mapped type (T) part of the value is not taken into consideration in this - * comparison.

- * - *

This comparison class returns true if the {@link Pair.first key} of the first argument - * is considered to go before that of the second (according to the strict weak ordering specified by the - * container's comparison function, {@link key_comp}), and false otherwise.

- * - * @return The comparison function for element values. - */ - value_comp(): (x: Pair, y: Pair) => boolean; - /** - *

Return iterator to lower bound.

- * - *

Returns an iterator pointing to the first element in the container whose key is not considered to - * go before k (i.e., either it is equivalent or goes after).

- * - *

The function uses its internal comparison object (key_comp) to determine this, returning an - * iterator to the first element for which key_comp(k, element_key) would return false.

- * - *

If the {@link ITreeMap} class is instantiated with the default comparison type ({@link less}), - * the function returns an iterator to the first element whose key is not less than k

. - * - *

A similar member function, {@link upper_bound}, has the same behavior as {@link lower_bound}, except - * in the case that the {@link ITreeMap} contains an element with a key equivalent to k: In this - * case, {@link lower_bound} returns an iterator pointing to that element, whereas {@link upper_bound} - * returns an iterator pointing to the next element.

- * - * @param k Key to search for. - * - * @return An iterator to the the first element in the container whose key is not considered to go before - * k, or {@link ITreeMap.end} if all keys are considered to go before k. - */ - lower_bound(key: Key): MapIterator; - /** - *

Return iterator to upper bound.

- * - *

Returns an iterator pointing to the first element in the container whose key is considered to - * go after k

. - * - *

The function uses its internal comparison object (key_comp) to determine this, returning an - * iterator to the first element for which key_comp(k, element_key) would return true.

- * - *

If the {@link ITreeMap} class is instantiated with the default comparison type ({@link less}), - * the function returns an iterator to the first element whose key is greater than k

. - * - *

A similar member function, {@link lower_bound}, has the same behavior as {@link upper_bound}, except - * in the case that the map contains an element with a key equivalent to k: In this case - * {@link lower_bound} returns an iterator pointing to that element, whereas {@link upper_bound} returns an - * iterator pointing to the next element.

- * - * @param k Key to search for. - * - * @return An iterator to the the first element in the container whose key is considered to go after - * k, or {@link TreeMap.end end} if no keys are considered to go after k. - */ - upper_bound(key: Key): MapIterator; - /** - *

Get range of equal elements.

- * - *

Returns the bounds of a range that includes all the elements in the container which have a key - * equivalent to k

. - * - *

If no matches are found, the range returned has a length of zero, with both iterators pointing to - * the first element that has a key considered to go after k according to the container's internal - * comparison object (key_comp).

- * - *

Two keys are considered equivalent if the container's comparison object returns false reflexively - * (i.e., no matter the order in which the keys are passed as arguments).

- * - * @param k Key to search for. - * - * @return The function returns a {@link Pair}, whose member {@link Pair.first} is the lower bound of - * the range (the same as {@link lower_bound}), and {@link Pair.second} is the upper bound - * (the same as {@link upper_bound}). - */ - equal_range(key: Key): Pair, MapIterator>; - } -} -declare namespace std.base { - /** - *

A red-black tree storing {@link MapIterator MapIterators}.

- * - *

- *

- * - * @author Jeongho Nam - */ - class PairTree extends XTree> { - /** - * @hidden - */ - private map_; - /** - * @hidden - */ - private compare_; - /** - * Default Constructor. - */ - constructor(map: TreeMap | TreeMultiMap, compare?: (x: Key, y: Key) => boolean); - find(key: Key): XTreeNode>; - find(it: MapIterator): XTreeNode>; - /** - * @hidden - */ - private find_by_key(key); - /** - *

Return iterator to lower bound.

- * - *

Returns an iterator pointing to the first element in the container whose key is not considered to - * go before k (i.e., either it is equivalent or goes after).

- * - *

The function uses its internal comparison object (key_comp) to determine this, returning an - * iterator to the first element for which key_comp(k, element_key) would return false.

- * - *

If the {@link ITreeMap} class is instantiated with the default comparison type ({@link less}), - * the function returns an iterator to the first element whose key is not less than k

. - * - *

A similar member function, {@link upper_bound}, has the same behavior as {@link lower_bound}, except - * in the case that the {@link ITreeMap} contains an element with a key equivalent to k: In this - * case, {@link lower_bound} returns an iterator pointing to that element, whereas {@link upper_bound} - * returns an iterator pointing to the next element.

- * - * @param k Key to search for. - * - * @return An iterator to the the first element in the container whose key is not considered to go before - * k, or {@link ITreeMap.end} if all keys are considered to go before k. - */ - lower_bound(key: Key): MapIterator; - /** - *

Return iterator to upper bound.

- * - *

Returns an iterator pointing to the first element in the container whose key is considered to - * go after k

. - * - *

The function uses its internal comparison object (key_comp) to determine this, returning an - * iterator to the first element for which key_comp(k, element_key) would return true.

- * - *

If the {@link ITreeMap} class is instantiated with the default comparison type ({@link less}), - * the function returns an iterator to the first element whose key is greater than k

. - * - *

A similar member function, {@link lower_bound}, has the same behavior as {@link upper_bound}, except - * in the case that the map contains an element with a key equivalent to k: In this case - * {@link lower_bound} returns an iterator pointing to that element, whereas {@link upper_bound} returns an - * iterator pointing to the next element.

- * - * @param k Key to search for. - * - * @return An iterator to the the first element in the container whose key is considered to go after - * k, or {@link TreeMap.end end} if no keys are considered to go after k. - */ - upper_bound(key: Key): MapIterator; - /** - *

Get range of equal elements.

- * - *

Returns the bounds of a range that includes all the elements in the container which have a key - * equivalent to k

. - * - *

If no matches are found, the range returned has a length of zero, with both iterators pointing to - * the first element that has a key considered to go after k according to the container's internal - * comparison object (key_comp).

- * - *

Two keys are considered equivalent if the container's comparison object returns false reflexively - * (i.e., no matter the order in which the keys are passed as arguments).

- * - * @param k Key to search for. - * - * @return The function returns a {@link Pair}, whose member {@link Pair.first} is the lower bound of - * the range (the same as {@link lower_bound}), and {@link Pair.second} is the upper bound - * (the same as {@link upper_bound}). - */ - equal_range(key: Key): Pair, MapIterator>; - /** - *

Return key comparison function.

- * - *

Returns a references of the comparison function used by the container to compare keys.

- * - *

The comparison object of a {@link ITreeMap tree-map object} is set on - * {@link TreeMap.constructor construction}. Its type (Key) is the last parameter of the - * {@link ITreeMap.constructor constructors}. By default, this is a {@link less} function, which returns the same - * as operator<.

- * - *

This function determines the order of the elements in the container: it is a function pointer that takes - * two arguments of the same type as the element keys, and returns true if the first argument - * is considered to go before the second in the strict weak ordering it defines, and false otherwise. - *

- * - *

Two keys are considered equivalent if {@link key_comp} returns false reflexively (i.e., no - * matter the order in which the keys are passed as arguments).

- * - * @return The comparison function. - */ - key_comp(): (x: Key, y: Key) => boolean; - /** - *

Return value comparison function.

- * - *

Returns a comparison function that can be used to compare two elements to get whether the key of the first - * one goes before the second.

- * - *

The arguments taken by this function object are of member type std.Pair (defined in - * {@link ITreeMap}), but the mapped type (T) part of the value is not taken into consideration in this - * comparison.

- * - *

This comparison class returns true if the {@link Pair.first key} of the first argument - * is considered to go before that of the second (according to the strict weak ordering specified by the - * container's comparison function, {@link key_comp}), and false otherwise.

- * - * @return The comparison function for element values. - */ - value_comp(): (x: Pair, y: Pair) => boolean; - /** - * @inheritdoc - */ - is_equal_to(left: MapIterator, right: MapIterator): boolean; - /** - * @inheritdoc - */ - is_less(left: MapIterator, right: MapIterator): boolean; - } -} -declare namespace std.base { - /** - *

A common interface for tree-structured set.

- * - *

{@link ITreeSet TreeMultiSets} are containers that store elements following a specific order.

- * - *

In a {@link ITreeSet}, the value of an element also identifies it (the value is itself - * the key, of type T). The value of the elements in a {@link ITreeSet} cannot - * be modified once in the container (the elements are always const), but they can be inserted or removed - * from the

- * - *

Internally, the elements in a {@link ITreeSet TreeMultiSets} are always sorted following a strict - * weak ordering criterion indicated by its internal comparison method (of {@link IComparable.less less}).

- * - *

{@link ITreeSet} containers are generally slower than {@link IHashSet} containers - * to access individual elements by their key, but they allow the direct iteration on subsets based on - * their order.

- * - *

{@link ITreeSet TreeMultiSets} are typically implemented as binary search trees.

- * - *

- *

- * - *

Container properties

- *
- *
Associative
- *
- * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
- * - *
Ordered
- *
- * The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order. - *
- * - *
Set
- *
The value of an element is also the key used to identify it.
- *
- * - * @param Type of the elements. Each element in a {@link ITreeSet} container is also identified - * by this value (each value is itself also the element's key). - * - * @reference http://www.cplusplus.com/reference/set - * @author Jeongho Nam - */ - interface ITreeSet { - /** - *

Return comparison function.

- * - *

Returns a copy of the comparison function used by the container.

- * - *

By default, this is a {@link less} object, which returns the same as operator<.

- * - *

This object determines the order of the elements in the container: it is a function pointer or a function - * object that takes two arguments of the same type as the container elements, and returns true if - * the first argument is considered to go before the second in the strict weak ordering it - * defines, and false otherwise.

- * - *

Two elements of a {@link ITreeSet} are considered equivalent if {@link key_comp} returns false - * reflexively (i.e., no matter the order in which the elements are passed as arguments).

- * - *

In {@link ITreeSet} containers, the keys to sort the elements are the values (T) themselves, - * therefore {@link key_comp} and its sibling member function {@link value_comp} are equivalent.

- * - * @return The comparison function. - */ - key_comp(): (x: T, y: T) => boolean; - /** - *

Return comparison function.

- * - *

Returns a copy of the comparison function used by the container.

- * - *

By default, this is a {@link less} object, which returns the same as operator<.

- * - *

This object determines the order of the elements in the container: it is a function pointer or a function - * object that takes two arguments of the same type as the container elements, and returns true if - * the first argument is considered to go before the second in the strict weak ordering it - * defines, and false otherwise.

- * - *

Two elements of a {@link ITreeSet} are considered equivalent if {@link key_comp} returns false - * reflexively (i.e., no matter the order in which the elements are passed as arguments).

- * - *

In {@link ITreeSet} containers, the keys to sort the elements are the values (T) themselves, - * therefore {@link key_comp} and its sibling member function {@link value_comp} are equivalent.

- * - * @return The comparison function. - */ - value_comp(): (x: T, y: T) => boolean; - /** - *

Return iterator to lower bound.

- * - *

Returns an iterator pointing to the first element in the container which is not considered to - * go before val (i.e., either it is equivalent or goes after).

- * - *

The function uses its internal comparison object (key_comp) to determine this, returning an - * iterator to the first element for which key_comp(element,val) would return false.

- * - *

If the {@link ITreeSet} class is instantiated with the default comparison type ({@link less}), - * the function returns an iterator to the first element that is not less than val.

- - *

A similar member function, {@link upper_bound}, has the same behavior as {@link lower_bound}, except - * in the case that the {@link ITreeSet} contains elements equivalent to val: In this case - * {@link lower_bound} returns an iterator pointing to the first of such elements, whereas - * {@link upper_bound} returns an iterator pointing to the element following the last.

- * - * @param val Value to compare. - * - * @return An iterator to the the first element in the container which is not considered to go before - * val, or {@link ITreeSet.end} if all elements are considered to go before val. - */ - lower_bound(val: T): SetIterator; - /** - *

Return iterator to upper bound.

- * - *

Returns an iterator pointing to the first element in the container which is considered to go after - * val.

- - *

The function uses its internal comparison object (key_comp) to determine this, returning an - * iterator to the first element for which key_comp(val,element) would return true.

- - *

If the {@code ITreeSet} class is instantiated with the default comparison type (less), the - * function returns an iterator to the first element that is greater than val.

- * - *

A similar member function, {@link lower_bound}, has the same behavior as {@link upper_bound}, except - * in the case that the {@ITreeSet} contains elements equivalent to val: In this case - * {@link lower_bound} returns an iterator pointing to the first of such elements, whereas - * {@link upper_bound} returns an iterator pointing to the element following the last.

- * - * @param val Value to compare. - * - * @return An iterator to the the first element in the container which is considered to go after - * val, or {@link TreeSet.end end} if no elements are considered to go after val. - */ - upper_bound(val: T): SetIterator; - /** - *

Get range of equal elements.

- * - *

Returns the bounds of a range that includes all the elements in the container that are equivalent - * to val.

- * - *

If no matches are found, the range returned has a length of zero, with both iterators pointing to - * the first element that is considered to go after val according to the container's - * internal comparison object (key_comp).

- * - *

Two elements of a multiset are considered equivalent if the container's comparison object returns - * false reflexively (i.e., no matter the order in which the elements are passed as arguments).

- * - * @param key Value to search for. - * - * @return The function returns a {@link Pair}, whose member {@link Pair.first} is the lower bound of - * the range (the same as {@link lower_bound}), and {@link Pair.second} is the upper bound - * (the same as {@link upper_bound}). - */ - equal_range(val: T): Pair, SetIterator>; - } -} -declare namespace std.base { - /** - *

A red-black Tree storing {@link SetIterator SetIterators}.

- * - *

- *

- * - * @author Jeongho Nam - */ - class AtomicTree extends XTree> { - /** - * @hidden - */ - private set_; - /** - * @hidden - */ - private compare_; - /** - * Default Constructor. - */ - constructor(set: TreeSet | TreeMultiSet, compare?: (x: T, y: T) => boolean); - find(val: T): XTreeNode>; - find(it: SetIterator): XTreeNode>; - /** - * @hidden - */ - private find_by_val(val); - /** - *

Return iterator to lower bound.

- * - *

Returns an iterator pointing to the first element in the container which is not considered to - * go before val (i.e., either it is equivalent or goes after).

- * - *

The function uses its internal comparison object (key_comp) to determine this, returning an - * iterator to the first element for which key_comp(element,val) would return false.

- * - *

If the {@link ITreeSet} class is instantiated with the default comparison type ({@link less}), - * the function returns an iterator to the first element that is not less than val.

- - *

A similar member function, {@link upper_bound}, has the same behavior as {@link lower_bound}, except - * in the case that the {@link ITreeSet} contains elements equivalent to val: In this case - * {@link lower_bound} returns an iterator pointing to the first of such elements, whereas - * {@link upper_bound} returns an iterator pointing to the element following the last.

- * - * @param val Value to compare. - * - * @return An iterator to the the first element in the container which is not considered to go before - * val, or {@link ITreeSet.end} if all elements are considered to go before val. - */ - lower_bound(val: T): SetIterator; - /** - *

Return iterator to upper bound.

- * - *

Returns an iterator pointing to the first element in the container which is considered to go after - * val.

- - *

The function uses its internal comparison object (key_comp) to determine this, returning an - * iterator to the first element for which key_comp(val,element) would return true.

- - *

If the {@code ITreeSet} class is instantiated with the default comparison type (less), the - * function returns an iterator to the first element that is greater than val.

- * - *

A similar member function, {@link lower_bound}, has the same behavior as {@link upper_bound}, except - * in the case that the {@ITreeSet} contains elements equivalent to val: In this case - * {@link lower_bound} returns an iterator pointing to the first of such elements, whereas - * {@link upper_bound} returns an iterator pointing to the element following the last.

- * - * @param val Value to compare. - * - * @return An iterator to the the first element in the container which is considered to go after - * val, or {@link TreeSet.end end} if no elements are considered to go after val. - */ - upper_bound(val: T): SetIterator; - /** - *

Get range of equal elements.

- * - *

Returns the bounds of a range that includes all the elements in the container that are equivalent - * to val.

- * - *

If no matches are found, the range returned has a length of zero, with both iterators pointing to - * the first element that is considered to go after val according to the container's - * internal comparison object (key_comp).

- * - *

Two elements of a multiset are considered equivalent if the container's comparison object returns - * false reflexively (i.e., no matter the order in which the elements are passed as arguments).

- * - * @param key Value to search for. - * - * @return The function returns a {@link Pair}, whose member {@link Pair.first} is the lower bound of - * the range (the same as {@link lower_bound}), and {@link Pair.second} is the upper bound - * (the same as {@link upper_bound}). - */ - equal_range(val: T): Pair, SetIterator>; - /** - *

Return comparison function.

- * - *

Returns a copy of the comparison function used by the container.

- * - *

By default, this is a {@link less} object, which returns the same as operator<.

- * - *

This object determines the order of the elements in the container: it is a function pointer or a function - * object that takes two arguments of the same type as the container elements, and returns true if - * the first argument is considered to go before the second in the strict weak ordering it - * defines, and false otherwise.

- * - *

Two elements of a {@link ITreeSet} are considered equivalent if {@link key_comp} returns false - * reflexively (i.e., no matter the order in which the elements are passed as arguments).

- * - *

In {@link ITreeSet} containers, the keys to sort the elements are the values (T) themselves, - * therefore {@link key_comp} and its sibling member function {@link value_comp} are equivalent.

- * - * @return The comparison function. - */ - key_comp(): (x: T, y: T) => boolean; - /** - *

Return comparison function.

- * - *

Returns a copy of the comparison function used by the container.

- * - *

By default, this is a {@link less} object, which returns the same as operator<.

- * - *

This object determines the order of the elements in the container: it is a function pointer or a function - * object that takes two arguments of the same type as the container elements, and returns true if - * the first argument is considered to go before the second in the strict weak ordering it - * defines, and false otherwise.

- * - *

Two elements of a {@link ITreeSet} are considered equivalent if {@link key_comp} returns false - * reflexively (i.e., no matter the order in which the elements are passed as arguments).

- * - *

In {@link ITreeSet} containers, the keys to sort the elements are the values (T) themselves, - * therefore {@link key_comp} and its sibling member function {@link value_comp} are equivalent.

- * - * @return The comparison function. - */ - value_comp(): (x: T, y: T) => boolean; - /** - * @inheritdoc - */ - is_equal_to(left: SetIterator, right: SetIterator): boolean; - /** - * @inheritdoc - */ - is_less(left: SetIterator, right: SetIterator): boolean; - } -} -declare namespace std.base { - /** - *

An abstract unique-map.

- * - *

{@link UniqueMap UniqueMaps} are associative containers that store elements formed by a combination of a - * key value (Key) and a mapped value (T), and which allows for fast retrieval of - * individual elements based on their keys.

- * - *

In a {@link MapContainer}, the key values are generally used to uniquely identify the elements, - * while the mapped values store the content associated to this key. The types of key and - * mapped value may differ, and are grouped together in member type value_type, which is a - * {@link Pair} type combining both:

- * - *

typedef pair value_type;

- * - *

{@link UniqueMap} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

- * - *

- *

- * - *

Container properties

- *
- *
Associative
- *
- * Elements in associative containers are referenced by their key and not by their absolute position - * in the container. - *
- * - *
Map
- *
- * Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value. - *
- * - *
Unique keys
- *
No two elements in the container can have equivalent keys.
- *
- * - * @param Type of the keys. Each element in a map is uniquely identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @author Jeongho Nam - */ - abstract class UniqueMap extends MapContainer { - /** - * @inheritdoc - */ - count(key: Key): number; - /** - *

Get an element

- * - *

Returns a reference to the mapped value of the element identified with key.

- * - * @param key Key value of the element whose mapped value is accessed. - * - * @throw exception out of range - * - * @return A reference object of the mapped value (_Ty) - */ - get(key: Key): T; - /** - *

Set an item as the specified identifier.

- * - *

If the identifier is already in map, change value of the identifier. If not, then insert the object - * with the identifier.

- * - * @param key Key value of the element whose mapped value is accessed. - * @param val Value, the item. - */ - set(key: Key, val: T): void; - /** - * Construct and insert element. - * - * Inserts a new element in the {@link UniqueMap} if its *key* is unique. This new element is constructed in - * place using args as the arguments for the construction of a *value_type* (which is an object of a - * {@link Pair} type). - * - * The insertion only takes place if no other element in the container has a *key equivalent* to the one - * being emplaced (*keys* in a {@link UniqueMap} container are unique). - * - * If inserted, this effectively increases the container {@link size} by one. - * - * A similar member function exists, {@link insert}, which either copies or moves existing objects into the - * container. - * - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return If the function successfully inserts the element (because no equivalent element existed already in - * the {@link UniqueMap}), the function returns a {@link Pair} of an {@link MapIterator iterator} to - * the newly inserted element and a value of true. Otherwise, it returns an - * {@link MapIterator iterator} to the equivalent element within the container and a value of false. - */ - emplace(key: Key, value: T): Pair, boolean>; - /** - * Construct and insert element. - * - * Inserts a new element in the {@link UniqueMap} if its *key* is unique. This new element is constructed in - * place using args as the arguments for the construction of a *value_type* (which is an object of a - * {@link Pair} type). - * - * The insertion only takes place if no other element in the container has a *key equivalent* to the one - * being emplaced (*keys* in a {@link UniqueMap} container are unique). - * - * If inserted, this effectively increases the container {@link size} by one. - * - * A similar member function exists, {@link insert}, which either copies or moves existing objects into the - * container. - * - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return If the function successfully inserts the element (because no equivalent element existed already in - * the {@link UniqueMap}), the function returns a {@link Pair} of an {@link MapIterator iterator} to - * the newly inserted element and a value of true. Otherwise, it returns an - * {@link MapIterator iterator} to the equivalent element within the container and a value of false. - */ - emplace(pair: Pair): Pair, boolean>; - /** - *

Insert an element.

- * - *

Extends the container by inserting new elements, effectively increasing the container {@link size} by - * one.

- * - *

Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is not inserted, returning an iterator to this existing element (if the function - * returns a value).

- * - *

For a similar container allowing for duplicate elements, see {@link MultiMap}.

- * - * @param pair A single argument of a {@link Pair} type with a value for the *key* as - * {@link Pair.first first} member, and a *value* for the mapped value as - * {@link Pair.second second}. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent key already existed. - */ - insert(pair: Pair): Pair, boolean>; - /** - *

Insert an element.

- * - *

Extends the container by inserting a new element, effectively increasing the container size by the - * number of elements inserted.

- * - *

Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is not inserted, returning an iterator to this existing element (if the function - * returns a value).

- * - *

For a similar container allowing for duplicate elements, see {@link MultiMap}.

- * - * @param tuple Tuple represensts the {@link Pair} to be inserted as an element. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent key already existed. - */ - insert(tuple: [L, U]): Pair, boolean>; - /** - * @inheritdoc - */ - insert(hint: MapIterator, pair: Pair): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapReverseIterator, pair: Pair): MapReverseIterator; - /** - * @inheritdoc - */ - insert(hint: MapIterator, tuple: [L, U]): MapIterator; - /** - * @inheritdoc - */ - insert(hint: MapReverseIterator, tuple: [L, U]): MapReverseIterator; - /** - * @inheritdoc - */ - insert>>(first: InputIterator, last: InputIterator): void; - /** - *

Insert or assign an element.

- * - *

Inserts an element or assigns to the current element if the key already exists.

- * - *

Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).

- * - *

For a similar container allowing for duplicate elements, see {@link MultiMap}.

- * - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the element with an equivalent key in the {@link UniqueMap}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent key already existed so the value is assigned. - */ - insert_or_assign(key: Key, value: T): Pair, boolean>; - /** - *

Insert or assign an element.

- * - *

Inserts an element or assigns to the current element if the key already exists.

- * - *

Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).

- * - *

For a similar container allowing for duplicate elements, see {@link MultiMap}.

- * - * @param hint Hint for the position where the element can be inserted. - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link UniqueMap}. - */ - insert_or_assign(hint: MapIterator, key: Key, value: T): MapIterator; - /** - *

Insert or assign an element.

- * - *

Inserts an element or assigns to the current element if the key already exists.

- * - *

Because element keys in a {@link UniqueMap} are unique, the insertion operation checks whether - * each inserted element has a key equivalent to the one of an element already in the container, and - * if so, the element is assigned, returning an iterator to this existing element (if the function returns a - * value).

- * - *

For a similar container allowing for duplicate elements, see {@link MultiMap}.

- * - * @param hint Hint for the position where the element can be inserted. - * @param key The key used both to look up and to insert if not found. - * @param value Value, the item. - * - * @return An iterator pointing to either the newly inserted element or to the element that already had an - * equivalent key in the {@link UniqueMap}. - */ - insert_or_assign(hint: MapReverseIterator, key: Key, value: T): MapReverseIterator; - /** - * @hidden - */ - private insert_or_assign_with_key_value(key, value); - /** - * @hidden - */ - private insert_or_assign_with_hint(hint, key, value); - /** - *

Extract an element.

- * - *

Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

- * - * @param key Key value of the element whose mapped value is accessed. - * - * @return A {@link Pair} containing the value pointed to by key. - */ - extract(key: Key): Pair; - /** - *

Extract an element.

- * - *

Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

- * - * @param it An iterator pointing an element to extract. - * - * @return An iterator pointing to the element immediately following it prior to the element being - * erased. If no such element exists,returns {@link end end()}. - */ - extract(it: MapIterator): MapIterator; - /** - *

Extract an element.

- * - *

Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

- * - * @param it An iterator pointing an element to extract. - * - * @return An iterator pointing to the element immediately following it prior to the element being - * erased. If no such element exists,returns {@link end end()}. - */ - extract(it: MapReverseIterator): MapReverseIterator; - /** - * @hidden - */ - private extract_by_key(key); - /** - * @hidden - */ - private extract_by_iterator(it); - /** - * @hidden - */ - private extract_by_reverse_iterator(it); - /** - * Merge two maps. - * - * Attempts to extract each element in *source* and insert it into this container. If there's an element in this - * container with key equivalent to the key of an element from *source*, tnen that element is not extracted from - * the *source*. Otherwise, no element with same key exists in this container, then that element will be - * transfered from the *source* to this container. - * - * @param source A {@link MapContainer map container} to transfer the elements from. - */ - merge(source: MapContainer): void; - } -} -declare namespace std.base { - /** - *

An abstract set.

- * - *

{@link SetContainer SetContainers} are containers that store elements allowing fast retrieval of - * individual elements based on their value.

- * - *

In an {@link SetContainer}, the value of an element is at the same time its key, used to uniquely - * identify it. Keys are immutable, therefore, the elements in an {@link SetContainer} cannot be modified - * once in the container - they can be inserted and removed, though.

- * - *

{@link SetContainer} stores elements, keeps sequence and enables indexing by inserting elements into a - * {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index - * table like {@link RBTree tree} or {@link HashBuckets hash-table}.

- * - *

- *

- * - *

Container properties

- *
- *
Associative
- *
- * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
- * - *
Set
- *
The value of an element is also the key used to identify it.
- * - *
Unique keys
- *
No two elements in the container can have equivalent keys.
- *
- * - * @param Type of the elements. Each element in a {@link SetContainer} container is also identified - * by this value (each value is itself also the element's key). - * - * @author Jeongho Nam - */ - abstract class UniqueSet extends SetContainer { - /** - * @inheritdoc - */ - count(key: T): number; - /** - *

Insert an element.

- * - *

Extends the container by inserting new elements, effectively increasing the container {@link size} by - * the number of element inserted (zero or one).

- * - *

Because elements in a {@link UniqueSet UniqueSets} are unique, the insertion operation checks whether - * each inserted element is equivalent to an element already in the container, and if so, the element is not - * inserted, returning an iterator to this existing element (if the function returns a value).

- * - *

For a similar container allowing for duplicate elements, see {@link MultiSet}.

- * - * @param key Value to be inserted as an element. - * - * @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly - * inserted element or to the equivalent element already in the {@link UniqueSet}. The - * {@link Pair.second} element in the {@link Pair} is set to true if a new element was inserted or - * false if an equivalent element already existed. - */ - insert(val: T): Pair, boolean>; - /** - * @inheritdoc - */ - insert(hint: SetIterator, val: T): SetIterator; - /** - * @inheritdoc - */ - insert(hint: SetReverseIterator, val: T): SetReverseIterator; - /** - * @inheritdoc - */ - insert>(begin: InputIterator, end: InputIterator): void; - /** - *

Extract an element.

- * - *

Extracts the element pointed to by val and erases it from the {@link UniqueSet}.

- * - * @param val Value to be extracted. - * - * @return A value. - */ - extract(val: T): T; - /** - *

Extract an element.

- * - *

Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

- * - * @param it An iterator pointing an element to extract. - * - * @return An iterator pointing to the element immediately following it prior to the element being - * erased. If no such element exists,returns {@link end end()}. - */ - extract(it: SetIterator): SetIterator; - /** - *

Extract an element.

- * - *

Extracts the element pointed to by key and erases it from the {@link UniqueMap}.

- * - * @param it An iterator pointing an element to extract. - * - * @return An iterator pointing to the element immediately following it prior to the element being - * erased. If no such element exists,returns {@link end end()}. - */ - extract(it: SetReverseIterator): SetReverseIterator; - /** - * @hidden - */ - private extract_by_key(val); - /** - * @hidden - */ - private extract_by_iterator(it); - /** - * @hidden - */ - private extract_by_reverse_iterator(it); - /** - * Merge two sets. - * - * Attempts to extract each element in *source* and insert it into this container. If there's an element in this - * container with key equivalent to the key of an element from *source*, tnen that element is not extracted from - * the *source*. Otherwise, no element with same key exists in this container, then that element will be - * transfered from the *source* to this container. - * - * @param source A {@link SetContainer set container} to transfer the elements from. - */ - merge(source: SetContainer): void; - } -} -declare namespace std.base { - /** - *

A node in an XTree.

- * - * @param Type of elements. - * - * @inventor Rudolf Bayer - * @author Migrated by Jeongho Nam - */ - class XTreeNode { - /** - * Parent of the node. - */ - parent: XTreeNode; - /** - * Left child in the node. - */ - left: XTreeNode; - /** - * Right child in the node. - */ - right: XTreeNode; - /** - * Value stored in the node. - */ - value: T; - /** - * Color of the node. - */ - color: Color; - /** - * Construct from value and color of node. - * - * @param value Value to be stored in. - * @param color Color of the node, red or black. - */ - constructor(value: T, color: Color); - /** - * Get grand-parent. - */ - readonly grand_parent: XTreeNode; - /** - * Get sibling, opposite side node in same parent. - */ - readonly sibling: XTreeNode; - /** - * Get uncle, parent's sibling. - */ - readonly uncle: XTreeNode; - } -} -declare namespace std.Deque { - type iterator = std.DequeIterator; - type reverse_iterator = std.DequeReverseIterator; -} -declare namespace std { - /** - *

Double ended queue.

- * - *

{@link Deque} (usually pronounced like "deck") is an irregular acronym of - * double-ended queue. Double-ended queues are sequence containers with dynamic sizes that can be - * expanded or contracted on both ends (either its front or its back).

- * - *

Specific libraries may implement deques in different ways, generally as some form of dynamic array. But in any - * case, they allow for the individual elements to be accessed directly through random access iterators, with storage - * handled automatically by expanding and contracting the container as needed.

- * - *

Therefore, they provide a functionality similar to vectors, but with efficient insertion and deletion of - * elements also at the beginning of the sequence, and not only at its end. But, unlike {@link Vector Vectors}, - * {@link Deque Deques} are not guaranteed to store all its elements in contiguous storage locations: accessing - * elements in a deque by offsetting a pointer to another element causes undefined behavior.

- * - *

Both {@link Vector}s and {@link Deque}s provide a very similar interface and can be used for similar purposes, - * but internally both work in quite different ways: While {@link Vector}s use a single array that needs to be - * occasionally reallocated for growth, the elements of a {@link Deque} can be scattered in different chunks of - * storage, with the container keeping the necessary information internally to provide direct access to any of its - * elements in constant time and with a uniform sequential interface (through iterators). Therefore, - * {@link Deque Deques} are a little more complex internally than {@link Vector}s, but this allows them to grow more - * efficiently under certain circumstances, especially with very long sequences, where reallocations become more - * expensive.

- * - *

For operations that involve frequent insertion or removals of elements at positions other than the beginning or - * the end, {@link Deque Deques} perform worse and have less consistent iterators and references than - * {@link List Lists}.

- * - *

- * - *

- * - *

Container properties

- *
- *
Sequence
- *
Elements in sequence containers are ordered in a strict linear sequence. Individual elements - * are accessed by their position in this sequence.
- * - *
Dynamic array
- *
Generally implemented as a dynamic array, it allows direct access to any element in the - * sequence and provides relatively fast addition/removal of elements at the beginning or the end - * of the sequence.
- *
- * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/deque/deque/ - * @author Jeongho Nam - */ - class Deque extends base.Container implements base.IArrayContainer, base.IDequeContainer { - /** - * @hidden - */ - private static readonly ROW; - /** - * @hidden - */ - private static readonly MIN_CAPACITY; - /** - * @hidden - */ - private matrix_; - /** - * @hidden - */ - private size_; - /** - * @hidden - */ - private capacity_; - /** - * @hidden - */ - private get_col_size(); - /** - * @hidden - */ - private end_; - /** - * @hidden - */ - private rend_; - /** - *

Default Constructor.

- * - *

Constructs an empty container, with no elements.

- */ - constructor(); - /** - *

Initializer list Constructor.

- * - *

Constructs a container with a copy of each of the elements in array, in the same order.

- * - * @param array An array containing elements to be copied and contained. - */ - constructor(items: Array); - /** - *

Fill Constructor.

- * - *

Constructs a container with n elements. Each element is a copy of val (if provided).

- * - * @param n Initial container size (i.e., the number of elements in the container at construction). - * @param val Value to fill the container with. Each of the n elements in the container is - * initialized to a copy of this value. - */ - constructor(size: number, val: T); - /** - *

Copy Constructor.

- * - *

Constructs a container with a copy of each of the elements in container, in the same order.

- * - * @param container Another container object of the same type (with the same class template - * arguments T), whose contents are either copied or acquired. - */ - constructor(container: Deque); - /** - *

Range Constructor.

- * - *

Constructs a container with as many elements as the range (begin, end), with each - * element emplace-constructed from its corresponding element in that range, in the same order.

- * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @inheritdoc - */ - assign>(begin: InputIterator, end: InputIterator): void; - /** - * @inheritdoc - */ - assign(n: number, val: T): void; - /** - * @inheritdoc - */ - reserve(capacity: number): void; - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - begin(): DequeIterator; - /** - * @inheritdoc - */ - end(): DequeIterator; - /** - * @inheritdoc - */ - rbegin(): DequeReverseIterator; - /** - * @inheritdoc - */ - rend(): DequeReverseIterator; - /** - * @inheritdoc - */ - size(): number; - /** - * @inheritdoc - */ - empty(): boolean; - /** - * @inheritdoc - */ - capacity(): number; - /** - * @inheritdoc - */ - at(index: number): T; - /** - * @inheritdoc - */ - set(index: number, val: T): void; - /** - * @inheritdoc - */ - front(): T; - /** - * @inheritdoc - */ - back(): T; - /** - // Fetch row and column's index. - /** - * @hidden - */ - private fetch_index(index); - /** - * @inheritdoc - */ - push(...items: T[]): number; - /** - * @inheritdoc - */ - push_front(val: T): void; - /** - * @inheritdoc - */ - push_back(val: T): void; - /** - * @inheritdoc - */ - pop_front(): void; - /** - * @inheritdoc - */ - pop_back(): void; - /** - * @inheritdoc - */ - insert(position: DequeIterator, val: T): DequeIterator; - /** - * @inheritdoc - */ - insert(position: DequeIterator, n: number, val: T): DequeIterator; - /** - * @inheritdoc - */ - insert>(position: DequeIterator, begin: InputIterator, end: InputIterator): DequeIterator; - /** - * @inheritdoc - */ - insert(position: DequeReverseIterator, val: T): DequeReverseIterator; - /** - * @inheritdoc - */ - insert(position: DequeReverseIterator, n: number, val: T): DequeReverseIterator; - /** - * @inheritdoc - */ - insert>(position: DequeReverseIterator, begin: InputIterator, end: InputIterator): DequeReverseIterator; - /** - * @hidden - */ - private insert_by_val(position, val); - /** - * @hidden - */ - protected _Insert_by_repeating_val(position: DequeIterator, n: number, val: T): DequeIterator; - /** - * @hidden - */ - protected _Insert_by_range>(position: DequeIterator, begin: InputIterator, end: InputIterator): DequeIterator; - /** - * @hidden - */ - private insert_by_items(position, items); - /** - * @inheritdoc - */ - erase(position: DequeIterator): DequeIterator; - /** - * @inheritdoc - */ - erase(first: DequeIterator, last: DequeIterator): DequeIterator; - /** - * @inheritdoc - */ - erase(position: DequeReverseIterator): DequeReverseIterator; - /** - * @inheritdoc - */ - erase(first: DequeReverseIterator, last: DequeReverseIterator): DequeReverseIterator; - /** - * @hidden - */ - protected _Erase_by_range(first: DequeIterator, last: DequeIterator): DequeIterator; - /** - *

Swap content.

- * - *

Exchanges the content of the container by the content of obj, which is another - * {@link Deque container} object with same type of elements. Sizes and container type may differ.

- * - *

After the call to this member function, the elements in this container are those which were in obj - * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

- * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

- * - * @param obj Another {@link Deque container} of the same type of elements (i.e., instantiated - * with the same template parameter, T) whose content is swapped with that of this - * {@link container Deque}. - */ - swap(obj: Deque): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std { - /** - *

An iterator of {@link Deque}.

- * - *

- * - *

- * - * @author Jeongho Nam - */ - class DequeIterator extends Iterator implements base.IArrayIterator { - /** - * Sequence number of iterator in the source {@link Deque}. - */ - private index_; - /** - *

Construct from the source {@link Deque container}.

- * - *

Note

- *

Do not create the iterator directly, by yourself.

- *

Use {@link Deque.begin begin()}, {@link Deque.end end()} in {@link Deque container} instead.

- * - * @param source The source {@link Deque container} to reference. - * @param index Sequence number of the element in the source {@link Deque}. - */ - constructor(source: Deque, index: number); - /** - * @hidden - */ - private readonly deque; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * @inheritdoc - */ - readonly index: number; - /** - * @inheritdoc - */ - prev(): DequeIterator; - /** - * @inheritdoc - */ - next(): DequeIterator; - /** - * @inheritdoc - */ - advance(n: number): DequeIterator; - /** - * @inheritdoc - */ - equals(obj: DequeIterator): boolean; - /** - * @inheritdoc - */ - swap(obj: DequeIterator): void; - } -} -declare namespace std { - /** - *

A reverse-iterator of Deque.

- * - *

- * - *

- * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class DequeReverseIterator extends ReverseIterator, DequeReverseIterator> implements base.IArrayIterator { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: DequeIterator); - /** - * @hidden - */ - protected _Create_neighbor(base: DequeIterator): DequeReverseIterator; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * Get index. - */ - readonly index: number; - } -} -declare namespace std { - /** - *

Function handling termination on exception

- * - *

Calls the current terminate handler.

- * - *

By default, the terminate handler calls abort. But this behavior can be redefined by calling - * {@link set_terminate}.

- * - *

This function is automatically called when no catch handler can be found for a thrown exception, - * or for some other exceptional circumstance that makes impossible to continue the exception handling process.

- * - *

This function is provided so that the terminate handler can be explicitly called by a program that needs to - * abnormally terminate, and works even if {@link set_terminate} has not been used to set a custom terminate handler - * (calling abort in this case).

- */ - function terminate(): void; - /** - *

Set terminate handler function.

- * - *

A terminate handler function is a function automatically called when the exception handling process has - * to be abandoned for some reason. This happens when no catch handler can be found for a thrown exception, or for - * some other exceptional circumstance that makes impossible to continue the exception handling process.

- * - *

Before this function is called by the program for the first time, the default behavior is to call abort.

- * - *

A program may explicitly call the current terminate handler function by calling {@link terminate}.

- * - * @param f Function that takes no parameters and returns no value (void). - */ - function set_terminate(f: () => void): void; - /** - *

Get terminate handler function.

- * - *

The terminate handler function is automatically called when no catch handler can be found - * for a thrown exception, or for some other exceptional circumstance that makes impossible to continue the exception - * handling process.

- * - *

If no such function has been set by a previous call to {@link set_terminate}, the function returns a - * null-pointer.

- * - * @return If {@link set_terminate} has previously been called by the program, the function returns the current - * terminate handler function. Otherwise, it returns a null-pointer. - */ - function get_terminate(): () => void; - /** - *

Standard exception class.

- * - *

Base class for standard exceptions.

- * - *

All objects thrown by components of the standard library are derived from this class. - * Therefore, all standard exceptions can be caught by catching this type by reference.

- * - *

- *

- * - * @reference http://www.cplusplus.com/reference/exception/exception - * @author Jeongho Nam - */ - class Exception extends Error { - /** - * A message representing specification about the Exception. - */ - private description; - /** - * Default Constructor. - */ - constructor(); - /** - *

Construct from a message.

- * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - /** - *

Get string identifying exception.

- *

Returns a string that may be used to identify the exception.

- * - *

The particular representation pointed by the returned value is implementation-defined. - * As a virtual function, derived classes may redefine this function so that specify value are - * returned.

- */ - what(): string; - /** - * @inheritdoc - */ - readonly message: string; - /** - * @inheritdoc - */ - readonly name: string; - } - /** - *

Logic error exception.

- * - *

This class defines the type of objects thrown as exceptions to report errors in the internal - * logical of the program, such as violation of logical preconditions or class invariants.

- * - *

These errors are presumably detectable before the program executes.

- * - *

It is used as a base class for several logical error exceptions.

- * - *

- *

- * - * @reference http://www.cplusplus.com/reference/stdexcept/logic_error - * @author Jeongho Nam - */ - class LogicError extends Exception { - /** - *

Construct from a message.

- * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

Domain error exception.

- * - *

This class defines the type of objects thrown as exceptions to report domain errors.

- * - *

Generally, the domain of a mathematical function is the subset of values that it is defined for. - * For example, the square root function is only defined for non-negative numbers. Thus, a negative number - * for such a function would qualify as a domain error.

- * - *

No component of the standard library throws exceptions of this type. It is designed as a standard - * exception to be thrown by programs.

- * - *

- *

- * - * @reference http://www.cplusplus.com/reference/stdexcept/domain_error - * @author Jeongho Nam - */ - class DomainError extends LogicError { - /** - *

Construct from a message.

- * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

Invalid argument exception.

- * - *

This class defines the type of objects thrown as exceptions to report an invalid argument.

- * - *

It is a standard exception that can be thrown by programs. Some components of the standard library - * also throw exceptions of this type to signal invalid arguments.

- * - *

- *

- * - * @reference http://www.cplusplus.com/reference/stdexcept/invalid_argument - * @author Jeongho Nam - */ - class InvalidArgument extends LogicError { - /** - *

Construct from a message.

- * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

Length error exception.

- * - *

This class defines the type of objects thrown as exceptions to report a length error.

- * - *

It is a standard exception that can be thrown by programs. Some components of the standard library, - * such as vector and string also throw exceptions of this type to signal errors resizing.

- * - *

- *

- * - * @reference http://www.cplusplus.com/reference/stdexcept/length_error - * @author Jeongho Nam - */ - class LengthError extends LogicError { - /** - *

Construct from a message.

- * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

Out-of-range exception.

- * - *

This class defines the type of objects thrown as exceptions to report an out-of-range error.

- * - *

It is a standard exception that can be thrown by programs. Some components of the standard library, - * such as vector, deque, string and bitset also throw exceptions of this type to signal arguments - * out of range.

- * - *

- *

- * - * @reference http://www.cplusplus.com/reference/stdexcept/out_of_range - * @author Jeongho Nam - */ - class OutOfRange extends LogicError { - /** - *

Construct from a message.

- * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

Runtime error exception.

- * - *

This class defines the type of objects thrown as exceptions to report errors that can only be - * detected during runtime.

- * - *

It is used as a base class for several runtime error exceptions.

- * - *

- *

- * - * @reference http://www.cplusplus.com/reference/stdexcept/runtime_error - * @author Jeongho Nam - */ - class RuntimeError extends Exception { - /** - *

Construct from a message.

- * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

Overflow error exception.

- * - *

This class defines the type of objects thrown as exceptions to arithmetic overflow errors.

- * - *

It is a standard exception that can be thrown by programs. Some components of the standard library - * also throw exceptions of this type to signal range errors.

- * - *

- *

- * - * @reference http://www.cplusplus.com/reference/stdexcept/overflow_error - * @author Jeongho Nam - */ - class OverflowError extends RuntimeError { - /** - *

Construct from a message.

- * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

Underflow error exception.

- * - *

This class defines the type of objects thrown as exceptions to arithmetic underflow errors.

- * - *

No component of the standard library throws exceptions of this type. It is designed as a standard - * exception to be thrown by programs.

- * - *

- *

- * - * @reference http://www.cplusplus.com/reference/stdexcept/underflow_error - * @author Jeongho Nam - */ - class UnderflowError extends RuntimeError { - /** - *

Construct from a message.

- * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } - /** - *

Range error exception.

- * - *

This class defines the type of objects thrown as exceptions to report range errors in internal - * computations.

- * - *

It is a standard exception that can be thrown by programs. Some components of the standard library - * also throw exceptions of this type to signal range errors.

- * - *

- *

- * - * @reference http://www.cplusplus.com/reference/stdexcept/range_error - * @author Jeongho Nam - */ - class RangeError extends RuntimeError { - /** - *

Construct from a message.

- * - * @param message A message representing specification about the Exception. - */ - constructor(message: string); - } -} -declare namespace std { - /** - *

Function object class for equality comparison.

- * - *

Binary function object class whose call returns whether its two arguments compare equal (as returned by - * operator ==).

- * - *

Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} - * defined. This member function allows the object to be used with the same syntax as a function call.

- * - * @param x First element to compare. - * @param y Second element to compare. - * - * @return Whether the arguments are equal. - */ - function equal_to(x: T, y: T): boolean; - /** - *

Function object class for non-equality comparison.

- * - *

Binary function object class whose call returns whether its two arguments compare not equal (as returned - * by operator operator!=).

- * - *

Generically, function objects are instances of a class with member function {@link IComparable.equal_to equal_to} - * defined. This member function allows the object to be used with the same syntax as a function call.

- * - * @param x First element to compare. - * @param y Second element to compare. - * - * @return Whether the arguments are not equal. - */ - function not_equal_to(x: T, y: T): boolean; - /** - *

Function for less-than inequality comparison.

- * - *

Binary function returns whether the its first argument compares less than the second.

- * - *

Generically, function objects are instances of a class with member function {@link IComparable.less less} - * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. - * This member function allows the object to be used with the same syntax as a function call.

- * - *

Objects of this class can be used on standard algorithms such as {@link sort sort()}, - * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}.

- * - * @param Type of arguments to compare by the function call. The type shall supporrt the operation - * operator<() or method {@link IComparable.less less}. - * - * @param x First element, the standard of comparison. - * @param y Second element compare with the first. - * - * @return Whether the first parameter is less than the second. - */ - function less(x: T, y: T): boolean; - /** - *

Function object class for less-than-or-equal-to comparison.

- * - *

Binary function object class whose call returns whether the its first argument compares {@link less less than} or - * {@link equal_to equal to} the second (as returned by operator <=).

- * - *

Generically, function objects are instances of a class with member function {@link IComparable.less less} - * and {@link IComparable.equal_to equal_to} defined. This member function allows the object to be used with the same - * syntax as a function call.

- * - * @param x First element, the standard of comparison. - * @param y Second element compare with the first. - * - * @return Whether the x is {@link less less than} or {@link equal_to equal to} the y. - */ - function less_equal(x: T, y: T): boolean; - /** - *

Function for greater-than inequality comparison.

- * - *

Binary function returns whether the its first argument compares greater than the second.

- * - *

Generically, function objects are instances of a class with member function {@link less} and - * {@link equal_to equal_to()} defined. If an object doesn't have those methods, then its own uid will be used - * to compare insteadly. This member function allows the object to be used with the same syntax as a function - * call.

- * - *

Objects of this class can be used on standard algorithms such as {@link sort sort()}, - * {@link merge merge()} or {@link TreeMap.lower_bound lower_bound()}.

- * - * @param Type of arguments to compare by the function call. The type shall supporrt the operation - * operator>() or method {@link IComparable.greater greater}. - * - * @return Whether the x is greater than the y. - */ - function greater(x: T, y: T): boolean; - /** - *

Function object class for greater-than-or-equal-to comparison.

- * - *

Binary function object class whose call returns whether the its first argument compares - * {@link greater greater than} or {@link equal_to equal to} the second (as returned by operator >=).

- * - *

Generically, function objects are instances of a class with member function {@link IComparable.less less} - * defined. If an object doesn't have the method, then its own uid will be used to compare insteadly. - * This member function allows the object to be used with the same syntax as a function call.

- * - * @param x First element, the standard of comparison. - * @param y Second element compare with the first. - * - * @return Whether the x is {@link greater greater than} or {@link equal_to equal to} the y. - */ - function greater_equal(x: T, y: T): boolean; - /** - *

Logical AND function object class.

- * - *

Binary function object class whose call returns the result of the logical "and" operation between its two - * arguments (as returned by operator &&).

- * - *

Generically, function objects are instances of a class with member function operator() defined. This member - * function allows the object to be used with the same syntax as a function call.

- * - * @param x First element. - * @param y Second element. - * - * @return Result of logical AND operation. - */ - function logical_and(x: T, y: T): boolean; - /** - *

Logical OR function object class.

- * - *

Binary function object class whose call returns the result of the logical "or" operation between its two - * arguments (as returned by operator ||).

- * - *

Generically, function objects are instances of a class with member function operator() defined. This member - * function allows the object to be used with the same syntax as a function call.

- * - * @param x First element. - * @param y Second element. - * - * @return Result of logical OR operation. - */ - function logical_or(x: T, y: T): boolean; - /** - *

Logical NOT function object class.

- * - *

Unary function object class whose call returns the result of the logical "not" operation on its argument - * (as returned by operator !).

- * - *

Generically, function objects are instances of a class with member function operator() defined. This member - * function allows the object to be used with the same syntax as a function call.

- * - * @param x Target element. - * - * @return Result of logical NOT operation. - */ - function logical_not(x: T): boolean; - /** - *

Bitwise AND function object class.

- * - *

Binary function object class whose call returns the result of applying the bitwise "and" operation between - * its two arguments (as returned by operator &).

- * - * @param x First element. - * @param y Second element. - * - * @return Result of bitwise AND operation. - */ - function bit_and(x: number, y: number): number; - /** - *

Bitwise OR function object class.

- * - *

Binary function object class whose call returns the result of applying the bitwise "and" operation between - * its two arguments (as returned by operator &).

- * - * @param x First element. - * @param y Second element. - * - * @return Result of bitwise OR operation. - */ - function bit_or(x: number, y: number): number; - /** - *

Bitwise XOR function object class.

- * - *

Binary function object class whose call returns the result of applying the bitwise "exclusive or" - * operation between its two arguments (as returned by operator ^).

- * - * @param x First element. - * @param y Second element. - * - * @return Result of bitwise XOR operation. - */ - function bit_xor(x: number, y: number): number; - /** - *

Default hash function for number.

- * - *

Unary function that defines the default hash function used by the standard library.

- * - *

The functional call returns a hash value of its argument: A hash value is a value that depends solely on - * its argument, returning always the same value for the same argument (for a given execution of a program). The - * value returned shall have a small likelihood of being the same as the one returned for a different argument. - *

- * - * @param val Value to be hashed. - * - * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. - */ - function hash(val: number): number; - /** - *

Default hash function for string.

- * - *

Unary function that defines the default hash function used by the standard library.

- * - *

The functional call returns a hash value of its argument: A hash value is a value that depends solely on - * its argument, returning always the same value for the same argument (for a given execution of a program). The - * value returned shall have a small likelihood of being the same as the one returned for a different argument. - *

- * - * @param str A string to be hashed. - * - * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. - */ - function hash(str: string): number; - /** - *

Default hash function for Object.

- * - *

Unary function that defines the default hash function used by the standard library.

- * - *

The functional call returns a hash value of its argument: A hash value is a value that depends solely on - * its argument, returning always the same value for the same argument (for a given execution of a program). The - * value returned shall have a small likelihood of being the same as the one returned for a different argument. - *

- * - *

The default {@link hash} function of Object returns a value returned from {@link hash hash(number)} with - * an unique id of each Object. If you want to specify {@link hash} function of a specific class, then - * define a member function public hash(): number in the class.

- * - * @param obj Object to be hashed. - * - * @return Returns a hash value for its argument, as a value of type number. The number is an unsigned integer. - */ - function hash(obj: Object): number; - /** - *

Exchange contents of {@link IContainers containers}.

- * - *

The contents of container left are exchanged with those of right. Both container objects must have - * same type of elements (same template parameters), although sizes may differ.

- * - *

After the call to this member function, the elements in left are those which were in right before - * the call, and the elements of right are those which were in left. All iterators, references and - * pointers remain valid for the swapped objects.

- * - *

This is an overload of the generic algorithm swap that improves its performance by mutually transferring - * ownership over their assets to the other container (i.e., the containers exchange references to their data, without - * actually performing any element copy or movement): It behaves as if left. - * {@link IContainer.swap swap}(right) was called.

- * - * @param left A {@link IContainer container} to swap its contents. - * @param right A {@link IContainer container} to swap its contents. - */ - function swap(left: base.IContainer, right: base.IContainer): void; - /** - *

Exchange contents of queues.

- * - *

Exchanges the contents of left and right.

- * - * @param left A {@link Queue} container of the same type. Size may differ. - * @param right A {@link Queue} container of the same type. Size may differ. - */ - function swap(left: Queue, right: Queue): void; - /** - *

Exchange contents of {@link PriorityQueue PriorityQueues}.

- * - *

Exchanges the contents of left and right.

- * - * @param left A {@link PriorityQueue} container of the same type. Size may differ. - * @param right A {@link PriorityQueue} container of the same type. Size may differ. - */ - function swap(left: PriorityQueue, right: PriorityQueue): void; - /** - *

Exchange contents of {@link Stack Stacks}.

- * - *

Exchanges the contents of left and right.

- * - * @param left A {@link Stack} container of the same type. Size may differ. - * @param right A {@link Stack} container of the same type. Size may differ. - */ - function swap(left: Stack, right: Stack): void; - /** - *

Exchanges the contents of two {@link UniqueMap unique maps}.

- * - *

The contents of container left are exchanged with those of right. Both container objects must - * be of the same type (same template parameters), although sizes may differ.

- * - *

After the call to this member function, the elements in left are those which were in right - * before the call, and the elements of right are those which were in left. All iterators, references - * and pointers remain valid for the swapped objects.

- * - *

This is an overload of the generic algorithm swap that improves its performance by mutually transferring - * ownership over their assets to the other container (i.e., the containers exchange references to their data, - * without actually performing any element copy or movement): It behaves as if - * left.{@link UniqueMap.swap swap}(right) was called.

- * - * @param left An {@link UniqueMap unique map} to swap its conents. - * @param right An {@link UniqueMap unique map} to swap its conents. - */ - function swap(left: base.UniqueMap, right: base.UniqueMap): void; - /** - *

Exchanges the contents of two {@link MultiMap multi maps}.

- * - *

The contents of container left are exchanged with those of right. Both container objects must - * be of the same type (same template parameters), although sizes may differ.

- * - *

After the call to this member function, the elements in left are those which were in right - * before the call, and the elements of right are those which were in left. All iterators, references - * and pointers remain valid for the swapped objects.

- * - *

This is an overload of the generic algorithm swap that improves its performance by mutually transferring - * ownership over their assets to the other container (i.e., the containers exchange references to their data, - * without actually performing any element copy or movement): It behaves as if - * left.{@link MultiMap.swap swap}(right) was called.

- * - * @param left A {@link MultiMap multi map} to swap its conents. - * @param right A {@link MultiMap multi map} to swap its conents. - */ - function swap(left: base.MultiMap, right: base.MultiMap): void; -} -declare namespace std { - /** - *

Bind function arguments.

- * - *

Returns a function object based on fn, but with its arguments bound to args.

- * - *

Each argument may either be bound to a value or be a {@link placeholders placeholder}:

- *
    - *
  • If bound to a value, calling the returned function object will always use that value as argument.
  • - *
  • - * If a {@link placeholders placeholder}, calling the returned function object forwards an argument passed to the - * call (the one whose order number is specified by the placeholder). - *
  • - *
- * - *

Calling the returned object returns the same type as fn.

- * - * @param fn A function object, pointer to function or pointer to member. - * @param args List of arguments to bind: either values, or {@link placeholders}. - * - * @return A function object that, when called, calls fn with its arguments bound to args. If fn is - * a pointer to member, the first argument expected by the returned function is an object of the class fn - * is a member. - */ - function bind(fn: (...args: any[]) => Ret, ...args: any[]): (...args: any[]) => Ret; - /** - *

Bind function arguments.

- * - *

Returns a function object based on fn, but with its arguments bound to args.

- * - *

Each argument may either be bound to a value or be a {@link placeholders placeholder}:

- *
    - *
  • If bound to a value, calling the returned function object will always use that value as argument.
  • - *
  • - * If a {@link placeholders placeholder}, calling the returned function object forwards an argument passed to the - * call (the one whose order number is specified by the placeholder). - *
  • - *
- * - *

Calling the returned object returns the same type as fn.

- * - * @param fn A function object, pointer to function or pointer to member. - * @param thisArg This argument, owner object of the member method fn. - * @param args List of arguments to bind: either values, or {@link placeholders}. - * - * @return A function object that, when called, calls fn with its arguments bound to args. If fn is - * a pointer to member, the first argument expected by the returned function is an object of the class fn - * is a member. - */ - function bind(fn: (...args: any[]) => Ret, thisArg: T, ...args: any[]): (...args: any[]) => Ret; -} -/** - *

Bind argument placeholders.

- * - *
- * - *

When the function object returned by bind is called, an argument with placeholder {@link _1} is replaced by the - * first argument in the call, {@link _2} is replaced by the second argument in the call, and so on... For example:

- * - * - * let vec: Vector = new Vector(); - * - * let bind = std.bind(Vector.insert, _1, vec.end(), _2, _3); - * bind.apply(vec, 5, 1); // vec.insert(vec.end(), 5, 1); - * // [1, 1, 1, 1, 1] - * - * - *

When a call to {@link bind} is used as a subexpression in another call to bind, the {@link placeholders} - * are relative to the outermost {@link bind} expression.

- * - * @reference http://www.cplusplus.com/reference/functional/placeholders/ - * @author Jeongho Nam - */ -declare namespace std.placeholders { - /** - * @hidden - */ - class PlaceHolder { - private index_; - constructor(index: number); - readonly index: number; - } - /** - * Replaced by the first argument in the function call. - */ - const _1: PlaceHolder; - /** - * Replaced by the second argument in the function call. - */ - const _2: PlaceHolder; - /** - * Replaced by the third argument in the function call. - */ - const _3: PlaceHolder; - const _4: PlaceHolder; - const _5: PlaceHolder; - const _6: PlaceHolder; - const _7: PlaceHolder; - const _8: PlaceHolder; - const _9: PlaceHolder; - const _10: PlaceHolder; - const _11: PlaceHolder; - const _12: PlaceHolder; - const _13: PlaceHolder; - const _14: PlaceHolder; - const _15: PlaceHolder; - const _16: PlaceHolder; - const _17: PlaceHolder; - const _18: PlaceHolder; - const _19: PlaceHolder; - const _20: PlaceHolder; -} -declare namespace std.HashMap { - type iterator = std.MapIterator; - type reverse_iterator = std.MapReverseIterator; -} -declare namespace std { - /** - *

Hashed, unordered map.

- * - *

{@link HashMap}s are associative containers that store elements formed by the combination of a key value - * and a mapped value, and which allows for fast retrieval of individual elements based on their keys. - *

- * - *

In an {@link HashMap}, the key value is generally used to uniquely identify the element, while the - * mapped value is an object with the content associated to this key. Types of key and - * mapped value may differ.

- * - *

Internally, the elements in the {@link HashMap} are not sorted in any particular order with respect to either - * their key or mapped values, but organized into buckets depending on their hash values to allow - * for fast access to individual elements directly by their key values (with a constant average time complexity - * on average).

- * - *

{@link HashMap} containers are faster than {@link TreeMap} containers to access individual elements by their - * key, although they are generally less efficient for range iteration through a subset of their elements.

- * - *

- * - *

- * - *

Container properties

- *
- *
Associative
- *
Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
- * - *
Hashed
- *
Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their key.
- * - *
Map
- *
Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value.
- * - *
Unique keys
- *
No two elements in the container can have equivalent keys.
- *
- * - * @param Type of the key values. - * Each element in an {@link HashMap} is uniquely identified by its key value. - * @param Type of the mapped value. - * Each element in an {@link HashMap} is used to store some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/unordered_map/unordered_map - * @author Jeongho Nam - */ - class HashMap extends base.UniqueMap implements base.IHashMap { - /** - * @hidden - */ - private hash_buckets_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from elements. - */ - constructor(items: Pair[]); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - */ - constructor(array: [Key, T][]); - /** - * Copy Constructor. - */ - constructor(container: HashMap); - /** - * Construct from range iterators. - */ - constructor(begin: Iterator>, end: Iterator>); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: Key): MapIterator; - /** - * @inheritdoc - */ - begin(): MapIterator; - /** - * @inheritdoc - */ - begin(index: number): MapIterator; - /** - * @inheritdoc - */ - end(): MapIterator; - /** - * @inheritdoc - */ - end(index: number): MapIterator; - /** - * @inheritdoc - */ - rbegin(): MapReverseIterator; - /** - * @inheritdoc - */ - rbegin(index: number): MapReverseIterator; - /** - * @inheritdoc - */ - rend(): MapReverseIterator; - /** - * @inheritdoc - */ - rend(index: number): MapReverseIterator; - /** - * @inheritdoc - */ - bucket_count(): number; - /** - * @inheritdoc - */ - bucket_size(index: number): number; - /** - * @inheritdoc - */ - max_load_factor(): number; - /** - * @inheritdoc - */ - max_load_factor(z: number): void; - /** - * @inheritdoc - */ - bucket(key: Key): number; - /** - * @inheritdoc - */ - reserve(n: number): void; - /** - * @inheritdoc - */ - rehash(n: number): void; - /** - * @hidden - */ - protected _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: MapIterator, last: MapIterator): void; - /** - *

Swap content.

- * - *

Exchanges the content of the container by the content of obj, which is another - * {@link HashMap map} of the same type. Sizes abd container type may differ.

- * - *

After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

- * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

- * - * @param obj Another {@link HashMap map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link HashMap container}. - */ - swap(obj: HashMap): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer>): void; - } -} -declare namespace std.HashMultiMap { - type iterator = std.MapIterator; - type reverse_iterator = std.MapReverseIterator; -} -declare namespace std { - /** - *

Hashed, unordered Multimap.

- * - *

{@link HashMultiMap}s are associative containers that store elements formed by the combination of - * a key value and a mapped value, much like {@link HashMultiMap} containers, but allowing - * different elements to have equivalent keys.

- * - *

In an {@link HashMultiMap}, the key value is generally used to uniquely identify the - * element, while the mapped value is an object with the content associated to this key. - * Types of key and mapped value may differ.

- * - *

Internally, the elements in the {@link HashMultiMap} are not sorted in any particular order with - * respect to either their key or mapped values, but organized into buckets depending on - * their hash values to allow for fast access to individual elements directly by their key values - * (with a constant average time complexity on average).

- * - *

Elements with equivalent keys are grouped together in the same bucket and in such a way that - * an iterator can iterate through all of them. Iterators in the container are doubly linked iterators.

- * - *

- * - *

- * - *

Container properties

- *
- *
Associative
- *
Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
- * - *
Hashed
- *
Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their key.
- * - *
Map
- *
Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value.
- * - *
Multiple equivalent keys
- *
The container can hold multiple elements with equivalent keys.
- *
- * - * @param Type of the key values. - * Each element in an {@link HashMultiMap} is identified by a key value. - * @param Type of the mapped value. - * Each element in an {@link HashMultiMap} is used to store some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/unordered_map/unordered_multimap - * @author Jeongho Nam - */ - class HashMultiMap extends base.MultiMap { - /** - * @hidden - */ - private hash_buckets_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from elements. - */ - constructor(items: Pair[]); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - */ - constructor(array: [Key, T][]); - /** - * Copy Constructor. - */ - constructor(container: HashMultiMap); - /** - * Construct from range iterators. - */ - constructor(begin: Iterator>, end: Iterator>); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: Key): MapIterator; - /** - * @inheritdoc - */ - count(key: Key): number; - /** - * @inheritdoc - */ - begin(): MapIterator; - /** - * @inheritdoc - */ - begin(index: number): MapIterator; - /** - * @inheritdoc - */ - end(): MapIterator; - /** - * @inheritdoc - */ - end(index: number): MapIterator; - /** - * @inheritdoc - */ - rbegin(): MapReverseIterator; - /** - * @inheritdoc - */ - rbegin(index: number): MapReverseIterator; - /** - * @inheritdoc - */ - rend(): MapReverseIterator; - /** - * @inheritdoc - */ - rend(index: number): MapReverseIterator; - /** - * @inheritdoc - */ - bucket_count(): number; - /** - * @inheritdoc - */ - bucket_size(n: number): number; - /** - * @inheritdoc - */ - max_load_factor(): number; - /** - * @inheritdoc - */ - max_load_factor(z: number): void; - /** - * @inheritdoc - */ - bucket(key: Key): number; - /** - * @inheritdoc - */ - reserve(n: number): void; - /** - * @inheritdoc - */ - rehash(n: number): void; - /** - * @hidden - */ - protected _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: MapIterator, last: MapIterator): void; - /** - *

Swap content.

- * - *

Exchanges the content of the container by the content of obj, which is another - * {@link HashMultiMap map} of the same type. Sizes abd container type may differ.

- * - *

After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

- * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

- * - * @param obj Another {@link HashMultiMap map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link HashMultiMap container}. - */ - swap(obj: HashMultiMap): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer>): void; - } -} -declare namespace std.HashMultiSet { - type iterator = std.SetIterator; - type reverse_iterator = std.SetReverseIterator; -} -declare namespace std { - /** - *

Hashed, unordered Multiset.

- * - *

{@link HashMultiSet HashMultiSets} are containers that store elements in no particular order, allowing fast - * retrieval of individual elements based on their value, much like {@link HashMultiSet} containers, - * but allowing different elements to have equivalent values.

- * - *

In an {@link HashMultiSet}, the value of an element is at the same time its key, used to - * identify it. Keys are immutable, therefore, the elements in an {@link HashMultiSet} cannot be - * modified once in the container - they can be inserted and removed, though.

- * - *

Internally, the elements in the {@link HashMultiSet} are not sorted in any particular, but - * organized into buckets depending on their hash values to allow for fast access to individual - * elements directly by their values (with a constant average time complexity on average).

- * - *

Elements with equivalent values are grouped together in the same bucket and in such a way that an - * iterator can iterate through all of them. Iterators in the container are doubly linked iterators.

- * - *

- *

- * - *

Container properties

- *
- *
Associative
- *
Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
- * - *
Hashed
- *
Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their key.
- * - *
Set
- *
The value of an element is also the key used to identify it.
- * - *
Multiple equivalent keys
- *
The container can hold multiple elements with equivalent keys.
- *
- * - * @param Type of the elements. - * Each element in an {@link UnorderedMultiSet} is also identified by this value.. - * - * @reference http://www.cplusplus.com/reference/unordered_set/unordered_multiset - * @author Jeongho Nam - */ - class HashMultiSet extends base.MultiSet { - /** - * @hidden - */ - private hash_buckets_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from elements. - */ - constructor(items: T[]); - /** - * Copy Constructor. - */ - constructor(container: HashMultiSet); - /** - * Construct from range iterators. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: T): SetIterator; - /** - * @inheritdoc - */ - count(key: T): number; - /** - * @inheritdoc - */ - begin(): SetIterator; - /** - * @inheritdoc - */ - begin(index: number): SetIterator; - /** - * @inheritdoc - */ - end(): SetIterator; - /** - * @inheritdoc - */ - end(index: number): SetIterator; - /** - * @inheritdoc - */ - rbegin(): SetReverseIterator; - /** - * @inheritdoc - */ - rbegin(index: number): SetReverseIterator; - /** - * @inheritdoc - */ - rend(): SetReverseIterator; - /** - * @inheritdoc - */ - rend(index: number): SetReverseIterator; - /** - * @inheritdoc - */ - bucket_count(): number; - /** - * @inheritdoc - */ - bucket_size(n: number): number; - /** - * @inheritdoc - */ - max_load_factor(): number; - /** - * @inheritdoc - */ - max_load_factor(z: number): void; - /** - * @inheritdoc - */ - bucket(key: T): number; - /** - * @inheritdoc - */ - reserve(n: number): void; - /** - * @inheritdoc - */ - rehash(n: number): void; - /** - * @hidden - */ - protected _Insert_by_val(val: T): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: SetIterator, last: SetIterator): void; - /** - *

Swap content.

- * - *

Exchanges the content of the container by the content of obj, which is another - * {@link HashMultiSet set} of the same type. Sizes abd container type may differ.

- * - *

After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

- * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

- * - * @param obj Another {@link HashMultiSet set container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link HashMultiSet container}. - */ - swap(obj: HashMultiSet): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std.HashSet { - type iterator = std.SetIterator; - type reverse_iterator = std.SetReverseIterator; -} -declare namespace std { - /** - *

Hashed, unordered set.

- * - *

{@link HashSet}s are containers that store unique elements in no particular order, and which - * allow for fast retrieval of individual elements based on their value.

- * - *

In an {@link HashSet}, the value of an element is at the same time its key, that - * identifies it uniquely. Keys are immutable, therefore, the elements in an {@link HashSet} cannot be - * modified once in the container - they can be inserted and removed, though.

- * - *

Internally, the elements in the {@link HashSet} are not sorted in any particular order, but - * organized into buckets depending on their hash values to allow for fast access to individual elements - * directly by their values (with a constant average time complexity on average).

- * - *

{@link HashSet} containers are faster than {@link TreeSet} containers to access individual - * elements by their key, although they are generally less efficient for range iteration through a - * subset of their elements.

- * - *

- *

- * - *

Container properties

- *
- *
Associative
- *
Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
- * - *
Hashed
- *
Hashed containers organize their elements using hash tables that allow for fast access to elements - * by their key.
- * - *
Set
- *
The value of an element is also the key used to identify it.
- * - *
Unique keys
- *
No two elements in the container can have equivalent keys.
- *
- * - * @param Type of the elements. - * Each element in an {@link HashSet} is also uniquely identified by this value. - * - * @reference http://www.cplusplus.com/reference/unordered_set/unordered_set - * @author Jeongho Nam - */ - class HashSet extends base.UniqueSet implements base.IHashSet { - /** - * @hidden - */ - private hash_buckets_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from elements. - */ - constructor(items: T[]); - /** - * Copy Constructor. - */ - constructor(container: HashSet); - /** - * Construct from range iterators. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: T): SetIterator; - /** - * @inheritdoc - */ - begin(): SetIterator; - /** - * @inheritdoc - */ - begin(index: number): SetIterator; - /** - * @inheritdoc - */ - end(): SetIterator; - /** - * @inheritdoc - */ - end(index: number): SetIterator; - /** - * @inheritdoc - */ - rbegin(): SetReverseIterator; - /** - * @inheritdoc - */ - rbegin(index: number): SetReverseIterator; - /** - * @inheritdoc - */ - rend(): SetReverseIterator; - /** - * @inheritdoc - */ - rend(index: number): SetReverseIterator; - /** - * @inheritdoc - */ - bucket_count(): number; - /** - * @inheritdoc - */ - bucket_size(n: number): number; - /** - * @inheritdoc - */ - max_load_factor(): number; - /** - * @inheritdoc - */ - max_load_factor(z: number): void; - /** - * @inheritdoc - */ - bucket(key: T): number; - /** - * @inheritdoc - */ - reserve(n: number): void; - /** - * @inheritdoc - */ - rehash(n: number): void; - /** - * @hidden - */ - protected _Insert_by_val(val: T): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: SetIterator, last: SetIterator): void; - /** - *

Swap content.

- * - *

Exchanges the content of the container by the content of obj, which is another - * {@link HashSet set} of the same type. Sizes abd container type may differ.

- * - *

After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

- * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

- * - * @param obj Another {@link HashSet set container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link HashSet container}. - */ - swap(obj: HashSet): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std { - /** - *

Comparable instance.

- * - *

{@link IComparable} is a common interface for objects who can compare each other.

- * - * @reference https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html - * @author Jeongho Nam - */ - interface IComparable extends Object { - /** - *

Indicates whether some other object is "equal to" this one.

- * - *

The {@link equal_to} method implements an equivalence relation on non-null object references:

- * - *
    - *
  • - * It is reflexive: for any non-null reference value x, x.equal_to(x) - * should return true. - *
  • - *
  • - * It is symmetric: for any non-null reference values x and y, - * x.equal_to(y) should return true if and only if y.equal_to(x) - * returns true.
  • - *
  • - * It is transitive: for any non-null reference values x, y, and - * z, if x.equal_to(y) returns true and y.equal_to(z) - * returns true, then x.equal_to(z) should return true. - *
  • - *
  • - * It is consistent: for any non-null reference values x and y, multiple - * invocations of x.equal_to(y) consistently return true or consistently return - * false, provided no information used in equal_to comparisons on the objects is modified. - *
  • - *
  • - * For any non-null reference value x, x.equal_to(null) should return - * false. - *
  • - *
- * - *

The {@link equal_to} method for interface {@link IComparable} implements the most discriminating possible - * equivalence relation on objects; that is, for any non-null reference values x and - * y, this method returns true if and only if x and y - * refer to the same object (x == y has the value true).

- * - *

Note that it is generally necessary to override the {@link hash_code} method whenever this method is - * overridden, so as to maintain the general contract for the {@link hash_code} method, which states that - * equal objects must have equal hash codes.

- * - *
    - *
  • {@link IComparable.equal_to} is called by {@link std.equal_to}.
  • - *
- * - * @param obj the reference object with which to compare. - * - * @return true if this object is the same as the obj argument; false otherwise. - */ - equals(obj: T): boolean; - /** - *

Less-than inequality comparison.

- * - *

Binary method returns whether the the instance compares less than the obj.

- * - *
    - *
  • - * {@link IComparable.less} is called by {@link std.less}. Also, this method can be used on standard - * algorithms such as {@link sort sort()}, {@link merge merge()} or - * {@link TreeMap.lower_bound lower_bound()}. - *
  • - *
- * - * @param obj the reference object with which to compare. - * - * @return Whether the first parameter is less than the second. - */ - less(obj: T): boolean; - /** - *

Issue a hash code.

- * - *

Returns a hash code value for the object. This method is supported for the benefit of hash tables such - * as those provided by hash containers; {@link HashSet}, {@link HashMap}, {@link MultiHashSet} and - * {@link MultiHashMap}.

- * - *

As much as is reasonably practical, the {@link hash_code} method defined by interface - * {@link IComparable} does return distinct integers for distinct objects. (This is typically implemented by - * converting the internal address of the object into an integer, but this implementation technique is not - * required by the JavaScript programming language.)

- * - *
    - *
  • - * {@link IComparable.hash_code} is called by {@link std.hash_code}. If you want to keep basically - * provided hash function, then returns {@link std.Hash.code}; return std.Hash.code(this); - *
  • - *
- * - * @return An hash code who represents the object. - */ - hashCode?(): number; - } -} -declare namespace std.List { - type iterator = std.ListIterator; - type reverse_iterator = std.ListReverseIterator; -} -declare namespace std { - /** - *

Doubly linked list.

- * - *

{@link List}s are sequence containers that allow constant time insert and erase operations anywhere within the - * sequence, and iteration in both directions.

- * - *

List containers are implemented as doubly-linked lists; Doubly linked lists can store each of the elements they - * contain in different and unrelated storage locations. The ordering is kept internally by the association to each - * element of a link to the element preceding it and a link to the element following it.

- * - *

Compared to other base standard sequence containers (array, vector and deque), lists perform generally better - * in inserting, extracting and moving elements in any position within the container for which an iterator has already - * been obtained, and therefore also in algorithms that make intensive use of these, like sorting algorithms.

- * - *

The main drawback of lists and forward_lists compared to these other sequence containers is that they lack - * direct access to the elements by their position; For example, to access the sixth element in a list, one has to - * iterate from a known position (like the beginning or the end) to that position, which takes linear time in the - * distance between these. They also consume some extra memory to keep the linking information associated to each - * element (which may be an important factor for large lists of small-sized elements).

- * - *

- * - *

- * - *

Container properties

- *
- *
Sequence
- *
Elements in sequence containers are ordered in a strict linear sequence. Individual elements are accessed by - * their position in this sequence.
- * - *
Doubly-linked list
- *
Each element keeps information on how to locate the next and the previous elements, allowing constant time - * insert and erase operations before or after a specific element (even of entire ranges), but no direct random - * access.
- *
- * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/list/list/ - * @author Jeongho Nam - */ - class List extends base.ListContainer> { - private rend_; - /** - *

Default Constructor.

- * - *

Constructs an empty container, with no elements.

- */ - constructor(); - /** - *

Initializer list Constructor.

- * - *

Constructs a container with a copy of each of the elements in array, in the same order.

- * - * @param array An array containing elements to be copied and contained. - */ - constructor(items: Array); - /** - *

Fill Constructor.

- * - *

Constructs a container with n elements. Each element is a copy of val (if provided).

- * - * @param n Initial container size (i.e., the number of elements in the container at construction). - * @param val Value to fill the container with. Each of the n elements in the container is - * initialized to a copy of this value. - */ - constructor(size: number, val: T); - /** - *

Copy Constructor.

- * - *

Constructs a container with a copy of each of the elements in container, in the same order.

- * - * @param container Another container object of the same type (with the same class template - * arguments T), whose contents are either copied or acquired. - */ - constructor(container: List); - /** - *

Range Constructor.

- * - *

Constructs a container with as many elements as the range (begin, end), with each - * element emplace-constructed from its corresponding element in that range, in the same order.

- * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @hidden - */ - protected _Create_iterator(prev: ListIterator, next: ListIterator, val: T): ListIterator; - /** - * @hidden - */ - protected _Set_begin(it: ListIterator): void; - /** - * @inheritdoc - */ - assign(n: number, val: T): void; - /** - * @inheritdoc - */ - assign>(begin: InputIterator, end: InputIterator): void; - /** - * @inheritdoc - */ - rbegin(): ListReverseIterator; - /** - * @inheritdoc - */ - rend(): ListReverseIterator; - /** - * @inheritdoc - */ - front(): T; - /** - * @inheritdoc - */ - back(): T; - /** - *

Insert an element.

- * - *

The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

- * - *

Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param position Position in the container where the new element is inserted. - * {@link iterator}> is a member type, defined as a - * {@link ListIterator bidirectional iterator} type that points to elements. - * @param val Value to be inserted as an element. - * - * @return An iterator that points to the newly inserted element; val. - */ - insert(position: ListIterator, val: T): ListIterator; - /** - *

Insert elements by repeated filling.

- * - *

The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

- * - *

Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param position Position in the container where the new elements are inserted. The {@link iterator} is a - * member type, defined as a {@link ListIterator bidirectional iterator} type that points to - * elements. - * @param size Number of elements to insert. - * @param val Value to be inserted as an element. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert(position: ListIterator, size: number, val: T): ListIterator; - /** - *

Insert elements by range iterators.

- * - *

The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

- * - *

Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param position Position in the container where the new elements are inserted. The {@link iterator} is a - * member type, defined as a {@link ListIterator bidirectional iterator} type that points to - * elements. - * @param begin An iterator specifying range of the begining element. - * @param end An iterator specifying range of the ending element. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert>(position: ListIterator, begin: InputIterator, end: InputIterator): ListIterator; - /** - *

Insert an element.

- * - *

The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

- * - *

Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param position Position in the container where the new element is inserted. - * {@link iterator}> is a member type, defined as a - * {@link ListReverseIterator bidirectional iterator} type that points to elements. - * @param val Value to be inserted as an element. - * - * @return An iterator that points to the newly inserted element; val. - */ - insert(position: ListReverseIterator, val: T): ListReverseIterator; - /** - *

Insert elements by repeated filling.

- * - *

The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

- * - *

Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param position Position in the container where the new elements are inserted. The {@link iterator} is a - * member type, defined as a {@link ListReverseIterator bidirectional iterator} type that points to - * elements. - * @param size Number of elements to insert. - * @param val Value to be inserted as an element. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert(position: ListReverseIterator, size: number, val: T): ListReverseIterator; - /** - *

Insert elements by range iterators.

- * - *

The container is extended by inserting a new element before the element at the specified - * position. This effectively increases the {@link List.size List size} by the amount of elements - * inserted.

- * - *

Unlike other standard sequence containers, {@link List} is specifically designed to be efficient - * inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param position Position in the container where the new elements are inserted. The {@link iterator} is a - * member type, defined as a {@link ListReverseIterator bidirectional iterator} type that points to - * elements. - * @param begin An iterator specifying range of the begining element. - * @param end An iterator specifying range of the ending element. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert>(position: ListReverseIterator, begin: InputIterator, end: InputIterator): ListReverseIterator; - /** - *

Erase an element.

- * - *

Removes from the {@link List} either a single element; position.

- * - *

This effectively reduces the container size by the number of element removed.

- * - *

Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param position Iterator pointing to a single element to be removed from the {@link List}. - * - * @return An iterator pointing to the element that followed the last element erased by the function call. - * This is the {@link end end()} if the operation erased the last element in the sequence. - */ - erase(position: ListIterator): ListIterator; - /** - *

Erase elements.

- * - *

Removes from the {@link List} container a range of elements.

- * - *

This effectively reduces the container {@link size} by the number of elements removed.

- * - *

Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - * - * @return An iterator pointing to the element that followed the last element erased by the function call. - * This is the {@link end end()} if the operation erased the last element in the sequence. - */ - erase(begin: ListIterator, end: ListIterator): ListIterator; - /** - *

Erase an element.

- * - *

Removes from the {@link List} either a single element; position.

- * - *

This effectively reduces the container size by the number of element removed.

- * - *

Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param position Iterator pointing to a single element to be removed from the {@link List}. - * - * @return An iterator pointing to the element that followed the last element erased by the function call. - * This is the {@link rend rend()} if the operation erased the last element in the sequence. - */ - erase(position: ListReverseIterator): ListReverseIterator; - /** - *

Erase elements.

- * - *

Removes from the {@link List} container a range of elements.

- * - *

This effectively reduces the container {@link size} by the number of elements removed.

- * - *

Unlike other standard sequence containers, {@link List} objects are specifically designed to be - * efficient inserting and removing elements in any position, even in the middle of the sequence.

- * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - * - * @return An iterator pointing to the element that followed the last element erased by the function call. - * This is the {@link rend rend()} if the operation erased the last element in the sequence. - */ - erase(begin: ListReverseIterator, end: ListReverseIterator): ListReverseIterator; - /** - *

Remove duplicate values.

- * - *

Removes all but the first element from every consecutive group of equal elements in the

- * - *

Notice that an element is only removed from the {@link List} container if it compares equal to the - * element immediately preceding it. Thus, this function is especially useful for sorted lists.

- */ - unique(): void; - /** - *

Remove duplicate values.

- * - *

Removes all but the first element from every consecutive group of equal elements in the

- * - *

The argument binary_pred is a specific comparison function that determine the uniqueness - * of an element. In fact, any behavior can be implemented (and not only an equality comparison), but notice - * that the function will call binary_pred(it.value, it.prev().value) for all pairs of elements - * (where it is an iterator to an element, starting from the second) and remove it - * from the {@link List} if the predicate returns true. - * - *

Notice that an element is only removed from the {@link List} container if it compares equal to the - * element immediately preceding it. Thus, this function is especially useful for sorted lists.

- * - * @param binary_pred Binary predicate that, taking two values of the same type than those contained in the - * {@link List}, returns true to remove the element passed as first argument - * from the container, and false otherwise. This shall be a function pointer - * or a function object. - */ - unique(binary_pred: (left: T, right: T) => boolean): void; - /** - *

Remove elements with specific value.

- * - *

Removes from the container all the elements that compare equal to val. This calls the - * destructor of these objects and reduces the container {@link size} by the number of elements removed.

- * - *

Unlike member function {@link List.erase}, which erases elements by their position (using an - * iterator), this function ({@link List.remove}) removes elements by their value.

- * - *

A similar function, {@link List.remove_if}, exists, which allows for a condition other than an - * equality comparison to determine whether an element is removed.

- * - * @param val Value of the elements to be removed. - */ - remove(val: T): void; - /** - *

Remove elements fulfilling condition.

- * - *

Removes from the container all the elements for which pred returns true. This - * calls the destructor of these objects and reduces the container {@link size} by the number of elements - * removed.

- * - *

The function calls pred(it.value) for each element (where it is an iterator - * to that element). Any of the elements in the list for which this returns true, are removed - * from the

- * - * @param pred Unary predicate that, taking a value of the same type as those contained in the forward_list - * object, returns true for those values to be removed from the container, and - * false for those remaining. This can either be a function pointer or a function - * object. - */ - remove_if(pred: (val: T) => boolean): void; - /** - *

Merge sorted {@link List Lists}.

- * - *

Merges obj into the {@link List} by transferring all of its elements at their respective - * ordered positions into the container (both containers shall already be ordered). - *

- * - *

This effectively removes all the elements in obj (which becomes {@link empty}), and inserts - * them into their ordered position within container (which expands in {@link size} by the number of elements - * transferred). The operation is performed without constructing nor destroying any element: they are - * transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type supports - * move-construction or not.

- * - *

This function requires that the {@link List} containers have their elements already ordered by value - * ({@link less}) before the call. For an alternative on unordered {@link List Lists}, see - * {@link List.splice}.

- * - *

Assuming such ordering, each element of obj is inserted at the position that corresponds to its - * value according to the strict weak ordering defined by {@link less}. The resulting order of equivalent - * elements is stable (i.e., equivalent elements preserve the relative order they had before the call, and - * existing elements precede those equivalent inserted from obj).

- * - * The function does nothing if this == obj. - * - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - * Note that this function modifies obj no matter whether an lvalue or rvalue reference is - * passed. - */ - merge(obj: List): void; - /** - *

Merge sorted {@link List Lists}.

- * - *

Merges obj into the {@link List} by transferring all of its elements at their respective - * ordered positions into the container (both containers shall already be ordered). - *

- * - *

This effectively removes all the elements in obj (which becomes {@link empty}), and inserts - * them into their ordered position within container (which expands in {@link size} by the number of elements - * transferred). The operation is performed without constructing nor destroying any element: they are - * transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type supports - * move-construction or not.

- * - *

The argument compare is a specific predicate to perform the comparison operation between - * elements. This comparison shall produce a strict weak ordering of the elements (i.e., a consistent - * transitive comparison, without considering its reflexiveness). - * - *

This function requires that the {@link List} containers have their elements already ordered by - * compare before the call. For an alternative on unordered {@link List Lists}, see - * {@link List.splice}.

- * - *

Assuming such ordering, each element of obj is inserted at the position that corresponds to its - * value according to the strict weak ordering defined by compare. The resulting order of equivalent - * elements is stable (i.e., equivalent elements preserve the relative order they had before the call, and - * existing elements precede those equivalent inserted from obj).

- * - * The function does nothing if this == obj. - * - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - * Note that this function modifies obj no matter whether an lvalue or rvalue reference is - * passed. - * @param compare Binary predicate that, taking two values of the same type than those contained in the - * {@link list}, returns true if the first argument is considered to go before - * the second in the strict weak ordering it defines, and false otherwise. - * This shall be a function pointer or a function object. - */ - merge(obj: List, compare: (left: T, right: T) => boolean): void; - /** - *

Transfer elements from {@link List} to {@link List}.

- * - *

Transfers elements from obj into the container, inserting them at position.

- * - *

This effectively inserts all elements into the container and removes them from obj, altering - * the sizes of both containers. The operation does not involve the construction or destruction of any - * element. They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the - * value_type supports move-construction or not.

- * - *

This first version (1) transfers all the elements of obj into the

- * - * @param position Position within the container where the elements of obj are inserted. - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - */ - splice(position: ListIterator, obj: List): void; - /** - *

Transfer an element from {@link List} to {@link List}.

- * - *

Transfers an element from obj, which is pointed by an {@link ListIterator iterator} it, - * into the container, inserting the element at specified position.

- * - *

This effectively inserts an element into the container and removes it from obj, altering the - * sizes of both containers. The operation does not involve the construction or destruction of any element. - * They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the value_type - * supports move-construction or not.

- * - *

This second version (2) transfers only the element pointed by it from obj into the - *

- * - * @param position Position within the container where the element of obj is inserted. - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - * This parameter may be this if position points to an element not actually - * being spliced. - * @param it {@link ListIterator Iterator} to an element in obj. Only this single element is - * transferred. - */ - splice(position: ListIterator, obj: List, it: ListIterator): void; - /** - *

Transfer elements from {@link List} to {@link List}.

- * - *

Transfers elements from obj into the container, inserting them at position.

- * - *

This effectively inserts those elements into the container and removes them from obj, altering - * the sizes of both containers. The operation does not involve the construction or destruction of any - * element. They are transferred, no matter whether obj is an lvalue or an rvalue, or whether the - * value_type supports move-construction or not.

- * - *

This third version (3) transfers the range [begin, end) from obj into the - *

- * - * @param position Position within the container where the elements of obj are inserted. - * @param obj A {@link List} object of the same type (i.e., with the same template parameters, T). - * This parameter may be this if position points to an element not actually - * being spliced. - * @param begin {@link ListIterator An Iterator} specifying initial position of a range of elements in - * obj. Transfers the elements in the range [begin, end) to - * position. - * @param end {@link ListIterator An Iterator} specifying final position of a range of elements in - * obj. Transfers the elements in the range [begin, end) to - * position. Notice that the range includes all the elements between begin and - * end, including the element pointed by begin but not the one pointed by end. - */ - splice(position: ListIterator, obj: List, begin: ListIterator, end: ListIterator): void; - /** - *

Sort elements in

- * - *

Sorts the elements in the {@link List}, altering their position within the

- * - *

The sorting is performed by applying an algorithm that uses {@link less}. This comparison shall - * produce a strict weak ordering of the elements (i.e., a consistent transitive comparison, without - * considering its reflexiveness).

- * - *

The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative - * order they had before the call.

- * - *

The entire operation does not involve the construction, destruction or copy of any element object. - * Elements are moved within the

- */ - sort(): void; - /** - *

Sort elements in

- * - *

Sorts the elements in the {@link List}, altering their position within the

- * - *

The sorting is performed by applying an algorithm that uses compare. This comparison shall - * produce a strict weak ordering of the elements (i.e., a consistent transitive comparison, without - * considering its reflexiveness).

- * - *

The resulting order of equivalent elements is stable: i.e., equivalent elements preserve the relative - * order they had before the call.

- * - *

The entire operation does not involve the construction, destruction or copy of any element object. - * Elements are moved within the

- * - * @param compare Binary predicate that, taking two values of the same type of those contained in the - * {@link List}, returns true if the first argument goes before the second - * argument in the strict weak ordering it defines, and false otherwise. This - * shall be a function pointer or a function object. - */ - sort(compare: (left: T, right: T) => boolean): void; - /** - * @hidden - */ - private qsort(first, last, compare); - /** - * @hidden - */ - private partition(first, last, compare); - /** - *

Swap content.

- * - *

Exchanges the content of the container by the content of obj, which is another - * {@link List container} object with same type of elements. Sizes and container type may differ.

- * - *

After the call to this member function, the elements in this container are those which were in obj - * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

- * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

- * - * @param obj Another {@link List container} of the same type of elements (i.e., instantiated - * with the same template parameter, T) whose content is swapped with that of this - * {@link container List}. - */ - swap(obj: List): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std { - /** - *

An iterator, node of a List.

- * - *

- * - *

- * - * @author Jeongho Nam - */ - class ListIterator extends base.ListIteratorBase { - /** - * Initializer Constructor. - * - * #### Note - * Do not create the iterator directly, by yourself. - * - * Use {@link List.begin begin()}, {@link List.end end()} in {@link List container} instead. - * - * @param source The source {@link List container} to reference. - * @param prev A refenrece of previous node ({@link ListIterator iterator}). - * @param next A refenrece of next node ({@link ListIterator iterator}). - * @param value Value to be stored in the node (iterator). - */ - constructor(source: List, prev: ListIterator, next: ListIterator, value: T); - /** - * @inheritdoc - */ - prev(): ListIterator; - /** - * @inheritdoc - */ - next(): ListIterator; - /** - * @inheritdoc - */ - advance(step: number): ListIterator; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * @inheritdoc - */ - equals(obj: ListIterator): boolean; - /** - * @inheritdoc - */ - swap(obj: ListIterator): void; - } -} -declare namespace std { - /** - *

A reverse-iterator of List.

- * - *

- * - *

- * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class ListReverseIterator extends ReverseIterator, ListReverseIterator> implements base.ILinearIterator { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: ListIterator); - /** - * @hidden - */ - protected _Create_neighbor(base: ListIterator): ListReverseIterator; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - } -} -declare namespace std.Vector { - type iterator = std.VectorIterator; - type reverse_iterator = std.VectorReverseIterator; -} -declare namespace std { - /** - *

Vector, the dynamic array.

- * - *

{@link Vector}s are sequence containers representing arrays that can change in size.

- * - *

Just like arrays, {@link Vector}s use contiguous storage locations for their elements, which means that - * their elements can also be accessed using offsets on regular pointers to its elements, and just as efficiently - * as in arrays. But unlike arrays, their size can change dynamically, with their storage being handled - * automatically by the container.

- * - *

Internally, {@link Vector}s use a dynamically allocated array to store their elements. This array may need - * to be reallocated in order to grow in size when new elements are inserted, which implies allocating a new - * array and moving all elements to it. This is a relatively expensive task in terms of processing time, and - * thus, {@link Vector}s do not reallocate each time an element is added to the container.

- * - *

Instead, {@link Vector} containers may allocate some extra storage to accommodate for possible growth, and - * thus the container may have an actual {@link capacity} greater than the storage strictly needed to contain its - * elements (i.e., its {@link size}). Libraries can implement different strategies for growth to balance between - * memory usage and reallocations, but in any case, reallocations should only happen at logarithmically growing - * intervals of {@link size} so that the insertion of individual elements at the end of the {@link Vector} can be - * provided with amortized constant time complexity (see {@link push_back push_back()}).

- * - *

Therefore, compared to arrays, {@link Vector}s consume more memory in exchange for the ability to manage - * storage and grow dynamically in an efficient way.

- * - *

Compared to the other dynamic sequence containers ({@link Deque}s, {@link List}s), {@link Vector Vectors} - * are very efficient accessing its elements (just like arrays) and relatively efficient adding or removing - * elements from its end. For operations that involve inserting or removing elements at positions other than the - * end, they perform worse than the others, and have less consistent iterators and references than {@link List}s. - *

- * - *

- * - *

- * - *

Container properties

- *
- *
Sequence
- *
- * Elements in sequence containers are ordered in a strict linear sequence. Individual elements are - * accessed by their position in this sequence. - *
- * - *
Dynamic array
- *
- * Allows direct access to any element in the sequence, even through pointer arithmetics, and provides - * relatively fast addition/removal of elements at the end of the sequence. - *
- *
- * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/vector/vector - * @author Jeongho Nam - */ - class Vector extends Array implements base.IContainer, base.IArrayContainer { - /** - * @hidden - */ - private end_; - /** - * @hidden - */ - private rend_; - /** - *

Default Constructor.

- * - *

Constructs an empty container, with no elements.

- */ - constructor(); - /** - * @inheritdoc - */ - constructor(array: Array); - /** - *

Initializer list Constructor.

- * - *

Constructs a container with a copy of each of the elements in array, in the same order.

- * - * @param array An array containing elements to be copied and contained. - */ - constructor(n: number); - /** - *

Fill Constructor.

- * - *

Constructs a container with n elements. Each element is a copy of val (if provided).

- * - * @param n Initial container size (i.e., the number of elements in the container at construction). - * @param val Value to fill the container with. Each of the n elements in the container is - * initialized to a copy of this value. - */ - constructor(n: number, val: T); - /** - *

Copy Constructor.

- * - *

Constructs a container with a copy of each of the elements in container, in the same order.

- * - * @param container Another container object of the same type (with the same class template - * arguments T), whose contents are either copied or acquired. - */ - constructor(container: Vector); - /** - *

Range Constructor.

- * - *

Constructs a container with as many elements as the range (begin, end), with each - * element emplace-constructed from its corresponding element in that range, in the same order.

- * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * @inheritdoc - */ - assign>(begin: InputIterator, end: InputIterator): void; - /** - * @inheritdoc - */ - assign(n: number, val: T): void; - /** - * @inheritdoc - */ - reserve(size: number): void; - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - begin(): VectorIterator; - /** - * @inheritdoc - */ - end(): VectorIterator; - /** - * @inheritdoc - */ - rbegin(): VectorReverseIterator; - /** - * @inheritdoc - */ - rend(): VectorReverseIterator; - /** - * @inheritdoc - */ - size(): number; - /** - * @inheritdoc - */ - capacity(): number; - /** - * @inheritdoc - */ - empty(): boolean; - /** - * @inheritdoc - */ - at(index: number): T; - /** - * @inheritdoc - */ - set(index: number, val: T): T; - /** - * @inheritdoc - */ - front(): T; - /** - * @inheritdoc - */ - back(): T; - /** - * @inheritdoc - */ - push_back(val: T): void; - /** - *

Insert an element.

- * - *

The {@link Vector} is extended by inserting new element before the element at the specified - * position, effectively increasing the container size by one.

- * - *

This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

- * - *

Because {@link Vector}s use an Array as their underlying storage, inserting element in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to its new position. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

- * - * @param position Position in the {@link Vector} where the new element is inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param val Value to be copied to the inserted element. - * - * @return An iterator that points to the newly inserted element. - */ - insert(position: VectorIterator, val: T): VectorIterator; - /** - *

Insert elements by repeated filling.

- * - *

The {@link Vector} is extended by inserting new elements before the element at the specified - * position, effectively increasing the container size by the number of elements inserted.

- * - *

This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

- * - *

Because {@link Vector}s use an Array as their underlying storage, inserting elements in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to their new positions. This is generally an inefficient operation compared to the - * one performed for the same operation by other kinds of sequence containers (such as {@link List}). - * - * @param position Position in the {@link Vector} where the new elements are inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param n Number of elements to insert. Each element is initialized to a copy of val. - * @param val Value to be copied (or moved) to the inserted elements. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert(position: VectorIterator, n: number, val: T): VectorIterator; - /** - *

Insert elements by range iterators.

- * - *

The {@link Vector} is extended by inserting new elements before the element at the specified - * position, effectively increasing the container size by the number of elements inserted by range - * iterators.

- * - *

This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

- * - *

Because {@link Vector}s use an Array as their underlying storage, inserting elements in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to their new positions. This is generally an inefficient operation compared to the - * one performed for the same operation by other kinds of sequence containers (such as {@link List}). - * - * @param position Position in the {@link Vector} where the new elements are inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert>(position: VectorIterator, begin: InputIterator, end: InputIterator): VectorIterator; - /** - *

Insert an element.

- * - *

The {@link Vector} is extended by inserting new element before the element at the specified - * position, effectively increasing the container size by one.

- * - *

This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

- * - *

Because {@link Vector}s use an Array as their underlying storage, inserting element in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to its new position. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

- * - * @param position Position in the {@link Vector} where the new element is inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param val Value to be copied to the inserted element. - * - * @return An iterator that points to the newly inserted element. - */ - insert(position: VectorReverseIterator, val: T): VectorReverseIterator; - /** - *

Insert elements by repeated filling.

- * - *

The {@link Vector} is extended by inserting new elements before the element at the specified - * position, effectively increasing the container size by the number of elements inserted.

- * - *

This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

- * - *

Because {@link Vector}s use an Array as their underlying storage, inserting elements in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to their new positions. This is generally an inefficient operation compared to the - * one performed for the same operation by other kinds of sequence containers (such as {@link List}). - * - * @param position Position in the {@link Vector} where the new elements are inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param n Number of elements to insert. Each element is initialized to a copy of val. - * @param val Value to be copied (or moved) to the inserted elements. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert(position: VectorReverseIterator, n: number, val: T): VectorReverseIterator; - /** - *

Insert elements by range iterators.

- * - *

The {@link Vector} is extended by inserting new elements before the element at the specified - * position, effectively increasing the container size by the number of elements inserted by range - * iterators.

- * - *

This causes an automatic reallocation of the allocated storage space if -and only if- the new - * {@link size} surpasses the current {@link capacity}.

- * - *

Because {@link Vector}s use an Array as their underlying storage, inserting elements in - * positions other than the {@link end end()} causes the container to relocate all the elements that were - * after position to their new positions. This is generally an inefficient operation compared to the - * one performed for the same operation by other kinds of sequence containers (such as {@link List}). - * - * @param position Position in the {@link Vector} where the new elements are inserted. - * {@link iterator} is a member type, defined as a - * {@link VectorIterator random access iterator} type that points to elements. - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * - * @return An iterator that points to the first of the newly inserted elements. - */ - insert>(position: VectorReverseIterator, begin: InputIterator, end: InputIterator): VectorReverseIterator; - /** - * @hidden - */ - private insert_by_val(position, val); - /** - * @hidden - */ - protected _Insert_by_repeating_val(position: VectorIterator, n: number, val: T): VectorIterator; - /** - * @hidden - */ - protected _Insert_by_range>(position: VectorIterator, first: InputIterator, last: InputIterator): VectorIterator; - /** - * @inheritdoc - */ - pop_back(): void; - /** - *

Erase element.

- * - *

Removes from the {@link Vector} either a single element; position.

- * - *

This effectively reduces the container size by the number of element removed.

- * - *

Because {@link Vector}s use an Array as their underlying storage, erasing an element in - * position other than the {@link end end()} causes the container to relocate all the elements after the - * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

- * - * @param position Iterator pointing to a single element to be removed from the {@link Vector}. - * - * @return An iterator pointing to the new location of the element that followed the last element erased by - * the function call. This is the {@link end end()} if the operation erased the last element in the - * sequence. - */ - erase(position: VectorIterator): VectorIterator; - /** - *

Erase element.

- * - *

Removes from the Vector either a single element; position.

- * - *

This effectively reduces the container size by the number of elements removed.

- * - *

Because {@link Vector}s use an Array as their underlying storage, erasing elements in - * position other than the {@link end end()} causes the container to relocate all the elements after the - * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

- * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - * - * @return An iterator pointing to the new location of the element that followed the last element erased by - * the function call. This is the {@link rend rend()} if the operation erased the last element in the - * sequence. - */ - erase(first: VectorIterator, last: VectorIterator): VectorIterator; - /** - *

Erase element.

- * - *

Removes from the {@link Vector} either a single element; position.

- * - *

This effectively reduces the container size by the number of element removed.

- * - *

Because {@link Vector}s use an Array as their underlying storage, erasing an element in - * position other than the {@link end end()} causes the container to relocate all the elements after the - * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

- * - * @param position Iterator pointing to a single element to be removed from the {@link Vector}. - * - * @return An iterator pointing to the new location of the element that followed the last element erased by - * the function call. This is the {@link rend rend()} if the operation erased the last element in the - * sequence. - */ - erase(position: VectorReverseIterator): VectorReverseIterator; - /** - *

Erase element.

- * - *

Removes from the Vector either a single element; position.

- * - *

This effectively reduces the container size by the number of elements removed.

- * - *

Because {@link Vector}s use an Array as their underlying storage, erasing elements in - * position other than the {@link end end()} causes the container to relocate all the elements after the - * segment erased to their new positions. This is generally an inefficient operation compared to the one - * performed for the same operation by other kinds of sequence containers (such as {@link List}).

- * - * @param begin An iterator specifying a range of beginning to erase. - * @param end An iterator specifying a range of end to erase. - * - * @return An iterator pointing to the new location of the element that followed the last element erased by - * the function call. This is the {@link end end()} if the operation erased the last element in the - * sequence. - */ - erase(first: VectorReverseIterator, last: VectorReverseIterator): VectorReverseIterator; - /** - * @hidden - */ - protected _Erase_by_range(first: VectorIterator, last: VectorIterator): VectorIterator; - /** - *

Swap content.

- * - *

Exchanges the content of the container by the content of obj, which is another - * {@link Vector container} object with same type of elements. Sizes and container type may differ.

- * - *

After the call to this member function, the elements in this container are those which were in obj - * before the call, and the elements of obj are those which were in this. All iterators, references and - * pointers remain valid for the swapped objects.

- * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

- * - * @param obj Another {@link Vector container} of the same type of elements (i.e., instantiated - * with the same template parameter, T) whose content is swapped with that of this - * {@link container Vector}. - */ - swap(obj: Vector): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std { - /** - *

An iterator of Vector.

- * - *

- * - *

- * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class VectorIterator extends Iterator implements base.IArrayIterator { - /** - * Sequence number of iterator in the source {@link Vector}. - */ - private index_; - /** - *

Construct from the source {@link Vector container}.

- * - *

Note

- *

Do not create the iterator directly, by yourself.

- *

Use {@link Vector.begin begin()}, {@link Vector.end end()} in {@link Vector container} instead.

- * - * @param source The source {@link Vector container} to reference. - * @param index Sequence number of the element in the source {@link Vector}. - */ - constructor(source: Vector, index: number); - /** - * @hidden - */ - private readonly vector; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * Get index. - */ - readonly index: number; - /** - * @inheritdoc - */ - prev(): VectorIterator; - /** - * @inheritdoc - */ - next(): VectorIterator; - /** - * @inheritdoc - */ - advance(n: number): VectorIterator; - /** - * @inheritdoc - */ - equals(obj: VectorIterator): boolean; - /** - * @inheritdoc - */ - swap(obj: VectorIterator): void; - toString(): number; - } -} -declare namespace std { - /** - *

A reverse-iterator of Vector.

- * - *

- * - *

- * - * @param Type of the elements. - * - * @author Jeongho Nam - */ - class VectorReverseIterator extends ReverseIterator, VectorReverseIterator> implements base.IArrayIterator { - /** - * Construct from base iterator. - * - * @param base A reference of the base iterator, which iterates in the opposite direction. - */ - constructor(base: VectorIterator); - /** - * @hidden - */ - protected _Create_neighbor(base: VectorIterator): VectorReverseIterator; - /** - * @inheritdoc - */ - /** - * Set value of the iterator is pointing to. - * - * @param val Value to set. - */ - value: T; - /** - * Get index. - */ - readonly index: number; - } -} -declare namespace std { - /** - *

FIFO queue.

- * - *

{@link Queue}s are a type of container adaptor, specifically designed to operate in a FIFO context - * (first-in first-out), where elements are inserted into one end of the container and extracted from the other. - *

- * - *

{@link Queue}s are implemented as containers adaptors, which are classes that use an encapsulated object of - * a specific container class as its underlying container, providing a specific set of member functions to access - * its elements. Elements are pushed into the {@link IDeque.back back()} of the specific container and popped from - * its {@link IDeque.front front()}.

- * - *

{@link container_ The underlying container} may be one of the standard container class template or some - * other specifically designed container class. This underlying container shall support at least the following - * operations:

- * - *
    - *
  • empty
  • - *
  • size
  • - *
  • front
  • - *
  • back
  • - *
  • push_back
  • - *
  • pop_front
  • - *
- * - *

The standard container classes {@link Deque} and {@link List} fulfill these requirements. - * By default, if no container class is specified for a particular {@link Queue} class instantiation, the standard - * container {@link List} is used.

- * - *

- * - *

- * - * @param Type of elements. - * - * @reference http://www.cplusplus.com/reference/queue/queue - * @author Jeongho Nam - */ - class Queue { - /** - * The underlying object for implementing the FIFO - */ - private container_; - /** - * Default Constructor. - */ - constructor(); - /** - * Copy Constructor. - */ - constructor(container: Queue); - /** - *

Return size.

- *

Returns the number of elements in the {@link Queue}.

- * - *

This member function effectively calls member {@link IDeque.size size()} of the - * {@link container_ underlying container} object.

- * - * @return The number of elements in the {@link container_ underlying container}. - */ - size(): number; - /** - *

Test whether container is empty.

- *

returns whether the {@link Queue} is empty: i.e. whether its size is zero.

- * - *

This member function efeectively calls member {@link IDeque.empty empty()} of the - * {@link container_ underlying container} object.

- * - * @return true if the {@link container_ underlying container}'s size is 0, - * false otherwise.

- */ - empty(): boolean; - /** - *

Access next element.

- *

Returns a value of the next element in the {@link Queue}.

- * - *

The next element is the "oldest" element in the {@link Queue} and the same element that is popped out - * from the queue when {@link pop Queue.pop()} is called.

- * - *

This member function effectively calls member {@link IDeque.front front()} of the - * {@link container_ underlying container} object.

- * - * @return A value of the next element in the {@link Queue}. - */ - front(): T; - /** - *

Access last element.

- * - *

Returns a vaue of the last element in the queue. This is the "newest" element in the queue (i.e. the - * last element pushed into the queue).

- * - *

This member function effectively calls the member function {@link IDeque.back back()} of the - * {@link container_ underlying container} object.

- * - * @return A value of the last element in the {@link Queue}. - */ - back(): T; - /** - *

Insert element.

- * - *

Inserts a new element at the end of the {@link Queue}, after its current last element. - * The content of this new element is initialized to val.

- * - *

This member function effectively calls the member function {@link IDeque.push_back push_back()} of the - * {@link container_ underlying container} object.

- * - * @param val Value to which the inserted element is initialized. - */ - push(val: T): void; - /** - *

Remove next element.

- * - *

Removes the next element in the {@link Queue}, effectively reducing its size by one.

- * - *

The element removed is the "oldest" element in the {@link Queue} whose value can be retrieved by calling - * member {@link front Queue.front()}

. - * - *

This member function effectively calls the member function {@link IDeque.pop_front pop_front()} of the - * {@link container_ underlying container} object.

- */ - pop(): void; - /** - *

Swap contents.

- * - *

Exchanges the contents of the container adaptor (this) by those of obj.

- * - *

This member function calls the non-member function {@link IContainer.swap swap} (unqualified) to swap - * the {@link container_ underlying containers}.

- * - * @param obj Another {@link Queue} container adaptor of the same type (i.e., instantiated with the same - * template parameter, T). Sizes may differ.

- */ - swap(obj: Queue): void; - } -} -declare namespace std { - /** - *

Priority queue.

- * - *

{@link PriorityQueue Priority queues} are a type of container adaptors, specifically designed such that its - * first element is always the greatest of the elements it contains, according to some strict weak ordering - * criterion.

- * - *

This context is similar to a heap, where elements can be inserted at any moment, and only the - * max heap element can be retrieved (the one at the top in the {@link PriorityQueue priority queue}).

- * - *

{@link PriorityQueue Priority queues} are implemented as container adaptors, which are classes that - * use an encapsulated object of a specific container class as its {@link container_ underlying container}, - * providing a specific set of member functions to access its elements. Elements are popped from the "back" - * of the specific container, which is known as the top of the {@link PriorityQueue Priority queue}.

- * - *

The {@link container_ underlying container} may be any of the standard container class templates or some - * other specifically designed container class. The container shall be accessible through - * {@link IArrayIterator random access iterators} and support the following operations:

- * - *
    - *
  • empty()
  • - *
  • size()
  • - *
  • front()
  • - *
  • push_back()
  • - *
  • pop_back()
  • - *
- * - *

The standard container classes {@link Vector} and {@link Deque} fulfill these requirements. By default, if - * no container class is specified for a particular {@link PriorityQueue} class instantiation, the standard - * container {@link Vector} is used.

- * - *

Support of {@link IArrayIterator random access iterators} is required to keep a heap structure internally - * at all times. This is done automatically by the container adaptor by automatically calling the algorithm - * functions make_heap, push_heap and pop_heap when needed.

- * - * @param Type of the elements. - * - * @reference http://www.cplusplus.com/reference/queue/priority_queue/ - * @author Jeongho Nam - */ - class PriorityQueue { - /** - *

The underlying container for implementing the priority queue.

- * - *

Following standard definition from the C++ committee, the underlying container should be one of - * {@link Vector} or {@link Deque}, however, I've adopted {@link TreeMultiSet} instead of them. Of course, - * there are proper reasons for adapting the {@link TreeMultiSet} even violating standard advice.

- * - *

Underlying container of {@link PriorityQueue} must keep a condition; the highest (or lowest) - * element must be placed on the terminal node for fast retrieval and deletion. To keep the condition with - * {@link Vector} or {@link Deque}, lots of times will only be spent for re-arranging elements. It calls - * rearrangement functions like make_heap, push_heap and pop_head for rearrangement.

- * - *

However, the {@link TreeMultiSet} container always keeps arrangment automatically without additional - * operations and it even meets full criteria of {@link PriorityQueue}. Those are the reason why I've adopted - * {@link TreeMultiSet} as the underlying container of {@link PriorityQueue}.

- */ - private container_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (left: T, right: T) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array); - /** - * Contruct from elements with compare. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array, compare: (left: T, right: T) => boolean); - /** - * Copy Constructor. - */ - constructor(container: base.IContainer); - /** - * Copy Constructor with compare. - * - * @param container A container to be copied. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: base.IContainer, compare: (left: T, right: T) => boolean); - /** - * Range Constructor. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * Range Constructor with compare. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator, end: Iterator, compare: (left: T, right: T) => boolean); - /** - *

Return size.

- * - *

Returns the number of elements in the {@link PriorityQueue}.

- * - *

This member function effectively calls member {@link IArray.size size} of the - * {@link container_ underlying container} object.

- * - * @return The number of elements in the underlying - */ - size(): number; - /** - *

Test whether container is empty.

- * - *

Returns whether the {@link PriorityQueue} is empty: i.e. whether its {@link size} is zero.

- * - *

This member function effectively calls member {@link IARray.empty empty} of the - * {@link container_ underlying container} object.

- */ - empty(): boolean; - /** - *

Access top element.

- * - *

Returns a constant reference to the top element in the {@link PriorityQueue}.

- * - *

The top element is the element that compares higher in the {@link PriorityQueue}, and the next that is - * removed from the container when {@link PriorityQueue.pop} is called.

- * - *

This member function effectively calls member {@link IArray.front front} of the - * {@link container_ underlying container} object.

- * - * @return A reference to the top element in the {@link PriorityQueue}. - */ - top(): T; - /** - *

Insert element.

- * - *

Inserts a new element in the {@link PriorityQueue}. The content of this new element is initialized to - * val. - * - *

This member function effectively calls the member function {@link IArray.push_back push_back} of the - * {@link container_ underlying container} object, and then reorders it to its location in the heap by calling - * the push_heap algorithm on the range that includes all the elements of the

- * - * @param val Value to which the inserted element is initialized. - */ - push(val: T): void; - /** - *

Remove top element.

- * - *

Removes the element on top of the {@link PriorityQueue}, effectively reducing its {@link size} by one. - * The element removed is the one with the highest (or lowest) value.

- * - *

The value of this element can be retrieved before being popped by calling member - * {@link PriorityQueue.top}.

- * - *

This member function effectively calls the pop_heap algorithm to keep the heap property of - * {@link PriorityQueue PriorityQueues} and then calls the member function {@link IArray.pop_back pop_back} of - * the {@link container_ underlying container} object to remove the element.

- */ - pop(): void; - /** - *

Swap contents.

- * - *

Exchanges the contents of the container adaptor by those of obj, swapping both the - * {@link container_ underlying container} value and their comparison function using the corresponding - * {@link std.swap swap} non-member functions (unqualified).

- * - *

This member function has a noexcept specifier that matches the combined noexcept of the - * {@link IArray.swap swap} operations on the {@link container_ underlying container} and the comparison - * functions.

- * - * @param obj {@link PriorityQueue} container adaptor of the same type (i.e., instantiated with the same - * template parameters, T). Sizes may differ. - */ - swap(obj: PriorityQueue): void; - } -} -declare namespace std { - /** - *

LIFO stack.

- * - *

{@link Stack}s are a type of container adaptor, specifically designed to operate in a LIFO context - * (last-in first-out), where elements are inserted and extracted only from one end of the

- * - *

{@link Stack}s are implemented as containers adaptors, which are classes that use an encapsulated object of - * a specific container class as its underlying container, providing a specific set of member functions to - * access its elements. Elements are pushed/popped from the {@link ILinearContainer.back back()} of the - * {@link ILinearContainer specific container}, which is known as the top of the {@link Stack}.

- * - *

{@link container_ The underlying container} may be any of the standard container class templates or some - * other specifically designed container class. The container shall support the following operations:

- * - *
    - *
  • empty
  • - *
  • size
  • - *
  • front
  • - *
  • back
  • - *
  • push_back
  • - *
  • pop_back
  • - *
- * - *

The standard container classes {@link Vector}, {@link Deque} and {@link List} fulfill these requirements. - * By default, if no container class is specified for a particular {@link Stack} class instantiation, the standard - * container {@link List} is used.

- * - *

- * - *

- * - * @param Type of elements. - * - * @reference http://www.cplusplus.com/reference/stack/stack - * @author Jeongho Nam - */ - class Stack { - /** - * The underlying object for implementing the LIFO - */ - private container_; - /** - * Default Constructor. - */ - constructor(); - /** - * Copy Constructor. - */ - constructor(stack: Stack); - /** - *

Return size.

- * - *

Returns the number of elements in the {@link Stack}.

- * - *

This member function effectively calls member {@link ILinearContainer.size size()} of the - * {@link container_ underlying container} object.

- * - * @return The number of elements in the {@link container_ underlying container}. - */ - size(): number; - /** - *

Test whether container is empty.

- * - *

returns whether the {@link Stack} is empty: i.e. whether its size is zero.

- * - *

This member function effectively calls member {@link ILinearContainer.empty empty()} of the - * {@link container_ underlying container} object.

- * - * @return true if the underlying container's size is 0, - * false otherwise.

- */ - empty(): boolean; - /** - *

Access next element.

- * - *

Returns a value of the top element in the {@link Stack}

. - * - *

Since {@link Stack}s are last-in first-out containers, the top element is the last element inserted into - * the {@link Stack}.

- * - *

This member function effectively calls member {@link ILinearContainer.back back()} of the - * {@link container_ underlying container} object.

- * - * @return A value of the top element in the {@link Stack}. - */ - top(): T; - /** - *

Insert element.

- * - *

Inserts a new element at the top of the {@link Stack}, above its current top element.

- * - *

This member function effectively calls the member function - * {@link ILinearContainer.push_back push_back()} of the {@link container_ underlying container} object.

- * - * @param val Value to which the inserted element is initialized. - */ - push(val: T): void; - /** - *

Remove top element.

- * - *

Removes the element on top of the {@link Stack}, effectively reducing its size by one.

- * - *

The element removed is the latest element inserted into the {@link Stack}, whose value can be retrieved - * by calling member {@link top Stack.top()}

. - * - *

This member function effectively calls the member function {@link ILinearContainer.pop_back pop_back()} - * of the {@link container_ underlying container} object.

- */ - pop(): void; - /** - *

Swap contents.

- * - *

Exchanges the contents of the container adaptor (this) by those of obj.

- * - *

This member function calls the non-member function {@link IContainer.swap swap} (unqualified) to swap - * the {@link container_ underlying containers}.

- * - * @param obj Another {@link Stack} container adaptor of the same type (i.e., instantiated with the same - * template parameter, T). Sizes may differ.

- */ - swap(obj: Stack): void; - } -} -declare namespace std.TreeSet { - type iterator = std.SetIterator; - type reverse_iterator = std.SetReverseIterator; -} -declare namespace std { - /** - *

Tree-structured set, std::set of STL.

- * - *

{@link TreeSet}s are containers that store unique elements following a specific order.

- * - *

In a {@link TreeSet}, the value of an element also identifies it (the value is itself the - * key, of type T), and each value must be unique. The value of the elements in a - * {@link TreeSet} cannot be modified once in the container (the elements are always const), but they - * can be inserted or removed from the container.

- * - *

Internally, the elements in a {@link TreeSet} are always sorted following a specific strict weak - * ordering criterion indicated by its internal comparison method (of {@link less}).

- * - *

{@link TreeSet} containers are generally slower than {@link HashSet} containers to access - * individual elements by their key, but they allow the direct iteration on subsets based on their - * order.

- * - *

{@link TreeSet}s are typically implemented as binary search trees.

- * - *

- *

- * - *

Container properties

- *
- *
Associative
- *
- * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
- * - *
Ordered
- *
- * The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order. - *
- * - *
Set
- *
The value of an element is also the key used to identify it.
- * - *
Unique keys
- *
No two elements in the container can have equivalent keys.
- *
- * - * @param Type of the elements. - * Each element in an {@link TreeSet} is also uniquely identified by this value. - * - * @reference http://www.cplusplus.com/reference/set/set - * @author Jeongho Nam - */ - class TreeSet extends base.UniqueSet implements base.ITreeSet { - /** - * @hidden - */ - private tree_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (x: T, y: T) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array); - /** - * Contruct from elements with compare. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array, compare: (x: T, y: T) => boolean); - /** - * Copy Constructor. - */ - constructor(container: TreeMultiSet); - /** - * Copy Constructor with compare. - * - * @param container A container to be copied. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: TreeMultiSet, compare: (x: T, y: T) => boolean); - /** - * Range Constructor. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * Construct from range and compare. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator, end: Iterator, compare: (x: T, y: T) => boolean); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(val: T): SetIterator; - /** - * @inheritdoc - */ - key_comp(): (x: T, y: T) => boolean; - /** - * @inheritdoc - */ - value_comp(): (x: T, y: T) => boolean; - /** - * @inheritdoc - */ - lower_bound(val: T): SetIterator; - /** - * @inheritdoc - */ - upper_bound(val: T): SetIterator; - /** - * @inheritdoc - */ - equal_range(val: T): Pair, SetIterator>; - /** - * @hidden - */ - protected _Insert_by_val(val: T): any; - protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: SetIterator, last: SetIterator): void; - /** - *

Swap content.

- * - *

Exchanges the content of the container by the content of obj, which is another - * {@link TreeSet set} of the same type. Sizes abd container type may differ.

- * - *

After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

- * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

- * - * @param obj Another {@link TreeSet set container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link TreeSet container}. - */ - swap(obj: TreeSet): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std.TreeMap { - type iterator = std.MapIterator; - type reverse_iterator = std.MapReverseIterator; -} -declare namespace std { - /** - *

Tree-structured map, std::map of STL.

- * - *

{@link TreeMap TreeMaps} are associative containers that store elements formed by a combination of a - * key value (Key) and a mapped value (T), following order.

- * - *

In a {@link TreeMap}, the key values are generally used to sort and uniquely identify the elements, - * while the mapped values store the content associated to this key. The types of key and - * mapped value may differ, and are grouped together in member type value_type, which is a {@link Pair} - * type combining both:

- * - *

typedef Pair value_type;

- * - *

Internally, the elements in a {@link TreeMap} are always sorted by its key following a - * strict weak ordering criterion indicated by its internal comparison method {@link less}. - * - *

{@link TreeMap} containers are generally slower than {@link HashMap HashMap} containers to access individual - * elements by their key, but they allow the direct iteration on subsets based on their order.

- * - *

{@link TreeMap}s are typically implemented as binary search trees.

- * - *

- *

- * - *

Container properties

- *
- *
Associative
- *
Elements in associative containers are referenced by their key and not by their absolute - * position in the container.
- * - *
Ordered
- *
The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order.
- * - *
Map
- *
Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value.
- * - *
Unique keys
- *
No two elements in the container can have equivalent keys.
- *
- * - * @param Type of the keys. Each element in a map is uniquely identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/map/map - * @author Jeongho Nam - */ - class TreeMap extends base.UniqueMap implements base.ITreeMap { - /** - * @hidden - */ - private tree_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (x: Key, y: Key) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array>); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array>, compare: (x: Key, y: Key) => boolean); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - */ - constructor(array: Array<[Key, T]>); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array<[Key, T]>, compare: (x: Key, y: Key) => boolean); - /** - * Copy Constructor. - * - * @param container Another map to copy. - */ - constructor(container: TreeMap); - /** - * Copy Constructor. - * - * @param container Another map to copy. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: TreeMap, compare: (x: Key, y: Key) => boolean); - /** - * Range Constructor. - * - * @param begin nput interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator>, end: Iterator>); - /** - * Range Constructor. - * - * @param begin nput interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator>, end: Iterator>, compare: (x: Key, y: Key) => boolean); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: Key): MapIterator; - /** - * @inheritdoc - */ - key_comp(): (x: Key, y: Key) => boolean; - /** - * @inheritdoc - */ - value_comp(): (x: Pair, y: Pair) => boolean; - /** - * @inheritdoc - */ - lower_bound(key: Key): MapIterator; - /** - * @inheritdoc - */ - upper_bound(key: Key): MapIterator; - /** - * @inheritdoc - */ - equal_range(key: Key): Pair, MapIterator>; - /** - * @hidden - */ - protected _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: MapIterator, last: MapIterator): void; - /** - *

Swap content.

- * - *

Exchanges the content of the container by the content of obj, which is another - * {@link TreeMap map} of the same type. Sizes abd container type may differ.

- * - *

After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

- * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

- * - * @param obj Another {@link TreeMap map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link TreeMap container}. - */ - swap(obj: TreeMap): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer>): void; - } -} -declare namespace std.TreeMultiSet { - type iterator = std.SetIterator; - type reverse_iterator = std.SetReverseIterator; -} -declare namespace std { - /** - *

Tree-structured multiple-key set.

- * - *

{@link TreeMultiSet TreeMultiSets} are containers that store elements following a specific order, and - * where multiple elements can have equivalent values.

- * - *

In a {@link TreeMultiSet}, the value of an element also identifies it (the value is itself - * the key, of type T). The value of the elements in a {@link TreeMultiSet} cannot - * be modified once in the container (the elements are always const), but they can be inserted or removed - * from the container.

- * - *

Internally, the elements in a {@link TreeMultiSet TreeMultiSets} are always sorted following a strict - * weak ordering criterion indicated by its internal comparison method (of {@link IComparable.less less}).

- * - *

{@link TreeMultiSet} containers are generally slower than {@link HashMultiSet} containers - * to access individual elements by their key, but they allow the direct iteration on subsets based on - * their order.

- * - *

{@link TreeMultiSet TreeMultiSets} are typically implemented as binary search trees.

- * - *

- *

- * - *

Container properties

- *
- *
Associative
- *
- * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
- * - *
Ordered
- *
- * The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order. - *
- * - *
Set
- *
The value of an element is also the key used to identify it.
- * - *
Multiple equivalent keys
- *
Multiple elements in the container can have equivalent keys.
- *
- * - * @param Type of the elements. Each element in a {@link TreeMultiSet} container is also identified - * by this value (each value is itself also the element's key). - * - * @reference http://www.cplusplus.com/reference/set/multiset - * @author Jeongho Nam - */ - class TreeMultiSet extends base.MultiSet implements base.ITreeSet { - /** - * @hidden - */ - private tree_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (x: T, y: T) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array); - /** - * Contruct from elements with compare. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array, compare: (x: T, y: T) => boolean); - /** - * Copy Constructor. - */ - constructor(container: TreeMultiSet); - /** - * Copy Constructor with compare. - * - * @param container A container to be copied. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: TreeMultiSet, compare: (x: T, y: T) => boolean); - /** - * Range Constructor. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator, end: Iterator); - /** - * Construct from range and compare. - * - * @param begin Input interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator, end: Iterator, compare: (x: T, y: T) => boolean); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(val: T): SetIterator; - /** - * @inheritdoc - */ - count(val: T): number; - /** - * @inheritdoc - */ - key_comp(): (x: T, y: T) => boolean; - /** - * @inheritdoc - */ - value_comp(): (x: T, y: T) => boolean; - /** - * @inheritdoc - */ - lower_bound(val: T): SetIterator; - /** - * @inheritdoc - */ - upper_bound(val: T): SetIterator; - /** - * @inheritdoc - */ - equal_range(val: T): Pair, SetIterator>; - /** - * @hidden - */ - protected _Insert_by_val(val: T): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: SetIterator, val: T): SetIterator; - /** - * @hidden - */ - protected _Insert_by_range>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: SetIterator, last: SetIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: SetIterator, last: SetIterator): void; - /** - *

Swap content.

- * - *

Exchanges the content of the container by the content of obj, which is another - * {@link TreeMultiSet set} of the same type. Sizes abd container type may differ.

- * - *

After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

- * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

- * - * @param obj Another {@link TreeMultiSet set container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link TreeMultiSet container}. - */ - swap(obj: TreeMultiSet): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer): void; - } -} -declare namespace std.TreeMultiMap { - type iterator = std.MapIterator; - type reverse_iterator = std.MapReverseIterator; -} -declare namespace std { - /** - *

Tree-structured multiple-key map.

- * - *

{@link TreeMultiMap TreeMultiMaps} are associative containers that store elements formed by a combination of - * a key value and a mapped value, following a specific order, and where multiple elements can - * have equivalent keys.

- * - *

In a {@link TreeMultiMap}, the key values are generally used to sort and uniquely identify - * the elements, while the mapped values store the content associated to this key. The types of - * key and mapped value may differ, and are grouped together in member type - * value_type, which is a {@link Pair} type combining both:

- * - *

typedef Pair value_type;

- * - *

Internally, the elements in a {@link TreeMultiMap}are always sorted by its key following a - * strict weak ordering criterion indicated by its internal comparison method (of {@link less}).

- * - *

{@link TreeMultiMap}containers are generally slower than {@link HashMap} containers - * to access individual elements by their key, but they allow the direct iteration on subsets based - * on their order.

- * - *

{@link TreeMultiMap TreeMultiMaps} are typically implemented as binary search trees.

- * - *

< - * img src="http://samchon.github.io/typescript-stl/images/design/class_diagram/map_containers.png" style="max-width: 100%" />

- * - *

Container properties

- *
- *
Associative
- *
- * Elements in associative containers are referenced by their key and not by their absolute - * position in the container. - *
- * - *
Ordered
- *
- * The elements in the container follow a strict order at all times. All inserted elements are - * given a position in this order. - *
- * - *
Map
- *
- * Each element associates a key to a mapped value: - * Keys are meant to identify the elements whose main content is the mapped value. - *
- * - *
Multiple equivalent keys
- *
Multiple elements in the container can have equivalent keys.
- *
- * - * @param Type of the keys. Each element in a map is uniquely identified by its key value. - * @param Type of the mapped value. Each element in a map stores some data as its mapped value. - * - * @reference http://www.cplusplus.com/reference/map/multimap - * @author Jeongho Nam - */ - class TreeMultiMap extends base.MultiMap implements base.ITreeMap { - /** - * @hidden - */ - private tree_; - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from compare. - * - * @param compare A binary predicate determines order of elements. - */ - constructor(compare: (x: Key, y: Key) => boolean); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - */ - constructor(array: Array>); - /** - * Contruct from elements. - * - * @param array Elements to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array>, compare: (x: Key, y: Key) => boolean); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - */ - constructor(array: Array<[Key, T]>); - /** - * Contruct from tuples. - * - * @param array Tuples to be contained. - * @param compare A binary predicate determines order of elements. - */ - constructor(array: Array<[Key, T]>, compare: (x: Key, y: Key) => boolean); - /** - * Copy Constructor. - * - * @param container Another map to copy. - */ - constructor(container: TreeMultiMap); - /** - * Copy Constructor. - * - * @param container Another map to copy. - * @param compare A binary predicate determines order of elements. - */ - constructor(container: TreeMultiMap, compare: (x: Key, y: Key) => boolean); - /** - * Range Constructor. - * - * @param begin nput interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - */ - constructor(begin: Iterator>, end: Iterator>); - /** - * Range Constructor. - * - * @param begin nput interator of the initial position in a sequence. - * @param end Input interator of the final position in a sequence. - * @param compare A binary predicate determines order of elements. - */ - constructor(begin: Iterator>, end: Iterator>, compare: (x: Key, y: Key) => boolean); - /** - * @inheritdoc - */ - clear(): void; - /** - * @inheritdoc - */ - find(key: Key): MapIterator; - /** - * @inheritdoc - */ - count(key: Key): number; - /** - * @inheritdoc - */ - key_comp(): (x: Key, y: Key) => boolean; - /** - * @inheritdoc - */ - value_comp(): (x: Pair, y: Pair) => boolean; - /** - * @inheritdoc - */ - lower_bound(key: Key): MapIterator; - /** - * @inheritdoc - */ - upper_bound(key: Key): MapIterator; - /** - * @inheritdoc - */ - equal_range(key: Key): Pair, MapIterator>; - /** - * @hidden - */ - protected _Insert_by_pair(pair: Pair): any; - /** - * @hidden - */ - protected _Insert_by_hint(hint: MapIterator, pair: Pair): MapIterator; - /** - * @hidden - */ - protected _Insert_by_range>>(first: InputIterator, last: InputIterator): void; - /** - * @inheritdoc - */ - protected _Handle_insert(first: MapIterator, last: MapIterator): void; - /** - * @inheritdoc - */ - protected _Handle_erase(first: MapIterator, last: MapIterator): void; - /** - *

Swap content.

- * - *

Exchanges the content of the container by the content of obj, which is another - * {@link TreeMapMulti map} of the same type. Sizes abd container type may differ.

- * - *

After the call to this member function, the elements in this container are those which were - * in obj before the call, and the elements of obj are those which were in this. All - * iterators, references and pointers remain valid for the swapped objects.

- * - *

Notice that a non-member function exists with the same name, {@link std.swap swap}, overloading that - * algorithm with an optimization that behaves like this member function.

- * - * @param obj Another {@link TreeMapMulti map container} of the same type of elements as this (i.e., - * with the same template parameters, Key and T) whose content is swapped - * with that of this {@link TreeMapMulti container}. - */ - swap(obj: TreeMultiMap): void; - /** - * @inheritdoc - */ - swap(obj: base.IContainer>): void; - } -} -declare namespace std { - /** - *

System error exception.

- * - *

This class defines the type of objects thrown as exceptions to report conditions originating during - * runtime from the operating system or other low-level application program interfaces which have an - * associated {@link ErrorCode}.

- * - *

The class inherits from {@link RuntimeError}, to which it adds an {@link ErrorCode} as - * member code (and defines a specialized what member).

- * - *

- *

- * - * @reference http://www.cplusplus.com/reference/system_error/system_error - * @author Jeongho Nam - */ - class SystemError extends RuntimeError { - /** - * @hidden - */ - protected code_: ErrorCode; - /** - * Construct from an error code. - * - * @param code An {@link ErrorCode} object. - */ - constructor(code: ErrorCode); - /** - * Construct from an error code and message. - * - * @param code An {@link ErrorCode} object. - * @param message A message incorporated in the string returned by member {@link what what()}. - */ - constructor(code: ErrorCode, message: string); - /** - * Construct from a numeric value and error category. - * - * @param val A numerical value identifying an error code. - * @param category A reference to an {@link ErrorCode} object. - */ - constructor(val: number, category: ErrorCategory); - /** - * Construct from a numeric value, error category and message. - * - * @param val A numerical value identifying an error code. - * @param category A reference to an {@link ErrorCode} object. - * @param message A message incorporated in the string returned by member {@link what what()}. - */ - constructor(val: number, category: ErrorCategory, message: string); - /** - *

Get error code.

- * - *

Returns the {@link ErrorCode} object associated with the exception.

- * - *

This value is either the {@link ErrorCode} passed to the construction or its equivalent - * (if constructed with a value and a {@link category}.

- * - * @return The {@link ErrorCode} associated with the object. - */ - code(): ErrorCode; - } -} -declare namespace std { - /** - *

Error category.

- * - *

This type serves as a base class for specific category types.

- * - *

Category types are used to identify the source of an error. They also define the relation between - * {@link ErrorCode} and {@link ErrorCondition}objects of its category, as well as the message set for {@link ErrorCode} - * objects. - * - *

Objects of these types have no distinct values and are not-copyable and not-assignable, and thus can only be - * passed by reference. As such, only one object of each of these types shall exist, each uniquely identifying its own - * category: all error codes and conditions of a same category shall return a reference to same object.

- * - *

- *

- * - * @reference http://www.cplusplus.com/reference/system_error/error_category - * @author Jeongho Nam - */ - abstract class ErrorCategory { - /** - * Default Constructor. - */ - constructor(); - /** - *

Return category name.

- * - *

In derived classes, the function returns a string naming the category.

- * - *

In {@link ErrorCategory}, it is a pure virtual member function.

- * - *
    - *
  • In the {@link GenericCategory} object, it returns "generic".
  • - *
  • In the {@link SystemCategory} object, it returns "system".
  • - *
  • In the {@link IOStreamCategory} object, it returns "iostream".
  • - *
- * - * @return The category name. - */ - abstract name(): string; - /** - *

Error message.

- * - *

In derived classes, the function returns a string object with a message describing the error condition - * denoted by val.

- * - *

In {@link ErrorCategory}, it is a pure virtual member function.

- * - *

This function is called both by {@link ErrorCode.message ErrorCode.message()} and - * {@link ErrorCondition.message ErrorCondition.message()} to obtain the corresponding message in the - * {@link category}. Therefore, numerical values used by custom error codes and - * {@link ErrorCondition error conditions} should only match for a category if they describe the same error.

- * - * @param val A numerical value identifying an error condition. - * If the {@link ErrorCategory} object is the {@link GenericCategory}, this argument is equivalent to an - * {@link errno} value. - * - * @return A string object with the message. - */ - abstract message(val: number): string; - /** - *

Default error condition.

- * - *

Returns the default {@link ErrorCondition}object of this category that is associated with the - * {@link ErrorCode} identified by a value of val.

- * - *

Its definition in the base class {@link ErrorCategory} returns the same as constructing an - * {@link ErrorCondition} object with: - * - *

new ErrorCondition(val, *this);

- * - *

As a virtual member function, this behavior can be overriden in derived classes.

- * - *

This function is called by the default definition of member {@link equivalent equivalent()}, which is used to - * compare {@link ErrorCondition error conditions} with error codes.

- * - * @param val A numerical value identifying an error condition. - * - * @return The default {@link ErrorCondition}object associated with condition value val for this category. - */ - default_error_condition(val: number): ErrorCondition; - /** - *

Check error code equivalence.

- * - *

Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an - * {@link ErrorCondition error condition.

- * - *

This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is - * compared to an {@link ErrorCode} object to check for equality or inequality. If either one of those objects' - * {@link ErrorCategory categories} considers the other equivalent using this function, they are considered - * equivalent by the operator.

- * - *

As a virtual member function, this behavior can be overridden in derived classes to define a different - * correspondence mechanism for each {@link ErrorCategory} type.

- * - * @param val_code A numerical value identifying an error code. - * @param cond An object of an {@link ErrorCondition} type. - * - * @return true if the arguments are considered equivalent. false otherwise. - */ - equivalent(val_code: number, cond: ErrorCondition): boolean; - /** - *

Check error code equivalence.

- * - *

Checks whether, for the category, an {@link ErrorCode error code} is equivalent to an - * {@link ErrorCondition error condition.

- * - *

This function is called by the overloads of comparison operators when an {@link ErrorCondition} object is - * compared to an {@link ErrorCode} object to check for equality or inequality. If either one of those objects' - * {@link ErrorCategory categories} considers the other equivalent using this function, they are considered - * equivalent by the operator.

- * - *

As a virtual member function, this behavior can be overridden in derived classes to define a different - * correspondence mechanism for each {@link ErrorCategory} type.

- * - * @param code An object of an {@link ErrorCode} type. - * @param val_cond A numerical value identifying an error code. - * - * @return true if the arguments are considered equivalent. false otherwise. - */ - equivalent(code: ErrorCode, val_cond: number): boolean; - } -} -declare namespace std { - /** - *

Error condition.

- * - *

Objects of this type hold a condition {@link value} associated with a {@link category}.

- * - *

Objects of this type describe errors in a generic way so that they may be portable across different - * systems. This is in contrast with {@link ErrorCode} objects, that may contain system-specific - * information.

- * - *

Because {@link ErrorCondition}objects can be compared with error_code objects directly by using - * relational operators, {@link ErrorCondition}objects are generally used to check whether - * a particular {@link ErrorCode} obtained from the system matches a specific error condition no matter - * the system.

- * - *

The {@link ErrorCategory categories} associated with the {@link ErrorCondition} and the - * {@link ErrorCode} define the equivalences between them.

- * - *

- *

- * - * @reference http://www.cplusplus.com/reference/system_error/error_condition - * @author Jeongho Nam - */ - class ErrorCondition extends base.ErrorInstance { - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from a numeric value and error category. - * - * @param val A numerical value identifying an error condition. - * @param category A reference to an {@link ErrorCategory} object. - */ - constructor(val: number, category: ErrorCategory); - } -} -declare namespace std { - /** - *

Error code.

- * - *

Objects of this type hold an error code {@link value} associated with a {@link category}.

- * - *

The operating system and other low-level applications and libraries generate numerical error codes to - * represent possible results. These numerical values may carry essential information for a specific platform, - * but be non-portable from one platform to another.

- * - *

Objects of this class associate such numerical codes to {@link ErrorCategory error categories}, so that they - * can be interpreted when needed as more abstract (and portable) {@link ErrorCondition error conditions}.

- * - *

- *

- * - * @reference http://www.cplusplus.com/reference/system_error/error_code - * @author Jeongho Nam - */ - class ErrorCode extends base.ErrorInstance { - /** - * Default Constructor. - */ - constructor(); - /** - * Construct from a numeric value and error category. - * - * @param val A numerical value identifying an error code. - * @param category A reference to an {@link ErrorCategory} object. - */ - constructor(val: number, category: ErrorCategory); - } -} -declare namespace std { - /** - *

Running on Node.

- * - *

Test whether the JavaScript is running on Node.

- * - * @references http://stackoverflow.com/questions/17575790/environment-detection-node-js-or-browser - */ - function is_node(): boolean; - /** - *

Pair of values.

- * - *

This class couples together a pair of values, which may be of different types (T1 and - * T2). The individual values can be accessed through its public members {@link first} and - * {@link second}.

- * - * @param Type of member {@link first}. - * @param Type of member {@link second}. - * - * @reference http://www.cplusplus.com/reference/utility/pair - * @author Jeongho Nam - */ - class Pair implements IComparable> { - /** - *

A first value in the Pair.

- */ - first: T1; - /** - *

A second value in the Pair.

- */ - second: T2; - /** - *

Construct from pair values.

- * - * @param first The first value of the Pair - * @param second The second value of the Pair - */ - constructor(first: T1, second: T2); - /** - *

Whether a Pair is equal with the Pair.

- *

Compare each first and second value of two Pair(s) and returns whether they are equal or not.

- * - *

If stored key and value in a Pair are not number or string but an object like a class or struct, - * the comparison will be executed by a member method (SomeObject)::equal_to(). If the object does not have - * the member method equal_to(), only address of pointer will be compared.

- * - * @param obj A Map to compare - * @return Indicates whether equal or not. - */ - equals(pair: Pair): boolean; - /** - * @inheritdoc - */ - less(pair: Pair): boolean; - } - /** - *

Construct {@link Pair} object.

- * - *

Constructs a {@link Pair} object with its {@link Pair.first first} element set to x and its - * {@link Pair.second second} element set to y.

- * - *

The template types can be implicitly deduced from the arguments passed to {@link make_pair}.

- * - *

{@link Pair} objects can be constructed from other {@link Pair} objects containing different types, if the - * respective types are implicitly convertible.

- * - * @param x Value for member {@link Pair.first first}. - * @param y Value for member {@link Pair.second second}. - * - * @return A {@link Pair} object whose elements {@link Pair.first first} and {@link Pair.second second} are set to - * x and y respectivelly. - */ - function make_pair(x: T1, y: T2): Pair; -} -declare namespace std { - /** - * Type definition of {@link Vector} and it's the original name used in C++. - */ - export import vector = Vector; - /** - * Type definition of {@link List} and it's the original name used in C++. - */ - export import list = List; - /** - * Type definition of {@link Deque} and it's the original name used in C++. - */ - export import deque = Deque; - /** - * Type definition of {@link Stack} and it's the original name used in C++. - */ - type stack = Stack; - /** - * Type definition of {@link Queue} and it's the original name used in C++. - */ - type queue = Queue; - /** - * Type definition of {@link PriorityQueue} and it's the original name used in C++. - */ - type priority_queue = PriorityQueue; - var stack: typeof Stack; - var queue: typeof Queue; - var priority_queue: typeof PriorityQueue; - /** - * Type definition of {@link TreeSet} and it's the original name used in C++. - */ - export import set = TreeSet; - /** - * Type definition of {@link TreeMultiSet} and it's the original name used in C++. - */ - export import multiset = TreeMultiSet; - /** - * Type definition of {@link HashSet} and it's the original name used in C++. - */ - export import unordered_set = HashSet; - /** - * Type definition of {@link HashMultiSet} and it's the original name used in C++. - */ - export import unordered_multiset = HashMultiSet; - /** - * Type definition of {@link TreeMap} and it's the original name used in C++. - */ - export import map = TreeMap; - /** - * Type definition of {@link TreeMultiMap} and it's the original name used in C++. - */ - export import multimap = TreeMultiMap; - /** - * Type definition of {@link HashMap} and it's the original name used in C++. - */ - export import unordered_map = HashMap; - /** - * Type definition of {@link HashMultiMap} and it's the original name used in C++. - */ - export import unordered_multimap = HashMultiMap; - type exception = Exception; - type logic_error = LogicError; - type domain_error = DomainError; - type invalid_argument = InvalidArgument; - type length_error = LengthError; - type out_of_range = OutOfRange; - type runtime_error = RuntimeError; - type overflow_error = OverflowError; - type underflow_error = UnderflowError; - type range_error = RangeError; - type system_error = SystemError; - type error_category = ErrorCategory; - type error_condition = ErrorCondition; - type error_code = ErrorCode; - var exception: typeof Exception; - var logic_error: typeof LogicError; - var domain_error: typeof DomainError; - var invalid_argument: typeof InvalidArgument; - var length_error: typeof LengthError; - var out_of_range: typeof OutOfRange; - var runtime_error: typeof RuntimeError; - var overflow_error: typeof OverflowError; - var underflow_error: typeof UnderflowError; - var range_error: typeof RangeError; - var system_error: typeof SystemError; - var error_category: typeof ErrorCategory; - var error_condition: typeof ErrorCondition; - var error_code: typeof ErrorCode; -} +} \ No newline at end of file From 4b58376953fa5b51560f2bc94745eadfe4870f3c Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sun, 5 Feb 2017 15:57:35 +0900 Subject: [PATCH 027/797] TSTL, Samchon & Packer BOM problem has solved. --- 3d-bin-packing/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3d-bin-packing/index.d.ts b/3d-bin-packing/index.d.ts index 19c5a16b28..8165ea513e 100644 --- a/3d-bin-packing/index.d.ts +++ b/3d-bin-packing/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for 3d-bin-packing v1.1.2 +// Type definitions for 3d-bin-packing v1.1.2 // Project: https://github.com/betterwaysystems/packer // Definitions by: Jeongho Nam // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped 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 028/797] 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 d09124c0dadba0706409036d1b2948ee5d08496f Mon Sep 17 00:00:00 2001 From: Olmo del Corral Date: Sun, 5 Feb 2017 20:34:10 +0100 Subject: [PATCH 029/797] remove numbro and add it to notNeededPackages.json --- notNeededPackages.json | 6 ++++++ numbro/index.d.ts | 49 ------------------------------------------ numbro/numbro-tests.ts | 43 ------------------------------------ numbro/tsconfig.json | 22 ------------------- 4 files changed, 6 insertions(+), 114 deletions(-) delete mode 100644 numbro/index.d.ts delete mode 100644 numbro/numbro-tests.ts delete mode 100644 numbro/tsconfig.json diff --git a/notNeededPackages.json b/notNeededPackages.json index e671ef4523..ef4e4f7f85 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -5,6 +5,12 @@ "typingsPackageName": "moment", "sourceRepoURL": "https://github.com/moment/moment", "asOfVersion": "2.13.0" + }, + { + "libraryName": "Numbro", + "typingsPackageName": "numbro", + "sourceRepoURL": "https://github.com/foretagsplatsen/numbro/", + "asOfVersion": "1.9.3" }, { "libraryName": "ng-table", diff --git a/numbro/index.d.ts b/numbro/index.d.ts deleted file mode 100644 index 55234aad81..0000000000 --- a/numbro/index.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Type definitions for Numbro.js -// Project: https://github.com/foretagsplatsen/numbro -// Definitions by: Vincent Bortone -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface NumbroLanguage { - delimiters: { - thousands: string; - decimal: string; - }; - abbreviations: { - thousand: string; - million: string; - billion: string; - trillion: string; - }; - ordinal(num: number): string; - currency: { - symbol: string; - }; -} - -interface Numbro { - (value?: any): Numbro; - version: string; - isNumbro: boolean; - culture(key: string, values?: NumbroLanguage): Numbro; - zeroFormat(format: string): string; - clone(): Numbro; - format(inputString?: string): string; - formatCurrency(inputString?: string): string; - unformat(inputString: string): number; - value(): number; - valueOf(): number; - set (value: any): Numbro; - add(value: any): Numbro; - subtract(value: any): Numbro; - multiply(value: any): Numbro; - divide(value: any): Numbro; - difference(value: any): number; -} - -declare var numbro: Numbro; - -declare module "numbro" { - - export = numbro; - -} diff --git a/numbro/numbro-tests.ts b/numbro/numbro-tests.ts deleted file mode 100644 index 5b5b762353..0000000000 --- a/numbro/numbro-tests.ts +++ /dev/null @@ -1,43 +0,0 @@ - - -var valueFormat: string = numbro(1000).format('0,0'); -// '1,000' - -var valueUnformat: number = numbro().unformat('($10,000.00)'); -// '-10000' - -var value3: Numbro = numbro(1000); -var added: Numbro = value3.add(10); -// 1010 - -var value4: Numbro = numbro(1000); -var formatValue4a: string = value4.format('0,0'); -// '1,000' -var formatValue4b: number = value4.value(); -// 1000 - -var value5: Numbro = numbro(); -value5.set(1000); -var value5Num: number = value5.value(); -// 1000 - -var value6: Numbro = numbro(1000); -var value: number = 100; -var difference = value6.difference(value); -// 900 - -var value7: Numbro = numbro(0); -numbro.zeroFormat('N/A'); -var zeroString: string = value7.format('0.0'); -// 'N/A' - -var a: Numbro = numbro(1000); -var b: Numbro = numbro(a); -var c: Numbro = a.clone(); - -var aVal: number = a.set(2000).value(); -// 2000 -var bVal: number = b.value(); -// 1000 -var cVal: number = c.add(10).value(); -// 1010 diff --git a/numbro/tsconfig.json b/numbro/tsconfig.json deleted file mode 100644 index 4a55ffe0ab..0000000000 --- a/numbro/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "numbro-tests.ts" - ] -} \ No newline at end of file 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 030/797] 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 031/797] 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 36ca0f413af09ba8b5d85dfcb8485191bfda9517 Mon Sep 17 00:00:00 2001 From: Olmo del Corral Date: Mon, 6 Feb 2017 07:49:17 +0100 Subject: [PATCH 032/797] make History Query and LocationState any instead of object to avoid castings on every usage. --- history/v2/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/history/v2/index.d.ts b/history/v2/index.d.ts index 6b61fa1b77..c2278d07fa 100644 --- a/history/v2/index.d.ts +++ b/history/v2/index.d.ts @@ -75,10 +75,10 @@ export namespace History { export type LocationDescriptor = LocationDescriptorObject | Path; export type LocationKey = string; export type LocationListener = (location: Location) => void; - export type LocationState = Object; + export type LocationState = any; export type Path = string // Pathname + QueryString; export type Pathname = string; - export type Query = Object; + export type Query = any; export type QueryString = string; export type Search = string; export type TransitionHook = (location: Location, callback: (result: any) => void) => any From ac21e1c86dbdee7582aa38bf8d6aa53879cf276c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Tue, 7 Feb 2017 16:25:12 +0100 Subject: [PATCH 033/797] body-parser v1.16 --- body-parser/body-parser-tests.ts | 9 ++ body-parser/index.d.ts | 152 ++++++------------------------- body-parser/tslint.json | 3 + 3 files changed, 42 insertions(+), 122 deletions(-) create mode 100644 body-parser/body-parser-tests.ts create mode 100644 body-parser/tslint.json diff --git a/body-parser/body-parser-tests.ts b/body-parser/body-parser-tests.ts new file mode 100644 index 0000000000..2022d3af09 --- /dev/null +++ b/body-parser/body-parser-tests.ts @@ -0,0 +1,9 @@ +import * as bodyParser from 'body-parser'; +import * as express from 'express'; + +const app = express(); + +express.use(bodyParser.json()); +express.use(bodyParser.raw()); +express.use(bodyParser.text()); +express.use(bodyParser.urlencoded()); diff --git a/body-parser/index.d.ts b/body-parser/index.d.ts index b8a1b0dc86..f71d58fffe 100644 --- a/body-parser/index.d.ts +++ b/body-parser/index.d.ts @@ -1,137 +1,45 @@ -// Type definitions for body-parser +// Type definitions for body-parser 1.16 // Project: http://expressjs.com -// Definitions by: Santi Albo , VILIC VANE , Jonathan Häberle +// Definitions by: Santi Albo , VILIC VANE , Jonathan Häberle , Tomasz Åaziuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import { Request, RequestHandler, Response } from 'express'; +// for docs go to https://github.com/expressjs/body-parser/tree/1.16.0#body-parser - -import * as express from "express"; - -/** - * bodyParser: use individual json/urlencoded middlewares - * @deprecated - */ - -declare function bodyParser(options?: { - /** - * if deflated bodies will be inflated. (default: true) - */ - inflate?: boolean; - /** - * maximum request body size. (default: '100kb') - */ - limit?: any; - /** - * function to verify body content, the parsing can be aborted by throwing an error. - */ - verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void; - /** - * only parse objects and arrays. (default: true) - */ - strict?: boolean; - /** - * passed to JSON.parse(). - */ - reviver?: (key: string, value: any) => any; - /** - * parse extended syntax with the qs module. (default: true) - */ - extended?: boolean; -}): express.RequestHandler; +// @deprecated +declare function bodyParser(options?: bodyParser.OptionsJson | bodyParser.OptionsText | bodyParser.OptionsUrlencoded): RequestHandler; declare namespace bodyParser { - export function json(options?: { - /** - * if deflated bodies will be inflated. (default: true) - */ + + export interface Options { inflate?: boolean; - /** - * maximum request body size. (default: '100kb') - */ - limit?: any; - /** - * request content-type to parse, passed directly to the type-is library. (default: 'json') - */ - type?: any; - /** - * function to verify body content, the parsing can be aborted by throwing an error. - */ - verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void; - /** - * only parse objects and arrays. (default: true) - */ + limit?: number | string; + type?: string | ((req: Request) => any); + verify?: (req: Request, res: Response, buf: Buffer, encoding: string) => void; + } + + export interface OptionsJson extends Options { + reviever?: (key: string, value: any) => any; strict?: boolean; - /** - * passed to JSON.parse(). - */ - reviver?: (key: string, value: any) => any; - }): express.RequestHandler; + } - export function raw(options?: { - /** - * if deflated bodies will be inflated. (default: true) - */ - inflate?: boolean; - /** - * maximum request body size. (default: '100kb') - */ - limit?: any; - /** - * request content-type to parse, passed directly to the type-is library. (default: 'application/octet-stream') - */ - type?: any; - /** - * function to verify body content, the parsing can be aborted by throwing an error. - */ - verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void; - }): express.RequestHandler; - - export function text(options?: { - /** - * if deflated bodies will be inflated. (default: true) - */ - inflate?: boolean; - /** - * maximum request body size. (default: '100kb') - */ - limit?: any; - /** - * request content-type to parse, passed directly to the type-is library. (default: 'text/plain') - */ - type?: any; - /** - * function to verify body content, the parsing can be aborted by throwing an error. - */ - verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void; - /** - * the default charset to parse as, if not specified in content-type. (default: 'utf-8') - */ + export interface OptionsText extends Options { defaultCharset?: string; - }): express.RequestHandler; + } - export function urlencoded(options: { - /** - * if deflated bodies will be inflated. (default: true) - */ - inflate?: boolean; - /** - * maximum request body size. (default: '100kb') - */ - limit?: any; - /** - * request content-type to parse, passed directly to the type-is library. (default: 'urlencoded') - */ - type?: any; - /** - * function to verify body content, the parsing can be aborted by throwing an error. - */ - verify?: (req: express.Request, res: express.Response, buf: Buffer, encoding: string) => void; - /** - * parse extended syntax with the qs module. - */ - extended: boolean; - }): express.RequestHandler; + export interface OptionsUrlencoded extends Options { + extended?: boolean; + parameterLimit?: number; + } + + export function json(options?: OptionsJson): RequestHandler; + + export function raw(options?: Options): RequestHandler; + + export function text(options?: OptionsText): RequestHandler; + + export function urlencoded(options: OptionsUrlencoded): RequestHandler; } export = bodyParser; diff --git a/body-parser/tslint.json b/body-parser/tslint.json new file mode 100644 index 0000000000..ec365f164b --- /dev/null +++ b/body-parser/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} From b958299670bf6b764f92dccd90de7ac8bba2b8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Tue, 7 Feb 2017 16:39:44 +0100 Subject: [PATCH 034/797] fix files --- body-parser/tsconfig.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/body-parser/tsconfig.json b/body-parser/tsconfig.json index 27e01ecd7b..800ea22e81 100644 --- a/body-parser/tsconfig.json +++ b/body-parser/tsconfig.json @@ -16,6 +16,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "body-parser-tests.ts" ] -} \ No newline at end of file +} From a055ddf1eec3ffc28c400fa9d0c67b3f5c33fdbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Tue, 7 Feb 2017 16:42:22 +0100 Subject: [PATCH 035/797] reference node for Buffer --- body-parser/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/body-parser/index.d.ts b/body-parser/index.d.ts index f71d58fffe..d7862557b5 100644 --- a/body-parser/index.d.ts +++ b/body-parser/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Santi Albo , VILIC VANE , Jonathan Häberle , Tomasz Åaziuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + import { Request, RequestHandler, Response } from 'express'; // for docs go to https://github.com/expressjs/body-parser/tree/1.16.0#body-parser From fb165d383ba74c12247ca2de7d9a0f05bb76f559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Tue, 7 Feb 2017 16:48:18 +0100 Subject: [PATCH 036/797] do not test that --- body-parser/body-parser-tests.ts | 9 --------- body-parser/tsconfig.json | 3 +-- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 body-parser/body-parser-tests.ts diff --git a/body-parser/body-parser-tests.ts b/body-parser/body-parser-tests.ts deleted file mode 100644 index 2022d3af09..0000000000 --- a/body-parser/body-parser-tests.ts +++ /dev/null @@ -1,9 +0,0 @@ -import * as bodyParser from 'body-parser'; -import * as express from 'express'; - -const app = express(); - -express.use(bodyParser.json()); -express.use(bodyParser.raw()); -express.use(bodyParser.text()); -express.use(bodyParser.urlencoded()); diff --git a/body-parser/tsconfig.json b/body-parser/tsconfig.json index 800ea22e81..fe0b5d1b8a 100644 --- a/body-parser/tsconfig.json +++ b/body-parser/tsconfig.json @@ -16,7 +16,6 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts", - "body-parser-tests.ts" + "index.d.ts" ] } From 4a6df91d35dc85cc2b293869113eb6e9e26e72f8 Mon Sep 17 00:00:00 2001 From: Keith Dahlby Date: Tue, 7 Feb 2017 15:03:55 -0600 Subject: [PATCH 037/797] 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 038/797] 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 039/797] 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 d7e823fd074a330c5da15f9f505c9ee8b385cdff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Thu, 9 Feb 2017 20:44:41 +0100 Subject: [PATCH 040/797] comments --- body-parser/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/body-parser/index.d.ts b/body-parser/index.d.ts index d7862557b5..3a1ebaaba8 100644 --- a/body-parser/index.d.ts +++ b/body-parser/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for body-parser 1.16 -// Project: http://expressjs.com -// Definitions by: Santi Albo , VILIC VANE , Jonathan Häberle , Tomasz Åaziuk +// Project: https://github.com/expressjs/body-parser +// Definitions by: Santi Albo , Vilic Vane , Jonathan Häberle , Tomasz Åaziuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 3dffd8105f595914c4be4b73817e4b673a8cf913 Mon Sep 17 00:00:00 2001 From: Marc Berli Date: Fri, 10 Feb 2017 09:43:54 +0100 Subject: [PATCH 041/797] Add .type(func) to assertion --- chai-enzyme/chai-enzyme.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chai-enzyme/chai-enzyme.d.ts b/chai-enzyme/chai-enzyme.d.ts index 72842332ad..5bb256ac11 100644 --- a/chai-enzyme/chai-enzyme.d.ts +++ b/chai-enzyme/chai-enzyme.d.ts @@ -98,6 +98,12 @@ declare namespace Chai { */ text(str?: string): Assertion; + /** + * Assert that the given wrapper has a given type: + * @param func + */ + type(func: EnzymeSelector): Assertion; + /** * Assert that the given wrapper has given value: * @param str From 510674e521ee29b29ca0cad6996ae4c5c78daa60 Mon Sep 17 00:00:00 2001 From: Marc Berli Date: Fri, 10 Feb 2017 09:44:33 +0100 Subject: [PATCH 042/797] check if wrapper has Type --- chai-enzyme/chai-enzyme-tests.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/chai-enzyme/chai-enzyme-tests.tsx b/chai-enzyme/chai-enzyme-tests.tsx index 0e491a7ba7..b37eca5d9c 100644 --- a/chai-enzyme/chai-enzyme-tests.tsx +++ b/chai-enzyme/chai-enzyme-tests.tsx @@ -35,6 +35,7 @@ expect(wrapper).to.have.ref("test"); expect(wrapper).to.be.selected(); expect(wrapper).to.have.tagName("div"); expect(wrapper).to.have.text(""); +expect(wrapper).to.have.Type(Test); expect(wrapper).to.have.value("test"); expect(wrapper).to.have.attr("test", "test"); expect(wrapper).to.have.data("test", "Test"); 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 043/797] 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 044/797] 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 287db19b16bfd473dfc629e6073db3056a136e35 Mon Sep 17 00:00:00 2001 From: Flarna Date: Fri, 10 Feb 2017 12:47:24 +0100 Subject: [PATCH 045/797] node: Add url.URL and url.URLSearchParams introduced in NodeJs 7.5.0 --- node/index.d.ts | 33 ++++++++++++++++++++++ node/node-tests.ts | 70 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) diff --git a/node/index.d.ts b/node/index.d.ts index d23cc981e4..e0d01d65ba 100644 --- a/node/index.d.ts +++ b/node/index.d.ts @@ -1837,6 +1837,39 @@ declare module "url" { export function parse(urlStr: string, parseQueryString?: boolean, slashesDenoteHost?: boolean): Url; export function format(url: Url): string; export function resolve(from: string, to: string): string; + + export class URLSearchParams implements Iterable { + constructor(init?: URLSearchParams | string); + append(name: string, value: string): void; + delete(name: string): void; + entries(): Iterator; + forEach(callback: (value: string, name: string) => void): void; + get(name: string): string | null; + getAll(name: string): string[]; + has(name: string): boolean; + keys(): Iterator; + set(name: string, value: string): void; + toString(): string; + values(): Iterator; + [Symbol.iterator](): Iterator; + } + + export class URL { + constructor(input: string, base?: string | URL); + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + readonly searchParams: URLSearchParams; + username: string; + toString(): string; + } } declare module "dns" { diff --git a/node/node-tests.ts b/node/node-tests.ts index 9585b3893a..fcd8f93a27 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -420,6 +420,76 @@ namespace url_tests { var helloUrl = url.parse('http://example.com/?hello=world', true) assert.equal(helloUrl.query.hello, 'world'); } + + { + let myURL = new url.URL('https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); + assert.equal(myURL.hash, '#bar'); + assert.equal(myURL.host, 'example.org:81'); + assert.equal(myURL.hostname, 'example.org'); + assert.equal(myURL.href, 'https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); + assert.equal(myURL.origin, 'https://example.org:81'); + assert.equal(myURL.password, 'thepwd'); + assert.equal(myURL.username, 'theuser'); + assert.equal(myURL.pathname, '/foo/path'); + assert.equal(myURL.port, "81"); + assert.equal(myURL.protocol, "https:"); + assert.equal(myURL.search, "?query=string"); + assert.equal(myURL.toString(), 'https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); + assert(myURL.searchParams instanceof url.URLSearchParams); + + myURL.host = 'example.org:82'; + myURL.hostname = 'example.com'; + myURL.href = 'http://other.com'; + myURL.hash = 'baz'; + myURL.password = "otherpwd"; + myURL.username = "otheruser"; + myURL.pathname = "/otherPath"; + myURL.port = "82"; + myURL.protocol = "http"; + myURL.search = "a=b"; + assert.equal(myURL.href, 'http://otheruser:otherpwd@other.com:82/otherPath?a=b#baz'); + + myURL = new url.URL('/foo', 'https://example.org/'); + assert.equal(myURL.href, 'https://example.org/foo'); + } + + { + const searchParams = new url.URLSearchParams('abc=123'); + + assert.equal(searchParams.toString(), 'abc=123'); + searchParams.forEach((value: string, name: string): void => { + assert.equal(name, 'abc'); + assert.equal(value, '123'); + }); + + assert.equal(searchParams.get('abc'), '123'); + + searchParams.append('abc', 'xyz'); + + assert.deepEqual(searchParams.getAll('abc'), ['123', 'xyz']); + + const entries = searchParams.entries(); + assert.deepEqual(entries.next(), { value: ["abc", "123"], done: false}); + assert.deepEqual(entries.next(), { value: ["abc", "xyz"], done: false}); + assert.deepEqual(entries.next(), { value: undefined, done: true}); + + const keys = searchParams.keys(); + assert.deepEqual(keys.next(), { value: "abc", done: false}); + assert.deepEqual(keys.next(), { value: "abc", done: false}); + assert.deepEqual(keys.next(), { value: undefined, done: true}); + + const values = searchParams.values(); + assert.deepEqual(values.next(), { value: "123", done: false}); + assert.deepEqual(values.next(), { value: "xyz", done: false}); + assert.deepEqual(values.next(), { value: undefined, done: true}); + + searchParams.set('abc', 'b'); + assert.deepEqual(searchParams.getAll('abc'), ['b']); + + searchParams.delete('a'); + assert(!searchParams.has('a')); + assert.equal(searchParams.get('a'), null); + } } ///////////////////////////////////////////////////// From 021ca569f7457f276e2c42ab63a5bc836bd368fd Mon Sep 17 00:00:00 2001 From: Flarna Date: Fri, 10 Feb 2017 13:57:43 +0100 Subject: [PATCH 046/797] use lib es6 in node-zookeeper-client --- node-zookeeper-client/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node-zookeeper-client/tsconfig.json b/node-zookeeper-client/tsconfig.json index 1f5ffdedf8..7b493509d7 100644 --- a/node-zookeeper-client/tsconfig.json +++ b/node-zookeeper-client/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5" + "es6" ], "noImplicitAny": true, "noImplicitThis": true, From 303462459eb3911762125bbc2f41b6991ceb04b4 Mon Sep 17 00:00:00 2001 From: Ivo Murrell Date: Fri, 10 Feb 2017 16:48:45 +0000 Subject: [PATCH 047/797] 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 048/797] 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 afaa3ee0a3df0aab352e3bda7bf98f5401e7e9f2 Mon Sep 17 00:00:00 2001 From: Steffen Jahr Date: Thu, 26 Jan 2017 22:14:14 +0100 Subject: [PATCH 049/797] Added missing methods to ServiceWorkerRegistration --- service_worker_api/index.d.ts | 82 ++++++++++++++++++- .../service_worker_api-tests.ts | 13 +++ 2 files changed, 91 insertions(+), 4 deletions(-) diff --git a/service_worker_api/index.d.ts b/service_worker_api/index.d.ts index 715fc4efbe..3f7e07acaa 100644 --- a/service_worker_api/index.d.ts +++ b/service_worker_api/index.d.ts @@ -576,12 +576,90 @@ interface ServiceWorkerRegistration extends EventTarget { * before it is unregistered. */ unregister(): Promise; + + /** + * Returns a Promise that resolves to an array of Notification objects. + * @param [options] An options object that can contain options to filter the notifications returned. + */ + getNotifications(options?: ServiceWorkerGetNotificationOptions): Promise; // need to be replaced with `Notification[]` when possible + + /** + * Displays the notification with the requested title. + * @param [title] The title that must be shown within the notification + * @param [options] An object that allows to configure the notification. + */ + showNotification(title: string, options?: ServiceWorkerNotificationOptions): Promise; } +/** + * An options object to provide options upon a ServiceWorkerRegistration. + * @param [scope] A USVString representing a URL that defines a service worker's registration scope; what range of + * URLs a service worker can control. This is usually a relative URL, and it defaults to '/' when not specified. + */ interface ServiceWorkerRegisterOptions { scope: string; } +/** + * Action to display in a notification. + * @param [action] A DOMString identifying a user action to be displayed on the notification. + * @param [title] A DOMString containing action text to be shown to the user. + * @param [icon] A USVString containg the URL of an icon to display with the action. + */ +interface NotificationAction { // TODO: Maybe need to moved if NotificationApi types are defined + action: string; + title: string; + icon?: string; +} + +/** + * Object that allows to configure a notification. + * @param [actions] An array of actions to display in the notification. + * Appropriate responses are built using event.action within the notificationclick event. + * @param [badge] The URL of an image to represent the notification when there is not enough space to display the + * notification itself such as, for example, the Android Notification Bar. On Android devices, the badge should + * accommodate devices up to 4x resolution, about 96 by 96 px, and the image will be automatically masked. + * @param [body] A string representing an extra content to display within the notification. + * @param [dir] The direction of the notification; it can be auto, ltr, or rtl. + * @param [icon] The URL of an image to be used as an icon by the notification. + * @param [image] A USVSTring containing the URL of an image to be displayed in the notification. + * @param [lang] Specify the lang used within the notification. This string must be a valid BCP 47 language tag. + * @param [renotify] A boolean that indicates whether to supress vibrations and audible alerts when resusing a tag + * value. The default is false. + * @param [requireInteraction] Indicates that on devices with sufficiently large screens, a notification should remain + * active until the user clicks or dismisses it. If this value is absent or false, the desktop version of Chrome + * will auto-minimize notifications after approximately twenty seconds. The default value is false. + * @param [tag] An ID for a given notification that allows you to find, replace, or remove the notification using + * script if necessary. + * @param [vibrate] A vibration pattern to run with the display of the notification. A vibration pattern can be an + * array with as few as one member. The values are times in milliseconds where the even indices (0, 2, 4, etc.) indicate + * how long to vibrate and the odd indices indicate how long to pause. For example [300, 100, 400] would vibrate + * 300ms, pause 100ms, then vibrate 400ms. + * @param [data] Arbitrary data that you want associated with the notification. This can be of any data type. + */ +interface ServiceWorkerNotificationOptions { + actions?: NotificationAction[]; + badge?: string; + body?: string; + dir?: 'auto' | 'ltr' | 'rtl'; + icon?: string; + lang?: string; + renotify?: boolean; + requireInteraction?: boolean; + tag?: string; + vibrate?: number[]; + data?: any; +} + +/** + * An options object that can contain options to filter notifications. + * @param [tag] A DOMString representing a notification tag. If specified, only notifications that have this tag + * will be returned. + */ +interface ServiceWorkerGetNotificationOptions { + tag: string; +} + /** * Provides an object representing the service worker as an overall unit in the * network ecosystem, including facilities to register, unregister and update @@ -629,10 +707,6 @@ interface ServiceWorkerContainer extends EventTarget { * * @param scriptURL The URL of the service worker script. * @param [options] An options object to provide options upon registration. - * Currently available options are: scope: A USVString representing a URL - * that defines a service worker's registration scope; what range of URLs a - * service worker can control. This is usually a relative URL, and it - * defaults to '/' when not specified. */ register(scriptURL: string, options?: ServiceWorkerRegisterOptions): Promise; diff --git a/service_worker_api/service_worker_api-tests.ts b/service_worker_api/service_worker_api-tests.ts index b2e183aa05..9e0d9ca13e 100644 --- a/service_worker_api/service_worker_api-tests.ts +++ b/service_worker_api/service_worker_api-tests.ts @@ -191,3 +191,16 @@ self.addEventListener('notificationclick', function(event: NotificationEvent) { return self.clients.openWindow('/'); })); }); + +navigator.serviceWorker.ready.then(function(registration) { + registration.showNotification('Notification Sample', { + body: 'This is a sample notification!', + icon: '/sw-test/star-wars-logo.jpg', + tag: 'notification-sample' + }); +}); + +self.registration.getNotifications({tag: 'notification-sample'}) + .then(function(notifications) { + console.log(notifications); + }); From 88fc35b3e172a47c300666227c03ac26d3e2fbb2 Mon Sep 17 00:00:00 2001 From: Flarna Date: Fri, 10 Feb 2017 23:09:34 +0100 Subject: [PATCH 050/797] correct CI errors because of TS 2.1 and trailing whitespaces --- assert-plus/index.d.ts | 184 +++++++++++++++--------------- globule/index.d.ts | 8 +- koa-json-error/index.d.ts | 1 + libpq/index.d.ts | 1 + loopback-boot/index.d.ts | 60 +++++----- loopback/index.d.ts | 138 +++++++++++----------- strong-cluster-control/index.d.ts | 2 +- xml/index.d.ts | 8 +- 8 files changed, 202 insertions(+), 200 deletions(-) diff --git a/assert-plus/index.d.ts b/assert-plus/index.d.ts index e2bafe4eae..9fed553532 100644 --- a/assert-plus/index.d.ts +++ b/assert-plus/index.d.ts @@ -8,247 +8,247 @@ import {Stream} from 'stream'; /** - * + * */ export function array(arr: any[], message ?: string): void; /** - * + * */ export function bool(bool: boolean, message ?: string): void; /** - * + * */ export function buffer(buffer: Buffer, message ?: string): void; /** - * + * */ export function func(func: any, message ?: string): void; /** - * + * */ export function number(number: number, message ?: string): void; /** - * + * */ export function finite(finite: number, message ?: string): void; /** - * + * */ export function object(obj: any, message ?: string): void; /** - * + * */ export function string(str: string, message ?: string): void; /** - * + * */ export function stream(stream: Stream, message ?: string): void; /** - * + * */ export function date(date: Date, message ?: string): void; /** - * + * */ export function regexp(regexp: RegExp, message ?: string): void; /** - * + * */ export function uuid(uuid: string, message ?: string): void; /** - * + * */ export function arrayOfArray(arr: any[][], message ?: string): void; /** - * + * */ export function arrayOfBool(arr: boolean[], message ?: string): void; /** - * + * */ export function arrayOfBuffer(arr: Buffer[], message ?: string): void; /** - * + * */ export function arrayOfFunc(arr: any[], message ?: string): void; /** - * + * */ export function arrayOfNumber(arr: number[], message ?: string): void; /** - * + * */ export function arrayOfFinite(arr: number[], message ?: string): void; /** - * + * */ export function arrayOfObject(arr: any[], message ?: string): void; /** - * + * */ export function arrayOfString(arr: string[], message ?: string): void; /** - * + * */ export function arrayOfStream(arr: Stream[], message ?: string): void; /** - * + * */ export function arrayOfDate(arr: Date[], message ?: string): void; /** - * + * */ export function arrayOfRegexp(arr: RegExp[], message ?: string): void; /** - * + * */ export function arrayOfUuid(arr: string[], message ?: string): void; /** - * + * */ export function optionalArray(arr: any[] | undefined, message ?: string): void; /** - * + * */ export function optionalBool(bool: boolean | undefined, message ?: string): void; /** - * + * */ export function optionalBuffer(buffer: Buffer | undefined, message ?: string): void; /** - * + * */ export function optionalFunc(options: any, message ?: string): void; /** - * + * */ export function optionalNumber(options: number | undefined, message ?: string): void; /** - * + * */ export function optionalFinite(options: number | undefined, message ?: string): void; /** - * + * */ export function optionalObject(options: any, message ?: string): void; /** - * + * */ export function optionalString(options: string | undefined, message ?: string): void; /** - * + * */ export function optionalStream(options: Stream | undefined, message ?: string): void; /** - * + * */ export function optionalDate(options: Date | undefined, message ?: string): void; /** - * + * */ export function optionalRegexp(options: RegExp | undefined, message ?: string): void; /** - * + * */ export function optionalUuid(options: string | undefined, message ?: string): void; /** - * + * */ export function optionalArrayOfArray(arr: any[][] | undefined, message ?: string): void; /** - * + * */ export function optionalArrayOfBool(arr: boolean[] | undefined, message ?: string): void; /** - * + * */ export function optionalArrayOfBuffer(arr: Buffer[] | undefined, message ?: string): void; /** - * + * */ export function optionalArrayOfFunc(arr: any[] | undefined, message ?: string): void; /** - * + * */ export function optionalArrayOfNumber(arr: number[] | undefined, message ?: string): void; /** - * + * */ export function optionalArrayOfFinite(arr: number[] | undefined, message ?: string): void; /** - * + * */ export function optionalArrayOfObject(arr: any[] | undefined, message ?: string): void; /** - * + * */ export function optionalArrayOfString(arr: string[] | undefined, message ?: string): void; /** - * + * */ export function optionalArrayOfStream(arr: Stream[] | undefined, message ?: string): void; /** - * + * */ export function optionalArrayOfDate(arr: Date[] | undefined, message ?: string): void; /** - * + * */ export function optionalArrayOfRegexp(arr: RegExp[] | undefined, message ?: string): void; /** - * + * */ export function optionalArrayOfUuid(arr: string[] | undefined, message ?: string): void; /** - * + * */ export function AssertionError(options: any, message ?: string): void; @@ -256,13 +256,13 @@ export function AssertionError(options: any, message ?: string): void; * Throws an `AssertionError`. If `message` is falsy, the error message is set * as the values of `actual` and `expected` separated by the provided `operator`. * Otherwise, the error message is the value of `message`. - * + * * ```js * const assert = require('assert'); - * + * * assert.fail(1, 2, undefined, '>'); * // AssertionError: 1 > 2 - * + * * assert.fail(1, 2, 'whoops', '>'); * // AssertionError: whoops * ``` @@ -272,14 +272,14 @@ export function fail(actual: any, expected: any, message: any, operator: any): v /** * Tests if `value` is truthy. It is equivalent to `assert.equal(!!value, true, message)`. - * + * * If `value` is not truthy, an `AssertionError` is thrown with a `message` property * set equal to the value of the `message` parameter. * If the `message` parameter is `undefined`, a default error message is assigned. - * + * * ```js * const assert = require('assert'); - * + * * assert.ok(true); * // OK * assert.ok(1); @@ -297,21 +297,21 @@ export function ok(options: any, message ?: string): void; /** * Tests shallow, coercive equality between the actual and expected parameters * using the equal comparison operator ( `==` ). - * + * * ```js * const assert = require('assert'); - * + * * assert.equal(1, 1); * // OK, 1 == 1 * assert.equal(1, '1'); * // OK, 1 == '1' - * + * * assert.equal(1, 2); * // AssertionError: 1 == 2 * assert.equal({a: {b: 1}}, {a: {b: 1}}); * //AssertionError: { a: { b: 1 } } == { a: { b: 1 } } * ``` - * + * * If the values are not equal, an `AssertionError` is thrown with * a `message` property set equal to the value of the `message` parameter. * If the `message` parameter is undefined, a default error message is assigned. @@ -320,20 +320,20 @@ export function equal(actual: any, expected: any, message ?: string): void; /** * Tests shallow, coercive inequality with the not equal comparison operator ( `!=` ). - * + * * ```js * const assert = require('assert'); - * + * * assert.notEqual(1, 2); * // OK - * + * * assert.notEqual(1, 1); * // AssertionError: 1 != 1 - * + * * assert.notEqual(1, '1'); * // AssertionError: 1 != '1' * ``` - * + * * If the values are equal, an `AssertionError` is thrown with * a `message` property set equal to the value of the `message` parameter. * If the `message` parameter is undefined, a default error message is assigned. @@ -343,20 +343,20 @@ export function notEqual(actual: any, expected: any, message ?: string): void; /** * Tests for deep equality between the `actual` and `expected` parameters. * Primitive values are compared with the equal comparison operator ( `==` ). - * + * * Only enumerable "own" properties are considered. * The `deepEqual()` implementation does not test object prototypes, attached symbols, * or non-enumerable properties. This can lead to some potentially surprising results. * For example, the following example does not throw an `AssertionError` because * the properties on the Error object are non-enumerable: - * + * * ```js * // WARNING: This does not throw an AssertionError! * assert.deepEqual(Error('a'), Error('b')); * ``` - * + * * "Deep" equality means that the enumerable "own" properties of child objects are evaluated also. - * + * * If the values are not equal, an `AssertionError` is thrown with a `message` property * set equal to the value of the `message` parameter. If the `message` parameter is undefined, * a default error message is assigned. @@ -365,28 +365,28 @@ export function deepEqual(actual: T, expected: T, message ?: string): void; /** * Tests for any deep inequality. Opposite of `assert.deepEqual()`. - * + * * ```js * const assert = require('assert'); - * + * * const obj1 = { a : { b : 1 } }; * const obj2 = { a : { b : 2 } }; * const obj3 = { a : { b : 1 } }; * const obj4 = Object.create(obj1); - * + * * assert.notDeepEqual(obj1, obj1); * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * + * * assert.notDeepEqual(obj1, obj2); * // OK, obj1 and obj2 are not deeply equal - * + * * assert.notDeepEqual(obj1, obj3); * // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } } - * + * * assert.notDeepEqual(obj1, obj4); * // OK, obj1 and obj2 are not deeply equal * ``` - * + * * If the values are deeply equal, an `AssertionError` is thrown with * a `message` property set equal to the value of the `message` parameter. * If the `message` parameter is undefined, a default error message is assigned. @@ -395,20 +395,20 @@ export function notDeepEqual(actual: any, expected: any, message ?: string): voi /** * Tests strict equality as determined by the strict equality operator ( `===` ). - * + * * ```js * const assert = require('assert'); - * + * * assert.strictEqual(1, 2); * // AssertionError: 1 === 2 - * + * * assert.strictEqual(1, 1); * // OK - * + * * assert.strictEqual(1, '1'); * // AssertionError: 1 === '1' * ``` - * + * * If the values are not strictly equal, an `AssertionError` is thrown with * a `message` property set equal to the value of the `message` parameter. * If the `message` parameter is undefined, a default error message is assigned. @@ -417,20 +417,20 @@ export function strictEqual(actual: T, expected: T, message ?: string): void; /** * Tests strict inequality as determined by the strict not equal operator ( `!==` ). - * + * * ```js * const assert = require('assert'); - * + * * assert.notStrictEqual(1, 2); * // OK - * + * * assert.notStrictEqual(1, 1); * // AssertionError: 1 !== 1 - * + * * assert.notStrictEqual(1, '1'); * // OK * ``` - * + * * If the values are strictly equal, an `AssertionError` is thrown with a `message` property * set equal to the value of the `message` parameter. If the `message` parameter is undefined, * a default error message is assigned. @@ -438,19 +438,19 @@ export function strictEqual(actual: T, expected: T, message ?: string): void; export function notStrictEqual(actual: any, expected: any, message ?: string): void; /** - * + * */ export function throws(block: any, error ?: any, message ?: string): void; /** * Asserts that the function `block` does not throw an error. See `assert.throws()` for more details. - * + * * When `assert.doesNotThrow()` is called, it will immediately call the `block` function. - * + * * If an error is thrown and it is the same type as that specified by the `error` parameter, * then an `AssertionError` is thrown. If the error is of a different type, * or if the `error` parameter is undefined, the error is propagated back to the caller. - * + * * The following, for instance, will throw the TypeError because there is no matching error type in the assertion: * ```js * assert.doesNotThrow( @@ -460,7 +460,7 @@ export function throws(block: any, error ?: any, message ?: string): void; * SyntaxError * ); * ``` - * + * * However, the following will result in an `AssertionError` with the message 'Got unwanted exception (TypeError)..': * ```js * assert.doesNotThrow( @@ -470,7 +470,7 @@ export function throws(block: any, error ?: any, message ?: string): void; * TypeError * ); * ``` - * + * * If an `AssertionError` is thrown and a value is provided for the `message` parameter, * the value of `message` will be appended to the `AssertionError` message: * ```js @@ -490,7 +490,7 @@ export function doesNotThrow(block: any, error ?: any, message ?: string): void; * Throws `value` if `value` is truthy. This is useful when testing the `error` argument in callbacks. * ```js * const assert = require('assert'); - * + * * assert.ifError(0); * // OK * assert.ifError(1); diff --git a/globule/index.d.ts b/globule/index.d.ts index 595a4d2aec..4add1d4461 100644 --- a/globule/index.d.ts +++ b/globule/index.d.ts @@ -61,22 +61,22 @@ interface GlobuleStatic { */ find(pattern: string, pattern2: string, pattern3: string | string[], options?: FindOptions): string[]; - /** + /** * Given a set of source file paths, returns an array of src-dest file mapping objects */ mapping(filepaths: string[], options?: MappingOptions): OneMapping[]; - /** + /** * Given a set of source file paths, returns an array of src-dest file mapping objects */ mapping(options: MappingOptions): OneMapping[]; - /** + /** * Given a set of source file paths, returns an array of src-dest file mapping objects */ mapping(filepaths: string[], filepaths2: string[], options?: MappingOptions): OneMapping[]; - /** + /** * Given a set of source file paths, returns an array of src-dest file mapping objects */ mapping(filepaths: string[], filepaths2: string[], filepaths3: string[], options?: MappingOptions): OneMapping[]; diff --git a/koa-json-error/index.d.ts b/koa-json-error/index.d.ts index 9f02cce994..f1a54470ca 100644 --- a/koa-json-error/index.d.ts +++ b/koa-json-error/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/koajs/json-error // Definitions by: Mudkip // Definitions: https://github.com/mudkipme/DefinitelyTyped +// TypeScript Version: 2.1 import * as Koa from "koa"; diff --git a/libpq/index.d.ts b/libpq/index.d.ts index 1e9e38dd5c..fc502bdd74 100644 --- a/libpq/index.d.ts +++ b/libpq/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/brianc/node-libpq#readme // Definitions by: Vlad Rindevich // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// diff --git a/loopback-boot/index.d.ts b/loopback-boot/index.d.ts index 4c66af5ef8..84f72b57aa 100644 --- a/loopback-boot/index.d.ts +++ b/loopback-boot/index.d.ts @@ -17,35 +17,35 @@ import * as loopback from "loopback"; * ``` * var loopback= require('loopback'); * var boot = require('loopback-boot'); - * + * * var app = module.exports = loopback(); - * + * * boot(app, __dirname); - * + * * ``` - * + * * Initialize an application from an options object or a set of JSON and JavaScript files. - * - * NOTE: This module is primarily intended for use with LoopBack 2.0. It does work with LoopBack 1.x applications, + * + * NOTE: This module is primarily intended for use with LoopBack 2.0. It does work with LoopBack 1.x applications, * but none of the LoopBack 1.x examples or generated code (scaffolding) use it. - * + * * This function takes an optional argument that is either a string or an object. - * + * * If the argument is a string, then it sets the application root directory based on the string value. Then it: * Creates DataSources from the datasources.json file in the application root directory. - * + * * Configures Models from the model-config.json file in the application root directory. - * - * Configures the LoopBack Application object from the config.json file in the application root directory. + * + * Configures the LoopBack Application object from the config.json file in the application root directory. * These properties can be accessed using app.get('propname'). - * + * * If the argument is an object, then it looks for models, dataSources, 'config', modelsRootDir, dsRootDir, * appConfigRootDir and appRootDir properties of the object. - * + * * If the object has no appRootDir property then it sets the current working directory as the application root directory. - * + * * The execution environment, {env}, is established from, in order, - * + * * options.env * process.env.NODE_ENV, * the literal development. @@ -64,20 +64,20 @@ import * as loopback from "loopback"; * config.json, * config.local.js or config.local.json (only one), * config.{env}.js or config.{env}.json (only one) - * + * * in the directory designated by 'options.appConfigRootDir', if present, or the application root directory. * It merges the properties from the files found. - * - * In both cases, the function loads JavaScript files in the /boot subdirectory of the application root directory + * + * In both cases, the function loads JavaScript files in the /boot subdirectory of the application root directory * with require(). - * + * * NOTE: The version 2.0 of loopback-boot changed the way how models are created. - * The model-config.json file contains only configuration options like dataSource and extra relations. + * The model-config.json file contains only configuration options like dataSource and extra relations. * To define a model, create a per-model JSON file in models/ directory. - * + * * NOTE: Mixing bootLoopBackApp(app, bootConfig) and app.model(name, modelConfig) in multiple files may result in models being undefined due to race conditions. To avoid this when using bootLoopBackApp() make sure all models are passed as part of the models definition. * Throws an error if the config object is not valid or if boot fails. - * + * * @param {Loopback.LoopbackApplication} app LoopBack application created by loopback(). * @param {string|OptionsLB} options Boot options; If String, this is the application root directory; if object, has below properties. * @param {() => void} callback @@ -87,13 +87,13 @@ declare function lb(app: loopback.LoopBackApplication, options: string|OptionsLB interface OptionsLB { /** - * Directory to use when loading JSON and JavaScript files. + * Directory to use when loading JSON and JavaScript files. * Defaults to the current directory (process.cwd()). */ appRootDir: string; /** - * Directory to use when loading config.json. Defaults to appRootDir. + * Directory to use when loading config.json. Defaults to appRootDir. */ appConfigRootDir: string; @@ -103,7 +103,7 @@ interface OptionsLB { models: any; /** - * List of model definitions to use. When options.modelDefinitions is provided, + * List of model definitions to use. When options.modelDefinitions is provided, * loopback-boot does not search filesystem and use only the models provided in this argument. */ modelDefinitions: any[]; @@ -134,8 +134,8 @@ interface OptionsLB { componentRootDir: string; /** - * Environment type, defaults to process.env.NODE_ENV or development. - * Common values are development, staging and production; + * Environment type, defaults to process.env.NODE_ENV or development. + * Common values are development, staging and production; * however the applications are free to use any names. */ env: string; @@ -156,7 +156,7 @@ interface OptionsLB { components: any; /** - * List of directories where to look for files containing model mixin definitions. + * List of directories where to look for files containing model mixin definitions. * All files (mixins) found in these directory are loaded. */ mixinDirs: string[]; @@ -187,7 +187,7 @@ declare namespace lb { /** * compileToBrowserify - * + * * Compile boot instructions and add them to a browserify bundler. * @param {string|any} options as described in bootLoopBackApp above. * @param {any} bundler A browserify bundler created by browserify(). @@ -198,7 +198,7 @@ declare namespace lb { class compileToBrowserify { /** - * Application identifier used to load the correct boot configuration when + * Application identifier used to load the correct boot configuration when * building multiple applications using browserify. */ appId: string; diff --git a/loopback/index.d.ts b/loopback/index.d.ts index 64aac97c92..3402f3006c 100644 --- a/loopback/index.d.ts +++ b/loopback/index.d.ts @@ -88,7 +88,7 @@ declare namespace l { * @returns {any} http.Server A node `http.Server` with this application configured * as the request handle * listen(cb?: () => void):http.Serve - * + * */ // listen(port?: number, cb?: () => void): any; @@ -203,16 +203,16 @@ declare namespace l { /** * Register (new) middleware phases. - * + * * If all names are new, then the phases are added just before "routes" phase. * Otherwise the provided list of names is merged with the existing phases * in such way that the order of phases is preserved - * + * * **Examples* * ```js * // built-in phases: * // initial, session, auth, parse, routes, files, fina - * + * * app.defineMiddlewarePhases('custom'); * // new list of phases * // initial, session, auth, parse, custom, routes, files, fina @@ -340,7 +340,7 @@ declare namespace l { * In the second variant, the parameters `name`, `properties` and `options` * are provided in the config object. Any additional config entries are * interpreted as `options`, i.e. the following two configs are identical - * + * * ```js * { name: 'Customer', base: 'User' } * { name: 'Customer', options: { base: 'User' } } @@ -792,7 +792,7 @@ declare namespace l { * // => model with id 1 has been changed * }); * `` - * + * * #### Event: `deleted * Emitted after an individual model has been deleted. * Argument: `id`, model ID (number) @@ -803,7 +803,7 @@ declare namespace l { * }); * `` * #### Event: `deletedAll - * + * * Emitted after an individual model has been deleted. * Argument: `where` (optional), where filter, JSON object * ```js @@ -816,7 +816,7 @@ declare namespace l { * } * }); * `` - * + * * #### Event: `attached * Emitted after a `Model` has been attached to an `app` * #### Event: `dataSourceAttached @@ -830,7 +830,7 @@ declare namespace l { * // => model with id 1 has been changed * }); * `` - * + * * @param {any} data * @property {string} Model.modelName The name of the model. Static property. * @property {DataSource} Model.dataSource Data source to which the model is connected, if any. Static property. @@ -943,12 +943,12 @@ declare namespace l { * SharedClass * Create a new SharedClass with the given options. * **NOTE** TODO : exported from another module type definition called strong-remoting - * + * * @param {string} name The SharedClass name * @param {() => void} constructor The constructor the SharedClass represents * @param {any} options Additional options. * @property {() => void } ctor The constructor - * @property {any} http The HTTP settings + * @property {any} http The HTTP settings */ class SharedClass { @@ -1013,7 +1013,7 @@ declare namespace l { /** * Get all shared methods belonging to this shared class. - * @param {any} options + * @param {any} options * @return {any[]} An array of shared methods SharedMethod[] */ @@ -1034,7 +1034,7 @@ declare namespace l { * cb(null, str); * } * ``` - * + * * @param {() => void} resolver The resolver function. */ @@ -1053,7 +1053,7 @@ declare namespace l { * **Change Event* * Listen for model changes using the `change` event * ```js - * MyPersistedModel.on('changed', function(obj) + * MyPersistedModel.on('changed', function(obj) * console.log(obj) // => the changed model * }); * ``` @@ -1116,10 +1116,10 @@ declare namespace l { static create(data?: any|any[], callback?: (err: Error, models: any) => void): void; - /** + /** * Create a change stream. See here for more info http://loopback.io/doc/en/lb2/Realtime-server-sent-events.html * @param {any} options Only changes to models matching this where filter will be included in the ChangeStream. - * @param {() => void} callback + * @param {() => void} callback */ static createChangeStream(options: {where: any}, callback: (err: Error, changes: any) => void): void; @@ -1150,7 +1150,7 @@ declare namespace l { * ``` *
See * [Where filter](docs.strongloop.com/display/LB/Where+filter#Wherefilter-Whereclauseforothermethods) - * + * * @callback {() => void} callback Optional callback function called with `(err, info)` arguments. * @param {Error} err Error object; see [Error object](docs.strongloop.com/display/LB/Error+object). * @param {any} info Additional information about the command outcome. @@ -1270,7 +1270,7 @@ declare namespace l { * the same as `find`, but limited to one object. Returns an object, not * collection. If you don't provide the filter object argument, it tries to * locate an existing object that matches the `data` argument - * + * * @options {any} [filter] Optional Filter object; see below. * @property {string|any|Array} fields Identify fields to include in return result. *
See [Fields filter](docs.strongloop.com/display/LB/Fields+filter). @@ -1627,7 +1627,7 @@ declare namespace l { function static(root: string, options: any): void; /** - * Return HTTP response with basic application status information: + * Return HTTP response with basic application status information: * date the application was started and uptime, in JSON format. For example: * ``` * { @@ -1651,7 +1651,7 @@ declare namespace l { * - `access_token` (params only) * - `X-Access-Token` (headers only) * - `authorization` (headers and cookies - * + * * It checks for these values in cookies, headers, and query string parameters _in addition_ to the items * specified in the options parameter * **NOTE:** This function only checks for [signed cookies](expressjs.com/api.html#req.signedCookies) @@ -1664,7 +1664,7 @@ declare namespace l { * params: ['foo-auth', 'foo_auth'] * })); * ``` - * + * * @options {any} [options] Each option Array is used to add additional keys to find an `accessToken` for a `request`. * @property {Array} [cookies] Array of cookie names. * @property {Array} [headers] Array of header names. @@ -1985,7 +1985,7 @@ declare namespace l { * pushSettings.apns.feedbackOptions.port (APNS). * pushSettings.apns.feedbackOptions.batchFeedback (APNS). * pushSettings.apns.feedbackOptions.interval (APNS). - * pushSettings.gcm.serverApiKey: Google Cloud Messaging API key. + * pushSettings.gcm.serverApiKey: Google Cloud Messaging API key. */ pushSetings: { apns: { @@ -2091,7 +2091,7 @@ declare namespace l { /** Model ID. */ modelId: string; - /** + /** * settings Extends the `Model.settings` object. * settings.hashAlgorithm Algorithm used to create cryptographic hash, used as argument * to [crypto.createHash](nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm).Default is sha1. @@ -2260,7 +2260,7 @@ declare namespace l { /** * When two changes conflict a conflict is created * **Note**: call `conflict.fetch()` to get the `target` and `source` models - * + * * @param {*} modelId * @param {PersistedModel} SourceModel * @param {PersistedModel} TargetModel @@ -2337,7 +2337,7 @@ declare namespace l { * Return a new Conflict instance with swapped Source and Target models * This is useful when resolving a conflict in one-way * replication, where the source data must not be changed - * + * * ```js * conflict.swapParties().resolveUsingTarget(cb); * ``` @@ -2349,11 +2349,11 @@ declare namespace l { /** * Determine the conflict type * Possible results ar - * + * * - `Change.UPDATE`: Source and target models were updated * - `Change.DELETE`: Source and or target model was deleted. * - `Change.UNKNOWN`: the conflict type is uknown or due to an erro - * + * * @callback {() => void} callback * @param {Error} err * @param {string} type The conflict type @@ -2402,7 +2402,7 @@ declare namespace l { * } * `` * See github.com/andris9/Nodemailer for other supported options - * + * * @options {any} options See below * @prop {string} from Senders's email address * @prop {string} to List of one or more recipient email addresses (comma-delimited) @@ -2424,19 +2424,19 @@ declare namespace l { /** * Data model for key-value databases. - * @class + * @class */ class KeyValueModel { /** - * Set the TTL (time to live) in ms (milliseconds) for a given key. + * Set the TTL (time to live) in ms (milliseconds) for a given key. * TTL is the remaining time before a key-value pair is discarded from the database. - * - * Callback (Optional) Optional callback. + * + * Callback (Optional) Optional callback. * When the callback function is not provided, a promise is returned instead (see below). - * - * Promise - * this method supports both callback-based and promise-based invocation. + * + * Promise + * this method supports both callback-based and promise-based invocation. * Call this method with no callback argument to get back a promise instead. * @param {string} key Key to use when searching the database. * @param {number} ttl TTL in ms to set for the key. @@ -2448,14 +2448,14 @@ declare namespace l { /** * Return the value associated with a given key. - * + * * Callback (Optional) * Optional callback. When the callback function is not provided, a promise is returned instead (see below). - * + * * Promise - * This method supports both callback-based and promise-based invocation. + * This method supports both callback-based and promise-based invocation. * Call this method with no callback argument to get back a promise instead. - * + * * @param {string} key Key to use when searching the database. * @param {any} options * @param {() => void} callback @@ -2464,8 +2464,8 @@ declare namespace l { static get(key: string, option?: any, callback?: (err: Error, result: any) => void): PromiseLike; /** - * Asynchronously iterate all keys in the database. Similar to .keys() - * but instead allows for iteration over large data sets without having + * Asynchronously iterate all keys in the database. Similar to .keys() + * but instead allows for iteration over large data sets without having * to load everything into memory at once. * Callback example: * ``` @@ -2478,7 +2478,7 @@ declare namespace l { * }); * }); * ``` - * + * * Promise example: * ``` * // Given a model named `Color` with two keys `red` and `blue` @@ -2494,10 +2494,10 @@ declare namespace l { * // key contains `blue` * }); * ``` - * + * * @param {any} filter An optional filter object with the following * @param {string} filter.match Glob string to use to filter returned keys (i.e. userid.*). - * All connectors are required to support * and ?. + * All connectors are required to support * and ?. * They may also support additional special characters that are specific to the backing database. * @param {any} filter.options * @return {any} result AsyncIterator An Object implementing next(cb) -> Promise function that can be used to iterate all keys. @@ -2509,33 +2509,33 @@ declare namespace l { * Return all keys in the database. * WARNING: This method is not suitable for large data sets as all key-values pairs * are loaded into memory at once. For large data sets, use iterateKeys() instead. - * - * This method supports both callback-based and promise-based invocation. + * + * This method supports both callback-based and promise-based invocation. * Call this method with no callback argument to get back a promise instead - * + * * WARNING: this promise implementation will not resolve according to the callback function. - * + * * @param {any} filter An optional filter object with the following - * @param {string} filter.match Glob string used to filter returned keys (i.e. userid.*). - * All connectors are required to support * and ?, but may also support additional special + * @param {string} filter.match Glob string used to filter returned keys (i.e. userid.*). + * All connectors are required to support * and ?, but may also support additional special * characters specific to the database. - * @param {any} filter.options + * @param {any} filter.options * @param {() => void} callback - * @return {PromiseLike} + * @return {PromiseLike} */ static keys(filter: {match: string; options: any}, callback: () => void): PromiseLike; /** * Persist a value and associate it with the given key. - * + * * Callback (Optional) * Optional callback. When the callback function is not provided, a promise is returned instead (see below). - * + * * Promise - * This method supports both callback-based and promise-based invocation. + * This method supports both callback-based and promise-based invocation. * Call this method with no callback argument to get back a promise instead. - * + * * @param {string} key Key to associate with the given value. * @param {any} value Value to persist. * @param {number|any} Optional settings for the key-value pair. If a Number is provided, it is set as the TTL (time to live) in ms (milliseconds) for the key-value pair. @@ -2545,15 +2545,15 @@ declare namespace l { static set(key: string, value: any, options?: number|any, callback?: (err: Error) => void): PromiseLike; /** - * Return the TTL (time to live) for a given key. + * Return the TTL (time to live) for a given key. * TTL is the remaining time before a key-value pair is discarded from the database. - * + * * Callback (Optional) - * Optional callback. When the callback function is not provided, + * Optional callback. When the callback function is not provided, * a promise is returned instead (see below). - * + * * @param {string} key Key to use when searching the database. - * @param {any} options + * @param {any} options * @param {() => void} callback */ @@ -2702,7 +2702,7 @@ declare namespace l { * - ALLOW EVERYONE `logout` * - ALLOW OWNER `findById` * - ALLOW OWNER `updateAttributes` - * + * * @property {string} username Must be unique. * @property {string} password Hidden from remote clients. * @property {string} email Must be valid email. @@ -2724,7 +2724,7 @@ declare namespace l { * @property {number} settings.resetPasswordTokenTTL Time to live for password reset `AccessToken`. Default is `900` (15 minutes). * @property {number} settings.saltWorkFactor The `bcrypt` salt work factor. Default is `10`. * @property {boolean} settings.caseSensitiveEmail Enable case sensitive email. - * + * * @class User * @inherits {PersistedModel} */ @@ -2798,13 +2798,13 @@ declare namespace l { /** * Login a user by with the given `credentials` - * + * * ```js * User.login({username: 'foo', password: 'bar'}, function (err, token) { * console.log(token.id); * }); * ``` - * + * * @param {any} credentials username/password or email/password * @param {string[]|string} [include] Optionally set it to "user" to include * the user info @@ -2817,13 +2817,13 @@ declare namespace l { /** * Logout a user with the given accessToken id - * + * * ```js * User.logout('asd0a9f8dsj9s0s3223mk', function (err) { * console.log(err || 'Logged out'); * }); * ``` - * + * * @param {string} accessTokenID * @callback {() => void} callback * @param {Error} er @@ -2884,10 +2884,10 @@ declare namespace l { * redirect: '/', * tokenGenerator: function (user, cb) { cb("random-token"); } * }; - * + * * user.verify(options, next); * ``` - * + * * @options {any} options * @property {string} type Must be 'email'. * @property {string} to Email address to which verification email is sent. diff --git a/strong-cluster-control/index.d.ts b/strong-cluster-control/index.d.ts index e0bb92b82f..5037aed03b 100644 --- a/strong-cluster-control/index.d.ts +++ b/strong-cluster-control/index.d.ts @@ -43,7 +43,7 @@ declare namespace StrongClusterControl { * @description Start the controller * @param [options] - An options object, no default, and options object is not required. * @param [options.size] - Number of workers that should be running, the default is to not control the number of workers - * @param [options.env=null] - Environment properties object passed to cluster.fork() if the controller has to start a worker to resize the cluster, default is null. + * @param [options.env=null] - Environment properties object passed to cluster.fork() if the controller has to start a worker to resize the cluster, default is null. * @param [options.shutdownTimeout=5000] - Number of milliseconds to wait after shutdown before terminating a worker, the default is 5 seconds * @param [options.terminateTimeout=5000] - Number of milliseconds to wait after terminate before killing a worker, the default is 5 seconds * @param [options.throttoleDelay] - Number of milliseconds to delay restarting workers after they are exiting abnormally. Abnormal is defined as as not suicide. diff --git a/xml/index.d.ts b/xml/index.d.ts index 8c5d5179ca..357c3f5b16 100644 --- a/xml/index.d.ts +++ b/xml/index.d.ts @@ -6,16 +6,16 @@ /// interface Option { - /** - * String used for tab, defaults to no tabs (compressed) + /** + * String used for tab, defaults to no tabs (compressed) */ indent?: string; /** - * Return the result as a `stream` (default false) + * Return the result as a `stream` (default false) */ stream?: boolean; /** - * Add default xml declaration (default false) + * Add default xml declaration (default false) */ declaration?: boolean | { encoding?: string; From 2e4eb822d4c45f1283bfd855c46b6e8db7e17edc Mon Sep 17 00:00:00 2001 From: Flarna Date: Fri, 10 Feb 2017 23:17:39 +0100 Subject: [PATCH 051/797] silent lint for bittorrent-protocol --- bittorrent-protocol/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bittorrent-protocol/index.d.ts b/bittorrent-protocol/index.d.ts index 688527e71f..be1a60b179 100644 --- a/bittorrent-protocol/index.d.ts +++ b/bittorrent-protocol/index.d.ts @@ -16,6 +16,7 @@ declare namespace BittorrentProtocol { } export interface Extension { + //tslint:disable-next-line:no-misused-new - could use class instead of interface but class is not extendible constructor(wire: Wire): this; onHandshake?: () => void; onExtendedHandshake?: () => void; @@ -24,6 +25,7 @@ declare namespace BittorrentProtocol { } export interface Request { + //tslint:disable-next-line:no-misused-new - could use class instead of interface but class is not extendible constructor(piece: number, offset: number, length: number, callback: () => void): this; piece: number; offset: number; From f605507a2ceccf092791e3a13e83cf71991cd2aa Mon Sep 17 00:00:00 2001 From: Flarna Date: Fri, 10 Feb 2017 23:57:05 +0100 Subject: [PATCH 052/797] enable ts 2.1 in supertest-as-promised --- supertest-as-promised/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/supertest-as-promised/index.d.ts b/supertest-as-promised/index.d.ts index db0bf18e81..2c8f8b036a 100644 --- a/supertest-as-promised/index.d.ts +++ b/supertest-as-promised/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/WhoopInc/supertest-as-promised // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 import * as supertest from "supertest"; import * as superagent from "superagent"; From 9de4486dbeb4bd5c71ebd751c052b0f443259a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Sat, 11 Feb 2017 00:58:28 +0100 Subject: [PATCH 053/797] tests --- body-parser/body-parser-tests.ts | 22 ++++++++++++++++++++++ body-parser/tsconfig.json | 6 ++++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 body-parser/body-parser-tests.ts diff --git a/body-parser/body-parser-tests.ts b/body-parser/body-parser-tests.ts new file mode 100644 index 0000000000..ffac86e592 --- /dev/null +++ b/body-parser/body-parser-tests.ts @@ -0,0 +1,22 @@ +import * as express from 'express'; +import { + json, + raw, + text, + urlencoded, +} from 'body-parser'; + +const app = express(); + +express.use(json()); +express.use(raw()); +express.use(text()); +express.use(urlencoded()); + +// send any data, it should be parsed and printed +express.all('/', (req, res, next) => { + console.log(req.body); + res.json(req.body); +}); + +express.listen(8080); diff --git a/body-parser/tsconfig.json b/body-parser/tsconfig.json index fe0b5d1b8a..e798cd97d3 100644 --- a/body-parser/tsconfig.json +++ b/body-parser/tsconfig.json @@ -2,7 +2,8 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, @@ -16,6 +17,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "body-parser-tests.ts" ] } From 6ddb418192acdbffb65238f6969870aa8d8143b6 Mon Sep 17 00:00:00 2001 From: Liwen Guo Date: Sat, 11 Feb 2017 02:18:51 +0100 Subject: [PATCH 054/797] [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 055/797] dockerode: Removed newline From d456588ba334d5e82815ccc7ab8afb969fc89940 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sat, 11 Feb 2017 12:43:05 +0900 Subject: [PATCH 056/797] TSTL, Samchon & Packer tslint.json files are added. --- 3d-bin-packing/tslint.json | 1 + samchon/tslint.json | 1 + tstl/tslint.json | 1 + 3 files changed, 3 insertions(+) create mode 100644 3d-bin-packing/tslint.json create mode 100644 samchon/tslint.json create mode 100644 tstl/tslint.json diff --git a/3d-bin-packing/tslint.json b/3d-bin-packing/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/3d-bin-packing/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/samchon/tslint.json b/samchon/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/samchon/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/tstl/tslint.json b/tstl/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/tstl/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From b26e01026128aaab3340e300fa7869bcde36f745 Mon Sep 17 00:00:00 2001 From: Jeongho Nam Date: Sat, 11 Feb 2017 12:53:15 +0900 Subject: [PATCH 057/797] Revert "TSTL, Samchon & Packer" This reverts commit d456588ba334d5e82815ccc7ab8afb969fc89940. --- 3d-bin-packing/tslint.json | 1 - samchon/tslint.json | 1 - tstl/tslint.json | 1 - 3 files changed, 3 deletions(-) delete mode 100644 3d-bin-packing/tslint.json delete mode 100644 samchon/tslint.json delete mode 100644 tstl/tslint.json diff --git a/3d-bin-packing/tslint.json b/3d-bin-packing/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/3d-bin-packing/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/samchon/tslint.json b/samchon/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/samchon/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/tstl/tslint.json b/tstl/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/tstl/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } From 7f7b9dfddcb0dbe0285699bf8b3caaa2c0981b0a Mon Sep 17 00:00:00 2001 From: Omer Bokhari Date: Fri, 10 Feb 2017 22:48:48 -0800 Subject: [PATCH 058/797] 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 059/797] 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 060/797] 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 061/797] 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 062/797] 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 063/797] 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 064/797] 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 065/797] 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 066/797] 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 067/797] 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 068/797] 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 069/797] 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 070/797] 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 071/797] 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 27da01598c435cd7701dbc2cb24079e90c12d5ab Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Mon, 13 Feb 2017 15:16:30 +0530 Subject: [PATCH 072/797] 15.1.33 added --- ej.web.all/ej.web.all-tests.ts | 6029 +++++++++++++++++--------------- ej.web.all/index.d.ts | 4779 +++++++++++++++++++++++-- 2 files changed, 7685 insertions(+), 3123 deletions(-) diff --git a/ej.web.all/ej.web.all-tests.ts b/ej.web.all/ej.web.all-tests.ts index faf5a48e0f..294f52b097 100644 --- a/ej.web.all/ej.web.all-tests.ts +++ b/ej.web.all/ej.web.all-tests.ts @@ -1,2789 +1,3240 @@ -/// -/// - - - -module AccordionComponent { - $(function () { - var sample = new ej.Accordion($("#basicAccordion"), { - width: "100%", - allowKeyboardNavigation: true, - collapseSpeed: 500, - collapsible: true, - enableAnimation: true, - enableMultipleOpen: true, - events: "click", - expandSpeed: 500, - headerSize: "40px", - height: "500px", - heightAdjustMode: ej.Accordion.HeightAdjustMode.Auto, - htmlAttributes: { title: "Demo" }, - selectedItemIndex: 1, - showCloseButton: true, - showRoundedCorner: true - }); - }); -} - - - -module AutocompleteComponent{ - var carList = [ - "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", - "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", - "Chevrolet Camaro", "Cadillac", - "Duesenberg J", "Dodge Sprinter", - "Elantra", "Excavator", - "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", - "GAZ Siber", - "Honda S2000", "Hyundai Santro", - "Isuzu Swift", "Infiniti Skyline", - "Jaguar XJS", - "Kia Sedona EX", "Koenigsegg Agera", - "Lotus Esprit", "Lamborghini Diablo", - "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", - "Nissan Qashqai", - "Oldsmobile S98", "Opel Superboss", - "Porsche 356", "Pontiac Sunbird", - "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", - "Triumph Spitfire", "Toyota 2000GT", - "Volvo P1800", "Volkswagen Shirako" - ]; - $(function () { - var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { - width: "100%", - watermarkText: "Select a car", - dataSource: carList, - enableAutoFill: true, - showPopupButton: true, - multiSelectMode: "delimiter" - }); - }); -} - - - - - -module Barcodecomponent { - $(function () { - var barcodesample = new ej.datavisualization.Barcode($("#Barcode"), { - text:"http://www.syncfusion.com" - }); - }); -} - - - - - -module Bulletgraphcomponent { - $(function () { - var bulletsample = new ej.datavisualization.BulletGraph($("#BulletGraph"), { - isResponsive: true, - tooltipSettings: { visible: true }, - quantitativeScaleSettings: { - featureMeasures: [{ - value: 8, comparativeMeasureValue:6.7 - }] - }, - qualitativeRanges: [{ - rangeEnd: 4.3, rangeStroke:"#ebebeb", - }, - { - rangeEnd: 7.3, rangeStroke:"#d8d8d8" - }, - { - rangeEnd: 10, rangeStroke: "#7f7f7f" - } - ], - captionSettings: { - textPosition: 'right', text: 'Revenue YTD', - subTitle: { - text: "$ in Thousands", textPosition:"right" - } - } - }); - }); -} - - - - - -module ButtonComponent { - $(function () { - var basicButton = new ej.Button($("#buttonnormal"), { - size: "large", - showRoundedCorner: true, - contentType: "textandimage", - prefixIcon: "e-icon e-save", - text: "Save" - }); - var toggleButton = new ej.ToggleButton($("#TextOnly"), { - showRoundedCorner: true, - size: "large", - contentType: "textandimage", - defaultPrefixIcon: "e-icon e-save", - activePrefixIcon: "e-icon e-delete", - defaultText: "Save", - activeText: "Delete" - }); - var splitbuttonnormal = new ej.SplitButton($("#splitbuttonnormal"), { - showRoundedCorner: true, - size: "large", - prefixIcon: "e-icon e-file-empty", - targetID: "menu1", - contentType: "textandimage", - text: "File" - }); - var groupButton = new ej.GroupButton($("#groupButton"), { - showRoundedCorner: true, - size: "large" - }); - var check1 = new ej.CheckBox($("#check1"), { - size: "medium", enableTriState: true - }); - var check2 = new ej.CheckBox($("#check2"), { - size: "medium", enableTriState: true - }); - var radio1 = new ej.RadioButton($("#radio1"), { - size: "medium" - }); - var radio2 = new ej.RadioButton($("#radio2"), { - size: "medium", checked: true - }); - }); -} - - - - -module ChartComponent { - $(function () { - var chartsample = new ej.datavisualization.Chart($("#Chart"), { - primaryXAxis: { - range: { min: 2005, max: 2011, interval: 1 }, - title: { text: "Year" }, - valueType: "category" - }, - primaryYAxis: { - range: { min: 25, max: 50, interval: 5 }, - labelFormat: "{value}%", - title: { text: "Efficiency" }, - - }, - commonSeriesOptions: - { - type: 'line', enableAnimation: true, - tooltip:{ visible :true, template:'Tooltip'}, - marker: - { - shape: 'circle', - size: - { - height: 10, width: 10 - }, - visible: true - }, - border : {width: 2} - }, - series: - [ - { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], - name: 'India' - }, - { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], - name: 'Germany' - }, - { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], - name: 'England' - }, - { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], - name: 'France' - } - ], - isResponsive: true, - load: function () { - var sender = $("#Chart").data("ejChart"); - if (!!window.orientation && sender) { //to modify chart properties for mobile view - var model = sender.model, - seriesLength = model.series.length; - model.legend.visible = false; - model.size.height = null; - model.size.width = null; - for (var i = 0; i < seriesLength; i++) { - if (!model.series[i].marker) - model.series[i].marker = {}; - if (!model.series[i].marker.size) - model.series[i].marker.size = {}; - model.series[i].marker.size.width = 6; - model.series[i].marker.size.height = 6; - } - model.primaryXAxis.labelIntersectAction = "rotate45"; - if (model.primaryXAxis.title) - model.primaryXAxis.title.text = ""; - if (model.primaryYAxis.title) - model.primaryYAxis.title.text = ""; - model.primaryXAxis.edgeLabelPlacement = "hide"; - model.primaryYAxis.labelIntersectAction = "rotate45"; - model.primaryYAxis.edgeLabelPlacement = "hide"; - } - }, - title: { text: 'Efficiency of oil-fired power production' }, - size: { height: "600" }, - legend: { visible: true} - }); - }); -} - - - -module ColorPickerComponent { - $(function () { - var colorSample = new ej.ColorPicker($("#colorpick"), { - value: "#278787" - }); - }); -} - - - - -module DatePickerComponent { - $(function () { - var dateSample = new ej.DatePicker($("#datepick"), { - width: "100%" - }); - }); -} - - - - -module DateTimePickerComponent { - $(function () { - var datetimeSample = new ej.DateTimePicker($("#datetimepick"), { - width: "100%" - }); - }); -} - - - -$(function () { - var diagram = new ej.datavisualization.Diagram($("#diagram"), { - width: "1000px", - height: "600px", - pageSettings: { - //Sets page size - pageHeight: 500, - pageWidth: 500, - //Customizes the appearance of page - pageBorderWidth: 4, - pageBackgroundColor: "white", - pageBorderColor: "lightgray", - pageMargin: 25, - showPageBreak: true, - multiplePage: true, - pageOrientation: ej.datavisualization.Diagram.PageOrientations.Portrait - }, - scrollSettings: { - horizontalOffset: 0, - verticalOffset: 0 - }, - snapSettings: { - snapConstraints: ej.datavisualization.Diagram.SnapConstraints.ShowLines - }, - nodes: [ - createNode({ name: "NewIdea", width: 150, height: 60, offsetX: 300, offsetY: 60, labels: [createLabel({ "text": "New idea identified" })], type: "flow", shape: "terminator" }), - createNode({ name: "Meeting", width: 150, height: 60, offsetX: 300, offsetY: 155, labels: [createLabel({ "text": "Meeting with board" })], type: "flow", shape: "process" }), - createNode({ name: "BoardDecision", width: 150, height: 110, offsetX: 300, offsetY: 280, labels: [createLabel({ text: "Board decides \nwhether \nto proceed", wrapText: "true", "margin": { left: 20, top: 0, right: 20, bottom: 0 } })], type: "flow", shape: "decision" }), - createNode({ name: "Project", width: 150, height: 100, offsetX: 300, offsetY: 430, labels: [createLabel({ "text": "Find Project \nmanager" })], type: "flow", shape: "decision" }), - createNode({ name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: "process" }), - createNode({ name: "Decision", width: 250, height: 60, offsetX: 550, offsetY: 60, labels: [createLabel({ "text": "Decision Process for new software ideas" })], type: "flow", shape: "card", fillColor: "#858585", borderColor: "#858585" }), - createNode({ name: "Reject", width: 150, height: 60, offsetX: 550, offsetY: 285, labels: [createLabel({ "text": "Reject and write report" })], type: "flow", shape: "process" }), - createNode({ name: "Resources", width: 150, height: 60, offsetX: 550, offsetY: 430, labels: [createLabel({ "text": "Hire new resources" })], type: "flow", shape: "process" }) - ], - connectors: [ - createConnector({ name: "connector1", sourceNode: "NewIdea", targetNode: "Meeting" }), - createConnector({ name: "connector2", sourceNode: "Meeting", targetNode: "BoardDecision" }), - createConnector({ name: "connector3", sourceNode: "BoardDecision", targetNode: "Project", labels: [createLabel({ "text": "Yes" })] }), - createConnector({ name: "connector4", sourceNode: "Project", targetNode: "End", labels: [createLabel({ "text": "Yes" })] }), - createConnector({ name: "connector5", sourceNode: "BoardDecision", targetNode: "Reject", labels: [createLabel({ "text": "No" })] }), - createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) - ] - }); - -}); - -function createNode(option: ej.datavisualization.Diagram.Node) { - if (!option.fillColor) { - option.borderColor = "#1BA0E2"; - option.fillColor = "#1BA0E2"; - } - option.labels[0].fontColor = "white"; - return option; -} - -function createConnector(option: ej.datavisualization.Diagram.Connector) { - option.targetDecorator = { shape: ej.datavisualization.Diagram.DecoratorShapes.Arrow, borderColor: "#606060", width: 10, height: 10 }; - option.lineColor = "#606060"; - if (option.labels && option.labels.length > 0) { - option.labels[0].fillColor = "white"; - } - return option; -} - -function createLabel(options : any) { - return options; -} - - - -module DialogComponent { - $(function () { - var dialogInstance = new ej.Dialog($("#basicDialog"), { - width: 550, - minWidth: 310, - minHeight: 215, - target:".control", - close:()=>{this.onDialogClose()} - }); - var btnInstance = new ej.Button($("#btnOpen"), { - size: "medium", - click: ()=>{this.onOpen()}, - type: "button", - height: 30, - width: 150 - }); - }); -} - -function onDialogClose(args:any) { - $("#btnOpen").show(); -} -function onOpen() { - $("#btnOpen").hide(); - $("#basicDialog").ejDialog("open"); -} - - - -module digitalgaugecomponent { - $(function () { - var digitalgaugesample = new ej.datavisualization.DigitalGauge($("#DigitalGauge"), { - width: 525, - height: 305, - isResponsive: true, - items: [{ - segmentSettings: { - width: 1, - spacing: 0, - color: "#8c8c8c" - }, - characterSettings: { - opacity: 0.8, - }, - value: "Syncfusion", - position: { x: 52, y: 52 } - }] - }); - }); -} - - - - - - -module DropDownListComponent { - var BikeList = [ - { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, - { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, - { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, - { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } - ]; - $(function () { - var sample = new ej.DropDownList($("#bikeList"),{ - dataSource: BikeList, - width: "100%", - watermarkText: "Select a bike", - fields: { id: "empid", text: "text", value: "text" }, - enableFilterSearch: true, - caseSensitiveSearch: true, - enableIncrementalSearch: true, - enablePopupResize: true, - delimiterChar: ";", - multiSelectMode: ej.MultiSelectMode.Delimiter, - maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", - minPopupWidth: "350px", - selectedIndex: 1, - showCheckbox: true, - showPopupOnLoad: true, - showRoundedCorner: true - }); - }); - -} - - - - - - -module ExplorerComponent { - $(function () { - var file = new ej.FileExplorer($("#fileExplorer"), { - path: (window).baseurl + "webapi/FileExplorer/FileBrowser/", - width: "100%", - minWidth: "150px", - layout: "tile", - isResponsive: true, - ajaxAction: (window).baseurl + "api/fileoperation/doJSONAction" - }); - }); -} - - - - -module GanttComponent { - $(function () { - var ganttInstance = new ej.Gantt($("#GanttContainer"), { - dataSource: (window).projectData, - allowColumnResize: true, - allowSorting: true, - allowSelection: true, - enableContextMenu: true, - taskIdMapping: "taskID", - allowDragAndDrop: true, - taskNameMapping: "taskName", - startDateMapping: "startDate", - showColumnChooser: true, - showColumnOptions: true, - progressMapping: "progress", - durationMapping: "duration", - endDateMapping: "endDate", - childMapping: "subtasks", - scheduleStartDate: "02/01/2014", - scheduleEndDate: "04/09/2014", - //Resources mapping - resourceInfoMapping: "resourceId", - resourceNameMapping: "resourceName", - resourceIdMapping: "resourceId", - resources: (window).projectResources, - predecessorMapping: "predecessor", - showResourceNames: true, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add","edit","delete","update","cancel","indent","outdent","expandAll","collapseAll","search"] - }, - editSettings: { - allowEditing: true, - allowAdding: true, - allowDeleting: true, - allowIndent: true, - editMode: "cellEditing" - }, - sizeSettings: { - width: "100%", - height: "100%" - }, - dragTooltip: { showTooltip: true }, - showGridCellTooltip: true, - treeColumnIndex: 1, - isResponsive: true, - }); -}); -} - - - -module GridComponent { - $(function () { - var gridInstance = new ej.Grid($("#Grid"), { - dataSource: (window).gridData, - allowGrouping: true, - allowSorting: true, - allowMultiSorting: true, - enableAltRow: true, - allowPaging: true, - allowReordering: true, - allowResizing: true, - allowFiltering: true, - allowScrolling: true, - enableRowHover: true, - selectionType: "multiple", - selectionSettings: { enableToggle: true, selectionMode: ["row", "cell", "column"] }, - allowKeyboardNavigation: true, - editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, allowEditOnDblClick: true, showDeleteConfirmDialog: true }, - toolbarSettings: { showToolbar: true, toolbarItems: ["add", "edit", "delete", "update", "cancel", "search"] }, - columns: [ - { field: "OrderID", headerText: "Order ID", isPrimaryKey: true, width: 75, textAlign: ej.TextAlign.Right }, - { field: "CustomerID", headerText: "Customer ID", editType: ej.Grid.EditingType.String, width: 80 }, - { field: "EmployeeID", headerText: "Employee ID", width: 75, editType: ej.Grid.EditingType.Dropdown, textAlign: ej.TextAlign.Right, priority: 4 }, - { field: "Freight", width: 75, format: "{0:C}", editType: ej.Grid.EditingType.Numeric, textAlign: ej.TextAlign.Right, priority: 3 }, - { field: "OrderDate", headerText: "Order Date", width: 80, format: "{0:MM/dd/yyyy}", textAlign: ej.TextAlign.Right, priority: 2 }, - { field: "ShipCity", headerText: "Ship City", editType: ej.Grid.EditingType.Dropdown, width: 110, priority: 2 } - ], - isResponsive: true, - minWidth: 700, - showSummary: true, - summaryRows: [{ title: "Sum", summaryColumns: [{ summaryType: ej.Grid.SummaryType.Sum, displayColumn: "Freight", dataMember: "Freight", format: "{0:C2}" }] }] - }); - }); -} - - - -var columns = ["Vegie-spread", "Tofuaa", "Alice Mutton", "Konbu", "Fløtemysost"] -var itemSource: any[] = []; -for (var i = 0; i < columns.length; i++) { - for (var j = 0; j < 6; j++) { - var value = Math.floor((Math.random() * 100) + 1); - itemSource.push({ ProductName: columns[i], Year: "Y" + (2011 + j), Value: value }) - } -} - -$(function () { - var heatmap = new ej.datavisualization.HeatMap($("#heatmap"), { - colorMappingCollection: [ - { value: 0, color: "#8ec8f8", label: { text: "0" } }, - { value: 100, color: "#0d47a1", label: { text: "100" } } - ], - isResponsive: true, - itemsSource: itemSource, - width: "100%", - itemsMapping: { - column: { propertyName: "ProductName", displayName: "Product Name" }, - row: { propertyName: "Year", displayName: "Year" }, - value: { propertyName: "Value" }, - columnMapping: [ - { "propertyName": columns[0], "displayName": columns[0] }, - { "propertyName": columns[1], "displayName": columns[1] }, - { "propertyName": columns[2], "displayName": columns[2] }, - { "propertyName": columns[3], "displayName": columns[3] }, - { "propertyName": columns[4], "displayName": columns[4] }, - { "propertyName": columns[5], "displayName": columns[5] } - ], - headerMapping: { propertyName: "Year", displayName: "Year", columnStyle: { width: 105, textAlign: "right" } }, - }, - legendCollection: ["heatmap_legend"] - }); - var heatmaplegend = new ej.datavisualization.HeatMapLegend($("#heatmap_legend"), { - colorMappingCollection: [ - { value: 0, color: "#8ec8f8", label: { text: "0" } }, - { value: 100, color: "#0d47a1", label: { text: "100" } } - ], - height: "50px", - width: "75%", - isResponsive: true - }); -}); - - - - -declare var window:myWindow; -export interface myWindow extends Window{ -kanbanData:any; -} -module KanbanComponent { - $(function () { - var sample = new ej.Kanban($("#Kanban"), { - dataSource: new ej.DataManager(window["kanbanData"]).executeLocal(new ej.Query().take(20)), - columns: [ - { headerText: "Backlog", key: "Open" }, - { headerText: "In Progress", key: "InProgress" }, - { headerText: "Testing", key: "Testing" }, - { headerText: "Done", key: "Close" } - ], - keyField: "Status", - allowTitle: true, - fields: { - content: "Summary", - primaryKey: "Id", - imageUrl: "ImgUrl" - }, - allowSelection: false - }); - }); -} - - - - -module lineargaugecomponent { - $(function () { - var linearsample = new ej.datavisualization.LinearGauge($("#LinearGauge"), { - labelColor: "#8c8c8c", width: 500, - isResponsive: true, enableAnimation: false, - scales: [{ - width: 4, border: { color: "transparent", width: 0 }, showBarPointers: false, showRanges: true, length: 310, - position: { x: 52, y: 50 }, markerPointers: [{ - value: 50, length: 10, width: 10, backgroundColor: "#4D4D4D", border: { color: "#4D4D4D" } - }], - labels: [{ font: { size: "11px", fontFamily: "Segoe UI", fontStyle: "bold" }, distanceFromScale: { x: -13 } }], - ticks: [{ type: "majorinterval", width: 1, color: "#8c8c8c" }], - ranges: [{ - endValue: 60, - startValue: 0, - backgroundColor: "#F6B53F", - border: { color: "#F6B53F" }, startWidth: 4, endWidth: 4 - }, { - endValue: 100, - startValue: 60, - backgroundColor: "#E94649", - border: { color: "#E94649" }, startWidth: 4, endWidth: 4 - }] - }] - }); - }); -} - - - - - -module ListBoxComponent { - $(function () { - var listboxInstance = new ej.ListBox($("#selectcar"), { - showCheckbox: true - }); - }); -} - - - -module ListviewComponent { - $(function () { - var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, - width: 400 - }); - }); -} - - -var world_map= - { - "type": "FeatureCollection", - "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, - "features": [ - { "type": "Feature", "properties": { "admin": "Afghanistan", "name": "Afghanistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[61.21081709172573, 35.650072333309218], [62.230651483005879, 35.270663967422287], [62.984662306576588, 35.404040839167614], [63.193538445900337, 35.857165635718907], [63.982895949158696, 36.007957465146596], [64.546479119733888, 36.31207326918426], [64.746105177677393, 37.111817735333297], [65.588947788357828, 37.305216783185628], [65.745630731066811, 37.661164048812061], [66.217384881459324, 37.393790188133913], [66.518606805288655, 37.362784328758785], [67.075782098259609, 37.35614390720928], [67.829999627559502, 37.144994004864678], [68.135562371701369, 37.023115139304302], [68.859445835245921, 37.344335842430588], [69.196272820924364, 37.15114350030742], [69.518785434857946, 37.608996690413413], [70.116578403610319, 37.588222764632086], [70.270574171840124, 37.73516469985401], [70.376304152309274, 38.138395901027515], [70.806820509732873, 38.486281643216408], [71.348131137990251, 38.258905341132156], [71.239403924448155, 37.953265082341879], [71.541917759084768, 37.905774441065631], [71.448693475230229, 37.065644843080513], [71.84463829945058, 36.738171291646914], [72.193040805962383, 36.94828766534566], [72.636889682917271, 37.047558091778349], [73.260055779924983, 37.495256862938994], [73.948695916646486, 37.421566270490786], [74.980002475895404, 37.419990139305888], [75.158027785140902, 37.13303091078911], [74.575892775372964, 37.02084137628345], [74.067551710917812, 36.836175645488446], [72.920024855444453, 36.720007025696312], [71.846291945283909, 36.509942328429851], [71.262348260385735, 36.074387518857797], [71.498767938121077, 35.650563259415996], [71.613076206350698, 35.153203436822857], [71.115018751921625, 34.733125718722228], [71.156773309213449, 34.348911444632144], [70.881803012988385, 33.988855902638512], [69.93054324735958, 34.020120144175102], [70.323594191371583, 33.358532619758385], [69.687147251264847, 33.105498969041228], [69.262522007122541, 32.501944078088293], [69.317764113242546, 31.901412258424436], [68.926676873657655, 31.620189113892064], [68.556932000609308, 31.713310044882011], [67.792689243444769, 31.582930406209623], [67.683393589147457, 31.303154201781414], [66.938891229118454, 31.304911200479346], [66.38145755398601, 30.738899237586448], [66.346472609324408, 29.88794342703617], [65.046862013616092, 29.472180691031902], [64.350418735618504, 29.560030625928089], [64.148002150331237, 29.340819200145965], [63.550260858011164, 29.468330796826162], [62.549856805272775, 29.318572496044304], [60.874248488208778, 29.829238999952604], [61.78122155136343, 30.735850328081231], [61.699314406180811, 31.379506130492661], [60.941944614511115, 31.548074652628745], [60.863654819588952, 32.182919623334421], [60.536077915290761, 32.981268825811561], [60.963700392505991, 33.528832302376252], [60.528429803311575, 33.676446031217999], [60.80319339380744, 34.404101874319856], [61.21081709172573, 35.650072333309218]]] } }, - { "type": "Feature", "properties": { "admin": "Angola", "name": "Angola", "continent": "Africa" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[16.326528354567042, -5.877470391466217], [16.573179965896141, -6.622644545115092], [16.860190870845226, -7.222297865429978], [17.089995965247166, -7.545688978712474], [17.472970004962288, -8.068551120641656], [18.134221632569048, -7.987677504104865], [18.464175652752683, -7.847014255406475], [19.016751743249664, -7.988245944860138], [19.166613396896079, -7.738183688999724], [19.417502475673214, -7.155428562044277], [20.037723016040214, -7.116361179231658], [20.091621534920616, -6.943090101756949], [20.60182295093832, -6.939317722199688], [20.514748162526526, -7.299605808138663], [21.728110792739752, -7.290872491081315], [21.74645592620336, -7.920084730667113], [21.949130893652033, -8.305900974158304], [21.80180138518795, -8.908706556842985], [21.875181919042397, -9.523707777548564], [22.208753289486417, -9.894796237836529], [22.155268182064326, -11.084801120653777], [22.402798292742428, -10.99307545333569], [22.837345411884762, -11.017621758674334], [23.456790805767461, -10.867863457892481], [23.912215203555743, -10.926826267137541], [24.017893507592614, -11.237298272347115], [23.904153680118235, -11.722281589406332], [24.079905226342895, -12.191296888887305], [23.930922072045373, -12.565847670138821], [24.0161365088947, -12.91104623784855], [21.933886346125941, -12.898437188369353], [21.887842644953871, -16.080310153876891], [22.562478468524283, -16.898451429921831], [23.215048455506086, -17.523116143465952], [21.377176141045592, -17.930636488519706], [18.956186964603628, -17.789094740472233], [18.263309360434217, -17.309950860262003], [14.209706658595049, -17.353100681225708], [14.058501417709035, -17.423380629142653], [13.462362094789963, -16.971211846588741], [12.814081251688405, -16.941342868724075], [12.21546146001938, -17.111668389558059], [11.734198846085146, -17.301889336824498], [11.640096062881609, -16.673142185129205], [11.778537224991563, -15.793816013250687], [12.123580763404444, -14.878316338767927], [12.175618930722264, -14.449143568583889], [12.500095249083014, -13.547699883684398], [12.738478631245439, -13.137905775609934], [13.312913852601834, -12.483630466362511], [13.633721144269824, -12.038644707897189], [13.738727654686924, -11.297863050993142], [13.686379428775293, -10.73107594161584], [13.38732791510216, -10.373578383020726], [13.120987583069873, -9.766897067914112], [12.875369500386567, -9.166933689005488], [12.929061313537797, -8.959091078327573], [13.23643273280987, -8.56262948978434], [12.933040398824314, -7.596538588087752], [12.728298374083916, -6.927122084178803], [12.227347039446441, -6.294447523629372], [12.322431674863562, -6.100092461779651], [12.735171339578695, -5.965682061388476], [13.024869419006988, -5.984388929878106], [13.375597364971892, -5.864241224799555], [16.326528354567042, -5.877470391466217]]], [[[12.436688266660919, -5.684303887559223], [12.182336866920277, -5.789930515163801], [11.914963006242115, -5.037986748884733], [12.318607618873923, -4.606230157086158], [12.620759718484548, -4.438023369976121], [12.995517205465202, -4.781103203961918], [12.631611769265842, -4.991271254092935], [12.468004184629759, -5.248361504744991], [12.436688266660919, -5.684303887559223]]]] } }, - { "type": "Feature", "properties": { "admin": "Albania", "name": "Albania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.590247430104906, 41.855404161133592], [20.463175083099195, 41.515089016275333], [20.605181919037356, 41.086226304685219], [21.020040317476397, 40.842726955725873], [20.99998986174722, 40.580003973953964], [20.67499677906363, 40.43499990494302], [20.61500044117275, 40.110006822259365], [20.150015903410516, 39.624997666983965], [19.980000441170144, 39.694993394523401], [19.9600016618732, 39.915005805006039], [19.40608198413673, 40.250773423822459], [19.319058872157139, 40.727230129553554], [19.403549838954287, 41.409565741535445], [19.540027296637099, 41.71998607031275], [19.371768833094958, 41.87754751237064], [19.304486118250786, 42.195745144207812], [19.738051385179627, 42.688247382165564], [19.801613396898681, 42.500093492190835], [20.0707, 42.58863], [20.28375451018189, 42.320259507815074], [20.52295, 42.21787], [20.590247430104906, 41.855404161133592]]] } }, - { "type": "Feature", "properties": { "admin": "United Arab Emirates", "name": "United Arab Emirates", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[51.579518670463258, 24.245497137951102], [51.757440626844172, 24.294072984305462], [51.794389275932865, 24.019826158132499], [52.577080519425593, 24.177439276622703], [53.404006788960139, 24.151316840099167], [54.008000929587574, 24.121757920828212], [54.693023716048614, 24.797892360935084], [55.439024692614126, 25.439145209244934], [56.070820753814544, 26.055464178973978], [56.261041701080948, 25.714606431576762], [56.396847365143991, 24.924732163995483], [55.886232537667993, 24.92083059335744], [55.804118686756212, 24.269604193615258], [55.981213820220454, 24.130542914317822], [55.528631626208231, 23.933604030853498], [55.525841098864461, 23.524869289640929], [55.234489373602869, 23.110992743415316], [55.208341098863187, 22.708329982997039], [55.006803012924898, 22.496947536707129], [52.000733270074321, 23.001154486578937], [51.617707553926969, 24.014219265228824], [51.579518670463258, 24.245497137951102]]] } }, - { "type": "Feature", "properties": { "admin": "Argentina", "name": "Argentina", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-65.5, -55.2], [-66.45, -55.25], [-66.95992, -54.89681], [-67.56244, -54.87001], [-68.63335, -54.8695], [-68.634010227583147, -52.636370458874453], [-68.25, -53.1], [-67.75, -53.85], [-66.45, -54.45], [-65.05, -54.7], [-65.5, -55.2]]], [[[-64.964892137294569, -22.075861504812348], [-64.377021043542257, -22.79809132252354], [-63.986838141522462, -21.993644301035953], [-62.84646847192154, -22.034985446869452], [-62.685057135657885, -22.249029229422401], [-60.846564704009928, -23.880712579038299], [-60.028966030503973, -24.032796319273238], [-58.807128465394939, -24.771459242453268], [-57.777217169817952, -25.162339776309032], [-57.633660040911124, -25.603656508081666], [-58.618173590719707, -27.123718763947117], [-57.609759690976134, -27.395898532828419], [-56.486701626192989, -27.548499037386243], [-55.695845506398186, -27.387837009390815], [-54.788794928595038, -26.621785577096087], [-54.625290696823541, -25.739255466415479], [-54.130049607954412, -25.547639255477243], [-53.628348965048716, -26.12486500417743], [-53.648735317587885, -26.923472588816104], [-54.490725267135517, -27.474756768505767], [-55.162286342984586, -27.881915378533414], [-56.290899624239088, -28.852760512000849], [-57.62513342958291, -30.21629485445424], [-57.874937303281897, -31.016556084926158], [-58.14244035504074, -32.044503676076182], [-58.132647671121404, -33.040566908502008], [-58.349611172098818, -33.263188978815428], [-58.427074144104367, -33.909454441057541], [-58.495442064026541, -34.4314897600701], [-57.225829637263629, -35.288026625307886], [-57.362358771378737, -35.977390232081497], [-56.737487352105447, -36.413125909166574], [-56.788285285048339, -36.901571547189327], [-57.749156867083421, -38.183870538079901], [-59.231857062401865, -38.720220228837199], [-61.2374452378656, -38.92842457454114], [-62.335956997310134, -38.827707208004362], [-62.125763108962914, -39.424104913084868], [-62.33053097191943, -40.172586358400316], [-62.145994432205228, -40.676896661136723], [-62.74580278181697, -41.028761488612083], [-63.770494757732514, -41.166789239263657], [-64.732089809819698, -40.802677097335128], [-65.118035244391578, -41.064314874028874], [-64.97856055363583, -42.058000990569312], [-64.303407965742466, -42.359016208669495], [-63.755947842042339, -42.043686618824495], [-63.458059048095883, -42.563138116222355], [-64.378803880456289, -42.873558444999638], [-65.181803961839691, -43.495380954767782], [-65.328823411710133, -44.501366062193689], [-65.565268927661592, -45.03678557716978], [-66.509965786389344, -45.039627780945843], [-67.293793911392427, -45.551896254255183], [-67.580546434180079, -46.301772963242527], [-66.597066413017259, -47.033924655953804], [-65.641026577401433, -47.23613453551188], [-65.98508826360073, -48.133289076531128], [-67.166178961847649, -48.697337334996931], [-67.816087612566449, -49.869668877970412], [-68.728745083273154, -50.26421843851886], [-69.138539191347789, -50.732510267947788], [-68.815561489523517, -51.771104011594097], [-68.149994879820397, -52.349983406127699], [-68.571545376241332, -52.299443855346247], [-69.498362189396076, -52.142760912637236], [-71.914803839796321, -52.009022305865912], [-72.329403856074023, -51.425956312872394], [-72.309973517532342, -50.677009779666342], [-72.975746832964617, -50.741450290734299], [-73.328050910114456, -50.378785088909865], [-73.415435757120022, -49.318436374712952], [-72.648247443314929, -48.878618259476774], [-72.331160854771937, -48.244238376661819], [-72.44735531278026, -47.738532810253517], [-71.917258470330196, -46.884838148791786], [-71.552009446891233, -45.560732924177117], [-71.659315558545316, -44.973688653341434], [-71.222778896759721, -44.784242852559409], [-71.329800788036195, -44.407521661151677], [-71.793622606071935, -44.207172133156099], [-71.464056159130493, -43.787611179378324], [-71.915423956983901, -43.408564548517404], [-72.148898078078517, -42.254888197601375], [-71.746803758415453, -42.051386407235988], [-71.915734015577542, -40.832339369470716], [-71.680761277946445, -39.808164157878061], [-71.413516608349042, -38.916022230791107], [-70.814664272734703, -38.552995293940732], [-71.118625047475419, -37.576827487947192], [-71.121880662709771, -36.65812387466233], [-70.364769253201658, -36.005088799789931], [-70.388049485949082, -35.169687595359441], [-69.817309129501453, -34.193571465798279], [-69.814776984319209, -33.273886000299839], [-70.074399380153622, -33.09120981214803], [-70.535068935819439, -31.365010267870279], [-69.919008348251921, -30.336339206668306], [-70.013550381129861, -29.367922865518544], [-69.656130337183143, -28.459141127233686], [-69.001234910748266, -27.521213881136127], [-68.295541551370391, -26.899339694935787], [-68.594799770772667, -26.50690886811126], [-68.386001146097342, -26.185016371365229], [-68.417652960876111, -24.518554782816874], [-67.328442959244128, -24.025303236590908], [-66.985233934177629, -22.986348565362825], [-67.106673550063604, -22.735924574476392], [-66.273339402924833, -21.832310479420677], [-64.964892137294569, -22.075861504812348]]]] } }, - { "type": "Feature", "properties": { "admin": "Armenia", "name": "Armenia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[43.582745802592726, 41.09214325618256], [44.972480096218071, 41.248128567055588], [45.179495883979335, 40.985353908851401], [45.560351189970433, 40.812289537105919], [45.359174839058156, 40.561503811193447], [45.891907179555076, 40.218475653639992], [45.610012241402913, 39.899993801425175], [46.034534132680662, 39.628020738273058], [46.483498976432443, 39.464154771475528], [46.505719842317966, 38.770605373686287], [46.143623081248812, 38.74120148371221], [45.735379266143006, 39.319719143219736], [45.739978468616975, 39.473999131827114], [45.298144972521456, 39.471751207022422], [45.00198733905674, 39.740003567049548], [44.793989699081934, 39.713002631177041], [44.400008579288695, 40.005000311842267], [43.656436395040934, 40.253563951166178], [43.752657911968399, 40.740200914058754], [43.582745802592726, 41.09214325618256]]] } }, - { "type": "Feature", "properties": { "admin": "French Southern and Antarctic Lands", "name": "Fr. S. Antarctic Lands", "continent": "Seven seas (open ocean)" }, "geometry": { "type": "Polygon", "coordinates": [[[68.935, -48.625], [69.58, -48.94], [70.525, -49.065], [70.56, -49.255], [70.28, -49.71], [68.745, -49.775], [68.72, -49.2425], [68.8675, -48.83], [68.935, -48.625]]] } }, - { "type": "Feature", "properties": { "admin": "Australia", "name": "Australia", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[145.397978143494782, -40.792548516605883], [146.364120721623692, -41.137695407883335], [146.908583612250823, -41.000546156580668], [147.689259474884125, -40.808258152022681], [148.289067824495987, -40.875437514002122], [148.359864536735785, -42.062445163746439], [148.017301467073082, -42.40702361426861], [147.914051955353784, -43.211522312188485], [147.564564243763982, -42.937688897473855], [146.87034305235494, -43.634597263362082], [146.663327264593647, -43.580853773778543], [146.048377720320389, -43.54974456153888], [145.431929559510536, -42.693776137056268], [145.295090366801674, -42.03360971452755], [144.7180713238306, -41.162551771815707], [144.743754510679622, -40.703975111657705], [145.397978143494782, -40.792548516605883]]], [[[143.561811151299935, -13.763655694232209], [143.922099237238882, -14.548310642152], [144.563713820574804, -14.171176039285879], [144.894908075133515, -14.594457696188622], [145.374723748963419, -14.984976495018284], [145.271991001567244, -15.428205254785691], [145.48525963763575, -16.285672295804769], [145.637033319276952, -16.784918308176611], [145.888904250267672, -16.906926364817647], [146.160308872664473, -17.76165455492524], [146.063673944278662, -18.280072523677315], [146.387478469019584, -18.958274021075905], [147.471081577747896, -19.480722751546676], [148.177601760042478, -19.955939222902767], [148.848413527623222, -20.391209812097252], [148.717465448195583, -20.633468926681513], [149.289420200802056, -21.260510756111096], [149.678337030230637, -22.342511895438388], [150.07738244038859, -22.122783705333315], [150.482939081015161, -22.556142266533012], [150.727265252891158, -22.402404880464655], [150.899554478152254, -23.462236830338679], [151.609175246384211, -24.076256198830755], [152.07353966695905, -24.45788665130619], [152.855197381805908, -25.267501316023008], [153.136162144176751, -26.071173191026187], [153.161948683890358, -26.641319268502439], [153.09290897034856, -27.260299574494503], [153.569469028944184, -28.110066827102099], [153.512108189100218, -28.995077406532751], [153.339095493787056, -29.458201592732443], [153.069241164358857, -30.350240166954809], [153.089601678681788, -30.923641859665445], [152.891577590139377, -31.640445651985949], [152.450002476205327, -32.550002536755237], [151.709117466436766, -33.041342054986337], [151.343971795862387, -33.816023451473846], [151.010555454715103, -34.310360202777879], [150.714139439089024, -35.173459974916803], [150.328219842733233, -35.671879164371923], [150.075212030232251, -36.420205580390508], [149.946124302367139, -37.109052422841224], [149.997283970336127, -37.425260512035123], [149.423882277625523, -37.772681166333463], [148.304622430615893, -37.809061374666875], [147.38173302631526, -38.219217217767543], [146.922122837511324, -38.606532077795116], [146.317921991154776, -39.035756524411433], [145.489652134380549, -38.593767999019043], [144.876976353128157, -38.41744801203911], [145.032212355732952, -37.896187839510972], [144.485682407814011, -38.085323581699257], [143.609973586196077, -38.809465427405321], [142.745426873952965, -38.538267510737519], [142.17832970598198, -38.380034275059835], [141.606581659104677, -38.308514092767872], [140.638578729413211, -38.019332777662541], [139.992158237874321, -37.402936293285094], [139.806588169514043, -36.643602797188272], [139.574147577065219, -36.138362318670666], [139.082808058834075, -35.732754001611774], [138.120747918856296, -35.612296237939397], [138.449461704664998, -35.127261244447887], [138.207564325106659, -34.384722588845925], [137.719170363516128, -35.07682504653102], [136.829405552314711, -35.260534763328614], [137.352371047108477, -34.707338555644093], [137.503886346588331, -34.130267836240769], [137.890116001537649, -33.640478610978327], [137.810327590079112, -32.900007012668105], [136.996837192940347, -33.752771498348629], [136.372069126531642, -34.094766127256186], [135.98904341038434, -34.89011809666048], [135.208212518454104, -34.478670342752601], [135.239218377829161, -33.947953383114971], [134.613416782774607, -33.222778008763136], [134.085903761939107, -32.848072198214759], [134.273902622617015, -32.617233575166949], [132.990776808809812, -32.011224053680188], [132.288080682504869, -31.982646986622761], [131.326330601120901, -31.495803318001041], [129.535793898639668, -31.590422865527476], [128.240937534702198, -31.948488864877849], [127.102867466338282, -32.282266941051041], [126.148713820501129, -32.2159660784206], [125.088623488465586, -32.728751316052829], [124.22164798390493, -32.959486586236061], [124.028946567888511, -33.483847344701708], [123.65966678273071, -33.890179131812722], [122.811036411633609, -33.914467054989835], [122.18306440642283, -34.003402194964217], [121.299190708502579, -33.821036065406126], [120.580268182458113, -33.930176690406618], [119.893695103028222, -33.976065362281808], [119.298899367348781, -34.50936614353396], [119.007340936357977, -34.464149265278529], [118.505717808100769, -34.746819349915093], [118.024971958489516, -35.064732761374707], [117.295507440257438, -35.025458672832862], [116.62510908413492, -35.025096937806829], [115.564346958479689, -34.386427911111547], [115.026808709779516, -34.196517022438918], [115.048616164206763, -33.623425388322026], [115.545123325667078, -33.487257989232951], [115.714673700016661, -33.259571628554944], [115.679378696761376, -32.900368747694124], [115.801645135563959, -32.205062351207026], [115.689610630355105, -31.612437025683782], [115.160909051576937, -30.601594333622455], [114.99704308477942, -30.030724786094162], [115.040037876446249, -29.461095472940794], [114.64197431850198, -28.810230808224706], [114.61649783738217, -28.516398614213042], [114.173579136208446, -28.118076674107321], [114.048883905088132, -27.33476531342712], [113.477497593236876, -26.543134047147898], [113.338953078262477, -26.116545098578477], [113.77835778204026, -26.549025160429174], [113.440962355606587, -25.621278171493152], [113.936901076311642, -25.911234633082877], [114.232852004047288, -26.298446140245868], [114.216160516417006, -25.786281019801105], [113.721255324357685, -24.998938897402123], [113.625343866024025, -24.683971042583146], [113.393523390762667, -24.384764499613262], [113.502043898575607, -23.80635019297025], [113.706992629045146, -23.56021534596406], [113.843418410295669, -23.059987481378734], [113.736551548316072, -22.475475355725372], [114.149756300921865, -21.755881036061009], [114.225307244932651, -22.51748829517863], [114.64776207891866, -21.829519952076904], [115.460167270979298, -21.495173435148541], [115.94737267462699, -21.068687839443708], [116.711615431791529, -20.701681817306817], [117.166316359527684, -20.623598728113802], [117.441545037914238, -20.746898695562162], [118.229558953932951, -20.374208265873232], [118.836085239742701, -20.263310642174822], [118.987807244951753, -20.044202569257319], [119.252493931150624, -19.952941989829835], [119.805225050944543, -19.976506442954978], [120.856220330896633, -19.683707777589188], [121.399856398607199, -19.239755547769729], [121.655137974129062, -18.70531788500713], [122.241665480641757, -18.197648614171765], [122.286623976735655, -17.798603204013911], [122.312772251475408, -17.254967136303446], [123.012574497571904, -16.405199883695854], [123.433789097183009, -17.268558037996225], [123.859344517106592, -17.069035332917249], [123.503242222183232, -16.596506036040363], [123.817073195491915, -16.11131601325199], [124.258286574399847, -16.32794361741956], [124.379726190285794, -15.567059828353973], [124.926152785340022, -15.07510019293532], [125.167275018413875, -14.680395603090004], [125.670086704613823, -14.510070082256018], [125.685796340030493, -14.230655612853834], [126.125149367376096, -14.347340996968949], [126.142822707219864, -14.095986830301211], [126.582589146023736, -13.95279143642041], [127.065867140817332, -13.817967624570922], [127.804633416861932, -14.276906019755042], [128.359689976108939, -14.869169610252253], [128.985543247595899, -14.875990899314738], [129.621473423379598, -14.969783623924553], [129.409600050982988, -14.420669854391031], [129.888640578328591, -13.618703301653481], [130.339465773642928, -13.357375583553473], [130.183506300985982, -13.107520033422301], [130.617795037966971, -12.536392103732464], [131.223494500859999, -12.183648776908113], [131.73509118054946, -12.302452894747159], [132.575298293183096, -12.114040622611013], [132.557211541881031, -11.603012383676683], [131.824698114143644, -11.273781833545097], [132.357223748911395, -11.128519382372641], [133.019560581596409, -11.376411228076844], [133.550845981989028, -11.786515394745134], [134.393068475481982, -12.042365411022173], [134.678632440327021, -11.9411829565947], [135.298491245667975, -12.248606052299051], [135.882693312727611, -11.962266940969796], [136.258380975489445, -12.049341729381606], [136.492475213771627, -11.857208754120389], [136.951620314684988, -12.351958916882735], [136.685124953355739, -12.887223402562054], [136.305406528875096, -13.291229750219895], [135.961758254134111, -13.324509372615889], [136.077616815332533, -13.72427825282578], [135.783836297753226, -14.223989353088211], [135.4286641786112, -14.715432224183896], [135.500184360903177, -14.997740573794427], [136.295174595281367, -15.550264987859121], [137.065360142159477, -15.870762220933353], [137.580470819244795, -16.215082289294084], [138.303217401278971, -16.807604261952658], [138.58516401586337, -16.806622409739173], [139.108542922115475, -17.062679131745366], [139.260574985918197, -17.371600843986183], [140.215245396078274, -17.710804945550063], [140.875463495039241, -17.36906869880394], [141.071110467696258, -16.832047214426719], [141.274095493738798, -16.388870131091604], [141.398222284103781, -15.840531508042584], [141.702183058844611, -15.044921156476928], [141.563380161708665, -14.561333103089506], [141.635520461188094, -14.270394789286284], [141.519868605718955, -13.698078301653805], [141.650920038011009, -12.944687595270562], [141.842691278246207, -12.741547539931187], [141.68699018775078, -12.407614434461134], [141.928629185147543, -11.877465915578778], [142.118488397387978, -11.328042087451619], [142.14370649634634, -11.04273650476814], [142.51526004452495, -10.668185723516642], [142.797310011974048, -11.157354831591515], [142.866763136974271, -11.784706719614929], [143.11594689348567, -11.90562957117791], [143.158631626558758, -12.325655612846187], [143.522123651299864, -12.834358412327429], [143.597157830987669, -13.400422051652594], [143.561811151299935, -13.763655694232209]]]] } }, - { "type": "Feature", "properties": { "admin": "Austria", "name": "Austria", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.979666782304033, 48.123497015976298], [16.903754103267257, 47.714865627628321], [16.340584344150411, 47.712901923201215], [16.534267612380372, 47.496170966169103], [16.202298211337361, 46.852385972676949], [16.011663852612653, 46.683610744811688], [15.137091912504982, 46.658702704447016], [14.632471551174827, 46.431817328469535], [13.806475457421524, 46.509306138691201], [12.376485223040813, 46.767559109069843], [12.153088006243051, 47.115393174826437], [11.164827915093268, 46.941579494812721], [11.048555942436533, 46.751358547546324], [10.442701450246627, 46.893546250997424], [9.932448357796657, 46.920728054382948], [9.479969516649019, 47.102809963563367], [9.632931756232974, 47.347601223329974], [9.594226108446346, 47.525058091820256], [9.896068149463188, 47.58019684507569], [10.402083774465209, 47.302487697939156], [10.544504021861625, 47.566399237653762], [11.426414015354736, 47.523766181012967], [12.141357456112784, 47.703083401065761], [12.620759718484491, 47.672387600284395], [12.932626987365945, 47.467645575543983], [13.025851271220487, 47.637583523135824], [12.884102817443901, 48.289145819687903], [13.243357374736998, 48.41611481382904], [13.595945672264433, 48.877171942737135], [14.33889773932472, 48.555305284207193], [14.901447381254055, 48.964401760445817], [15.253415561593979, 49.039074205107575], [16.029647251050218, 48.733899034207916], [16.49928266771877, 48.785808010445095], [16.960288120194573, 48.596982326850593], [16.879982944412998, 48.470013332709463], [16.979666782304033, 48.123497015976298]]] } }, - { "type": "Feature", "properties": { "admin": "Azerbaijan", "name": "Azerbaijan", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[45.001987339056789, 39.740003567049591], [45.298144972521435, 39.471751207022422], [45.739978468616997, 39.473999131827149], [45.735379266143092, 39.319719143219785], [46.143623081248812, 38.74120148371221], [45.457721795438729, 38.874139105783108], [44.952688022650264, 39.33576467544642], [44.79398969908199, 39.713002631177027], [45.001987339056789, 39.740003567049591]]], [[[47.373315464066216, 41.219732367511249], [47.81566572448471, 41.151416124021338], [47.987283156126033, 41.405819200194223], [48.584352654826283, 41.808869533854669], [49.110263706260653, 41.282286688800518], [49.618914829309588, 40.572924302729966], [50.084829542853093, 40.526157131505776], [50.392821079312704, 40.256561184239096], [49.569202101444795, 40.176100979160701], [49.395259230350419, 39.39948171646224], [49.2232283872507, 39.04921885838791], [48.856532423707584, 38.815486355131775], [48.883249139202533, 38.320245266262638], [48.634375441284831, 38.270377509100925], [48.010744256386502, 38.794014797514528], [48.355529412637928, 39.288764960276886], [48.060095249225256, 39.582235419262439], [47.685079380083117, 39.508363959301185], [46.505719842317966, 38.770605373686251], [46.483498976432443, 39.464154771475528], [46.034534132680697, 39.628020738273044], [45.610012241402913, 39.899993801425175], [45.891907179555133, 40.21847565363997], [45.359174839058156, 40.561503811193482], [45.560351189970469, 40.812289537105947], [45.179495883979392, 40.98535390885143], [44.972480096218156, 41.248128567055623], [45.217426385281634, 41.411451931314041], [45.962600538930438, 41.123872585609789], [46.501637404166978, 41.064444688474104], [46.637908156120567, 41.181672675128219], [46.145431756378983, 41.72280243587263], [46.404950799348818, 41.860675157227341], [46.686070591016652, 41.827137152669899], [47.373315464066216, 41.219732367511249]]]] } }, - { "type": "Feature", "properties": { "admin": "Burundi", "name": "Burundi", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[29.339997592900342, -4.499983412294092], [29.276383904749046, -3.293907159034063], [29.02492638521678, -2.839257907730157], [29.632176141078585, -2.917857761246096], [29.938359002407935, -2.348486830254238], [30.469696079232978, -2.413857517103458], [30.527677036264457, -2.807631931167534], [30.743012729624692, -3.034284763199686], [30.752262811004943, -3.359329522315569], [30.505559523243559, -3.568567396665364], [30.116332635221166, -4.090137627787242], [29.753512404099919, -4.45238941815328], [29.339997592900342, -4.499983412294092]]] } }, - { "type": "Feature", "properties": { "admin": "Belgium", "name": "Belgium", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[3.314971144228536, 51.345780951536071], [4.047071160507527, 51.267258612668556], [4.973991326526913, 51.475023708698124], [5.60697594567, 51.037298488969768], [6.156658155958779, 50.803721015010574], [6.043073357781109, 50.128051662794221], [5.782417433300905, 50.090327867221205], [5.674051954784828, 49.52948354755749], [4.799221632515809, 49.985373033236371], [4.286022983425084, 49.90749664977254], [3.588184441755685, 50.378992418003563], [3.123251580425801, 50.780363267614561], [2.658422071960274, 50.796848049515731], [2.513573032246142, 51.148506171261815], [3.314971144228536, 51.345780951536071]]] } }, - { "type": "Feature", "properties": { "admin": "Benin", "name": "Benin", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[2.691701694356254, 6.258817246928628], [1.865240512712318, 6.14215770102973], [1.618950636409238, 6.832038072126236], [1.664477573258381, 9.128590399609378], [1.46304284018467, 9.334624335157086], [1.425060662450136, 9.825395412632998], [1.077795037448737, 10.175606594275022], [0.772335646171484, 10.470808213742357], [0.899563022474069, 10.997339382364258], [1.243469679376488, 11.11051076908346], [1.447178175471066, 11.547719224488857], [1.93598554851988, 11.641150214072551], [2.154473504249921, 11.940150051313337], [2.49016360841793, 12.233052069543671], [2.84864301922667, 12.235635891158266], [3.611180454125558, 11.660167141155966], [3.572216424177469, 11.327939357951516], [3.797112257511713, 10.734745591673104], [3.600070021182801, 10.332186184119406], [3.705438266625918, 10.063210354040207], [3.220351596702101, 9.4441525333997], [2.912308383810255, 9.13760793704432], [2.723792758809509, 8.506845404489708], [2.74906253420022, 7.870734361192886], [2.691701694356254, 6.258817246928628]]] } }, - { "type": "Feature", "properties": { "admin": "Burkina Faso", "name": "Burkina Faso", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.827496303712706, 9.642460842319775], [-3.511898972986272, 9.900326239456216], [-3.980449184576684, 9.862344061721698], [-4.330246954760383, 9.610834865757139], [-4.779883592131966, 9.821984768101741], [-4.954653286143098, 10.152713934769732], [-5.404341599946973, 10.370736802609144], [-5.470564947929004, 10.951269842976044], [-5.197842576508648, 11.375145778850136], [-5.220941941743119, 11.713858954307224], [-4.427166103523802, 12.542645575404292], [-4.280405035814879, 13.228443508349738], [-4.006390753587225, 13.472485459848112], [-3.52280270019986, 13.337661647998612], [-3.103706834312759, 13.54126679122859], [-2.967694464520576, 13.798150336151506], [-2.191824510090384, 14.246417548067352], [-2.001035122068771, 14.559008287000887], [-1.066363491205663, 14.973815009007764], [-0.515854458000348, 15.116157741755725], [-0.26625729003058, 14.924308986872147], [0.374892205414682, 14.928908189346128], [0.295646396495101, 14.444234930880651], [0.429927605805517, 13.988733018443922], [0.993045688490071, 13.335749620003821], [1.024103224297477, 12.851825669806573], [2.177107781593775, 12.625017808477532], [2.154473504249921, 11.940150051313337], [1.93598554851988, 11.641150214072551], [1.447178175471066, 11.547719224488857], [1.243469679376488, 11.11051076908346], [0.899563022474069, 10.997339382364258], [0.023802524423701, 11.018681748900802], [-0.438701544588582, 11.09834096927872], [-0.761575893548183, 10.936929633015053], [-1.203357713211431, 11.009819240762736], [-2.94040930827046, 10.962690334512557], [-2.963896246747111, 10.395334784380081], [-2.827496303712706, 9.642460842319775]]] } }, - { "type": "Feature", "properties": { "admin": "Bangladesh", "name": "Bangladesh", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[92.672720981825549, 22.041238918541247], [92.652257114637976, 21.324047552978481], [92.30323449093865, 21.475485337809815], [92.368553501355606, 20.670883287025344], [92.082886183646124, 21.192195135985767], [92.025215285208361, 21.701569729086764], [91.834890985077408, 22.182935695885561], [91.417087029997646, 22.765019029221218], [90.496006300827247, 22.805016587815125], [90.586956821660948, 22.392793687422863], [90.272970819055544, 21.836367702720107], [89.847467075564268, 22.039146023033421], [89.70204959509492, 21.857115790285299], [89.41886274613546, 21.966178900637296], [89.031961297566198, 22.055708319582973], [88.876311883503064, 22.879146429937826], [88.529769728553759, 23.631141872649163], [88.699940220090895, 24.233714911388557], [88.084422235062405, 24.501657212821918], [88.30637251175601, 24.866079413344199], [88.931553989623069, 25.238692328384769], [88.209789259802477, 25.768065700782707], [88.56304935094974, 26.446525580342716], [89.355094028687276, 26.014407253518065], [89.832480910199592, 25.965082098895476], [89.920692580121838, 25.269749864192171], [90.872210727912105, 25.13260061288954], [91.799595981822065, 25.14743174895731], [92.376201613334786, 24.976692816664961], [91.915092807994398, 24.130413723237108], [91.467729933643668, 24.072639471934789], [91.158963250699713, 23.503526923104381], [91.706475050832083, 22.985263983649183], [91.869927606171302, 23.62434642180278], [92.146034783906799, 23.62749868417259], [92.672720981825549, 22.041238918541247]]] } }, - { "type": "Feature", "properties": { "admin": "Bulgaria", "name": "Bulgaria", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.657149692482985, 44.234923000661276], [22.94483239105184, 43.823785305347123], [23.332302280376322, 43.897010809904707], [24.100679152124169, 43.741051337247846], [25.569271681426923, 43.688444729174712], [26.065158725699739, 43.943493760751259], [27.242399529740904, 44.175986029632398], [27.970107049275068, 43.812468166675202], [28.55808149589199, 43.707461656258118], [28.039095086384712, 43.293171698574177], [27.673897739378042, 42.577892361006214], [27.996720411905383, 42.007358710287775], [27.135739373490473, 42.141484890301335], [26.117041863720793, 41.826904608724554], [26.106138136507205, 41.328898830727766], [25.197201368925441, 41.234485988930523], [24.492644891058031, 41.583896185872028], [23.692073601992345, 41.309080918943842], [22.952377150166445, 41.337993882811141], [22.881373732197424, 41.999297186850242], [22.380525750424585, 42.320259507815081], [22.545011834409614, 42.461362006188025], [22.436594679461273, 42.580321153323929], [22.604801466571324, 42.898518785161137], [22.986018507588479, 43.211161200526959], [22.500156691180276, 43.642814439460977], [22.410446404721593, 44.008063462899948], [22.657149692482985, 44.234923000661276]]] } }, - { "type": "Feature", "properties": { "admin": "The Bahamas", "name": "Bahamas", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-77.53466, 23.75975], [-77.78, 23.71], [-78.03405, 24.28615], [-78.40848, 24.57564], [-78.19087, 25.2103], [-77.89, 25.17], [-77.54, 24.34], [-77.53466, 23.75975]]], [[[-77.82, 26.58], [-78.91, 26.42], [-78.98, 26.79], [-78.51, 26.87], [-77.85, 26.84], [-77.82, 26.58]]], [[[-77.0, 26.59], [-77.17255, 25.87918], [-77.35641, 26.00735], [-77.34, 26.53], [-77.78802, 26.92516], [-77.79, 27.04], [-77.0, 26.59]]]] } }, - { "type": "Feature", "properties": { "admin": "Bosnia and Herzegovina", "name": "Bosnia and Herz.", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[19.005486281010118, 44.860233669609144], [19.36803, 44.863], [19.11761, 44.42307], [19.59976, 44.03847], [19.454, 43.568100000000115], [19.21852, 43.52384], [19.03165, 43.43253], [18.70648, 43.20011], [18.56, 42.65], [17.674921502358981, 43.028562527023603], [17.297373488034449, 43.446340643887353], [16.916156447017325, 43.667722479825663], [16.456442905348862, 44.041239732431265], [16.239660271884528, 44.351143296885695], [15.750026075918978, 44.81871165626255], [15.959367303133373, 45.233776760430935], [16.318156772535868, 45.004126695325901], [16.534939406000202, 45.211607570977705], [17.00214603035101, 45.233776760430935], [17.861783481526398, 45.067740383477137], [18.553214145591646, 45.08158966733145], [19.005486281010118, 44.860233669609144]]] } }, - { "type": "Feature", "properties": { "admin": "Belarus", "name": "Belarus", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[23.484127638449841, 53.912497667041123], [24.45068362803703, 53.905702216194747], [25.536353794056989, 54.282423407602515], [25.768432651479792, 54.846962592175082], [26.588279249790386, 55.167175604871659], [26.494331495883749, 55.61510691997762], [27.102459751094525, 55.783313707087672], [28.17670942557799, 56.169129950578807], [29.2295133806603, 55.918344224666356], [29.371571893030669, 55.67009064393617], [29.896294386522353, 55.789463202530406], [30.87390913262, 55.550976467503396], [30.971835971813132, 55.081547756564028], [30.75753380709871, 54.811770941784303], [31.384472283663733, 54.157056382862422], [31.791424187962232, 53.974638576872117], [31.731272820774503, 53.794029446012011], [32.405598585751157, 53.618045355842028], [32.693643019346034, 53.351420803432106], [32.304519484188226, 53.132726141972903], [31.497643670382924, 53.167426866256889], [31.30520063652801, 53.073995876673195], [31.540018344862254, 52.742052313846344], [31.78599816257158, 52.10167796488544], [30.927549269338975, 52.042353420614383], [30.619454380014837, 51.822806098022362], [30.55511722181145, 51.319503485715643], [30.157363722460889, 51.416138414101454], [29.254938185347921, 51.368234361366881], [28.992835320763522, 51.602044379271462], [28.617612745892242, 51.427713934934836], [28.241615024536564, 51.572227077839059], [27.454066196408426, 51.59230337178446], [26.337958611768549, 51.832288723347915], [25.327787713327005, 51.910656032918538], [24.553106316839511, 51.888461005249177], [24.005077752384206, 51.617443956094448], [23.52707075368437, 51.578454087930233], [23.508002150168689, 52.023646552124717], [23.19949384938618, 52.486977444053664], [23.799198846133375, 52.691099351606553], [23.804934930117774, 53.08973135030606], [23.527535841574995, 53.47012156840654], [23.484127638449841, 53.912497667041123]]] } }, - { "type": "Feature", "properties": { "admin": "Belize", "name": "Belize", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-89.143080410503302, 17.808318996649316], [-89.150909389995519, 17.955467637600414], [-89.029857347351808, 18.001511338772485], [-88.848343878926585, 17.883198147040229], [-88.490122850279334, 18.486830552641603], [-88.300031094093669, 18.499982204659897], [-88.296336229184803, 18.353272813383263], [-88.106812913754368, 18.348673610909284], [-88.123478563168476, 18.076674709541003], [-88.285354987322776, 17.644142971258031], [-88.197866787452625, 17.489475409408453], [-88.302640753924422, 17.13169363043566], [-88.239517991879893, 17.036066392479551], [-88.355428229510551, 16.530774237529624], [-88.551824510435821, 16.265467434143144], [-88.732433641295927, 16.233634751851351], [-88.930612759135244, 15.887273464415072], [-89.229121670269265, 15.886937567605166], [-89.15080603713092, 17.015576687075832], [-89.143080410503302, 17.808318996649316]]] } }, - { "type": "Feature", "properties": { "admin": "Bolivia", "name": "Bolivia", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-62.84646847192154, -22.034985446869442], [-63.986838141522462, -21.993644301035946], [-64.377021043542243, -22.798091322523533], [-64.964892137294598, -22.07586150481232], [-66.273339402924833, -21.832310479420713], [-67.10667355006359, -22.735924574476414], [-67.82817989772272, -22.872918796482171], [-68.219913092711266, -21.494346612231858], [-68.757167121033731, -20.372657972904459], [-68.442225104430904, -19.405068454671426], [-68.966818406841853, -18.9816834449041], [-69.100246955019472, -18.260125420812674], [-69.590423753524036, -17.580011895419329], [-68.959635382753291, -16.500697930571267], [-69.389764166934697, -15.66012908291165], [-69.160346645774936, -15.323973890853015], [-69.339534674747, -14.953195489158828], [-68.94888668483658, -14.45363941819328], [-68.929223802349526, -13.602683607643007], [-68.880079515239956, -12.89972909917665], [-68.665079718689611, -12.561300144097171], [-69.52967810736493, -10.951734307502193], [-68.786157599549469, -11.036380303596276], [-68.27125362819325, -11.014521172736817], [-68.048192308205373, -10.712059014532484], [-67.173801235610725, -10.30681243249961], [-66.646908331962791, -9.931331475466861], [-65.33843522811641, -9.76198780684639], [-65.444837002205375, -10.51145110437543], [-65.321898769783004, -10.895872084194675], [-65.402281460213018, -11.566270440317151], [-64.31635291203159, -12.461978041232191], [-63.196498786050562, -12.627032565972433], [-62.803060268796372, -13.000653171442682], [-62.127080857986371, -13.19878061284972], [-61.713204311760769, -13.489202162330049], [-61.084121263255646, -13.479383640194595], [-60.503304002511122, -13.775954685117656], [-60.459198167550014, -14.354007256734551], [-60.264326341377355, -14.645979099183638], [-60.251148851142922, -15.077218926659318], [-60.542965664295131, -15.093910414289592], [-60.158389655179022, -16.258283786690082], [-58.241219855366673, -16.299573256091289], [-58.388058437724027, -16.877109063385273], [-58.280804002502244, -17.271710300366014], [-57.734558274960989, -17.552468357007765], [-57.498371141170971, -18.174187513911289], [-57.676008877174297, -18.961839694904025], [-57.949997321185819, -19.400004164306814], [-57.853801642474494, -19.969995212486186], [-58.166392381408038, -20.176700941653674], [-58.183471442280492, -19.868399346600359], [-59.11504248720609, -19.356906019775398], [-60.043564622626477, -19.342746677327419], [-61.786326463453761, -19.633736667562957], [-62.265961269770784, -20.513734633061272], [-62.291179368729203, -21.051634616787389], [-62.685057135657871, -22.24902922942238], [-62.84646847192154, -22.034985446869442]]] } }, - { "type": "Feature", "properties": { "admin": "Brazil", "name": "Brazil", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.625133429582945, -30.216294854454258], [-56.290899624239067, -28.852760512000884], [-55.162286342984558, -27.881915378533456], [-54.49072526713551, -27.474756768505785], [-53.648735317587885, -26.923472588816086], [-53.628348965048737, -26.124865004177465], [-54.130049607954376, -25.547639255477247], [-54.625290696823562, -25.739255466415507], [-54.428946092330577, -25.162184747012162], [-54.293476325077435, -24.570799655863958], [-54.292959560754511, -24.021014092710722], [-54.652834235235119, -23.839578138933955], [-55.027901780809543, -24.001273695575225], [-55.400747239795407, -23.956935316668797], [-55.517639329639621, -23.57199757252663], [-55.61068274598113, -22.655619398694839], [-55.797958136606894, -22.356929620047815], [-56.473317430229379, -22.086300144135279], [-56.881509568902885, -22.282153822521476], [-57.937155727761287, -22.090175876557169], [-57.870673997617786, -20.732687676681948], [-58.166392381408038, -20.176700941653674], [-57.853801642474494, -19.969995212486186], [-57.949997321185819, -19.400004164306814], [-57.676008877174297, -18.961839694904025], [-57.498371141170971, -18.174187513911289], [-57.734558274960989, -17.552468357007765], [-58.280804002502244, -17.271710300366014], [-58.388058437724027, -16.877109063385273], [-58.241219855366673, -16.299573256091289], [-60.158389655179022, -16.258283786690082], [-60.542965664295131, -15.093910414289592], [-60.251148851142922, -15.077218926659318], [-60.264326341377355, -14.645979099183638], [-60.459198167550014, -14.354007256734551], [-60.503304002511122, -13.775954685117656], [-61.084121263255646, -13.479383640194595], [-61.713204311760769, -13.489202162330049], [-62.127080857986371, -13.19878061284972], [-62.803060268796372, -13.000653171442682], [-63.196498786050562, -12.627032565972433], [-64.31635291203159, -12.461978041232191], [-65.402281460213018, -11.566270440317151], [-65.321898769783004, -10.895872084194675], [-65.444837002205375, -10.51145110437543], [-65.33843522811641, -9.76198780684639], [-66.646908331962791, -9.931331475466861], [-67.173801235610725, -10.30681243249961], [-68.048192308205373, -10.712059014532484], [-68.27125362819325, -11.014521172736817], [-68.786157599549469, -11.036380303596276], [-69.52967810736493, -10.951734307502193], [-70.093752204046879, -11.123971856331011], [-70.548685675728393, -11.009146823778462], [-70.481893886991159, -9.490118096558842], [-71.302412278921523, -10.079436130415372], [-72.184890713169821, -10.05359791426943], [-72.563033006465631, -9.520193780152715], [-73.226713426390148, -9.462212823121233], [-73.015382656532537, -9.03283334720806], [-73.571059332967053, -8.424446709835832], [-73.987235480429646, -7.523829847853063], [-73.723401455363486, -7.340998630404412], [-73.724486660441627, -6.918595472850638], [-73.120027431923575, -6.629930922068238], [-73.219711269814596, -6.089188734566076], [-72.964507208941185, -5.741251315944892], [-72.891927659787243, -5.274561455916979], [-71.748405727816532, -4.59398284263301], [-70.928843349883564, -4.401591485210367], [-70.79476884630229, -4.251264743673302], [-69.893635219996611, -4.298186944194326], [-69.444101935489599, -1.556287123219817], [-69.420485805932216, -1.122618503426409], [-69.577065395776586, -0.549991957200163], [-70.02065589057004, -0.185156345219539], [-70.015565761989293, 0.541414292804205], [-69.452396002872447, 0.706158758950693], [-69.252434048119042, 0.602650865070075], [-69.218637661400166, 0.985676581217433], [-69.804596727157701, 1.089081122233466], [-69.816973232691609, 1.714805202639624], [-67.868565029558823, 1.692455145673392], [-67.537810024674684, 2.037162787276329], [-67.25999752467358, 1.719998684084956], [-67.065048183852483, 1.130112209473225], [-66.876325853122566, 1.253360500489336], [-66.325765143484944, 0.724452215982012], [-65.548267381437554, 0.78925446207603], [-65.354713304288353, 1.0952822941085], [-64.611011928959854, 1.328730576987041], [-64.199305792890499, 1.49285492594602], [-64.083085496666072, 1.91636912679408], [-63.368788011311644, 2.200899562993129], [-63.422867397705105, 2.411067613124174], [-64.269999152265783, 2.497005520025566], [-64.408827887617903, 3.126786200366623], [-64.368494432214092, 3.797210394705246], [-64.816064012294007, 4.056445217297422], [-64.628659430587533, 4.14848094320925], [-63.888342861574145, 4.020530096854571], [-63.093197597899092, 3.770571193858784], [-62.804533047116692, 4.006965033377951], [-62.085429653559125, 4.162123521334308], [-60.966893276601517, 4.536467596856638], [-60.601179165271922, 4.918098049332129], [-60.733574184803707, 5.2002772078619], [-60.213683437731319, 5.2444863956876], [-59.980958624904865, 5.014061184098138], [-60.111002366767373, 4.574966538914082], [-59.767405768458701, 4.423502915866606], [-59.538039923731219, 3.958802598481937], [-59.815413174057852, 3.606498521332085], [-59.974524909084543, 2.755232652188055], [-59.718545701726732, 2.249630438644359], [-59.646043667221242, 1.786893825686789], [-59.030861579002639, 1.317697658692722], [-58.540012986878288, 1.26808828369252], [-58.429477098205957, 1.46394196207872], [-58.113449876525003, 1.507195135907025], [-57.660971035377358, 1.682584947105638], [-57.33582292339689, 1.948537705895759], [-56.782704230360814, 1.863710842288653], [-56.53938574891454, 1.89952260986692], [-55.995698004771739, 1.817667141116601], [-55.905600145070871, 2.021995754398659], [-56.073341844290283, 2.220794989425499], [-55.973322109589361, 2.510363877773016], [-55.569755011605984, 2.42150625244713], [-55.097587449755125, 2.523748073736612], [-54.524754197799709, 2.311848863123785], [-54.088062506717243, 2.105556545414629], [-53.778520677288903, 2.376702785650081], [-53.554839240113537, 2.33489655192595], [-53.4184651352953, 2.05338918701598], [-52.939657151894949, 2.124857692875636], [-52.556424730018414, 2.504705308437053], [-52.249337531123942, 3.241094468596244], [-51.657797410678882, 4.156232408053028], [-51.317146369010842, 4.203490505383953], [-51.069771287629649, 3.65039765056403], [-50.508875291533641, 1.901563828942456], [-49.974075893745045, 1.736483465986069], [-49.947100796088705, 1.046189683431223], [-50.699251268096901, 0.222984117021681], [-50.388210822132123, -0.078444512536819], [-48.620566779156313, -0.235489190271821], [-48.584496629416577, -1.237805271005001], [-47.824956427590621, -0.5816179337628], [-46.566583624851219, -0.941027520352776], [-44.9057030909904, -1.551739597178134], [-44.417619187993658, -2.137750339367975], [-44.581588507655773, -2.691308282078523], [-43.418791266440188, -2.383110039889793], [-41.47265682632824, -2.912018324397116], [-39.97866533055403, -2.87305429444904], [-38.50038347019656, -3.700652357603394], [-37.223252122535193, -4.820945733258915], [-36.45293738457638, -5.109403578312153], [-35.597795783010454, -5.149504489770648], [-35.235388963347553, -5.464937432480245], [-34.896029832486825, -6.738193047719709], [-34.729993455533027, -7.343220716992965], [-35.128212042774216, -8.996401462442284], [-35.636966518687707, -9.649281508017811], [-37.046518724096991, -11.040721123908799], [-37.683611619607355, -12.17119475672582], [-38.423876512188436, -13.038118584854285], [-38.673887091616507, -13.057652276260615], [-38.953275722802537, -13.79336964280002], [-38.882298143049645, -15.667053724838764], [-39.161092495264306, -17.208406670808468], [-39.267339240056394, -17.867746270420479], [-39.583521491034219, -18.262295830968934], [-39.76082333022763, -19.599113457927402], [-40.774740770010332, -20.90451181405242], [-40.944756232250597, -21.937316989837807], [-41.75416419123821, -22.370675551037454], [-41.988284267736546, -22.970070489190888], [-43.074703742024738, -22.967693373305462], [-44.647811855637798, -23.351959323827838], [-45.35213578955991, -23.796841729428579], [-46.472093268405523, -24.088968601174539], [-47.648972337420645, -24.885199069927715], [-48.495458136577689, -25.877024834905647], [-48.641004808127725, -26.623697605090928], [-48.474735887228647, -27.175911960561887], [-48.661520351747612, -28.186134535435713], [-48.888457404157393, -28.674115085567877], [-49.587329474472668, -29.224469089476333], [-50.696874152211478, -30.984465020472953], [-51.576226162306149, -31.777698256153204], [-52.256081305538032, -32.245369968394662], [-52.71209998229768, -33.196578057591175], [-53.373661668498229, -33.768377780900757], [-53.650543992718084, -33.202004082981823], [-53.209588995971529, -32.727666110974717], [-53.787951626182185, -32.047242526987617], [-54.572451544805105, -31.494511407193745], [-55.601510179249331, -30.853878676071385], [-55.97324459494093, -30.883075860316296], [-56.976025763564721, -30.109686374636119], [-57.625133429582945, -30.216294854454258]]] } }, - { "type": "Feature", "properties": { "admin": "Brunei", "name": "Brunei", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[114.204016554828343, 4.525873928236805], [114.599961379048707, 4.900011298029965], [115.450710483869798, 5.447729803891532], [115.405700311343566, 4.955227565933837], [115.347460972150643, 4.316636053887009], [114.869557326315373, 4.348313706881924], [114.659595981913498, 4.007636826997753], [114.204016554828343, 4.525873928236805]]] } }, - { "type": "Feature", "properties": { "admin": "Bhutan", "name": "Bhutan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[91.69665652869665, 27.771741848251661], [92.10371178585973, 27.4526140406332], [92.033483514375078, 26.838310451763554], [91.217512648486405, 26.808648179628019], [90.37327477413406, 26.875724188742872], [89.744527622438838, 26.71940298105995], [88.835642531289366, 27.098966376243755], [88.814248488320544, 27.299315904239361], [89.475810174521101, 28.04275889740639], [90.015828891971154, 28.296438503527209], [90.730513950567769, 28.064953925075748], [91.258853794319904, 28.040614325466287], [91.69665652869665, 27.771741848251661]]] } }, - { "type": "Feature", "properties": { "admin": "Botswana", "name": "Botswana", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[25.649163445750155, -18.536025892818987], [25.850391473094724, -18.714412937090533], [26.164790887158478, -19.293085625894935], [27.296504754350501, -20.391519870690995], [27.724747348753247, -20.499058526290387], [27.727227817503252, -20.851801853114711], [28.02137007010861, -21.485975030200578], [28.794656202924209, -21.639454034107445], [29.432188348109033, -22.091312758067584], [28.017235955525244, -22.827753594659072], [27.119409620886238, -23.574323011979772], [26.78640669119741, -24.240690606383478], [26.485753208123292, -24.616326592713097], [25.941652052522151, -24.696373386333214], [25.765848829865206, -25.174845472923671], [25.664666375437712, -25.486816094669706], [25.025170525825782, -25.719670098576891], [24.211266717228792, -25.670215752873567], [23.733569777122703, -25.39012948985161], [23.312096795350179, -25.268689873965712], [22.824271274514896, -25.500458672794768], [22.579531691180584, -25.979447523708142], [22.105968865657864, -26.28025603607913], [21.60589603036939, -26.726533705351748], [20.889609002371731, -26.828542982695907], [20.666470167735437, -26.477453301704916], [20.758609246511831, -25.868136488551446], [20.165725538827186, -24.917961928000768], [19.895767856534427, -24.767790215760588], [19.895457797940672, -21.849156996347865], [20.881134067475866, -21.814327080983144], [20.910641310314531, -18.252218926672018], [21.655040317478971, -18.219146010005222], [23.196858351339298, -17.869038181227783], [23.579005568137713, -18.281261081620055], [24.217364536239209, -17.889347019118485], [24.520705193792534, -17.887124932529932], [25.084443393664564, -17.661815687737366], [25.264225701608005, -17.736539808831413], [25.649163445750155, -18.536025892818987]]] } }, - { "type": "Feature", "properties": { "admin": "Central African Republic", "name": "Central African Rep.", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[15.279460483469107, 7.421924546737968], [16.106231723706767, 7.497087917506504], [16.290561557691884, 7.754307359239304], [16.456184523187343, 7.734773667832966], [16.705988396886251, 7.508327541529978], [17.964929640380884, 7.890914008002865], [18.389554884523218, 8.281303615751822], [18.911021762780504, 8.630894680206351], [18.81200971850927, 8.982914536978596], [19.094008009526018, 9.074846910025837], [20.059685499764267, 9.01270600019485], [21.00086836109616, 9.475985215691507], [21.723821648859452, 10.567055568885973], [22.231129184668784, 10.971888739460507], [22.864165480244218, 11.142395127807543], [22.977543572692603, 10.714462591998538], [23.554304233502187, 10.089255275915306], [23.557249790142826, 9.681218166538683], [23.394779087017181, 9.26506785729222], [23.459012892355979, 8.954285793488891], [23.805813429466745, 8.666318874542425], [24.567369012152078, 8.229187933785466], [25.114932488716786, 7.825104071479172], [25.12413089366472, 7.500085150579436], [25.796647983511171, 6.979315904158069], [26.21341840994511, 6.546603298362071], [26.465909458123232, 5.94671743410187], [27.213409051225163, 5.550953477394557], [27.374226108517483, 5.233944403500059], [27.044065382604703, 5.127852688004835], [26.402760857862535, 5.150874538590869], [25.650455356557465, 5.256087754737123], [25.278798455514302, 5.170408229997191], [25.128833449003274, 4.927244777847789], [24.805028924262409, 4.897246608902349], [24.41053104014625, 5.108784084489129], [23.297213982850135, 4.609693101414221], [22.841479526468103, 4.710126247573483], [22.704123569436284, 4.633050848810156], [22.405123732195531, 4.02916006104732], [21.659122755630019, 4.224341945813719], [20.927591180106273, 4.322785549329736], [20.290679152108932, 4.691677761245287], [19.467783644293146, 5.031527818212779], [18.932312452884755, 4.709506130385973], [18.542982211997778, 4.201785183118317], [18.453065219809925, 3.504385891123348], [17.809900343505259, 3.560196437998569], [17.133042433346297, 3.728196519379451], [16.537058139724135, 3.198254706226278], [16.01285241055535, 2.267639675298084], [15.907380812247649, 2.557389431158612], [15.862732374747479, 3.013537298998982], [15.405395948964379, 3.335300604664339], [15.036219516671249, 3.851367295747123], [14.950953403389658, 4.21038930909492], [14.478372430080466, 4.732605495620446], [14.558935988023501, 5.03059764243153], [14.459407179429345, 5.451760565610299], [14.536560092841111, 6.22695872642069], [14.776545444404572, 6.408498033062044], [15.279460483469107, 7.421924546737968]]] } }, - { "type": "Feature", "properties": { "admin": "Canada", "name": "Canada", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-63.6645, 46.55001], [-62.9393, 46.41587], [-62.01208, 46.44314], [-62.50391, 46.03339], [-62.87433, 45.96818], [-64.1428, 46.39265], [-64.39261, 46.72747], [-64.01486, 47.03601], [-63.6645, 46.55001]]], [[[-61.806305, 49.10506], [-62.29318, 49.08717], [-63.58926, 49.40069], [-64.51912, 49.87304], [-64.17322, 49.95718], [-62.85829, 49.70641], [-61.835585, 49.28855], [-61.806305, 49.10506]]], [[[-123.510001587551116, 48.51001089130343], [-124.012890788399474, 48.370846259141402], [-125.655012777338342, 48.825004584338494], [-125.954994466792726, 49.179995835967638], [-126.850004435871853, 49.530000311880421], [-127.029993449544392, 49.814995835970073], [-128.059336304366212, 49.994959011426594], [-128.444584107102145, 50.53913768167611], [-128.358413656255408, 50.770648098343678], [-127.308581096029883, 50.552573554071948], [-126.695000977212302, 50.40090322529538], [-125.755006673823161, 50.295018215529367], [-125.415001587558791, 49.950000515332604], [-124.920768189119315, 49.47527497008339], [-123.92250870832099, 49.062483628935794], [-123.510001587551116, 48.51001089130343]]], [[[-56.134035814017111, 50.687009792679298], [-56.795881720595261, 49.812308661490945], [-56.143105027884289, 50.15011749938283], [-55.471492275602934, 49.935815334668447], [-55.822401089080913, 49.587128607779093], [-54.93514258484565, 49.313010972686833], [-54.473775397343772, 49.556691189159167], [-53.47654944519131, 49.24913890237405], [-53.786013759971233, 48.516780503933617], [-53.086133999226249, 48.687803656603528], [-52.95864824076223, 48.157164211614472], [-52.648098720904173, 47.53554840757549], [-53.069158291218336, 46.655498765644936], [-53.521456264853029, 46.618291734394823], [-54.178935512902527, 46.807065741556997], [-53.961868659060471, 47.625207017601909], [-54.240482143762122, 47.752279364607617], [-55.400773078011483, 46.88499380145312], [-55.997480841685835, 46.919720363953289], [-55.291219041552765, 47.389562486350982], [-56.250798712780508, 47.632545070987383], [-57.325229254777085, 47.572807115257987], [-59.26601518414676, 47.603347886742498], [-59.41949418805369, 47.89945384377485], [-58.796586473207398, 48.251525376979473], [-59.23162451845652, 48.523188381537793], [-58.391804979065213, 49.125580552764163], [-57.358689744686025, 50.718274034215845], [-56.738650071831998, 51.287438259478527], [-55.87097693543528, 51.632094224649187], [-55.406974249886602, 51.588272610065722], [-55.600218268442077, 51.317074693397913], [-56.134035814017111, 50.687009792679298]]], [[[-133.180004041711669, 54.169975490935308], [-132.710007884431292, 54.040009315423518], [-131.749989584003259, 54.120004380909208], [-132.049480347350965, 52.984621487024519], [-131.179042521826574, 52.18043284769827], [-131.577829549822894, 52.182370713909236], [-132.180428426778519, 52.639707139692391], [-132.549992432313843, 53.100014960332132], [-133.054611178755493, 53.411468817755363], [-133.239664482792676, 53.851080227262386], [-133.180004041711669, 54.169975490935308]]], [[[-79.26582, 62.158675], [-79.65752, 61.63308], [-80.09956, 61.7181], [-80.36215, 62.01649], [-80.315395, 62.085565], [-79.92939, 62.3856], [-79.52002, 62.36371], [-79.26582, 62.158675]]], [[[-81.89825, 62.7108], [-83.06857, 62.15922], [-83.77462, 62.18231], [-83.99367, 62.4528], [-83.25048, 62.91409], [-81.87699, 62.90458], [-81.89825, 62.7108]]], [[[-85.161307949549851, 65.657284654392797], [-84.975763719405933, 65.217518215588981], [-84.464012010419495, 65.371772365980163], [-83.88262630891974, 65.109617824963536], [-82.78757687043877, 64.766693020274673], [-81.642013719392509, 64.455135809986942], [-81.553440314444245, 63.979609280037131], [-80.817361212878851, 64.057485663500998], [-80.103451300766594, 63.725981350348597], [-80.991019863595653, 63.41124603947496], [-82.547178107416997, 63.651722317145229], [-83.108797573565042, 64.101875718839707], [-84.100416632813847, 63.569711819098004], [-85.523404710618991, 63.052379055424076], [-85.866768764982339, 63.637252916103542], [-87.221983201836721, 63.541238104905212], [-86.352759772471259, 64.035833238370699], [-86.224886440765133, 64.822916978608262], [-85.883847825854858, 65.738778388117041], [-85.161307949549851, 65.657284654392797]]], [[[-75.86588, 67.14886], [-76.98687, 67.09873], [-77.2364, 67.58809], [-76.81166, 68.14856], [-75.89521, 68.28721], [-75.1145, 68.01036], [-75.10333, 67.58202], [-75.21597, 67.44425], [-75.86588, 67.14886]]], [[[-95.647681203800488, 69.107690358321761], [-96.269521203800579, 68.757040358321731], [-97.61740120380054, 69.060030358321782], [-98.431801203800504, 68.950700358321768], [-99.797401203800504, 69.400030358321786], [-98.917401203800523, 69.710030358321788], [-98.218261203800466, 70.143540358321744], [-97.157401203800532, 69.860030358321794], [-96.557401203800524, 69.680030358321758], [-96.257401203800498, 69.490030358321761], [-95.647681203800488, 69.107690358321761]]], [[[-90.5471, 69.49766], [-90.55151, 68.47499], [-89.21515, 69.25873], [-88.01966, 68.61508], [-88.31749, 67.87338], [-87.35017, 67.19872], [-86.30607, 67.92146], [-85.57664, 68.78456], [-85.52197, 69.88211], [-84.10081, 69.80539], [-82.62258, 69.65826], [-81.28043, 69.16202], [-81.2202, 68.66567], [-81.96436, 68.13253], [-81.25928, 67.59716], [-81.38653, 67.11078], [-83.34456, 66.41154], [-84.73542, 66.2573], [-85.76943, 66.55833], [-86.0676, 66.05625], [-87.03143, 65.21297], [-87.32324, 64.77563], [-88.48296, 64.09897], [-89.91444, 64.03273], [-90.70398, 63.61017], [-90.77004, 62.96021], [-91.93342, 62.83508], [-93.15698, 62.02469], [-94.24153, 60.89865], [-94.62931, 60.11021], [-94.6846, 58.94882], [-93.21502, 58.78212], [-92.76462, 57.84571], [-92.297029999999893, 57.08709], [-90.89769, 57.28468], [-89.03953, 56.85172], [-88.03978, 56.47162], [-87.32421, 55.99914], [-86.07121, 55.72383], [-85.01181, 55.3026], [-83.36055, 55.24489], [-82.27285, 55.14832], [-82.4362, 54.28227], [-82.12502, 53.27703], [-81.40075, 52.15788], [-79.91289, 51.20842], [-79.14301, 51.53393], [-78.60191, 52.56208], [-79.12421, 54.14145], [-79.82958, 54.66772], [-78.22874, 55.13645], [-77.0956, 55.83741], [-76.54137, 56.53423], [-76.62319, 57.20263], [-77.30226, 58.05209], [-78.51688, 58.80458], [-77.33676, 59.85261], [-77.77272, 60.75788], [-78.10687, 62.31964], [-77.41067, 62.55053], [-75.69621, 62.2784], [-74.6682, 62.18111], [-73.83988, 62.4438], [-72.90853, 62.10507], [-71.67708, 61.52535], [-71.37369, 61.13717], [-69.59042, 61.06141], [-69.62033, 60.22125], [-69.2879, 58.95736], [-68.37455, 58.80106], [-67.64976, 58.21206], [-66.20178, 58.76731], [-65.24517, 59.87071], [-64.58352, 60.33558], [-63.80475, 59.4426], [-62.50236, 58.16708], [-61.39655, 56.96745], [-61.79866, 56.33945], [-60.46853, 55.77548], [-59.56962, 55.20407], [-57.97508, 54.94549], [-57.3332, 54.6265], [-56.93689, 53.78032], [-56.15811, 53.64749], [-55.75632, 53.27036], [-55.68338, 52.14664], [-56.40916, 51.7707], [-57.12691, 51.41972], [-58.77482, 51.0643], [-60.03309, 50.24277], [-61.72366, 50.08046], [-63.86251, 50.29099], [-65.36331, 50.2982], [-66.39905, 50.22897], [-67.23631, 49.51156], [-68.51114, 49.06836], [-69.95362, 47.74488], [-71.10458, 46.82171], [-70.25522, 46.98606], [-68.65, 48.3], [-66.55243, 49.1331], [-65.05626, 49.23278], [-64.17099, 48.74248], [-65.11545, 48.07085], [-64.79854, 46.99297], [-64.47219, 46.23849], [-63.17329, 45.73902], [-61.52072, 45.88377], [-60.51815, 47.00793], [-60.4486, 46.28264], [-59.80287, 45.9204], [-61.03988, 45.26525], [-63.25471, 44.67014], [-64.24656, 44.26553], [-65.36406, 43.54523], [-66.1234, 43.61867], [-66.16173, 44.46512], [-64.42549, 45.29204], [-66.02605, 45.25931], [-67.13741, 45.13753], [-67.79134, 45.70281], [-67.79046, 47.06636], [-68.23444, 47.35486], [-68.905, 47.185], [-69.237216, 47.447781], [-69.99997, 46.69307], [-70.305, 45.915], [-70.66, 45.46], [-71.08482, 45.30524], [-71.405, 45.255], [-71.50506, 45.0082], [-73.34783, 45.00738], [-74.867, 45.00048], [-75.31821, 44.81645], [-76.375, 44.09631], [-76.5, 44.018458893758712], [-76.820034145805565, 43.628784288093748], [-77.737885097957687, 43.62905558936329], [-78.720279914042365, 43.625089423184868], [-79.171673550111862, 43.466339423184216], [-79.01, 43.27], [-78.92, 42.965], [-78.939362148743683, 42.863611355148031], [-80.247447679347928, 42.366199856122584], [-81.277746548167144, 42.209025987306845], [-82.439277716791608, 41.675105088867149], [-82.690089280920162, 41.675105088867149], [-83.029810146806909, 41.832795722005834], [-83.141999681312555, 41.975681057292825], [-83.12, 42.08], [-82.9, 42.43], [-82.43, 42.98], [-82.137642381503881, 43.571087551439909], [-82.337763125431053, 44.44], [-82.550924648758169, 45.347516587905368], [-83.592850714843067, 45.816893622412373], [-83.469550747394621, 45.994686387712584], [-83.616130947590563, 46.116926988299056], [-83.890765347005726, 46.116926988299056], [-84.091851264161463, 46.27541860613816], [-84.14211951367335, 46.512225857115723], [-84.3367, 46.40877], [-84.6049, 46.4396], [-84.543748745445853, 46.538684190449132], [-84.779238247399888, 46.637101955749038], [-84.876079881514855, 46.900083319682366], [-85.652363247403414, 47.220218817730498], [-86.461990831228249, 47.553338019392037], [-87.439792623300207, 47.94], [-88.378114183286698, 48.302917588893727], [-89.272917446636654, 48.019808254582657], [-89.6, 48.01], [-90.83, 48.27], [-91.64, 48.14], [-92.61, 48.45], [-93.63087, 48.60926], [-94.32914, 48.67074], [-94.64, 48.84], [-94.81758, 49.38905], [-95.15609, 49.38425], [-95.159069509172014, 49.0], [-97.228720000004799, 49.0007], [-100.65, 49.0], [-104.04826, 48.99986], [-107.05, 49.0], [-110.05, 49.0], [-113.0, 49.0], [-116.04818, 49.0], [-117.03121, 49.0], [-120.0, 49.0], [-122.84, 49.0], [-122.97421, 49.002537777777789], [-124.91024, 49.98456], [-125.62461, 50.41656], [-127.43561, 50.83061], [-127.99276, 51.71583], [-127.85032, 52.32961], [-129.12979, 52.75538], [-129.30523, 53.56159], [-130.51497, 54.28757], [-130.53611, 54.80278], [-129.98, 55.285], [-130.00778, 55.91583], [-131.70781, 56.55212], [-132.73042, 57.69289], [-133.35556, 58.41028], [-134.27111, 58.86111], [-134.945, 59.27056], [-135.47583, 59.78778], [-136.47972, 59.46389], [-137.4525, 58.905], [-138.34089, 59.56211], [-139.039, 60.0], [-140.013, 60.27682], [-140.99778, 60.30639], [-140.9925, 66.00003], [-140.986, 69.712], [-139.12052, 69.47102], [-137.54636, 68.99002], [-136.50358, 68.89804], [-135.62576, 69.31512], [-134.41464, 69.62743], [-132.92925, 69.50534], [-131.43136, 69.94451], [-129.79471, 70.19369], [-129.10773, 69.77927], [-128.36156, 70.01286], [-128.13817, 70.48384], [-127.44712, 70.37721], [-125.75632, 69.48058], [-124.42483, 70.1584], [-124.28968, 69.39969], [-123.06108, 69.56372], [-122.6835, 69.85553], [-121.47226, 69.79778], [-119.94288, 69.37786], [-117.60268, 69.01128], [-116.22643, 68.84151], [-115.2469, 68.90591], [-113.89794, 68.3989], [-115.30489, 67.90261], [-113.49727, 67.68815], [-110.798, 67.80612], [-109.94619, 67.98104], [-108.8802, 67.38144], [-107.79239, 67.88736], [-108.81299, 68.31164], [-108.16721, 68.65392], [-106.95, 68.7], [-106.15, 68.8], [-105.34282, 68.56122], [-104.33791, 68.018], [-103.22115, 68.09775], [-101.45433, 67.64689], [-99.90195, 67.80566], [-98.4432, 67.78165], [-98.5586, 68.40394], [-97.66948, 68.57864], [-96.11991, 68.23939], [-96.12588, 67.29338], [-95.48943, 68.0907], [-94.685, 68.06383], [-94.23282, 69.06903], [-95.30408, 69.68571], [-96.47131, 70.08976], [-96.39115, 71.19482], [-95.2088, 71.92053], [-93.88997, 71.76015], [-92.87818, 71.31869], [-91.51964, 70.19129], [-92.40692, 69.69997], [-90.5471, 69.49766]]], [[[-114.167169999999871, 73.12145], [-114.66634, 72.65277], [-112.441019999999867, 72.9554], [-111.05039, 72.4504], [-109.920349999999857, 72.96113], [-109.00654, 72.63335], [-108.188349999999886, 71.65089], [-107.68599, 72.06548], [-108.39639, 73.08953], [-107.51645, 73.23598], [-106.522589999999866, 73.07601], [-105.402459999999877, 72.67259], [-104.77484, 71.6984], [-104.464759999999814, 70.99297], [-102.78537, 70.49776], [-100.980779999999868, 70.02432], [-101.089289999999892, 69.58447000000011], [-102.731159999999875, 69.50402], [-102.09329, 69.11962], [-102.43024, 68.75282], [-104.24, 68.91], [-105.96, 69.180000000000135], [-107.12254, 69.11922], [-108.999999999999872, 68.78], [-111.534148875200117, 68.630059156817921], [-113.3132, 68.53554], [-113.854959999999807, 69.007440000000102], [-115.22, 69.28], [-116.10794, 69.16821], [-117.34, 69.960000000000107], [-116.674729999999869, 70.06655], [-115.13112, 70.2373], [-113.72141, 70.19237], [-112.4161, 70.36638], [-114.35, 70.6], [-116.48684, 70.52045], [-117.9048, 70.540560000000127], [-118.43238, 70.9092], [-116.11311, 71.30918], [-117.65568, 71.2952], [-119.40199, 71.55859], [-118.56267, 72.30785], [-117.866419999999877, 72.70594], [-115.18909, 73.314590000000109], [-114.167169999999871, 73.12145]]], [[[-104.5, 73.42], [-105.38, 72.76], [-106.94, 73.46], [-106.6, 73.6], [-105.26, 73.64], [-104.5, 73.42]]], [[[-76.34, 73.102684989953005], [-76.251403808593736, 72.826385498046861], [-77.314437866210895, 72.85554504394527], [-78.391670227050795, 72.876655578613253], [-79.486251831054645, 72.742202758789062], [-79.775833129882827, 72.80290222167973], [-80.876098632812514, 73.333183288574205], [-80.833885192871051, 73.693183898925767], [-80.353057861328111, 73.75971984863277], [-78.064437866210923, 73.651931762695327], [-76.34, 73.102684989953005]]], [[[-86.562178514334107, 73.157447007938444], [-85.774371304044521, 72.534125881633798], [-84.850112474288224, 73.34027822538711], [-82.315590176100969, 73.750950832810574], [-80.600087653307611, 72.716543687624181], [-80.748941616524391, 72.061906643350753], [-78.770638597310764, 72.352173163534147], [-77.824623989559569, 72.749616604291035], [-75.605844692675717, 72.243678493937381], [-74.228616095664975, 71.767144273557889], [-74.099140794557698, 71.330840155717638], [-72.242225714797641, 71.556924546994495], [-71.200015428335192, 70.920012518997211], [-68.78605424668487, 70.525023708774242], [-67.914970465756923, 70.121947536897594], [-66.969033372654152, 69.18608734809186], [-68.805122850200533, 68.720198472764409], [-66.449866095633851, 68.067163397892003], [-64.862314419195215, 67.847538560651614], [-63.424934454996745, 66.928473212340649], [-61.851981370680569, 66.862120673277829], [-62.163176845942296, 66.160251369889593], [-63.91844438338417, 64.998668524832837], [-65.148860236253611, 65.426032619886669], [-66.72121904159853, 66.388041083432185], [-68.015016038673949, 66.262725735124391], [-68.141287400979152, 65.689789130304362], [-67.089646165623392, 65.108455105236985], [-65.732080451099748, 64.64840566675862], [-65.320167609301265, 64.382737128346051], [-64.669406297449669, 63.392926744227474], [-65.013803880458894, 62.674185085695974], [-66.275044725190455, 62.945098781986069], [-68.783186204692711, 63.745670071051805], [-67.369680752213029, 62.883965562584869], [-66.328297288667201, 62.28007477482204], [-66.165568203380147, 61.930897121825879], [-68.877366502544632, 62.330149237712803], [-71.023437059193824, 62.910708116295829], [-72.23537858751898, 63.397836005295154], [-71.886278449171286, 63.679989325608837], [-73.37830624051837, 64.193963121183813], [-74.834418911422588, 64.679075629323776], [-74.818502570276706, 64.389093329517962], [-77.709979824520019, 64.229542344816778], [-78.55594885935416, 64.572906399180127], [-77.897281053361908, 65.309192206474776], [-76.018274298797181, 65.326968899183143], [-73.95979529488271, 65.454764716240888], [-74.293883429649625, 65.81177134872938], [-73.94491248238262, 66.310578111426722], [-72.65116716173938, 67.284575507263853], [-72.926059943316076, 67.726925767682374], [-73.311617804645721, 68.069437160912898], [-74.8433072577768, 68.554627183701271], [-76.869100918266739, 68.894735622830254], [-76.228649054657339, 69.147769273547411], [-77.28736996123709, 69.769540106883269], [-78.168633999326588, 69.826487535268896], [-78.95724219431672, 70.166880194775402], [-79.492455003563649, 69.871807766388898], [-81.305470954091732, 69.743185126414332], [-84.944706183598456, 69.966634019644388], [-87.060003424817864, 70.260001125765356], [-88.681713223001495, 70.410741278760796], [-89.513419562523012, 70.762037665480975], [-88.467721116880753, 71.218185533321318], [-89.888151211287465, 71.222552191849942], [-90.205160285181989, 72.235074367960792], [-89.43657670770493, 73.129464219852352], [-88.408241543312784, 73.537888902471209], [-85.826151089200906, 73.803815823045213], [-86.562178514334107, 73.157447007938444]]], [[[-100.35642, 73.84389], [-99.16387, 73.63339], [-97.38, 73.76], [-97.12, 73.47], [-98.05359, 72.99052], [-96.54, 72.56], [-96.72, 71.66], [-98.35966, 71.27285], [-99.32286, 71.35639], [-100.01482, 71.73827], [-102.5, 72.51], [-102.48, 72.83], [-100.43836, 72.70588], [-101.54, 73.36], [-100.35642, 73.84389]]], [[[-93.196295539100205, 72.771992499473342], [-94.26904659704725, 72.024596259235949], [-95.409855516322637, 72.061880805134578], [-96.033745083382428, 72.940276801231789], [-96.01826799191096, 73.437429918095788], [-95.495793423224001, 73.862416897264154], [-94.503657599652328, 74.134906724739196], [-92.420012173211745, 74.100025132942179], [-90.509792853542578, 73.85673248971203], [-92.003965216829869, 72.966244208458477], [-93.196295539100205, 72.771992499473342]]], [[[-120.46, 71.383601793087578], [-123.09219, 70.90164], [-123.62, 71.34], [-125.92894873747332, 71.868688463011395], [-125.499999999999872, 72.292260811795003], [-124.80729, 73.02256], [-123.94, 73.680000000000135], [-124.917749999999899, 74.292750000000112], [-121.53788, 74.44893], [-120.10978, 74.24135], [-117.55564, 74.18577], [-116.58442, 73.89607], [-115.51081, 73.47519], [-116.767939999999882, 73.22292], [-119.22, 72.52], [-120.46, 71.82], [-120.46, 71.383601793087578]]], [[[-93.612755906940464, 74.979997260224437], [-94.156908738973812, 74.59234650338685], [-95.60868058956558, 74.666863918751758], [-96.820932176484561, 74.927623196096576], [-96.288587409229791, 75.377828274223333], [-94.850819871789113, 75.647217515760886], [-93.977746548217908, 75.296489569795952], [-93.612755906940464, 74.979997260224437]]], [[[-98.5, 76.72], [-97.735585, 76.25656], [-97.704415, 75.74344], [-98.16, 75.0], [-99.80874, 74.89744], [-100.88366, 75.05736], [-100.86292, 75.64075], [-102.50209, 75.5638], [-102.56552, 76.3366], [-101.48973, 76.30537], [-99.98349, 76.64634], [-98.57699, 76.58859], [-98.5, 76.72]]], [[[-108.21141, 76.20168], [-107.81943, 75.84552], [-106.92893, 76.01282], [-105.881, 75.9694], [-105.70498, 75.47951], [-106.31347, 75.00527], [-109.7, 74.85], [-112.22307, 74.41696], [-113.74381, 74.39427], [-113.87135, 74.72029], [-111.79421, 75.1625], [-116.31221, 75.04343], [-117.7104, 75.2222], [-116.34602, 76.19903], [-115.40487, 76.47887], [-112.59056, 76.14134], [-110.81422, 75.54919], [-109.0671, 75.47321], [-110.49726, 76.42982], [-109.5811, 76.79417], [-108.54859, 76.67832], [-108.21141, 76.20168]]], [[[-94.684085862999439, 77.097878323058367], [-93.573921068073105, 76.776295884906062], [-91.605023159536586, 76.778517971494594], [-90.741845872749209, 76.449597479956807], [-90.969661424507976, 76.074013170059445], [-89.822237921899244, 75.847773749485626], [-89.187082892599776, 75.610165513807615], [-87.838276333349611, 75.566188869927217], [-86.379192267588664, 75.482421373182163], [-84.789625210290595, 75.699204006646497], [-82.753444586910049, 75.784315090631225], [-81.12853084992436, 75.713983466282016], [-80.05751095245914, 75.336848863415867], [-79.833932868148324, 74.923127346487192], [-80.457770758775823, 74.657303778777774], [-81.948842536125511, 74.442459011524321], [-83.2288936022114, 74.564027818490928], [-86.097452358733292, 74.410032050261137], [-88.150350307960196, 74.392307033984977], [-89.764722052758358, 74.515555325001117], [-92.422440965529418, 74.837757880340973], [-92.768285488642789, 75.38681997344213], [-92.889905972041717, 75.882655341282629], [-93.893824022175977, 76.319243679500516], [-95.962457445035795, 76.44138092722244], [-97.121378953829463, 76.751077785947587], [-96.745122850312342, 77.161388658345132], [-94.684085862999439, 77.097878323058367]]], [[[-116.198586595507322, 77.645286770326194], [-116.335813361458349, 76.876961575010554], [-117.106050584768766, 76.530031846819114], [-118.040412157038119, 76.481171780087081], [-119.899317586885687, 76.053213406061971], [-121.499995077126471, 75.900018622532784], [-122.85492448615895, 76.116542873835684], [-122.854925293603188, 76.116542873835684], [-121.157535360328239, 76.864507554828336], [-119.103938971821023, 77.512219957174608], [-117.570130784965954, 77.498318996888102], [-116.198586595507322, 77.645286770326194]]], [[[-93.840003017943971, 77.51999726023449], [-94.295608283245244, 77.491342678528682], [-96.169654100310055, 77.55511139597688], [-96.436304490936109, 77.83462921824362], [-94.422577277386353, 77.820004787904978], [-93.720656297565867, 77.634331366680314], [-93.840003017943971, 77.51999726023449]]], [[[-110.186938035912945, 77.697014879050286], [-112.051191169058455, 77.409228827616843], [-113.534278937619035, 77.732206529441143], [-112.724586758253835, 78.051050116681935], [-111.264443325630822, 78.152956041161545], [-109.854451870547067, 77.996324774884812], [-110.186938035912945, 77.697014879050286]]], [[[-109.663145718202557, 78.601972561345676], [-110.88131425661885, 78.406919867659994], [-112.542091437615142, 78.407901719873493], [-112.525890876091566, 78.550554511215225], [-111.500010342233367, 78.849993598130538], [-110.96366065147599, 78.804440823065207], [-109.663145718202557, 78.601972561345676]]], [[[-95.830294969449312, 78.056941229963243], [-97.309842902397975, 77.85059723582178], [-98.124289313533964, 78.082856960757567], [-98.55286780474664, 78.458105373845086], [-98.631984422585504, 78.871930243638374], [-97.337231411512604, 78.831984361476756], [-96.754398769908761, 78.765812689926989], [-95.559277920294562, 78.41831452098026], [-95.830294969449312, 78.056941229963243]]], [[[-100.060191820052111, 78.324754340315891], [-99.670939093813601, 77.907544664207393], [-101.303940192452984, 78.018984890444798], [-102.949808722733025, 78.343228664860206], [-105.176132778731514, 78.38033234324574], [-104.210429450277147, 78.677420152491777], [-105.419580451258511, 78.918335679836431], [-105.492289191493128, 79.301593939929177], [-103.529282396237917, 79.16534902619162], [-100.8251580472688, 78.80046173777869], [-100.060191820052111, 78.324754340315891]]], [[[-87.02, 79.66], [-85.81435, 79.3369], [-87.18756, 79.0393], [-89.03535, 78.28723], [-90.80436, 78.21533], [-92.87669, 78.34333], [-93.95116, 78.75099], [-93.93574, 79.11373], [-93.14524, 79.3801], [-94.974, 79.37248], [-96.07614, 79.70502], [-96.70972, 80.15777], [-96.01644, 80.60233], [-95.32345, 80.90729], [-94.29843, 80.97727], [-94.73542, 81.20646], [-92.40984, 81.25739], [-91.13289, 80.72345], [-89.45, 80.509322033898258], [-87.81, 80.32], [-87.02, 79.66]]], [[[-68.5, 83.106321516765732], [-65.82735, 83.02801], [-63.68, 82.9], [-61.85, 82.6286], [-61.89388, 82.36165], [-64.334, 81.92775], [-66.75342, 81.72527], [-67.65755, 81.50141], [-65.48031, 81.50657], [-67.84, 80.9], [-69.4697, 80.61683], [-71.18, 79.8], [-73.2428, 79.63415], [-73.88, 79.430162204802073], [-76.90773, 79.32309], [-75.52924, 79.19766], [-76.22046, 79.01907], [-75.39345, 78.52581], [-76.34354, 78.18296], [-77.88851, 77.89991], [-78.36269, 77.50859], [-79.75951, 77.20968], [-79.61965, 76.98336], [-77.91089, 77.022045], [-77.88911, 76.777955], [-80.56125, 76.17812], [-83.17439, 76.45403], [-86.11184, 76.29901], [-87.6, 76.42], [-89.49068, 76.47239], [-89.6161, 76.95213], [-87.76739, 77.17833], [-88.26, 77.9], [-87.65, 77.970222222222205], [-84.97634, 77.53873], [-86.34, 78.18], [-87.96192, 78.37181], [-87.15198, 78.75867], [-85.37868, 78.9969], [-85.09495, 79.34543], [-86.50734, 79.73624], [-86.93179, 80.25145], [-84.19844, 80.20836], [-83.408695652173819, 80.1], [-81.84823, 80.46442], [-84.1, 80.58], [-87.59895, 80.51627], [-89.36663, 80.85569], [-90.2, 81.26], [-91.36786, 81.5531], [-91.58702, 81.89429], [-90.1, 82.085], [-88.93227, 82.11751], [-86.97024, 82.27961], [-85.5, 82.652273458057024], [-84.260005, 82.6], [-83.18, 82.32], [-82.42, 82.86], [-81.1, 83.02], [-79.30664, 83.13056], [-76.25, 83.172058823529369], [-75.71878, 83.06404], [-72.83153, 83.23324], [-70.665765, 83.169780758382828], [-68.5, 83.106321516765732]]]] } }, - { "type": "Feature", "properties": { "admin": "Switzerland", "name": "Switzerland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.594226108446346, 47.525058091820256], [9.632931756232974, 47.347601223329974], [9.479969516649019, 47.102809963563367], [9.932448357796657, 46.920728054382948], [10.442701450246627, 46.893546250997424], [10.36337812667861, 46.483571275409851], [9.922836541390378, 46.314899400409182], [9.182881707403054, 46.440214748716976], [8.966305779667804, 46.036931871111186], [8.489952426801322, 46.005150865251672], [8.316629672894377, 46.163642483090847], [7.755992058959832, 45.824490057959302], [7.273850945676655, 45.776947740250769], [6.843592970414504, 45.991146552100595], [6.500099724970424, 46.429672756529428], [6.022609490593537, 46.272989813820466], [6.037388950229, 46.725778713561859], [6.768713820023605, 47.287708238303686], [6.736571079138058, 47.541801255882838], [7.192202182655505, 47.449765529971003], [7.466759067422228, 47.620581976911794], [8.31730146651415, 47.613579820336255], [8.522611932009765, 47.830827541691285], [9.594226108446346, 47.525058091820256]]] } }, - { "type": "Feature", "properties": { "admin": "Chile", "name": "Chile", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-68.634010227583147, -52.636370458874353], [-68.633349999999879, -54.8695], [-67.56244, -54.87001], [-66.95992, -54.89681], [-67.291029999999878, -55.30124], [-68.148629999999841, -55.61183], [-68.639990810811796, -55.580017999086877], [-69.2321, -55.49906], [-69.95809, -55.19843], [-71.00568, -55.05383], [-72.2639, -54.49514], [-73.2852, -53.957519999999874], [-74.66253, -52.83749], [-73.8381, -53.04743], [-72.43418, -53.7154], [-71.10773, -54.07433], [-70.591779999999787, -53.61583], [-70.26748, -52.93123], [-69.345649999999878, -52.5183], [-68.634010227583147, -52.636370458874353]]], [[[-68.219913092711224, -21.49434661223183], [-67.828179897722634, -22.872918796482178], [-67.106673550063604, -22.735924574476392], [-66.985233934177629, -22.986348565362825], [-67.328442959244128, -24.025303236590908], [-68.417652960876111, -24.518554782816874], [-68.386001146097342, -26.185016371365229], [-68.594799770772667, -26.50690886811126], [-68.295541551370391, -26.899339694935787], [-69.001234910748266, -27.521213881136127], [-69.656130337183143, -28.459141127233686], [-70.013550381129861, -29.367922865518544], [-69.919008348251921, -30.336339206668306], [-70.535068935819439, -31.365010267870279], [-70.074399380153622, -33.09120981214803], [-69.814776984319209, -33.273886000299839], [-69.817309129501453, -34.193571465798279], [-70.388049485949082, -35.169687595359441], [-70.364769253201658, -36.005088799789931], [-71.121880662709771, -36.65812387466233], [-71.118625047475419, -37.576827487947192], [-70.814664272734703, -38.552995293940732], [-71.413516608349042, -38.916022230791107], [-71.680761277946445, -39.808164157878061], [-71.915734015577542, -40.832339369470716], [-71.746803758415453, -42.051386407235988], [-72.148898078078517, -42.254888197601375], [-71.915423956983901, -43.408564548517404], [-71.464056159130493, -43.787611179378324], [-71.793622606071935, -44.207172133156099], [-71.329800788036195, -44.407521661151677], [-71.222778896759721, -44.784242852559409], [-71.659315558545316, -44.973688653341434], [-71.552009446891233, -45.560732924177117], [-71.917258470330196, -46.884838148791786], [-72.44735531278026, -47.738532810253517], [-72.331160854771937, -48.244238376661819], [-72.648247443314929, -48.878618259476774], [-73.415435757120022, -49.318436374712952], [-73.328050910114456, -50.378785088909865], [-72.975746832964617, -50.741450290734299], [-72.309973517532342, -50.677009779666342], [-72.329403856074023, -51.425956312872394], [-71.914803839796321, -52.009022305865912], [-69.498362189396076, -52.142760912637236], [-68.571545376241332, -52.299443855346247], [-69.461284349226617, -52.291950772663924], [-69.94277950710611, -52.537930590373243], [-70.8451016913545, -52.899200528525711], [-71.006332160105217, -53.833252042201345], [-71.429794684520928, -53.856454760300373], [-72.557942877884855, -53.531410001184447], [-73.702756720662862, -52.835069268607249], [-73.702756720662862, -52.835070076051487], [-74.946763475225154, -52.262753588419017], [-75.260026007778507, -51.62935475037321], [-74.976632453089806, -51.043395684615675], [-75.47975419788348, -50.378371677451547], [-75.608015102831942, -48.673772881871784], [-75.182769741502128, -47.711919447623153], [-74.126580980104677, -46.939253431995084], [-75.644395311165439, -46.647643324572016], [-74.69215369332305, -45.76397633238097], [-74.351709357384252, -44.10304412208788], [-73.240356004515192, -44.454960625995611], [-72.717803921179765, -42.383355808278985], [-73.388899909138232, -42.117532240569567], [-73.701335618774834, -43.365776462579738], [-74.33194312203257, -43.224958184584395], [-74.017957119427152, -41.794812920906828], [-73.677099372029943, -39.942212823243111], [-73.217592536090663, -39.258688653318508], [-73.505559455037044, -38.282882582351064], [-73.588060879191076, -37.156284681956016], [-73.166717088499283, -37.123780206044351], [-72.553136969681717, -35.508840020491022], [-71.861732143832555, -33.909092706031522], [-71.438450486929895, -32.418899428030819], [-71.668720669222424, -30.920644626592516], [-71.370082567007714, -30.095682061484997], [-71.48989437527645, -28.861442152625909], [-70.905123867461569, -27.640379734001193], [-70.724953986275963, -25.705924167587209], [-70.403965827095035, -23.628996677344542], [-70.091245897080668, -21.393319187101223], [-70.164419725205974, -19.756468194256183], [-70.372572394477714, -18.347975355708879], [-69.858443569605797, -18.092693780187027], [-69.590423753523979, -17.580011895419286], [-69.100246955019401, -18.260125420812653], [-68.966818406841824, -18.981683444904089], [-68.442225104430918, -19.405068454671419], [-68.757167121033703, -20.37265797290447], [-68.219913092711224, -21.49434661223183]]]] } }, - { "type": "Feature", "properties": { "admin": "China", "name": "China", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[110.339187860151526, 18.678395087147603], [109.475209588663702, 18.19770091396861], [108.655207961056135, 18.507681993071397], [108.626217482540426, 19.367887885001974], [109.119055617308007, 19.821038519769385], [110.211598748822837, 20.101253973872073], [110.786550734502228, 20.077534491450077], [111.01005130416462, 19.695929877190732], [110.570646600386794, 19.255879218009305], [110.339187860151526, 18.678395087147603]]], [[[127.657407261262378, 49.760270494172929], [129.397817824420429, 49.440600084015429], [130.58229332898236, 48.729687404976112], [130.987281528853828, 47.790132351261391], [132.506671991099495, 47.788969631534876], [133.373595819228001, 48.183441677434914], [135.026311476786702, 48.478229885443902], [134.500813836810607, 47.578439846377833], [134.112362095272601, 47.212467352886719], [133.76964399631288, 46.116926988299056], [133.097126906466428, 45.14406647397216], [131.883454217659562, 45.32116160743643], [131.025212030156069, 44.967953192721573], [131.288555129115537, 44.111519680348252], [131.144687941614848, 42.929989732426932], [130.633866408409801, 42.903014634770543], [130.640015903852429, 42.39500946712527], [129.994267205933227, 42.985386867843793], [129.596668735879462, 42.424981797854592], [128.05221520397231, 41.994284572917984], [128.208433058790717, 41.466771552082534], [127.343782993683021, 41.503151760415953], [126.869083286649854, 41.816569322266155], [126.18204511932943, 41.107336127276362], [125.079941847840587, 40.569823716792449], [124.265624627785314, 39.928493353834135], [122.86757042856101, 39.637787583976255], [122.131387974130917, 39.170451768544623], [121.054554478032856, 38.89747101496291], [121.585994907722466, 39.360853583324136], [121.376757033372641, 39.750261338859524], [122.168595005381007, 40.422442531896046], [121.640358514493528, 40.946389878903304], [120.768628778161954, 40.593388169917596], [119.639602085449056, 39.898055935214209], [119.023463983233015, 39.252333075511096], [118.042748651197897, 39.204273993479674], [117.532702264477052, 38.73763580988409], [118.05969852098967, 38.061475531561051], [118.878149855628351, 37.897325344385898], [118.911636183753501, 37.448463853498723], [119.702802362142037, 37.156388658185072], [120.823457472823648, 37.870427761377968], [121.711258579597938, 37.481123358707165], [122.357937453298462, 37.454484157860684], [122.519994744965814, 36.930614325501828], [121.104163853033029, 36.651329047180432], [120.63700890511457, 36.111439520811125], [119.66456180224607, 35.609790554337728], [119.151208123858567, 34.909859117160458], [120.227524855633717, 34.360331936168613], [120.620369093916565, 33.37672272392512], [121.229014113450219, 32.460318711877186], [121.908145786630044, 31.692174384074683], [121.891919386890336, 30.949351508095098], [121.264257440273298, 30.676267401648712], [121.503519321784722, 30.14291494396425], [122.092113885589086, 29.832520453403156], [121.93842817595305, 29.018022365834803], [121.684438511238469, 28.225512600206677], [121.125661248866436, 28.135673122667178], [120.395473260582307, 27.053206895449385], [119.585496860839555, 25.740780544532605], [118.656871372554519, 24.547390855400234], [117.281606479970833, 23.624501451099714], [115.890735304835118, 22.782873236578094], [114.763827345846209, 22.668074042241663], [114.152546828265656, 22.223760077396204], [113.806779819800752, 22.548339748621423], [113.241077915501592, 22.051367499270462], [111.843592157032447, 21.550493679281512], [110.78546552942413, 21.39714386645533], [110.444039341271662, 20.34103261970639], [109.88986128137357, 20.282457383703441], [109.627655063924635, 21.008227037026725], [109.864488153118316, 21.395050970947516], [108.522812941524421, 21.715212307211821], [108.050180291782979, 21.552379869060101], [107.043420037872636, 21.8118989120299], [106.567273390735352, 22.21820486092474], [106.725403273548466, 22.794267889898375], [105.811247186305209, 22.976892401617899], [105.329209425886631, 23.352063300056976], [104.476858351664475, 22.819150092046918], [103.504514601660503, 22.703756618739217], [102.706992222100155, 22.708795070887696], [102.170435825613552, 22.464753119389336], [101.652017856861576, 22.318198757409554], [101.803119744882906, 21.174366766845051], [101.27002566936001, 21.201651923095167], [101.180005324307558, 21.436572984294052], [101.150032993578236, 21.849984442629015], [100.416537713627349, 21.558839423096654], [99.983489211021549, 21.742936713136451], [99.240898878987196, 22.118314317304559], [99.53199222208741, 22.949038804612591], [98.898749220782804, 23.142722072842581], [98.66026248575578, 24.063286037690002], [97.604719679762027, 23.897404690033049], [97.724609002679131, 25.083637193293036], [98.671838006589212, 25.91870250091349], [98.712093947344556, 26.743535874940243], [98.682690057370507, 27.508812160750658], [98.246230910233351, 27.747221381129172], [97.91198774616943, 28.335945136014367], [97.327113885490007, 28.261582749946339], [96.248833449287829, 28.411030992134467], [96.586590610747521, 28.830979519154361], [96.117678664131006, 29.452802028922513], [95.404802280664626, 29.031716620392157], [94.565990431702929, 29.27743805593996], [93.413347609432662, 28.640629380807233], [92.503118931043616, 27.896876329046442], [91.696656528696693, 27.771741848251615], [91.258853794319876, 28.040614325466343], [90.730513950567797, 28.064953925075738], [90.015828891971182, 28.296438503527177], [89.475810174521158, 28.042758897406365], [88.814248488320573, 27.299315904239389], [88.730325962278528, 28.086864732367552], [88.120440708369941, 27.876541652939572], [86.954517043000635, 27.974261786403524], [85.823319940131526, 28.203575954698742], [85.011638218123053, 28.642773952747369], [84.23457970575015, 28.839893703724691], [83.89899295444674, 29.320226141877633], [83.337115106137176, 29.463731594352193], [82.327512648450877, 30.115268052688204], [81.525804477874786, 30.422716986608659], [81.111256138029276, 30.183480943313402], [79.721366815107118, 30.882714748654728], [78.738894484374001, 31.515906073527045], [78.458446486326025, 32.61816437431272], [79.176128777995544, 32.483779812137747], [79.208891636068543, 32.994394639613738], [78.811086460285722, 33.506198025032397], [78.912268914713209, 34.321936346975768], [77.83745079947461, 35.494009507787794], [76.192848341785705, 35.89840342868785], [75.896897414050173, 36.666806138651872], [75.158027785140987, 37.133030910789152], [74.980002475895404, 37.419990139305888], [74.829985792952144, 37.990007025701445], [74.864815708316783, 38.378846340481587], [74.25751427602269, 38.606506862943476], [73.928852166646394, 38.505815334622717], [73.675379266254836, 39.431236884105566], [73.960013055318427, 39.660008449861714], [73.822243686828315, 39.893973497063136], [74.776862420556043, 40.366425279291619], [75.467827996730719, 40.56207225194867], [76.526368035797432, 40.427946071935132], [76.90448449087711, 41.066485907549648], [78.187196893226044, 41.185315863604799], [78.543660923175253, 41.582242540038713], [80.119430373051401, 42.12394074153822], [80.259990268885318, 42.34999929459908], [80.180150180994374, 42.920067857426844], [80.866206496101213, 43.180362046881008], [79.966106398441426, 44.917516994804622], [81.947070753918084, 45.317027492853143], [82.458925815769035, 45.539649563166499], [83.180483839860543, 47.330031236350735], [85.164290399113213, 47.000955715516099], [85.720483839870667, 47.452969468773077], [85.76823286330837, 48.455750637396896], [86.59877648310335, 48.549181626980605], [87.359970330762692, 49.214980780629148], [87.751264276076668, 49.297197984405464], [88.013832228551678, 48.599462795600594], [88.854297723346747, 48.069081732773007], [90.280825636763893, 47.693549099307901], [90.970809360724957, 46.88814606382293], [90.585768263718307, 45.719716091487491], [90.945539585334316, 45.286073309910243], [92.133890822318222, 45.115075995456429], [93.480733677141316, 44.97547211362], [94.688928664125356, 44.352331854828456], [95.306875441471504, 44.241330878265458], [95.762454868556688, 43.319449164394619], [96.349395786527808, 42.725635280928643], [97.451757440177971, 42.74888967546007], [99.515817498779995, 42.524691473961688], [100.845865513108279, 42.663804429691417], [101.833040399179936, 42.51487295182627], [103.312278273534787, 41.907468166667613], [104.522281935649005, 41.90834666601662], [104.964993931093431, 41.597409572916334], [106.129315627061658, 42.134327704428891], [107.744772576937976, 42.481515814781908], [109.243595819131428, 42.519446316084149], [110.412103306115299, 42.871233628911014], [111.129682244920218, 43.406834011400171], [111.82958784388137, 43.743118394539486], [111.667737257943202, 44.073175767587706], [111.348376906379428, 44.457441718110047], [111.87330610560025, 45.102079372735112], [112.436062453258842, 45.01164561622425], [113.463906691544196, 44.808893134127111], [114.46033165899604, 45.339816799493875], [115.985096470200133, 45.727235012386004], [116.717868280098855, 46.38820241961524], [117.421701287914246, 46.67273285581421], [118.874325799638711, 46.805412095723646], [119.663269891438745, 46.692679958678944], [119.772823927897562, 47.048058783550132], [118.866574334794947, 47.747060044946195], [118.064142694166719, 48.06673045510373], [117.295507440257438, 47.697709052107385], [116.308952671373234, 47.853410142602812], [115.742837355615734, 47.726544501326273], [115.485282017073018, 48.135382595403442], [116.191802199367601, 49.134598090199056], [116.67880089728618, 49.888531399121398], [117.879244419426371, 49.510983384796944], [119.288460728025839, 50.142882798862033], [119.279365675942358, 50.582907619827282], [120.182049595216924, 51.64356639261802], [120.738191359541972, 51.964115302124547], [120.725789015791975, 52.516226304730814], [120.177088657716865, 52.753886216841195], [121.003084751470226, 53.251401068731226], [122.245747918792858, 53.431725979213681], [123.571506789240843, 53.458804429734627], [125.068211297710434, 53.161044826868832], [125.946348911646169, 52.792798570356936], [126.564399041856959, 51.784255479532689], [126.939156528837657, 51.353894151405896], [127.287455682484904, 50.739797268265434], [127.657407261262378, 49.760270494172929]]]] } }, - { "type": "Feature", "properties": { "admin": "Ivory Coast", "name": "Côte d'Ivoire", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.856125047202397, 4.994475816259508], [-3.311084357100071, 4.984295559098014], [-4.008819545904941, 5.179813340674314], [-4.64991736491791, 5.168263658057084], [-5.834496222344525, 4.993700669775135], [-6.528769090185845, 4.705087795425015], [-7.518941209330434, 4.338288479017307], [-7.712159389669749, 4.364565944837721], [-7.63536821128403, 5.188159084489455], [-7.53971513511176, 5.313345241716517], [-7.570152553731686, 5.707352199725903], [-7.993692592795879, 6.126189683451541], [-8.311347622094017, 6.193033148621081], [-8.602880214868618, 6.467564195171659], [-8.385451626000572, 6.911800645368742], [-8.485445522485348, 7.395207831243068], [-8.439298468448696, 7.686042792181736], [-8.280703497744936, 7.687179673692156], [-8.221792364932197, 8.123328762235571], [-8.299048631208562, 8.316443589710302], [-8.203498907900878, 8.455453192575446], [-7.832100389019186, 8.575704250518625], [-8.079113735374348, 9.376223863152033], [-8.309616461612249, 9.789531968622439], [-8.22933712404682, 10.129020290563897], [-8.029943610048617, 10.206534939001711], [-7.89958980959237, 10.297382106970824], [-7.622759161804808, 10.147236232946792], [-6.850506557635057, 10.138993841996237], [-6.666460944027547, 10.430810655148447], [-6.493965013037267, 10.411302801958268], [-6.205222947606429, 10.524060777219132], [-6.050452032892266, 10.096360785355442], [-5.816926235365286, 10.222554633012191], [-5.404341599946973, 10.370736802609144], [-4.954653286143098, 10.152713934769732], [-4.779883592131966, 9.821984768101741], [-4.330246954760383, 9.610834865757139], [-3.980449184576684, 9.862344061721698], [-3.511898972986272, 9.900326239456216], [-2.827496303712706, 9.642460842319775], [-2.56218950032624, 8.219627793811481], [-2.983584967450326, 7.379704901555511], [-3.244370083011261, 6.2504715031135], [-2.810701463217839, 5.389051215024109], [-2.856125047202397, 4.994475816259508]]] } }, - { "type": "Feature", "properties": { "admin": "Cameroon", "name": "Cameroon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[13.07582238124675, 2.267097072759014], [12.951333855855605, 2.321615708826939], [12.359380323952218, 2.19281220133945], [11.751665480199787, 2.326757513839993], [11.276449008843711, 2.261050930180871], [9.649158155972627, 2.283866075037735], [9.795195753629455, 3.073404445809117], [9.404366896205998, 3.734526882335202], [8.948115675501068, 3.904128933117135], [8.744923943729416, 4.352215277519959], [8.488815545290889, 4.495617377129917], [8.500287713259693, 4.771982937026847], [8.757532993208626, 5.47966583904791], [9.233162876023043, 6.444490668153334], [9.522705926154398, 6.453482367372116], [10.118276808318255, 7.038769639509879], [10.497375115611417, 7.055357774275562], [11.058787876030349, 6.644426784690593], [11.745774366918509, 6.981382961449753], [11.839308709366801, 7.397042344589434], [12.063946160539556, 7.799808457872301], [12.218872104550597, 8.305824082874322], [12.753671502339214, 8.717762762888993], [12.955467970438971, 9.417771714714702], [13.1675997249971, 9.64062632897341], [13.308676385153914, 10.160362046748926], [13.572949659894558, 10.798565985553564], [14.415378859116682, 11.572368882692071], [14.468192172918974, 11.90475169519341], [14.57717776862253, 12.085360826053501], [14.181336297266792, 12.483656927943112], [14.213530714584634, 12.802035427293344], [14.495787387762842, 12.859396267137326], [14.893385857816522, 12.219047756392582], [14.960151808337598, 11.555574042197222], [14.923564894274955, 10.891325181517471], [15.467872755605269, 9.982336737503429], [14.909353875394713, 9.99212942142273], [14.627200555081057, 9.920919297724536], [14.171466098699025, 10.021378282099928], [13.954218377344002, 9.549494940626685], [14.544466586981766, 8.965861314322266], [14.979995558337688, 8.796104234243471], [15.120865512765331, 8.382150173369423], [15.436091749745765, 7.692812404811971], [15.279460483469107, 7.421924546737968], [14.776545444404572, 6.408498033062044], [14.536560092841111, 6.22695872642069], [14.459407179429345, 5.451760565610299], [14.558935988023501, 5.03059764243153], [14.478372430080466, 4.732605495620446], [14.950953403389658, 4.21038930909492], [15.036219516671249, 3.851367295747123], [15.405395948964379, 3.335300604664339], [15.862732374747479, 3.013537298998982], [15.907380812247649, 2.557389431158612], [16.01285241055535, 2.267639675298084], [15.940918816805061, 1.727672634280295], [15.14634199388524, 1.964014797367184], [14.337812534246577, 2.22787466064949], [13.07582238124675, 2.267097072759014]]] } }, - { "type": "Feature", "properties": { "admin": "Democratic Republic of the Congo", "name": "Dem. Rep. Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.833859897593801, 3.50916596111034], [30.773346795380036, 2.339883327642127], [31.174149204235807, 2.204465236821263], [30.852670118948048, 1.849396470543809], [30.468507521290292, 1.58380544677972], [30.086153598762703, 1.062312730306288], [29.875778842902488, 0.597379868976304], [29.819503208136634, -0.205310153813372], [29.587837762172164, -0.58740569417948], [29.579466180140876, -1.341313164885626], [29.29188683443661, -1.620055840667987], [29.254834832483336, -2.215109958508911], [29.117478875451546, -2.292211195488384], [29.02492638521678, -2.839257907730157], [29.276383904749046, -3.293907159034063], [29.339997592900342, -4.499983412294092], [29.519986606572925, -5.419978936386313], [29.41999271008816, -5.939998874539432], [29.620032179490003, -6.520015150583424], [30.199996779101692, -7.079980970898161], [30.740015496551781, -8.340007419470913], [30.34608605319081, -8.238256524288216], [29.002912225060467, -8.40703175215347], [28.734866570762495, -8.526559340044576], [28.449871046672818, -9.164918308146083], [28.673681674928922, -9.605924981324931], [28.496069777141763, -10.789883721564044], [28.372253045370421, -11.793646742401389], [28.642417433392346, -11.971568698782312], [29.341547885869087, -12.36074391037241], [29.616001417771223, -12.178894545137307], [29.699613885219485, -13.257226657771827], [28.934285922976834, -13.248958428605132], [28.52356163912102, -12.698604424696679], [28.15510867687998, -12.272480564017894], [27.38879886242378, -12.132747491100663], [27.164419793412456, -11.608748467661071], [26.55308759939961, -11.924439792532125], [25.752309604604726, -11.784965101776356], [25.418118116973197, -11.330935967659958], [24.783169793402948, -11.238693536018962], [24.314516228947948, -11.262826429899269], [24.257155389103982, -10.951992689663655], [23.912215203555714, -10.926826267137512], [23.456790805767433, -10.867863457892481], [22.837345411884733, -11.017621758674329], [22.402798292742371, -10.99307545333569], [22.155268182064304, -11.084801120653768], [22.208753289486388, -9.894796237836507], [21.87518191904234, -9.523707777548564], [21.801801385187897, -8.908706556842978], [21.949130893652036, -8.305900974158275], [21.746455926203303, -7.920084730667147], [21.728110792739695, -7.2908724910813], [20.514748162526498, -7.299605808138629], [20.601822950938292, -6.93931772219968], [20.091621534920645, -6.943090101756993], [20.037723016040214, -7.116361179231644], [19.417502475673157, -7.155428562044297], [19.166613396896107, -7.738183688999753], [19.016751743249664, -7.988245944860132], [18.464175652752683, -7.847014255406442], [18.134221632569048, -7.98767750410492], [17.472970004962232, -8.068551120641699], [17.089995965247166, -7.545688978712525], [16.860190870845198, -7.222297865429984], [16.573179965896141, -6.622644545115087], [16.326528354567042, -5.877470391466267], [13.375597364971892, -5.864241224799548], [13.02486941900696, -5.984388929878157], [12.735171339578695, -5.965682061388497], [12.322431674863507, -6.100092461779658], [12.182336866920249, -5.789930515163837], [12.436688266660866, -5.684303887559245], [12.468004184629734, -5.248361504745003], [12.631611769265788, -4.991271254092935], [12.995517205465173, -4.781103203961883], [13.258240187237044, -4.882957452009165], [13.600234816144676, -4.500138441590969], [14.144956088933295, -4.510008640158715], [14.209034864975219, -4.793092136253597], [14.582603794013179, -4.970238946150139], [15.170991652088441, -4.3435071753143], [15.753540073314749, -3.855164890156096], [16.006289503654298, -3.535132744972528], [15.972803175529149, -2.712392266453612], [16.407091912510051, -1.740927015798682], [16.86530683764212, -1.225816338713287], [17.523716261472853, -0.743830254726987], [17.638644646889983, -0.424831638189246], [17.663552687254676, -0.058083998213817], [17.826540154703245, 0.288923244626105], [17.774191928791563, 0.855658677571085], [17.89883548347958, 1.741831976728278], [18.09427575040743, 2.365721543788055], [18.39379235197114, 2.90044342692822], [18.453065219809925, 3.504385891123348], [18.542982211997778, 4.201785183118317], [18.932312452884755, 4.709506130385973], [19.467783644293146, 5.031527818212779], [20.290679152108932, 4.691677761245287], [20.927591180106273, 4.322785549329736], [21.659122755630019, 4.224341945813719], [22.405123732195531, 4.02916006104732], [22.704123569436284, 4.633050848810156], [22.841479526468103, 4.710126247573483], [23.297213982850135, 4.609693101414221], [24.41053104014625, 5.108784084489129], [24.805028924262409, 4.897246608902349], [25.128833449003274, 4.927244777847789], [25.278798455514302, 5.170408229997191], [25.650455356557465, 5.256087754737123], [26.402760857862535, 5.150874538590869], [27.044065382604703, 5.127852688004835], [27.374226108517483, 5.233944403500059], [27.979977247842807, 4.408413397637373], [28.428993768026906, 4.287154649264493], [28.696677687298795, 4.455077215996936], [29.159078403446497, 4.38926727947323], [29.715995314256013, 4.600804755060024], [29.953500197069467, 4.173699042167683], [30.833859897593801, 3.50916596111034]]] } }, - { "type": "Feature", "properties": { "admin": "Republic of Congo", "name": "Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[12.995517205465173, -4.781103203961883], [12.620759718484491, -4.438023369976135], [12.318607618873923, -4.606230157086187], [11.914963006242086, -5.037986748884789], [11.093772820691923, -3.978826592630546], [11.855121697648114, -3.42687061932105], [11.478038771214299, -2.765618991714241], [11.820963575903189, -2.514161472181982], [12.495702752338159, -2.391688327650242], [12.575284458067639, -1.948511244315134], [13.109618767965626, -2.428740329603513], [13.992407260807706, -2.470804945489099], [14.299210239324564, -1.998275648612213], [14.425455763413593, -1.333406670744971], [14.316418491277741, -0.552627455247048], [13.843320753645653, 0.038757635901149], [14.276265903386953, 1.196929836426619], [14.026668735417214, 1.395677395021153], [13.282631463278816, 1.31418366129688], [13.003113641012074, 1.830896307783319], [13.07582238124675, 2.267097072759014], [14.337812534246577, 2.22787466064949], [15.14634199388524, 1.964014797367184], [15.940918816805061, 1.727672634280295], [16.01285241055535, 2.267639675298084], [16.537058139724135, 3.198254706226278], [17.133042433346297, 3.728196519379451], [17.809900343505259, 3.560196437998569], [18.453065219809925, 3.504385891123348], [18.39379235197114, 2.90044342692822], [18.09427575040743, 2.365721543788055], [17.89883548347958, 1.741831976728278], [17.774191928791563, 0.855658677571085], [17.826540154703245, 0.288923244626105], [17.663552687254676, -0.058083998213817], [17.638644646889983, -0.424831638189246], [17.523716261472853, -0.743830254726987], [16.86530683764212, -1.225816338713287], [16.407091912510051, -1.740927015798682], [15.972803175529149, -2.712392266453612], [16.006289503654298, -3.535132744972528], [15.753540073314749, -3.855164890156096], [15.170991652088441, -4.3435071753143], [14.582603794013179, -4.970238946150139], [14.209034864975219, -4.793092136253597], [14.144956088933295, -4.510008640158715], [13.600234816144676, -4.500138441590969], [13.258240187237044, -4.882957452009165], [12.995517205465173, -4.781103203961883]]] } }, - { "type": "Feature", "properties": { "admin": "Colombia", "name": "Colombia", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-75.373223232713841, -0.15203175212045], [-75.801465827116587, 0.084801337073202], [-76.292314419240938, 0.416047268064119], [-76.576379767549383, 0.256935533037435], [-77.424984300430367, 0.395686753741117], [-77.668612840470416, 0.825893052570961], [-77.855061408179509, 0.809925034992773], [-78.855258755188686, 1.380923773601822], [-78.990935228171026, 1.691369940595251], [-78.617831387023699, 1.766404120283056], [-78.662118089497838, 2.267355454920476], [-78.427610439757302, 2.629555568854215], [-77.931542527971473, 2.696605739752925], [-77.510431281224996, 3.325016994638246], [-77.127689785455246, 3.849636135265356], [-77.496271938776999, 4.087606105969427], [-77.307601284479375, 4.667984117039452], [-77.533220587865713, 5.582811997902496], [-77.318815070286718, 5.845354112161359], [-77.476660732722266, 6.691116441266301], [-77.881571417945239, 7.223771267114783], [-77.75341386586139, 7.709839789252141], [-77.431107957656977, 7.638061224798733], [-77.242566494440069, 7.935278225125442], [-77.474722866511314, 8.524286200388216], [-77.353360765273848, 8.670504665558068], [-76.836673957003541, 8.638749497914715], [-76.086383836557843, 9.336820583529486], [-75.674600185840035, 9.443248195834597], [-75.664704149056149, 9.774003200718736], [-75.480425991503338, 10.618990383339305], [-74.906895107711975, 11.08304474532032], [-74.276752692344871, 11.102035834187586], [-74.197222663047683, 11.310472723836865], [-73.414763963500278, 11.227015285685479], [-72.62783525255962, 11.731971543825519], [-72.238194953078903, 11.955549628136325], [-71.754090135368628, 12.437303168177305], [-71.399822353791691, 12.376040757695289], [-71.137461107045866, 12.112981879113503], [-71.331583624950284, 11.776284084515805], [-71.973921678338272, 11.608671576377116], [-72.227575446242923, 11.108702093953237], [-72.614657762325194, 10.821975409381777], [-72.905286017534692, 10.45034434655477], [-73.027604132769554, 9.736770331252441], [-73.304951544880026, 9.151999823437604], [-72.788729824500379, 9.085027167187331], [-72.660494757768092, 8.62528778730268], [-72.439862230097944, 8.405275376820027], [-72.360900641555958, 8.002638454617893], [-72.479678921178831, 7.632506008327352], [-72.444487270788059, 7.42378489830048], [-72.19835242378187, 7.340430813013682], [-71.960175747348629, 6.991614895043538], [-70.674233567981503, 7.087784735538717], [-70.093312954372408, 6.960376491723109], [-69.389479946557103, 6.099860541198835], [-68.985318569602327, 6.206804917826856], [-68.265052456318216, 6.153268133972473], [-67.695087246355001, 6.267318020040645], [-67.34143958196556, 6.095468044454021], [-67.521531948502741, 5.556870428891968], [-67.744696621355203, 5.221128648291667], [-67.823012254493534, 4.503937282728898], [-67.621835903581271, 3.839481716319994], [-67.33756384954367, 3.542342230641721], [-67.303173183853417, 3.31845408773718], [-67.809938117123693, 2.820655015469569], [-67.447092047786299, 2.600280869960869], [-67.181294318293041, 2.250638129074062], [-66.876325853122566, 1.253360500489336], [-67.065048183852483, 1.130112209473225], [-67.25999752467358, 1.719998684084956], [-67.537810024674684, 2.037162787276329], [-67.868565029558823, 1.692455145673392], [-69.816973232691609, 1.714805202639624], [-69.804596727157701, 1.089081122233466], [-69.218637661400166, 0.985676581217433], [-69.252434048119042, 0.602650865070075], [-69.452396002872447, 0.706158758950693], [-70.015565761989293, 0.541414292804205], [-70.02065589057004, -0.185156345219539], [-69.577065395776586, -0.549991957200163], [-69.420485805932216, -1.122618503426409], [-69.444101935489599, -1.556287123219817], [-69.893635219996611, -4.298186944194326], [-70.394043952094975, -3.766591485207825], [-70.692682054309699, -3.742872002785858], [-70.047708502874841, -2.725156345229699], [-70.813475714791949, -2.256864515800742], [-71.413645799429773, -2.342802422702128], [-71.774760708285385, -2.169789727388937], [-72.325786505813639, -2.434218031426453], [-73.070392218707212, -2.308954359550952], [-73.659503546834586, -1.260491224781134], [-74.122395189089048, -1.002832533373848], [-74.441600511355958, -0.530820000819887], [-75.106624518520064, -0.05720549886486], [-75.373223232713841, -0.15203175212045]]] } }, - { "type": "Feature", "properties": { "admin": "Costa Rica", "name": "Costa Rica", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-82.965783047197348, 8.225027980985983], [-83.508437262694287, 8.446926581247281], [-83.711473965169063, 8.656836249216864], [-83.596313035806631, 8.830443223501417], [-83.632641567707822, 9.051385809765319], [-83.909885626953724, 9.290802720573579], [-84.303401658856345, 9.487354030795712], [-84.64764421256865, 9.615537421095707], [-84.713350796227743, 9.908051866083849], [-84.975660366541319, 10.086723130733004], [-84.911374884770211, 9.795991522658921], [-85.110923428065291, 9.557039699741308], [-85.339488288092255, 9.834542141148658], [-85.660786505866966, 9.93334747969072], [-85.797444831062819, 10.134885565629032], [-85.791708747078417, 10.439337266476612], [-85.65931372754666, 10.754330959511718], [-85.941725430021748, 10.895278428587799], [-85.712540452807289, 11.088444932494822], [-85.561851976244171, 11.217119248901593], [-84.903003302738924, 10.952303371621895], [-84.673069017256239, 11.082657172078139], [-84.355930752281026, 10.999225572142901], [-84.190178595704822, 10.793450018756671], [-83.895054490885926, 10.726839097532444], [-83.655611741861563, 10.938764146361418], [-83.402319708982944, 10.39543813724465], [-83.015676642575158, 9.992982082555553], [-82.546196255203469, 9.566134751824674], [-82.932890998043561, 9.476812038608172], [-82.927154914059145, 9.074330145702914], [-82.719183112300513, 8.925708726431493], [-82.868657192704759, 8.807266343618521], [-82.829770677405151, 8.626295477732368], [-82.9131764391242, 8.423517157419068], [-82.965783047197348, 8.225027980985983]]] } }, - { "type": "Feature", "properties": { "admin": "Cuba", "name": "Cuba", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-82.268151211257035, 23.188610744717703], [-81.404457160146819, 23.117271429938775], [-80.61876868358118, 23.105980129482994], [-79.679523688460222, 22.765303249598823], [-79.281485968732071, 22.399201565027049], [-78.347434455056472, 22.512166246017085], [-77.993295864560253, 22.277193508385928], [-77.146422492161037, 21.657851467367831], [-76.523824835908528, 21.20681956632437], [-76.194620123993175, 21.220565497314006], [-75.598222418912655, 21.01662445727413], [-75.671060350228032, 20.735091254147999], [-74.933896043584483, 20.693905137611381], [-74.178024868451246, 20.284627793859737], [-74.296648118777242, 20.050378526280678], [-74.961594611292924, 19.923435370355687], [-75.634680141894577, 19.873774318923193], [-76.323656175425981, 19.952890936762056], [-77.755480923153044, 19.855480861891873], [-77.085108405246729, 20.413353786698789], [-77.492654588516601, 20.673105373613886], [-78.137292243141573, 20.739948838783427], [-78.482826707661161, 21.028613389565848], [-78.719866502583997, 21.598113511638431], [-79.284999966127913, 21.559175319906497], [-80.217475348618635, 21.827324327069032], [-80.517534552721401, 22.037078965741756], [-81.820943366203167, 22.192056586185068], [-82.169991828118611, 22.387109279870746], [-81.79500179719264, 22.636964830001951], [-82.775897996740838, 22.688150336187057], [-83.494458787759328, 22.168517971276124], [-83.908800421875611, 22.154565334557329], [-84.052150845053248, 21.910575059491251], [-84.547030198896351, 21.801227728761639], [-84.974911058273079, 21.896028143801082], [-84.44706214062775, 22.204949856041903], [-84.23035702181177, 22.56575470630376], [-83.778239915690165, 22.78811839445569], [-83.267547573565736, 22.983041897060641], [-82.510436164057495, 23.078746649665181], [-82.268151211257035, 23.188610744717703]]] } }, - { "type": "Feature", "properties": { "admin": "Northern Cyprus", "name": "N. Cyprus", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[32.731780226377445, 35.14002594658843], [32.802473585752743, 35.145503648411363], [32.946960890440799, 35.38670339613369], [33.667227003724939, 35.373215847305509], [34.576473829900458, 35.671595567358786], [33.900804477684197, 35.245755927057608], [33.973616570783456, 35.058506374647997], [33.866439650210104, 35.093594672174177], [33.675391880027057, 35.017862860650446], [33.525685255677494, 35.038688462864066], [33.475817498515845, 35.000344550103499], [33.45592207208346, 35.101423651666401], [33.383833449036295, 35.162711900364563], [33.190977003723042, 35.173124701471373], [32.919572381326127, 35.087832749973636], [32.731780226377445, 35.14002594658843]]] } }, - { "type": "Feature", "properties": { "admin": "Cyprus", "name": "Cyprus", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[33.973616570783456, 35.058506374647997], [34.004880812320032, 34.978097846001852], [32.97982710137844, 34.571869411755436], [32.490296258277532, 34.701654771456468], [32.256667107885953, 35.103232326796622], [32.731780226377445, 35.14002594658843], [32.919572381326127, 35.087832749973636], [33.190977003723042, 35.173124701471373], [33.383833449036295, 35.162711900364563], [33.45592207208346, 35.101423651666401], [33.475817498515845, 35.000344550103499], [33.525685255677494, 35.038688462864066], [33.675391880027057, 35.017862860650446], [33.866439650210104, 35.093594672174177], [33.973616570783456, 35.058506374647997]]] } }, - { "type": "Feature", "properties": { "admin": "Czech Republic", "name": "Czech Rep.", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.960288120194573, 48.596982326850593], [16.49928266771877, 48.785808010445095], [16.029647251050218, 48.733899034207916], [15.253415561593979, 49.039074205107575], [14.901447381254055, 48.964401760445817], [14.33889773932472, 48.555305284207193], [13.595945672264433, 48.877171942737135], [13.031328973043427, 49.307068182973232], [12.52102420416119, 49.54741526956272], [12.415190870827441, 49.96912079528056], [12.240111118222556, 50.266337795607271], [12.96683678554319, 50.484076443069071], [13.338131951560282, 50.733234361364346], [14.05622765468817, 50.926917629594286], [14.307013380600633, 51.117267767941399], [14.570718214586062, 51.002339382524262], [15.016995883858666, 51.106674099321566], [15.490972120839725, 50.7847299261432], [16.238626743238566, 50.697732652379827], [16.176253289462263, 50.4226073268579], [16.719475945714429, 50.215746568393527], [16.868769158605655, 50.473973700556016], [17.554567091551117, 50.36214590107641], [17.649445021238986, 50.049038397819942], [18.392913852622168, 49.988628648470737], [18.85314415861361, 49.496229763377634], [18.554971144289478, 49.495015367218777], [18.399993523846174, 49.315000515330034], [18.170498488037961, 49.271514797556421], [18.104972771891848, 49.043983466175298], [17.913511590250462, 48.996492824899072], [17.886484816161808, 48.903475246773695], [17.545006951577101, 48.800019029325362], [17.101984897538895, 48.8169688991171], [16.960288120194573, 48.596982326850593]]] } }, - { "type": "Feature", "properties": { "admin": "Germany", "name": "Germany", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.92190636560923, 54.983104153048025], [9.939579705452898, 54.596641954153242], [10.950112338920517, 54.363607082733147], [10.939466993868447, 54.008693345752583], [11.95625247564328, 54.196485500701144], [12.518440382546711, 54.470370591847988], [13.647467075259495, 54.075510972705885], [14.119686313542555, 53.757029120491026], [14.353315463934164, 53.248171291713092], [14.074521111719431, 52.981262518925334], [14.437599725002197, 52.62485016540829], [14.685026482815713, 52.089947414755208], [14.607098422919645, 51.745188096719964], [15.016995883858781, 51.106674099321701], [14.570718214586119, 51.002339382524369], [14.307013380600662, 51.117267767941364], [14.05622765468831, 50.92691762959435], [13.338131951560397, 50.733234361364268], [12.966836785543249, 50.484076443069164], [12.240111118222668, 50.266337795607214], [12.41519087082747, 49.969120795280602], [12.521024204161332, 49.547415269562741], [13.031328973043513, 49.307068182973232], [13.595945672264575, 48.877171942737156], [13.243357374737112, 48.416114813829026], [12.884102817443873, 48.289145819687846], [13.025851271220514, 47.637583523135945], [12.93262698736606, 47.467645575543983], [12.620759718484519, 47.672387600284409], [12.141357456112869, 47.703083401065768], [11.426414015354847, 47.523766181013045], [10.544504021861597, 47.566399237653783], [10.402083774465321, 47.302487697939164], [9.896068149463188, 47.58019684507569], [9.594226108446376, 47.525058091820185], [8.522611932009793, 47.830827541691342], [8.317301466514092, 47.613579820336263], [7.466759067422286, 47.620581976911907], [7.59367638513106, 48.333019110703724], [8.099278598674855, 49.017783515003423], [6.658229607783709, 49.201958319691627], [6.186320428094176, 49.4638028021145], [6.242751092156992, 49.90222565367872], [6.043073357781109, 50.128051662794221], [6.156658155958779, 50.803721015010574], [5.988658074577812, 51.85161570902504], [6.589396599970825, 51.85202912048338], [6.842869500362381, 52.228440253297542], [7.092053256873895, 53.14404328064488], [6.905139601274128, 53.482162177130633], [7.100424838905268, 53.693932196662658], [7.936239454793961, 53.748295803433777], [8.121706170289483, 53.527792466844275], [8.800734490604667, 54.02078563090889], [8.572117954145368, 54.395646470754045], [8.526229282270206, 54.962743638725144], [9.282048780971136, 54.830865383516297], [9.92190636560923, 54.983104153048025]]] } }, - { "type": "Feature", "properties": { "admin": "Djibouti", "name": "Djibouti", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[43.081226027200152, 12.699638576707112], [43.317852410664663, 12.390148423711022], [43.286381463398911, 11.974928290245883], [42.715873650896519, 11.735640570518338], [43.145304803242126, 11.462039699748853], [42.776851841000948, 10.926878566934416], [42.55493000000012, 11.105110000000193], [42.314140000000116, 11.0342], [41.755570000000191, 11.05091], [41.739590000000177, 11.355110000000137], [41.661760000000122, 11.6312], [42.000000000000107, 12.100000000000133], [42.351560000000106, 12.54223000000013], [42.779642368344739, 12.455415757695672], [43.081226027200152, 12.699638576707112]]] } }, - { "type": "Feature", "properties": { "admin": "Denmark", "name": "Denmark", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[12.690006137755629, 55.60999095318077], [12.089991082414738, 54.800014553437919], [11.043543328504226, 55.36486379660424], [10.90391360845163, 55.779954738988735], [12.370904168353288, 56.111407375708822], [12.690006137755629, 55.60999095318077]]], [[[10.912181837618359, 56.4586213242779], [10.667803989309986, 56.081383368547208], [10.369992710011983, 56.190007229224719], [9.649984978889306, 55.469999498102041], [9.921906365609173, 54.983104153048046], [9.282048780971136, 54.830865383516155], [8.526229282270235, 54.962743638724973], [8.120310906617588, 55.517722683323612], [8.089976840862247, 56.540011705137587], [8.256581658571262, 56.809969387430286], [8.543437534223385, 57.110002753316891], [9.424469028367609, 57.172066148499468], [9.775558709358561, 57.447940782289649], [10.580005730846151, 57.730016587954843], [10.54610599126269, 57.21573273378614], [10.250000034230222, 56.890016181050456], [10.369992710011983, 56.60998159446082], [10.912181837618359, 56.4586213242779]]]] } }, - { "type": "Feature", "properties": { "admin": "Dominican Republic", "name": "Dominican Rep.", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-71.71236141629295, 19.714455878167353], [-71.587304450146604, 19.884910590082093], [-70.806706102161726, 19.880285549391981], [-70.214364997016119, 19.622885240146157], [-69.950815192327568, 19.647999986240002], [-69.769250047470067, 19.293267116772437], [-69.222125820579862, 19.313214219637096], [-69.254346076113819, 19.015196234609871], [-68.809411994080818, 18.979074408437846], [-68.317943284768958, 18.612197577381689], [-68.689315965434503, 18.205142320218609], [-69.164945848248905, 18.422648423735108], [-69.623987596297624, 18.380712998930246], [-69.952933926051529, 18.428306993071057], [-70.133232998317879, 18.245915025296892], [-70.517137213814195, 18.184290879788829], [-70.669298468697619, 18.42688589118303], [-70.999950120717173, 18.283328762276206], [-71.400209927033885, 17.598564357976596], [-71.657661912712001, 17.757572740138695], [-71.708304816358037, 18.044997056546091], [-71.687737596305865, 18.316660061104468], [-71.945112067335543, 18.616900132720257], [-71.701302659782485, 18.785416978424049], [-71.624873216422813, 19.169837958243303], [-71.71236141629295, 19.714455878167353]]] } }, - { "type": "Feature", "properties": { "admin": "Algeria", "name": "Algeria", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[11.99950564947161, 23.471668402596443], [8.572893100629782, 21.565660712159136], [5.677565952180684, 19.601206976799713], [4.267419467800038, 19.155265204336995], [3.158133172222704, 19.057364203360034], [3.146661004253899, 19.693578599521441], [2.683588494486428, 19.856230170160114], [2.060990838233919, 20.142233384679482], [1.823227573259032, 20.61080943448604], [-1.550054897457613, 22.792665920497377], [-4.92333736817423, 24.974574082940993], [-8.684399786809051, 27.395744126895998], [-8.66512447756419, 27.58947907155822], [-8.665589565454805, 27.656425889592349], [-8.674116176782972, 28.841288967396572], [-7.059227667661928, 29.579228420524522], [-6.060632290053772, 29.731699734001687], [-5.242129278982786, 30.000443020135581], [-4.859646165374469, 30.501187649043839], [-3.690441046554695, 30.896951605751152], [-3.647497931320145, 31.637294012980668], [-3.068980271812647, 31.724497992473207], [-2.616604783529567, 32.094346218386143], [-1.30789913573787, 32.262888902306095], [-1.124551153966308, 32.651521511357124], [-1.388049282222567, 32.864015000941301], [-1.733454555661467, 33.91971283623198], [-1.792985805661686, 34.527918606091198], [-2.169913702798624, 35.168396307916673], [-1.208602871089056, 35.71484874118709], [-0.127454392894606, 35.888662421200799], [0.503876580415209, 36.301272894835272], [1.466918572606545, 36.605647081034398], [3.161698846050824, 36.783904934225205], [4.815758090849129, 36.865036932923452], [5.320120070017792, 36.716518866516616], [6.261819695672611, 37.110655015606731], [7.330384962603969, 37.118380642234364], [7.737078484741003, 36.885707505840209], [8.420964389691674, 36.946427313783154], [8.217824334352313, 36.433176988260271], [8.376367628623766, 35.479876003555937], [8.140981479534302, 34.655145982393783], [7.524481642292242, 34.097376410451453], [7.612641635782181, 33.344114895148955], [8.430472853233367, 32.748337307255944], [8.439102817426116, 32.506284898400814], [9.055602654668148, 32.102691962201284], [9.482139926805273, 30.307556057246181], [9.805634392952411, 29.424638373323383], [9.859997999723443, 28.959989732371007], [9.683884718472765, 28.144173895779193], [9.756128370816779, 27.688258571884141], [9.629056023811073, 27.140953477480913], [9.716285841519747, 26.512206325785691], [9.319410841518161, 26.094324856057447], [9.910692579801774, 25.365454616796733], [9.948261346077969, 24.93695364023251], [10.30384687667836, 24.37931325937091], [10.771363559622925, 24.562532050061744], [11.560669386449002, 24.097909247325511], [11.99950564947161, 23.471668402596443]]] } }, - { "type": "Feature", "properties": { "admin": "Ecuador", "name": "Ecuador", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-80.302560594387188, -3.404856459164712], [-79.770293341780913, -2.65751189535964], [-79.986559210922394, -2.220794366061014], [-80.368783942369234, -2.685158786635788], [-80.967765469064332, -2.246942640800703], [-80.764806281238023, -1.965047702648532], [-80.933659023751702, -1.057454522306358], [-80.583370327461239, -0.906662692878683], [-80.39932471385373, -0.283703301600141], [-80.020898200180355, 0.360340074053468], [-80.090609707342097, 0.768428859862396], [-79.542762010399784, 0.982937730305963], [-78.855258755188686, 1.380923773601822], [-77.855061408179509, 0.809925034992773], [-77.668612840470416, 0.825893052570961], [-77.424984300430367, 0.395686753741117], [-76.576379767549383, 0.256935533037435], [-76.292314419240938, 0.416047268064119], [-75.801465827116587, 0.084801337073202], [-75.373223232713841, -0.15203175212045], [-75.233722703741932, -0.911416924649529], [-75.544995693652027, -1.56160979574588], [-76.635394253226707, -2.608677666843817], [-77.83790483265858, -3.003020521663103], [-78.450683966775628, -3.873096612161375], [-78.639897223612323, -4.547784112164072], [-79.205289069317715, -4.959128513207388], [-79.62497921417615, -4.454198093283494], [-80.028908047185581, -4.346090996928893], [-80.442241990872134, -4.425724379090673], [-80.46929460317692, -4.059286797708999], [-80.184014858709645, -3.821161797708043], [-80.302560594387188, -3.404856459164712]]] } }, - { "type": "Feature", "properties": { "admin": "Egypt", "name": "Egypt", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.9226, 29.50133], [34.64174, 29.09942], [34.42655, 28.34399], [34.15451, 27.8233], [33.92136, 27.6487], [33.58811, 27.97136], [33.13676, 28.41765], [32.42323, 29.85108], [32.32046, 29.76043], [32.73482, 28.70523], [33.34876, 27.69989], [34.10455, 26.14227], [34.47387, 25.59856], [34.79507, 25.03375], [35.69241, 23.92671], [35.49372, 23.75237], [35.52598, 23.10244], [36.69069, 22.20485], [36.86623, 22.0], [32.9, 22.0], [29.02, 22.0], [25.0, 22.0], [25.0, 25.682499996360992], [25.0, 29.238654529533452], [24.70007, 30.04419], [24.95762, 30.6616], [24.80287, 31.08929], [25.16482, 31.56915], [26.49533, 31.58568], [27.45762, 31.32126], [28.45048, 31.02577], [28.91353, 30.87005], [29.68342, 31.18686], [30.09503, 31.4734], [30.97693, 31.55586], [31.68796, 31.4296], [31.96041, 30.9336], [32.19247, 31.26034], [32.99392, 31.02407], [33.7734, 30.96746], [34.26544, 31.21936], [34.9226, 29.50133]]] } }, - { "type": "Feature", "properties": { "admin": "Eritrea", "name": "Eritrea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[42.351560000000106, 12.54223000000013], [42.00975, 12.86582], [41.59856, 13.452090000000108], [41.15519371924983, 13.773319810435224], [40.8966, 14.118640000000138], [40.026218702969167, 14.519579169162281], [39.34061, 14.53155], [39.0994, 14.74064], [38.51295, 14.50547], [37.90607, 14.959430000000165], [37.59377, 14.2131], [36.42951, 14.42211], [36.323188917798113, 14.822480577041057], [36.753860304518575, 16.291874091044289], [36.852530000000108, 16.95655], [37.16747, 17.263140000000128], [37.904000000000103, 17.42754], [38.410089959473218, 17.998307399970312], [38.990622999839999, 16.84062612555169], [39.266110060388016, 15.922723496967246], [39.814293654140208, 15.435647284400314], [41.179274936697645, 14.491079616753209], [41.734951613132345, 13.921036892141554], [42.276830682144848, 13.34399201095442], [42.589576450375255, 13.000421250861901], [43.081226027200152, 12.699638576707112], [42.779642368344739, 12.455415757695672], [42.351560000000106, 12.54223000000013]]] } }, - { "type": "Feature", "properties": { "admin": "Spain", "name": "Spain", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-9.034817674180244, 41.880570583659669], [-8.98443315269567, 42.592775173506261], [-9.392883673530644, 43.026624660812686], [-7.978189663108308, 43.748337714200979], [-6.754491746436754, 43.567909450853918], [-5.411886359061596, 43.574239813809669], [-4.347842779955783, 43.403449205085025], [-3.51753170410609, 43.455900783861296], [-1.901351284177764, 43.422802028978332], [-1.502770961910528, 43.034014390630425], [0.338046909190581, 42.579546006839543], [0.701590610363894, 42.795734361332599], [1.826793247087153, 42.343384711265678], [2.985998976258457, 42.473015041669854], [3.039484083680548, 41.892120266276891], [2.091841668312184, 41.226088568683082], [0.810524529635188, 41.014731960609332], [0.721331007499401, 40.678318386389229], [0.106691521819869, 40.123933620762003], [-0.278711310212941, 39.309978135732713], [0.111290724293838, 38.738514309233032], [-0.467123582349103, 38.292365831041138], [-0.683389451490598, 37.642353827457811], [-1.438382127274849, 37.443063666324214], [-2.146452602538119, 36.674144192037282], [-3.415780808923386, 36.658899644511173], [-4.368900926114718, 36.677839056946141], [-4.995219285492211, 36.32470815687963], [-5.377159796561457, 35.946850083961458], [-5.866432257500902, 36.02981659600605], [-6.236693894872174, 36.367677110330327], [-6.520190802425402, 36.942913316387312], [-7.45372555177809, 37.097787583966053], [-7.537105475281022, 37.428904323876232], [-7.166507941099863, 37.803894354802217], [-7.029281175148794, 38.075764065089757], [-7.374092169616317, 38.373058580064914], [-7.098036668313126, 39.03007274022378], [-7.498632371439724, 39.629571031241802], [-7.066591559263527, 39.711891587882768], [-7.026413133156593, 40.184524237624238], [-6.864019944679383, 40.330871893874821], [-6.851126674822551, 41.111082668617513], [-6.389087693700914, 41.381815497394641], [-6.668605515967655, 41.883386949219577], [-7.251308966490822, 41.91834605566504], [-7.422512986673794, 41.792074693359822], [-8.01317460776991, 41.790886135417118], [-8.26385698081779, 42.280468654950326], [-8.671945766626719, 42.134689439454952], [-9.034817674180244, 41.880570583659669]]] } }, - { "type": "Feature", "properties": { "admin": "Estonia", "name": "Estonia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[24.312862583114615, 57.793423570376966], [24.428927850042154, 58.383413397853275], [24.061198357853179, 58.257374579493394], [23.426560092876681, 58.612753404364618], [23.339795363058641, 59.187240302153363], [24.604214308376182, 59.465853786855007], [25.864189080516631, 59.611090399811324], [26.949135776484518, 59.445803331125767], [27.981114129353237, 59.47538808861286], [28.131699253051742, 59.300825100330904], [27.420166456824941, 58.724581203844224], [27.716685825315714, 57.791899115624354], [27.288184848751509, 57.474528306703817], [26.46353234223778, 57.476388658266316], [25.602809685984365, 57.847528794986559], [25.164593540149262, 57.970156968815175], [24.312862583114615, 57.793423570376966]]] } }, - { "type": "Feature", "properties": { "admin": "Ethiopia", "name": "Ethiopia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[37.90607, 14.959430000000165], [38.51295, 14.50547], [39.0994, 14.74064], [39.34061, 14.53155], [40.026250000000111, 14.51959], [40.8966, 14.118640000000138], [41.1552, 13.77333], [41.59856, 13.452090000000108], [42.00975, 12.86582], [42.351560000000106, 12.54223000000013], [42.000000000000107, 12.100000000000133], [41.661760000000122, 11.6312], [41.739590000000177, 11.355110000000137], [41.755570000000191, 11.05091], [42.314140000000116, 11.0342], [42.55493000000012, 11.105110000000193], [42.776851841000948, 10.926878566934416], [42.55876, 10.572580000000126], [42.92812, 10.021940000000139], [43.29699, 9.540480000000169], [43.67875, 9.183580000000116], [46.94834, 7.99688], [47.78942, 8.003], [44.9636, 5.001620000000115], [43.66087, 4.95755], [42.769670000000119, 4.252590000000223], [42.12861, 4.234130000000163], [41.855083092644108, 3.918911920483764], [41.171800000000125, 3.91909], [40.768480000000118, 4.257020000000124], [39.854940000000106, 3.83879000000013], [39.559384258765917, 3.422060000000215], [38.89251, 3.50074], [38.67114, 3.61607], [38.436970000000137, 3.58851], [38.120915000000132, 3.598605], [36.85509323800823, 4.447864127672857], [36.159078632855646, 4.447864127672857], [35.817447662353622, 4.776965663462021], [35.817447662353622, 5.338232082790852], [35.298007118233095, 5.506], [34.70702, 6.59422000000012], [34.25032, 6.82607], [34.075100000000184, 7.22595], [33.56829, 7.71334], [32.954180000000228, 7.7849700000001], [33.294800000000116, 8.35458], [33.82550000000014, 8.37916], [33.97498, 8.684560000000145], [33.96162, 9.58358], [34.25745, 10.63009], [34.73115000000012, 10.910170000000106], [34.831630000000125, 11.318960000000116], [35.26049, 12.08286], [35.863630000000164, 12.57828], [36.27022, 13.563330000000118], [36.42951, 14.42211], [37.59377, 14.2131], [37.90607, 14.959430000000165]]] } }, - { "type": "Feature", "properties": { "admin": "Finland", "name": "Finland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[28.591929559043187, 69.064776923286644], [28.445943637818651, 68.36461294216403], [29.9774263852206, 67.698297024192641], [29.054588657352319, 66.944286200621917], [30.21765, 65.80598], [29.544429559046982, 64.948671576590471], [30.444684686003704, 64.204453436939076], [30.035872430142714, 63.552813625738544], [31.516092156711117, 62.867687486412869], [31.139991082490891, 62.357692776124395], [30.211107212044443, 61.780027777749673], [28.06999759289527, 60.503516547275829], [26.25517296723697, 60.423960679762487], [24.496623976344516, 60.057316392651636], [22.869694858499454, 59.846373196036211], [22.290763787533589, 60.391921291741525], [21.322244093519313, 60.720169989659503], [21.544866163832687, 61.705329494871783], [21.059211053153682, 62.607393296958726], [21.536029493910799, 63.189735012455863], [22.442744174903986, 63.817810370531276], [24.730511508897528, 64.902343655040823], [25.398067661243939, 65.111426500093728], [25.2940430030404, 65.53434642197044], [23.903378533633795, 66.006927395279604], [23.565879754335576, 66.396050930437411], [23.539473097434435, 67.936008612735236], [21.978534783626113, 68.616845608180682], [20.645592889089521, 69.106247260200846], [21.244936150810666, 69.370443020293067], [22.356237827247405, 68.841741441514898], [23.662049594830751, 68.891247463650529], [24.735679152126721, 68.649556789821446], [25.689212680776361, 69.092113755969024], [26.179622023226241, 69.825298977326113], [27.732292107867856, 70.164193020296239], [29.015572950971968, 69.766491197377974], [28.591929559043187, 69.064776923286644]]] } }, - { "type": "Feature", "properties": { "admin": "Fiji", "name": "Fiji", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[178.3736, -17.33992], [178.71806, -17.62846], [178.55271, -18.15059], [177.93266, -18.28799], [177.38146, -18.16432], [177.28504, -17.72465], [177.67087, -17.38114], [178.12557, -17.50481], [178.3736, -17.33992]]], [[[179.364142661964223, -16.801354076946847], [178.725059362997058, -17.012041674368017], [178.596838595117021, -16.63915], [179.096609362997128, -16.43398427754742], [179.413509362997075, -16.379054277547393], [180.000000000000114, -16.067132663642436], [180.000000000000114, -16.555216566639157], [179.364142661964223, -16.801354076946847]]], [[[-179.917369384765237, -16.501783135649358], [-180.0, -16.555216566639157], [-180.0, -16.067132663642436], [-179.793320109048551, -16.020882256741228], [-179.917369384765237, -16.501783135649358]]]] } }, - { "type": "Feature", "properties": { "admin": "Falkland Islands", "name": "Falkland Is.", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-61.2, -51.85], [-60.0, -51.25], [-59.15, -51.5], [-58.55, -51.1], [-57.75, -51.55], [-58.05, -51.9], [-59.4, -52.2], [-59.85, -51.85], [-60.7, -52.3], [-61.2, -51.85]]] } }, - { "type": "Feature", "properties": { "admin": "France", "name": "France", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-52.556424730018378, 2.504705308437053], [-52.939657151894963, 2.124857692875622], [-53.41846513529525, 2.053389187016037], [-53.554839240113481, 2.334896551925964], [-53.778520677288881, 2.376702785650053], [-54.088062506717264, 2.105556545414629], [-54.524754197799737, 2.311848863123785], [-54.271229620975781, 2.738747870286942], [-54.184284023644743, 3.194172268075234], [-54.011503872276812, 3.622569891774857], [-54.3995422023565, 4.212611395683481], [-54.478632981979203, 4.896755682795642], [-53.958044603070917, 5.756548163267808], [-53.618452928264837, 5.646529038918401], [-52.882141282754063, 5.409850979021598], [-51.823342861525916, 4.565768133966144], [-51.657797410678874, 4.156232408053028], [-52.249337531123977, 3.241094468596287], [-52.556424730018378, 2.504705308437053]]], [[[9.560016310269132, 42.152491970379558], [9.229752231491771, 41.380006822264441], [8.77572309737536, 41.583611965494427], [8.544212680707828, 42.256516628583078], [8.746009148807586, 42.628121853193946], [9.390000848028901, 43.009984849614725], [9.560016310269132, 42.152491970379558]]], [[[3.588184441755714, 50.378992418003563], [4.28602298342514, 49.90749664977254], [4.799221632515752, 49.985373033236314], [5.674051954784885, 49.529483547557433], [5.897759230176375, 49.442667141307155], [6.186320428094204, 49.463802802114444], [6.658229607783538, 49.201958319691549], [8.09927859867477, 49.017783515003366], [7.59367638513106, 48.333019110703724], [7.466759067422228, 47.620581976911851], [7.192202182655533, 47.449765529970982], [6.736571079138086, 47.541801255882874], [6.768713820023634, 47.287708238303672], [6.037388950228971, 46.725778713561894], [6.022609490593566, 46.272989813820502], [6.500099724970453, 46.429672756529428], [6.84359297041456, 45.991146552100659], [6.80235517744566, 45.708579820328673], [7.096652459347835, 45.333098863295859], [6.749955275101711, 45.028517971367584], [7.007562290076661, 44.254766750661382], [7.549596388386161, 44.127901109384808], [7.435184767291841, 43.693844916349164], [6.529245232783068, 43.12889232031835], [4.556962517931395, 43.399650987311581], [3.100410597352719, 43.075200507167118], [2.985998976258486, 42.473015041669882], [1.826793247087181, 42.343384711265649], [0.701590610363922, 42.795734361332642], [0.338046909190581, 42.57954600683955], [-1.502770961910471, 43.034014390630482], [-1.901351284177735, 43.422802028978332], [-1.384225226232956, 44.022610378590166], [-1.193797573237361, 46.014917710954862], [-2.225724249673788, 47.064362697938201], [-2.963276129559573, 47.570326646507958], [-4.491554938159481, 47.95495433205641], [-4.592349819344746, 48.68416046812694], [-3.295813971357745, 48.901692409859628], [-1.616510789384932, 48.644421291694577], [-1.933494025063254, 49.776341864615759], [-0.98946895995536, 49.347375800160869], [1.338761020522753, 50.127173163445256], [1.6390010921385, 50.9466063502975], [2.51357303224617, 51.14850617126185], [2.65842207196033, 50.796848049515646], [3.123251580425716, 50.780363267614504], [3.588184441755714, 50.378992418003563]]]] } }, - { "type": "Feature", "properties": { "admin": "Gabon", "name": "Gabon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[11.093772820691923, -3.978826592630546], [10.066135288135738, -2.969482517105681], [9.405245395554969, -2.144313246269042], [8.797995639693168, -1.111301364754496], [8.830086704146423, -0.779073581550037], [9.048419630579586, -0.459351494960217], [9.291350538783687, 0.268666083167687], [9.492888624721981, 1.010119533691494], [9.83028405115564, 1.067893784993799], [11.285078973036461, 1.057661851400013], [11.276449008843711, 2.261050930180871], [11.751665480199787, 2.326757513839993], [12.359380323952218, 2.19281220133945], [12.951333855855605, 2.321615708826939], [13.07582238124675, 2.267097072759014], [13.003113641012074, 1.830896307783319], [13.282631463278816, 1.31418366129688], [14.026668735417214, 1.395677395021153], [14.276265903386953, 1.196929836426619], [13.843320753645653, 0.038757635901149], [14.316418491277741, -0.552627455247048], [14.425455763413593, -1.333406670744971], [14.299210239324564, -1.998275648612213], [13.992407260807706, -2.470804945489099], [13.109618767965626, -2.428740329603513], [12.575284458067639, -1.948511244315134], [12.495702752338159, -2.391688327650242], [11.820963575903189, -2.514161472181982], [11.478038771214299, -2.765618991714241], [11.855121697648114, -3.42687061932105], [11.093772820691923, -3.978826592630546]]] } }, - { "type": "Feature", "properties": { "admin": "United Kingdom", "name": "United Kingdom", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-5.661948614921896, 54.554603176483838], [-6.197884894220976, 53.867565009163329], [-6.953730231137994, 54.073702297575622], [-7.572167934591078, 54.059956366585979], [-7.366030646178785, 54.595840969452688], [-7.572167934591078, 55.131622219454883], [-6.733847011736144, 55.172860012423783], [-5.661948614921896, 54.554603176483838]]], [[[-3.00500484863528, 58.635000108466322], [-4.073828497728015, 57.55302480735525], [-3.055001796877661, 57.690019029360933], [-1.959280564776918, 57.684799709699512], [-2.219988165689301, 56.870017401753515], [-3.119003058271118, 55.97379303651546], [-2.085009324543023, 55.909998480851264], [-2.005675679673856, 55.804902850350217], [-1.11499101399221, 54.624986477265388], [-0.4304849918542, 54.464376125702145], [0.184981316742039, 53.325014146531018], [0.469976840831777, 52.929999498091959], [1.681530795914739, 52.739520168663987], [1.559987827164377, 52.099998480836], [1.050561557630914, 51.806760565795678], [1.4498653499503, 51.289427802121949], [0.550333693045502, 50.765738837275862], [-0.787517462558639, 50.774988918656206], [-2.489997524414377, 50.500018622431227], [-2.956273972984035, 50.696879991247002], [-3.617448085942327, 50.228355617872708], [-4.542507900399243, 50.341837063185658], [-5.245023159191134, 49.959999904981082], [-5.776566941745299, 50.159677639356815], [-4.309989793301837, 51.210001125689146], [-3.414850633142122, 51.426008612669236], [-3.422719467108322, 51.426848167406078], [-4.984367234710873, 51.593466091510962], [-5.267295701508885, 51.991400458374571], [-4.222346564134852, 52.30135569926135], [-4.770013393564112, 52.840004991255611], [-4.579999152026914, 53.495003770555165], [-3.093830673788658, 53.404547400669671], [-3.092079637047106, 53.404440822963544], [-2.945008510744343, 53.98499970154667], [-3.614700825433033, 54.60093677329256], [-3.63000545898933, 54.615012925833], [-4.844169073903003, 54.790971177786837], [-5.082526617849224, 55.061600653699358], [-4.719112107756643, 55.508472601943467], [-5.047980922862108, 55.783985500707516], [-5.586397670911139, 55.311146145236805], [-5.64499874513018, 56.275014960344791], [-6.149980841486352, 56.785009670633528], [-5.78682471355529, 57.818848375064633], [-5.009998745127574, 58.630013332750039], [-4.211494513353555, 58.550845038479153], [-3.00500484863528, 58.635000108466322]]]] } }, - { "type": "Feature", "properties": { "admin": "Georgia", "name": "Georgia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[41.55408410011065, 41.535656236327561], [41.703170607272703, 41.962942816732912], [41.453470086438379, 42.645123399417926], [40.875469191253785, 43.013628038091277], [40.321394484220313, 43.128633938156831], [39.955008579270917, 43.434997666999216], [40.07696495947976, 43.553104153002309], [40.922184686045618, 43.38215851498078], [42.394394565608806, 43.220307929042619], [43.756016880067378, 42.74082815202248], [43.931199985536828, 42.554973863284758], [44.537622918481979, 42.71199270280362], [45.470279168485703, 42.502780666669963], [45.776410353382758, 42.09244395605635], [46.404950799348818, 41.860675157227298], [46.145431756379004, 41.722802435872573], [46.637908156120574, 41.181672675128219], [46.501637404166921, 41.064444688474104], [45.962600538930381, 41.123872585609767], [45.217426385281577, 41.411451931314041], [44.972480096218071, 41.248128567055588], [43.582745802592726, 41.09214325618256], [42.619548781104484, 41.583172715819934], [41.55408410011065, 41.535656236327561]]] } }, - { "type": "Feature", "properties": { "admin": "Ghana", "name": "Ghana", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[1.060121697604927, 5.928837388528875], [-0.507637905265938, 5.343472601742675], [-1.063624640294193, 5.000547797053811], [-1.964706590167594, 4.71046214438337], [-2.856125047202397, 4.994475816259508], [-2.810701463217839, 5.389051215024109], [-3.244370083011261, 6.2504715031135], [-2.983584967450326, 7.379704901555511], [-2.56218950032624, 8.219627793811481], [-2.827496303712706, 9.642460842319775], [-2.963896246747111, 10.395334784380081], [-2.94040930827046, 10.962690334512557], [-1.203357713211431, 11.009819240762736], [-0.761575893548183, 10.936929633015053], [-0.438701544588582, 11.09834096927872], [0.023802524423701, 11.018681748900802], [-0.049784715159944, 10.706917832883928], [0.367579990245389, 10.191212876827176], [0.365900506195885, 9.46500397382948], [0.461191847342121, 8.677222601756013], [0.712029249686878, 8.312464504423827], [0.490957472342245, 7.411744289576474], [0.570384148774849, 6.914358628767188], [0.836931186536333, 6.279978745952147], [1.060121697604927, 5.928837388528875]]] } }, - { "type": "Feature", "properties": { "admin": "Guinea", "name": "Guinea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-8.439298468448696, 7.686042792181736], [-8.722123582382123, 7.711674302598509], [-8.926064622422002, 7.309037380396375], [-9.208786383490844, 7.313920803247952], [-9.403348151069748, 7.526905218938906], [-9.33727983238458, 7.928534450711351], [-9.755342169625832, 8.541055202666923], [-10.016566534861253, 8.42850393313523], [-10.230093553091276, 8.406205552601291], [-10.505477260774667, 8.348896389189603], [-10.494315151399629, 8.715540676300433], [-10.65477047366589, 8.977178452994194], [-10.622395188835037, 9.267910061068276], [-10.839151984083299, 9.688246161330367], [-11.117481248407328, 10.045872911006283], [-11.917277390988655, 10.046983954300556], [-12.150338100625003, 9.858571682164378], [-12.425928514037562, 9.835834051955953], [-12.596719122762206, 9.620188300001969], [-12.711957566773076, 9.342711696810765], [-13.246550258832512, 8.903048610871506], [-13.685153977909788, 9.494743760613458], [-14.074044969122278, 9.886166897008248], [-14.330075852912367, 10.015719712763966], [-14.579698859098254, 10.214467271358513], [-14.693231980843501, 10.65630076745404], [-14.83955379887794, 10.876571560098139], [-15.130311245168167, 11.040411688679525], [-14.685687221728896, 11.527823798056485], [-14.382191534878727, 11.509271958863691], [-14.121406419317776, 11.677117010947693], [-13.900799729863772, 11.678718980348744], [-13.743160773157411, 11.811269029177408], [-13.828271857142122, 12.142644151249041], [-13.718743658899511, 12.247185573775507], [-13.700476040084322, 12.586182969610192], [-13.217818162478235, 12.575873521367964], [-12.499050665730561, 12.332089952031053], [-12.278599005573438, 12.354440008997285], [-12.20356482588563, 12.465647691289401], [-11.658300950557928, 12.386582749882834], [-11.513942836950587, 12.442987575729415], [-11.456168585648269, 12.076834214725336], [-11.297573614944508, 12.077971096235768], [-11.036555955438256, 12.211244615116513], [-10.870829637078211, 12.177887478072106], [-10.593223842806278, 11.923975328005977], [-10.165213792348835, 11.844083563682743], [-9.890992804392011, 12.060478623904968], [-9.567911749703212, 12.194243068892472], [-9.327616339546008, 12.334286200403451], [-9.127473517279581, 12.308060411015331], [-8.905264858424529, 12.088358059126433], [-8.786099005559462, 11.812560939984705], [-8.376304897484911, 11.393645941610627], [-8.581305304386772, 11.136245632364801], [-8.620321010767126, 10.810890814655181], [-8.407310756860026, 10.90925690352276], [-8.282357143578279, 10.792597357623842], [-8.335377163109738, 10.494811916541932], [-8.029943610048617, 10.206534939001711], [-8.22933712404682, 10.129020290563897], [-8.309616461612249, 9.789531968622439], [-8.079113735374348, 9.376223863152033], [-7.832100389019186, 8.575704250518625], [-8.203498907900878, 8.455453192575446], [-8.299048631208562, 8.316443589710302], [-8.221792364932197, 8.123328762235571], [-8.280703497744936, 7.687179673692156], [-8.439298468448696, 7.686042792181736]]] } }, - { "type": "Feature", "properties": { "admin": "Gambia", "name": "Gambia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-16.84152462408127, 13.151393947802557], [-16.713728807023468, 13.594958604379853], [-15.624596320039936, 13.623587347869556], [-15.398770310924457, 13.860368760630916], [-15.081735398813816, 13.876491807505982], [-14.687030808968483, 13.63035696049978], [-14.376713833055785, 13.625680243377371], [-14.046992356817478, 13.794067898000446], [-13.844963344772404, 13.505041612191999], [-14.277701788784553, 13.28058502853224], [-14.712197231494626, 13.298206691943774], [-15.141163295949463, 13.509511623585235], [-15.511812506562931, 13.278569647672864], [-15.691000535534991, 13.270353094938455], [-15.931295945692208, 13.130284125211331], [-16.84152462408127, 13.151393947802557]]] } }, - { "type": "Feature", "properties": { "admin": "Guinea Bissau", "name": "Guinea-Bissau", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-15.130311245168167, 11.040411688679525], [-15.664180467175523, 11.458474025920792], [-16.085214199273562, 11.524594021038236], [-16.314786749730199, 11.806514797406548], [-16.308947312881227, 11.958701890506116], [-16.613838263403277, 12.170911159712698], [-16.67745195155457, 12.38485158940105], [-16.147716844130581, 12.547761542201185], [-15.816574266004251, 12.515567124883345], [-15.548476935274005, 12.628170070847343], [-13.700476040084322, 12.586182969610192], [-13.718743658899511, 12.247185573775507], [-13.828271857142122, 12.142644151249041], [-13.743160773157411, 11.811269029177408], [-13.900799729863772, 11.678718980348744], [-14.121406419317776, 11.677117010947693], [-14.382191534878727, 11.509271958863691], [-14.685687221728896, 11.527823798056485], [-15.130311245168167, 11.040411688679525]]] } }, - { "type": "Feature", "properties": { "admin": "Equatorial Guinea", "name": "Eq. Guinea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[9.492888624721981, 1.010119533691494], [9.305613234096255, 1.160911363119183], [9.649158155972627, 2.283866075037735], [11.276449008843711, 2.261050930180871], [11.285078973036461, 1.057661851400013], [9.83028405115564, 1.067893784993799], [9.492888624721981, 1.010119533691494]]] } }, - { "type": "Feature", "properties": { "admin": "Greece", "name": "Greece", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[23.699980096133, 35.705004380835526], [24.246665073348673, 35.368022365860149], [25.025015496528873, 35.424995632461979], [25.769207797964182, 35.354018052709073], [25.745023227651579, 35.179997666966209], [26.290002882601719, 35.299990342747911], [26.164997592887651, 35.004995429009789], [24.724982130642299, 34.919987697889603], [24.735007358506941, 35.084990546197581], [23.514978468528106, 35.27999156345097], [23.699980096133, 35.705004380835526]]], [[[26.604195590936282, 41.562114569661098], [26.294602085075777, 40.936261298174244], [26.056942172965499, 40.824123440100827], [25.44767703624418, 40.852545477861455], [24.925848422960932, 40.947061672523226], [23.714811232200809, 40.687129218095116], [24.407998894964063, 40.124992987624083], [23.89996788910258, 39.962005520175573], [23.342999301860797, 39.960997829745786], [22.813987664488959, 40.476005153966547], [22.626298862404777, 40.256561184239175], [22.849747755634805, 39.659310818025759], [23.350027296652595, 39.190011298167256], [22.97309939951554, 38.97090322524965], [23.53001631032495, 38.51000112563846], [24.025024855248937, 38.219992987616443], [24.040011020613601, 37.655014553369419], [23.115002882589145, 37.920011298162215], [23.409971958111065, 37.409990749657389], [22.77497195810863, 37.305010077456551], [23.154225294698612, 36.422505804992042], [22.4900281104511, 36.410000108377446], [21.670026482843692, 36.84498647719419], [21.295010613701574, 37.644989325504689], [21.120034213961329, 38.31032339126272], [20.730032179454579, 38.769985256498778], [20.217712029712853, 39.340234686839629], [20.150015903410516, 39.624997666984022], [20.615000441172779, 40.110006822259422], [20.67499677906363, 40.434999904943048], [20.999989861747274, 40.580003973953964], [21.020040317476422, 40.842726955725873], [21.674160597426969, 40.931274522457976], [22.055377638444266, 41.149865831052686], [22.597308383889008, 41.130487168943198], [22.76177, 41.3048], [22.952377150166562, 41.337993882811212], [23.692073601992455, 41.309080918943849], [24.492644891058031, 41.583896185872035], [25.19720136892553, 41.234485988930651], [26.106138136507177, 41.328898830727823], [26.11704186372091, 41.826904608724725], [26.604195590936282, 41.562114569661098]]]] } }, - { "type": "Feature", "properties": { "admin": "Greenland", "name": "Greenland", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-46.76379, 82.62796], [-43.40644, 83.22516], [-39.89753, 83.18018], [-38.62214, 83.54905], [-35.08787, 83.64513], [-27.10046, 83.51966], [-20.84539, 82.72669], [-22.69182, 82.34165], [-26.51753, 82.29765], [-31.9, 82.2], [-31.39646, 82.02154], [-27.85666, 82.13178], [-24.84448, 81.78697], [-22.90328, 82.09317], [-22.07175, 81.73449], [-23.16961, 81.15271], [-20.62363, 81.52462], [-15.76818, 81.91245], [-12.77018, 81.71885], [-12.20855, 81.29154], [-16.28533, 80.58004], [-16.85, 80.35], [-20.04624, 80.17708], [-17.73035, 80.12912], [-18.9, 79.4], [-19.70499, 78.75128], [-19.67353, 77.63859], [-18.47285, 76.98565], [-20.03503, 76.94434], [-21.67944, 76.62795], [-19.83407, 76.09808], [-19.59896, 75.24838], [-20.66818, 75.15585], [-19.37281, 74.29561], [-21.59422, 74.22382], [-20.43454, 73.81713], [-20.76234, 73.46436], [-22.17221, 73.30955], [-23.56593, 73.30663], [-22.31311, 72.62928], [-22.29954, 72.18409], [-24.27834, 72.59788], [-24.79296, 72.3302], [-23.44296, 72.08016], [-22.13281, 71.46898], [-21.75356, 70.66369], [-23.53603, 70.471], [-24.30702, 70.85649], [-25.54341, 71.43094], [-25.20135, 70.75226], [-26.36276, 70.22646], [-23.72742, 70.18401], [-22.34902, 70.12946], [-25.02927, 69.2588], [-27.74737, 68.47046], [-30.67371, 68.12503], [-31.77665, 68.12078], [-32.81105, 67.73547], [-34.20196, 66.67974], [-36.35284, 65.9789], [-37.04378, 65.93768], [-38.37505, 65.69213], [-39.81222, 65.45848], [-40.66899, 64.83997], [-40.68281, 64.13902], [-41.1887, 63.48246], [-42.81938, 62.68233], [-42.41666, 61.90093], [-42.86619, 61.07404], [-43.3784, 60.09772], [-44.7875, 60.03676], [-46.26364, 60.85328], [-48.26294, 60.85843], [-49.23308, 61.40681], [-49.90039, 62.38336], [-51.63325, 63.62691], [-52.14014, 64.27842], [-52.27659, 65.1767], [-53.66166, 66.09957], [-53.30161, 66.8365], [-53.96911, 67.18899], [-52.9804, 68.35759], [-51.47536, 68.72958], [-51.08041, 69.14781], [-50.87122, 69.9291], [-52.013585, 69.574925], [-52.55792, 69.42616], [-53.45629, 69.283625], [-54.68336, 69.61003], [-54.75001, 70.28932], [-54.35884, 70.821315], [-53.431315, 70.835755], [-51.39014, 70.56978], [-53.10937, 71.20485], [-54.00422, 71.54719], [-55.0, 71.406536967272558], [-55.83468, 71.65444], [-54.71819, 72.58625], [-55.32634, 72.95861], [-56.12003, 73.64977], [-57.32363, 74.71026], [-58.59679, 75.09861], [-58.58516, 75.51727], [-61.26861, 76.10238], [-63.39165, 76.1752], [-66.06427, 76.13486], [-68.50438, 76.06141], [-69.66485, 76.37975], [-71.40257, 77.00857], [-68.77671, 77.32312], [-66.76397, 77.37595], [-71.04293, 77.63595], [-73.297, 78.04419], [-73.15938, 78.43271], [-69.37345, 78.91388], [-65.7107, 79.39436], [-65.3239, 79.75814], [-68.02298, 80.11721], [-67.15129, 80.51582], [-63.68925, 81.21396], [-62.23444, 81.3211], [-62.65116, 81.77042], [-60.28249, 82.03363], [-57.20744, 82.19074], [-54.13442, 82.19962], [-53.04328, 81.88833], [-50.39061, 82.43883], [-48.00386, 82.06481], [-46.59984, 81.985945], [-44.523, 81.6607], [-46.9007, 82.19979], [-46.76379, 82.62796]]] } }, - { "type": "Feature", "properties": { "admin": "Guatemala", "name": "Guatemala", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-90.095554572290951, 13.73533763270073], [-90.608624030300817, 13.909771429901948], [-91.232410244496037, 13.927832342987953], [-91.689746670279106, 14.126218166556452], [-92.227750006869812, 14.538828640190925], [-92.203229539747298, 14.830102850804066], [-92.087215949252041, 15.064584662328436], [-92.229248623406249, 15.251446641495857], [-91.747960171255912, 16.066564846251719], [-90.464472622422647, 16.069562079324651], [-90.438866950222021, 16.410109768128091], [-90.600846727240906, 16.470777899638758], [-90.711821865587694, 16.687483018454724], [-91.081670091500641, 16.918476670799404], [-91.453921271515128, 17.252177232324168], [-91.002269253284197, 17.254657701074176], [-91.001519945015943, 17.817594916245707], [-90.067933519230948, 17.819326076727474], [-89.143080410503302, 17.808318996649316], [-89.15080603713092, 17.015576687075832], [-89.229121670269265, 15.886937567605166], [-88.930612759135244, 15.887273464415072], [-88.604586147805833, 15.706380113177358], [-88.518364020526846, 15.855389105690971], [-88.22502275262201, 15.727722479713901], [-88.680679694355618, 15.346247056535301], [-89.15481096063354, 15.066419175674806], [-89.225220099631244, 14.874286200413618], [-89.145535041037149, 14.67801911056908], [-89.353325975282772, 14.424132798719112], [-89.587342698916544, 14.362586167859485], [-89.5342193265205, 14.244815578666302], [-89.7219339668207, 14.134228013561694], [-90.064677903996568, 13.881969509328924], [-90.095554572290951, 13.73533763270073]]] } }, - { "type": "Feature", "properties": { "admin": "Guyana", "name": "Guyana", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-59.758284878159181, 8.367034816924045], [-59.10168412945864, 7.99920197187049], [-58.482962205628041, 7.347691351750696], [-58.454876064677414, 6.832787380394463], [-58.078103196837361, 6.809093736188641], [-57.542218593970631, 6.321268215353355], [-57.147436489476874, 5.973149929219161], [-57.307245856339492, 5.073566595882225], [-57.914288906472123, 4.812626451024413], [-57.860209520078691, 4.576801052260449], [-58.044694383360664, 4.060863552258382], [-57.601568976457848, 3.334654649260684], [-57.281433478409703, 3.333491929534119], [-57.150097825739898, 2.768926906745406], [-56.53938574891454, 1.89952260986692], [-56.782704230360814, 1.863710842288653], [-57.33582292339689, 1.948537705895759], [-57.660971035377358, 1.682584947105638], [-58.113449876525003, 1.507195135907025], [-58.429477098205957, 1.46394196207872], [-58.540012986878288, 1.26808828369252], [-59.030861579002639, 1.317697658692722], [-59.646043667221242, 1.786893825686789], [-59.718545701726732, 2.249630438644359], [-59.974524909084543, 2.755232652188055], [-59.815413174057852, 3.606498521332085], [-59.538039923731219, 3.958802598481937], [-59.767405768458701, 4.423502915866606], [-60.111002366767373, 4.574966538914082], [-59.980958624904865, 5.014061184098138], [-60.213683437731319, 5.2444863956876], [-60.733574184803707, 5.2002772078619], [-61.410302903881941, 5.959068101419616], [-61.139415045807937, 6.234296779806142], [-61.159336310456467, 6.696077378766317], [-60.543999192940966, 6.856584377464881], [-60.295668097562377, 7.043911444522918], [-60.637972785063752, 7.414999904810853], [-60.550587938058186, 7.779602972846178], [-59.758284878159181, 8.367034816924045]]] } }, - { "type": "Feature", "properties": { "admin": "Honduras", "name": "Honduras", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-87.316654425795463, 12.984685777229], [-87.48940873894712, 13.29753489832393], [-87.793111131526501, 13.384480495655165], [-87.723502977229288, 13.785050360565602], [-87.859515347021599, 13.893312486217097], [-88.065342576840109, 13.964625962779788], [-88.503997972349609, 13.845485948130939], [-88.541230841815931, 13.98015473068352], [-88.843072882832743, 14.140506700085208], [-89.058511929057644, 14.340029405164213], [-89.353325975282786, 14.424132798719084], [-89.145535041037164, 14.678019110569149], [-89.22522009963123, 14.874286200413675], [-89.154810960633526, 15.066419175674863], [-88.680679694355575, 15.346247056535386], [-88.225022752621925, 15.727722479714027], [-88.121153123715359, 15.688655096901355], [-87.901812506852394, 15.864458319558194], [-87.615680101252309, 15.878798529519198], [-87.522920905288444, 15.797278957578779], [-87.367762417332116, 15.846940009011286], [-86.903191291028165, 15.756712958229565], [-86.440945604177372, 15.782835394753189], [-86.119233974944322, 15.893448798073958], [-86.00195431185783, 16.005405788634388], [-85.68331743034625, 15.953651841693949], [-85.444003872402547, 15.885749009662444], [-85.182443610357183, 15.909158433490628], [-84.98372188997881, 15.995923163308698], [-84.526979743167118, 15.857223619037423], [-84.36825558138257, 15.835157782448729], [-84.063054572266807, 15.648244126849132], [-83.773976610026111, 15.42407176356687], [-83.410381232420363, 15.27090281825377], [-83.147219000974104, 14.995829169164207], [-83.489988776366005, 15.01626719813566], [-83.628584967772866, 14.880073960830368], [-83.975721401693576, 14.749435939996483], [-84.228341640952394, 14.748764146376626], [-84.449335903648588, 14.62161428472251], [-84.64958207877963, 14.666805324761865], [-84.820036790694289, 14.819586696832628], [-84.924500698572302, 14.790492865452332], [-85.052787441736868, 14.551541042534719], [-85.148750576502877, 14.560196844943615], [-85.165364549484806, 14.354369615125048], [-85.514413011400265, 14.079011745657905], [-85.698665330736944, 13.960078436737998], [-85.801294725268505, 13.8360549992376], [-86.096263800790595, 14.03818736414723], [-86.312142096689826, 13.771356106008223], [-86.520708177419891, 13.778487453664464], [-86.755086636079596, 13.754845485890936], [-86.733821784191463, 13.263092556201398], [-86.880557013684353, 13.254204209847213], [-87.005769009127434, 13.025794379117254], [-87.316654425795463, 12.984685777229]]] } }, - { "type": "Feature", "properties": { "admin": "Croatia", "name": "Croatia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[18.829838087650039, 45.908877671891837], [19.072768995854172, 45.521511135432078], [19.390475701584588, 45.236515611342369], [19.005486281010118, 44.860233669609144], [18.553214145591646, 45.08158966733145], [17.861783481526398, 45.067740383477137], [17.00214603035101, 45.233776760430935], [16.534939406000202, 45.211607570977705], [16.318156772535868, 45.004126695325901], [15.959367303133373, 45.233776760430935], [15.750026075918978, 44.81871165626255], [16.239660271884528, 44.351143296885695], [16.456442905348862, 44.041239732431265], [16.916156447017325, 43.667722479825663], [17.297373488034449, 43.446340643887353], [17.674921502358981, 43.028562527023603], [18.56, 42.65], [18.450016310304814, 42.47999136002931], [17.509970330483323, 42.84999461523914], [16.930005730871638, 43.209998480800373], [16.015384555737679, 43.507215481127204], [15.174453973052094, 44.243191229827907], [15.376250441151793, 44.317915350922064], [14.920309279040504, 44.73848399512945], [14.901602410550874, 45.076060289076104], [14.258747592839992, 45.233776760430935], [13.952254672917032, 44.802123521496853], [13.65697553880119, 45.136935126315947], [13.679403110415816, 45.484149074884996], [13.715059848697248, 45.500323798192419], [14.411968214585496, 45.466165676447403], [14.595109490627916, 45.63494090431282], [14.935243767972961, 45.471695054702757], [15.327674594797424, 45.452316392593325], [15.323953891672428, 45.731782538427687], [15.671529575267638, 45.8341535507979], [15.768732944408608, 46.23810822202352], [16.564808383864939, 46.503750922219794], [16.882515089595412, 46.380631822284428], [17.630066359129554, 45.951769110694087], [18.456062452882858, 45.759481106136143], [18.829838087650039, 45.908877671891837]]] } }, - { "type": "Feature", "properties": { "admin": "Haiti", "name": "Haiti", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-73.189790615517595, 19.915683905511909], [-72.579672817663607, 19.871500555902351], [-71.71236141629295, 19.714455878167353], [-71.624873216422813, 19.169837958243303], [-71.701302659782485, 18.785416978424049], [-71.945112067335543, 18.616900132720257], [-71.687737596305865, 18.316660061104468], [-71.708304816358037, 18.044997056546091], [-72.372476162389333, 18.214960842354053], [-72.844411180294856, 18.145611070218362], [-73.454554816365018, 18.217906398994696], [-73.922433234335642, 18.030992743395], [-74.458033616824764, 18.342549953682703], [-74.369925299767118, 18.664907538319408], [-73.449542202432696, 18.526052964751141], [-72.694937099890623, 18.445799465401858], [-72.334881557896992, 18.66842153571525], [-72.791649542924873, 19.101625067618027], [-72.784104783810264, 19.483591416903405], [-73.41502234566174, 19.639550889560276], [-73.189790615517595, 19.915683905511909]]] } }, - { "type": "Feature", "properties": { "admin": "Hungary", "name": "Hungary", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.202298211337361, 46.852385972676949], [16.534267612380372, 47.496170966169103], [16.340584344150411, 47.712901923201215], [16.903754103267257, 47.714865627628321], [16.979666782304033, 48.123497015976298], [17.488472934649813, 47.867466132186209], [17.857132602620023, 47.758428860050365], [18.696512892336923, 47.88095368101439], [18.777024773847668, 48.081768296900627], [19.174364861739885, 48.111378892603859], [19.66136355965849, 48.266614895208647], [19.769470656013109, 48.2026911484636], [20.239054396249344, 48.327567247096916], [20.473562045989862, 48.562850043321809], [20.801293979584919, 48.62385407164237], [21.872236362401729, 48.319970811550007], [22.085608351334848, 48.422264309271782], [22.640819939878746, 48.150239569687351], [22.710531447040488, 47.882193915389394], [22.09976769378283, 47.672439276716695], [21.626514926853869, 46.994237779318148], [21.021952345471245, 46.316087958351886], [20.220192498462833, 46.127468980486547], [19.596044549241579, 46.171729844744533], [18.829838087649957, 45.908877671891915], [18.456062452882858, 45.759481106136121], [17.630066359129554, 45.95176911069418], [16.882515089595298, 46.380631822284428], [16.564808383864854, 46.503750922219822], [16.370504998447412, 46.841327216166498], [16.202298211337361, 46.852385972676949]]] } }, - { "type": "Feature", "properties": { "admin": "Indonesia", "name": "Indonesia", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[120.715608758630438, -10.239581394087862], [120.295014276206871, -10.258649997603525], [118.967808465654684, -9.55796925215803], [119.900309686361609, -9.361340427287514], [120.425755649905398, -9.665921319215796], [120.775501743656719, -9.969675388227456], [120.715608758630438, -10.239581394087862]]], [[[124.435950148619384, -10.14000090906144], [123.579981724136701, -10.359987481327961], [123.459989048354998, -10.239994805546171], [123.55000939340745, -9.900015557497978], [123.980008986508096, -9.290026950724693], [124.96868248911619, -8.892790215697046], [125.070019972840612, -9.089987481322835], [125.088520135601073, -9.393173109579321], [124.435950148619384, -10.14000090906144]]], [[[117.900018345207741, -8.095681247594923], [118.260616489740471, -8.362383314653327], [118.87845991422212, -8.280682875199828], [119.126506789223086, -8.705824883665072], [117.97040164598927, -8.906639499551257], [117.277730747549015, -9.040894870645557], [116.74014082241662, -9.032936700072637], [117.083737420725313, -8.457157891476539], [117.632024367342126, -8.44930307376819], [117.900018345207741, -8.095681247594923]]], [[[122.903537225436082, -8.094234307490735], [122.756982863456287, -8.649807631060638], [121.2544905945701, -8.933666273639941], [119.924390903809567, -8.810417982623873], [119.920928582846102, -8.44485890059107], [120.715091994307542, -8.236964613480863], [121.341668735846554, -8.53673959720602], [122.007364536630405, -8.46062021244016], [122.903537225436082, -8.094234307490735]]], [[[108.623478631628927, -6.777673841990675], [110.539227329553285, -6.877357679881682], [110.759575636845909, -6.465186455921751], [112.614811232556349, -6.946035658397589], [112.978768345188087, -7.594213148634578], [114.478935174621142, -7.776527601760277], [115.705526971501058, -8.370806573116864], [114.564511346496488, -8.75181690840483], [113.464733514460875, -8.348947442257424], [112.559672479301028, -8.376180922075163], [111.522061395312448, -8.302128594600957], [110.586149530074294, -8.122604668819021], [109.427667270955183, -7.740664157749761], [108.693655226681301, -7.641600437046219], [108.277763299596302, -7.766657403192579], [106.454102004016136, -7.354899590690947], [106.280624220812285, -6.924899997590201], [105.365486281355516, -6.851416110871169], [106.051645949327053, -5.895918877794499], [107.265008579540165, -5.954985039904058], [108.072091099074683, -6.345762220895237], [108.486846144649235, -6.421984958525768], [108.623478631628927, -6.777673841990675]]], [[[134.724624465066654, -6.214400730009286], [134.210133905168902, -6.895237725454704], [134.112775506730998, -6.142467136259014], [134.290335728085779, -5.783057549669038], [134.499625278867882, -5.445042006047898], [134.727001580952106, -5.737582289252158], [134.724624465066654, -6.214400730009286]]], [[[127.249215122588893, -3.459065036638889], [126.874922723498855, -3.790982761249579], [126.183802118027302, -3.607376397316556], [125.989033644719257, -3.177273451351325], [127.00065148326496, -3.12931772218441], [127.249215122588893, -3.459065036638889]]], [[[130.471344028851775, -3.09376433676762], [130.834836053592767, -3.858472181822761], [129.990546502808115, -3.446300957862817], [129.155248651242403, -3.362636813982248], [128.590683628453633, -3.428679294451256], [127.898891229362334, -3.393435967628192], [128.135879347852779, -2.843650404474914], [129.370997756060888, -2.802154229344551], [130.471344028851775, -3.09376433676762]]], [[[134.143367954647772, -1.151867364103594], [134.422627394753022, -2.769184665542383], [135.457602980694674, -3.367752780779113], [136.293314243718754, -2.30704233155609], [137.4407377463275, -1.703513278819372], [138.329727411044757, -1.70268645590265], [139.18492068904294, -2.051295668143637], [139.926684198160387, -2.409051608900284], [141.000210402591847, -2.600151055515624], [141.017056919519007, -5.85902190513802], [141.033851760013874, -9.117892754760417], [140.143415155192542, -8.297167657100955], [139.127766554928087, -8.096042982620942], [138.881476678624949, -8.380935153846094], [137.614473911692812, -8.41168263105976], [138.039099155835174, -7.597882175327354], [138.668621454014783, -7.320224704623072], [138.407913853102343, -6.232849216337483], [137.927839797110835, -5.393365573755998], [135.989250116113453, -4.546543877789047], [135.164597609599667, -4.462931410340771], [133.662880487197867, -3.538853448097526], [133.367704705946778, -4.024818617370314], [132.983955519747326, -4.112978610860281], [132.75694095268895, -3.746282647317129], [132.753788690319197, -3.311787204607071], [131.989804315316178, -2.820551039240455], [133.066844517143466, -2.460417982598443], [133.780030959203486, -2.479848321140209], [133.69621178602614, -2.214541517753687], [132.232373488494204, -2.212526136894325], [131.836221958544684, -1.617161960459597], [130.942839797082797, -1.432522067880796], [130.519558140180038, -0.937720228686075], [131.867537876513609, -0.695461114101818], [132.380116408416768, -0.369537855636977], [133.985548130428384, -0.780210463060442], [134.143367954647772, -1.151867364103594]]], [[[125.240500522971573, 1.419836127117605], [124.43703535369734, 0.427881171058971], [123.685504998876695, 0.235593166500877], [122.723083123872854, 0.431136786293337], [121.056724888189081, 0.381217352699451], [120.18308312386273, 0.23724681233422], [120.040869582195455, -0.519657891444851], [120.935905389490699, -1.408905938323372], [121.475820754076167, -0.955962009285116], [123.34056481332847, -0.615672702643081], [123.258399285984481, -1.076213067228337], [122.822715285331597, -0.930950616055881], [122.388529901215364, -1.516858005381124], [121.508273553555455, -1.904482924002422], [122.454572381684272, -3.186058444840881], [122.271896193532541, -3.529500013852696], [123.170962762546537, -4.683693129091707], [123.162332798353759, -5.34060393638596], [122.628515252778683, -5.634591159694494], [122.236394484548057, -5.282933037948281], [122.71956912647704, -4.46417164471579], [121.738233677254357, -4.851331475446499], [121.48946333220124, -4.574552504091215], [121.619171177253861, -4.188477878438674], [120.898181593917684, -3.602105401222828], [120.972388950688767, -2.627642917494909], [120.305452915529884, -2.931603692235725], [120.39004723519173, -4.097579034037223], [120.430716587405371, -5.528241062037778], [119.796543410319487, -5.67340016034565], [119.36690555224493, -5.379878024927804], [119.653606398600104, -4.459417412944958], [119.498835483885969, -3.49441171632651], [119.078344354326987, -3.487021986508764], [118.767768996252869, -2.801999200047688], [119.180973748858662, -2.147103773612798], [119.323393996255049, -1.35314706788047], [119.825998976725828, 0.154254462073496], [120.035701938966341, 0.566477362465804], [120.885779250167687, 1.309222723796835], [121.666816847826965, 1.013943589681076], [122.927566766451818, 0.875192368977465], [124.077522414242836, 0.917101955566139], [125.065989211121803, 1.643259182131558], [125.240500522971573, 1.419836127117605]]], [[[128.688248732620707, 1.132385972494106], [128.635952183141342, 0.258485826006179], [128.120169712436166, 0.356412665199286], [127.968034295768845, -0.252077325037533], [128.379998813999691, -0.780003757331286], [128.100015903842291, -0.899996433112974], [127.69647464407501, -0.266598402511505], [127.399490187693743, 1.011721503092573], [127.600511509309044, 1.81069082275718], [127.932377557487484, 2.174596258956555], [128.004156121940809, 1.628531398928331], [128.594559360875451, 1.540810655112864], [128.688248732620707, 1.132385972494106]]], [[[117.875627069166001, 1.827640692548911], [118.996747267738158, 0.902219143066048], [117.811858351717788, 0.784241848143722], [117.478338657706047, 0.102474676917026], [117.521643507966587, -0.803723239753211], [116.560048455879496, -1.487660821136231], [116.533796828275158, -2.483517347832901], [116.148083937648607, -4.012726332214014], [116.000857782049067, -3.657037448749008], [114.864803094544513, -4.106984144714416], [114.468651564595064, -3.49570362713382], [113.755671828264099, -3.439169610206519], [113.256994256647545, -3.118775729996854], [112.068126255340644, -3.478392022316071], [111.703290643359992, -2.994442233902631], [111.04824018762821, -3.049425957861188], [110.223846063275971, -2.934032484553483], [110.070935500124335, -1.592874037282414], [109.571947869914041, -1.314906507984489], [109.091873813922518, -0.459506524257051], [108.952657505328162, 0.415375474444346], [109.069136183714036, 1.341933905437642], [109.663260125773718, 2.006466986494984], [109.830226678508836, 1.338135687664191], [110.514060907027101, 0.773131415200993], [111.159137811326559, 0.976478176269509], [111.797548455860408, 0.904441229654651], [112.380251906383648, 1.410120957846757], [112.859809198052176, 1.497790025229946], [113.805849644019531, 1.217548732911041], [114.621355422017473, 1.430688177898886], [115.134037306785231, 2.821481838386219], [115.51907840379198, 3.169238389494395], [115.86551720587677, 4.306559149590156], [117.01521447150634, 4.306094061699468], [117.882034946770162, 4.137551377779487], [117.313232456533513, 3.234428208830578], [118.048329705885351, 2.287690131027361], [117.875627069166001, 1.827640692548911]]], [[[105.817655063909356, -5.852355645372411], [104.710384149191498, -5.873284600450644], [103.868213332130736, -5.037314955264974], [102.584260695406897, -4.220258884298203], [102.156173130300999, -3.614146009946765], [101.399113397225051, -2.799777113459171], [100.902502882900137, -2.05026213949786], [100.141980828860596, -0.650347588710957], [99.26373986206022, 0.183141587724663], [98.970011020913319, 1.042882391764536], [98.601351352943084, 1.823506577965616], [97.699597609449881, 2.453183905442116], [97.17694217324987, 3.30879059489861], [96.424016554757316, 3.86885976807791], [95.380876092513475, 4.970782172053673], [95.293026157617305, 5.479820868344816], [95.936862827541745, 5.439513251157108], [97.484882033277088, 5.24632090903401], [98.369169142655679, 4.268370266126366], [99.142558628335792, 3.590349636240915], [99.693997837322399, 3.174328518075156], [100.641433546961665, 2.099381211755798], [101.658012323007313, 2.083697414555189], [102.498271112073212, 1.398700466310217], [103.076840448013002, 0.561361395668854], [103.838396030698348, 0.104541734208666], [103.437645298274973, -0.711945896002845], [104.010788608824001, -1.059211521004229], [104.369991489684878, -1.084843031421016], [104.539490187602155, -1.782371514496716], [104.887892694113987, -2.340425306816655], [105.622111444116982, -2.42884368246807], [106.10859337771268, -3.06177662517895], [105.857445916774111, -4.305524997579723], [105.817655063909356, -5.852355645372411]]]] } }, - { "type": "Feature", "properties": { "admin": "India", "name": "India", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[77.837450799474553, 35.494009507787759], [78.912268914713209, 34.321936346975782], [78.811086460285722, 33.506198025032404], [79.208891636068572, 32.994394639613709], [79.176128777995501, 32.483779812137705], [78.458446486325997, 32.61816437431272], [78.738894484374001, 31.515906073527056], [79.721366815107089, 30.882714748654724], [81.11125613802929, 30.183480943313398], [80.476721225917373, 29.729865220655334], [80.088424513676259, 28.794470119740136], [81.057202589851997, 28.416095282499036], [81.999987420584958, 27.925479234319987], [83.304248895199535, 27.364505723575554], [84.675017938173767, 27.234901231387528], [85.25177859898335, 26.726198431906337], [86.024392938179147, 26.630984605408567], [87.22747195836628, 26.39789805755607], [88.060237664749806, 26.414615383402484], [88.174804315140904, 26.810405178325944], [88.043132765661198, 27.445818589786818], [88.120440708369841, 27.876541652939586], [88.730325962278528, 28.086864732367509], [88.814248488320544, 27.299315904239361], [88.835642531289366, 27.098966376243755], [89.744527622438838, 26.71940298105995], [90.37327477413406, 26.875724188742872], [91.217512648486405, 26.808648179628019], [92.033483514375078, 26.838310451763554], [92.10371178585973, 27.4526140406332], [91.69665652869665, 27.771741848251661], [92.503118931043616, 27.896876329046442], [93.413347609432662, 28.640629380807219], [94.565990431702929, 29.277438055939978], [95.404802280664612, 29.031716620392125], [96.117678664131006, 29.452802028922459], [96.586590610747479, 28.830979519154337], [96.248833449287758, 28.411030992134435], [97.327113885490007, 28.261582749946331], [97.402561476636123, 27.88253611908544], [97.051988559968066, 27.699058946233144], [97.133999058015277, 27.08377350514996], [96.419365675850941, 27.264589341739221], [95.124767694074933, 26.573572089132295], [95.155153436262566, 26.001307277932078], [94.603249139385355, 25.162495428970399], [94.552657912171611, 24.675238348890328], [94.106741977925054, 23.850740871673477], [93.325187615942767, 24.078556423432197], [93.286326938859247, 23.043658352138998], [93.060294224014598, 22.703110663335565], [93.166127557348361, 22.278459580977099], [92.672720981825549, 22.041238918541247], [92.146034783906799, 23.62749868417259], [91.869927606171302, 23.62434642180278], [91.706475050832083, 22.985263983649183], [91.158963250699713, 23.503526923104381], [91.467729933643668, 24.072639471934789], [91.915092807994398, 24.130413723237108], [92.376201613334786, 24.976692816664961], [91.799595981822065, 25.14743174895731], [90.872210727912105, 25.13260061288954], [89.920692580121838, 25.269749864192171], [89.832480910199592, 25.965082098895476], [89.355094028687276, 26.014407253518065], [88.56304935094974, 26.446525580342716], [88.209789259802477, 25.768065700782707], [88.931553989623069, 25.238692328384769], [88.30637251175601, 24.866079413344199], [88.084422235062405, 24.501657212821918], [88.699940220090895, 24.233714911388557], [88.529769728553759, 23.631141872649163], [88.876311883503064, 22.879146429937826], [89.031961297566198, 22.055708319582973], [88.888765903685396, 21.690588487224741], [88.208497348995209, 21.703171698487804], [86.975704380240259, 21.495561631755201], [87.033168572948853, 20.743307806882406], [86.499351027373777, 20.151638495356604], [85.060265740909671, 19.478578802971096], [83.941005893899998, 18.302009792549722], [83.189217156917834, 17.671221421778977], [82.192792189465905, 17.016636053937813], [82.191241896497175, 16.556664130107844], [81.692719354177456, 16.3102192245079], [80.791999139330116, 15.951972357644488], [80.324895867843864, 15.899184882058346], [80.025069207686428, 15.136414903214144], [80.23327355339039, 13.835770778859978], [80.286293572921849, 13.006260687710832], [79.862546828128487, 12.056215318240886], [79.85799930208681, 10.357275091997108], [79.340511509115984, 10.308854274939618], [78.885345493489169, 9.54613597252772], [79.189719679688281, 9.216543687370146], [78.27794070833049, 8.933046779816932], [77.94116539908434, 8.25295909263974], [77.539897902337927, 7.965534776232331], [76.592978957021657, 8.899276231314188], [76.130061476551063, 10.299630031775518], [75.746467319648488, 11.308250637248303], [75.396101108709573, 11.781245022015822], [74.864815708316812, 12.741935736537895], [74.616717156883524, 13.992582912649677], [74.443859490867197, 14.617221787977693], [73.534199253233368, 15.990652167214957], [73.119909295549419, 17.928570054592495], [72.820909458308634, 19.208233547436162], [72.824475132136783, 20.41950328214153], [72.630533481745388, 21.356009426351001], [71.175273471973938, 20.757441311114228], [70.470458611945091, 20.877330634031381], [69.164130080038817, 22.089298000572697], [69.644927606082391, 22.450774644454334], [69.349596795534325, 22.843179633062686], [68.176645135373377, 23.691965033456704], [68.842599318318761, 24.359133612560932], [71.0432401874682, 24.356523952730193], [70.844699334602822, 25.215102037043511], [70.282873162725579, 25.722228705339823], [70.168926629522005, 26.491871649678835], [69.514392938113119, 26.940965684511365], [70.61649620960192, 27.989196275335861], [71.777665643200308, 27.913180243434521], [72.823751662084689, 28.961591701772047], [73.450638462217412, 29.976413479119863], [74.421380242820263, 30.97981476493117], [74.405928989564998, 31.692639471965272], [75.258641798813187, 32.271105455040491], [74.451559279278698, 32.764899603805489], [74.104293654277328, 33.441473293586846], [73.749948358051952, 34.317698879527846], [74.240202671204955, 34.748887030571247], [75.757060988268321, 34.504922593721311], [76.871721632804011, 34.653544012992732], [77.837450799474553, 35.494009507787759]]] } }, - { "type": "Feature", "properties": { "admin": "Ireland", "name": "Ireland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-6.197884894220989, 53.86756500916335], [-6.032985398777609, 53.153164170944336], [-6.788856573910847, 52.260117906292322], [-8.561616583683557, 51.669301255899349], [-9.977085740590267, 51.820454820353071], [-9.16628251793078, 52.864628811242667], [-9.688524542672452, 53.881362616585285], [-8.327987433292007, 54.664518947968624], [-7.572167934591064, 55.131622219454854], [-7.366030646178785, 54.595840969452709], [-7.572167934591064, 54.059956366585986], [-6.953730231138065, 54.073702297575622], [-6.197884894220989, 53.86756500916335]]] } }, - { "type": "Feature", "properties": { "admin": "Iran", "name": "Iran", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[53.921597934795543, 37.198918361961255], [54.800303989486558, 37.392420762678178], [55.511578403551894, 37.964117133123153], [56.180374790273319, 37.935126654607423], [56.619366082592805, 38.121394354803478], [57.330433790928964, 38.029229437810933], [58.436154412678192, 37.522309475243794], [59.234761997316795, 37.412987982730336], [60.377637973883864, 36.52738312432836], [61.123070509694131, 36.491597194966239], [61.21081709172573, 35.650072333309218], [60.80319339380744, 34.404101874319856], [60.528429803311575, 33.676446031217999], [60.963700392505991, 33.528832302376252], [60.536077915290761, 32.981268825811561], [60.863654819588952, 32.182919623334421], [60.941944614511115, 31.548074652628745], [61.699314406180811, 31.379506130492661], [61.78122155136343, 30.735850328081231], [60.874248488208778, 29.829238999952604], [61.369308709564926, 29.303276272085917], [61.771868117118615, 28.699333807890792], [62.727830438085974, 28.259644883735383], [62.755425652929851, 27.378923448184985], [63.23389773952028, 27.217047024030702], [63.316631707619578, 26.756532497661659], [61.874187453056535, 26.239974880472097], [61.497362908784183, 25.078237006118492], [59.616134067630831, 25.380156561783775], [58.525761346272297, 25.609961656185725], [57.39725141788238, 25.739902045183634], [56.97076582217754, 26.966106268821356], [56.492138706290199, 27.14330475515019], [55.723710158110059, 26.964633490501036], [54.715089552637252, 26.480657863871507], [53.493096958231334, 26.812368882753042], [52.483597853409599, 27.580849107365488], [51.520762566947404, 27.865689602158291], [50.852948032439528, 28.814520575469377], [50.115008579311571, 30.14777252859971], [49.576850213423988, 29.9857152369324], [48.941333449098536, 30.31709035900403], [48.567971225789748, 29.926778265903515], [48.014568312376085, 30.452456773392594], [48.00469811380831, 30.985137437457237], [47.685286085812258, 30.984853217079621], [47.849203729042095, 31.709175930298663], [47.334661492711895, 32.469155381799105], [46.109361606639304, 33.017287299118998], [45.416690708199035, 33.967797756479577], [45.648459507028079, 34.748137722303007], [46.15178795755093, 35.093258775364284], [46.076340366404786, 35.67738332777548], [45.420618117053202, 35.977545884742817], [44.77267, 37.17045], [44.225755649600522, 37.971584377589345], [44.421402622257538, 38.281281236314534], [44.109225294782334, 39.428136298168091], [44.793989699081934, 39.713002631177041], [44.9526880226503, 39.335764675446363], [45.457721795438765, 38.874139105783051], [46.143623081248812, 38.74120148371221], [46.505719842317966, 38.770605373686287], [47.685079380083081, 39.508363959301207], [48.060095249225235, 39.582235419262453], [48.355529412637871, 39.2887649602769], [48.010744256386474, 38.794014797514514], [48.634375441284803, 38.27037750910096], [48.883249139202483, 38.32024526626261], [49.199612257693332, 37.582874253889877], [50.147771437384606, 37.37456655532133], [50.842354363819695, 36.872814235983384], [52.26402469260141, 36.700421657857696], [53.825789829326411, 36.965030829408228], [53.921597934795543, 37.198918361961255]]] } }, - { "type": "Feature", "properties": { "admin": "Iraq", "name": "Iraq", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[45.420618117053202, 35.977545884742817], [46.076340366404786, 35.67738332777548], [46.15178795755093, 35.093258775364284], [45.648459507028079, 34.748137722303007], [45.416690708199035, 33.967797756479577], [46.109361606639304, 33.017287299118998], [47.334661492711895, 32.469155381799105], [47.849203729042095, 31.709175930298663], [47.685286085812258, 30.984853217079621], [48.00469811380831, 30.985137437457237], [48.014568312376085, 30.452456773392594], [48.567971225789748, 29.926778265903515], [47.974519077349889, 29.975819200148493], [47.302622104690947, 30.059069932570711], [46.568713413281742, 29.099025173452283], [44.709498732284736, 29.178891099559376], [41.889980910007829, 31.190008653278362], [40.399994337736238, 31.889991766887931], [39.195468377444961, 32.16100881604266], [38.792340529136077, 33.378686428352218], [41.00615888851992, 34.419372260062111], [41.383965285005807, 35.628316555314349], [41.289707472505448, 36.358814602192261], [41.837064243340954, 36.605853786763568], [42.349591098811764, 37.22987254490409], [42.779125604021822, 37.385263576805741], [43.942258742047287, 37.256227525372942], [44.293451775902852, 37.001514390606289], [44.772699008977689, 37.170444647768427], [45.420618117053202, 35.977545884742817]]] } }, - { "type": "Feature", "properties": { "admin": "Iceland", "name": "Iceland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-14.508695441129232, 66.455892239031414], [-14.739637417041605, 65.808748277440287], [-13.609732224979807, 65.126671047619851], [-14.9098337467949, 64.36408193628867], [-17.794438035543418, 63.67874909123384], [-18.656245896874989, 63.496382961675806], [-19.972754685942757, 63.643634955491514], [-22.762971971110154, 63.960178941495371], [-21.778484259517676, 64.402115790455497], [-23.955043911219104, 64.891129869233481], [-22.184402635170354, 65.084968166760291], [-22.227423265053329, 65.378593655042721], [-24.326184047939332, 65.611189276788451], [-23.650514695723082, 66.262519029395207], [-22.134922451250883, 66.410468655046856], [-20.576283738679543, 65.732112128351417], [-19.056841600001587, 66.276600857194751], [-17.798623826559048, 65.993853257909763], [-16.167818976292121, 66.526792304135853], [-14.508695441129232, 66.455892239031414]]] } }, - { "type": "Feature", "properties": { "admin": "Israel", "name": "Israel", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.719918247222743, 32.709192409794859], [35.545665317534535, 32.393992011030569], [35.183930291491428, 32.532510687788935], [34.974640740709319, 31.866582343059715], [35.225891554512422, 31.754341132121759], [34.970506626125989, 31.616778469360803], [34.927408481594554, 31.35343537040141], [35.397560662586038, 31.489086005167572], [35.420918409981958, 31.100065822874349], [34.922602573391423, 29.501326198844517], [34.26543338393568, 31.219360866820146], [34.556371697738903, 31.548823960896989], [34.48810713068135, 31.605538845337314], [34.752587111151165, 32.07292633720116], [34.955417107896771, 32.827376410446369], [35.098457472480668, 33.080539252244257], [35.126052687324538, 33.090900376918775], [35.460709262846699, 33.089040025356276], [35.552796665190805, 33.264274807258012], [35.821100701650231, 33.277426459276292], [35.836396925608618, 32.868123277308506], [35.700797967274745, 32.716013698857374], [35.719918247222743, 32.709192409794859]]] } }, - { "type": "Feature", "properties": { "admin": "Italy", "name": "Italy", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[15.52037601081383, 38.231155096991465], [15.160242954171732, 37.444045518537813], [15.309897902089002, 37.134219468731793], [15.099988234119445, 36.61998729099539], [14.335228712632013, 36.996630967754747], [13.826732618879927, 37.104531358380186], [12.431003859108809, 37.612949937483812], [12.570943637755132, 38.126381130519682], [13.741156447004581, 38.03496552179535], [14.761249220446157, 38.143873602850498], [15.52037601081383, 38.231155096991465]]], [[[9.210011834356264, 41.209991360024212], [9.809975213264973, 40.500008856766094], [9.669518670295671, 39.177376410471787], [9.214817742559486, 39.240473334300127], [8.806935662479729, 38.906617743478471], [8.428302443077113, 39.171847032216611], [8.388253208050939, 40.378310858718798], [8.159998406617659, 40.950007229163774], [8.709990675500107, 40.899984442705225], [9.210011834356264, 41.209991360024212]]], [[[12.376485223040842, 46.767559109069872], [13.806475457421552, 46.50930613869118], [13.698109978905475, 46.016778062517368], [13.937630242578335, 45.59101593686465], [13.141606479554294, 45.736691799495411], [12.328581170306304, 45.38177806251484], [12.383874952858601, 44.885374253919075], [12.261453484759157, 44.600482082694008], [12.589237094786482, 44.091365871754462], [13.526905958722491, 43.587727362637899], [14.029820997787024, 42.761007798832473], [15.142569614327952, 41.955139675456891], [15.926191033601892, 41.961315009115729], [16.169897088290409, 41.740294908203417], [15.889345737377793, 41.541082261718195], [16.785001661860573, 41.179605617836579], [17.519168735431204, 40.877143459632229], [18.376687452882575, 40.355624904942651], [18.4802470231954, 40.168866278639818], [18.293385044028096, 39.810774441073235], [17.738380161213279, 40.277671006830289], [16.869595981522334, 40.442234605463838], [16.448743116937319, 39.795400702466473], [17.171489698971495, 39.424699815420716], [17.052840610429339, 38.902871202137291], [16.635088331781841, 38.843572496082395], [16.100960727613053, 37.985898749334176], [15.684086948314498, 37.908849188787023], [15.687962680736318, 38.214592800441849], [15.891981235424705, 38.750942491199218], [16.109332309644312, 38.964547024077682], [15.718813510814638, 39.544072374014938], [15.413612501698818, 40.048356838535163], [14.998495721098234, 40.172948716790913], [14.703268263414767, 40.604550279292617], [14.06067182786526, 40.786347968095434], [13.627985060285393, 41.188287258461649], [12.888081902730418, 41.253089504555604], [12.106682570044907, 41.7045348170574], [11.191906365614184, 42.355425319989671], [10.511947869517794, 42.93146251074721], [10.200028924204046, 43.920006822274608], [9.702488234097812, 44.036278794931313], [8.888946160526869, 44.366336167979533], [8.428560825238575, 44.23122813575241], [7.8507666357832, 43.767147935555236], [7.435184767291841, 43.693844916349164], [7.549596388386161, 44.127901109384808], [7.007562290076661, 44.254766750661382], [6.749955275101711, 45.028517971367584], [7.096652459347835, 45.333098863295859], [6.80235517744566, 45.708579820328673], [6.84359297041456, 45.991146552100659], [7.273850945676683, 45.776947740250748], [7.755992058959832, 45.824490057959267], [8.316629672894377, 46.16364248309084], [8.489952426801294, 46.005150865251736], [8.966305779667833, 46.03693187111115], [9.18288170740311, 46.440214748716976], [9.92283654139035, 46.314899400409182], [10.363378126678665, 46.48357127540983], [10.4427014502466, 46.893546250997431], [11.048555942436504, 46.751358547546396], [11.164827915093325, 46.941579494812729], [12.153088006243079, 47.115393174826423], [12.376485223040842, 46.767559109069872]]]] } }, - { "type": "Feature", "properties": { "admin": "Jamaica", "name": "Jamaica", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-77.569600796199197, 18.490525417550483], [-76.896618618462114, 18.400866807524078], [-76.365359056285527, 18.16070058844759], [-76.19965857614163, 17.886867173732963], [-76.902561408175671, 17.868237819891743], [-77.206341315403449, 17.701116237859818], [-77.766022915340599, 17.861597398342237], [-78.337719285785596, 18.225967922432226], [-78.217726610003865, 18.454532782459193], [-77.797364671525614, 18.524218451404774], [-77.569600796199197, 18.490525417550483]]] } }, - { "type": "Feature", "properties": { "admin": "Jordan", "name": "Jordan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.545665317534535, 32.393992011030569], [35.719918247222743, 32.709192409794859], [36.834062127435537, 32.312937526980768], [38.792340529136077, 33.378686428352218], [39.195468377444961, 32.16100881604266], [39.004885695152545, 32.010216986614971], [37.002165561681004, 31.508412990844736], [37.998848911294367, 30.508499864213128], [37.668119744626374, 30.338665269485894], [37.503581984209028, 30.003776150018396], [36.740527784987243, 29.865283311476183], [36.501214227043583, 29.505253607698702], [36.068940870922049, 29.19749461518445], [34.956037225084252, 29.356554673778835], [34.922602573391423, 29.501326198844517], [35.420918409981958, 31.100065822874349], [35.397560662586038, 31.489086005167572], [35.545251906076196, 31.782504787720832], [35.545665317534535, 32.393992011030569]]] } }, - { "type": "Feature", "properties": { "admin": "Japan", "name": "Japan", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[134.638428176003856, 34.149233710256418], [134.766379022358478, 33.806334743783673], [134.20341596897083, 33.201177883429622], [133.792950067276479, 33.521985175097583], [133.280268182508848, 33.289570420864941], [133.014858026257855, 32.704567369104772], [132.363114862192674, 32.989382025681373], [132.371176385630179, 33.463642483040068], [132.924372593314786, 34.060298570282036], [133.492968377822194, 33.944620876596694], [133.904106073136347, 34.364931138642611], [134.638428176003856, 34.149233710256418]]], [[[140.976387567305267, 37.142074286440156], [140.599769728762084, 36.343983466124534], [140.774074334882641, 35.842877102190229], [140.253279250245072, 35.138113918593653], [138.975527785396196, 34.667600002576101], [137.217598911691198, 34.606285915661843], [135.792983026268871, 33.46480520276662], [135.120982700745401, 33.849071153289053], [135.07943484918269, 34.596544908174813], [133.340316196831964, 34.375938218720755], [132.156770868051296, 33.904933376596503], [130.986144647343451, 33.885761420216276], [132.000036248910021, 33.149992377244608], [131.33279015515734, 31.450354519164836], [130.68631798718593, 31.029579169228235], [130.202419875204953, 31.418237616495411], [130.447676222862128, 32.319474595665717], [129.81469160371887, 32.610309556604385], [129.408463169472554, 33.296055813117583], [130.353935174684636, 33.604150702441693], [130.878450962447118, 34.232742824840031], [131.884229364143891, 34.749713853487911], [132.617672967662486, 35.433393052709413], [134.608300815977771, 35.731617743465812], [135.677537876528902, 35.527134100886819], [136.723830601142424, 37.304984239240376], [137.390611607004473, 36.827390651998819], [138.857602166906247, 37.827484646143454], [139.426404657142882, 38.215962225897634], [140.054790073812057, 39.438807481436378], [139.883379347899847, 40.563312486323682], [140.305782505453664, 41.195005194659551], [141.368973423426667, 41.378559882160282], [141.914263136970476, 39.991616115878678], [141.884600864834965, 39.18086456965149], [140.959489373945729, 38.174000962876583], [140.976387567305267, 37.142074286440156]]], [[[143.910161981379474, 44.174099839853724], [144.613426548439634, 43.960882880217511], [145.320825230083074, 44.384732977875437], [145.543137241802754, 43.262088324550596], [144.059661899999867, 42.988358262700551], [143.183849725517291, 41.995214748699183], [141.611490920172457, 42.678790595056071], [141.067286411706618, 41.58459381770799], [139.95510623592105, 41.56955597591103], [139.817543573159924, 42.563758856774392], [140.312087030193169, 43.333272610032644], [141.380548944259999, 43.388824774746489], [141.671952345953912, 44.772125352551477], [141.967644891527982, 45.551483466161343], [143.142870314709796, 44.510358384776957], [143.910161981379474, 44.174099839853724]]]] } }, - { "type": "Feature", "properties": { "admin": "Kazakhstan", "name": "Kazakhstan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[70.962314894499272, 42.26615428320553], [70.388964878220776, 42.081307684897517], [69.070027296835221, 41.384244289712335], [68.632482944620037, 40.668680731766855], [68.259895867795635, 40.662324530594894], [67.985855747351806, 41.135990708982199], [66.714047072216587, 41.168443508461557], [66.510648634715707, 41.987644151368549], [66.023391554635609, 41.994646307944031], [66.098012322865188, 42.997660020513074], [64.90082441595932, 43.728080552742647], [63.18578698105658, 43.650074978197999], [62.013300408786264, 43.504476630215649], [61.05831994003249, 44.405816962250576], [60.239971958258472, 44.784036770194739], [58.689989048095796, 45.500013739598721], [58.503127068928428, 45.58680430763296], [55.928917270741167, 44.995858466159163], [55.968191359283011, 41.30864166926937], [55.455251092353805, 41.259859117185826], [54.755345493392653, 42.04397146256661], [54.079417759014959, 42.324109402020831], [52.944293247291725, 42.116034247397572], [52.502459751196277, 41.783315538086462], [52.446339145727208, 42.027150783855561], [52.692112257707251, 42.443895372073364], [52.501426222550315, 42.792297878585188], [51.342427199108201, 43.132974758469338], [50.891291945200223, 44.031033637053774], [50.339129266161358, 44.284015611338468], [50.305642938036257, 44.609835516938908], [51.278503452363211, 44.514854234386448], [51.316899041556034, 45.245998236667894], [52.167389764215713, 45.408391425145098], [53.040876499245194, 45.259046535821753], [53.220865512917712, 46.23464590105992], [53.042736850807771, 46.853006089864486], [52.042022739475598, 46.804636949239232], [51.191945428274252, 47.048704738953909], [50.034083286342465, 46.608989976582208], [49.10116, 46.39933000000012], [48.593241001180495, 46.561034247415471], [48.694733514201729, 47.075628160177921], [48.057253045449258, 47.743752753279516], [47.315231154170242, 47.715847479841948], [46.466445753776256, 48.394152330104923], [47.043671502476506, 49.1520388860976], [46.751596307162728, 49.35600576435376], [47.549480421749301, 50.454698391311119], [48.577841424357523, 49.874759629915658], [48.702381626181008, 50.605128485712825], [50.766648390512145, 51.692762356159889], [52.328723585830957, 51.71865224873811], [54.53287845237621, 51.026239732459302], [55.716940545479801, 50.62171662047853], [56.777961053296551, 51.043551337277037], [58.363290643146733, 51.063653469438563], [59.642282342370599, 50.545442206415707], [59.932807244715484, 50.842194118851857], [61.337424350840919, 50.799070136104248], [61.588003371024158, 51.2726587998432], [59.967533807215531, 51.960420437215696], [60.927268507740258, 52.447548326215028], [60.739993117114572, 52.719986477257734], [61.699986199800584, 52.979996446334255], [60.978066440683151, 53.664993394579128], [61.436591424409052, 54.006264553434775], [65.178533563095911, 54.354227810272093], [65.66687584825398, 54.601266994843449], [68.169100376258811, 54.970391750704309], [69.068166945272864, 55.385250149143516], [70.865266554655122, 55.169733588270091], [71.180131056609397, 54.133285224008247], [72.224150018202167, 54.376655381886728], [73.508516066384388, 54.035616766976588], [73.425678745420427, 53.489810289109741], [74.384845005190044, 53.546861070360066], [76.891100294913414, 54.490524400441913], [76.525179477854735, 54.177003485727127], [77.800915561844221, 53.404414984747561], [80.035559523441663, 50.864750881547238], [80.568446893235475, 51.388336493528456], [81.945985548839914, 50.812195949906354], [83.383003778012366, 51.069182847693909], [83.935114780618832, 50.889245510453563], [84.416377394553052, 50.311399644565817], [85.115559523462011, 50.117302964877631], [85.541269972682457, 49.69285858824815], [86.829356723989619, 49.826674709668154], [87.359970330762664, 49.214980780629148], [86.598776483103379, 48.549181626980605], [85.768232863308285, 48.455750637396974], [85.72048383987071, 47.452969468773112], [85.164290399113355, 47.000955715516099], [83.180483839860443, 47.330031236350848], [82.458925815769106, 45.539649563166499], [81.947070753918112, 45.317027492853235], [79.966106398441397, 44.917516994804643], [80.866206496101356, 43.180362046881037], [80.180150180994289, 42.920067857426936], [80.259990268885332, 42.349999294599101], [79.643645460940135, 42.496682847659649], [79.142177361979776, 42.856092434249589], [77.658391961583206, 42.960685533208327], [76.000353631498555, 42.988022365890622], [75.636964959622091, 42.877899888676765], [74.212865838522575, 43.298339341803505], [73.645303582660901, 43.091271877609863], [73.489757521462337, 42.500894476891276], [71.844638299450637, 42.845395412765178], [71.186280552052253, 42.704292914392219], [70.962314894499272, 42.26615428320553]]] } }, - { "type": "Feature", "properties": { "admin": "Kenya", "name": "Kenya", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[40.993, -0.85829], [41.58513, -1.68325], [40.88477, -2.08255], [40.63785, -2.49979], [40.26304, -2.57309], [40.12119, -3.27768], [39.80006, -3.68116], [39.60489, -4.34653], [39.20222, -4.67677], [37.7669, -3.67712], [37.69869, -3.09699], [34.07262, -1.05982], [33.903711197104521, -0.95], [33.893568969666937, 0.109813537861896], [34.18, 0.515], [34.6721, 1.17694], [35.03599, 1.90584], [34.59607, 3.05374], [34.47913, 3.5556], [34.005, 4.249884947362047], [34.620196267853871, 4.847122742081987], [35.298007118232974, 5.506], [35.817447662353501, 5.338232082790795], [35.817447662353501, 4.776965663461889], [36.159078632855639, 4.447864127672768], [36.855093238008116, 4.447864127672768], [38.120915, 3.598605], [38.43697, 3.58851], [38.67114, 3.61607], [38.89251, 3.50074], [39.559384258765846, 3.42206], [39.85494, 3.83879], [40.76848, 4.25702], [41.1718, 3.91909], [41.855083092643966, 3.918911920483726], [40.98105, 2.78452], [40.993, -0.85829]]] } }, - { "type": "Feature", "properties": { "admin": "Kyrgyzstan", "name": "Kyrgyzstan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[70.96231489449913, 42.266154283205481], [71.186280552052111, 42.704292914392127], [71.84463829945058, 42.845395412765093], [73.489757521462337, 42.500894476891311], [73.645303582660901, 43.09127187760982], [74.212865838522546, 43.298339341803363], [75.636964959622006, 42.877899888676673], [76.000353631498442, 42.988022365890664], [77.658391961583206, 42.960685533208256], [79.142177361979762, 42.856092434249511], [79.643645460940107, 42.496682847659514], [80.259990268885289, 42.349999294599044], [80.119430373051358, 42.123940741538235], [78.543660923175295, 41.582242540038685], [78.187196893225959, 41.185315863604792], [76.904484490877067, 41.066485907549634], [76.526368035797432, 40.427946071935111], [75.467827996730691, 40.562072251948663], [74.776862420556043, 40.366425279291619], [73.822243686828287, 39.893973497063179], [73.960013055318413, 39.660008449861721], [73.67537926625478, 39.431236884105594], [71.784693637991992, 39.279463202464363], [70.549161818325601, 39.604197902986492], [69.464886915977516, 39.526683254548693], [69.559609816368507, 40.103211371412968], [70.648018833299957, 39.935753892571157], [71.014198032520156, 40.244365546218226], [71.774875115856545, 40.145844428053763], [73.055417108049156, 40.86603302668945], [71.870114780570447, 41.392900092121259], [71.157858514291576, 41.143587144529107], [70.420022414028196, 41.519998277343134], [71.259247674448218, 42.167710679689456], [70.96231489449913, 42.266154283205481]]] } }, - { "type": "Feature", "properties": { "admin": "Cambodia", "name": "Cambodia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[103.497279901139677, 10.632555446815926], [103.090689731867229, 11.153660590047162], [102.58493248902667, 12.186594956913279], [102.348099399833004, 13.39424734135822], [102.988422072361601, 14.225721136934464], [104.281418084736586, 14.416743068901363], [105.218776890078871, 14.27321177821069], [106.04394616091551, 13.881091009979952], [106.496373325630856, 14.57058380783428], [107.382727492301058, 14.202440904186968], [107.614547967562402, 13.535530707244202], [107.491403029410861, 12.337205918827944], [105.810523716253101, 11.567614650921225], [106.249670037869436, 10.961811835163585], [105.199914992292321, 10.889309800658094], [104.334334751403446, 10.486543687375228], [103.497279901139677, 10.632555446815926]]] } }, - { "type": "Feature", "properties": { "admin": "South Korea", "name": "Korea", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[128.349716424676586, 38.612242946927843], [129.212919549680038, 37.432392483055942], [129.460449660358137, 36.784189154602821], [129.468304478066472, 35.632140611303939], [129.091376580929563, 35.08248423923142], [128.18585045787907, 34.890377102186385], [127.386519403188373, 34.475673733044111], [126.485747511908713, 34.390045884736473], [126.3739197124291, 34.934560451795939], [126.559231398627773, 35.684540513647896], [126.117397902532261, 36.725484727519252], [126.860143263863364, 36.893924058574612], [126.174758742376213, 37.749685777328033], [126.237338901881742, 37.840377916000271], [126.683719924018888, 37.804772854151174], [127.073308547067342, 38.256114813788393], [127.780035435090966, 38.304535630845884], [128.205745884311426, 38.370397243801882], [128.349716424676586, 38.612242946927843]]] } }, - { "type": "Feature", "properties": { "admin": "Kosovo", "name": "Kosovo", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.76216, 42.05186], [20.717310000000108, 41.84711], [20.59023, 41.85541], [20.52295, 42.21787], [20.28374, 42.32025], [20.0707, 42.58863], [20.25758, 42.81275], [20.49679, 42.88469], [20.63508, 43.21671], [20.81448, 43.27205], [20.95651, 43.13094], [21.143395, 43.068685000000123], [21.27421, 42.90959], [21.43866, 42.86255], [21.63302, 42.67717], [21.77505, 42.6827], [21.66292, 42.43922], [21.54332, 42.32025], [21.576635989402117, 42.245224397061847], [21.352700000000134, 42.2068], [20.76216, 42.05186]]] } }, - { "type": "Feature", "properties": { "admin": "Kuwait", "name": "Kuwait", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[47.974519077349889, 29.975819200148493], [48.183188510944483, 29.534476630159759], [48.09394331237641, 29.306299343374999], [48.416094191283939, 28.552004299426663], [47.708850538937376, 28.526062730416136], [47.459821811722819, 29.002519436147217], [46.568713413281742, 29.099025173452283], [47.302622104690947, 30.059069932570711], [47.974519077349889, 29.975819200148493]]] } }, - { "type": "Feature", "properties": { "admin": "Laos", "name": "Lao PDR", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[105.218776890078871, 14.27321177821069], [105.544338413517664, 14.723933620660414], [105.589038527450128, 15.570316066952856], [104.779320509868768, 16.441864935771445], [104.716947056092465, 17.428858954330078], [103.956476678485288, 18.240954087796872], [103.200192091893726, 18.309632066312769], [102.998705682387694, 17.961694647691598], [102.413004998791592, 17.932781683824281], [102.113591750092453, 18.109101670804161], [101.059547560635139, 17.512497259994486], [101.035931431077742, 18.408928330961611], [101.282014601651667, 19.462584947176762], [100.606293573003128, 19.508344427971217], [100.548881056726856, 20.109237982661124], [100.115987583417819, 20.41784963630818], [100.329101190189519, 20.786121731036229], [101.180005324307515, 21.436572984294024], [101.270025669359939, 21.201651923095177], [101.803119744882906, 21.174366766845065], [101.652017856861491, 22.318198757409544], [102.170435825613552, 22.464753119389297], [102.754896274834636, 21.675137233969462], [103.203861118586431, 20.766562201413745], [104.435000441508024, 20.758733221921528], [104.822573683697073, 19.886641750563879], [104.183387892678908, 19.624668077060214], [103.896532017026701, 19.265180975821799], [105.094598423281496, 18.666974595611073], [105.925762160264, 17.485315456608955], [106.55600792849566, 16.604283962464802], [107.312705926545576, 15.908538316303177], [107.564525181103875, 15.202173163305554], [107.382727492301058, 14.202440904186968], [106.496373325630856, 14.57058380783428], [106.04394616091551, 13.881091009979952], [105.218776890078871, 14.27321177821069]]] } }, - { "type": "Feature", "properties": { "admin": "Lebanon", "name": "Lebanon", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.821100701650231, 33.277426459276292], [35.552796665190805, 33.264274807258012], [35.460709262846699, 33.089040025356276], [35.126052687324538, 33.090900376918775], [35.48220665868012, 33.905450140919434], [35.979592319489392, 34.610058295219126], [35.998402540843628, 34.644914048799997], [36.448194207512095, 34.59393524834406], [36.611750115715886, 34.201788641897174], [36.066460402172048, 33.824912421192543], [35.821100701650231, 33.277426459276292]]] } }, - { "type": "Feature", "properties": { "admin": "Liberia", "name": "Liberia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-7.712159389669749, 4.364565944837721], [-7.974107224957249, 4.355755113131961], [-9.004793667018673, 4.832418524592199], [-9.913420376006682, 5.593560695819205], [-10.765383876986643, 6.140710760925556], [-11.438779466182053, 6.785916856305746], [-11.199801805048278, 7.105845648624735], [-11.14670427086838, 7.396706447779534], [-10.695594855176477, 7.939464016141085], [-10.230093553091276, 8.406205552601291], [-10.016566534861253, 8.42850393313523], [-9.755342169625832, 8.541055202666923], [-9.33727983238458, 7.928534450711351], [-9.403348151069748, 7.526905218938906], [-9.208786383490844, 7.313920803247952], [-8.926064622422002, 7.309037380396375], [-8.722123582382123, 7.711674302598509], [-8.439298468448696, 7.686042792181736], [-8.485445522485348, 7.395207831243068], [-8.385451626000572, 6.911800645368742], [-8.602880214868618, 6.467564195171659], [-8.311347622094017, 6.193033148621081], [-7.993692592795879, 6.126189683451541], [-7.570152553731686, 5.707352199725903], [-7.53971513511176, 5.313345241716517], [-7.63536821128403, 5.188159084489455], [-7.712159389669749, 4.364565944837721]]] } }, - { "type": "Feature", "properties": { "admin": "Libya", "name": "Libya", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[14.8513, 22.862950000000119], [14.143870883855239, 22.491288967371126], [13.581424594790459, 23.040506089769274], [11.999505649471697, 23.471668402596432], [11.560669386449032, 24.09790924732561], [10.771363559622952, 24.562532050061741], [10.303846876678445, 24.379313259370967], [9.948261346078024, 24.936953640232613], [9.910692579801774, 25.365454616796789], [9.319410841518218, 26.094324856057476], [9.716285841519662, 26.512206325785652], [9.629056023811073, 27.140953477481041], [9.756128370816779, 27.688258571884198], [9.68388471847288, 28.144173895779311], [9.859997999723472, 28.959989732371064], [9.805634392952353, 29.424638373323369], [9.482139926805415, 30.307556057246181], [9.970017124072966, 30.539324856075375], [10.056575148161697, 30.961831366493517], [9.950225050505194, 31.376069647745275], [10.636901482799484, 31.761420803345679], [10.944789666394511, 32.081814683555358], [11.43225345220378, 32.368903103152824], [11.488787469131008, 33.136995754523234], [12.66331, 32.79278], [13.08326, 32.87882], [13.91868, 32.71196], [15.24563, 32.26508], [15.71394, 31.37626], [16.61162, 31.18218], [18.02109, 30.76357], [19.08641, 30.26639], [19.57404, 30.52582], [20.05335, 30.98576], [19.82033, 31.751790000000135], [20.13397, 32.2382], [20.85452, 32.7068], [21.54298, 32.8432], [22.89576, 32.63858], [23.2368, 32.19149], [23.6091300000001, 32.18726], [23.9275, 32.01667], [24.92114, 31.89936], [25.16482, 31.56915], [24.80287, 31.08929], [24.95762, 30.6616], [24.70007, 30.04419], [25.00000000000011, 29.238654529533552], [25.00000000000011, 25.682499996360995], [25.00000000000011, 22.0], [25.00000000000011, 20.00304], [23.850000000000129, 20.0], [23.837660000000135, 19.580470000000101], [19.84926, 21.49509], [15.86085, 23.40972], [14.8513, 22.862950000000119]]] } }, - { "type": "Feature", "properties": { "admin": "Sri Lanka", "name": "Sri Lanka", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[81.787959018891371, 7.523055324733162], [81.637322218760573, 6.481775214051921], [81.218019647144317, 6.197141424988287], [80.348356968104397, 5.968369859232154], [79.872468703128519, 6.763463446474928], [79.6951668639351, 8.200843410673384], [80.147800734379629, 9.824077663609554], [80.838817986986541, 9.268426825391186], [81.304319289071756, 8.564206244333688], [81.787959018891371, 7.523055324733162]]] } }, - { "type": "Feature", "properties": { "admin": "Lesotho", "name": "Lesotho", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[28.978262566857236, -28.955596612261708], [29.325166456832587, -29.257386976846245], [29.018415154748016, -29.743765557577362], [28.848399692507734, -30.070050551068245], [28.291069370239903, -30.226216729454293], [28.107204624145421, -30.545732110314944], [27.749397006956478, -30.645105889612214], [26.999261915807629, -29.875953871379977], [27.532511020627471, -29.242710870075353], [28.07433841320778, -28.851468601193581], [28.541700066855491, -28.647501722937562], [28.978262566857236, -28.955596612261708]]] } }, - { "type": "Feature", "properties": { "admin": "Lithuania", "name": "Lithuania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.731098667092649, 54.327536932993311], [22.651051873472536, 54.582740993866729], [22.757763706155256, 54.856574408581366], [22.31572350433057, 55.01529857036585], [21.26844892750346, 55.190481675835301], [21.05580040862241, 56.031076361711051], [22.201156853939491, 56.337801825579483], [23.878263787539957, 56.273671373105259], [24.860684441840753, 56.372528388079616], [25.000934279080887, 56.164530748104831], [25.533046502390327, 56.100296942766029], [26.494331495883749, 55.61510691997762], [26.588279249790386, 55.167175604871659], [25.768432651479792, 54.846962592175082], [25.536353794056989, 54.282423407602515], [24.45068362803703, 53.905702216194747], [23.484127638449841, 53.912497667041123], [23.243987257589506, 54.220566718149129], [22.731098667092649, 54.327536932993311]]] } }, - { "type": "Feature", "properties": { "admin": "Luxembourg", "name": "Luxembourg", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[6.043073357781109, 50.128051662794221], [6.242751092156992, 49.90222565367872], [6.186320428094176, 49.4638028021145], [5.897759230176403, 49.442667141307012], [5.674051954784828, 49.52948354755749], [5.782417433300905, 50.090327867221205], [6.043073357781109, 50.128051662794221]]] } }, - { "type": "Feature", "properties": { "admin": "Latvia", "name": "Latvia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[21.05580040862241, 56.031076361711051], [21.090423618257965, 56.783872789122924], [21.581866489353668, 57.411870632549913], [22.524341261492872, 57.753374335350756], [23.31845299652209, 57.006236477274854], [24.120729607853423, 57.025692654032753], [24.312862583114615, 57.793423570376966], [25.164593540149262, 57.970156968815175], [25.602809685984365, 57.847528794986559], [26.46353234223778, 57.476388658266316], [27.288184848751509, 57.474528306703817], [27.770015903440925, 57.244258124411218], [27.855282016722519, 56.759326483784278], [28.17670942557799, 56.169129950578807], [27.102459751094525, 55.783313707087672], [26.494331495883749, 55.61510691997762], [25.533046502390327, 56.100296942766029], [25.000934279080887, 56.164530748104831], [24.860684441840753, 56.372528388079616], [23.878263787539957, 56.273671373105259], [22.201156853939491, 56.337801825579483], [21.05580040862241, 56.031076361711051]]] } }, - { "type": "Feature", "properties": { "admin": "Morocco", "name": "Morocco", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-5.193863491222031, 35.755182196590845], [-4.591006232105143, 35.330711981745644], [-3.640056525070007, 35.39985504815197], [-2.604305792644111, 35.17909332940112], [-2.169913702798624, 35.168396307916694], [-1.792985805661658, 34.527918606091298], [-1.73345455566141, 33.919712836232115], [-1.388049282222596, 32.864015000941372], [-1.124551153966195, 32.651521511357195], [-1.30789913573787, 32.262888902306024], [-2.616604783529567, 32.094346218386157], [-3.068980271812648, 31.724497992473285], [-3.647497931320145, 31.637294012980814], [-3.690441046554666, 30.896951605751152], [-4.859646165374442, 30.501187649043874], [-5.242129278982786, 30.00044302013557], [-6.060632290053745, 29.731699734001801], [-7.059227667661899, 29.57922842052465], [-8.67411617678283, 28.841288967396643], [-8.665589565454836, 27.656425889592462], [-8.817809007940523, 27.656425889592462], [-8.817828334986642, 27.656425889592462], [-8.794883999049032, 27.120696316022553], [-9.413037482124507, 27.088476060488539], [-9.735343390328749, 26.860944729107409], [-10.189424200877452, 26.860944729107409], [-10.551262579785258, 26.990807603456879], [-11.392554897496948, 26.883423977154386], [-11.718219773800339, 26.104091701760801], [-12.030758836301654, 26.030866197203121], [-12.500962693725368, 24.770116278578136], [-13.891110398809044, 23.691009019459383], [-14.22116777185715, 22.310163072188338], [-14.630832688850942, 21.860939846274867], [-14.750954555713404, 21.500600083903802], [-17.002961798561071, 21.42073415779668], [-17.020428432675768, 21.422310288981631], [-16.973247849993182, 21.88574453377495], [-16.589136928767626, 22.158234361250091], [-16.26192175949566, 22.679339504481273], [-16.326413946995896, 23.017768459560894], [-15.982610642958059, 23.723358466074096], [-15.426003790742183, 24.359133612561035], [-15.089331834360729, 24.520260728446964], [-14.824645148161689, 25.103532619725307], [-14.800925665739666, 25.636264960222285], [-14.439939947964827, 26.254418443297645], [-13.773804897506462, 26.618892320252279], [-13.13994177901429, 27.640147813420491], [-13.121613369914709, 27.654147671719805], [-12.61883663578311, 28.038185533148656], [-11.688919236690761, 28.148643907172577], [-10.9009569971044, 28.832142238880913], [-10.39959225100864, 29.09858592377778], [-9.564811163765624, 29.933573716749855], [-9.814718390329174, 31.177735500609053], [-9.434793260119362, 32.038096421836478], [-9.300692918321827, 32.564679266890629], [-8.657476365585039, 33.24024526624239], [-7.654178432638217, 33.697064927702506], [-6.912544114601358, 34.11047638603744], [-6.24434200685141, 35.145865383437517], [-5.929994269219832, 35.759988104793983], [-5.193863491222031, 35.755182196590845]]] } }, - { "type": "Feature", "properties": { "admin": "Moldova", "name": "Moldova", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[26.619336785597788, 48.220726223333457], [26.857823520624798, 48.368210761094488], [27.52253746919515, 48.467119452501102], [28.259546746541837, 48.155562242213406], [28.670891147585163, 48.118148505234089], [29.122698195113024, 47.849095160506458], [29.050867954227321, 47.510226955752493], [29.415135125452732, 47.346645209332571], [29.559674106573105, 46.928582872091312], [29.908851759569295, 46.67436066343145], [29.838210076626289, 46.525325832701675], [30.024658644335364, 46.423936672545032], [29.759971958136383, 46.349987697935354], [29.170653924279879, 46.379262396828693], [29.072106967899288, 46.517677720722482], [28.862972446414055, 46.437889309263824], [28.933717482221621, 46.258830471372491], [28.659987420371575, 45.939986884131628], [28.48526940279276, 45.596907050145887], [28.233553501099035, 45.488283189468369], [28.054442986775392, 45.944586086605618], [28.160017937947707, 46.371562608417207], [28.128030226359037, 46.81047638608824], [27.551166212684841, 47.405117092470817], [27.233872918412736, 47.826770941756365], [26.924176059687561, 48.123264472030982], [26.619336785597788, 48.220726223333457]]] } }, - { "type": "Feature", "properties": { "admin": "Madagascar", "name": "Madagascar", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[49.543518914595737, -12.469832858940553], [49.80898074727908, -12.895284925999551], [50.05651085795715, -13.555761407121981], [50.217431268114055, -14.758788750876795], [50.476536899625515, -15.226512139550541], [50.377111443895942, -15.706069431219122], [50.200274692593169, -16.000263360256763], [49.860605503138665, -15.414252618066913], [49.672606642460849, -15.710203545802477], [49.863344354050142, -16.451036879138773], [49.774564243372694, -16.875042006093597], [49.49861209493411, -17.10603565843827], [49.435618523970298, -17.953064060134363], [49.04179243347393, -19.118781019774442], [48.548540887247995, -20.496888116134119], [47.930749139198653, -22.391501153251077], [47.547723423051295, -23.781958916928513], [47.095761346226588, -24.941629733990446], [46.282477654817079, -25.178462823184102], [45.409507684110444, -25.601434421493082], [44.833573846217547, -25.346101169538933], [44.039720493349755, -24.9883452287823], [43.763768344911156, -24.460677178649988], [43.697777540874441, -23.574116306250595], [43.345654331237611, -22.77690398528387], [43.254187046080986, -22.057413018484116], [43.433297560404633, -21.336475111580185], [43.893682895692919, -21.163307386970121], [43.89637007017209, -20.830459486578167], [44.374325392439644, -20.072366224856385], [44.464397413924374, -19.435454196859045], [44.23242190936616, -18.961994724200899], [44.042976108584149, -18.331387220943167], [43.963084344260899, -17.409944756746778], [44.312468702986273, -16.850495700754951], [44.446517368351387, -16.216219170804504], [44.944936557806521, -16.179373874580396], [45.502731967964976, -15.974373467678538], [45.872993605336255, -15.793454278224681], [46.312243279817203, -15.780018405828795], [46.882182651564271, -15.210182386946309], [47.70512983581235, -14.594302666891762], [48.005214878131241, -14.091232598530372], [47.869047479042152, -13.663868503476582], [48.29382775248137, -13.784067884987483], [48.845060255738773, -13.08917489995866], [48.863508742066976, -12.487867933810417], [49.194651320193302, -12.040556735891967], [49.543518914595737, -12.469832858940553]]] } }, - { "type": "Feature", "properties": { "admin": "Mexico", "name": "Mexico", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-97.140008307670684, 25.869997463478395], [-97.528072475966539, 24.992144069920297], [-97.702945522842214, 24.272343044526728], [-97.776041836319024, 22.932579860927653], [-97.872366706111094, 22.444211737553356], [-97.699043952204164, 21.898689480064256], [-97.388959520236739, 21.411018988525818], [-97.189333462293277, 20.635433254473124], [-96.525575527720306, 19.890930894444061], [-96.292127244841737, 19.32037140550954], [-95.90088497595994, 18.828024196848727], [-94.8390634834427, 18.562717393462204], [-94.425729539756205, 18.144370835843343], [-93.548651292682365, 18.423836981677933], [-92.786113857783477, 18.524838568592255], [-92.037348192090391, 18.704569200103432], [-91.407903408559235, 18.876083278880227], [-90.771869879910852, 19.284120388256778], [-90.533589850613026, 19.867418117751292], [-90.451475999701231, 20.707521877520428], [-90.278618333684889, 20.999855454995547], [-89.601321173851474, 21.261725775634485], [-88.543866339862845, 21.493675441976613], [-87.658416510757704, 21.458845526611977], [-87.051890224948053, 21.543543199138295], [-86.811982388032931, 21.331514797444747], [-86.845907965832595, 20.849864610268348], [-87.383291185235848, 20.255404771398727], [-87.621054450210721, 19.646553046135917], [-87.436750454441764, 19.472403469312265], [-87.586560431655911, 19.040130113190738], [-87.837191128271485, 18.259815985583426], [-88.090664028663156, 18.516647854074048], [-88.300031094093626, 18.499982204659997], [-88.490122850279278, 18.486830552641717], [-88.84834387892657, 17.883198147040329], [-89.029857347351737, 18.001511338772556], [-89.150909389995462, 17.955467637600403], [-89.143080410503316, 17.808318996649401], [-90.067933519230891, 17.819326076727517], [-91.001519945015943, 17.817594916245692], [-91.002269253284155, 17.254657701074272], [-91.453921271515114, 17.252177232324183], [-91.08167009150057, 16.918476670799517], [-90.711821865587623, 16.687483018454767], [-90.600846727240921, 16.470777899638787], [-90.438866950221993, 16.410109768128105], [-90.464472622422633, 16.069562079324722], [-91.747960171255926, 16.066564846251762], [-92.229248623406278, 15.251446641495871], [-92.087215949252013, 15.06458466232851], [-92.203229539747255, 14.830102850804108], [-92.227750006869812, 14.538828640190953], [-93.359463874061746, 15.61542959234367], [-93.875168830118511, 15.94016429286591], [-94.691656460330108, 16.20097524664288], [-95.250227016973014, 16.128318182840641], [-96.053382127653293, 15.752087917539592], [-96.557434048228274, 15.653515122942787], [-97.263592495496624, 15.917064927631312], [-98.013029954809596, 16.107311713113912], [-98.947675747456486, 16.566043402568763], [-99.697397427147024, 16.706164048728166], [-100.829498867581293, 17.171071071842047], [-101.666088629954444, 17.649026394109622], [-101.918528001700196, 17.916090196193974], [-102.478132086988907, 17.975750637275095], [-103.500989549558057, 18.292294623278845], [-103.917527432046811, 18.748571682200005], [-104.992009650475467, 19.316133938061679], [-105.493038499761411, 19.946767279535429], [-105.731396043707633, 20.434101874264108], [-105.397772996831321, 20.531718654863422], [-105.500660773524402, 20.816895046466122], [-105.27075232625792, 21.076284898355137], [-105.265817226974022, 21.422103583252348], [-105.603160976975374, 21.871145941652568], [-105.693413865973113, 22.269080308516148], [-106.028716396898943, 22.77375234627862], [-106.909980434988341, 23.767774359628895], [-107.91544877809136, 24.548915310152946], [-108.401904873470954, 25.172313951105931], [-109.260198737406625, 25.580609442644054], [-109.444089321717314, 25.824883938087673], [-109.291643846456267, 26.44293406829842], [-109.801457689231796, 26.676175645447923], [-110.391731737085692, 27.162114976504533], [-110.641018846461606, 27.859876003525521], [-111.178918830187826, 27.941240546169062], [-111.759606899851619, 28.467952582303944], [-112.228234626090369, 28.954408677683482], [-112.27182369672866, 29.266844387320074], [-112.80959448937395, 30.021113593052341], [-113.163810594518651, 30.786880804969424], [-113.148669399857141, 31.170965887978912], [-113.871881069781836, 31.56760834403519], [-114.205736660603506, 31.524045111613123], [-114.776451178835003, 31.79953217216114], [-114.936699795372121, 31.393484605427595], [-114.771231859173483, 30.91361725516526], [-114.673899298951739, 30.162681179315985], [-114.330974494262918, 29.750432440707407], [-113.588875088335413, 29.061611436473008], [-113.424053107540516, 28.826173610951223], [-113.271969367305502, 28.754782619739892], [-113.140039435664363, 28.411289374295954], [-112.962298346796473, 28.425190334582503], [-112.761587083774856, 27.78021678314752], [-112.457910529411635, 27.525813706974752], [-112.24495195193677, 27.171726792910754], [-111.616489020619184, 26.662817287700474], [-111.284674648872993, 25.732589830014426], [-110.987819383572386, 25.294606228124557], [-110.71000688357131, 24.826004340101854], [-110.655048997828871, 24.298594672131113], [-110.17285620811343, 24.265547593680417], [-109.771847093528521, 23.811182562754194], [-109.409104377055698, 23.364672349536242], [-109.433392300232896, 23.185587673428696], [-109.85421932660168, 22.818271592698061], [-110.031391974714424, 22.823077500901199], [-110.295070970483636, 23.430973212166684], [-110.949501309028022, 24.000964260345988], [-111.670568407012681, 24.484423122652508], [-112.182035895621468, 24.73841278736716], [-112.148988817170817, 25.470125230404044], [-112.300710822379671, 26.012004299416613], [-112.777296719191526, 26.321959540303162], [-113.464670783321907, 26.768185533143416], [-113.596729906043805, 26.639459540304465], [-113.848936733844241, 26.900063788352437], [-114.465746629680027, 27.142090358991361], [-115.055142178184965, 27.722726752222904], [-114.982252570437382, 27.798200181585109], [-114.570365566854917, 27.741485297144884], [-114.199328782999231, 28.115002549750553], [-114.162018398884612, 28.566111965442296], [-114.931842210736605, 29.279479275015483], [-115.518653937626965, 29.556361599235395], [-115.887365282029563, 30.180793768834171], [-116.2583503894529, 30.836464341753572], [-116.721526252084956, 31.635743720012037], [-117.127759999999839, 32.53534], [-115.99135, 32.612390000000111], [-114.72139, 32.72083], [-114.815, 32.52528], [-113.30498, 32.03914], [-111.02361, 31.33472], [-109.035, 31.341940000000129], [-108.24194, 31.34222], [-108.24, 31.754853718166366], [-106.507589999999851, 31.75452], [-106.1429, 31.39995], [-105.63159, 31.08383], [-105.03737, 30.64402], [-104.70575, 30.12173], [-104.456969999999885, 29.57196], [-103.94, 29.27], [-103.11, 28.97], [-102.48, 29.76], [-101.6624, 29.7793], [-100.9576, 29.380710000000125], [-100.45584, 28.696120000000118], [-100.11, 28.11000000000012], [-99.52, 27.54], [-99.3, 26.84], [-99.019999999999897, 26.37], [-98.24, 26.06], [-97.529999999999887, 25.84], [-97.140008307670684, 25.869997463478395]]] } }, - { "type": "Feature", "properties": { "admin": "Macedonia", "name": "Macedonia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.59023, 41.85541], [20.717310000000108, 41.84711], [20.76216, 42.05186], [21.352700000000134, 42.2068], [21.576635989402117, 42.245224397061847], [21.917080000000105, 42.30364], [22.380525750424674, 42.320259507815074], [22.881373732197339, 41.999297186850349], [22.952377150166505, 41.337993882811176], [22.76177, 41.3048], [22.597308383889008, 41.130487168943198], [22.055377638444266, 41.149865831052686], [21.674160597426969, 40.93127452245794], [21.020040317476397, 40.842726955725873], [20.60518, 41.08622], [20.46315, 41.51509], [20.59023, 41.85541]]] } }, - { "type": "Feature", "properties": { "admin": "Mali", "name": "Mali", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-12.170750291380299, 14.616834214735503], [-11.834207526079465, 14.799096991428936], [-11.666078253617853, 15.388208319556295], [-11.349095017939502, 15.411256008358475], [-10.650791388379414, 15.132745876521422], [-10.086846482778212, 15.330485744686269], [-9.700255092802703, 15.264107367407359], [-9.550238409859388, 15.486496893775435], [-5.537744309908446, 15.501689764869253], [-5.315277268891931, 16.201853745991837], [-5.488522508150438, 16.325102037007962], [-5.971128709324247, 20.640833441647626], [-6.453786586930334, 24.956590684503418], [-4.92333736817423, 24.974574082940993], [-1.550054897457613, 22.792665920497377], [1.823227573259032, 20.61080943448604], [2.060990838233919, 20.142233384679482], [2.683588494486428, 19.856230170160114], [3.146661004253899, 19.693578599521441], [3.158133172222704, 19.057364203360034], [4.267419467800038, 19.155265204336995], [4.270209995143801, 16.852227484601212], [3.723421665063482, 16.184283759012612], [3.638258904646476, 15.568119818580453], [2.749992709981483, 15.409524847876693], [1.385528191746857, 15.323561102759168], [1.01578331869851, 14.968182277887944], [0.374892205414682, 14.928908189346128], [-0.26625729003058, 14.924308986872147], [-0.515854458000348, 15.116157741755725], [-1.066363491205663, 14.973815009007764], [-2.001035122068771, 14.559008287000887], [-2.191824510090384, 14.246417548067352], [-2.967694464520576, 13.798150336151506], [-3.103706834312759, 13.54126679122859], [-3.52280270019986, 13.337661647998612], [-4.006390753587225, 13.472485459848112], [-4.280405035814879, 13.228443508349738], [-4.427166103523802, 12.542645575404292], [-5.220941941743119, 11.713858954307224], [-5.197842576508648, 11.375145778850136], [-5.470564947929004, 10.951269842976044], [-5.404341599946973, 10.370736802609144], [-5.816926235365286, 10.222554633012191], [-6.050452032892266, 10.096360785355442], [-6.205222947606429, 10.524060777219132], [-6.493965013037267, 10.411302801958268], [-6.666460944027547, 10.430810655148447], [-6.850506557635057, 10.138993841996237], [-7.622759161804808, 10.147236232946792], [-7.89958980959237, 10.297382106970824], [-8.029943610048617, 10.206534939001711], [-8.335377163109738, 10.494811916541932], [-8.282357143578279, 10.792597357623842], [-8.407310756860026, 10.90925690352276], [-8.620321010767126, 10.810890814655181], [-8.581305304386772, 11.136245632364801], [-8.376304897484911, 11.393645941610627], [-8.786099005559462, 11.812560939984705], [-8.905264858424529, 12.088358059126433], [-9.127473517279581, 12.308060411015331], [-9.327616339546008, 12.334286200403451], [-9.567911749703212, 12.194243068892472], [-9.890992804392011, 12.060478623904968], [-10.165213792348835, 11.844083563682743], [-10.593223842806278, 11.923975328005977], [-10.870829637078211, 12.177887478072106], [-11.036555955438256, 12.211244615116513], [-11.297573614944508, 12.077971096235768], [-11.456168585648269, 12.076834214725336], [-11.513942836950587, 12.442987575729415], [-11.467899135778522, 12.754518947800973], [-11.553397793005427, 13.141213690641063], [-11.927716030311613, 13.422075100147392], [-12.124887457721256, 13.994727484589784], [-12.170750291380299, 14.616834214735503]]] } }, - { "type": "Feature", "properties": { "admin": "Myanmar", "name": "Myanmar", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[99.543309360759281, 20.186597601802056], [98.959675734454848, 19.752980658440944], [98.253723992915582, 19.708203029860041], [97.797782830804394, 18.627080389881751], [97.375896437573516, 18.445437730375811], [97.859122755934848, 17.567946071843657], [98.493761020911322, 16.837835598207928], [98.90334842325673, 16.177824204976115], [98.537375929765687, 15.308497422746081], [98.192074009191373, 15.123702500870349], [98.430819126379859, 14.622027696180831], [99.097755161538728, 13.827502549693275], [99.212011753336071, 13.269293728076462], [99.196353794351637, 12.804748439988666], [99.587286004639694, 11.892762762901695], [99.038120558673953, 10.960545762572435], [98.553550653073017, 9.932959906448543], [98.457174106848697, 10.675266018105146], [98.764545526120756, 11.441291612183745], [98.428338657629823, 12.032986761925681], [98.509574009192661, 13.122377631070675], [98.103603957107666, 13.64045970301285], [97.777732375075161, 14.837285874892638], [97.597071567782749, 16.100567938699765], [97.164539829499773, 16.928734442609336], [96.505768670642965, 16.427240505432845], [95.369352248112378, 15.714389960182599], [94.808404575584092, 15.803454291237637], [94.188804152404515, 16.037936102762014], [94.533485955791321, 17.277240301985724], [94.324816522196741, 18.213513902249893], [93.540988397193615, 19.366492621330021], [93.663254835996199, 19.726961574781992], [93.078277622452163, 19.855144965081973], [92.368553501355606, 20.670883287025344], [92.30323449093865, 21.475485337809815], [92.652257114637976, 21.324047552978481], [92.672720981825549, 22.041238918541247], [93.166127557348361, 22.278459580977099], [93.060294224014598, 22.703110663335565], [93.286326938859247, 23.043658352138998], [93.325187615942767, 24.078556423432197], [94.106741977925054, 23.850740871673477], [94.552657912171611, 24.675238348890328], [94.603249139385355, 25.162495428970399], [95.155153436262566, 26.001307277932078], [95.124767694074933, 26.573572089132295], [96.419365675850941, 27.264589341739221], [97.133999058015277, 27.08377350514996], [97.051988559968066, 27.699058946233144], [97.402561476636123, 27.88253611908544], [97.327113885490007, 28.261582749946331], [97.91198774616943, 28.335945136014338], [98.24623091023328, 27.747221381129172], [98.682690057370451, 27.508812160750612], [98.712093947344499, 26.74353587494026], [98.671838006589127, 25.918702500913518], [97.724609002679117, 25.083637193292994], [97.604719679761956, 23.897404690033039], [98.660262485755737, 24.063286037689959], [98.898749220782747, 23.142722072842524], [99.531992222087382, 22.949038804612574], [99.240898878987224, 22.118314317304577], [99.983489211021464, 21.742936713136398], [100.416537713627349, 21.558839423096607], [101.150032993578222, 21.849984442629015], [101.180005324307515, 21.436572984294024], [100.329101190189519, 20.786121731036229], [100.115987583417819, 20.41784963630818], [99.543309360759281, 20.186597601802056]]] } }, - { "type": "Feature", "properties": { "admin": "Montenegro", "name": "Montenegro", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[19.801613396898681, 42.500093492190835], [19.738051385179627, 42.688247382165564], [19.30449, 42.19574], [19.371770000000136, 41.87755], [19.16246, 41.95502], [18.88214, 42.28151], [18.45, 42.48], [18.56, 42.65], [18.70648, 43.20011], [19.03165, 43.43253], [19.21852, 43.52384], [19.48389, 43.35229], [19.63, 43.213779970270522], [19.95857, 43.10604], [20.3398, 42.89852], [20.25758, 42.81275], [20.0707, 42.58863], [19.801613396898681, 42.500093492190835]]] } }, - { "type": "Feature", "properties": { "admin": "Mongolia", "name": "Mongolia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[87.751264276076697, 49.297197984405479], [88.805566847695488, 49.470520738312409], [90.713667433640666, 50.331811835321076], [92.234711541719662, 50.802170722041716], [93.104219191462661, 50.495290228876414], [94.147566359435615, 50.480536607457083], [94.815949334698701, 50.013433335970838], [95.814027947983973, 49.977466539095708], [97.259727817781396, 49.726060695995727], [98.231761509191543, 50.422400621128737], [97.825739780674283, 51.010995184933165], [98.861490513100307, 52.047366034546684], [99.981732212323507, 51.634006252643978], [100.889480421962588, 51.516855780638316], [102.065222609467298, 51.25992055928311], [102.255908644624299, 50.510560614618669], [103.676545444760194, 50.089966132195109], [104.621552362081687, 50.275329494826067], [105.886591424586726, 50.406019192092209], [106.888804152455336, 50.274295966180219], [107.868175897250936, 49.793705145865808], [108.475167270951275, 49.282547715850725], [109.402449171996636, 49.292960516957535], [110.662010532678764, 49.130128078805861], [111.581230910286607, 49.377968248077678], [112.897739699354361, 49.543565375356984], [114.362456496235239, 50.248302720737399], [114.962109816550154, 50.140247300815112], [115.485695428531386, 49.805177313834591], [116.678800897286152, 49.888531399121376], [116.191802199367544, 49.134598090199091], [115.485282017073018, 48.135382595403428], [115.742837355615748, 47.726544501326273], [116.308952671373206, 47.853410142602826], [117.295507440257396, 47.69770905210742], [118.064142694166691, 48.066730455103674], [118.866574334794933, 47.747060044946153], [119.772823927897477, 47.048058783550125], [119.66326989143873, 46.692679958678909], [118.874325799638711, 46.805412095723646], [117.421701287914175, 46.672732855814253], [116.717868280098841, 46.388202419615205], [115.985096470200062, 45.727235012385989], [114.46033165899604, 45.339816799493811], [113.463906691544139, 44.808893134127111], [112.436062453258785, 45.011645616224278], [111.873306105600278, 45.102079372735055], [111.348376906379428, 44.457441718110083], [111.667737257943202, 44.073175767587706], [111.829587843881342, 43.743118394539515], [111.129682244920218, 43.406834011400136], [110.412103306115256, 42.871233628911014], [109.243595819131428, 42.519446316084093], [107.744772576937933, 42.481515814781865], [106.129315627061658, 42.134327704428898], [104.964993931093446, 41.597409572916334], [104.522281935648977, 41.908346666016541], [103.312278273534787, 41.907468166667591], [101.833040399179922, 42.51487295182627], [100.845865513108237, 42.663804429691439], [99.515817498780009, 42.524691473961717], [97.451757440177985, 42.748889675460013], [96.349395786527793, 42.725635280928678], [95.762454868556674, 43.319449164394598], [95.306875441471504, 44.241330878265458], [94.688928664125299, 44.352331854828414], [93.480733677141274, 44.975472113619951], [92.133890822318193, 45.115075995456444], [90.945539585334288, 45.286073309910265], [90.585768263718265, 45.719716091487513], [90.970809360724985, 46.888146063822923], [90.280825636763893, 47.693549099307923], [88.854297723346733, 48.06908173277295], [88.013832228551721, 48.599462795600601], [87.751264276076697, 49.297197984405479]]] } }, - { "type": "Feature", "properties": { "admin": "Mozambique", "name": "Mozambique", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.559989047999345, -11.520020033415923], [35.312397902169032, -11.439146416879145], [36.514081658684248, -11.720938002166733], [36.775150994622791, -11.594537448780804], [37.471284214026596, -11.568750909067157], [37.827644891111383, -11.268769219612834], [38.427556593587745, -11.285202325081654], [39.521029900883768, -10.896853936408224], [40.316588576017182, -10.317096042525696], [40.478387485523022, -10.765440769089992], [40.437253045418672, -11.761710707245014], [40.560811395028558, -12.639176527561023], [40.599620395679743, -14.201975192931858], [40.775475294768988, -14.691764418194239], [40.477250604012596, -15.406294447493968], [40.089263950365208, -16.100774021064456], [39.452558628097044, -16.720891208566936], [38.53835086442151, -17.101023044505954], [37.411132846838875, -17.586368096591233], [36.281279331209348, -18.659687595293445], [35.896496616364054, -18.842260430580634], [35.198399692533137, -19.552811374593887], [34.786383497870041, -19.784011732667732], [34.701892531072836, -20.497043145431007], [35.176127150215358, -21.254361260668407], [35.373427768705731, -21.840837090748874], [35.385848253705397, -22.14], [35.562545536369079, -22.09], [35.533934767404297, -23.070787855727751], [35.371774122872374, -23.535358982031692], [35.607470330555621, -23.706563002214676], [35.458745558419615, -24.122609958596545], [35.040734897610655, -24.478350518493798], [34.215824008935463, -24.816314385682652], [33.013210076639005, -25.357573337507731], [32.574632195777859, -25.727318210556088], [32.660363396950082, -26.148584486599443], [32.915955031065685, -26.215867201443459], [32.830120477028878, -26.74219166433619], [32.071665480281062, -26.733820082304902], [31.985779249811962, -26.29177988048022], [31.837777947728057, -25.843331801051342], [31.752408481581874, -25.484283949487406], [31.930588820124242, -24.369416599222532], [31.670397983534645, -23.658969008073861], [31.191409132621278, -22.251509698172395], [32.244988234188007, -21.116488539313689], [32.508693068173436, -20.395292250248303], [32.659743279762573, -20.30429005298231], [32.772707960752619, -19.715592136313294], [32.611994256324884, -19.419382826416268], [32.654885695127142, -18.672089939043492], [32.849860874164385, -17.979057305577175], [32.847638787575839, -16.713398125884613], [32.328238966610222, -16.392074069893749], [31.852040643040592, -16.319417006091374], [31.636498243951188, -16.071990248277881], [31.173063999157673, -15.860943698797868], [30.338954705534537, -15.880839125230242], [30.274255812305103, -15.507786960515208], [30.179481235481827, -14.796099134991525], [33.214024692525207, -13.97186003993615], [33.789700148256678, -14.451830743063068], [34.064825473778619, -14.359950046448118], [34.459633416488536, -14.613009535381421], [34.517666049952304, -15.013708591372609], [34.307291294092089, -15.478641452702592], [34.381291945134045, -16.183559665596039], [35.033810255683527, -16.801299737213089], [35.339062941231639, -16.107440280830108], [35.771904738108347, -15.896858819240721], [35.686845330555926, -14.611045830954328], [35.267956170398001, -13.887834161029563], [34.907151320136158, -13.565424899960565], [34.559989047999345, -13.579997653866872], [34.280006137841973, -12.280025323132504], [34.559989047999345, -11.520020033415923]]] } }, - { "type": "Feature", "properties": { "admin": "Mauritania", "name": "Mauritania", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-12.170750291380299, 14.616834214735503], [-12.830658331747513, 15.303691514542942], [-13.43573767745306, 16.039383042866188], [-14.099521450242175, 16.304302273010489], [-14.577347581428977, 16.598263658102805], [-15.135737270558813, 16.587282416240779], [-15.623666144258689, 16.369337063049809], [-16.120690070041928, 16.45566254319338], [-16.463098110407881, 16.135036119038457], [-16.549707810929061, 16.673892116761959], [-16.270551723688353, 17.166962795474866], [-16.146347418674846, 18.108481553616652], [-16.256883307347163, 19.096715806550304], [-16.377651129613266, 19.593817246981981], [-16.277838100641514, 20.092520656814695], [-16.536323614965465, 20.567866319251486], [-17.063423224342568, 20.99975210213082], [-16.845193650773989, 21.333323472574875], [-12.929101935263528, 21.327070624267559], [-13.118754441774708, 22.771220201096249], [-12.874221564169574, 23.284832261645171], [-11.93722449385332, 23.374594224536164], [-11.969418911171159, 25.933352769468261], [-8.687293667017398, 25.881056219988899], [-8.684399786809051, 27.395744126895998], [-4.92333736817423, 24.974574082940993], [-6.453786586930334, 24.956590684503418], [-5.971128709324247, 20.640833441647626], [-5.488522508150438, 16.325102037007962], [-5.315277268891931, 16.201853745991837], [-5.537744309908446, 15.501689764869253], [-9.550238409859388, 15.486496893775435], [-9.700255092802703, 15.264107367407359], [-10.086846482778212, 15.330485744686269], [-10.650791388379414, 15.132745876521422], [-11.349095017939502, 15.411256008358475], [-11.666078253617853, 15.388208319556295], [-11.834207526079465, 14.799096991428936], [-12.170750291380299, 14.616834214735503]]] } }, - { "type": "Feature", "properties": { "admin": "Malawi", "name": "Malawi", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.559989047999345, -11.520020033415923], [34.280006137841973, -12.280025323132504], [34.559989047999345, -13.579997653866872], [34.907151320136158, -13.565424899960565], [35.267956170398001, -13.887834161029563], [35.686845330555926, -14.611045830954328], [35.771904738108347, -15.896858819240721], [35.339062941231639, -16.107440280830108], [35.033810255683527, -16.801299737213089], [34.381291945134045, -16.183559665596039], [34.307291294092089, -15.478641452702592], [34.517666049952304, -15.013708591372609], [34.459633416488536, -14.613009535381421], [34.064825473778619, -14.359950046448118], [33.789700148256678, -14.451830743063068], [33.214024692525207, -13.97186003993615], [32.688165317523122, -13.712857761289273], [32.991764357237876, -12.783870537978272], [33.306422153463068, -12.435778090060214], [33.114289178201908, -11.607198174692311], [33.315310499817279, -10.796549981329695], [33.485687697083584, -10.525558770391111], [33.231387973775291, -9.676721693564799], [32.759375441221316, -9.230599053589058], [33.739729038230443, -9.417150974162722], [33.940837724096532, -9.693673841980292], [34.280006137841973, -10.159999688358402], [34.559989047999345, -11.520020033415923]]] } }, - { "type": "Feature", "properties": { "admin": "Malaysia", "name": "Malaysia", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[101.075515578213299, 6.204867051615891], [101.154218784593809, 5.691384182147713], [101.814281854258013, 5.810808417174228], [102.141186964936423, 6.221636053894655], [102.371147088635212, 6.12820506431096], [102.961705356866673, 5.524495144061077], [103.381214634212142, 4.855001125503746], [103.438575474056165, 4.181605536308381], [103.332122023534851, 3.72669790284297], [103.42942874554052, 3.382868760589019], [103.502447544368877, 2.791018581550204], [103.854674106870334, 2.515454006353763], [104.247931756611479, 1.631141058759055], [104.228811476663523, 1.293048000489534], [103.519707472754433, 1.226333726400682], [102.573615350354771, 1.967115383304744], [101.39063846232915, 2.760813706875623], [101.273539666755838, 3.27029165284118], [100.69543541870668, 3.939139715994869], [100.557407668055092, 4.767280381688279], [100.19670617065772, 5.312492580583678], [100.306260207116509, 6.040561835143875], [100.085756870527078, 6.46448944745029], [100.259596388756918, 6.64282481528957], [101.075515578213299, 6.204867051615891]]], [[[118.618320754064825, 4.47820241944754], [117.882034946770162, 4.137551377779487], [117.01521447150634, 4.306094061699468], [115.86551720587677, 4.306559149590156], [115.51907840379198, 3.169238389494395], [115.134037306785231, 2.821481838386219], [114.621355422017473, 1.430688177898886], [113.805849644019531, 1.217548732911041], [112.859809198052176, 1.497790025229946], [112.380251906383648, 1.410120957846757], [111.797548455860408, 0.904441229654651], [111.159137811326559, 0.976478176269509], [110.514060907027101, 0.773131415200993], [109.830226678508836, 1.338135687664191], [109.663260125773718, 2.006466986494984], [110.396135288537039, 1.663774725751395], [111.168852980597478, 1.850636704918784], [111.370081007942076, 2.697303371588872], [111.796928338672842, 2.885896511238073], [112.995614862115247, 3.102394924324869], [113.712935418758718, 3.893509426281127], [114.204016554828399, 4.525873928236819], [114.659595981913526, 4.00763682699781], [114.869557326315373, 4.348313706881952], [115.347460972150671, 4.316636053887009], [115.405700311343594, 4.955227565933824], [115.450710483869798, 5.447729803891561], [116.220741001450961, 6.143191229675621], [116.725102980619752, 6.924771429873998], [117.129626092600461, 6.928052883324566], [117.643393182446303, 6.422166449403305], [117.689075148592337, 5.98749013918018], [118.347691278152197, 5.708695786965462], [119.181903924639926, 5.407835598162249], [119.110693800941718, 5.016128241389864], [118.439727004064082, 4.966518866389619], [118.618320754064825, 4.47820241944754]]]] } }, - { "type": "Feature", "properties": { "admin": "Namibia", "name": "Namibia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[16.344976840895239, -28.576705010697697], [15.601818068105812, -27.821247247022797], [15.210472446359457, -27.09095590587404], [14.989710727608548, -26.117371921495153], [14.74321414557633, -25.392920017195376], [14.40814415859583, -23.85301401132984], [14.385716586981145, -22.656652927340687], [14.257714064194172, -22.111208184499951], [13.868642205468657, -21.699036960539974], [13.352497999737437, -20.872834161057497], [12.82684533046449, -19.673165785401661], [12.608564080463617, -19.045348809487695], [11.794918654028063, -18.069129327061912], [11.734198846085118, -17.30188933682447], [12.215461460019352, -17.11166838955808], [12.814081251688405, -16.941342868724067], [13.462362094789963, -16.971211846588769], [14.058501417709007, -17.42338062914266], [14.209706658595021, -17.353100681225715], [18.26330936043416, -17.309950860262003], [18.956186964603599, -17.789094740472255], [21.377176141045563, -17.930636488519688], [23.215048455506057, -17.52311614346598], [24.033861525170771, -17.29584319424632], [24.6823490740015, -17.35341073981947], [25.076950310982255, -17.578823337476617], [25.084443393664564, -17.661815687737366], [24.520705193792534, -17.887124932529932], [24.217364536239209, -17.889347019118485], [23.579005568137713, -18.281261081620055], [23.196858351339298, -17.869038181227783], [21.655040317478971, -18.219146010005222], [20.910641310314531, -18.252218926672018], [20.881134067475866, -21.814327080983144], [19.895457797940672, -21.849156996347865], [19.895767856534427, -24.767790215760588], [19.89473432788861, -28.461104831660769], [19.002127312911082, -28.972443129188857], [18.464899122804745, -29.045461928017271], [17.836151971109526, -28.856377862261311], [17.387497185951499, -28.783514092729774], [17.218928663815401, -28.355943291946804], [16.824017368240899, -28.082161553664466], [16.344976840895239, -28.576705010697697]]] } }, - { "type": "Feature", "properties": { "admin": "New Caledonia", "name": "New Caledonia", "continent": "Oceania" }, "geometry": { "type": "Polygon", "coordinates": [[[165.779989862326346, -21.080004978115621], [166.599991489933814, -21.700018812753523], [167.120011428086883, -22.159990736583488], [166.74003462144475, -22.399976088146943], [166.189732293968632, -22.129708347260447], [165.474375441752159, -21.679606621998229], [164.829815301775653, -21.149819838141948], [164.16799523341362, -20.444746595951624], [164.029605747735957, -20.105645847252347], [164.459967075862664, -20.120011895429492], [165.020036249041993, -20.459991143477726], [165.460009393575064, -20.800022067958253], [165.779989862326346, -21.080004978115621]]] } }, - { "type": "Feature", "properties": { "admin": "Niger", "name": "Niger", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[2.154473504249949, 11.940150051313422], [2.177107781593917, 12.625017808477534], [1.024103224297619, 12.851825669806598], [0.993045688490156, 13.335749620003865], [0.429927605805517, 13.988733018443893], [0.295646396495215, 14.444234930880663], [0.374892205414767, 14.928908189346144], [1.015783318698481, 14.968182277887989], [1.385528191746971, 15.323561102759237], [2.74999270998154, 15.409524847876751], [3.63825890464659, 15.56811981858044], [3.723421665063596, 16.184283759012654], [4.270209995143886, 16.852227484601311], [4.267419467800095, 19.155265204337123], [5.677565952180712, 19.601206976799794], [8.572893100629868, 21.565660712159225], [11.999505649471697, 23.471668402596432], [13.581424594790459, 23.040506089769274], [14.143870883855239, 22.491288967371126], [14.8513, 22.862950000000119], [15.096887648181847, 21.308518785074902], [15.471076694407314, 21.048457139565979], [15.487148064850143, 20.730414537025634], [15.90324669766431, 20.387618923417499], [15.68574059414777, 19.957180080642384], [15.300441114979716, 17.927949937405], [15.247731154041842, 16.627305813050778], [13.972201775781681, 15.684365953021139], [13.540393507550785, 14.36713369390122], [13.956698846094124, 13.996691189016925], [13.954476759505607, 13.353448798063765], [14.595781284247604, 13.330426947477859], [14.495787387762899, 12.859396267137353], [14.213530714584746, 12.80203542729333], [14.181336297266906, 12.483656927943169], [13.995352817448289, 12.4615652531383], [13.318701613018558, 13.55635630945795], [13.083987257548809, 13.596147162322492], [12.302071160540546, 13.037189032437535], [11.527803175511504, 13.328980007373556], [10.989593133191532, 13.387322699431191], [10.701031935273816, 13.246917832894038], [10.114814487354748, 13.277251898649464], [9.524928012743088, 12.85110219975456], [9.014933302454436, 12.826659247280414], [7.804671258178869, 13.343526923063731], [7.330746697630046, 13.098038031461213], [6.82044192874781, 13.115091254117598], [6.445426059605721, 13.492768459522718], [5.443058302440135, 13.865923977102225], [4.368343540066006, 13.747481594289408], [4.107945997747378, 13.531215725147941], [3.967282749048933, 12.956108710171574], [3.680633579125924, 12.552903347214167], [3.611180454125587, 11.660167141155965], [2.848643019226585, 12.235635891158207], [2.490163608418015, 12.233052069543588], [2.154473504249949, 11.940150051313422]]] } }, - { "type": "Feature", "properties": { "admin": "Nigeria", "name": "Nigeria", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[8.500287713259693, 4.771982937026847], [7.462108188515939, 4.41210826254624], [7.082596469764438, 4.464689032403228], [6.698072137080598, 4.240594183769516], [5.898172641634686, 4.262453314628984], [5.362804803090881, 4.887970689305957], [5.033574252959368, 5.611802476418233], [4.325607130560683, 6.270651149923466], [3.574180128604552, 6.258300482605717], [2.691701694356254, 6.258817246928628], [2.74906253420022, 7.870734361192886], [2.723792758809509, 8.506845404489708], [2.912308383810255, 9.13760793704432], [3.220351596702101, 9.4441525333997], [3.705438266625918, 10.063210354040207], [3.600070021182801, 10.332186184119406], [3.797112257511713, 10.734745591673104], [3.572216424177469, 11.327939357951516], [3.611180454125558, 11.660167141155966], [3.68063357912581, 12.552903347214222], [3.967282749048848, 12.956108710171572], [4.107945997747321, 13.531215725147829], [4.368343540066063, 13.747481594289324], [5.443058302440163, 13.865923977102295], [6.445426059605636, 13.492768459522676], [6.820441928747753, 13.115091254117514], [7.330746697630017, 13.098038031461199], [7.804671258178784, 13.343526923063745], [9.014933302454462, 12.826659247280427], [9.524928012742945, 12.851102199754477], [10.114814487354689, 13.277251898649409], [10.701031935273702, 13.246917832894081], [10.989593133191532, 13.387322699431108], [11.527803175511393, 13.328980007373584], [12.302071160540521, 13.037189032437521], [13.083987257548866, 13.596147162322563], [13.318701613018558, 13.556356309457824], [13.995352817448346, 12.461565253138343], [14.181336297266792, 12.483656927943112], [14.57717776862253, 12.085360826053501], [14.468192172918974, 11.90475169519341], [14.415378859116682, 11.572368882692071], [13.572949659894558, 10.798565985553564], [13.308676385153914, 10.160362046748926], [13.1675997249971, 9.64062632897341], [12.955467970438971, 9.417771714714702], [12.753671502339214, 8.717762762888993], [12.218872104550597, 8.305824082874322], [12.063946160539556, 7.799808457872301], [11.839308709366801, 7.397042344589434], [11.745774366918509, 6.981382961449753], [11.058787876030349, 6.644426784690593], [10.497375115611417, 7.055357774275562], [10.118276808318255, 7.038769639509879], [9.522705926154398, 6.453482367372116], [9.233162876023043, 6.444490668153334], [8.757532993208626, 5.47966583904791], [8.500287713259693, 4.771982937026847]]] } }, - { "type": "Feature", "properties": { "admin": "Nicaragua", "name": "Nicaragua", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-85.712540452807289, 11.088444932494822], [-86.058488328785245, 11.40343862552994], [-86.525849982432931, 11.806876532432593], [-86.7459915839963, 12.143961900272483], [-87.167516242201131, 12.458257961471656], [-87.668493415054698, 12.909909979702629], [-87.557466600275603, 13.064551703336061], [-87.392386237319201, 12.914018256069836], [-87.316654425795463, 12.984685777228972], [-87.005769009127562, 13.025794379117157], [-86.880557013684339, 13.254204209847241], [-86.733821784191576, 13.263092556201441], [-86.755086636079696, 13.754845485890909], [-86.520708177419877, 13.778487453664436], [-86.312142096689911, 13.771356106008167], [-86.096263800790581, 14.038187364147245], [-85.801294725268576, 13.836054999237586], [-85.698665330736901, 13.960078436738083], [-85.514413011400222, 14.079011745657834], [-85.165364549484792, 14.354369615125076], [-85.148750576502948, 14.560196844943615], [-85.052787441736925, 14.551541042534719], [-84.924500698572388, 14.790492865452348], [-84.820036790694346, 14.819586696832669], [-84.649582078779602, 14.66680532476175], [-84.449335903648588, 14.621614284722494], [-84.228341640952394, 14.748764146376654], [-83.975721401693576, 14.749435939996458], [-83.628584967772895, 14.880073960830298], [-83.489988776366104, 15.016267198135534], [-83.147219000974104, 14.995829169164109], [-83.233234422523907, 14.8998660343981], [-83.28416154654758, 14.676623846897197], [-83.182126430987267, 14.310703029838447], [-83.412499966144424, 13.970077826386554], [-83.519831916014667, 13.56769928634588], [-83.55220720084553, 13.127054348193084], [-83.498515387694255, 12.869292303921226], [-83.473323126951968, 12.419087225794424], [-83.626104499022887, 12.320850328007563], [-83.719613003255034, 11.893124497927724], [-83.650857510090702, 11.629032090700116], [-83.855470343750369, 11.373311265503785], [-83.808935716471538, 11.103043524617274], [-83.655611741861563, 10.938764146361418], [-83.895054490885926, 10.726839097532444], [-84.190178595704822, 10.793450018756671], [-84.355930752281026, 10.999225572142901], [-84.673069017256239, 11.082657172078139], [-84.903003302738924, 10.952303371621895], [-85.561851976244171, 11.217119248901593], [-85.712540452807289, 11.088444932494822]]] } }, - { "type": "Feature", "properties": { "admin": "Netherlands", "name": "Netherlands", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[6.074182570020922, 53.51040334737813], [6.905139601274128, 53.482162177130633], [7.092053256873895, 53.14404328064488], [6.842869500362381, 52.228440253297542], [6.589396599970825, 51.85202912048338], [5.988658074577812, 51.85161570902504], [6.156658155958779, 50.803721015010574], [5.60697594567, 51.037298488969768], [4.973991326526913, 51.475023708698124], [4.047071160507527, 51.267258612668556], [3.314971144228536, 51.345755113319903], [3.830288527043137, 51.620544542031936], [4.705997348661184, 53.091798407597757], [6.074182570020922, 53.51040334737813]]] } }, - { "type": "Feature", "properties": { "admin": "Norway", "name": "Norway", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[28.165547316202911, 71.185474351680497], [31.293418409965472, 70.453787746859902], [30.005435011522785, 70.186258856884876], [31.101078728975118, 69.558080145944857], [29.399580519332879, 69.156916002063056], [28.591929559043187, 69.064776923286686], [29.015572950971968, 69.76649119737796], [27.732292107867885, 70.164193020296281], [26.179622023226298, 69.825298977326142], [25.689212680776389, 69.092113755968995], [24.735679152126714, 68.649556789821432], [23.662049594830759, 68.891247463650515], [22.356237827247405, 68.841741441514941], [21.244936150810723, 69.370443020293109], [20.645592889089581, 69.106247260200846], [20.02526899585791, 69.065138658312705], [19.878559604581248, 68.407194322372604], [17.993868442464386, 68.567391262477329], [17.729181756265344, 68.01055186631622], [16.768878614985535, 68.013936672631374], [16.108712192456832, 67.302455552836889], [15.108411492583055, 66.193866889095418], [13.555689731509087, 64.787027696381458], [13.919905226302202, 64.445420640716108], [13.571916131248766, 64.049114081469654], [12.57993533697393, 64.066218980558332], [11.930569288794228, 63.128317572676977], [11.992064243221531, 61.800362453856557], [12.63114668137524, 61.293571682370079], [12.300365838274896, 60.117932847730046], [11.468271925511173, 59.432393296945989], [11.027368605196925, 58.856149400459394], [10.356556837616095, 59.469807033925363], [8.382000359743641, 58.313288479233265], [7.048748406613297, 58.078884182357271], [5.665835402050418, 58.588155422593658], [5.308234490590733, 59.663231919993805], [4.992078077829005, 61.97099803328426], [5.912900424837885, 62.614472968182682], [8.553411085655766, 63.454008287196459], [10.527709181366784, 64.486038316497471], [12.358346795306371, 65.879725857193151], [14.7611458675816, 67.810641587995121], [16.435927361728968, 68.563205471461671], [19.184028354578512, 69.817444159617807], [21.378416375420606, 70.255169379346043], [23.02374230316158, 70.202071845166259], [24.546543409938515, 71.030496731237221], [26.370049676221807, 70.986261705195361], [28.165547316202911, 71.185474351680497]]], [[[24.72412, 77.85385], [22.49032, 77.44493], [20.72601, 77.67704], [21.41611, 77.93504], [20.8119, 78.25463], [22.88426, 78.45494], [23.28134, 78.07954], [24.72412, 77.85385]]], [[[18.25183, 79.70175], [21.54383, 78.95611], [19.02737, 78.5626], [18.47172, 77.82669], [17.59441, 77.63796], [17.1182, 76.80941], [15.91315, 76.77045], [13.76259, 77.38035], [14.66956, 77.73565], [13.1706, 78.02493], [11.22231, 78.8693], [10.44453, 79.65239], [13.17077, 80.01046], [13.71852, 79.66039], [15.14282, 79.67431], [15.52255, 80.01608], [16.99085, 80.05086], [18.25183, 79.70175]]], [[[25.447625359811887, 80.407340399894494], [27.407505730913492, 80.056405748200447], [25.924650506298171, 79.517833970854539], [23.024465773213613, 79.40001170522909], [20.075188429451877, 79.566823228667232], [19.897266473070907, 79.842361965647498], [18.46226362475792, 79.859880276194403], [17.368015170977454, 80.318896186027004], [20.455992059010693, 80.598155626132225], [21.907944777115397, 80.357679348462071], [22.919252557067431, 80.657144273593488], [25.447625359811887, 80.407340399894494]]]] } }, - { "type": "Feature", "properties": { "admin": "Nepal", "name": "Nepal", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[88.120440708369841, 27.876541652939586], [88.043132765661198, 27.445818589786818], [88.174804315140904, 26.810405178325944], [88.060237664749806, 26.414615383402484], [87.22747195836628, 26.39789805755607], [86.024392938179147, 26.630984605408567], [85.25177859898335, 26.726198431906337], [84.675017938173767, 27.234901231387528], [83.304248895199535, 27.364505723575554], [81.999987420584958, 27.925479234319987], [81.057202589851997, 28.416095282499036], [80.088424513676259, 28.794470119740136], [80.476721225917373, 29.729865220655334], [81.11125613802929, 30.183480943313398], [81.525804477874729, 30.422716986608627], [82.327512648450863, 30.115268052688126], [83.337115106137176, 29.463731594352193], [83.898992954446712, 29.320226141877654], [84.234579705750136, 28.839893703724691], [85.011638218123025, 28.642773952747337], [85.823319940131498, 28.203575954698699], [86.954517043000592, 27.97426178640351], [88.120440708369841, 27.876541652939586]]] } }, - { "type": "Feature", "properties": { "admin": "New Zealand", "name": "New Zealand", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[173.020374790740703, -40.919052422856417], [173.247234328502003, -41.331998793300777], [173.958405389702875, -40.926700534835604], [174.2475867048081, -41.349155368821663], [174.248516880589449, -41.770008233406749], [173.876446568087886, -42.233184096038819], [173.222739699595621, -42.970038344088557], [172.711246372770717, -43.372287693048492], [173.080112746470206, -43.853343601253577], [172.308583612352464, -43.865694268571332], [171.452925246463622, -44.24251881284372], [171.185137974327233, -44.897104180684885], [170.616697219116588, -45.908928724959701], [169.83142215400926, -46.355774834987585], [169.332331170934253, -46.641235446967848], [168.411353794628525, -46.619944756863582], [167.763744745146823, -46.290197442409195], [166.676886021184202, -46.219917494492236], [166.509144321964669, -45.852704766626204], [167.046424188503238, -45.110941257508664], [168.303763462596862, -44.12397307716612], [168.949408807651508, -43.93581918719142], [169.667814569373149, -43.555325616226334], [170.524919875366152, -43.031688327812823], [171.125089960004004, -42.512753594737781], [171.569713983443194, -41.767424411792128], [171.948708937871885, -41.514416599291145], [172.097227004278722, -40.956104424809674], [172.798579543343948, -40.493962090823466], [173.020374790740703, -40.919052422856417]]], [[[174.612008905330526, -36.156397393540537], [175.336615838927173, -37.209097995758263], [175.3575964704375, -36.52619394302112], [175.808886753642469, -36.798942152657681], [175.958490025127475, -37.555381768546063], [176.763195428776555, -37.881253350578696], [177.438813104560495, -37.961248467766488], [178.010354445708657, -37.579824721020124], [178.517093540762801, -37.695373223624792], [178.274731073313802, -38.582812595373092], [177.970460239979332, -39.166342868812968], [177.206992629299123, -39.145775648760839], [176.939980503647007, -39.449736423501562], [177.032946405340113, -39.879942722331471], [176.8858236026052, -40.06597787858216], [176.508017206119348, -40.60480803808958], [176.012440220440283, -41.289624118821493], [175.239567499082966, -41.688307793953236], [175.067898391009408, -41.425894870775075], [174.650972935278418, -41.281820977545443], [175.227630243223615, -40.459235528323397], [174.900156691789959, -39.908933200847216], [173.824046665743992, -39.508854262043506], [173.852261997775315, -39.146602471677461], [174.57480187408035, -38.797683200842748], [174.743473749081033, -38.027807712558378], [174.69701663645057, -37.381128838857954], [174.292028436579187, -36.71109221776144], [174.319003534235549, -36.534823907213884], [173.840996535535766, -36.121980889634109], [173.05417117745958, -35.237125339500331], [172.636005487353714, -34.529106540669382], [173.007042271209457, -34.450661716450334], [173.551298456107475, -35.006183363587958], [174.329390497126241, -35.265495700828616], [174.612008905330526, -36.156397393540537]]]] } }, - { "type": "Feature", "properties": { "admin": "Oman", "name": "Oman", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[58.861141391846573, 21.114034532144299], [58.487985874266961, 20.428985907467101], [58.03431847517659, 20.481437486243347], [57.826372511634098, 20.24300242764863], [57.66576216007094, 19.736004950433109], [57.788700392493368, 19.067570298737646], [57.694390903560667, 18.944709580963799], [57.2342639504338, 18.947991034414255], [56.609650913321971, 18.574267076079476], [56.512189162019482, 18.087113348863934], [56.283520949128011, 17.876066799383945], [55.661491733630683, 17.884128322821535], [55.269939406155189, 17.632309068263194], [55.274900343655091, 17.228354397037659], [54.791002231674113, 16.950696926333357], [54.239252964093751, 17.04498057704998], [53.57050825380459, 16.707662665264674], [53.108572625547502, 16.651051133688977], [52.782184279192066, 17.349742336491229], [52.000009800022227, 19.000003363516068], [54.999981723862405, 19.999994004796118], [55.666659376859869, 22.000001125572307], [55.208341098863187, 22.708329982997007], [55.234489373602869, 23.110992743415348], [55.52584109886449, 23.524869289640911], [55.528631626208288, 23.933604030853498], [55.981213820220503, 24.130542914317854], [55.80411868675624, 24.269604193615287], [55.88623253766805, 24.920830593357486], [56.396847365143984, 24.924732163995508], [56.845140415276049, 24.241673081961487], [57.403452589757428, 23.878594468678834], [58.136947869708322, 23.747930609628835], [58.729211460205427, 23.565667832935414], [59.180501743410346, 22.992395331305456], [59.450097690677033, 22.660270900965592], [59.80806033716285, 22.533611965418199], [59.806148309168087, 22.31052480721419], [59.442191196536399, 21.71454051359208], [59.282407667889871, 21.433885809814875], [58.861141391846573, 21.114034532144299]]], [[[56.391421339753393, 25.895990708921254], [56.261041701080913, 25.714606431576748], [56.070820753814544, 26.055464178973946], [56.362017449779344, 26.395934353128947], [56.485679152253809, 26.309117946878665], [56.391421339753393, 25.895990708921254]]]] } }, - { "type": "Feature", "properties": { "admin": "Pakistan", "name": "Pakistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[75.158027785140902, 37.13303091078911], [75.896897414050116, 36.666806138651829], [76.192848341785677, 35.898403428687821], [77.837450799474553, 35.494009507787759], [76.871721632804011, 34.653544012992732], [75.757060988268321, 34.504922593721311], [74.240202671204955, 34.748887030571247], [73.749948358051952, 34.317698879527846], [74.104293654277328, 33.441473293586846], [74.451559279278698, 32.764899603805489], [75.258641798813187, 32.271105455040491], [74.405928989564998, 31.692639471965272], [74.421380242820263, 30.97981476493117], [73.450638462217412, 29.976413479119863], [72.823751662084689, 28.961591701772047], [71.777665643200308, 27.913180243434521], [70.61649620960192, 27.989196275335861], [69.514392938113119, 26.940965684511365], [70.168926629522005, 26.491871649678835], [70.282873162725579, 25.722228705339823], [70.844699334602822, 25.215102037043511], [71.0432401874682, 24.356523952730193], [68.842599318318761, 24.359133612560932], [68.176645135373377, 23.691965033456704], [67.443666619745457, 23.944843654876983], [67.145441928989058, 24.663611151624639], [66.37282758979326, 25.425140896093847], [64.530407749291115, 25.237038682551425], [62.905700718034595, 25.218409328710202], [61.497362908784183, 25.078237006118492], [61.874187453056535, 26.239974880472097], [63.316631707619578, 26.756532497661659], [63.23389773952028, 27.217047024030702], [62.755425652929851, 27.378923448184985], [62.727830438085974, 28.259644883735383], [61.771868117118615, 28.699333807890792], [61.369308709564926, 29.303276272085917], [60.874248488208778, 29.829238999952604], [62.549856805272775, 29.318572496044304], [63.550260858011164, 29.468330796826162], [64.148002150331237, 29.340819200145965], [64.350418735618504, 29.560030625928089], [65.046862013616092, 29.472180691031902], [66.346472609324408, 29.88794342703617], [66.38145755398601, 30.738899237586448], [66.938891229118454, 31.304911200479346], [67.683393589147457, 31.303154201781414], [67.792689243444769, 31.582930406209623], [68.556932000609308, 31.713310044882011], [68.926676873657655, 31.620189113892064], [69.317764113242546, 31.901412258424436], [69.262522007122541, 32.501944078088293], [69.687147251264847, 33.105498969041228], [70.323594191371583, 33.358532619758385], [69.93054324735958, 34.020120144175102], [70.881803012988385, 33.988855902638512], [71.156773309213449, 34.348911444632144], [71.115018751921625, 34.733125718722228], [71.613076206350698, 35.153203436822857], [71.498767938121077, 35.650563259415996], [71.262348260385735, 36.074387518857797], [71.846291945283909, 36.509942328429851], [72.920024855444453, 36.720007025696312], [74.067551710917812, 36.836175645488446], [74.575892775372964, 37.02084137628345], [75.158027785140902, 37.13303091078911]]] } }, - { "type": "Feature", "properties": { "admin": "Panama", "name": "Panama", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-77.881571417945239, 7.223771267114783], [-78.214936082660103, 7.512254950384159], [-78.429160732726061, 8.052041123888925], [-78.182095709938608, 8.319182440621772], [-78.43546525746568, 8.387705389840788], [-78.622120530903928, 8.718124497915026], [-79.120307176413732, 8.996092027213022], [-79.557877366845176, 8.932374986197145], [-79.760578172510037, 8.584515082224398], [-80.164481167303322, 8.333315944853593], [-80.382659064439608, 8.29840851484043], [-80.480689256497286, 8.090307522001067], [-80.003689948227148, 7.54752411542337], [-80.276670701808982, 7.419754136581713], [-80.421158006497066, 7.271571966984763], [-80.886400926420791, 7.220541490096535], [-81.059542812814698, 7.817921047390596], [-81.189715745757937, 7.647905585150339], [-81.519514736644666, 7.706610012233908], [-81.721311204744453, 8.108962714058434], [-82.131441209628889, 8.175392767769635], [-82.390934414382542, 8.292362372262287], [-82.820081346350406, 8.290863755725821], [-82.850958014644803, 8.073822740099954], [-82.965783047197348, 8.225027980985983], [-82.9131764391242, 8.423517157419068], [-82.829770677405151, 8.626295477732368], [-82.868657192704759, 8.807266343618521], [-82.719183112300513, 8.925708726431493], [-82.927154914059145, 9.074330145702914], [-82.932890998043561, 9.476812038608172], [-82.546196255203469, 9.566134751824674], [-82.187122565423394, 9.207448635286779], [-82.207586432610952, 8.995575262890098], [-81.808566860669259, 8.95061676679617], [-81.714154018872023, 9.031955471223581], [-81.43928707551153, 8.786234035675715], [-80.947301601876745, 8.858503526235905], [-80.521901211250054, 9.11107208906243], [-79.914599778955974, 9.312765204297618], [-79.573302781884294, 9.611610012241526], [-79.021191779277913, 9.552931423374103], [-79.058450486960353, 9.454565334506523], [-78.500887620747164, 9.420458889193879], [-78.055927700497989, 9.247730414258296], [-77.729513515926399, 8.946844387238867], [-77.353360765273848, 8.670504665558068], [-77.474722866511314, 8.524286200388216], [-77.242566494440069, 7.935278225125442], [-77.431107957656977, 7.638061224798733], [-77.75341386586139, 7.709839789252141], [-77.881571417945239, 7.223771267114783]]] } }, - { "type": "Feature", "properties": { "admin": "Peru", "name": "Peru", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-69.590423753524036, -17.580011895419329], [-69.858443569605839, -18.092693780187009], [-70.3725723944777, -18.347975355708861], [-71.375250210236914, -17.77379851651385], [-71.462040778271117, -17.363487644116379], [-73.444529588500401, -16.359362888252992], [-75.23788265654143, -15.26568287522778], [-76.009205084929931, -14.649286390850317], [-76.423469204397733, -13.823186944232431], [-76.259241502574156, -13.535039157772939], [-77.10619238962181, -12.222716159720816], [-78.092152879534623, -10.377712497604062], [-79.036953091126918, -8.38656788496589], [-79.445920376284832, -7.930833428583859], [-79.760578172510037, -7.194340915560081], [-80.537481655586049, -6.541667575713715], [-81.249996304026411, -6.136834405139182], [-80.926346808582423, -5.690556735866563], [-81.410942552399433, -4.736764825055459], [-81.099669562489353, -4.036394138203696], [-80.302560594387188, -3.404856459164712], [-80.184014858709645, -3.821161797708043], [-80.46929460317692, -4.059286797708999], [-80.442241990872134, -4.425724379090673], [-80.028908047185581, -4.346090996928893], [-79.62497921417615, -4.454198093283494], [-79.205289069317715, -4.959128513207388], [-78.639897223612323, -4.547784112164072], [-78.450683966775628, -3.873096612161375], [-77.83790483265858, -3.003020521663103], [-76.635394253226707, -2.608677666843817], [-75.544995693652027, -1.56160979574588], [-75.233722703741932, -0.911416924649529], [-75.373223232713841, -0.15203175212045], [-75.106624518520064, -0.05720549886486], [-74.441600511355958, -0.530820000819887], [-74.122395189089048, -1.002832533373848], [-73.659503546834586, -1.260491224781134], [-73.070392218707212, -2.308954359550952], [-72.325786505813639, -2.434218031426453], [-71.774760708285385, -2.169789727388937], [-71.413645799429773, -2.342802422702128], [-70.813475714791949, -2.256864515800742], [-70.047708502874841, -2.725156345229699], [-70.692682054309699, -3.742872002785858], [-70.394043952094975, -3.766591485207825], [-69.893635219996611, -4.298186944194326], [-70.79476884630229, -4.251264743673302], [-70.928843349883564, -4.401591485210367], [-71.748405727816532, -4.59398284263301], [-72.891927659787243, -5.274561455916979], [-72.964507208941185, -5.741251315944892], [-73.219711269814596, -6.089188734566076], [-73.120027431923575, -6.629930922068238], [-73.724486660441627, -6.918595472850638], [-73.723401455363486, -7.340998630404412], [-73.987235480429646, -7.523829847853063], [-73.571059332967053, -8.424446709835832], [-73.015382656532537, -9.03283334720806], [-73.226713426390148, -9.462212823121233], [-72.563033006465631, -9.520193780152715], [-72.184890713169821, -10.05359791426943], [-71.302412278921523, -10.079436130415372], [-70.481893886991159, -9.490118096558842], [-70.548685675728393, -11.009146823778462], [-70.093752204046879, -11.123971856331011], [-69.52967810736493, -10.951734307502193], [-68.665079718689611, -12.561300144097171], [-68.880079515239956, -12.89972909917665], [-68.929223802349526, -13.602683607643007], [-68.94888668483658, -14.45363941819328], [-69.339534674747, -14.953195489158828], [-69.160346645774936, -15.323973890853015], [-69.389764166934697, -15.66012908291165], [-68.959635382753291, -16.500697930571267], [-69.590423753524036, -17.580011895419329]]] } }, - { "type": "Feature", "properties": { "admin": "Philippines", "name": "Philippines", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[126.376813592637447, 8.414706325713352], [126.478512811387873, 7.750354112168976], [126.537423944200611, 7.189380601424572], [126.19677290253253, 6.274294338400038], [125.831420526229081, 7.293715318221855], [125.363852166852283, 6.78648529706099], [125.683160841983707, 6.049656887227257], [125.396511672060626, 5.581003322772288], [124.219787632342332, 6.16135549562618], [123.938719517106918, 6.88513560630612], [124.243662144061318, 7.360610459823659], [123.610212437027542, 7.833527329942753], [123.29607140512519, 7.418875637232786], [122.825505812675388, 7.457374579290216], [122.085499302255769, 6.899424139834847], [121.919928013192603, 7.192119452336072], [122.312358840017112, 8.034962063016506], [122.94239790251963, 8.316236883981174], [123.487687616063511, 8.693009751821192], [123.841154412939815, 8.240324204944384], [124.6014697612502, 8.514157619659015], [124.764612257995623, 8.960409450715458], [125.471390822451539, 8.986996975129641], [125.412117954612754, 9.760334784377545], [126.222714471543156, 9.28607432701885], [126.306636997585073, 8.782487494334573], [126.376813592637447, 8.414706325713352]]], [[[123.982437778825798, 10.278778591345811], [123.62318322153277, 9.950090643753297], [123.309920688979332, 9.318268744336676], [122.995883009941636, 9.022188625520398], [122.380054966319463, 9.713360907424201], [122.586088901867072, 9.981044826696104], [122.837081333508706, 10.261156927934234], [122.947410516451896, 10.881868394408029], [123.498849725438447, 10.940624497923945], [123.337774285984722, 10.267383938025445], [124.077935825701218, 11.232725531453706], [123.982437778825798, 10.278778591345811]]], [[[118.504580926590336, 9.316382554558087], [117.174274530100675, 8.367499904814663], [117.664477166821371, 9.066888739452933], [118.386913690261736, 9.684499619989223], [118.98734215706105, 10.376292019080507], [119.511496209797528, 11.36966807702721], [119.689676548339889, 10.554291490109872], [119.029458449378978, 10.003653265823869], [118.504580926590336, 9.316382554558087]]], [[[121.883547804859106, 11.891755072471977], [122.483821242361458, 11.582187404827506], [123.120216506035959, 11.583660183147867], [123.100837843926442, 11.165933742716486], [122.637713657726692, 10.741308498574226], [122.002610304859559, 10.441016750526087], [121.967366978036523, 10.905691229694622], [122.038370396005519, 11.415840969280039], [121.883547804859106, 11.891755072471977]]], [[[125.502551711123488, 12.162694606978347], [125.783464797062152, 11.046121934447767], [125.01188398651226, 11.311454576050377], [125.032761265158115, 10.975816148314703], [125.277449172060244, 10.358722032101308], [124.801819289245714, 10.134678859899889], [124.760168084818474, 10.8379951033923], [124.459101190286049, 10.889929917845633], [124.302521600441722, 11.495370998577227], [124.891012811381572, 11.415582587118589], [124.877990350443952, 11.794189968304988], [124.266761509295705, 12.557760931849682], [125.22711632700782, 12.53572093347719], [125.502551711123488, 12.162694606978347]]], [[[121.527393833503481, 13.069590155484516], [121.262190382981544, 12.2055602075644], [120.833896112146533, 12.704496161342416], [120.323436313967477, 13.466413479053866], [121.18012820850214, 13.429697373910439], [121.527393833503481, 13.069590155484516]]], [[[121.321308221523566, 18.504064642811013], [121.937601353036371, 18.21855235439838], [122.246006300954264, 18.478949896717094], [122.336956821787965, 18.224882717354173], [122.174279412933174, 17.810282701076371], [122.51565392465335, 17.09350474697197], [122.252310825693883, 16.262444362854122], [121.662786086108255, 15.931017564350125], [121.505069614753367, 15.124813544164621], [121.728828566577249, 14.328376369682244], [122.258925409027313, 14.218202216035973], [122.701275669445636, 14.336541245984417], [123.950295037940236, 13.782130642141066], [123.855107049658599, 13.237771104378464], [124.181288690284873, 12.997527370653469], [124.077419061378222, 12.536676947474573], [123.298035109552245, 13.027525539598981], [122.928651971529902, 13.552919826710404], [122.671355015148663, 13.185836289925131], [122.034649692880521, 13.784481919810343], [121.126384718918587, 13.636687323455559], [120.628637323083296, 13.857655747935649], [120.679383579593832, 14.271015529838319], [120.99181928923052, 14.525392767795079], [120.693336216312687, 14.756670640517282], [120.564145135582976, 14.396279201713821], [120.070428501466367, 14.970869452367094], [119.920928582846102, 15.406346747290735], [119.883773228028247, 16.363704331929963], [120.286487664878791, 16.034628811095327], [120.39004723519173, 17.599081122299506], [120.7158671407919, 18.505227362537536], [121.321308221523566, 18.504064642811013]]]] } }, - { "type": "Feature", "properties": { "admin": "Papua New Guinea", "name": "Papua New Guinea", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[155.880025669578401, -6.819996840037758], [155.599991082988765, -6.919990736522491], [155.166994256815087, -6.535931491729299], [154.729191522438327, -5.900828138862208], [154.514114211239644, -5.139117526880012], [154.652503696917336, -5.042430922061839], [154.759990676084357, -5.339983819198493], [155.062917922179338, -5.566791680527486], [155.547746209941693, -6.200654799019658], [156.019965448224752, -6.540013929880386], [155.880025669578401, -6.819996840037758]]], [[[151.982795851854462, -5.478063246282344], [151.459106887008659, -5.560280450058739], [151.301390415653884, -5.840728448106701], [150.754447056276661, -6.083762709175387], [150.241196730753813, -6.317753594592984], [149.709963006793316, -6.316513360218051], [148.890064732050462, -6.026040134305432], [148.318936802360696, -5.74714242922613], [148.401825799756864, -5.437755629094722], [149.298411900020824, -5.583741550319216], [149.845561965127217, -5.505503431829339], [149.996250441690279, -5.026101169457674], [150.139755894164921, -5.001348158389788], [150.236907586873485, -5.53222014732428], [150.807467075808063, -5.455842380396886], [151.089672072553981, -5.113692722192368], [151.647880894170811, -4.757073662946168], [151.537861769821518, -4.167807305521889], [152.136791620084352, -4.148790378438519], [152.338743117480988, -4.31296640382976], [152.318692661751754, -4.867661228050748], [151.982795851854462, -5.478063246282344]]], [[[147.191873814074938, -7.388024183789978], [148.084635858349372, -8.044108168167609], [148.734105259393573, -9.104663588093755], [149.306835158484432, -9.071435642130067], [149.266630894161324, -9.514406019736027], [150.038728469034311, -9.684318129111698], [149.738798456012262, -9.872937106977002], [150.801627638959133, -10.29368661869742], [150.690574985963849, -10.582712904505865], [150.028393182575826, -10.652476088099929], [149.782310012001972, -10.393267103723941], [148.923137648717216, -10.28092253992136], [147.913018426707993, -10.130440769087469], [147.135443150012236, -9.492443536012017], [146.567880894150619, -8.942554619994153], [146.048481073184917, -8.067414239131308], [144.74416792213799, -7.630128269077473], [143.897087844009661, -7.915330498896279], [143.286375767184268, -8.245491224809056], [143.413913202080664, -8.983068942910945], [142.628431431244223, -9.326820570516501], [142.068258905200196, -9.159595635620034], [141.033851760013874, -9.117892754760417], [141.017056919519007, -5.85902190513802], [141.000210402591847, -2.600151055515624], [142.735246616791443, -3.289152927263216], [144.583970982033236, -3.861417738463401], [145.27317955950997, -4.373737888205027], [145.829786411725649, -4.876497897972683], [145.981921828392956, -5.465609226100012], [147.648073358347574, -6.083659356310803], [147.891107619416175, -6.614014580922315], [146.970905389594861, -6.721656589386255], [147.191873814074938, -7.388024183789978]]], [[[153.14003787659874, -4.499983412294113], [152.827292108368255, -4.766427097190998], [152.63867313050298, -4.176127211120927], [152.406025832324929, -3.789742526874561], [151.953236932583536, -3.462062269711821], [151.384279413050024, -3.035421644710111], [150.6620495953388, -2.741486097833956], [150.939965448204532, -2.500002129734028], [151.479984165654514, -2.779985039891386], [151.820015090135087, -2.999971612157907], [152.239989455371074, -3.24000864015366], [152.640016717742526, -3.659983005389647], [153.019993524384631, -3.980015150573293], [153.14003787659874, -4.499983412294113]]]] } }, - { "type": "Feature", "properties": { "admin": "Poland", "name": "Poland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[15.016995883858666, 51.106674099321566], [14.607098422919531, 51.745188096719964], [14.685026482815685, 52.089947414755187], [14.437599725002197, 52.624850165408382], [14.074521111719488, 52.981262518925426], [14.353315463934136, 53.248171291712957], [14.119686313542584, 53.757029120491026], [14.802900424873455, 54.050706285205735], [16.363477003655728, 54.513158677785711], [17.622831658608671, 54.851535956432897], [18.620858595461637, 54.682605699270766], [18.696254510175461, 54.438718777069276], [19.6606400896064, 54.426083889373913], [20.89224450041862, 54.312524929412518], [22.731098667092649, 54.327536932993311], [23.243987257589506, 54.220566718149129], [23.484127638449841, 53.912497667041123], [23.527535841574995, 53.47012156840654], [23.804934930117774, 53.08973135030606], [23.799198846133375, 52.691099351606553], [23.19949384938618, 52.486977444053664], [23.508002150168689, 52.023646552124717], [23.52707075368437, 51.578454087930233], [24.029985792748899, 50.705406602575174], [23.922757195743259, 50.424881089878738], [23.426508416444388, 50.308505764357449], [22.518450148211596, 49.476773586619736], [22.776418898212619, 49.027395331409608], [22.558137648211751, 49.08573802346713], [21.607808058364206, 49.470107326854077], [20.887955356538406, 49.328772284535823], [20.415839471119849, 49.431453355499755], [19.825022820726865, 49.217125352569219], [19.320712517990469, 49.571574001659179], [18.909574822676316, 49.435845852244562], [18.85314415861361, 49.496229763377634], [18.392913852622168, 49.988628648470737], [17.649445021238986, 50.049038397819942], [17.554567091551117, 50.36214590107641], [16.868769158605655, 50.473973700556016], [16.719475945714429, 50.215746568393527], [16.176253289462263, 50.4226073268579], [16.238626743238566, 50.697732652379827], [15.490972120839725, 50.7847299261432], [15.016995883858666, 51.106674099321566]]] } }, - { "type": "Feature", "properties": { "admin": "Puerto Rico", "name": "Puerto Rico", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-66.2824344550082, 18.51476166429536], [-65.771302863209286, 18.426679185453875], [-65.591003790942935, 18.228034979723912], [-65.847163865813755, 17.975905666571855], [-66.599934455009475, 17.98182261806927], [-67.184162360285256, 17.946553453030074], [-67.24242753769434, 18.374460150622934], [-67.100679083917726, 18.520601101144347], [-66.2824344550082, 18.51476166429536]]] } }, - { "type": "Feature", "properties": { "admin": "North Korea", "name": "Dem. Rep. Korea", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[130.640015903852401, 42.39500946712527], [130.780007358931101, 42.220007229168843], [130.400030552288996, 42.280003567059701], [129.965948521037234, 41.941367906251052], [129.667362095254788, 41.601104437825221], [129.705189243692445, 40.882827867184318], [129.188114862179958, 40.661807766271984], [129.010399611528186, 40.485436102859801], [128.633368361526692, 40.189846910150301], [127.967414178581322, 40.025412502597547], [127.533435500194145, 39.756850083976694], [127.502119582225276, 39.323930772451526], [127.385434198110261, 39.213472398427648], [127.783342726757709, 39.050898342437414], [128.349716424676586, 38.612242946927843], [128.205745884311426, 38.370397243801882], [127.780035435090966, 38.304535630845884], [127.073308547067342, 38.256114813788393], [126.683719924018888, 37.804772854151174], [126.237338901881742, 37.840377916000271], [126.174758742376213, 37.749685777328033], [125.689103631697165, 37.940010077459014], [125.568439162295675, 37.752088731429616], [125.275330438336184, 37.66907054295271], [125.24008711151312, 37.857224432927424], [124.981033156433952, 37.948820909164773], [124.712160679219352, 38.108346055649783], [124.985994093933954, 38.548474229479673], [125.221948683778677, 38.665857245430665], [125.13285851450749, 38.848559271798578], [125.386589797060566, 39.387957872061158], [125.321115757346774, 39.551384589184202], [124.737482131042384, 39.660344346671614], [124.265624627785286, 39.928493353834149], [125.079941847840615, 40.569823716792442], [126.182045119329402, 41.107336127276362], [126.86908328664984, 41.816569322266176], [127.343782993682993, 41.50315176041596], [128.208433058790632, 41.466771552082477], [128.052215203972281, 41.994284572917934], [129.59666873587949, 42.424981797854542], [129.994267205933198, 42.985386867843779], [130.640015903852401, 42.39500946712527]]] } }, - { "type": "Feature", "properties": { "admin": "Portugal", "name": "Portugal", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-9.034817674180244, 41.880570583659669], [-8.671945766626719, 42.134689439454952], [-8.26385698081779, 42.280468654950326], [-8.01317460776991, 41.790886135417118], [-7.422512986673794, 41.792074693359822], [-7.251308966490822, 41.91834605566504], [-6.668605515967655, 41.883386949219577], [-6.389087693700914, 41.381815497394641], [-6.851126674822551, 41.111082668617513], [-6.864019944679383, 40.330871893874821], [-7.026413133156593, 40.184524237624238], [-7.066591559263527, 39.711891587882768], [-7.498632371439724, 39.629571031241802], [-7.098036668313126, 39.03007274022378], [-7.374092169616317, 38.373058580064914], [-7.029281175148794, 38.075764065089757], [-7.166507941099863, 37.803894354802217], [-7.537105475281022, 37.428904323876232], [-7.45372555177809, 37.097787583966053], [-7.855613165711985, 36.838268540996253], [-8.382816127953687, 36.978880113262449], [-8.898856980820325, 36.868809312480771], [-8.746101446965552, 37.6513455266766], [-8.839997524439879, 38.266243394517609], [-9.287463751655221, 38.358485826158592], [-9.526570603869713, 38.737429104154906], [-9.44698889814023, 39.392066148428363], [-9.048305223008425, 39.755093085278766], [-8.977353481471679, 40.159306138665798], [-8.7686840478771, 40.76063894303018], [-8.790853237330309, 41.18433401139125], [-8.990789353867568, 41.543459377603625], [-9.034817674180244, 41.880570583659669]]] } }, - { "type": "Feature", "properties": { "admin": "Paraguay", "name": "Paraguay", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-62.685057135657871, -22.24902922942238], [-62.291179368729203, -21.051634616787389], [-62.265961269770784, -20.513734633061272], [-61.786326463453761, -19.633736667562957], [-60.043564622626477, -19.342746677327419], [-59.11504248720609, -19.356906019775398], [-58.183471442280492, -19.868399346600359], [-58.166392381408038, -20.176700941653674], [-57.870673997617786, -20.732687676681948], [-57.937155727761287, -22.090175876557169], [-56.881509568902885, -22.282153822521476], [-56.473317430229379, -22.086300144135279], [-55.797958136606894, -22.356929620047815], [-55.61068274598113, -22.655619398694839], [-55.517639329639621, -23.57199757252663], [-55.400747239795407, -23.956935316668797], [-55.027901780809543, -24.001273695575225], [-54.652834235235119, -23.839578138933955], [-54.292959560754511, -24.021014092710722], [-54.293476325077435, -24.570799655863958], [-54.428946092330577, -25.162184747012162], [-54.625290696823562, -25.739255466415507], [-54.788794928595038, -26.621785577096126], [-55.695845506398143, -27.387837009390857], [-56.486701626192989, -27.548499037386286], [-57.609759690976134, -27.395898532828383], [-58.618173590719735, -27.123718763947089], [-57.633660040911117, -25.603656508081638], [-57.777217169817924, -25.162339776309032], [-58.807128465394968, -24.771459242453307], [-60.028966030504016, -24.032796319273267], [-60.846564704009907, -23.880712579038288], [-62.685057135657871, -22.24902922942238]]] } }, - { "type": "Feature", "properties": { "admin": "Palestine", "name": "Palestine", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.545665317534535, 32.393992011030569], [35.545251906076196, 31.782504787720832], [35.397560662586038, 31.489086005167572], [34.927408481594554, 31.35343537040141], [34.970506626125989, 31.616778469360803], [35.225891554512422, 31.754341132121759], [34.974640740709319, 31.866582343059715], [35.183930291491428, 32.532510687788935], [35.545665317534535, 32.393992011030569]]] } }, - { "type": "Feature", "properties": { "admin": "Qatar", "name": "Qatar", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[50.810108270069563, 24.754742539971371], [50.743910760303677, 25.482424221289389], [51.01335167827348, 26.006991685484191], [51.286461622936045, 26.114582017515865], [51.589078810437243, 25.801112779233375], [51.606700473848804, 25.215670477798735], [51.389607781790623, 24.627385972588051], [51.112415398977006, 24.556330878186721], [50.810108270069563, 24.754742539971371]]] } }, - { "type": "Feature", "properties": { "admin": "Romania", "name": "Romania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.710531447040488, 47.882193915389394], [23.142236362406798, 48.096341050806942], [23.760958286237404, 47.985598456405448], [24.402056105250374, 47.981877753280422], [24.866317172960571, 47.737525743188307], [25.207743361112986, 47.891056423527459], [25.945941196402394, 47.987148749374207], [26.197450392366925, 48.220881252630342], [26.619336785597788, 48.220726223333457], [26.924176059687561, 48.123264472030982], [27.233872918412736, 47.826770941756365], [27.551166212684841, 47.405117092470817], [28.128030226359037, 46.81047638608824], [28.160017937947707, 46.371562608417207], [28.054442986775392, 45.944586086605618], [28.233553501099035, 45.488283189468369], [28.679779493939371, 45.30403087013169], [29.149724969201646, 45.464925442072442], [29.603289015427425, 45.293308010431119], [29.62654340995876, 45.035390936862392], [29.141611769331831, 44.820210272799038], [28.837857700320196, 44.913873806328041], [28.55808149589199, 43.707461656258118], [27.970107049275068, 43.812468166675202], [27.242399529740904, 44.175986029632398], [26.065158725699739, 43.943493760751259], [25.569271681426923, 43.688444729174712], [24.100679152124169, 43.741051337247846], [23.332302280376322, 43.897010809904707], [22.94483239105184, 43.823785305347123], [22.657149692482985, 44.234923000661276], [22.474008416440594, 44.409227606781762], [22.705725538837349, 44.578002834647016], [22.459022251075933, 44.702517198254291], [22.145087924902807, 44.478422349620573], [21.562022739353605, 44.768947251965486], [21.483526238702233, 45.181170152357772], [20.874312778413351, 45.416375433934228], [20.76217492033998, 45.734573065771428], [20.220192498462833, 46.127468980486547], [21.021952345471245, 46.316087958351886], [21.626514926853869, 46.994237779318148], [22.09976769378283, 47.672439276716695], [22.710531447040488, 47.882193915389394]]] } }, - { "type": "Feature", "properties": { "admin": "Russia", "name": "Russia", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[143.648007440362846, 50.747600409541512], [144.65414757708561, 48.976390692737581], [143.173927850517174, 49.306551418650365], [142.558668247650076, 47.861575018904908], [143.533492466404027, 46.836728013692479], [143.505277134372591, 46.137907619809475], [142.747700636973889, 46.740764878926562], [142.092030064054484, 45.966755276058777], [141.906925083585008, 46.805928860046535], [142.018442824470867, 47.780132961612921], [141.904444614835029, 48.859188544299563], [142.135800002205656, 49.615163072297449], [142.179983351815281, 50.952342434281903], [141.594075962490024, 51.935434882202529], [141.682546014573632, 53.301966457728767], [142.606934035410745, 53.762145087287891], [142.209748976815376, 54.225475979216853], [142.654786411712934, 54.365880845753864], [142.914615513276544, 53.704577541714734], [143.260847609632037, 52.740760403039033], [143.235267775647628, 51.756660264688733], [143.648007440362846, 50.747600409541512]]], [[[22.731098667092649, 54.327536932993311], [20.892244500418652, 54.312524929412568], [19.6606400896064, 54.42608388937397], [19.88848147958134, 54.866160386771483], [21.268448927503492, 55.190481675835279], [22.315723504330599, 55.015298570365886], [22.757763706155281, 54.856574408581416], [22.651051873472564, 54.582740993866693], [22.731098667092649, 54.327536932993311]]], [[[180.000000000000114, 70.832199208546669], [178.903425, 70.78114], [178.7253, 71.0988], [180.000000000000114, 71.515714336428246], [180.000000000000114, 70.832199208546669]]], [[[143.60385, 73.21244], [142.08763, 73.20544], [140.038155, 73.31692], [139.86312, 73.36983], [140.81171, 73.76506], [142.06207, 73.85758], [143.48283, 73.47525], [143.60385, 73.21244]]], [[[150.73167, 75.08406], [149.575925, 74.68892], [147.977465, 74.778355], [146.11919, 75.17298], [146.358485, 75.49682], [148.22223, 75.345845], [150.73167, 75.08406]]], [[[145.086285, 75.562625], [144.3, 74.82], [140.61381, 74.84768], [138.95544, 74.61148], [136.97439, 75.26167], [137.51176, 75.94917], [138.831075, 76.13676], [141.471615, 76.09289], [145.086285, 75.562625]]], [[[57.535692579992386, 70.720463975702145], [56.944979282463933, 70.63274323188665], [53.677375115784187, 70.762657782668455], [53.412016635965372, 71.206661688920192], [51.601894565645708, 71.474759019650477], [51.455753615124209, 72.014881089965129], [52.478275180883564, 72.229441636840946], [52.444168735570841, 72.77473135038484], [54.427613559797649, 73.627547512497571], [53.508289829325136, 73.749813951300141], [55.902458937407644, 74.627486477345329], [55.631932814359701, 75.081412258597155], [57.868643833248839, 75.609390367323186], [61.170044386647497, 76.251883450008123], [64.498368361270209, 76.439055487769267], [66.210977003855092, 76.809782213031227], [68.157059767534818, 76.939696763812904], [68.852211134725124, 76.544811306454605], [68.180572544227644, 76.233641669409096], [64.637326287703004, 75.737754625136219], [61.583507521414752, 75.260884507946784], [58.477082147053366, 74.309056301562819], [56.986785516187993, 73.333043524866227], [55.41933597191094, 72.371267605265956], [55.622837762276291, 71.540594794390316], [57.535692579992386, 70.720463975702145]]], [[[106.970130000000111, 76.97419], [107.240000000000123, 76.48], [108.1538, 76.723350000000138], [111.077260000000138, 76.71], [113.33151, 76.22224], [114.13417, 75.84764], [113.88539, 75.327790000000121], [112.77918, 75.03186], [110.151250000000175, 74.47673], [109.4, 74.18], [110.64, 74.04], [112.11919, 73.787740000000113], [113.019540000000234, 73.976930000000138], [113.529580000000294, 73.33505], [113.96881, 73.59488], [115.56782, 73.75285], [118.776330000000215, 73.58772], [119.02, 73.12], [123.20066, 72.97122], [123.257770000000178, 73.73503], [125.380000000000166, 73.56], [126.97644, 73.56549], [128.59126, 73.03871], [129.05157, 72.39872], [128.46, 71.98], [129.715990000000204, 71.19304], [131.288580000000252, 70.786990000000102], [132.253500000000145, 71.8363], [133.857660000000294, 71.386420000000143], [135.56193, 71.655250000000123], [137.49755, 71.34763], [138.234090000000123, 71.62803], [139.86983, 71.487830000000116], [139.14791, 72.4161900000001], [140.46817, 72.849410000000134], [149.5, 72.2], [150.35118000000017, 71.60643], [152.96890000000019, 70.84222], [157.00688, 71.03141], [158.99779, 70.86672], [159.830310000000225, 70.45324], [159.70866, 69.72198], [160.94053000000028, 69.43728], [162.279070000000104, 69.64204], [164.05248, 69.66823], [165.940370000000172, 69.47199], [167.83567, 69.58269], [169.57763000000017, 68.6938], [170.816880000000253, 69.01363], [170.008200000000159, 69.65276], [170.453450000000259, 70.09703], [173.643910000000204, 69.81743], [175.72403000000017, 69.877250000000217], [178.6, 69.4], [180.000000000000114, 68.963636363636553], [180.000000000000114, 64.979708702198465], [179.99281, 64.97433], [178.707200000000199, 64.53493], [177.411280000000147, 64.60821], [178.313000000000187, 64.07593], [178.90825000000018, 63.251970000000128], [179.37034, 62.98262], [179.48636, 62.56894], [179.228250000000116, 62.304100000000133], [177.3643, 62.5219], [174.569290000000194, 61.76915], [173.68013, 61.65261], [172.15, 60.95], [170.6985, 60.33618], [170.330850000000282, 59.88177], [168.90046, 60.57355], [166.294980000000265, 59.7885500000002], [165.840000000000202, 60.16], [164.87674, 59.7316], [163.539290000000108, 59.86871], [163.217110000000218, 59.21101], [162.01733, 58.24328], [162.05297, 57.83912], [163.19191, 57.61503], [163.057940000000144, 56.159240000000111], [162.129580000000203, 56.12219], [161.70146, 55.285680000000148], [162.117490000000117, 54.85514], [160.368770000000325, 54.34433], [160.021730000000218, 53.20257], [158.530940000000157, 52.958680000000236], [158.23118, 51.94269], [156.789790000000266, 51.01105], [156.42000000000013, 51.7], [155.99182, 53.15895], [155.43366, 55.381030000000109], [155.914420000000291, 56.767920000000132], [156.75815, 57.3647], [156.81035, 57.83204], [158.364330000000166, 58.05575], [160.150640000000124, 59.314770000000109], [161.87204, 60.343000000000117], [163.66969, 61.1409], [164.473550000000103, 62.55061], [163.258420000000172, 62.46627], [162.65791, 61.6425], [160.12148, 60.54423], [159.30232, 61.77396], [156.72068, 61.43442], [154.218060000000293, 59.758180000000117], [155.04375, 59.14495], [152.81185, 58.88385], [151.265730000000246, 58.78089], [151.33815, 59.50396], [149.78371, 59.655730000000126], [148.54481, 59.16448], [145.48722, 59.33637], [142.197820000000121, 59.03998], [138.958480000000293, 57.08805], [135.12619, 54.72959], [136.70171, 54.603550000000112], [137.19342, 53.97732], [138.1647, 53.755010000000247], [138.80463, 54.25455], [139.90151, 54.189680000000166], [141.34531, 53.089570000000109], [141.37923, 52.23877], [140.59742000000017, 51.23967], [140.51308, 50.045530000000113], [140.061930000000189, 48.446710000000152], [138.554720000000202, 46.99965], [138.21971, 46.30795], [136.86232, 45.143500000000174], [135.515350000000183, 43.989], [134.869390000000237, 43.39821], [133.536870000000249, 42.81147], [132.90627, 42.79849], [132.278070000000241, 43.284560000000106], [130.935870000000136, 42.55274], [130.78, 42.220000000000191], [130.640000000000157, 42.395], [130.633866408409801, 42.903014634770543], [131.144687941614961, 42.929989732426932], [131.288555129115593, 44.111519680348252], [131.025190000000237, 44.96796], [131.883454217659562, 45.321161607436508], [133.097120000000189, 45.14409], [133.769643996313164, 46.116926988299149], [134.112350000000163, 47.212480000000127], [134.50081, 47.578450000000139], [135.026311476786759, 48.478229885443902], [133.373595819228001, 48.183441677434836], [132.506690000000106, 47.78896], [130.987260000000106, 47.79013], [130.582293328982644, 48.72968740497619], [129.397817824420486, 49.4406000840156], [127.657400000000351, 49.76027], [127.287455682484904, 50.739797268265434], [126.939156528837827, 51.353894151405896], [126.564399041856959, 51.784255479532689], [125.946348911646439, 52.792798570356936], [125.068211297710434, 53.161044826868924], [123.57147, 53.4588], [122.245747918793043, 53.431725979213681], [121.003084751470354, 53.251401068731226], [120.177088657716865, 52.753886216841195], [120.725789015791975, 52.516226304730893], [120.7382, 51.96411], [120.182080000000155, 51.64355], [119.27939, 50.58292], [119.288460728025839, 50.142882798861947], [117.87924441942647, 49.510983384797036], [116.67880089728618, 49.888531399121398], [115.485695428531415, 49.805177313834733], [114.962109816550353, 50.140247300815119], [114.362456496235325, 50.24830272073747], [112.897739699354361, 49.543565375356984], [111.581230910286649, 49.377968248077671], [110.662010532678835, 49.130128078805846], [109.402449171996707, 49.292960516957685], [108.475167270951275, 49.282547715850704], [107.868175897251092, 49.793705145865871], [106.888804152455293, 50.274295966180276], [105.886591424586868, 50.40601919209216], [104.62158, 50.275320000000157], [103.676545444760336, 50.08996613219513], [102.25589, 50.510560000000105], [102.06521, 51.25991], [100.889480421962631, 51.516855780638409], [99.981732212323564, 51.63400625264395], [98.861490513100492, 52.047366034546698], [97.82573978067451, 51.010995184933236], [98.231761509191699, 50.422400621128716], [97.259760000000199, 49.72605], [95.814020000000156, 49.977460000000114], [94.815949334698757, 50.01343333597088], [94.147566359435601, 50.480536607457161], [93.10421, 50.49529], [92.234711541719676, 50.802170722041737], [90.713667433640765, 50.331811835321098], [88.805566847695573, 49.470520738312459], [87.751264276076824, 49.297197984405543], [87.359970330762692, 49.214980780629148], [86.829356723989648, 49.826674709668133], [85.541269972682485, 49.69285858824815], [85.115559523462082, 50.117302964877631], [84.416377394553038, 50.311399644565817], [83.935114780618903, 50.889245510453563], [83.383003778012451, 51.069182847693881], [81.945985548839943, 50.812195949906325], [80.568446893235446, 51.388336493528435], [80.035559523441705, 50.864750881547209], [77.80091556184432, 53.404414984747532], [76.525179477854749, 54.177003485727127], [76.891100294913443, 54.490524400441913], [74.384820000000119, 53.546850000000113], [73.425678745420512, 53.489810289109741], [73.50851606638436, 54.035616766976588], [72.224150018202195, 54.376655381886778], [71.180131056609468, 54.133285224008247], [70.86526655465515, 55.169733588270091], [69.068166945272893, 55.385250149143488], [68.169100376258896, 54.970391750704366], [65.66687, 54.601250000000149], [65.178533563095939, 54.354227810272064], [61.436600000000126, 54.00625], [60.978066440683236, 53.664993394579128], [61.69998619980062, 52.979996446334255], [60.73999311711453, 52.719986477257734], [60.927268507740237, 52.447548326214999], [59.967533807215567, 51.96042043721566], [61.588003371024136, 51.272658799843171], [61.337424350840998, 50.799070136104248], [59.932807244715555, 50.842194118851822], [59.642282342370564, 50.545442206415707], [58.363320000000122, 51.06364], [56.77798, 51.04355], [55.71694, 50.621710000000142], [54.532878452376181, 51.026239732459359], [52.328723585831042, 51.718652248738088], [50.766648390512174, 51.692762356159861], [48.702381626181044, 50.605128485712825], [48.577841424357601, 49.87475962991563], [47.549480421749379, 50.454698391311119], [46.751596307162764, 49.356005764353725], [47.043671502476585, 49.152038886097571], [46.466445753776291, 48.394152330104923], [47.315240000000152, 47.71585], [48.05725, 47.74377], [48.694733514201872, 47.075628160177885], [48.59325000000014, 46.56104], [49.101160000000121, 46.39933], [48.645410000000105, 45.80629], [47.67591, 45.641490000000111], [46.68201, 44.6092], [47.59094, 43.660160000000118], [47.49252, 42.98658], [48.58437000000017, 41.80888], [47.987283156126033, 41.405819200194387], [47.815665724484653, 41.151416124021338], [47.373315464066387, 41.219732367511135], [46.686070591016708, 41.827137152669899], [46.404950799348924, 41.860675157227426], [45.7764, 42.092440000000224], [45.470279168485909, 42.502780666670041], [44.537622918482057, 42.711992702803677], [43.93121, 42.554960000000101], [43.755990000000182, 42.74083], [42.394400000000154, 43.2203], [40.922190000000128, 43.382150000000131], [40.076964959479838, 43.553104153002486], [39.95500857927108, 43.434997666999287], [38.68, 44.28], [37.539120000000104, 44.65721], [36.675460000000122, 45.24469], [37.40317, 45.40451], [38.23295, 46.24087], [37.67372, 46.63657], [39.14767, 47.044750000000128], [39.121200000000123, 47.26336], [38.22353803889947, 47.102189846375971], [38.2551123390298, 47.546400458356956], [38.77057, 47.825620000000228], [39.738277622238982, 47.898937079452068], [39.895620000000136, 48.23241], [39.67465, 48.783820000000127], [40.080789015469477, 49.307429917999364], [40.069040000000108, 49.60105], [38.594988234213552, 49.926461900423718], [38.010631137857068, 49.915661526074715], [37.393459506995228, 50.383953355503664], [36.626167840325387, 50.225590928745127], [35.35611616388811, 50.577197374059139], [35.37791, 50.77394], [35.02218305841793, 51.207572333371495], [34.224815708154402, 51.255993150428921], [34.141978387190612, 51.56641347920619], [34.391730584457228, 51.768881740925892], [33.75269982273587, 52.335074571331646], [32.715760532367163, 52.238465481162159], [32.412058139787767, 52.288694973349763], [32.15944000000021, 52.061250000000101], [31.78597, 52.10168], [31.540018344862254, 52.742052313846429], [31.305200636527978, 53.073995876673301], [31.49764, 53.167430000000124], [32.304519484188368, 53.132726141972839], [32.693643019346119, 53.351420803432141], [32.405598585751157, 53.618045355842], [31.731272820774585, 53.794029446012011], [31.791424187962399, 53.974638576872181], [31.384472283663818, 54.157056382862365], [30.757533807098774, 54.811770941784388], [30.971835971813245, 55.08154775656412], [30.873909132620064, 55.55097646750351], [29.896294386522435, 55.789463202530484], [29.371571893030783, 55.670090643936263], [29.229513380660389, 55.918344224666399], [28.176709425577933, 56.169129950578778], [27.855282016722519, 56.759326483784363], [27.770015903440985, 57.244258124411189], [27.288184848751648, 57.474528306703903], [27.716685825315771, 57.791899115624439], [27.420150000000202, 58.724570000000128], [28.131699253051856, 59.300825100330982], [27.98112, 59.47537], [29.1177, 60.028050000000107], [28.07, 60.503520000000137], [30.211107212044645, 61.780027777749673], [31.139991082491029, 62.357692776124431], [31.516092156711263, 62.867687486412898], [30.035872430142796, 63.552813625738551], [30.444684686003736, 64.204453436939062], [29.544429559047014, 64.948671576590542], [30.21765, 65.80598], [29.054588657352376, 66.944286200622017], [29.977426385220689, 67.69829702419274], [28.445943637818765, 68.364612942163987], [28.591929559043358, 69.064776923286686], [29.39955, 69.15692000000017], [31.101080000000103, 69.55811], [32.132720000000255, 69.905950000000232], [33.77547, 69.301420000000107], [36.51396, 69.06342], [40.292340000000159, 67.9324], [41.059870000000124, 67.457130000000106], [41.125950000000174, 66.79158000000011], [40.01583, 66.266180000000119], [38.38295, 65.99953], [33.918710000000168, 66.75961], [33.18444, 66.63253], [34.81477, 65.900150000000124], [34.87857425307876, 65.436212877048192], [34.943910000000152, 64.414370000000147], [36.23129, 64.10945], [37.012730000000111, 63.84983], [37.141970000000143, 64.33471], [36.539579035089801, 64.76446], [37.176040000000135, 65.143220000000113], [39.59345, 64.520790000000162], [40.4356, 64.76446], [39.762600000000148, 65.49682], [42.09309, 66.47623], [43.01604000000011, 66.41858], [43.94975000000013, 66.06908], [44.53226, 66.756340000000122], [43.69839, 67.35245], [44.187950000000136, 67.95051], [43.45282, 68.57079], [46.250000000000135, 68.25], [46.821340000000156, 67.68997], [45.55517, 67.56652], [45.56202, 67.010050000000192], [46.349150000000137, 66.66767], [47.894160000000248, 66.884550000000146], [48.13876, 67.52238], [50.227660000000142, 67.998670000000132], [53.717430000000164, 68.85738], [54.47171, 68.80815], [53.485820000000118, 68.20131], [54.72628, 68.09702], [55.442680000000124, 68.43866], [57.317020000000149, 68.46628], [58.802000000000206, 68.88082], [59.941420000000178, 68.27844], [61.077840000000165, 68.94069], [60.03, 69.52], [60.55, 69.85], [63.504000000000147, 69.54739], [64.888115, 69.234835000000132], [68.512160000000108, 68.09233000000016], [69.18068, 68.61563000000011], [68.16444, 69.14436], [68.13522, 69.35649], [66.930080000000103, 69.454610000000102], [67.25976, 69.92873], [66.724920000000125, 70.708890000000125], [66.69466, 71.028970000000228], [68.540060000000111, 71.934500000000227], [69.19636, 72.843360000000146], [69.94, 73.04000000000012], [72.58754, 72.77629], [72.79603, 72.22006], [71.84811, 71.40898], [72.47011, 71.09019], [72.79188, 70.39114], [72.564700000000201, 69.02085], [73.66787, 68.4079], [73.2387, 67.7404], [71.280000000000101, 66.320000000000149], [72.423010000000147, 66.172670000000167], [72.82077, 66.53267], [73.920990000000131, 66.789460000000119], [74.186510000000183, 67.28429], [75.052, 67.760470000000154], [74.469260000000148, 68.32899], [74.93584, 68.98918], [73.84236, 69.07146], [73.601870000000204, 69.62763], [74.3998, 70.63175], [73.1011, 71.447170000000241], [74.890820000000204, 72.12119], [74.65926, 72.83227], [75.158010000000175, 72.854970000000108], [75.68351, 72.300560000000118], [75.288980000000109, 71.33556], [76.35911, 71.152870000000135], [75.903130000000161, 71.87401], [77.5766500000001, 72.26717], [79.652020000000107, 72.32011], [81.5, 71.75], [80.61071, 72.582850000000107], [80.51109, 73.6482], [82.25, 73.85], [84.65526, 73.805910000000154], [86.822300000000226, 73.93688], [86.00956, 74.459670000000145], [87.166820000000143, 75.11643], [88.31571, 75.14393], [90.26, 75.64], [92.90058, 75.77333], [93.234210000000132, 76.0472], [95.860000000000127, 76.14], [96.67821, 75.91548], [98.922540000000197, 76.44689], [100.759670000000199, 76.43028], [101.03532, 76.86189], [101.990840000000105, 77.287540000000192], [104.3516, 77.69792], [106.066640000000135, 77.37389], [104.705000000000211, 77.1274], [106.970130000000111, 76.97419]]], [[[105.07547, 78.30689], [99.43814, 77.921], [101.2649, 79.23399], [102.08635, 79.34641], [102.837815, 79.28129], [105.37243, 78.71334], [105.07547, 78.30689]]], [[[51.136186557831266, 80.54728017854093], [49.793684523320692, 80.415427761548202], [48.894411248577526, 80.33956675894369], [48.75493655782175, 80.175468248200829], [47.586119012244147, 80.010181179515328], [46.502825962109647, 80.247246812654339], [47.072455275262897, 80.559424140129451], [44.846958042181107, 80.589809882317169], [46.799138624871226, 80.771917629713627], [48.31847741068465, 80.784009914869927], [48.52280602396668, 80.514568996900138], [49.097189568890897, 80.753985907708412], [50.039767693894603, 80.918885403151791], [51.522932977103679, 80.699725653801906], [51.136186557831266, 80.54728017854093]]], [[[99.93976, 78.88094], [97.75794, 78.7562], [94.97259, 79.044745], [93.31288, 79.4265], [92.5454, 80.14379], [91.18107, 80.34146], [93.77766, 81.0246], [95.940895, 81.2504], [97.88385, 80.746975], [100.186655, 79.780135], [99.93976, 78.88094]]]] } }, - { "type": "Feature", "properties": { "admin": "Rwanda", "name": "Rwanda", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.419104852019235, -1.134659112150416], [30.816134881317705, -1.698914076345388], [30.758308953583104, -2.287250257988368], [30.469696079232978, -2.413857517103458], [29.938359002407935, -2.348486830254238], [29.632176141078585, -2.917857761246096], [29.02492638521678, -2.839257907730157], [29.117478875451546, -2.292211195488384], [29.254834832483336, -2.215109958508911], [29.29188683443661, -1.620055840667987], [29.579466180140876, -1.341313164885626], [29.821518588996003, -1.443322442229785], [30.419104852019235, -1.134659112150416]]] } }, - { "type": "Feature", "properties": { "admin": "Western Sahara", "name": "W. Sahara", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-8.794883999049075, 27.120696316022503], [-8.81782833498667, 27.656425889592349], [-8.665589565454805, 27.656425889592349], [-8.66512447756419, 27.58947907155822], [-8.684399786809051, 27.395744126895998], [-8.687293667017398, 25.881056219988899], [-11.969418911171159, 25.933352769468261], [-11.93722449385332, 23.374594224536164], [-12.874221564169574, 23.284832261645171], [-13.118754441774708, 22.771220201096249], [-12.929101935263528, 21.327070624267559], [-16.845193650773989, 21.333323472574875], [-17.063423224342568, 20.99975210213082], [-17.020428432675736, 21.422310288981475], [-17.002961798561085, 21.420734157796574], [-14.750954555713532, 21.50060008390366], [-14.630832688851068, 21.860939846274899], [-14.221167771857251, 22.310163072188153], [-13.891110398809044, 23.691009019459297], [-12.500962693725368, 24.770116278578193], [-12.030758836301613, 26.030866197203036], [-11.718219773800353, 26.104091701760616], [-11.392554897496977, 26.883423977154358], [-10.551262579785272, 26.990807603456879], [-10.18942420087758, 26.860944729107398], [-9.735343390328877, 26.860944729107398], [-9.413037482124464, 27.088476060488514], [-8.794883999049075, 27.120696316022503]]] } }, - { "type": "Feature", "properties": { "admin": "Saudi Arabia", "name": "Saudi Arabia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[42.779332309750963, 16.34789134364868], [42.64957278826607, 16.77463532151496], [42.347989129410706, 17.075805568911996], [42.270887892431219, 17.474721787989122], [41.754381951673949, 17.833046169500971], [41.221391229015573, 18.671599636301206], [40.939341261566533, 19.486485297111752], [40.247652215339819, 20.174634507726488], [39.801684604660934, 20.338862209550054], [39.139399448408277, 21.29190481209293], [39.023695916506782, 21.986875311770191], [39.066328973147577, 22.579655666590263], [38.492772251140075, 23.688451036060851], [38.023860304523616, 24.078685614512928], [37.483634881344379, 24.285494696545008], [37.154817742671177, 24.858482977797301], [37.209491408035994, 25.084541530858104], [36.931627231602583, 25.602959499610172], [36.639603712721218, 25.826227525327219], [36.249136590323808, 26.570135606384873], [35.640181512196385, 27.376520494083415], [35.130186801907875, 28.063351955674712], [34.632336053207972, 28.058546047471559], [34.787778761541936, 28.607427273059692], [34.832220493312938, 28.957483425404838], [34.956037225084252, 29.356554673778835], [36.068940870922049, 29.19749461518445], [36.501214227043583, 29.505253607698702], [36.740527784987243, 29.865283311476183], [37.503581984209028, 30.003776150018396], [37.668119744626374, 30.338665269485894], [37.998848911294367, 30.508499864213128], [37.002165561681004, 31.508412990844736], [39.004885695152545, 32.010216986614971], [39.195468377444961, 32.16100881604266], [40.399994337736238, 31.889991766887931], [41.889980910007829, 31.190008653278362], [44.709498732284736, 29.178891099559376], [46.568713413281742, 29.099025173452283], [47.459821811722819, 29.002519436147217], [47.708850538937376, 28.526062730416136], [48.416094191283939, 28.552004299426663], [48.807594842327163, 27.689627997339876], [49.299554477745815, 27.461218166609804], [49.470913527225647, 27.109999294538078], [50.152422316290874, 26.689663194275994], [50.212935418504671, 26.277026882425371], [50.113303257045928, 25.943972276304248], [50.23985883972874, 25.608049628190923], [50.527386509000728, 25.327808335872099], [50.660556675016885, 24.999895534764018], [50.810108270069563, 24.754742539971371], [51.112415398977006, 24.556330878186721], [51.389607781790623, 24.627385972588051], [51.579518670463258, 24.245497137951102], [51.617707553926969, 24.014219265228824], [52.000733270074321, 23.001154486578937], [55.006803012924898, 22.496947536707129], [55.208341098863187, 22.708329982997039], [55.666659376859812, 22.000001125572336], [54.999981723862355, 19.999994004796104], [52.000009800022227, 19.000003363516054], [49.116671583864857, 18.616667588774941], [48.183343540241324, 18.166669216377311], [47.466694777217626, 17.116681626854877], [47.000004917189749, 16.949999294497438], [46.749994337761642, 17.283338120996174], [46.366658563020529, 17.233315334537632], [45.399999220568752, 17.333335069238554], [45.216651238797184, 17.43332896572333], [44.062613152855072, 17.410358791569589], [43.791518589051904, 17.319976711491105], [43.380794305196098, 17.579986680567668], [43.115797560403351, 17.088440456607369], [43.218375278502734, 16.666889960186406], [42.779332309750963, 16.34789134364868]]] } }, - { "type": "Feature", "properties": { "admin": "Sudan", "name": "Sudan", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.963392794971178, 9.464285229420623], [33.824963480907506, 9.48406084571536], [33.842130853028145, 9.981914637215992], [33.721959248183097, 10.325262079630191], [33.206938084561777, 10.720111638406591], [33.086766479716729, 11.441141267476493], [33.206938084561777, 12.179338268667093], [32.743419037302537, 12.24800775714999], [32.674749548819641, 12.024831919580716], [32.073891524594778, 11.973329803218517], [32.314234734284746, 11.681484477166519], [32.400071594888338, 11.080626452941486], [31.850715687025509, 10.531270545078822], [31.352861895524875, 9.810240916008693], [30.837840731903377, 9.707236683284519], [29.996639497988546, 10.290927335388684], [29.618957311332842, 10.084918869940223], [29.515953078608607, 9.793073543888053], [29.000931914987166, 9.604232450560287], [28.966597170745779, 9.398223985111654], [27.970889587744345, 9.398223985111654], [27.833550610778783, 9.604232450560287], [27.112520981708876, 9.638567194801622], [26.752006167173811, 9.466893473594492], [26.477328213242508, 9.552730334198086], [25.96230704962101, 10.136420986302422], [25.790633328413943, 10.411098940233726], [25.069603699343979, 10.27375996326799], [24.79492574541268, 9.810240916008693], [24.537415163602017, 8.917537565731719], [24.194067721187643, 8.728696472403895], [23.886979580860665, 8.619729712933063], [23.805813429466745, 8.666318874542522], [23.459012892355979, 8.954285793489019], [23.394779087017291, 9.26506785729225], [23.557249790142915, 9.681218166538766], [23.554304233502187, 10.089255275915319], [22.977543572692749, 10.714462591998538], [22.864165480244246, 11.142395127807616], [22.87622, 11.384610000000119], [22.50869, 11.67936], [22.49762, 12.26024], [22.28801, 12.64605], [21.93681, 12.588180000000133], [22.03759, 12.95546], [22.29658, 13.37232], [22.18329, 13.78648], [22.51202, 14.09318], [22.30351, 14.32682], [22.567950000000106, 14.944290000000134], [23.02459, 15.68072], [23.886890000000101, 15.61084], [23.837660000000135, 19.580470000000101], [23.850000000000129, 20.0], [25.00000000000011, 20.00304], [25.00000000000011, 22.0], [29.02, 22.0], [32.9, 22.0], [36.86623, 22.0], [37.18872, 21.01885], [36.96941, 20.837440000000125], [37.114700000000134, 19.80796], [37.48179, 18.61409], [37.86276, 18.36786], [38.410089959473218, 17.998307399970312], [37.904000000000103, 17.42754], [37.16747, 17.263140000000128], [36.852530000000108, 16.95655], [36.75389, 16.29186], [36.32322, 14.82249], [36.42951, 14.42211], [36.27022, 13.563330000000118], [35.86363, 12.57828], [35.26049, 12.08286], [34.831630000000125, 11.318960000000116], [34.73115000000012, 10.910170000000106], [34.25745, 10.63009], [33.96162, 9.58358], [33.963392794971178, 9.464285229420623]]] } }, - { "type": "Feature", "properties": { "admin": "South Sudan", "name": "S. Sudan", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.963392794971178, 9.464285229420623], [33.97498, 8.68456], [33.82550000000014, 8.37916], [33.294800000000116, 8.35458], [32.95418, 7.7849700000001], [33.56829, 7.71334], [34.0751, 7.22595], [34.25032, 6.82607], [34.70702, 6.59422000000012], [35.298007118233095, 5.506], [34.620196267853935, 4.847122742082034], [34.005, 4.249884947362147], [33.39, 3.79], [32.68642, 3.79232], [31.881450000000136, 3.55827], [31.24556, 3.7819], [30.83385, 3.50917], [29.95349, 4.1737], [29.715995314256013, 4.600804755060152], [29.159078403446635, 4.389267279473244], [28.696677687298795, 4.455077215996993], [28.428993768026992, 4.287154649264607], [27.979977247842946, 4.408413397637388], [27.374226108517625, 5.233944403500173], [27.213409051225248, 5.550953477394613], [26.465909458123289, 5.946717434101855], [26.213418409945113, 6.546603298362127], [25.796647983511257, 6.979315904158169], [25.124130893664805, 7.500085150579422], [25.114932488716867, 7.825104071479244], [24.567369012152191, 8.229187933785452], [23.886979580860665, 8.619729712933063], [24.194067721187643, 8.728696472403895], [24.537415163602017, 8.917537565731719], [24.79492574541268, 9.810240916008693], [25.069603699343979, 10.27375996326799], [25.790633328413943, 10.411098940233726], [25.96230704962101, 10.136420986302422], [26.477328213242508, 9.552730334198086], [26.752006167173811, 9.466893473594492], [27.112520981708876, 9.638567194801622], [27.833550610778783, 9.604232450560287], [27.970889587744345, 9.398223985111654], [28.966597170745779, 9.398223985111654], [29.000931914987166, 9.604232450560287], [29.515953078608607, 9.793073543888053], [29.618957311332842, 10.084918869940223], [29.996639497988546, 10.290927335388684], [30.837840731903377, 9.707236683284519], [31.352861895524875, 9.810240916008693], [31.850715687025509, 10.531270545078822], [32.400071594888338, 11.080626452941486], [32.314234734284746, 11.681484477166519], [32.073891524594778, 11.973329803218517], [32.674749548819641, 12.024831919580716], [32.743419037302537, 12.24800775714999], [33.206938084561777, 12.179338268667093], [33.086766479716729, 11.441141267476493], [33.206938084561777, 10.720111638406591], [33.721959248183097, 10.325262079630191], [33.842130853028145, 9.981914637215992], [33.824963480907506, 9.48406084571536], [33.963392794971178, 9.464285229420623]]] } }, - { "type": "Feature", "properties": { "admin": "Senegal", "name": "Senegal", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-16.713728807023468, 13.594958604379853], [-17.126106736712611, 14.373515733289221], [-17.625042690490655, 14.72954051356407], [-17.185172898822227, 14.91947724045286], [-16.700706346085919, 15.621527411354107], [-16.463098110407881, 16.135036119038457], [-16.120690070041928, 16.45566254319338], [-15.623666144258689, 16.369337063049809], [-15.135737270558813, 16.587282416240779], [-14.577347581428977, 16.598263658102805], [-14.099521450242175, 16.304302273010489], [-13.43573767745306, 16.039383042866188], [-12.830658331747513, 15.303691514542942], [-12.170750291380299, 14.616834214735503], [-12.124887457721256, 13.994727484589784], [-11.927716030311613, 13.422075100147392], [-11.553397793005427, 13.141213690641063], [-11.467899135778522, 12.754518947800973], [-11.513942836950587, 12.442987575729415], [-11.658300950557928, 12.386582749882834], [-12.20356482588563, 12.465647691289401], [-12.278599005573438, 12.354440008997285], [-12.499050665730561, 12.332089952031053], [-13.217818162478235, 12.575873521367964], [-13.700476040084322, 12.586182969610192], [-15.548476935274005, 12.628170070847343], [-15.816574266004251, 12.515567124883345], [-16.147716844130581, 12.547761542201185], [-16.67745195155457, 12.38485158940105], [-16.84152462408127, 13.151393947802557], [-15.931295945692208, 13.130284125211331], [-15.691000535534991, 13.270353094938455], [-15.511812506562931, 13.278569647672864], [-15.141163295949463, 13.509511623585235], [-14.712197231494626, 13.298206691943774], [-14.277701788784553, 13.28058502853224], [-13.844963344772404, 13.505041612191999], [-14.046992356817478, 13.794067898000446], [-14.376713833055785, 13.625680243377371], [-14.687030808968483, 13.63035696049978], [-15.081735398813816, 13.876491807505982], [-15.398770310924457, 13.860368760630916], [-15.624596320039936, 13.623587347869556], [-16.713728807023468, 13.594958604379853]]] } }, - { "type": "Feature", "properties": { "admin": "Solomon Islands", "name": "Solomon Is.", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[162.119024693040842, -10.482719008021133], [162.398645868172196, -10.826367282762119], [161.700032180018354, -10.820011081590222], [161.319796991214702, -10.204751478723123], [161.917383254237933, -10.446700534713653], [162.119024693040842, -10.482719008021133]]], [[[160.852228631837903, -9.872937106977002], [160.462588332357228, -9.89520964929484], [159.849447463214176, -9.794027194867367], [159.640002883135139, -9.639979750205269], [159.70294477766663, -9.242949720906777], [160.362956170898428, -9.400304457235533], [160.688517694337179, -9.610162448772808], [160.852228631837903, -9.872937106977002]]], [[[161.679981724289121, -9.599982191611373], [161.52939660059053, -9.784312025596433], [160.788253208660507, -8.917543226764918], [160.579997186524338, -8.320008640173965], [160.92002811100491, -8.320008640173965], [161.280006138349961, -9.120011488484449], [161.679981724289121, -9.599982191611373]]], [[[159.875027297198585, -8.337320244991714], [159.917401971677975, -8.538289890174864], [159.133677199539335, -8.114181410355398], [158.586113722974687, -7.754823500197713], [158.211149530264834, -7.421872246941147], [158.359977655265425, -7.320017998893915], [158.820001255527671, -7.56000335045739], [159.640002883135139, -8.020026950719567], [159.875027297198585, -8.337320244991714]]], [[[157.53842573468927, -7.347819919466928], [157.339419793933217, -7.404767347852554], [156.902030471014768, -7.176874281445391], [156.491357863591304, -6.765943291860394], [156.542827590153934, -6.599338474151478], [157.140000441718882, -7.021638278840653], [157.53842573468927, -7.347819919466928]]]] } }, - { "type": "Feature", "properties": { "admin": "Sierra Leone", "name": "Sierra Leone", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-11.438779466182053, 6.785916856305746], [-11.708194545935736, 6.860098374860724], [-12.428098924193815, 7.262942002792029], [-12.949049038128193, 7.798645738145736], [-13.124025437868479, 8.163946438016977], [-13.246550258832512, 8.903048610871506], [-12.711957566773076, 9.342711696810765], [-12.596719122762206, 9.620188300001969], [-12.425928514037562, 9.835834051955953], [-12.150338100625003, 9.858571682164378], [-11.917277390988655, 10.046983954300556], [-11.117481248407328, 10.045872911006283], [-10.839151984083299, 9.688246161330367], [-10.622395188835037, 9.267910061068276], [-10.65477047366589, 8.977178452994194], [-10.494315151399629, 8.715540676300433], [-10.505477260774667, 8.348896389189603], [-10.230093553091276, 8.406205552601291], [-10.695594855176477, 7.939464016141085], [-11.14670427086838, 7.396706447779534], [-11.199801805048278, 7.105845648624735], [-11.438779466182053, 6.785916856305746]]] } }, - { "type": "Feature", "properties": { "admin": "El Salvador", "name": "El Salvador", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-87.793111131526558, 13.384480495655051], [-87.904112108089507, 13.149016831917134], [-88.483301561216791, 13.163951320849488], [-88.843227912129692, 13.259733588102474], [-89.256742723329282, 13.4585328231293], [-89.812393561547637, 13.520622056527994], [-90.095554572290951, 13.73533763270073], [-90.064677903996568, 13.881969509328924], [-89.7219339668207, 14.134228013561694], [-89.5342193265205, 14.244815578666302], [-89.587342698916544, 14.362586167859485], [-89.353325975282772, 14.424132798719112], [-89.058511929057644, 14.340029405164085], [-88.843072882832814, 14.140506700085169], [-88.541230841815974, 13.980154730683475], [-88.50399797234968, 13.845485948130854], [-88.065342576840123, 13.964625962779774], [-87.859515347021585, 13.893312486216979], [-87.723502977229387, 13.785050360565503], [-87.793111131526558, 13.384480495655051]]] } }, - { "type": "Feature", "properties": { "admin": "Somaliland", "name": "Somaliland", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[48.938129510296491, 9.451748968946672], [48.486735874226994, 8.837626247589979], [47.78942, 8.003], [46.948328484897942, 7.996876532417386], [43.67875, 9.183580000000116], [43.296975132018744, 9.540477403191742], [42.92812, 10.021940000000139], [42.55876, 10.572580000000126], [42.776851841000948, 10.926878566934416], [43.145304803242126, 11.462039699748853], [43.470659620951658, 11.27770986576388], [43.666668328634834, 10.864169216348158], [44.117803582542805, 10.445538438351603], [44.614259067570849, 10.442205308468941], [45.556940545439133, 10.698029486529775], [46.645401238802997, 10.816549383991171], [47.525657586462778, 11.127228094929986], [48.021596307167769, 11.193063869669741], [48.378783807169263, 11.375481675660122], [48.948206414593457, 11.410621649618516], [48.942005242718423, 11.394266058798163], [48.938491245322595, 10.982327378783451], [48.938232863161076, 9.973500067581481], [48.938129510296491, 9.451748968946672]]] } }, - { "type": "Feature", "properties": { "admin": "Somalia", "name": "Somalia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[49.72862, 11.5789], [50.25878, 11.67957], [50.73202, 12.0219], [51.1112, 12.02464], [51.13387, 11.74815], [51.04153, 11.16651], [51.04531, 10.6409], [50.83418, 10.27972], [50.55239, 9.19874], [50.07092, 8.08173], [49.4527, 6.80466], [48.59455, 5.33911], [47.74079, 4.2194], [46.56476, 2.85529], [45.56399, 2.04576], [44.06815, 1.05283], [43.13597, 0.2922], [42.04157, -0.91916], [41.81095, -1.44647], [41.58513, -1.68325], [40.993, -0.85829], [40.98105, 2.78452], [41.855083092643966, 3.918911920483726], [42.12861, 4.23413], [42.76967, 4.25259], [43.66087, 4.95755], [44.9636, 5.00162], [47.78942, 8.003], [48.486735874226937, 8.837626247589993], [48.938129510296442, 9.451748968946616], [48.938232863161026, 9.973500067581508], [48.938491245322481, 10.982327378783465], [48.942005242718345, 11.394266058798136], [48.948204758509732, 11.410617281697961], [49.26776, 11.43033], [49.72862, 11.5789]]] } }, - { "type": "Feature", "properties": { "admin": "Republic of Serbia", "name": "Serbia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.874312778413408, 45.416375433934306], [21.483526238702204, 45.181170152357865], [21.562022739353718, 44.768947251965635], [22.145087924902892, 44.478422349620573], [22.459022251075961, 44.702517198254426], [22.705725538837434, 44.578002834647002], [22.47400841644065, 44.409227606781762], [22.657149692483067, 44.234923000661347], [22.410446404721593, 44.008063462900047], [22.500156691180219, 43.642814439460999], [22.986018507588479, 43.211161200527094], [22.604801466571352, 42.898518785161109], [22.43659467946139, 42.580321153323943], [22.545011834409642, 42.461362006188025], [22.380525750424674, 42.320259507815074], [21.917080000000105, 42.30364], [21.576635989402117, 42.245224397061847], [21.54332, 42.32025], [21.66292, 42.43922], [21.77505, 42.6827], [21.63302, 42.67717], [21.43866, 42.86255], [21.27421, 42.90959], [21.143395, 43.068685000000123], [20.95651, 43.13094], [20.81448, 43.27205], [20.63508, 43.21671], [20.49679, 42.88469], [20.25758, 42.81275], [20.3398, 42.89852], [19.95857, 43.10604], [19.63, 43.213779970270522], [19.48389, 43.35229], [19.21852, 43.52384], [19.454, 43.568100000000115], [19.59976, 44.03847], [19.11761, 44.42307], [19.36803, 44.863], [19.00548, 44.86023], [19.390475701584588, 45.236515611342369], [19.072768995854172, 45.521511135432078], [18.82982, 45.90888], [19.596044549241636, 46.171729844744547], [20.22019249846289, 46.127468980486569], [20.76217492033998, 45.734573065771478], [20.874312778413408, 45.416375433934306]]] } }, - { "type": "Feature", "properties": { "admin": "Suriname", "name": "Suriname", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.147436489476874, 5.973149929219161], [-55.949318406789786, 5.772877915872], [-55.841779751190408, 5.953125311706059], [-55.033250291551759, 6.025291449401662], [-53.958044603070888, 5.756548163267764], [-54.478632981979224, 4.896755682795585], [-54.3995422023565, 4.212611395683466], [-54.006930508018996, 3.620037746592558], [-54.181726040246261, 3.189779771330421], [-54.269705166223183, 2.732391669115046], [-54.524754197799709, 2.311848863123785], [-55.097587449755125, 2.523748073736612], [-55.569755011605984, 2.42150625244713], [-55.973322109589361, 2.510363877773016], [-56.073341844290283, 2.220794989425499], [-55.905600145070871, 2.021995754398659], [-55.995698004771739, 1.817667141116601], [-56.53938574891454, 1.89952260986692], [-57.150097825739898, 2.768926906745406], [-57.281433478409703, 3.333491929534119], [-57.601568976457848, 3.334654649260684], [-58.044694383360664, 4.060863552258382], [-57.860209520078691, 4.576801052260449], [-57.914288906472123, 4.812626451024413], [-57.307245856339492, 5.073566595882225], [-57.147436489476874, 5.973149929219161]]] } }, - { "type": "Feature", "properties": { "admin": "Slovakia", "name": "Slovakia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[18.85314415861361, 49.496229763377634], [18.909574822676316, 49.435845852244562], [19.320712517990469, 49.571574001659179], [19.825022820726865, 49.217125352569219], [20.415839471119849, 49.431453355499755], [20.887955356538406, 49.328772284535823], [21.607808058364206, 49.470107326854077], [22.558137648211751, 49.08573802346713], [22.280841912533553, 48.825392157580659], [22.085608351334848, 48.422264309271782], [21.872236362401729, 48.319970811550007], [20.801293979584919, 48.62385407164237], [20.473562045989862, 48.562850043321809], [20.239054396249344, 48.327567247096916], [19.769470656013109, 48.2026911484636], [19.66136355965849, 48.266614895208647], [19.174364861739885, 48.111378892603859], [18.777024773847668, 48.081768296900627], [18.696512892336923, 47.88095368101439], [17.857132602620023, 47.758428860050365], [17.488472934649813, 47.867466132186209], [16.979666782304033, 48.123497015976298], [16.879982944412998, 48.470013332709463], [16.960288120194573, 48.596982326850593], [17.101984897538895, 48.8169688991171], [17.545006951577101, 48.800019029325362], [17.886484816161808, 48.903475246773695], [17.913511590250462, 48.996492824899072], [18.104972771891848, 49.043983466175298], [18.170498488037961, 49.271514797556421], [18.399993523846174, 49.315000515330034], [18.554971144289478, 49.495015367218777], [18.85314415861361, 49.496229763377634]]] } }, - { "type": "Feature", "properties": { "admin": "Slovenia", "name": "Slovenia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[13.806475457421524, 46.509306138691201], [14.632471551174827, 46.431817328469535], [15.137091912504982, 46.658702704447016], [16.011663852612653, 46.683610744811688], [16.202298211337361, 46.852385972676949], [16.370504998447412, 46.841327216166498], [16.564808383864854, 46.503750922219822], [15.768732944408548, 46.238108222023442], [15.671529575267552, 45.834153550797865], [15.323953891672403, 45.731782538427673], [15.327674594797424, 45.452316392593218], [14.935243767972931, 45.471695054702671], [14.595109490627804, 45.6349409043127], [14.411968214585411, 45.466165676447446], [13.715059848697221, 45.500323798192369], [13.937630242578305, 45.591015936864608], [13.698109978905475, 46.016778062517339], [13.806475457421524, 46.509306138691201]]] } }, - { "type": "Feature", "properties": { "admin": "Sweden", "name": "Sweden", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.183173455501922, 65.723740546320158], [21.213516879977213, 65.02600535751526], [21.369631381930954, 64.413587958424273], [19.778875766690216, 63.609554348395022], [17.847779168375208, 62.749400132896803], [17.11955488451812, 61.341165676510954], [17.831346062906388, 60.636583360427394], [18.787721795332086, 60.081914374422581], [17.869224887776337, 58.95376618105869], [16.829185011470084, 58.719826972073385], [16.44770958829147, 57.041118069071871], [15.87978559740378, 56.104301866268649], [14.666681349352071, 56.20088511822216], [14.100721062891461, 55.407781073622637], [12.942910597392054, 55.361737372450563], [12.625100538797025, 56.307080186581956], [11.787942335668671, 57.441817125063061], [11.027368605196866, 58.856149400459344], [11.468271925511145, 59.432393296946024], [12.300365838274896, 60.117932847730025], [12.631146681375181, 61.293571682370121], [11.992064243221559, 61.800362453856543], [11.930569288794228, 63.128317572676963], [12.57993533697393, 64.066218980558318], [13.571916131248711, 64.049114081469696], [13.9199052263022, 64.445420640716065], [13.555689731509087, 64.7870276963815], [15.108411492582999, 66.19386688909546], [16.108712192456775, 67.302455552836875], [16.768878614985478, 68.013936672631388], [17.729181756265344, 68.010551866316263], [17.993868442464329, 68.567391262477344], [19.878559604581248, 68.407194322372561], [20.025268995857882, 69.065138658312691], [20.645592889089521, 69.106247260200846], [21.978534783626113, 68.616845608180682], [23.539473097434435, 67.936008612735236], [23.565879754335576, 66.396050930437411], [23.903378533633795, 66.006927395279604], [22.183173455501922, 65.723740546320158]]] } }, - { "type": "Feature", "properties": { "admin": "Swaziland", "name": "Swaziland", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[32.071665480281062, -26.733820082304902], [31.868060337051073, -27.17792734142127], [31.282773064913325, -27.285879408478991], [30.685961948374477, -26.743845310169526], [30.676608514129633, -26.398078301704604], [30.949666782359905, -26.022649021104144], [31.044079624157146, -25.731452325139436], [31.333157586397899, -25.660190525008943], [31.837777947728057, -25.843331801051342], [31.985779249811962, -26.29177988048022], [32.071665480281062, -26.733820082304902]]] } }, - { "type": "Feature", "properties": { "admin": "Syria", "name": "Syria", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[38.792340529136077, 33.378686428352218], [36.834062127435537, 32.312937526980768], [35.719918247222743, 32.709192409794859], [35.700797967274745, 32.716013698857374], [35.836396925608618, 32.868123277308506], [35.821100701650231, 33.277426459276292], [36.066460402172048, 33.824912421192543], [36.611750115715886, 34.201788641897174], [36.448194207512095, 34.59393524834406], [35.998402540843628, 34.644914048799997], [35.905023227692219, 35.410009467097318], [36.149762811026527, 35.821534735653664], [36.417550083163029, 36.040616970355053], [36.685389031731795, 36.259699205056457], [36.739494256341395, 36.817520453431079], [37.066761102045824, 36.623036200500614], [38.167727492024191, 36.901210435527766], [38.699891391765895, 36.712927354472335], [39.522580193852541, 36.716053778625984], [40.673259311695681, 37.091276353497285], [41.212089471203043, 37.074352321921687], [42.349591098811764, 37.22987254490409], [41.837064243340954, 36.605853786763568], [41.289707472505448, 36.358814602192261], [41.383965285005807, 35.628316555314349], [41.00615888851992, 34.419372260062111], [38.792340529136077, 33.378686428352218]]] } }, - { "type": "Feature", "properties": { "admin": "Chad", "name": "Chad", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[14.495787387762899, 12.859396267137353], [14.595781284247604, 13.330426947477859], [13.954476759505607, 13.353448798063765], [13.956698846094124, 13.996691189016925], [13.540393507550785, 14.36713369390122], [13.97217, 15.68437], [15.247731154041842, 16.627305813050778], [15.300441114979716, 17.927949937405], [15.68574059414777, 19.957180080642384], [15.90324669766431, 20.387618923417499], [15.487148064850143, 20.730414537025634], [15.47106, 21.04845], [15.096887648181847, 21.308518785074902], [14.8513, 22.862950000000119], [15.86085, 23.40972], [19.84926, 21.49509], [23.837660000000135, 19.580470000000101], [23.886890000000101, 15.61084], [23.02459, 15.68072], [22.567950000000106, 14.944290000000134], [22.30351, 14.32682], [22.51202, 14.09318], [22.18329, 13.78648], [22.29658, 13.37232], [22.03759, 12.95546], [21.93681, 12.588180000000133], [22.28801, 12.64605], [22.49762, 12.26024], [22.50869, 11.67936], [22.87622, 11.384610000000119], [22.864165480244246, 11.142395127807616], [22.231129184668756, 10.971888739460608], [21.723821648859538, 10.567055568885959], [21.000868361096305, 9.475985215691479], [20.059685499764267, 9.012706000194838], [19.094008009526071, 9.074846910025768], [18.81200971850927, 8.982914536978623], [18.911021762780589, 8.630894680206435], [18.389554884523303, 8.281303615751879], [17.964929640380884, 7.890914008002992], [16.705988396886365, 7.508327541529978], [16.4561845231874, 7.734773667832938], [16.290561557691884, 7.754307359239417], [16.106231723706738, 7.497087917506461], [15.279460483469164, 7.42192454673801], [15.436091749745737, 7.692812404811887], [15.120865512765302, 8.382150173369437], [14.979995558337688, 8.796104234243442], [14.544466586981851, 8.965861314322238], [13.954218377344088, 9.549494940626685], [14.17146609869911, 10.021378282100043], [14.627200555081057, 9.920919297724591], [14.909353875394796, 9.992129421422758], [15.46787275560524, 9.982336737503543], [14.923564894275042, 10.891325181517514], [14.960151808337679, 11.555574042197234], [14.89336, 12.21905], [14.495787387762899, 12.859396267137353]]] } }, - { "type": "Feature", "properties": { "admin": "Togo", "name": "Togo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[1.865240512712318, 6.14215770102973], [1.060121697604927, 5.928837388528875], [0.836931186536333, 6.279978745952147], [0.570384148774849, 6.914358628767188], [0.490957472342245, 7.411744289576474], [0.712029249686878, 8.312464504423827], [0.461191847342121, 8.677222601756013], [0.365900506195885, 9.46500397382948], [0.367579990245389, 10.191212876827176], [-0.049784715159944, 10.706917832883928], [0.023802524423701, 11.018681748900802], [0.899563022474069, 10.997339382364258], [0.772335646171484, 10.470808213742357], [1.077795037448737, 10.175606594275022], [1.425060662450136, 9.825395412632998], [1.46304284018467, 9.334624335157086], [1.664477573258381, 9.128590399609378], [1.618950636409238, 6.832038072126236], [1.865240512712318, 6.14215770102973]]] } }, - { "type": "Feature", "properties": { "admin": "Thailand", "name": "Thailand", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[102.58493248902667, 12.186594956913279], [101.687157830819928, 12.645740057826568], [100.831809523524839, 12.627084865769204], [100.978467238369191, 13.412721665902563], [100.097797479251099, 13.406856390837429], [100.018732537844528, 12.307001044153353], [99.478920526123602, 10.846366685423545], [99.153772414143134, 9.963061428258554], [99.222398716226749, 9.239255479362425], [99.873831821698118, 9.207862046745118], [100.279646844486194, 8.29515289960605], [100.45927412313273, 7.429572658717175], [101.017327915452697, 6.856868597842476], [101.623079054778032, 6.740622463401918], [102.141186964936367, 6.221636053894626], [101.81428185425797, 5.810808417174242], [101.154218784593837, 5.691384182147713], [101.075515578213327, 6.20486705161592], [100.259596388756933, 6.642824815289542], [100.085756870527092, 6.46448944745029], [99.690690545655727, 6.848212795433595], [99.519641554769606, 7.343453884302759], [98.988252801512289, 7.907993068875325], [98.503786248775967, 8.382305202666286], [98.339661899816988, 7.794511623562384], [98.150009393305808, 8.350007432483876], [98.259150018306229, 8.973922837759799], [98.553550653073017, 9.932959906448543], [99.038120558673953, 10.960545762572435], [99.587286004639694, 11.892762762901695], [99.196353794351637, 12.804748439988666], [99.212011753336071, 13.269293728076462], [99.097755161538728, 13.827502549693275], [98.430819126379859, 14.622027696180831], [98.192074009191373, 15.123702500870349], [98.537375929765687, 15.308497422746081], [98.90334842325673, 16.177824204976115], [98.493761020911322, 16.837835598207928], [97.859122755934848, 17.567946071843657], [97.375896437573516, 18.445437730375811], [97.797782830804394, 18.627080389881751], [98.253723992915582, 19.708203029860041], [98.959675734454848, 19.752980658440944], [99.543309360759281, 20.186597601802056], [100.115987583417819, 20.41784963630818], [100.548881056726856, 20.109237982661124], [100.606293573003128, 19.508344427971217], [101.282014601651667, 19.462584947176762], [101.035931431077742, 18.408928330961611], [101.059547560635139, 17.512497259994486], [102.113591750092453, 18.109101670804161], [102.413004998791592, 17.932781683824281], [102.998705682387694, 17.961694647691598], [103.200192091893726, 18.309632066312769], [103.956476678485288, 18.240954087796872], [104.716947056092465, 17.428858954330078], [104.779320509868768, 16.441864935771445], [105.589038527450128, 15.570316066952856], [105.544338413517664, 14.723933620660414], [105.218776890078871, 14.27321177821069], [104.281418084736586, 14.416743068901363], [102.988422072361601, 14.225721136934464], [102.348099399833004, 13.39424734135822], [102.58493248902667, 12.186594956913279]]] } }, - { "type": "Feature", "properties": { "admin": "Tajikistan", "name": "Tajikistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[71.014198032520156, 40.244365546218226], [70.648018833299957, 39.935753892571157], [69.559609816368507, 40.103211371412968], [69.464886915977516, 39.526683254548693], [70.549161818325601, 39.604197902986492], [71.784693637991992, 39.279463202464363], [73.67537926625478, 39.431236884105594], [73.928852166646408, 38.505815334622724], [74.257514276022718, 38.606506862943441], [74.864815708316812, 38.378846340481587], [74.829985792952087, 37.990007025701388], [74.980002475895404, 37.419990139305888], [73.948695916646486, 37.421566270490786], [73.260055779924983, 37.495256862938994], [72.636889682917271, 37.047558091778349], [72.193040805962383, 36.94828766534566], [71.84463829945058, 36.738171291646914], [71.448693475230229, 37.065644843080513], [71.541917759084768, 37.905774441065631], [71.239403924448155, 37.953265082341879], [71.348131137990251, 38.258905341132156], [70.806820509732873, 38.486281643216408], [70.376304152309274, 38.138395901027515], [70.270574171840124, 37.73516469985401], [70.116578403610319, 37.588222764632086], [69.518785434857946, 37.608996690413413], [69.196272820924364, 37.15114350030742], [68.859445835245921, 37.344335842430588], [68.135562371701369, 37.023115139304302], [67.829999627559502, 37.144994004864678], [68.392032505165943, 38.157025254868728], [68.176025018185911, 38.901553453113898], [67.442219679641298, 39.140143541005479], [67.701428664017342, 39.580478420564518], [68.536416456989414, 39.533452867178923], [69.011632928345477, 40.086158148756653], [69.329494663372813, 40.727824408524839], [70.666622348925031, 40.960213324541407], [70.458159621059608, 40.49649485937028], [70.601406691372674, 40.218527330072284], [71.014198032520156, 40.244365546218226]]] } }, - { "type": "Feature", "properties": { "admin": "Turkmenistan", "name": "Turkmenistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[61.21081709172573, 35.650072333309218], [61.123070509694131, 36.491597194966239], [60.377637973883864, 36.52738312432836], [59.234761997316795, 37.412987982730336], [58.436154412678192, 37.522309475243794], [57.330433790928964, 38.029229437810933], [56.619366082592805, 38.121394354803478], [56.180374790273319, 37.935126654607423], [55.511578403551894, 37.964117133123153], [54.800303989486558, 37.392420762678178], [53.921597934795543, 37.198918361961255], [53.735511102112504, 37.906136176091685], [53.880928582581831, 38.952093003895349], [53.101027866432894, 39.290573635407121], [53.357808058491216, 39.975286363274442], [52.693972609269807, 40.033629055331964], [52.91525109234361, 40.87652334244472], [53.85813927594112, 40.631034450842165], [54.736845330632136, 40.951014919593455], [54.0083109881813, 41.551210842447404], [53.721713494690576, 42.123191433270016], [52.916749708880069, 41.868116563477322], [52.81468875510361, 41.135370591794704], [52.502459751196135, 41.783315538086356], [52.94429324729164, 42.116034247397586], [54.079417759014937, 42.324109402020817], [54.755345493392625, 42.04397146256656], [55.455251092353755, 41.259859117185826], [55.968191359282898, 41.308641669269356], [57.096391229079089, 41.32231008561056], [56.93221520368779, 41.82602610937559], [57.786529982337065, 42.170552883465511], [58.629010857991453, 42.751551011723045], [59.976422153569771, 42.223081976890199], [60.083340691981654, 41.425146185871391], [60.46595299667068, 41.22032664648254], [61.547178989513547, 41.2663703476546], [61.882714064384679, 41.084856879229392], [62.374260288344992, 40.053886216790382], [63.518014764261018, 39.363256537425627], [64.170223016216752, 38.892406724598231], [65.215998976507379, 38.402695013984292], [66.546150343700205, 37.974684963526855], [66.518606805288655, 37.362784328758785], [66.217384881459324, 37.393790188133913], [65.745630731066811, 37.661164048812061], [65.588947788357828, 37.305216783185628], [64.746105177677393, 37.111817735333297], [64.546479119733888, 36.31207326918426], [63.982895949158696, 36.007957465146596], [63.193538445900337, 35.857165635718907], [62.984662306576588, 35.404040839167614], [62.230651483005879, 35.270663967422287], [61.21081709172573, 35.650072333309218]]] } }, - { "type": "Feature", "properties": { "admin": "East Timor", "name": "Timor-Leste", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[124.96868248911619, -8.892790215697081], [125.086246372580248, -8.656887302284678], [125.947072381698234, -8.432094821815033], [126.64470421763852, -8.39824675866385], [126.957243280139792, -8.273344821814396], [127.335928175974615, -8.397316582882601], [126.967991978056517, -8.668256117388891], [125.925885044458568, -9.106007175333351], [125.088520135601073, -9.393173109579292], [125.070019972840583, -9.08998748132287], [124.96868248911619, -8.892790215697081]]] } }, - { "type": "Feature", "properties": { "admin": "Trinidad and Tobago", "name": "Trinidad and Tobago", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-61.68, 10.76], [-61.105, 10.89], [-60.895, 10.855], [-60.935, 10.11], [-61.77, 10.0], [-61.95, 10.09], [-61.66, 10.365], [-61.68, 10.76]]] } }, - { "type": "Feature", "properties": { "admin": "Tunisia", "name": "Tunisia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[9.482139926805273, 30.307556057246181], [9.055602654668148, 32.102691962201284], [8.439102817426116, 32.506284898400814], [8.430472853233367, 32.748337307255944], [7.612641635782181, 33.344114895148955], [7.524481642292242, 34.097376410451453], [8.140981479534302, 34.655145982393783], [8.376367628623766, 35.479876003555937], [8.217824334352313, 36.433176988260271], [8.420964389691674, 36.946427313783154], [9.509993523810605, 37.349994411766531], [10.210002475636315, 37.230001735984807], [10.180650262094529, 36.724037787415071], [11.028867221733348, 37.09210317641395], [11.100025668999249, 36.899996039368908], [10.600004510143092, 36.410000108377368], [10.593286573945134, 35.947444362932806], [10.939518670300686, 35.698984076473486], [10.807847120821007, 34.833507188449182], [10.149592726287123, 34.330773016897702], [10.339658644256613, 33.785741685515312], [10.856836378633684, 33.768740139291275], [11.108500603895118, 33.293342800422188], [11.488787469131008, 33.136995754523134], [11.432253452203692, 32.368903103152867], [10.944789666394453, 32.081814683555358], [10.636901482799484, 31.761420803345747], [9.950225050505081, 31.376069647745251], [10.056575148161752, 30.961831366493595], [9.97001712407285, 30.539324856075236], [9.482139926805273, 30.307556057246181]]] } }, - { "type": "Feature", "properties": { "admin": "Turkey", "name": "Turkey", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[36.913127068842151, 41.335358384764291], [38.347664829264502, 40.948586127275711], [39.512606642420238, 41.102762763018561], [40.373432651538245, 41.013672593747337], [41.554084100110707, 41.535656236327604], [42.619548781104548, 41.58317271581992], [43.582745802592704, 41.09214325618256], [43.752657911968491, 40.740200914058811], [43.656436395040963, 40.253563951166157], [44.400008579288759, 40.005000311842302], [44.79398969908199, 39.713002631177027], [44.109225294782355, 39.428136298168049], [44.421402622257595, 38.281281236314513], [44.225755649600522, 37.971584377589345], [44.772699008977739, 37.170444647768441], [44.293451775902852, 37.001514390606353], [43.942258742047343, 37.256227525372928], [42.77912560402185, 37.385263576805798], [42.349591098811764, 37.229872544904104], [41.212089471203015, 37.074352321921729], [40.673259311695702, 37.091276353497356], [39.522580193852512, 36.716053778626012], [38.699891391765917, 36.712927354472313], [38.167727492024156, 36.90121043552778], [37.066761102045824, 36.623036200500614], [36.739494256341366, 36.817520453431108], [36.685389031731816, 36.259699205056499], [36.417550083163086, 36.040616970355096], [36.149762811026584, 35.821534735653664], [35.782084995269848, 36.274995429014915], [36.160821567537049, 36.650605577128367], [35.550936313628334, 36.565442816711325], [34.714553256984367, 36.795532131490909], [34.026894972476455, 36.219960028623966], [32.509158156064096, 36.107563788389193], [31.69959516777956, 36.644275214172602], [30.621624790171062, 36.677864895162308], [30.391096225717114, 36.262980658506983], [29.69997562024556, 36.144357408181001], [28.732902866335387, 36.676831366516431], [27.641186557737363, 36.658822129862749], [27.048767937943289, 37.653360907536005], [26.318218214633042, 38.208133246405382], [26.804700148228726, 38.985760199533551], [26.170785353304375, 39.463612168936457], [27.280019972449388, 40.420013739578302], [28.819977654747209, 40.460011298172212], [29.240003696415574, 41.219990749672682], [31.145933872204434, 41.087621568357058], [32.347979363745786, 41.736264146484629], [33.513282911927512, 42.018960069337304], [35.167703891751863, 42.040224921225438], [36.913127068842151, 41.335358384764291]]], [[[27.192376743282406, 40.690565700842448], [26.358009067497782, 40.151993923496477], [26.043351271272535, 40.617753607743161], [26.056942172965332, 40.824123440100735], [26.294602085075692, 40.936261298174166], [26.604195590936282, 41.562114569661013], [26.117041863720825, 41.826904608724554], [27.135739373490505, 42.141484890301307], [27.996720411905407, 42.007358710287768], [28.115524529744441, 41.622886054036279], [28.988442824018779, 41.299934190428175], [28.806438429486743, 41.05496206314853], [27.619017368284112, 40.999823309893102], [27.192376743282406, 40.690565700842448]]]] } }, - { "type": "Feature", "properties": { "admin": "Taiwan", "name": "Taiwan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[121.777817824389899, 24.394273586519393], [121.175632358892713, 22.790857245367164], [120.747079705896198, 21.970571397382106], [120.220083449383651, 22.814860948166732], [120.106188592612369, 23.556262722258229], [120.694679803552233, 24.53845083261373], [121.49504438688875, 25.295458889257379], [121.951243931161429, 24.997595933527034], [121.777817824389899, 24.394273586519393]]] } }, - { "type": "Feature", "properties": { "admin": "United Republic of Tanzania", "name": "Tanzania", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.903711197104592, -0.95], [34.07262, -1.05982], [37.69869, -3.09699], [37.7669, -3.67712], [39.20222, -4.67677], [38.74054, -5.90895], [38.79977, -6.47566], [39.44, -6.84], [39.470000000000134, -7.1], [39.19469, -7.7039], [39.25203, -8.00781], [39.18652, -8.48551], [39.53574, -9.112369999999883], [39.9496, -10.0984], [40.31659, -10.317099999999867], [39.521, -10.89688], [38.427556593587767, -11.285202325081626], [37.82764, -11.26879], [37.47129, -11.56876], [36.775150994622884, -11.59453744878078], [36.514081658684397, -11.720938002166745], [35.312397902169145, -11.439146416879165], [34.559989047999451, -11.520020033415845], [34.28, -10.16], [33.940837724096518, -9.693673841980283], [33.73972, -9.41715], [32.759375441221373, -9.230599053589001], [32.191864861791935, -8.930358981973255], [31.556348097466628, -8.762048841998647], [31.157751336950064, -8.594578747317312], [30.74, -8.34], [30.2, -7.08], [29.62, -6.52], [29.419992710088305, -5.939998874539297], [29.519986606573063, -5.419978936386257], [29.339997592900367, -4.499983412294113], [29.753512404099858, -4.452389418153301], [30.11632, -4.09012], [30.50554, -3.56858], [30.75224, -3.35931], [30.74301, -3.03431], [30.52766, -2.80762], [30.46967, -2.41383], [30.758308953583132, -2.287250257988375], [30.816134881317844, -1.698914076345374], [30.419104852019291, -1.134659112150416], [30.769860000000101, -1.01455], [31.86617, -1.02736], [33.903711197104592, -0.95]]] } }, - { "type": "Feature", "properties": { "admin": "Uganda", "name": "Uganda", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.86617, -1.02736], [30.769860000000101, -1.01455], [30.419104852019291, -1.134659112150416], [29.821518588996121, -1.443322442229771], [29.579466180141019, -1.341313164885605], [29.587837762172164, -0.587405694179381], [29.8195, -0.2053], [29.875778842902431, 0.597379868976361], [30.086153598762785, 1.062312730306416], [30.468507521290285, 1.583805446779706], [30.852670118948133, 1.849396470543752], [31.174149204235952, 2.204465236821306], [30.77332, 2.339890000000139], [30.83385, 3.50917], [31.24556, 3.7819], [31.88145, 3.55827], [32.68642, 3.79232], [33.39, 3.79], [34.005, 4.249884947362147], [34.47913, 3.5556], [34.59607, 3.053740000000118], [35.03599, 1.90584], [34.6721, 1.17694], [34.18, 0.515], [33.893568969666994, 0.109813537861839], [33.903711197104592, -0.95], [31.86617, -1.02736]]] } }, - { "type": "Feature", "properties": { "admin": "Ukraine", "name": "Ukraine", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[31.78599816257158, 52.10167796488544], [32.159412062312661, 52.061266994833204], [32.412058139787625, 52.288694973349735], [32.715760532366964, 52.238465481162038], [33.7526998227357, 52.335074571331681], [34.391730584457001, 51.768881740925778], [34.141978387190385, 51.566413479206226], [34.22481570815426, 51.255993150428942], [35.022183058417873, 51.207572333371445], [35.377923618315116, 50.773955390010343], [35.35611616388794, 50.577197374059054], [36.62616784032533, 50.225590928745127], [37.393459506995065, 50.383953355503586], [38.01063113785689, 49.915661526074622], [38.59498823421341, 49.926461900423618], [40.069058465339097, 49.601055406281688], [40.080789015469342, 49.307429917999272], [39.674663934087526, 48.783818467801872], [39.895632358567575, 48.232405097031425], [39.738277622238819, 47.898937079451983], [38.770584751141186, 47.825608222029807], [38.255112339029743, 47.546400458356807], [38.223538038899413, 47.102189846375872], [37.42513715998998, 47.022220567404197], [36.759854770664383, 46.698700263040919], [35.823684523264816, 46.645964463887054], [34.962341749823871, 46.273196519549636], [35.020787794745978, 45.65121898048465], [35.51000857925316, 45.409993394546177], [36.529997999830151, 45.46998973243705], [36.334712762199146, 45.113215643893952], [35.239999220528112, 44.939996242851599], [33.882511020652878, 44.361478583344066], [33.326420932760037, 44.564877020844875], [33.546924269349446, 45.034770819674883], [32.454174432105496, 45.327466132176063], [32.630804477679128, 45.519185695978905], [33.588162062318382, 45.851568508480227], [33.298567335754704, 46.08059845639783], [31.744140252415171, 46.333347886737378], [31.675307244602401, 46.706245022155528], [30.748748813609094, 46.583100084003995], [30.37760867688888, 46.032410183285663], [29.603289015427425, 45.293308010431119], [29.149724969201646, 45.464925442072442], [28.679779493939371, 45.30403087013169], [28.233553501099035, 45.488283189468369], [28.48526940279276, 45.596907050145887], [28.659987420371575, 45.939986884131628], [28.933717482221621, 46.258830471372491], [28.862972446414055, 46.437889309263824], [29.072106967899288, 46.517677720722482], [29.170653924279879, 46.379262396828693], [29.759971958136383, 46.349987697935354], [30.024658644335364, 46.423936672545032], [29.838210076626289, 46.525325832701675], [29.908851759569295, 46.67436066343145], [29.559674106573105, 46.928582872091312], [29.415135125452732, 47.346645209332571], [29.050867954227321, 47.510226955752493], [29.122698195113024, 47.849095160506458], [28.670891147585163, 48.118148505234089], [28.259546746541837, 48.155562242213406], [27.52253746919515, 48.467119452501102], [26.857823520624798, 48.368210761094488], [26.619336785597788, 48.220726223333457], [26.197450392366925, 48.220881252630342], [25.945941196402394, 47.987148749374207], [25.207743361112986, 47.891056423527459], [24.866317172960571, 47.737525743188307], [24.402056105250374, 47.981877753280422], [23.760958286237404, 47.985598456405448], [23.142236362406798, 48.096341050806942], [22.710531447040488, 47.882193915389394], [22.640819939878746, 48.150239569687351], [22.085608351334848, 48.422264309271782], [22.280841912533553, 48.825392157580659], [22.558137648211751, 49.08573802346713], [22.776418898212619, 49.027395331409608], [22.518450148211596, 49.476773586619736], [23.426508416444388, 50.308505764357449], [23.922757195743259, 50.424881089878738], [24.029985792748899, 50.705406602575174], [23.52707075368437, 51.578454087930233], [24.005077752384206, 51.617443956094448], [24.553106316839511, 51.888461005249177], [25.327787713327005, 51.910656032918538], [26.337958611768549, 51.832288723347915], [27.454066196408426, 51.59230337178446], [28.241615024536564, 51.572227077839059], [28.617612745892242, 51.427713934934836], [28.992835320763522, 51.602044379271462], [29.254938185347921, 51.368234361366881], [30.157363722460889, 51.416138414101454], [30.55511722181145, 51.319503485715643], [30.619454380014837, 51.822806098022362], [30.927549269338975, 52.042353420614383], [31.78599816257158, 52.10167796488544]]] } }, - { "type": "Feature", "properties": { "admin": "Uruguay", "name": "Uruguay", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.625133429582945, -30.216294854454258], [-56.976025763564721, -30.109686374636119], [-55.97324459494093, -30.883075860316296], [-55.601510179249331, -30.853878676071385], [-54.572451544805105, -31.494511407193745], [-53.787951626182185, -32.047242526987617], [-53.209588995971529, -32.727666110974717], [-53.650543992718084, -33.202004082981823], [-53.373661668498229, -33.768377780900757], [-53.806425950726521, -34.396814874002224], [-54.935866054897716, -34.952646579733617], [-55.674089728403274, -34.752658786764066], [-56.215297003796053, -34.85983570733741], [-57.139685024633096, -34.430456231424238], [-57.817860683815489, -34.462547295877492], [-58.427074144104381, -33.909454441057569], [-58.349611172098854, -33.2631889788154], [-58.132647671121433, -33.040566908502008], [-58.142440355040748, -32.044503676076147], [-57.874937303281875, -31.016556084926201], [-57.625133429582945, -30.216294854454258]]] } }, - { "type": "Feature", "properties": { "admin": "United States of America", "name": "United States", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-155.54211, 19.08348], [-155.68817, 18.91619], [-155.93665, 19.05939], [-155.90806, 19.33888], [-156.07347, 19.70294], [-156.02368, 19.81422], [-155.85008, 19.97729], [-155.91907, 20.17395], [-155.86108, 20.26721], [-155.78505, 20.2487], [-155.40214, 20.07975], [-155.22452, 19.99302], [-155.06226, 19.8591], [-154.80741, 19.50871], [-154.83147, 19.45328], [-155.222169999999892, 19.23972], [-155.54211, 19.08348]]], [[[-156.07926, 20.64397], [-156.41445, 20.57241], [-156.58673, 20.783], [-156.70167, 20.8643], [-156.71055, 20.92676], [-156.61258, 21.01249], [-156.25711, 20.91745], [-155.99566, 20.76404], [-156.07926, 20.64397]]], [[[-156.75824, 21.17684], [-156.78933, 21.06873], [-157.32521, 21.09777], [-157.25027, 21.21958], [-156.75824, 21.17684]]], [[[-157.65283, 21.32217], [-157.70703, 21.26442], [-157.7786, 21.27729], [-158.12667, 21.31244], [-158.2538, 21.53919], [-158.29265, 21.57912], [-158.0252, 21.71696], [-157.94161, 21.65272], [-157.65283, 21.32217]]], [[[-159.34512, 21.982], [-159.46372, 21.88299], [-159.80051, 22.06533], [-159.74877, 22.1382], [-159.5962, 22.23618], [-159.36569, 22.21494], [-159.34512, 21.982]]], [[[-94.81758, 49.38905], [-94.639999999999858, 48.840000000000103], [-94.32914, 48.67074], [-93.63087, 48.60926], [-92.61, 48.45], [-91.64, 48.14], [-90.829999999999856, 48.27], [-89.6, 48.01], [-89.272917446636654, 48.019808254582834], [-88.378114183286513, 48.302917588893806], [-87.439792623300207, 47.94], [-86.461990831228135, 47.553338019392037], [-85.652363247403215, 47.220218817730498], [-84.876079881514855, 46.900083319682366], [-84.779238247399817, 46.637101955749117], [-84.54374874544564, 46.538684190449224], [-84.6049, 46.4396], [-84.3367, 46.408770000000104], [-84.142119513673279, 46.512225857115723], [-84.091851264161463, 46.275418606138253], [-83.890765347005654, 46.116926988299149], [-83.616130947590491, 46.116926988299149], [-83.469550747394621, 45.994686387712584], [-83.592850714843067, 45.816893622412543], [-82.550924648758169, 45.347516587905446], [-82.337763125431053, 44.44], [-82.137642381503952, 43.571087551439987], [-82.43, 42.98], [-82.899999999999878, 42.430000000000135], [-83.119999999999877, 42.08], [-83.141999681312555, 41.975681057292995], [-83.029810146806909, 41.832795722005997], [-82.690089280920162, 41.675105088867319], [-82.439277716791608, 41.675105088867319], [-81.277746548167059, 42.209025987306845], [-80.247447679347843, 42.36619985612267], [-78.939362148743683, 42.863611355148116], [-78.92, 42.965], [-79.009999999999863, 43.27], [-79.171673550111862, 43.466339423184301], [-78.720279914042365, 43.625089423184953], [-77.737885097957601, 43.629055589363382], [-76.820034145805565, 43.628784288093748], [-76.5, 44.018458893758599], [-76.375, 44.09631], [-75.31821, 44.81645000000016], [-74.867, 45.00048000000011], [-73.347829999999874, 45.00738], [-71.505059999999858, 45.0082], [-71.405, 45.255000000000123], [-71.08482, 45.305240000000154], [-70.659999999999783, 45.46], [-70.305, 45.915], [-69.99997, 46.69307], [-69.237216, 47.447781], [-68.905, 47.185], [-68.23444, 47.35486], [-67.79046, 47.06636], [-67.79134, 45.702810000000134], [-67.13741, 45.13753], [-66.96466, 44.809700000000149], [-68.03252, 44.3252], [-69.059999999999874, 43.98], [-70.116169999999897, 43.684050000000141], [-70.645475633410967, 43.090238348964043], [-70.81489, 42.8653], [-70.825, 42.335], [-70.494999999999891, 41.805], [-70.08, 41.78], [-70.185, 42.145], [-69.88497, 41.922830000000111], [-69.96503, 41.637170000000161], [-70.64, 41.475], [-71.12039, 41.494450000000164], [-71.859999999999829, 41.32], [-72.295, 41.27], [-72.87643, 41.22065], [-73.71, 40.931102351654481], [-72.24126, 41.119480000000138], [-71.944999999999808, 40.93], [-73.345, 40.63], [-73.982, 40.628], [-73.952325, 40.75075], [-74.25671, 40.47351], [-73.96244, 40.42763], [-74.17838, 39.70926], [-74.90604, 38.93954], [-74.98041, 39.1964], [-75.20002, 39.24845], [-75.52805, 39.4985], [-75.32, 38.96], [-75.071834764789784, 38.782032230179276], [-75.05673, 38.404120000000106], [-75.37747, 38.01551], [-75.94023, 37.21689], [-76.03127, 37.2566], [-75.722049999999783, 37.937050000000106], [-76.23287, 38.319215], [-76.35, 39.15], [-76.542725, 38.717615], [-76.32933, 38.08326], [-76.98999793161353, 38.239991766913384], [-76.301619999999886, 37.917945], [-76.25874, 36.9664000000001], [-75.9718, 36.89726], [-75.868039999999809, 36.55125], [-75.72749, 35.550740000000125], [-76.36318, 34.808540000000129], [-77.39763499999988, 34.51201], [-78.05496, 33.92547], [-78.554349999999815, 33.861330000000116], [-79.06067, 33.49395], [-79.20357, 33.15839], [-80.301325, 32.509355], [-80.86498, 32.0333], [-81.33629, 31.44049], [-81.49042, 30.729990000000122], [-81.31371, 30.03552], [-80.98, 29.18000000000011], [-80.53558499999987, 28.47213], [-80.529999999999774, 28.04], [-80.056539284977532, 26.88000000000013], [-80.088015, 26.205765], [-80.131559999999837, 25.816775], [-80.38103, 25.20616], [-80.679999999999879, 25.08], [-81.17213, 25.201260000000126], [-81.33, 25.64], [-81.709999999999795, 25.87], [-82.239999999999895, 26.730000000000125], [-82.70515, 27.49504], [-82.85526, 27.88624], [-82.65, 28.550000000000146], [-82.929999999999865, 29.100000000000129], [-83.70959, 29.93656], [-84.1, 30.090000000000114], [-85.10882, 29.63615], [-85.28784, 29.686120000000127], [-85.7731, 30.152610000000116], [-86.399999999999878, 30.400000000000112], [-87.530359999999831, 30.27433], [-88.41782, 30.3849], [-89.180489999999836, 30.31598], [-89.593831178419748, 30.159994004836843], [-89.413735, 29.89419], [-89.43, 29.48864], [-89.21767, 29.29108], [-89.40823, 29.15961], [-89.77928, 29.307140000000135], [-90.15463, 29.11743], [-90.880224999999896, 29.148535000000116], [-91.626784999999842, 29.677000000000127], [-92.49906, 29.5523], [-93.22637, 29.78375], [-93.84842, 29.71363], [-94.69, 29.480000000000125], [-95.60026, 28.73863], [-96.59404, 28.30748], [-97.139999999999802, 27.83], [-97.37, 27.38], [-97.379999999999853, 26.69], [-97.33, 26.210000000000115], [-97.139999999999802, 25.87], [-97.529999999999859, 25.84], [-98.239999999999895, 26.060000000000109], [-99.019999999999854, 26.37], [-99.3, 26.84], [-99.52, 27.54], [-100.11, 28.11000000000012], [-100.45584, 28.696120000000118], [-100.957599999999886, 29.380710000000125], [-101.6624, 29.779300000000113], [-102.48, 29.76], [-103.11, 28.97], [-103.94, 29.27], [-104.456969999999814, 29.57196], [-104.705749999999895, 30.12173], [-105.03737, 30.64402], [-105.63159, 31.083830000000113], [-106.1429, 31.39995], [-106.507589999999794, 31.75452], [-108.24, 31.754853718166398], [-108.24194, 31.34222], [-109.035, 31.341940000000161], [-111.02361, 31.33472], [-113.30498, 32.03914], [-114.815, 32.52528], [-114.721389999999829, 32.72083], [-115.991349999999869, 32.61239000000014], [-117.127759999999753, 32.53534], [-117.295937691273863, 33.04622461520389], [-117.944, 33.621236431201389], [-118.410602275897475, 33.740909223124497], [-118.519894822799685, 34.027781577575745], [-119.081, 34.078], [-119.438840642016658, 34.348477178284291], [-120.36778, 34.44711], [-120.62286, 34.60855], [-120.74433, 35.156860000000101], [-121.714569999999853, 36.16153], [-122.54747, 37.551760000000101], [-122.51201, 37.783390000000132], [-122.95319, 38.113710000000104], [-123.7272, 38.951660000000111], [-123.865169999999878, 39.766990000000128], [-124.39807, 40.3132], [-124.17886, 41.142020000000109], [-124.2137, 41.999640000000134], [-124.532839999999894, 42.76599], [-124.14214, 43.70838], [-124.020535, 44.615895], [-123.898929999999893, 45.52341], [-124.079635, 46.86475], [-124.395669999999896, 47.72017], [-124.687210083007812, 48.184432983398537], [-124.566101074218736, 48.379714965820384], [-123.12, 48.04], [-122.587359999999876, 47.096], [-122.34, 47.36], [-122.5, 48.18], [-122.84, 49.0], [-120.0, 49.0], [-117.03121, 49.0], [-116.04818, 49.0], [-112.999999999999872, 49.0], [-110.049999999999812, 49.0], [-107.049999999999898, 49.0], [-104.04826, 48.99986], [-100.65, 49.0], [-97.228720000004699, 49.0007], [-95.159069509171943, 49.0], [-95.15609, 49.38425], [-94.81758, 49.38905]]], [[[-153.006314053336837, 57.115842190165878], [-154.0050902984581, 56.734676825581047], [-154.516402757770067, 56.992748928446687], [-154.670992804971092, 57.461195787172493], [-153.762779507441451, 57.816574612043773], [-153.228729417921073, 57.968968410872421], [-152.564790615835108, 57.901427313866961], [-152.141147223906273, 57.591058661521977], [-153.006314053336837, 57.115842190165878]]], [[[-165.579164191733554, 59.909986884187539], [-166.192770148767238, 59.754440822988961], [-166.848337368821944, 59.941406155020942], [-167.455277066090048, 60.213069159579376], [-166.467792121424566, 60.384169826897775], [-165.674429694663644, 60.293606879306232], [-165.579164191733554, 59.909986884187539]]], [[[-171.731656867539357, 63.782515367275906], [-171.114433560245175, 63.592191067144981], [-170.491112433940657, 63.694975490973505], [-169.682505459653555, 63.431115627691142], [-168.689439460300662, 63.297506212000584], [-168.77194088445458, 63.188598130945437], [-169.529439867204985, 62.976931464277882], [-170.290556200215917, 63.194437567794452], [-170.671385667990847, 63.375821845138965], [-171.553063117538642, 63.317789211675077], [-171.791110602891166, 63.40584585230048], [-171.731656867539357, 63.782515367275906]]], [[[-155.067790290324211, 71.147776394323685], [-154.344165208941206, 70.696408596470192], [-153.900006273392563, 70.889988511835682], [-152.210006069935275, 70.829992173944831], [-152.270002407826127, 70.60000621202984], [-150.739992438744508, 70.430016588005699], [-149.720003018167489, 70.530010484490433], [-147.613361579357047, 70.214034939241785], [-145.689989800225248, 70.120009670686741], [-144.920010959076393, 69.989991767040479], [-143.58944618042517, 70.152514146598307], [-142.072510348713365, 69.851938178172631], [-140.985987521560702, 69.711998399526365], [-140.985988329004869, 69.711998399526365], [-140.992498752029377, 66.000028591568665], [-140.997769748123119, 60.306396796298593], [-140.012997816153074, 60.276837877027575], [-139.03900042031583, 60.000007229240012], [-138.340889999999888, 59.562110000000146], [-137.4525, 58.905000000000101], [-136.47972, 59.46389], [-135.47583, 59.78778], [-134.945, 59.270560000000117], [-134.27111, 58.86111], [-133.355548882207188, 58.410285142645151], [-132.73042, 57.692890000000105], [-131.707809999999853, 56.55212], [-130.00778, 55.91583], [-129.979994263358265, 55.284997870497207], [-130.536110189467223, 54.802753404349389], [-131.08581823797212, 55.178906155002025], [-131.967211467142278, 55.497775580459049], [-132.250010742859445, 56.369996242897443], [-133.539181084356386, 57.178887437562125], [-134.07806292029602, 58.123067531966889], [-135.038211032279037, 58.187714748763931], [-136.628062309954629, 58.212209377670447], [-137.800006279686016, 58.499995429103777], [-139.867787041412981, 59.537761542389134], [-140.825273817133024, 59.72751740176507], [-142.574443535564427, 60.084446519604981], [-143.958880994879848, 59.99918040632339], [-145.925556816827822, 60.458609727614274], [-147.114373949146625, 60.884656073644628], [-148.224306200127643, 60.672989406977152], [-148.018065558850736, 59.978328965893631], [-148.570822516860858, 59.914172675203297], [-149.727857835875824, 59.705658270905545], [-150.608243374616421, 59.368211168039487], [-151.716392788683294, 59.155821031319974], [-151.859433153267105, 59.74498403587959], [-151.40971900124714, 60.725802720779392], [-150.346941494732505, 61.033587551509854], [-150.621110806256951, 61.284424953854447], [-151.895839199816834, 60.727197984451273], [-152.578329841095581, 60.061657212964285], [-154.019172126257558, 59.350279446034264], [-153.287511359653166, 58.864727688219787], [-154.232492438758442, 58.146373602930531], [-155.307491421510207, 57.727794501366319], [-156.308334723923082, 57.422774359763636], [-156.556097378546298, 56.979984849670636], [-158.117216559867728, 56.463608099994175], [-158.433321296197136, 55.994153550838533], [-159.603327399717415, 55.566686102920116], [-160.289719611634183, 55.643580634170561], [-161.223047655257773, 55.364734605523481], [-162.23776607974105, 55.024186916720097], [-163.069446581046378, 54.689737046927171], [-164.785569221027174, 54.40417308208216], [-164.942226325520011, 54.572224839895327], [-163.84833960676562, 55.039431464246107], [-162.870001390615897, 55.348043117893198], [-161.804174974596009, 55.894986477270429], [-160.563604702781134, 56.008054511125025], [-160.070559862284483, 56.418055324928744], [-158.684442918919416, 57.016675116597852], [-158.461097378553944, 57.216921291728866], [-157.722770352183858, 57.570000515363056], [-157.550274421193564, 58.328326321030218], [-157.041674974576949, 58.918884589261708], [-158.194731208305427, 58.615802313869828], [-158.517217984023034, 58.787781480537305], [-159.058606126928709, 58.424186102931671], [-159.711667040017318, 58.931390285876333], [-159.981288825500144, 58.572549140041623], [-160.355271165996498, 59.071123358793628], [-161.355003425115001, 58.670837714260742], [-161.968893602526293, 58.671664537177371], [-162.054986538724648, 59.266925360747436], [-161.874170702135331, 59.633621324290587], [-162.518059048492034, 59.989723619213905], [-163.818341437820123, 59.798055731843377], [-164.662217577146407, 60.267484442782639], [-165.346387702474772, 60.507495632562396], [-165.350831875651835, 61.073895168697497], [-166.121379157555907, 61.500019029376212], [-165.734451870770471, 62.074996853271792], [-164.919178636717788, 62.633076483807919], [-164.562507901039339, 63.146378485763044], [-163.753332485996964, 63.219448961023758], [-163.067224494457832, 63.05945872664801], [-162.260555386381697, 63.541935736741159], [-161.534449836248569, 63.455816962326757], [-160.772506680321101, 63.76610810002326], [-160.958335130842528, 64.222798570402759], [-161.518068407212184, 64.402787584075313], [-160.777777676414729, 64.788603827566405], [-161.391926235987597, 64.777235012462327], [-162.453050096668818, 64.559444688568206], [-162.757786017894034, 64.338605455168803], [-163.54639421288428, 64.559160468190484], [-164.960829841145141, 64.446945095468848], [-166.425288255864473, 64.686672064870706], [-166.845004238939026, 65.088895575614529], [-168.110560065767146, 65.669997056736733], [-166.70527116602193, 66.088317776139391], [-164.474709642575448, 66.576660061297488], [-163.652511766595637, 66.576660061297488], [-163.788601651036117, 66.077207343196662], [-161.677774421210131, 66.116119696712403], [-162.489714525379981, 66.735565090595102], [-163.719716966791083, 67.116394558370089], [-164.430991380856511, 67.616338202577779], [-165.390286831706703, 68.042772121850234], [-166.764440680995989, 68.35887685817967], [-166.204707404626561, 68.883030910916162], [-164.430810513343431, 68.915535386827727], [-163.168613654614489, 69.371114813912882], [-162.930566169261965, 69.858061835399255], [-161.908897264635499, 70.333329983187625], [-160.93479651593367, 70.447689927849567], [-159.039175788387126, 70.891642157668926], [-158.119722866833939, 70.824721177851032], [-156.580824551398024, 71.357763576941736], [-155.067790290324211, 71.147776394323685]]]] } }, - { "type": "Feature", "properties": { "admin": "Uzbekistan", "name": "Uzbekistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[66.518606805288655, 37.362784328758785], [66.546150343700205, 37.974684963526855], [65.215998976507379, 38.402695013984292], [64.170223016216752, 38.892406724598231], [63.518014764261018, 39.363256537425627], [62.374260288344992, 40.053886216790382], [61.882714064384679, 41.084856879229392], [61.547178989513547, 41.2663703476546], [60.46595299667068, 41.22032664648254], [60.083340691981654, 41.425146185871391], [59.976422153569771, 42.223081976890199], [58.629010857991453, 42.751551011723045], [57.786529982337065, 42.170552883465511], [56.93221520368779, 41.82602610937559], [57.096391229079089, 41.32231008561056], [55.968191359282898, 41.308641669269356], [55.928917270741081, 44.995858466159099], [58.503127068928457, 45.586804307632818], [58.689989048095882, 45.500013739598621], [60.239971958258316, 44.784036770194717], [61.05831994003244, 44.405816962250505], [62.013300408786236, 43.504476630215642], [63.185786981056559, 43.650074978197999], [64.900824415959264, 43.728080552742576], [66.098012322865074, 42.997660020513088], [66.023391554635609, 41.994646307943974], [66.510648634715707, 41.987644151368436], [66.714047072216502, 41.168443508461493], [67.985855747351806, 41.135990708982213], [68.259895867795606, 40.662324530594894], [68.632482944620008, 40.668680731766798], [69.070027296835306, 41.384244289712363], [70.388964878220776, 42.081307684897439], [70.96231489449913, 42.266154283205481], [71.259247674448218, 42.167710679689456], [70.420022414028196, 41.519998277343134], [71.157858514291576, 41.143587144529107], [71.870114780570447, 41.392900092121259], [73.055417108049156, 40.86603302668945], [71.774875115856545, 40.145844428053763], [71.014198032520156, 40.244365546218226], [70.601406691372674, 40.218527330072284], [70.458159621059608, 40.49649485937028], [70.666622348925031, 40.960213324541407], [69.329494663372813, 40.727824408524839], [69.011632928345477, 40.086158148756653], [68.536416456989414, 39.533452867178923], [67.701428664017342, 39.580478420564518], [67.442219679641298, 39.140143541005479], [68.176025018185911, 38.901553453113898], [68.392032505165943, 38.157025254868728], [67.829999627559502, 37.144994004864678], [67.075782098259609, 37.35614390720928], [66.518606805288655, 37.362784328758785]]] } }, - { "type": "Feature", "properties": { "admin": "Venezuela", "name": "Venezuela", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-71.331583624950284, 11.776284084515805], [-71.36000566271079, 11.53999359786121], [-71.947049933546495, 11.423282375530018], [-71.620868292920164, 10.969459947142791], [-71.633063930941063, 10.446494452349027], [-72.074173956984495, 9.865651353388369], [-71.695644090446521, 9.072263088411246], [-71.26455929226772, 9.137194525585981], [-71.039999355743376, 9.859992784052407], [-71.350083787710773, 10.211935126176213], [-71.400623338492224, 10.968969021036013], [-70.155298834906503, 11.375481675660039], [-70.293843349881016, 11.846822414594211], [-69.943244594996813, 12.162307033736095], [-69.584300096297454, 11.459610907431211], [-68.882999233664435, 11.44338450769156], [-68.233271450458716, 10.885744126829945], [-68.194126552997616, 10.554653225135921], [-67.296248541926317, 10.545868231646306], [-66.227864142507983, 10.648626817258684], [-65.655237596281737, 10.20079885501732], [-64.890452236578156, 10.077214667191296], [-64.329478725833724, 10.389598700395679], [-64.318006557864933, 10.641417954953978], [-63.079322475828725, 10.701724351438598], [-61.880946010980182, 10.7156253117251], [-62.730118984616396, 10.420268662960904], [-62.388511928950969, 9.948204453974636], [-61.588767462801918, 9.873066921422263], [-60.830596686431711, 9.38133982994894], [-60.671252407459718, 8.580174261911877], [-60.150095587796166, 8.602756862823425], [-59.758284878159181, 8.367034816924045], [-60.550587938058186, 7.779602972846178], [-60.637972785063752, 7.414999904810853], [-60.295668097562377, 7.043911444522918], [-60.543999192940966, 6.856584377464881], [-61.159336310456467, 6.696077378766317], [-61.139415045807937, 6.234296779806142], [-61.410302903881941, 5.959068101419616], [-60.733574184803707, 5.2002772078619], [-60.601179165271922, 4.918098049332129], [-60.966893276601517, 4.536467596856638], [-62.085429653559125, 4.162123521334308], [-62.804533047116692, 4.006965033377951], [-63.093197597899092, 3.770571193858784], [-63.888342861574145, 4.020530096854571], [-64.628659430587533, 4.14848094320925], [-64.816064012294007, 4.056445217297422], [-64.368494432214092, 3.797210394705246], [-64.408827887617903, 3.126786200366623], [-64.269999152265783, 2.497005520025566], [-63.422867397705105, 2.411067613124174], [-63.368788011311644, 2.200899562993129], [-64.083085496666072, 1.91636912679408], [-64.199305792890499, 1.49285492594602], [-64.611011928959854, 1.328730576987041], [-65.354713304288353, 1.0952822941085], [-65.548267381437554, 0.78925446207603], [-66.325765143484944, 0.724452215982012], [-66.876325853122566, 1.253360500489336], [-67.181294318293041, 2.250638129074062], [-67.447092047786299, 2.600280869960869], [-67.809938117123693, 2.820655015469569], [-67.303173183853417, 3.31845408773718], [-67.33756384954367, 3.542342230641721], [-67.621835903581271, 3.839481716319994], [-67.823012254493534, 4.503937282728898], [-67.744696621355203, 5.221128648291667], [-67.521531948502741, 5.556870428891968], [-67.34143958196556, 6.095468044454021], [-67.695087246355001, 6.267318020040645], [-68.265052456318216, 6.153268133972473], [-68.985318569602327, 6.206804917826856], [-69.389479946557103, 6.099860541198835], [-70.093312954372408, 6.960376491723109], [-70.674233567981503, 7.087784735538717], [-71.960175747348629, 6.991614895043538], [-72.19835242378187, 7.340430813013682], [-72.444487270788059, 7.42378489830048], [-72.479678921178831, 7.632506008327352], [-72.360900641555958, 8.002638454617893], [-72.439862230097944, 8.405275376820027], [-72.660494757768092, 8.62528778730268], [-72.788729824500379, 9.085027167187331], [-73.304951544880026, 9.151999823437604], [-73.027604132769554, 9.736770331252441], [-72.905286017534692, 10.45034434655477], [-72.614657762325194, 10.821975409381777], [-72.227575446242923, 11.108702093953237], [-71.973921678338272, 11.608671576377116], [-71.331583624950284, 11.776284084515805]]] } }, - { "type": "Feature", "properties": { "admin": "Vietnam", "name": "Vietnam", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[108.050180291782908, 21.552379869060111], [106.715067987090066, 20.696850694252014], [105.881682163519002, 19.752050482659694], [105.662005649846279, 19.058165188060567], [106.426816847765991, 18.004120998603224], [107.36195356651973, 16.697456569887049], [108.269495070429599, 16.079742336486145], [108.877106561317447, 15.276690578670436], [109.335269810017209, 13.42602834721772], [109.200135939573954, 11.666859239137761], [108.366129998815424, 11.00832062422627], [107.22092858279521, 10.36448395430183], [106.4051127462034, 9.530839748569317], [105.158263787865081, 8.599759629750492], [104.795185174582372, 9.2410383162765], [105.076201613385592, 9.918490505406806], [104.334334751403446, 10.486543687375228], [105.199914992292321, 10.889309800658094], [106.249670037869436, 10.961811835163585], [105.810523716253101, 11.567614650921225], [107.491403029410861, 12.337205918827944], [107.614547967562402, 13.535530707244202], [107.382727492301058, 14.202440904186968], [107.564525181103875, 15.202173163305554], [107.312705926545576, 15.908538316303177], [106.55600792849566, 16.604283962464802], [105.925762160264, 17.485315456608955], [105.094598423281496, 18.666974595611073], [103.896532017026701, 19.265180975821799], [104.183387892678908, 19.624668077060214], [104.822573683697073, 19.886641750563879], [104.435000441508024, 20.758733221921528], [103.203861118586431, 20.766562201413745], [102.754896274834636, 21.675137233969462], [102.170435825613552, 22.464753119389297], [102.706992222100084, 22.708795070887668], [103.504514601660546, 22.703756618739202], [104.476858351664447, 22.819150092046961], [105.329209425886603, 23.352063300056908], [105.811247186305209, 22.976892401617899], [106.725403273548451, 22.794267889898414], [106.567273390735295, 22.218204860924768], [107.043420037872608, 21.811898912029907], [108.050180291782908, 21.552379869060111]]] } }, - { "type": "Feature", "properties": { "admin": "Vanuatu", "name": "Vanuatu", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[167.844876743845077, -16.466333103097153], [167.515181105822847, -16.597849623279966], [167.180007765977791, -16.159995212470957], [167.2168013857696, -15.891846205308449], [167.844876743845077, -16.466333103097153]]], [[[167.107712437201485, -14.933920179913951], [167.2700281110302, -15.74002084723487], [167.001207310247935, -15.614602146062492], [166.79315799384085, -15.668810723536719], [166.649859247095549, -15.392703545801192], [166.629136997746429, -14.6264970842096], [167.107712437201485, -14.933920179913951]]]] } }, - { "type": "Feature", "properties": { "admin": "Yemen", "name": "Yemen", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[53.108572625547502, 16.651051133688949], [52.385205926325874, 16.38241120041965], [52.191729363825075, 15.938433132384018], [52.168164910699986, 15.597420355689945], [51.172515089732471, 15.175249742081489], [49.574576450403136, 14.708766587782746], [48.679230584514151, 14.003202419485657], [48.238947381387412, 13.948089504446369], [47.938914015500771, 14.007233181204423], [47.354453566279702, 13.592219753468379], [46.71707645039173, 13.399699204965016], [45.877592807810252, 13.347764390511681], [45.625050083199874, 13.290946153206759], [45.406458774605241, 13.02690542241143], [45.144355910020849, 12.953938300015306], [44.9895333188744, 12.699586900274708], [44.494576450382844, 12.721652736863344], [44.175112745954486, 12.585950425664873], [43.48295861183712, 12.63680003504008], [43.222871128112118, 13.220950425667422], [43.251448195169516, 13.767583726450848], [43.087943963398047, 14.062630316621306], [42.892245314308717, 14.802249253798745], [42.604872674333606, 15.213335272680592], [42.805015496600042, 15.261962795467252], [42.702437778500652, 15.718885809791995], [42.823670688657408, 15.911742255105263], [42.779332309750963, 16.34789134364868], [43.218375278502734, 16.666889960186406], [43.115797560403351, 17.088440456607369], [43.380794305196098, 17.579986680567668], [43.791518589051904, 17.319976711491105], [44.062613152855072, 17.410358791569589], [45.216651238797184, 17.43332896572333], [45.399999220568752, 17.333335069238554], [46.366658563020529, 17.233315334537632], [46.749994337761642, 17.283338120996174], [47.000004917189749, 16.949999294497438], [47.466694777217626, 17.116681626854877], [48.183343540241324, 18.166669216377311], [49.116671583864857, 18.616667588774941], [52.000009800022227, 19.000003363516054], [52.782184279192037, 17.349742336491229], [53.108572625547502, 16.651051133688949]]] } }, - { "type": "Feature", "properties": { "admin": "South Africa", "name": "South Africa", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.521001417778869, -29.257386976846245], [31.325561150850994, -29.401977634398907], [30.901762729625336, -29.909956963828034], [30.622813348113816, -30.423775730106122], [30.055716180142774, -31.140269463832951], [28.925552605919535, -32.172041110972494], [28.219755893677092, -32.771952813448848], [27.464608188595967, -33.226963799778794], [26.419452345492818, -33.614950453426175], [25.909664340933482, -33.667040297176392], [25.78062828950069, -33.944646091448334], [25.172861769315965, -33.796851495093577], [24.67785322439212, -33.987175795224537], [23.594043409934635, -33.794474379208147], [22.988188917744729, -33.916430759416976], [22.574157342222232, -33.864082533505304], [21.542799106541022, -34.258838799782922], [20.689052768646999, -34.417175388325226], [20.071261020597628, -34.795136814107984], [19.616405063564567, -34.819166355123706], [19.193278435958714, -34.462598972309777], [18.855314568769867, -34.444305515278458], [18.424643182049376, -33.997872816708963], [18.377410922934612, -34.13652068454806], [18.244499139079917, -33.867751560198023], [18.250080193767442, -33.281430759414434], [17.925190463948436, -32.61129078545342], [18.247909783611185, -32.429131361624563], [18.221761508871477, -31.661632989225662], [17.566917758868861, -30.72572112398754], [17.0644161312627, -29.878641045859158], [17.06291751472622, -29.875953871379977], [16.344976840895239, -28.576705010697697], [16.824017368240899, -28.082161553664466], [17.218928663815401, -28.355943291946804], [17.387497185951499, -28.783514092729774], [17.836151971109526, -28.856377862261311], [18.464899122804745, -29.045461928017271], [19.002127312911082, -28.972443129188857], [19.89473432788861, -28.461104831660769], [19.895767856534427, -24.767790215760588], [20.165725538827186, -24.917961928000768], [20.758609246511831, -25.868136488551446], [20.666470167735437, -26.477453301704916], [20.889609002371731, -26.828542982695907], [21.60589603036939, -26.726533705351748], [22.105968865657864, -26.28025603607913], [22.579531691180584, -25.979447523708142], [22.824271274514896, -25.500458672794768], [23.312096795350179, -25.268689873965712], [23.733569777122703, -25.39012948985161], [24.211266717228792, -25.670215752873567], [25.025170525825782, -25.719670098576891], [25.664666375437712, -25.486816094669706], [25.765848829865206, -25.174845472923671], [25.941652052522151, -24.696373386333214], [26.485753208123292, -24.616326592713097], [26.78640669119741, -24.240690606383478], [27.119409620886238, -23.574323011979772], [28.017235955525244, -22.827753594659072], [29.432188348109033, -22.091312758067584], [29.839036899542965, -22.102216485281172], [30.322883335091767, -22.271611830333931], [30.659865350067083, -22.151567478119912], [31.191409132621278, -22.251509698172395], [31.670397983534645, -23.658969008073861], [31.930588820124242, -24.369416599222532], [31.752408481581874, -25.484283949487406], [31.837777947728057, -25.843331801051342], [31.333157586397899, -25.660190525008943], [31.044079624157146, -25.731452325139436], [30.949666782359905, -26.022649021104144], [30.676608514129633, -26.398078301704604], [30.685961948374477, -26.743845310169526], [31.282773064913325, -27.285879408478991], [31.868060337051073, -27.17792734142127], [32.071665480281062, -26.733820082304902], [32.830120477028878, -26.74219166433619], [32.580264926897677, -27.470157566031808], [32.462132602678444, -28.30101124442055], [32.203388706193032, -28.752404880490065], [31.521001417778869, -29.257386976846245]], [[28.978262566857236, -28.955596612261708], [28.541700066855491, -28.647501722937562], [28.07433841320778, -28.851468601193581], [27.532511020627471, -29.242710870075353], [26.999261915807629, -29.875953871379977], [27.749397006956478, -30.645105889612214], [28.107204624145421, -30.545732110314944], [28.291069370239903, -30.226216729454293], [28.848399692507734, -30.070050551068245], [29.018415154748016, -29.743765557577362], [29.325166456832587, -29.257386976846245], [28.978262566857236, -28.955596612261708]]] } }, - { "type": "Feature", "properties": { "admin": "Zambia", "name": "Zambia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[32.759375441221316, -9.230599053589058], [33.231387973775291, -9.676721693564799], [33.485687697083584, -10.525558770391111], [33.315310499817279, -10.796549981329695], [33.114289178201908, -11.607198174692311], [33.306422153463068, -12.435778090060214], [32.991764357237876, -12.783870537978272], [32.688165317523122, -13.712857761289273], [33.214024692525207, -13.97186003993615], [30.179481235481827, -14.796099134991525], [30.274255812305103, -15.507786960515208], [29.51683434420314, -15.644677829656386], [28.947463413211256, -16.043051446194436], [28.825868768028492, -16.389748630440611], [28.467906121542676, -16.468400160388843], [27.598243442502753, -17.290830580314005], [27.044427117630729, -17.938026218337427], [26.706773309035633, -17.961228936436477], [26.381935255648919, -17.846042168857892], [25.264225701608005, -17.736539808831413], [25.084443393664564, -17.661815687737366], [25.076950310982255, -17.578823337476617], [24.6823490740015, -17.35341073981947], [24.033861525170771, -17.29584319424632], [23.215048455506057, -17.52311614346598], [22.562478468524255, -16.89845142992181], [21.887842644953867, -16.080310153876876], [21.933886346125913, -12.898437188369357], [24.016136508894672, -12.91104623784857], [23.930922072045373, -12.565847670138854], [24.079905226342838, -12.191296888887361], [23.904153680118181, -11.722281589406318], [24.017893507592586, -11.237298272347088], [23.912215203555714, -10.926826267137512], [24.257155389103982, -10.951992689663655], [24.314516228947948, -11.262826429899269], [24.783169793402948, -11.238693536018962], [25.418118116973197, -11.330935967659958], [25.752309604604726, -11.784965101776356], [26.55308759939961, -11.924439792532125], [27.164419793412456, -11.608748467661071], [27.38879886242378, -12.132747491100663], [28.15510867687998, -12.272480564017894], [28.52356163912102, -12.698604424696679], [28.934285922976834, -13.248958428605132], [29.699613885219485, -13.257226657771827], [29.616001417771223, -12.178894545137307], [29.341547885869087, -12.36074391037241], [28.642417433392346, -11.971568698782312], [28.372253045370421, -11.793646742401389], [28.496069777141763, -10.789883721564044], [28.673681674928922, -9.605924981324931], [28.449871046672818, -9.164918308146083], [28.734866570762495, -8.526559340044576], [29.002912225060467, -8.40703175215347], [30.34608605319081, -8.238256524288216], [30.740015496551781, -8.340007419470913], [31.157751336950042, -8.594578747317362], [31.55634809746649, -8.76204884199864], [32.191864861791963, -8.930358981973276], [32.759375441221316, -9.230599053589058]]] } }, - { "type": "Feature", "properties": { "admin": "Zimbabwe", "name": "Zimbabwe", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.191409132621278, -22.251509698172395], [30.659865350067083, -22.151567478119912], [30.322883335091767, -22.271611830333931], [29.839036899542965, -22.102216485281172], [29.432188348109033, -22.091312758067584], [28.794656202924209, -21.639454034107445], [28.02137007010861, -21.485975030200578], [27.727227817503252, -20.851801853114711], [27.724747348753247, -20.499058526290387], [27.296504754350501, -20.391519870690995], [26.164790887158478, -19.293085625894935], [25.850391473094724, -18.714412937090533], [25.649163445750155, -18.536025892818987], [25.264225701608005, -17.736539808831413], [26.381935255648919, -17.846042168857892], [26.706773309035633, -17.961228936436477], [27.044427117630729, -17.938026218337427], [27.598243442502753, -17.290830580314005], [28.467906121542676, -16.468400160388843], [28.825868768028492, -16.389748630440611], [28.947463413211256, -16.043051446194436], [29.51683434420314, -15.644677829656386], [30.274255812305103, -15.507786960515208], [30.338954705534537, -15.880839125230242], [31.173063999157673, -15.860943698797868], [31.636498243951188, -16.071990248277881], [31.852040643040592, -16.319417006091374], [32.328238966610222, -16.392074069893749], [32.847638787575839, -16.713398125884613], [32.849860874164385, -17.979057305577175], [32.654885695127142, -18.672089939043492], [32.611994256324884, -19.419382826416268], [32.772707960752619, -19.715592136313294], [32.659743279762573, -20.30429005298231], [32.508693068173436, -20.395292250248303], [32.244988234188007, -21.116488539313689], [31.191409132621278, -22.251509698172395]]] } } - ] - }; - -var randomcountriesData1 = [ - { country: "Iran", "continent": "Asia", "CategoryName": "Books", "Sales": 550 }, - { country: "Benin", "continent": "Africa", "CategoryName": "Books", "Sales": 1000 }, - { country: "China", "continent": "Asia", "CategoryName": "Books", "Sales": 420 }, - { country: "Chile", "continent": "South America", "CategoryName": "Books", "Sales": 1100 }, - { country: "Cuba", "continent": "North America", "CategoryName": "Books", "Sales": 450 }, - { country: "Spain", "continent": "Europe", "CategoryName": "Books", "Sales": 1200 }, - { country: "Fiji", "continent": "Oceania", "CategoryName": "Books", "Sales": 618.0 }, -]; - -module mapcomponenet { - $(function () { - var mapsample = new ej.datavisualization.Map($("#map"), { - enableAnimation: true, - navigationControl: { - enableNavigation: true, - orientation: 'vertical', - absolutePosition: { x: 5, y: 15 }, - dockPosition: 'none' - }, - layers: [ - { - layerType: 'geometry', - enableMouseHover: false, - enableSelection: false, - shapeSettings: { - fill: "#626171", - autoFill: false, - highlightStroke: "white", - stroke: "white", - strokeThickness: 0.5, - highlightColor: "#BFBFBF" - }, - shapeData: world_map, - legendSettings: { dockOnMap: false } - } - ] - }); - }); -} - - - - - - - -module MenuComponent { - $(function () { - var sample = new ej.Menu($("#syncfusionProducts"),{ - width: "100%", - animationType: ej.AnimationType.Default, - cssClass: 'gradient-lime ', - enableAnimation: true, - enableSeparator: true, - height: 40, - htmlAttributes: { "aria-label": "menu" }, - menuType: "normalmenu", - orientation: ej.Orientation.Horizontal, - showRootLevelArrows: true, - showSubLevelArrows: true, - subMenuDirection: ej.Direction.Right, - titleText: "Menu", - - }); - }); - -} - - - - - - - - -module NavigationDrawerComponent { - $(function () { - var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { - targetId: "butdrawer", - contentId: "content_container", - type: "overlay", - direction: "left", - enableListView: true, - listViewSettings: { - width: 300, - selectedItemIndex: 0, - mouseUp: "headChange" - }, - position: "normal" - }); - }); - function headChange(e:any) { - $("#butdrawer").parent().children("h2").text(e.text); - } -} - - - -module PDFViewerComponent { - $(function () { - var pdfviewerControl = new ej.PdfViewer($("#pdfviewer"), { - serviceUrl: (window).baseurl + "api/PdfViewer", - isResponsive: true - }); - }); -} - - - - - - - - - -module PivotGridOlap { - - $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"),{ - dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]", - } - ], - axis: "columns" - } - ], - filters:[] - }, - hyperlinkSettings: { - enableValueCellHyperlink: true, - enableRowHeaderHyperlink: true, - enableColumnHeaderHyperlink: true, - enableSummaryCellHyperlink: true - }, - enableGroupingBar: true, - enableCellEditing: true, - enableCellSelection: true, - renderSuccess: function (args) {$("#PivotSchemaDesigner").ejPivotSchemaDesigner({ pivotControl: args, layout: "excel" });} - }); - }); -} - - - -var pivot_dataset = [ - { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, - { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, - { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, - { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, - { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, - { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, - { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, - { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, - { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, - { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, - { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, - { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, - { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, - { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, - { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, - { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, - { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, - { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, - { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, - { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, - { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, - { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, - { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, - { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } -] - -module PivotGridRelational { - $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"),{ - dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - } - ], - columns: - [{ - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - }, - { - fieldName: "Quantity", - fieldCaption: "Quantity" - } - ], - filters:[] - }, - hyperlinkSettings: { - enableValueCellHyperlink: true, - enableRowHeaderHyperlink: true, - enableColumnHeaderHyperlink: true, - enableSummaryCellHyperlink: true - }, - enableGroupingBar: true, - enableCellEditing: true, - enableCellSelection: true, - renderSuccess: function (args) {$("#PivotSchemaDesigner").ejPivotSchemaDesigner({ pivotControl: args, layout: "excel" });} - }); - }); -} - - - -module PivotTreeMap { - $(function () { - var sample = new ej.PivotTreeMap($("#PivotTreeMap"),{ - dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - columns: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Customer Count]", - } - ], - axis: "columns" - } - ], - filters:[] - } - }); - }); -} - - - -module ProgressBarComponent { - $(function () { - var sample = new ej.ProgressBar($("#progressBar"),{ - width: 200, - value: 45, - height: 20, - enablePersistence: true, - maxValue: 200, - minValue: 0, - showRoundedCorner: true, - text: 'loading...' - }); - }); - -} - - - - -declare var rteObj: any; -declare var data: any; -var radialEle = $('#defaultradialmenu'), action = 0, forRedo = 0; -var rteEle = $("#rteSample1"); -module AccordionComponent { - $(function () { - - if (!(ej.browserInfo().name == "msie" && parseInt(ej.browserInfo().version) < 9)) { - var radialmenuInstance = new ej.RadialMenu($("#defaultradialmenu"), { - imageClass: "imageclass", - backImageClass: "backimageclass", - targetElementId: "radialtarget1" - }); - } - else { - $("#contentDiv").html("Radial Menu is only supported from Internet Explorer Versioned 9 and above.").css({ "font-size": "20px", "color": "red" }); - } - var rteInstance = new ej.RTE($("#rteSample1"), { - width: "100%", - minWidth: "10px", - change: (e) => { radialEle.ejRadialMenu("enableItem", "Undo"); }, - select: (e) => { - var target = $("#radialtarget1"), radialRadius = 150, radialDiameter = 2 * radialRadius, - // To get Iframe positions - iframeY = target.offset().top + e.event.clientY, iframeX = target.offset().left + e.event.clientX, - // To set Radial Menu position within target - x = iframeX > target.width() - radialRadius ? target.width() - radialDiameter : (iframeX > radialRadius ? iframeX - radialRadius : 0), - y = iframeY > target.height() - radialRadius ? target.height() - radialDiameter : (iframeY > radialRadius ? iframeY - radialRadius : 0); - radialEle.ejRadialMenu("setPosition", x, y); - radialEle.focus(); - $('iframe').contents().find('body').blur(); - }, - showToolbar: false, - showContextMenu: false - }); - $(window).resize(function () { - if (ej.isMobile() && ej.isPortrait()) - $('#defaultradialmenu').css({ "left": 25 }); - }); - }); -} - - -function bold(e: any) { - - rteObj = rteEle.data("ejRTE"); - rteObj.executeCommand("bold"); - data = rteObj._getSelectedHtmlString() ? true : false; - if (data) action += 1; - forRedo = action; - radialEle.focus(); -} -function italic(e: any) { - rteObj = rteEle.data("ejRTE"); - rteObj.executeCommand("italic"); - data = rteObj._getSelectedHtmlString() ? true : false; - if (data) action += 1; - forRedo = action; - radialEle.focus(); -} -function undo(e: any) { - rteObj = rteEle.data("ejRTE"); - rteObj.executeCommand("undo"); - action -= 1; - if (action == 0) - radialEle.ejRadialMenu("disableItem", "Undo"); - radialEle.ejRadialMenu("enableItem", "Redo"); - radialEle.focus(); -} -function redo(e: any) { - rteObj = rteEle.data("ejRTE"); - rteObj.executeCommand("redo"); - action += 1; - if (forRedo == action) radialEle.ejRadialMenu("disableItem", "Redo"); - radialEle.ejRadialMenu("enableItem", "Undo"); - radialEle.focus(); -} - - - - -module RadialSliderComponent { - $(function () { - var radialsliderInstance = new ej.RadialSlider($("#radialSlider"), { - innerCircleImageUrl: "../images/radialslider/chevron-right.png" - }); - }); -} - - -module rangecomponent { - $(function () { - var linearsample = new ej.datavisualization.RangeNavigator($("#RangeNavigator"), { - enableDeferredUpdate: true, - padding: "15", - allowSnapping: true, - selectedRangeSettings: { - start: "2010/5/1", end: "2011/10/1" - }, - isResponsive: true, - tooltipSettings: { - visible: true, labelFormat: "MM/dd/yyyy", backgroundColor: "gray", tooltipDisplayMode: "ondemand" - }, - load: () => { - var rn = $("#RangeNavigator").data("ejRangeNavigator"); - rn.model.series = [ - { - type: 'line', - dataSource: data.Open, xName: "XValue", yName: "YValue", - fill: '#69D2E7' - } - ]; - } - - }); - }); -} -var data; -data = GetData(); - -function GetData() { - var series1:any[]=[]; - var series2:any[]= []; - var value = 100; - var value1 = 120; - for (var i = 1; i < 730; i++) { - - if (Math.random() > .5) { - value += Math.random(); - value1 += Math.random(); - } else { - value -= Math.random(); - value1 -= Math.random(); - } - var point1 = { XValue: new Date(2010, 0, i), YValue: value }; - var point2 = { XValue: new Date(2010, 0, i), YValue: value1 }; - series1.push(point1); - series2.push(point2); - } - - data = { Open: series1, Close: series2 }; - return data; -}; - - - -module RatingComponent { - $(function () { - - var sample1 = new ej.Rating($("#fullRating"),{ - value: 4, - precision: ej.Rating.Precision.Full, - allowReset: true, - cssClass: "gradient-lime", - enabled: true, - enablePersistence: true, - incrementStep: 2, - maxValue: 10, - minValue: 0, - orientation: ej.Orientation.Horizontal, - shapeHeight: 25, - shapeWidth: 25, - showTooltip: true - }); - - var sample2 = new ej.Rating($("#halfRating"),{ - precision: ej.Rating.Precision.Half, - value: 3.5, - allowReset: true, - cssClass: "gradient-lime", - enabled: true, - enablePersistence: true, - incrementStep: 2, - maxValue: 10, - minValue: 0, - orientation: "horizontal", - shapeHeight: 25, - shapeWidth: 25, - showTooltip: true - }); - - var sample3 = new ej.Rating($("#exactRating"),{ - precision: ej.Rating.Precision.Exact, - value: 3.7, - allowReset: true, - cssClass: "gradient-lime", - enabled: true, - enablePersistence: true, - incrementStep: 2, - maxValue: 10, - minValue: 0, - orientation: "horizontal", - shapeHeight: 25, - shapeWidth: 25, - showTooltip: true - }); - }); - -} - - - -module ReportViewerComponent { - $(function () { - var report = new ej.ReportViewer($("#territoryReportViewer"), { - reportServiceUrl: (window).baseurl + 'api/SSRSReport', - reportServerUrl: 'http://mvc.syncfusion.com/reportserver', - processingMode: ej.ReportViewer.ProcessingMode.Remote, - reportPath: "/SSRSSamples2/Territory Sales new", - isResponsive: true - }); - }); -} - - - -var fontfamily = ["Segoe UI", "Arial", "Times New Roman", "Tahoma", "Helvetica"], fontsize = ["1pt", "2pt", "3pt", "4pt", "5pt"], action1 = ["New", "Clear"], action2 = ["Bold", "Italic", "Underline", "strikethrough", "superscript", "subscript", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyFull", "Undo", "Redo"]; -module RibbonComponent { - $(function () { - var sample = new ej.Ribbon($("#defaultRibbon"), { - width: "100%", - expandPinSettings: { - toolTip: "Collapse the Ribbon" - }, - collapsePinSettings: { - toolTip: "Pin the Ribbon" - }, - applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } - }, - tabs: [{ - id: "home", text: "HOME", groups: [{ - text: "New", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "new", - text: "New", - toolTip: "New", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-new" - } - } - ], - defaults: { - type: "button", - width: 60, - height: 70 - } - }] - }, - { - text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{ - groups: [{ - id: "paste", - text: "paste", - toolTip: "Paste", - splitButtonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-ribbonpaste", - targetID: "pasteSplit", - buttonMode: "dropdown", - arrowPosition: ej.ArrowPosition.Bottom - } - } - ], - defaults: { - type: "splitbutton", - width: 50, - height: 70 - } - }, - { - groups: [{ - id: "cut", - text: "Cut", - toolTip: "Cut", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - prefixIcon: "e-icon e-ribbon e-ribboncut" - } - }, - { - id: "copy", - text: "Copy", - toolTip: "Copy", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - prefixIcon: "e-icon e-ribbon e-ribboncopy" - } - }, - { - id: "clear", - text: "Clear", - toolTip: "Clear All", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - prefixIcon: "e-icon e-ribbon clearAll" - } - }], - defaults: { - type: "button", - width: 60, - isBig: false - } - }] - }, - { - text: "Font", alignType: "rows", content: [{ - groups: [{ - id: "fontfamily", - toolTip: "Font", - dropdownSettings: { - dataSource: fontfamily, - text: "Segoe UI", - width: 150 - } - }, - { - id: "fontsize", - toolTip: "FontSize", - dropdownSettings: { - dataSource: fontsize, - text: "1pt", - width: 65 - } - }], - defaults: { - type: "dropdownlist", - height: 28 - } - }, - { - groups: [{ - id: "bold", - toolTip: "Bold", - type: ej.Ribbon.Type.ToggleButton, - toggleButtonSettings: { - contentType: ej.ContentType.ImageOnly, - defaultText: "Bold", - activeText: "Bold", - defaultPrefixIcon: "e-icon e-ribbon bold", - activePrefixIcon: "e-icon e-ribbon bold" - } - }, - { - id: "italic", - toolTip: "Italic", - type: ej.Ribbon.Type.ToggleButton, - toggleButtonSettings: { - contentType: ej.ContentType.ImageOnly, - defaultText: "Italic", - activeText: "Italic", - defaultPrefixIcon: "e-icon e-ribbon e-ribbonitalic", - activePrefixIcon: "e-icon e-ribbon e-ribbonitalic" - } - }, - { - id: "underline", - text: "Underline", - toolTip: "Underline", - type: ej.Ribbon.Type.ToggleButton, - toggleButtonSettings: { - contentType: ej.ContentType.ImageOnly, - defaultText: "Underline", - activeText: "Underline", - defaultPrefixIcon: "e-icon e-ribbon e-ribbonunderline", - activePrefixIcon: "e-icon e-ribbon e-ribbonunderline" - } - }, - { - id: "strikethrough", - text: "strikethrough", - toolTip: "Strikethrough", - type: ej.Ribbon.Type.ToggleButton, - toggleButtonSettings: { - contentType: ej.ContentType.ImageOnly, - defaultText: "Strikethrough", - activeText: "Strikethrough", - defaultPrefixIcon: "e-icon e-ribbon strikethrough", - activePrefixIcon: "e-icon e-ribbon strikethrough" - } - }, - { - id: "superscript", - text: "superscript", - toolTip: "Superscript", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-superscripticon" - } - }, - { - id: "subscript", - text: "subscript", - toolTip: "Subscript", - enableSeparator: true, - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-subscripticon" - } - }, - { - id: "fontcolor", - text: "Font Color", - toolTip: "Font Color", - type: ej.Ribbon.Type.Custom, - contentID: "fontcolor" - }, - { - id: "fillcolor", - text: "Fill Color", - toolTip: "Fill Color", - type: ej.Ribbon.Type.Custom, - contentID: "fillcolor" - } - ], - defaults: { - isBig: false - } - }] - }, - { - text: "Alignment", alignType: ej.Ribbon.AlignType.Rows, content: [ - { - groups: [{ - id: "bullet", - text: "Bullet Format", - toolTip: "Bullets", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-bullet" - } - }, - { - id: "number", - text: "Number Format", - toolTip: "Numbering", - enableSeparator: true, - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-numbericon" - } - }, - { - id: "textindent", - text: "Indent", - toolTip: "Text Indent", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-indent" - } - }, - { - id: "textoudent", - text: "Outdent", - toolTip: "Text Outdent", - enableSeparator: true, - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-outdent" - } - }, - { - id: "sortascending", - text: "Sort", - toolTip: "Sort", - enableSeparator: true, - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-sort" - } - }, - { - id: "border", - text: "Border", - toolTip: "Border", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-border" - } - }], - defaults: { - type: "button", - isBig: false - } - }, - { - groups: [{ - id: "alignleft", - text: "JustifyLeft", - toolTip: "Align Left", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon alignleft" - } - }, - { - id: "aligncenter", - text: "JustifyCenter", - toolTip: "Align Center", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon aligncenter" - } - }, - { - id: "alignright", - text: "JustifyRight", - toolTip: "Align Right", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon alignright" - } - }, - { - id: "justify", - text: "JustifyFull", - toolTip: "Justify", - enableSeparator: true, - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon justify" - } - }, - { - id: "uppercase", - text: "Upper Case", - toolTip: "Upper Case", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-uppercase" - } - }, - { - id: "lowercase", - text: "Lower Case", - toolTip: "Lower Case", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-lowercase" - } - }], - defaults: { - type: "button", - isBig: false - } - }] - }, - { - text: "Actions", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "undo", - text: "Undo", - toolTip: "Undo", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-undo" - } - }, - { - id: "redo", - text: "Redo", - toolTip: "Redo", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-redo" - } - } - ], - defaults: { - type: "button", - width: 40, - height: 70 - } - }] - }, - { - text: "View", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "zoomin", - text: "Zoom In", - toolTip: "Zoom In", - buttonSettings: { - width: 58, - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-zoomin" - } - }, - { - id: "zoomout", - text: "Zoom Out", - toolTip: "Zoom Out", - buttonSettings: { - width: 70, - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-zoomout" - } - }, - { - id: "fullscreen", - text: "Full Screen", - toolTip: "Full Screen", - buttonSettings: { - width: 73, - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-fullscreen" - } - } - ], - defaults: { - type: "button", - height: 70 - } - }] - }] - },{ - id: "insert", text: "INSERT", groups: [{ - text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{ - groups: [{ - id: "tables", - text: "Tables", - toolTip: "Tables", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-table" - } - } - ], - defaults: { - type: "button", - width: 50, - height: 70 - } - }] - }, - { - text: "Illustrations", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "pictures", - text: "Pictures", - toolTip: "Pictures", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-picture" - } - }, - { - id: "videos", - text: "Videos", - toolTip: "Videos", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-video" - } - }, - { - id: "shapes", - text: "Shapes", - toolTip: "Shapes", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-shape" - } - }, - { - id: "charts", - text: "Charts", - toolTip: "Charts", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-chart" - } - } - ], - defaults: { - type: "button", - width: 56, - height: 70 - } - }] - }, - { - text: "Comments", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "comments", - text: "Comments", - toolTip: "Comments", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-comment" - } - } - ], - defaults: { - type: "button", - width: 70, - height: 70 - } - }] - }, - { - text: "Text", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "text", - text: "Text", - toolTip: "Text", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-text", - width: 50 - } - }, - { - id: "datetime", - text: "Date Time", - toolTip: "DateTime", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-datetimenew" - } - } - ], - defaults: { - type: "button", - width: 70, - height: 70 - } - }] - }, - { - text: "Hyperlink", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "hyperlink", - text: "Hyperlink", - toolTip: "Hyperlink", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-hyperlink" - } - } - ], - defaults: { - type: "button", - width: 70, - height: 70 - } - }] - }, - { - text: "Equation", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "equation", - text: "Equation", - toolTip: "Equation", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-equation" - } - } - ], - defaults: { - type: "button", - width: 60, - height: 70 - } - }] - }, - { - text: "Print Layout", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "printlayout", - text: "Print Layout", - toolTip: "Print Layout", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-printlayout" - } - } - ], - defaults: { - type: "button", - width: 80, - height: 70 - } - }] - }, - { - text: "Save", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "print", - text: "Print", - toolTip: "Print", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-print" - } - }, - { - id: "save", - text: "Save", - toolTip: "Save", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-save" - } - } - ], - defaults: { - type: "button", - width: 50, - height: 70 - } - }] - } - ] - } - ], - create: function createControl(args) { - var ribbon = $("#defaultRibbon").data("ejRibbon"); - $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); - $("#fillcolor").ejColorPicker({ value: "#FF0000", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fillcoloricon", select: colorHandler }); - } - }); - }); -} -function colorHandler(args:any) { - (this._id.indexOf("fillcolor") != -1) ? $("#contenteditor").css('background-color', args.value) : document.execCommand('forecolor', false, args.value); -} - - - - - - -module RotatorComponent { - $(function () { - var rotatorInstance = new ej.Rotator($("#sliderContent"), { - slideWidth: "100%", - frameSpace: "0px", - slideHeight: "auto", - displayItemsCount: "1", - navigateSteps: "1", - pagerPosition:"outside", - orientation: "horizontal", - showPager: true, - enabled: true, - showCaption: true, - allowKeyboardNavigation: true, - showPlayButton: true, - isResponsive:true, - animationType: "slide", - }); - }); -} - - - -module RTEComponent { - $(function () { - var sample = new ej.RTE($("#rteSample"),{ - width: "100%", - minWidth: "150px", - showFooter: true, - showHtmlSource: true, - allowEditing: true, - allowKeyboardNavigation: true, - autoFocus: true, - autoHeight: true, - colorPaletteColumns: 10, - colorPaletteRows: 5, - cssClass: 'gradient-lime', - enableResize: true, - enableTabKeyNavigation: true, - fileBrowser: { - filePath: "../FileExplorerContent/", - extensionAllow: "*.png, *.doc, *.pdf, *.txt, *.docx", - ajaxAction: "http://mvc.syncfusion.com/OdataServices/api/fileoperation/", - }, - imageBrowser: { - filePath: "../FileExplorerContent/", - extensionAllow: "*.png, *.gif, *.jpg, *.jpeg, *.docx", - ajaxAction: "http://mvc.syncfusion.com/OdataServices/api/fileoperation/", - }, - isResponsive: true, - showClearAll: true, - showClearFormat: true, - showDimensions: true, - showCharCount: true, - tools: { - formatStyle: ["format"], - edit: ["findAndReplace"], - font: ["fontName", "fontSize", "fontColor", "backgroundColor"], - style: ["bold", "italic", "underline", "strikethrough"], - alignment: ["justifyLeft", "justifyCenter", "justifyRight", "justifyFull"], - lists: ["unorderedList", "orderedList"], - clipboard: ["cut", "copy", "paste"], - doAction: ["undo", "redo"], - indenting: ["outdent", "indent"], - clear: ["clearFormat", "clearAll"], - links: ["createLink", "removeLink"], - images: ["image"], - media: ["video"], - tables: ["createTable", "addRowAbove", "addRowBelow", "addColumnLeft", "addColumnRight", "deleteRow", "deleteColumn", "deleteTable"], - effects: ["superscript", "subscript"], - casing: ["upperCase", "lowerCase"], - view: ["fullScreen", "zoomIn", "zoomOut"], - print: ["print"], - customUnorderedList: [{ - name: "unOrderInsert", - tooltip: "Custom UnOrderList", - css: "e-rte-toolbar-icon e-rte-unlistitems customUnOrder", - text: "Smiley", - listImage: "url('../content/images/rte/Smiley-GIF.gif')" - }], - customOrderedList: [{ - name: "orderInsert", - tooltip: "Custom OrderList", - css: "e-rte-toolbar-icon e-rte-listitems customOrder", - text: "Lower-Greek", - listStyle: "lower-greek" - }] - } - }); - }); - -} - - - -declare var window :myWindow; -export interface myWindow extends Window{ -Default:any; -} -module ScheduleComponent { - $(function () { - var sample = new ej.Schedule($("#Schedule1"), { - width: "100%", - height: "525px", - currentDate: new Date(2014, 4, 5), - timeScale: { - minorSlotCount: 4, - majorSlot: 60 - }, - contextMenuSettings: { - enable: true, - menuItems: { - appointment: [ - { id: "open", text: "Open Appointment" }, - { id: "delete", text: "Delete Appointment" }, - { id: "customMenu3", text: "Menu Item 3" }, - { id: "customMenu4", text: "Menu Item 4" } - ], - cells: [ - { id: "new", text: "New Appointment" }, - { id: "recurrence", text: "New Recurring Appointment" }, - { id: "today", text: "Today" }, - { id: "gotodate", text: "Go to date" }, - { id: "settings", text: "Settings" }, - { id: "view", text: "View", parentId: "settings" }, - { id: "timemode", text: "TimeMode", parentId: "settings" }, - { id: "view_Day", text: "Day", parentId: "view" }, - { id: "view_Week", text: "Week", parentId: "view" }, - { id: "view_Workweek", text: "Workweek", parentId: "view" }, - { id: "view_Month", text: "Month", parentId: "view" }, - { id: "timemode_Hour12", text: "12 Hours", parentId: "timemode" }, - { id: "timemode_Hour24", text: "24 Hours", parentId: "timemode" }, - { id: "workhours", text: "Work Hours", parentId: "settings" }, - { id: "customMenu1", text: "Menu Item 1" }, - { id: "customMenu2", text: "Menu Item 2" } - ] - } - }, - resources: [{ - field: "ownerId", - title: "Owner", - name: "Owners", allowMultiple: true, - resourceSettings: { - dataSource: [ - { text: "Nancy", id: 1, groupId: 1, color: "#f8a398" }, - { text: "Steven", id: 3, groupId: 2, color: "#56ca85" }, - { text: "Michael", id: 5, groupId: 1, color: "#51a0ed" } - ], - text: "text", id: "id", groupId: "groupId", color: "color" - } - }], - appointmentSettings: { - dataSource: new ej.DataManager(window.Default).executeLocal(new ej.Query().take(10)), - id: "Id", - subject: "Subject", - startTime: "StartTime", - endTime: "EndTime", - description: "Description", - allDay: "AllDay", - recurrence: "Recurrence", - recurrenceRule: "RecurrenceRule", - resourceFields: "ownerId" - } - }); - }); -} - - - -module ScrollerComponent { - $(function () { - var scrollerSample = new ej.Scroller($("#scrollcontent"), { - height: "300px", - width: "100%" - }); - $(window).bind('resize', function () { - scrollerSample.refresh(); - }); - - }); -} - - - - - -module SliderComponent { - $(function () { - var slider = new ej.Slider($("#minSlider"), { - sliderType: "MinRange", - height: "16px", - width: "300px", - value: 60, - minValue: 0, - maxValue: 100 - }); - var rangeslider = new ej.Slider($("#rangeSlider"), { - sliderType: "Range", - height: "16px", - width: "300px", - values: [30, 60], - minValue: 0 - }); - - }); -} - - - - - - -module linesparkline { - $(function () { - - var sparklinesample = new ej.Sparkline($("#line"), { - dataSource: [12, 14, 11, 12, 11, 15, 12, 10, 11, 12, 15, 13, 12, 11, 10, 13, 15, 12, 14, 16, 14, 12, 11], - tooltip: { - visible: true, - font: { size:"12px" } - }, - type: "line", - size: { height: "40", width:"170" }, - }); - }); -} - -module columnsparkline { - $(function () { - var sparkcolumnsample = new ej.Sparkline($("#column"), { - dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10,], - negativePointColor: "red", - highPointColor: "blue", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - type: "column", - size: { height: "100", width: "150" }, - }); - }); -} - -module areasparkline { - $(function () { - var sparkareasample = new ej.Sparkline($("#area"), { - dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10,], - markerSettings: { visible: true }, - highPointColor: "blue", - lowPointColor: "orange", - type: "area", - opacity: 0.5, - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "100", width: "150" }, - }); - }); -} - -module windlosssparkline { - $(function () { - var sparkwinlosssample = new ej.Sparkline($("#winloss"), { - dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10,], - type: "winloss", - size: { height: "100", width: "150" }, - }); - }); -} - -module piesparkline1 { - $(function () { - var sparkpiesample1 = new ej.Sparkline($("#pie1"), { - dataSource: [4, 6, 7], - type: "pie", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "40", width: "40" }, - }); - }); -} - -module piesparkline2 { - $(function () { - var sparkpiesample2 = new ej.Sparkline($("#pie2"), { - dataSource: [8, 9, 1,], - type: "pie", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "40", width: "40" }, - }); - }); -} - -module piesparkline3 { - $(function () { - var sparkpiesample3 = new ej.Sparkline($("#pie3"), { - dataSource: [2, 3, 5], - type: "pie", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "40", width: "40" }, - }); - }); -} - -module piesparkline4 { - $(function () { - var sparkpiesample4 = new ej.Sparkline($("#pie4"), { - dataSource: [10, 12, 11], - type: "pie", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "40", width: "40" }, - }); - }); -} - - - - - - -module SplitterComponent { - $(function () { - var splitterInstance = new ej.Splitter($("#outterSpliter"), { - height: "250px", - width: "50%", - orientation: ej.Orientation.Vertical, - properties: [{}, { paneSize: 80 }], - isResponsive:true - }); - var splitterInstance1 = new ej.Splitter($("#innerSpliter"), { - isResponsive:true, - }); - }); -} - - - -module SpreadsheetComponent { -$(function () { - var sample = new ej.Spreadsheet($("#basicSpreadsheet"), { - scrollSettings: { - height: 550, - }, - importSettings: { - importMapper: (window).baseurl + "api/JSXLExport/Import" - }, - exportSettings: { - excelUrl: (window).baseurl + "api/JSXLExport/ExportToExcel", - csvUrl: (window).baseurl + "api/JSXLExport/ExportToCsv", - pdfUrl: (window).baseurl + "api/JSXLExport/ExportToPdf" - }, - sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { - var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; - if (!(spreadsheet).isImport) { - spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); - xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); - xlFormat.format({ "type": "currency" }, "E2:H11"); - spreadsheet.XLRibbon.updateRibbonIcons(); - }} - }); - }); -} - - - - -module TabComponent { - $(function () { - var sample = new ej.Tab($("#defaultTab"),{ - width: "500px", - collapsible: true, - events: "click", - heightAdjustMode: ej.Tab.HeightAdjustMode.Content, - showCloseButton: true, - showRoundedCorner: false - }); - }); -} - - - -module TagCloudComponent { - - - var websiteCollection = [ - { text: "Google", url: "http://www.google.com", frequency: 12 }, - { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, - { text: "Arts Technica", url: "http://arstechnica.com/", frequency: 8 }, - { text: "Business Week", url: "http://www.businessweek.com/", frequency: 2 }, - { text: "Yahoo", url: "http://in.yahoo.com/", frequency: 12 }, - { text: "Center Networks", url: "http://www.centernetworks.com/", frequency: 5 }, - { text: "Crave", url: "http://news.cnet.com/crave/", frequency: 8 }, - { text: "Crunch Gear", url: "http://techcrunch.com/gadgets/", frequency: 20 }, - { text: "Daily Tech", url: "http://www.dailytech.com/", frequency: 1 }, - { text: "Electronista", url: "http://www.electronista.com/", frequency: 3 }, - { text: "Engadget", url: "http://www.engadget.com/", frequency: 5 }, - { text: "Gearlog", url: "http://www.gearlog.com/", frequency: 9 }, - { text: "Information Week", url: "http://www.informationweek.com/", frequency: 0 }, - { text: "PCWorld", url: "http://www.pcworld.com/", frequency: 11 }, - { text: "Tech Republic", url: "http://techrepublic.com/", frequency: 3 }, - { text: "Valleywag", url: "http://valleywag.gawker.com/", frequency: 6 }, - { text: "Rediff", url: "http://in.rediff.com/", frequency: 9 }, - { text: "WebProNews", url: "http://www.webpronews.com/", frequency: 2 } - ]; - - $(function () { - var sample = new ej.TagCloud($("#techWebList"), { - titleText: "Tech Sites", - dataSource: websiteCollection, - cssClass: "gradient-lime", - fields: { - text: "text", url: "url", frequency: "frequency" - } - }); - - }); -} - - - -module EditorComponent { - $(function () { - var num = new ej.NumericTextbox($("#numeric"), { - value: 30, - minValue: 1, - maxValue: 100, - name: "numeric", - width: "100%" - }); - var per = new ej.PercentageTextbox($("#percent"), { - value: 60, - minValue: 10, - maxValue: 1000, - name: "percent", - width: "100%" - }); - var cur = new ej.CurrencyTextbox($("#currency"), { - value: 100, - minValue: 10, - maxValue: 1000, - name: "currency", - width: "100%" - }); - var mask = new ej.MaskEdit($("#maskedit"), { - name: "mask", - value: "4242422424", - maskFormat: "99 999-99999", - width: "100%" - }) - }); -} - - - - - -module AccordionComponent { - $(function () { - var tile1 = new ej.Tile($("#tile1"), { - imagePosition:"fill", - caption:{text:"People"}, - tileSize:"medium", - imageUrl:'content/images/tile/windows/people_1.png' - }); - var tile2 = new ej.Tile($("#tile2"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/alerts.png', - - }); - var tile3 = new ej.Tile($("#tile3"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/bing.png', - }); - var tile4 = new ej.Tile($("#tile4"), { - tileSize:"small", - imageUrl:'content/images/tile/windows/camera.png', - }); - var tile5 = new ej.Tile($("#tile5"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/messages.png', - }); - var tile6 = new ej.Tile($("#tile6"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/games.png', - caption:{text:"Play"} - }); - var tile7 = new ej.Tile($("#tile7"), { - tileSize:"medium", - imageUrl:'content/images/tile/windows/map.png', - caption:{text:"Maps"} - }); - var tile8 = new ej.Tile($("#tile8"), { - imagePosition:"fill", - tileSize:"wide", - imageUrl:'content/images/tile/windows/sports.png', - caption:{text:"Sports"} - }); - var tile9 = new ej.Tile($("#tile9"), { - imagePosition:"fill", - tileSize:"medium", - imageUrl:'content/images/tile/windows/people_2.png', - caption:{text:"People"} - }); - var tile10 = new ej.Tile($("#tile10"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/pictures.png', - caption:{text:"Photo"} - }); - var tile11 = new ej.Tile($("#tile11"), { - imagePosition:"center", - tileSize:"wide", - imageUrl:'content/images/tile/windows/weather.png', - caption:{text:"Weather"} - }); - var tile12 = new ej.Tile($("#tile12"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/music.png', - caption:{text:"Music"} - }); - var tile13 = new ej.Tile($("#tile13"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/favs.png', - caption:{text:"Favorites"} - }); - }); -} - - - -module TimePickerComponent { - $(function () { - var timeSample = new ej.TimePicker($("#timepick"), { - width: "100%" - }); - }); -} - - - - -module ToolbarComponent { - - $(function () { - var sample = new ej.Toolbar($("#editingToolbar"),{ - width: "100%", - cssClass: "gradient-lime", - enableSeparator: true, - height: 30, - isResponsive: true, - orientation: ej.Orientation.Horizontal, - showRoundedCorner: true - }); - }); - -} - - - - -module TooltipComponent { - - $(function () { - - var sample1 = new ej.Tooltip($("#link1"),{ - content: "ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.", - associate: "mousefollow", - autoCloseTimeout: 5000, - collision: "fit", - containment: ".frame", - showRoundedCorner: true, - showShadow: true - }); - - var sample2 = new ej.Tooltip($("#link2"),{ - content: "The World Wide Web (WWW) is an information space where documents and other web resources are identified by URLs, interlinked by hypertext links, and can be accessed via the Internet.", - position: { - stem: { - horizontal: "left", - vertical: "center" - }, - target: { - horizontal: "right", - vertical: "center", - }, - }, - autoCloseTimeout: 5000, - collision: "fit", - containment: ".frame", - showRoundedCorner: true, - showShadow: true - }); - - var sample3 = new ej.Tooltip($("#link3"),{ - content: 'Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic.', - position: { - stem: { - horizontal: "right", - vertical: "center" - }, - target: { - horizontal: "left", - vertical: "center", - }, - }, - associate: "mousefollow", - autoCloseTimeout: 5000, - collision: "fit", - containment: ".frame", - showRoundedCorner: true, - showShadow: true - }); - }); -} - - - -module TreeGridComponent { - $(function () { - var treegridInstance = new ej.TreeGrid($("#TreeGridContainer"), { - dataSource: (window).treeGridData, - childMapping: "subtasks", - allowSorting: true, - allowMultiSorting: true, - enableAltRow: true, - allowFiltering: true, - treeColumnIndex: 1, - allowKeyboardNavigation: true, - showColumnChooser: true, - showColumnOptions: true, - contextMenuSettings: { - showContextMenu: true, - contextMenuItems: ["add", "edit", "delete"] - }, - columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], - editSettings: { - allowAdding: true, - allowEditing: true, - allowDeleting: true, - editMode: "cellEditing", - rowPosition: "belowSelectedRow" - }, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add","edit","delete","update","cancel","expandAll","collapseAll"] - }, - columns: [ - { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, - { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, - { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker" }, - { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker" }, - { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } - ], - isResponsive: true, - }); -}); -} - - - - -var population_data: Array = [ - { Continent: "Asia", Country: "Indonesia", Growth: 3, Population: 237641326 }, - { Continent: "Asia", Country: "Russia", Growth: 2, Population: 152518015 }, - { Continent: "Asia", Country: "Malaysia", Growth: 1, Population: 29672000 }, - { Continent: "North America", Country: "United States", Growth: 4, Population: 315645000 }, - { Continent: "North America", Country: "Mexico", Growth: 2, Population: 112336538 }, - { Continent: "North America", Country: "Canada", Growth: 1, Population: 39056064 }, - { Continent: "South America", Country: "Colombia", Growth: 1, Population: 47000000 }, - { Continent: "South America", Country: "Brazil", Growth: 3, Population: 193946886 }, - { Continent: "Africa", Country: "Nigeria", Growth: 2, Population: 170901000 }, - { Continent: "Africa", Country: "Egypt", Growth: 1, Population: 83661000 }, - { Continent: "Europe", Country: "Germany", Growth: 1, Population: 81993000 }, - { Continent: "Europe", Country: "France", Growth: 1, Population: 65605000 }, - { Continent: "Europe", Country: "UK", Growth: 1, Population: 63181775 } -]; - -module treemapcomponent { - $(function () { - var treemapsample = new ej.datavisualization.TreeMap($("#treemap"), { - leafItemSettings: { showLabels: true, labelPath: "Country" }, - rangeColorMapping: [ - { color: "#77D8D8", legendLabel: "1% Growth", from: 0, to: 1 }, - { color: "#AED960", from: 0, legendLabel: "2% Growth", to: 2 }, - { color: "#FFAF51", from: 0, legendLabel: "3% Growth", to: 3 }, - { color: "#F3D240", from: 0, legendLabel: "4% Growth", to: 4 } - ], - levels: [ - { groupPath: "Continent", groupGap: 5, headerHeight: 25, showHeader: true, headerTemplate: 'headertemplate' } - ], - dataSource: population_data, - colorValuePath: "Growth", - weightValuePath: "Population", - borderThickness: 0, - showLegend: true - }); - }); -} - - - - - -module TreeViewComponent { - $(function () { - var tree = new ej.TreeView($("#treeView"), { - allowEditing: true, - allowDragAndDrop: true, - allowDropChild: true, - allowDropSibling: true, - }); - }); -} - - - - -module UploadboxComponent { - - $(function () { - var sample = new ej.Uploadbox($("#UploadDefault"),{ - saveUrl: "uploadbox/saveFiles.ashx", - removeUrl: "uploadbox/removeFiles.ashx", - buttonText: { - browse: "Choose File", upload: "Upload the File", cancel: "Cancel the Upload" - }, - cssClass: "gradient- purple", - dialogAction: { - modal: false, closeOnComplete: false, drag: true - }, - extensionsAllow: ".zip", - multipleFilesSelection: true, - showFileDetails: true - }); - }); - -} - - - - -module WaitingPopupComponent { - $(function () { - var sample = new ej.WaitingPopup($("#target"),{ - showOnInit: true, - showImage: true, - text: 'waiting…' - }); - }); - -} +/// +/// + + + + +module AccordionComponent { + $(function () { + var sample = new ej.Accordion($("#basicAccordion"), { + width: "100%", + allowKeyboardNavigation: true, + collapseSpeed: 500, + collapsible: true, + enableAnimation: true, + enableMultipleOpen: true, + events: "click", + expandSpeed: 500, + headerSize: "40px", + htmlAttributes: { title: "Demo" }, + selectedItemIndex: 1, + showCloseButton: true, + showRoundedCorner: true + }); + }); +} + + + +module AutocompleteComponent{ + var carList = [ + "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", + "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", + "Chevrolet Camaro", "Cadillac", + "Duesenberg J", "Dodge Sprinter", + "Elantra", "Excavator", + "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", + "GAZ Siber", + "Honda S2000", "Hyundai Santro", + "Isuzu Swift", "Infiniti Skyline", + "Jaguar XJS", + "Kia Sedona EX", "Koenigsegg Agera", + "Lotus Esprit", "Lamborghini Diablo", + "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", + "Nissan Qashqai", + "Oldsmobile S98", "Opel Superboss", + "Porsche 356", "Pontiac Sunbird", + "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", + "Triumph Spitfire", "Toyota 2000GT", + "Volvo P1800", "Volkswagen Shirako" + ]; + $(function () { + var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { + width: "100%", + watermarkText: "Select a car", + dataSource: carList, + enableAutoFill: true, + showPopupButton: true, + multiSelectMode: "delimiter" + }); + }); +} + + + + + +module Barcodecomponent { + $(function () { + var barcodesample = new ej.datavisualization.Barcode($("#Barcode"), { + text:"http://www.syncfusion.com" + }); + }); +} + + + + + +module Bulletgraphcomponent { + $(function () { + var bulletsample = new ej.datavisualization.BulletGraph($("#BulletGraph"), { + isResponsive: true, + tooltipSettings: { visible: true }, + quantitativeScaleSettings: { + featureMeasures: [{ + value: 8, comparativeMeasureValue:6.7 + }] + }, + qualitativeRanges: [{ + rangeEnd: 4.3, rangeStroke:"#ebebeb", + }, + { + rangeEnd: 7.3, rangeStroke:"#d8d8d8" + }, + { + rangeEnd: 10, rangeStroke: "#7f7f7f" + } + ], + captionSettings: { + textPosition: 'right', text: 'Revenue YTD', + subTitle: { + text: "$ in Thousands", textPosition:"right" + } + } + }); + }); +} + + + + + +module ButtonComponent { + $(function () { + var basicButton = new ej.Button($("#buttonnormal"), { + size: "large", + showRoundedCorner: true, + contentType: "textandimage", + prefixIcon: "e-icon e-save", + text: "Save" + }); + var toggleButton = new ej.ToggleButton($("#TextOnly"), { + showRoundedCorner: true, + size: "large", + contentType: "textandimage", + defaultPrefixIcon: "e-icon e-save", + activePrefixIcon: "e-icon e-delete", + defaultText: "Save", + activeText: "Delete" + }); + var splitbuttonnormal = new ej.SplitButton($("#splitbuttonnormal"), { + showRoundedCorner: true, + size: "large", + prefixIcon: "e-icon e-file-empty", + targetID: "menu1", + contentType: "textandimage", + text: "File" + }); + var groupButton = new ej.GroupButton($("#groupButton"), { + showRoundedCorner: true, + size: "large" + }); + var check1 = new ej.CheckBox($("#check1"), { + size: "medium", enableTriState: true + }); + var check2 = new ej.CheckBox($("#check2"), { + size: "medium", enableTriState: true + }); + var radio1 = new ej.RadioButton($("#radio1"), { + size: "medium" + }); + var radio2 = new ej.RadioButton($("#radio2"), { + size: "medium", checked: true + }); + }); +} + + + + +module ChartComponent { + $(function () { + var chartsample = new ej.datavisualization.Chart($("#Chart"), { + primaryXAxis: { + range: { min: 2005, max: 2011, interval: 1 }, + title: { text: "Year" }, + valueType: "category" + }, + primaryYAxis: { + range: { min: 25, max: 50, interval: 5 }, + labelFormat: "{value}%", + title: { text: "Efficiency" }, + + }, + commonSeriesOptions: + { + type: 'line', enableAnimation: true, + tooltip:{ visible :true, template:'Tooltip'}, + marker: + { + shape: 'circle', + size: + { + height: 10, width: 10 + }, + visible: true + }, + border : {width: 2} + }, + series: + [ + { + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + name: 'India' + }, + { + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + name: 'Germany' + }, + { + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + name: 'England' + }, + { + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + name: 'France' + } + ], + isResponsive: true, + load: function () { + var sender = $("#Chart").data("ejChart"); + if (!!window.orientation && sender) { //to modify chart properties for mobile view + var model = sender.model, + seriesLength = model.series.length; + model.legend.visible = false; + model.size.height = null; + model.size.width = null; + for (var i = 0; i < seriesLength; i++) { + if (!model.series[i].marker) + model.series[i].marker = {}; + if (!model.series[i].marker.size) + model.series[i].marker.size = {}; + model.series[i].marker.size.width = 6; + model.series[i].marker.size.height = 6; + } + model.primaryXAxis.labelIntersectAction = "rotate45"; + if (model.primaryXAxis.title) + model.primaryXAxis.title.text = ""; + if (model.primaryYAxis.title) + model.primaryYAxis.title.text = ""; + model.primaryXAxis.edgeLabelPlacement = "hide"; + model.primaryYAxis.labelIntersectAction = "rotate45"; + model.primaryYAxis.edgeLabelPlacement = "hide"; + } + }, + title: { text: 'Efficiency of oil-fired power production' }, + size: { height: "600" }, + legend: { visible: true} + }); + }); +} + + + + + +module circulargaugecomponent { + $(function () { + var circularsample = new ej.datavisualization.CircularGauge($("#CircularGauge"), { + enableAnimation: false, + isResponsive: true, + backgroundColor: "transparent", width: 500, + scales: [{ + showRanges: true, + startAngle: 122, sweepAngle: 296, radius: 130, showScaleBar: true, size: 1, maximum: 120, majorIntervalValue: 20, minorIntervalValue: 10, + border: { + width: 0.5, + }, + pointers: [{ + value: 60, + showBackNeedle: true, + backNeedleLength: 20, + length: 95, + width: 7 + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, { type: "minor", height: 8, width: 1, distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -30, + startValue: 0, + endValue: 70 + }, { + distanceFromScale: -30, + startValue: 70, + endValue: 110, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -30, + startValue: 110, + endValue: 120, + backgroundColor: "#f5b43f", + border: { color: "#f5b43f" } + }] + }] + }); + }); +} + + + + +module ColorPickerComponent { + $(function () { + var colorSample = new ej.ColorPicker($("#colorpick"), { + value: "#278787" + }); + }); +} + + + + +module DatePickerComponent { + $(function () { + var dateSample = new ej.DatePicker($("#datepick"), { + width: "100%" + }); + }); +} + + + + +module DateTimePickerComponent { + $(function () { + var datetimeSample = new ej.DateTimePicker($("#datetimepick"), { + width: "100%" + }); + }); +} + + + +$(function () { + var diagram = new ej.datavisualization.Diagram($("#diagram"), { + width: "1000px", + height: "600px", + pageSettings: { + //Sets page size + pageHeight: 500, + pageWidth: 500, + //Customizes the appearance of page + pageBorderWidth: 4, + pageBackgroundColor: "white", + pageBorderColor: "lightgray", + pageMargin: 25, + showPageBreak: true, + multiplePage: true, + pageOrientation: ej.datavisualization.Diagram.PageOrientations.Portrait + }, + scrollSettings: { + horizontalOffset: 0, + verticalOffset: 0 + }, + snapSettings: { + snapConstraints: ej.datavisualization.Diagram.SnapConstraints.ShowLines + }, + nodes: [ + createNode({ name: "NewIdea", width: 150, height: 60, offsetX: 300, offsetY: 60, labels: [createLabel({ "text": "New idea identified" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Terminator }), + createNode({ name: "Meeting", width: 150, height: 60, offsetX: 300, offsetY: 155, labels: [createLabel({ "text": "Meeting with board" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), + createNode({ + name: "BoardDecision", width: 150, height: 110, offsetX: 300, offsetY: 280, labels: [createLabel({ text: "Board decides \nwhether \nto proceed", wrapText: "true", "margin": { left: 20, top: 0, right: 20, bottom: 0 } })], + type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision + }), + createNode({ name: "Project", width: 150, height: 100, offsetX: 300, offsetY: 430, labels: [createLabel({ "text": "Find Project \nmanager" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision }), + createNode({ + name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), + createNode({ name: "Decision", width: 250, height: 60, offsetX: 550, offsetY: 60, labels: [createLabel({ "text": "Decision Process for new software ideas" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Card, fillColor: "#858585", borderColor: "#858585" }), + createNode({ name: "Reject", width: 150, height: 60, offsetX: 550, offsetY: 285, labels: [createLabel({ "text": "Reject and write report" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), + createNode({ name: "Resources", width: 150, height: 60, offsetX: 550, offsetY: 430, labels: [createLabel({ "text": "Hire new resources" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }) + ], + connectors: [ + createConnector({ name: "connector1", sourceNode: "NewIdea", targetNode: "Meeting" }), + createConnector({ name: "connector2", sourceNode: "Meeting", targetNode: "BoardDecision" }), + createConnector({ name: "connector3", sourceNode: "BoardDecision", targetNode: "Project", labels: [createLabel({ "text": "Yes" })] }), + createConnector({ name: "connector4", sourceNode: "Project", targetNode: "End", labels: [createLabel({ "text": "Yes" })] }), + createConnector({ name: "connector5", sourceNode: "BoardDecision", targetNode: "Reject", labels: [createLabel({ "text": "No" })] }), + createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) + ] + }); + +}); + +function createNode(option: ej.datavisualization.Diagram.Node) { + if (!option.fillColor) { + option.borderColor = "#1BA0E2"; + option.fillColor = "#1BA0E2"; + } + option.labels[0].fontColor = "white"; + return option; +} + +function createConnector(option: ej.datavisualization.Diagram.Connector) { + option.targetDecorator = { shape: ej.datavisualization.Diagram.DecoratorShapes.Arrow, borderColor: "#606060", width: 10, height: 10 }; + option.lineColor = "#606060"; + if (option.labels && option.labels.length > 0) { + option.labels[0].fillColor = "white"; + } + return option; +} + +function createLabel(options : any) { + return options; +} + + + +module DialogComponent { + $(function () { + var dialogInstance = new ej.Dialog($("#basicDialog"), { + width: 550, + minWidth: 310, + minHeight: 215, + target:".control", + close:()=>{ + $("#btnOpen").show();} + }); + var btnInstance = new ej.Button($("#btnOpen"), { + size: "medium", + click: ()=>{ + $("#btnOpen").hide(); + $("#basicDialog").ejDialog("open");}, + type: "button", + height: 30, + width: 150 + }); + }); +} + + + + +module digitalgaugecomponent { + $(function () { + var digitalgaugesample = new ej.datavisualization.DigitalGauge($("#DigitalGauge"), { + width: 525, + height: 305, + isResponsive: true, + items: [{ + segmentSettings: { + width: 1, + spacing: 0, + color: "#8c8c8c" + }, + characterSettings: { + opacity: 0.8, + }, + value: "Syncfusion", + position: { x: 52, y: 52 } + }] + }); + }); +} + + + + + + +module DropDownListComponent { + var BikeList = [ + { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, + { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, + { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, + { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } + ]; + $(function () { + var sample = new ej.DropDownList($("#bikeList"),{ + dataSource: BikeList, + width: "100%", + watermarkText: "Select a bike", + fields: { id: "empid", text: "text", value: "text" }, + enableFilterSearch: true, + caseSensitiveSearch: true, + enableIncrementalSearch: true, + enablePopupResize: true, + delimiterChar: ";", + multiSelectMode: ej.MultiSelectMode.Delimiter, + maxPopupHeight: "300px", + minPopupHeight: "150px", + maxPopupWidth: "500px", + minPopupWidth: "350px", + showCheckbox: true, + showRoundedCorner: true + }); + }); + +} + + + + + + +module ExplorerComponent { + $(function () { + var file = new ej.FileExplorer($("#fileExplorer"), { + path: (window).baseurl + "Content/FileBrowser/", + width: "100%", + minWidth: "150px", + layout: "tile", + isResponsive: true, + ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" + }); + }); +} + + + + +module GanttComponent { + $(function () { + var ganttInstance = new ej.Gantt($("#GanttContainer"), { + dataSource: (window).projectData, + allowColumnResize: true, + allowSorting: true, + allowSelection: true, + enableContextMenu: true, + taskIdMapping: "taskID", + allowDragAndDrop: true, + taskNameMapping: "taskName", + startDateMapping: "startDate", + showColumnChooser: true, + showColumnOptions: true, + progressMapping: "progress", + durationMapping: "duration", + endDateMapping: "endDate", + childMapping: "subtasks", + scheduleStartDate: "02/01/2014", + scheduleEndDate: "04/09/2014", + //Resources mapping + resourceInfoMapping: "resourceId", + resourceNameMapping: "resourceName", + resourceIdMapping: "resourceId", + resources: (window).projectResources, + predecessorMapping: "predecessor", + showResourceNames: true, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add","edit","delete","update","cancel","indent","outdent","expandAll","collapseAll","search"] + }, + editSettings: { + allowEditing: true, + allowAdding: true, + allowDeleting: true, + allowIndent: true, + editMode: "cellEditing" + }, + sizeSettings: { + width: "100%", + height: "100%" + }, + dragTooltip: { showTooltip: true }, + showGridCellTooltip: true, + treeColumnIndex: 1, + isResponsive: true, + }); +}); +} + + + +module GridComponent { + $(function () { + var gridInstance = new ej.Grid($("#Grid"), { + dataSource: (window).gridData, + allowGrouping: true, + allowSorting: true, + allowMultiSorting: true, + enableAltRow: true, + allowPaging: true, + allowReordering: true, + allowResizing: true, + allowFiltering: true, + allowScrolling: true, + enableRowHover: true, + selectionType: "multiple", + selectionSettings: { enableToggle: true, selectionMode: ["row", "cell", "column"] }, + allowKeyboardNavigation: true, + editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, allowEditOnDblClick: true, showDeleteConfirmDialog: true }, + toolbarSettings: { showToolbar: true, toolbarItems: ["add", "edit", "delete", "update", "cancel", "search"] }, + columns: [ + { field: "OrderID", headerText: "Order ID", isPrimaryKey: true, width: 75, textAlign: ej.TextAlign.Right }, + { field: "CustomerID", headerText: "Customer ID", editType: ej.Grid.EditingType.String, width: 80 }, + { field: "EmployeeID", headerText: "Employee ID", width: 75, editType: ej.Grid.EditingType.Dropdown, textAlign: ej.TextAlign.Right, priority: 4 }, + { field: "Freight", width: 75, format: "{0:C}", editType: ej.Grid.EditingType.Numeric, textAlign: ej.TextAlign.Right, priority: 3 }, + { field: "OrderDate", headerText: "Order Date", width: 80, format: "{0:MM/dd/yyyy}", textAlign: ej.TextAlign.Right, priority: 2 }, + { field: "ShipCity", headerText: "Ship City", editType: ej.Grid.EditingType.Dropdown, width: 110, priority: 2 } + ], + isResponsive: true, + minWidth: 700, + showSummary: true, + summaryRows: [{ title: "Sum", summaryColumns: [{ summaryType: ej.Grid.SummaryType.Sum, displayColumn: "Freight", dataMember: "Freight", format: "{0:C2}" }] }] + }); + }); +} + + + +var columns = ["Vegie-spread", "Tofuaa", "Alice Mutton", "Konbu", "Fløtemysost"] +var itemSource: any[] = []; +for (var i = 0; i < columns.length; i++) { + for (var j = 0; j < 6; j++) { + var value = Math.floor((Math.random() * 100) + 1); + itemSource.push({ ProductName: columns[i], Year: "Y" + (2011 + j), Value: value }) + } +} + +$(function () { + var heatmap = new ej.datavisualization.HeatMap($("#heatmap"), { + colorMappingCollection: [ + { value: 0, color: "#8ec8f8", label: { text: "0" } }, + { value: 100, color: "#0d47a1", label: { text: "100" } } + ], + isResponsive: true, + itemsSource: itemSource, + width: "100%", + itemsMapping: { + column: { propertyName: "ProductName", displayName: "Product Name" }, + row: { propertyName: "Year", displayName: "Year" }, + value: { propertyName: "Value" }, + columnMapping: [ + { "propertyName": columns[0], "displayName": columns[0] }, + { "propertyName": columns[1], "displayName": columns[1] }, + { "propertyName": columns[2], "displayName": columns[2] }, + { "propertyName": columns[3], "displayName": columns[3] }, + { "propertyName": columns[4], "displayName": columns[4] }, + { "propertyName": columns[5], "displayName": columns[5] } + ], + headerMapping: { propertyName: "Year", displayName: "Year", columnStyle: { width: 105, textAlign: "right" } }, + }, + legendCollection: ["heatmap_legend"] + }); + var heatmaplegend = new ej.datavisualization.HeatMapLegend($("#heatmap_legend"), { + colorMappingCollection: [ + { value: 0, color: "#8ec8f8", label: { text: "0" } }, + { value: 100, color: "#0d47a1", label: { text: "100" } } + ], + height: "50px", + width: "75%", + isResponsive: true + }); +}); + + + + +declare var window:myWindow; +export interface myWindow extends Window{ +kanbanData:any; +} +module KanbanComponent { + $(function () { + var sample = new ej.Kanban($("#Kanban"), { + dataSource: new ej.DataManager(window["kanbanData"]).executeLocal(new ej.Query().take(20)), + columns: [ + { headerText: "Backlog", key: "Open" }, + { headerText: "In Progress", key: "InProgress" }, + { headerText: "Testing", key: "Testing" }, + { headerText: "Done", key: "Close" } + ], + keyField: "Status", + allowTitle: true, + fields: { + content: "Summary", + primaryKey: "Id", + imageUrl: "ImgUrl" + }, + allowSelection: false + }); + }); +} + + + + +module lineargaugecomponent { + $(function () { + var linearsample = new ej.datavisualization.LinearGauge($("#LinearGauge"), { + labelColor: "#8c8c8c", width: 500, + isResponsive: true, enableAnimation: false, + scales: [{ + width: 4, border: { color: "transparent", width: 0 }, showBarPointers: false, showRanges: true, length: 310, + position: { x: 52, y: 50 }, markerPointers: [{ + value: 50, length: 10, width: 10, backgroundColor: "#4D4D4D", border: { color: "#4D4D4D" } + }], + labels: [{ font: { size: "11px", fontFamily: "Segoe UI", fontStyle: "bold" }, distanceFromScale: { x: -13 } }], + ticks: [{ type: "majorinterval", width: 1, color: "#8c8c8c" }], + ranges: [{ + endValue: 60, + startValue: 0, + backgroundColor: "#F6B53F", + border: { color: "#F6B53F" }, startWidth: 4, endWidth: 4 + }, { + endValue: 100, + startValue: 60, + backgroundColor: "#E94649", + border: { color: "#E94649" }, startWidth: 4, endWidth: 4 + }] + }] + }); + }); +} + + + + + +module ListBoxComponent { + $(function () { + var listboxInstance = new ej.ListBox($("#selectcar"), { + showCheckbox: true + }); + }); +} + + + +module ListviewComponent { + $(function () { + var listviewInstance = new ej.ListView($("#defaultlistview"), { + enableCheckMark: true, + width: 400 + }); + }); +} + + +var world_map= + { + "type": "FeatureCollection", + "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, + "features": [ + { "type": "Feature", "properties": { "admin": "Afghanistan", "name": "Afghanistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[61.21081709172573, 35.650072333309218], [62.230651483005879, 35.270663967422287], [62.984662306576588, 35.404040839167614], [63.193538445900337, 35.857165635718907], [63.982895949158696, 36.007957465146596], [64.546479119733888, 36.31207326918426], [64.746105177677393, 37.111817735333297], [65.588947788357828, 37.305216783185628], [65.745630731066811, 37.661164048812061], [66.217384881459324, 37.393790188133913], [66.518606805288655, 37.362784328758785], [67.075782098259609, 37.35614390720928], [67.829999627559502, 37.144994004864678], [68.135562371701369, 37.023115139304302], [68.859445835245921, 37.344335842430588], [69.196272820924364, 37.15114350030742], [69.518785434857946, 37.608996690413413], [70.116578403610319, 37.588222764632086], [70.270574171840124, 37.73516469985401], [70.376304152309274, 38.138395901027515], [70.806820509732873, 38.486281643216408], [71.348131137990251, 38.258905341132156], [71.239403924448155, 37.953265082341879], [71.541917759084768, 37.905774441065631], [71.448693475230229, 37.065644843080513], [71.84463829945058, 36.738171291646914], [72.193040805962383, 36.94828766534566], [72.636889682917271, 37.047558091778349], [73.260055779924983, 37.495256862938994], [73.948695916646486, 37.421566270490786], [74.980002475895404, 37.419990139305888], [75.158027785140902, 37.13303091078911], [74.575892775372964, 37.02084137628345], [74.067551710917812, 36.836175645488446], [72.920024855444453, 36.720007025696312], [71.846291945283909, 36.509942328429851], [71.262348260385735, 36.074387518857797], [71.498767938121077, 35.650563259415996], [71.613076206350698, 35.153203436822857], [71.115018751921625, 34.733125718722228], [71.156773309213449, 34.348911444632144], [70.881803012988385, 33.988855902638512], [69.93054324735958, 34.020120144175102], [70.323594191371583, 33.358532619758385], [69.687147251264847, 33.105498969041228], [69.262522007122541, 32.501944078088293], [69.317764113242546, 31.901412258424436], [68.926676873657655, 31.620189113892064], [68.556932000609308, 31.713310044882011], [67.792689243444769, 31.582930406209623], [67.683393589147457, 31.303154201781414], [66.938891229118454, 31.304911200479346], [66.38145755398601, 30.738899237586448], [66.346472609324408, 29.88794342703617], [65.046862013616092, 29.472180691031902], [64.350418735618504, 29.560030625928089], [64.148002150331237, 29.340819200145965], [63.550260858011164, 29.468330796826162], [62.549856805272775, 29.318572496044304], [60.874248488208778, 29.829238999952604], [61.78122155136343, 30.735850328081231], [61.699314406180811, 31.379506130492661], [60.941944614511115, 31.548074652628745], [60.863654819588952, 32.182919623334421], [60.536077915290761, 32.981268825811561], [60.963700392505991, 33.528832302376252], [60.528429803311575, 33.676446031217999], [60.80319339380744, 34.404101874319856], [61.21081709172573, 35.650072333309218]]] } }, + { "type": "Feature", "properties": { "admin": "Angola", "name": "Angola", "continent": "Africa" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[16.326528354567042, -5.877470391466217], [16.573179965896141, -6.622644545115092], [16.860190870845226, -7.222297865429978], [17.089995965247166, -7.545688978712474], [17.472970004962288, -8.068551120641656], [18.134221632569048, -7.987677504104865], [18.464175652752683, -7.847014255406475], [19.016751743249664, -7.988245944860138], [19.166613396896079, -7.738183688999724], [19.417502475673214, -7.155428562044277], [20.037723016040214, -7.116361179231658], [20.091621534920616, -6.943090101756949], [20.60182295093832, -6.939317722199688], [20.514748162526526, -7.299605808138663], [21.728110792739752, -7.290872491081315], [21.74645592620336, -7.920084730667113], [21.949130893652033, -8.305900974158304], [21.80180138518795, -8.908706556842985], [21.875181919042397, -9.523707777548564], [22.208753289486417, -9.894796237836529], [22.155268182064326, -11.084801120653777], [22.402798292742428, -10.99307545333569], [22.837345411884762, -11.017621758674334], [23.456790805767461, -10.867863457892481], [23.912215203555743, -10.926826267137541], [24.017893507592614, -11.237298272347115], [23.904153680118235, -11.722281589406332], [24.079905226342895, -12.191296888887305], [23.930922072045373, -12.565847670138821], [24.0161365088947, -12.91104623784855], [21.933886346125941, -12.898437188369353], [21.887842644953871, -16.080310153876891], [22.562478468524283, -16.898451429921831], [23.215048455506086, -17.523116143465952], [21.377176141045592, -17.930636488519706], [18.956186964603628, -17.789094740472233], [18.263309360434217, -17.309950860262003], [14.209706658595049, -17.353100681225708], [14.058501417709035, -17.423380629142653], [13.462362094789963, -16.971211846588741], [12.814081251688405, -16.941342868724075], [12.21546146001938, -17.111668389558059], [11.734198846085146, -17.301889336824498], [11.640096062881609, -16.673142185129205], [11.778537224991563, -15.793816013250687], [12.123580763404444, -14.878316338767927], [12.175618930722264, -14.449143568583889], [12.500095249083014, -13.547699883684398], [12.738478631245439, -13.137905775609934], [13.312913852601834, -12.483630466362511], [13.633721144269824, -12.038644707897189], [13.738727654686924, -11.297863050993142], [13.686379428775293, -10.73107594161584], [13.38732791510216, -10.373578383020726], [13.120987583069873, -9.766897067914112], [12.875369500386567, -9.166933689005488], [12.929061313537797, -8.959091078327573], [13.23643273280987, -8.56262948978434], [12.933040398824314, -7.596538588087752], [12.728298374083916, -6.927122084178803], [12.227347039446441, -6.294447523629372], [12.322431674863562, -6.100092461779651], [12.735171339578695, -5.965682061388476], [13.024869419006988, -5.984388929878106], [13.375597364971892, -5.864241224799555], [16.326528354567042, -5.877470391466217]]], [[[12.436688266660919, -5.684303887559223], [12.182336866920277, -5.789930515163801], [11.914963006242115, -5.037986748884733], [12.318607618873923, -4.606230157086158], [12.620759718484548, -4.438023369976121], [12.995517205465202, -4.781103203961918], [12.631611769265842, -4.991271254092935], [12.468004184629759, -5.248361504744991], [12.436688266660919, -5.684303887559223]]]] } }, + { "type": "Feature", "properties": { "admin": "Albania", "name": "Albania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.590247430104906, 41.855404161133592], [20.463175083099195, 41.515089016275333], [20.605181919037356, 41.086226304685219], [21.020040317476397, 40.842726955725873], [20.99998986174722, 40.580003973953964], [20.67499677906363, 40.43499990494302], [20.61500044117275, 40.110006822259365], [20.150015903410516, 39.624997666983965], [19.980000441170144, 39.694993394523401], [19.9600016618732, 39.915005805006039], [19.40608198413673, 40.250773423822459], [19.319058872157139, 40.727230129553554], [19.403549838954287, 41.409565741535445], [19.540027296637099, 41.71998607031275], [19.371768833094958, 41.87754751237064], [19.304486118250786, 42.195745144207812], [19.738051385179627, 42.688247382165564], [19.801613396898681, 42.500093492190835], [20.0707, 42.58863], [20.28375451018189, 42.320259507815074], [20.52295, 42.21787], [20.590247430104906, 41.855404161133592]]] } }, + { "type": "Feature", "properties": { "admin": "United Arab Emirates", "name": "United Arab Emirates", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[51.579518670463258, 24.245497137951102], [51.757440626844172, 24.294072984305462], [51.794389275932865, 24.019826158132499], [52.577080519425593, 24.177439276622703], [53.404006788960139, 24.151316840099167], [54.008000929587574, 24.121757920828212], [54.693023716048614, 24.797892360935084], [55.439024692614126, 25.439145209244934], [56.070820753814544, 26.055464178973978], [56.261041701080948, 25.714606431576762], [56.396847365143991, 24.924732163995483], [55.886232537667993, 24.92083059335744], [55.804118686756212, 24.269604193615258], [55.981213820220454, 24.130542914317822], [55.528631626208231, 23.933604030853498], [55.525841098864461, 23.524869289640929], [55.234489373602869, 23.110992743415316], [55.208341098863187, 22.708329982997039], [55.006803012924898, 22.496947536707129], [52.000733270074321, 23.001154486578937], [51.617707553926969, 24.014219265228824], [51.579518670463258, 24.245497137951102]]] } }, + { "type": "Feature", "properties": { "admin": "Argentina", "name": "Argentina", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-65.5, -55.2], [-66.45, -55.25], [-66.95992, -54.89681], [-67.56244, -54.87001], [-68.63335, -54.8695], [-68.634010227583147, -52.636370458874453], [-68.25, -53.1], [-67.75, -53.85], [-66.45, -54.45], [-65.05, -54.7], [-65.5, -55.2]]], [[[-64.964892137294569, -22.075861504812348], [-64.377021043542257, -22.79809132252354], [-63.986838141522462, -21.993644301035953], [-62.84646847192154, -22.034985446869452], [-62.685057135657885, -22.249029229422401], [-60.846564704009928, -23.880712579038299], [-60.028966030503973, -24.032796319273238], [-58.807128465394939, -24.771459242453268], [-57.777217169817952, -25.162339776309032], [-57.633660040911124, -25.603656508081666], [-58.618173590719707, -27.123718763947117], [-57.609759690976134, -27.395898532828419], [-56.486701626192989, -27.548499037386243], [-55.695845506398186, -27.387837009390815], [-54.788794928595038, -26.621785577096087], [-54.625290696823541, -25.739255466415479], [-54.130049607954412, -25.547639255477243], [-53.628348965048716, -26.12486500417743], [-53.648735317587885, -26.923472588816104], [-54.490725267135517, -27.474756768505767], [-55.162286342984586, -27.881915378533414], [-56.290899624239088, -28.852760512000849], [-57.62513342958291, -30.21629485445424], [-57.874937303281897, -31.016556084926158], [-58.14244035504074, -32.044503676076182], [-58.132647671121404, -33.040566908502008], [-58.349611172098818, -33.263188978815428], [-58.427074144104367, -33.909454441057541], [-58.495442064026541, -34.4314897600701], [-57.225829637263629, -35.288026625307886], [-57.362358771378737, -35.977390232081497], [-56.737487352105447, -36.413125909166574], [-56.788285285048339, -36.901571547189327], [-57.749156867083421, -38.183870538079901], [-59.231857062401865, -38.720220228837199], [-61.2374452378656, -38.92842457454114], [-62.335956997310134, -38.827707208004362], [-62.125763108962914, -39.424104913084868], [-62.33053097191943, -40.172586358400316], [-62.145994432205228, -40.676896661136723], [-62.74580278181697, -41.028761488612083], [-63.770494757732514, -41.166789239263657], [-64.732089809819698, -40.802677097335128], [-65.118035244391578, -41.064314874028874], [-64.97856055363583, -42.058000990569312], [-64.303407965742466, -42.359016208669495], [-63.755947842042339, -42.043686618824495], [-63.458059048095883, -42.563138116222355], [-64.378803880456289, -42.873558444999638], [-65.181803961839691, -43.495380954767782], [-65.328823411710133, -44.501366062193689], [-65.565268927661592, -45.03678557716978], [-66.509965786389344, -45.039627780945843], [-67.293793911392427, -45.551896254255183], [-67.580546434180079, -46.301772963242527], [-66.597066413017259, -47.033924655953804], [-65.641026577401433, -47.23613453551188], [-65.98508826360073, -48.133289076531128], [-67.166178961847649, -48.697337334996931], [-67.816087612566449, -49.869668877970412], [-68.728745083273154, -50.26421843851886], [-69.138539191347789, -50.732510267947788], [-68.815561489523517, -51.771104011594097], [-68.149994879820397, -52.349983406127699], [-68.571545376241332, -52.299443855346247], [-69.498362189396076, -52.142760912637236], [-71.914803839796321, -52.009022305865912], [-72.329403856074023, -51.425956312872394], [-72.309973517532342, -50.677009779666342], [-72.975746832964617, -50.741450290734299], [-73.328050910114456, -50.378785088909865], [-73.415435757120022, -49.318436374712952], [-72.648247443314929, -48.878618259476774], [-72.331160854771937, -48.244238376661819], [-72.44735531278026, -47.738532810253517], [-71.917258470330196, -46.884838148791786], [-71.552009446891233, -45.560732924177117], [-71.659315558545316, -44.973688653341434], [-71.222778896759721, -44.784242852559409], [-71.329800788036195, -44.407521661151677], [-71.793622606071935, -44.207172133156099], [-71.464056159130493, -43.787611179378324], [-71.915423956983901, -43.408564548517404], [-72.148898078078517, -42.254888197601375], [-71.746803758415453, -42.051386407235988], [-71.915734015577542, -40.832339369470716], [-71.680761277946445, -39.808164157878061], [-71.413516608349042, -38.916022230791107], [-70.814664272734703, -38.552995293940732], [-71.118625047475419, -37.576827487947192], [-71.121880662709771, -36.65812387466233], [-70.364769253201658, -36.005088799789931], [-70.388049485949082, -35.169687595359441], [-69.817309129501453, -34.193571465798279], [-69.814776984319209, -33.273886000299839], [-70.074399380153622, -33.09120981214803], [-70.535068935819439, -31.365010267870279], [-69.919008348251921, -30.336339206668306], [-70.013550381129861, -29.367922865518544], [-69.656130337183143, -28.459141127233686], [-69.001234910748266, -27.521213881136127], [-68.295541551370391, -26.899339694935787], [-68.594799770772667, -26.50690886811126], [-68.386001146097342, -26.185016371365229], [-68.417652960876111, -24.518554782816874], [-67.328442959244128, -24.025303236590908], [-66.985233934177629, -22.986348565362825], [-67.106673550063604, -22.735924574476392], [-66.273339402924833, -21.832310479420677], [-64.964892137294569, -22.075861504812348]]]] } }, + { "type": "Feature", "properties": { "admin": "Armenia", "name": "Armenia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[43.582745802592726, 41.09214325618256], [44.972480096218071, 41.248128567055588], [45.179495883979335, 40.985353908851401], [45.560351189970433, 40.812289537105919], [45.359174839058156, 40.561503811193447], [45.891907179555076, 40.218475653639992], [45.610012241402913, 39.899993801425175], [46.034534132680662, 39.628020738273058], [46.483498976432443, 39.464154771475528], [46.505719842317966, 38.770605373686287], [46.143623081248812, 38.74120148371221], [45.735379266143006, 39.319719143219736], [45.739978468616975, 39.473999131827114], [45.298144972521456, 39.471751207022422], [45.00198733905674, 39.740003567049548], [44.793989699081934, 39.713002631177041], [44.400008579288695, 40.005000311842267], [43.656436395040934, 40.253563951166178], [43.752657911968399, 40.740200914058754], [43.582745802592726, 41.09214325618256]]] } }, + { "type": "Feature", "properties": { "admin": "French Southern and Antarctic Lands", "name": "Fr. S. Antarctic Lands", "continent": "Seven seas (open ocean)" }, "geometry": { "type": "Polygon", "coordinates": [[[68.935, -48.625], [69.58, -48.94], [70.525, -49.065], [70.56, -49.255], [70.28, -49.71], [68.745, -49.775], [68.72, -49.2425], [68.8675, -48.83], [68.935, -48.625]]] } }, + { "type": "Feature", "properties": { "admin": "Australia", "name": "Australia", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[145.397978143494782, -40.792548516605883], [146.364120721623692, -41.137695407883335], [146.908583612250823, -41.000546156580668], [147.689259474884125, -40.808258152022681], [148.289067824495987, -40.875437514002122], [148.359864536735785, -42.062445163746439], [148.017301467073082, -42.40702361426861], [147.914051955353784, -43.211522312188485], [147.564564243763982, -42.937688897473855], [146.87034305235494, -43.634597263362082], [146.663327264593647, -43.580853773778543], [146.048377720320389, -43.54974456153888], [145.431929559510536, -42.693776137056268], [145.295090366801674, -42.03360971452755], [144.7180713238306, -41.162551771815707], [144.743754510679622, -40.703975111657705], [145.397978143494782, -40.792548516605883]]], [[[143.561811151299935, -13.763655694232209], [143.922099237238882, -14.548310642152], [144.563713820574804, -14.171176039285879], [144.894908075133515, -14.594457696188622], [145.374723748963419, -14.984976495018284], [145.271991001567244, -15.428205254785691], [145.48525963763575, -16.285672295804769], [145.637033319276952, -16.784918308176611], [145.888904250267672, -16.906926364817647], [146.160308872664473, -17.76165455492524], [146.063673944278662, -18.280072523677315], [146.387478469019584, -18.958274021075905], [147.471081577747896, -19.480722751546676], [148.177601760042478, -19.955939222902767], [148.848413527623222, -20.391209812097252], [148.717465448195583, -20.633468926681513], [149.289420200802056, -21.260510756111096], [149.678337030230637, -22.342511895438388], [150.07738244038859, -22.122783705333315], [150.482939081015161, -22.556142266533012], [150.727265252891158, -22.402404880464655], [150.899554478152254, -23.462236830338679], [151.609175246384211, -24.076256198830755], [152.07353966695905, -24.45788665130619], [152.855197381805908, -25.267501316023008], [153.136162144176751, -26.071173191026187], [153.161948683890358, -26.641319268502439], [153.09290897034856, -27.260299574494503], [153.569469028944184, -28.110066827102099], [153.512108189100218, -28.995077406532751], [153.339095493787056, -29.458201592732443], [153.069241164358857, -30.350240166954809], [153.089601678681788, -30.923641859665445], [152.891577590139377, -31.640445651985949], [152.450002476205327, -32.550002536755237], [151.709117466436766, -33.041342054986337], [151.343971795862387, -33.816023451473846], [151.010555454715103, -34.310360202777879], [150.714139439089024, -35.173459974916803], [150.328219842733233, -35.671879164371923], [150.075212030232251, -36.420205580390508], [149.946124302367139, -37.109052422841224], [149.997283970336127, -37.425260512035123], [149.423882277625523, -37.772681166333463], [148.304622430615893, -37.809061374666875], [147.38173302631526, -38.219217217767543], [146.922122837511324, -38.606532077795116], [146.317921991154776, -39.035756524411433], [145.489652134380549, -38.593767999019043], [144.876976353128157, -38.41744801203911], [145.032212355732952, -37.896187839510972], [144.485682407814011, -38.085323581699257], [143.609973586196077, -38.809465427405321], [142.745426873952965, -38.538267510737519], [142.17832970598198, -38.380034275059835], [141.606581659104677, -38.308514092767872], [140.638578729413211, -38.019332777662541], [139.992158237874321, -37.402936293285094], [139.806588169514043, -36.643602797188272], [139.574147577065219, -36.138362318670666], [139.082808058834075, -35.732754001611774], [138.120747918856296, -35.612296237939397], [138.449461704664998, -35.127261244447887], [138.207564325106659, -34.384722588845925], [137.719170363516128, -35.07682504653102], [136.829405552314711, -35.260534763328614], [137.352371047108477, -34.707338555644093], [137.503886346588331, -34.130267836240769], [137.890116001537649, -33.640478610978327], [137.810327590079112, -32.900007012668105], [136.996837192940347, -33.752771498348629], [136.372069126531642, -34.094766127256186], [135.98904341038434, -34.89011809666048], [135.208212518454104, -34.478670342752601], [135.239218377829161, -33.947953383114971], [134.613416782774607, -33.222778008763136], [134.085903761939107, -32.848072198214759], [134.273902622617015, -32.617233575166949], [132.990776808809812, -32.011224053680188], [132.288080682504869, -31.982646986622761], [131.326330601120901, -31.495803318001041], [129.535793898639668, -31.590422865527476], [128.240937534702198, -31.948488864877849], [127.102867466338282, -32.282266941051041], [126.148713820501129, -32.2159660784206], [125.088623488465586, -32.728751316052829], [124.22164798390493, -32.959486586236061], [124.028946567888511, -33.483847344701708], [123.65966678273071, -33.890179131812722], [122.811036411633609, -33.914467054989835], [122.18306440642283, -34.003402194964217], [121.299190708502579, -33.821036065406126], [120.580268182458113, -33.930176690406618], [119.893695103028222, -33.976065362281808], [119.298899367348781, -34.50936614353396], [119.007340936357977, -34.464149265278529], [118.505717808100769, -34.746819349915093], [118.024971958489516, -35.064732761374707], [117.295507440257438, -35.025458672832862], [116.62510908413492, -35.025096937806829], [115.564346958479689, -34.386427911111547], [115.026808709779516, -34.196517022438918], [115.048616164206763, -33.623425388322026], [115.545123325667078, -33.487257989232951], [115.714673700016661, -33.259571628554944], [115.679378696761376, -32.900368747694124], [115.801645135563959, -32.205062351207026], [115.689610630355105, -31.612437025683782], [115.160909051576937, -30.601594333622455], [114.99704308477942, -30.030724786094162], [115.040037876446249, -29.461095472940794], [114.64197431850198, -28.810230808224706], [114.61649783738217, -28.516398614213042], [114.173579136208446, -28.118076674107321], [114.048883905088132, -27.33476531342712], [113.477497593236876, -26.543134047147898], [113.338953078262477, -26.116545098578477], [113.77835778204026, -26.549025160429174], [113.440962355606587, -25.621278171493152], [113.936901076311642, -25.911234633082877], [114.232852004047288, -26.298446140245868], [114.216160516417006, -25.786281019801105], [113.721255324357685, -24.998938897402123], [113.625343866024025, -24.683971042583146], [113.393523390762667, -24.384764499613262], [113.502043898575607, -23.80635019297025], [113.706992629045146, -23.56021534596406], [113.843418410295669, -23.059987481378734], [113.736551548316072, -22.475475355725372], [114.149756300921865, -21.755881036061009], [114.225307244932651, -22.51748829517863], [114.64776207891866, -21.829519952076904], [115.460167270979298, -21.495173435148541], [115.94737267462699, -21.068687839443708], [116.711615431791529, -20.701681817306817], [117.166316359527684, -20.623598728113802], [117.441545037914238, -20.746898695562162], [118.229558953932951, -20.374208265873232], [118.836085239742701, -20.263310642174822], [118.987807244951753, -20.044202569257319], [119.252493931150624, -19.952941989829835], [119.805225050944543, -19.976506442954978], [120.856220330896633, -19.683707777589188], [121.399856398607199, -19.239755547769729], [121.655137974129062, -18.70531788500713], [122.241665480641757, -18.197648614171765], [122.286623976735655, -17.798603204013911], [122.312772251475408, -17.254967136303446], [123.012574497571904, -16.405199883695854], [123.433789097183009, -17.268558037996225], [123.859344517106592, -17.069035332917249], [123.503242222183232, -16.596506036040363], [123.817073195491915, -16.11131601325199], [124.258286574399847, -16.32794361741956], [124.379726190285794, -15.567059828353973], [124.926152785340022, -15.07510019293532], [125.167275018413875, -14.680395603090004], [125.670086704613823, -14.510070082256018], [125.685796340030493, -14.230655612853834], [126.125149367376096, -14.347340996968949], [126.142822707219864, -14.095986830301211], [126.582589146023736, -13.95279143642041], [127.065867140817332, -13.817967624570922], [127.804633416861932, -14.276906019755042], [128.359689976108939, -14.869169610252253], [128.985543247595899, -14.875990899314738], [129.621473423379598, -14.969783623924553], [129.409600050982988, -14.420669854391031], [129.888640578328591, -13.618703301653481], [130.339465773642928, -13.357375583553473], [130.183506300985982, -13.107520033422301], [130.617795037966971, -12.536392103732464], [131.223494500859999, -12.183648776908113], [131.73509118054946, -12.302452894747159], [132.575298293183096, -12.114040622611013], [132.557211541881031, -11.603012383676683], [131.824698114143644, -11.273781833545097], [132.357223748911395, -11.128519382372641], [133.019560581596409, -11.376411228076844], [133.550845981989028, -11.786515394745134], [134.393068475481982, -12.042365411022173], [134.678632440327021, -11.9411829565947], [135.298491245667975, -12.248606052299051], [135.882693312727611, -11.962266940969796], [136.258380975489445, -12.049341729381606], [136.492475213771627, -11.857208754120389], [136.951620314684988, -12.351958916882735], [136.685124953355739, -12.887223402562054], [136.305406528875096, -13.291229750219895], [135.961758254134111, -13.324509372615889], [136.077616815332533, -13.72427825282578], [135.783836297753226, -14.223989353088211], [135.4286641786112, -14.715432224183896], [135.500184360903177, -14.997740573794427], [136.295174595281367, -15.550264987859121], [137.065360142159477, -15.870762220933353], [137.580470819244795, -16.215082289294084], [138.303217401278971, -16.807604261952658], [138.58516401586337, -16.806622409739173], [139.108542922115475, -17.062679131745366], [139.260574985918197, -17.371600843986183], [140.215245396078274, -17.710804945550063], [140.875463495039241, -17.36906869880394], [141.071110467696258, -16.832047214426719], [141.274095493738798, -16.388870131091604], [141.398222284103781, -15.840531508042584], [141.702183058844611, -15.044921156476928], [141.563380161708665, -14.561333103089506], [141.635520461188094, -14.270394789286284], [141.519868605718955, -13.698078301653805], [141.650920038011009, -12.944687595270562], [141.842691278246207, -12.741547539931187], [141.68699018775078, -12.407614434461134], [141.928629185147543, -11.877465915578778], [142.118488397387978, -11.328042087451619], [142.14370649634634, -11.04273650476814], [142.51526004452495, -10.668185723516642], [142.797310011974048, -11.157354831591515], [142.866763136974271, -11.784706719614929], [143.11594689348567, -11.90562957117791], [143.158631626558758, -12.325655612846187], [143.522123651299864, -12.834358412327429], [143.597157830987669, -13.400422051652594], [143.561811151299935, -13.763655694232209]]]] } }, + { "type": "Feature", "properties": { "admin": "Austria", "name": "Austria", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.979666782304033, 48.123497015976298], [16.903754103267257, 47.714865627628321], [16.340584344150411, 47.712901923201215], [16.534267612380372, 47.496170966169103], [16.202298211337361, 46.852385972676949], [16.011663852612653, 46.683610744811688], [15.137091912504982, 46.658702704447016], [14.632471551174827, 46.431817328469535], [13.806475457421524, 46.509306138691201], [12.376485223040813, 46.767559109069843], [12.153088006243051, 47.115393174826437], [11.164827915093268, 46.941579494812721], [11.048555942436533, 46.751358547546324], [10.442701450246627, 46.893546250997424], [9.932448357796657, 46.920728054382948], [9.479969516649019, 47.102809963563367], [9.632931756232974, 47.347601223329974], [9.594226108446346, 47.525058091820256], [9.896068149463188, 47.58019684507569], [10.402083774465209, 47.302487697939156], [10.544504021861625, 47.566399237653762], [11.426414015354736, 47.523766181012967], [12.141357456112784, 47.703083401065761], [12.620759718484491, 47.672387600284395], [12.932626987365945, 47.467645575543983], [13.025851271220487, 47.637583523135824], [12.884102817443901, 48.289145819687903], [13.243357374736998, 48.41611481382904], [13.595945672264433, 48.877171942737135], [14.33889773932472, 48.555305284207193], [14.901447381254055, 48.964401760445817], [15.253415561593979, 49.039074205107575], [16.029647251050218, 48.733899034207916], [16.49928266771877, 48.785808010445095], [16.960288120194573, 48.596982326850593], [16.879982944412998, 48.470013332709463], [16.979666782304033, 48.123497015976298]]] } }, + { "type": "Feature", "properties": { "admin": "Azerbaijan", "name": "Azerbaijan", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[45.001987339056789, 39.740003567049591], [45.298144972521435, 39.471751207022422], [45.739978468616997, 39.473999131827149], [45.735379266143092, 39.319719143219785], [46.143623081248812, 38.74120148371221], [45.457721795438729, 38.874139105783108], [44.952688022650264, 39.33576467544642], [44.79398969908199, 39.713002631177027], [45.001987339056789, 39.740003567049591]]], [[[47.373315464066216, 41.219732367511249], [47.81566572448471, 41.151416124021338], [47.987283156126033, 41.405819200194223], [48.584352654826283, 41.808869533854669], [49.110263706260653, 41.282286688800518], [49.618914829309588, 40.572924302729966], [50.084829542853093, 40.526157131505776], [50.392821079312704, 40.256561184239096], [49.569202101444795, 40.176100979160701], [49.395259230350419, 39.39948171646224], [49.2232283872507, 39.04921885838791], [48.856532423707584, 38.815486355131775], [48.883249139202533, 38.320245266262638], [48.634375441284831, 38.270377509100925], [48.010744256386502, 38.794014797514528], [48.355529412637928, 39.288764960276886], [48.060095249225256, 39.582235419262439], [47.685079380083117, 39.508363959301185], [46.505719842317966, 38.770605373686251], [46.483498976432443, 39.464154771475528], [46.034534132680697, 39.628020738273044], [45.610012241402913, 39.899993801425175], [45.891907179555133, 40.21847565363997], [45.359174839058156, 40.561503811193482], [45.560351189970469, 40.812289537105947], [45.179495883979392, 40.98535390885143], [44.972480096218156, 41.248128567055623], [45.217426385281634, 41.411451931314041], [45.962600538930438, 41.123872585609789], [46.501637404166978, 41.064444688474104], [46.637908156120567, 41.181672675128219], [46.145431756378983, 41.72280243587263], [46.404950799348818, 41.860675157227341], [46.686070591016652, 41.827137152669899], [47.373315464066216, 41.219732367511249]]]] } }, + { "type": "Feature", "properties": { "admin": "Burundi", "name": "Burundi", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[29.339997592900342, -4.499983412294092], [29.276383904749046, -3.293907159034063], [29.02492638521678, -2.839257907730157], [29.632176141078585, -2.917857761246096], [29.938359002407935, -2.348486830254238], [30.469696079232978, -2.413857517103458], [30.527677036264457, -2.807631931167534], [30.743012729624692, -3.034284763199686], [30.752262811004943, -3.359329522315569], [30.505559523243559, -3.568567396665364], [30.116332635221166, -4.090137627787242], [29.753512404099919, -4.45238941815328], [29.339997592900342, -4.499983412294092]]] } }, + { "type": "Feature", "properties": { "admin": "Belgium", "name": "Belgium", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[3.314971144228536, 51.345780951536071], [4.047071160507527, 51.267258612668556], [4.973991326526913, 51.475023708698124], [5.60697594567, 51.037298488969768], [6.156658155958779, 50.803721015010574], [6.043073357781109, 50.128051662794221], [5.782417433300905, 50.090327867221205], [5.674051954784828, 49.52948354755749], [4.799221632515809, 49.985373033236371], [4.286022983425084, 49.90749664977254], [3.588184441755685, 50.378992418003563], [3.123251580425801, 50.780363267614561], [2.658422071960274, 50.796848049515731], [2.513573032246142, 51.148506171261815], [3.314971144228536, 51.345780951536071]]] } }, + { "type": "Feature", "properties": { "admin": "Benin", "name": "Benin", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[2.691701694356254, 6.258817246928628], [1.865240512712318, 6.14215770102973], [1.618950636409238, 6.832038072126236], [1.664477573258381, 9.128590399609378], [1.46304284018467, 9.334624335157086], [1.425060662450136, 9.825395412632998], [1.077795037448737, 10.175606594275022], [0.772335646171484, 10.470808213742357], [0.899563022474069, 10.997339382364258], [1.243469679376488, 11.11051076908346], [1.447178175471066, 11.547719224488857], [1.93598554851988, 11.641150214072551], [2.154473504249921, 11.940150051313337], [2.49016360841793, 12.233052069543671], [2.84864301922667, 12.235635891158266], [3.611180454125558, 11.660167141155966], [3.572216424177469, 11.327939357951516], [3.797112257511713, 10.734745591673104], [3.600070021182801, 10.332186184119406], [3.705438266625918, 10.063210354040207], [3.220351596702101, 9.4441525333997], [2.912308383810255, 9.13760793704432], [2.723792758809509, 8.506845404489708], [2.74906253420022, 7.870734361192886], [2.691701694356254, 6.258817246928628]]] } }, + { "type": "Feature", "properties": { "admin": "Burkina Faso", "name": "Burkina Faso", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.827496303712706, 9.642460842319775], [-3.511898972986272, 9.900326239456216], [-3.980449184576684, 9.862344061721698], [-4.330246954760383, 9.610834865757139], [-4.779883592131966, 9.821984768101741], [-4.954653286143098, 10.152713934769732], [-5.404341599946973, 10.370736802609144], [-5.470564947929004, 10.951269842976044], [-5.197842576508648, 11.375145778850136], [-5.220941941743119, 11.713858954307224], [-4.427166103523802, 12.542645575404292], [-4.280405035814879, 13.228443508349738], [-4.006390753587225, 13.472485459848112], [-3.52280270019986, 13.337661647998612], [-3.103706834312759, 13.54126679122859], [-2.967694464520576, 13.798150336151506], [-2.191824510090384, 14.246417548067352], [-2.001035122068771, 14.559008287000887], [-1.066363491205663, 14.973815009007764], [-0.515854458000348, 15.116157741755725], [-0.26625729003058, 14.924308986872147], [0.374892205414682, 14.928908189346128], [0.295646396495101, 14.444234930880651], [0.429927605805517, 13.988733018443922], [0.993045688490071, 13.335749620003821], [1.024103224297477, 12.851825669806573], [2.177107781593775, 12.625017808477532], [2.154473504249921, 11.940150051313337], [1.93598554851988, 11.641150214072551], [1.447178175471066, 11.547719224488857], [1.243469679376488, 11.11051076908346], [0.899563022474069, 10.997339382364258], [0.023802524423701, 11.018681748900802], [-0.438701544588582, 11.09834096927872], [-0.761575893548183, 10.936929633015053], [-1.203357713211431, 11.009819240762736], [-2.94040930827046, 10.962690334512557], [-2.963896246747111, 10.395334784380081], [-2.827496303712706, 9.642460842319775]]] } }, + { "type": "Feature", "properties": { "admin": "Bangladesh", "name": "Bangladesh", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[92.672720981825549, 22.041238918541247], [92.652257114637976, 21.324047552978481], [92.30323449093865, 21.475485337809815], [92.368553501355606, 20.670883287025344], [92.082886183646124, 21.192195135985767], [92.025215285208361, 21.701569729086764], [91.834890985077408, 22.182935695885561], [91.417087029997646, 22.765019029221218], [90.496006300827247, 22.805016587815125], [90.586956821660948, 22.392793687422863], [90.272970819055544, 21.836367702720107], [89.847467075564268, 22.039146023033421], [89.70204959509492, 21.857115790285299], [89.41886274613546, 21.966178900637296], [89.031961297566198, 22.055708319582973], [88.876311883503064, 22.879146429937826], [88.529769728553759, 23.631141872649163], [88.699940220090895, 24.233714911388557], [88.084422235062405, 24.501657212821918], [88.30637251175601, 24.866079413344199], [88.931553989623069, 25.238692328384769], [88.209789259802477, 25.768065700782707], [88.56304935094974, 26.446525580342716], [89.355094028687276, 26.014407253518065], [89.832480910199592, 25.965082098895476], [89.920692580121838, 25.269749864192171], [90.872210727912105, 25.13260061288954], [91.799595981822065, 25.14743174895731], [92.376201613334786, 24.976692816664961], [91.915092807994398, 24.130413723237108], [91.467729933643668, 24.072639471934789], [91.158963250699713, 23.503526923104381], [91.706475050832083, 22.985263983649183], [91.869927606171302, 23.62434642180278], [92.146034783906799, 23.62749868417259], [92.672720981825549, 22.041238918541247]]] } }, + { "type": "Feature", "properties": { "admin": "Bulgaria", "name": "Bulgaria", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.657149692482985, 44.234923000661276], [22.94483239105184, 43.823785305347123], [23.332302280376322, 43.897010809904707], [24.100679152124169, 43.741051337247846], [25.569271681426923, 43.688444729174712], [26.065158725699739, 43.943493760751259], [27.242399529740904, 44.175986029632398], [27.970107049275068, 43.812468166675202], [28.55808149589199, 43.707461656258118], [28.039095086384712, 43.293171698574177], [27.673897739378042, 42.577892361006214], [27.996720411905383, 42.007358710287775], [27.135739373490473, 42.141484890301335], [26.117041863720793, 41.826904608724554], [26.106138136507205, 41.328898830727766], [25.197201368925441, 41.234485988930523], [24.492644891058031, 41.583896185872028], [23.692073601992345, 41.309080918943842], [22.952377150166445, 41.337993882811141], [22.881373732197424, 41.999297186850242], [22.380525750424585, 42.320259507815081], [22.545011834409614, 42.461362006188025], [22.436594679461273, 42.580321153323929], [22.604801466571324, 42.898518785161137], [22.986018507588479, 43.211161200526959], [22.500156691180276, 43.642814439460977], [22.410446404721593, 44.008063462899948], [22.657149692482985, 44.234923000661276]]] } }, + { "type": "Feature", "properties": { "admin": "The Bahamas", "name": "Bahamas", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-77.53466, 23.75975], [-77.78, 23.71], [-78.03405, 24.28615], [-78.40848, 24.57564], [-78.19087, 25.2103], [-77.89, 25.17], [-77.54, 24.34], [-77.53466, 23.75975]]], [[[-77.82, 26.58], [-78.91, 26.42], [-78.98, 26.79], [-78.51, 26.87], [-77.85, 26.84], [-77.82, 26.58]]], [[[-77.0, 26.59], [-77.17255, 25.87918], [-77.35641, 26.00735], [-77.34, 26.53], [-77.78802, 26.92516], [-77.79, 27.04], [-77.0, 26.59]]]] } }, + { "type": "Feature", "properties": { "admin": "Bosnia and Herzegovina", "name": "Bosnia and Herz.", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[19.005486281010118, 44.860233669609144], [19.36803, 44.863], [19.11761, 44.42307], [19.59976, 44.03847], [19.454, 43.568100000000115], [19.21852, 43.52384], [19.03165, 43.43253], [18.70648, 43.20011], [18.56, 42.65], [17.674921502358981, 43.028562527023603], [17.297373488034449, 43.446340643887353], [16.916156447017325, 43.667722479825663], [16.456442905348862, 44.041239732431265], [16.239660271884528, 44.351143296885695], [15.750026075918978, 44.81871165626255], [15.959367303133373, 45.233776760430935], [16.318156772535868, 45.004126695325901], [16.534939406000202, 45.211607570977705], [17.00214603035101, 45.233776760430935], [17.861783481526398, 45.067740383477137], [18.553214145591646, 45.08158966733145], [19.005486281010118, 44.860233669609144]]] } }, + { "type": "Feature", "properties": { "admin": "Belarus", "name": "Belarus", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[23.484127638449841, 53.912497667041123], [24.45068362803703, 53.905702216194747], [25.536353794056989, 54.282423407602515], [25.768432651479792, 54.846962592175082], [26.588279249790386, 55.167175604871659], [26.494331495883749, 55.61510691997762], [27.102459751094525, 55.783313707087672], [28.17670942557799, 56.169129950578807], [29.2295133806603, 55.918344224666356], [29.371571893030669, 55.67009064393617], [29.896294386522353, 55.789463202530406], [30.87390913262, 55.550976467503396], [30.971835971813132, 55.081547756564028], [30.75753380709871, 54.811770941784303], [31.384472283663733, 54.157056382862422], [31.791424187962232, 53.974638576872117], [31.731272820774503, 53.794029446012011], [32.405598585751157, 53.618045355842028], [32.693643019346034, 53.351420803432106], [32.304519484188226, 53.132726141972903], [31.497643670382924, 53.167426866256889], [31.30520063652801, 53.073995876673195], [31.540018344862254, 52.742052313846344], [31.78599816257158, 52.10167796488544], [30.927549269338975, 52.042353420614383], [30.619454380014837, 51.822806098022362], [30.55511722181145, 51.319503485715643], [30.157363722460889, 51.416138414101454], [29.254938185347921, 51.368234361366881], [28.992835320763522, 51.602044379271462], [28.617612745892242, 51.427713934934836], [28.241615024536564, 51.572227077839059], [27.454066196408426, 51.59230337178446], [26.337958611768549, 51.832288723347915], [25.327787713327005, 51.910656032918538], [24.553106316839511, 51.888461005249177], [24.005077752384206, 51.617443956094448], [23.52707075368437, 51.578454087930233], [23.508002150168689, 52.023646552124717], [23.19949384938618, 52.486977444053664], [23.799198846133375, 52.691099351606553], [23.804934930117774, 53.08973135030606], [23.527535841574995, 53.47012156840654], [23.484127638449841, 53.912497667041123]]] } }, + { "type": "Feature", "properties": { "admin": "Belize", "name": "Belize", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-89.143080410503302, 17.808318996649316], [-89.150909389995519, 17.955467637600414], [-89.029857347351808, 18.001511338772485], [-88.848343878926585, 17.883198147040229], [-88.490122850279334, 18.486830552641603], [-88.300031094093669, 18.499982204659897], [-88.296336229184803, 18.353272813383263], [-88.106812913754368, 18.348673610909284], [-88.123478563168476, 18.076674709541003], [-88.285354987322776, 17.644142971258031], [-88.197866787452625, 17.489475409408453], [-88.302640753924422, 17.13169363043566], [-88.239517991879893, 17.036066392479551], [-88.355428229510551, 16.530774237529624], [-88.551824510435821, 16.265467434143144], [-88.732433641295927, 16.233634751851351], [-88.930612759135244, 15.887273464415072], [-89.229121670269265, 15.886937567605166], [-89.15080603713092, 17.015576687075832], [-89.143080410503302, 17.808318996649316]]] } }, + { "type": "Feature", "properties": { "admin": "Bolivia", "name": "Bolivia", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-62.84646847192154, -22.034985446869442], [-63.986838141522462, -21.993644301035946], [-64.377021043542243, -22.798091322523533], [-64.964892137294598, -22.07586150481232], [-66.273339402924833, -21.832310479420713], [-67.10667355006359, -22.735924574476414], [-67.82817989772272, -22.872918796482171], [-68.219913092711266, -21.494346612231858], [-68.757167121033731, -20.372657972904459], [-68.442225104430904, -19.405068454671426], [-68.966818406841853, -18.9816834449041], [-69.100246955019472, -18.260125420812674], [-69.590423753524036, -17.580011895419329], [-68.959635382753291, -16.500697930571267], [-69.389764166934697, -15.66012908291165], [-69.160346645774936, -15.323973890853015], [-69.339534674747, -14.953195489158828], [-68.94888668483658, -14.45363941819328], [-68.929223802349526, -13.602683607643007], [-68.880079515239956, -12.89972909917665], [-68.665079718689611, -12.561300144097171], [-69.52967810736493, -10.951734307502193], [-68.786157599549469, -11.036380303596276], [-68.27125362819325, -11.014521172736817], [-68.048192308205373, -10.712059014532484], [-67.173801235610725, -10.30681243249961], [-66.646908331962791, -9.931331475466861], [-65.33843522811641, -9.76198780684639], [-65.444837002205375, -10.51145110437543], [-65.321898769783004, -10.895872084194675], [-65.402281460213018, -11.566270440317151], [-64.31635291203159, -12.461978041232191], [-63.196498786050562, -12.627032565972433], [-62.803060268796372, -13.000653171442682], [-62.127080857986371, -13.19878061284972], [-61.713204311760769, -13.489202162330049], [-61.084121263255646, -13.479383640194595], [-60.503304002511122, -13.775954685117656], [-60.459198167550014, -14.354007256734551], [-60.264326341377355, -14.645979099183638], [-60.251148851142922, -15.077218926659318], [-60.542965664295131, -15.093910414289592], [-60.158389655179022, -16.258283786690082], [-58.241219855366673, -16.299573256091289], [-58.388058437724027, -16.877109063385273], [-58.280804002502244, -17.271710300366014], [-57.734558274960989, -17.552468357007765], [-57.498371141170971, -18.174187513911289], [-57.676008877174297, -18.961839694904025], [-57.949997321185819, -19.400004164306814], [-57.853801642474494, -19.969995212486186], [-58.166392381408038, -20.176700941653674], [-58.183471442280492, -19.868399346600359], [-59.11504248720609, -19.356906019775398], [-60.043564622626477, -19.342746677327419], [-61.786326463453761, -19.633736667562957], [-62.265961269770784, -20.513734633061272], [-62.291179368729203, -21.051634616787389], [-62.685057135657871, -22.24902922942238], [-62.84646847192154, -22.034985446869442]]] } }, + { "type": "Feature", "properties": { "admin": "Brazil", "name": "Brazil", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.625133429582945, -30.216294854454258], [-56.290899624239067, -28.852760512000884], [-55.162286342984558, -27.881915378533456], [-54.49072526713551, -27.474756768505785], [-53.648735317587885, -26.923472588816086], [-53.628348965048737, -26.124865004177465], [-54.130049607954376, -25.547639255477247], [-54.625290696823562, -25.739255466415507], [-54.428946092330577, -25.162184747012162], [-54.293476325077435, -24.570799655863958], [-54.292959560754511, -24.021014092710722], [-54.652834235235119, -23.839578138933955], [-55.027901780809543, -24.001273695575225], [-55.400747239795407, -23.956935316668797], [-55.517639329639621, -23.57199757252663], [-55.61068274598113, -22.655619398694839], [-55.797958136606894, -22.356929620047815], [-56.473317430229379, -22.086300144135279], [-56.881509568902885, -22.282153822521476], [-57.937155727761287, -22.090175876557169], [-57.870673997617786, -20.732687676681948], [-58.166392381408038, -20.176700941653674], [-57.853801642474494, -19.969995212486186], [-57.949997321185819, -19.400004164306814], [-57.676008877174297, -18.961839694904025], [-57.498371141170971, -18.174187513911289], [-57.734558274960989, -17.552468357007765], [-58.280804002502244, -17.271710300366014], [-58.388058437724027, -16.877109063385273], [-58.241219855366673, -16.299573256091289], [-60.158389655179022, -16.258283786690082], [-60.542965664295131, -15.093910414289592], [-60.251148851142922, -15.077218926659318], [-60.264326341377355, -14.645979099183638], [-60.459198167550014, -14.354007256734551], [-60.503304002511122, -13.775954685117656], [-61.084121263255646, -13.479383640194595], [-61.713204311760769, -13.489202162330049], [-62.127080857986371, -13.19878061284972], [-62.803060268796372, -13.000653171442682], [-63.196498786050562, -12.627032565972433], [-64.31635291203159, -12.461978041232191], [-65.402281460213018, -11.566270440317151], [-65.321898769783004, -10.895872084194675], [-65.444837002205375, -10.51145110437543], [-65.33843522811641, -9.76198780684639], [-66.646908331962791, -9.931331475466861], [-67.173801235610725, -10.30681243249961], [-68.048192308205373, -10.712059014532484], [-68.27125362819325, -11.014521172736817], [-68.786157599549469, -11.036380303596276], [-69.52967810736493, -10.951734307502193], [-70.093752204046879, -11.123971856331011], [-70.548685675728393, -11.009146823778462], [-70.481893886991159, -9.490118096558842], [-71.302412278921523, -10.079436130415372], [-72.184890713169821, -10.05359791426943], [-72.563033006465631, -9.520193780152715], [-73.226713426390148, -9.462212823121233], [-73.015382656532537, -9.03283334720806], [-73.571059332967053, -8.424446709835832], [-73.987235480429646, -7.523829847853063], [-73.723401455363486, -7.340998630404412], [-73.724486660441627, -6.918595472850638], [-73.120027431923575, -6.629930922068238], [-73.219711269814596, -6.089188734566076], [-72.964507208941185, -5.741251315944892], [-72.891927659787243, -5.274561455916979], [-71.748405727816532, -4.59398284263301], [-70.928843349883564, -4.401591485210367], [-70.79476884630229, -4.251264743673302], [-69.893635219996611, -4.298186944194326], [-69.444101935489599, -1.556287123219817], [-69.420485805932216, -1.122618503426409], [-69.577065395776586, -0.549991957200163], [-70.02065589057004, -0.185156345219539], [-70.015565761989293, 0.541414292804205], [-69.452396002872447, 0.706158758950693], [-69.252434048119042, 0.602650865070075], [-69.218637661400166, 0.985676581217433], [-69.804596727157701, 1.089081122233466], [-69.816973232691609, 1.714805202639624], [-67.868565029558823, 1.692455145673392], [-67.537810024674684, 2.037162787276329], [-67.25999752467358, 1.719998684084956], [-67.065048183852483, 1.130112209473225], [-66.876325853122566, 1.253360500489336], [-66.325765143484944, 0.724452215982012], [-65.548267381437554, 0.78925446207603], [-65.354713304288353, 1.0952822941085], [-64.611011928959854, 1.328730576987041], [-64.199305792890499, 1.49285492594602], [-64.083085496666072, 1.91636912679408], [-63.368788011311644, 2.200899562993129], [-63.422867397705105, 2.411067613124174], [-64.269999152265783, 2.497005520025566], [-64.408827887617903, 3.126786200366623], [-64.368494432214092, 3.797210394705246], [-64.816064012294007, 4.056445217297422], [-64.628659430587533, 4.14848094320925], [-63.888342861574145, 4.020530096854571], [-63.093197597899092, 3.770571193858784], [-62.804533047116692, 4.006965033377951], [-62.085429653559125, 4.162123521334308], [-60.966893276601517, 4.536467596856638], [-60.601179165271922, 4.918098049332129], [-60.733574184803707, 5.2002772078619], [-60.213683437731319, 5.2444863956876], [-59.980958624904865, 5.014061184098138], [-60.111002366767373, 4.574966538914082], [-59.767405768458701, 4.423502915866606], [-59.538039923731219, 3.958802598481937], [-59.815413174057852, 3.606498521332085], [-59.974524909084543, 2.755232652188055], [-59.718545701726732, 2.249630438644359], [-59.646043667221242, 1.786893825686789], [-59.030861579002639, 1.317697658692722], [-58.540012986878288, 1.26808828369252], [-58.429477098205957, 1.46394196207872], [-58.113449876525003, 1.507195135907025], [-57.660971035377358, 1.682584947105638], [-57.33582292339689, 1.948537705895759], [-56.782704230360814, 1.863710842288653], [-56.53938574891454, 1.89952260986692], [-55.995698004771739, 1.817667141116601], [-55.905600145070871, 2.021995754398659], [-56.073341844290283, 2.220794989425499], [-55.973322109589361, 2.510363877773016], [-55.569755011605984, 2.42150625244713], [-55.097587449755125, 2.523748073736612], [-54.524754197799709, 2.311848863123785], [-54.088062506717243, 2.105556545414629], [-53.778520677288903, 2.376702785650081], [-53.554839240113537, 2.33489655192595], [-53.4184651352953, 2.05338918701598], [-52.939657151894949, 2.124857692875636], [-52.556424730018414, 2.504705308437053], [-52.249337531123942, 3.241094468596244], [-51.657797410678882, 4.156232408053028], [-51.317146369010842, 4.203490505383953], [-51.069771287629649, 3.65039765056403], [-50.508875291533641, 1.901563828942456], [-49.974075893745045, 1.736483465986069], [-49.947100796088705, 1.046189683431223], [-50.699251268096901, 0.222984117021681], [-50.388210822132123, -0.078444512536819], [-48.620566779156313, -0.235489190271821], [-48.584496629416577, -1.237805271005001], [-47.824956427590621, -0.5816179337628], [-46.566583624851219, -0.941027520352776], [-44.9057030909904, -1.551739597178134], [-44.417619187993658, -2.137750339367975], [-44.581588507655773, -2.691308282078523], [-43.418791266440188, -2.383110039889793], [-41.47265682632824, -2.912018324397116], [-39.97866533055403, -2.87305429444904], [-38.50038347019656, -3.700652357603394], [-37.223252122535193, -4.820945733258915], [-36.45293738457638, -5.109403578312153], [-35.597795783010454, -5.149504489770648], [-35.235388963347553, -5.464937432480245], [-34.896029832486825, -6.738193047719709], [-34.729993455533027, -7.343220716992965], [-35.128212042774216, -8.996401462442284], [-35.636966518687707, -9.649281508017811], [-37.046518724096991, -11.040721123908799], [-37.683611619607355, -12.17119475672582], [-38.423876512188436, -13.038118584854285], [-38.673887091616507, -13.057652276260615], [-38.953275722802537, -13.79336964280002], [-38.882298143049645, -15.667053724838764], [-39.161092495264306, -17.208406670808468], [-39.267339240056394, -17.867746270420479], [-39.583521491034219, -18.262295830968934], [-39.76082333022763, -19.599113457927402], [-40.774740770010332, -20.90451181405242], [-40.944756232250597, -21.937316989837807], [-41.75416419123821, -22.370675551037454], [-41.988284267736546, -22.970070489190888], [-43.074703742024738, -22.967693373305462], [-44.647811855637798, -23.351959323827838], [-45.35213578955991, -23.796841729428579], [-46.472093268405523, -24.088968601174539], [-47.648972337420645, -24.885199069927715], [-48.495458136577689, -25.877024834905647], [-48.641004808127725, -26.623697605090928], [-48.474735887228647, -27.175911960561887], [-48.661520351747612, -28.186134535435713], [-48.888457404157393, -28.674115085567877], [-49.587329474472668, -29.224469089476333], [-50.696874152211478, -30.984465020472953], [-51.576226162306149, -31.777698256153204], [-52.256081305538032, -32.245369968394662], [-52.71209998229768, -33.196578057591175], [-53.373661668498229, -33.768377780900757], [-53.650543992718084, -33.202004082981823], [-53.209588995971529, -32.727666110974717], [-53.787951626182185, -32.047242526987617], [-54.572451544805105, -31.494511407193745], [-55.601510179249331, -30.853878676071385], [-55.97324459494093, -30.883075860316296], [-56.976025763564721, -30.109686374636119], [-57.625133429582945, -30.216294854454258]]] } }, + { "type": "Feature", "properties": { "admin": "Brunei", "name": "Brunei", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[114.204016554828343, 4.525873928236805], [114.599961379048707, 4.900011298029965], [115.450710483869798, 5.447729803891532], [115.405700311343566, 4.955227565933837], [115.347460972150643, 4.316636053887009], [114.869557326315373, 4.348313706881924], [114.659595981913498, 4.007636826997753], [114.204016554828343, 4.525873928236805]]] } }, + { "type": "Feature", "properties": { "admin": "Bhutan", "name": "Bhutan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[91.69665652869665, 27.771741848251661], [92.10371178585973, 27.4526140406332], [92.033483514375078, 26.838310451763554], [91.217512648486405, 26.808648179628019], [90.37327477413406, 26.875724188742872], [89.744527622438838, 26.71940298105995], [88.835642531289366, 27.098966376243755], [88.814248488320544, 27.299315904239361], [89.475810174521101, 28.04275889740639], [90.015828891971154, 28.296438503527209], [90.730513950567769, 28.064953925075748], [91.258853794319904, 28.040614325466287], [91.69665652869665, 27.771741848251661]]] } }, + { "type": "Feature", "properties": { "admin": "Botswana", "name": "Botswana", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[25.649163445750155, -18.536025892818987], [25.850391473094724, -18.714412937090533], [26.164790887158478, -19.293085625894935], [27.296504754350501, -20.391519870690995], [27.724747348753247, -20.499058526290387], [27.727227817503252, -20.851801853114711], [28.02137007010861, -21.485975030200578], [28.794656202924209, -21.639454034107445], [29.432188348109033, -22.091312758067584], [28.017235955525244, -22.827753594659072], [27.119409620886238, -23.574323011979772], [26.78640669119741, -24.240690606383478], [26.485753208123292, -24.616326592713097], [25.941652052522151, -24.696373386333214], [25.765848829865206, -25.174845472923671], [25.664666375437712, -25.486816094669706], [25.025170525825782, -25.719670098576891], [24.211266717228792, -25.670215752873567], [23.733569777122703, -25.39012948985161], [23.312096795350179, -25.268689873965712], [22.824271274514896, -25.500458672794768], [22.579531691180584, -25.979447523708142], [22.105968865657864, -26.28025603607913], [21.60589603036939, -26.726533705351748], [20.889609002371731, -26.828542982695907], [20.666470167735437, -26.477453301704916], [20.758609246511831, -25.868136488551446], [20.165725538827186, -24.917961928000768], [19.895767856534427, -24.767790215760588], [19.895457797940672, -21.849156996347865], [20.881134067475866, -21.814327080983144], [20.910641310314531, -18.252218926672018], [21.655040317478971, -18.219146010005222], [23.196858351339298, -17.869038181227783], [23.579005568137713, -18.281261081620055], [24.217364536239209, -17.889347019118485], [24.520705193792534, -17.887124932529932], [25.084443393664564, -17.661815687737366], [25.264225701608005, -17.736539808831413], [25.649163445750155, -18.536025892818987]]] } }, + { "type": "Feature", "properties": { "admin": "Central African Republic", "name": "Central African Rep.", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[15.279460483469107, 7.421924546737968], [16.106231723706767, 7.497087917506504], [16.290561557691884, 7.754307359239304], [16.456184523187343, 7.734773667832966], [16.705988396886251, 7.508327541529978], [17.964929640380884, 7.890914008002865], [18.389554884523218, 8.281303615751822], [18.911021762780504, 8.630894680206351], [18.81200971850927, 8.982914536978596], [19.094008009526018, 9.074846910025837], [20.059685499764267, 9.01270600019485], [21.00086836109616, 9.475985215691507], [21.723821648859452, 10.567055568885973], [22.231129184668784, 10.971888739460507], [22.864165480244218, 11.142395127807543], [22.977543572692603, 10.714462591998538], [23.554304233502187, 10.089255275915306], [23.557249790142826, 9.681218166538683], [23.394779087017181, 9.26506785729222], [23.459012892355979, 8.954285793488891], [23.805813429466745, 8.666318874542425], [24.567369012152078, 8.229187933785466], [25.114932488716786, 7.825104071479172], [25.12413089366472, 7.500085150579436], [25.796647983511171, 6.979315904158069], [26.21341840994511, 6.546603298362071], [26.465909458123232, 5.94671743410187], [27.213409051225163, 5.550953477394557], [27.374226108517483, 5.233944403500059], [27.044065382604703, 5.127852688004835], [26.402760857862535, 5.150874538590869], [25.650455356557465, 5.256087754737123], [25.278798455514302, 5.170408229997191], [25.128833449003274, 4.927244777847789], [24.805028924262409, 4.897246608902349], [24.41053104014625, 5.108784084489129], [23.297213982850135, 4.609693101414221], [22.841479526468103, 4.710126247573483], [22.704123569436284, 4.633050848810156], [22.405123732195531, 4.02916006104732], [21.659122755630019, 4.224341945813719], [20.927591180106273, 4.322785549329736], [20.290679152108932, 4.691677761245287], [19.467783644293146, 5.031527818212779], [18.932312452884755, 4.709506130385973], [18.542982211997778, 4.201785183118317], [18.453065219809925, 3.504385891123348], [17.809900343505259, 3.560196437998569], [17.133042433346297, 3.728196519379451], [16.537058139724135, 3.198254706226278], [16.01285241055535, 2.267639675298084], [15.907380812247649, 2.557389431158612], [15.862732374747479, 3.013537298998982], [15.405395948964379, 3.335300604664339], [15.036219516671249, 3.851367295747123], [14.950953403389658, 4.21038930909492], [14.478372430080466, 4.732605495620446], [14.558935988023501, 5.03059764243153], [14.459407179429345, 5.451760565610299], [14.536560092841111, 6.22695872642069], [14.776545444404572, 6.408498033062044], [15.279460483469107, 7.421924546737968]]] } }, + { "type": "Feature", "properties": { "admin": "Canada", "name": "Canada", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-63.6645, 46.55001], [-62.9393, 46.41587], [-62.01208, 46.44314], [-62.50391, 46.03339], [-62.87433, 45.96818], [-64.1428, 46.39265], [-64.39261, 46.72747], [-64.01486, 47.03601], [-63.6645, 46.55001]]], [[[-61.806305, 49.10506], [-62.29318, 49.08717], [-63.58926, 49.40069], [-64.51912, 49.87304], [-64.17322, 49.95718], [-62.85829, 49.70641], [-61.835585, 49.28855], [-61.806305, 49.10506]]], [[[-123.510001587551116, 48.51001089130343], [-124.012890788399474, 48.370846259141402], [-125.655012777338342, 48.825004584338494], [-125.954994466792726, 49.179995835967638], [-126.850004435871853, 49.530000311880421], [-127.029993449544392, 49.814995835970073], [-128.059336304366212, 49.994959011426594], [-128.444584107102145, 50.53913768167611], [-128.358413656255408, 50.770648098343678], [-127.308581096029883, 50.552573554071948], [-126.695000977212302, 50.40090322529538], [-125.755006673823161, 50.295018215529367], [-125.415001587558791, 49.950000515332604], [-124.920768189119315, 49.47527497008339], [-123.92250870832099, 49.062483628935794], [-123.510001587551116, 48.51001089130343]]], [[[-56.134035814017111, 50.687009792679298], [-56.795881720595261, 49.812308661490945], [-56.143105027884289, 50.15011749938283], [-55.471492275602934, 49.935815334668447], [-55.822401089080913, 49.587128607779093], [-54.93514258484565, 49.313010972686833], [-54.473775397343772, 49.556691189159167], [-53.47654944519131, 49.24913890237405], [-53.786013759971233, 48.516780503933617], [-53.086133999226249, 48.687803656603528], [-52.95864824076223, 48.157164211614472], [-52.648098720904173, 47.53554840757549], [-53.069158291218336, 46.655498765644936], [-53.521456264853029, 46.618291734394823], [-54.178935512902527, 46.807065741556997], [-53.961868659060471, 47.625207017601909], [-54.240482143762122, 47.752279364607617], [-55.400773078011483, 46.88499380145312], [-55.997480841685835, 46.919720363953289], [-55.291219041552765, 47.389562486350982], [-56.250798712780508, 47.632545070987383], [-57.325229254777085, 47.572807115257987], [-59.26601518414676, 47.603347886742498], [-59.41949418805369, 47.89945384377485], [-58.796586473207398, 48.251525376979473], [-59.23162451845652, 48.523188381537793], [-58.391804979065213, 49.125580552764163], [-57.358689744686025, 50.718274034215845], [-56.738650071831998, 51.287438259478527], [-55.87097693543528, 51.632094224649187], [-55.406974249886602, 51.588272610065722], [-55.600218268442077, 51.317074693397913], [-56.134035814017111, 50.687009792679298]]], [[[-133.180004041711669, 54.169975490935308], [-132.710007884431292, 54.040009315423518], [-131.749989584003259, 54.120004380909208], [-132.049480347350965, 52.984621487024519], [-131.179042521826574, 52.18043284769827], [-131.577829549822894, 52.182370713909236], [-132.180428426778519, 52.639707139692391], [-132.549992432313843, 53.100014960332132], [-133.054611178755493, 53.411468817755363], [-133.239664482792676, 53.851080227262386], [-133.180004041711669, 54.169975490935308]]], [[[-79.26582, 62.158675], [-79.65752, 61.63308], [-80.09956, 61.7181], [-80.36215, 62.01649], [-80.315395, 62.085565], [-79.92939, 62.3856], [-79.52002, 62.36371], [-79.26582, 62.158675]]], [[[-81.89825, 62.7108], [-83.06857, 62.15922], [-83.77462, 62.18231], [-83.99367, 62.4528], [-83.25048, 62.91409], [-81.87699, 62.90458], [-81.89825, 62.7108]]], [[[-85.161307949549851, 65.657284654392797], [-84.975763719405933, 65.217518215588981], [-84.464012010419495, 65.371772365980163], [-83.88262630891974, 65.109617824963536], [-82.78757687043877, 64.766693020274673], [-81.642013719392509, 64.455135809986942], [-81.553440314444245, 63.979609280037131], [-80.817361212878851, 64.057485663500998], [-80.103451300766594, 63.725981350348597], [-80.991019863595653, 63.41124603947496], [-82.547178107416997, 63.651722317145229], [-83.108797573565042, 64.101875718839707], [-84.100416632813847, 63.569711819098004], [-85.523404710618991, 63.052379055424076], [-85.866768764982339, 63.637252916103542], [-87.221983201836721, 63.541238104905212], [-86.352759772471259, 64.035833238370699], [-86.224886440765133, 64.822916978608262], [-85.883847825854858, 65.738778388117041], [-85.161307949549851, 65.657284654392797]]], [[[-75.86588, 67.14886], [-76.98687, 67.09873], [-77.2364, 67.58809], [-76.81166, 68.14856], [-75.89521, 68.28721], [-75.1145, 68.01036], [-75.10333, 67.58202], [-75.21597, 67.44425], [-75.86588, 67.14886]]], [[[-95.647681203800488, 69.107690358321761], [-96.269521203800579, 68.757040358321731], [-97.61740120380054, 69.060030358321782], [-98.431801203800504, 68.950700358321768], [-99.797401203800504, 69.400030358321786], [-98.917401203800523, 69.710030358321788], [-98.218261203800466, 70.143540358321744], [-97.157401203800532, 69.860030358321794], [-96.557401203800524, 69.680030358321758], [-96.257401203800498, 69.490030358321761], [-95.647681203800488, 69.107690358321761]]], [[[-90.5471, 69.49766], [-90.55151, 68.47499], [-89.21515, 69.25873], [-88.01966, 68.61508], [-88.31749, 67.87338], [-87.35017, 67.19872], [-86.30607, 67.92146], [-85.57664, 68.78456], [-85.52197, 69.88211], [-84.10081, 69.80539], [-82.62258, 69.65826], [-81.28043, 69.16202], [-81.2202, 68.66567], [-81.96436, 68.13253], [-81.25928, 67.59716], [-81.38653, 67.11078], [-83.34456, 66.41154], [-84.73542, 66.2573], [-85.76943, 66.55833], [-86.0676, 66.05625], [-87.03143, 65.21297], [-87.32324, 64.77563], [-88.48296, 64.09897], [-89.91444, 64.03273], [-90.70398, 63.61017], [-90.77004, 62.96021], [-91.93342, 62.83508], [-93.15698, 62.02469], [-94.24153, 60.89865], [-94.62931, 60.11021], [-94.6846, 58.94882], [-93.21502, 58.78212], [-92.76462, 57.84571], [-92.297029999999893, 57.08709], [-90.89769, 57.28468], [-89.03953, 56.85172], [-88.03978, 56.47162], [-87.32421, 55.99914], [-86.07121, 55.72383], [-85.01181, 55.3026], [-83.36055, 55.24489], [-82.27285, 55.14832], [-82.4362, 54.28227], [-82.12502, 53.27703], [-81.40075, 52.15788], [-79.91289, 51.20842], [-79.14301, 51.53393], [-78.60191, 52.56208], [-79.12421, 54.14145], [-79.82958, 54.66772], [-78.22874, 55.13645], [-77.0956, 55.83741], [-76.54137, 56.53423], [-76.62319, 57.20263], [-77.30226, 58.05209], [-78.51688, 58.80458], [-77.33676, 59.85261], [-77.77272, 60.75788], [-78.10687, 62.31964], [-77.41067, 62.55053], [-75.69621, 62.2784], [-74.6682, 62.18111], [-73.83988, 62.4438], [-72.90853, 62.10507], [-71.67708, 61.52535], [-71.37369, 61.13717], [-69.59042, 61.06141], [-69.62033, 60.22125], [-69.2879, 58.95736], [-68.37455, 58.80106], [-67.64976, 58.21206], [-66.20178, 58.76731], [-65.24517, 59.87071], [-64.58352, 60.33558], [-63.80475, 59.4426], [-62.50236, 58.16708], [-61.39655, 56.96745], [-61.79866, 56.33945], [-60.46853, 55.77548], [-59.56962, 55.20407], [-57.97508, 54.94549], [-57.3332, 54.6265], [-56.93689, 53.78032], [-56.15811, 53.64749], [-55.75632, 53.27036], [-55.68338, 52.14664], [-56.40916, 51.7707], [-57.12691, 51.41972], [-58.77482, 51.0643], [-60.03309, 50.24277], [-61.72366, 50.08046], [-63.86251, 50.29099], [-65.36331, 50.2982], [-66.39905, 50.22897], [-67.23631, 49.51156], [-68.51114, 49.06836], [-69.95362, 47.74488], [-71.10458, 46.82171], [-70.25522, 46.98606], [-68.65, 48.3], [-66.55243, 49.1331], [-65.05626, 49.23278], [-64.17099, 48.74248], [-65.11545, 48.07085], [-64.79854, 46.99297], [-64.47219, 46.23849], [-63.17329, 45.73902], [-61.52072, 45.88377], [-60.51815, 47.00793], [-60.4486, 46.28264], [-59.80287, 45.9204], [-61.03988, 45.26525], [-63.25471, 44.67014], [-64.24656, 44.26553], [-65.36406, 43.54523], [-66.1234, 43.61867], [-66.16173, 44.46512], [-64.42549, 45.29204], [-66.02605, 45.25931], [-67.13741, 45.13753], [-67.79134, 45.70281], [-67.79046, 47.06636], [-68.23444, 47.35486], [-68.905, 47.185], [-69.237216, 47.447781], [-69.99997, 46.69307], [-70.305, 45.915], [-70.66, 45.46], [-71.08482, 45.30524], [-71.405, 45.255], [-71.50506, 45.0082], [-73.34783, 45.00738], [-74.867, 45.00048], [-75.31821, 44.81645], [-76.375, 44.09631], [-76.5, 44.018458893758712], [-76.820034145805565, 43.628784288093748], [-77.737885097957687, 43.62905558936329], [-78.720279914042365, 43.625089423184868], [-79.171673550111862, 43.466339423184216], [-79.01, 43.27], [-78.92, 42.965], [-78.939362148743683, 42.863611355148031], [-80.247447679347928, 42.366199856122584], [-81.277746548167144, 42.209025987306845], [-82.439277716791608, 41.675105088867149], [-82.690089280920162, 41.675105088867149], [-83.029810146806909, 41.832795722005834], [-83.141999681312555, 41.975681057292825], [-83.12, 42.08], [-82.9, 42.43], [-82.43, 42.98], [-82.137642381503881, 43.571087551439909], [-82.337763125431053, 44.44], [-82.550924648758169, 45.347516587905368], [-83.592850714843067, 45.816893622412373], [-83.469550747394621, 45.994686387712584], [-83.616130947590563, 46.116926988299056], [-83.890765347005726, 46.116926988299056], [-84.091851264161463, 46.27541860613816], [-84.14211951367335, 46.512225857115723], [-84.3367, 46.40877], [-84.6049, 46.4396], [-84.543748745445853, 46.538684190449132], [-84.779238247399888, 46.637101955749038], [-84.876079881514855, 46.900083319682366], [-85.652363247403414, 47.220218817730498], [-86.461990831228249, 47.553338019392037], [-87.439792623300207, 47.94], [-88.378114183286698, 48.302917588893727], [-89.272917446636654, 48.019808254582657], [-89.6, 48.01], [-90.83, 48.27], [-91.64, 48.14], [-92.61, 48.45], [-93.63087, 48.60926], [-94.32914, 48.67074], [-94.64, 48.84], [-94.81758, 49.38905], [-95.15609, 49.38425], [-95.159069509172014, 49.0], [-97.228720000004799, 49.0007], [-100.65, 49.0], [-104.04826, 48.99986], [-107.05, 49.0], [-110.05, 49.0], [-113.0, 49.0], [-116.04818, 49.0], [-117.03121, 49.0], [-120.0, 49.0], [-122.84, 49.0], [-122.97421, 49.002537777777789], [-124.91024, 49.98456], [-125.62461, 50.41656], [-127.43561, 50.83061], [-127.99276, 51.71583], [-127.85032, 52.32961], [-129.12979, 52.75538], [-129.30523, 53.56159], [-130.51497, 54.28757], [-130.53611, 54.80278], [-129.98, 55.285], [-130.00778, 55.91583], [-131.70781, 56.55212], [-132.73042, 57.69289], [-133.35556, 58.41028], [-134.27111, 58.86111], [-134.945, 59.27056], [-135.47583, 59.78778], [-136.47972, 59.46389], [-137.4525, 58.905], [-138.34089, 59.56211], [-139.039, 60.0], [-140.013, 60.27682], [-140.99778, 60.30639], [-140.9925, 66.00003], [-140.986, 69.712], [-139.12052, 69.47102], [-137.54636, 68.99002], [-136.50358, 68.89804], [-135.62576, 69.31512], [-134.41464, 69.62743], [-132.92925, 69.50534], [-131.43136, 69.94451], [-129.79471, 70.19369], [-129.10773, 69.77927], [-128.36156, 70.01286], [-128.13817, 70.48384], [-127.44712, 70.37721], [-125.75632, 69.48058], [-124.42483, 70.1584], [-124.28968, 69.39969], [-123.06108, 69.56372], [-122.6835, 69.85553], [-121.47226, 69.79778], [-119.94288, 69.37786], [-117.60268, 69.01128], [-116.22643, 68.84151], [-115.2469, 68.90591], [-113.89794, 68.3989], [-115.30489, 67.90261], [-113.49727, 67.68815], [-110.798, 67.80612], [-109.94619, 67.98104], [-108.8802, 67.38144], [-107.79239, 67.88736], [-108.81299, 68.31164], [-108.16721, 68.65392], [-106.95, 68.7], [-106.15, 68.8], [-105.34282, 68.56122], [-104.33791, 68.018], [-103.22115, 68.09775], [-101.45433, 67.64689], [-99.90195, 67.80566], [-98.4432, 67.78165], [-98.5586, 68.40394], [-97.66948, 68.57864], [-96.11991, 68.23939], [-96.12588, 67.29338], [-95.48943, 68.0907], [-94.685, 68.06383], [-94.23282, 69.06903], [-95.30408, 69.68571], [-96.47131, 70.08976], [-96.39115, 71.19482], [-95.2088, 71.92053], [-93.88997, 71.76015], [-92.87818, 71.31869], [-91.51964, 70.19129], [-92.40692, 69.69997], [-90.5471, 69.49766]]], [[[-114.167169999999871, 73.12145], [-114.66634, 72.65277], [-112.441019999999867, 72.9554], [-111.05039, 72.4504], [-109.920349999999857, 72.96113], [-109.00654, 72.63335], [-108.188349999999886, 71.65089], [-107.68599, 72.06548], [-108.39639, 73.08953], [-107.51645, 73.23598], [-106.522589999999866, 73.07601], [-105.402459999999877, 72.67259], [-104.77484, 71.6984], [-104.464759999999814, 70.99297], [-102.78537, 70.49776], [-100.980779999999868, 70.02432], [-101.089289999999892, 69.58447000000011], [-102.731159999999875, 69.50402], [-102.09329, 69.11962], [-102.43024, 68.75282], [-104.24, 68.91], [-105.96, 69.180000000000135], [-107.12254, 69.11922], [-108.999999999999872, 68.78], [-111.534148875200117, 68.630059156817921], [-113.3132, 68.53554], [-113.854959999999807, 69.007440000000102], [-115.22, 69.28], [-116.10794, 69.16821], [-117.34, 69.960000000000107], [-116.674729999999869, 70.06655], [-115.13112, 70.2373], [-113.72141, 70.19237], [-112.4161, 70.36638], [-114.35, 70.6], [-116.48684, 70.52045], [-117.9048, 70.540560000000127], [-118.43238, 70.9092], [-116.11311, 71.30918], [-117.65568, 71.2952], [-119.40199, 71.55859], [-118.56267, 72.30785], [-117.866419999999877, 72.70594], [-115.18909, 73.314590000000109], [-114.167169999999871, 73.12145]]], [[[-104.5, 73.42], [-105.38, 72.76], [-106.94, 73.46], [-106.6, 73.6], [-105.26, 73.64], [-104.5, 73.42]]], [[[-76.34, 73.102684989953005], [-76.251403808593736, 72.826385498046861], [-77.314437866210895, 72.85554504394527], [-78.391670227050795, 72.876655578613253], [-79.486251831054645, 72.742202758789062], [-79.775833129882827, 72.80290222167973], [-80.876098632812514, 73.333183288574205], [-80.833885192871051, 73.693183898925767], [-80.353057861328111, 73.75971984863277], [-78.064437866210923, 73.651931762695327], [-76.34, 73.102684989953005]]], [[[-86.562178514334107, 73.157447007938444], [-85.774371304044521, 72.534125881633798], [-84.850112474288224, 73.34027822538711], [-82.315590176100969, 73.750950832810574], [-80.600087653307611, 72.716543687624181], [-80.748941616524391, 72.061906643350753], [-78.770638597310764, 72.352173163534147], [-77.824623989559569, 72.749616604291035], [-75.605844692675717, 72.243678493937381], [-74.228616095664975, 71.767144273557889], [-74.099140794557698, 71.330840155717638], [-72.242225714797641, 71.556924546994495], [-71.200015428335192, 70.920012518997211], [-68.78605424668487, 70.525023708774242], [-67.914970465756923, 70.121947536897594], [-66.969033372654152, 69.18608734809186], [-68.805122850200533, 68.720198472764409], [-66.449866095633851, 68.067163397892003], [-64.862314419195215, 67.847538560651614], [-63.424934454996745, 66.928473212340649], [-61.851981370680569, 66.862120673277829], [-62.163176845942296, 66.160251369889593], [-63.91844438338417, 64.998668524832837], [-65.148860236253611, 65.426032619886669], [-66.72121904159853, 66.388041083432185], [-68.015016038673949, 66.262725735124391], [-68.141287400979152, 65.689789130304362], [-67.089646165623392, 65.108455105236985], [-65.732080451099748, 64.64840566675862], [-65.320167609301265, 64.382737128346051], [-64.669406297449669, 63.392926744227474], [-65.013803880458894, 62.674185085695974], [-66.275044725190455, 62.945098781986069], [-68.783186204692711, 63.745670071051805], [-67.369680752213029, 62.883965562584869], [-66.328297288667201, 62.28007477482204], [-66.165568203380147, 61.930897121825879], [-68.877366502544632, 62.330149237712803], [-71.023437059193824, 62.910708116295829], [-72.23537858751898, 63.397836005295154], [-71.886278449171286, 63.679989325608837], [-73.37830624051837, 64.193963121183813], [-74.834418911422588, 64.679075629323776], [-74.818502570276706, 64.389093329517962], [-77.709979824520019, 64.229542344816778], [-78.55594885935416, 64.572906399180127], [-77.897281053361908, 65.309192206474776], [-76.018274298797181, 65.326968899183143], [-73.95979529488271, 65.454764716240888], [-74.293883429649625, 65.81177134872938], [-73.94491248238262, 66.310578111426722], [-72.65116716173938, 67.284575507263853], [-72.926059943316076, 67.726925767682374], [-73.311617804645721, 68.069437160912898], [-74.8433072577768, 68.554627183701271], [-76.869100918266739, 68.894735622830254], [-76.228649054657339, 69.147769273547411], [-77.28736996123709, 69.769540106883269], [-78.168633999326588, 69.826487535268896], [-78.95724219431672, 70.166880194775402], [-79.492455003563649, 69.871807766388898], [-81.305470954091732, 69.743185126414332], [-84.944706183598456, 69.966634019644388], [-87.060003424817864, 70.260001125765356], [-88.681713223001495, 70.410741278760796], [-89.513419562523012, 70.762037665480975], [-88.467721116880753, 71.218185533321318], [-89.888151211287465, 71.222552191849942], [-90.205160285181989, 72.235074367960792], [-89.43657670770493, 73.129464219852352], [-88.408241543312784, 73.537888902471209], [-85.826151089200906, 73.803815823045213], [-86.562178514334107, 73.157447007938444]]], [[[-100.35642, 73.84389], [-99.16387, 73.63339], [-97.38, 73.76], [-97.12, 73.47], [-98.05359, 72.99052], [-96.54, 72.56], [-96.72, 71.66], [-98.35966, 71.27285], [-99.32286, 71.35639], [-100.01482, 71.73827], [-102.5, 72.51], [-102.48, 72.83], [-100.43836, 72.70588], [-101.54, 73.36], [-100.35642, 73.84389]]], [[[-93.196295539100205, 72.771992499473342], [-94.26904659704725, 72.024596259235949], [-95.409855516322637, 72.061880805134578], [-96.033745083382428, 72.940276801231789], [-96.01826799191096, 73.437429918095788], [-95.495793423224001, 73.862416897264154], [-94.503657599652328, 74.134906724739196], [-92.420012173211745, 74.100025132942179], [-90.509792853542578, 73.85673248971203], [-92.003965216829869, 72.966244208458477], [-93.196295539100205, 72.771992499473342]]], [[[-120.46, 71.383601793087578], [-123.09219, 70.90164], [-123.62, 71.34], [-125.92894873747332, 71.868688463011395], [-125.499999999999872, 72.292260811795003], [-124.80729, 73.02256], [-123.94, 73.680000000000135], [-124.917749999999899, 74.292750000000112], [-121.53788, 74.44893], [-120.10978, 74.24135], [-117.55564, 74.18577], [-116.58442, 73.89607], [-115.51081, 73.47519], [-116.767939999999882, 73.22292], [-119.22, 72.52], [-120.46, 71.82], [-120.46, 71.383601793087578]]], [[[-93.612755906940464, 74.979997260224437], [-94.156908738973812, 74.59234650338685], [-95.60868058956558, 74.666863918751758], [-96.820932176484561, 74.927623196096576], [-96.288587409229791, 75.377828274223333], [-94.850819871789113, 75.647217515760886], [-93.977746548217908, 75.296489569795952], [-93.612755906940464, 74.979997260224437]]], [[[-98.5, 76.72], [-97.735585, 76.25656], [-97.704415, 75.74344], [-98.16, 75.0], [-99.80874, 74.89744], [-100.88366, 75.05736], [-100.86292, 75.64075], [-102.50209, 75.5638], [-102.56552, 76.3366], [-101.48973, 76.30537], [-99.98349, 76.64634], [-98.57699, 76.58859], [-98.5, 76.72]]], [[[-108.21141, 76.20168], [-107.81943, 75.84552], [-106.92893, 76.01282], [-105.881, 75.9694], [-105.70498, 75.47951], [-106.31347, 75.00527], [-109.7, 74.85], [-112.22307, 74.41696], [-113.74381, 74.39427], [-113.87135, 74.72029], [-111.79421, 75.1625], [-116.31221, 75.04343], [-117.7104, 75.2222], [-116.34602, 76.19903], [-115.40487, 76.47887], [-112.59056, 76.14134], [-110.81422, 75.54919], [-109.0671, 75.47321], [-110.49726, 76.42982], [-109.5811, 76.79417], [-108.54859, 76.67832], [-108.21141, 76.20168]]], [[[-94.684085862999439, 77.097878323058367], [-93.573921068073105, 76.776295884906062], [-91.605023159536586, 76.778517971494594], [-90.741845872749209, 76.449597479956807], [-90.969661424507976, 76.074013170059445], [-89.822237921899244, 75.847773749485626], [-89.187082892599776, 75.610165513807615], [-87.838276333349611, 75.566188869927217], [-86.379192267588664, 75.482421373182163], [-84.789625210290595, 75.699204006646497], [-82.753444586910049, 75.784315090631225], [-81.12853084992436, 75.713983466282016], [-80.05751095245914, 75.336848863415867], [-79.833932868148324, 74.923127346487192], [-80.457770758775823, 74.657303778777774], [-81.948842536125511, 74.442459011524321], [-83.2288936022114, 74.564027818490928], [-86.097452358733292, 74.410032050261137], [-88.150350307960196, 74.392307033984977], [-89.764722052758358, 74.515555325001117], [-92.422440965529418, 74.837757880340973], [-92.768285488642789, 75.38681997344213], [-92.889905972041717, 75.882655341282629], [-93.893824022175977, 76.319243679500516], [-95.962457445035795, 76.44138092722244], [-97.121378953829463, 76.751077785947587], [-96.745122850312342, 77.161388658345132], [-94.684085862999439, 77.097878323058367]]], [[[-116.198586595507322, 77.645286770326194], [-116.335813361458349, 76.876961575010554], [-117.106050584768766, 76.530031846819114], [-118.040412157038119, 76.481171780087081], [-119.899317586885687, 76.053213406061971], [-121.499995077126471, 75.900018622532784], [-122.85492448615895, 76.116542873835684], [-122.854925293603188, 76.116542873835684], [-121.157535360328239, 76.864507554828336], [-119.103938971821023, 77.512219957174608], [-117.570130784965954, 77.498318996888102], [-116.198586595507322, 77.645286770326194]]], [[[-93.840003017943971, 77.51999726023449], [-94.295608283245244, 77.491342678528682], [-96.169654100310055, 77.55511139597688], [-96.436304490936109, 77.83462921824362], [-94.422577277386353, 77.820004787904978], [-93.720656297565867, 77.634331366680314], [-93.840003017943971, 77.51999726023449]]], [[[-110.186938035912945, 77.697014879050286], [-112.051191169058455, 77.409228827616843], [-113.534278937619035, 77.732206529441143], [-112.724586758253835, 78.051050116681935], [-111.264443325630822, 78.152956041161545], [-109.854451870547067, 77.996324774884812], [-110.186938035912945, 77.697014879050286]]], [[[-109.663145718202557, 78.601972561345676], [-110.88131425661885, 78.406919867659994], [-112.542091437615142, 78.407901719873493], [-112.525890876091566, 78.550554511215225], [-111.500010342233367, 78.849993598130538], [-110.96366065147599, 78.804440823065207], [-109.663145718202557, 78.601972561345676]]], [[[-95.830294969449312, 78.056941229963243], [-97.309842902397975, 77.85059723582178], [-98.124289313533964, 78.082856960757567], [-98.55286780474664, 78.458105373845086], [-98.631984422585504, 78.871930243638374], [-97.337231411512604, 78.831984361476756], [-96.754398769908761, 78.765812689926989], [-95.559277920294562, 78.41831452098026], [-95.830294969449312, 78.056941229963243]]], [[[-100.060191820052111, 78.324754340315891], [-99.670939093813601, 77.907544664207393], [-101.303940192452984, 78.018984890444798], [-102.949808722733025, 78.343228664860206], [-105.176132778731514, 78.38033234324574], [-104.210429450277147, 78.677420152491777], [-105.419580451258511, 78.918335679836431], [-105.492289191493128, 79.301593939929177], [-103.529282396237917, 79.16534902619162], [-100.8251580472688, 78.80046173777869], [-100.060191820052111, 78.324754340315891]]], [[[-87.02, 79.66], [-85.81435, 79.3369], [-87.18756, 79.0393], [-89.03535, 78.28723], [-90.80436, 78.21533], [-92.87669, 78.34333], [-93.95116, 78.75099], [-93.93574, 79.11373], [-93.14524, 79.3801], [-94.974, 79.37248], [-96.07614, 79.70502], [-96.70972, 80.15777], [-96.01644, 80.60233], [-95.32345, 80.90729], [-94.29843, 80.97727], [-94.73542, 81.20646], [-92.40984, 81.25739], [-91.13289, 80.72345], [-89.45, 80.509322033898258], [-87.81, 80.32], [-87.02, 79.66]]], [[[-68.5, 83.106321516765732], [-65.82735, 83.02801], [-63.68, 82.9], [-61.85, 82.6286], [-61.89388, 82.36165], [-64.334, 81.92775], [-66.75342, 81.72527], [-67.65755, 81.50141], [-65.48031, 81.50657], [-67.84, 80.9], [-69.4697, 80.61683], [-71.18, 79.8], [-73.2428, 79.63415], [-73.88, 79.430162204802073], [-76.90773, 79.32309], [-75.52924, 79.19766], [-76.22046, 79.01907], [-75.39345, 78.52581], [-76.34354, 78.18296], [-77.88851, 77.89991], [-78.36269, 77.50859], [-79.75951, 77.20968], [-79.61965, 76.98336], [-77.91089, 77.022045], [-77.88911, 76.777955], [-80.56125, 76.17812], [-83.17439, 76.45403], [-86.11184, 76.29901], [-87.6, 76.42], [-89.49068, 76.47239], [-89.6161, 76.95213], [-87.76739, 77.17833], [-88.26, 77.9], [-87.65, 77.970222222222205], [-84.97634, 77.53873], [-86.34, 78.18], [-87.96192, 78.37181], [-87.15198, 78.75867], [-85.37868, 78.9969], [-85.09495, 79.34543], [-86.50734, 79.73624], [-86.93179, 80.25145], [-84.19844, 80.20836], [-83.408695652173819, 80.1], [-81.84823, 80.46442], [-84.1, 80.58], [-87.59895, 80.51627], [-89.36663, 80.85569], [-90.2, 81.26], [-91.36786, 81.5531], [-91.58702, 81.89429], [-90.1, 82.085], [-88.93227, 82.11751], [-86.97024, 82.27961], [-85.5, 82.652273458057024], [-84.260005, 82.6], [-83.18, 82.32], [-82.42, 82.86], [-81.1, 83.02], [-79.30664, 83.13056], [-76.25, 83.172058823529369], [-75.71878, 83.06404], [-72.83153, 83.23324], [-70.665765, 83.169780758382828], [-68.5, 83.106321516765732]]]] } }, + { "type": "Feature", "properties": { "admin": "Switzerland", "name": "Switzerland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.594226108446346, 47.525058091820256], [9.632931756232974, 47.347601223329974], [9.479969516649019, 47.102809963563367], [9.932448357796657, 46.920728054382948], [10.442701450246627, 46.893546250997424], [10.36337812667861, 46.483571275409851], [9.922836541390378, 46.314899400409182], [9.182881707403054, 46.440214748716976], [8.966305779667804, 46.036931871111186], [8.489952426801322, 46.005150865251672], [8.316629672894377, 46.163642483090847], [7.755992058959832, 45.824490057959302], [7.273850945676655, 45.776947740250769], [6.843592970414504, 45.991146552100595], [6.500099724970424, 46.429672756529428], [6.022609490593537, 46.272989813820466], [6.037388950229, 46.725778713561859], [6.768713820023605, 47.287708238303686], [6.736571079138058, 47.541801255882838], [7.192202182655505, 47.449765529971003], [7.466759067422228, 47.620581976911794], [8.31730146651415, 47.613579820336255], [8.522611932009765, 47.830827541691285], [9.594226108446346, 47.525058091820256]]] } }, + { "type": "Feature", "properties": { "admin": "Chile", "name": "Chile", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-68.634010227583147, -52.636370458874353], [-68.633349999999879, -54.8695], [-67.56244, -54.87001], [-66.95992, -54.89681], [-67.291029999999878, -55.30124], [-68.148629999999841, -55.61183], [-68.639990810811796, -55.580017999086877], [-69.2321, -55.49906], [-69.95809, -55.19843], [-71.00568, -55.05383], [-72.2639, -54.49514], [-73.2852, -53.957519999999874], [-74.66253, -52.83749], [-73.8381, -53.04743], [-72.43418, -53.7154], [-71.10773, -54.07433], [-70.591779999999787, -53.61583], [-70.26748, -52.93123], [-69.345649999999878, -52.5183], [-68.634010227583147, -52.636370458874353]]], [[[-68.219913092711224, -21.49434661223183], [-67.828179897722634, -22.872918796482178], [-67.106673550063604, -22.735924574476392], [-66.985233934177629, -22.986348565362825], [-67.328442959244128, -24.025303236590908], [-68.417652960876111, -24.518554782816874], [-68.386001146097342, -26.185016371365229], [-68.594799770772667, -26.50690886811126], [-68.295541551370391, -26.899339694935787], [-69.001234910748266, -27.521213881136127], [-69.656130337183143, -28.459141127233686], [-70.013550381129861, -29.367922865518544], [-69.919008348251921, -30.336339206668306], [-70.535068935819439, -31.365010267870279], [-70.074399380153622, -33.09120981214803], [-69.814776984319209, -33.273886000299839], [-69.817309129501453, -34.193571465798279], [-70.388049485949082, -35.169687595359441], [-70.364769253201658, -36.005088799789931], [-71.121880662709771, -36.65812387466233], [-71.118625047475419, -37.576827487947192], [-70.814664272734703, -38.552995293940732], [-71.413516608349042, -38.916022230791107], [-71.680761277946445, -39.808164157878061], [-71.915734015577542, -40.832339369470716], [-71.746803758415453, -42.051386407235988], [-72.148898078078517, -42.254888197601375], [-71.915423956983901, -43.408564548517404], [-71.464056159130493, -43.787611179378324], [-71.793622606071935, -44.207172133156099], [-71.329800788036195, -44.407521661151677], [-71.222778896759721, -44.784242852559409], [-71.659315558545316, -44.973688653341434], [-71.552009446891233, -45.560732924177117], [-71.917258470330196, -46.884838148791786], [-72.44735531278026, -47.738532810253517], [-72.331160854771937, -48.244238376661819], [-72.648247443314929, -48.878618259476774], [-73.415435757120022, -49.318436374712952], [-73.328050910114456, -50.378785088909865], [-72.975746832964617, -50.741450290734299], [-72.309973517532342, -50.677009779666342], [-72.329403856074023, -51.425956312872394], [-71.914803839796321, -52.009022305865912], [-69.498362189396076, -52.142760912637236], [-68.571545376241332, -52.299443855346247], [-69.461284349226617, -52.291950772663924], [-69.94277950710611, -52.537930590373243], [-70.8451016913545, -52.899200528525711], [-71.006332160105217, -53.833252042201345], [-71.429794684520928, -53.856454760300373], [-72.557942877884855, -53.531410001184447], [-73.702756720662862, -52.835069268607249], [-73.702756720662862, -52.835070076051487], [-74.946763475225154, -52.262753588419017], [-75.260026007778507, -51.62935475037321], [-74.976632453089806, -51.043395684615675], [-75.47975419788348, -50.378371677451547], [-75.608015102831942, -48.673772881871784], [-75.182769741502128, -47.711919447623153], [-74.126580980104677, -46.939253431995084], [-75.644395311165439, -46.647643324572016], [-74.69215369332305, -45.76397633238097], [-74.351709357384252, -44.10304412208788], [-73.240356004515192, -44.454960625995611], [-72.717803921179765, -42.383355808278985], [-73.388899909138232, -42.117532240569567], [-73.701335618774834, -43.365776462579738], [-74.33194312203257, -43.224958184584395], [-74.017957119427152, -41.794812920906828], [-73.677099372029943, -39.942212823243111], [-73.217592536090663, -39.258688653318508], [-73.505559455037044, -38.282882582351064], [-73.588060879191076, -37.156284681956016], [-73.166717088499283, -37.123780206044351], [-72.553136969681717, -35.508840020491022], [-71.861732143832555, -33.909092706031522], [-71.438450486929895, -32.418899428030819], [-71.668720669222424, -30.920644626592516], [-71.370082567007714, -30.095682061484997], [-71.48989437527645, -28.861442152625909], [-70.905123867461569, -27.640379734001193], [-70.724953986275963, -25.705924167587209], [-70.403965827095035, -23.628996677344542], [-70.091245897080668, -21.393319187101223], [-70.164419725205974, -19.756468194256183], [-70.372572394477714, -18.347975355708879], [-69.858443569605797, -18.092693780187027], [-69.590423753523979, -17.580011895419286], [-69.100246955019401, -18.260125420812653], [-68.966818406841824, -18.981683444904089], [-68.442225104430918, -19.405068454671419], [-68.757167121033703, -20.37265797290447], [-68.219913092711224, -21.49434661223183]]]] } }, + { "type": "Feature", "properties": { "admin": "China", "name": "China", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[110.339187860151526, 18.678395087147603], [109.475209588663702, 18.19770091396861], [108.655207961056135, 18.507681993071397], [108.626217482540426, 19.367887885001974], [109.119055617308007, 19.821038519769385], [110.211598748822837, 20.101253973872073], [110.786550734502228, 20.077534491450077], [111.01005130416462, 19.695929877190732], [110.570646600386794, 19.255879218009305], [110.339187860151526, 18.678395087147603]]], [[[127.657407261262378, 49.760270494172929], [129.397817824420429, 49.440600084015429], [130.58229332898236, 48.729687404976112], [130.987281528853828, 47.790132351261391], [132.506671991099495, 47.788969631534876], [133.373595819228001, 48.183441677434914], [135.026311476786702, 48.478229885443902], [134.500813836810607, 47.578439846377833], [134.112362095272601, 47.212467352886719], [133.76964399631288, 46.116926988299056], [133.097126906466428, 45.14406647397216], [131.883454217659562, 45.32116160743643], [131.025212030156069, 44.967953192721573], [131.288555129115537, 44.111519680348252], [131.144687941614848, 42.929989732426932], [130.633866408409801, 42.903014634770543], [130.640015903852429, 42.39500946712527], [129.994267205933227, 42.985386867843793], [129.596668735879462, 42.424981797854592], [128.05221520397231, 41.994284572917984], [128.208433058790717, 41.466771552082534], [127.343782993683021, 41.503151760415953], [126.869083286649854, 41.816569322266155], [126.18204511932943, 41.107336127276362], [125.079941847840587, 40.569823716792449], [124.265624627785314, 39.928493353834135], [122.86757042856101, 39.637787583976255], [122.131387974130917, 39.170451768544623], [121.054554478032856, 38.89747101496291], [121.585994907722466, 39.360853583324136], [121.376757033372641, 39.750261338859524], [122.168595005381007, 40.422442531896046], [121.640358514493528, 40.946389878903304], [120.768628778161954, 40.593388169917596], [119.639602085449056, 39.898055935214209], [119.023463983233015, 39.252333075511096], [118.042748651197897, 39.204273993479674], [117.532702264477052, 38.73763580988409], [118.05969852098967, 38.061475531561051], [118.878149855628351, 37.897325344385898], [118.911636183753501, 37.448463853498723], [119.702802362142037, 37.156388658185072], [120.823457472823648, 37.870427761377968], [121.711258579597938, 37.481123358707165], [122.357937453298462, 37.454484157860684], [122.519994744965814, 36.930614325501828], [121.104163853033029, 36.651329047180432], [120.63700890511457, 36.111439520811125], [119.66456180224607, 35.609790554337728], [119.151208123858567, 34.909859117160458], [120.227524855633717, 34.360331936168613], [120.620369093916565, 33.37672272392512], [121.229014113450219, 32.460318711877186], [121.908145786630044, 31.692174384074683], [121.891919386890336, 30.949351508095098], [121.264257440273298, 30.676267401648712], [121.503519321784722, 30.14291494396425], [122.092113885589086, 29.832520453403156], [121.93842817595305, 29.018022365834803], [121.684438511238469, 28.225512600206677], [121.125661248866436, 28.135673122667178], [120.395473260582307, 27.053206895449385], [119.585496860839555, 25.740780544532605], [118.656871372554519, 24.547390855400234], [117.281606479970833, 23.624501451099714], [115.890735304835118, 22.782873236578094], [114.763827345846209, 22.668074042241663], [114.152546828265656, 22.223760077396204], [113.806779819800752, 22.548339748621423], [113.241077915501592, 22.051367499270462], [111.843592157032447, 21.550493679281512], [110.78546552942413, 21.39714386645533], [110.444039341271662, 20.34103261970639], [109.88986128137357, 20.282457383703441], [109.627655063924635, 21.008227037026725], [109.864488153118316, 21.395050970947516], [108.522812941524421, 21.715212307211821], [108.050180291782979, 21.552379869060101], [107.043420037872636, 21.8118989120299], [106.567273390735352, 22.21820486092474], [106.725403273548466, 22.794267889898375], [105.811247186305209, 22.976892401617899], [105.329209425886631, 23.352063300056976], [104.476858351664475, 22.819150092046918], [103.504514601660503, 22.703756618739217], [102.706992222100155, 22.708795070887696], [102.170435825613552, 22.464753119389336], [101.652017856861576, 22.318198757409554], [101.803119744882906, 21.174366766845051], [101.27002566936001, 21.201651923095167], [101.180005324307558, 21.436572984294052], [101.150032993578236, 21.849984442629015], [100.416537713627349, 21.558839423096654], [99.983489211021549, 21.742936713136451], [99.240898878987196, 22.118314317304559], [99.53199222208741, 22.949038804612591], [98.898749220782804, 23.142722072842581], [98.66026248575578, 24.063286037690002], [97.604719679762027, 23.897404690033049], [97.724609002679131, 25.083637193293036], [98.671838006589212, 25.91870250091349], [98.712093947344556, 26.743535874940243], [98.682690057370507, 27.508812160750658], [98.246230910233351, 27.747221381129172], [97.91198774616943, 28.335945136014367], [97.327113885490007, 28.261582749946339], [96.248833449287829, 28.411030992134467], [96.586590610747521, 28.830979519154361], [96.117678664131006, 29.452802028922513], [95.404802280664626, 29.031716620392157], [94.565990431702929, 29.27743805593996], [93.413347609432662, 28.640629380807233], [92.503118931043616, 27.896876329046442], [91.696656528696693, 27.771741848251615], [91.258853794319876, 28.040614325466343], [90.730513950567797, 28.064953925075738], [90.015828891971182, 28.296438503527177], [89.475810174521158, 28.042758897406365], [88.814248488320573, 27.299315904239389], [88.730325962278528, 28.086864732367552], [88.120440708369941, 27.876541652939572], [86.954517043000635, 27.974261786403524], [85.823319940131526, 28.203575954698742], [85.011638218123053, 28.642773952747369], [84.23457970575015, 28.839893703724691], [83.89899295444674, 29.320226141877633], [83.337115106137176, 29.463731594352193], [82.327512648450877, 30.115268052688204], [81.525804477874786, 30.422716986608659], [81.111256138029276, 30.183480943313402], [79.721366815107118, 30.882714748654728], [78.738894484374001, 31.515906073527045], [78.458446486326025, 32.61816437431272], [79.176128777995544, 32.483779812137747], [79.208891636068543, 32.994394639613738], [78.811086460285722, 33.506198025032397], [78.912268914713209, 34.321936346975768], [77.83745079947461, 35.494009507787794], [76.192848341785705, 35.89840342868785], [75.896897414050173, 36.666806138651872], [75.158027785140987, 37.133030910789152], [74.980002475895404, 37.419990139305888], [74.829985792952144, 37.990007025701445], [74.864815708316783, 38.378846340481587], [74.25751427602269, 38.606506862943476], [73.928852166646394, 38.505815334622717], [73.675379266254836, 39.431236884105566], [73.960013055318427, 39.660008449861714], [73.822243686828315, 39.893973497063136], [74.776862420556043, 40.366425279291619], [75.467827996730719, 40.56207225194867], [76.526368035797432, 40.427946071935132], [76.90448449087711, 41.066485907549648], [78.187196893226044, 41.185315863604799], [78.543660923175253, 41.582242540038713], [80.119430373051401, 42.12394074153822], [80.259990268885318, 42.34999929459908], [80.180150180994374, 42.920067857426844], [80.866206496101213, 43.180362046881008], [79.966106398441426, 44.917516994804622], [81.947070753918084, 45.317027492853143], [82.458925815769035, 45.539649563166499], [83.180483839860543, 47.330031236350735], [85.164290399113213, 47.000955715516099], [85.720483839870667, 47.452969468773077], [85.76823286330837, 48.455750637396896], [86.59877648310335, 48.549181626980605], [87.359970330762692, 49.214980780629148], [87.751264276076668, 49.297197984405464], [88.013832228551678, 48.599462795600594], [88.854297723346747, 48.069081732773007], [90.280825636763893, 47.693549099307901], [90.970809360724957, 46.88814606382293], [90.585768263718307, 45.719716091487491], [90.945539585334316, 45.286073309910243], [92.133890822318222, 45.115075995456429], [93.480733677141316, 44.97547211362], [94.688928664125356, 44.352331854828456], [95.306875441471504, 44.241330878265458], [95.762454868556688, 43.319449164394619], [96.349395786527808, 42.725635280928643], [97.451757440177971, 42.74888967546007], [99.515817498779995, 42.524691473961688], [100.845865513108279, 42.663804429691417], [101.833040399179936, 42.51487295182627], [103.312278273534787, 41.907468166667613], [104.522281935649005, 41.90834666601662], [104.964993931093431, 41.597409572916334], [106.129315627061658, 42.134327704428891], [107.744772576937976, 42.481515814781908], [109.243595819131428, 42.519446316084149], [110.412103306115299, 42.871233628911014], [111.129682244920218, 43.406834011400171], [111.82958784388137, 43.743118394539486], [111.667737257943202, 44.073175767587706], [111.348376906379428, 44.457441718110047], [111.87330610560025, 45.102079372735112], [112.436062453258842, 45.01164561622425], [113.463906691544196, 44.808893134127111], [114.46033165899604, 45.339816799493875], [115.985096470200133, 45.727235012386004], [116.717868280098855, 46.38820241961524], [117.421701287914246, 46.67273285581421], [118.874325799638711, 46.805412095723646], [119.663269891438745, 46.692679958678944], [119.772823927897562, 47.048058783550132], [118.866574334794947, 47.747060044946195], [118.064142694166719, 48.06673045510373], [117.295507440257438, 47.697709052107385], [116.308952671373234, 47.853410142602812], [115.742837355615734, 47.726544501326273], [115.485282017073018, 48.135382595403442], [116.191802199367601, 49.134598090199056], [116.67880089728618, 49.888531399121398], [117.879244419426371, 49.510983384796944], [119.288460728025839, 50.142882798862033], [119.279365675942358, 50.582907619827282], [120.182049595216924, 51.64356639261802], [120.738191359541972, 51.964115302124547], [120.725789015791975, 52.516226304730814], [120.177088657716865, 52.753886216841195], [121.003084751470226, 53.251401068731226], [122.245747918792858, 53.431725979213681], [123.571506789240843, 53.458804429734627], [125.068211297710434, 53.161044826868832], [125.946348911646169, 52.792798570356936], [126.564399041856959, 51.784255479532689], [126.939156528837657, 51.353894151405896], [127.287455682484904, 50.739797268265434], [127.657407261262378, 49.760270494172929]]]] } }, + { "type": "Feature", "properties": { "admin": "Ivory Coast", "name": "Côte d'Ivoire", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.856125047202397, 4.994475816259508], [-3.311084357100071, 4.984295559098014], [-4.008819545904941, 5.179813340674314], [-4.64991736491791, 5.168263658057084], [-5.834496222344525, 4.993700669775135], [-6.528769090185845, 4.705087795425015], [-7.518941209330434, 4.338288479017307], [-7.712159389669749, 4.364565944837721], [-7.63536821128403, 5.188159084489455], [-7.53971513511176, 5.313345241716517], [-7.570152553731686, 5.707352199725903], [-7.993692592795879, 6.126189683451541], [-8.311347622094017, 6.193033148621081], [-8.602880214868618, 6.467564195171659], [-8.385451626000572, 6.911800645368742], [-8.485445522485348, 7.395207831243068], [-8.439298468448696, 7.686042792181736], [-8.280703497744936, 7.687179673692156], [-8.221792364932197, 8.123328762235571], [-8.299048631208562, 8.316443589710302], [-8.203498907900878, 8.455453192575446], [-7.832100389019186, 8.575704250518625], [-8.079113735374348, 9.376223863152033], [-8.309616461612249, 9.789531968622439], [-8.22933712404682, 10.129020290563897], [-8.029943610048617, 10.206534939001711], [-7.89958980959237, 10.297382106970824], [-7.622759161804808, 10.147236232946792], [-6.850506557635057, 10.138993841996237], [-6.666460944027547, 10.430810655148447], [-6.493965013037267, 10.411302801958268], [-6.205222947606429, 10.524060777219132], [-6.050452032892266, 10.096360785355442], [-5.816926235365286, 10.222554633012191], [-5.404341599946973, 10.370736802609144], [-4.954653286143098, 10.152713934769732], [-4.779883592131966, 9.821984768101741], [-4.330246954760383, 9.610834865757139], [-3.980449184576684, 9.862344061721698], [-3.511898972986272, 9.900326239456216], [-2.827496303712706, 9.642460842319775], [-2.56218950032624, 8.219627793811481], [-2.983584967450326, 7.379704901555511], [-3.244370083011261, 6.2504715031135], [-2.810701463217839, 5.389051215024109], [-2.856125047202397, 4.994475816259508]]] } }, + { "type": "Feature", "properties": { "admin": "Cameroon", "name": "Cameroon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[13.07582238124675, 2.267097072759014], [12.951333855855605, 2.321615708826939], [12.359380323952218, 2.19281220133945], [11.751665480199787, 2.326757513839993], [11.276449008843711, 2.261050930180871], [9.649158155972627, 2.283866075037735], [9.795195753629455, 3.073404445809117], [9.404366896205998, 3.734526882335202], [8.948115675501068, 3.904128933117135], [8.744923943729416, 4.352215277519959], [8.488815545290889, 4.495617377129917], [8.500287713259693, 4.771982937026847], [8.757532993208626, 5.47966583904791], [9.233162876023043, 6.444490668153334], [9.522705926154398, 6.453482367372116], [10.118276808318255, 7.038769639509879], [10.497375115611417, 7.055357774275562], [11.058787876030349, 6.644426784690593], [11.745774366918509, 6.981382961449753], [11.839308709366801, 7.397042344589434], [12.063946160539556, 7.799808457872301], [12.218872104550597, 8.305824082874322], [12.753671502339214, 8.717762762888993], [12.955467970438971, 9.417771714714702], [13.1675997249971, 9.64062632897341], [13.308676385153914, 10.160362046748926], [13.572949659894558, 10.798565985553564], [14.415378859116682, 11.572368882692071], [14.468192172918974, 11.90475169519341], [14.57717776862253, 12.085360826053501], [14.181336297266792, 12.483656927943112], [14.213530714584634, 12.802035427293344], [14.495787387762842, 12.859396267137326], [14.893385857816522, 12.219047756392582], [14.960151808337598, 11.555574042197222], [14.923564894274955, 10.891325181517471], [15.467872755605269, 9.982336737503429], [14.909353875394713, 9.99212942142273], [14.627200555081057, 9.920919297724536], [14.171466098699025, 10.021378282099928], [13.954218377344002, 9.549494940626685], [14.544466586981766, 8.965861314322266], [14.979995558337688, 8.796104234243471], [15.120865512765331, 8.382150173369423], [15.436091749745765, 7.692812404811971], [15.279460483469107, 7.421924546737968], [14.776545444404572, 6.408498033062044], [14.536560092841111, 6.22695872642069], [14.459407179429345, 5.451760565610299], [14.558935988023501, 5.03059764243153], [14.478372430080466, 4.732605495620446], [14.950953403389658, 4.21038930909492], [15.036219516671249, 3.851367295747123], [15.405395948964379, 3.335300604664339], [15.862732374747479, 3.013537298998982], [15.907380812247649, 2.557389431158612], [16.01285241055535, 2.267639675298084], [15.940918816805061, 1.727672634280295], [15.14634199388524, 1.964014797367184], [14.337812534246577, 2.22787466064949], [13.07582238124675, 2.267097072759014]]] } }, + { "type": "Feature", "properties": { "admin": "Democratic Republic of the Congo", "name": "Dem. Rep. Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.833859897593801, 3.50916596111034], [30.773346795380036, 2.339883327642127], [31.174149204235807, 2.204465236821263], [30.852670118948048, 1.849396470543809], [30.468507521290292, 1.58380544677972], [30.086153598762703, 1.062312730306288], [29.875778842902488, 0.597379868976304], [29.819503208136634, -0.205310153813372], [29.587837762172164, -0.58740569417948], [29.579466180140876, -1.341313164885626], [29.29188683443661, -1.620055840667987], [29.254834832483336, -2.215109958508911], [29.117478875451546, -2.292211195488384], [29.02492638521678, -2.839257907730157], [29.276383904749046, -3.293907159034063], [29.339997592900342, -4.499983412294092], [29.519986606572925, -5.419978936386313], [29.41999271008816, -5.939998874539432], [29.620032179490003, -6.520015150583424], [30.199996779101692, -7.079980970898161], [30.740015496551781, -8.340007419470913], [30.34608605319081, -8.238256524288216], [29.002912225060467, -8.40703175215347], [28.734866570762495, -8.526559340044576], [28.449871046672818, -9.164918308146083], [28.673681674928922, -9.605924981324931], [28.496069777141763, -10.789883721564044], [28.372253045370421, -11.793646742401389], [28.642417433392346, -11.971568698782312], [29.341547885869087, -12.36074391037241], [29.616001417771223, -12.178894545137307], [29.699613885219485, -13.257226657771827], [28.934285922976834, -13.248958428605132], [28.52356163912102, -12.698604424696679], [28.15510867687998, -12.272480564017894], [27.38879886242378, -12.132747491100663], [27.164419793412456, -11.608748467661071], [26.55308759939961, -11.924439792532125], [25.752309604604726, -11.784965101776356], [25.418118116973197, -11.330935967659958], [24.783169793402948, -11.238693536018962], [24.314516228947948, -11.262826429899269], [24.257155389103982, -10.951992689663655], [23.912215203555714, -10.926826267137512], [23.456790805767433, -10.867863457892481], [22.837345411884733, -11.017621758674329], [22.402798292742371, -10.99307545333569], [22.155268182064304, -11.084801120653768], [22.208753289486388, -9.894796237836507], [21.87518191904234, -9.523707777548564], [21.801801385187897, -8.908706556842978], [21.949130893652036, -8.305900974158275], [21.746455926203303, -7.920084730667147], [21.728110792739695, -7.2908724910813], [20.514748162526498, -7.299605808138629], [20.601822950938292, -6.93931772219968], [20.091621534920645, -6.943090101756993], [20.037723016040214, -7.116361179231644], [19.417502475673157, -7.155428562044297], [19.166613396896107, -7.738183688999753], [19.016751743249664, -7.988245944860132], [18.464175652752683, -7.847014255406442], [18.134221632569048, -7.98767750410492], [17.472970004962232, -8.068551120641699], [17.089995965247166, -7.545688978712525], [16.860190870845198, -7.222297865429984], [16.573179965896141, -6.622644545115087], [16.326528354567042, -5.877470391466267], [13.375597364971892, -5.864241224799548], [13.02486941900696, -5.984388929878157], [12.735171339578695, -5.965682061388497], [12.322431674863507, -6.100092461779658], [12.182336866920249, -5.789930515163837], [12.436688266660866, -5.684303887559245], [12.468004184629734, -5.248361504745003], [12.631611769265788, -4.991271254092935], [12.995517205465173, -4.781103203961883], [13.258240187237044, -4.882957452009165], [13.600234816144676, -4.500138441590969], [14.144956088933295, -4.510008640158715], [14.209034864975219, -4.793092136253597], [14.582603794013179, -4.970238946150139], [15.170991652088441, -4.3435071753143], [15.753540073314749, -3.855164890156096], [16.006289503654298, -3.535132744972528], [15.972803175529149, -2.712392266453612], [16.407091912510051, -1.740927015798682], [16.86530683764212, -1.225816338713287], [17.523716261472853, -0.743830254726987], [17.638644646889983, -0.424831638189246], [17.663552687254676, -0.058083998213817], [17.826540154703245, 0.288923244626105], [17.774191928791563, 0.855658677571085], [17.89883548347958, 1.741831976728278], [18.09427575040743, 2.365721543788055], [18.39379235197114, 2.90044342692822], [18.453065219809925, 3.504385891123348], [18.542982211997778, 4.201785183118317], [18.932312452884755, 4.709506130385973], [19.467783644293146, 5.031527818212779], [20.290679152108932, 4.691677761245287], [20.927591180106273, 4.322785549329736], [21.659122755630019, 4.224341945813719], [22.405123732195531, 4.02916006104732], [22.704123569436284, 4.633050848810156], [22.841479526468103, 4.710126247573483], [23.297213982850135, 4.609693101414221], [24.41053104014625, 5.108784084489129], [24.805028924262409, 4.897246608902349], [25.128833449003274, 4.927244777847789], [25.278798455514302, 5.170408229997191], [25.650455356557465, 5.256087754737123], [26.402760857862535, 5.150874538590869], [27.044065382604703, 5.127852688004835], [27.374226108517483, 5.233944403500059], [27.979977247842807, 4.408413397637373], [28.428993768026906, 4.287154649264493], [28.696677687298795, 4.455077215996936], [29.159078403446497, 4.38926727947323], [29.715995314256013, 4.600804755060024], [29.953500197069467, 4.173699042167683], [30.833859897593801, 3.50916596111034]]] } }, + { "type": "Feature", "properties": { "admin": "Republic of Congo", "name": "Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[12.995517205465173, -4.781103203961883], [12.620759718484491, -4.438023369976135], [12.318607618873923, -4.606230157086187], [11.914963006242086, -5.037986748884789], [11.093772820691923, -3.978826592630546], [11.855121697648114, -3.42687061932105], [11.478038771214299, -2.765618991714241], [11.820963575903189, -2.514161472181982], [12.495702752338159, -2.391688327650242], [12.575284458067639, -1.948511244315134], [13.109618767965626, -2.428740329603513], [13.992407260807706, -2.470804945489099], [14.299210239324564, -1.998275648612213], [14.425455763413593, -1.333406670744971], [14.316418491277741, -0.552627455247048], [13.843320753645653, 0.038757635901149], [14.276265903386953, 1.196929836426619], [14.026668735417214, 1.395677395021153], [13.282631463278816, 1.31418366129688], [13.003113641012074, 1.830896307783319], [13.07582238124675, 2.267097072759014], [14.337812534246577, 2.22787466064949], [15.14634199388524, 1.964014797367184], [15.940918816805061, 1.727672634280295], [16.01285241055535, 2.267639675298084], [16.537058139724135, 3.198254706226278], [17.133042433346297, 3.728196519379451], [17.809900343505259, 3.560196437998569], [18.453065219809925, 3.504385891123348], [18.39379235197114, 2.90044342692822], [18.09427575040743, 2.365721543788055], [17.89883548347958, 1.741831976728278], [17.774191928791563, 0.855658677571085], [17.826540154703245, 0.288923244626105], [17.663552687254676, -0.058083998213817], [17.638644646889983, -0.424831638189246], [17.523716261472853, -0.743830254726987], [16.86530683764212, -1.225816338713287], [16.407091912510051, -1.740927015798682], [15.972803175529149, -2.712392266453612], [16.006289503654298, -3.535132744972528], [15.753540073314749, -3.855164890156096], [15.170991652088441, -4.3435071753143], [14.582603794013179, -4.970238946150139], [14.209034864975219, -4.793092136253597], [14.144956088933295, -4.510008640158715], [13.600234816144676, -4.500138441590969], [13.258240187237044, -4.882957452009165], [12.995517205465173, -4.781103203961883]]] } }, + { "type": "Feature", "properties": { "admin": "Colombia", "name": "Colombia", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-75.373223232713841, -0.15203175212045], [-75.801465827116587, 0.084801337073202], [-76.292314419240938, 0.416047268064119], [-76.576379767549383, 0.256935533037435], [-77.424984300430367, 0.395686753741117], [-77.668612840470416, 0.825893052570961], [-77.855061408179509, 0.809925034992773], [-78.855258755188686, 1.380923773601822], [-78.990935228171026, 1.691369940595251], [-78.617831387023699, 1.766404120283056], [-78.662118089497838, 2.267355454920476], [-78.427610439757302, 2.629555568854215], [-77.931542527971473, 2.696605739752925], [-77.510431281224996, 3.325016994638246], [-77.127689785455246, 3.849636135265356], [-77.496271938776999, 4.087606105969427], [-77.307601284479375, 4.667984117039452], [-77.533220587865713, 5.582811997902496], [-77.318815070286718, 5.845354112161359], [-77.476660732722266, 6.691116441266301], [-77.881571417945239, 7.223771267114783], [-77.75341386586139, 7.709839789252141], [-77.431107957656977, 7.638061224798733], [-77.242566494440069, 7.935278225125442], [-77.474722866511314, 8.524286200388216], [-77.353360765273848, 8.670504665558068], [-76.836673957003541, 8.638749497914715], [-76.086383836557843, 9.336820583529486], [-75.674600185840035, 9.443248195834597], [-75.664704149056149, 9.774003200718736], [-75.480425991503338, 10.618990383339305], [-74.906895107711975, 11.08304474532032], [-74.276752692344871, 11.102035834187586], [-74.197222663047683, 11.310472723836865], [-73.414763963500278, 11.227015285685479], [-72.62783525255962, 11.731971543825519], [-72.238194953078903, 11.955549628136325], [-71.754090135368628, 12.437303168177305], [-71.399822353791691, 12.376040757695289], [-71.137461107045866, 12.112981879113503], [-71.331583624950284, 11.776284084515805], [-71.973921678338272, 11.608671576377116], [-72.227575446242923, 11.108702093953237], [-72.614657762325194, 10.821975409381777], [-72.905286017534692, 10.45034434655477], [-73.027604132769554, 9.736770331252441], [-73.304951544880026, 9.151999823437604], [-72.788729824500379, 9.085027167187331], [-72.660494757768092, 8.62528778730268], [-72.439862230097944, 8.405275376820027], [-72.360900641555958, 8.002638454617893], [-72.479678921178831, 7.632506008327352], [-72.444487270788059, 7.42378489830048], [-72.19835242378187, 7.340430813013682], [-71.960175747348629, 6.991614895043538], [-70.674233567981503, 7.087784735538717], [-70.093312954372408, 6.960376491723109], [-69.389479946557103, 6.099860541198835], [-68.985318569602327, 6.206804917826856], [-68.265052456318216, 6.153268133972473], [-67.695087246355001, 6.267318020040645], [-67.34143958196556, 6.095468044454021], [-67.521531948502741, 5.556870428891968], [-67.744696621355203, 5.221128648291667], [-67.823012254493534, 4.503937282728898], [-67.621835903581271, 3.839481716319994], [-67.33756384954367, 3.542342230641721], [-67.303173183853417, 3.31845408773718], [-67.809938117123693, 2.820655015469569], [-67.447092047786299, 2.600280869960869], [-67.181294318293041, 2.250638129074062], [-66.876325853122566, 1.253360500489336], [-67.065048183852483, 1.130112209473225], [-67.25999752467358, 1.719998684084956], [-67.537810024674684, 2.037162787276329], [-67.868565029558823, 1.692455145673392], [-69.816973232691609, 1.714805202639624], [-69.804596727157701, 1.089081122233466], [-69.218637661400166, 0.985676581217433], [-69.252434048119042, 0.602650865070075], [-69.452396002872447, 0.706158758950693], [-70.015565761989293, 0.541414292804205], [-70.02065589057004, -0.185156345219539], [-69.577065395776586, -0.549991957200163], [-69.420485805932216, -1.122618503426409], [-69.444101935489599, -1.556287123219817], [-69.893635219996611, -4.298186944194326], [-70.394043952094975, -3.766591485207825], [-70.692682054309699, -3.742872002785858], [-70.047708502874841, -2.725156345229699], [-70.813475714791949, -2.256864515800742], [-71.413645799429773, -2.342802422702128], [-71.774760708285385, -2.169789727388937], [-72.325786505813639, -2.434218031426453], [-73.070392218707212, -2.308954359550952], [-73.659503546834586, -1.260491224781134], [-74.122395189089048, -1.002832533373848], [-74.441600511355958, -0.530820000819887], [-75.106624518520064, -0.05720549886486], [-75.373223232713841, -0.15203175212045]]] } }, + { "type": "Feature", "properties": { "admin": "Costa Rica", "name": "Costa Rica", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-82.965783047197348, 8.225027980985983], [-83.508437262694287, 8.446926581247281], [-83.711473965169063, 8.656836249216864], [-83.596313035806631, 8.830443223501417], [-83.632641567707822, 9.051385809765319], [-83.909885626953724, 9.290802720573579], [-84.303401658856345, 9.487354030795712], [-84.64764421256865, 9.615537421095707], [-84.713350796227743, 9.908051866083849], [-84.975660366541319, 10.086723130733004], [-84.911374884770211, 9.795991522658921], [-85.110923428065291, 9.557039699741308], [-85.339488288092255, 9.834542141148658], [-85.660786505866966, 9.93334747969072], [-85.797444831062819, 10.134885565629032], [-85.791708747078417, 10.439337266476612], [-85.65931372754666, 10.754330959511718], [-85.941725430021748, 10.895278428587799], [-85.712540452807289, 11.088444932494822], [-85.561851976244171, 11.217119248901593], [-84.903003302738924, 10.952303371621895], [-84.673069017256239, 11.082657172078139], [-84.355930752281026, 10.999225572142901], [-84.190178595704822, 10.793450018756671], [-83.895054490885926, 10.726839097532444], [-83.655611741861563, 10.938764146361418], [-83.402319708982944, 10.39543813724465], [-83.015676642575158, 9.992982082555553], [-82.546196255203469, 9.566134751824674], [-82.932890998043561, 9.476812038608172], [-82.927154914059145, 9.074330145702914], [-82.719183112300513, 8.925708726431493], [-82.868657192704759, 8.807266343618521], [-82.829770677405151, 8.626295477732368], [-82.9131764391242, 8.423517157419068], [-82.965783047197348, 8.225027980985983]]] } }, + { "type": "Feature", "properties": { "admin": "Cuba", "name": "Cuba", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-82.268151211257035, 23.188610744717703], [-81.404457160146819, 23.117271429938775], [-80.61876868358118, 23.105980129482994], [-79.679523688460222, 22.765303249598823], [-79.281485968732071, 22.399201565027049], [-78.347434455056472, 22.512166246017085], [-77.993295864560253, 22.277193508385928], [-77.146422492161037, 21.657851467367831], [-76.523824835908528, 21.20681956632437], [-76.194620123993175, 21.220565497314006], [-75.598222418912655, 21.01662445727413], [-75.671060350228032, 20.735091254147999], [-74.933896043584483, 20.693905137611381], [-74.178024868451246, 20.284627793859737], [-74.296648118777242, 20.050378526280678], [-74.961594611292924, 19.923435370355687], [-75.634680141894577, 19.873774318923193], [-76.323656175425981, 19.952890936762056], [-77.755480923153044, 19.855480861891873], [-77.085108405246729, 20.413353786698789], [-77.492654588516601, 20.673105373613886], [-78.137292243141573, 20.739948838783427], [-78.482826707661161, 21.028613389565848], [-78.719866502583997, 21.598113511638431], [-79.284999966127913, 21.559175319906497], [-80.217475348618635, 21.827324327069032], [-80.517534552721401, 22.037078965741756], [-81.820943366203167, 22.192056586185068], [-82.169991828118611, 22.387109279870746], [-81.79500179719264, 22.636964830001951], [-82.775897996740838, 22.688150336187057], [-83.494458787759328, 22.168517971276124], [-83.908800421875611, 22.154565334557329], [-84.052150845053248, 21.910575059491251], [-84.547030198896351, 21.801227728761639], [-84.974911058273079, 21.896028143801082], [-84.44706214062775, 22.204949856041903], [-84.23035702181177, 22.56575470630376], [-83.778239915690165, 22.78811839445569], [-83.267547573565736, 22.983041897060641], [-82.510436164057495, 23.078746649665181], [-82.268151211257035, 23.188610744717703]]] } }, + { "type": "Feature", "properties": { "admin": "Northern Cyprus", "name": "N. Cyprus", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[32.731780226377445, 35.14002594658843], [32.802473585752743, 35.145503648411363], [32.946960890440799, 35.38670339613369], [33.667227003724939, 35.373215847305509], [34.576473829900458, 35.671595567358786], [33.900804477684197, 35.245755927057608], [33.973616570783456, 35.058506374647997], [33.866439650210104, 35.093594672174177], [33.675391880027057, 35.017862860650446], [33.525685255677494, 35.038688462864066], [33.475817498515845, 35.000344550103499], [33.45592207208346, 35.101423651666401], [33.383833449036295, 35.162711900364563], [33.190977003723042, 35.173124701471373], [32.919572381326127, 35.087832749973636], [32.731780226377445, 35.14002594658843]]] } }, + { "type": "Feature", "properties": { "admin": "Cyprus", "name": "Cyprus", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[33.973616570783456, 35.058506374647997], [34.004880812320032, 34.978097846001852], [32.97982710137844, 34.571869411755436], [32.490296258277532, 34.701654771456468], [32.256667107885953, 35.103232326796622], [32.731780226377445, 35.14002594658843], [32.919572381326127, 35.087832749973636], [33.190977003723042, 35.173124701471373], [33.383833449036295, 35.162711900364563], [33.45592207208346, 35.101423651666401], [33.475817498515845, 35.000344550103499], [33.525685255677494, 35.038688462864066], [33.675391880027057, 35.017862860650446], [33.866439650210104, 35.093594672174177], [33.973616570783456, 35.058506374647997]]] } }, + { "type": "Feature", "properties": { "admin": "Czech Republic", "name": "Czech Rep.", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.960288120194573, 48.596982326850593], [16.49928266771877, 48.785808010445095], [16.029647251050218, 48.733899034207916], [15.253415561593979, 49.039074205107575], [14.901447381254055, 48.964401760445817], [14.33889773932472, 48.555305284207193], [13.595945672264433, 48.877171942737135], [13.031328973043427, 49.307068182973232], [12.52102420416119, 49.54741526956272], [12.415190870827441, 49.96912079528056], [12.240111118222556, 50.266337795607271], [12.96683678554319, 50.484076443069071], [13.338131951560282, 50.733234361364346], [14.05622765468817, 50.926917629594286], [14.307013380600633, 51.117267767941399], [14.570718214586062, 51.002339382524262], [15.016995883858666, 51.106674099321566], [15.490972120839725, 50.7847299261432], [16.238626743238566, 50.697732652379827], [16.176253289462263, 50.4226073268579], [16.719475945714429, 50.215746568393527], [16.868769158605655, 50.473973700556016], [17.554567091551117, 50.36214590107641], [17.649445021238986, 50.049038397819942], [18.392913852622168, 49.988628648470737], [18.85314415861361, 49.496229763377634], [18.554971144289478, 49.495015367218777], [18.399993523846174, 49.315000515330034], [18.170498488037961, 49.271514797556421], [18.104972771891848, 49.043983466175298], [17.913511590250462, 48.996492824899072], [17.886484816161808, 48.903475246773695], [17.545006951577101, 48.800019029325362], [17.101984897538895, 48.8169688991171], [16.960288120194573, 48.596982326850593]]] } }, + { "type": "Feature", "properties": { "admin": "Germany", "name": "Germany", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.92190636560923, 54.983104153048025], [9.939579705452898, 54.596641954153242], [10.950112338920517, 54.363607082733147], [10.939466993868447, 54.008693345752583], [11.95625247564328, 54.196485500701144], [12.518440382546711, 54.470370591847988], [13.647467075259495, 54.075510972705885], [14.119686313542555, 53.757029120491026], [14.353315463934164, 53.248171291713092], [14.074521111719431, 52.981262518925334], [14.437599725002197, 52.62485016540829], [14.685026482815713, 52.089947414755208], [14.607098422919645, 51.745188096719964], [15.016995883858781, 51.106674099321701], [14.570718214586119, 51.002339382524369], [14.307013380600662, 51.117267767941364], [14.05622765468831, 50.92691762959435], [13.338131951560397, 50.733234361364268], [12.966836785543249, 50.484076443069164], [12.240111118222668, 50.266337795607214], [12.41519087082747, 49.969120795280602], [12.521024204161332, 49.547415269562741], [13.031328973043513, 49.307068182973232], [13.595945672264575, 48.877171942737156], [13.243357374737112, 48.416114813829026], [12.884102817443873, 48.289145819687846], [13.025851271220514, 47.637583523135945], [12.93262698736606, 47.467645575543983], [12.620759718484519, 47.672387600284409], [12.141357456112869, 47.703083401065768], [11.426414015354847, 47.523766181013045], [10.544504021861597, 47.566399237653783], [10.402083774465321, 47.302487697939164], [9.896068149463188, 47.58019684507569], [9.594226108446376, 47.525058091820185], [8.522611932009793, 47.830827541691342], [8.317301466514092, 47.613579820336263], [7.466759067422286, 47.620581976911907], [7.59367638513106, 48.333019110703724], [8.099278598674855, 49.017783515003423], [6.658229607783709, 49.201958319691627], [6.186320428094176, 49.4638028021145], [6.242751092156992, 49.90222565367872], [6.043073357781109, 50.128051662794221], [6.156658155958779, 50.803721015010574], [5.988658074577812, 51.85161570902504], [6.589396599970825, 51.85202912048338], [6.842869500362381, 52.228440253297542], [7.092053256873895, 53.14404328064488], [6.905139601274128, 53.482162177130633], [7.100424838905268, 53.693932196662658], [7.936239454793961, 53.748295803433777], [8.121706170289483, 53.527792466844275], [8.800734490604667, 54.02078563090889], [8.572117954145368, 54.395646470754045], [8.526229282270206, 54.962743638725144], [9.282048780971136, 54.830865383516297], [9.92190636560923, 54.983104153048025]]] } }, + { "type": "Feature", "properties": { "admin": "Djibouti", "name": "Djibouti", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[43.081226027200152, 12.699638576707112], [43.317852410664663, 12.390148423711022], [43.286381463398911, 11.974928290245883], [42.715873650896519, 11.735640570518338], [43.145304803242126, 11.462039699748853], [42.776851841000948, 10.926878566934416], [42.55493000000012, 11.105110000000193], [42.314140000000116, 11.0342], [41.755570000000191, 11.05091], [41.739590000000177, 11.355110000000137], [41.661760000000122, 11.6312], [42.000000000000107, 12.100000000000133], [42.351560000000106, 12.54223000000013], [42.779642368344739, 12.455415757695672], [43.081226027200152, 12.699638576707112]]] } }, + { "type": "Feature", "properties": { "admin": "Denmark", "name": "Denmark", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[12.690006137755629, 55.60999095318077], [12.089991082414738, 54.800014553437919], [11.043543328504226, 55.36486379660424], [10.90391360845163, 55.779954738988735], [12.370904168353288, 56.111407375708822], [12.690006137755629, 55.60999095318077]]], [[[10.912181837618359, 56.4586213242779], [10.667803989309986, 56.081383368547208], [10.369992710011983, 56.190007229224719], [9.649984978889306, 55.469999498102041], [9.921906365609173, 54.983104153048046], [9.282048780971136, 54.830865383516155], [8.526229282270235, 54.962743638724973], [8.120310906617588, 55.517722683323612], [8.089976840862247, 56.540011705137587], [8.256581658571262, 56.809969387430286], [8.543437534223385, 57.110002753316891], [9.424469028367609, 57.172066148499468], [9.775558709358561, 57.447940782289649], [10.580005730846151, 57.730016587954843], [10.54610599126269, 57.21573273378614], [10.250000034230222, 56.890016181050456], [10.369992710011983, 56.60998159446082], [10.912181837618359, 56.4586213242779]]]] } }, + { "type": "Feature", "properties": { "admin": "Dominican Republic", "name": "Dominican Rep.", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-71.71236141629295, 19.714455878167353], [-71.587304450146604, 19.884910590082093], [-70.806706102161726, 19.880285549391981], [-70.214364997016119, 19.622885240146157], [-69.950815192327568, 19.647999986240002], [-69.769250047470067, 19.293267116772437], [-69.222125820579862, 19.313214219637096], [-69.254346076113819, 19.015196234609871], [-68.809411994080818, 18.979074408437846], [-68.317943284768958, 18.612197577381689], [-68.689315965434503, 18.205142320218609], [-69.164945848248905, 18.422648423735108], [-69.623987596297624, 18.380712998930246], [-69.952933926051529, 18.428306993071057], [-70.133232998317879, 18.245915025296892], [-70.517137213814195, 18.184290879788829], [-70.669298468697619, 18.42688589118303], [-70.999950120717173, 18.283328762276206], [-71.400209927033885, 17.598564357976596], [-71.657661912712001, 17.757572740138695], [-71.708304816358037, 18.044997056546091], [-71.687737596305865, 18.316660061104468], [-71.945112067335543, 18.616900132720257], [-71.701302659782485, 18.785416978424049], [-71.624873216422813, 19.169837958243303], [-71.71236141629295, 19.714455878167353]]] } }, + { "type": "Feature", "properties": { "admin": "Algeria", "name": "Algeria", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[11.99950564947161, 23.471668402596443], [8.572893100629782, 21.565660712159136], [5.677565952180684, 19.601206976799713], [4.267419467800038, 19.155265204336995], [3.158133172222704, 19.057364203360034], [3.146661004253899, 19.693578599521441], [2.683588494486428, 19.856230170160114], [2.060990838233919, 20.142233384679482], [1.823227573259032, 20.61080943448604], [-1.550054897457613, 22.792665920497377], [-4.92333736817423, 24.974574082940993], [-8.684399786809051, 27.395744126895998], [-8.66512447756419, 27.58947907155822], [-8.665589565454805, 27.656425889592349], [-8.674116176782972, 28.841288967396572], [-7.059227667661928, 29.579228420524522], [-6.060632290053772, 29.731699734001687], [-5.242129278982786, 30.000443020135581], [-4.859646165374469, 30.501187649043839], [-3.690441046554695, 30.896951605751152], [-3.647497931320145, 31.637294012980668], [-3.068980271812647, 31.724497992473207], [-2.616604783529567, 32.094346218386143], [-1.30789913573787, 32.262888902306095], [-1.124551153966308, 32.651521511357124], [-1.388049282222567, 32.864015000941301], [-1.733454555661467, 33.91971283623198], [-1.792985805661686, 34.527918606091198], [-2.169913702798624, 35.168396307916673], [-1.208602871089056, 35.71484874118709], [-0.127454392894606, 35.888662421200799], [0.503876580415209, 36.301272894835272], [1.466918572606545, 36.605647081034398], [3.161698846050824, 36.783904934225205], [4.815758090849129, 36.865036932923452], [5.320120070017792, 36.716518866516616], [6.261819695672611, 37.110655015606731], [7.330384962603969, 37.118380642234364], [7.737078484741003, 36.885707505840209], [8.420964389691674, 36.946427313783154], [8.217824334352313, 36.433176988260271], [8.376367628623766, 35.479876003555937], [8.140981479534302, 34.655145982393783], [7.524481642292242, 34.097376410451453], [7.612641635782181, 33.344114895148955], [8.430472853233367, 32.748337307255944], [8.439102817426116, 32.506284898400814], [9.055602654668148, 32.102691962201284], [9.482139926805273, 30.307556057246181], [9.805634392952411, 29.424638373323383], [9.859997999723443, 28.959989732371007], [9.683884718472765, 28.144173895779193], [9.756128370816779, 27.688258571884141], [9.629056023811073, 27.140953477480913], [9.716285841519747, 26.512206325785691], [9.319410841518161, 26.094324856057447], [9.910692579801774, 25.365454616796733], [9.948261346077969, 24.93695364023251], [10.30384687667836, 24.37931325937091], [10.771363559622925, 24.562532050061744], [11.560669386449002, 24.097909247325511], [11.99950564947161, 23.471668402596443]]] } }, + { "type": "Feature", "properties": { "admin": "Ecuador", "name": "Ecuador", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-80.302560594387188, -3.404856459164712], [-79.770293341780913, -2.65751189535964], [-79.986559210922394, -2.220794366061014], [-80.368783942369234, -2.685158786635788], [-80.967765469064332, -2.246942640800703], [-80.764806281238023, -1.965047702648532], [-80.933659023751702, -1.057454522306358], [-80.583370327461239, -0.906662692878683], [-80.39932471385373, -0.283703301600141], [-80.020898200180355, 0.360340074053468], [-80.090609707342097, 0.768428859862396], [-79.542762010399784, 0.982937730305963], [-78.855258755188686, 1.380923773601822], [-77.855061408179509, 0.809925034992773], [-77.668612840470416, 0.825893052570961], [-77.424984300430367, 0.395686753741117], [-76.576379767549383, 0.256935533037435], [-76.292314419240938, 0.416047268064119], [-75.801465827116587, 0.084801337073202], [-75.373223232713841, -0.15203175212045], [-75.233722703741932, -0.911416924649529], [-75.544995693652027, -1.56160979574588], [-76.635394253226707, -2.608677666843817], [-77.83790483265858, -3.003020521663103], [-78.450683966775628, -3.873096612161375], [-78.639897223612323, -4.547784112164072], [-79.205289069317715, -4.959128513207388], [-79.62497921417615, -4.454198093283494], [-80.028908047185581, -4.346090996928893], [-80.442241990872134, -4.425724379090673], [-80.46929460317692, -4.059286797708999], [-80.184014858709645, -3.821161797708043], [-80.302560594387188, -3.404856459164712]]] } }, + { "type": "Feature", "properties": { "admin": "Egypt", "name": "Egypt", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.9226, 29.50133], [34.64174, 29.09942], [34.42655, 28.34399], [34.15451, 27.8233], [33.92136, 27.6487], [33.58811, 27.97136], [33.13676, 28.41765], [32.42323, 29.85108], [32.32046, 29.76043], [32.73482, 28.70523], [33.34876, 27.69989], [34.10455, 26.14227], [34.47387, 25.59856], [34.79507, 25.03375], [35.69241, 23.92671], [35.49372, 23.75237], [35.52598, 23.10244], [36.69069, 22.20485], [36.86623, 22.0], [32.9, 22.0], [29.02, 22.0], [25.0, 22.0], [25.0, 25.682499996360992], [25.0, 29.238654529533452], [24.70007, 30.04419], [24.95762, 30.6616], [24.80287, 31.08929], [25.16482, 31.56915], [26.49533, 31.58568], [27.45762, 31.32126], [28.45048, 31.02577], [28.91353, 30.87005], [29.68342, 31.18686], [30.09503, 31.4734], [30.97693, 31.55586], [31.68796, 31.4296], [31.96041, 30.9336], [32.19247, 31.26034], [32.99392, 31.02407], [33.7734, 30.96746], [34.26544, 31.21936], [34.9226, 29.50133]]] } }, + { "type": "Feature", "properties": { "admin": "Eritrea", "name": "Eritrea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[42.351560000000106, 12.54223000000013], [42.00975, 12.86582], [41.59856, 13.452090000000108], [41.15519371924983, 13.773319810435224], [40.8966, 14.118640000000138], [40.026218702969167, 14.519579169162281], [39.34061, 14.53155], [39.0994, 14.74064], [38.51295, 14.50547], [37.90607, 14.959430000000165], [37.59377, 14.2131], [36.42951, 14.42211], [36.323188917798113, 14.822480577041057], [36.753860304518575, 16.291874091044289], [36.852530000000108, 16.95655], [37.16747, 17.263140000000128], [37.904000000000103, 17.42754], [38.410089959473218, 17.998307399970312], [38.990622999839999, 16.84062612555169], [39.266110060388016, 15.922723496967246], [39.814293654140208, 15.435647284400314], [41.179274936697645, 14.491079616753209], [41.734951613132345, 13.921036892141554], [42.276830682144848, 13.34399201095442], [42.589576450375255, 13.000421250861901], [43.081226027200152, 12.699638576707112], [42.779642368344739, 12.455415757695672], [42.351560000000106, 12.54223000000013]]] } }, + { "type": "Feature", "properties": { "admin": "Spain", "name": "Spain", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-9.034817674180244, 41.880570583659669], [-8.98443315269567, 42.592775173506261], [-9.392883673530644, 43.026624660812686], [-7.978189663108308, 43.748337714200979], [-6.754491746436754, 43.567909450853918], [-5.411886359061596, 43.574239813809669], [-4.347842779955783, 43.403449205085025], [-3.51753170410609, 43.455900783861296], [-1.901351284177764, 43.422802028978332], [-1.502770961910528, 43.034014390630425], [0.338046909190581, 42.579546006839543], [0.701590610363894, 42.795734361332599], [1.826793247087153, 42.343384711265678], [2.985998976258457, 42.473015041669854], [3.039484083680548, 41.892120266276891], [2.091841668312184, 41.226088568683082], [0.810524529635188, 41.014731960609332], [0.721331007499401, 40.678318386389229], [0.106691521819869, 40.123933620762003], [-0.278711310212941, 39.309978135732713], [0.111290724293838, 38.738514309233032], [-0.467123582349103, 38.292365831041138], [-0.683389451490598, 37.642353827457811], [-1.438382127274849, 37.443063666324214], [-2.146452602538119, 36.674144192037282], [-3.415780808923386, 36.658899644511173], [-4.368900926114718, 36.677839056946141], [-4.995219285492211, 36.32470815687963], [-5.377159796561457, 35.946850083961458], [-5.866432257500902, 36.02981659600605], [-6.236693894872174, 36.367677110330327], [-6.520190802425402, 36.942913316387312], [-7.45372555177809, 37.097787583966053], [-7.537105475281022, 37.428904323876232], [-7.166507941099863, 37.803894354802217], [-7.029281175148794, 38.075764065089757], [-7.374092169616317, 38.373058580064914], [-7.098036668313126, 39.03007274022378], [-7.498632371439724, 39.629571031241802], [-7.066591559263527, 39.711891587882768], [-7.026413133156593, 40.184524237624238], [-6.864019944679383, 40.330871893874821], [-6.851126674822551, 41.111082668617513], [-6.389087693700914, 41.381815497394641], [-6.668605515967655, 41.883386949219577], [-7.251308966490822, 41.91834605566504], [-7.422512986673794, 41.792074693359822], [-8.01317460776991, 41.790886135417118], [-8.26385698081779, 42.280468654950326], [-8.671945766626719, 42.134689439454952], [-9.034817674180244, 41.880570583659669]]] } }, + { "type": "Feature", "properties": { "admin": "Estonia", "name": "Estonia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[24.312862583114615, 57.793423570376966], [24.428927850042154, 58.383413397853275], [24.061198357853179, 58.257374579493394], [23.426560092876681, 58.612753404364618], [23.339795363058641, 59.187240302153363], [24.604214308376182, 59.465853786855007], [25.864189080516631, 59.611090399811324], [26.949135776484518, 59.445803331125767], [27.981114129353237, 59.47538808861286], [28.131699253051742, 59.300825100330904], [27.420166456824941, 58.724581203844224], [27.716685825315714, 57.791899115624354], [27.288184848751509, 57.474528306703817], [26.46353234223778, 57.476388658266316], [25.602809685984365, 57.847528794986559], [25.164593540149262, 57.970156968815175], [24.312862583114615, 57.793423570376966]]] } }, + { "type": "Feature", "properties": { "admin": "Ethiopia", "name": "Ethiopia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[37.90607, 14.959430000000165], [38.51295, 14.50547], [39.0994, 14.74064], [39.34061, 14.53155], [40.026250000000111, 14.51959], [40.8966, 14.118640000000138], [41.1552, 13.77333], [41.59856, 13.452090000000108], [42.00975, 12.86582], [42.351560000000106, 12.54223000000013], [42.000000000000107, 12.100000000000133], [41.661760000000122, 11.6312], [41.739590000000177, 11.355110000000137], [41.755570000000191, 11.05091], [42.314140000000116, 11.0342], [42.55493000000012, 11.105110000000193], [42.776851841000948, 10.926878566934416], [42.55876, 10.572580000000126], [42.92812, 10.021940000000139], [43.29699, 9.540480000000169], [43.67875, 9.183580000000116], [46.94834, 7.99688], [47.78942, 8.003], [44.9636, 5.001620000000115], [43.66087, 4.95755], [42.769670000000119, 4.252590000000223], [42.12861, 4.234130000000163], [41.855083092644108, 3.918911920483764], [41.171800000000125, 3.91909], [40.768480000000118, 4.257020000000124], [39.854940000000106, 3.83879000000013], [39.559384258765917, 3.422060000000215], [38.89251, 3.50074], [38.67114, 3.61607], [38.436970000000137, 3.58851], [38.120915000000132, 3.598605], [36.85509323800823, 4.447864127672857], [36.159078632855646, 4.447864127672857], [35.817447662353622, 4.776965663462021], [35.817447662353622, 5.338232082790852], [35.298007118233095, 5.506], [34.70702, 6.59422000000012], [34.25032, 6.82607], [34.075100000000184, 7.22595], [33.56829, 7.71334], [32.954180000000228, 7.7849700000001], [33.294800000000116, 8.35458], [33.82550000000014, 8.37916], [33.97498, 8.684560000000145], [33.96162, 9.58358], [34.25745, 10.63009], [34.73115000000012, 10.910170000000106], [34.831630000000125, 11.318960000000116], [35.26049, 12.08286], [35.863630000000164, 12.57828], [36.27022, 13.563330000000118], [36.42951, 14.42211], [37.59377, 14.2131], [37.90607, 14.959430000000165]]] } }, + { "type": "Feature", "properties": { "admin": "Finland", "name": "Finland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[28.591929559043187, 69.064776923286644], [28.445943637818651, 68.36461294216403], [29.9774263852206, 67.698297024192641], [29.054588657352319, 66.944286200621917], [30.21765, 65.80598], [29.544429559046982, 64.948671576590471], [30.444684686003704, 64.204453436939076], [30.035872430142714, 63.552813625738544], [31.516092156711117, 62.867687486412869], [31.139991082490891, 62.357692776124395], [30.211107212044443, 61.780027777749673], [28.06999759289527, 60.503516547275829], [26.25517296723697, 60.423960679762487], [24.496623976344516, 60.057316392651636], [22.869694858499454, 59.846373196036211], [22.290763787533589, 60.391921291741525], [21.322244093519313, 60.720169989659503], [21.544866163832687, 61.705329494871783], [21.059211053153682, 62.607393296958726], [21.536029493910799, 63.189735012455863], [22.442744174903986, 63.817810370531276], [24.730511508897528, 64.902343655040823], [25.398067661243939, 65.111426500093728], [25.2940430030404, 65.53434642197044], [23.903378533633795, 66.006927395279604], [23.565879754335576, 66.396050930437411], [23.539473097434435, 67.936008612735236], [21.978534783626113, 68.616845608180682], [20.645592889089521, 69.106247260200846], [21.244936150810666, 69.370443020293067], [22.356237827247405, 68.841741441514898], [23.662049594830751, 68.891247463650529], [24.735679152126721, 68.649556789821446], [25.689212680776361, 69.092113755969024], [26.179622023226241, 69.825298977326113], [27.732292107867856, 70.164193020296239], [29.015572950971968, 69.766491197377974], [28.591929559043187, 69.064776923286644]]] } }, + { "type": "Feature", "properties": { "admin": "Fiji", "name": "Fiji", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[178.3736, -17.33992], [178.71806, -17.62846], [178.55271, -18.15059], [177.93266, -18.28799], [177.38146, -18.16432], [177.28504, -17.72465], [177.67087, -17.38114], [178.12557, -17.50481], [178.3736, -17.33992]]], [[[179.364142661964223, -16.801354076946847], [178.725059362997058, -17.012041674368017], [178.596838595117021, -16.63915], [179.096609362997128, -16.43398427754742], [179.413509362997075, -16.379054277547393], [180.000000000000114, -16.067132663642436], [180.000000000000114, -16.555216566639157], [179.364142661964223, -16.801354076946847]]], [[[-179.917369384765237, -16.501783135649358], [-180.0, -16.555216566639157], [-180.0, -16.067132663642436], [-179.793320109048551, -16.020882256741228], [-179.917369384765237, -16.501783135649358]]]] } }, + { "type": "Feature", "properties": { "admin": "Falkland Islands", "name": "Falkland Is.", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-61.2, -51.85], [-60.0, -51.25], [-59.15, -51.5], [-58.55, -51.1], [-57.75, -51.55], [-58.05, -51.9], [-59.4, -52.2], [-59.85, -51.85], [-60.7, -52.3], [-61.2, -51.85]]] } }, + { "type": "Feature", "properties": { "admin": "France", "name": "France", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-52.556424730018378, 2.504705308437053], [-52.939657151894963, 2.124857692875622], [-53.41846513529525, 2.053389187016037], [-53.554839240113481, 2.334896551925964], [-53.778520677288881, 2.376702785650053], [-54.088062506717264, 2.105556545414629], [-54.524754197799737, 2.311848863123785], [-54.271229620975781, 2.738747870286942], [-54.184284023644743, 3.194172268075234], [-54.011503872276812, 3.622569891774857], [-54.3995422023565, 4.212611395683481], [-54.478632981979203, 4.896755682795642], [-53.958044603070917, 5.756548163267808], [-53.618452928264837, 5.646529038918401], [-52.882141282754063, 5.409850979021598], [-51.823342861525916, 4.565768133966144], [-51.657797410678874, 4.156232408053028], [-52.249337531123977, 3.241094468596287], [-52.556424730018378, 2.504705308437053]]], [[[9.560016310269132, 42.152491970379558], [9.229752231491771, 41.380006822264441], [8.77572309737536, 41.583611965494427], [8.544212680707828, 42.256516628583078], [8.746009148807586, 42.628121853193946], [9.390000848028901, 43.009984849614725], [9.560016310269132, 42.152491970379558]]], [[[3.588184441755714, 50.378992418003563], [4.28602298342514, 49.90749664977254], [4.799221632515752, 49.985373033236314], [5.674051954784885, 49.529483547557433], [5.897759230176375, 49.442667141307155], [6.186320428094204, 49.463802802114444], [6.658229607783538, 49.201958319691549], [8.09927859867477, 49.017783515003366], [7.59367638513106, 48.333019110703724], [7.466759067422228, 47.620581976911851], [7.192202182655533, 47.449765529970982], [6.736571079138086, 47.541801255882874], [6.768713820023634, 47.287708238303672], [6.037388950228971, 46.725778713561894], [6.022609490593566, 46.272989813820502], [6.500099724970453, 46.429672756529428], [6.84359297041456, 45.991146552100659], [6.80235517744566, 45.708579820328673], [7.096652459347835, 45.333098863295859], [6.749955275101711, 45.028517971367584], [7.007562290076661, 44.254766750661382], [7.549596388386161, 44.127901109384808], [7.435184767291841, 43.693844916349164], [6.529245232783068, 43.12889232031835], [4.556962517931395, 43.399650987311581], [3.100410597352719, 43.075200507167118], [2.985998976258486, 42.473015041669882], [1.826793247087181, 42.343384711265649], [0.701590610363922, 42.795734361332642], [0.338046909190581, 42.57954600683955], [-1.502770961910471, 43.034014390630482], [-1.901351284177735, 43.422802028978332], [-1.384225226232956, 44.022610378590166], [-1.193797573237361, 46.014917710954862], [-2.225724249673788, 47.064362697938201], [-2.963276129559573, 47.570326646507958], [-4.491554938159481, 47.95495433205641], [-4.592349819344746, 48.68416046812694], [-3.295813971357745, 48.901692409859628], [-1.616510789384932, 48.644421291694577], [-1.933494025063254, 49.776341864615759], [-0.98946895995536, 49.347375800160869], [1.338761020522753, 50.127173163445256], [1.6390010921385, 50.9466063502975], [2.51357303224617, 51.14850617126185], [2.65842207196033, 50.796848049515646], [3.123251580425716, 50.780363267614504], [3.588184441755714, 50.378992418003563]]]] } }, + { "type": "Feature", "properties": { "admin": "Gabon", "name": "Gabon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[11.093772820691923, -3.978826592630546], [10.066135288135738, -2.969482517105681], [9.405245395554969, -2.144313246269042], [8.797995639693168, -1.111301364754496], [8.830086704146423, -0.779073581550037], [9.048419630579586, -0.459351494960217], [9.291350538783687, 0.268666083167687], [9.492888624721981, 1.010119533691494], [9.83028405115564, 1.067893784993799], [11.285078973036461, 1.057661851400013], [11.276449008843711, 2.261050930180871], [11.751665480199787, 2.326757513839993], [12.359380323952218, 2.19281220133945], [12.951333855855605, 2.321615708826939], [13.07582238124675, 2.267097072759014], [13.003113641012074, 1.830896307783319], [13.282631463278816, 1.31418366129688], [14.026668735417214, 1.395677395021153], [14.276265903386953, 1.196929836426619], [13.843320753645653, 0.038757635901149], [14.316418491277741, -0.552627455247048], [14.425455763413593, -1.333406670744971], [14.299210239324564, -1.998275648612213], [13.992407260807706, -2.470804945489099], [13.109618767965626, -2.428740329603513], [12.575284458067639, -1.948511244315134], [12.495702752338159, -2.391688327650242], [11.820963575903189, -2.514161472181982], [11.478038771214299, -2.765618991714241], [11.855121697648114, -3.42687061932105], [11.093772820691923, -3.978826592630546]]] } }, + { "type": "Feature", "properties": { "admin": "United Kingdom", "name": "United Kingdom", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-5.661948614921896, 54.554603176483838], [-6.197884894220976, 53.867565009163329], [-6.953730231137994, 54.073702297575622], [-7.572167934591078, 54.059956366585979], [-7.366030646178785, 54.595840969452688], [-7.572167934591078, 55.131622219454883], [-6.733847011736144, 55.172860012423783], [-5.661948614921896, 54.554603176483838]]], [[[-3.00500484863528, 58.635000108466322], [-4.073828497728015, 57.55302480735525], [-3.055001796877661, 57.690019029360933], [-1.959280564776918, 57.684799709699512], [-2.219988165689301, 56.870017401753515], [-3.119003058271118, 55.97379303651546], [-2.085009324543023, 55.909998480851264], [-2.005675679673856, 55.804902850350217], [-1.11499101399221, 54.624986477265388], [-0.4304849918542, 54.464376125702145], [0.184981316742039, 53.325014146531018], [0.469976840831777, 52.929999498091959], [1.681530795914739, 52.739520168663987], [1.559987827164377, 52.099998480836], [1.050561557630914, 51.806760565795678], [1.4498653499503, 51.289427802121949], [0.550333693045502, 50.765738837275862], [-0.787517462558639, 50.774988918656206], [-2.489997524414377, 50.500018622431227], [-2.956273972984035, 50.696879991247002], [-3.617448085942327, 50.228355617872708], [-4.542507900399243, 50.341837063185658], [-5.245023159191134, 49.959999904981082], [-5.776566941745299, 50.159677639356815], [-4.309989793301837, 51.210001125689146], [-3.414850633142122, 51.426008612669236], [-3.422719467108322, 51.426848167406078], [-4.984367234710873, 51.593466091510962], [-5.267295701508885, 51.991400458374571], [-4.222346564134852, 52.30135569926135], [-4.770013393564112, 52.840004991255611], [-4.579999152026914, 53.495003770555165], [-3.093830673788658, 53.404547400669671], [-3.092079637047106, 53.404440822963544], [-2.945008510744343, 53.98499970154667], [-3.614700825433033, 54.60093677329256], [-3.63000545898933, 54.615012925833], [-4.844169073903003, 54.790971177786837], [-5.082526617849224, 55.061600653699358], [-4.719112107756643, 55.508472601943467], [-5.047980922862108, 55.783985500707516], [-5.586397670911139, 55.311146145236805], [-5.64499874513018, 56.275014960344791], [-6.149980841486352, 56.785009670633528], [-5.78682471355529, 57.818848375064633], [-5.009998745127574, 58.630013332750039], [-4.211494513353555, 58.550845038479153], [-3.00500484863528, 58.635000108466322]]]] } }, + { "type": "Feature", "properties": { "admin": "Georgia", "name": "Georgia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[41.55408410011065, 41.535656236327561], [41.703170607272703, 41.962942816732912], [41.453470086438379, 42.645123399417926], [40.875469191253785, 43.013628038091277], [40.321394484220313, 43.128633938156831], [39.955008579270917, 43.434997666999216], [40.07696495947976, 43.553104153002309], [40.922184686045618, 43.38215851498078], [42.394394565608806, 43.220307929042619], [43.756016880067378, 42.74082815202248], [43.931199985536828, 42.554973863284758], [44.537622918481979, 42.71199270280362], [45.470279168485703, 42.502780666669963], [45.776410353382758, 42.09244395605635], [46.404950799348818, 41.860675157227298], [46.145431756379004, 41.722802435872573], [46.637908156120574, 41.181672675128219], [46.501637404166921, 41.064444688474104], [45.962600538930381, 41.123872585609767], [45.217426385281577, 41.411451931314041], [44.972480096218071, 41.248128567055588], [43.582745802592726, 41.09214325618256], [42.619548781104484, 41.583172715819934], [41.55408410011065, 41.535656236327561]]] } }, + { "type": "Feature", "properties": { "admin": "Ghana", "name": "Ghana", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[1.060121697604927, 5.928837388528875], [-0.507637905265938, 5.343472601742675], [-1.063624640294193, 5.000547797053811], [-1.964706590167594, 4.71046214438337], [-2.856125047202397, 4.994475816259508], [-2.810701463217839, 5.389051215024109], [-3.244370083011261, 6.2504715031135], [-2.983584967450326, 7.379704901555511], [-2.56218950032624, 8.219627793811481], [-2.827496303712706, 9.642460842319775], [-2.963896246747111, 10.395334784380081], [-2.94040930827046, 10.962690334512557], [-1.203357713211431, 11.009819240762736], [-0.761575893548183, 10.936929633015053], [-0.438701544588582, 11.09834096927872], [0.023802524423701, 11.018681748900802], [-0.049784715159944, 10.706917832883928], [0.367579990245389, 10.191212876827176], [0.365900506195885, 9.46500397382948], [0.461191847342121, 8.677222601756013], [0.712029249686878, 8.312464504423827], [0.490957472342245, 7.411744289576474], [0.570384148774849, 6.914358628767188], [0.836931186536333, 6.279978745952147], [1.060121697604927, 5.928837388528875]]] } }, + { "type": "Feature", "properties": { "admin": "Guinea", "name": "Guinea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-8.439298468448696, 7.686042792181736], [-8.722123582382123, 7.711674302598509], [-8.926064622422002, 7.309037380396375], [-9.208786383490844, 7.313920803247952], [-9.403348151069748, 7.526905218938906], [-9.33727983238458, 7.928534450711351], [-9.755342169625832, 8.541055202666923], [-10.016566534861253, 8.42850393313523], [-10.230093553091276, 8.406205552601291], [-10.505477260774667, 8.348896389189603], [-10.494315151399629, 8.715540676300433], [-10.65477047366589, 8.977178452994194], [-10.622395188835037, 9.267910061068276], [-10.839151984083299, 9.688246161330367], [-11.117481248407328, 10.045872911006283], [-11.917277390988655, 10.046983954300556], [-12.150338100625003, 9.858571682164378], [-12.425928514037562, 9.835834051955953], [-12.596719122762206, 9.620188300001969], [-12.711957566773076, 9.342711696810765], [-13.246550258832512, 8.903048610871506], [-13.685153977909788, 9.494743760613458], [-14.074044969122278, 9.886166897008248], [-14.330075852912367, 10.015719712763966], [-14.579698859098254, 10.214467271358513], [-14.693231980843501, 10.65630076745404], [-14.83955379887794, 10.876571560098139], [-15.130311245168167, 11.040411688679525], [-14.685687221728896, 11.527823798056485], [-14.382191534878727, 11.509271958863691], [-14.121406419317776, 11.677117010947693], [-13.900799729863772, 11.678718980348744], [-13.743160773157411, 11.811269029177408], [-13.828271857142122, 12.142644151249041], [-13.718743658899511, 12.247185573775507], [-13.700476040084322, 12.586182969610192], [-13.217818162478235, 12.575873521367964], [-12.499050665730561, 12.332089952031053], [-12.278599005573438, 12.354440008997285], [-12.20356482588563, 12.465647691289401], [-11.658300950557928, 12.386582749882834], [-11.513942836950587, 12.442987575729415], [-11.456168585648269, 12.076834214725336], [-11.297573614944508, 12.077971096235768], [-11.036555955438256, 12.211244615116513], [-10.870829637078211, 12.177887478072106], [-10.593223842806278, 11.923975328005977], [-10.165213792348835, 11.844083563682743], [-9.890992804392011, 12.060478623904968], [-9.567911749703212, 12.194243068892472], [-9.327616339546008, 12.334286200403451], [-9.127473517279581, 12.308060411015331], [-8.905264858424529, 12.088358059126433], [-8.786099005559462, 11.812560939984705], [-8.376304897484911, 11.393645941610627], [-8.581305304386772, 11.136245632364801], [-8.620321010767126, 10.810890814655181], [-8.407310756860026, 10.90925690352276], [-8.282357143578279, 10.792597357623842], [-8.335377163109738, 10.494811916541932], [-8.029943610048617, 10.206534939001711], [-8.22933712404682, 10.129020290563897], [-8.309616461612249, 9.789531968622439], [-8.079113735374348, 9.376223863152033], [-7.832100389019186, 8.575704250518625], [-8.203498907900878, 8.455453192575446], [-8.299048631208562, 8.316443589710302], [-8.221792364932197, 8.123328762235571], [-8.280703497744936, 7.687179673692156], [-8.439298468448696, 7.686042792181736]]] } }, + { "type": "Feature", "properties": { "admin": "Gambia", "name": "Gambia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-16.84152462408127, 13.151393947802557], [-16.713728807023468, 13.594958604379853], [-15.624596320039936, 13.623587347869556], [-15.398770310924457, 13.860368760630916], [-15.081735398813816, 13.876491807505982], [-14.687030808968483, 13.63035696049978], [-14.376713833055785, 13.625680243377371], [-14.046992356817478, 13.794067898000446], [-13.844963344772404, 13.505041612191999], [-14.277701788784553, 13.28058502853224], [-14.712197231494626, 13.298206691943774], [-15.141163295949463, 13.509511623585235], [-15.511812506562931, 13.278569647672864], [-15.691000535534991, 13.270353094938455], [-15.931295945692208, 13.130284125211331], [-16.84152462408127, 13.151393947802557]]] } }, + { "type": "Feature", "properties": { "admin": "Guinea Bissau", "name": "Guinea-Bissau", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-15.130311245168167, 11.040411688679525], [-15.664180467175523, 11.458474025920792], [-16.085214199273562, 11.524594021038236], [-16.314786749730199, 11.806514797406548], [-16.308947312881227, 11.958701890506116], [-16.613838263403277, 12.170911159712698], [-16.67745195155457, 12.38485158940105], [-16.147716844130581, 12.547761542201185], [-15.816574266004251, 12.515567124883345], [-15.548476935274005, 12.628170070847343], [-13.700476040084322, 12.586182969610192], [-13.718743658899511, 12.247185573775507], [-13.828271857142122, 12.142644151249041], [-13.743160773157411, 11.811269029177408], [-13.900799729863772, 11.678718980348744], [-14.121406419317776, 11.677117010947693], [-14.382191534878727, 11.509271958863691], [-14.685687221728896, 11.527823798056485], [-15.130311245168167, 11.040411688679525]]] } }, + { "type": "Feature", "properties": { "admin": "Equatorial Guinea", "name": "Eq. Guinea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[9.492888624721981, 1.010119533691494], [9.305613234096255, 1.160911363119183], [9.649158155972627, 2.283866075037735], [11.276449008843711, 2.261050930180871], [11.285078973036461, 1.057661851400013], [9.83028405115564, 1.067893784993799], [9.492888624721981, 1.010119533691494]]] } }, + { "type": "Feature", "properties": { "admin": "Greece", "name": "Greece", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[23.699980096133, 35.705004380835526], [24.246665073348673, 35.368022365860149], [25.025015496528873, 35.424995632461979], [25.769207797964182, 35.354018052709073], [25.745023227651579, 35.179997666966209], [26.290002882601719, 35.299990342747911], [26.164997592887651, 35.004995429009789], [24.724982130642299, 34.919987697889603], [24.735007358506941, 35.084990546197581], [23.514978468528106, 35.27999156345097], [23.699980096133, 35.705004380835526]]], [[[26.604195590936282, 41.562114569661098], [26.294602085075777, 40.936261298174244], [26.056942172965499, 40.824123440100827], [25.44767703624418, 40.852545477861455], [24.925848422960932, 40.947061672523226], [23.714811232200809, 40.687129218095116], [24.407998894964063, 40.124992987624083], [23.89996788910258, 39.962005520175573], [23.342999301860797, 39.960997829745786], [22.813987664488959, 40.476005153966547], [22.626298862404777, 40.256561184239175], [22.849747755634805, 39.659310818025759], [23.350027296652595, 39.190011298167256], [22.97309939951554, 38.97090322524965], [23.53001631032495, 38.51000112563846], [24.025024855248937, 38.219992987616443], [24.040011020613601, 37.655014553369419], [23.115002882589145, 37.920011298162215], [23.409971958111065, 37.409990749657389], [22.77497195810863, 37.305010077456551], [23.154225294698612, 36.422505804992042], [22.4900281104511, 36.410000108377446], [21.670026482843692, 36.84498647719419], [21.295010613701574, 37.644989325504689], [21.120034213961329, 38.31032339126272], [20.730032179454579, 38.769985256498778], [20.217712029712853, 39.340234686839629], [20.150015903410516, 39.624997666984022], [20.615000441172779, 40.110006822259422], [20.67499677906363, 40.434999904943048], [20.999989861747274, 40.580003973953964], [21.020040317476422, 40.842726955725873], [21.674160597426969, 40.931274522457976], [22.055377638444266, 41.149865831052686], [22.597308383889008, 41.130487168943198], [22.76177, 41.3048], [22.952377150166562, 41.337993882811212], [23.692073601992455, 41.309080918943849], [24.492644891058031, 41.583896185872035], [25.19720136892553, 41.234485988930651], [26.106138136507177, 41.328898830727823], [26.11704186372091, 41.826904608724725], [26.604195590936282, 41.562114569661098]]]] } }, + { "type": "Feature", "properties": { "admin": "Greenland", "name": "Greenland", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-46.76379, 82.62796], [-43.40644, 83.22516], [-39.89753, 83.18018], [-38.62214, 83.54905], [-35.08787, 83.64513], [-27.10046, 83.51966], [-20.84539, 82.72669], [-22.69182, 82.34165], [-26.51753, 82.29765], [-31.9, 82.2], [-31.39646, 82.02154], [-27.85666, 82.13178], [-24.84448, 81.78697], [-22.90328, 82.09317], [-22.07175, 81.73449], [-23.16961, 81.15271], [-20.62363, 81.52462], [-15.76818, 81.91245], [-12.77018, 81.71885], [-12.20855, 81.29154], [-16.28533, 80.58004], [-16.85, 80.35], [-20.04624, 80.17708], [-17.73035, 80.12912], [-18.9, 79.4], [-19.70499, 78.75128], [-19.67353, 77.63859], [-18.47285, 76.98565], [-20.03503, 76.94434], [-21.67944, 76.62795], [-19.83407, 76.09808], [-19.59896, 75.24838], [-20.66818, 75.15585], [-19.37281, 74.29561], [-21.59422, 74.22382], [-20.43454, 73.81713], [-20.76234, 73.46436], [-22.17221, 73.30955], [-23.56593, 73.30663], [-22.31311, 72.62928], [-22.29954, 72.18409], [-24.27834, 72.59788], [-24.79296, 72.3302], [-23.44296, 72.08016], [-22.13281, 71.46898], [-21.75356, 70.66369], [-23.53603, 70.471], [-24.30702, 70.85649], [-25.54341, 71.43094], [-25.20135, 70.75226], [-26.36276, 70.22646], [-23.72742, 70.18401], [-22.34902, 70.12946], [-25.02927, 69.2588], [-27.74737, 68.47046], [-30.67371, 68.12503], [-31.77665, 68.12078], [-32.81105, 67.73547], [-34.20196, 66.67974], [-36.35284, 65.9789], [-37.04378, 65.93768], [-38.37505, 65.69213], [-39.81222, 65.45848], [-40.66899, 64.83997], [-40.68281, 64.13902], [-41.1887, 63.48246], [-42.81938, 62.68233], [-42.41666, 61.90093], [-42.86619, 61.07404], [-43.3784, 60.09772], [-44.7875, 60.03676], [-46.26364, 60.85328], [-48.26294, 60.85843], [-49.23308, 61.40681], [-49.90039, 62.38336], [-51.63325, 63.62691], [-52.14014, 64.27842], [-52.27659, 65.1767], [-53.66166, 66.09957], [-53.30161, 66.8365], [-53.96911, 67.18899], [-52.9804, 68.35759], [-51.47536, 68.72958], [-51.08041, 69.14781], [-50.87122, 69.9291], [-52.013585, 69.574925], [-52.55792, 69.42616], [-53.45629, 69.283625], [-54.68336, 69.61003], [-54.75001, 70.28932], [-54.35884, 70.821315], [-53.431315, 70.835755], [-51.39014, 70.56978], [-53.10937, 71.20485], [-54.00422, 71.54719], [-55.0, 71.406536967272558], [-55.83468, 71.65444], [-54.71819, 72.58625], [-55.32634, 72.95861], [-56.12003, 73.64977], [-57.32363, 74.71026], [-58.59679, 75.09861], [-58.58516, 75.51727], [-61.26861, 76.10238], [-63.39165, 76.1752], [-66.06427, 76.13486], [-68.50438, 76.06141], [-69.66485, 76.37975], [-71.40257, 77.00857], [-68.77671, 77.32312], [-66.76397, 77.37595], [-71.04293, 77.63595], [-73.297, 78.04419], [-73.15938, 78.43271], [-69.37345, 78.91388], [-65.7107, 79.39436], [-65.3239, 79.75814], [-68.02298, 80.11721], [-67.15129, 80.51582], [-63.68925, 81.21396], [-62.23444, 81.3211], [-62.65116, 81.77042], [-60.28249, 82.03363], [-57.20744, 82.19074], [-54.13442, 82.19962], [-53.04328, 81.88833], [-50.39061, 82.43883], [-48.00386, 82.06481], [-46.59984, 81.985945], [-44.523, 81.6607], [-46.9007, 82.19979], [-46.76379, 82.62796]]] } }, + { "type": "Feature", "properties": { "admin": "Guatemala", "name": "Guatemala", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-90.095554572290951, 13.73533763270073], [-90.608624030300817, 13.909771429901948], [-91.232410244496037, 13.927832342987953], [-91.689746670279106, 14.126218166556452], [-92.227750006869812, 14.538828640190925], [-92.203229539747298, 14.830102850804066], [-92.087215949252041, 15.064584662328436], [-92.229248623406249, 15.251446641495857], [-91.747960171255912, 16.066564846251719], [-90.464472622422647, 16.069562079324651], [-90.438866950222021, 16.410109768128091], [-90.600846727240906, 16.470777899638758], [-90.711821865587694, 16.687483018454724], [-91.081670091500641, 16.918476670799404], [-91.453921271515128, 17.252177232324168], [-91.002269253284197, 17.254657701074176], [-91.001519945015943, 17.817594916245707], [-90.067933519230948, 17.819326076727474], [-89.143080410503302, 17.808318996649316], [-89.15080603713092, 17.015576687075832], [-89.229121670269265, 15.886937567605166], [-88.930612759135244, 15.887273464415072], [-88.604586147805833, 15.706380113177358], [-88.518364020526846, 15.855389105690971], [-88.22502275262201, 15.727722479713901], [-88.680679694355618, 15.346247056535301], [-89.15481096063354, 15.066419175674806], [-89.225220099631244, 14.874286200413618], [-89.145535041037149, 14.67801911056908], [-89.353325975282772, 14.424132798719112], [-89.587342698916544, 14.362586167859485], [-89.5342193265205, 14.244815578666302], [-89.7219339668207, 14.134228013561694], [-90.064677903996568, 13.881969509328924], [-90.095554572290951, 13.73533763270073]]] } }, + { "type": "Feature", "properties": { "admin": "Guyana", "name": "Guyana", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-59.758284878159181, 8.367034816924045], [-59.10168412945864, 7.99920197187049], [-58.482962205628041, 7.347691351750696], [-58.454876064677414, 6.832787380394463], [-58.078103196837361, 6.809093736188641], [-57.542218593970631, 6.321268215353355], [-57.147436489476874, 5.973149929219161], [-57.307245856339492, 5.073566595882225], [-57.914288906472123, 4.812626451024413], [-57.860209520078691, 4.576801052260449], [-58.044694383360664, 4.060863552258382], [-57.601568976457848, 3.334654649260684], [-57.281433478409703, 3.333491929534119], [-57.150097825739898, 2.768926906745406], [-56.53938574891454, 1.89952260986692], [-56.782704230360814, 1.863710842288653], [-57.33582292339689, 1.948537705895759], [-57.660971035377358, 1.682584947105638], [-58.113449876525003, 1.507195135907025], [-58.429477098205957, 1.46394196207872], [-58.540012986878288, 1.26808828369252], [-59.030861579002639, 1.317697658692722], [-59.646043667221242, 1.786893825686789], [-59.718545701726732, 2.249630438644359], [-59.974524909084543, 2.755232652188055], [-59.815413174057852, 3.606498521332085], [-59.538039923731219, 3.958802598481937], [-59.767405768458701, 4.423502915866606], [-60.111002366767373, 4.574966538914082], [-59.980958624904865, 5.014061184098138], [-60.213683437731319, 5.2444863956876], [-60.733574184803707, 5.2002772078619], [-61.410302903881941, 5.959068101419616], [-61.139415045807937, 6.234296779806142], [-61.159336310456467, 6.696077378766317], [-60.543999192940966, 6.856584377464881], [-60.295668097562377, 7.043911444522918], [-60.637972785063752, 7.414999904810853], [-60.550587938058186, 7.779602972846178], [-59.758284878159181, 8.367034816924045]]] } }, + { "type": "Feature", "properties": { "admin": "Honduras", "name": "Honduras", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-87.316654425795463, 12.984685777229], [-87.48940873894712, 13.29753489832393], [-87.793111131526501, 13.384480495655165], [-87.723502977229288, 13.785050360565602], [-87.859515347021599, 13.893312486217097], [-88.065342576840109, 13.964625962779788], [-88.503997972349609, 13.845485948130939], [-88.541230841815931, 13.98015473068352], [-88.843072882832743, 14.140506700085208], [-89.058511929057644, 14.340029405164213], [-89.353325975282786, 14.424132798719084], [-89.145535041037164, 14.678019110569149], [-89.22522009963123, 14.874286200413675], [-89.154810960633526, 15.066419175674863], [-88.680679694355575, 15.346247056535386], [-88.225022752621925, 15.727722479714027], [-88.121153123715359, 15.688655096901355], [-87.901812506852394, 15.864458319558194], [-87.615680101252309, 15.878798529519198], [-87.522920905288444, 15.797278957578779], [-87.367762417332116, 15.846940009011286], [-86.903191291028165, 15.756712958229565], [-86.440945604177372, 15.782835394753189], [-86.119233974944322, 15.893448798073958], [-86.00195431185783, 16.005405788634388], [-85.68331743034625, 15.953651841693949], [-85.444003872402547, 15.885749009662444], [-85.182443610357183, 15.909158433490628], [-84.98372188997881, 15.995923163308698], [-84.526979743167118, 15.857223619037423], [-84.36825558138257, 15.835157782448729], [-84.063054572266807, 15.648244126849132], [-83.773976610026111, 15.42407176356687], [-83.410381232420363, 15.27090281825377], [-83.147219000974104, 14.995829169164207], [-83.489988776366005, 15.01626719813566], [-83.628584967772866, 14.880073960830368], [-83.975721401693576, 14.749435939996483], [-84.228341640952394, 14.748764146376626], [-84.449335903648588, 14.62161428472251], [-84.64958207877963, 14.666805324761865], [-84.820036790694289, 14.819586696832628], [-84.924500698572302, 14.790492865452332], [-85.052787441736868, 14.551541042534719], [-85.148750576502877, 14.560196844943615], [-85.165364549484806, 14.354369615125048], [-85.514413011400265, 14.079011745657905], [-85.698665330736944, 13.960078436737998], [-85.801294725268505, 13.8360549992376], [-86.096263800790595, 14.03818736414723], [-86.312142096689826, 13.771356106008223], [-86.520708177419891, 13.778487453664464], [-86.755086636079596, 13.754845485890936], [-86.733821784191463, 13.263092556201398], [-86.880557013684353, 13.254204209847213], [-87.005769009127434, 13.025794379117254], [-87.316654425795463, 12.984685777229]]] } }, + { "type": "Feature", "properties": { "admin": "Croatia", "name": "Croatia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[18.829838087650039, 45.908877671891837], [19.072768995854172, 45.521511135432078], [19.390475701584588, 45.236515611342369], [19.005486281010118, 44.860233669609144], [18.553214145591646, 45.08158966733145], [17.861783481526398, 45.067740383477137], [17.00214603035101, 45.233776760430935], [16.534939406000202, 45.211607570977705], [16.318156772535868, 45.004126695325901], [15.959367303133373, 45.233776760430935], [15.750026075918978, 44.81871165626255], [16.239660271884528, 44.351143296885695], [16.456442905348862, 44.041239732431265], [16.916156447017325, 43.667722479825663], [17.297373488034449, 43.446340643887353], [17.674921502358981, 43.028562527023603], [18.56, 42.65], [18.450016310304814, 42.47999136002931], [17.509970330483323, 42.84999461523914], [16.930005730871638, 43.209998480800373], [16.015384555737679, 43.507215481127204], [15.174453973052094, 44.243191229827907], [15.376250441151793, 44.317915350922064], [14.920309279040504, 44.73848399512945], [14.901602410550874, 45.076060289076104], [14.258747592839992, 45.233776760430935], [13.952254672917032, 44.802123521496853], [13.65697553880119, 45.136935126315947], [13.679403110415816, 45.484149074884996], [13.715059848697248, 45.500323798192419], [14.411968214585496, 45.466165676447403], [14.595109490627916, 45.63494090431282], [14.935243767972961, 45.471695054702757], [15.327674594797424, 45.452316392593325], [15.323953891672428, 45.731782538427687], [15.671529575267638, 45.8341535507979], [15.768732944408608, 46.23810822202352], [16.564808383864939, 46.503750922219794], [16.882515089595412, 46.380631822284428], [17.630066359129554, 45.951769110694087], [18.456062452882858, 45.759481106136143], [18.829838087650039, 45.908877671891837]]] } }, + { "type": "Feature", "properties": { "admin": "Haiti", "name": "Haiti", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-73.189790615517595, 19.915683905511909], [-72.579672817663607, 19.871500555902351], [-71.71236141629295, 19.714455878167353], [-71.624873216422813, 19.169837958243303], [-71.701302659782485, 18.785416978424049], [-71.945112067335543, 18.616900132720257], [-71.687737596305865, 18.316660061104468], [-71.708304816358037, 18.044997056546091], [-72.372476162389333, 18.214960842354053], [-72.844411180294856, 18.145611070218362], [-73.454554816365018, 18.217906398994696], [-73.922433234335642, 18.030992743395], [-74.458033616824764, 18.342549953682703], [-74.369925299767118, 18.664907538319408], [-73.449542202432696, 18.526052964751141], [-72.694937099890623, 18.445799465401858], [-72.334881557896992, 18.66842153571525], [-72.791649542924873, 19.101625067618027], [-72.784104783810264, 19.483591416903405], [-73.41502234566174, 19.639550889560276], [-73.189790615517595, 19.915683905511909]]] } }, + { "type": "Feature", "properties": { "admin": "Hungary", "name": "Hungary", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.202298211337361, 46.852385972676949], [16.534267612380372, 47.496170966169103], [16.340584344150411, 47.712901923201215], [16.903754103267257, 47.714865627628321], [16.979666782304033, 48.123497015976298], [17.488472934649813, 47.867466132186209], [17.857132602620023, 47.758428860050365], [18.696512892336923, 47.88095368101439], [18.777024773847668, 48.081768296900627], [19.174364861739885, 48.111378892603859], [19.66136355965849, 48.266614895208647], [19.769470656013109, 48.2026911484636], [20.239054396249344, 48.327567247096916], [20.473562045989862, 48.562850043321809], [20.801293979584919, 48.62385407164237], [21.872236362401729, 48.319970811550007], [22.085608351334848, 48.422264309271782], [22.640819939878746, 48.150239569687351], [22.710531447040488, 47.882193915389394], [22.09976769378283, 47.672439276716695], [21.626514926853869, 46.994237779318148], [21.021952345471245, 46.316087958351886], [20.220192498462833, 46.127468980486547], [19.596044549241579, 46.171729844744533], [18.829838087649957, 45.908877671891915], [18.456062452882858, 45.759481106136121], [17.630066359129554, 45.95176911069418], [16.882515089595298, 46.380631822284428], [16.564808383864854, 46.503750922219822], [16.370504998447412, 46.841327216166498], [16.202298211337361, 46.852385972676949]]] } }, + { "type": "Feature", "properties": { "admin": "Indonesia", "name": "Indonesia", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[120.715608758630438, -10.239581394087862], [120.295014276206871, -10.258649997603525], [118.967808465654684, -9.55796925215803], [119.900309686361609, -9.361340427287514], [120.425755649905398, -9.665921319215796], [120.775501743656719, -9.969675388227456], [120.715608758630438, -10.239581394087862]]], [[[124.435950148619384, -10.14000090906144], [123.579981724136701, -10.359987481327961], [123.459989048354998, -10.239994805546171], [123.55000939340745, -9.900015557497978], [123.980008986508096, -9.290026950724693], [124.96868248911619, -8.892790215697046], [125.070019972840612, -9.089987481322835], [125.088520135601073, -9.393173109579321], [124.435950148619384, -10.14000090906144]]], [[[117.900018345207741, -8.095681247594923], [118.260616489740471, -8.362383314653327], [118.87845991422212, -8.280682875199828], [119.126506789223086, -8.705824883665072], [117.97040164598927, -8.906639499551257], [117.277730747549015, -9.040894870645557], [116.74014082241662, -9.032936700072637], [117.083737420725313, -8.457157891476539], [117.632024367342126, -8.44930307376819], [117.900018345207741, -8.095681247594923]]], [[[122.903537225436082, -8.094234307490735], [122.756982863456287, -8.649807631060638], [121.2544905945701, -8.933666273639941], [119.924390903809567, -8.810417982623873], [119.920928582846102, -8.44485890059107], [120.715091994307542, -8.236964613480863], [121.341668735846554, -8.53673959720602], [122.007364536630405, -8.46062021244016], [122.903537225436082, -8.094234307490735]]], [[[108.623478631628927, -6.777673841990675], [110.539227329553285, -6.877357679881682], [110.759575636845909, -6.465186455921751], [112.614811232556349, -6.946035658397589], [112.978768345188087, -7.594213148634578], [114.478935174621142, -7.776527601760277], [115.705526971501058, -8.370806573116864], [114.564511346496488, -8.75181690840483], [113.464733514460875, -8.348947442257424], [112.559672479301028, -8.376180922075163], [111.522061395312448, -8.302128594600957], [110.586149530074294, -8.122604668819021], [109.427667270955183, -7.740664157749761], [108.693655226681301, -7.641600437046219], [108.277763299596302, -7.766657403192579], [106.454102004016136, -7.354899590690947], [106.280624220812285, -6.924899997590201], [105.365486281355516, -6.851416110871169], [106.051645949327053, -5.895918877794499], [107.265008579540165, -5.954985039904058], [108.072091099074683, -6.345762220895237], [108.486846144649235, -6.421984958525768], [108.623478631628927, -6.777673841990675]]], [[[134.724624465066654, -6.214400730009286], [134.210133905168902, -6.895237725454704], [134.112775506730998, -6.142467136259014], [134.290335728085779, -5.783057549669038], [134.499625278867882, -5.445042006047898], [134.727001580952106, -5.737582289252158], [134.724624465066654, -6.214400730009286]]], [[[127.249215122588893, -3.459065036638889], [126.874922723498855, -3.790982761249579], [126.183802118027302, -3.607376397316556], [125.989033644719257, -3.177273451351325], [127.00065148326496, -3.12931772218441], [127.249215122588893, -3.459065036638889]]], [[[130.471344028851775, -3.09376433676762], [130.834836053592767, -3.858472181822761], [129.990546502808115, -3.446300957862817], [129.155248651242403, -3.362636813982248], [128.590683628453633, -3.428679294451256], [127.898891229362334, -3.393435967628192], [128.135879347852779, -2.843650404474914], [129.370997756060888, -2.802154229344551], [130.471344028851775, -3.09376433676762]]], [[[134.143367954647772, -1.151867364103594], [134.422627394753022, -2.769184665542383], [135.457602980694674, -3.367752780779113], [136.293314243718754, -2.30704233155609], [137.4407377463275, -1.703513278819372], [138.329727411044757, -1.70268645590265], [139.18492068904294, -2.051295668143637], [139.926684198160387, -2.409051608900284], [141.000210402591847, -2.600151055515624], [141.017056919519007, -5.85902190513802], [141.033851760013874, -9.117892754760417], [140.143415155192542, -8.297167657100955], [139.127766554928087, -8.096042982620942], [138.881476678624949, -8.380935153846094], [137.614473911692812, -8.41168263105976], [138.039099155835174, -7.597882175327354], [138.668621454014783, -7.320224704623072], [138.407913853102343, -6.232849216337483], [137.927839797110835, -5.393365573755998], [135.989250116113453, -4.546543877789047], [135.164597609599667, -4.462931410340771], [133.662880487197867, -3.538853448097526], [133.367704705946778, -4.024818617370314], [132.983955519747326, -4.112978610860281], [132.75694095268895, -3.746282647317129], [132.753788690319197, -3.311787204607071], [131.989804315316178, -2.820551039240455], [133.066844517143466, -2.460417982598443], [133.780030959203486, -2.479848321140209], [133.69621178602614, -2.214541517753687], [132.232373488494204, -2.212526136894325], [131.836221958544684, -1.617161960459597], [130.942839797082797, -1.432522067880796], [130.519558140180038, -0.937720228686075], [131.867537876513609, -0.695461114101818], [132.380116408416768, -0.369537855636977], [133.985548130428384, -0.780210463060442], [134.143367954647772, -1.151867364103594]]], [[[125.240500522971573, 1.419836127117605], [124.43703535369734, 0.427881171058971], [123.685504998876695, 0.235593166500877], [122.723083123872854, 0.431136786293337], [121.056724888189081, 0.381217352699451], [120.18308312386273, 0.23724681233422], [120.040869582195455, -0.519657891444851], [120.935905389490699, -1.408905938323372], [121.475820754076167, -0.955962009285116], [123.34056481332847, -0.615672702643081], [123.258399285984481, -1.076213067228337], [122.822715285331597, -0.930950616055881], [122.388529901215364, -1.516858005381124], [121.508273553555455, -1.904482924002422], [122.454572381684272, -3.186058444840881], [122.271896193532541, -3.529500013852696], [123.170962762546537, -4.683693129091707], [123.162332798353759, -5.34060393638596], [122.628515252778683, -5.634591159694494], [122.236394484548057, -5.282933037948281], [122.71956912647704, -4.46417164471579], [121.738233677254357, -4.851331475446499], [121.48946333220124, -4.574552504091215], [121.619171177253861, -4.188477878438674], [120.898181593917684, -3.602105401222828], [120.972388950688767, -2.627642917494909], [120.305452915529884, -2.931603692235725], [120.39004723519173, -4.097579034037223], [120.430716587405371, -5.528241062037778], [119.796543410319487, -5.67340016034565], [119.36690555224493, -5.379878024927804], [119.653606398600104, -4.459417412944958], [119.498835483885969, -3.49441171632651], [119.078344354326987, -3.487021986508764], [118.767768996252869, -2.801999200047688], [119.180973748858662, -2.147103773612798], [119.323393996255049, -1.35314706788047], [119.825998976725828, 0.154254462073496], [120.035701938966341, 0.566477362465804], [120.885779250167687, 1.309222723796835], [121.666816847826965, 1.013943589681076], [122.927566766451818, 0.875192368977465], [124.077522414242836, 0.917101955566139], [125.065989211121803, 1.643259182131558], [125.240500522971573, 1.419836127117605]]], [[[128.688248732620707, 1.132385972494106], [128.635952183141342, 0.258485826006179], [128.120169712436166, 0.356412665199286], [127.968034295768845, -0.252077325037533], [128.379998813999691, -0.780003757331286], [128.100015903842291, -0.899996433112974], [127.69647464407501, -0.266598402511505], [127.399490187693743, 1.011721503092573], [127.600511509309044, 1.81069082275718], [127.932377557487484, 2.174596258956555], [128.004156121940809, 1.628531398928331], [128.594559360875451, 1.540810655112864], [128.688248732620707, 1.132385972494106]]], [[[117.875627069166001, 1.827640692548911], [118.996747267738158, 0.902219143066048], [117.811858351717788, 0.784241848143722], [117.478338657706047, 0.102474676917026], [117.521643507966587, -0.803723239753211], [116.560048455879496, -1.487660821136231], [116.533796828275158, -2.483517347832901], [116.148083937648607, -4.012726332214014], [116.000857782049067, -3.657037448749008], [114.864803094544513, -4.106984144714416], [114.468651564595064, -3.49570362713382], [113.755671828264099, -3.439169610206519], [113.256994256647545, -3.118775729996854], [112.068126255340644, -3.478392022316071], [111.703290643359992, -2.994442233902631], [111.04824018762821, -3.049425957861188], [110.223846063275971, -2.934032484553483], [110.070935500124335, -1.592874037282414], [109.571947869914041, -1.314906507984489], [109.091873813922518, -0.459506524257051], [108.952657505328162, 0.415375474444346], [109.069136183714036, 1.341933905437642], [109.663260125773718, 2.006466986494984], [109.830226678508836, 1.338135687664191], [110.514060907027101, 0.773131415200993], [111.159137811326559, 0.976478176269509], [111.797548455860408, 0.904441229654651], [112.380251906383648, 1.410120957846757], [112.859809198052176, 1.497790025229946], [113.805849644019531, 1.217548732911041], [114.621355422017473, 1.430688177898886], [115.134037306785231, 2.821481838386219], [115.51907840379198, 3.169238389494395], [115.86551720587677, 4.306559149590156], [117.01521447150634, 4.306094061699468], [117.882034946770162, 4.137551377779487], [117.313232456533513, 3.234428208830578], [118.048329705885351, 2.287690131027361], [117.875627069166001, 1.827640692548911]]], [[[105.817655063909356, -5.852355645372411], [104.710384149191498, -5.873284600450644], [103.868213332130736, -5.037314955264974], [102.584260695406897, -4.220258884298203], [102.156173130300999, -3.614146009946765], [101.399113397225051, -2.799777113459171], [100.902502882900137, -2.05026213949786], [100.141980828860596, -0.650347588710957], [99.26373986206022, 0.183141587724663], [98.970011020913319, 1.042882391764536], [98.601351352943084, 1.823506577965616], [97.699597609449881, 2.453183905442116], [97.17694217324987, 3.30879059489861], [96.424016554757316, 3.86885976807791], [95.380876092513475, 4.970782172053673], [95.293026157617305, 5.479820868344816], [95.936862827541745, 5.439513251157108], [97.484882033277088, 5.24632090903401], [98.369169142655679, 4.268370266126366], [99.142558628335792, 3.590349636240915], [99.693997837322399, 3.174328518075156], [100.641433546961665, 2.099381211755798], [101.658012323007313, 2.083697414555189], [102.498271112073212, 1.398700466310217], [103.076840448013002, 0.561361395668854], [103.838396030698348, 0.104541734208666], [103.437645298274973, -0.711945896002845], [104.010788608824001, -1.059211521004229], [104.369991489684878, -1.084843031421016], [104.539490187602155, -1.782371514496716], [104.887892694113987, -2.340425306816655], [105.622111444116982, -2.42884368246807], [106.10859337771268, -3.06177662517895], [105.857445916774111, -4.305524997579723], [105.817655063909356, -5.852355645372411]]]] } }, + { "type": "Feature", "properties": { "admin": "India", "name": "India", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[77.837450799474553, 35.494009507787759], [78.912268914713209, 34.321936346975782], [78.811086460285722, 33.506198025032404], [79.208891636068572, 32.994394639613709], [79.176128777995501, 32.483779812137705], [78.458446486325997, 32.61816437431272], [78.738894484374001, 31.515906073527056], [79.721366815107089, 30.882714748654724], [81.11125613802929, 30.183480943313398], [80.476721225917373, 29.729865220655334], [80.088424513676259, 28.794470119740136], [81.057202589851997, 28.416095282499036], [81.999987420584958, 27.925479234319987], [83.304248895199535, 27.364505723575554], [84.675017938173767, 27.234901231387528], [85.25177859898335, 26.726198431906337], [86.024392938179147, 26.630984605408567], [87.22747195836628, 26.39789805755607], [88.060237664749806, 26.414615383402484], [88.174804315140904, 26.810405178325944], [88.043132765661198, 27.445818589786818], [88.120440708369841, 27.876541652939586], [88.730325962278528, 28.086864732367509], [88.814248488320544, 27.299315904239361], [88.835642531289366, 27.098966376243755], [89.744527622438838, 26.71940298105995], [90.37327477413406, 26.875724188742872], [91.217512648486405, 26.808648179628019], [92.033483514375078, 26.838310451763554], [92.10371178585973, 27.4526140406332], [91.69665652869665, 27.771741848251661], [92.503118931043616, 27.896876329046442], [93.413347609432662, 28.640629380807219], [94.565990431702929, 29.277438055939978], [95.404802280664612, 29.031716620392125], [96.117678664131006, 29.452802028922459], [96.586590610747479, 28.830979519154337], [96.248833449287758, 28.411030992134435], [97.327113885490007, 28.261582749946331], [97.402561476636123, 27.88253611908544], [97.051988559968066, 27.699058946233144], [97.133999058015277, 27.08377350514996], [96.419365675850941, 27.264589341739221], [95.124767694074933, 26.573572089132295], [95.155153436262566, 26.001307277932078], [94.603249139385355, 25.162495428970399], [94.552657912171611, 24.675238348890328], [94.106741977925054, 23.850740871673477], [93.325187615942767, 24.078556423432197], [93.286326938859247, 23.043658352138998], [93.060294224014598, 22.703110663335565], [93.166127557348361, 22.278459580977099], [92.672720981825549, 22.041238918541247], [92.146034783906799, 23.62749868417259], [91.869927606171302, 23.62434642180278], [91.706475050832083, 22.985263983649183], [91.158963250699713, 23.503526923104381], [91.467729933643668, 24.072639471934789], [91.915092807994398, 24.130413723237108], [92.376201613334786, 24.976692816664961], [91.799595981822065, 25.14743174895731], [90.872210727912105, 25.13260061288954], [89.920692580121838, 25.269749864192171], [89.832480910199592, 25.965082098895476], [89.355094028687276, 26.014407253518065], [88.56304935094974, 26.446525580342716], [88.209789259802477, 25.768065700782707], [88.931553989623069, 25.238692328384769], [88.30637251175601, 24.866079413344199], [88.084422235062405, 24.501657212821918], [88.699940220090895, 24.233714911388557], [88.529769728553759, 23.631141872649163], [88.876311883503064, 22.879146429937826], [89.031961297566198, 22.055708319582973], [88.888765903685396, 21.690588487224741], [88.208497348995209, 21.703171698487804], [86.975704380240259, 21.495561631755201], [87.033168572948853, 20.743307806882406], [86.499351027373777, 20.151638495356604], [85.060265740909671, 19.478578802971096], [83.941005893899998, 18.302009792549722], [83.189217156917834, 17.671221421778977], [82.192792189465905, 17.016636053937813], [82.191241896497175, 16.556664130107844], [81.692719354177456, 16.3102192245079], [80.791999139330116, 15.951972357644488], [80.324895867843864, 15.899184882058346], [80.025069207686428, 15.136414903214144], [80.23327355339039, 13.835770778859978], [80.286293572921849, 13.006260687710832], [79.862546828128487, 12.056215318240886], [79.85799930208681, 10.357275091997108], [79.340511509115984, 10.308854274939618], [78.885345493489169, 9.54613597252772], [79.189719679688281, 9.216543687370146], [78.27794070833049, 8.933046779816932], [77.94116539908434, 8.25295909263974], [77.539897902337927, 7.965534776232331], [76.592978957021657, 8.899276231314188], [76.130061476551063, 10.299630031775518], [75.746467319648488, 11.308250637248303], [75.396101108709573, 11.781245022015822], [74.864815708316812, 12.741935736537895], [74.616717156883524, 13.992582912649677], [74.443859490867197, 14.617221787977693], [73.534199253233368, 15.990652167214957], [73.119909295549419, 17.928570054592495], [72.820909458308634, 19.208233547436162], [72.824475132136783, 20.41950328214153], [72.630533481745388, 21.356009426351001], [71.175273471973938, 20.757441311114228], [70.470458611945091, 20.877330634031381], [69.164130080038817, 22.089298000572697], [69.644927606082391, 22.450774644454334], [69.349596795534325, 22.843179633062686], [68.176645135373377, 23.691965033456704], [68.842599318318761, 24.359133612560932], [71.0432401874682, 24.356523952730193], [70.844699334602822, 25.215102037043511], [70.282873162725579, 25.722228705339823], [70.168926629522005, 26.491871649678835], [69.514392938113119, 26.940965684511365], [70.61649620960192, 27.989196275335861], [71.777665643200308, 27.913180243434521], [72.823751662084689, 28.961591701772047], [73.450638462217412, 29.976413479119863], [74.421380242820263, 30.97981476493117], [74.405928989564998, 31.692639471965272], [75.258641798813187, 32.271105455040491], [74.451559279278698, 32.764899603805489], [74.104293654277328, 33.441473293586846], [73.749948358051952, 34.317698879527846], [74.240202671204955, 34.748887030571247], [75.757060988268321, 34.504922593721311], [76.871721632804011, 34.653544012992732], [77.837450799474553, 35.494009507787759]]] } }, + { "type": "Feature", "properties": { "admin": "Ireland", "name": "Ireland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-6.197884894220989, 53.86756500916335], [-6.032985398777609, 53.153164170944336], [-6.788856573910847, 52.260117906292322], [-8.561616583683557, 51.669301255899349], [-9.977085740590267, 51.820454820353071], [-9.16628251793078, 52.864628811242667], [-9.688524542672452, 53.881362616585285], [-8.327987433292007, 54.664518947968624], [-7.572167934591064, 55.131622219454854], [-7.366030646178785, 54.595840969452709], [-7.572167934591064, 54.059956366585986], [-6.953730231138065, 54.073702297575622], [-6.197884894220989, 53.86756500916335]]] } }, + { "type": "Feature", "properties": { "admin": "Iran", "name": "Iran", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[53.921597934795543, 37.198918361961255], [54.800303989486558, 37.392420762678178], [55.511578403551894, 37.964117133123153], [56.180374790273319, 37.935126654607423], [56.619366082592805, 38.121394354803478], [57.330433790928964, 38.029229437810933], [58.436154412678192, 37.522309475243794], [59.234761997316795, 37.412987982730336], [60.377637973883864, 36.52738312432836], [61.123070509694131, 36.491597194966239], [61.21081709172573, 35.650072333309218], [60.80319339380744, 34.404101874319856], [60.528429803311575, 33.676446031217999], [60.963700392505991, 33.528832302376252], [60.536077915290761, 32.981268825811561], [60.863654819588952, 32.182919623334421], [60.941944614511115, 31.548074652628745], [61.699314406180811, 31.379506130492661], [61.78122155136343, 30.735850328081231], [60.874248488208778, 29.829238999952604], [61.369308709564926, 29.303276272085917], [61.771868117118615, 28.699333807890792], [62.727830438085974, 28.259644883735383], [62.755425652929851, 27.378923448184985], [63.23389773952028, 27.217047024030702], [63.316631707619578, 26.756532497661659], [61.874187453056535, 26.239974880472097], [61.497362908784183, 25.078237006118492], [59.616134067630831, 25.380156561783775], [58.525761346272297, 25.609961656185725], [57.39725141788238, 25.739902045183634], [56.97076582217754, 26.966106268821356], [56.492138706290199, 27.14330475515019], [55.723710158110059, 26.964633490501036], [54.715089552637252, 26.480657863871507], [53.493096958231334, 26.812368882753042], [52.483597853409599, 27.580849107365488], [51.520762566947404, 27.865689602158291], [50.852948032439528, 28.814520575469377], [50.115008579311571, 30.14777252859971], [49.576850213423988, 29.9857152369324], [48.941333449098536, 30.31709035900403], [48.567971225789748, 29.926778265903515], [48.014568312376085, 30.452456773392594], [48.00469811380831, 30.985137437457237], [47.685286085812258, 30.984853217079621], [47.849203729042095, 31.709175930298663], [47.334661492711895, 32.469155381799105], [46.109361606639304, 33.017287299118998], [45.416690708199035, 33.967797756479577], [45.648459507028079, 34.748137722303007], [46.15178795755093, 35.093258775364284], [46.076340366404786, 35.67738332777548], [45.420618117053202, 35.977545884742817], [44.77267, 37.17045], [44.225755649600522, 37.971584377589345], [44.421402622257538, 38.281281236314534], [44.109225294782334, 39.428136298168091], [44.793989699081934, 39.713002631177041], [44.9526880226503, 39.335764675446363], [45.457721795438765, 38.874139105783051], [46.143623081248812, 38.74120148371221], [46.505719842317966, 38.770605373686287], [47.685079380083081, 39.508363959301207], [48.060095249225235, 39.582235419262453], [48.355529412637871, 39.2887649602769], [48.010744256386474, 38.794014797514514], [48.634375441284803, 38.27037750910096], [48.883249139202483, 38.32024526626261], [49.199612257693332, 37.582874253889877], [50.147771437384606, 37.37456655532133], [50.842354363819695, 36.872814235983384], [52.26402469260141, 36.700421657857696], [53.825789829326411, 36.965030829408228], [53.921597934795543, 37.198918361961255]]] } }, + { "type": "Feature", "properties": { "admin": "Iraq", "name": "Iraq", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[45.420618117053202, 35.977545884742817], [46.076340366404786, 35.67738332777548], [46.15178795755093, 35.093258775364284], [45.648459507028079, 34.748137722303007], [45.416690708199035, 33.967797756479577], [46.109361606639304, 33.017287299118998], [47.334661492711895, 32.469155381799105], [47.849203729042095, 31.709175930298663], [47.685286085812258, 30.984853217079621], [48.00469811380831, 30.985137437457237], [48.014568312376085, 30.452456773392594], [48.567971225789748, 29.926778265903515], [47.974519077349889, 29.975819200148493], [47.302622104690947, 30.059069932570711], [46.568713413281742, 29.099025173452283], [44.709498732284736, 29.178891099559376], [41.889980910007829, 31.190008653278362], [40.399994337736238, 31.889991766887931], [39.195468377444961, 32.16100881604266], [38.792340529136077, 33.378686428352218], [41.00615888851992, 34.419372260062111], [41.383965285005807, 35.628316555314349], [41.289707472505448, 36.358814602192261], [41.837064243340954, 36.605853786763568], [42.349591098811764, 37.22987254490409], [42.779125604021822, 37.385263576805741], [43.942258742047287, 37.256227525372942], [44.293451775902852, 37.001514390606289], [44.772699008977689, 37.170444647768427], [45.420618117053202, 35.977545884742817]]] } }, + { "type": "Feature", "properties": { "admin": "Iceland", "name": "Iceland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-14.508695441129232, 66.455892239031414], [-14.739637417041605, 65.808748277440287], [-13.609732224979807, 65.126671047619851], [-14.9098337467949, 64.36408193628867], [-17.794438035543418, 63.67874909123384], [-18.656245896874989, 63.496382961675806], [-19.972754685942757, 63.643634955491514], [-22.762971971110154, 63.960178941495371], [-21.778484259517676, 64.402115790455497], [-23.955043911219104, 64.891129869233481], [-22.184402635170354, 65.084968166760291], [-22.227423265053329, 65.378593655042721], [-24.326184047939332, 65.611189276788451], [-23.650514695723082, 66.262519029395207], [-22.134922451250883, 66.410468655046856], [-20.576283738679543, 65.732112128351417], [-19.056841600001587, 66.276600857194751], [-17.798623826559048, 65.993853257909763], [-16.167818976292121, 66.526792304135853], [-14.508695441129232, 66.455892239031414]]] } }, + { "type": "Feature", "properties": { "admin": "Israel", "name": "Israel", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.719918247222743, 32.709192409794859], [35.545665317534535, 32.393992011030569], [35.183930291491428, 32.532510687788935], [34.974640740709319, 31.866582343059715], [35.225891554512422, 31.754341132121759], [34.970506626125989, 31.616778469360803], [34.927408481594554, 31.35343537040141], [35.397560662586038, 31.489086005167572], [35.420918409981958, 31.100065822874349], [34.922602573391423, 29.501326198844517], [34.26543338393568, 31.219360866820146], [34.556371697738903, 31.548823960896989], [34.48810713068135, 31.605538845337314], [34.752587111151165, 32.07292633720116], [34.955417107896771, 32.827376410446369], [35.098457472480668, 33.080539252244257], [35.126052687324538, 33.090900376918775], [35.460709262846699, 33.089040025356276], [35.552796665190805, 33.264274807258012], [35.821100701650231, 33.277426459276292], [35.836396925608618, 32.868123277308506], [35.700797967274745, 32.716013698857374], [35.719918247222743, 32.709192409794859]]] } }, + { "type": "Feature", "properties": { "admin": "Italy", "name": "Italy", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[15.52037601081383, 38.231155096991465], [15.160242954171732, 37.444045518537813], [15.309897902089002, 37.134219468731793], [15.099988234119445, 36.61998729099539], [14.335228712632013, 36.996630967754747], [13.826732618879927, 37.104531358380186], [12.431003859108809, 37.612949937483812], [12.570943637755132, 38.126381130519682], [13.741156447004581, 38.03496552179535], [14.761249220446157, 38.143873602850498], [15.52037601081383, 38.231155096991465]]], [[[9.210011834356264, 41.209991360024212], [9.809975213264973, 40.500008856766094], [9.669518670295671, 39.177376410471787], [9.214817742559486, 39.240473334300127], [8.806935662479729, 38.906617743478471], [8.428302443077113, 39.171847032216611], [8.388253208050939, 40.378310858718798], [8.159998406617659, 40.950007229163774], [8.709990675500107, 40.899984442705225], [9.210011834356264, 41.209991360024212]]], [[[12.376485223040842, 46.767559109069872], [13.806475457421552, 46.50930613869118], [13.698109978905475, 46.016778062517368], [13.937630242578335, 45.59101593686465], [13.141606479554294, 45.736691799495411], [12.328581170306304, 45.38177806251484], [12.383874952858601, 44.885374253919075], [12.261453484759157, 44.600482082694008], [12.589237094786482, 44.091365871754462], [13.526905958722491, 43.587727362637899], [14.029820997787024, 42.761007798832473], [15.142569614327952, 41.955139675456891], [15.926191033601892, 41.961315009115729], [16.169897088290409, 41.740294908203417], [15.889345737377793, 41.541082261718195], [16.785001661860573, 41.179605617836579], [17.519168735431204, 40.877143459632229], [18.376687452882575, 40.355624904942651], [18.4802470231954, 40.168866278639818], [18.293385044028096, 39.810774441073235], [17.738380161213279, 40.277671006830289], [16.869595981522334, 40.442234605463838], [16.448743116937319, 39.795400702466473], [17.171489698971495, 39.424699815420716], [17.052840610429339, 38.902871202137291], [16.635088331781841, 38.843572496082395], [16.100960727613053, 37.985898749334176], [15.684086948314498, 37.908849188787023], [15.687962680736318, 38.214592800441849], [15.891981235424705, 38.750942491199218], [16.109332309644312, 38.964547024077682], [15.718813510814638, 39.544072374014938], [15.413612501698818, 40.048356838535163], [14.998495721098234, 40.172948716790913], [14.703268263414767, 40.604550279292617], [14.06067182786526, 40.786347968095434], [13.627985060285393, 41.188287258461649], [12.888081902730418, 41.253089504555604], [12.106682570044907, 41.7045348170574], [11.191906365614184, 42.355425319989671], [10.511947869517794, 42.93146251074721], [10.200028924204046, 43.920006822274608], [9.702488234097812, 44.036278794931313], [8.888946160526869, 44.366336167979533], [8.428560825238575, 44.23122813575241], [7.8507666357832, 43.767147935555236], [7.435184767291841, 43.693844916349164], [7.549596388386161, 44.127901109384808], [7.007562290076661, 44.254766750661382], [6.749955275101711, 45.028517971367584], [7.096652459347835, 45.333098863295859], [6.80235517744566, 45.708579820328673], [6.84359297041456, 45.991146552100659], [7.273850945676683, 45.776947740250748], [7.755992058959832, 45.824490057959267], [8.316629672894377, 46.16364248309084], [8.489952426801294, 46.005150865251736], [8.966305779667833, 46.03693187111115], [9.18288170740311, 46.440214748716976], [9.92283654139035, 46.314899400409182], [10.363378126678665, 46.48357127540983], [10.4427014502466, 46.893546250997431], [11.048555942436504, 46.751358547546396], [11.164827915093325, 46.941579494812729], [12.153088006243079, 47.115393174826423], [12.376485223040842, 46.767559109069872]]]] } }, + { "type": "Feature", "properties": { "admin": "Jamaica", "name": "Jamaica", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-77.569600796199197, 18.490525417550483], [-76.896618618462114, 18.400866807524078], [-76.365359056285527, 18.16070058844759], [-76.19965857614163, 17.886867173732963], [-76.902561408175671, 17.868237819891743], [-77.206341315403449, 17.701116237859818], [-77.766022915340599, 17.861597398342237], [-78.337719285785596, 18.225967922432226], [-78.217726610003865, 18.454532782459193], [-77.797364671525614, 18.524218451404774], [-77.569600796199197, 18.490525417550483]]] } }, + { "type": "Feature", "properties": { "admin": "Jordan", "name": "Jordan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.545665317534535, 32.393992011030569], [35.719918247222743, 32.709192409794859], [36.834062127435537, 32.312937526980768], [38.792340529136077, 33.378686428352218], [39.195468377444961, 32.16100881604266], [39.004885695152545, 32.010216986614971], [37.002165561681004, 31.508412990844736], [37.998848911294367, 30.508499864213128], [37.668119744626374, 30.338665269485894], [37.503581984209028, 30.003776150018396], [36.740527784987243, 29.865283311476183], [36.501214227043583, 29.505253607698702], [36.068940870922049, 29.19749461518445], [34.956037225084252, 29.356554673778835], [34.922602573391423, 29.501326198844517], [35.420918409981958, 31.100065822874349], [35.397560662586038, 31.489086005167572], [35.545251906076196, 31.782504787720832], [35.545665317534535, 32.393992011030569]]] } }, + { "type": "Feature", "properties": { "admin": "Japan", "name": "Japan", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[134.638428176003856, 34.149233710256418], [134.766379022358478, 33.806334743783673], [134.20341596897083, 33.201177883429622], [133.792950067276479, 33.521985175097583], [133.280268182508848, 33.289570420864941], [133.014858026257855, 32.704567369104772], [132.363114862192674, 32.989382025681373], [132.371176385630179, 33.463642483040068], [132.924372593314786, 34.060298570282036], [133.492968377822194, 33.944620876596694], [133.904106073136347, 34.364931138642611], [134.638428176003856, 34.149233710256418]]], [[[140.976387567305267, 37.142074286440156], [140.599769728762084, 36.343983466124534], [140.774074334882641, 35.842877102190229], [140.253279250245072, 35.138113918593653], [138.975527785396196, 34.667600002576101], [137.217598911691198, 34.606285915661843], [135.792983026268871, 33.46480520276662], [135.120982700745401, 33.849071153289053], [135.07943484918269, 34.596544908174813], [133.340316196831964, 34.375938218720755], [132.156770868051296, 33.904933376596503], [130.986144647343451, 33.885761420216276], [132.000036248910021, 33.149992377244608], [131.33279015515734, 31.450354519164836], [130.68631798718593, 31.029579169228235], [130.202419875204953, 31.418237616495411], [130.447676222862128, 32.319474595665717], [129.81469160371887, 32.610309556604385], [129.408463169472554, 33.296055813117583], [130.353935174684636, 33.604150702441693], [130.878450962447118, 34.232742824840031], [131.884229364143891, 34.749713853487911], [132.617672967662486, 35.433393052709413], [134.608300815977771, 35.731617743465812], [135.677537876528902, 35.527134100886819], [136.723830601142424, 37.304984239240376], [137.390611607004473, 36.827390651998819], [138.857602166906247, 37.827484646143454], [139.426404657142882, 38.215962225897634], [140.054790073812057, 39.438807481436378], [139.883379347899847, 40.563312486323682], [140.305782505453664, 41.195005194659551], [141.368973423426667, 41.378559882160282], [141.914263136970476, 39.991616115878678], [141.884600864834965, 39.18086456965149], [140.959489373945729, 38.174000962876583], [140.976387567305267, 37.142074286440156]]], [[[143.910161981379474, 44.174099839853724], [144.613426548439634, 43.960882880217511], [145.320825230083074, 44.384732977875437], [145.543137241802754, 43.262088324550596], [144.059661899999867, 42.988358262700551], [143.183849725517291, 41.995214748699183], [141.611490920172457, 42.678790595056071], [141.067286411706618, 41.58459381770799], [139.95510623592105, 41.56955597591103], [139.817543573159924, 42.563758856774392], [140.312087030193169, 43.333272610032644], [141.380548944259999, 43.388824774746489], [141.671952345953912, 44.772125352551477], [141.967644891527982, 45.551483466161343], [143.142870314709796, 44.510358384776957], [143.910161981379474, 44.174099839853724]]]] } }, + { "type": "Feature", "properties": { "admin": "Kazakhstan", "name": "Kazakhstan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[70.962314894499272, 42.26615428320553], [70.388964878220776, 42.081307684897517], [69.070027296835221, 41.384244289712335], [68.632482944620037, 40.668680731766855], [68.259895867795635, 40.662324530594894], [67.985855747351806, 41.135990708982199], [66.714047072216587, 41.168443508461557], [66.510648634715707, 41.987644151368549], [66.023391554635609, 41.994646307944031], [66.098012322865188, 42.997660020513074], [64.90082441595932, 43.728080552742647], [63.18578698105658, 43.650074978197999], [62.013300408786264, 43.504476630215649], [61.05831994003249, 44.405816962250576], [60.239971958258472, 44.784036770194739], [58.689989048095796, 45.500013739598721], [58.503127068928428, 45.58680430763296], [55.928917270741167, 44.995858466159163], [55.968191359283011, 41.30864166926937], [55.455251092353805, 41.259859117185826], [54.755345493392653, 42.04397146256661], [54.079417759014959, 42.324109402020831], [52.944293247291725, 42.116034247397572], [52.502459751196277, 41.783315538086462], [52.446339145727208, 42.027150783855561], [52.692112257707251, 42.443895372073364], [52.501426222550315, 42.792297878585188], [51.342427199108201, 43.132974758469338], [50.891291945200223, 44.031033637053774], [50.339129266161358, 44.284015611338468], [50.305642938036257, 44.609835516938908], [51.278503452363211, 44.514854234386448], [51.316899041556034, 45.245998236667894], [52.167389764215713, 45.408391425145098], [53.040876499245194, 45.259046535821753], [53.220865512917712, 46.23464590105992], [53.042736850807771, 46.853006089864486], [52.042022739475598, 46.804636949239232], [51.191945428274252, 47.048704738953909], [50.034083286342465, 46.608989976582208], [49.10116, 46.39933000000012], [48.593241001180495, 46.561034247415471], [48.694733514201729, 47.075628160177921], [48.057253045449258, 47.743752753279516], [47.315231154170242, 47.715847479841948], [46.466445753776256, 48.394152330104923], [47.043671502476506, 49.1520388860976], [46.751596307162728, 49.35600576435376], [47.549480421749301, 50.454698391311119], [48.577841424357523, 49.874759629915658], [48.702381626181008, 50.605128485712825], [50.766648390512145, 51.692762356159889], [52.328723585830957, 51.71865224873811], [54.53287845237621, 51.026239732459302], [55.716940545479801, 50.62171662047853], [56.777961053296551, 51.043551337277037], [58.363290643146733, 51.063653469438563], [59.642282342370599, 50.545442206415707], [59.932807244715484, 50.842194118851857], [61.337424350840919, 50.799070136104248], [61.588003371024158, 51.2726587998432], [59.967533807215531, 51.960420437215696], [60.927268507740258, 52.447548326215028], [60.739993117114572, 52.719986477257734], [61.699986199800584, 52.979996446334255], [60.978066440683151, 53.664993394579128], [61.436591424409052, 54.006264553434775], [65.178533563095911, 54.354227810272093], [65.66687584825398, 54.601266994843449], [68.169100376258811, 54.970391750704309], [69.068166945272864, 55.385250149143516], [70.865266554655122, 55.169733588270091], [71.180131056609397, 54.133285224008247], [72.224150018202167, 54.376655381886728], [73.508516066384388, 54.035616766976588], [73.425678745420427, 53.489810289109741], [74.384845005190044, 53.546861070360066], [76.891100294913414, 54.490524400441913], [76.525179477854735, 54.177003485727127], [77.800915561844221, 53.404414984747561], [80.035559523441663, 50.864750881547238], [80.568446893235475, 51.388336493528456], [81.945985548839914, 50.812195949906354], [83.383003778012366, 51.069182847693909], [83.935114780618832, 50.889245510453563], [84.416377394553052, 50.311399644565817], [85.115559523462011, 50.117302964877631], [85.541269972682457, 49.69285858824815], [86.829356723989619, 49.826674709668154], [87.359970330762664, 49.214980780629148], [86.598776483103379, 48.549181626980605], [85.768232863308285, 48.455750637396974], [85.72048383987071, 47.452969468773112], [85.164290399113355, 47.000955715516099], [83.180483839860443, 47.330031236350848], [82.458925815769106, 45.539649563166499], [81.947070753918112, 45.317027492853235], [79.966106398441397, 44.917516994804643], [80.866206496101356, 43.180362046881037], [80.180150180994289, 42.920067857426936], [80.259990268885332, 42.349999294599101], [79.643645460940135, 42.496682847659649], [79.142177361979776, 42.856092434249589], [77.658391961583206, 42.960685533208327], [76.000353631498555, 42.988022365890622], [75.636964959622091, 42.877899888676765], [74.212865838522575, 43.298339341803505], [73.645303582660901, 43.091271877609863], [73.489757521462337, 42.500894476891276], [71.844638299450637, 42.845395412765178], [71.186280552052253, 42.704292914392219], [70.962314894499272, 42.26615428320553]]] } }, + { "type": "Feature", "properties": { "admin": "Kenya", "name": "Kenya", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[40.993, -0.85829], [41.58513, -1.68325], [40.88477, -2.08255], [40.63785, -2.49979], [40.26304, -2.57309], [40.12119, -3.27768], [39.80006, -3.68116], [39.60489, -4.34653], [39.20222, -4.67677], [37.7669, -3.67712], [37.69869, -3.09699], [34.07262, -1.05982], [33.903711197104521, -0.95], [33.893568969666937, 0.109813537861896], [34.18, 0.515], [34.6721, 1.17694], [35.03599, 1.90584], [34.59607, 3.05374], [34.47913, 3.5556], [34.005, 4.249884947362047], [34.620196267853871, 4.847122742081987], [35.298007118232974, 5.506], [35.817447662353501, 5.338232082790795], [35.817447662353501, 4.776965663461889], [36.159078632855639, 4.447864127672768], [36.855093238008116, 4.447864127672768], [38.120915, 3.598605], [38.43697, 3.58851], [38.67114, 3.61607], [38.89251, 3.50074], [39.559384258765846, 3.42206], [39.85494, 3.83879], [40.76848, 4.25702], [41.1718, 3.91909], [41.855083092643966, 3.918911920483726], [40.98105, 2.78452], [40.993, -0.85829]]] } }, + { "type": "Feature", "properties": { "admin": "Kyrgyzstan", "name": "Kyrgyzstan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[70.96231489449913, 42.266154283205481], [71.186280552052111, 42.704292914392127], [71.84463829945058, 42.845395412765093], [73.489757521462337, 42.500894476891311], [73.645303582660901, 43.09127187760982], [74.212865838522546, 43.298339341803363], [75.636964959622006, 42.877899888676673], [76.000353631498442, 42.988022365890664], [77.658391961583206, 42.960685533208256], [79.142177361979762, 42.856092434249511], [79.643645460940107, 42.496682847659514], [80.259990268885289, 42.349999294599044], [80.119430373051358, 42.123940741538235], [78.543660923175295, 41.582242540038685], [78.187196893225959, 41.185315863604792], [76.904484490877067, 41.066485907549634], [76.526368035797432, 40.427946071935111], [75.467827996730691, 40.562072251948663], [74.776862420556043, 40.366425279291619], [73.822243686828287, 39.893973497063179], [73.960013055318413, 39.660008449861721], [73.67537926625478, 39.431236884105594], [71.784693637991992, 39.279463202464363], [70.549161818325601, 39.604197902986492], [69.464886915977516, 39.526683254548693], [69.559609816368507, 40.103211371412968], [70.648018833299957, 39.935753892571157], [71.014198032520156, 40.244365546218226], [71.774875115856545, 40.145844428053763], [73.055417108049156, 40.86603302668945], [71.870114780570447, 41.392900092121259], [71.157858514291576, 41.143587144529107], [70.420022414028196, 41.519998277343134], [71.259247674448218, 42.167710679689456], [70.96231489449913, 42.266154283205481]]] } }, + { "type": "Feature", "properties": { "admin": "Cambodia", "name": "Cambodia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[103.497279901139677, 10.632555446815926], [103.090689731867229, 11.153660590047162], [102.58493248902667, 12.186594956913279], [102.348099399833004, 13.39424734135822], [102.988422072361601, 14.225721136934464], [104.281418084736586, 14.416743068901363], [105.218776890078871, 14.27321177821069], [106.04394616091551, 13.881091009979952], [106.496373325630856, 14.57058380783428], [107.382727492301058, 14.202440904186968], [107.614547967562402, 13.535530707244202], [107.491403029410861, 12.337205918827944], [105.810523716253101, 11.567614650921225], [106.249670037869436, 10.961811835163585], [105.199914992292321, 10.889309800658094], [104.334334751403446, 10.486543687375228], [103.497279901139677, 10.632555446815926]]] } }, + { "type": "Feature", "properties": { "admin": "South Korea", "name": "Korea", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[128.349716424676586, 38.612242946927843], [129.212919549680038, 37.432392483055942], [129.460449660358137, 36.784189154602821], [129.468304478066472, 35.632140611303939], [129.091376580929563, 35.08248423923142], [128.18585045787907, 34.890377102186385], [127.386519403188373, 34.475673733044111], [126.485747511908713, 34.390045884736473], [126.3739197124291, 34.934560451795939], [126.559231398627773, 35.684540513647896], [126.117397902532261, 36.725484727519252], [126.860143263863364, 36.893924058574612], [126.174758742376213, 37.749685777328033], [126.237338901881742, 37.840377916000271], [126.683719924018888, 37.804772854151174], [127.073308547067342, 38.256114813788393], [127.780035435090966, 38.304535630845884], [128.205745884311426, 38.370397243801882], [128.349716424676586, 38.612242946927843]]] } }, + { "type": "Feature", "properties": { "admin": "Kosovo", "name": "Kosovo", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.76216, 42.05186], [20.717310000000108, 41.84711], [20.59023, 41.85541], [20.52295, 42.21787], [20.28374, 42.32025], [20.0707, 42.58863], [20.25758, 42.81275], [20.49679, 42.88469], [20.63508, 43.21671], [20.81448, 43.27205], [20.95651, 43.13094], [21.143395, 43.068685000000123], [21.27421, 42.90959], [21.43866, 42.86255], [21.63302, 42.67717], [21.77505, 42.6827], [21.66292, 42.43922], [21.54332, 42.32025], [21.576635989402117, 42.245224397061847], [21.352700000000134, 42.2068], [20.76216, 42.05186]]] } }, + { "type": "Feature", "properties": { "admin": "Kuwait", "name": "Kuwait", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[47.974519077349889, 29.975819200148493], [48.183188510944483, 29.534476630159759], [48.09394331237641, 29.306299343374999], [48.416094191283939, 28.552004299426663], [47.708850538937376, 28.526062730416136], [47.459821811722819, 29.002519436147217], [46.568713413281742, 29.099025173452283], [47.302622104690947, 30.059069932570711], [47.974519077349889, 29.975819200148493]]] } }, + { "type": "Feature", "properties": { "admin": "Laos", "name": "Lao PDR", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[105.218776890078871, 14.27321177821069], [105.544338413517664, 14.723933620660414], [105.589038527450128, 15.570316066952856], [104.779320509868768, 16.441864935771445], [104.716947056092465, 17.428858954330078], [103.956476678485288, 18.240954087796872], [103.200192091893726, 18.309632066312769], [102.998705682387694, 17.961694647691598], [102.413004998791592, 17.932781683824281], [102.113591750092453, 18.109101670804161], [101.059547560635139, 17.512497259994486], [101.035931431077742, 18.408928330961611], [101.282014601651667, 19.462584947176762], [100.606293573003128, 19.508344427971217], [100.548881056726856, 20.109237982661124], [100.115987583417819, 20.41784963630818], [100.329101190189519, 20.786121731036229], [101.180005324307515, 21.436572984294024], [101.270025669359939, 21.201651923095177], [101.803119744882906, 21.174366766845065], [101.652017856861491, 22.318198757409544], [102.170435825613552, 22.464753119389297], [102.754896274834636, 21.675137233969462], [103.203861118586431, 20.766562201413745], [104.435000441508024, 20.758733221921528], [104.822573683697073, 19.886641750563879], [104.183387892678908, 19.624668077060214], [103.896532017026701, 19.265180975821799], [105.094598423281496, 18.666974595611073], [105.925762160264, 17.485315456608955], [106.55600792849566, 16.604283962464802], [107.312705926545576, 15.908538316303177], [107.564525181103875, 15.202173163305554], [107.382727492301058, 14.202440904186968], [106.496373325630856, 14.57058380783428], [106.04394616091551, 13.881091009979952], [105.218776890078871, 14.27321177821069]]] } }, + { "type": "Feature", "properties": { "admin": "Lebanon", "name": "Lebanon", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.821100701650231, 33.277426459276292], [35.552796665190805, 33.264274807258012], [35.460709262846699, 33.089040025356276], [35.126052687324538, 33.090900376918775], [35.48220665868012, 33.905450140919434], [35.979592319489392, 34.610058295219126], [35.998402540843628, 34.644914048799997], [36.448194207512095, 34.59393524834406], [36.611750115715886, 34.201788641897174], [36.066460402172048, 33.824912421192543], [35.821100701650231, 33.277426459276292]]] } }, + { "type": "Feature", "properties": { "admin": "Liberia", "name": "Liberia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-7.712159389669749, 4.364565944837721], [-7.974107224957249, 4.355755113131961], [-9.004793667018673, 4.832418524592199], [-9.913420376006682, 5.593560695819205], [-10.765383876986643, 6.140710760925556], [-11.438779466182053, 6.785916856305746], [-11.199801805048278, 7.105845648624735], [-11.14670427086838, 7.396706447779534], [-10.695594855176477, 7.939464016141085], [-10.230093553091276, 8.406205552601291], [-10.016566534861253, 8.42850393313523], [-9.755342169625832, 8.541055202666923], [-9.33727983238458, 7.928534450711351], [-9.403348151069748, 7.526905218938906], [-9.208786383490844, 7.313920803247952], [-8.926064622422002, 7.309037380396375], [-8.722123582382123, 7.711674302598509], [-8.439298468448696, 7.686042792181736], [-8.485445522485348, 7.395207831243068], [-8.385451626000572, 6.911800645368742], [-8.602880214868618, 6.467564195171659], [-8.311347622094017, 6.193033148621081], [-7.993692592795879, 6.126189683451541], [-7.570152553731686, 5.707352199725903], [-7.53971513511176, 5.313345241716517], [-7.63536821128403, 5.188159084489455], [-7.712159389669749, 4.364565944837721]]] } }, + { "type": "Feature", "properties": { "admin": "Libya", "name": "Libya", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[14.8513, 22.862950000000119], [14.143870883855239, 22.491288967371126], [13.581424594790459, 23.040506089769274], [11.999505649471697, 23.471668402596432], [11.560669386449032, 24.09790924732561], [10.771363559622952, 24.562532050061741], [10.303846876678445, 24.379313259370967], [9.948261346078024, 24.936953640232613], [9.910692579801774, 25.365454616796789], [9.319410841518218, 26.094324856057476], [9.716285841519662, 26.512206325785652], [9.629056023811073, 27.140953477481041], [9.756128370816779, 27.688258571884198], [9.68388471847288, 28.144173895779311], [9.859997999723472, 28.959989732371064], [9.805634392952353, 29.424638373323369], [9.482139926805415, 30.307556057246181], [9.970017124072966, 30.539324856075375], [10.056575148161697, 30.961831366493517], [9.950225050505194, 31.376069647745275], [10.636901482799484, 31.761420803345679], [10.944789666394511, 32.081814683555358], [11.43225345220378, 32.368903103152824], [11.488787469131008, 33.136995754523234], [12.66331, 32.79278], [13.08326, 32.87882], [13.91868, 32.71196], [15.24563, 32.26508], [15.71394, 31.37626], [16.61162, 31.18218], [18.02109, 30.76357], [19.08641, 30.26639], [19.57404, 30.52582], [20.05335, 30.98576], [19.82033, 31.751790000000135], [20.13397, 32.2382], [20.85452, 32.7068], [21.54298, 32.8432], [22.89576, 32.63858], [23.2368, 32.19149], [23.6091300000001, 32.18726], [23.9275, 32.01667], [24.92114, 31.89936], [25.16482, 31.56915], [24.80287, 31.08929], [24.95762, 30.6616], [24.70007, 30.04419], [25.00000000000011, 29.238654529533552], [25.00000000000011, 25.682499996360995], [25.00000000000011, 22.0], [25.00000000000011, 20.00304], [23.850000000000129, 20.0], [23.837660000000135, 19.580470000000101], [19.84926, 21.49509], [15.86085, 23.40972], [14.8513, 22.862950000000119]]] } }, + { "type": "Feature", "properties": { "admin": "Sri Lanka", "name": "Sri Lanka", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[81.787959018891371, 7.523055324733162], [81.637322218760573, 6.481775214051921], [81.218019647144317, 6.197141424988287], [80.348356968104397, 5.968369859232154], [79.872468703128519, 6.763463446474928], [79.6951668639351, 8.200843410673384], [80.147800734379629, 9.824077663609554], [80.838817986986541, 9.268426825391186], [81.304319289071756, 8.564206244333688], [81.787959018891371, 7.523055324733162]]] } }, + { "type": "Feature", "properties": { "admin": "Lesotho", "name": "Lesotho", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[28.978262566857236, -28.955596612261708], [29.325166456832587, -29.257386976846245], [29.018415154748016, -29.743765557577362], [28.848399692507734, -30.070050551068245], [28.291069370239903, -30.226216729454293], [28.107204624145421, -30.545732110314944], [27.749397006956478, -30.645105889612214], [26.999261915807629, -29.875953871379977], [27.532511020627471, -29.242710870075353], [28.07433841320778, -28.851468601193581], [28.541700066855491, -28.647501722937562], [28.978262566857236, -28.955596612261708]]] } }, + { "type": "Feature", "properties": { "admin": "Lithuania", "name": "Lithuania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.731098667092649, 54.327536932993311], [22.651051873472536, 54.582740993866729], [22.757763706155256, 54.856574408581366], [22.31572350433057, 55.01529857036585], [21.26844892750346, 55.190481675835301], [21.05580040862241, 56.031076361711051], [22.201156853939491, 56.337801825579483], [23.878263787539957, 56.273671373105259], [24.860684441840753, 56.372528388079616], [25.000934279080887, 56.164530748104831], [25.533046502390327, 56.100296942766029], [26.494331495883749, 55.61510691997762], [26.588279249790386, 55.167175604871659], [25.768432651479792, 54.846962592175082], [25.536353794056989, 54.282423407602515], [24.45068362803703, 53.905702216194747], [23.484127638449841, 53.912497667041123], [23.243987257589506, 54.220566718149129], [22.731098667092649, 54.327536932993311]]] } }, + { "type": "Feature", "properties": { "admin": "Luxembourg", "name": "Luxembourg", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[6.043073357781109, 50.128051662794221], [6.242751092156992, 49.90222565367872], [6.186320428094176, 49.4638028021145], [5.897759230176403, 49.442667141307012], [5.674051954784828, 49.52948354755749], [5.782417433300905, 50.090327867221205], [6.043073357781109, 50.128051662794221]]] } }, + { "type": "Feature", "properties": { "admin": "Latvia", "name": "Latvia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[21.05580040862241, 56.031076361711051], [21.090423618257965, 56.783872789122924], [21.581866489353668, 57.411870632549913], [22.524341261492872, 57.753374335350756], [23.31845299652209, 57.006236477274854], [24.120729607853423, 57.025692654032753], [24.312862583114615, 57.793423570376966], [25.164593540149262, 57.970156968815175], [25.602809685984365, 57.847528794986559], [26.46353234223778, 57.476388658266316], [27.288184848751509, 57.474528306703817], [27.770015903440925, 57.244258124411218], [27.855282016722519, 56.759326483784278], [28.17670942557799, 56.169129950578807], [27.102459751094525, 55.783313707087672], [26.494331495883749, 55.61510691997762], [25.533046502390327, 56.100296942766029], [25.000934279080887, 56.164530748104831], [24.860684441840753, 56.372528388079616], [23.878263787539957, 56.273671373105259], [22.201156853939491, 56.337801825579483], [21.05580040862241, 56.031076361711051]]] } }, + { "type": "Feature", "properties": { "admin": "Morocco", "name": "Morocco", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-5.193863491222031, 35.755182196590845], [-4.591006232105143, 35.330711981745644], [-3.640056525070007, 35.39985504815197], [-2.604305792644111, 35.17909332940112], [-2.169913702798624, 35.168396307916694], [-1.792985805661658, 34.527918606091298], [-1.73345455566141, 33.919712836232115], [-1.388049282222596, 32.864015000941372], [-1.124551153966195, 32.651521511357195], [-1.30789913573787, 32.262888902306024], [-2.616604783529567, 32.094346218386157], [-3.068980271812648, 31.724497992473285], [-3.647497931320145, 31.637294012980814], [-3.690441046554666, 30.896951605751152], [-4.859646165374442, 30.501187649043874], [-5.242129278982786, 30.00044302013557], [-6.060632290053745, 29.731699734001801], [-7.059227667661899, 29.57922842052465], [-8.67411617678283, 28.841288967396643], [-8.665589565454836, 27.656425889592462], [-8.817809007940523, 27.656425889592462], [-8.817828334986642, 27.656425889592462], [-8.794883999049032, 27.120696316022553], [-9.413037482124507, 27.088476060488539], [-9.735343390328749, 26.860944729107409], [-10.189424200877452, 26.860944729107409], [-10.551262579785258, 26.990807603456879], [-11.392554897496948, 26.883423977154386], [-11.718219773800339, 26.104091701760801], [-12.030758836301654, 26.030866197203121], [-12.500962693725368, 24.770116278578136], [-13.891110398809044, 23.691009019459383], [-14.22116777185715, 22.310163072188338], [-14.630832688850942, 21.860939846274867], [-14.750954555713404, 21.500600083903802], [-17.002961798561071, 21.42073415779668], [-17.020428432675768, 21.422310288981631], [-16.973247849993182, 21.88574453377495], [-16.589136928767626, 22.158234361250091], [-16.26192175949566, 22.679339504481273], [-16.326413946995896, 23.017768459560894], [-15.982610642958059, 23.723358466074096], [-15.426003790742183, 24.359133612561035], [-15.089331834360729, 24.520260728446964], [-14.824645148161689, 25.103532619725307], [-14.800925665739666, 25.636264960222285], [-14.439939947964827, 26.254418443297645], [-13.773804897506462, 26.618892320252279], [-13.13994177901429, 27.640147813420491], [-13.121613369914709, 27.654147671719805], [-12.61883663578311, 28.038185533148656], [-11.688919236690761, 28.148643907172577], [-10.9009569971044, 28.832142238880913], [-10.39959225100864, 29.09858592377778], [-9.564811163765624, 29.933573716749855], [-9.814718390329174, 31.177735500609053], [-9.434793260119362, 32.038096421836478], [-9.300692918321827, 32.564679266890629], [-8.657476365585039, 33.24024526624239], [-7.654178432638217, 33.697064927702506], [-6.912544114601358, 34.11047638603744], [-6.24434200685141, 35.145865383437517], [-5.929994269219832, 35.759988104793983], [-5.193863491222031, 35.755182196590845]]] } }, + { "type": "Feature", "properties": { "admin": "Moldova", "name": "Moldova", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[26.619336785597788, 48.220726223333457], [26.857823520624798, 48.368210761094488], [27.52253746919515, 48.467119452501102], [28.259546746541837, 48.155562242213406], [28.670891147585163, 48.118148505234089], [29.122698195113024, 47.849095160506458], [29.050867954227321, 47.510226955752493], [29.415135125452732, 47.346645209332571], [29.559674106573105, 46.928582872091312], [29.908851759569295, 46.67436066343145], [29.838210076626289, 46.525325832701675], [30.024658644335364, 46.423936672545032], [29.759971958136383, 46.349987697935354], [29.170653924279879, 46.379262396828693], [29.072106967899288, 46.517677720722482], [28.862972446414055, 46.437889309263824], [28.933717482221621, 46.258830471372491], [28.659987420371575, 45.939986884131628], [28.48526940279276, 45.596907050145887], [28.233553501099035, 45.488283189468369], [28.054442986775392, 45.944586086605618], [28.160017937947707, 46.371562608417207], [28.128030226359037, 46.81047638608824], [27.551166212684841, 47.405117092470817], [27.233872918412736, 47.826770941756365], [26.924176059687561, 48.123264472030982], [26.619336785597788, 48.220726223333457]]] } }, + { "type": "Feature", "properties": { "admin": "Madagascar", "name": "Madagascar", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[49.543518914595737, -12.469832858940553], [49.80898074727908, -12.895284925999551], [50.05651085795715, -13.555761407121981], [50.217431268114055, -14.758788750876795], [50.476536899625515, -15.226512139550541], [50.377111443895942, -15.706069431219122], [50.200274692593169, -16.000263360256763], [49.860605503138665, -15.414252618066913], [49.672606642460849, -15.710203545802477], [49.863344354050142, -16.451036879138773], [49.774564243372694, -16.875042006093597], [49.49861209493411, -17.10603565843827], [49.435618523970298, -17.953064060134363], [49.04179243347393, -19.118781019774442], [48.548540887247995, -20.496888116134119], [47.930749139198653, -22.391501153251077], [47.547723423051295, -23.781958916928513], [47.095761346226588, -24.941629733990446], [46.282477654817079, -25.178462823184102], [45.409507684110444, -25.601434421493082], [44.833573846217547, -25.346101169538933], [44.039720493349755, -24.9883452287823], [43.763768344911156, -24.460677178649988], [43.697777540874441, -23.574116306250595], [43.345654331237611, -22.77690398528387], [43.254187046080986, -22.057413018484116], [43.433297560404633, -21.336475111580185], [43.893682895692919, -21.163307386970121], [43.89637007017209, -20.830459486578167], [44.374325392439644, -20.072366224856385], [44.464397413924374, -19.435454196859045], [44.23242190936616, -18.961994724200899], [44.042976108584149, -18.331387220943167], [43.963084344260899, -17.409944756746778], [44.312468702986273, -16.850495700754951], [44.446517368351387, -16.216219170804504], [44.944936557806521, -16.179373874580396], [45.502731967964976, -15.974373467678538], [45.872993605336255, -15.793454278224681], [46.312243279817203, -15.780018405828795], [46.882182651564271, -15.210182386946309], [47.70512983581235, -14.594302666891762], [48.005214878131241, -14.091232598530372], [47.869047479042152, -13.663868503476582], [48.29382775248137, -13.784067884987483], [48.845060255738773, -13.08917489995866], [48.863508742066976, -12.487867933810417], [49.194651320193302, -12.040556735891967], [49.543518914595737, -12.469832858940553]]] } }, + { "type": "Feature", "properties": { "admin": "Mexico", "name": "Mexico", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-97.140008307670684, 25.869997463478395], [-97.528072475966539, 24.992144069920297], [-97.702945522842214, 24.272343044526728], [-97.776041836319024, 22.932579860927653], [-97.872366706111094, 22.444211737553356], [-97.699043952204164, 21.898689480064256], [-97.388959520236739, 21.411018988525818], [-97.189333462293277, 20.635433254473124], [-96.525575527720306, 19.890930894444061], [-96.292127244841737, 19.32037140550954], [-95.90088497595994, 18.828024196848727], [-94.8390634834427, 18.562717393462204], [-94.425729539756205, 18.144370835843343], [-93.548651292682365, 18.423836981677933], [-92.786113857783477, 18.524838568592255], [-92.037348192090391, 18.704569200103432], [-91.407903408559235, 18.876083278880227], [-90.771869879910852, 19.284120388256778], [-90.533589850613026, 19.867418117751292], [-90.451475999701231, 20.707521877520428], [-90.278618333684889, 20.999855454995547], [-89.601321173851474, 21.261725775634485], [-88.543866339862845, 21.493675441976613], [-87.658416510757704, 21.458845526611977], [-87.051890224948053, 21.543543199138295], [-86.811982388032931, 21.331514797444747], [-86.845907965832595, 20.849864610268348], [-87.383291185235848, 20.255404771398727], [-87.621054450210721, 19.646553046135917], [-87.436750454441764, 19.472403469312265], [-87.586560431655911, 19.040130113190738], [-87.837191128271485, 18.259815985583426], [-88.090664028663156, 18.516647854074048], [-88.300031094093626, 18.499982204659997], [-88.490122850279278, 18.486830552641717], [-88.84834387892657, 17.883198147040329], [-89.029857347351737, 18.001511338772556], [-89.150909389995462, 17.955467637600403], [-89.143080410503316, 17.808318996649401], [-90.067933519230891, 17.819326076727517], [-91.001519945015943, 17.817594916245692], [-91.002269253284155, 17.254657701074272], [-91.453921271515114, 17.252177232324183], [-91.08167009150057, 16.918476670799517], [-90.711821865587623, 16.687483018454767], [-90.600846727240921, 16.470777899638787], [-90.438866950221993, 16.410109768128105], [-90.464472622422633, 16.069562079324722], [-91.747960171255926, 16.066564846251762], [-92.229248623406278, 15.251446641495871], [-92.087215949252013, 15.06458466232851], [-92.203229539747255, 14.830102850804108], [-92.227750006869812, 14.538828640190953], [-93.359463874061746, 15.61542959234367], [-93.875168830118511, 15.94016429286591], [-94.691656460330108, 16.20097524664288], [-95.250227016973014, 16.128318182840641], [-96.053382127653293, 15.752087917539592], [-96.557434048228274, 15.653515122942787], [-97.263592495496624, 15.917064927631312], [-98.013029954809596, 16.107311713113912], [-98.947675747456486, 16.566043402568763], [-99.697397427147024, 16.706164048728166], [-100.829498867581293, 17.171071071842047], [-101.666088629954444, 17.649026394109622], [-101.918528001700196, 17.916090196193974], [-102.478132086988907, 17.975750637275095], [-103.500989549558057, 18.292294623278845], [-103.917527432046811, 18.748571682200005], [-104.992009650475467, 19.316133938061679], [-105.493038499761411, 19.946767279535429], [-105.731396043707633, 20.434101874264108], [-105.397772996831321, 20.531718654863422], [-105.500660773524402, 20.816895046466122], [-105.27075232625792, 21.076284898355137], [-105.265817226974022, 21.422103583252348], [-105.603160976975374, 21.871145941652568], [-105.693413865973113, 22.269080308516148], [-106.028716396898943, 22.77375234627862], [-106.909980434988341, 23.767774359628895], [-107.91544877809136, 24.548915310152946], [-108.401904873470954, 25.172313951105931], [-109.260198737406625, 25.580609442644054], [-109.444089321717314, 25.824883938087673], [-109.291643846456267, 26.44293406829842], [-109.801457689231796, 26.676175645447923], [-110.391731737085692, 27.162114976504533], [-110.641018846461606, 27.859876003525521], [-111.178918830187826, 27.941240546169062], [-111.759606899851619, 28.467952582303944], [-112.228234626090369, 28.954408677683482], [-112.27182369672866, 29.266844387320074], [-112.80959448937395, 30.021113593052341], [-113.163810594518651, 30.786880804969424], [-113.148669399857141, 31.170965887978912], [-113.871881069781836, 31.56760834403519], [-114.205736660603506, 31.524045111613123], [-114.776451178835003, 31.79953217216114], [-114.936699795372121, 31.393484605427595], [-114.771231859173483, 30.91361725516526], [-114.673899298951739, 30.162681179315985], [-114.330974494262918, 29.750432440707407], [-113.588875088335413, 29.061611436473008], [-113.424053107540516, 28.826173610951223], [-113.271969367305502, 28.754782619739892], [-113.140039435664363, 28.411289374295954], [-112.962298346796473, 28.425190334582503], [-112.761587083774856, 27.78021678314752], [-112.457910529411635, 27.525813706974752], [-112.24495195193677, 27.171726792910754], [-111.616489020619184, 26.662817287700474], [-111.284674648872993, 25.732589830014426], [-110.987819383572386, 25.294606228124557], [-110.71000688357131, 24.826004340101854], [-110.655048997828871, 24.298594672131113], [-110.17285620811343, 24.265547593680417], [-109.771847093528521, 23.811182562754194], [-109.409104377055698, 23.364672349536242], [-109.433392300232896, 23.185587673428696], [-109.85421932660168, 22.818271592698061], [-110.031391974714424, 22.823077500901199], [-110.295070970483636, 23.430973212166684], [-110.949501309028022, 24.000964260345988], [-111.670568407012681, 24.484423122652508], [-112.182035895621468, 24.73841278736716], [-112.148988817170817, 25.470125230404044], [-112.300710822379671, 26.012004299416613], [-112.777296719191526, 26.321959540303162], [-113.464670783321907, 26.768185533143416], [-113.596729906043805, 26.639459540304465], [-113.848936733844241, 26.900063788352437], [-114.465746629680027, 27.142090358991361], [-115.055142178184965, 27.722726752222904], [-114.982252570437382, 27.798200181585109], [-114.570365566854917, 27.741485297144884], [-114.199328782999231, 28.115002549750553], [-114.162018398884612, 28.566111965442296], [-114.931842210736605, 29.279479275015483], [-115.518653937626965, 29.556361599235395], [-115.887365282029563, 30.180793768834171], [-116.2583503894529, 30.836464341753572], [-116.721526252084956, 31.635743720012037], [-117.127759999999839, 32.53534], [-115.99135, 32.612390000000111], [-114.72139, 32.72083], [-114.815, 32.52528], [-113.30498, 32.03914], [-111.02361, 31.33472], [-109.035, 31.341940000000129], [-108.24194, 31.34222], [-108.24, 31.754853718166366], [-106.507589999999851, 31.75452], [-106.1429, 31.39995], [-105.63159, 31.08383], [-105.03737, 30.64402], [-104.70575, 30.12173], [-104.456969999999885, 29.57196], [-103.94, 29.27], [-103.11, 28.97], [-102.48, 29.76], [-101.6624, 29.7793], [-100.9576, 29.380710000000125], [-100.45584, 28.696120000000118], [-100.11, 28.11000000000012], [-99.52, 27.54], [-99.3, 26.84], [-99.019999999999897, 26.37], [-98.24, 26.06], [-97.529999999999887, 25.84], [-97.140008307670684, 25.869997463478395]]] } }, + { "type": "Feature", "properties": { "admin": "Macedonia", "name": "Macedonia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.59023, 41.85541], [20.717310000000108, 41.84711], [20.76216, 42.05186], [21.352700000000134, 42.2068], [21.576635989402117, 42.245224397061847], [21.917080000000105, 42.30364], [22.380525750424674, 42.320259507815074], [22.881373732197339, 41.999297186850349], [22.952377150166505, 41.337993882811176], [22.76177, 41.3048], [22.597308383889008, 41.130487168943198], [22.055377638444266, 41.149865831052686], [21.674160597426969, 40.93127452245794], [21.020040317476397, 40.842726955725873], [20.60518, 41.08622], [20.46315, 41.51509], [20.59023, 41.85541]]] } }, + { "type": "Feature", "properties": { "admin": "Mali", "name": "Mali", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-12.170750291380299, 14.616834214735503], [-11.834207526079465, 14.799096991428936], [-11.666078253617853, 15.388208319556295], [-11.349095017939502, 15.411256008358475], [-10.650791388379414, 15.132745876521422], [-10.086846482778212, 15.330485744686269], [-9.700255092802703, 15.264107367407359], [-9.550238409859388, 15.486496893775435], [-5.537744309908446, 15.501689764869253], [-5.315277268891931, 16.201853745991837], [-5.488522508150438, 16.325102037007962], [-5.971128709324247, 20.640833441647626], [-6.453786586930334, 24.956590684503418], [-4.92333736817423, 24.974574082940993], [-1.550054897457613, 22.792665920497377], [1.823227573259032, 20.61080943448604], [2.060990838233919, 20.142233384679482], [2.683588494486428, 19.856230170160114], [3.146661004253899, 19.693578599521441], [3.158133172222704, 19.057364203360034], [4.267419467800038, 19.155265204336995], [4.270209995143801, 16.852227484601212], [3.723421665063482, 16.184283759012612], [3.638258904646476, 15.568119818580453], [2.749992709981483, 15.409524847876693], [1.385528191746857, 15.323561102759168], [1.01578331869851, 14.968182277887944], [0.374892205414682, 14.928908189346128], [-0.26625729003058, 14.924308986872147], [-0.515854458000348, 15.116157741755725], [-1.066363491205663, 14.973815009007764], [-2.001035122068771, 14.559008287000887], [-2.191824510090384, 14.246417548067352], [-2.967694464520576, 13.798150336151506], [-3.103706834312759, 13.54126679122859], [-3.52280270019986, 13.337661647998612], [-4.006390753587225, 13.472485459848112], [-4.280405035814879, 13.228443508349738], [-4.427166103523802, 12.542645575404292], [-5.220941941743119, 11.713858954307224], [-5.197842576508648, 11.375145778850136], [-5.470564947929004, 10.951269842976044], [-5.404341599946973, 10.370736802609144], [-5.816926235365286, 10.222554633012191], [-6.050452032892266, 10.096360785355442], [-6.205222947606429, 10.524060777219132], [-6.493965013037267, 10.411302801958268], [-6.666460944027547, 10.430810655148447], [-6.850506557635057, 10.138993841996237], [-7.622759161804808, 10.147236232946792], [-7.89958980959237, 10.297382106970824], [-8.029943610048617, 10.206534939001711], [-8.335377163109738, 10.494811916541932], [-8.282357143578279, 10.792597357623842], [-8.407310756860026, 10.90925690352276], [-8.620321010767126, 10.810890814655181], [-8.581305304386772, 11.136245632364801], [-8.376304897484911, 11.393645941610627], [-8.786099005559462, 11.812560939984705], [-8.905264858424529, 12.088358059126433], [-9.127473517279581, 12.308060411015331], [-9.327616339546008, 12.334286200403451], [-9.567911749703212, 12.194243068892472], [-9.890992804392011, 12.060478623904968], [-10.165213792348835, 11.844083563682743], [-10.593223842806278, 11.923975328005977], [-10.870829637078211, 12.177887478072106], [-11.036555955438256, 12.211244615116513], [-11.297573614944508, 12.077971096235768], [-11.456168585648269, 12.076834214725336], [-11.513942836950587, 12.442987575729415], [-11.467899135778522, 12.754518947800973], [-11.553397793005427, 13.141213690641063], [-11.927716030311613, 13.422075100147392], [-12.124887457721256, 13.994727484589784], [-12.170750291380299, 14.616834214735503]]] } }, + { "type": "Feature", "properties": { "admin": "Myanmar", "name": "Myanmar", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[99.543309360759281, 20.186597601802056], [98.959675734454848, 19.752980658440944], [98.253723992915582, 19.708203029860041], [97.797782830804394, 18.627080389881751], [97.375896437573516, 18.445437730375811], [97.859122755934848, 17.567946071843657], [98.493761020911322, 16.837835598207928], [98.90334842325673, 16.177824204976115], [98.537375929765687, 15.308497422746081], [98.192074009191373, 15.123702500870349], [98.430819126379859, 14.622027696180831], [99.097755161538728, 13.827502549693275], [99.212011753336071, 13.269293728076462], [99.196353794351637, 12.804748439988666], [99.587286004639694, 11.892762762901695], [99.038120558673953, 10.960545762572435], [98.553550653073017, 9.932959906448543], [98.457174106848697, 10.675266018105146], [98.764545526120756, 11.441291612183745], [98.428338657629823, 12.032986761925681], [98.509574009192661, 13.122377631070675], [98.103603957107666, 13.64045970301285], [97.777732375075161, 14.837285874892638], [97.597071567782749, 16.100567938699765], [97.164539829499773, 16.928734442609336], [96.505768670642965, 16.427240505432845], [95.369352248112378, 15.714389960182599], [94.808404575584092, 15.803454291237637], [94.188804152404515, 16.037936102762014], [94.533485955791321, 17.277240301985724], [94.324816522196741, 18.213513902249893], [93.540988397193615, 19.366492621330021], [93.663254835996199, 19.726961574781992], [93.078277622452163, 19.855144965081973], [92.368553501355606, 20.670883287025344], [92.30323449093865, 21.475485337809815], [92.652257114637976, 21.324047552978481], [92.672720981825549, 22.041238918541247], [93.166127557348361, 22.278459580977099], [93.060294224014598, 22.703110663335565], [93.286326938859247, 23.043658352138998], [93.325187615942767, 24.078556423432197], [94.106741977925054, 23.850740871673477], [94.552657912171611, 24.675238348890328], [94.603249139385355, 25.162495428970399], [95.155153436262566, 26.001307277932078], [95.124767694074933, 26.573572089132295], [96.419365675850941, 27.264589341739221], [97.133999058015277, 27.08377350514996], [97.051988559968066, 27.699058946233144], [97.402561476636123, 27.88253611908544], [97.327113885490007, 28.261582749946331], [97.91198774616943, 28.335945136014338], [98.24623091023328, 27.747221381129172], [98.682690057370451, 27.508812160750612], [98.712093947344499, 26.74353587494026], [98.671838006589127, 25.918702500913518], [97.724609002679117, 25.083637193292994], [97.604719679761956, 23.897404690033039], [98.660262485755737, 24.063286037689959], [98.898749220782747, 23.142722072842524], [99.531992222087382, 22.949038804612574], [99.240898878987224, 22.118314317304577], [99.983489211021464, 21.742936713136398], [100.416537713627349, 21.558839423096607], [101.150032993578222, 21.849984442629015], [101.180005324307515, 21.436572984294024], [100.329101190189519, 20.786121731036229], [100.115987583417819, 20.41784963630818], [99.543309360759281, 20.186597601802056]]] } }, + { "type": "Feature", "properties": { "admin": "Montenegro", "name": "Montenegro", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[19.801613396898681, 42.500093492190835], [19.738051385179627, 42.688247382165564], [19.30449, 42.19574], [19.371770000000136, 41.87755], [19.16246, 41.95502], [18.88214, 42.28151], [18.45, 42.48], [18.56, 42.65], [18.70648, 43.20011], [19.03165, 43.43253], [19.21852, 43.52384], [19.48389, 43.35229], [19.63, 43.213779970270522], [19.95857, 43.10604], [20.3398, 42.89852], [20.25758, 42.81275], [20.0707, 42.58863], [19.801613396898681, 42.500093492190835]]] } }, + { "type": "Feature", "properties": { "admin": "Mongolia", "name": "Mongolia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[87.751264276076697, 49.297197984405479], [88.805566847695488, 49.470520738312409], [90.713667433640666, 50.331811835321076], [92.234711541719662, 50.802170722041716], [93.104219191462661, 50.495290228876414], [94.147566359435615, 50.480536607457083], [94.815949334698701, 50.013433335970838], [95.814027947983973, 49.977466539095708], [97.259727817781396, 49.726060695995727], [98.231761509191543, 50.422400621128737], [97.825739780674283, 51.010995184933165], [98.861490513100307, 52.047366034546684], [99.981732212323507, 51.634006252643978], [100.889480421962588, 51.516855780638316], [102.065222609467298, 51.25992055928311], [102.255908644624299, 50.510560614618669], [103.676545444760194, 50.089966132195109], [104.621552362081687, 50.275329494826067], [105.886591424586726, 50.406019192092209], [106.888804152455336, 50.274295966180219], [107.868175897250936, 49.793705145865808], [108.475167270951275, 49.282547715850725], [109.402449171996636, 49.292960516957535], [110.662010532678764, 49.130128078805861], [111.581230910286607, 49.377968248077678], [112.897739699354361, 49.543565375356984], [114.362456496235239, 50.248302720737399], [114.962109816550154, 50.140247300815112], [115.485695428531386, 49.805177313834591], [116.678800897286152, 49.888531399121376], [116.191802199367544, 49.134598090199091], [115.485282017073018, 48.135382595403428], [115.742837355615748, 47.726544501326273], [116.308952671373206, 47.853410142602826], [117.295507440257396, 47.69770905210742], [118.064142694166691, 48.066730455103674], [118.866574334794933, 47.747060044946153], [119.772823927897477, 47.048058783550125], [119.66326989143873, 46.692679958678909], [118.874325799638711, 46.805412095723646], [117.421701287914175, 46.672732855814253], [116.717868280098841, 46.388202419615205], [115.985096470200062, 45.727235012385989], [114.46033165899604, 45.339816799493811], [113.463906691544139, 44.808893134127111], [112.436062453258785, 45.011645616224278], [111.873306105600278, 45.102079372735055], [111.348376906379428, 44.457441718110083], [111.667737257943202, 44.073175767587706], [111.829587843881342, 43.743118394539515], [111.129682244920218, 43.406834011400136], [110.412103306115256, 42.871233628911014], [109.243595819131428, 42.519446316084093], [107.744772576937933, 42.481515814781865], [106.129315627061658, 42.134327704428898], [104.964993931093446, 41.597409572916334], [104.522281935648977, 41.908346666016541], [103.312278273534787, 41.907468166667591], [101.833040399179922, 42.51487295182627], [100.845865513108237, 42.663804429691439], [99.515817498780009, 42.524691473961717], [97.451757440177985, 42.748889675460013], [96.349395786527793, 42.725635280928678], [95.762454868556674, 43.319449164394598], [95.306875441471504, 44.241330878265458], [94.688928664125299, 44.352331854828414], [93.480733677141274, 44.975472113619951], [92.133890822318193, 45.115075995456444], [90.945539585334288, 45.286073309910265], [90.585768263718265, 45.719716091487513], [90.970809360724985, 46.888146063822923], [90.280825636763893, 47.693549099307923], [88.854297723346733, 48.06908173277295], [88.013832228551721, 48.599462795600601], [87.751264276076697, 49.297197984405479]]] } }, + { "type": "Feature", "properties": { "admin": "Mozambique", "name": "Mozambique", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.559989047999345, -11.520020033415923], [35.312397902169032, -11.439146416879145], [36.514081658684248, -11.720938002166733], [36.775150994622791, -11.594537448780804], [37.471284214026596, -11.568750909067157], [37.827644891111383, -11.268769219612834], [38.427556593587745, -11.285202325081654], [39.521029900883768, -10.896853936408224], [40.316588576017182, -10.317096042525696], [40.478387485523022, -10.765440769089992], [40.437253045418672, -11.761710707245014], [40.560811395028558, -12.639176527561023], [40.599620395679743, -14.201975192931858], [40.775475294768988, -14.691764418194239], [40.477250604012596, -15.406294447493968], [40.089263950365208, -16.100774021064456], [39.452558628097044, -16.720891208566936], [38.53835086442151, -17.101023044505954], [37.411132846838875, -17.586368096591233], [36.281279331209348, -18.659687595293445], [35.896496616364054, -18.842260430580634], [35.198399692533137, -19.552811374593887], [34.786383497870041, -19.784011732667732], [34.701892531072836, -20.497043145431007], [35.176127150215358, -21.254361260668407], [35.373427768705731, -21.840837090748874], [35.385848253705397, -22.14], [35.562545536369079, -22.09], [35.533934767404297, -23.070787855727751], [35.371774122872374, -23.535358982031692], [35.607470330555621, -23.706563002214676], [35.458745558419615, -24.122609958596545], [35.040734897610655, -24.478350518493798], [34.215824008935463, -24.816314385682652], [33.013210076639005, -25.357573337507731], [32.574632195777859, -25.727318210556088], [32.660363396950082, -26.148584486599443], [32.915955031065685, -26.215867201443459], [32.830120477028878, -26.74219166433619], [32.071665480281062, -26.733820082304902], [31.985779249811962, -26.29177988048022], [31.837777947728057, -25.843331801051342], [31.752408481581874, -25.484283949487406], [31.930588820124242, -24.369416599222532], [31.670397983534645, -23.658969008073861], [31.191409132621278, -22.251509698172395], [32.244988234188007, -21.116488539313689], [32.508693068173436, -20.395292250248303], [32.659743279762573, -20.30429005298231], [32.772707960752619, -19.715592136313294], [32.611994256324884, -19.419382826416268], [32.654885695127142, -18.672089939043492], [32.849860874164385, -17.979057305577175], [32.847638787575839, -16.713398125884613], [32.328238966610222, -16.392074069893749], [31.852040643040592, -16.319417006091374], [31.636498243951188, -16.071990248277881], [31.173063999157673, -15.860943698797868], [30.338954705534537, -15.880839125230242], [30.274255812305103, -15.507786960515208], [30.179481235481827, -14.796099134991525], [33.214024692525207, -13.97186003993615], [33.789700148256678, -14.451830743063068], [34.064825473778619, -14.359950046448118], [34.459633416488536, -14.613009535381421], [34.517666049952304, -15.013708591372609], [34.307291294092089, -15.478641452702592], [34.381291945134045, -16.183559665596039], [35.033810255683527, -16.801299737213089], [35.339062941231639, -16.107440280830108], [35.771904738108347, -15.896858819240721], [35.686845330555926, -14.611045830954328], [35.267956170398001, -13.887834161029563], [34.907151320136158, -13.565424899960565], [34.559989047999345, -13.579997653866872], [34.280006137841973, -12.280025323132504], [34.559989047999345, -11.520020033415923]]] } }, + { "type": "Feature", "properties": { "admin": "Mauritania", "name": "Mauritania", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-12.170750291380299, 14.616834214735503], [-12.830658331747513, 15.303691514542942], [-13.43573767745306, 16.039383042866188], [-14.099521450242175, 16.304302273010489], [-14.577347581428977, 16.598263658102805], [-15.135737270558813, 16.587282416240779], [-15.623666144258689, 16.369337063049809], [-16.120690070041928, 16.45566254319338], [-16.463098110407881, 16.135036119038457], [-16.549707810929061, 16.673892116761959], [-16.270551723688353, 17.166962795474866], [-16.146347418674846, 18.108481553616652], [-16.256883307347163, 19.096715806550304], [-16.377651129613266, 19.593817246981981], [-16.277838100641514, 20.092520656814695], [-16.536323614965465, 20.567866319251486], [-17.063423224342568, 20.99975210213082], [-16.845193650773989, 21.333323472574875], [-12.929101935263528, 21.327070624267559], [-13.118754441774708, 22.771220201096249], [-12.874221564169574, 23.284832261645171], [-11.93722449385332, 23.374594224536164], [-11.969418911171159, 25.933352769468261], [-8.687293667017398, 25.881056219988899], [-8.684399786809051, 27.395744126895998], [-4.92333736817423, 24.974574082940993], [-6.453786586930334, 24.956590684503418], [-5.971128709324247, 20.640833441647626], [-5.488522508150438, 16.325102037007962], [-5.315277268891931, 16.201853745991837], [-5.537744309908446, 15.501689764869253], [-9.550238409859388, 15.486496893775435], [-9.700255092802703, 15.264107367407359], [-10.086846482778212, 15.330485744686269], [-10.650791388379414, 15.132745876521422], [-11.349095017939502, 15.411256008358475], [-11.666078253617853, 15.388208319556295], [-11.834207526079465, 14.799096991428936], [-12.170750291380299, 14.616834214735503]]] } }, + { "type": "Feature", "properties": { "admin": "Malawi", "name": "Malawi", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.559989047999345, -11.520020033415923], [34.280006137841973, -12.280025323132504], [34.559989047999345, -13.579997653866872], [34.907151320136158, -13.565424899960565], [35.267956170398001, -13.887834161029563], [35.686845330555926, -14.611045830954328], [35.771904738108347, -15.896858819240721], [35.339062941231639, -16.107440280830108], [35.033810255683527, -16.801299737213089], [34.381291945134045, -16.183559665596039], [34.307291294092089, -15.478641452702592], [34.517666049952304, -15.013708591372609], [34.459633416488536, -14.613009535381421], [34.064825473778619, -14.359950046448118], [33.789700148256678, -14.451830743063068], [33.214024692525207, -13.97186003993615], [32.688165317523122, -13.712857761289273], [32.991764357237876, -12.783870537978272], [33.306422153463068, -12.435778090060214], [33.114289178201908, -11.607198174692311], [33.315310499817279, -10.796549981329695], [33.485687697083584, -10.525558770391111], [33.231387973775291, -9.676721693564799], [32.759375441221316, -9.230599053589058], [33.739729038230443, -9.417150974162722], [33.940837724096532, -9.693673841980292], [34.280006137841973, -10.159999688358402], [34.559989047999345, -11.520020033415923]]] } }, + { "type": "Feature", "properties": { "admin": "Malaysia", "name": "Malaysia", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[101.075515578213299, 6.204867051615891], [101.154218784593809, 5.691384182147713], [101.814281854258013, 5.810808417174228], [102.141186964936423, 6.221636053894655], [102.371147088635212, 6.12820506431096], [102.961705356866673, 5.524495144061077], [103.381214634212142, 4.855001125503746], [103.438575474056165, 4.181605536308381], [103.332122023534851, 3.72669790284297], [103.42942874554052, 3.382868760589019], [103.502447544368877, 2.791018581550204], [103.854674106870334, 2.515454006353763], [104.247931756611479, 1.631141058759055], [104.228811476663523, 1.293048000489534], [103.519707472754433, 1.226333726400682], [102.573615350354771, 1.967115383304744], [101.39063846232915, 2.760813706875623], [101.273539666755838, 3.27029165284118], [100.69543541870668, 3.939139715994869], [100.557407668055092, 4.767280381688279], [100.19670617065772, 5.312492580583678], [100.306260207116509, 6.040561835143875], [100.085756870527078, 6.46448944745029], [100.259596388756918, 6.64282481528957], [101.075515578213299, 6.204867051615891]]], [[[118.618320754064825, 4.47820241944754], [117.882034946770162, 4.137551377779487], [117.01521447150634, 4.306094061699468], [115.86551720587677, 4.306559149590156], [115.51907840379198, 3.169238389494395], [115.134037306785231, 2.821481838386219], [114.621355422017473, 1.430688177898886], [113.805849644019531, 1.217548732911041], [112.859809198052176, 1.497790025229946], [112.380251906383648, 1.410120957846757], [111.797548455860408, 0.904441229654651], [111.159137811326559, 0.976478176269509], [110.514060907027101, 0.773131415200993], [109.830226678508836, 1.338135687664191], [109.663260125773718, 2.006466986494984], [110.396135288537039, 1.663774725751395], [111.168852980597478, 1.850636704918784], [111.370081007942076, 2.697303371588872], [111.796928338672842, 2.885896511238073], [112.995614862115247, 3.102394924324869], [113.712935418758718, 3.893509426281127], [114.204016554828399, 4.525873928236819], [114.659595981913526, 4.00763682699781], [114.869557326315373, 4.348313706881952], [115.347460972150671, 4.316636053887009], [115.405700311343594, 4.955227565933824], [115.450710483869798, 5.447729803891561], [116.220741001450961, 6.143191229675621], [116.725102980619752, 6.924771429873998], [117.129626092600461, 6.928052883324566], [117.643393182446303, 6.422166449403305], [117.689075148592337, 5.98749013918018], [118.347691278152197, 5.708695786965462], [119.181903924639926, 5.407835598162249], [119.110693800941718, 5.016128241389864], [118.439727004064082, 4.966518866389619], [118.618320754064825, 4.47820241944754]]]] } }, + { "type": "Feature", "properties": { "admin": "Namibia", "name": "Namibia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[16.344976840895239, -28.576705010697697], [15.601818068105812, -27.821247247022797], [15.210472446359457, -27.09095590587404], [14.989710727608548, -26.117371921495153], [14.74321414557633, -25.392920017195376], [14.40814415859583, -23.85301401132984], [14.385716586981145, -22.656652927340687], [14.257714064194172, -22.111208184499951], [13.868642205468657, -21.699036960539974], [13.352497999737437, -20.872834161057497], [12.82684533046449, -19.673165785401661], [12.608564080463617, -19.045348809487695], [11.794918654028063, -18.069129327061912], [11.734198846085118, -17.30188933682447], [12.215461460019352, -17.11166838955808], [12.814081251688405, -16.941342868724067], [13.462362094789963, -16.971211846588769], [14.058501417709007, -17.42338062914266], [14.209706658595021, -17.353100681225715], [18.26330936043416, -17.309950860262003], [18.956186964603599, -17.789094740472255], [21.377176141045563, -17.930636488519688], [23.215048455506057, -17.52311614346598], [24.033861525170771, -17.29584319424632], [24.6823490740015, -17.35341073981947], [25.076950310982255, -17.578823337476617], [25.084443393664564, -17.661815687737366], [24.520705193792534, -17.887124932529932], [24.217364536239209, -17.889347019118485], [23.579005568137713, -18.281261081620055], [23.196858351339298, -17.869038181227783], [21.655040317478971, -18.219146010005222], [20.910641310314531, -18.252218926672018], [20.881134067475866, -21.814327080983144], [19.895457797940672, -21.849156996347865], [19.895767856534427, -24.767790215760588], [19.89473432788861, -28.461104831660769], [19.002127312911082, -28.972443129188857], [18.464899122804745, -29.045461928017271], [17.836151971109526, -28.856377862261311], [17.387497185951499, -28.783514092729774], [17.218928663815401, -28.355943291946804], [16.824017368240899, -28.082161553664466], [16.344976840895239, -28.576705010697697]]] } }, + { "type": "Feature", "properties": { "admin": "New Caledonia", "name": "New Caledonia", "continent": "Oceania" }, "geometry": { "type": "Polygon", "coordinates": [[[165.779989862326346, -21.080004978115621], [166.599991489933814, -21.700018812753523], [167.120011428086883, -22.159990736583488], [166.74003462144475, -22.399976088146943], [166.189732293968632, -22.129708347260447], [165.474375441752159, -21.679606621998229], [164.829815301775653, -21.149819838141948], [164.16799523341362, -20.444746595951624], [164.029605747735957, -20.105645847252347], [164.459967075862664, -20.120011895429492], [165.020036249041993, -20.459991143477726], [165.460009393575064, -20.800022067958253], [165.779989862326346, -21.080004978115621]]] } }, + { "type": "Feature", "properties": { "admin": "Niger", "name": "Niger", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[2.154473504249949, 11.940150051313422], [2.177107781593917, 12.625017808477534], [1.024103224297619, 12.851825669806598], [0.993045688490156, 13.335749620003865], [0.429927605805517, 13.988733018443893], [0.295646396495215, 14.444234930880663], [0.374892205414767, 14.928908189346144], [1.015783318698481, 14.968182277887989], [1.385528191746971, 15.323561102759237], [2.74999270998154, 15.409524847876751], [3.63825890464659, 15.56811981858044], [3.723421665063596, 16.184283759012654], [4.270209995143886, 16.852227484601311], [4.267419467800095, 19.155265204337123], [5.677565952180712, 19.601206976799794], [8.572893100629868, 21.565660712159225], [11.999505649471697, 23.471668402596432], [13.581424594790459, 23.040506089769274], [14.143870883855239, 22.491288967371126], [14.8513, 22.862950000000119], [15.096887648181847, 21.308518785074902], [15.471076694407314, 21.048457139565979], [15.487148064850143, 20.730414537025634], [15.90324669766431, 20.387618923417499], [15.68574059414777, 19.957180080642384], [15.300441114979716, 17.927949937405], [15.247731154041842, 16.627305813050778], [13.972201775781681, 15.684365953021139], [13.540393507550785, 14.36713369390122], [13.956698846094124, 13.996691189016925], [13.954476759505607, 13.353448798063765], [14.595781284247604, 13.330426947477859], [14.495787387762899, 12.859396267137353], [14.213530714584746, 12.80203542729333], [14.181336297266906, 12.483656927943169], [13.995352817448289, 12.4615652531383], [13.318701613018558, 13.55635630945795], [13.083987257548809, 13.596147162322492], [12.302071160540546, 13.037189032437535], [11.527803175511504, 13.328980007373556], [10.989593133191532, 13.387322699431191], [10.701031935273816, 13.246917832894038], [10.114814487354748, 13.277251898649464], [9.524928012743088, 12.85110219975456], [9.014933302454436, 12.826659247280414], [7.804671258178869, 13.343526923063731], [7.330746697630046, 13.098038031461213], [6.82044192874781, 13.115091254117598], [6.445426059605721, 13.492768459522718], [5.443058302440135, 13.865923977102225], [4.368343540066006, 13.747481594289408], [4.107945997747378, 13.531215725147941], [3.967282749048933, 12.956108710171574], [3.680633579125924, 12.552903347214167], [3.611180454125587, 11.660167141155965], [2.848643019226585, 12.235635891158207], [2.490163608418015, 12.233052069543588], [2.154473504249949, 11.940150051313422]]] } }, + { "type": "Feature", "properties": { "admin": "Nigeria", "name": "Nigeria", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[8.500287713259693, 4.771982937026847], [7.462108188515939, 4.41210826254624], [7.082596469764438, 4.464689032403228], [6.698072137080598, 4.240594183769516], [5.898172641634686, 4.262453314628984], [5.362804803090881, 4.887970689305957], [5.033574252959368, 5.611802476418233], [4.325607130560683, 6.270651149923466], [3.574180128604552, 6.258300482605717], [2.691701694356254, 6.258817246928628], [2.74906253420022, 7.870734361192886], [2.723792758809509, 8.506845404489708], [2.912308383810255, 9.13760793704432], [3.220351596702101, 9.4441525333997], [3.705438266625918, 10.063210354040207], [3.600070021182801, 10.332186184119406], [3.797112257511713, 10.734745591673104], [3.572216424177469, 11.327939357951516], [3.611180454125558, 11.660167141155966], [3.68063357912581, 12.552903347214222], [3.967282749048848, 12.956108710171572], [4.107945997747321, 13.531215725147829], [4.368343540066063, 13.747481594289324], [5.443058302440163, 13.865923977102295], [6.445426059605636, 13.492768459522676], [6.820441928747753, 13.115091254117514], [7.330746697630017, 13.098038031461199], [7.804671258178784, 13.343526923063745], [9.014933302454462, 12.826659247280427], [9.524928012742945, 12.851102199754477], [10.114814487354689, 13.277251898649409], [10.701031935273702, 13.246917832894081], [10.989593133191532, 13.387322699431108], [11.527803175511393, 13.328980007373584], [12.302071160540521, 13.037189032437521], [13.083987257548866, 13.596147162322563], [13.318701613018558, 13.556356309457824], [13.995352817448346, 12.461565253138343], [14.181336297266792, 12.483656927943112], [14.57717776862253, 12.085360826053501], [14.468192172918974, 11.90475169519341], [14.415378859116682, 11.572368882692071], [13.572949659894558, 10.798565985553564], [13.308676385153914, 10.160362046748926], [13.1675997249971, 9.64062632897341], [12.955467970438971, 9.417771714714702], [12.753671502339214, 8.717762762888993], [12.218872104550597, 8.305824082874322], [12.063946160539556, 7.799808457872301], [11.839308709366801, 7.397042344589434], [11.745774366918509, 6.981382961449753], [11.058787876030349, 6.644426784690593], [10.497375115611417, 7.055357774275562], [10.118276808318255, 7.038769639509879], [9.522705926154398, 6.453482367372116], [9.233162876023043, 6.444490668153334], [8.757532993208626, 5.47966583904791], [8.500287713259693, 4.771982937026847]]] } }, + { "type": "Feature", "properties": { "admin": "Nicaragua", "name": "Nicaragua", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-85.712540452807289, 11.088444932494822], [-86.058488328785245, 11.40343862552994], [-86.525849982432931, 11.806876532432593], [-86.7459915839963, 12.143961900272483], [-87.167516242201131, 12.458257961471656], [-87.668493415054698, 12.909909979702629], [-87.557466600275603, 13.064551703336061], [-87.392386237319201, 12.914018256069836], [-87.316654425795463, 12.984685777228972], [-87.005769009127562, 13.025794379117157], [-86.880557013684339, 13.254204209847241], [-86.733821784191576, 13.263092556201441], [-86.755086636079696, 13.754845485890909], [-86.520708177419877, 13.778487453664436], [-86.312142096689911, 13.771356106008167], [-86.096263800790581, 14.038187364147245], [-85.801294725268576, 13.836054999237586], [-85.698665330736901, 13.960078436738083], [-85.514413011400222, 14.079011745657834], [-85.165364549484792, 14.354369615125076], [-85.148750576502948, 14.560196844943615], [-85.052787441736925, 14.551541042534719], [-84.924500698572388, 14.790492865452348], [-84.820036790694346, 14.819586696832669], [-84.649582078779602, 14.66680532476175], [-84.449335903648588, 14.621614284722494], [-84.228341640952394, 14.748764146376654], [-83.975721401693576, 14.749435939996458], [-83.628584967772895, 14.880073960830298], [-83.489988776366104, 15.016267198135534], [-83.147219000974104, 14.995829169164109], [-83.233234422523907, 14.8998660343981], [-83.28416154654758, 14.676623846897197], [-83.182126430987267, 14.310703029838447], [-83.412499966144424, 13.970077826386554], [-83.519831916014667, 13.56769928634588], [-83.55220720084553, 13.127054348193084], [-83.498515387694255, 12.869292303921226], [-83.473323126951968, 12.419087225794424], [-83.626104499022887, 12.320850328007563], [-83.719613003255034, 11.893124497927724], [-83.650857510090702, 11.629032090700116], [-83.855470343750369, 11.373311265503785], [-83.808935716471538, 11.103043524617274], [-83.655611741861563, 10.938764146361418], [-83.895054490885926, 10.726839097532444], [-84.190178595704822, 10.793450018756671], [-84.355930752281026, 10.999225572142901], [-84.673069017256239, 11.082657172078139], [-84.903003302738924, 10.952303371621895], [-85.561851976244171, 11.217119248901593], [-85.712540452807289, 11.088444932494822]]] } }, + { "type": "Feature", "properties": { "admin": "Netherlands", "name": "Netherlands", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[6.074182570020922, 53.51040334737813], [6.905139601274128, 53.482162177130633], [7.092053256873895, 53.14404328064488], [6.842869500362381, 52.228440253297542], [6.589396599970825, 51.85202912048338], [5.988658074577812, 51.85161570902504], [6.156658155958779, 50.803721015010574], [5.60697594567, 51.037298488969768], [4.973991326526913, 51.475023708698124], [4.047071160507527, 51.267258612668556], [3.314971144228536, 51.345755113319903], [3.830288527043137, 51.620544542031936], [4.705997348661184, 53.091798407597757], [6.074182570020922, 53.51040334737813]]] } }, + { "type": "Feature", "properties": { "admin": "Norway", "name": "Norway", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[28.165547316202911, 71.185474351680497], [31.293418409965472, 70.453787746859902], [30.005435011522785, 70.186258856884876], [31.101078728975118, 69.558080145944857], [29.399580519332879, 69.156916002063056], [28.591929559043187, 69.064776923286686], [29.015572950971968, 69.76649119737796], [27.732292107867885, 70.164193020296281], [26.179622023226298, 69.825298977326142], [25.689212680776389, 69.092113755968995], [24.735679152126714, 68.649556789821432], [23.662049594830759, 68.891247463650515], [22.356237827247405, 68.841741441514941], [21.244936150810723, 69.370443020293109], [20.645592889089581, 69.106247260200846], [20.02526899585791, 69.065138658312705], [19.878559604581248, 68.407194322372604], [17.993868442464386, 68.567391262477329], [17.729181756265344, 68.01055186631622], [16.768878614985535, 68.013936672631374], [16.108712192456832, 67.302455552836889], [15.108411492583055, 66.193866889095418], [13.555689731509087, 64.787027696381458], [13.919905226302202, 64.445420640716108], [13.571916131248766, 64.049114081469654], [12.57993533697393, 64.066218980558332], [11.930569288794228, 63.128317572676977], [11.992064243221531, 61.800362453856557], [12.63114668137524, 61.293571682370079], [12.300365838274896, 60.117932847730046], [11.468271925511173, 59.432393296945989], [11.027368605196925, 58.856149400459394], [10.356556837616095, 59.469807033925363], [8.382000359743641, 58.313288479233265], [7.048748406613297, 58.078884182357271], [5.665835402050418, 58.588155422593658], [5.308234490590733, 59.663231919993805], [4.992078077829005, 61.97099803328426], [5.912900424837885, 62.614472968182682], [8.553411085655766, 63.454008287196459], [10.527709181366784, 64.486038316497471], [12.358346795306371, 65.879725857193151], [14.7611458675816, 67.810641587995121], [16.435927361728968, 68.563205471461671], [19.184028354578512, 69.817444159617807], [21.378416375420606, 70.255169379346043], [23.02374230316158, 70.202071845166259], [24.546543409938515, 71.030496731237221], [26.370049676221807, 70.986261705195361], [28.165547316202911, 71.185474351680497]]], [[[24.72412, 77.85385], [22.49032, 77.44493], [20.72601, 77.67704], [21.41611, 77.93504], [20.8119, 78.25463], [22.88426, 78.45494], [23.28134, 78.07954], [24.72412, 77.85385]]], [[[18.25183, 79.70175], [21.54383, 78.95611], [19.02737, 78.5626], [18.47172, 77.82669], [17.59441, 77.63796], [17.1182, 76.80941], [15.91315, 76.77045], [13.76259, 77.38035], [14.66956, 77.73565], [13.1706, 78.02493], [11.22231, 78.8693], [10.44453, 79.65239], [13.17077, 80.01046], [13.71852, 79.66039], [15.14282, 79.67431], [15.52255, 80.01608], [16.99085, 80.05086], [18.25183, 79.70175]]], [[[25.447625359811887, 80.407340399894494], [27.407505730913492, 80.056405748200447], [25.924650506298171, 79.517833970854539], [23.024465773213613, 79.40001170522909], [20.075188429451877, 79.566823228667232], [19.897266473070907, 79.842361965647498], [18.46226362475792, 79.859880276194403], [17.368015170977454, 80.318896186027004], [20.455992059010693, 80.598155626132225], [21.907944777115397, 80.357679348462071], [22.919252557067431, 80.657144273593488], [25.447625359811887, 80.407340399894494]]]] } }, + { "type": "Feature", "properties": { "admin": "Nepal", "name": "Nepal", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[88.120440708369841, 27.876541652939586], [88.043132765661198, 27.445818589786818], [88.174804315140904, 26.810405178325944], [88.060237664749806, 26.414615383402484], [87.22747195836628, 26.39789805755607], [86.024392938179147, 26.630984605408567], [85.25177859898335, 26.726198431906337], [84.675017938173767, 27.234901231387528], [83.304248895199535, 27.364505723575554], [81.999987420584958, 27.925479234319987], [81.057202589851997, 28.416095282499036], [80.088424513676259, 28.794470119740136], [80.476721225917373, 29.729865220655334], [81.11125613802929, 30.183480943313398], [81.525804477874729, 30.422716986608627], [82.327512648450863, 30.115268052688126], [83.337115106137176, 29.463731594352193], [83.898992954446712, 29.320226141877654], [84.234579705750136, 28.839893703724691], [85.011638218123025, 28.642773952747337], [85.823319940131498, 28.203575954698699], [86.954517043000592, 27.97426178640351], [88.120440708369841, 27.876541652939586]]] } }, + { "type": "Feature", "properties": { "admin": "New Zealand", "name": "New Zealand", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[173.020374790740703, -40.919052422856417], [173.247234328502003, -41.331998793300777], [173.958405389702875, -40.926700534835604], [174.2475867048081, -41.349155368821663], [174.248516880589449, -41.770008233406749], [173.876446568087886, -42.233184096038819], [173.222739699595621, -42.970038344088557], [172.711246372770717, -43.372287693048492], [173.080112746470206, -43.853343601253577], [172.308583612352464, -43.865694268571332], [171.452925246463622, -44.24251881284372], [171.185137974327233, -44.897104180684885], [170.616697219116588, -45.908928724959701], [169.83142215400926, -46.355774834987585], [169.332331170934253, -46.641235446967848], [168.411353794628525, -46.619944756863582], [167.763744745146823, -46.290197442409195], [166.676886021184202, -46.219917494492236], [166.509144321964669, -45.852704766626204], [167.046424188503238, -45.110941257508664], [168.303763462596862, -44.12397307716612], [168.949408807651508, -43.93581918719142], [169.667814569373149, -43.555325616226334], [170.524919875366152, -43.031688327812823], [171.125089960004004, -42.512753594737781], [171.569713983443194, -41.767424411792128], [171.948708937871885, -41.514416599291145], [172.097227004278722, -40.956104424809674], [172.798579543343948, -40.493962090823466], [173.020374790740703, -40.919052422856417]]], [[[174.612008905330526, -36.156397393540537], [175.336615838927173, -37.209097995758263], [175.3575964704375, -36.52619394302112], [175.808886753642469, -36.798942152657681], [175.958490025127475, -37.555381768546063], [176.763195428776555, -37.881253350578696], [177.438813104560495, -37.961248467766488], [178.010354445708657, -37.579824721020124], [178.517093540762801, -37.695373223624792], [178.274731073313802, -38.582812595373092], [177.970460239979332, -39.166342868812968], [177.206992629299123, -39.145775648760839], [176.939980503647007, -39.449736423501562], [177.032946405340113, -39.879942722331471], [176.8858236026052, -40.06597787858216], [176.508017206119348, -40.60480803808958], [176.012440220440283, -41.289624118821493], [175.239567499082966, -41.688307793953236], [175.067898391009408, -41.425894870775075], [174.650972935278418, -41.281820977545443], [175.227630243223615, -40.459235528323397], [174.900156691789959, -39.908933200847216], [173.824046665743992, -39.508854262043506], [173.852261997775315, -39.146602471677461], [174.57480187408035, -38.797683200842748], [174.743473749081033, -38.027807712558378], [174.69701663645057, -37.381128838857954], [174.292028436579187, -36.71109221776144], [174.319003534235549, -36.534823907213884], [173.840996535535766, -36.121980889634109], [173.05417117745958, -35.237125339500331], [172.636005487353714, -34.529106540669382], [173.007042271209457, -34.450661716450334], [173.551298456107475, -35.006183363587958], [174.329390497126241, -35.265495700828616], [174.612008905330526, -36.156397393540537]]]] } }, + { "type": "Feature", "properties": { "admin": "Oman", "name": "Oman", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[58.861141391846573, 21.114034532144299], [58.487985874266961, 20.428985907467101], [58.03431847517659, 20.481437486243347], [57.826372511634098, 20.24300242764863], [57.66576216007094, 19.736004950433109], [57.788700392493368, 19.067570298737646], [57.694390903560667, 18.944709580963799], [57.2342639504338, 18.947991034414255], [56.609650913321971, 18.574267076079476], [56.512189162019482, 18.087113348863934], [56.283520949128011, 17.876066799383945], [55.661491733630683, 17.884128322821535], [55.269939406155189, 17.632309068263194], [55.274900343655091, 17.228354397037659], [54.791002231674113, 16.950696926333357], [54.239252964093751, 17.04498057704998], [53.57050825380459, 16.707662665264674], [53.108572625547502, 16.651051133688977], [52.782184279192066, 17.349742336491229], [52.000009800022227, 19.000003363516068], [54.999981723862405, 19.999994004796118], [55.666659376859869, 22.000001125572307], [55.208341098863187, 22.708329982997007], [55.234489373602869, 23.110992743415348], [55.52584109886449, 23.524869289640911], [55.528631626208288, 23.933604030853498], [55.981213820220503, 24.130542914317854], [55.80411868675624, 24.269604193615287], [55.88623253766805, 24.920830593357486], [56.396847365143984, 24.924732163995508], [56.845140415276049, 24.241673081961487], [57.403452589757428, 23.878594468678834], [58.136947869708322, 23.747930609628835], [58.729211460205427, 23.565667832935414], [59.180501743410346, 22.992395331305456], [59.450097690677033, 22.660270900965592], [59.80806033716285, 22.533611965418199], [59.806148309168087, 22.31052480721419], [59.442191196536399, 21.71454051359208], [59.282407667889871, 21.433885809814875], [58.861141391846573, 21.114034532144299]]], [[[56.391421339753393, 25.895990708921254], [56.261041701080913, 25.714606431576748], [56.070820753814544, 26.055464178973946], [56.362017449779344, 26.395934353128947], [56.485679152253809, 26.309117946878665], [56.391421339753393, 25.895990708921254]]]] } }, + { "type": "Feature", "properties": { "admin": "Pakistan", "name": "Pakistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[75.158027785140902, 37.13303091078911], [75.896897414050116, 36.666806138651829], [76.192848341785677, 35.898403428687821], [77.837450799474553, 35.494009507787759], [76.871721632804011, 34.653544012992732], [75.757060988268321, 34.504922593721311], [74.240202671204955, 34.748887030571247], [73.749948358051952, 34.317698879527846], [74.104293654277328, 33.441473293586846], [74.451559279278698, 32.764899603805489], [75.258641798813187, 32.271105455040491], [74.405928989564998, 31.692639471965272], [74.421380242820263, 30.97981476493117], [73.450638462217412, 29.976413479119863], [72.823751662084689, 28.961591701772047], [71.777665643200308, 27.913180243434521], [70.61649620960192, 27.989196275335861], [69.514392938113119, 26.940965684511365], [70.168926629522005, 26.491871649678835], [70.282873162725579, 25.722228705339823], [70.844699334602822, 25.215102037043511], [71.0432401874682, 24.356523952730193], [68.842599318318761, 24.359133612560932], [68.176645135373377, 23.691965033456704], [67.443666619745457, 23.944843654876983], [67.145441928989058, 24.663611151624639], [66.37282758979326, 25.425140896093847], [64.530407749291115, 25.237038682551425], [62.905700718034595, 25.218409328710202], [61.497362908784183, 25.078237006118492], [61.874187453056535, 26.239974880472097], [63.316631707619578, 26.756532497661659], [63.23389773952028, 27.217047024030702], [62.755425652929851, 27.378923448184985], [62.727830438085974, 28.259644883735383], [61.771868117118615, 28.699333807890792], [61.369308709564926, 29.303276272085917], [60.874248488208778, 29.829238999952604], [62.549856805272775, 29.318572496044304], [63.550260858011164, 29.468330796826162], [64.148002150331237, 29.340819200145965], [64.350418735618504, 29.560030625928089], [65.046862013616092, 29.472180691031902], [66.346472609324408, 29.88794342703617], [66.38145755398601, 30.738899237586448], [66.938891229118454, 31.304911200479346], [67.683393589147457, 31.303154201781414], [67.792689243444769, 31.582930406209623], [68.556932000609308, 31.713310044882011], [68.926676873657655, 31.620189113892064], [69.317764113242546, 31.901412258424436], [69.262522007122541, 32.501944078088293], [69.687147251264847, 33.105498969041228], [70.323594191371583, 33.358532619758385], [69.93054324735958, 34.020120144175102], [70.881803012988385, 33.988855902638512], [71.156773309213449, 34.348911444632144], [71.115018751921625, 34.733125718722228], [71.613076206350698, 35.153203436822857], [71.498767938121077, 35.650563259415996], [71.262348260385735, 36.074387518857797], [71.846291945283909, 36.509942328429851], [72.920024855444453, 36.720007025696312], [74.067551710917812, 36.836175645488446], [74.575892775372964, 37.02084137628345], [75.158027785140902, 37.13303091078911]]] } }, + { "type": "Feature", "properties": { "admin": "Panama", "name": "Panama", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-77.881571417945239, 7.223771267114783], [-78.214936082660103, 7.512254950384159], [-78.429160732726061, 8.052041123888925], [-78.182095709938608, 8.319182440621772], [-78.43546525746568, 8.387705389840788], [-78.622120530903928, 8.718124497915026], [-79.120307176413732, 8.996092027213022], [-79.557877366845176, 8.932374986197145], [-79.760578172510037, 8.584515082224398], [-80.164481167303322, 8.333315944853593], [-80.382659064439608, 8.29840851484043], [-80.480689256497286, 8.090307522001067], [-80.003689948227148, 7.54752411542337], [-80.276670701808982, 7.419754136581713], [-80.421158006497066, 7.271571966984763], [-80.886400926420791, 7.220541490096535], [-81.059542812814698, 7.817921047390596], [-81.189715745757937, 7.647905585150339], [-81.519514736644666, 7.706610012233908], [-81.721311204744453, 8.108962714058434], [-82.131441209628889, 8.175392767769635], [-82.390934414382542, 8.292362372262287], [-82.820081346350406, 8.290863755725821], [-82.850958014644803, 8.073822740099954], [-82.965783047197348, 8.225027980985983], [-82.9131764391242, 8.423517157419068], [-82.829770677405151, 8.626295477732368], [-82.868657192704759, 8.807266343618521], [-82.719183112300513, 8.925708726431493], [-82.927154914059145, 9.074330145702914], [-82.932890998043561, 9.476812038608172], [-82.546196255203469, 9.566134751824674], [-82.187122565423394, 9.207448635286779], [-82.207586432610952, 8.995575262890098], [-81.808566860669259, 8.95061676679617], [-81.714154018872023, 9.031955471223581], [-81.43928707551153, 8.786234035675715], [-80.947301601876745, 8.858503526235905], [-80.521901211250054, 9.11107208906243], [-79.914599778955974, 9.312765204297618], [-79.573302781884294, 9.611610012241526], [-79.021191779277913, 9.552931423374103], [-79.058450486960353, 9.454565334506523], [-78.500887620747164, 9.420458889193879], [-78.055927700497989, 9.247730414258296], [-77.729513515926399, 8.946844387238867], [-77.353360765273848, 8.670504665558068], [-77.474722866511314, 8.524286200388216], [-77.242566494440069, 7.935278225125442], [-77.431107957656977, 7.638061224798733], [-77.75341386586139, 7.709839789252141], [-77.881571417945239, 7.223771267114783]]] } }, + { "type": "Feature", "properties": { "admin": "Peru", "name": "Peru", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-69.590423753524036, -17.580011895419329], [-69.858443569605839, -18.092693780187009], [-70.3725723944777, -18.347975355708861], [-71.375250210236914, -17.77379851651385], [-71.462040778271117, -17.363487644116379], [-73.444529588500401, -16.359362888252992], [-75.23788265654143, -15.26568287522778], [-76.009205084929931, -14.649286390850317], [-76.423469204397733, -13.823186944232431], [-76.259241502574156, -13.535039157772939], [-77.10619238962181, -12.222716159720816], [-78.092152879534623, -10.377712497604062], [-79.036953091126918, -8.38656788496589], [-79.445920376284832, -7.930833428583859], [-79.760578172510037, -7.194340915560081], [-80.537481655586049, -6.541667575713715], [-81.249996304026411, -6.136834405139182], [-80.926346808582423, -5.690556735866563], [-81.410942552399433, -4.736764825055459], [-81.099669562489353, -4.036394138203696], [-80.302560594387188, -3.404856459164712], [-80.184014858709645, -3.821161797708043], [-80.46929460317692, -4.059286797708999], [-80.442241990872134, -4.425724379090673], [-80.028908047185581, -4.346090996928893], [-79.62497921417615, -4.454198093283494], [-79.205289069317715, -4.959128513207388], [-78.639897223612323, -4.547784112164072], [-78.450683966775628, -3.873096612161375], [-77.83790483265858, -3.003020521663103], [-76.635394253226707, -2.608677666843817], [-75.544995693652027, -1.56160979574588], [-75.233722703741932, -0.911416924649529], [-75.373223232713841, -0.15203175212045], [-75.106624518520064, -0.05720549886486], [-74.441600511355958, -0.530820000819887], [-74.122395189089048, -1.002832533373848], [-73.659503546834586, -1.260491224781134], [-73.070392218707212, -2.308954359550952], [-72.325786505813639, -2.434218031426453], [-71.774760708285385, -2.169789727388937], [-71.413645799429773, -2.342802422702128], [-70.813475714791949, -2.256864515800742], [-70.047708502874841, -2.725156345229699], [-70.692682054309699, -3.742872002785858], [-70.394043952094975, -3.766591485207825], [-69.893635219996611, -4.298186944194326], [-70.79476884630229, -4.251264743673302], [-70.928843349883564, -4.401591485210367], [-71.748405727816532, -4.59398284263301], [-72.891927659787243, -5.274561455916979], [-72.964507208941185, -5.741251315944892], [-73.219711269814596, -6.089188734566076], [-73.120027431923575, -6.629930922068238], [-73.724486660441627, -6.918595472850638], [-73.723401455363486, -7.340998630404412], [-73.987235480429646, -7.523829847853063], [-73.571059332967053, -8.424446709835832], [-73.015382656532537, -9.03283334720806], [-73.226713426390148, -9.462212823121233], [-72.563033006465631, -9.520193780152715], [-72.184890713169821, -10.05359791426943], [-71.302412278921523, -10.079436130415372], [-70.481893886991159, -9.490118096558842], [-70.548685675728393, -11.009146823778462], [-70.093752204046879, -11.123971856331011], [-69.52967810736493, -10.951734307502193], [-68.665079718689611, -12.561300144097171], [-68.880079515239956, -12.89972909917665], [-68.929223802349526, -13.602683607643007], [-68.94888668483658, -14.45363941819328], [-69.339534674747, -14.953195489158828], [-69.160346645774936, -15.323973890853015], [-69.389764166934697, -15.66012908291165], [-68.959635382753291, -16.500697930571267], [-69.590423753524036, -17.580011895419329]]] } }, + { "type": "Feature", "properties": { "admin": "Philippines", "name": "Philippines", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[126.376813592637447, 8.414706325713352], [126.478512811387873, 7.750354112168976], [126.537423944200611, 7.189380601424572], [126.19677290253253, 6.274294338400038], [125.831420526229081, 7.293715318221855], [125.363852166852283, 6.78648529706099], [125.683160841983707, 6.049656887227257], [125.396511672060626, 5.581003322772288], [124.219787632342332, 6.16135549562618], [123.938719517106918, 6.88513560630612], [124.243662144061318, 7.360610459823659], [123.610212437027542, 7.833527329942753], [123.29607140512519, 7.418875637232786], [122.825505812675388, 7.457374579290216], [122.085499302255769, 6.899424139834847], [121.919928013192603, 7.192119452336072], [122.312358840017112, 8.034962063016506], [122.94239790251963, 8.316236883981174], [123.487687616063511, 8.693009751821192], [123.841154412939815, 8.240324204944384], [124.6014697612502, 8.514157619659015], [124.764612257995623, 8.960409450715458], [125.471390822451539, 8.986996975129641], [125.412117954612754, 9.760334784377545], [126.222714471543156, 9.28607432701885], [126.306636997585073, 8.782487494334573], [126.376813592637447, 8.414706325713352]]], [[[123.982437778825798, 10.278778591345811], [123.62318322153277, 9.950090643753297], [123.309920688979332, 9.318268744336676], [122.995883009941636, 9.022188625520398], [122.380054966319463, 9.713360907424201], [122.586088901867072, 9.981044826696104], [122.837081333508706, 10.261156927934234], [122.947410516451896, 10.881868394408029], [123.498849725438447, 10.940624497923945], [123.337774285984722, 10.267383938025445], [124.077935825701218, 11.232725531453706], [123.982437778825798, 10.278778591345811]]], [[[118.504580926590336, 9.316382554558087], [117.174274530100675, 8.367499904814663], [117.664477166821371, 9.066888739452933], [118.386913690261736, 9.684499619989223], [118.98734215706105, 10.376292019080507], [119.511496209797528, 11.36966807702721], [119.689676548339889, 10.554291490109872], [119.029458449378978, 10.003653265823869], [118.504580926590336, 9.316382554558087]]], [[[121.883547804859106, 11.891755072471977], [122.483821242361458, 11.582187404827506], [123.120216506035959, 11.583660183147867], [123.100837843926442, 11.165933742716486], [122.637713657726692, 10.741308498574226], [122.002610304859559, 10.441016750526087], [121.967366978036523, 10.905691229694622], [122.038370396005519, 11.415840969280039], [121.883547804859106, 11.891755072471977]]], [[[125.502551711123488, 12.162694606978347], [125.783464797062152, 11.046121934447767], [125.01188398651226, 11.311454576050377], [125.032761265158115, 10.975816148314703], [125.277449172060244, 10.358722032101308], [124.801819289245714, 10.134678859899889], [124.760168084818474, 10.8379951033923], [124.459101190286049, 10.889929917845633], [124.302521600441722, 11.495370998577227], [124.891012811381572, 11.415582587118589], [124.877990350443952, 11.794189968304988], [124.266761509295705, 12.557760931849682], [125.22711632700782, 12.53572093347719], [125.502551711123488, 12.162694606978347]]], [[[121.527393833503481, 13.069590155484516], [121.262190382981544, 12.2055602075644], [120.833896112146533, 12.704496161342416], [120.323436313967477, 13.466413479053866], [121.18012820850214, 13.429697373910439], [121.527393833503481, 13.069590155484516]]], [[[121.321308221523566, 18.504064642811013], [121.937601353036371, 18.21855235439838], [122.246006300954264, 18.478949896717094], [122.336956821787965, 18.224882717354173], [122.174279412933174, 17.810282701076371], [122.51565392465335, 17.09350474697197], [122.252310825693883, 16.262444362854122], [121.662786086108255, 15.931017564350125], [121.505069614753367, 15.124813544164621], [121.728828566577249, 14.328376369682244], [122.258925409027313, 14.218202216035973], [122.701275669445636, 14.336541245984417], [123.950295037940236, 13.782130642141066], [123.855107049658599, 13.237771104378464], [124.181288690284873, 12.997527370653469], [124.077419061378222, 12.536676947474573], [123.298035109552245, 13.027525539598981], [122.928651971529902, 13.552919826710404], [122.671355015148663, 13.185836289925131], [122.034649692880521, 13.784481919810343], [121.126384718918587, 13.636687323455559], [120.628637323083296, 13.857655747935649], [120.679383579593832, 14.271015529838319], [120.99181928923052, 14.525392767795079], [120.693336216312687, 14.756670640517282], [120.564145135582976, 14.396279201713821], [120.070428501466367, 14.970869452367094], [119.920928582846102, 15.406346747290735], [119.883773228028247, 16.363704331929963], [120.286487664878791, 16.034628811095327], [120.39004723519173, 17.599081122299506], [120.7158671407919, 18.505227362537536], [121.321308221523566, 18.504064642811013]]]] } }, + { "type": "Feature", "properties": { "admin": "Papua New Guinea", "name": "Papua New Guinea", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[155.880025669578401, -6.819996840037758], [155.599991082988765, -6.919990736522491], [155.166994256815087, -6.535931491729299], [154.729191522438327, -5.900828138862208], [154.514114211239644, -5.139117526880012], [154.652503696917336, -5.042430922061839], [154.759990676084357, -5.339983819198493], [155.062917922179338, -5.566791680527486], [155.547746209941693, -6.200654799019658], [156.019965448224752, -6.540013929880386], [155.880025669578401, -6.819996840037758]]], [[[151.982795851854462, -5.478063246282344], [151.459106887008659, -5.560280450058739], [151.301390415653884, -5.840728448106701], [150.754447056276661, -6.083762709175387], [150.241196730753813, -6.317753594592984], [149.709963006793316, -6.316513360218051], [148.890064732050462, -6.026040134305432], [148.318936802360696, -5.74714242922613], [148.401825799756864, -5.437755629094722], [149.298411900020824, -5.583741550319216], [149.845561965127217, -5.505503431829339], [149.996250441690279, -5.026101169457674], [150.139755894164921, -5.001348158389788], [150.236907586873485, -5.53222014732428], [150.807467075808063, -5.455842380396886], [151.089672072553981, -5.113692722192368], [151.647880894170811, -4.757073662946168], [151.537861769821518, -4.167807305521889], [152.136791620084352, -4.148790378438519], [152.338743117480988, -4.31296640382976], [152.318692661751754, -4.867661228050748], [151.982795851854462, -5.478063246282344]]], [[[147.191873814074938, -7.388024183789978], [148.084635858349372, -8.044108168167609], [148.734105259393573, -9.104663588093755], [149.306835158484432, -9.071435642130067], [149.266630894161324, -9.514406019736027], [150.038728469034311, -9.684318129111698], [149.738798456012262, -9.872937106977002], [150.801627638959133, -10.29368661869742], [150.690574985963849, -10.582712904505865], [150.028393182575826, -10.652476088099929], [149.782310012001972, -10.393267103723941], [148.923137648717216, -10.28092253992136], [147.913018426707993, -10.130440769087469], [147.135443150012236, -9.492443536012017], [146.567880894150619, -8.942554619994153], [146.048481073184917, -8.067414239131308], [144.74416792213799, -7.630128269077473], [143.897087844009661, -7.915330498896279], [143.286375767184268, -8.245491224809056], [143.413913202080664, -8.983068942910945], [142.628431431244223, -9.326820570516501], [142.068258905200196, -9.159595635620034], [141.033851760013874, -9.117892754760417], [141.017056919519007, -5.85902190513802], [141.000210402591847, -2.600151055515624], [142.735246616791443, -3.289152927263216], [144.583970982033236, -3.861417738463401], [145.27317955950997, -4.373737888205027], [145.829786411725649, -4.876497897972683], [145.981921828392956, -5.465609226100012], [147.648073358347574, -6.083659356310803], [147.891107619416175, -6.614014580922315], [146.970905389594861, -6.721656589386255], [147.191873814074938, -7.388024183789978]]], [[[153.14003787659874, -4.499983412294113], [152.827292108368255, -4.766427097190998], [152.63867313050298, -4.176127211120927], [152.406025832324929, -3.789742526874561], [151.953236932583536, -3.462062269711821], [151.384279413050024, -3.035421644710111], [150.6620495953388, -2.741486097833956], [150.939965448204532, -2.500002129734028], [151.479984165654514, -2.779985039891386], [151.820015090135087, -2.999971612157907], [152.239989455371074, -3.24000864015366], [152.640016717742526, -3.659983005389647], [153.019993524384631, -3.980015150573293], [153.14003787659874, -4.499983412294113]]]] } }, + { "type": "Feature", "properties": { "admin": "Poland", "name": "Poland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[15.016995883858666, 51.106674099321566], [14.607098422919531, 51.745188096719964], [14.685026482815685, 52.089947414755187], [14.437599725002197, 52.624850165408382], [14.074521111719488, 52.981262518925426], [14.353315463934136, 53.248171291712957], [14.119686313542584, 53.757029120491026], [14.802900424873455, 54.050706285205735], [16.363477003655728, 54.513158677785711], [17.622831658608671, 54.851535956432897], [18.620858595461637, 54.682605699270766], [18.696254510175461, 54.438718777069276], [19.6606400896064, 54.426083889373913], [20.89224450041862, 54.312524929412518], [22.731098667092649, 54.327536932993311], [23.243987257589506, 54.220566718149129], [23.484127638449841, 53.912497667041123], [23.527535841574995, 53.47012156840654], [23.804934930117774, 53.08973135030606], [23.799198846133375, 52.691099351606553], [23.19949384938618, 52.486977444053664], [23.508002150168689, 52.023646552124717], [23.52707075368437, 51.578454087930233], [24.029985792748899, 50.705406602575174], [23.922757195743259, 50.424881089878738], [23.426508416444388, 50.308505764357449], [22.518450148211596, 49.476773586619736], [22.776418898212619, 49.027395331409608], [22.558137648211751, 49.08573802346713], [21.607808058364206, 49.470107326854077], [20.887955356538406, 49.328772284535823], [20.415839471119849, 49.431453355499755], [19.825022820726865, 49.217125352569219], [19.320712517990469, 49.571574001659179], [18.909574822676316, 49.435845852244562], [18.85314415861361, 49.496229763377634], [18.392913852622168, 49.988628648470737], [17.649445021238986, 50.049038397819942], [17.554567091551117, 50.36214590107641], [16.868769158605655, 50.473973700556016], [16.719475945714429, 50.215746568393527], [16.176253289462263, 50.4226073268579], [16.238626743238566, 50.697732652379827], [15.490972120839725, 50.7847299261432], [15.016995883858666, 51.106674099321566]]] } }, + { "type": "Feature", "properties": { "admin": "Puerto Rico", "name": "Puerto Rico", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-66.2824344550082, 18.51476166429536], [-65.771302863209286, 18.426679185453875], [-65.591003790942935, 18.228034979723912], [-65.847163865813755, 17.975905666571855], [-66.599934455009475, 17.98182261806927], [-67.184162360285256, 17.946553453030074], [-67.24242753769434, 18.374460150622934], [-67.100679083917726, 18.520601101144347], [-66.2824344550082, 18.51476166429536]]] } }, + { "type": "Feature", "properties": { "admin": "North Korea", "name": "Dem. Rep. Korea", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[130.640015903852401, 42.39500946712527], [130.780007358931101, 42.220007229168843], [130.400030552288996, 42.280003567059701], [129.965948521037234, 41.941367906251052], [129.667362095254788, 41.601104437825221], [129.705189243692445, 40.882827867184318], [129.188114862179958, 40.661807766271984], [129.010399611528186, 40.485436102859801], [128.633368361526692, 40.189846910150301], [127.967414178581322, 40.025412502597547], [127.533435500194145, 39.756850083976694], [127.502119582225276, 39.323930772451526], [127.385434198110261, 39.213472398427648], [127.783342726757709, 39.050898342437414], [128.349716424676586, 38.612242946927843], [128.205745884311426, 38.370397243801882], [127.780035435090966, 38.304535630845884], [127.073308547067342, 38.256114813788393], [126.683719924018888, 37.804772854151174], [126.237338901881742, 37.840377916000271], [126.174758742376213, 37.749685777328033], [125.689103631697165, 37.940010077459014], [125.568439162295675, 37.752088731429616], [125.275330438336184, 37.66907054295271], [125.24008711151312, 37.857224432927424], [124.981033156433952, 37.948820909164773], [124.712160679219352, 38.108346055649783], [124.985994093933954, 38.548474229479673], [125.221948683778677, 38.665857245430665], [125.13285851450749, 38.848559271798578], [125.386589797060566, 39.387957872061158], [125.321115757346774, 39.551384589184202], [124.737482131042384, 39.660344346671614], [124.265624627785286, 39.928493353834149], [125.079941847840615, 40.569823716792442], [126.182045119329402, 41.107336127276362], [126.86908328664984, 41.816569322266176], [127.343782993682993, 41.50315176041596], [128.208433058790632, 41.466771552082477], [128.052215203972281, 41.994284572917934], [129.59666873587949, 42.424981797854542], [129.994267205933198, 42.985386867843779], [130.640015903852401, 42.39500946712527]]] } }, + { "type": "Feature", "properties": { "admin": "Portugal", "name": "Portugal", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-9.034817674180244, 41.880570583659669], [-8.671945766626719, 42.134689439454952], [-8.26385698081779, 42.280468654950326], [-8.01317460776991, 41.790886135417118], [-7.422512986673794, 41.792074693359822], [-7.251308966490822, 41.91834605566504], [-6.668605515967655, 41.883386949219577], [-6.389087693700914, 41.381815497394641], [-6.851126674822551, 41.111082668617513], [-6.864019944679383, 40.330871893874821], [-7.026413133156593, 40.184524237624238], [-7.066591559263527, 39.711891587882768], [-7.498632371439724, 39.629571031241802], [-7.098036668313126, 39.03007274022378], [-7.374092169616317, 38.373058580064914], [-7.029281175148794, 38.075764065089757], [-7.166507941099863, 37.803894354802217], [-7.537105475281022, 37.428904323876232], [-7.45372555177809, 37.097787583966053], [-7.855613165711985, 36.838268540996253], [-8.382816127953687, 36.978880113262449], [-8.898856980820325, 36.868809312480771], [-8.746101446965552, 37.6513455266766], [-8.839997524439879, 38.266243394517609], [-9.287463751655221, 38.358485826158592], [-9.526570603869713, 38.737429104154906], [-9.44698889814023, 39.392066148428363], [-9.048305223008425, 39.755093085278766], [-8.977353481471679, 40.159306138665798], [-8.7686840478771, 40.76063894303018], [-8.790853237330309, 41.18433401139125], [-8.990789353867568, 41.543459377603625], [-9.034817674180244, 41.880570583659669]]] } }, + { "type": "Feature", "properties": { "admin": "Paraguay", "name": "Paraguay", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-62.685057135657871, -22.24902922942238], [-62.291179368729203, -21.051634616787389], [-62.265961269770784, -20.513734633061272], [-61.786326463453761, -19.633736667562957], [-60.043564622626477, -19.342746677327419], [-59.11504248720609, -19.356906019775398], [-58.183471442280492, -19.868399346600359], [-58.166392381408038, -20.176700941653674], [-57.870673997617786, -20.732687676681948], [-57.937155727761287, -22.090175876557169], [-56.881509568902885, -22.282153822521476], [-56.473317430229379, -22.086300144135279], [-55.797958136606894, -22.356929620047815], [-55.61068274598113, -22.655619398694839], [-55.517639329639621, -23.57199757252663], [-55.400747239795407, -23.956935316668797], [-55.027901780809543, -24.001273695575225], [-54.652834235235119, -23.839578138933955], [-54.292959560754511, -24.021014092710722], [-54.293476325077435, -24.570799655863958], [-54.428946092330577, -25.162184747012162], [-54.625290696823562, -25.739255466415507], [-54.788794928595038, -26.621785577096126], [-55.695845506398143, -27.387837009390857], [-56.486701626192989, -27.548499037386286], [-57.609759690976134, -27.395898532828383], [-58.618173590719735, -27.123718763947089], [-57.633660040911117, -25.603656508081638], [-57.777217169817924, -25.162339776309032], [-58.807128465394968, -24.771459242453307], [-60.028966030504016, -24.032796319273267], [-60.846564704009907, -23.880712579038288], [-62.685057135657871, -22.24902922942238]]] } }, + { "type": "Feature", "properties": { "admin": "Palestine", "name": "Palestine", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.545665317534535, 32.393992011030569], [35.545251906076196, 31.782504787720832], [35.397560662586038, 31.489086005167572], [34.927408481594554, 31.35343537040141], [34.970506626125989, 31.616778469360803], [35.225891554512422, 31.754341132121759], [34.974640740709319, 31.866582343059715], [35.183930291491428, 32.532510687788935], [35.545665317534535, 32.393992011030569]]] } }, + { "type": "Feature", "properties": { "admin": "Qatar", "name": "Qatar", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[50.810108270069563, 24.754742539971371], [50.743910760303677, 25.482424221289389], [51.01335167827348, 26.006991685484191], [51.286461622936045, 26.114582017515865], [51.589078810437243, 25.801112779233375], [51.606700473848804, 25.215670477798735], [51.389607781790623, 24.627385972588051], [51.112415398977006, 24.556330878186721], [50.810108270069563, 24.754742539971371]]] } }, + { "type": "Feature", "properties": { "admin": "Romania", "name": "Romania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.710531447040488, 47.882193915389394], [23.142236362406798, 48.096341050806942], [23.760958286237404, 47.985598456405448], [24.402056105250374, 47.981877753280422], [24.866317172960571, 47.737525743188307], [25.207743361112986, 47.891056423527459], [25.945941196402394, 47.987148749374207], [26.197450392366925, 48.220881252630342], [26.619336785597788, 48.220726223333457], [26.924176059687561, 48.123264472030982], [27.233872918412736, 47.826770941756365], [27.551166212684841, 47.405117092470817], [28.128030226359037, 46.81047638608824], [28.160017937947707, 46.371562608417207], [28.054442986775392, 45.944586086605618], [28.233553501099035, 45.488283189468369], [28.679779493939371, 45.30403087013169], [29.149724969201646, 45.464925442072442], [29.603289015427425, 45.293308010431119], [29.62654340995876, 45.035390936862392], [29.141611769331831, 44.820210272799038], [28.837857700320196, 44.913873806328041], [28.55808149589199, 43.707461656258118], [27.970107049275068, 43.812468166675202], [27.242399529740904, 44.175986029632398], [26.065158725699739, 43.943493760751259], [25.569271681426923, 43.688444729174712], [24.100679152124169, 43.741051337247846], [23.332302280376322, 43.897010809904707], [22.94483239105184, 43.823785305347123], [22.657149692482985, 44.234923000661276], [22.474008416440594, 44.409227606781762], [22.705725538837349, 44.578002834647016], [22.459022251075933, 44.702517198254291], [22.145087924902807, 44.478422349620573], [21.562022739353605, 44.768947251965486], [21.483526238702233, 45.181170152357772], [20.874312778413351, 45.416375433934228], [20.76217492033998, 45.734573065771428], [20.220192498462833, 46.127468980486547], [21.021952345471245, 46.316087958351886], [21.626514926853869, 46.994237779318148], [22.09976769378283, 47.672439276716695], [22.710531447040488, 47.882193915389394]]] } }, + { "type": "Feature", "properties": { "admin": "Russia", "name": "Russia", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[143.648007440362846, 50.747600409541512], [144.65414757708561, 48.976390692737581], [143.173927850517174, 49.306551418650365], [142.558668247650076, 47.861575018904908], [143.533492466404027, 46.836728013692479], [143.505277134372591, 46.137907619809475], [142.747700636973889, 46.740764878926562], [142.092030064054484, 45.966755276058777], [141.906925083585008, 46.805928860046535], [142.018442824470867, 47.780132961612921], [141.904444614835029, 48.859188544299563], [142.135800002205656, 49.615163072297449], [142.179983351815281, 50.952342434281903], [141.594075962490024, 51.935434882202529], [141.682546014573632, 53.301966457728767], [142.606934035410745, 53.762145087287891], [142.209748976815376, 54.225475979216853], [142.654786411712934, 54.365880845753864], [142.914615513276544, 53.704577541714734], [143.260847609632037, 52.740760403039033], [143.235267775647628, 51.756660264688733], [143.648007440362846, 50.747600409541512]]], [[[22.731098667092649, 54.327536932993311], [20.892244500418652, 54.312524929412568], [19.6606400896064, 54.42608388937397], [19.88848147958134, 54.866160386771483], [21.268448927503492, 55.190481675835279], [22.315723504330599, 55.015298570365886], [22.757763706155281, 54.856574408581416], [22.651051873472564, 54.582740993866693], [22.731098667092649, 54.327536932993311]]], [[[180.000000000000114, 70.832199208546669], [178.903425, 70.78114], [178.7253, 71.0988], [180.000000000000114, 71.515714336428246], [180.000000000000114, 70.832199208546669]]], [[[143.60385, 73.21244], [142.08763, 73.20544], [140.038155, 73.31692], [139.86312, 73.36983], [140.81171, 73.76506], [142.06207, 73.85758], [143.48283, 73.47525], [143.60385, 73.21244]]], [[[150.73167, 75.08406], [149.575925, 74.68892], [147.977465, 74.778355], [146.11919, 75.17298], [146.358485, 75.49682], [148.22223, 75.345845], [150.73167, 75.08406]]], [[[145.086285, 75.562625], [144.3, 74.82], [140.61381, 74.84768], [138.95544, 74.61148], [136.97439, 75.26167], [137.51176, 75.94917], [138.831075, 76.13676], [141.471615, 76.09289], [145.086285, 75.562625]]], [[[57.535692579992386, 70.720463975702145], [56.944979282463933, 70.63274323188665], [53.677375115784187, 70.762657782668455], [53.412016635965372, 71.206661688920192], [51.601894565645708, 71.474759019650477], [51.455753615124209, 72.014881089965129], [52.478275180883564, 72.229441636840946], [52.444168735570841, 72.77473135038484], [54.427613559797649, 73.627547512497571], [53.508289829325136, 73.749813951300141], [55.902458937407644, 74.627486477345329], [55.631932814359701, 75.081412258597155], [57.868643833248839, 75.609390367323186], [61.170044386647497, 76.251883450008123], [64.498368361270209, 76.439055487769267], [66.210977003855092, 76.809782213031227], [68.157059767534818, 76.939696763812904], [68.852211134725124, 76.544811306454605], [68.180572544227644, 76.233641669409096], [64.637326287703004, 75.737754625136219], [61.583507521414752, 75.260884507946784], [58.477082147053366, 74.309056301562819], [56.986785516187993, 73.333043524866227], [55.41933597191094, 72.371267605265956], [55.622837762276291, 71.540594794390316], [57.535692579992386, 70.720463975702145]]], [[[106.970130000000111, 76.97419], [107.240000000000123, 76.48], [108.1538, 76.723350000000138], [111.077260000000138, 76.71], [113.33151, 76.22224], [114.13417, 75.84764], [113.88539, 75.327790000000121], [112.77918, 75.03186], [110.151250000000175, 74.47673], [109.4, 74.18], [110.64, 74.04], [112.11919, 73.787740000000113], [113.019540000000234, 73.976930000000138], [113.529580000000294, 73.33505], [113.96881, 73.59488], [115.56782, 73.75285], [118.776330000000215, 73.58772], [119.02, 73.12], [123.20066, 72.97122], [123.257770000000178, 73.73503], [125.380000000000166, 73.56], [126.97644, 73.56549], [128.59126, 73.03871], [129.05157, 72.39872], [128.46, 71.98], [129.715990000000204, 71.19304], [131.288580000000252, 70.786990000000102], [132.253500000000145, 71.8363], [133.857660000000294, 71.386420000000143], [135.56193, 71.655250000000123], [137.49755, 71.34763], [138.234090000000123, 71.62803], [139.86983, 71.487830000000116], [139.14791, 72.4161900000001], [140.46817, 72.849410000000134], [149.5, 72.2], [150.35118000000017, 71.60643], [152.96890000000019, 70.84222], [157.00688, 71.03141], [158.99779, 70.86672], [159.830310000000225, 70.45324], [159.70866, 69.72198], [160.94053000000028, 69.43728], [162.279070000000104, 69.64204], [164.05248, 69.66823], [165.940370000000172, 69.47199], [167.83567, 69.58269], [169.57763000000017, 68.6938], [170.816880000000253, 69.01363], [170.008200000000159, 69.65276], [170.453450000000259, 70.09703], [173.643910000000204, 69.81743], [175.72403000000017, 69.877250000000217], [178.6, 69.4], [180.000000000000114, 68.963636363636553], [180.000000000000114, 64.979708702198465], [179.99281, 64.97433], [178.707200000000199, 64.53493], [177.411280000000147, 64.60821], [178.313000000000187, 64.07593], [178.90825000000018, 63.251970000000128], [179.37034, 62.98262], [179.48636, 62.56894], [179.228250000000116, 62.304100000000133], [177.3643, 62.5219], [174.569290000000194, 61.76915], [173.68013, 61.65261], [172.15, 60.95], [170.6985, 60.33618], [170.330850000000282, 59.88177], [168.90046, 60.57355], [166.294980000000265, 59.7885500000002], [165.840000000000202, 60.16], [164.87674, 59.7316], [163.539290000000108, 59.86871], [163.217110000000218, 59.21101], [162.01733, 58.24328], [162.05297, 57.83912], [163.19191, 57.61503], [163.057940000000144, 56.159240000000111], [162.129580000000203, 56.12219], [161.70146, 55.285680000000148], [162.117490000000117, 54.85514], [160.368770000000325, 54.34433], [160.021730000000218, 53.20257], [158.530940000000157, 52.958680000000236], [158.23118, 51.94269], [156.789790000000266, 51.01105], [156.42000000000013, 51.7], [155.99182, 53.15895], [155.43366, 55.381030000000109], [155.914420000000291, 56.767920000000132], [156.75815, 57.3647], [156.81035, 57.83204], [158.364330000000166, 58.05575], [160.150640000000124, 59.314770000000109], [161.87204, 60.343000000000117], [163.66969, 61.1409], [164.473550000000103, 62.55061], [163.258420000000172, 62.46627], [162.65791, 61.6425], [160.12148, 60.54423], [159.30232, 61.77396], [156.72068, 61.43442], [154.218060000000293, 59.758180000000117], [155.04375, 59.14495], [152.81185, 58.88385], [151.265730000000246, 58.78089], [151.33815, 59.50396], [149.78371, 59.655730000000126], [148.54481, 59.16448], [145.48722, 59.33637], [142.197820000000121, 59.03998], [138.958480000000293, 57.08805], [135.12619, 54.72959], [136.70171, 54.603550000000112], [137.19342, 53.97732], [138.1647, 53.755010000000247], [138.80463, 54.25455], [139.90151, 54.189680000000166], [141.34531, 53.089570000000109], [141.37923, 52.23877], [140.59742000000017, 51.23967], [140.51308, 50.045530000000113], [140.061930000000189, 48.446710000000152], [138.554720000000202, 46.99965], [138.21971, 46.30795], [136.86232, 45.143500000000174], [135.515350000000183, 43.989], [134.869390000000237, 43.39821], [133.536870000000249, 42.81147], [132.90627, 42.79849], [132.278070000000241, 43.284560000000106], [130.935870000000136, 42.55274], [130.78, 42.220000000000191], [130.640000000000157, 42.395], [130.633866408409801, 42.903014634770543], [131.144687941614961, 42.929989732426932], [131.288555129115593, 44.111519680348252], [131.025190000000237, 44.96796], [131.883454217659562, 45.321161607436508], [133.097120000000189, 45.14409], [133.769643996313164, 46.116926988299149], [134.112350000000163, 47.212480000000127], [134.50081, 47.578450000000139], [135.026311476786759, 48.478229885443902], [133.373595819228001, 48.183441677434836], [132.506690000000106, 47.78896], [130.987260000000106, 47.79013], [130.582293328982644, 48.72968740497619], [129.397817824420486, 49.4406000840156], [127.657400000000351, 49.76027], [127.287455682484904, 50.739797268265434], [126.939156528837827, 51.353894151405896], [126.564399041856959, 51.784255479532689], [125.946348911646439, 52.792798570356936], [125.068211297710434, 53.161044826868924], [123.57147, 53.4588], [122.245747918793043, 53.431725979213681], [121.003084751470354, 53.251401068731226], [120.177088657716865, 52.753886216841195], [120.725789015791975, 52.516226304730893], [120.7382, 51.96411], [120.182080000000155, 51.64355], [119.27939, 50.58292], [119.288460728025839, 50.142882798861947], [117.87924441942647, 49.510983384797036], [116.67880089728618, 49.888531399121398], [115.485695428531415, 49.805177313834733], [114.962109816550353, 50.140247300815119], [114.362456496235325, 50.24830272073747], [112.897739699354361, 49.543565375356984], [111.581230910286649, 49.377968248077671], [110.662010532678835, 49.130128078805846], [109.402449171996707, 49.292960516957685], [108.475167270951275, 49.282547715850704], [107.868175897251092, 49.793705145865871], [106.888804152455293, 50.274295966180276], [105.886591424586868, 50.40601919209216], [104.62158, 50.275320000000157], [103.676545444760336, 50.08996613219513], [102.25589, 50.510560000000105], [102.06521, 51.25991], [100.889480421962631, 51.516855780638409], [99.981732212323564, 51.63400625264395], [98.861490513100492, 52.047366034546698], [97.82573978067451, 51.010995184933236], [98.231761509191699, 50.422400621128716], [97.259760000000199, 49.72605], [95.814020000000156, 49.977460000000114], [94.815949334698757, 50.01343333597088], [94.147566359435601, 50.480536607457161], [93.10421, 50.49529], [92.234711541719676, 50.802170722041737], [90.713667433640765, 50.331811835321098], [88.805566847695573, 49.470520738312459], [87.751264276076824, 49.297197984405543], [87.359970330762692, 49.214980780629148], [86.829356723989648, 49.826674709668133], [85.541269972682485, 49.69285858824815], [85.115559523462082, 50.117302964877631], [84.416377394553038, 50.311399644565817], [83.935114780618903, 50.889245510453563], [83.383003778012451, 51.069182847693881], [81.945985548839943, 50.812195949906325], [80.568446893235446, 51.388336493528435], [80.035559523441705, 50.864750881547209], [77.80091556184432, 53.404414984747532], [76.525179477854749, 54.177003485727127], [76.891100294913443, 54.490524400441913], [74.384820000000119, 53.546850000000113], [73.425678745420512, 53.489810289109741], [73.50851606638436, 54.035616766976588], [72.224150018202195, 54.376655381886778], [71.180131056609468, 54.133285224008247], [70.86526655465515, 55.169733588270091], [69.068166945272893, 55.385250149143488], [68.169100376258896, 54.970391750704366], [65.66687, 54.601250000000149], [65.178533563095939, 54.354227810272064], [61.436600000000126, 54.00625], [60.978066440683236, 53.664993394579128], [61.69998619980062, 52.979996446334255], [60.73999311711453, 52.719986477257734], [60.927268507740237, 52.447548326214999], [59.967533807215567, 51.96042043721566], [61.588003371024136, 51.272658799843171], [61.337424350840998, 50.799070136104248], [59.932807244715555, 50.842194118851822], [59.642282342370564, 50.545442206415707], [58.363320000000122, 51.06364], [56.77798, 51.04355], [55.71694, 50.621710000000142], [54.532878452376181, 51.026239732459359], [52.328723585831042, 51.718652248738088], [50.766648390512174, 51.692762356159861], [48.702381626181044, 50.605128485712825], [48.577841424357601, 49.87475962991563], [47.549480421749379, 50.454698391311119], [46.751596307162764, 49.356005764353725], [47.043671502476585, 49.152038886097571], [46.466445753776291, 48.394152330104923], [47.315240000000152, 47.71585], [48.05725, 47.74377], [48.694733514201872, 47.075628160177885], [48.59325000000014, 46.56104], [49.101160000000121, 46.39933], [48.645410000000105, 45.80629], [47.67591, 45.641490000000111], [46.68201, 44.6092], [47.59094, 43.660160000000118], [47.49252, 42.98658], [48.58437000000017, 41.80888], [47.987283156126033, 41.405819200194387], [47.815665724484653, 41.151416124021338], [47.373315464066387, 41.219732367511135], [46.686070591016708, 41.827137152669899], [46.404950799348924, 41.860675157227426], [45.7764, 42.092440000000224], [45.470279168485909, 42.502780666670041], [44.537622918482057, 42.711992702803677], [43.93121, 42.554960000000101], [43.755990000000182, 42.74083], [42.394400000000154, 43.2203], [40.922190000000128, 43.382150000000131], [40.076964959479838, 43.553104153002486], [39.95500857927108, 43.434997666999287], [38.68, 44.28], [37.539120000000104, 44.65721], [36.675460000000122, 45.24469], [37.40317, 45.40451], [38.23295, 46.24087], [37.67372, 46.63657], [39.14767, 47.044750000000128], [39.121200000000123, 47.26336], [38.22353803889947, 47.102189846375971], [38.2551123390298, 47.546400458356956], [38.77057, 47.825620000000228], [39.738277622238982, 47.898937079452068], [39.895620000000136, 48.23241], [39.67465, 48.783820000000127], [40.080789015469477, 49.307429917999364], [40.069040000000108, 49.60105], [38.594988234213552, 49.926461900423718], [38.010631137857068, 49.915661526074715], [37.393459506995228, 50.383953355503664], [36.626167840325387, 50.225590928745127], [35.35611616388811, 50.577197374059139], [35.37791, 50.77394], [35.02218305841793, 51.207572333371495], [34.224815708154402, 51.255993150428921], [34.141978387190612, 51.56641347920619], [34.391730584457228, 51.768881740925892], [33.75269982273587, 52.335074571331646], [32.715760532367163, 52.238465481162159], [32.412058139787767, 52.288694973349763], [32.15944000000021, 52.061250000000101], [31.78597, 52.10168], [31.540018344862254, 52.742052313846429], [31.305200636527978, 53.073995876673301], [31.49764, 53.167430000000124], [32.304519484188368, 53.132726141972839], [32.693643019346119, 53.351420803432141], [32.405598585751157, 53.618045355842], [31.731272820774585, 53.794029446012011], [31.791424187962399, 53.974638576872181], [31.384472283663818, 54.157056382862365], [30.757533807098774, 54.811770941784388], [30.971835971813245, 55.08154775656412], [30.873909132620064, 55.55097646750351], [29.896294386522435, 55.789463202530484], [29.371571893030783, 55.670090643936263], [29.229513380660389, 55.918344224666399], [28.176709425577933, 56.169129950578778], [27.855282016722519, 56.759326483784363], [27.770015903440985, 57.244258124411189], [27.288184848751648, 57.474528306703903], [27.716685825315771, 57.791899115624439], [27.420150000000202, 58.724570000000128], [28.131699253051856, 59.300825100330982], [27.98112, 59.47537], [29.1177, 60.028050000000107], [28.07, 60.503520000000137], [30.211107212044645, 61.780027777749673], [31.139991082491029, 62.357692776124431], [31.516092156711263, 62.867687486412898], [30.035872430142796, 63.552813625738551], [30.444684686003736, 64.204453436939062], [29.544429559047014, 64.948671576590542], [30.21765, 65.80598], [29.054588657352376, 66.944286200622017], [29.977426385220689, 67.69829702419274], [28.445943637818765, 68.364612942163987], [28.591929559043358, 69.064776923286686], [29.39955, 69.15692000000017], [31.101080000000103, 69.55811], [32.132720000000255, 69.905950000000232], [33.77547, 69.301420000000107], [36.51396, 69.06342], [40.292340000000159, 67.9324], [41.059870000000124, 67.457130000000106], [41.125950000000174, 66.79158000000011], [40.01583, 66.266180000000119], [38.38295, 65.99953], [33.918710000000168, 66.75961], [33.18444, 66.63253], [34.81477, 65.900150000000124], [34.87857425307876, 65.436212877048192], [34.943910000000152, 64.414370000000147], [36.23129, 64.10945], [37.012730000000111, 63.84983], [37.141970000000143, 64.33471], [36.539579035089801, 64.76446], [37.176040000000135, 65.143220000000113], [39.59345, 64.520790000000162], [40.4356, 64.76446], [39.762600000000148, 65.49682], [42.09309, 66.47623], [43.01604000000011, 66.41858], [43.94975000000013, 66.06908], [44.53226, 66.756340000000122], [43.69839, 67.35245], [44.187950000000136, 67.95051], [43.45282, 68.57079], [46.250000000000135, 68.25], [46.821340000000156, 67.68997], [45.55517, 67.56652], [45.56202, 67.010050000000192], [46.349150000000137, 66.66767], [47.894160000000248, 66.884550000000146], [48.13876, 67.52238], [50.227660000000142, 67.998670000000132], [53.717430000000164, 68.85738], [54.47171, 68.80815], [53.485820000000118, 68.20131], [54.72628, 68.09702], [55.442680000000124, 68.43866], [57.317020000000149, 68.46628], [58.802000000000206, 68.88082], [59.941420000000178, 68.27844], [61.077840000000165, 68.94069], [60.03, 69.52], [60.55, 69.85], [63.504000000000147, 69.54739], [64.888115, 69.234835000000132], [68.512160000000108, 68.09233000000016], [69.18068, 68.61563000000011], [68.16444, 69.14436], [68.13522, 69.35649], [66.930080000000103, 69.454610000000102], [67.25976, 69.92873], [66.724920000000125, 70.708890000000125], [66.69466, 71.028970000000228], [68.540060000000111, 71.934500000000227], [69.19636, 72.843360000000146], [69.94, 73.04000000000012], [72.58754, 72.77629], [72.79603, 72.22006], [71.84811, 71.40898], [72.47011, 71.09019], [72.79188, 70.39114], [72.564700000000201, 69.02085], [73.66787, 68.4079], [73.2387, 67.7404], [71.280000000000101, 66.320000000000149], [72.423010000000147, 66.172670000000167], [72.82077, 66.53267], [73.920990000000131, 66.789460000000119], [74.186510000000183, 67.28429], [75.052, 67.760470000000154], [74.469260000000148, 68.32899], [74.93584, 68.98918], [73.84236, 69.07146], [73.601870000000204, 69.62763], [74.3998, 70.63175], [73.1011, 71.447170000000241], [74.890820000000204, 72.12119], [74.65926, 72.83227], [75.158010000000175, 72.854970000000108], [75.68351, 72.300560000000118], [75.288980000000109, 71.33556], [76.35911, 71.152870000000135], [75.903130000000161, 71.87401], [77.5766500000001, 72.26717], [79.652020000000107, 72.32011], [81.5, 71.75], [80.61071, 72.582850000000107], [80.51109, 73.6482], [82.25, 73.85], [84.65526, 73.805910000000154], [86.822300000000226, 73.93688], [86.00956, 74.459670000000145], [87.166820000000143, 75.11643], [88.31571, 75.14393], [90.26, 75.64], [92.90058, 75.77333], [93.234210000000132, 76.0472], [95.860000000000127, 76.14], [96.67821, 75.91548], [98.922540000000197, 76.44689], [100.759670000000199, 76.43028], [101.03532, 76.86189], [101.990840000000105, 77.287540000000192], [104.3516, 77.69792], [106.066640000000135, 77.37389], [104.705000000000211, 77.1274], [106.970130000000111, 76.97419]]], [[[105.07547, 78.30689], [99.43814, 77.921], [101.2649, 79.23399], [102.08635, 79.34641], [102.837815, 79.28129], [105.37243, 78.71334], [105.07547, 78.30689]]], [[[51.136186557831266, 80.54728017854093], [49.793684523320692, 80.415427761548202], [48.894411248577526, 80.33956675894369], [48.75493655782175, 80.175468248200829], [47.586119012244147, 80.010181179515328], [46.502825962109647, 80.247246812654339], [47.072455275262897, 80.559424140129451], [44.846958042181107, 80.589809882317169], [46.799138624871226, 80.771917629713627], [48.31847741068465, 80.784009914869927], [48.52280602396668, 80.514568996900138], [49.097189568890897, 80.753985907708412], [50.039767693894603, 80.918885403151791], [51.522932977103679, 80.699725653801906], [51.136186557831266, 80.54728017854093]]], [[[99.93976, 78.88094], [97.75794, 78.7562], [94.97259, 79.044745], [93.31288, 79.4265], [92.5454, 80.14379], [91.18107, 80.34146], [93.77766, 81.0246], [95.940895, 81.2504], [97.88385, 80.746975], [100.186655, 79.780135], [99.93976, 78.88094]]]] } }, + { "type": "Feature", "properties": { "admin": "Rwanda", "name": "Rwanda", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.419104852019235, -1.134659112150416], [30.816134881317705, -1.698914076345388], [30.758308953583104, -2.287250257988368], [30.469696079232978, -2.413857517103458], [29.938359002407935, -2.348486830254238], [29.632176141078585, -2.917857761246096], [29.02492638521678, -2.839257907730157], [29.117478875451546, -2.292211195488384], [29.254834832483336, -2.215109958508911], [29.29188683443661, -1.620055840667987], [29.579466180140876, -1.341313164885626], [29.821518588996003, -1.443322442229785], [30.419104852019235, -1.134659112150416]]] } }, + { "type": "Feature", "properties": { "admin": "Western Sahara", "name": "W. Sahara", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-8.794883999049075, 27.120696316022503], [-8.81782833498667, 27.656425889592349], [-8.665589565454805, 27.656425889592349], [-8.66512447756419, 27.58947907155822], [-8.684399786809051, 27.395744126895998], [-8.687293667017398, 25.881056219988899], [-11.969418911171159, 25.933352769468261], [-11.93722449385332, 23.374594224536164], [-12.874221564169574, 23.284832261645171], [-13.118754441774708, 22.771220201096249], [-12.929101935263528, 21.327070624267559], [-16.845193650773989, 21.333323472574875], [-17.063423224342568, 20.99975210213082], [-17.020428432675736, 21.422310288981475], [-17.002961798561085, 21.420734157796574], [-14.750954555713532, 21.50060008390366], [-14.630832688851068, 21.860939846274899], [-14.221167771857251, 22.310163072188153], [-13.891110398809044, 23.691009019459297], [-12.500962693725368, 24.770116278578193], [-12.030758836301613, 26.030866197203036], [-11.718219773800353, 26.104091701760616], [-11.392554897496977, 26.883423977154358], [-10.551262579785272, 26.990807603456879], [-10.18942420087758, 26.860944729107398], [-9.735343390328877, 26.860944729107398], [-9.413037482124464, 27.088476060488514], [-8.794883999049075, 27.120696316022503]]] } }, + { "type": "Feature", "properties": { "admin": "Saudi Arabia", "name": "Saudi Arabia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[42.779332309750963, 16.34789134364868], [42.64957278826607, 16.77463532151496], [42.347989129410706, 17.075805568911996], [42.270887892431219, 17.474721787989122], [41.754381951673949, 17.833046169500971], [41.221391229015573, 18.671599636301206], [40.939341261566533, 19.486485297111752], [40.247652215339819, 20.174634507726488], [39.801684604660934, 20.338862209550054], [39.139399448408277, 21.29190481209293], [39.023695916506782, 21.986875311770191], [39.066328973147577, 22.579655666590263], [38.492772251140075, 23.688451036060851], [38.023860304523616, 24.078685614512928], [37.483634881344379, 24.285494696545008], [37.154817742671177, 24.858482977797301], [37.209491408035994, 25.084541530858104], [36.931627231602583, 25.602959499610172], [36.639603712721218, 25.826227525327219], [36.249136590323808, 26.570135606384873], [35.640181512196385, 27.376520494083415], [35.130186801907875, 28.063351955674712], [34.632336053207972, 28.058546047471559], [34.787778761541936, 28.607427273059692], [34.832220493312938, 28.957483425404838], [34.956037225084252, 29.356554673778835], [36.068940870922049, 29.19749461518445], [36.501214227043583, 29.505253607698702], [36.740527784987243, 29.865283311476183], [37.503581984209028, 30.003776150018396], [37.668119744626374, 30.338665269485894], [37.998848911294367, 30.508499864213128], [37.002165561681004, 31.508412990844736], [39.004885695152545, 32.010216986614971], [39.195468377444961, 32.16100881604266], [40.399994337736238, 31.889991766887931], [41.889980910007829, 31.190008653278362], [44.709498732284736, 29.178891099559376], [46.568713413281742, 29.099025173452283], [47.459821811722819, 29.002519436147217], [47.708850538937376, 28.526062730416136], [48.416094191283939, 28.552004299426663], [48.807594842327163, 27.689627997339876], [49.299554477745815, 27.461218166609804], [49.470913527225647, 27.109999294538078], [50.152422316290874, 26.689663194275994], [50.212935418504671, 26.277026882425371], [50.113303257045928, 25.943972276304248], [50.23985883972874, 25.608049628190923], [50.527386509000728, 25.327808335872099], [50.660556675016885, 24.999895534764018], [50.810108270069563, 24.754742539971371], [51.112415398977006, 24.556330878186721], [51.389607781790623, 24.627385972588051], [51.579518670463258, 24.245497137951102], [51.617707553926969, 24.014219265228824], [52.000733270074321, 23.001154486578937], [55.006803012924898, 22.496947536707129], [55.208341098863187, 22.708329982997039], [55.666659376859812, 22.000001125572336], [54.999981723862355, 19.999994004796104], [52.000009800022227, 19.000003363516054], [49.116671583864857, 18.616667588774941], [48.183343540241324, 18.166669216377311], [47.466694777217626, 17.116681626854877], [47.000004917189749, 16.949999294497438], [46.749994337761642, 17.283338120996174], [46.366658563020529, 17.233315334537632], [45.399999220568752, 17.333335069238554], [45.216651238797184, 17.43332896572333], [44.062613152855072, 17.410358791569589], [43.791518589051904, 17.319976711491105], [43.380794305196098, 17.579986680567668], [43.115797560403351, 17.088440456607369], [43.218375278502734, 16.666889960186406], [42.779332309750963, 16.34789134364868]]] } }, + { "type": "Feature", "properties": { "admin": "Sudan", "name": "Sudan", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.963392794971178, 9.464285229420623], [33.824963480907506, 9.48406084571536], [33.842130853028145, 9.981914637215992], [33.721959248183097, 10.325262079630191], [33.206938084561777, 10.720111638406591], [33.086766479716729, 11.441141267476493], [33.206938084561777, 12.179338268667093], [32.743419037302537, 12.24800775714999], [32.674749548819641, 12.024831919580716], [32.073891524594778, 11.973329803218517], [32.314234734284746, 11.681484477166519], [32.400071594888338, 11.080626452941486], [31.850715687025509, 10.531270545078822], [31.352861895524875, 9.810240916008693], [30.837840731903377, 9.707236683284519], [29.996639497988546, 10.290927335388684], [29.618957311332842, 10.084918869940223], [29.515953078608607, 9.793073543888053], [29.000931914987166, 9.604232450560287], [28.966597170745779, 9.398223985111654], [27.970889587744345, 9.398223985111654], [27.833550610778783, 9.604232450560287], [27.112520981708876, 9.638567194801622], [26.752006167173811, 9.466893473594492], [26.477328213242508, 9.552730334198086], [25.96230704962101, 10.136420986302422], [25.790633328413943, 10.411098940233726], [25.069603699343979, 10.27375996326799], [24.79492574541268, 9.810240916008693], [24.537415163602017, 8.917537565731719], [24.194067721187643, 8.728696472403895], [23.886979580860665, 8.619729712933063], [23.805813429466745, 8.666318874542522], [23.459012892355979, 8.954285793489019], [23.394779087017291, 9.26506785729225], [23.557249790142915, 9.681218166538766], [23.554304233502187, 10.089255275915319], [22.977543572692749, 10.714462591998538], [22.864165480244246, 11.142395127807616], [22.87622, 11.384610000000119], [22.50869, 11.67936], [22.49762, 12.26024], [22.28801, 12.64605], [21.93681, 12.588180000000133], [22.03759, 12.95546], [22.29658, 13.37232], [22.18329, 13.78648], [22.51202, 14.09318], [22.30351, 14.32682], [22.567950000000106, 14.944290000000134], [23.02459, 15.68072], [23.886890000000101, 15.61084], [23.837660000000135, 19.580470000000101], [23.850000000000129, 20.0], [25.00000000000011, 20.00304], [25.00000000000011, 22.0], [29.02, 22.0], [32.9, 22.0], [36.86623, 22.0], [37.18872, 21.01885], [36.96941, 20.837440000000125], [37.114700000000134, 19.80796], [37.48179, 18.61409], [37.86276, 18.36786], [38.410089959473218, 17.998307399970312], [37.904000000000103, 17.42754], [37.16747, 17.263140000000128], [36.852530000000108, 16.95655], [36.75389, 16.29186], [36.32322, 14.82249], [36.42951, 14.42211], [36.27022, 13.563330000000118], [35.86363, 12.57828], [35.26049, 12.08286], [34.831630000000125, 11.318960000000116], [34.73115000000012, 10.910170000000106], [34.25745, 10.63009], [33.96162, 9.58358], [33.963392794971178, 9.464285229420623]]] } }, + { "type": "Feature", "properties": { "admin": "South Sudan", "name": "S. Sudan", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.963392794971178, 9.464285229420623], [33.97498, 8.68456], [33.82550000000014, 8.37916], [33.294800000000116, 8.35458], [32.95418, 7.7849700000001], [33.56829, 7.71334], [34.0751, 7.22595], [34.25032, 6.82607], [34.70702, 6.59422000000012], [35.298007118233095, 5.506], [34.620196267853935, 4.847122742082034], [34.005, 4.249884947362147], [33.39, 3.79], [32.68642, 3.79232], [31.881450000000136, 3.55827], [31.24556, 3.7819], [30.83385, 3.50917], [29.95349, 4.1737], [29.715995314256013, 4.600804755060152], [29.159078403446635, 4.389267279473244], [28.696677687298795, 4.455077215996993], [28.428993768026992, 4.287154649264607], [27.979977247842946, 4.408413397637388], [27.374226108517625, 5.233944403500173], [27.213409051225248, 5.550953477394613], [26.465909458123289, 5.946717434101855], [26.213418409945113, 6.546603298362127], [25.796647983511257, 6.979315904158169], [25.124130893664805, 7.500085150579422], [25.114932488716867, 7.825104071479244], [24.567369012152191, 8.229187933785452], [23.886979580860665, 8.619729712933063], [24.194067721187643, 8.728696472403895], [24.537415163602017, 8.917537565731719], [24.79492574541268, 9.810240916008693], [25.069603699343979, 10.27375996326799], [25.790633328413943, 10.411098940233726], [25.96230704962101, 10.136420986302422], [26.477328213242508, 9.552730334198086], [26.752006167173811, 9.466893473594492], [27.112520981708876, 9.638567194801622], [27.833550610778783, 9.604232450560287], [27.970889587744345, 9.398223985111654], [28.966597170745779, 9.398223985111654], [29.000931914987166, 9.604232450560287], [29.515953078608607, 9.793073543888053], [29.618957311332842, 10.084918869940223], [29.996639497988546, 10.290927335388684], [30.837840731903377, 9.707236683284519], [31.352861895524875, 9.810240916008693], [31.850715687025509, 10.531270545078822], [32.400071594888338, 11.080626452941486], [32.314234734284746, 11.681484477166519], [32.073891524594778, 11.973329803218517], [32.674749548819641, 12.024831919580716], [32.743419037302537, 12.24800775714999], [33.206938084561777, 12.179338268667093], [33.086766479716729, 11.441141267476493], [33.206938084561777, 10.720111638406591], [33.721959248183097, 10.325262079630191], [33.842130853028145, 9.981914637215992], [33.824963480907506, 9.48406084571536], [33.963392794971178, 9.464285229420623]]] } }, + { "type": "Feature", "properties": { "admin": "Senegal", "name": "Senegal", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-16.713728807023468, 13.594958604379853], [-17.126106736712611, 14.373515733289221], [-17.625042690490655, 14.72954051356407], [-17.185172898822227, 14.91947724045286], [-16.700706346085919, 15.621527411354107], [-16.463098110407881, 16.135036119038457], [-16.120690070041928, 16.45566254319338], [-15.623666144258689, 16.369337063049809], [-15.135737270558813, 16.587282416240779], [-14.577347581428977, 16.598263658102805], [-14.099521450242175, 16.304302273010489], [-13.43573767745306, 16.039383042866188], [-12.830658331747513, 15.303691514542942], [-12.170750291380299, 14.616834214735503], [-12.124887457721256, 13.994727484589784], [-11.927716030311613, 13.422075100147392], [-11.553397793005427, 13.141213690641063], [-11.467899135778522, 12.754518947800973], [-11.513942836950587, 12.442987575729415], [-11.658300950557928, 12.386582749882834], [-12.20356482588563, 12.465647691289401], [-12.278599005573438, 12.354440008997285], [-12.499050665730561, 12.332089952031053], [-13.217818162478235, 12.575873521367964], [-13.700476040084322, 12.586182969610192], [-15.548476935274005, 12.628170070847343], [-15.816574266004251, 12.515567124883345], [-16.147716844130581, 12.547761542201185], [-16.67745195155457, 12.38485158940105], [-16.84152462408127, 13.151393947802557], [-15.931295945692208, 13.130284125211331], [-15.691000535534991, 13.270353094938455], [-15.511812506562931, 13.278569647672864], [-15.141163295949463, 13.509511623585235], [-14.712197231494626, 13.298206691943774], [-14.277701788784553, 13.28058502853224], [-13.844963344772404, 13.505041612191999], [-14.046992356817478, 13.794067898000446], [-14.376713833055785, 13.625680243377371], [-14.687030808968483, 13.63035696049978], [-15.081735398813816, 13.876491807505982], [-15.398770310924457, 13.860368760630916], [-15.624596320039936, 13.623587347869556], [-16.713728807023468, 13.594958604379853]]] } }, + { "type": "Feature", "properties": { "admin": "Solomon Islands", "name": "Solomon Is.", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[162.119024693040842, -10.482719008021133], [162.398645868172196, -10.826367282762119], [161.700032180018354, -10.820011081590222], [161.319796991214702, -10.204751478723123], [161.917383254237933, -10.446700534713653], [162.119024693040842, -10.482719008021133]]], [[[160.852228631837903, -9.872937106977002], [160.462588332357228, -9.89520964929484], [159.849447463214176, -9.794027194867367], [159.640002883135139, -9.639979750205269], [159.70294477766663, -9.242949720906777], [160.362956170898428, -9.400304457235533], [160.688517694337179, -9.610162448772808], [160.852228631837903, -9.872937106977002]]], [[[161.679981724289121, -9.599982191611373], [161.52939660059053, -9.784312025596433], [160.788253208660507, -8.917543226764918], [160.579997186524338, -8.320008640173965], [160.92002811100491, -8.320008640173965], [161.280006138349961, -9.120011488484449], [161.679981724289121, -9.599982191611373]]], [[[159.875027297198585, -8.337320244991714], [159.917401971677975, -8.538289890174864], [159.133677199539335, -8.114181410355398], [158.586113722974687, -7.754823500197713], [158.211149530264834, -7.421872246941147], [158.359977655265425, -7.320017998893915], [158.820001255527671, -7.56000335045739], [159.640002883135139, -8.020026950719567], [159.875027297198585, -8.337320244991714]]], [[[157.53842573468927, -7.347819919466928], [157.339419793933217, -7.404767347852554], [156.902030471014768, -7.176874281445391], [156.491357863591304, -6.765943291860394], [156.542827590153934, -6.599338474151478], [157.140000441718882, -7.021638278840653], [157.53842573468927, -7.347819919466928]]]] } }, + { "type": "Feature", "properties": { "admin": "Sierra Leone", "name": "Sierra Leone", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-11.438779466182053, 6.785916856305746], [-11.708194545935736, 6.860098374860724], [-12.428098924193815, 7.262942002792029], [-12.949049038128193, 7.798645738145736], [-13.124025437868479, 8.163946438016977], [-13.246550258832512, 8.903048610871506], [-12.711957566773076, 9.342711696810765], [-12.596719122762206, 9.620188300001969], [-12.425928514037562, 9.835834051955953], [-12.150338100625003, 9.858571682164378], [-11.917277390988655, 10.046983954300556], [-11.117481248407328, 10.045872911006283], [-10.839151984083299, 9.688246161330367], [-10.622395188835037, 9.267910061068276], [-10.65477047366589, 8.977178452994194], [-10.494315151399629, 8.715540676300433], [-10.505477260774667, 8.348896389189603], [-10.230093553091276, 8.406205552601291], [-10.695594855176477, 7.939464016141085], [-11.14670427086838, 7.396706447779534], [-11.199801805048278, 7.105845648624735], [-11.438779466182053, 6.785916856305746]]] } }, + { "type": "Feature", "properties": { "admin": "El Salvador", "name": "El Salvador", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-87.793111131526558, 13.384480495655051], [-87.904112108089507, 13.149016831917134], [-88.483301561216791, 13.163951320849488], [-88.843227912129692, 13.259733588102474], [-89.256742723329282, 13.4585328231293], [-89.812393561547637, 13.520622056527994], [-90.095554572290951, 13.73533763270073], [-90.064677903996568, 13.881969509328924], [-89.7219339668207, 14.134228013561694], [-89.5342193265205, 14.244815578666302], [-89.587342698916544, 14.362586167859485], [-89.353325975282772, 14.424132798719112], [-89.058511929057644, 14.340029405164085], [-88.843072882832814, 14.140506700085169], [-88.541230841815974, 13.980154730683475], [-88.50399797234968, 13.845485948130854], [-88.065342576840123, 13.964625962779774], [-87.859515347021585, 13.893312486216979], [-87.723502977229387, 13.785050360565503], [-87.793111131526558, 13.384480495655051]]] } }, + { "type": "Feature", "properties": { "admin": "Somaliland", "name": "Somaliland", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[48.938129510296491, 9.451748968946672], [48.486735874226994, 8.837626247589979], [47.78942, 8.003], [46.948328484897942, 7.996876532417386], [43.67875, 9.183580000000116], [43.296975132018744, 9.540477403191742], [42.92812, 10.021940000000139], [42.55876, 10.572580000000126], [42.776851841000948, 10.926878566934416], [43.145304803242126, 11.462039699748853], [43.470659620951658, 11.27770986576388], [43.666668328634834, 10.864169216348158], [44.117803582542805, 10.445538438351603], [44.614259067570849, 10.442205308468941], [45.556940545439133, 10.698029486529775], [46.645401238802997, 10.816549383991171], [47.525657586462778, 11.127228094929986], [48.021596307167769, 11.193063869669741], [48.378783807169263, 11.375481675660122], [48.948206414593457, 11.410621649618516], [48.942005242718423, 11.394266058798163], [48.938491245322595, 10.982327378783451], [48.938232863161076, 9.973500067581481], [48.938129510296491, 9.451748968946672]]] } }, + { "type": "Feature", "properties": { "admin": "Somalia", "name": "Somalia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[49.72862, 11.5789], [50.25878, 11.67957], [50.73202, 12.0219], [51.1112, 12.02464], [51.13387, 11.74815], [51.04153, 11.16651], [51.04531, 10.6409], [50.83418, 10.27972], [50.55239, 9.19874], [50.07092, 8.08173], [49.4527, 6.80466], [48.59455, 5.33911], [47.74079, 4.2194], [46.56476, 2.85529], [45.56399, 2.04576], [44.06815, 1.05283], [43.13597, 0.2922], [42.04157, -0.91916], [41.81095, -1.44647], [41.58513, -1.68325], [40.993, -0.85829], [40.98105, 2.78452], [41.855083092643966, 3.918911920483726], [42.12861, 4.23413], [42.76967, 4.25259], [43.66087, 4.95755], [44.9636, 5.00162], [47.78942, 8.003], [48.486735874226937, 8.837626247589993], [48.938129510296442, 9.451748968946616], [48.938232863161026, 9.973500067581508], [48.938491245322481, 10.982327378783465], [48.942005242718345, 11.394266058798136], [48.948204758509732, 11.410617281697961], [49.26776, 11.43033], [49.72862, 11.5789]]] } }, + { "type": "Feature", "properties": { "admin": "Republic of Serbia", "name": "Serbia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.874312778413408, 45.416375433934306], [21.483526238702204, 45.181170152357865], [21.562022739353718, 44.768947251965635], [22.145087924902892, 44.478422349620573], [22.459022251075961, 44.702517198254426], [22.705725538837434, 44.578002834647002], [22.47400841644065, 44.409227606781762], [22.657149692483067, 44.234923000661347], [22.410446404721593, 44.008063462900047], [22.500156691180219, 43.642814439460999], [22.986018507588479, 43.211161200527094], [22.604801466571352, 42.898518785161109], [22.43659467946139, 42.580321153323943], [22.545011834409642, 42.461362006188025], [22.380525750424674, 42.320259507815074], [21.917080000000105, 42.30364], [21.576635989402117, 42.245224397061847], [21.54332, 42.32025], [21.66292, 42.43922], [21.77505, 42.6827], [21.63302, 42.67717], [21.43866, 42.86255], [21.27421, 42.90959], [21.143395, 43.068685000000123], [20.95651, 43.13094], [20.81448, 43.27205], [20.63508, 43.21671], [20.49679, 42.88469], [20.25758, 42.81275], [20.3398, 42.89852], [19.95857, 43.10604], [19.63, 43.213779970270522], [19.48389, 43.35229], [19.21852, 43.52384], [19.454, 43.568100000000115], [19.59976, 44.03847], [19.11761, 44.42307], [19.36803, 44.863], [19.00548, 44.86023], [19.390475701584588, 45.236515611342369], [19.072768995854172, 45.521511135432078], [18.82982, 45.90888], [19.596044549241636, 46.171729844744547], [20.22019249846289, 46.127468980486569], [20.76217492033998, 45.734573065771478], [20.874312778413408, 45.416375433934306]]] } }, + { "type": "Feature", "properties": { "admin": "Suriname", "name": "Suriname", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.147436489476874, 5.973149929219161], [-55.949318406789786, 5.772877915872], [-55.841779751190408, 5.953125311706059], [-55.033250291551759, 6.025291449401662], [-53.958044603070888, 5.756548163267764], [-54.478632981979224, 4.896755682795585], [-54.3995422023565, 4.212611395683466], [-54.006930508018996, 3.620037746592558], [-54.181726040246261, 3.189779771330421], [-54.269705166223183, 2.732391669115046], [-54.524754197799709, 2.311848863123785], [-55.097587449755125, 2.523748073736612], [-55.569755011605984, 2.42150625244713], [-55.973322109589361, 2.510363877773016], [-56.073341844290283, 2.220794989425499], [-55.905600145070871, 2.021995754398659], [-55.995698004771739, 1.817667141116601], [-56.53938574891454, 1.89952260986692], [-57.150097825739898, 2.768926906745406], [-57.281433478409703, 3.333491929534119], [-57.601568976457848, 3.334654649260684], [-58.044694383360664, 4.060863552258382], [-57.860209520078691, 4.576801052260449], [-57.914288906472123, 4.812626451024413], [-57.307245856339492, 5.073566595882225], [-57.147436489476874, 5.973149929219161]]] } }, + { "type": "Feature", "properties": { "admin": "Slovakia", "name": "Slovakia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[18.85314415861361, 49.496229763377634], [18.909574822676316, 49.435845852244562], [19.320712517990469, 49.571574001659179], [19.825022820726865, 49.217125352569219], [20.415839471119849, 49.431453355499755], [20.887955356538406, 49.328772284535823], [21.607808058364206, 49.470107326854077], [22.558137648211751, 49.08573802346713], [22.280841912533553, 48.825392157580659], [22.085608351334848, 48.422264309271782], [21.872236362401729, 48.319970811550007], [20.801293979584919, 48.62385407164237], [20.473562045989862, 48.562850043321809], [20.239054396249344, 48.327567247096916], [19.769470656013109, 48.2026911484636], [19.66136355965849, 48.266614895208647], [19.174364861739885, 48.111378892603859], [18.777024773847668, 48.081768296900627], [18.696512892336923, 47.88095368101439], [17.857132602620023, 47.758428860050365], [17.488472934649813, 47.867466132186209], [16.979666782304033, 48.123497015976298], [16.879982944412998, 48.470013332709463], [16.960288120194573, 48.596982326850593], [17.101984897538895, 48.8169688991171], [17.545006951577101, 48.800019029325362], [17.886484816161808, 48.903475246773695], [17.913511590250462, 48.996492824899072], [18.104972771891848, 49.043983466175298], [18.170498488037961, 49.271514797556421], [18.399993523846174, 49.315000515330034], [18.554971144289478, 49.495015367218777], [18.85314415861361, 49.496229763377634]]] } }, + { "type": "Feature", "properties": { "admin": "Slovenia", "name": "Slovenia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[13.806475457421524, 46.509306138691201], [14.632471551174827, 46.431817328469535], [15.137091912504982, 46.658702704447016], [16.011663852612653, 46.683610744811688], [16.202298211337361, 46.852385972676949], [16.370504998447412, 46.841327216166498], [16.564808383864854, 46.503750922219822], [15.768732944408548, 46.238108222023442], [15.671529575267552, 45.834153550797865], [15.323953891672403, 45.731782538427673], [15.327674594797424, 45.452316392593218], [14.935243767972931, 45.471695054702671], [14.595109490627804, 45.6349409043127], [14.411968214585411, 45.466165676447446], [13.715059848697221, 45.500323798192369], [13.937630242578305, 45.591015936864608], [13.698109978905475, 46.016778062517339], [13.806475457421524, 46.509306138691201]]] } }, + { "type": "Feature", "properties": { "admin": "Sweden", "name": "Sweden", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.183173455501922, 65.723740546320158], [21.213516879977213, 65.02600535751526], [21.369631381930954, 64.413587958424273], [19.778875766690216, 63.609554348395022], [17.847779168375208, 62.749400132896803], [17.11955488451812, 61.341165676510954], [17.831346062906388, 60.636583360427394], [18.787721795332086, 60.081914374422581], [17.869224887776337, 58.95376618105869], [16.829185011470084, 58.719826972073385], [16.44770958829147, 57.041118069071871], [15.87978559740378, 56.104301866268649], [14.666681349352071, 56.20088511822216], [14.100721062891461, 55.407781073622637], [12.942910597392054, 55.361737372450563], [12.625100538797025, 56.307080186581956], [11.787942335668671, 57.441817125063061], [11.027368605196866, 58.856149400459344], [11.468271925511145, 59.432393296946024], [12.300365838274896, 60.117932847730025], [12.631146681375181, 61.293571682370121], [11.992064243221559, 61.800362453856543], [11.930569288794228, 63.128317572676963], [12.57993533697393, 64.066218980558318], [13.571916131248711, 64.049114081469696], [13.9199052263022, 64.445420640716065], [13.555689731509087, 64.7870276963815], [15.108411492582999, 66.19386688909546], [16.108712192456775, 67.302455552836875], [16.768878614985478, 68.013936672631388], [17.729181756265344, 68.010551866316263], [17.993868442464329, 68.567391262477344], [19.878559604581248, 68.407194322372561], [20.025268995857882, 69.065138658312691], [20.645592889089521, 69.106247260200846], [21.978534783626113, 68.616845608180682], [23.539473097434435, 67.936008612735236], [23.565879754335576, 66.396050930437411], [23.903378533633795, 66.006927395279604], [22.183173455501922, 65.723740546320158]]] } }, + { "type": "Feature", "properties": { "admin": "Swaziland", "name": "Swaziland", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[32.071665480281062, -26.733820082304902], [31.868060337051073, -27.17792734142127], [31.282773064913325, -27.285879408478991], [30.685961948374477, -26.743845310169526], [30.676608514129633, -26.398078301704604], [30.949666782359905, -26.022649021104144], [31.044079624157146, -25.731452325139436], [31.333157586397899, -25.660190525008943], [31.837777947728057, -25.843331801051342], [31.985779249811962, -26.29177988048022], [32.071665480281062, -26.733820082304902]]] } }, + { "type": "Feature", "properties": { "admin": "Syria", "name": "Syria", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[38.792340529136077, 33.378686428352218], [36.834062127435537, 32.312937526980768], [35.719918247222743, 32.709192409794859], [35.700797967274745, 32.716013698857374], [35.836396925608618, 32.868123277308506], [35.821100701650231, 33.277426459276292], [36.066460402172048, 33.824912421192543], [36.611750115715886, 34.201788641897174], [36.448194207512095, 34.59393524834406], [35.998402540843628, 34.644914048799997], [35.905023227692219, 35.410009467097318], [36.149762811026527, 35.821534735653664], [36.417550083163029, 36.040616970355053], [36.685389031731795, 36.259699205056457], [36.739494256341395, 36.817520453431079], [37.066761102045824, 36.623036200500614], [38.167727492024191, 36.901210435527766], [38.699891391765895, 36.712927354472335], [39.522580193852541, 36.716053778625984], [40.673259311695681, 37.091276353497285], [41.212089471203043, 37.074352321921687], [42.349591098811764, 37.22987254490409], [41.837064243340954, 36.605853786763568], [41.289707472505448, 36.358814602192261], [41.383965285005807, 35.628316555314349], [41.00615888851992, 34.419372260062111], [38.792340529136077, 33.378686428352218]]] } }, + { "type": "Feature", "properties": { "admin": "Chad", "name": "Chad", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[14.495787387762899, 12.859396267137353], [14.595781284247604, 13.330426947477859], [13.954476759505607, 13.353448798063765], [13.956698846094124, 13.996691189016925], [13.540393507550785, 14.36713369390122], [13.97217, 15.68437], [15.247731154041842, 16.627305813050778], [15.300441114979716, 17.927949937405], [15.68574059414777, 19.957180080642384], [15.90324669766431, 20.387618923417499], [15.487148064850143, 20.730414537025634], [15.47106, 21.04845], [15.096887648181847, 21.308518785074902], [14.8513, 22.862950000000119], [15.86085, 23.40972], [19.84926, 21.49509], [23.837660000000135, 19.580470000000101], [23.886890000000101, 15.61084], [23.02459, 15.68072], [22.567950000000106, 14.944290000000134], [22.30351, 14.32682], [22.51202, 14.09318], [22.18329, 13.78648], [22.29658, 13.37232], [22.03759, 12.95546], [21.93681, 12.588180000000133], [22.28801, 12.64605], [22.49762, 12.26024], [22.50869, 11.67936], [22.87622, 11.384610000000119], [22.864165480244246, 11.142395127807616], [22.231129184668756, 10.971888739460608], [21.723821648859538, 10.567055568885959], [21.000868361096305, 9.475985215691479], [20.059685499764267, 9.012706000194838], [19.094008009526071, 9.074846910025768], [18.81200971850927, 8.982914536978623], [18.911021762780589, 8.630894680206435], [18.389554884523303, 8.281303615751879], [17.964929640380884, 7.890914008002992], [16.705988396886365, 7.508327541529978], [16.4561845231874, 7.734773667832938], [16.290561557691884, 7.754307359239417], [16.106231723706738, 7.497087917506461], [15.279460483469164, 7.42192454673801], [15.436091749745737, 7.692812404811887], [15.120865512765302, 8.382150173369437], [14.979995558337688, 8.796104234243442], [14.544466586981851, 8.965861314322238], [13.954218377344088, 9.549494940626685], [14.17146609869911, 10.021378282100043], [14.627200555081057, 9.920919297724591], [14.909353875394796, 9.992129421422758], [15.46787275560524, 9.982336737503543], [14.923564894275042, 10.891325181517514], [14.960151808337679, 11.555574042197234], [14.89336, 12.21905], [14.495787387762899, 12.859396267137353]]] } }, + { "type": "Feature", "properties": { "admin": "Togo", "name": "Togo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[1.865240512712318, 6.14215770102973], [1.060121697604927, 5.928837388528875], [0.836931186536333, 6.279978745952147], [0.570384148774849, 6.914358628767188], [0.490957472342245, 7.411744289576474], [0.712029249686878, 8.312464504423827], [0.461191847342121, 8.677222601756013], [0.365900506195885, 9.46500397382948], [0.367579990245389, 10.191212876827176], [-0.049784715159944, 10.706917832883928], [0.023802524423701, 11.018681748900802], [0.899563022474069, 10.997339382364258], [0.772335646171484, 10.470808213742357], [1.077795037448737, 10.175606594275022], [1.425060662450136, 9.825395412632998], [1.46304284018467, 9.334624335157086], [1.664477573258381, 9.128590399609378], [1.618950636409238, 6.832038072126236], [1.865240512712318, 6.14215770102973]]] } }, + { "type": "Feature", "properties": { "admin": "Thailand", "name": "Thailand", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[102.58493248902667, 12.186594956913279], [101.687157830819928, 12.645740057826568], [100.831809523524839, 12.627084865769204], [100.978467238369191, 13.412721665902563], [100.097797479251099, 13.406856390837429], [100.018732537844528, 12.307001044153353], [99.478920526123602, 10.846366685423545], [99.153772414143134, 9.963061428258554], [99.222398716226749, 9.239255479362425], [99.873831821698118, 9.207862046745118], [100.279646844486194, 8.29515289960605], [100.45927412313273, 7.429572658717175], [101.017327915452697, 6.856868597842476], [101.623079054778032, 6.740622463401918], [102.141186964936367, 6.221636053894626], [101.81428185425797, 5.810808417174242], [101.154218784593837, 5.691384182147713], [101.075515578213327, 6.20486705161592], [100.259596388756933, 6.642824815289542], [100.085756870527092, 6.46448944745029], [99.690690545655727, 6.848212795433595], [99.519641554769606, 7.343453884302759], [98.988252801512289, 7.907993068875325], [98.503786248775967, 8.382305202666286], [98.339661899816988, 7.794511623562384], [98.150009393305808, 8.350007432483876], [98.259150018306229, 8.973922837759799], [98.553550653073017, 9.932959906448543], [99.038120558673953, 10.960545762572435], [99.587286004639694, 11.892762762901695], [99.196353794351637, 12.804748439988666], [99.212011753336071, 13.269293728076462], [99.097755161538728, 13.827502549693275], [98.430819126379859, 14.622027696180831], [98.192074009191373, 15.123702500870349], [98.537375929765687, 15.308497422746081], [98.90334842325673, 16.177824204976115], [98.493761020911322, 16.837835598207928], [97.859122755934848, 17.567946071843657], [97.375896437573516, 18.445437730375811], [97.797782830804394, 18.627080389881751], [98.253723992915582, 19.708203029860041], [98.959675734454848, 19.752980658440944], [99.543309360759281, 20.186597601802056], [100.115987583417819, 20.41784963630818], [100.548881056726856, 20.109237982661124], [100.606293573003128, 19.508344427971217], [101.282014601651667, 19.462584947176762], [101.035931431077742, 18.408928330961611], [101.059547560635139, 17.512497259994486], [102.113591750092453, 18.109101670804161], [102.413004998791592, 17.932781683824281], [102.998705682387694, 17.961694647691598], [103.200192091893726, 18.309632066312769], [103.956476678485288, 18.240954087796872], [104.716947056092465, 17.428858954330078], [104.779320509868768, 16.441864935771445], [105.589038527450128, 15.570316066952856], [105.544338413517664, 14.723933620660414], [105.218776890078871, 14.27321177821069], [104.281418084736586, 14.416743068901363], [102.988422072361601, 14.225721136934464], [102.348099399833004, 13.39424734135822], [102.58493248902667, 12.186594956913279]]] } }, + { "type": "Feature", "properties": { "admin": "Tajikistan", "name": "Tajikistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[71.014198032520156, 40.244365546218226], [70.648018833299957, 39.935753892571157], [69.559609816368507, 40.103211371412968], [69.464886915977516, 39.526683254548693], [70.549161818325601, 39.604197902986492], [71.784693637991992, 39.279463202464363], [73.67537926625478, 39.431236884105594], [73.928852166646408, 38.505815334622724], [74.257514276022718, 38.606506862943441], [74.864815708316812, 38.378846340481587], [74.829985792952087, 37.990007025701388], [74.980002475895404, 37.419990139305888], [73.948695916646486, 37.421566270490786], [73.260055779924983, 37.495256862938994], [72.636889682917271, 37.047558091778349], [72.193040805962383, 36.94828766534566], [71.84463829945058, 36.738171291646914], [71.448693475230229, 37.065644843080513], [71.541917759084768, 37.905774441065631], [71.239403924448155, 37.953265082341879], [71.348131137990251, 38.258905341132156], [70.806820509732873, 38.486281643216408], [70.376304152309274, 38.138395901027515], [70.270574171840124, 37.73516469985401], [70.116578403610319, 37.588222764632086], [69.518785434857946, 37.608996690413413], [69.196272820924364, 37.15114350030742], [68.859445835245921, 37.344335842430588], [68.135562371701369, 37.023115139304302], [67.829999627559502, 37.144994004864678], [68.392032505165943, 38.157025254868728], [68.176025018185911, 38.901553453113898], [67.442219679641298, 39.140143541005479], [67.701428664017342, 39.580478420564518], [68.536416456989414, 39.533452867178923], [69.011632928345477, 40.086158148756653], [69.329494663372813, 40.727824408524839], [70.666622348925031, 40.960213324541407], [70.458159621059608, 40.49649485937028], [70.601406691372674, 40.218527330072284], [71.014198032520156, 40.244365546218226]]] } }, + { "type": "Feature", "properties": { "admin": "Turkmenistan", "name": "Turkmenistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[61.21081709172573, 35.650072333309218], [61.123070509694131, 36.491597194966239], [60.377637973883864, 36.52738312432836], [59.234761997316795, 37.412987982730336], [58.436154412678192, 37.522309475243794], [57.330433790928964, 38.029229437810933], [56.619366082592805, 38.121394354803478], [56.180374790273319, 37.935126654607423], [55.511578403551894, 37.964117133123153], [54.800303989486558, 37.392420762678178], [53.921597934795543, 37.198918361961255], [53.735511102112504, 37.906136176091685], [53.880928582581831, 38.952093003895349], [53.101027866432894, 39.290573635407121], [53.357808058491216, 39.975286363274442], [52.693972609269807, 40.033629055331964], [52.91525109234361, 40.87652334244472], [53.85813927594112, 40.631034450842165], [54.736845330632136, 40.951014919593455], [54.0083109881813, 41.551210842447404], [53.721713494690576, 42.123191433270016], [52.916749708880069, 41.868116563477322], [52.81468875510361, 41.135370591794704], [52.502459751196135, 41.783315538086356], [52.94429324729164, 42.116034247397586], [54.079417759014937, 42.324109402020817], [54.755345493392625, 42.04397146256656], [55.455251092353755, 41.259859117185826], [55.968191359282898, 41.308641669269356], [57.096391229079089, 41.32231008561056], [56.93221520368779, 41.82602610937559], [57.786529982337065, 42.170552883465511], [58.629010857991453, 42.751551011723045], [59.976422153569771, 42.223081976890199], [60.083340691981654, 41.425146185871391], [60.46595299667068, 41.22032664648254], [61.547178989513547, 41.2663703476546], [61.882714064384679, 41.084856879229392], [62.374260288344992, 40.053886216790382], [63.518014764261018, 39.363256537425627], [64.170223016216752, 38.892406724598231], [65.215998976507379, 38.402695013984292], [66.546150343700205, 37.974684963526855], [66.518606805288655, 37.362784328758785], [66.217384881459324, 37.393790188133913], [65.745630731066811, 37.661164048812061], [65.588947788357828, 37.305216783185628], [64.746105177677393, 37.111817735333297], [64.546479119733888, 36.31207326918426], [63.982895949158696, 36.007957465146596], [63.193538445900337, 35.857165635718907], [62.984662306576588, 35.404040839167614], [62.230651483005879, 35.270663967422287], [61.21081709172573, 35.650072333309218]]] } }, + { "type": "Feature", "properties": { "admin": "East Timor", "name": "Timor-Leste", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[124.96868248911619, -8.892790215697081], [125.086246372580248, -8.656887302284678], [125.947072381698234, -8.432094821815033], [126.64470421763852, -8.39824675866385], [126.957243280139792, -8.273344821814396], [127.335928175974615, -8.397316582882601], [126.967991978056517, -8.668256117388891], [125.925885044458568, -9.106007175333351], [125.088520135601073, -9.393173109579292], [125.070019972840583, -9.08998748132287], [124.96868248911619, -8.892790215697081]]] } }, + { "type": "Feature", "properties": { "admin": "Trinidad and Tobago", "name": "Trinidad and Tobago", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-61.68, 10.76], [-61.105, 10.89], [-60.895, 10.855], [-60.935, 10.11], [-61.77, 10.0], [-61.95, 10.09], [-61.66, 10.365], [-61.68, 10.76]]] } }, + { "type": "Feature", "properties": { "admin": "Tunisia", "name": "Tunisia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[9.482139926805273, 30.307556057246181], [9.055602654668148, 32.102691962201284], [8.439102817426116, 32.506284898400814], [8.430472853233367, 32.748337307255944], [7.612641635782181, 33.344114895148955], [7.524481642292242, 34.097376410451453], [8.140981479534302, 34.655145982393783], [8.376367628623766, 35.479876003555937], [8.217824334352313, 36.433176988260271], [8.420964389691674, 36.946427313783154], [9.509993523810605, 37.349994411766531], [10.210002475636315, 37.230001735984807], [10.180650262094529, 36.724037787415071], [11.028867221733348, 37.09210317641395], [11.100025668999249, 36.899996039368908], [10.600004510143092, 36.410000108377368], [10.593286573945134, 35.947444362932806], [10.939518670300686, 35.698984076473486], [10.807847120821007, 34.833507188449182], [10.149592726287123, 34.330773016897702], [10.339658644256613, 33.785741685515312], [10.856836378633684, 33.768740139291275], [11.108500603895118, 33.293342800422188], [11.488787469131008, 33.136995754523134], [11.432253452203692, 32.368903103152867], [10.944789666394453, 32.081814683555358], [10.636901482799484, 31.761420803345747], [9.950225050505081, 31.376069647745251], [10.056575148161752, 30.961831366493595], [9.97001712407285, 30.539324856075236], [9.482139926805273, 30.307556057246181]]] } }, + { "type": "Feature", "properties": { "admin": "Turkey", "name": "Turkey", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[36.913127068842151, 41.335358384764291], [38.347664829264502, 40.948586127275711], [39.512606642420238, 41.102762763018561], [40.373432651538245, 41.013672593747337], [41.554084100110707, 41.535656236327604], [42.619548781104548, 41.58317271581992], [43.582745802592704, 41.09214325618256], [43.752657911968491, 40.740200914058811], [43.656436395040963, 40.253563951166157], [44.400008579288759, 40.005000311842302], [44.79398969908199, 39.713002631177027], [44.109225294782355, 39.428136298168049], [44.421402622257595, 38.281281236314513], [44.225755649600522, 37.971584377589345], [44.772699008977739, 37.170444647768441], [44.293451775902852, 37.001514390606353], [43.942258742047343, 37.256227525372928], [42.77912560402185, 37.385263576805798], [42.349591098811764, 37.229872544904104], [41.212089471203015, 37.074352321921729], [40.673259311695702, 37.091276353497356], [39.522580193852512, 36.716053778626012], [38.699891391765917, 36.712927354472313], [38.167727492024156, 36.90121043552778], [37.066761102045824, 36.623036200500614], [36.739494256341366, 36.817520453431108], [36.685389031731816, 36.259699205056499], [36.417550083163086, 36.040616970355096], [36.149762811026584, 35.821534735653664], [35.782084995269848, 36.274995429014915], [36.160821567537049, 36.650605577128367], [35.550936313628334, 36.565442816711325], [34.714553256984367, 36.795532131490909], [34.026894972476455, 36.219960028623966], [32.509158156064096, 36.107563788389193], [31.69959516777956, 36.644275214172602], [30.621624790171062, 36.677864895162308], [30.391096225717114, 36.262980658506983], [29.69997562024556, 36.144357408181001], [28.732902866335387, 36.676831366516431], [27.641186557737363, 36.658822129862749], [27.048767937943289, 37.653360907536005], [26.318218214633042, 38.208133246405382], [26.804700148228726, 38.985760199533551], [26.170785353304375, 39.463612168936457], [27.280019972449388, 40.420013739578302], [28.819977654747209, 40.460011298172212], [29.240003696415574, 41.219990749672682], [31.145933872204434, 41.087621568357058], [32.347979363745786, 41.736264146484629], [33.513282911927512, 42.018960069337304], [35.167703891751863, 42.040224921225438], [36.913127068842151, 41.335358384764291]]], [[[27.192376743282406, 40.690565700842448], [26.358009067497782, 40.151993923496477], [26.043351271272535, 40.617753607743161], [26.056942172965332, 40.824123440100735], [26.294602085075692, 40.936261298174166], [26.604195590936282, 41.562114569661013], [26.117041863720825, 41.826904608724554], [27.135739373490505, 42.141484890301307], [27.996720411905407, 42.007358710287768], [28.115524529744441, 41.622886054036279], [28.988442824018779, 41.299934190428175], [28.806438429486743, 41.05496206314853], [27.619017368284112, 40.999823309893102], [27.192376743282406, 40.690565700842448]]]] } }, + { "type": "Feature", "properties": { "admin": "Taiwan", "name": "Taiwan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[121.777817824389899, 24.394273586519393], [121.175632358892713, 22.790857245367164], [120.747079705896198, 21.970571397382106], [120.220083449383651, 22.814860948166732], [120.106188592612369, 23.556262722258229], [120.694679803552233, 24.53845083261373], [121.49504438688875, 25.295458889257379], [121.951243931161429, 24.997595933527034], [121.777817824389899, 24.394273586519393]]] } }, + { "type": "Feature", "properties": { "admin": "United Republic of Tanzania", "name": "Tanzania", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.903711197104592, -0.95], [34.07262, -1.05982], [37.69869, -3.09699], [37.7669, -3.67712], [39.20222, -4.67677], [38.74054, -5.90895], [38.79977, -6.47566], [39.44, -6.84], [39.470000000000134, -7.1], [39.19469, -7.7039], [39.25203, -8.00781], [39.18652, -8.48551], [39.53574, -9.112369999999883], [39.9496, -10.0984], [40.31659, -10.317099999999867], [39.521, -10.89688], [38.427556593587767, -11.285202325081626], [37.82764, -11.26879], [37.47129, -11.56876], [36.775150994622884, -11.59453744878078], [36.514081658684397, -11.720938002166745], [35.312397902169145, -11.439146416879165], [34.559989047999451, -11.520020033415845], [34.28, -10.16], [33.940837724096518, -9.693673841980283], [33.73972, -9.41715], [32.759375441221373, -9.230599053589001], [32.191864861791935, -8.930358981973255], [31.556348097466628, -8.762048841998647], [31.157751336950064, -8.594578747317312], [30.74, -8.34], [30.2, -7.08], [29.62, -6.52], [29.419992710088305, -5.939998874539297], [29.519986606573063, -5.419978936386257], [29.339997592900367, -4.499983412294113], [29.753512404099858, -4.452389418153301], [30.11632, -4.09012], [30.50554, -3.56858], [30.75224, -3.35931], [30.74301, -3.03431], [30.52766, -2.80762], [30.46967, -2.41383], [30.758308953583132, -2.287250257988375], [30.816134881317844, -1.698914076345374], [30.419104852019291, -1.134659112150416], [30.769860000000101, -1.01455], [31.86617, -1.02736], [33.903711197104592, -0.95]]] } }, + { "type": "Feature", "properties": { "admin": "Uganda", "name": "Uganda", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.86617, -1.02736], [30.769860000000101, -1.01455], [30.419104852019291, -1.134659112150416], [29.821518588996121, -1.443322442229771], [29.579466180141019, -1.341313164885605], [29.587837762172164, -0.587405694179381], [29.8195, -0.2053], [29.875778842902431, 0.597379868976361], [30.086153598762785, 1.062312730306416], [30.468507521290285, 1.583805446779706], [30.852670118948133, 1.849396470543752], [31.174149204235952, 2.204465236821306], [30.77332, 2.339890000000139], [30.83385, 3.50917], [31.24556, 3.7819], [31.88145, 3.55827], [32.68642, 3.79232], [33.39, 3.79], [34.005, 4.249884947362147], [34.47913, 3.5556], [34.59607, 3.053740000000118], [35.03599, 1.90584], [34.6721, 1.17694], [34.18, 0.515], [33.893568969666994, 0.109813537861839], [33.903711197104592, -0.95], [31.86617, -1.02736]]] } }, + { "type": "Feature", "properties": { "admin": "Ukraine", "name": "Ukraine", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[31.78599816257158, 52.10167796488544], [32.159412062312661, 52.061266994833204], [32.412058139787625, 52.288694973349735], [32.715760532366964, 52.238465481162038], [33.7526998227357, 52.335074571331681], [34.391730584457001, 51.768881740925778], [34.141978387190385, 51.566413479206226], [34.22481570815426, 51.255993150428942], [35.022183058417873, 51.207572333371445], [35.377923618315116, 50.773955390010343], [35.35611616388794, 50.577197374059054], [36.62616784032533, 50.225590928745127], [37.393459506995065, 50.383953355503586], [38.01063113785689, 49.915661526074622], [38.59498823421341, 49.926461900423618], [40.069058465339097, 49.601055406281688], [40.080789015469342, 49.307429917999272], [39.674663934087526, 48.783818467801872], [39.895632358567575, 48.232405097031425], [39.738277622238819, 47.898937079451983], [38.770584751141186, 47.825608222029807], [38.255112339029743, 47.546400458356807], [38.223538038899413, 47.102189846375872], [37.42513715998998, 47.022220567404197], [36.759854770664383, 46.698700263040919], [35.823684523264816, 46.645964463887054], [34.962341749823871, 46.273196519549636], [35.020787794745978, 45.65121898048465], [35.51000857925316, 45.409993394546177], [36.529997999830151, 45.46998973243705], [36.334712762199146, 45.113215643893952], [35.239999220528112, 44.939996242851599], [33.882511020652878, 44.361478583344066], [33.326420932760037, 44.564877020844875], [33.546924269349446, 45.034770819674883], [32.454174432105496, 45.327466132176063], [32.630804477679128, 45.519185695978905], [33.588162062318382, 45.851568508480227], [33.298567335754704, 46.08059845639783], [31.744140252415171, 46.333347886737378], [31.675307244602401, 46.706245022155528], [30.748748813609094, 46.583100084003995], [30.37760867688888, 46.032410183285663], [29.603289015427425, 45.293308010431119], [29.149724969201646, 45.464925442072442], [28.679779493939371, 45.30403087013169], [28.233553501099035, 45.488283189468369], [28.48526940279276, 45.596907050145887], [28.659987420371575, 45.939986884131628], [28.933717482221621, 46.258830471372491], [28.862972446414055, 46.437889309263824], [29.072106967899288, 46.517677720722482], [29.170653924279879, 46.379262396828693], [29.759971958136383, 46.349987697935354], [30.024658644335364, 46.423936672545032], [29.838210076626289, 46.525325832701675], [29.908851759569295, 46.67436066343145], [29.559674106573105, 46.928582872091312], [29.415135125452732, 47.346645209332571], [29.050867954227321, 47.510226955752493], [29.122698195113024, 47.849095160506458], [28.670891147585163, 48.118148505234089], [28.259546746541837, 48.155562242213406], [27.52253746919515, 48.467119452501102], [26.857823520624798, 48.368210761094488], [26.619336785597788, 48.220726223333457], [26.197450392366925, 48.220881252630342], [25.945941196402394, 47.987148749374207], [25.207743361112986, 47.891056423527459], [24.866317172960571, 47.737525743188307], [24.402056105250374, 47.981877753280422], [23.760958286237404, 47.985598456405448], [23.142236362406798, 48.096341050806942], [22.710531447040488, 47.882193915389394], [22.640819939878746, 48.150239569687351], [22.085608351334848, 48.422264309271782], [22.280841912533553, 48.825392157580659], [22.558137648211751, 49.08573802346713], [22.776418898212619, 49.027395331409608], [22.518450148211596, 49.476773586619736], [23.426508416444388, 50.308505764357449], [23.922757195743259, 50.424881089878738], [24.029985792748899, 50.705406602575174], [23.52707075368437, 51.578454087930233], [24.005077752384206, 51.617443956094448], [24.553106316839511, 51.888461005249177], [25.327787713327005, 51.910656032918538], [26.337958611768549, 51.832288723347915], [27.454066196408426, 51.59230337178446], [28.241615024536564, 51.572227077839059], [28.617612745892242, 51.427713934934836], [28.992835320763522, 51.602044379271462], [29.254938185347921, 51.368234361366881], [30.157363722460889, 51.416138414101454], [30.55511722181145, 51.319503485715643], [30.619454380014837, 51.822806098022362], [30.927549269338975, 52.042353420614383], [31.78599816257158, 52.10167796488544]]] } }, + { "type": "Feature", "properties": { "admin": "Uruguay", "name": "Uruguay", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.625133429582945, -30.216294854454258], [-56.976025763564721, -30.109686374636119], [-55.97324459494093, -30.883075860316296], [-55.601510179249331, -30.853878676071385], [-54.572451544805105, -31.494511407193745], [-53.787951626182185, -32.047242526987617], [-53.209588995971529, -32.727666110974717], [-53.650543992718084, -33.202004082981823], [-53.373661668498229, -33.768377780900757], [-53.806425950726521, -34.396814874002224], [-54.935866054897716, -34.952646579733617], [-55.674089728403274, -34.752658786764066], [-56.215297003796053, -34.85983570733741], [-57.139685024633096, -34.430456231424238], [-57.817860683815489, -34.462547295877492], [-58.427074144104381, -33.909454441057569], [-58.349611172098854, -33.2631889788154], [-58.132647671121433, -33.040566908502008], [-58.142440355040748, -32.044503676076147], [-57.874937303281875, -31.016556084926201], [-57.625133429582945, -30.216294854454258]]] } }, + { "type": "Feature", "properties": { "admin": "United States of America", "name": "United States", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-155.54211, 19.08348], [-155.68817, 18.91619], [-155.93665, 19.05939], [-155.90806, 19.33888], [-156.07347, 19.70294], [-156.02368, 19.81422], [-155.85008, 19.97729], [-155.91907, 20.17395], [-155.86108, 20.26721], [-155.78505, 20.2487], [-155.40214, 20.07975], [-155.22452, 19.99302], [-155.06226, 19.8591], [-154.80741, 19.50871], [-154.83147, 19.45328], [-155.222169999999892, 19.23972], [-155.54211, 19.08348]]], [[[-156.07926, 20.64397], [-156.41445, 20.57241], [-156.58673, 20.783], [-156.70167, 20.8643], [-156.71055, 20.92676], [-156.61258, 21.01249], [-156.25711, 20.91745], [-155.99566, 20.76404], [-156.07926, 20.64397]]], [[[-156.75824, 21.17684], [-156.78933, 21.06873], [-157.32521, 21.09777], [-157.25027, 21.21958], [-156.75824, 21.17684]]], [[[-157.65283, 21.32217], [-157.70703, 21.26442], [-157.7786, 21.27729], [-158.12667, 21.31244], [-158.2538, 21.53919], [-158.29265, 21.57912], [-158.0252, 21.71696], [-157.94161, 21.65272], [-157.65283, 21.32217]]], [[[-159.34512, 21.982], [-159.46372, 21.88299], [-159.80051, 22.06533], [-159.74877, 22.1382], [-159.5962, 22.23618], [-159.36569, 22.21494], [-159.34512, 21.982]]], [[[-94.81758, 49.38905], [-94.639999999999858, 48.840000000000103], [-94.32914, 48.67074], [-93.63087, 48.60926], [-92.61, 48.45], [-91.64, 48.14], [-90.829999999999856, 48.27], [-89.6, 48.01], [-89.272917446636654, 48.019808254582834], [-88.378114183286513, 48.302917588893806], [-87.439792623300207, 47.94], [-86.461990831228135, 47.553338019392037], [-85.652363247403215, 47.220218817730498], [-84.876079881514855, 46.900083319682366], [-84.779238247399817, 46.637101955749117], [-84.54374874544564, 46.538684190449224], [-84.6049, 46.4396], [-84.3367, 46.408770000000104], [-84.142119513673279, 46.512225857115723], [-84.091851264161463, 46.275418606138253], [-83.890765347005654, 46.116926988299149], [-83.616130947590491, 46.116926988299149], [-83.469550747394621, 45.994686387712584], [-83.592850714843067, 45.816893622412543], [-82.550924648758169, 45.347516587905446], [-82.337763125431053, 44.44], [-82.137642381503952, 43.571087551439987], [-82.43, 42.98], [-82.899999999999878, 42.430000000000135], [-83.119999999999877, 42.08], [-83.141999681312555, 41.975681057292995], [-83.029810146806909, 41.832795722005997], [-82.690089280920162, 41.675105088867319], [-82.439277716791608, 41.675105088867319], [-81.277746548167059, 42.209025987306845], [-80.247447679347843, 42.36619985612267], [-78.939362148743683, 42.863611355148116], [-78.92, 42.965], [-79.009999999999863, 43.27], [-79.171673550111862, 43.466339423184301], [-78.720279914042365, 43.625089423184953], [-77.737885097957601, 43.629055589363382], [-76.820034145805565, 43.628784288093748], [-76.5, 44.018458893758599], [-76.375, 44.09631], [-75.31821, 44.81645000000016], [-74.867, 45.00048000000011], [-73.347829999999874, 45.00738], [-71.505059999999858, 45.0082], [-71.405, 45.255000000000123], [-71.08482, 45.305240000000154], [-70.659999999999783, 45.46], [-70.305, 45.915], [-69.99997, 46.69307], [-69.237216, 47.447781], [-68.905, 47.185], [-68.23444, 47.35486], [-67.79046, 47.06636], [-67.79134, 45.702810000000134], [-67.13741, 45.13753], [-66.96466, 44.809700000000149], [-68.03252, 44.3252], [-69.059999999999874, 43.98], [-70.116169999999897, 43.684050000000141], [-70.645475633410967, 43.090238348964043], [-70.81489, 42.8653], [-70.825, 42.335], [-70.494999999999891, 41.805], [-70.08, 41.78], [-70.185, 42.145], [-69.88497, 41.922830000000111], [-69.96503, 41.637170000000161], [-70.64, 41.475], [-71.12039, 41.494450000000164], [-71.859999999999829, 41.32], [-72.295, 41.27], [-72.87643, 41.22065], [-73.71, 40.931102351654481], [-72.24126, 41.119480000000138], [-71.944999999999808, 40.93], [-73.345, 40.63], [-73.982, 40.628], [-73.952325, 40.75075], [-74.25671, 40.47351], [-73.96244, 40.42763], [-74.17838, 39.70926], [-74.90604, 38.93954], [-74.98041, 39.1964], [-75.20002, 39.24845], [-75.52805, 39.4985], [-75.32, 38.96], [-75.071834764789784, 38.782032230179276], [-75.05673, 38.404120000000106], [-75.37747, 38.01551], [-75.94023, 37.21689], [-76.03127, 37.2566], [-75.722049999999783, 37.937050000000106], [-76.23287, 38.319215], [-76.35, 39.15], [-76.542725, 38.717615], [-76.32933, 38.08326], [-76.98999793161353, 38.239991766913384], [-76.301619999999886, 37.917945], [-76.25874, 36.9664000000001], [-75.9718, 36.89726], [-75.868039999999809, 36.55125], [-75.72749, 35.550740000000125], [-76.36318, 34.808540000000129], [-77.39763499999988, 34.51201], [-78.05496, 33.92547], [-78.554349999999815, 33.861330000000116], [-79.06067, 33.49395], [-79.20357, 33.15839], [-80.301325, 32.509355], [-80.86498, 32.0333], [-81.33629, 31.44049], [-81.49042, 30.729990000000122], [-81.31371, 30.03552], [-80.98, 29.18000000000011], [-80.53558499999987, 28.47213], [-80.529999999999774, 28.04], [-80.056539284977532, 26.88000000000013], [-80.088015, 26.205765], [-80.131559999999837, 25.816775], [-80.38103, 25.20616], [-80.679999999999879, 25.08], [-81.17213, 25.201260000000126], [-81.33, 25.64], [-81.709999999999795, 25.87], [-82.239999999999895, 26.730000000000125], [-82.70515, 27.49504], [-82.85526, 27.88624], [-82.65, 28.550000000000146], [-82.929999999999865, 29.100000000000129], [-83.70959, 29.93656], [-84.1, 30.090000000000114], [-85.10882, 29.63615], [-85.28784, 29.686120000000127], [-85.7731, 30.152610000000116], [-86.399999999999878, 30.400000000000112], [-87.530359999999831, 30.27433], [-88.41782, 30.3849], [-89.180489999999836, 30.31598], [-89.593831178419748, 30.159994004836843], [-89.413735, 29.89419], [-89.43, 29.48864], [-89.21767, 29.29108], [-89.40823, 29.15961], [-89.77928, 29.307140000000135], [-90.15463, 29.11743], [-90.880224999999896, 29.148535000000116], [-91.626784999999842, 29.677000000000127], [-92.49906, 29.5523], [-93.22637, 29.78375], [-93.84842, 29.71363], [-94.69, 29.480000000000125], [-95.60026, 28.73863], [-96.59404, 28.30748], [-97.139999999999802, 27.83], [-97.37, 27.38], [-97.379999999999853, 26.69], [-97.33, 26.210000000000115], [-97.139999999999802, 25.87], [-97.529999999999859, 25.84], [-98.239999999999895, 26.060000000000109], [-99.019999999999854, 26.37], [-99.3, 26.84], [-99.52, 27.54], [-100.11, 28.11000000000012], [-100.45584, 28.696120000000118], [-100.957599999999886, 29.380710000000125], [-101.6624, 29.779300000000113], [-102.48, 29.76], [-103.11, 28.97], [-103.94, 29.27], [-104.456969999999814, 29.57196], [-104.705749999999895, 30.12173], [-105.03737, 30.64402], [-105.63159, 31.083830000000113], [-106.1429, 31.39995], [-106.507589999999794, 31.75452], [-108.24, 31.754853718166398], [-108.24194, 31.34222], [-109.035, 31.341940000000161], [-111.02361, 31.33472], [-113.30498, 32.03914], [-114.815, 32.52528], [-114.721389999999829, 32.72083], [-115.991349999999869, 32.61239000000014], [-117.127759999999753, 32.53534], [-117.295937691273863, 33.04622461520389], [-117.944, 33.621236431201389], [-118.410602275897475, 33.740909223124497], [-118.519894822799685, 34.027781577575745], [-119.081, 34.078], [-119.438840642016658, 34.348477178284291], [-120.36778, 34.44711], [-120.62286, 34.60855], [-120.74433, 35.156860000000101], [-121.714569999999853, 36.16153], [-122.54747, 37.551760000000101], [-122.51201, 37.783390000000132], [-122.95319, 38.113710000000104], [-123.7272, 38.951660000000111], [-123.865169999999878, 39.766990000000128], [-124.39807, 40.3132], [-124.17886, 41.142020000000109], [-124.2137, 41.999640000000134], [-124.532839999999894, 42.76599], [-124.14214, 43.70838], [-124.020535, 44.615895], [-123.898929999999893, 45.52341], [-124.079635, 46.86475], [-124.395669999999896, 47.72017], [-124.687210083007812, 48.184432983398537], [-124.566101074218736, 48.379714965820384], [-123.12, 48.04], [-122.587359999999876, 47.096], [-122.34, 47.36], [-122.5, 48.18], [-122.84, 49.0], [-120.0, 49.0], [-117.03121, 49.0], [-116.04818, 49.0], [-112.999999999999872, 49.0], [-110.049999999999812, 49.0], [-107.049999999999898, 49.0], [-104.04826, 48.99986], [-100.65, 49.0], [-97.228720000004699, 49.0007], [-95.159069509171943, 49.0], [-95.15609, 49.38425], [-94.81758, 49.38905]]], [[[-153.006314053336837, 57.115842190165878], [-154.0050902984581, 56.734676825581047], [-154.516402757770067, 56.992748928446687], [-154.670992804971092, 57.461195787172493], [-153.762779507441451, 57.816574612043773], [-153.228729417921073, 57.968968410872421], [-152.564790615835108, 57.901427313866961], [-152.141147223906273, 57.591058661521977], [-153.006314053336837, 57.115842190165878]]], [[[-165.579164191733554, 59.909986884187539], [-166.192770148767238, 59.754440822988961], [-166.848337368821944, 59.941406155020942], [-167.455277066090048, 60.213069159579376], [-166.467792121424566, 60.384169826897775], [-165.674429694663644, 60.293606879306232], [-165.579164191733554, 59.909986884187539]]], [[[-171.731656867539357, 63.782515367275906], [-171.114433560245175, 63.592191067144981], [-170.491112433940657, 63.694975490973505], [-169.682505459653555, 63.431115627691142], [-168.689439460300662, 63.297506212000584], [-168.77194088445458, 63.188598130945437], [-169.529439867204985, 62.976931464277882], [-170.290556200215917, 63.194437567794452], [-170.671385667990847, 63.375821845138965], [-171.553063117538642, 63.317789211675077], [-171.791110602891166, 63.40584585230048], [-171.731656867539357, 63.782515367275906]]], [[[-155.067790290324211, 71.147776394323685], [-154.344165208941206, 70.696408596470192], [-153.900006273392563, 70.889988511835682], [-152.210006069935275, 70.829992173944831], [-152.270002407826127, 70.60000621202984], [-150.739992438744508, 70.430016588005699], [-149.720003018167489, 70.530010484490433], [-147.613361579357047, 70.214034939241785], [-145.689989800225248, 70.120009670686741], [-144.920010959076393, 69.989991767040479], [-143.58944618042517, 70.152514146598307], [-142.072510348713365, 69.851938178172631], [-140.985987521560702, 69.711998399526365], [-140.985988329004869, 69.711998399526365], [-140.992498752029377, 66.000028591568665], [-140.997769748123119, 60.306396796298593], [-140.012997816153074, 60.276837877027575], [-139.03900042031583, 60.000007229240012], [-138.340889999999888, 59.562110000000146], [-137.4525, 58.905000000000101], [-136.47972, 59.46389], [-135.47583, 59.78778], [-134.945, 59.270560000000117], [-134.27111, 58.86111], [-133.355548882207188, 58.410285142645151], [-132.73042, 57.692890000000105], [-131.707809999999853, 56.55212], [-130.00778, 55.91583], [-129.979994263358265, 55.284997870497207], [-130.536110189467223, 54.802753404349389], [-131.08581823797212, 55.178906155002025], [-131.967211467142278, 55.497775580459049], [-132.250010742859445, 56.369996242897443], [-133.539181084356386, 57.178887437562125], [-134.07806292029602, 58.123067531966889], [-135.038211032279037, 58.187714748763931], [-136.628062309954629, 58.212209377670447], [-137.800006279686016, 58.499995429103777], [-139.867787041412981, 59.537761542389134], [-140.825273817133024, 59.72751740176507], [-142.574443535564427, 60.084446519604981], [-143.958880994879848, 59.99918040632339], [-145.925556816827822, 60.458609727614274], [-147.114373949146625, 60.884656073644628], [-148.224306200127643, 60.672989406977152], [-148.018065558850736, 59.978328965893631], [-148.570822516860858, 59.914172675203297], [-149.727857835875824, 59.705658270905545], [-150.608243374616421, 59.368211168039487], [-151.716392788683294, 59.155821031319974], [-151.859433153267105, 59.74498403587959], [-151.40971900124714, 60.725802720779392], [-150.346941494732505, 61.033587551509854], [-150.621110806256951, 61.284424953854447], [-151.895839199816834, 60.727197984451273], [-152.578329841095581, 60.061657212964285], [-154.019172126257558, 59.350279446034264], [-153.287511359653166, 58.864727688219787], [-154.232492438758442, 58.146373602930531], [-155.307491421510207, 57.727794501366319], [-156.308334723923082, 57.422774359763636], [-156.556097378546298, 56.979984849670636], [-158.117216559867728, 56.463608099994175], [-158.433321296197136, 55.994153550838533], [-159.603327399717415, 55.566686102920116], [-160.289719611634183, 55.643580634170561], [-161.223047655257773, 55.364734605523481], [-162.23776607974105, 55.024186916720097], [-163.069446581046378, 54.689737046927171], [-164.785569221027174, 54.40417308208216], [-164.942226325520011, 54.572224839895327], [-163.84833960676562, 55.039431464246107], [-162.870001390615897, 55.348043117893198], [-161.804174974596009, 55.894986477270429], [-160.563604702781134, 56.008054511125025], [-160.070559862284483, 56.418055324928744], [-158.684442918919416, 57.016675116597852], [-158.461097378553944, 57.216921291728866], [-157.722770352183858, 57.570000515363056], [-157.550274421193564, 58.328326321030218], [-157.041674974576949, 58.918884589261708], [-158.194731208305427, 58.615802313869828], [-158.517217984023034, 58.787781480537305], [-159.058606126928709, 58.424186102931671], [-159.711667040017318, 58.931390285876333], [-159.981288825500144, 58.572549140041623], [-160.355271165996498, 59.071123358793628], [-161.355003425115001, 58.670837714260742], [-161.968893602526293, 58.671664537177371], [-162.054986538724648, 59.266925360747436], [-161.874170702135331, 59.633621324290587], [-162.518059048492034, 59.989723619213905], [-163.818341437820123, 59.798055731843377], [-164.662217577146407, 60.267484442782639], [-165.346387702474772, 60.507495632562396], [-165.350831875651835, 61.073895168697497], [-166.121379157555907, 61.500019029376212], [-165.734451870770471, 62.074996853271792], [-164.919178636717788, 62.633076483807919], [-164.562507901039339, 63.146378485763044], [-163.753332485996964, 63.219448961023758], [-163.067224494457832, 63.05945872664801], [-162.260555386381697, 63.541935736741159], [-161.534449836248569, 63.455816962326757], [-160.772506680321101, 63.76610810002326], [-160.958335130842528, 64.222798570402759], [-161.518068407212184, 64.402787584075313], [-160.777777676414729, 64.788603827566405], [-161.391926235987597, 64.777235012462327], [-162.453050096668818, 64.559444688568206], [-162.757786017894034, 64.338605455168803], [-163.54639421288428, 64.559160468190484], [-164.960829841145141, 64.446945095468848], [-166.425288255864473, 64.686672064870706], [-166.845004238939026, 65.088895575614529], [-168.110560065767146, 65.669997056736733], [-166.70527116602193, 66.088317776139391], [-164.474709642575448, 66.576660061297488], [-163.652511766595637, 66.576660061297488], [-163.788601651036117, 66.077207343196662], [-161.677774421210131, 66.116119696712403], [-162.489714525379981, 66.735565090595102], [-163.719716966791083, 67.116394558370089], [-164.430991380856511, 67.616338202577779], [-165.390286831706703, 68.042772121850234], [-166.764440680995989, 68.35887685817967], [-166.204707404626561, 68.883030910916162], [-164.430810513343431, 68.915535386827727], [-163.168613654614489, 69.371114813912882], [-162.930566169261965, 69.858061835399255], [-161.908897264635499, 70.333329983187625], [-160.93479651593367, 70.447689927849567], [-159.039175788387126, 70.891642157668926], [-158.119722866833939, 70.824721177851032], [-156.580824551398024, 71.357763576941736], [-155.067790290324211, 71.147776394323685]]]] } }, + { "type": "Feature", "properties": { "admin": "Uzbekistan", "name": "Uzbekistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[66.518606805288655, 37.362784328758785], [66.546150343700205, 37.974684963526855], [65.215998976507379, 38.402695013984292], [64.170223016216752, 38.892406724598231], [63.518014764261018, 39.363256537425627], [62.374260288344992, 40.053886216790382], [61.882714064384679, 41.084856879229392], [61.547178989513547, 41.2663703476546], [60.46595299667068, 41.22032664648254], [60.083340691981654, 41.425146185871391], [59.976422153569771, 42.223081976890199], [58.629010857991453, 42.751551011723045], [57.786529982337065, 42.170552883465511], [56.93221520368779, 41.82602610937559], [57.096391229079089, 41.32231008561056], [55.968191359282898, 41.308641669269356], [55.928917270741081, 44.995858466159099], [58.503127068928457, 45.586804307632818], [58.689989048095882, 45.500013739598621], [60.239971958258316, 44.784036770194717], [61.05831994003244, 44.405816962250505], [62.013300408786236, 43.504476630215642], [63.185786981056559, 43.650074978197999], [64.900824415959264, 43.728080552742576], [66.098012322865074, 42.997660020513088], [66.023391554635609, 41.994646307943974], [66.510648634715707, 41.987644151368436], [66.714047072216502, 41.168443508461493], [67.985855747351806, 41.135990708982213], [68.259895867795606, 40.662324530594894], [68.632482944620008, 40.668680731766798], [69.070027296835306, 41.384244289712363], [70.388964878220776, 42.081307684897439], [70.96231489449913, 42.266154283205481], [71.259247674448218, 42.167710679689456], [70.420022414028196, 41.519998277343134], [71.157858514291576, 41.143587144529107], [71.870114780570447, 41.392900092121259], [73.055417108049156, 40.86603302668945], [71.774875115856545, 40.145844428053763], [71.014198032520156, 40.244365546218226], [70.601406691372674, 40.218527330072284], [70.458159621059608, 40.49649485937028], [70.666622348925031, 40.960213324541407], [69.329494663372813, 40.727824408524839], [69.011632928345477, 40.086158148756653], [68.536416456989414, 39.533452867178923], [67.701428664017342, 39.580478420564518], [67.442219679641298, 39.140143541005479], [68.176025018185911, 38.901553453113898], [68.392032505165943, 38.157025254868728], [67.829999627559502, 37.144994004864678], [67.075782098259609, 37.35614390720928], [66.518606805288655, 37.362784328758785]]] } }, + { "type": "Feature", "properties": { "admin": "Venezuela", "name": "Venezuela", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-71.331583624950284, 11.776284084515805], [-71.36000566271079, 11.53999359786121], [-71.947049933546495, 11.423282375530018], [-71.620868292920164, 10.969459947142791], [-71.633063930941063, 10.446494452349027], [-72.074173956984495, 9.865651353388369], [-71.695644090446521, 9.072263088411246], [-71.26455929226772, 9.137194525585981], [-71.039999355743376, 9.859992784052407], [-71.350083787710773, 10.211935126176213], [-71.400623338492224, 10.968969021036013], [-70.155298834906503, 11.375481675660039], [-70.293843349881016, 11.846822414594211], [-69.943244594996813, 12.162307033736095], [-69.584300096297454, 11.459610907431211], [-68.882999233664435, 11.44338450769156], [-68.233271450458716, 10.885744126829945], [-68.194126552997616, 10.554653225135921], [-67.296248541926317, 10.545868231646306], [-66.227864142507983, 10.648626817258684], [-65.655237596281737, 10.20079885501732], [-64.890452236578156, 10.077214667191296], [-64.329478725833724, 10.389598700395679], [-64.318006557864933, 10.641417954953978], [-63.079322475828725, 10.701724351438598], [-61.880946010980182, 10.7156253117251], [-62.730118984616396, 10.420268662960904], [-62.388511928950969, 9.948204453974636], [-61.588767462801918, 9.873066921422263], [-60.830596686431711, 9.38133982994894], [-60.671252407459718, 8.580174261911877], [-60.150095587796166, 8.602756862823425], [-59.758284878159181, 8.367034816924045], [-60.550587938058186, 7.779602972846178], [-60.637972785063752, 7.414999904810853], [-60.295668097562377, 7.043911444522918], [-60.543999192940966, 6.856584377464881], [-61.159336310456467, 6.696077378766317], [-61.139415045807937, 6.234296779806142], [-61.410302903881941, 5.959068101419616], [-60.733574184803707, 5.2002772078619], [-60.601179165271922, 4.918098049332129], [-60.966893276601517, 4.536467596856638], [-62.085429653559125, 4.162123521334308], [-62.804533047116692, 4.006965033377951], [-63.093197597899092, 3.770571193858784], [-63.888342861574145, 4.020530096854571], [-64.628659430587533, 4.14848094320925], [-64.816064012294007, 4.056445217297422], [-64.368494432214092, 3.797210394705246], [-64.408827887617903, 3.126786200366623], [-64.269999152265783, 2.497005520025566], [-63.422867397705105, 2.411067613124174], [-63.368788011311644, 2.200899562993129], [-64.083085496666072, 1.91636912679408], [-64.199305792890499, 1.49285492594602], [-64.611011928959854, 1.328730576987041], [-65.354713304288353, 1.0952822941085], [-65.548267381437554, 0.78925446207603], [-66.325765143484944, 0.724452215982012], [-66.876325853122566, 1.253360500489336], [-67.181294318293041, 2.250638129074062], [-67.447092047786299, 2.600280869960869], [-67.809938117123693, 2.820655015469569], [-67.303173183853417, 3.31845408773718], [-67.33756384954367, 3.542342230641721], [-67.621835903581271, 3.839481716319994], [-67.823012254493534, 4.503937282728898], [-67.744696621355203, 5.221128648291667], [-67.521531948502741, 5.556870428891968], [-67.34143958196556, 6.095468044454021], [-67.695087246355001, 6.267318020040645], [-68.265052456318216, 6.153268133972473], [-68.985318569602327, 6.206804917826856], [-69.389479946557103, 6.099860541198835], [-70.093312954372408, 6.960376491723109], [-70.674233567981503, 7.087784735538717], [-71.960175747348629, 6.991614895043538], [-72.19835242378187, 7.340430813013682], [-72.444487270788059, 7.42378489830048], [-72.479678921178831, 7.632506008327352], [-72.360900641555958, 8.002638454617893], [-72.439862230097944, 8.405275376820027], [-72.660494757768092, 8.62528778730268], [-72.788729824500379, 9.085027167187331], [-73.304951544880026, 9.151999823437604], [-73.027604132769554, 9.736770331252441], [-72.905286017534692, 10.45034434655477], [-72.614657762325194, 10.821975409381777], [-72.227575446242923, 11.108702093953237], [-71.973921678338272, 11.608671576377116], [-71.331583624950284, 11.776284084515805]]] } }, + { "type": "Feature", "properties": { "admin": "Vietnam", "name": "Vietnam", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[108.050180291782908, 21.552379869060111], [106.715067987090066, 20.696850694252014], [105.881682163519002, 19.752050482659694], [105.662005649846279, 19.058165188060567], [106.426816847765991, 18.004120998603224], [107.36195356651973, 16.697456569887049], [108.269495070429599, 16.079742336486145], [108.877106561317447, 15.276690578670436], [109.335269810017209, 13.42602834721772], [109.200135939573954, 11.666859239137761], [108.366129998815424, 11.00832062422627], [107.22092858279521, 10.36448395430183], [106.4051127462034, 9.530839748569317], [105.158263787865081, 8.599759629750492], [104.795185174582372, 9.2410383162765], [105.076201613385592, 9.918490505406806], [104.334334751403446, 10.486543687375228], [105.199914992292321, 10.889309800658094], [106.249670037869436, 10.961811835163585], [105.810523716253101, 11.567614650921225], [107.491403029410861, 12.337205918827944], [107.614547967562402, 13.535530707244202], [107.382727492301058, 14.202440904186968], [107.564525181103875, 15.202173163305554], [107.312705926545576, 15.908538316303177], [106.55600792849566, 16.604283962464802], [105.925762160264, 17.485315456608955], [105.094598423281496, 18.666974595611073], [103.896532017026701, 19.265180975821799], [104.183387892678908, 19.624668077060214], [104.822573683697073, 19.886641750563879], [104.435000441508024, 20.758733221921528], [103.203861118586431, 20.766562201413745], [102.754896274834636, 21.675137233969462], [102.170435825613552, 22.464753119389297], [102.706992222100084, 22.708795070887668], [103.504514601660546, 22.703756618739202], [104.476858351664447, 22.819150092046961], [105.329209425886603, 23.352063300056908], [105.811247186305209, 22.976892401617899], [106.725403273548451, 22.794267889898414], [106.567273390735295, 22.218204860924768], [107.043420037872608, 21.811898912029907], [108.050180291782908, 21.552379869060111]]] } }, + { "type": "Feature", "properties": { "admin": "Vanuatu", "name": "Vanuatu", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[167.844876743845077, -16.466333103097153], [167.515181105822847, -16.597849623279966], [167.180007765977791, -16.159995212470957], [167.2168013857696, -15.891846205308449], [167.844876743845077, -16.466333103097153]]], [[[167.107712437201485, -14.933920179913951], [167.2700281110302, -15.74002084723487], [167.001207310247935, -15.614602146062492], [166.79315799384085, -15.668810723536719], [166.649859247095549, -15.392703545801192], [166.629136997746429, -14.6264970842096], [167.107712437201485, -14.933920179913951]]]] } }, + { "type": "Feature", "properties": { "admin": "Yemen", "name": "Yemen", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[53.108572625547502, 16.651051133688949], [52.385205926325874, 16.38241120041965], [52.191729363825075, 15.938433132384018], [52.168164910699986, 15.597420355689945], [51.172515089732471, 15.175249742081489], [49.574576450403136, 14.708766587782746], [48.679230584514151, 14.003202419485657], [48.238947381387412, 13.948089504446369], [47.938914015500771, 14.007233181204423], [47.354453566279702, 13.592219753468379], [46.71707645039173, 13.399699204965016], [45.877592807810252, 13.347764390511681], [45.625050083199874, 13.290946153206759], [45.406458774605241, 13.02690542241143], [45.144355910020849, 12.953938300015306], [44.9895333188744, 12.699586900274708], [44.494576450382844, 12.721652736863344], [44.175112745954486, 12.585950425664873], [43.48295861183712, 12.63680003504008], [43.222871128112118, 13.220950425667422], [43.251448195169516, 13.767583726450848], [43.087943963398047, 14.062630316621306], [42.892245314308717, 14.802249253798745], [42.604872674333606, 15.213335272680592], [42.805015496600042, 15.261962795467252], [42.702437778500652, 15.718885809791995], [42.823670688657408, 15.911742255105263], [42.779332309750963, 16.34789134364868], [43.218375278502734, 16.666889960186406], [43.115797560403351, 17.088440456607369], [43.380794305196098, 17.579986680567668], [43.791518589051904, 17.319976711491105], [44.062613152855072, 17.410358791569589], [45.216651238797184, 17.43332896572333], [45.399999220568752, 17.333335069238554], [46.366658563020529, 17.233315334537632], [46.749994337761642, 17.283338120996174], [47.000004917189749, 16.949999294497438], [47.466694777217626, 17.116681626854877], [48.183343540241324, 18.166669216377311], [49.116671583864857, 18.616667588774941], [52.000009800022227, 19.000003363516054], [52.782184279192037, 17.349742336491229], [53.108572625547502, 16.651051133688949]]] } }, + { "type": "Feature", "properties": { "admin": "South Africa", "name": "South Africa", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.521001417778869, -29.257386976846245], [31.325561150850994, -29.401977634398907], [30.901762729625336, -29.909956963828034], [30.622813348113816, -30.423775730106122], [30.055716180142774, -31.140269463832951], [28.925552605919535, -32.172041110972494], [28.219755893677092, -32.771952813448848], [27.464608188595967, -33.226963799778794], [26.419452345492818, -33.614950453426175], [25.909664340933482, -33.667040297176392], [25.78062828950069, -33.944646091448334], [25.172861769315965, -33.796851495093577], [24.67785322439212, -33.987175795224537], [23.594043409934635, -33.794474379208147], [22.988188917744729, -33.916430759416976], [22.574157342222232, -33.864082533505304], [21.542799106541022, -34.258838799782922], [20.689052768646999, -34.417175388325226], [20.071261020597628, -34.795136814107984], [19.616405063564567, -34.819166355123706], [19.193278435958714, -34.462598972309777], [18.855314568769867, -34.444305515278458], [18.424643182049376, -33.997872816708963], [18.377410922934612, -34.13652068454806], [18.244499139079917, -33.867751560198023], [18.250080193767442, -33.281430759414434], [17.925190463948436, -32.61129078545342], [18.247909783611185, -32.429131361624563], [18.221761508871477, -31.661632989225662], [17.566917758868861, -30.72572112398754], [17.0644161312627, -29.878641045859158], [17.06291751472622, -29.875953871379977], [16.344976840895239, -28.576705010697697], [16.824017368240899, -28.082161553664466], [17.218928663815401, -28.355943291946804], [17.387497185951499, -28.783514092729774], [17.836151971109526, -28.856377862261311], [18.464899122804745, -29.045461928017271], [19.002127312911082, -28.972443129188857], [19.89473432788861, -28.461104831660769], [19.895767856534427, -24.767790215760588], [20.165725538827186, -24.917961928000768], [20.758609246511831, -25.868136488551446], [20.666470167735437, -26.477453301704916], [20.889609002371731, -26.828542982695907], [21.60589603036939, -26.726533705351748], [22.105968865657864, -26.28025603607913], [22.579531691180584, -25.979447523708142], [22.824271274514896, -25.500458672794768], [23.312096795350179, -25.268689873965712], [23.733569777122703, -25.39012948985161], [24.211266717228792, -25.670215752873567], [25.025170525825782, -25.719670098576891], [25.664666375437712, -25.486816094669706], [25.765848829865206, -25.174845472923671], [25.941652052522151, -24.696373386333214], [26.485753208123292, -24.616326592713097], [26.78640669119741, -24.240690606383478], [27.119409620886238, -23.574323011979772], [28.017235955525244, -22.827753594659072], [29.432188348109033, -22.091312758067584], [29.839036899542965, -22.102216485281172], [30.322883335091767, -22.271611830333931], [30.659865350067083, -22.151567478119912], [31.191409132621278, -22.251509698172395], [31.670397983534645, -23.658969008073861], [31.930588820124242, -24.369416599222532], [31.752408481581874, -25.484283949487406], [31.837777947728057, -25.843331801051342], [31.333157586397899, -25.660190525008943], [31.044079624157146, -25.731452325139436], [30.949666782359905, -26.022649021104144], [30.676608514129633, -26.398078301704604], [30.685961948374477, -26.743845310169526], [31.282773064913325, -27.285879408478991], [31.868060337051073, -27.17792734142127], [32.071665480281062, -26.733820082304902], [32.830120477028878, -26.74219166433619], [32.580264926897677, -27.470157566031808], [32.462132602678444, -28.30101124442055], [32.203388706193032, -28.752404880490065], [31.521001417778869, -29.257386976846245]], [[28.978262566857236, -28.955596612261708], [28.541700066855491, -28.647501722937562], [28.07433841320778, -28.851468601193581], [27.532511020627471, -29.242710870075353], [26.999261915807629, -29.875953871379977], [27.749397006956478, -30.645105889612214], [28.107204624145421, -30.545732110314944], [28.291069370239903, -30.226216729454293], [28.848399692507734, -30.070050551068245], [29.018415154748016, -29.743765557577362], [29.325166456832587, -29.257386976846245], [28.978262566857236, -28.955596612261708]]] } }, + { "type": "Feature", "properties": { "admin": "Zambia", "name": "Zambia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[32.759375441221316, -9.230599053589058], [33.231387973775291, -9.676721693564799], [33.485687697083584, -10.525558770391111], [33.315310499817279, -10.796549981329695], [33.114289178201908, -11.607198174692311], [33.306422153463068, -12.435778090060214], [32.991764357237876, -12.783870537978272], [32.688165317523122, -13.712857761289273], [33.214024692525207, -13.97186003993615], [30.179481235481827, -14.796099134991525], [30.274255812305103, -15.507786960515208], [29.51683434420314, -15.644677829656386], [28.947463413211256, -16.043051446194436], [28.825868768028492, -16.389748630440611], [28.467906121542676, -16.468400160388843], [27.598243442502753, -17.290830580314005], [27.044427117630729, -17.938026218337427], [26.706773309035633, -17.961228936436477], [26.381935255648919, -17.846042168857892], [25.264225701608005, -17.736539808831413], [25.084443393664564, -17.661815687737366], [25.076950310982255, -17.578823337476617], [24.6823490740015, -17.35341073981947], [24.033861525170771, -17.29584319424632], [23.215048455506057, -17.52311614346598], [22.562478468524255, -16.89845142992181], [21.887842644953867, -16.080310153876876], [21.933886346125913, -12.898437188369357], [24.016136508894672, -12.91104623784857], [23.930922072045373, -12.565847670138854], [24.079905226342838, -12.191296888887361], [23.904153680118181, -11.722281589406318], [24.017893507592586, -11.237298272347088], [23.912215203555714, -10.926826267137512], [24.257155389103982, -10.951992689663655], [24.314516228947948, -11.262826429899269], [24.783169793402948, -11.238693536018962], [25.418118116973197, -11.330935967659958], [25.752309604604726, -11.784965101776356], [26.55308759939961, -11.924439792532125], [27.164419793412456, -11.608748467661071], [27.38879886242378, -12.132747491100663], [28.15510867687998, -12.272480564017894], [28.52356163912102, -12.698604424696679], [28.934285922976834, -13.248958428605132], [29.699613885219485, -13.257226657771827], [29.616001417771223, -12.178894545137307], [29.341547885869087, -12.36074391037241], [28.642417433392346, -11.971568698782312], [28.372253045370421, -11.793646742401389], [28.496069777141763, -10.789883721564044], [28.673681674928922, -9.605924981324931], [28.449871046672818, -9.164918308146083], [28.734866570762495, -8.526559340044576], [29.002912225060467, -8.40703175215347], [30.34608605319081, -8.238256524288216], [30.740015496551781, -8.340007419470913], [31.157751336950042, -8.594578747317362], [31.55634809746649, -8.76204884199864], [32.191864861791963, -8.930358981973276], [32.759375441221316, -9.230599053589058]]] } }, + { "type": "Feature", "properties": { "admin": "Zimbabwe", "name": "Zimbabwe", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.191409132621278, -22.251509698172395], [30.659865350067083, -22.151567478119912], [30.322883335091767, -22.271611830333931], [29.839036899542965, -22.102216485281172], [29.432188348109033, -22.091312758067584], [28.794656202924209, -21.639454034107445], [28.02137007010861, -21.485975030200578], [27.727227817503252, -20.851801853114711], [27.724747348753247, -20.499058526290387], [27.296504754350501, -20.391519870690995], [26.164790887158478, -19.293085625894935], [25.850391473094724, -18.714412937090533], [25.649163445750155, -18.536025892818987], [25.264225701608005, -17.736539808831413], [26.381935255648919, -17.846042168857892], [26.706773309035633, -17.961228936436477], [27.044427117630729, -17.938026218337427], [27.598243442502753, -17.290830580314005], [28.467906121542676, -16.468400160388843], [28.825868768028492, -16.389748630440611], [28.947463413211256, -16.043051446194436], [29.51683434420314, -15.644677829656386], [30.274255812305103, -15.507786960515208], [30.338954705534537, -15.880839125230242], [31.173063999157673, -15.860943698797868], [31.636498243951188, -16.071990248277881], [31.852040643040592, -16.319417006091374], [32.328238966610222, -16.392074069893749], [32.847638787575839, -16.713398125884613], [32.849860874164385, -17.979057305577175], [32.654885695127142, -18.672089939043492], [32.611994256324884, -19.419382826416268], [32.772707960752619, -19.715592136313294], [32.659743279762573, -20.30429005298231], [32.508693068173436, -20.395292250248303], [32.244988234188007, -21.116488539313689], [31.191409132621278, -22.251509698172395]]] } } + ] + }; + +var randomcountriesData1 = [ + { country: "Iran", "continent": "Asia", "CategoryName": "Books", "Sales": 550 }, + { country: "Benin", "continent": "Africa", "CategoryName": "Books", "Sales": 1000 }, + { country: "China", "continent": "Asia", "CategoryName": "Books", "Sales": 420 }, + { country: "Chile", "continent": "South America", "CategoryName": "Books", "Sales": 1100 }, + { country: "Cuba", "continent": "North America", "CategoryName": "Books", "Sales": 450 }, + { country: "Spain", "continent": "Europe", "CategoryName": "Books", "Sales": 1200 }, + { country: "Fiji", "continent": "Oceania", "CategoryName": "Books", "Sales": 618.0 }, +]; + +module mapcomponenet { + $(function () { + var mapsample = new ej.datavisualization.Map($("#map"), { + enableAnimation: true, + navigationControl: { + enableNavigation: true, + orientation: 'vertical', + absolutePosition: { x: 5, y: 15 }, + dockPosition: 'none' + }, + layers: [ + { + layerType: 'geometry', + enableMouseHover: false, + enableSelection: false, + shapeSettings: { + fill: "#626171", + autoFill: false, + highlightStroke: "white", + stroke: "white", + strokeThickness: 0.5, + highlightColor: "#BFBFBF" + }, + shapeData: world_map, + legendSettings: { dockOnMap: false } + } + ] + }); + }); +} + + + + + + + +module MenuComponent { + $(function () { + var sample = new ej.Menu($("#syncfusionProducts"),{ + width: "100%", + animationType: ej.AnimationType.Default, + cssClass: 'gradient-lime ', + enableAnimation: true, + enableSeparator: true, + height: 40, + htmlAttributes: { "aria-label": "menu" }, + menuType: "normalmenu", + orientation: ej.Orientation.Horizontal, + showRootLevelArrows: true, + showSubLevelArrows: true, + subMenuDirection: ej.Direction.Right, + titleText: "Menu", + + }); + }); + +} + + + + + + + + +module NavigationDrawerComponent { + $(function () { + var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { + targetId: "butdrawer", + contentId: "content_container", + type: "overlay", + direction: "left", + enableListView: true, + listViewSettings: { + width: 300, + selectedItemIndex: 0 + }, + position: "normal" + }); + $("#navpane_listview").click(function(e: any) { + var text=e.target["text"]||$(e.target).closest("li.e-list").text(); + $("#butdrawer").parent().children("h2").text(text); + }); + }); +} + + + +module PDFViewerComponent { + $(function () { + var pdfviewerControl = new ej.PdfViewer($("#pdfviewer"), { + serviceUrl:(window).baseurl+ "api/PdfViewer", + isResponsive: true + }); + }); +} + + + +module PivotChartOlap { + $(function () { + var sample = new ej.PivotChart($("#PivotChart"),{ + dataSource: { + data: "http://bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + } + ], + axis: "columns" + } + ], + filters:[] + }, + isResponsive: true,zooming:{enableScrollbar: true}, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, + primaryYAxis: { title: { text: "Internet Sales Amount" } }, + legend: { visible: true, rowCount: 2 } + }); + }); +} + + + +var pivot_dataset = [ + { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, + { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, + { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, + { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, + { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, + { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, + { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, + { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, + { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, + { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, + { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, + { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, + { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, + { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, + { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, + { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, + { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, + { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, + { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, + { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } +] + +module PivotChartRelational { + + $(function () { + var sample = new ej.PivotChart($("#PivotChart"),{ + dataSource: { + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + }, + { + fieldName: "Date", + fieldCaption: "Date" + } + ], + columns: [ + { + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + } + ], + filters:[] + }, + isResponsive: true,zooming:{enableScrollbar: true}, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryYAxis: { title: { text: "Amount" } }, + legend: { visible: true } + }); + }); +} + + + +module PivotGaugeOlap { + + $(function () { + var sample = new ej.PivotGauge($("#PivotGauge"),{ + dataSource: { + data: "http://bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]", + filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } + }, + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + }, + { + fieldName: "[Measures].[Internet Revenue Status]" + }, + { + fieldName: "[Measures].[Internet Revenue Trend]" + }, + { + fieldName: "[Measures].[Internet Revenue Goal]" + }, + ], + axis: "columns" + } + ], + filters:[] + }, + enableTooltip: true, isResponsive: true, + labelFormatSettings: { decimalPlaces: 2 }, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, + border: { + width: 0.5 + }, + showIndicators: true, showLabels: true, + pointers: [{ + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 + }, + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, + color: "#8c8c8c" + }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -5, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] + }] + }); + }); +} + + + +var pivot_dataset = [ + { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, + { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, + { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, + { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, + { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, + { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, + { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, + { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, + { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, + { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, + { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, + { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, + { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, + { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, + { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, + { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, + { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, + { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, + { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, + { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } +] + +module PivotGaugeRelational { + $(function () { + var sample = new ej.PivotGauge($("#PivotGauge"),{ + dataSource: { + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + }, + { + fieldName: "State", + } + ], + columns: [ + { + fieldName: "Product", + } + ], + values: [ + { + fieldName: "Amount", + }, + { + fieldName: "Quantity", + } + ] + }, + enableTooltip: true, isResponsive: true, + labelFormatSettings: { decimalPlaces: 2 }, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, + border: { + width: 0.5 + }, + showIndicators: true, showLabels: true, + pointers: [{ + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 + }, + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, + color: "#8c8c8c" + }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -5, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] + }] + }); + }); +} + + + +module PivotGridOlap { + + $(function () { + var sample = new ej.PivotGrid($("#PivotGrid"),{ + dataSource: { + data: "http://bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]", + } + ], + axis: "columns" + } + ], + filters:[] + }, + enableGroupingBar: true, + pivotTableFieldListID:"PivotSchemaDesigner" + }); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + }); +} + + + +var pivot_dataset = [ + { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, + { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, + { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, + { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, + { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, + { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, + { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, + { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, + { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, + { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, + { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, + { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, + { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, + { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, + { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, + { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, + { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, + { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, + { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, + { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } +] + +module PivotGridRelational { + $(function () { + var sample = new ej.PivotGrid($("#PivotGrid"),{ + dataSource: { + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + } + ], + columns: + [{ + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + }, + { + fieldName: "Quantity", + fieldCaption: "Quantity" + } + ], + filters:[] + }, + enableGroupingBar: true, + pivotTableFieldListID:"PivotSchemaDesigner" + }); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + + }); +} + + + +module PivotTreeMap { + $(function () { + var sample = new ej.PivotTreeMap($("#PivotTreeMap"),{ + dataSource: { + data: "http://bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + columns: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Customer Count]", + } + ], + axis: "columns" + } + ], + filters:[] + } + }); + }); +} + + + +module ProgressBarComponent { + $(function () { + var sample = new ej.ProgressBar($("#progressBar"),{ + width: 200, + value: 45, + height: 20, + enablePersistence: true, + maxValue: 200, + minValue: 0, + showRoundedCorner: true, + text: 'loading...' + }); + }); + +} + + + + +declare var rteObj: any; +declare var data: any; +var radialEle = $('#defaultradialmenu'), action = 0, forRedo = 0; +var rteEle = $("#rteSample1"); +module RadialMenuComponent { + $(function () { + + if (!(ej.browserInfo().name == "msie" && parseInt(ej.browserInfo().version) < 9)) { + var radialmenuInstance = new ej.RadialMenu($("#defaultradialmenu"), { + imageClass: "imageclass", + backImageClass: "backimageclass", + targetElementId: "radialtarget1" + }); + $("#radialtarget1").parent().css("position", "relative"); + } + else { + $("#contentDiv").html("Radial Menu is only supported from Internet Explorer Versioned 9 and above.").css({ "font-size": "20px", "color": "red" }); + } + var rteInstance = new ej.RTE($("#rteSample1"), { + width: "100%", + minWidth: "10px", + change: (e) => { radialEle.ejRadialMenu("enableItem", "Undo"); }, + select: (e) => { + var target = $("#radialtarget1"), radialRadius = 150, radialDiameter = 2 * radialRadius, + // To get Iframe positions + iframeY = e.event.clientY, iframeX = e.event.clientX, + // To set Radial Menu position within target + x = iframeX > target.width() - radialRadius ? target.width() - radialDiameter : (iframeX > radialRadius ? iframeX - radialRadius : 0), + y = iframeY > target.height() - radialRadius ? target.height() - radialDiameter : (iframeY > radialRadius ? iframeY - radialRadius : 0); + radialEle.ejRadialMenu("setPosition", x, y); + radialEle.focus(); + $('iframe').contents().find('body').blur(); + }, + showToolbar: false, + showContextMenu: false + }); + $(window).resize(function () { + if (ej.isMobile() && ej.isPortrait()) + $('#defaultradialmenu').css({ "left": 25 }); + }); + }); +} + + +function bold(e: any) { + + rteObj = rteEle.data("ejRTE"); + rteObj.executeCommand("bold"); + data = rteObj._getSelectedHtmlString() ? true : false; + if (data) action += 1; + forRedo = action; + radialEle.focus(); +} +function italic(e: any) { + rteObj = rteEle.data("ejRTE"); + rteObj.executeCommand("italic"); + data = rteObj._getSelectedHtmlString() ? true : false; + if (data) action += 1; + forRedo = action; + radialEle.focus(); +} +function undo(e: any) { + rteObj = rteEle.data("ejRTE"); + rteObj.executeCommand("undo"); + action -= 1; + if (action == 0) + radialEle.ejRadialMenu("disableItem", "Undo"); + radialEle.ejRadialMenu("enableItem", "Redo"); + radialEle.focus(); +} +function redo(e: any) { + rteObj = rteEle.data("ejRTE"); + rteObj.executeCommand("redo"); + action += 1; + if (forRedo == action) radialEle.ejRadialMenu("disableItem", "Redo"); + radialEle.ejRadialMenu("enableItem", "Undo"); + radialEle.focus(); +} + + + + +module RadialSliderComponent { + $(function () { + var radialsliderInstance = new ej.RadialSlider($("#radialSlider"), { + innerCircleImageUrl: "../images/radialslider/chevron-right.png" + }); + }); +} + + +module rangecomponent { + $(function () { + var linearsample = new ej.datavisualization.RangeNavigator($("#RangeNavigator"), { + enableDeferredUpdate: true, + padding: "15", + allowSnapping: true, + selectedRangeSettings: { + start: "2010/5/1", end: "2011/10/1" + }, + isResponsive: true, + tooltipSettings: { + visible: true, labelFormat: "MM/dd/yyyy", backgroundColor: "gray", tooltipDisplayMode: "ondemand" + }, + load: () => { + var rn = $("#RangeNavigator").data("ejRangeNavigator"); + rn.model.series = [ + { + type: 'line', + dataSource: data.Open, xName: "XValue", yName: "YValue", + fill: '#69D2E7' + } + ]; + } + + }); + }); +} +var data; +data = GetData(); + +function GetData() { + var series1:any[]=[]; + var series2:any[]= []; + var value = 100; + var value1 = 120; + for (var i = 1; i < 730; i++) { + + if (Math.random() > .5) { + value += Math.random(); + value1 += Math.random(); + } else { + value -= Math.random(); + value1 -= Math.random(); + } + var point1 = { XValue: new Date(2010, 0, i), YValue: value }; + var point2 = { XValue: new Date(2010, 0, i), YValue: value1 }; + series1.push(point1); + series2.push(point2); + } + + data = { Open: series1, Close: series2 }; + return data; +}; + + + +module RatingComponent { + $(function () { + + var sample1 = new ej.Rating($("#fullRating"),{ + value: 4, + precision: ej.Rating.Precision.Full, + allowReset: true, + cssClass: "gradient-lime", + enabled: true, + enablePersistence: true, + incrementStep: 2, + maxValue: 10, + minValue: 0, + orientation: ej.Orientation.Horizontal, + shapeHeight: 25, + shapeWidth: 25, + showTooltip: true + }); + + var sample2 = new ej.Rating($("#halfRating"),{ + precision: ej.Rating.Precision.Half, + value: 3.5, + allowReset: true, + cssClass: "gradient-lime", + enabled: true, + enablePersistence: true, + incrementStep: 2, + maxValue: 10, + minValue: 0, + orientation: "horizontal", + shapeHeight: 25, + shapeWidth: 25, + showTooltip: true + }); + + var sample3 = new ej.Rating($("#exactRating"),{ + precision: ej.Rating.Precision.Exact, + value: 3.7, + allowReset: true, + cssClass: "gradient-lime", + enabled: true, + enablePersistence: true, + incrementStep: 2, + maxValue: 10, + minValue: 0, + orientation: "horizontal", + shapeHeight: 25, + shapeWidth: 25, + showTooltip: true + }); + }); + +} + + + +module ReportViewerComponent { + $(function () { + var report = new ej.ReportViewer($("#territoryReportViewer"), { + reportServiceUrl: (window).baseurl + 'api/ReportViewer', + reportServerUrl: 'http://mvc.syncfusion.com/reportserver', + processingMode: ej.ReportViewer.ProcessingMode.Remote, + reportPath: "/SSRSSamples2/Territory Sales new", + isResponsive: true + }); + }); +} + + + +var fontfamily = ["Segoe UI", "Arial", "Times New Roman", "Tahoma", "Helvetica"], fontsize = ["1pt", "2pt", "3pt", "4pt", "5pt"], action1 = ["New", "Clear"], action2 = ["Bold", "Italic", "Underline", "strikethrough", "superscript", "subscript", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyFull", "Undo", "Redo"]; +module RibbonComponent { + $(function () { + var sample = new ej.Ribbon($("#defaultRibbon"), { + width: "100%", + expandPinSettings: { + toolTip: "Collapse the Ribbon" + }, + collapsePinSettings: { + toolTip: "Pin the Ribbon" + }, + applicationTab: { + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + }, + tabs: [{ + id: "home", text: "HOME", groups: [{ + text: "New", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "new", + text: "New", + toolTip: "New", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-new" + } + } + ], + defaults: { + type: "button", + width: 60, + height: 70 + } + }] + }, + { + text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{ + groups: [{ + id: "paste", + text: "paste", + toolTip: "Paste", + splitButtonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-ribbonpaste", + targetID: "pasteSplit", + buttonMode: "dropdown", + arrowPosition: ej.ArrowPosition.Bottom + } + } + ], + defaults: { + type: "splitbutton", + width: 50, + height: 70 + } + }, + { + groups: [{ + id: "cut", + text: "Cut", + toolTip: "Cut", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + prefixIcon: "e-icon e-ribbon e-ribboncut" + } + }, + { + id: "copy", + text: "Copy", + toolTip: "Copy", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + prefixIcon: "e-icon e-ribbon e-ribboncopy" + } + }, + { + id: "clear", + text: "Clear", + toolTip: "Clear All", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + prefixIcon: "e-icon e-ribbon clearAll" + } + }], + defaults: { + type: "button", + width: 60, + isBig: false + } + }] + }, + { + text: "Font", alignType: "rows", content: [{ + groups: [{ + id: "fontfamily", + toolTip: "Font", + dropdownSettings: { + dataSource: fontfamily, + text: "Segoe UI", + width: 150 + } + }, + { + id: "fontsize", + toolTip: "FontSize", + dropdownSettings: { + dataSource: fontsize, + text: "1pt", + width: 65 + } + }], + defaults: { + type: "dropdownlist", + height: 28 + } + }, + { + groups: [{ + id: "bold", + toolTip: "Bold", + type: ej.Ribbon.Type.ToggleButton, + toggleButtonSettings: { + contentType: ej.ContentType.ImageOnly, + defaultText: "Bold", + activeText: "Bold", + defaultPrefixIcon: "e-icon e-ribbon bold", + activePrefixIcon: "e-icon e-ribbon bold" + } + }, + { + id: "italic", + toolTip: "Italic", + type: ej.Ribbon.Type.ToggleButton, + toggleButtonSettings: { + contentType: ej.ContentType.ImageOnly, + defaultText: "Italic", + activeText: "Italic", + defaultPrefixIcon: "e-icon e-ribbon e-ribbonitalic", + activePrefixIcon: "e-icon e-ribbon e-ribbonitalic" + } + }, + { + id: "underline", + text: "Underline", + toolTip: "Underline", + type: ej.Ribbon.Type.ToggleButton, + toggleButtonSettings: { + contentType: ej.ContentType.ImageOnly, + defaultText: "Underline", + activeText: "Underline", + defaultPrefixIcon: "e-icon e-ribbon e-ribbonunderline", + activePrefixIcon: "e-icon e-ribbon e-ribbonunderline" + } + }, + { + id: "strikethrough", + text: "strikethrough", + toolTip: "Strikethrough", + type: ej.Ribbon.Type.ToggleButton, + toggleButtonSettings: { + contentType: ej.ContentType.ImageOnly, + defaultText: "Strikethrough", + activeText: "Strikethrough", + defaultPrefixIcon: "e-icon e-ribbon strikethrough", + activePrefixIcon: "e-icon e-ribbon strikethrough" + } + }, + { + id: "superscript", + text: "superscript", + toolTip: "Superscript", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-superscripticon" + } + }, + { + id: "subscript", + text: "subscript", + toolTip: "Subscript", + enableSeparator: true, + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-subscripticon" + } + }, + { + id: "fontcolor", + text: "Font Color", + toolTip: "Font Color", + type: ej.Ribbon.Type.Custom, + contentID: "fontcolor" + }, + { + id: "fillcolor", + text: "Fill Color", + toolTip: "Fill Color", + type: ej.Ribbon.Type.Custom, + contentID: "fillcolor" + } + ], + defaults: { + isBig: false + } + }] + }, + { + text: "Alignment", alignType: ej.Ribbon.AlignType.Rows, content: [ + { + groups: [{ + id: "bullet", + text: "Bullet Format", + toolTip: "Bullets", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-bullet" + } + }, + { + id: "number", + text: "Number Format", + toolTip: "Numbering", + enableSeparator: true, + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-numbericon" + } + }, + { + id: "textindent", + text: "Indent", + toolTip: "Text Indent", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-indent" + } + }, + { + id: "textoudent", + text: "Outdent", + toolTip: "Text Outdent", + enableSeparator: true, + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-outdent" + } + }, + { + id: "sortascending", + text: "Sort", + toolTip: "Sort", + enableSeparator: true, + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-sort" + } + }, + { + id: "border", + text: "Border", + toolTip: "Border", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-border" + } + }], + defaults: { + type: "button", + isBig: false + } + }, + { + groups: [{ + id: "alignleft", + text: "JustifyLeft", + toolTip: "Align Left", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon alignleft" + } + }, + { + id: "aligncenter", + text: "JustifyCenter", + toolTip: "Align Center", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon aligncenter" + } + }, + { + id: "alignright", + text: "JustifyRight", + toolTip: "Align Right", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon alignright" + } + }, + { + id: "justify", + text: "JustifyFull", + toolTip: "Justify", + enableSeparator: true, + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon justify" + } + }, + { + id: "uppercase", + text: "Upper Case", + toolTip: "Upper Case", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-uppercase" + } + }, + { + id: "lowercase", + text: "Lower Case", + toolTip: "Lower Case", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-lowercase" + } + }], + defaults: { + type: "button", + isBig: false + } + }] + }, + { + text: "Actions", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "undo", + text: "Undo", + toolTip: "Undo", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-undo" + } + }, + { + id: "redo", + text: "Redo", + toolTip: "Redo", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-redo" + } + } + ], + defaults: { + type: "button", + width: 40, + height: 70 + } + }] + }, + { + text: "View", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "zoomin", + text: "Zoom In", + toolTip: "Zoom In", + buttonSettings: { + width: 58, + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-zoomin" + } + }, + { + id: "zoomout", + text: "Zoom Out", + toolTip: "Zoom Out", + buttonSettings: { + width: 70, + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-zoomout" + } + }, + { + id: "fullscreen", + text: "Full Screen", + toolTip: "Full Screen", + buttonSettings: { + width: 73, + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-fullscreen" + } + } + ], + defaults: { + type: "button", + height: 70 + } + }] + }] + },{ + id: "insert", text: "INSERT", groups: [{ + text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{ + groups: [{ + id: "tables", + text: "Tables", + toolTip: "Tables", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-table" + } + } + ], + defaults: { + type: "button", + width: 50, + height: 70 + } + }] + }, + { + text: "Illustrations", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "pictures", + text: "Pictures", + toolTip: "Pictures", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-picture" + } + }, + { + id: "videos", + text: "Videos", + toolTip: "Videos", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-video" + } + }, + { + id: "shapes", + text: "Shapes", + toolTip: "Shapes", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-shape" + } + }, + { + id: "charts", + text: "Charts", + toolTip: "Charts", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-chart" + } + } + ], + defaults: { + type: "button", + width: 56, + height: 70 + } + }] + }, + { + text: "Comments", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "comments", + text: "Comments", + toolTip: "Comments", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-comment" + } + } + ], + defaults: { + type: "button", + width: 70, + height: 70 + } + }] + }, + { + text: "Text", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "text", + text: "Text", + toolTip: "Text", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-text", + width: 50 + } + }, + { + id: "datetime", + text: "Date Time", + toolTip: "DateTime", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-datetimenew" + } + } + ], + defaults: { + type: "button", + width: 70, + height: 70 + } + }] + }, + { + text: "Hyperlink", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "hyperlink", + text: "Hyperlink", + toolTip: "Hyperlink", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-hyperlink" + } + } + ], + defaults: { + type: "button", + width: 70, + height: 70 + } + }] + }, + { + text: "Equation", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "equation", + text: "Equation", + toolTip: "Equation", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-equation" + } + } + ], + defaults: { + type: "button", + width: 60, + height: 70 + } + }] + }, + { + text: "Print Layout", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "printlayout", + text: "Print Layout", + toolTip: "Print Layout", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-printlayout" + } + } + ], + defaults: { + type: "button", + width: 80, + height: 70 + } + }] + }, + { + text: "Save", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "print", + text: "Print", + toolTip: "Print", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-print" + } + }, + { + id: "save", + text: "Save", + toolTip: "Save", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-save" + } + } + ], + defaults: { + type: "button", + width: 50, + height: 70 + } + }] + } + ] + } + ], + create: function createControl(args) { + var ribbon = $("#defaultRibbon").data("ejRibbon"); + $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); + $("#fillcolor").ejColorPicker({ value: "#FF0000", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fillcoloricon", select: colorHandler }); + } + }); + }); +} +function colorHandler(args:any) { + (this._id.indexOf("fillcolor") != -1) ? $("#contenteditor").css('background-color', args.value) : document.execCommand('forecolor', false, args.value); +} + + + + + + +module RotatorComponent { + $(function () { + var rotatorInstance = new ej.Rotator($("#sliderContent"), { + slideWidth: "100%", + frameSpace: "0px", + slideHeight: "auto", + displayItemsCount: "1", + navigateSteps: "1", + pagerPosition:"outside", + orientation: "horizontal", + showPager: true, + enabled: true, + showCaption: true, + allowKeyboardNavigation: true, + showPlayButton: true, + isResponsive:true, + animationType: "slide", + }); + }); +} + + + +module RTEComponent { + $(function () { + var sample = new ej.RTE($("#rteSample"),{ + width: "100%", + minWidth: "150px", + showFooter: true, + showHtmlSource: true, + allowEditing: true, + allowKeyboardNavigation: true, + autoFocus: true, + autoHeight: true, + colorPaletteColumns: 10, + colorPaletteRows: 5, + cssClass: 'gradient-lime', + enableResize: true, + enableTabKeyNavigation: true, + fileBrowser: { + filePath: (window).baseurl + "Content/FileBrowser/", + extensionAllow: "*.png, *.doc, *.pdf, *.txt, *.docx", + ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" + }, + imageBrowser: { + filePath: (window).baseurl + "Content/FileBrowser/", + extensionAllow: "*.png, *.gif, *.jpg, *.jpeg, *.docx", + ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" + }, + isResponsive: true, + showClearAll: true, + showClearFormat: true, + showDimensions: true, + showCharCount: true, + tools: { + formatStyle: ["format"], + edit: ["findAndReplace"], + font: ["fontName", "fontSize", "fontColor", "backgroundColor"], + style: ["bold", "italic", "underline", "strikethrough"], + alignment: ["justifyLeft", "justifyCenter", "justifyRight", "justifyFull"], + lists: ["unorderedList", "orderedList"], + clipboard: ["cut", "copy", "paste"], + doAction: ["undo", "redo"], + indenting: ["outdent", "indent"], + clear: ["clearFormat", "clearAll"], + links: ["createLink", "removeLink"], + images: ["image"], + media: ["video"], + tables: ["createTable", "addRowAbove", "addRowBelow", "addColumnLeft", "addColumnRight", "deleteRow", "deleteColumn", "deleteTable"], + effects: ["superscript", "subscript"], + casing: ["upperCase", "lowerCase"], + view: ["fullScreen", "zoomIn", "zoomOut"], + print: ["print"], + customUnorderedList: [{ + name: "unOrderInsert", + tooltip: "Custom UnOrderList", + css: "e-rte-toolbar-icon e-rte-unlistitems customUnOrder", + text: "Smiley", + listImage: "url('../content/images/rte/Smiley-GIF.gif')" + }], + customOrderedList: [{ + name: "orderInsert", + tooltip: "Custom OrderList", + css: "e-rte-toolbar-icon e-rte-listitems customOrder", + text: "Lower-Greek", + listStyle: "lower-greek" + }] + } + }); + }); + +} + + + +module ScheduleComponent { + $(function () { + var sample = new ej.Schedule($("#Schedule1"), { + width: "100%", + height: "525px", + currentDate: new Date(2014, 4, 5), + timeScale: { + minorSlotCount: 4, + majorSlot: 60 + }, + contextMenuSettings: { + enable: true, + menuItems: { + appointment: [ + { id: "open", text: "Open Appointment" }, + { id: "delete", text: "Delete Appointment" }, + { id: "customMenu3", text: "Menu Item 3" }, + { id: "customMenu4", text: "Menu Item 4" } + ], + cells: [ + { id: "new", text: "New Appointment" }, + { id: "recurrence", text: "New Recurring Appointment" }, + { id: "today", text: "Today" }, + { id: "gotodate", text: "Go to date" }, + { id: "settings", text: "Settings" }, + { id: "view", text: "View", parentId: "settings" }, + { id: "timemode", text: "TimeMode", parentId: "settings" }, + { id: "view_Day", text: "Day", parentId: "view" }, + { id: "view_Week", text: "Week", parentId: "view" }, + { id: "view_Workweek", text: "Workweek", parentId: "view" }, + { id: "view_Month", text: "Month", parentId: "view" }, + { id: "timemode_Hour12", text: "12 Hours", parentId: "timemode" }, + { id: "timemode_Hour24", text: "24 Hours", parentId: "timemode" }, + { id: "workhours", text: "Work Hours", parentId: "settings" }, + { id: "customMenu1", text: "Menu Item 1" }, + { id: "customMenu2", text: "Menu Item 2" } + ] + } + }, + resources: [{ + field: "ownerId", + title: "Owner", + name: "Owners", allowMultiple: true, + resourceSettings: { + dataSource: [ + { text: "Nancy", id: 1, groupId: 1, color: "#f8a398" }, + { text: "Steven", id: 3, groupId: 2, color: "#56ca85" }, + { text: "Michael", id: 5, groupId: 1, color: "#51a0ed" } + ], + text: "text", id: "id", groupId: "groupId", color: "color" + } + }], + appointmentSettings: { + dataSource: new ej.DataManager((window).Default).executeLocal(new ej.Query().take(10)), + id: "Id", + subject: "Subject", + startTime: "StartTime", + endTime: "EndTime", + description: "Description", + allDay: "AllDay", + recurrence: "Recurrence", + recurrenceRule: "RecurrenceRule", + resourceFields: "ownerId" + } + }); + }); +} + + + +module ScrollerComponent { + $(function () { + var scrollerSample = new ej.Scroller($("#scrollcontent"), { + height: "300px", + width: "100%" + }); + $(window).bind('resize', function () { + scrollerSample.refresh(); + }); + }); +} + + + +module SignatureComponent { + $(function () { + var basicSignature = new ej.Signature($("#signature"), { + height: "400px", + isResponsive: true, + strokeWidth: 3 + }); + }); +} + + + + +module SliderComponent { + $(function () { + var slider = new ej.Slider($("#minSlider"), { + sliderType: "MinRange", + height: "16px", + width: "300px", + value: 60, + minValue: 0, + maxValue: 100 + }); + var rangeslider = new ej.Slider($("#rangeSlider"), { + sliderType: "Range", + height: "16px", + width: "300px", + values: [30, 60], + minValue: 0 + }); + + }); +} + + + + + + +module linesparkline { + $(function () { + + var sparklinesample = new ej.Sparkline($("#line"), { + dataSource: [12, 14, 11, 12, 11, 15, 12, 10, 11, 12, 15, 13, 12, 11, 10, 13, 15, 12, 14, 16, 14, 12, 11], + tooltip: { + visible: true, + font: { size:"12px" } + }, + type: "line", + size: { height: "40", width:"170" }, + }); + }); +} + +module columnsparkline { + $(function () { + var sparkcolumnsample = new ej.Sparkline($("#column"), { + dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10,], + negativePointColor: "red", + highPointColor: "blue", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + type: "column", + size: { height: "100", width: "150" }, + }); + }); +} + +module areasparkline { + $(function () { + var sparkareasample = new ej.Sparkline($("#area"), { + dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10,], + markerSettings: { visible: true }, + highPointColor: "blue", + lowPointColor: "orange", + type: "area", + opacity: 0.5, + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "100", width: "150" }, + }); + }); +} + +module windlosssparkline { + $(function () { + var sparkwinlosssample = new ej.Sparkline($("#winloss"), { + dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10,], + type: "winloss", + size: { height: "100", width: "150" }, + }); + }); +} + +module piesparkline1 { + $(function () { + var sparkpiesample1 = new ej.Sparkline($("#pie1"), { + dataSource: [4, 6, 7], + type: "pie", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "40", width: "40" }, + }); + }); +} + +module piesparkline2 { + $(function () { + var sparkpiesample2 = new ej.Sparkline($("#pie2"), { + dataSource: [8, 9, 1,], + type: "pie", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "40", width: "40" }, + }); + }); +} + +module piesparkline3 { + $(function () { + var sparkpiesample3 = new ej.Sparkline($("#pie3"), { + dataSource: [2, 3, 5], + type: "pie", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "40", width: "40" }, + }); + }); +} + +module piesparkline4 { + $(function () { + var sparkpiesample4 = new ej.Sparkline($("#pie4"), { + dataSource: [10, 12, 11], + type: "pie", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "40", width: "40" }, + }); + }); +} + + + + + + +module SplitterComponent { + $(function () { + var splitterInstance = new ej.Splitter($("#outterSpliter"), { + height: "250px", + width: "50%", + orientation: ej.Orientation.Vertical, + properties: [{}, { paneSize: 80 }], + isResponsive:true + }); + var splitterInstance1 = new ej.Splitter($("#innerSpliter"), { + isResponsive:true, + }); + }); +} + + + +module SpreadsheetComponent { +$(function () { + var sample = new ej.Spreadsheet($("#basicSpreadsheet"), { + scrollSettings: { + height: 550, + }, + importSettings: { + importMapper: (window).baseurl + "api/Spreadsheet/Import" + }, + exportSettings: { + excelUrl: (window).baseurl + "api/Spreadsheet/ExcelExport", + csvUrl: (window).baseurl + "api/Spreadsheet/CsvExport", + pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" + }, + sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], + loadComplete: () => { + var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; + if (!(spreadsheet).isImport) { + spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); + xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); + xlFormat.format({ "type": "currency" }, "E2:H11"); + spreadsheet.XLRibbon.updateRibbonIcons(); + }} + }); + }); +} + + + + +var default_data: Array = [ + { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup:"Executive", EmployeesCount : 50 }, + { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Marketing", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 55 }, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 175}, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, + { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, + + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, + { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, + { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, + + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, + { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, + { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, + { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, + + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, + { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, + { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, + + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, + { Category : "Employees", Country : "France", JobDescription: "Marketing", EmployeesCount: 50 } +]; + +module sunburstcomponent { + $(function () { + var sunburstsample = new ej.SunburstChart($("#Sunburst"), { + valueMemberPath: "EmployeesCount", + levels: [ + {groupMemberPath: "Country"}, + {groupMemberPath: "JobDescription"}, + {groupMemberPath: "JobGroup"}, + {groupMemberPath: "JobRole"} + ], + dataSource: default_data, + dataLabelSettings:{visible:true}, + tooltip:{visible:false}, + enableAnimation:false, + size:{height:"600"}, + innerRadius:0.2, + title:{text:"Employees Count"}, + zoomSettings:{enable:false}, + legend:{visible:true,position:'top'} + }); + }); +} + + + + +module TabComponent { + $(function () { + var sample = new ej.Tab($("#defaultTab"),{ + width: "500px", + collapsible: true, + events: "click", + heightAdjustMode: ej.Tab.HeightAdjustMode.Content, + showCloseButton: true, + showRoundedCorner: false + }); + }); +} + + + +module TagCloudComponent { + + + var websiteCollection = [ + { text: "Google", url: "http://www.google.com", frequency: 12 }, + { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, + { text: "Arts Technica", url: "http://arstechnica.com/", frequency: 8 }, + { text: "Business Week", url: "http://www.businessweek.com/", frequency: 2 }, + { text: "Yahoo", url: "http://in.yahoo.com/", frequency: 12 }, + { text: "Center Networks", url: "http://www.centernetworks.com/", frequency: 5 }, + { text: "Crave", url: "http://news.cnet.com/crave/", frequency: 8 }, + { text: "Crunch Gear", url: "http://techcrunch.com/gadgets/", frequency: 20 }, + { text: "Daily Tech", url: "http://www.dailytech.com/", frequency: 1 }, + { text: "Electronista", url: "http://www.electronista.com/", frequency: 3 }, + { text: "Engadget", url: "http://www.engadget.com/", frequency: 5 }, + { text: "Gearlog", url: "http://www.gearlog.com/", frequency: 9 }, + { text: "Information Week", url: "http://www.informationweek.com/", frequency: 0 }, + { text: "PCWorld", url: "http://www.pcworld.com/", frequency: 11 }, + { text: "Tech Republic", url: "http://techrepublic.com/", frequency: 3 }, + { text: "Valleywag", url: "http://valleywag.gawker.com/", frequency: 6 }, + { text: "Rediff", url: "http://in.rediff.com/", frequency: 9 }, + { text: "WebProNews", url: "http://www.webpronews.com/", frequency: 2 } + ]; + + $(function () { + var sample = new ej.TagCloud($("#techWebList"), { + titleText: "Tech Sites", + dataSource: websiteCollection, + cssClass: "gradient-lime", + fields: { + text: "text", url: "url", frequency: "frequency" + } + }); + + }); +} + + + +module EditorComponent { + $(function () { + var num = new ej.NumericTextbox($("#numeric"), { + value: 30, + minValue: 1, + maxValue: 100, + name: "numeric", + width: "100%" + }); + var per = new ej.PercentageTextbox($("#percent"), { + value: 60, + minValue: 10, + maxValue: 1000, + name: "percent", + width: "100%" + }); + var cur = new ej.CurrencyTextbox($("#currency"), { + value: 100, + minValue: 10, + maxValue: 1000, + name: "currency", + width: "100%" + }); + var mask = new ej.MaskEdit($("#maskedit"), { + name: "mask", + value: "4242422424", + maskFormat: "99 999-99999", + width: "100%" + }) + }); +} + + + + + +module TileViewComponent { + $(function () { + var tile1 = new ej.Tile($("#tile1"), { + imagePosition:"fill", + caption:{text:"People"}, + tileSize:"medium", + imageUrl:'content/images/tile/windows/people_1.png' + }); + var tile2 = new ej.Tile($("#tile2"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/alerts.png', + + }); + var tile3 = new ej.Tile($("#tile3"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/bing.png', + }); + var tile4 = new ej.Tile($("#tile4"), { + tileSize:"small", + imageUrl:'content/images/tile/windows/camera.png', + }); + var tile5 = new ej.Tile($("#tile5"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/messages.png', + }); + var tile6 = new ej.Tile($("#tile6"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/games.png', + caption:{text:"Play"} + }); + var tile7 = new ej.Tile($("#tile7"), { + tileSize:"medium", + imageUrl:'content/images/tile/windows/map.png', + caption:{text:"Maps"} + }); + var tile8 = new ej.Tile($("#tile8"), { + imagePosition:"fill", + tileSize:"wide", + imageUrl:'content/images/tile/windows/sports.png', + caption:{text:"Sports"} + }); + var tile9 = new ej.Tile($("#tile9"), { + imagePosition:"fill", + tileSize:"medium", + imageUrl:'content/images/tile/windows/people_2.png', + caption:{text:"People"} + }); + var tile10 = new ej.Tile($("#tile10"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/pictures.png', + caption:{text:"Photo"} + }); + var tile11 = new ej.Tile($("#tile11"), { + imagePosition:"center", + tileSize:"wide", + imageUrl:'content/images/tile/windows/weather.png', + caption:{text:"Weather"} + }); + var tile12 = new ej.Tile($("#tile12"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/music.png', + caption:{text:"Music"} + }); + var tile13 = new ej.Tile($("#tile13"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/favs.png', + caption:{text:"Favorites"} + }); + }); +} + + + +module TimePickerComponent { + $(function () { + var timeSample = new ej.TimePicker($("#timepick"), { + width: "100%" + }); + }); +} + + + + +module ToolbarComponent { + + $(function () { + var sample = new ej.Toolbar($("#editingToolbar"),{ + width: "100%", + cssClass: "gradient-lime", + enableSeparator: true, + height: 30, + isResponsive: true, + orientation: ej.Orientation.Horizontal, + showRoundedCorner: true + }); + }); + +} + + + + +module TooltipComponent { + + $(function () { + + var sample1 = new ej.Tooltip($("#link1"),{ + content: "ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.", + associate: "mousefollow", + autoCloseTimeout: 5000, + collision: "fit", + containment: ".frame", + showRoundedCorner: true, + showShadow: true + }); + + var sample2 = new ej.Tooltip($("#link2"),{ + content: "The World Wide Web (WWW) is an information space where documents and other web resources are identified by URLs, interlinked by hypertext links, and can be accessed via the Internet.", + position: { + stem: { + horizontal: "right", + vertical: "center" + }, + target: { + horizontal: "left", + vertical: "center" + } + }, + autoCloseTimeout: 5000, + collision: "fit", + containment: ".frame", + showRoundedCorner: true, + showShadow: true + }); + + var sample3 = new ej.Tooltip($("#link3"),{ + content: 'Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic.', + position: { + stem: { + horizontal: "right", + vertical: "center" + }, + target: { + horizontal: "left", + vertical: "center", + }, + }, + associate: "mousefollow", + autoCloseTimeout: 5000, + collision: "fit", + containment: ".frame", + showRoundedCorner: true, + showShadow: true + }); + }); +} + + + +module TreeGridComponent { + $(function () { + var treegridInstance = new ej.TreeGrid($("#TreeGridContainer"), { + dataSource: (window).treeGridData, + childMapping: "subtasks", + allowSorting: true, + allowMultiSorting: true, + enableAltRow: true, + allowFiltering: true, + treeColumnIndex: 1, + allowKeyboardNavigation: true, + showColumnChooser: true, + showColumnOptions: true, + contextMenuSettings: { + showContextMenu: true, + contextMenuItems: ["add", "edit", "delete"] + }, + columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], + editSettings: { + allowAdding: true, + allowEditing: true, + allowDeleting: true, + editMode: "cellEditing", + rowPosition: "belowSelectedRow" + }, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add","edit","delete","update","cancel","expandAll","collapseAll"] + }, + columns: [ + { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, + { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, + { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } + ], + isResponsive: true, + }); +}); +} + + + + +var population_data: Array = [ + { Continent: "Asia", Country: "Indonesia", Growth: 3, Population: 237641326 }, + { Continent: "Asia", Country: "Russia", Growth: 2, Population: 152518015 }, + { Continent: "Asia", Country: "Malaysia", Growth: 1, Population: 29672000 }, + { Continent: "North America", Country: "United States", Growth: 4, Population: 315645000 }, + { Continent: "North America", Country: "Mexico", Growth: 2, Population: 112336538 }, + { Continent: "North America", Country: "Canada", Growth: 1, Population: 39056064 }, + { Continent: "South America", Country: "Colombia", Growth: 1, Population: 47000000 }, + { Continent: "South America", Country: "Brazil", Growth: 3, Population: 193946886 }, + { Continent: "Africa", Country: "Nigeria", Growth: 2, Population: 170901000 }, + { Continent: "Africa", Country: "Egypt", Growth: 1, Population: 83661000 }, + { Continent: "Europe", Country: "Germany", Growth: 1, Population: 81993000 }, + { Continent: "Europe", Country: "France", Growth: 1, Population: 65605000 }, + { Continent: "Europe", Country: "UK", Growth: 1, Population: 63181775 } +]; + +module treemapcomponent { + $(function () { + var treemapsample = new ej.datavisualization.TreeMap($("#treemap"), { + leafItemSettings: { showLabels: true, labelPath: "Country" }, + rangeColorMapping: [ + { color: "#77D8D8", legendLabel: "1% Growth", from: 0, to: 1 }, + { color: "#AED960", from: 0, legendLabel: "2% Growth", to: 2 }, + { color: "#FFAF51", from: 0, legendLabel: "3% Growth", to: 3 }, + { color: "#F3D240", from: 0, legendLabel: "4% Growth", to: 4 } + ], + levels: [ + { groupPath: "Continent", groupGap: 5, headerHeight: 25, showHeader: true, headerTemplate: 'headertemplate' } + ], + dataSource: population_data, + colorValuePath: "Growth", + weightValuePath: "Population", + borderThickness: 0, + showLegend: true + }); + }); +} + + + + + +module TreeViewComponent { + $(function () { + var tree = new ej.TreeView($("#treeView"), { + allowEditing: true, + allowDragAndDrop: true, + allowDropChild: true, + allowDropSibling: true, + }); + }); +} + + + + +module UploadboxComponent { + + $(function () { + var sample = new ej.Uploadbox($("#UploadDefault"),{ + saveUrl: "uploadbox/saveFiles.ashx", + removeUrl: "uploadbox/removeFiles.ashx", + buttonText: { + browse: "Choose File", upload: "Upload", cancel: "Cancel" + }, + cssClass: "gradient- purple", + dialogAction: { + modal: false, closeOnComplete: false, drag: true + }, + extensionsAllow: ".zip", + multipleFilesSelection: true, + showFileDetails: true + }); + }); + +} + + + + +module WaitingPopupComponent { + $(function () { + var sample = new ej.WaitingPopup($("#target"),{ + showOnInit: true, + showImage: true, + text: 'waiting…', + target: "#target", + appendTo: "#waiting" + }); + }); + +} diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 41d0f2f54f..975a5baa70 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ej.web.all 14.4 +// Type definitions for ej.web.all 15.1.33 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -7,15 +7,15 @@ /*! * filename: ej.web.all.d.ts -* version : 14.4.0.20 -* Copyright Syncfusion Inc. 2001 - 2016. All rights reserved. +* version : 15.1.0.33 +* Copyright Syncfusion Inc. 2001 - 2017. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under -* applicable laws. +* applicable laws. */ declare module ej { - + var dataUtil: dataUtil; function isMobile(): boolean; function isIOS(): boolean; @@ -103,7 +103,7 @@ declare module ej { function select(jsonArray: any, fields: string): any; function setTransition(): boolean; function sum(json: string, fieldName: string): string; - function swap(array: any, x: string, y: string): any; + function swap(array: any, x: string, y: string): any; var cssUA: string; var serverTimezoneOffset: number; var transform: string; @@ -117,7 +117,7 @@ declare module ej { var template: any; var util: { valueFunction(val: string): any; - } + } export module device { function isAndroid(): boolean; function isIOS(): boolean; @@ -133,8 +133,8 @@ declare module ej { function destroyAll(elements: Element): void; function init(element: Element): void; function registerInstance(element: Element, pluginName: string, className: string, prototype: any):void; - } - + } + interface browserInfoOptions { name: string; version: string; @@ -150,7 +150,7 @@ declare module ej { _on(element: JQuery, eventType?: string, handler?: (eventObject: JQueryEventObject) => any): any; _on(element: JQuery, eventType ?: string, selector ?: string, handler ?: (eventObject: JQueryEventObject) => any): any; _off(element: JQuery, eventName: string, handler ?: (eventObject: JQueryEventObject) => any): any; - _off(element: JQuery, eventType ?: string, selector ?: string, handler ?: (eventObject: JQueryEventObject) => any): any; + _off(element: JQuery, eventType ?: string, selector ?: string, handler ?: (eventObject: JQueryEventObject) => any): any; persistState(): void; restoreState(silent: boolean): void; } @@ -160,17 +160,17 @@ declare module ej { static fn: Widget; static extend(widget: Widget): any; register(pluginName: string, className: string, prototype: any): void; - destroyAll(elements: Element): void; - model: any; + destroyAll(elements: Element): void; + model: any; } interface BaseEvent { cancel: boolean; - type: string; + type: string; } class DataManager { - constructor(dataSource?: any, query?: ej.Query, adaptor?: any); + constructor(dataSource?: any, query?: ej.Query, adaptor?: any); setDefaultQuery(query: ej.Query): void; executeQuery(query?: ej.Query, done?: any, fail?: any, always?: any): JQueryPromise; executeLocal(query?: ej.Query): ej.DataManager; @@ -178,7 +178,7 @@ declare module ej { insert(data: Object, tableName?: string): JQueryPromise; remove(keyField: string, value: any, tableName?: string): Object; update(keyField: string, value: any, tableName?: string): Object; - } + } class Query { constructor(); @@ -295,7 +295,7 @@ declare module ej { changeSetContent?: string; batchChangeSetContentType?: string; } - + class WebApiAdaptor extends ej.ODataAdaptor { constructor(); insert(dm: ej.DataManager, data: Object, tableName?: string): { url: string; type: string; data: Object; } @@ -305,18 +305,18 @@ declare module ej { result: Object; count: number }; } - + class ODataV4Adaptor extends ej.ODataAdaptor { constructor(); options: ODataAdaptorOptions; onCount(e: Object): string; onEachSearch(e: Object): void; - onSearch(e: Object): string; + onSearch(e: Object): string; beforeSend(dm: ej.DataManager, request: any, settings?: any): void; processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { result: Object; count: number }; - + } interface ODataAdaptorOptions { requestType?: string; @@ -407,8 +407,8 @@ declare module ej { class Predicate { constructor(); constructor(field: string, operator: ej.FilterOperators, value: any, ignoreCase: boolean); - and(field: string, operator: any, value:any, ignoreCase:boolean): void; - or(field: string, operator: any, value: any, ignoreCase: boolean): void; + and(field: string, operator: any, value:any, ignoreCase:boolean): ej.Predicate; + or(field: string, operator: any, value: any, ignoreCase: boolean): ej.Predicate; or(predicate: Array): any; validate(record: Object): boolean; toJSON(): { @@ -421,7 +421,7 @@ declare module ej { predicates: any; }; } - interface dataUtil { + interface dataUtil { swap(array: Array, x: number, y: number): void; mergeSort(jsonArray: Array, fieldName?: string, comparer?:any): Array; max(jsonArray: Array, fieldName?: string, comparer?: string): Array; @@ -491,7 +491,7 @@ declare module ej { row, tHead } - + enum filterType{ StartsWith, Contains, @@ -507,7 +507,7 @@ declare module ej { Fade, None, Slide - } + } enum Type{ Overlay, Slide @@ -876,10 +876,10 @@ export interface HelperEventArgs { function parseDate(value: string, format: string, culture ?: string): Date; function getLocalizedConstants(controlName: string, culture ?: string): any; -interface globalize { +interface globalize { addCulture(name: string, culture?: any): void; preferredCulture(culture?: string): culture; - format(value: any, format: string, culture?: string): string; + format(value: any, format: string, culture?: string): string; parseInt(value: string, radix?: any, culture?: string): number; parseFloat(value: string, radix?: any, culture?: string): number; parseDate(value: string, format: string, culture?: string): Date; @@ -944,7 +944,7 @@ interface globalize { M: string; Y: string; S: string; - } + } class Scroller extends ej.Widget { static fn: Scroller; constructor(element: JQuery, options?: Scroller.Model); @@ -2485,7 +2485,7 @@ export interface ClickEventArgs { */ status?: boolean; - /** return the event model for sever side processing. + /** return the event model for sever side processing. */ e?: any; } @@ -2552,16 +2552,16 @@ Normal, Mini, //Creates button with Built-in small size height, width specified Small, -//Creates button with Built-in medium size height, width specified +//Creates button with Built-in medium size height, width specified Medium, -//Creates button with Built-in large size height, width specified +//Creates button with Built-in large size height, width specified Large, } enum ButtonType { //Creates button with Built-in button type specified Button, -//Creates button with Built-in reset type specified +//Creates button with Built-in reset type specified Reset, //Creates button with Built-in submit type specified Submit, @@ -2947,7 +2947,7 @@ class ListBox extends ej.Widget { removeSelectedItems(): void; /** Removes a list item by using its text. - * @param {string} Text of the listbox item to be removed. + * @param {string} Text of the listbox item to be removed. * @returns {void} */ removeItemByText(text: string): void; @@ -2958,7 +2958,7 @@ class ListBox extends ej.Widget { */ removeItemByIndex(index: number): void; - /** + /** * @returns {void} */ selectAll(): void; @@ -3004,7 +3004,7 @@ class ListBox extends ej.Widget { */ uncheckItemsByIndices(indices: number[]|string): void; - /** + /** * @returns {void} */ unselectAll(): void; @@ -3086,7 +3086,7 @@ class ListBox extends ej.Widget { */ hideItemByIndex(index: number): void; - /** + /** * @returns {void} */ show(): void; @@ -4156,19 +4156,19 @@ class ColorPicker extends ej.Widget { * @param {any} Specified HSV code converted to RGB * @returns {any} */ - HSVToRGB(hsv: any): any; + HSVToRGB(HSV: any): any; /** Convert color value from RGB to HEX * @param {any} Specified RGB code converted to HEX code * @returns {string} */ - RGBToHEX(rgb: any): string; + RGBToHEX(RGB: any): string; /** Convert color value from RGB to HSV * @param {any} Specified RGB code converted to HSV code * @returns {any} */ - RGBToHSV(rgb: any): any; + RGBToHSV(RGB: any): any; /** Open the ColorPicker popup. * @returns {void} @@ -4551,7 +4551,7 @@ enum Presets{ } enum ButtonMode { -//Displays the button in split mode +//Displays the button in split mode Split, //Displays the button in Dropdown mode Dropdown, @@ -4571,25 +4571,25 @@ class FileExplorer extends ej.Widget { adjustSize(): void; /** Disable the particular context menu item. - * @param {string|HTMLElement} Id of the menu item/ Menu element to be disabled + * @param {string|HTMLElement} Id of the menu item/ Menu element to be disabled * @returns {void} */ disableMenuItem(item: string|HTMLElement): void; /** Disable the particular toolbar item. - * @param {string|HTMLElement} Id of the toolbar item/ Tool item element to be disabled + * @param {string|HTMLElement} Id of the toolbar item/ Tool item element to be disabled * @returns {void} */ disableToolbarItem(item: string|HTMLElement): void; /** Enable the particular context menu item. - * @param {string|HTMLElement} Id of the menu item/ Menu element to be Enabled + * @param {string|HTMLElement} Id of the menu item/ Menu element to be Enabled * @returns {void} */ enableMenuItem(item: string|HTMLElement): void; /** Enable the particular toolbar item - * @param {string|HTMLElement} Id of the tool item/ Tool item element to be Enabled + * @param {string|HTMLElement} Id of the tool item/ Tool item element to be Enabled * @returns {void} */ enableToolbarItem(item: string|HTMLElement): void; @@ -4600,7 +4600,7 @@ class FileExplorer extends ej.Widget { refresh(): void; /** Remove the particular toolbar item. - * @param {string|HTMLElement} Id of the tool item/ tool item element to be removed + * @param {string|HTMLElement} Id of the tool item/ tool item element to be removed * @returns {void} */ removeToolbarItem(item: string|HTMLElement): void; @@ -4835,6 +4835,42 @@ export interface Model { /** Fires when the file view type is changed. */ layoutChange? (e: LayoutChangeEventArgs): void; + + /** Fires when before the ContextMenu opening. */ + menuBeforeOpen? (e: MenuBeforeOpenEventArgs): void; + + /** Fires when click the ContextMenu item. */ + menuClick? (e: MenuClickEventArgs): void; + + /** Fires when ContextMenu is successfully opened. */ + menuOpen? (e: MenuOpenEventArgs): void; + + /** Fires when files are successfully opened. */ + open? (e: OpenEventArgs): void; + + /** Fires when a file or folder is pasted successfully. */ + paste? (e: PasteEventArgs): void; + + /** Fires when file or folder is deleted successfully. */ + remove? (e: RemoveEventArgs): void; + + /** Fires when resizing is performed for FileExplorer. */ + resize? (e: ResizeEventArgs): void; + + /** Fires when resizing is started for FileExplorer. */ + resizeStart? (e: ResizeStartEventArgs): void; + + /** Fires this event when the resizing is stopped for FileExplorer. */ + resizeStop? (e: ResizeStopEventArgs): void; + + /** Fires when the items from grid view or tile view of FileExplorer control is selected. */ + select? (e: SelectEventArgs): void; + + /** Triggered when refresh the template column elements in the grid view of FileExplorer control. */ + templateRefresh? (e: TemplateRefreshEventArgs): void; + + /** Fires when the items from grid view or tile view or large icons view of FileExplorer control is unselected. */ + unselect? (e: UnselectEventArgs): void; } export interface BeforeAjaxRequestEventArgs { @@ -4955,6 +4991,10 @@ export interface BeforeUploadEventArgs { */ selectedItems?: any; + /** returns the upload item details. + */ + uploadItemDetails?: any; + /** returns the name of the event. */ type?: string; @@ -5267,6 +5307,223 @@ export interface LayoutChangeEventArgs { */ isInteraction?: boolean; + /** returns the current view type. + */ + layoutType?: string; + + /** returns the FileExplorer model. + */ + model?: any; + + /** returns the name of the event. + */ + type?: string; +} + +export interface MenuBeforeOpenEventArgs { + + /** set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /** returns the name of ContextMenu items group. + */ + contextMenu?: string; + + /** returns the dataSource of ContextMenu. + */ + dataSource?: Array; + + /** returns the element of ContextMenu. + */ + element?: any; + + /** returns the event of ContextMenu. + */ + events?: any; + + /** returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /** returns the target element. + */ + target?: any; + + /** returns the name of the event. + */ + type?: string; +} + +export interface MenuClickEventArgs { + + /** returns the ID of clicked ContextMenu item. + */ + ID?: string; + + /** set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /** returns the name of ContextMenu items group. + */ + contextMenu?: string; + + /** returns the element of clicked ContextMenu item. + */ + element?: any; + + /** returns the event of ContextMenu. + */ + event?: any; + + /** returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /** returns the parent element ID of clicked ContextMenu item. + */ + parentId?: string; + + /** returns the parent element text of clicked ContextMenu item. + */ + parentText?: string; + + /** returns the text of clicked ContextMenu item. + */ + text?: string; + + /** returns the name of the event. + */ + type?: string; +} + +export interface MenuOpenEventArgs { + + /** set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /** returns the name of ContextMenu items group. + */ + contextMenu?: string; + + /** returns the element of ContextMenu. + */ + element?: any; + + /** returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /** returns the target element. + */ + target?: any; + + /** returns the name of the event. + */ + type?: string; +} + +export interface OpenEventArgs { + + /** Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /** returns the opened item type. + */ + itemType?: string; + + /** returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /** returns the path of currently opened item. + */ + path?: string; + + /** returns the selected item details. + */ + selectedItems?: any; + + /** returns the name of the event. + */ + type?: string; +} + +export interface PasteEventArgs { + + /** Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /** returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /** returns the name of moved/copied file or folder. + */ + name?: string[]; + + /** returns the selected item details. + */ + selectedItems?: any; + + /** returns the target folder item details. + */ + targetFolder?: any; + + /** returns the target path. + */ + targetPath?: string; + + /** returns the name of the event. + */ + type?: string; +} + +export interface RemoveEventArgs { + + /** Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /** returns the AJAX response data. + */ + data?: any; + + /** returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /** returns the names of deleted items. + */ + name?: string; + + /** returns the path of deleted item. + */ + path?: string; + + /** returns the removed item details. + */ + selectedItems?: any; + + /** returns the name of the event. + */ + type?: string; +} + +export interface ResizeEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** returns the mouse move event args. + */ + event?: any; + /** returns the FileExplorer model. */ model?: ej.FileExplorer.Model; @@ -5276,6 +5533,129 @@ export interface LayoutChangeEventArgs { type?: string; } +export interface ResizeStartEventArgs { + + /** Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /** returns the mouse down event args. + */ + event?: any; + + /** returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /** returns the name of the event. + */ + type?: string; +} + +export interface ResizeStopEventArgs { + + /** Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /** returns the mouse leave event args. + */ + event?: any; + + /** returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /** returns the name of the event. + */ + type?: string; +} + +export interface SelectEventArgs { + + /** Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /** returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /** returns the name of selected items. + */ + name?: string[]; + + /** returns the path of selected items. + */ + path?: string; + + /** returns the selected item details + */ + selectedItems?: any; + + /** returns the name of the event. + */ + type?: string; +} + +export interface TemplateRefreshEventArgs { + + /** Set to true when the event has to be canceled, else false. + */ + cancel?: boolean; + + /** Returns the cell object. + */ + cell?: ej.FileExplorer.Model; + + /** Returns the column object. + */ + column?: any; + + /** Returns the current row data. + */ + data?: any; + + /** Returns the grid model of FileExplorer. + */ + model?: any; + + /** Returns the current row index. + */ + rowIndex?: number; + + /** returns the name of the event. + */ + type?: string; +} + +export interface UnselectEventArgs { + + /** Returns the FileExplorer model. + */ + model?: ej.FileExplorer.Model; + + /** Returns the name of unselected item. + */ + name?: string; + + /** Returns the type of unselected item. + */ + nodeType?: string; + + /** Returns the path of unselected item. + */ + path?: string; + + /** Returns the name of the event. + */ + type?: string; + + /** Returns the unselected item details. + */ + unselectedItem?: any; +} + export interface ContextMenuSettings { /** The items property is used to configure and group the required ContextMenu items in FileExplorer control. @@ -5348,7 +5728,7 @@ enum layoutType{ ///Supports to display files in tile view Tile, - ///Supports to display files in grid view + ///Supports to display files in grid view Grid, ///Supports to display files as large icons @@ -5960,10 +6340,10 @@ enum Level{ enum HighlightSection{ - ///Highlight the week of the currently selected date in DatePicker popup calendar + ///Highlight the week of the currently selected date in DatePicker popup calendar Week, - ///Highlight the workdays in a currently selected date's week in DatePicker popup calendar + ///Highlight the workdays in a currently selected date's week in DatePicker popup calendar WorkDays, ///Nothing will be highlighted, remove highlights from DatePicker popup calendar if already exists @@ -6437,7 +6817,7 @@ enum popupPosition { //Opens the DateTimePicker popup below to the DateTimePicker input box Bottom, -//Opens the DateTimePicker popup above to the DateTimePicker input box +//Opens the DateTimePicker popup above to the DateTimePicker input box Top, } @@ -6514,7 +6894,7 @@ export interface Model { */ dateFormat?: string; - /** Allows to embed the Timepicker aling with the calendars in the page, two timepicker will be render, for selecting start and end date. + /** Allows to embed the Timepicker align with the calendars in the page, two timepicker will be render, for selecting start and end date. * @Default {false} */ enableTimePicker?: boolean; @@ -8030,11 +8410,11 @@ export interface ActionCompleteEventArgs { */ model?: any; - /** Returns the query for data retrieval + /** Returns the query for data retrieval */ query?: any; - /** Returns the query for data retrieval from the Database + /** Returns the query for data retrieval from the Database */ request?: any; @@ -8065,7 +8445,7 @@ export interface ActionFailureEventArgs { */ model?: any; - /** Returns the query for data retrieval + /** Returns the query for data retrieval */ query?: any; @@ -8088,11 +8468,11 @@ export interface ActionSuccessEventArgs { */ model?: any; - /** Returns the query for data retrieval + /** Returns the query for data retrieval */ query?: any; - /** Returns the query for data retrieval from the Database + /** Returns the query for data retrieval from the Database */ request?: any; @@ -8541,14 +8921,14 @@ export interface Fields { } enum FilterType { -//filter the data wherever contains search key +//filter the data wherever contains search key Contains, //filter the data based on search key present at start position StartsWith, } enum MultiSelectMode { -// can select only single item in DropDownList +// can select only single item in DropDownList None, //can select multiple items and it's separated by delimiterChar Delimiter, @@ -9461,7 +9841,7 @@ export interface Model { */ ajaxSettings?: AjaxSettings; - /** Set the index values to be selected on intial loading. This works only when enableCheckMark is set true. + /** Set the index values to be selected on initial loading. This works only when enableCheckMark is set true. * @Default {[]} */ checkedIndices?: Array; @@ -10452,6 +10832,16 @@ export interface Model { */ width?: string|number; + /** Specifies the popup menu height. + * @Default {auto} + */ + overflowHeight?: string|number; + + /** Specifies the popup menu width. + * @Default {auto} + */ + overflowWidth?: string|number; + /** Fires before context menu gets open. */ beforeOpen? (e: BeforeOpenEventArgs): void; @@ -10478,6 +10868,12 @@ export interface Model { /** Fires when mouse over the Menu items. */ mouseover? (e: MouseoverEventArgs): void; + + /** Fires when overflow popup menu opens. */ + overflowOpen? (e: OverflowOpenEventArgs): void; + + /** Fires when overflow popup menu closes. */ + overflowClose? (e: OverflowCloseEventArgs): void; } export interface BeforeOpenEventArgs { @@ -10647,6 +11043,44 @@ export interface MouseoverEventArgs { event?: any; } +export interface OverflowOpenEventArgs { + + /** returns the menu model + */ + model?: ej.Menu.Model; + + /** returns the name of the event + */ + type?: string; + + /** returns the event object + */ + e?: any; + + /** if the event should be cancelled ; otherwise ,false + */ + cancel?: boolean; +} + +export interface OverflowCloseEventArgs { + + /** returns the menu model + */ + model?: ej.Menu.Model; + + /** returns the name of the event + */ + type?: string; + + /** returns the event object + */ + e?: any; + + /** if the event should be cancelled ; otherwise ,false + */ + cancel?: boolean; +} + export interface Fields { /** It receives the child data for the inner level. @@ -12626,7 +13060,7 @@ enum CustomItemType{ enum QuickAccessMode{ - ///Controls are hidden in Quick Access toolbar + ///Controls are hidden in Quick Access toolbar None, ///Add controls in toolBar @@ -12694,7 +13128,7 @@ class Kanban extends ej.Widget { toggleColumn(headerText: any): void; /** Expand or collapse the card based on the state of target "div" - * @param {string|number} Pass the id of card to be toggle + * @param {string|number} Pass the id of card to be toggle * @returns {void} */ toggleCard(key: string|number): void; @@ -13945,12 +14379,12 @@ export interface Column { key?: string|number; /** To enable/disable allowDrop for specific column wise. - * @Default {false} + * @Default {true} */ allowDrop?: boolean; /** To enable/disable allowDrag for specific column wise. - * @Default {false} + * @Default {true} */ allowDrag?: boolean; @@ -14257,7 +14691,7 @@ enum EditingType{ ///Allows to set edit type as string edit type String, - ///Allows to set edit type as numeric edit type + ///Allows to set edit type as numeric edit type Numeric, ///Allows to set edit type as drop down edit type @@ -14954,6 +15388,16 @@ export interface Model { */ enableTabKeyNavigation?: boolean; + /** This API allows to enable url and fileName for pdf export. + * @Default {null} + */ + exportToPdfSettings?: ExportToPdfSettings; + + /** This API allows to enable url and fileName for word export. + * @Default {null} + */ + exportToWordSettings?: ExportToWordSettings; + /** Load the external CSS file inside Iframe. * @Default {null} */ @@ -14999,6 +15443,11 @@ export interface Model { */ imageBrowser?: ImageBrowser; + /** This API allows to enable the url for connecting to RTE import. + * @Default {null} + */ + importSettings?: ImportSettings; + /** Enables/disables responsive support for the RTE control toolbar items during the window resizing time. * @Default {false} */ @@ -15325,6 +15774,28 @@ export interface SelectEventArgs { event?: any; } +export interface ExportToPdfSettings { + + /** This API is used to receive the server-side handler for export related operations. + */ + url?: string; + + /** Specifies the file name for the exported pdf file. + */ + fileName?: string; +} + +export interface ExportToWordSettings { + + /** This API is used to receive the server-side handler for export related operations. + */ + url?: string; + + /** Specifies the file name for the exported word file. + */ + fileName?: string; +} + export interface FileBrowser { /** This API is used to receive the server-side handler for file related operations. @@ -15355,6 +15826,13 @@ export interface ImageBrowser { filePath?: string; } +export interface ImportSettings { + + /** This API is used to receive the server-side handler for import operations. + */ + url?: string; +} + export interface ToolsCustomOrderedList { /** Specifies the name for customOrderedList item. @@ -15483,6 +15961,10 @@ export interface Tools { */ print?: Array; + /** Specifies the importExport tools and the display order of this tool in the RTE toolbar. + */ + importExport?: Array; + /** Specifies the customOrderedList tools and the display order of this tool in the RTE toolbar. */ customOrderedList?: Array; @@ -15692,7 +16174,7 @@ export interface ChangeEventArgs { */ value?: number; - /** returns true if event triggered by interaction else returns false. + /** returns true if event triggered by interaction else returns false. */ isInteraction?: boolean; } @@ -16929,7 +17411,7 @@ enum Position{ ///Tab headers display to top position Top, - ///Tab headers display to bottom position + ///Tab headers display to bottom position Bottom, ///Tab headers display to left position. @@ -17964,6 +18446,11 @@ export interface Model { */ isResponsive?: boolean; + /** Specifies the items of Toolbar + * @Default {null} + */ + Items?: Items; + /** Specifies the Toolbar orientation. See orientation * @Default {Horizontal} */ @@ -17974,6 +18461,11 @@ export interface Model { */ query?: any; + /** Specifies the Toolbar responsive type. + * @Default {Popup} + */ + responsiveType?: ej.Toolbar.ResponsiveType|string; + /** Displays the Toolbar with rounded corners. * @Default {false} */ @@ -18000,6 +18492,12 @@ export interface Model { /** Fires after mouse leave from Toolbar control item. */ itemLeave? (e: ItemLeaveEventArgs): void; + + /** Fires when the overflow popup of toolbar is opened. */ + overflowOpen? (e: OverflowOpenEventArgs): void; + + /** Fires when the overflow popup of toolbar is closed. */ + overflowClose? (e: OverflowCloseEventArgs): void; } export interface ClickEventArgs { @@ -18128,6 +18626,60 @@ export interface ItemLeaveEventArgs { status?: boolean; } +export interface OverflowOpenEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /** returns the name of the event + */ + type?: string; + + /** Returns the current X position of the target . + */ + clientX?: number; + + /** Returns the current Y position of the target . + */ + clientY?: number; + + /** returns the target of the current object. + */ + currentTarget?: any; +} + +export interface OverflowCloseEventArgs { + + /** if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** returns the Toolbar model + */ + model?: ej.Toolbar.Model; + + /** returns the name of the event + */ + type?: string; + + /** Returns the current X position of the target . + */ + clientX?: number; + + /** Returns the current Y position of the target . + */ + clientY?: number; + + /** returns the target of the current object. + */ + currentTarget?: any; +} + export interface Fields { /** Defines the group name for the item. @@ -18161,7 +18713,60 @@ export interface Fields { /** Defines the tooltip text for the tag. */ tooltipText?: string; + + /** Allows you to add template as toolbar item + */ + template?: string; } + +export interface Items { + + /** Defines the group name for the item. + */ + group?: string; + + /** Defines the HTML attributes such as id, class, styles for the item . + */ + htmlAttributes?: any; + + /** Defines id for the tag. + */ + id?: string; + + /** Defines the image attributes such as height, width, styles and so on. + */ + imageAttributes?: string; + + /** Defines the imageURL for the image location. + */ + imageUrl?: string; + + /** Defines the sprite CSS for the image tag. + */ + spriteCssClass?: string; + + /** Defines the text content for the tag. + */ + text?: string; + + /** Defines the tooltip text for the tag. + */ + tooltipText?: string; + + /** Allows to add template as toolbar item. + */ + template?: string; +} + +enum ResponsiveType{ + + ///To display the toolbar overflow items as popup + Popup, + + ///To display the toolbar overflow items as inline toolbar + Inline +} + } class TreeView extends ej.Widget { @@ -18192,10 +18797,10 @@ class TreeView extends ej.Widget { checkAll(): void; /** To check a node in TreeView. - * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - checkNode(element: string|any): void; + checkNode(element: string|any|Array): void; /** This method is used to collapse all nodes in TreeView control. If you want to collapse all nodes up to the specific level in TreeView control then we need to pass levelUntil as argument to this method. * @param {number} TreeView nodes will collapse until the given level @@ -18205,22 +18810,22 @@ class TreeView extends ej.Widget { collapseAll(levelUntil?: number, excludeHiddenNodes?: boolean): void; /** To collapse a particular node in TreeView. - * @param {string|any} ID of TreeView node|object of TreeView node + * @param {string|any|Array} ID of TreeView node|object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - collapseNode(element: string|any): void; + collapseNode(element: string|any|Array): void; /** To disable the node in the TreeView. - * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - disableNode(element: string|any): void; + disableNode(element: string|any|Array): void; /** To enable the node in the TreeView. - * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - enableNode(element: string|any): void; + enableNode(element: string|any|Array): void; /** To ensure that the TreeView node is visible in the TreeView. This method is useful if we need select a TreeView node dynamically. * @param {string|any} ID of TreeView node/object of TreeView node @@ -18236,10 +18841,10 @@ class TreeView extends ej.Widget { expandAll(levelUntil?: number, excludeHiddenNodes?: boolean): void; /** To expandNode particular node in TreeView. - * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - expandNode(element: string|any): void; + expandNode(element: string|any|Array): void; /** To get currently checked nodes in TreeView. * @returns {any} @@ -18346,10 +18951,10 @@ class TreeView extends ej.Widget { hide(): void; /** To hide particular node in TreeView. - * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - hideNode(element: string|any): void; + hideNode(element: string|any|Array): void; /** To add a Node or collection of nodes after the particular TreeView node. * @param {string|any} New node text or JSON object @@ -18433,10 +19038,10 @@ class TreeView extends ej.Widget { removeAll(): void; /** To remove a node in TreeView. - * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - removeNode(element: string|any): void; + removeNode(element: string|any|Array): void; /** To select all the TreeView nodes when enable allowMultiSelection property. * @returns {void} @@ -18455,10 +19060,10 @@ class TreeView extends ej.Widget { show(): void; /** To show a node in TreeView. - * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - showNode(element: string|any): void; + showNode(element: string|any|Array): void; /** To uncheck all the nodes in TreeView. * @returns {void} @@ -18466,10 +19071,10 @@ class TreeView extends ej.Widget { unCheckAll(): void; /** To uncheck a node in TreeView. - * @param {string|any} ID of TreeView node/object of TreeView node + * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - uncheckNode(element: string|any): void; + uncheckNode(element: string|any|Array): void; /** To unselect all the TreeView nodes when enable allowMultiSelection property. * @returns {void} @@ -18794,7 +19399,7 @@ export interface BeforeCollapseEventArgs { */ parentId?: string; - /** returns the format asynchronous or synchronous + /** returns the format asynchronous or synchronous */ async?: boolean; } @@ -18922,7 +19527,7 @@ export interface BeforeExpandEventArgs { */ parentId?: string; - /** returns the format asynchronous or synchronous + /** returns the format asynchronous or synchronous */ async?: boolean; } @@ -19293,7 +19898,7 @@ export interface NodeCollapseEventArgs { */ isChildLoaded?: boolean; - /** returns the format asynchronous or synchronous + /** returns the format asynchronous or synchronous */ async?: boolean; } @@ -19597,7 +20202,7 @@ export interface NodeExpandEventArgs { */ parentId?: string; - /** returns the format asynchronous or synchronous + /** returns the format asynchronous or synchronous */ async?: boolean; } @@ -20470,7 +21075,7 @@ class Grid extends ej.Widget { defaults:Grid.Model; /** Adds a grid model property which is to be ignored upon exporting. - * @param {Array} Pass the array of parameters which need to be ignored on exporting + * @param {Array} Pass the array of parameters which need to be ignored on exporting * @returns {void} */ addIgnoreOnExport(propertyNames: Array): void; @@ -20839,6 +21444,11 @@ class Grid extends ej.Widget { */ refreshBatchEditChanges(): void; + /** It is used to refresh the grid header. + * @returns {void} + */ + refreshHeader(): void; + /** Refresh the grid contents. The template refreshment is based on the argument passed along with this method * @param {boolean} optional When templateRefresh is set true, template and grid contents both are refreshed in grid else only grid content is refreshed * @returns {void} @@ -20896,7 +21506,7 @@ class Grid extends ej.Widget { saveCell(): void; /** We can prevent the client side cellSave event triggering by passing the preventSaveEvent argument as true. - * @param {boolean} optionalIf we pass preventSaveEvent as true, it prevents the client side cellSave event triggering + * @param {boolean} optionalIf we pass preventSaveEvent as true, it prevents the client side cellSave event triggering * @returns {void} */ saveCell(preventSaveEvent: boolean): void; @@ -21192,6 +21802,21 @@ export interface Model { */ enableTouch?: Boolean; + /** Act as mapper for the excel exporting URL. + * @Default {ExportToExcel} + */ + exportToExcelAction?: string; + + /** Act as mapper for the PDF exporting URL. + * @Default {ExportToPdf} + */ + exportToPdfAction?: string; + + /** Act as mapper for the Word exporting URL. + * @Default {ExportToWord} + */ + exportToWordAction?: string; + /** Gets or sets an object that indicates whether to customize the filtering behavior of the grid */ filterSettings?: FilterSettings; @@ -21350,6 +21975,12 @@ export interface Model { /** Triggered before the cell is going to be selected. */ cellSelecting? (e: CellSelectingEventArgs): void; + /** Triggered after the cell is deselected. */ + cellDeselected? (e: CellDeselectedEventArgs): void; + + /** Triggered before the cell is going to be deselected. */ + cellDeselecting? (e: CellDeselectingEventArgs): void; + /** Triggered when the column is being dragged. */ columnDrag? (e: ColumnDragEventArgs): void; @@ -21374,6 +22005,12 @@ export interface Model { /** Triggered before the column is going to be selected. */ columnSelecting? (e: ColumnSelectingEventArgs): void; + /** Triggered after the column is deselected. */ + columnDeselected? (e: ColumnDeselectedEventArgs): void; + + /** Triggered before the column is going to be deselected. */ + columnDeselecting? (e: ColumnDeselectingEventArgs): void; + /** Triggered when context menu item is clicked */ contextClick? (e: ContextClickEventArgs): void; @@ -21443,6 +22080,12 @@ export interface Model { /** Triggered before the row is going to be selected. */ rowSelecting? (e: RowSelectingEventArgs): void; + /** Triggered after the row is deselected. */ + rowDeselected? (e: RowDeselectedEventArgs): void; + + /** Triggered before the row is going to be deselected. */ + rowDeselecting? (e: RowDeselectingEventArgs): void; + /** Triggered when refresh the template column elements in the Grid. */ templateRefresh? (e: TemplateRefreshEventArgs): void; @@ -22113,6 +22756,60 @@ export interface CellSelectingEventArgs { type?: string; } +export interface CellDeselectedEventArgs { + + /** Returns the deselected cell index value. + */ + cellIndex?: number; + + /** Returns the deselected cell element. + */ + currentCell?: any; + + /** Returns current record object (JSON). + */ + data?: any; + + /** Returns the grid model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; +} + +export interface CellDeselectingEventArgs { + + /** Returns the deselecting cell index value. + */ + cellIndex?: number; + + /** Returns the deselecting cell element. + */ + currentCell?: any; + + /** Returns current record object (JSON). + */ + data?: any; + + /** Returns whether the ctrl key is pressed while deselecting cell + */ + isCtrlKeyPressed?: boolean; + + /** Returns whether the shift key is pressed while deselecting cell + */ + isShiftKeyPressed?: boolean; + + /** Returns the grid model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; +} + export interface ColumnDragEventArgs { /** Returns the cancel option value. @@ -22365,6 +23062,60 @@ export interface ColumnSelectingEventArgs { type?: string; } +export interface ColumnDeselectedEventArgs { + + /** Returns the Deselected column index value. + */ + columnIndex?: number; + + /** Returns the Deselected column header element. + */ + headerCell?: any; + + /** Returns corresponding column object (JSON). + */ + column?: any; + + /** Returns the grid model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; +} + +export interface ColumnDeselectingEventArgs { + + /** Returns the deselecting column index value. + */ + columnIndex?: number; + + /** Returns the deselecting column header element. + */ + headerCell?: any; + + /** Returns corresponding column object (JSON). + */ + column?: any; + + /** Returns whether the ctrl key is pressed while deselecting column + */ + isCtrlKeyPressed?: boolean; + + /** Returns whether the shift key is pressed while deselecting column + */ + isShiftKeyPressed?: boolean; + + /** Returns the grid model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; +} + export interface ContextClickEventArgs { /** Returns the cancel option value. @@ -23030,6 +23781,60 @@ export interface RowSelectingEventArgs { type?: string; } +export interface RowDeselectedEventArgs { + + /** Returns current record object (JSON). + */ + data?: any; + + /** Returns the row index of the deselected row. + */ + rowIndex?: number; + + /** Returns the current deselected row element. + */ + row?: any; + + /** Returns the grid model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; +} + +export interface RowDeselectingEventArgs { + + /** Returns the deselecting row index value. + */ + rowIndex?: number; + + /** Returns the deselecting row element. + */ + row?: any; + + /** Returns current record object (JSON). + */ + data?: any; + + /** Returns whether the ctrl key is pressed while deselecting row + */ + isCtrlKeyPressed?: boolean; + + /** Returns whether the shift key is pressed while deselecting row + */ + isShiftKeyPressed?: boolean; + + /** Returns the grid model. + */ + model?: any; + + /** Returns the name of the event. + */ + type?: string; +} + export interface TemplateRefreshEventArgs { /** Returns the cancel option value. @@ -24272,7 +25077,7 @@ export interface LoadedEventArgs { export interface TooltipInitializeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -24396,7 +25201,7 @@ export interface PointRegionMouseClickEventArgs { export interface SparklineMouseMoveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -24411,7 +25216,7 @@ export interface SparklineMouseMoveEventArgs { export interface SparklineMouseLeaveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -24677,6 +25482,1192 @@ Lighter, } } +class SunburstChart extends ej.Widget { + static fn: SunburstChart; + constructor(element: JQuery, options?: SunburstChart.Model); + constructor(element: Element, options?: SunburstChart.Model); + static Locale: any; + model:SunburstChart.Model; + defaults:SunburstChart.Model; + + /** Redraws the entire sunburst. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. + * @returns {void} + */ + redraw(): void; + + /** destroy the sunburst + * @returns {void} + */ + _destroy(): void; +} +export module SunburstChart{ + +export interface Model { + + /** Background color of the plot area. + * @Default {null} + */ + background?: string; + + /** Bind the data field from the data source. + * @Default {null} + */ + valueMemberPath?: string; + + /** Options for customizing the sunburst border. + */ + border?: Border; + + /** Options for customizing the sunburst segment border. + */ + segmentBorder?: SegmentBorder; + + /** Specifies the dataSource to the sunburst. + * @Default {null} + */ + dataSource?: any; + + /** Palette color for the data points. + * @Default {null} + */ + palette?: string; + + /** Parent node of the data points. + * @Default {null} + */ + parentNode?: string; + + /** Name of the property in the datasource that contains x values. + * @Default {null} + */ + xName?: string; + + /** Name of the property in the datasource that contains y values. + * @Default {null} + */ + yName?: string; + + /** Controls wheather sunburst has to be responsive or not. + * @Default {true} + */ + isResponsive?: boolean; + + /** Options to customize the Sunburst size. + */ + size?: Size; + + /** Controls the visibility of sunburst. + * @Default {true} + */ + visible?: boolean; + + /** Options to customize the Sunburst tooltip. + */ + tooltip?: Tooltip; + + /** Options for customizing sunburst points. + */ + points?: Points; + + /** Sunburst rendering will start from the specified value + * @Default {null} + */ + startAngle?: number; + + /** Sunburst rendering will end at the specified value + * @Default {null} + */ + endAngle?: number; + + /** Sunburst outer radius value + * @Default {1} + */ + radius?: number; + + /** Sunburst inner radius value + * @Default {0.4} + */ + innerRadius?: number; + + /** Options to customize the Sunburst dataLabel. + */ + dataLabelSettings?: DataLabelSettings; + + /** Options for customizing the title and subtitle of sunburst. + */ + title?: Title; + + /** Options for customizing the appearance of the levels or point while highlighting. + */ + highlightSettings?: HighlightSettings; + + /** Options for customizing the appearance of the levels or data point while selection. + */ + selectionSettings?: SelectionSettings; + + /** Specify levels of sunburst for grouped visualization of data + * @Default {[]} + */ + levels?: Array; + + /** Options to customize the legend items and legend title. + */ + legend?: Legend; + + /** Specifies the theme for Sunburst. + * @Default {Flatlight. See Theme} + */ + theme?: ej.datavisualization.Sunburst.SunburstTheme|string; + + /** Options to customize the left, right, top and bottom margins of sunburst area. + */ + margin?: Margin; + + /** Enable/disable the animation for all the levels. + * @Default {false} + */ + enableAnimation?: boolean; + + /** Opacity of the levels. + * @Default {1} + */ + opacity?: number; + + /** Options for enable zooming feature of chart. + */ + zoomSettings?: ZoomSettings; + + /** Animation type of sunburst + * @Default {rotation. See Alignment} + */ + animationType?: ej.datavisualization.Sunburst.Animation|string; + + /** Fires before loading. */ + load? (e: LoadEventArgs): void; + + /** Fires before rendering sunburst. */ + preRender? (e: PreRenderEventArgs): void; + + /** Fires after rendering sunburst. */ + loaded? (e: LoadedEventArgs): void; + + /** Fires before rendering the datalabel */ + dataLabelRendering? (e: DataLabelRenderingEventArgs): void; + + /** Fires before rendering each segment */ + segmentRendering? (e: SegmentRenderingEventArgs): void; + + /** Fires before rendering sunburst title. */ + titleRendering? (e: TitleRenderingEventArgs): void; + + /** Fires during initialization of tooltip. */ + tooltipInitialize? (e: TooltipInitializeEventArgs): void; + + /** Fires after clicking the point in sunburst */ + pointRegionClick? (e: PointRegionClickEventArgs): void; + + /** Fires while moving the mouse over sunburst points */ + pointRegionMousemove? (e: PointRegionMousemoveEventArgs): void; + + /** Fires when clicking the point to perform drilldown. */ + drillDownClick? (e: DrillDownClickEventArgs): void; + + /** Fires when resetting drilldown points. */ + drillDownBack? (e: DrillDownBackEventArgs): void; + + /** Fires after resetting the sunburst points */ + drillDownReset? (e: DrillDownResetEventArgs): void; +} + +export interface LoadEventArgs { + + /** Load event data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface PreRenderEventArgs { + + /** PreRender event data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface LoadedEventArgs { + + /** Loaded event data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface DataLabelRenderingEventArgs { + + /** Sunburst datalabel data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface SegmentRenderingEventArgs { + + /** Sunburst datalabel data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface TitleRenderingEventArgs { + + /** Sunburst title data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface TooltipInitializeEventArgs { + + /** Sunburst tooltip data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface PointRegionClickEventArgs { + + /** Includes clicked points region data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface PointRegionMousemoveEventArgs { + + /** Includes data of mouse moved region + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface DrillDownClickEventArgs { + + /** Clicked point data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface DrillDownBackEventArgs { + + /** Drill down data of points + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface DrillDownResetEventArgs { + + /** Drill down reset data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface Border { + + /** Border color of the sunburst. + * @Default {null} + */ + color?: string; + + /** Width of the Sunburst border. + * @Default {2} + */ + width?: number; +} + +export interface SegmentBorder { + + /** Segment Border color of the sunburst. + * @Default {null} + */ + color?: string; + + /** Width of the Sunburst segment border. + * @Default {2} + */ + width?: number; +} + +export interface Size { + + /** Height of the Sunburst. + * @Default {''} + */ + height?: string; + + /** Width of the Sunburst. + * @Default {''} + */ + width?: string; +} + +export interface TooltipBorder { + + /** Border color of the tooltip. + * @Default {null} + */ + color?: string; + + /** Border width of the tooltip. + * @Default {5} + */ + width?: number; +} + +export interface TooltipFont { + + /** Font color of the text in the tooltip. + * @Default {null} + */ + color?: string; + + /** Font Family for the tooltip. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Specifies the font Style for the tooltip. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; + + /** Specifies the font weight for the tooltip. + * @Default {Regular} + */ + fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; + + /** Opacity for text in the tooltip. + * @Default {1} + */ + opacity?: number; + + /** Font size for text in the tooltip. + * @Default {12px} + */ + size?: string; +} + +export interface Tooltip { + + /** tooltip visibility of the Sunburst. + * @Default {true} + */ + visible?: boolean; + + /** Options for customizing the border of the sunburst tooltip. + */ + border?: TooltipBorder; + + /** Fill color for the sunburst tooltip. + * @Default {null} + */ + fill?: string; + + /** Options for customizing the font of the tooltip. + */ + font?: TooltipFont; + + /** Custom template to the tooltip. + * @Default {null} + */ + template?: string; +} + +export interface Points { + + /** Points x value of the sunburst. + * @Default {null} + */ + x?: string; + + /** Points y value of the sunburst. + * @Default {null} + */ + y?: number; + + /** Points text of the sunburst. + * @Default {null} + */ + text?: string; + + /** Points fill color of the sunburst. + * @Default {null} + */ + fill?: string; +} + +export interface DataLabelSettingsFont { + + /** Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; + + /** Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; + + /** Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /** Font color of the data label text. + * @Default {null} + */ + color?: string; + + /** Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface DataLabelSettings { + + /** Datalabel visibility of the Sunburst. + * @Default {false} + */ + visible?: boolean; + + /** Alginment of sunburst datalabel + * @Default {Angle. See DatalabelAlignment} + */ + labelRotationMode?: ej.datavisualization.Sunburst.SunburstLabelRotationMode|string; + + /** Options for customizing the data label font. + */ + font?: DataLabelSettingsFont; + + /** Custome template for datalabel + * @Default {null} + */ + template?: string; + + /** Fill color for the datalable + * @Default {null} + */ + fill?: string; + + /** Datalabel overflow mode + * @Default {Trim. See LabelOverflowMode} + */ + labelOverflowMode?: ej.datavisualization.Sunburst.SunburstLabelOverflowMode|string; +} + +export interface TitleFont { + + /** Font family for Sunburst title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style for Sunburst title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; + + /** Font weight for Sunburst title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; + + /** Opacity of the Sunburst title. + * @Default {1} + */ + opacity?: number; + + /** Font size for Sunburst title. + * @Default {20px} + */ + size?: string; +} + +export interface TitleSubtitleFont { + + /** Font family of sub title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style for sub title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; + + /** Font weight for sub title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; + + /** Opacity of the sub title. + * @Default {1} + */ + opacity?: number; + + /** Font size for sub title. + * @Default {12px} + */ + size?: string; +} + +export interface TitleSubtitle { + + /** Subtitle text for sunburst + */ + text?: string; + + /** Sub title text visibility for sunburst + * @Default {true} + */ + visible?: string; + + /** Sub title text alignment + * @Default {far. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; + + /** Options for customizing the font of sub title. + */ + font?: TitleSubtitleFont; +} + +export interface Title { + + /** Title text for sunburst + */ + text?: string; + + /** Title text visibility for sunburst + * @Default {true} + */ + visible?: string; + + /** Title text alignment + * @Default {center. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; + + /** Options for customizing the font of sunburst title. + */ + font?: TitleFont; + + /** Options to customize the sub title of Sunburst. + */ + subtitle?: TitleSubtitle; +} + +export interface HighlightSettings { + + /** Enables/disables the ability to highlight the levels or point interactively. + * @Default {false} + */ + enable?: boolean; + + /** Specifies whether the levels or point has to be highlighted. + * @Default {point. See Mode} + */ + mode?: ej.datavisualization.Sunburst.SunburstHighlightMode|string; + + /** Color of the levels/point on highlight. + * @Default {red} + */ + color?: string; + + /** Opacity of the levels/point on highlight. + * @Default {0.5} + */ + opacity?: number; + + /** Specifies whether the levels or data point has to be highlighted. + * @Default {opacity. See Mode} + */ + type?: ej.datavisualization.Sunburst.SunburstHighlightType|string; +} + +export interface SelectionSettings { + + /** Enables/disables the ability to select the levels or data point interactively. + * @Default {false} + */ + enable?: boolean; + + /** Specifies whether the levels or data point has to be selected. + * @Default {point. See Mode} + */ + mode?: ej.datavisualization.Sunburst.SunburstHighlightMode|string; + + /** Color of the levels/point on selection. + * @Default {green} + */ + color?: string; + + /** Opacity of the levels/point on selection. + * @Default {0.5} + */ + opacity?: number; + + /** Specifies whether the levels or data point has to be selected. + * @Default {opacity. See Mode} + */ + type?: ej.datavisualization.Sunburst.SunburstHighlightType|string; +} + +export interface Level { + + /** Specifies the group member path + * @Default {null} + */ + groupMemberPath?: string; +} + +export interface LegendBorder { + + /** Border color of the legend. + * @Default {null} + */ + color?: string; + + /** Border width of the legend. + * @Default {1} + */ + width?: number; +} + +export interface LegendFont { + + /** Font family for legend item text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style for legend item text. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; + + /** Font weight for legend item text. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; + + /** Font size for legend item text. + * @Default {12px} + */ + size?: string; +} + +export interface LegendItemStyle { + + /** Height of the shape in legend items. + * @Default {10} + */ + height?: number; + + /** Width of the shape in legend items. + * @Default {10} + */ + width?: number; +} + +export interface LegendLocation { + + /** X value or horizontal offset to position the legend in chart. + * @Default {0} + */ + x?: number; + + /** Y value or vertical offset to position the legend. + * @Default {0} + */ + y?: number; +} + +export interface LegendSize { + + /** Height of the legend. Height can be specified in either pixel or percentage. + * @Default {null} + */ + height?: string; + + /** Width of the legend. Width can be specified in either pixel or percentage. + * @Default {null} + */ + width?: string; +} + +export interface LegendTitleFont { + + /** Font family for the text in legend title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style for legend title. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; + + /** Font weight for legend title. + * @Default {normal. See FontWeight} + */ + fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; + + /** Font size for legend title. + * @Default {12px} + */ + size?: string; +} + +export interface LegendTitle { + + /** Options to customize the font used for legend title + */ + font?: LegendTitleFont; + + /** Enables or disables the legend title. + * @Default {true} + */ + visible?: string; + + /** Text to be displayed in legend title. + */ + text?: string; + + /** Alignment of the legend title. + * @Default {center. See Alignment} + */ + textAlignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; +} + +export interface Legend { + + /** Visibility of the legend. + * @Default {false} + */ + visible?: boolean; + + /** Interactive action of legend items. + * @Default {toggleSegmentVisibility. See Alignment} + */ + clickAction?: ej.datavisualization.Sunburst.SunburstClickAction|string; + + /** Horizontal alignment of the legend. + * @Default {Center. See Alignment} + */ + alignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; + + /** Options for customizing the legend border. + */ + border?: LegendBorder; + + /** Number of columns to arrange the legend items. + * @Default {null} + */ + columnCount?: number; + + /** Number of rows to arrange the legend items. + * @Default {null} + */ + rowCount?: number; + + /** Options to customize the font used for legend item text. + */ + font?: LegendFont; + + /** Gap or padding between the legend items. + * @Default {10} + */ + itemPadding?: number; + + /** Options to customize the style of legend items. + */ + itemStyle?: LegendItemStyle; + + /** Options to customize the location of sunburst legend. Legend is placed in provided location only when value of position property is custom + */ + location?: LegendLocation; + + /** Places the legend at specified position. Legend can be placed at left, right, top or bottom of the chart area.To manually specify the location of legend, set custom as value to this property. + * @Default {Bottom. See Position} + */ + position?: ej.datavisualization.Sunburst.SunburstLegendPosition|string; + + /** Shape of the legend items. + * @Default {None. See Shape} + */ + shape?: ej.datavisualization.Sunburst.SunburstLegendShape|string; + + /** Options to customize the size of the legend. + */ + size?: LegendSize; + + /** Options to customize the legend title. + */ + title?: LegendTitle; +} + +export interface Margin { + + /** Spacing for the left margin of chart area. Setting positive value decreases the width of the chart area from left side. + * @Default {10} + */ + left?: number; + + /** Spacing for the right margin of chart area. Setting positive value decreases the width of the chart area from right side. + * @Default {10} + */ + right?: number; + + /** Spacing for the top margin of chart area. Setting positive value decreases the height of the chart area from the top. + * @Default {10} + */ + top?: number; + + /** Spacing for the bottom margin of the chart area. Setting positive value decreases the height of the chart area from the bottom. + * @Default {10} + */ + bottom?: number; +} + +export interface ZoomSettings { + + /** Enables or disables zooming. + * @Default {false} + */ + enable?: boolean; + + /** Toolbar horizontal alignment + * @Default {right. See Alignment} + */ + toolbarHorizontalAlignment?: ej.datavisualization.Sunburst.SunburstHorizontalAlignment|string; + + /** Toolbar vertical alignment + * @Default {top. See Alignment} + */ + toolbarVerticalAlignment?: ej.datavisualization.Sunburst.SunburstVerticalAlignment|string; +} +} +module Sunburst +{ +enum FontStyle +{ +//string +Normal, +//string +Italic, +} +} +module Sunburst +{ +enum FontWeight +{ +//string +Regular, +//string +Bold, +//string +Lighter, +} +} +module Sunburst +{ +enum SunburstLabelRotationMode +{ +//string +Angle, +//string +Normal, +} +} +module Sunburst +{ +enum SunburstLabelOverflowMode +{ +//string +Trim, +//string +Hide, +//string +None, +} +} +module Sunburst +{ +enum SunburstAlignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Sunburst +{ +enum SunburstHighlightMode +{ +//string +Point, +//string +Parent, +//string +Child, +//string +All, +} +} +module Sunburst +{ +enum SunburstHighlightType +{ +//string +Opacity, +//string +Color, +} +} +module Sunburst +{ +enum SunburstClickAction +{ +//string +None, +//string +ToggleSegmentVisibility, +//string +ToggleSegmentSelection, +} +} +module Sunburst +{ +enum SunburstLegendPosition +{ +//string +Left, +//string +Right, +//string +Top, +//string +Bottom, +} +} +module Sunburst +{ +enum SunburstLegendShape +{ +//string +Diamond, +//string +Pentagon, +//string +Rectangle, +//string +Circle, +//string +Cross, +//string +Triangle, +} +} +module Sunburst +{ +enum SunburstTheme +{ +//string +FlatLight, +//string +FlatDark, +} +} +module Sunburst +{ +enum SunburstHorizontalAlignment +{ +//string +Center, +//string +Left, +//string +Right, +} +} +module Sunburst +{ +enum SunburstVerticalAlignment +{ +//string +Top, +//string +Bottom, +//string +Middle, +} +} +module Sunburst +{ +enum Animation +{ +//string +Rotation, +//string +FadeIn, +} +} + class PivotGrid extends ej.Widget { static fn: PivotGrid; constructor(element: JQuery, options?: PivotGrid.Model); @@ -24794,6 +26785,11 @@ export interface Model { */ dataSource?: DataSource; + /** Holds the neccessary properties for value sorting. + * @Default {{}} + */ + valueSortSettings?: ValueSortSettings; + /** Object that holds the settings of frozen headers. * @Default {{}} */ @@ -24819,7 +26815,7 @@ export interface Model { */ enableCellSelection?: boolean; - /** Enables the Drill-Through feature which retrieves the raw items that are used to create the specific cell in PivotGrid. This is only applicable in server mode component. + /** Enables the Drill-Through feature which retrieves the raw items that are used to create the specific cell in PivotGrid. * @Default {false} */ enableDrillThrough?: boolean; @@ -25605,6 +27601,22 @@ export interface DataSource { pagerOptions?: DataSourcePagerOptions; } +export interface ValueSortSettings { + + /** Contains the headers of the specific column to which value sorting is applied. + */ + headerText?: string; + + /** Allows the user to set the string for separating column headers provided in the above property headerText. + */ + headerDelimiters?: string; + + /** Allows the user to set the sorting order of the values of the field. + * @Default {ej.PivotAnalysis.SortOrder.Ascending} + */ + sortOrder?: ej.PivotAnalysis.SortOrder|string; +} + export interface FrozenHeaderSettings { /** Allows the user to freeze the row headers alone on scrolling the horizontal scroll bar. @@ -26770,6 +28782,11 @@ export interface Model { */ displaySettings?: DisplaySettings; + /** Enables the splitter option for resizing the elements inside the control. + * @Default {false} + */ + enableSplitter?: boolean; + /** Enables the advanced filtering options Value Filtering, Label Filtering and Sorting for each dimensions on binding OLAP data in server mode. * @Default {false} */ @@ -29444,7 +31461,7 @@ export interface ResizeStopEventArgs { export interface OverflowButtonClickEventArgs { - /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the clicked overflow button is present. + /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the clicked overflow button is present. */ object?: any; @@ -29467,7 +31484,7 @@ export interface OverflowButtonClickEventArgs { export interface OverflowButtonHoverEventArgs { - /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the overflow button is currently hovered. + /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the overflow button is currently hovered. */ object?: any; @@ -31647,6 +33664,16 @@ export interface ScheduleHeaderSettings { * @Default {yyyy} */ yearHeaderFormat?: string; + + /** Specifies the size of the lowest time unit along the timescale, with minimum value as "50%" and maximum value as "500%". It is also possble to set the value in pixels. + * @Default {100%} + */ + timscaleUnitSize?: string; + + /** Specifies the start day of the week in week timescale mode + * @Default {0} + */ + weekStartDay?: number; } export interface SizeSettings { @@ -32509,7 +34536,7 @@ class TreeGrid extends ej.Widget { /** To rename a column with the specified name * @param {number} Index of the column to be renamed - * @param {string} Header text of the column + * @param {string} Header text of the column * @returns {void} */ renameColumn(columnIndex: number, name: string): void; @@ -32719,6 +34746,11 @@ export interface Model { */ locale?: string; + /** Enables or disables internal parsing of a row. When disbaled this property, row will be displayed using the defined template without any internal event bindings. + * @Default {true} + */ + parseRowTemplate?: boolean; + /** Specifies the name of the field in the dataSource, which contains the id of that row. */ idMapping?: string; @@ -32850,6 +34882,9 @@ export interface Model { /** Triggered while collapsing the TreeGrid record */ collapsing? (e: CollapsingEventArgs): void; + /** Triggered while clicking a row, even when allowSelection property is disabled. */ + recordClick? (e: RecordClickEventArgs): void; + /** Triggered when you start to drag a column */ columnDragStart? (e: ColumnDragStartEventArgs): void; @@ -33064,6 +35099,37 @@ export interface CollapsingEventArgs { expanded?: boolean; } +export interface RecordClickEventArgs { + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the element of clicked cell. + */ + cell?: any; + + /** Returns the index of the clicked cell. + */ + cellIndex?: number; + + /** Returns the data of clicked cell. + */ + cellValue?: any; + + /** Returns the element of the clicked row. + */ + row?: any; + + /** Returns the index of the clicked row. + */ + rowIndex?: number; + + /** Returns the column name of the clicked cell. + */ + columnName?: string; +} + export interface ColumnDragStartEventArgs { /** Returns the cancel option value. @@ -33728,6 +35794,10 @@ export interface Column { */ visible?: boolean; + /** Gets or sets a value for treegrid column width + */ + width?: Number; + /** Specifies the header template value for the column header */ headerTemplateID?: String; @@ -34377,9 +36447,9 @@ export interface SelectEventArgs { } enum GroupButtonMode { -//Sets the GroupButton to work as checkbox mode +//Sets the GroupButton to work as checkbox mode CheckBox, -//Sets the RadioButton to work as radio button mode +//Sets the RadioButton to work as radio button mode RadioButton, } @@ -35004,7 +37074,7 @@ export interface MouseDownEventArgs { */ text?: string; - /** returns the index of current tile item + /** returns the index of current tile item */ index?: number; } @@ -35027,7 +37097,7 @@ export interface MouseUpEventArgs { */ text?: boolean; - /** returns the index of current tile item + /** returns the index of current tile item */ index?: number; } @@ -35566,122 +37636,122 @@ export interface Model { export interface ChangeEventArgs { - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the initial value of Radial slider + /** returns the initial value of Radial slider */ oldValue?: number; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the current value of the Radial slider + /** returns the current value of the Radial slider */ value?: number; } export interface CreateEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the Radialslider model /td> + /** returns the Radialslider model */ model?: any; - /** returns the name of the event + /** returns the name of the event */ type?: string; } export interface MouseoverEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** returns the value selected + /** returns the value selected */ selectedValue?: number; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the current value selected in Radial slider + /** returns the current value selected in Radial slider */ value?: number; } export interface SlideEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** returns the value selected in Radial slider + /** returns the value selected in Radial slider */ selectedValue?: number; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the currently selected value + /** returns the currently selected value */ value?: number; } export interface StartEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the current value selected in Radial slider + /** returns the current value selected in Radial slider */ value?: number; } export interface StopEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the current value selected in Radial slider + /** returns the current value selected in Radial slider */ value?: number; } @@ -35708,13 +37778,13 @@ class Spreadsheet extends ej.Widget { addNewSheet(): void; /** It is used to clear all the data and format in the specified range of cells in Spreadsheet. - * @param {string|Array} Optional. If range is specified, then it will clear all content in the specified range else it will use the current selected range. + * @param {string|Array} Optional. If range is specified, then it will clear all content in the specified range else it will use the current selected range. * @returns {void} */ clearAll(range?: string|Array): void; /** This property is used to clear all the formats applied in the specified range in Spreadsheet. - * @param {string|Array} Optional. If range is specified, then it will clear all format in the specified range else it will use the current selected range. + * @param {string|Array} Optional. If range is specified, then it will clear all format in the specified range else it will use the current selected range. * @returns {void} */ clearAllFormat(range?: string|Array): void; @@ -35726,7 +37796,7 @@ class Spreadsheet extends ej.Widget { clearBorder(range?: string|Array): void; /** This property is used to clear the contents in the specified range in Spreadsheet. - * @param {string|Array} Optional. If the range is specified, then it will clear the content in the specified range else it will use the current selected range. + * @param {string|Array} Optional. If the range is specified, then it will clear the content in the specified range else it will use the current selected range. * @returns {void} */ clearContents(range?: string|Array): void; @@ -35738,20 +37808,25 @@ class Spreadsheet extends ej.Widget { clearRange(rangeName: string): void; /** It is used to remove data in the specified range of cells based on the defined property. - * @param {Array|string} Optional. If range is specified, it will clear data for the specified range else it will use the current selected range. - * @param {string} Optional. If property is specified, it will remove the specified property in the range else it will remove default properties + * @param {Array|string} Optional. If range is specified, it will clear data for the specified range else it will use the current selected range. + * @param {string} Optional. If property is specified, it will remove the specified property in the range else it will remove default properties * @param {any} Optional. - * @param {boolean} Optional. pass `true`, if you want to skip the hidden rows + * @param {boolean} Optional. pass {{'`true`' | markdownify}}, if you want to skip the hidden rows * @param {any} Optional. Pass the status to perform undo and redo operation. * @param {any} Optional. It specifies whether to skip element processing or not. * @returns {void} */ clearRangeData(range?: Array|string, property?: string, cells?: any, skipHiddenRow?: boolean, status?: any, skipCell?: any): void; + /** This method is used to clear undo and redo collections in the Spreadsheet. + * @returns {void} + */ + clearUndoRedo(): void; + /** This method is used to copy or move the sheets in Spreadsheet. * @param {number} Pass the sheet index that you want to copy or move. * @param {number} Pass the position index where you want to copy or move. - * @param {boolean} Pass `true`,If you want to copy sheet or else it will move sheet. + * @param {boolean} Pass {{'`true`' | markdownify}},If you want to copy sheet or else it will move sheet. * @returns {void} */ copySheet(fromIdx: number, toIdx: number, isCopySheet: boolean): void; @@ -35815,9 +37890,9 @@ class Spreadsheet extends ej.Widget { getActiveCellElem(sheetIdx?: number): HTMLElement; /** This method is used to get the current active sheet index in Spreadsheet. - * @returns {Number} + * @returns {number} */ - getActiveSheetIndex(): Number; + getActiveSheetIndex(): number; /** This method is used to get the auto fill element in Spreadsheet. * @returns {HTMLElement} @@ -35834,21 +37909,21 @@ class Spreadsheet extends ej.Widget { /** This method is used to get the data settings in the Spreadsheet. * @param {number} Pass the sheet index. - * @returns {Number} + * @returns {number} */ - getDataSettings(sheetIdx: number): Number; + getDataSettings(sheetIdx: number): number; /** This method is used to get the frozen columns index in the Spreadsheet. * @param {number} Pass the sheet index. - * @returns {Number} + * @returns {number} */ - getFrozenColumns(sheetIdx: number): Number; + getFrozenColumns(sheetIdx: number): number; /** This method is used to get the frozen row index in Spreadsheet. * @param {number} Pass the sheet index. - * @returns {Number} + * @returns {number} */ - getFrozenRows(sheetIdx: number): Number; + getFrozenRows(sheetIdx: number): number; /** This method is used to get the hyperlink data as object from the specified cell in Spreadsheet. * @param {HTMLElement} Pass the DOM element to get hyperlink @@ -35859,13 +37934,13 @@ class Spreadsheet extends ej.Widget { /** This method is used to get all cell elements in the specified range. * @param {string} Pass the range that you want to get the cells. * @param {number} Pass the index of the sheet. - * @param {boolean} Optional. Pass `true`, if you want to skip the hidden rows. + * @param {boolean} Optional. Pass {{'`true`' | markdownify}}, if you want to skip the hidden rows. * @returns {HTMLElement} */ getRange(range: string, sheetIdx: number, skipHiddenRow?: boolean): HTMLElement; /** This method is used to get the data in specified range in Spreadsheet. - * @param {any} Optional. Pass the range, property, sheetIdx, valueOnly in options. + * @param {any} Optional. Pass the range, property, sheetIdx, valueOnly in options. * @returns {Array} */ getRangeData(options?: any): Array; @@ -35888,9 +37963,14 @@ class Spreadsheet extends ej.Widget { */ getSheetElement(sheetIdx: number): HTMLElement; + /** This method is used to get all the sheets in workbook. + * @returns {Array} + */ + getSheets(): Array; + /** This method is used to send a paging request to the specified sheet Index in the Spreadsheet. * @param {number} Pass the sheet index to perform paging at specified sheet index - * @param {boolean} Pass `true` to create a new sheet. If the specified sheet index is already exist, it navigate to that sheet else it create a new sheet. + * @param {boolean} Pass {{'`true`' | markdownify}} to create a new sheet. If the specified sheet index is already exist, it navigate to that sheet else it create a new sheet. * @returns {void} */ gotoPage(sheetIdx: number, newSheet: boolean): void; @@ -35972,25 +38052,32 @@ class Spreadsheet extends ej.Widget { /** This method is used to lock/unlock the range of cells in active sheet. Lock cells are activated only after the sheet is protected. Once the sheet is protected it is unable to lock/unlock cells. * @param {string|Array} Pass the alpha range cells or array range of cells. - * @param {string} Optional. By default is `true`. If it is `false` locked cells are unlocked. + * @param {string} Optional. By default is {{'`true`' | markdownify}}. If it is {{'`false`' | markdownify}} locked cells are unlocked. * @returns {void} */ lockCells(range: string|Array, isLocked?: string): void; /** This method is used to merge cells by across in the Spreadsheet. * @param {string} Optional. To pass the cell range or selected cells are process. - * @param {boolean} Optional. If pass `true` it does not show alert. + * @param {boolean} Optional. If pass {{'`true`' | markdownify}} it does not show alert. * @returns {void} */ mergeAcrossCells(range?: string, alertStatus?: boolean): void; /** This method is used to merge the selected cells in the Spreadsheet. * @param {string|Array} Optional. To pass the cell range or selected cells are process. - * @param {boolean} Optional. If pass `true` it does not show alert. + * @param {boolean} Optional. If pass {{'`true`' | markdownify}} it does not show alert. * @returns {void} */ mergeCells(range?: string|Array, alertStatus?: boolean): void; + /** This method is used to select a cell or range in the Spreadsheet. + * @param {any} Pass the start cell to perform selection. + * @param {any} Pass the end cell to perform selection. + * @returns {void} + */ + performSelection(startCell: any, endCell: any): void; + /** This method is used to protect or unprotect active sheet. * @param {boolean} Optional. By default is `true`. If it is `false` active sheet is unprotected. * @returns {void} @@ -36017,10 +38104,10 @@ class Spreadsheet extends ej.Widget { /** This method is used to remove the hyperlink from selected cells of current sheet. * @param {string} Hyperlink remove from the specified range. - * @param {boolean} Optional. If it is `true`, It will clear link only not format. + * @param {boolean} Optional. If it is {{'`true`' | markdownify}}, It will clear link only not format. * @param {boolean} Optional. Pass the status to perform undo and redo operations. * @param {any} Optional. Pass the cells that you want to remove hyperlink. - * @param {boolean} Optional. Pass `true`, if you want to skip the hidden rows. + * @param {boolean} Optional. Pass {{'`true`' | markdownify}}, if you want to skip the hidden rows. * @returns {void} */ removeHyperlink(range: string, isClearHLink?: boolean, status?: boolean, cells?: any, skipHiddenRow?: boolean): void; @@ -36031,6 +38118,12 @@ class Spreadsheet extends ej.Widget { */ removeRange(rangeName: string): void; + /** This method is used to remove the readonly option for the specified range. + * @param {string|Array} Pass the range. + * @returns {void} + */ + removeReadOnly(range?: string|Array): void; + /** This method is used to save JSON data in Spreadsheet. * @returns {any} */ @@ -36063,6 +38156,12 @@ class Spreadsheet extends ej.Widget { */ setBorder(property: any, range?: string): void; + /** This method is used to set the height for the rows in the Spreadsheet. + * @param {Array|any} Pass the row index and height of the rows. + * @returns {void} + */ + setHeightToRows(heightColl: Array|any): void; + /** This method is used to set the hyperlink in selected cells of the current sheet. * @param {string|Array} If range is specified, it will set the hyperlink in range of the cells. * @param {any} Pass cellAddress or webAddress @@ -36071,6 +38170,12 @@ class Spreadsheet extends ej.Widget { */ setHyperlink(range: string|Array, link: any, sheetIdx: number): void; + /** This method is used to set the readonly option for the specified range. + * @param {string|Array} Pass the range. + * @returns {void} + */ + setReadOnly(range?: string|Array): void; + /** This method is used to set the focus to the Spreadsheet. * @returns {void} */ @@ -36107,17 +38212,23 @@ class Spreadsheet extends ej.Widget { showFormulaBar(): void; /** This method is used to show/hide gridlines in active sheet in the Spreadsheet. - * @param {boolean} Pass `true` to show the gridlines + * @param {boolean} Pass {{'`true`' | markdownify}} to show the gridlines * @returns {void} */ showGridlines(status: boolean): void; /** This method is used to show/hide the headers in active sheet in the Spreadsheet. - * @param {boolean} Pass `true` to show the sheet headers. + * @param {boolean} Pass {{'`true`' | markdownify}} to show the sheet headers. * @returns {void} */ showHeadings(startRow: boolean): void; + /** This method is used to show/hide pager in the Spreadsheet. + * @param {boolean} Pass {{'`true`' | markdownify}} to show pager. + * @returns {void} + */ + showPager(status: boolean): void; + /** This method is used to show the hidden rows in the specified range in the Spreadsheet. * @param {number} Index of the start row. * @param {number} Optional. Index of the end row. @@ -36155,7 +38266,7 @@ class Spreadsheet extends ej.Widget { /** This method is used to update the data for the specified range of cells in the Spreadsheet. * @param {any} Pass the cells data that you want to update. - * @param {Array|string} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. + * @param {Array|string} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. * @returns {void} */ updateData(data: any, range?: Array|string): void; @@ -36172,6 +38283,12 @@ class Spreadsheet extends ej.Widget { */ updateRange(sheetIdx: number, settings: any): void; + /** This method is used to update the details for custom undo and redo operations. + * @param {any} Pass the details to update undo and redo collection + * @returns {void} + */ + updateUndoRedoCollection(details: any): void; + /** This method is used to update the unique data for the specified range of cells in Spreadsheet. * @param {any} Pass the data that you want to update in the particular range * @param {Array|string} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. @@ -36258,7 +38375,7 @@ export interface XLCellType { export interface XLCFormat { /** This method is used to clear the applied conditional formatting rules in the Spreadsheet. - * @param {boolean} Pass `true` if you want to clear rules from selected cells else it will clear rules from entire sheet. + * @param {boolean} Pass {{'`true`' | markdownify}} if you want to clear rules from selected cells else it will clear rules from entire sheet. * @param {Array|string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. * @returns {void} */ @@ -36287,6 +38404,13 @@ export interface XLChart { */ changeTheme(chartId: string,theme: ej.datavisualization.Chart.Theme): void; + /** This method is used to change the type of the chart in the Spreadsheet. + * @param {string} Pass the chart id. + * @param {any} Pass the chart type. + * @returns {void} + */ + changeType(chartId: string,option: any): void; + /** This method is used to change the data range of the chart in the Spreadsheet. * @param {string} Pass the chart id. * @param {string} X axis range of chart data. @@ -36353,28 +38477,28 @@ export interface XLClipboard { export interface XLComment { /** This method is used to delete the comment in the specified range in Spreadsheet. - * @param {Array|string} Optional. If range is specified, it will delete comments for the specified range else it will use the current selected range. + * @param {Array|string} Optional. If range is specified, it will delete comments for the specified range else it will use the current selected range. * @param {number} Optional. If sheetIdx is specified, it will delete comment in specified sheet else it will use active sheet. - * @param {boolean} Optional. Pass `true`, if you want to skip the hidden rows data. + * @param {boolean} Optional. Pass {{'`true`' | markdownify}}, if you want to skip the hidden rows data. * @returns {void} */ deleteComment(range: Array|string,sheetIdx: number,skipHiddenRow: boolean): void; /** This method is used to edit the comment in the target Cell in Spreadsheet. - * @param {any} Optional. Pass the row index and column index of the cell which contains comment. + * @param {any} Optional. Pass the row index and column index of the cell which contains comment. * @returns {void} */ editComment(targetCell: any): void; /** This method is used to find the next comment from the active cell in Spreadsheet. - * @returns {Boolean} + * @returns {boolean} */ - findNextComment(): Boolean; + findNextComment(): boolean; /** This method is used to find the previous comment from the active cell in Spreadsheet. - * @returns {Boolean} + * @returns {boolean} */ - findPrevComment(): Boolean; + findPrevComment(): boolean; /** This method is used to get comment data for the specified cell. * @param {HTMLElement} Pass the DOM element to get comment data as object. @@ -36383,10 +38507,10 @@ export interface XLComment { getComment(cell: HTMLElement): any; /** This method is used to set new comment in Spreadsheet. - * @param {string|Array} Optional. If we pass the range comment will set in the range otherwise it will set with selected cells. + * @param {string|Array} Optional. If we pass the range comment will set in the range otherwise it will set with selected cells. * @param {string} Optional. Pass the comment data. - * @param {boolean} Optional. Pass `true` to show comment in edit mode - * @param {boolean} Optional. Pass `true` to show the user name + * @param {boolean} Optional. Pass {{'`true`' | markdownify}} to show comment in edit mode + * @param {boolean} Optional. Pass {{'`true`' | markdownify}} to show the user name * @returns {void} */ setComment(range: string|Array,data: string,showEditPanel: boolean,showUserName: boolean): void; @@ -36471,7 +38595,7 @@ export interface XLDragFill { hideAutoFillOptions(): void; /** This method is used to set position of the auto fill element in the Spreadsheet. - * @param {boolean} Pass the isDragFill option as `boolean` value to show auto fill options in Spreadsheet. + * @param {boolean} Pass the isDragFill option as {{'`boolean`' | markdownify}} value to show auto fill options in Spreadsheet. * @returns {void} */ positionAutoFillElement(isDragFill: boolean): void; @@ -36488,7 +38612,7 @@ export interface XLEdit { /** This method is used to edit a particular cell based on the row index and column index in the Spreadsheet. * @param {number} Pass the row index to edit particular cell. * @param {number} Pass the column index to edit particular cell. - * @param {boolean} Pass `true`, if you want to maintain previous cell value. + * @param {boolean} Pass {{'`true`' | markdownify}}, if you want to maintain previous cell value. * @returns {void} */ editCell(rowIdx: number,colIdx: number,oldData: boolean): void; @@ -36498,17 +38622,17 @@ export interface XLEdit { * @param {number} Pass the column index to get the property value. * @param {string} Optional. Pass the property name that you want("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", "decimalPlaces", "cellType"). * @param {number} Optional. Pass the index of the sheet. - * @returns {any|String|Array} + * @returns {any|string|Array} */ - getPropertyValue(rowIdx: number,colIdx: number,prop: string,sheetIdx: number): any|String|Array; + getPropertyValue(rowIdx: number,colIdx: number,prop: string,sheetIdx: number): any|string|Array; /** This method is used to get the property value in specified cell in Spreadsheet. * @param {HTMLElement} Pass the cell element to get property value. * @param {string} Pass the property name that you want ("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", "decimalPlaces", "cellType"). * @param {number} Pass the index of sheet. - * @returns {any|String|Array} + * @returns {any|string|Array} */ - getPropertyValueByElem(elem: HTMLElement,property: string,sheetIdx: number): any|String|Array; + getPropertyValueByElem(elem: HTMLElement,property: string,sheetIdx: number): any|string|Array; /** This method is used to save the edited cell value in the Spreadsheet. * @returns {void} @@ -36525,7 +38649,7 @@ export interface XLEdit { /** This method is used to update a particular cell value and its format in the Spreadsheet. * @param {any} Pass row index and column index of the cell. * @param {string|number} Pass the cell value. - * @param {string} Pass the class name to update format. + * @param {string} Pass the class name to update format. * @param {number} Pass sheet index. * @returns {void} */ @@ -36535,7 +38659,7 @@ export interface XLEdit { export interface XLExport { /** This method is used to save the sheet data as Excel ,CSV or PDF document (.xls, .xlsx .csv, .pdf) in Spreadsheet. - * @param {string} Pass the export type that you want. + * @param {string} Pass the export type that you want. * @returns {void} */ export(type: string): void; @@ -36567,12 +38691,18 @@ export interface XLFilter { export interface XLFormat { + /** This method is used to convert table range to normal range. + * @param {any} Pass the sheet index and table id. + * @returns {void} + */ + convertToRange(options: any): void; + /** This method is used to create a table for the selected range of cells in the Spreadsheet. * @param {any} Pass the table object. - * @param {string|Array} Optional. If the range is specified, then it will create table in the specified range else it will use the current selected range. - * @returns {String} + * @param {string|Array} Optional. If the range is specified, then it will create table in the specified range else it will use the current selected range. + * @returns {string} */ - createTable(tableObject: any,range: string|Array): String; + createTable(tableObject: any,range: string|Array): string; /** This method is used to set format style and values in a cell or range of cells. * @param {any} Pass the formatObject which contains style, type, format, groupSeparator and decimalPlaces. @@ -36603,7 +38733,7 @@ export interface XLFormat { /** This method is used to update the format for the selected range of cells in the Spreadsheet. * @param {any} Pass the format object that you want to update. - * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. + * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. * @returns {void} */ updateFormat(formatObj: any,range: Array): void; @@ -36650,7 +38780,7 @@ export interface XLFreeze { export interface XLPivot { /** This property is used to clear the pivot table list in Spreadsheet. - * @param {string} Pass the name of the pivot table. + * @param {string} Pass the name of the pivot table. * @returns {void} */ clearPivotFieldList(pivotName: string): void; @@ -36661,9 +38791,9 @@ export interface XLPivot { * @param {string} It specifies the name of the pivot table. * @param {any} Pass the pivot table settings. * @param {any} Pass the pivot range, sheet index, address and data source . - * @returns {String} + * @returns {string} */ - createPivotTable(range: string,location: string,name: string,settings: any,pvt: any): String; + createPivotTable(range: string,location: string,name: string,settings: any,pvt: any): string; /** This method is used to delete the pivot table which is selected. * @param {string} Pass the name of the pivot table. @@ -36708,15 +38838,15 @@ export interface XLResize { /** This method is used to get the column width of the specified column index in the Spreadsheet. * @param {number} Pass the column index. - * @returns {Number} + * @returns {number} */ - getColWidth(colIdx: number): Number; + getColWidth(colIdx: number): number; /** This method is used to get the row height of the specified row index in the Spreadsheet. * @param {number} Pass the row index which you want to find its height. - * @returns {Number} + * @returns {number} */ - getRowHeight(rowIdx: number): Number; + getRowHeight(rowIdx: number): number; /** This method is used to set the column width of the specified column index in the Spreadsheet. * @param {number} Pass the column index. @@ -36848,8 +38978,8 @@ export interface XLSearch { /** This method is used to find and replace all data by workbook in the Spreadsheet. * @param {string} Pass the search data. * @param {string} Pass the replace data. - * @param {boolean} Pass `true`, if you want to match with case-sensitive. - * @param {boolean} Pass `true`, if you want to match with entire cell contents. + * @param {boolean} Pass {{'`true`' | markdownify}}, if you want to match with case-sensitive. + * @param {boolean} Pass {{'`true`' | markdownify}}, if you want to match with entire cell contents. * @returns {void} */ replaceAllByBook(findData: string,replaceData: string,isCSen: boolean,isEMatch: boolean): void; @@ -36857,8 +38987,8 @@ export interface XLSearch { /** This method is used to find and replace all data by sheet in Spreadsheet. * @param {string} Pass the search data. * @param {string} Pass the replace data. - * @param {boolean} Pass `true`, if you want to match with case-sensitive. - * @param {boolean} Pass `true`, if you want to match with entire cell contents. + * @param {boolean} Pass {{'`true`' | markdownify}}, if you want to match with case-sensitive. + * @param {boolean} Pass {{'`true`' | markdownify}}, if you want to match with entire cell contents. * @returns {void} */ replaceAllBySheet(findData: string,replaceData: string,isCSen: boolean,isEMatch: boolean): void; @@ -36930,15 +39060,15 @@ export interface XLShape { * @param {number} Optional. Pass the height of the image that you want to set. * @param {number} Optional. Pass the top of the image that you want to set. * @param {number} Optional. Pass the left of the image that you want to set. - * @returns {String} + * @returns {string} */ - setPicture(range: string,url: string,width: number,height: number,top: number,left: number): String; + setPicture(range: string,url: string,width: number,height: number,top: number,left: number): string; } export interface XLSort { /** This method is used to sort a particular range of cells based on its cell or font color in the Spreadsheet. - * @param {string} Pass 'PutCellColor' to sort by cell color or 'PutFontColor' for by font color. + * @param {string} Pass {{'`PutCellColor`' | markdownify}} to sort by cell color or {{'`PutFontColor`' | markdownify}} for sort by font color. * @param {any} Pass the HEX color code to sort. * @param {string} Pass the range * @returns {void} @@ -36949,25 +39079,25 @@ export interface XLSort { * @param {Array|string} Pass the range to sort. * @param {string} Pass the column name. * @param {any} Pass the direction to sort (ascending or descending). - * @returns {Boolean} + * @returns {boolean} */ - sortByRange(range: Array|string,columnName: string,direction: any): Boolean; + sortByRange(range: Array|string,columnName: string,direction: any): boolean; } export interface XLValidate { /** This method is used to apply data validation rules in a selected range of cells based on the defined condition in the Spreadsheet. - * @param {string|Array} If range is specified, it will apply rules for the specified range else it will use the current selected range. + * @param {string|Array} If range is specified, it will apply rules for the specified range else it will use the current selected range. * @param {Array} Pass the validation condition, value1 and value2. * @param {string} Pass the data type. - * @param {boolean} Pass `true` if you ignore blank values. - * @param {boolean} Pass `true` if you want to show an error alert. + * @param {boolean} Pass {{'`true`' | markdownify}} if you ignore blank values. + * @param {boolean} Pass {{'`true`' | markdownify}} if you want to show an error alert. * @returns {void} */ applyDVRules(range: string|Array,values: Array,type: string,required: boolean,showErrorAlert: boolean): void; /** This method is used to clear the applied validation rules in a specified range of cells in the Spreadsheet. - * @param {string|Array} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @param {string|Array} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. * @returns {void} */ clearDV(range: string|Array): void; @@ -36984,7 +39114,7 @@ export interface Model { /** Gets or sets an active sheet index in the Spreadsheet. By defining this value, you can specify which sheet should be active in workbook. * @Default {1} */ - activeSheetIndex?: Number; + activeSheetIndex?: number; /** Gets or sets a value that indicates whether to enable or disable auto rendering of cell type in the Spreadsheet. * @Default {false} @@ -37149,7 +39279,7 @@ export interface Model { /** Gets or sets a value that indicates to define the width of the activation panel in Spreadsheet. * @Default {300} */ - apWidth?: Number; + apWidth?: number; /** Gets or sets an object that indicates to customize the auto fill behavior in the Spreadsheet. */ @@ -37162,12 +39292,12 @@ export interface Model { /** Gets or sets a value that defines the number of columns displayed in the sheet. * @Default {21} */ - columnCount?: Number; + columnCount?: number; /** Gets or sets a value that indicates to define the common width for each column in the Spreadsheet. * @Default {64} */ - columnWidth?: Number; + columnWidth?: number; /** Gets or sets a value to add root CSS class for customizing Spreadsheet skins. */ @@ -37230,12 +39360,12 @@ export interface Model { /** Gets or sets a value that indicates whether to define the number of rows to be displayed in the sheet. * @Default {20} */ - rowCount?: Number; + rowCount?: number; /** Gets or sets a value that indicates to define the common height for each row in the sheet. * @Default {20} */ - rowHeight?: Number; + rowHeight?: number; /** Gets or sets an object that indicates to customize the scroll options in the Spreadsheet. */ @@ -37248,7 +39378,7 @@ export interface Model { /** Gets or sets a value that indicates to define the number of sheets to be created at the initial load. * @Default {1} */ - sheetCount?: Number; + sheetCount?: number; /** Gets or sets an object that indicates to customize the sheet behavior in Spreadsheet. */ @@ -37267,7 +39397,7 @@ export interface Model { /** This is used to set the number of undo-redo steps in the Spreadsheet. * @Default {20} */ - undoRedoStep?: Number; + undoRedoStep?: number; /** Define the username for the Spreadsheet which is displayed in comment. * @Default {User Name} @@ -37346,6 +39476,12 @@ export interface Model { /** Triggered after range editing completes. */ editRangeComplete? (e: EditRangeCompleteEventArgs): void; + /** Triggered when the key is pressed down. */ + keyDown? (e: KeyDownEventArgs): void; + + /** Triggered when the key is released. */ + keyUp? (e: KeyUpEventArgs): void; + /** Triggered before the sheet is loaded. */ load? (e: LoadEventArgs): void; @@ -38099,6 +40235,76 @@ export interface EditRangeCompleteEventArgs { cancel?: boolean; } +export interface KeyDownEventArgs { + + /** Returns the sheet index. + */ + sheetIndex?: number; + + /** Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /** Returns the boolean value. + */ + isCommentEdit?: boolean; + + /** Returns the boolean value. + */ + isEdit?: boolean; + + /** Returns the boolean value. + */ + isSheetRename?: boolean; + + /** Returns the target element. + */ + target?: HTMLElement; + + /** Returns the name of the event. + */ + type?: string; + + /** Returns the cancel option value. + */ + cancel?: boolean; +} + +export interface KeyUpEventArgs { + + /** Returns the sheet index. + */ + sheetIndex?: number; + + /** Returns the Spreadsheet model. + */ + model?: ej.Spreadsheet.Model; + + /** Returns the boolean value. + */ + isCommentEdit?: boolean; + + /** Returns the boolean value. + */ + isEdit?: boolean; + + /** Returns the boolean value. + */ + isSheetRename?: boolean; + + /** Returns the target element. + */ + target?: HTMLElement; + + /** Returns the name of the event. + */ + type?: string; + + /** Returns the cancel option value. + */ + cancel?: boolean; +} + export interface LoadEventArgs { /** Returns the name of the event. @@ -38457,12 +40663,12 @@ export interface ChartSettings { /** Gets or sets a value that defines the chart height in Spreadsheet. * @Default {220} */ - height?: Number; + height?: number; /** Gets or sets a value that defines the chart width in the Spreadsheet. * @Default {440} */ - width?: Number; + width?: number; } export interface ExportSettings { @@ -38541,12 +40747,12 @@ export interface PictureSettings { /** Gets or sets a value that indicates to define height to picture in the Spreadsheet. * @Default {220} */ - height?: Number; + height?: number; /** Gets or sets a value that indicates to define width to picture in the Spreadsheet. * @Default {440} */ - width?: Number; + width?: number; } export interface PrintSettings { @@ -38619,7 +40825,7 @@ export interface ScrollSettings { /** Gets or sets the value that indicates to define the height of spreadsheet. * @Default {100%} */ - height?: Number|string; + height?: number|string; /** Gets or sets the value that indicates whether to enable or disable responsive mode in the Spreadsheet. * @Default {true} @@ -38634,7 +40840,7 @@ export interface ScrollSettings { /** Gets or sets the value that indicates to define the height of the spreadsheet. * @Default {100%} */ - width?: Number|string; + width?: number|string; } export interface SelectionSettings { @@ -38646,7 +40852,7 @@ export interface SelectionSettings { /** Gets or sets a value that indicates to define animation time while selection in the Spreadsheet. * @Default {0.001} */ - animationTime?: Number; + animationTime?: number; /** Gets or sets a value that indicates to enable or disable animation while selection. * @Default {false} @@ -38666,7 +40872,7 @@ export interface SelectionSettings { export interface SheetsBorder { - /** + /** */ type?: ej.Spreadsheet.BorderType|string; @@ -38745,6 +40951,20 @@ export interface SheetsRowsCellsComment { export interface SheetsRowsCellsFormat { + /** Specifies the number of decimal places for the given input. + * @Default {2} + */ + decimalPlaces?: number; + + /** Specifies the string format for the given input. + */ + formatStr?: string; + + /** Specifies the thousand separator for the given input. + * @Default {false} + */ + thousandSeparator?: boolean; + /** Specifies the type of the format in Spreadsheet. */ type?: string; @@ -38763,7 +40983,7 @@ export interface SheetsRowsCellsHyperlink { /** Specifies the sheet index to which the cell is referred. * @Default {1} */ - sheetIndex?: Number; + sheetIndex?: number; } export interface SheetsRowsCellsStyle { @@ -38801,7 +41021,12 @@ export interface SheetsRowsCell { /** Specifies the index of a cell in Spreadsheet. * @Default {0} */ - index?: Number; + index?: number; + + /** Specifies whether to lock or unlock a particular cell. + * @Default {false} + */ + isLocked?: boolean; /** Specifies the styles of a cell in Spreadsheet. * @Default {null} @@ -38818,7 +41043,7 @@ export interface SheetsRow { /** Gets or sets the height of a row in Spreadsheet. * @Default {20} */ - height?: Number; + height?: number; /** Specifies the cells of a row in Spreadsheet. * @Default {[]} @@ -38828,7 +41053,7 @@ export interface SheetsRow { /** Gets or sets the index of a row in Spreadsheet. * @Default {0} */ - index?: Number; + index?: number; } export interface Sheet { @@ -38846,12 +41071,12 @@ export interface Sheet { /** Gets or sets a value that indicates to define column count in the Spreadsheet. * @Default {21} */ - colCount?: Number; + colCount?: number; /** Gets or sets a value that indicates to define column width in the Spreadsheet. * @Default {64} */ - columnWidth?: Number; + columnWidth?: number; /** Gets or sets the data to render the Spreadsheet. * @Default {null} @@ -38900,7 +41125,7 @@ export interface Sheet { /** Gets or sets a value that indicates to define row count in the Spreadsheet. * @Default {20} */ - rowCount?: Number; + rowCount?: number; /** Specifies the rows for a sheet in Spreadsheet. * @Default {[]} @@ -39138,49 +41363,55 @@ class PdfViewer extends ej.Widget { defaults:PdfViewer.Model; /** Loads the document with the filename and displays it in PDF viewer. + * @param {string} File name to be loaded * @returns {void} */ - load(): void; + load(fileName: string): void; - /** Shows/hides the tool bar in the PDF viewer. + /** Shows/hides the toolbar in the PDF viewer. + * @param {boolean} shows/hides the toolbar * @returns {void} */ - showToolbar(): void; + showToolbar(show: boolean): void; /** Prints the PDF document. * @returns {void} */ print(): void; - /** Abort the printing function and restores the PDF Viewer. + /** Abort the printing function and restores the PDF viewer. * @returns {void} */ abortPrint(): void; - /** Shows/hides the print icon in the tool bar. + /** Shows/hides the print icon in the toolbar. + * @param {boolean} shows/hides print button in the toolbar * @returns {void} */ - showPrintTools(): void; + showPrintTools(show: boolean): void; /** Downloads the PDF document being loaded in the ejPdfViewer control. * @returns {void} */ download(): void; - /** Shows/hides the download tool in the tool bar. + /** Shows/hides the download tool in the toolbar. + * @param {boolean} shows/hides download button in the toolbar * @returns {void} */ - showDownloadTool(): void; + showDownloadTool(show: boolean): void; /** Shows/hides the page navigation tools in the toolbar + * @param {boolean} shows/hides navigation tools in the toolbar * @returns {void} */ - showPageNavigationTools(): void; + showPageNavigationTools(show: boolean): void; /** Navigates to the specific page in the PDF document. If the page is not available for the given pageNumber, PDF viewer retains the existing page in view. + * @param {number} navigates to the page number in the PDF document * @returns {void} */ - goToPage(): void; + goToPage(pageNumber: number): void; /** Navigates to the last page of the PDF document. * @returns {void} @@ -39202,10 +41433,11 @@ class PdfViewer extends ej.Widget { */ goToPreviousPage(): void; - /** Shows/hides the zoom tools in the tool bar. + /** Shows/hides the zoom tools in the toolbar. + * @param {boolean} shows/hides zoom tools in the toolbar * @returns {void} */ - showMagnificationTools(): void; + showMagnificationTools(show: boolean): void; /** Scales the page to fit the page in the container in the control. * @returns {void} @@ -39228,9 +41460,15 @@ class PdfViewer extends ej.Widget { zoomOut(): void; /** Scales the page to the specified percentage ranging from 50 to 400. If the given zoomValue is less than 50 or greater than 400; the PDF viewer scales the page to 50 and 400 respectively. + * @param {number} zoom value for scaling the pages in the PDF Viewer * @returns {void} */ - zoomTo(): void; + zoomTo(zoomValue: number): void; + + /** Unloads the PDF document being displayed in the PDF viewer. + * @returns {void} + */ + unload(): void; } export module PdfViewer{ @@ -39238,31 +41476,35 @@ export interface Model { /** Specifies the locale information of the PDF viewer. */ - locale?: String; + locale?: string; /** Specifies the toolbar settings. */ toolbarSettings?: ToolbarSettings; - /** Shows or hides the grouped items in the toolbar with the help of enum ej.PdfViewer.ToolbarItems + /** Specifies the name of the action method in the server. */ - toolbarItems?: ej.PdfViewer.ToolbarItems|string; + serverActionSettings?: ServerActionSettings; /** Sets the PDF Web API service URL */ - serviceUrl?: String; + serviceUrl?: string; + + /** Sets the PDF document path for initial loading. + */ + documentPath?: string; /** Gets the total number of pages in PDF document. */ - pageCount?: Number; + pageCount?: number; - /** Gets the number of the page being displayed in the PDF Viewer. + /** Gets the number of the page being displayed in the PDF viewer. */ - currentPageNumber?: Number; + currentPageNumber?: number; /** Gets the current zoom percentage of the PDF document in viewer. */ - zoomPercentage?: Number; + zoomPercentage?: number; /** Specifies the location of the supporting PDF service */ @@ -39272,9 +41514,25 @@ export interface Model { */ hyperlinkOpenState?: ej.PdfViewer.LinkTarget|string; - /** Enables or disables the responsive support for PDF Viewer control during the window resizing time. + /** Enables or disables the hyperlinks in PDF document. */ - isResponsive?: Boolean; + enableHyperlink?: boolean; + + /** Enables or disables the text selection in PDF document. + */ + enableTextSelection?: boolean; + + /** Enables or disables the responsiveness of the PDF viewer control during the window resize. + */ + isResponsive?: boolean; + + /** Checks whether the PDF document is edited. + */ + isDocumentEdited?: boolean; + + /** Enables or disables the buffering of the PDF pages in the client side. + */ + allowClientBuffering?: boolean; /** Gets the name of the PDF document which loaded in the ejPdfViewer control for downloading. */ @@ -39301,6 +41559,12 @@ export interface Model { /** Triggers when the mouse click is performed over the page of the PDF document. */ pageClick? (e: PageClickEventArgs): void; + /** Triggers when the client buffering process starts. */ + bufferStart? (e: BufferStartEventArgs): void; + + /** Triggers when the client buffering process ends. */ + bufferEnd? (e: BufferEndEventArgs): void; + /** Triggers when PDF viewer control is destroyed successfully. */ destroy? (e: DestroyEventArgs): void; } @@ -39309,15 +41573,15 @@ export interface DocumentLoadEventArgs { /** true, if the event should be canceled; otherwise, false. */ - Cancel?: boolean; + cancel?: boolean; /** Returns the PDF viewer model */ - Model?: any; + model?: any; /** Returns the name of the event */ - Type?: string; + type?: string; } export interface PageChangeEventArgs { @@ -39434,6 +41698,44 @@ export interface PageClickEventArgs { offsetY?: number; } +export interface BufferStartEventArgs { + + /** True, if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** Returns the PDF viewer model + */ + model?: any; + + /** Returns the name of the event + */ + type?: string; + + /** Specifies the state of the buffering + */ + isBuffering?: boolean; +} + +export interface BufferEndEventArgs { + + /** True, if the event should be canceled; otherwise, false. + */ + cancel?: boolean; + + /** Returns the PDF viewer model + */ + model?: any; + + /** Returns the name of the event + */ + type?: string; + + /** Specifies the state of the buffering + */ + isBuffering?: boolean; +} + export interface DestroyEventArgs { /** True, if the event should be canceled; otherwise, false. @@ -39453,7 +41755,30 @@ export interface ToolbarSettings { /** Shows or hides the tooltip of the toolbar items. */ - showToolTip?: Boolean; + showToolTip?: boolean; + + /** Shows or hides the grouped items in the toolbar with the help of enum ej.PdfViewer.ToolbarItems + */ + toolbarItem?: ej.PdfViewer.ToolbarItems|string; +} + +export interface ServerActionSettings { + + /** Specifies the name of the action method used for loading the PDF document. + */ + load?: string; + + /** Specifies the name of the action method used for uploading the PDF document to the PDF viewer control. + */ + fileUpload?: string; + + /** Specifies the name of the action method used for printing the PDF document in the PDF viewer control. + */ + print?: string; + + /** Specifies the name of the action method used for downloading the PDF document from the PDF viewer control. + */ + download?: string; } enum ToolbarItems{ @@ -39487,7 +41812,7 @@ enum PdfService{ enum LinkTarget{ - ///Opens the hyperlink in the same tab of the browser. + ///Opens the hyperlink in the same tab of the browser. Default, ///Opens the hyperlink in a new tab of the browser. @@ -39598,6 +41923,16 @@ export interface Model { */ ignoreSettings?: IgnoreSettings; + /** When set to true, allows the spellcheck to render based upon screen size. + * @Default {true} + */ + isResponsive?: boolean; + + /** It allows to spell check the multiple target HTML element's texts and correct its error words. + * @Default {null} + */ + controlsToValidate?: string; + /** Triggers on the success of AJAX call request. */ actionSuccess? (e: ActionSuccessEventArgs): void; @@ -39630,6 +41965,9 @@ export interface Model { /** Triggers when the spell check control performing the spell check operations such as ignore, ignoreAll, change, changeAll and addToDictionary. */ validating? (e: ValidatingEventArgs): void; + + /** Triggers before loading the target HTML element text into the dialog sentence area. */ + targetUpdating? (e: TargetUpdatingEventArgs): void; } export interface ActionSuccessEventArgs { @@ -39925,6 +42263,33 @@ export interface ValidatingEventArgs { customWord?: string; } +export interface TargetUpdatingEventArgs { + + /** Returns the previous target element value. + */ + previousElement?: any; + + /** Returns the current target element value. + */ + currentElement?: any; + + /** Returns the target html value. + */ + targetHtml?: string; + + /** Returns the cancel option value. + */ + cancel?: boolean; + + /** Returns the SpellCheck model. + */ + model?: ej.SpellCheck.Model; + + /** Returns the name of the event. + */ + type?: string; +} + export interface DictionarySettings { /** The dictionaryUrl option accepts string, which is the method path to find the error words and get the suggestions to correct the errors. @@ -39985,7 +42350,7 @@ export interface IgnoreSettings { } declare module ej.datavisualization { - + class SymbolPalette extends ej.Widget { static fn: SymbolPalette; constructor(element: JQuery, options?: SymbolPalette.Model); @@ -39993,6 +42358,20 @@ class SymbolPalette extends ej.Widget { static Locale: any; model:SymbolPalette.Model; defaults:SymbolPalette.Model; + + /** Add items to Palettes at runtime + * @param {string} name of the Palette + * @param {any} JSON for the new items to added in Palette + * @returns {void} + */ + addPaletteItem(paletteName: string, node: any): void; + + /** Remove items to Palettes at runtime + * @param {string} name of the Palette + * @param {any} JSON for the new node to removed in Palette + * @returns {void} + */ + removePaletteItem(paletteName: string, node: any): void; } export module SymbolPalette{ @@ -44667,6 +47046,11 @@ export interface Model { */ enableCanvasRendering?: boolean; + /** Controls whether the series has to be rendered at initial loading of chart, this will be useful in scenarios where chart is placed at the bottom of the web page and we need to render the series only when the chart is visible while scrolling to the top. + * @Default {true} + */ + initSeriesRender?: boolean; + /** Controls whether 3D view has to be rotated on dragging. This property is applicable only for 3D view. * @Default {false} */ @@ -44803,6 +47187,9 @@ export interface Model { /** Fires before loading the chart. */ load? (e: LoadEventArgs): void; + /** Fires after selected the data in chart. */ + rangeSelected? (e: RangeSelectedEventArgs): void; + /** Fires on clicking a point in chart. You can use this event to handle clicks made on points. */ pointRegionClick? (e: PointRegionClickEventArgs): void; @@ -45072,11 +47459,11 @@ export interface DisplayTextRenderingEventArgs { */ locationY?: number; - /** Index of the series in series Collection whose data label is being rendered + /** Index of the series in series Collection whose data label is being rendered */ seriesIndex?: number; - /** Index of the point in series whose data label is being rendered + /** Index of the point in series whose data label is being rendered */ pointIndex?: number; @@ -45256,6 +47643,25 @@ export interface LoadEventArgs { type?: string; } +export interface RangeSelectedEventArgs { + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the chart model object + */ + model?: any; + + /** Name of the event + */ + type?: string; + + /** Selected data collection of object + */ + data?: any; +} + export interface PointRegionClickEventArgs { /** Set this option to true to cancel the event @@ -45377,7 +47783,7 @@ export interface SeriesRenderingEventArgs { export interface SymbolRenderingEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -45400,7 +47806,7 @@ export interface SymbolRenderingEventArgs { export interface TitleRenderingEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -45427,7 +47833,7 @@ export interface TitleRenderingEventArgs { export interface ToolTipInitializeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -45454,7 +47860,7 @@ export interface ToolTipInitializeEventArgs { export interface TrackAxisToolTipEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -45485,7 +47891,7 @@ export interface TrackAxisToolTipEventArgs { export interface TrackToolTipEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -45520,7 +47926,7 @@ export interface TrackToolTipEventArgs { export interface AxisLabelClickEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -45532,7 +47938,7 @@ export interface AxisLabelClickEventArgs { */ type?: string; - /** X and Y co-ordinate of the labels in chart area. + /** X and Y co-ordinate of the labels in chart area. */ location?: any; @@ -45551,7 +47957,7 @@ export interface AxisLabelClickEventArgs { export interface AxisLabelMouseMoveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -45563,7 +47969,7 @@ export interface AxisLabelMouseMoveEventArgs { */ type?: string; - /** X and Y co-ordinate of the labels in chart area. + /** X and Y co-ordinate of the labels in chart area. */ location?: any; @@ -45582,7 +47988,7 @@ export interface AxisLabelMouseMoveEventArgs { export interface ChartClickEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -45594,30 +48000,30 @@ export interface ChartClickEventArgs { */ type?: string; - /** X and Y co-ordinate of the points with respect to chart area. + /** X and Y co-ordinate of the points with respect to chart area. */ location?: any; - /** ID of the target element. + /** ID of the target element. */ id?: string; - /** Width and height of the chart. + /** Width and height of the chart. */ size?: any; - /** x-coordinate of the pointer, relative to the page + /** x-coordinate of the pointer, relative to the page */ pageX?: number; - /** y-coordinate of the pointer, relative to the page + /** y-coordinate of the pointer, relative to the page */ pageY?: number; } export interface ChartMouseMoveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -45629,30 +48035,30 @@ export interface ChartMouseMoveEventArgs { */ type?: string; - /** X and Y co-ordinate of the points with respect to chart area. + /** X and Y co-ordinate of the points with respect to chart area. */ location?: any; - /** ID of the target element. + /** ID of the target element. */ id?: string; - /** Width and height of the chart. + /** Width and height of the chart. */ size?: any; - /** x-coordinate of the pointer, relative to the page + /** x-coordinate of the pointer, relative to the page */ pageX?: number; - /** y-coordinate of the pointer, relative to the page + /** y-coordinate of the pointer, relative to the page */ pageY?: number; } export interface ChartDoubleClickEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -45664,30 +48070,30 @@ export interface ChartDoubleClickEventArgs { */ type?: string; - /** X and Y co-ordinate of the points with respect to chart area. + /** X and Y co-ordinate of the points with respect to chart area. */ location?: any; - /** ID of the target element. + /** ID of the target element. */ id?: string; - /** Width and height of the chart. + /** Width and height of the chart. */ size?: any; - /** x-coordinate of the pointer, relative to the page + /** x-coordinate of the pointer, relative to the page */ pageX?: number; - /** y-coordinate of the pointer, relative to the page + /** y-coordinate of the pointer, relative to the page */ pageY?: number; } export interface AnnotationClickEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -45699,26 +48105,26 @@ export interface AnnotationClickEventArgs { */ type?: string; - /** X and Y co-ordinate of the annotation in chart area. + /** X and Y co-ordinate of the annotation in chart area. */ location?: any; - /** Information about the annotation, like Coordinate unit, Region, content + /** Information about the annotation, like Coordinate unit, Region, content */ contentData?: any; - /** x-coordinate of the pointer, relative to the page + /** x-coordinate of the pointer, relative to the page */ pageX?: number; - /** y-coordinate of the pointer, relative to the page + /** y-coordinate of the pointer, relative to the page */ pageY?: number; } export interface AfterResizeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -45730,34 +48136,34 @@ export interface AfterResizeEventArgs { */ type?: string; - /** Chart width, after resize + /** Chart width, after resize */ width?: number; - /** Chart height, after resize + /** Chart height, after resize */ height?: number; - /** Chart width, before resize + /** Chart width, before resize */ prevWidth?: number; - /** Chart height, before resize + /** Chart height, before resize */ prevHeight?: number; - /** Chart width, when the chart was first rendered + /** Chart width, when the chart was first rendered */ originalWidth?: number; - /** Chart height, when the chart was first rendered + /** Chart height, when the chart was first rendered */ originalHeight?: number; } export interface BeforeResizeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -45769,26 +48175,26 @@ export interface BeforeResizeEventArgs { */ type?: string; - /** Chart width, before resize + /** Chart width, before resize */ currentWidth?: number; - /** Chart height, before resize + /** Chart height, before resize */ currentHeight?: number; - /** Chart width, after resize + /** Chart width, after resize */ newWidth?: number; - /** Chart height, after resize + /** Chart height, after resize */ newHeight?: number; } export interface ErrorBarRenderingEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -45800,7 +48206,7 @@ export interface ErrorBarRenderingEventArgs { */ type?: string; - /** Error bar Object + /** Error bar Object */ errorbar?: any; } @@ -46366,6 +48772,31 @@ export interface CommonSeriesOptionsMarker { visible?: boolean; } +export interface CommonSeriesOptionsOutlierSettingsSize { + + /** Height of the outlier shape. + * @Default {6} + */ + height?: number; + + /** Width of the outlier shape. + * @Default {6} + */ + width?: number; +} + +export interface CommonSeriesOptionsOutlierSettings { + + /** Specifies the shape of the outlier. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /** Options for customizing the size of the outlier shape. + */ + size?: CommonSeriesOptionsOutlierSettingsSize; +} + export interface CommonSeriesOptionsCornerRadius { /** Specifies the radius for the top left corner. @@ -46517,6 +48948,19 @@ export interface CommonSeriesOptionsConnectorLine { opacity?: number; } +export interface CommonSeriesOptionsDragSettings { + + /** drag/drop the series + * @Default {false} + */ + enable?: boolean; + + /** Specifies the type of drag settings. + * @Default {xy} + */ + type?: string; +} + export interface CommonSeriesOptionsErrorBarCap { /** Show/Hides the error bar cap. @@ -46793,6 +49237,10 @@ export interface CommonSeriesOptions { */ visibleOnLegend?: string; + /** Group of the stacking collection series. + */ + stackingGroup?: string; + /** Pattern of dashes and gaps used to stroke all the line type series. */ dashArray?: string; @@ -46891,11 +49339,21 @@ export interface CommonSeriesOptions { */ isTransposed?: boolean; + /** Render the x mark in the center of the boxplot series type.x represents the average value of the boxplot series. + * @Default {true} + */ + showMedian?: boolean; + /** Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. * @Default {inside. See LabelPosition} */ labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + /** Quartile calculation has been performed in three different formulas to render the boxplot series. + * @Default {exclusive} + */ + boxPlotMode?: ej.datavisualization.Chart.boxPlotMode|string; + /** Specifies the line cap of the series. * @Default {butt. See LineCap} */ @@ -46915,6 +49373,10 @@ export interface CommonSeriesOptions { */ opacity?: number; + /** Options for customizing the outlier of the series. + */ + outlierSettings?: CommonSeriesOptionsOutlierSettings; + /** Name of a field in data source, where the fill color for all the data points is generated. */ palette?: string; @@ -47015,6 +49477,10 @@ export interface CommonSeriesOptions { */ connectorLine?: CommonSeriesOptionsConnectorLine; + /** Options to customize the drag and drop in series. + */ + dragSettings?: CommonSeriesOptionsDragSettings; + /** Options to customize the error bar in series. */ errorBar?: CommonSeriesOptionsErrorBar; @@ -47669,6 +50135,10 @@ export interface PrimaryXAxisAxisLine { */ visible?: boolean; + /** Default Value + */ + color?: string; + /** Width of axis line. * @Default {1} */ @@ -48345,6 +50815,10 @@ export interface AxesAxisLine { */ visible?: boolean; + /** Color of axis line. + */ + color?: string; + /** Width of axis line. * @Default {1} */ @@ -49016,6 +51490,10 @@ export interface PrimaryYAxisAxisLine { */ visible?: boolean; + /** Color of axis line. + */ + color?: string; + /** Width of axis line. * @Default {1} */ @@ -49941,6 +52419,31 @@ export interface SeriesMarker { visible?: boolean; } +export interface SeriesOutlierSettingsSize { + + /** Height of the outlier shape. + * @Default {6} + */ + height?: number; + + /** Width of the outlier shape. + * @Default {6} + */ + width?: number; +} + +export interface SeriesOutlierSettings { + + /** Specifies the shape of the outlier. + * @Default {circle. See Shape} + */ + shape?: ej.datavisualization.Chart.Shape|string; + + /** Options for customizing the size of the outlier shape. + */ + size?: SeriesOutlierSettingsSize; +} + export interface SeriesEmptyPointSettingsStyleBorder { /** Border color of the empty point. @@ -50004,6 +52507,19 @@ export interface SeriesConnectorLine { opacity?: number; } +export interface SeriesDragSettings { + + /** drag/drop the series + * @Default {false} + */ + enable?: boolean; + + /** Specifies the type of drag settings. + * @Default {xy} + */ + type?: string; +} + export interface SeriesErrorBarCap { /** Show/Hides the error bar cap. @@ -50667,6 +53183,10 @@ export interface Series { */ columnSpacing?: number; + /** To group the series of stacking collection. + */ + stackingGroup?: string; + /** Pattern of dashes and gaps used to stroke the line type series. */ dashArray?: string; @@ -50765,11 +53285,21 @@ export interface Series { */ isTransposed?: boolean; + /** Render the x mark in the center of the boxplot series type.x represents the average value of the boxplot series. + * @Default {true} + */ + showMedian?: boolean; + /** Position of the data label in pie/doughnut/pyramid/funnel series. OutsideExtended position is not applicable for pyramid/funnel. * @Default {inside. See LabelPosition} */ labelPosition?: ej.datavisualization.Chart.LabelPosition|string; + /** Quartile calculation has been performed in three different formulas to render the boxplot series . + * @Default {exclusive} + */ + boxPlotMode?: ej.datavisualization.Chart.LabelPosition|string; + /** Specifies the line cap of the series. * @Default {Butt. See LineCap} */ @@ -50794,6 +53324,10 @@ export interface Series { */ opacity?: number; + /** Options for customizing the outlier of individual series. + */ + outlierSettings?: SeriesOutlierSettings; + /** Name of a field in data source where fill color for all the data points is generated. */ palette?: string; @@ -50816,6 +53350,10 @@ export interface Series { */ connectorLine?: SeriesConnectorLine; + /** Options to customize the drag and drop in series. + */ + dragSettings?: SeriesDragSettings; + /** Options to customize the error bar in series. */ errorBar?: SeriesErrorBar; @@ -51289,6 +53827,18 @@ OutsideExtended, } module Chart { +enum boxPlotMode +{ +//string +Exclusive, +//string +Inclusive, +//string +Normal, +} +} +module Chart +{ enum LineCap { //string @@ -53005,11 +55555,6 @@ export interface Model { */ quantitativeScaleSettings?: QuantitativeScaleSettings; - /** Contains property to add dataSource and dataSource fields. - * @Default {null} - */ - fields?: any; - /** By specifying this property the user can change the theme of the bullet graph. * @Default {flatlight} */ @@ -54989,6 +57534,16 @@ export interface Model { */ drillDownSelectionColor?: string; + /** Specifies whether datasource is hierarchical or not. + * @Default {false} + */ + isHierarchicalDatasource?: boolean; + + /** Specifies the header for parent item during drilldown. This is applicable only for hierarchical data source. + * @Default {null} + */ + header?: string; + /** Enable/Disable the drillDown for treemap * @Default {false} */ @@ -55478,6 +58033,13 @@ class Diagram extends ej.Widget { */ addLabel(nodeName: string, newLabel: any): void; + /** Add dynamic Lanes to swimlane at runtime + * @param {any} JSON for the new lane to be added + * @param {number} Index value to add the lane in swimlane + * @returns {void} + */ + addLane(lane: any, index: number): void; + /** Add a phase to a swimlane at runtime * @param {string} name of the swimlane to which the phase will be added * @param {any} JSON object to define the phase to be added @@ -55548,7 +58110,7 @@ class Diagram extends ej.Widget { cut(): void; /** Export the diagram as downloadable files or as data - * @param {Diagram.Options} options to export the desired region of diagram to the desired formats.NameTypeDescriptionfileNamestringname of the file to be downloaded.formatstringformat of the exported file/data. See [File Formats](/api/js/global#fileformats).modestringto set whether to export diagram as a file or as raw data. See [Export Modes](/api/js/global#exportmodes).regionstringto set the region of the diagram to be exported. See [Region](/api/js/global#region).boundsobjectto export any custom region of diagram.marginobjectto set margin to the exported data. + * @param {Diagram.Options} options to export the desired region of diagram to the desired formats. * @returns {string} */ exportDiagram(options?: Diagram.Options): string; @@ -55771,10 +58333,10 @@ class Diagram extends ej.Widget { upgrade(data: any): void; /** Used to zoomIn/zoomOut diagram - * @param {any} options to zoom the diagram(zoom factor, zoomIn/zoomOut) + * @param {Diagram.Zoom} options to zoom the diagram(zoom factor, zoomIn/zoomOut) * @returns {void} */ - zoomTo(zoom: any): void; + zoomTo(Zoom?: Diagram.Zoom): void; } export module Diagram{ @@ -55803,6 +58365,25 @@ export interface Options { /** to set margin to the exported data. */ margin?: any; + + /** to set stretch to the exported data. + */ + stretch?: string; +} + +export interface Zoom { + + /** Used to increase the zoom-in or zoom-out based on the zoom factor value. + */ + zoomFactor?: number; + + /** Used to zoom-in or zoom-out the diagram. + */ + zoomCommand?: ej.datavisualization.Diagram.ZoomCommand; + + /** Used to zoom-in or zoom-out the diagram based on the point. + */ + focusPoint?: ej.datavisualization.Diagram.ConnectorsSourcePoint; } export interface Model { @@ -55877,6 +58458,11 @@ export interface Model { */ historyManager?: HistoryManager; + /** Defines the type of the rendering mode of label. + * @Default {Html} + */ + labelRenderingMode?: ej.datavisualization.Diagram.LabelRenderingMode|string; + /** Automatically arranges the nodes and connectors in a predefined manner. */ layout?: Layout; @@ -56810,6 +59396,11 @@ export interface ConnectorsLabel { */ horizontalAlignment?: ej.datavisualization.Diagram.HorizontalAlignment|string; + /** Sets the hyperlink for the labels in the connectors. + * @Default {none} + */ + hyperlink?: string; + /** Enables/disables the italic style * @Default {false} */ @@ -57007,6 +59598,11 @@ export interface ConnectorsShape { * @Default {null} */ multiplicity?: ConnectorsShapeMultiplicity; + + /** Defines the shape of UMLActivity to connector. Applicable, if the connector is of type UMLActivity + * @Default {ej.datavisualization.Diagram.UMLActivityFlow.Control} + */ + ActivityFlow?: ej.datavisualization.Diagram.UMLActivityFlow|string; } export interface ConnectorsSourceDecorator { @@ -57261,12 +59857,25 @@ export interface Connector { zOrder?: number; } +export interface ContextMenuItem { + + /** Defines the image url for the collection of context menu items + * @Default {null} + */ + imageUrl?: string; + + /** Defines the CssClass for the collection of context menu items + * @Default {null} + */ + cssClass?: string; +} + export interface ContextMenu { /** Defines the collection of context menu items * @Default {[]} */ - items?: Array; + items?: Array; /** To set whether to display the default context menu items or not * @Default {false} @@ -57834,6 +60443,11 @@ export interface NodesLabel { */ opacity?: number; + /** Sets the overflowType of the labels + * @Default {ej.datavisualization.Diagram.OverflowType.Ellipsis} + */ + overflowType?: ej.datavisualization.Diagram.OverflowType|string; + /** Defines whether the label is editable or not * @Default {false} */ @@ -57858,6 +60472,11 @@ export interface NodesLabel { */ textDecoration?: ej.datavisualization.Diagram.TextDecorations|string; + /** Defines the overflowed content is displayed or not. + * @Default {false} + */ + textOverflow?: boolean; + /** Sets the vertical alignment of the label. * @Default {ej.datavisualization.Diagram.VerticalAlignment.Center} */ @@ -58461,7 +61080,7 @@ export interface Node { /** Sets the shape of the node. It depends upon the type of node. * @Default {ej.datavisualization.Diagram.BasicShapes.Rectangle} */ - shape?: ej.datavisualization.Diagram.BasicShapes|string; + shape?: ej.datavisualization.Diagram.BasicShapes | ej.datavisualization.Diagram.FlowShapes | ej.datavisualization.Diagram.BPMNShapes | ej.datavisualization.Diagram.UMLActivityShapes|string; /** Sets the source path of the image. Applicable, if the type of the node is image. */ @@ -58832,11 +61451,11 @@ export interface Tooltip { } module Diagram { -enum ImageAlignment +enum ImageAlignment { //Scales the graphic content non-uniformly to the width and height of the diagram area None, -//Used to align the image at the top left of diagram area +//Used to align the image at the top left of diagram area XMinYMin, //Used to align the image at the left center of diagram area XMinYMid, @@ -59064,8 +61683,10 @@ enum ConnectorShapes { //Used to specify connector type as BPMN BPMN, -//Used to specify connector type as Classifier -Classifier, +//Used to specify connector type as UMLClassifier +UMLClassifier, +//Used to specify connector type as UMLActivity +UMLActivity, } } module Diagram @@ -59074,7 +61695,7 @@ enum BPMNFlows { //Used to specify the Sequence flow in a BPMN Process Sequence, -//Used to specify the Association flow in a BPMN Process +//Used to specify the Association flow in a BPMN Process Association, //Used to specify the Message flow in a BPMN Process Message, @@ -59154,6 +61775,18 @@ ManyToMany, } module Diagram { +enum UMLActivityFlow +{ +//Defines a activity flow as Object in UML Activity Diagram +Object, +//Defines a activity flow as Control in UML Activity Diagram +Control, +//Defines a activity flow as Exception in UML Activity Diagram +Exception, +} +} +module Diagram +{ enum DecoratorShapes { //Used to set decorator shape as none @@ -59210,6 +61843,16 @@ Default, } module Diagram { +enum LabelRenderingMode +{ +//Sets the labelRenderingMode as Html +Html, +//Sets the labelRenderingMode as Svg +Svg, +} +} +module Diagram +{ enum LayoutOrientations { //Used to set LayoutOrientation from top to bottom @@ -59404,6 +62047,16 @@ View, } module Diagram { +enum OverflowType +{ +//Set overflow Type as ellipsis +Ellipsis, +//Set overflow Type as Clip +Clip, +} +} +module Diagram +{ enum TextAlign { //Used to align text on left side of node/connector @@ -59484,7 +62137,7 @@ Default, } module Diagram { -enum BasicShapes +enum BasicShapes { //Used to specify node Shape as Rectangle Rectangle, @@ -59518,6 +62171,110 @@ Cylinder, } module Diagram { +enum FlowShapes +{ +//Used to specify node Shape as Process +Process, +//Used to specify node Shape as Decision +Decision, +//Used to specify node Shape as Document +Document, +//Used to specify node Shape as PreDefinedProcess +PreDefinedProcess, +//Used to specify node Shape as Terminator +Terminator, +//Used to specify node Shape as PaperTap +PaperTap, +//Used to specify node Shape as DirectData +DirectData, +//Used to specify node Shape as SequentialData +SequentialData, +//Used to specify node Shape as Sort +Sort, +//Used to specify node Shape as MultiDocument +MultiDocument, +//Used to specify node Shape as Collate +Collate, +//Used to specify node Shape as SummingJunction +SummingJunction, +//Used to specify node Shape as Or +Or, +//Used to specify node Shape as InternalStorage +InternalStorage, +//Used to specify node Shape as Extract +Extract, +//Used to specify node Shape as ManualOperation +ManualOperation, +//Used to specify node Shape as Merge +Merge, +//Used to specify node Shape as OffPageReference +OffPageReference, +//Used to specify node Shape as SequentialAccessStorage +SequentialAccessStorage, +//Used to specify node Shape as Annotation1 +Annotation1, +//Used to specify node Shape as Annotation2 +Annotation2, +//Used to specify node Shape as Data +Data, +//Used to specify node Shape as Card +Card, +} +} +module Diagram +{ +enum BPMNShapes +{ +//Used to specify node Shape as Event +Event, +//Used to specify node Shape as Gateway +Gateway, +//Used to specify node Shape as Message +Message, +//Used to specify node Shape as DataObject +DataObject, +//Used to specify node Shape as DataSource +DataSource, +//Used to specify node Shape as Activity +Activity, +//Used to specify node Shape as Group +Group, +} +} +module Diagram +{ +enum UMLActivityShapes +{ +//Used to set UML ActivityShapes as Action +Action, +//Used to set UML ActivityShapes as Decision +Decision, +//Used to set UML ActivityShapes as MergeNode +MergeNode, +//Used to set UML ActivityShapes as InitialNode +InitialNode, +//Used to set UML ActivityShapes as FinalNode +FinalNode, +//Used to set UML ActivityShapes as ForkNode +ForkNode, +//Used to set UML ActivityShapes as JoinNode +JoinNode, +//Used to set UML ActivityShapes as TimeEvent +TimeEvent, +//Used to set UML ActivityShapes as AcceptingEvent +AcceptingEvent, +//Used to set UML ActivityShapes as SendSignal +SendSignal, +//Used to set UML ActivityShapes as ReceiveSignal +ReceiveSignal, +//Used to set UML ActivityShapes as StructuredNode +StructuredNode, +//Used to set UML ActivityShapes as Note +Note, +} +} +module Diagram +{ enum BPMNBoundary { //Used to set BPMN SubProcess's Boundary as Default @@ -59616,18 +62373,24 @@ module Diagram { enum Shapes { -//Used to set decorator shape as none -None, -//Used to set decorator shape as Arrow -Arrow, -//Used to set decorator shape as Open Arrow -OpenArrow, -//Used to set decorator shape as Circle -Circle, -//Used to set decorator shape as Diamond -Diamond, -//Used to set decorator shape as path -Path, +//Used to specify node type as Text +Text, +//Used to specify node type as Image +Image, +//Used to specify node type as Html +Html, +//Used to specify node type as Native +Native, +//Used to specify node type as Basic +Basic, +//Used to specify node type as Flow +Flow, +//Used to specify node type as BPMN +BPMN, +//Used to specify node type as UMLClassifier +UMLClassifier, +//Used to specify node type as UMLActivity +UMLActivity, } } module Diagram @@ -59682,7 +62445,7 @@ All, } module Diagram { -enum UserHandlePositions +enum UserHandlePositions { //Set the position of the userhandle as topleft TopLeft, @@ -59752,6 +62515,16 @@ Object, Mouse, } } +module Diagram +{ +enum ZoomCommand +{ +//Used to zoom in the Diagram +ZoomIn, +//Used to zoom out the diagram +ZoomOut, +} +} class HeatMap extends ej.Widget { static fn: HeatMap; @@ -59780,6 +62553,15 @@ export interface Model { */ id?: number; + /** Enables or disables tooltip of heatmap + * @Default {true} + */ + showTooltip?: boolean; + + /** Defines the tooltip that should be shown when the mouse hovers over rows/columns. + */ + tooltipSettings?: TooltipSettings; + /** Specifies the source data of the heat map. * @Default {[]} */ @@ -59893,6 +62675,86 @@ export interface CellSelectedEventArgs { cell?: any; } +export interface TooltipSettingsPositionTarget { + + /** Sets the arrow position again popup based on horizontal(x) value + * @Default {center} + */ + horizontal?: ej.datavisualization.HeatMap.Horizontal|string; + + /** Sets the arrow position again popup based on vertical(y) value + * @Default {top} + */ + vertical?: ej.datavisualization.HeatMap.Vertical|string; +} + +export interface TooltipSettingsPositionStem { + + /** Sets the arrow position again popup based on horizontal(x) value + * @Default {center} + */ + horizontal?: ej.datavisualization.HeatMap.Horizontal|string; + + /** Sets the arrow position again popup based on vertical(y) value + * @Default {bottom} + */ + vertical?: ej.datavisualization.HeatMap.Vertical|string; +} + +export interface TooltipSettingsPosition { + + /** Sets the Tooltip position against target. + */ + target?: TooltipSettingsPositionTarget; + + /** Sets the arrow position again popup. + */ + stem?: TooltipSettingsPositionStem; +} + +export interface TooltipSettingsAnimation { + + /** Defines the animation effect for the tooltip that should be shown when the mouse hovers over rows/columns. + * @Default {none} + */ + effect?: ej.datavisualization.HeatMap.Effect|string; + + /** Defines the animation speed for the tooltip that should be shown when the mouse hovers over rows/columns. + * @Default {0} + */ + speed?: number; +} + +export interface TooltipSettings { + + /** Defines the tooltip that should be shown when the mouse hovers over rows/columns. + * @Default {null} + */ + templateId?: string; + + /** Defines the tooltip of associate that should be shown when the mouse hovers over rows/columns. + */ + associate?: ej.datavisualization.HeatMap.Associate|string; + + /** Enables/ disables the balloon for the tooltip to be shown + * @Default {true} + */ + isBalloon?: boolean; + + /** Defines various attributes of the Tooltip position + */ + position?: TooltipSettingsPosition; + + /** Defines the tooltip to be triggered. + * @Default {hover} + */ + trigger?: ej.datavisualization.HeatMap.Trigger|string; + + /** Defines the animation for the tooltip that should be shown when the mouse hovers over rows/columns. + */ + animation?: TooltipSettingsAnimation; +} + export interface HeatMapCell { /** Specifies whether the cell content can be visible or not. @@ -60082,19 +62944,77 @@ export interface ColorMappingCollection { } module HeatMap { +enum Associate +{ +//Used to set the associate of tooltip as Target +Target, +//Used to set the associate of tooltip as MouseFollow +MouseFollow, +//Used to set the associate of tooltip as MouseEnter +MouseEnter, +} +} +module HeatMap +{ +enum Horizontal +{ +//Used to display the tooltip horizontally on left side of rows/columns +Left, +//Used to display the tooltip horizontally on center side of rows/columns +Center, +//Used to display the tooltip horizontally on right side of rows/columns +Right, +} +} +module HeatMap +{ +enum Vertical +{ +//Used to display the tooltip horizontally on left side of rows/columns +Top, +//Used to display the tooltip horizontally on center side of rows/columns +Center, +//Used to display the tooltip horizontally on right side of rows/columns +Bottom, +} +} +module HeatMap +{ +enum Trigger +{ +//Tooltip can be triggered on mouse hovers +Hover, +//Tooltip can be triggered on mouse click +Click, +} +} +module HeatMap +{ +enum Effect +{ +//Sets tooltip animation as None +None, +//Sets tooltip animation as Fade +Fade, +//Sets tooltip animation as Slide +Slide, +} +} +module HeatMap +{ enum CellVisibility { -//Display the content of the cell +//Display the content of the cell Visible, -//Hide the content of the cell +//Hide the content of the cell Hidden, } } module HeatMap { -enum TextDecoration +enum TextDecoration { -//Defines a line below the text +//Defines a line below the text Underline, //Defines a line above the text Overline, @@ -60212,9 +63132,9 @@ module HeatMap { enum LegendOrientation { -//Scales the graphic content non-uniformly to the width and height of the diagram area +//Scales the graphic content non-uniformly to the width and height of the diagram area Horizontal, -//Used to align the image at the top left of diagram area +//Used to align the image at the top left of diagram area Vertical, } } @@ -60222,9 +63142,9 @@ module HeatMap { enum LegendMode { -//Scales the graphic content non-uniformly to the width and height of the diagram area +//Scales the graphic content non-uniformly to the width and height of the diagram area Gradient, -//Used to align the image at the top left of diagram area +//Used to align the image at the top left of diagram area List, } } @@ -60421,7 +63341,7 @@ export interface LoadedEventArgs { export interface TooltipInitializeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -60545,7 +63465,7 @@ export interface PointRegionMouseClickEventArgs { export interface SparklineMouseMoveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -60560,7 +63480,7 @@ export interface SparklineMouseMoveEventArgs { export interface SparklineMouseLeaveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -60826,6 +63746,1192 @@ Lighter, } } +class SunburstChart extends ej.Widget { + static fn: SunburstChart; + constructor(element: JQuery, options?: SunburstChart.Model); + constructor(element: Element, options?: SunburstChart.Model); + static Locale: any; + model:SunburstChart.Model; + defaults:SunburstChart.Model; + + /** Redraws the entire sunburst. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. + * @returns {void} + */ + redraw(): void; + + /** destroy the sunburst + * @returns {void} + */ + _destroy(): void; +} +export module SunburstChart{ + +export interface Model { + + /** Background color of the plot area. + * @Default {null} + */ + background?: string; + + /** Bind the data field from the data source. + * @Default {null} + */ + valueMemberPath?: string; + + /** Options for customizing the sunburst border. + */ + border?: Border; + + /** Options for customizing the sunburst segment border. + */ + segmentBorder?: SegmentBorder; + + /** Specifies the dataSource to the sunburst. + * @Default {null} + */ + dataSource?: any; + + /** Palette color for the data points. + * @Default {null} + */ + palette?: string; + + /** Parent node of the data points. + * @Default {null} + */ + parentNode?: string; + + /** Name of the property in the datasource that contains x values. + * @Default {null} + */ + xName?: string; + + /** Name of the property in the datasource that contains y values. + * @Default {null} + */ + yName?: string; + + /** Controls wheather sunburst has to be responsive or not. + * @Default {true} + */ + isResponsive?: boolean; + + /** Options to customize the Sunburst size. + */ + size?: Size; + + /** Controls the visibility of sunburst. + * @Default {true} + */ + visible?: boolean; + + /** Options to customize the Sunburst tooltip. + */ + tooltip?: Tooltip; + + /** Options for customizing sunburst points. + */ + points?: Points; + + /** Sunburst rendering will start from the specified value + * @Default {null} + */ + startAngle?: number; + + /** Sunburst rendering will end at the specified value + * @Default {null} + */ + endAngle?: number; + + /** Sunburst outer radius value + * @Default {1} + */ + radius?: number; + + /** Sunburst inner radius value + * @Default {0.4} + */ + innerRadius?: number; + + /** Options to customize the Sunburst dataLabel. + */ + dataLabelSettings?: DataLabelSettings; + + /** Options for customizing the title and subtitle of sunburst. + */ + title?: Title; + + /** Options for customizing the appearance of the levels or point while highlighting. + */ + highlightSettings?: HighlightSettings; + + /** Options for customizing the appearance of the levels or data point while selection. + */ + selectionSettings?: SelectionSettings; + + /** Specify levels of sunburst for grouped visualization of data + * @Default {[]} + */ + levels?: Array; + + /** Options to customize the legend items and legend title. + */ + legend?: Legend; + + /** Specifies the theme for Sunburst. + * @Default {Flatlight. See Theme} + */ + theme?: ej.datavisualization.Sunburst.SunburstTheme|string; + + /** Options to customize the left, right, top and bottom margins of sunburst area. + */ + margin?: Margin; + + /** Enable/disable the animation for all the levels. + * @Default {false} + */ + enableAnimation?: boolean; + + /** Opacity of the levels. + * @Default {1} + */ + opacity?: number; + + /** Options for enable zooming feature of chart. + */ + zoomSettings?: ZoomSettings; + + /** Animation type of sunburst + * @Default {rotation. See Alignment} + */ + animationType?: ej.datavisualization.Sunburst.Animation|string; + + /** Fires before loading. */ + load? (e: LoadEventArgs): void; + + /** Fires before rendering sunburst. */ + preRender? (e: PreRenderEventArgs): void; + + /** Fires after rendering sunburst. */ + loaded? (e: LoadedEventArgs): void; + + /** Fires before rendering the datalabel */ + dataLabelRendering? (e: DataLabelRenderingEventArgs): void; + + /** Fires before rendering each segment */ + segmentRendering? (e: SegmentRenderingEventArgs): void; + + /** Fires before rendering sunburst title. */ + titleRendering? (e: TitleRenderingEventArgs): void; + + /** Fires during initialization of tooltip. */ + tooltipInitialize? (e: TooltipInitializeEventArgs): void; + + /** Fires after clicking the point in sunburst */ + pointRegionClick? (e: PointRegionClickEventArgs): void; + + /** Fires while moving the mouse over sunburst points */ + pointRegionMousemove? (e: PointRegionMousemoveEventArgs): void; + + /** Fires when clicking the point to perform drilldown. */ + drillDownClick? (e: DrillDownClickEventArgs): void; + + /** Fires when resetting drilldown points. */ + drillDownBack? (e: DrillDownBackEventArgs): void; + + /** Fires after resetting the sunburst points */ + drillDownReset? (e: DrillDownResetEventArgs): void; +} + +export interface LoadEventArgs { + + /** Load event data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface PreRenderEventArgs { + + /** PreRender event data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface LoadedEventArgs { + + /** Loaded event data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface DataLabelRenderingEventArgs { + + /** Sunburst datalabel data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface SegmentRenderingEventArgs { + + /** Sunburst datalabel data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface TitleRenderingEventArgs { + + /** Sunburst title data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface TooltipInitializeEventArgs { + + /** Sunburst tooltip data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface PointRegionClickEventArgs { + + /** Includes clicked points region data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface PointRegionMousemoveEventArgs { + + /** Includes data of mouse moved region + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface DrillDownClickEventArgs { + + /** Clicked point data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface DrillDownBackEventArgs { + + /** Drill down data of points + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface DrillDownResetEventArgs { + + /** Drill down reset data + */ + data?: string; + + /** Set this option to true to cancel the event + */ + cancel?: boolean; + + /** Instance of the sunburst model object + */ + model?: any; + + /** Name of the event + */ + type?: string; +} + +export interface Border { + + /** Border color of the sunburst. + * @Default {null} + */ + color?: string; + + /** Width of the Sunburst border. + * @Default {2} + */ + width?: number; +} + +export interface SegmentBorder { + + /** Segment Border color of the sunburst. + * @Default {null} + */ + color?: string; + + /** Width of the Sunburst segment border. + * @Default {2} + */ + width?: number; +} + +export interface Size { + + /** Height of the Sunburst. + * @Default {''} + */ + height?: string; + + /** Width of the Sunburst. + * @Default {''} + */ + width?: string; +} + +export interface TooltipBorder { + + /** Border color of the tooltip. + * @Default {null} + */ + color?: string; + + /** Border width of the tooltip. + * @Default {5} + */ + width?: number; +} + +export interface TooltipFont { + + /** Font color of the text in the tooltip. + * @Default {null} + */ + color?: string; + + /** Font Family for the tooltip. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Specifies the font Style for the tooltip. + * @Default {Normal} + */ + fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; + + /** Specifies the font weight for the tooltip. + * @Default {Regular} + */ + fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; + + /** Opacity for text in the tooltip. + * @Default {1} + */ + opacity?: number; + + /** Font size for text in the tooltip. + * @Default {12px} + */ + size?: string; +} + +export interface Tooltip { + + /** tooltip visibility of the Sunburst. + * @Default {true} + */ + visible?: boolean; + + /** Options for customizing the border of the sunburst tooltip. + */ + border?: TooltipBorder; + + /** Fill color for the sunburst tooltip. + * @Default {null} + */ + fill?: string; + + /** Options for customizing the font of the tooltip. + */ + font?: TooltipFont; + + /** Custom template to the tooltip. + * @Default {null} + */ + template?: string; +} + +export interface Points { + + /** Points x value of the sunburst. + * @Default {null} + */ + x?: string; + + /** Points y value of the sunburst. + * @Default {null} + */ + y?: number; + + /** Points text of the sunburst. + * @Default {null} + */ + text?: string; + + /** Points fill color of the sunburst. + * @Default {null} + */ + fill?: string; +} + +export interface DataLabelSettingsFont { + + /** Font family of the data label. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style of the data label. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; + + /** Font weight of the data label. + * @Default {regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; + + /** Opacity of the text. + * @Default {1} + */ + opacity?: number; + + /** Font color of the data label text. + * @Default {null} + */ + color?: string; + + /** Font size of the data label. + * @Default {12px} + */ + size?: string; +} + +export interface DataLabelSettings { + + /** Datalabel visibility of the Sunburst. + * @Default {false} + */ + visible?: boolean; + + /** Alginment of sunburst datalabel + * @Default {Angle. See DatalabelAlignment} + */ + labelRotationMode?: ej.datavisualization.Sunburst.SunburstLabelRotationMode|string; + + /** Options for customizing the data label font. + */ + font?: DataLabelSettingsFont; + + /** Custome template for datalabel + * @Default {null} + */ + template?: string; + + /** Fill color for the datalable + * @Default {null} + */ + fill?: string; + + /** Datalabel overflow mode + * @Default {Trim. See LabelOverflowMode} + */ + labelOverflowMode?: ej.datavisualization.Sunburst.SunburstLabelOverflowMode|string; +} + +export interface TitleFont { + + /** Font family for Sunburst title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style for Sunburst title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; + + /** Font weight for Sunburst title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; + + /** Opacity of the Sunburst title. + * @Default {1} + */ + opacity?: number; + + /** Font size for Sunburst title. + * @Default {20px} + */ + size?: string; +} + +export interface TitleSubtitleFont { + + /** Font family of sub title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style for sub title. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; + + /** Font weight for sub title. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; + + /** Opacity of the sub title. + * @Default {1} + */ + opacity?: number; + + /** Font size for sub title. + * @Default {12px} + */ + size?: string; +} + +export interface TitleSubtitle { + + /** Subtitle text for sunburst + */ + text?: string; + + /** Sub title text visibility for sunburst + * @Default {true} + */ + visible?: string; + + /** Sub title text alignment + * @Default {far. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; + + /** Options for customizing the font of sub title. + */ + font?: TitleSubtitleFont; +} + +export interface Title { + + /** Title text for sunburst + */ + text?: string; + + /** Title text visibility for sunburst + * @Default {true} + */ + visible?: string; + + /** Title text alignment + * @Default {center. See TextAlignment} + */ + textAlignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; + + /** Options for customizing the font of sunburst title. + */ + font?: TitleFont; + + /** Options to customize the sub title of Sunburst. + */ + subtitle?: TitleSubtitle; +} + +export interface HighlightSettings { + + /** Enables/disables the ability to highlight the levels or point interactively. + * @Default {false} + */ + enable?: boolean; + + /** Specifies whether the levels or point has to be highlighted. + * @Default {point. See Mode} + */ + mode?: ej.datavisualization.Sunburst.SunburstHighlightMode|string; + + /** Color of the levels/point on highlight. + * @Default {red} + */ + color?: string; + + /** Opacity of the levels/point on highlight. + * @Default {0.5} + */ + opacity?: number; + + /** Specifies whether the levels or data point has to be highlighted. + * @Default {opacity. See Mode} + */ + type?: ej.datavisualization.Sunburst.SunburstHighlightType|string; +} + +export interface SelectionSettings { + + /** Enables/disables the ability to select the levels or data point interactively. + * @Default {false} + */ + enable?: boolean; + + /** Specifies whether the levels or data point has to be selected. + * @Default {point. See Mode} + */ + mode?: ej.datavisualization.Sunburst.SunburstHighlightMode|string; + + /** Color of the levels/point on selection. + * @Default {green} + */ + color?: string; + + /** Opacity of the levels/point on selection. + * @Default {0.5} + */ + opacity?: number; + + /** Specifies whether the levels or data point has to be selected. + * @Default {opacity. See Mode} + */ + type?: ej.datavisualization.Sunburst.SunburstHighlightType|string; +} + +export interface Level { + + /** Specifies the group member path + * @Default {null} + */ + groupMemberPath?: string; +} + +export interface LegendBorder { + + /** Border color of the legend. + * @Default {null} + */ + color?: string; + + /** Border width of the legend. + * @Default {1} + */ + width?: number; +} + +export interface LegendFont { + + /** Font family for legend item text. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style for legend item text. + * @Default {Normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; + + /** Font weight for legend item text. + * @Default {Regular. See FontWeight} + */ + fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; + + /** Font size for legend item text. + * @Default {12px} + */ + size?: string; +} + +export interface LegendItemStyle { + + /** Height of the shape in legend items. + * @Default {10} + */ + height?: number; + + /** Width of the shape in legend items. + * @Default {10} + */ + width?: number; +} + +export interface LegendLocation { + + /** X value or horizontal offset to position the legend in chart. + * @Default {0} + */ + x?: number; + + /** Y value or vertical offset to position the legend. + * @Default {0} + */ + y?: number; +} + +export interface LegendSize { + + /** Height of the legend. Height can be specified in either pixel or percentage. + * @Default {null} + */ + height?: string; + + /** Width of the legend. Width can be specified in either pixel or percentage. + * @Default {null} + */ + width?: string; +} + +export interface LegendTitleFont { + + /** Font family for the text in legend title. + * @Default {Segoe UI} + */ + fontFamily?: string; + + /** Font style for legend title. + * @Default {normal. See FontStyle} + */ + fontStyle?: ej.datavisualization.Sunburst.FontStyle|string; + + /** Font weight for legend title. + * @Default {normal. See FontWeight} + */ + fontWeight?: ej.datavisualization.Sunburst.FontWeight|string; + + /** Font size for legend title. + * @Default {12px} + */ + size?: string; +} + +export interface LegendTitle { + + /** Options to customize the font used for legend title + */ + font?: LegendTitleFont; + + /** Enables or disables the legend title. + * @Default {true} + */ + visible?: string; + + /** Text to be displayed in legend title. + */ + text?: string; + + /** Alignment of the legend title. + * @Default {center. See Alignment} + */ + textAlignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; +} + +export interface Legend { + + /** Visibility of the legend. + * @Default {false} + */ + visible?: boolean; + + /** Interactive action of legend items. + * @Default {toggleSegmentVisibility. See Alignment} + */ + clickAction?: ej.datavisualization.Sunburst.SunburstClickAction|string; + + /** Horizontal alignment of the legend. + * @Default {Center. See Alignment} + */ + alignment?: ej.datavisualization.Sunburst.SunburstAlignment|string; + + /** Options for customizing the legend border. + */ + border?: LegendBorder; + + /** Number of columns to arrange the legend items. + * @Default {null} + */ + columnCount?: number; + + /** Number of rows to arrange the legend items. + * @Default {null} + */ + rowCount?: number; + + /** Options to customize the font used for legend item text. + */ + font?: LegendFont; + + /** Gap or padding between the legend items. + * @Default {10} + */ + itemPadding?: number; + + /** Options to customize the style of legend items. + */ + itemStyle?: LegendItemStyle; + + /** Options to customize the location of sunburst legend. Legend is placed in provided location only when value of position property is custom + */ + location?: LegendLocation; + + /** Places the legend at specified position. Legend can be placed at left, right, top or bottom of the chart area.To manually specify the location of legend, set custom as value to this property. + * @Default {Bottom. See Position} + */ + position?: ej.datavisualization.Sunburst.SunburstLegendPosition|string; + + /** Shape of the legend items. + * @Default {None. See Shape} + */ + shape?: ej.datavisualization.Sunburst.SunburstLegendShape|string; + + /** Options to customize the size of the legend. + */ + size?: LegendSize; + + /** Options to customize the legend title. + */ + title?: LegendTitle; +} + +export interface Margin { + + /** Spacing for the left margin of chart area. Setting positive value decreases the width of the chart area from left side. + * @Default {10} + */ + left?: number; + + /** Spacing for the right margin of chart area. Setting positive value decreases the width of the chart area from right side. + * @Default {10} + */ + right?: number; + + /** Spacing for the top margin of chart area. Setting positive value decreases the height of the chart area from the top. + * @Default {10} + */ + top?: number; + + /** Spacing for the bottom margin of the chart area. Setting positive value decreases the height of the chart area from the bottom. + * @Default {10} + */ + bottom?: number; +} + +export interface ZoomSettings { + + /** Enables or disables zooming. + * @Default {false} + */ + enable?: boolean; + + /** Toolbar horizontal alignment + * @Default {right. See Alignment} + */ + toolbarHorizontalAlignment?: ej.datavisualization.Sunburst.SunburstHorizontalAlignment|string; + + /** Toolbar vertical alignment + * @Default {top. See Alignment} + */ + toolbarVerticalAlignment?: ej.datavisualization.Sunburst.SunburstVerticalAlignment|string; +} +} +module Sunburst +{ +enum FontStyle +{ +//string +Normal, +//string +Italic, +} +} +module Sunburst +{ +enum FontWeight +{ +//string +Regular, +//string +Bold, +//string +Lighter, +} +} +module Sunburst +{ +enum SunburstLabelRotationMode +{ +//string +Angle, +//string +Normal, +} +} +module Sunburst +{ +enum SunburstLabelOverflowMode +{ +//string +Trim, +//string +Hide, +//string +None, +} +} +module Sunburst +{ +enum SunburstAlignment +{ +//string +Center, +//string +Near, +//string +Far, +} +} +module Sunburst +{ +enum SunburstHighlightMode +{ +//string +Point, +//string +Parent, +//string +Child, +//string +All, +} +} +module Sunburst +{ +enum SunburstHighlightType +{ +//string +Opacity, +//string +Color, +} +} +module Sunburst +{ +enum SunburstClickAction +{ +//string +None, +//string +ToggleSegmentVisibility, +//string +ToggleSegmentSelection, +} +} +module Sunburst +{ +enum SunburstLegendPosition +{ +//string +Left, +//string +Right, +//string +Top, +//string +Bottom, +} +} +module Sunburst +{ +enum SunburstLegendShape +{ +//string +Diamond, +//string +Pentagon, +//string +Rectangle, +//string +Circle, +//string +Cross, +//string +Triangle, +} +} +module Sunburst +{ +enum SunburstTheme +{ +//string +FlatLight, +//string +FlatDark, +} +} +module Sunburst +{ +enum SunburstHorizontalAlignment +{ +//string +Center, +//string +Left, +//string +Right, +} +} +module Sunburst +{ +enum SunburstVerticalAlignment +{ +//string +Top, +//string +Bottom, +//string +Middle, +} +} +module Sunburst +{ +enum Animation +{ +//string +Rotation, +//string +FadeIn, +} +} + class Overview extends ej.Widget { static fn: Overview; constructor(element: JQuery, options?: Overview.Model); @@ -61198,6 +65304,11 @@ ejSpreadsheet(options?: ej.Spreadsheet.Model): JQuery; ejSpreadsheet(memberName: any, value?: any, param?: any): any; data(key: "ejSpreadsheet"): ej.Spreadsheet; +ejSunburstChart(): JQuery; +ejSunburstChart(options?: ej.datavisualization.SunburstChart.Model): JQuery; +ejSunburstChart(memberName: any, value?: any, param?: any): any; +data(key: "ejSunburstChart"): ej.datavisualization.SunburstChart; + ejSymbolPalette(): JQuery; ejSymbolPalette(options?: ej.datavisualization.SymbolPalette.Model): JQuery; ejSymbolPalette(memberName: any, value?: any, param?: any): any; From ce8ec50aab62c4d226d9ec61bcda989d5394c9ec Mon Sep 17 00:00:00 2001 From: Tommy Troy Lin Date: Mon, 13 Feb 2017 18:00:28 +0800 Subject: [PATCH 073/797] 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 074/797] 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 075/797] 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 076/797] 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 ec4b986bc8641599b223a79efaebafe196aeb2e8 Mon Sep 17 00:00:00 2001 From: Alexey Svetliakov Date: Tue, 14 Feb 2017 01:49:54 +0100 Subject: [PATCH 077/797] enzyme: return any as state for shallow() and mount() --- enzyme/enzyme-tests.tsx | 14 ++++++++++++++ enzyme/index.d.ts | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/enzyme/enzyme-tests.tsx b/enzyme/enzyme-tests.tsx index 82a8dc9822..c7323766f7 100644 --- a/enzyme/enzyme-tests.tsx +++ b/enzyme/enzyme-tests.tsx @@ -37,6 +37,13 @@ namespace ShallowWrapperTest { elementWrapper: ShallowWrapper, {}>, statelessWrapper: ShallowWrapper; + function test_props_state_inferring() { + let wrapper: ShallowWrapper; + wrapper = shallow(); + wrapper.state().stateProperty; + wrapper.props().stringProp.toUpperCase(); + } + function test_shallow_options() { shallow(, { context: { @@ -337,6 +344,13 @@ namespace ReactWrapperTest { elementWrapper: ReactWrapper, {}>, statelessWrapper: ReactWrapper; + function test_prop_state_inferring() { + let wrapper: ReactWrapper; + wrapper = mount(); + wrapper.state().stateProperty; + wrapper.props().stringProp.toUpperCase(); + } + function test_unmount() { reactWrapper = reactWrapper.unmount(); } diff --git a/enzyme/index.d.ts b/enzyme/index.d.ts index 66c86d1166..184b20ec57 100644 --- a/enzyme/index.d.ts +++ b/enzyme/index.d.ts @@ -541,14 +541,14 @@ export interface MountRendererProps { * @param node * @param [options] */ -export function shallow(node: ReactElement

, options?: ShallowRendererProps): ShallowWrapper; +export function shallow(node: ReactElement

, options?: ShallowRendererProps): ShallowWrapper; /** * Mounts and renders a react component into the document and provides a testing wrapper around it. * @param node * @param [options] */ -export function mount(node: ReactElement

, options?: MountRendererProps): ReactWrapper; +export function mount(node: ReactElement

, options?: MountRendererProps): ReactWrapper; /** * Render react components to static HTML and analyze the resulting HTML structure. From ce3154548d2e629f4ecd39fa9e0d9ff0c7ba80bb Mon Sep 17 00:00:00 2001 From: pathanin Date: Tue, 14 Feb 2017 08:35:34 +0700 Subject: [PATCH 078/797] 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 079/797] 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 080/797] 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 081/797] 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 082/797] 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 083/797] 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 084/797] 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 085/797] 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 086/797] 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 e39187a75a9b155c27599bffd6aad673d6dc5b94 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Tue, 14 Feb 2017 14:04:45 +0100 Subject: [PATCH 087/797] Add types for stream-buffers --- stream-buffers/index.d.ts | 40 +++++++++++++++++++++ stream-buffers/stream-buffers-tests.ts | 48 ++++++++++++++++++++++++++ stream-buffers/tsconfig.json | 22 ++++++++++++ stream-buffers/tslint.json | 1 + 4 files changed, 111 insertions(+) create mode 100644 stream-buffers/index.d.ts create mode 100644 stream-buffers/stream-buffers-tests.ts create mode 100644 stream-buffers/tsconfig.json create mode 100644 stream-buffers/tslint.json diff --git a/stream-buffers/index.d.ts b/stream-buffers/index.d.ts new file mode 100644 index 0000000000..ac44049d78 --- /dev/null +++ b/stream-buffers/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for stream-buffers 3.0 +// Project: https://github.com/samcday/node-stream-buffer#readme +// Definitions by: Jason Dent +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +import * as stream from 'stream'; + +export interface WritableStreamBufferOptions extends stream.WritableOptions { + initialSize?: number; + incrementAmount?: number; +} + +export declare class WritableStreamBuffer extends stream.Writable { + constructor(options?: WritableStreamBufferOptions); + size(): number; + maxSize(): number; + getContents(length?: number): any | false; + getContentsAsString(encoding?: string, length?: number): string; +} + +export interface ReadableStreamBufferOptions extends stream.ReadableOptions { + frequency?: number; + chunkSize?: number; + initialSize?: number; + incrementAmount?: number; +} + +export declare class ReadableStreamBuffer extends stream.Readable { + constructor(options?: ReadableStreamBufferOptions); + put(data: string | Buffer, encoding?: string): void; + stop(): void; + size(): number; + maxSize(): number; +} + +export declare const DEFAULT_INITIAL_SIZE: number; +export declare const DEFAULT_INCREMENT_AMOUNT: number; +export declare const DEFAULT_FREQUENCY: number; +export declare const DEFAULT_CHUNK_SIZE: number; diff --git a/stream-buffers/stream-buffers-tests.ts b/stream-buffers/stream-buffers-tests.ts new file mode 100644 index 0000000000..2a1a1f35f8 --- /dev/null +++ b/stream-buffers/stream-buffers-tests.ts @@ -0,0 +1,48 @@ +import * as streamBuffers from 'stream-buffers'; + +// The following are examples from README.md +// https://github.com/samcday/node-stream-buffer + +var myWritableStreamBuffer = new streamBuffers.WritableStreamBuffer({ + initialSize: (100 * 1024), // start at 100 kilobytes. + incrementAmount: (10 * 1024) // grow by 10 kilobytes each time buffer overflows. +}); + +var a = streamBuffers.DEFAULT_INITIAL_SIZE; // (8 * 1024) +var b = streamBuffers.DEFAULT_INCREMENT_AMOUNT; // (8 * 1024) +var c = streamBuffers.DEFAULT_CHUNK_SIZE; // (1024) +var d = streamBuffers.DEFAULT_FREQUENCY; // (1) + +const buffer = new Buffer('ASDF'); +myWritableStreamBuffer.write('ASDF'); +myWritableStreamBuffer.write(buffer); +myWritableStreamBuffer.size(); +myWritableStreamBuffer.maxSize(); + +// Gets all held data as a Buffer. +myWritableStreamBuffer.getContents(); + +// Gets all held data as a utf8 string. +myWritableStreamBuffer.getContentsAsString('utf8'); + +// Gets first 5 bytes as a Buffer. +myWritableStreamBuffer.getContents(5); + +// Gets first 5 bytes as a utf8 string. +myWritableStreamBuffer.getContentsAsString('utf8', 5); + +var myReadableStreamBuffer = new streamBuffers.ReadableStreamBuffer({ + frequency: 10, // in milliseconds. + chunkSize: 2048 // in bytes. +}); + +myReadableStreamBuffer.put('A String', 'utf8'); +myReadableStreamBuffer.put(buffer); + +myReadableStreamBuffer.on('data', function(data) { + // streams1.x style data + // assert.isTrue(data instanceof Buffer); +}); + +myReadableStreamBuffer.put('the last data this stream will ever see'); +myReadableStreamBuffer.stop(); diff --git a/stream-buffers/tsconfig.json b/stream-buffers/tsconfig.json new file mode 100644 index 0000000000..827ea2a3fe --- /dev/null +++ b/stream-buffers/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", + "stream-buffers-tests.ts" + ] +} diff --git a/stream-buffers/tslint.json b/stream-buffers/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/stream-buffers/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 18c357d03c047de83e7db7e47721d43524e50ccc Mon Sep 17 00:00:00 2001 From: Patrick Lee Date: Tue, 14 Feb 2017 14:15:50 -0600 Subject: [PATCH 088/797] 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 089/797] 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 090/797] 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 091/797] 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 ba4249b578d8486fa7512394f53246415de28681 Mon Sep 17 00:00:00 2001 From: Flarna Date: Tue, 14 Feb 2017 23:01:57 +0100 Subject: [PATCH 092/797] fix test errors (missing lib entry) after merge from master --- bittorrent-protocol/tsconfig.json | 1 + dockerode/tsconfig.json | 1 + forever-monitor/tsconfig.json | 1 + globule/tsconfig.json | 1 + hapi-auth-jwt2/tsconfig.json | 1 + lodash-webpack-plugin/tsconfig.json | 1 + opener/tsconfig.json | 1 + pump/tsconfig.json | 1 + spatialite/tsconfig.json | 1 + strong-cluster-control/tsconfig.json | 1 + 10 files changed, 10 insertions(+) diff --git a/bittorrent-protocol/tsconfig.json b/bittorrent-protocol/tsconfig.json index 65222bf056..91bc973b19 100644 --- a/bittorrent-protocol/tsconfig.json +++ b/bittorrent-protocol/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "module": "commonjs", + "lib": ["es6"], "target": "es6", "noImplicitAny": true, "noImplicitThis": true, diff --git a/dockerode/tsconfig.json b/dockerode/tsconfig.json index a077f02e3c..71dc09b6f3 100644 --- a/dockerode/tsconfig.json +++ b/dockerode/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": false, diff --git a/forever-monitor/tsconfig.json b/forever-monitor/tsconfig.json index 8c6d4986b5..51be96a492 100644 --- a/forever-monitor/tsconfig.json +++ b/forever-monitor/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/globule/tsconfig.json b/globule/tsconfig.json index ec155b8b0f..1c268beac3 100644 --- a/globule/tsconfig.json +++ b/globule/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/hapi-auth-jwt2/tsconfig.json b/hapi-auth-jwt2/tsconfig.json index 764570cbac..799f735597 100644 --- a/hapi-auth-jwt2/tsconfig.json +++ b/hapi-auth-jwt2/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/lodash-webpack-plugin/tsconfig.json b/lodash-webpack-plugin/tsconfig.json index 03e491ef78..f0ffecca16 100644 --- a/lodash-webpack-plugin/tsconfig.json +++ b/lodash-webpack-plugin/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/opener/tsconfig.json b/opener/tsconfig.json index 963f0f48b5..829bca6c8c 100644 --- a/opener/tsconfig.json +++ b/opener/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/pump/tsconfig.json b/pump/tsconfig.json index b7d71ceb05..691201c4f5 100644 --- a/pump/tsconfig.json +++ b/pump/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/spatialite/tsconfig.json b/spatialite/tsconfig.json index 6ad0b96035..920a30d441 100644 --- a/spatialite/tsconfig.json +++ b/spatialite/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/strong-cluster-control/tsconfig.json b/strong-cluster-control/tsconfig.json index 3623adaea2..aace29264e 100644 --- a/strong-cluster-control/tsconfig.json +++ b/strong-cluster-control/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, From 7aaf957deb409060efc12dcafa001708f677cbb5 Mon Sep 17 00:00:00 2001 From: Omer Bokhari Date: Tue, 14 Feb 2017 17:08:01 -0800 Subject: [PATCH 093/797] 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 c4b77ece6008ae9da573a1edd166debb12854f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Elgaard=20Larsen?= Date: Wed, 15 Feb 2017 10:50:18 +0100 Subject: [PATCH 094/797] Added support for isbn-utils --- isbn-utils/index.d.ts | 35 +++++++++++++++++++++++++++++++++ isbn-utils/isbn-utils-tests.ts | 36 ++++++++++++++++++++++++++++++++++ isbn-utils/tsconfig.json | 20 +++++++++++++++++++ isbn-utils/tslint.conf | 3 +++ 4 files changed, 94 insertions(+) create mode 100644 isbn-utils/index.d.ts create mode 100644 isbn-utils/isbn-utils-tests.ts create mode 100644 isbn-utils/tsconfig.json create mode 100644 isbn-utils/tslint.conf diff --git a/isbn-utils/index.d.ts b/isbn-utils/index.d.ts new file mode 100644 index 0000000000..fe2ac4dae9 --- /dev/null +++ b/isbn-utils/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for isbn-utils 1.1 +// Project: https://github.com/GitbookIO/isbn-utils +// Definitions by: Jørgen Elgaard Larsen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +type IGroups = any; + +export class ISBNcodes { + readonly source: string; + readonly prefix: string; + readonly group: string; + readonly publisher: string; + readonly article: string; + readonly check: string; + readonly check10: string; + readonly check13: string; + readonly groupname: string; +} + +export class ISBN { + constructor(val: string, groups: IGroups); + asIsbn10(hyphenate?: boolean): string; + asIsbn13(hyphenate?: boolean): string; + codes: ISBNcodes; + isIsbn10(): boolean; + isIsbn13(): boolean; + isValid(): boolean; +} + +export function asIsbn10(isbn: string, hyphenate?: boolean): string; +export function asIsbn13(isbn: string, hyphenate?: boolean): string; +export function parse(isbn: string, groups?: IGroups): ISBN|null; +export function hyphenate(isbn: string): string; +export function isValid(isbn: string, groups?: IGroups): boolean; diff --git a/isbn-utils/isbn-utils-tests.ts b/isbn-utils/isbn-utils-tests.ts new file mode 100644 index 0000000000..91f72a0359 --- /dev/null +++ b/isbn-utils/isbn-utils-tests.ts @@ -0,0 +1,36 @@ +import * as isbn from 'isbn-utils'; + + +const isbn10a: isbn.ISBN|null = isbn.parse('4873113369'); +let b: boolean; +let s: string; + +if (isbn10a !== null) { + b = isbn10a.isIsbn10(); + b = isbn10a.isIsbn13(); + s = isbn10a.asIsbn10(); + s = isbn10a.asIsbn10(true); + s = isbn10a.asIsbn13(); + s = isbn10a.asIsbn13(true); + s = isbn10a.codes.source; + s = isbn10a.codes.prefix; + s = isbn10a.codes.group; + s = isbn10a.codes.publisher; + s = isbn10a.codes.article; + s = isbn10a.codes.check; + s = isbn10a.codes.check10; + s = isbn10a.codes.check13; + s = isbn10a.codes.groupname; +} + +const bad: isbn.ISBN|null = isbn.parse('invalid format'); +if (bad === null) { + s = 'Bummer.'; +} + +s = isbn.asIsbn13('4-87311-336-9'); +s = isbn.asIsbn13('4-87311-336-9', true); +s = isbn.asIsbn10('978-4-87311-336-4'); +s = isbn.asIsbn10('978-4-87311-336-4', true); + +s = isbn.hyphenate('9784873113364'); diff --git a/isbn-utils/tsconfig.json b/isbn-utils/tsconfig.json new file mode 100644 index 0000000000..f67fbd95ef --- /dev/null +++ b/isbn-utils/tsconfig.json @@ -0,0 +1,20 @@ +{ + "files": [ + "index.d.ts", + "isbn-utils-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/isbn-utils/tslint.conf b/isbn-utils/tslint.conf new file mode 100644 index 0000000000..0a0094293e --- /dev/null +++ b/isbn-utils/tslint.conf @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json", +} From ab494ae5d1ee13a845819cd0fafcb80c44cdd380 Mon Sep 17 00:00:00 2001 From: Achim Hasenmueller Date: Wed, 15 Feb 2017 15:21:02 +0100 Subject: [PATCH 095/797] Updates from openlayers 4.0.1 ol.anmiation was removed Map.beforeRender was removed Observable.unByKey member function was removed (static function remains) Updated View.fit / view.FitOptions Added forgotten TextOptions.rotateWithView --- openlayers/index.d.ts | 86 ++++++------------------------------------- 1 file changed, 11 insertions(+), 75 deletions(-) diff --git a/openlayers/index.d.ts b/openlayers/index.d.ts index f81e964b4d..f551b3bde6 100644 --- a/openlayers/index.d.ts +++ b/openlayers/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for OpenLayers v3.20.0 +// Type definitions for OpenLayers v4.0.1 // Project: http://openlayers.org/ // Definitions by: Olivier Sechet // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,55 +10,6 @@ declare type GlobalObject = Object; * @namespace ol */ declare module ol { - /** - * The animation static methods are designed to be used with the - * {@link ol.Map#beforeRender} method. For example: - * - * var map = new ol.Map({ ... }); - * var zoom = ol.animation.zoom({ - * resolution: map.getView().getResolution() - * }); - * map.beforeRender(zoom); - * map.getView().setResolution(map.getView().getResolution() * 2); - * - * @namespace ol.animation - */ - module animation { - /** - * Generate an animated transition that will "bounce" the resolution as it - * approaches the final value. - * @param {olx.animation.BounceOptions} options Bounce options. - * @return {ol.PreRenderFunction} Pre-render function. - * @api - */ - function bounce(options: olx.animation.BounceOptions): ol.PreRenderFunction; - - /** - * Generate an animated transition while updating the view center. - * @param {olx.animation.PanOptions} options Pan options. - * @return {ol.PreRenderFunction} Pre-render function. - * @api - */ - function pan(options: olx.animation.PanOptions): ol.PreRenderFunction; - - /** - * Generate an animated transition while updating the view rotation. - * @param {olx.animation.RotateOptions} options Rotate options. - * @return {ol.PreRenderFunction} Pre-render function. - * @api - */ - function rotate(options: olx.animation.RotateOptions): ol.PreRenderFunction; - - /** - * Generate an animated transition while updating the view resolution. - * @param {olx.animation.ZoomOptions} options Zoom options. - * @return {ol.PreRenderFunction} Pre-render function. - * @api - */ - function zoom(options: olx.animation.ZoomOptions): ol.PreRenderFunction; - - } - /** * Error object thrown when an assertion failed. This is an ECMA-262 Error, * extended with a `code` property. @@ -6645,15 +6596,6 @@ declare module ol { */ addOverlay(overlay: ol.Overlay): void; - /** - * Add functions to be called before rendering. This can be used for attaching - * animations before updating the map's view. The {@link ol.animation} - * namespace provides several static methods for creating prerender functions. - * @param {...ol.PreRenderFunction} var_args Any number of pre-render functions. - * @api - */ - beforeRender(var_args: ol.PreRenderFunction): void; - /** * Detect features that intersect a pixel on the viewport, and execute a * callback with each intersecting feature. Layers included in the detection can @@ -7367,18 +7309,6 @@ declare module ol { * @api stable */ un(type: (string | string[]), listener: Function, opt_this?: GlobalObject): void; - - /** - * Removes an event listener using the key returned by `on()` or `once()`. - * Note that using the {@link ol.Observable.unByKey} static function is to - * be preferred. - * @param {ol.EventsKey|Array.} key The key returned by `on()` - * or `once()` (or an array of keys). - * @function - * @api stable - */ - unByKey(key: (ol.EventsKey | ol.EventsKey[])): void; - } /** @@ -11672,11 +11602,10 @@ declare module ol { * In most cases you will want to use the map size, that is `map.getSize()`. * Takes care of the map angle. * @param {ol.geom.SimpleGeometry|ol.Extent} geometry Geometry. - * @param {ol.Size} size Box pixel size. * @param {olx.view.FitOptions=} opt_options Options. * @api */ - fit(geometry: (ol.geom.SimpleGeometry | ol.Extent), size: ol.Size, opt_options?: olx.view.FitOptions): void; + fit(geometry: (ol.geom.SimpleGeometry | ol.Extent), opt_options?: olx.view.FitOptions): void; /** * Center on coordinate and view position. @@ -13535,6 +13464,7 @@ declare module olx { offsetX?: number; offsetY?: number; scale?: number; + rotateWithView?: boolean; rotation?: number; text?: string; textAlign?: string; @@ -13775,18 +13705,24 @@ declare module olx { module view { /** * @typedef {{ + * size: (ol.Size|undefined), * padding: (!Array.|undefined), * constrainResolution: (boolean|undefined), + * duration: (number|undefined), * nearest: (boolean|undefined), * maxZoom: (number|undefined), - * minResolution: (number|undefined)}} + * minResolution: (number|undefined), + * easing: (function(t: number) => number) }} */ interface FitOptions { + size?: ol.Size, padding?: number[]; constrainResolution?: boolean; nearest?: boolean; - maxZoom?: number; minResolution?: number; + maxZoom?: number; + duration?: number; + easing?: ((t: number) => number); } } From 69c3d510d87d0ba467874f6008d635d236ef6199 Mon Sep 17 00:00:00 2001 From: Christian Treppo Date: Wed, 15 Feb 2017 15:44:20 +0100 Subject: [PATCH 096/797] [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 097/797] 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 3f579f06959a5ffef2f98e2479bf951f83827785 Mon Sep 17 00:00:00 2001 From: Jason Dent Date: Thu, 16 Feb 2017 09:52:00 +0100 Subject: [PATCH 098/797] Remove unnecessary false based upon comments. --- stream-buffers/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stream-buffers/index.d.ts b/stream-buffers/index.d.ts index ac44049d78..d3871b1efa 100644 --- a/stream-buffers/index.d.ts +++ b/stream-buffers/index.d.ts @@ -15,7 +15,7 @@ export declare class WritableStreamBuffer extends stream.Writable { constructor(options?: WritableStreamBufferOptions); size(): number; maxSize(): number; - getContents(length?: number): any | false; + getContents(length?: number): any; getContentsAsString(encoding?: string, length?: number): string; } From b983469a15b61bf259d37d04de304273dcbdc3ef Mon Sep 17 00:00:00 2001 From: sqwk Date: Thu, 16 Feb 2017 10:12:42 +0100 Subject: [PATCH 099/797] Initial Commit --- lowdb/index.d.ts | 536 +++++++++++++++++++++++++++++++++++++++++++ lowdb/lowdb-tests.ts | 12 + lowdb/tsconfig.json | 23 ++ 3 files changed, 571 insertions(+) create mode 100644 lowdb/index.d.ts create mode 100644 lowdb/lowdb-tests.ts create mode 100644 lowdb/tsconfig.json diff --git a/lowdb/index.d.ts b/lowdb/index.d.ts new file mode 100644 index 0000000000..ddd20e89ed --- /dev/null +++ b/lowdb/index.d.ts @@ -0,0 +1,536 @@ +declare module 'lowdb' { + interface PromiseLike { + + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; + } + + interface StringRepresentable { + toString(): string; + } + + interface List { + [index: number]: T; + length: number; + } + + interface Dictionary { + [index: string]: T; + } + + interface DictionaryIterator { + (value: T, key?: string, collection?: Dictionary): TResult; + } + + interface ListIterator { + (value: T, index: number, collection: List): TResult; + } + + interface StringIterator { + (char: string, index?: number, string?: string): TResult; + } + + interface MixinOptions { + chain?: boolean; + } + + interface LoDashWrapper { + + /** + * @see _.has + */ + has(path: StringRepresentable | StringRepresentable[]): LoDashWrapper; + + /** + * @see _.hasIn + */ + hasIn(path: StringRepresentable | StringRepresentable[]): LoDashWrapper; + + /** + * @see _.assign + */ + assign( + source: TSource + ): LoDashWrapper; + + /** + * @see _.assign + */ + assign( + source1: TSource1, + source2: TSource2 + ): LoDashWrapper; + + /** + * @see _.assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashWrapper; + + /** + * @see _.assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashWrapper; + + /** + * @see _.assign + */ + assign(): LoDashWrapper; + + /** + * @see _.assign + */ + assign(...otherArgs: any[]): LoDashWrapper; + + /** + * @see _.cloneDeep + */ + cloneDeep(): LoDashWrapper; + + /** + * @see _.cloneDeep + */ + cloneDeep(): LoDashWrapper; + + /** + * @see _.cloneDeep + */ + cloneDeepWith(customizer: (value: any) => any): LoDashWrapper[]; + + /** + * @see _.cloneDeep + */ + cloneDeepWith(customizer: (value: any) => any): LoDashWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: S1, + ...sources: {}[] + ): LoDashWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: S1, + source2: S2, + ...sources: {}[] + ): LoDashWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: S1, + source2: S2, + source3: S3, + ...sources: {}[] + ): LoDashWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: S1, + source2: S2, + source3: S3, + source4: S4, + ...sources: {}[] + ): LoDashWrapper; + + /** + * @see _.defaults + */ + defaults(): LoDashWrapper; + + /** + * @see _.defaults + */ + defaults(...sources: {}[]): LoDashWrapper; + + /** + * @see _.get + */ + get(object: Object, + path: string | number | boolean | Array, + defaultValue?: TResult + ): LoDashWrapper; + + /** + * @see _.get + */ + get(path: string | number | boolean | Array, + defaultValue?: TResult + ): LoDashWrapper; + + + /** + * @see _.mixin + */ + mixin( + source: Dictionary, + options?: MixinOptions + ): LoDashWrapper; + + /** + * @see _.mixin + */ + mixin( + options?: MixinOptions + ): LoDashWrapper; + + /** + * @see _.set + */ + set( + path: StringRepresentable | StringRepresentable[], + value: any + ): LoDashWrapper; + + /** + * @see _.set + */ + set( + path: StringRepresentable | StringRepresentable[], + value: V + ): LoDashWrapper; + + /** + * @see _.find + */ + find( + predicate?: ListIterator, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.find + */ + find( + predicate?: string, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.find + */ + find( + predicate?: TObject + ): LoDashWrapper; + + /** + * @see _.find + */ + filter( + predicate?: TObject + ): LoDashWrapper; + + /** + * @see _.filter + */ + filter( + predicate?: ListIterator, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.filter + */ + filter( + predicate: string, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.filter + */ + filter( + predicate: ListIterator | DictionaryIterator, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.filter + */ + filter( + predicate?: StringIterator, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.filter + */ + filter(predicate: W): LoDashWrapper; + /** + * @see _.map + */ + map( + iteratee?: ListIterator, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.map + */ + map( + iteratee?: string + ): LoDashWrapper; + + /** + * @see _.map + */ + map( + iteratee?: TObject + ): LoDashWrapper; + /** + * @see _.map + */ + map( + iteratee?: ListIterator | DictionaryIterator, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.range + */ + range( + end?: number, + step?: number + ): LoDashWrapper; + + /** + * @see _.rangeRight + */ + rangeRight( + end?: number, + step?: number + ): LoDashWrapper; + + /** + * @see _.remove + */ + remove( + predicate?: ListIterator, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.remove + */ + remove( + predicate?: string, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.remove + */ + remove( + predicate?: W + ): LoDashWrapper; + + /** + * @see _.sortBy + */ + sortBy( + iteratee?: ListIterator + ): LoDashWrapper; + + /** + * @see _.sortBy + */ + sortBy(iteratee: string): LoDashWrapper; + + /** + * @see _.sortBy + */ + sortBy(whereValue: W): LoDashWrapper; + + /** + * @see _.sortBy + */ + sortBy(): LoDashWrapper; + + /** + * @see _.sortBy + */ + sortBy(...iteratees: (ListIterator | Object | string)[]): LoDashWrapper; + + /** + * @see _.sortBy + */ + sortBy(iteratees: (ListIterator | string | Object)[]): LoDashWrapper; + + /** + * @see _.slice + */ + slice( + start?: number, + end?: number + ): LoDashWrapper; + + /** + * @see _.size + */ + size(): LoDashWrapper; + + /** + * @see _.take + */ + take(n?: number): LoDashWrapper; + + /** + * @see _.times + */ + times( + iteratee: (num: number) => TResult + ): LoDashWrapper; + + /** + * @see _.times + */ + times(): LoDashWrapper; + + /** + * @see _.uniqueId + */ + uniqueId(): LoDashWrapper; + + value(): T; + + pop(): T; + push(...items: T[]): LoDashWrapper; + shift(): T; + sort(compareFn?: (a: T, b: T) => number): LoDashWrapper; + splice(start: number): LoDashWrapper; + splice(start: number, deleteCount: number, ...items: any[]): LoDashWrapper; + unshift(...items: T[]): LoDashWrapper; + } + + interface Storage { + /** + * Reads the database. + * + * @param source The source location. + * @param deserialize The deserialize function to apply. + * @return Returns a promise with the deserialized db object. + */ + read?(source: string, deserialize: any): PromiseLike + /** + * Reads the database. + * + * @param source The source location. + * @param deserialize The deserialize function to apply. + * @return Returns the deserialized db object. + */ + read?(source: string, deserialize: any): Object + /** + * Writes to the database. + * + * @param destination The destination location. + * @param obj The object to write. + * @param serialize The serialize function to apply. + */ + write?(destination: string, obj: any, serialize: any): void + /** + * Writes to the database. + * + * @param destination The destination location. + * @param obj The object to write. + * @param serialize The serialize function to apply. + */ + write?(destination: string, obj: any, serialize: any): PromiseLike + } + + interface Format { + /** + * Writes to the database. + * + * @param obj The object to serialize. + * @return Returns the serialized object string. + */ + serialize(obj: Object): string + /** + * Writes to the database. + * + * @param data The object to deserialize. + * @return Returns the deserialized object. + */ + deserialize(data: string): Object + } + + interface Options { + /** + * The custom "storage" object. + */ + storage?: Storage + /** + * The custom "format" object. + */ + format?: Format + /** + * The flag to automatically persist changes. + */ + writeOnChange?: boolean + } + + export interface Low extends LoDashWrapper, Format { + /** + * Access current database state. + * Returns Returns the database state. + */ + getState(): Object + /** + * Drop or reset database state. + * @param newState New state of the database + */ + setState(newState: Object): void + /** + * Persist database. + * @param source The source location. + */ + write(source: string): void + /** + * Persist database. + * @param source The source location. + */ + write(source: string): PromiseLike + /** + * Read database. + * @param source The source location. + */ + read(source?: string): Object + /** + * Read database. + * @param source The source location. + */ + read(source?: string): PromiseLike + } + +// declare class lowdb { +// new (source?: string, opts?: Options): Low; +// (source?: string, opts?: Options) : Low; +// } + +// declare module "lowdb" { +// export = lowdb; +// } + +} + diff --git a/lowdb/lowdb-tests.ts b/lowdb/lowdb-tests.ts new file mode 100644 index 0000000000..d656c63b62 --- /dev/null +++ b/lowdb/lowdb-tests.ts @@ -0,0 +1,12 @@ +import Lowdb = require('lowdb'); + +Lowdb +let db = new Lowdb(); + +db.defaults({ 'someObject': {}, 'anotherObject': {} }).value(); + +db.get('someObject').set('foo' , 'bar').value(); +db.get('anotherObject').set('foo' , 'bar').value(); +db.set('singleValue', 'foo').value(); + +console.log(db.getState()); diff --git a/lowdb/tsconfig.json b/lowdb/tsconfig.json new file mode 100644 index 0000000000..4a6104842c --- /dev/null +++ b/lowdb/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "lowdb-tests.ts" + ] +} \ No newline at end of file From 7a0e3cf5362f8f546f20d96574a66bb53a2473a5 Mon Sep 17 00:00:00 2001 From: Gilbert Date: Thu, 16 Feb 2017 11:13:03 +0100 Subject: [PATCH 100/797] updated jasmine-expect matchers + assymetric matchers. --- jasmine-expect/index.d.ts | 221 ++++++++++++++++++++++++-------------- 1 file changed, 141 insertions(+), 80 deletions(-) diff --git a/jasmine-expect/index.d.ts b/jasmine-expect/index.d.ts index c2ee7e0ee5..f8dbc54f56 100644 --- a/jasmine-expect/index.d.ts +++ b/jasmine-expect/index.d.ts @@ -1,93 +1,154 @@ -// Type definitions for jasmine-expect 2.0 +// Type definitions for jasmine-expect 3.6.0 // Project: https://github.com/JamieMason/Jasmine-Matchers -// Definitions by: UserPixel +// Definitions by: GeneralCss // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 /// declare namespace jasmine { - interface Matchers { - // These functions are written in the order defined in the src directory of jasmine-matchers - // The type system is used smartly whenever it can provide value (by looking at the code of every matcher) - toBeAfter(otherDate: Date): boolean; // - toBeArray(): boolean; // - toBeArrayOfBooleans(): boolean; // - toBeArrayOfNumbers(): boolean; - toBeArrayOfObjects(): boolean; - toBeArrayOfSize(size: number): boolean; - toBeArrayOfStrings(): boolean; - toBeBefore(otherDate: Date): boolean; // - toBeBoolean(): boolean; - toBeCalculable(): boolean; - toBeDate(): boolean; - toBeEmptyArray(): boolean; - toBeEmptyObject(): boolean; - toBeEmptyString(): boolean; - toBeEvenNumber(): boolean; - toBeFalse(): boolean; - toBeFunction(): boolean; - toBeHtmlString(): boolean; - toBeIso8601(): boolean; - toBeJsonString(): boolean; - toBeLongerThan(other: string): boolean; - toBeNonEmptyArray(): boolean; - toBeNonEmptyObject(): boolean; - toBeNonEmptyString(): boolean; - toBeNumber(): boolean; - toBeObject(): boolean; - toBeOddNumber(): boolean; - toBeSameLengthAs(other: string): boolean; - toBeShorterThan(other: string): boolean; - toBeString(): boolean; - toBeTrue(): boolean; - toBeWhitespace(): boolean; - toBeWholeNumber(): boolean; - toBeWithinRange(floor: number, ceiling: number): boolean; + interface Matchers { + // toBe + toBeArray(): boolean; + toBeArrayOfBooleans(): boolean; + toBeArrayOfNumbers(): boolean; + toBeArrayOfObjects(): boolean; + toBeArrayOfSize(): boolean; + toBeArrayOfStrings(): boolean; + toBeEmptyArray(): boolean; + toBeNonEmptyArray(): boolean; - toEndWith(subString: string): boolean; + // Booleans + toBeBoolean(): boolean; + toBeFalse(): boolean; + toBeTrue(): boolean; - toHaveArray(key: string): boolean; - toHaveArrayOfBooleans(key: string): boolean; - toHaveArrayOfNumbers(key: string): boolean; - toHaveArrayOfObjects(key: string): boolean; - toHaveArrayOfSize(key: string, size?: number): boolean; - toHaveArrayOfStrings(key: string): boolean; - toHaveBoolean(key: string): boolean; - toHaveCalculable(key: string): boolean; - toHaveDate(key: string): boolean; - toHaveDateAfter(key: string, otherDate: Date): boolean; - toHaveDateBefore(key: string, otherDate: Date): boolean; - toHaveEmptyArray(key: string): boolean; - toHaveEmptyObject(key: string): boolean; - toHaveEmptyString(key: string): boolean; - toHaveEvenNumber(key: string): boolean; - toHaveFalse(key: string): boolean; - toHaveHtmlString(key: string): boolean; - toHaveIso8601(key: string): boolean; - toHaveJsonString(key: string): boolean; - toHaveMember(key: string): boolean; - toHaveMethod(key: string): boolean; - toHaveNonEmptyArray(key: string): boolean; - toHaveNonEmptyObject(key: string): boolean; - toHaveNonEmptyString(key: string): boolean; - toHaveNumber(key: string): boolean; - toHaveNumberWithinRange(key: string, floor: number, ceiling: number): boolean; - toHaveObject(key: string): boolean; - toHaveOddNumber(key: string): boolean; - toHaveString(key: string): boolean; - toHaveStringLongerThan(key: string, other: string): boolean; - toHaveStringSameLengthAs(key: string, other: string): boolean; - toHaveStringShorterThan(key: string, other: string): boolean; - toHaveTrue(key: string): boolean; - toHaveWhitespaceString(key: string): boolean; - toHaveWholeNumber(key: string): boolean; + // Dates + toBeAfter(date: Date): boolean + toBeBefore(date: Date): boolean + toBeDate(): boolean; + toBeValidDate(): boolean; - toImplement(api: {}): boolean; + // Functions + toBeFunction(): boolean; + toThrowAnyError(): boolean; + toThrowErrorOfType(constructorName: string): boolean - toStartWith(subString: string): boolean; + // Numbers + toBeCalculable(): boolean; + toBeEvenNumber(): boolean; + toBeGreaterThanOrEqualTo(number: number): boolean; + toBeLessThanOrEqualTo(number: number): boolean; + toBeNear(number: number, epsilon: number): boolean; + toBeNumber(): boolean; + toBeOddNumber(): boolean + toBeWholeNumber(): boolean; + toBeWithinRange(floor: number, ceiling: number): boolean; - toThrowAnyError(): boolean; - toThrowErrorOfType(type: string): boolean; - } + // Strings + toBeEmptyString(): boolean; + toBeHtmlString(): boolean; + toBeIso8601(): boolean; + toBeJsonString(): boolean; + toBeLongerThan(): boolean; + toBeNonEmptyString(): boolean; + toBeSameLengthAs(): boolean; + toBeShorterThan(): boolean; + toBeString(): boolean; + toBeWhitespace(): boolean; + toEndWith(): boolean; + toStartWith(): boolean; + + // Objects + toBeEmptyObject(): boolean; + toBeNonEmptyObject(): boolean; + toBeObject(): boolean; + + // Regular Expression + toBeRegExp(): boolean; + + // Members, Properties, Methods + toHaveArray(memberName: string): boolean; + toHaveArrayOfBooleans(memberName: string): boolean; + toHaveArrayOfNumbers(memberName: string): boolean; + toHaveArrayOfObjects(memberName: string): boolean; + toHaveArrayOfSize(memberName: string, size: number): boolean; + toHaveArrayOfStrings(memberName: string): boolean; + toHaveBoolean(memberName: string): boolean; + toHaveCalculable(memberName: string): boolean; + toHaveDate(memberName: string): boolean; + toHaveDateAfter(memberName: string, date: Date): boolean; + toHaveDateBefore(memberName: string, date: Date): boolean; + toHaveEmptyArray(memberName: string): boolean; + toHaveEmptyObject(memberName: string): boolean; + toHaveEmptyString(memberName: string): boolean; + toHaveEvenNumber(memberName: string): boolean; + toHaveFalse(memberName: string): boolean; + toHaveHtmlString(memberName: string): boolean; + toHaveIso8601(memberName: string): boolean; + toHaveJsonString(memberName: string): boolean; + toHaveMember(memberName: string): boolean; + toHaveMethod(memberName: string): boolean; + toHaveNonEmptyArray(memberName: string): boolean; + toHaveNonEmptyObject(memberName: string): boolean; + toHaveNonEmptyString(memberName: string): boolean; + toHaveNumber(memberName: string): boolean; + toHaveNumberWithinRange(memberName: string, floor: number, ceiling: number): boolean; + toHaveObject(memberName: string): boolean; + toHaveOddNumber(memberName: string): boolean; + toHaveString(memberName: string): boolean; + toHaveStringLongerThan(memberName: string, string: string): boolean; + toHaveStringSameLengthAs(memberName: string, string: string): boolean; + toHaveStringShorterThan(memberName: string, string: string): boolean; + toHaveTrue(memberName: string): boolean; + toHaveUndefined(memberName: string): boolean; + toHaveWhitespaceString(memberName: string): boolean; + toHaveWholeNumber(memberName: string): boolean; + } + + interface AssymetricMatchers { + + // Arrays + arrayOfBooleans(): boolean; + arrayOfNumbers(): boolean; + arrayOfObjects(): boolean; + arrayOfSize(number: number): boolean; + arrayOfStrings(): boolean; + emptyArray(): boolean; + nonEmptyArray(): boolean; + + // Dates + after(date: Date): boolean; + before(date: Date): boolean; + + // Numbers + calculable(): boolean; + evenNumber(): boolean; + greaterThanOrEqualTo(number: number): boolean; + lessThanOrEqualTo(number: number): boolean; + oddNumber(): boolean; + wholeNumber(): boolean; + withinRange(floor: number, ceiling: number): boolean; + + // Strings + endingWith(string: string): boolean; + iso8601(): boolean; + jsonString(): boolean; + longerThan(string: string): boolean; + nonEmptyString(string: string): boolean; + sameLengthAs(string: string): boolean; + shorterThan(string: string): boolean; + startingWith(string: string): boolean; + whitespace(): boolean; + + //Objects + emptyObject(): boolean; + nonEmptyObject(): boolean; + + // Regular expressions + regExp(): boolean; + } } + +declare var any: jasmine.AssymetricMatchers; + From d4f54ea6c1a9d2867081c71254012bc6b0d0b105 Mon Sep 17 00:00:00 2001 From: Gilbert Date: Thu, 16 Feb 2017 11:50:23 +0100 Subject: [PATCH 101/797] fixed failing tests. Did not add any new ones though --- jasmine-expect/index.d.ts | 12 ++++---- jasmine-expect/jasmine-expect-tests.ts | 38 ++------------------------ 2 files changed, 9 insertions(+), 41 deletions(-) diff --git a/jasmine-expect/index.d.ts b/jasmine-expect/index.d.ts index f8dbc54f56..1a37f8fbe7 100644 --- a/jasmine-expect/index.d.ts +++ b/jasmine-expect/index.d.ts @@ -13,7 +13,7 @@ declare namespace jasmine { toBeArrayOfBooleans(): boolean; toBeArrayOfNumbers(): boolean; toBeArrayOfObjects(): boolean; - toBeArrayOfSize(): boolean; + toBeArrayOfSize(size: number): boolean; toBeArrayOfStrings(): boolean; toBeEmptyArray(): boolean; toBeNonEmptyArray(): boolean; @@ -50,14 +50,14 @@ declare namespace jasmine { toBeHtmlString(): boolean; toBeIso8601(): boolean; toBeJsonString(): boolean; - toBeLongerThan(): boolean; + toBeLongerThan(string: string): boolean; toBeNonEmptyString(): boolean; - toBeSameLengthAs(): boolean; - toBeShorterThan(): boolean; + toBeSameLengthAs(string: string): boolean; + toBeShorterThan(string: string): boolean; toBeString(): boolean; toBeWhitespace(): boolean; - toEndWith(): boolean; - toStartWith(): boolean; + toEndWith(string: string): boolean; + toStartWith(string: string): boolean; // Objects toBeEmptyObject(): boolean; diff --git a/jasmine-expect/jasmine-expect-tests.ts b/jasmine-expect/jasmine-expect-tests.ts index 7753cc7381..d01595a171 100644 --- a/jasmine-expect/jasmine-expect-tests.ts +++ b/jasmine-expect/jasmine-expect-tests.ts @@ -873,9 +873,11 @@ describe('toHaveArrayOfSize', function() { describeToHaveArrayX('toHaveArrayOfSize', function() { describe('when number of expected items does not match', function() { it('should deny', function() { - expect({ + var xpToFail = expect; + xpToFail({ memberName: '' }).not.toHaveArrayOfSize('memberName'); + expect({ memberName: ['bar'] }).not.toHaveArrayOfSize('memberName', 0); @@ -1877,40 +1879,6 @@ describe('toHaveWholeNumber', function() { }); }); -describe('toImplement', function() { - describe('when invoked', function() { - describe('when subject IS an Object containing all of the supplied members', function() { - it('should confirm', function() { - expect({ - a: 1, - b: 2 - }).toImplement({ - a: 1, - b: 2 - }); - expect({ - a: 1, - b: 2 - }).toImplement({ - a: 1 - }); - }); - }); - describe('when subject is NOT an Object containing all of the supplied members', function() { - it('should deny', function() { - expect({ - a: 1 - }).not.toImplement({ - c: 3 - }); - expect(null).not.toImplement({ - a: 1 - }); - }); - }); - }); -}); - describe('toStartWith', function() { describe('when invoked', function() { describe('when subject is NOT an undefined or empty string', function() { From 189a51cd2c5ffbd8eca9e96c9c46dbb12a6a32d1 Mon Sep 17 00:00:00 2001 From: Anton Konev Date: Thu, 16 Feb 2017 16:26:39 +0300 Subject: [PATCH 102/797] 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 103/797] 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 43b04ba59f77456b44ae32e905f141b9420382a0 Mon Sep 17 00:00:00 2001 From: Yongliang Zhan Date: Thu, 16 Feb 2017 16:33:50 +0100 Subject: [PATCH 104/797] Add new method to add custom argument transformations Introduced in cucumber.js v2.0.0-rc.0 https://github.com/cucumber/cucumber-js/blob/master/CHANGELOG.md#new-features-3 --- cucumber/cucumber-tests.ts | 8 ++++++++ cucumber/index.d.ts | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/cucumber/cucumber-tests.ts b/cucumber/cucumber-tests.ts index 87089671ae..4df99f82f8 100644 --- a/cucumber/cucumber-tests.ts +++ b/cucumber/cucumber-tests.ts @@ -97,6 +97,14 @@ function StepSample() { } ) }); + cucumber.defineSupportCode(function(hook: cucumber.Hooks){ + hook.addTransform({ + captureGroupRegexps: ['red|blue|green'], + transformer: (arg: string) => arg, + typeName: 'color' + }); + }); + let fns : cucumber.SupportCodeConsumer[] = cucumber.getSupportCodeFns() cucumber.clearSupportCodeFns(); diff --git a/cucumber/index.d.ts b/cucumber/index.d.ts index 8c56e3aae4..cba6ecab24 100644 --- a/cucumber/index.d.ts +++ b/cucumber/index.d.ts @@ -64,6 +64,12 @@ declare namespace cucumber { (scenario: HookScenario, runScenario?: (error:string, callback?:Function)=>void): void; } + interface Transform { + captureGroupRegexps: Array; + transformer: (arg: string) => any; + typeName: string; + } + export interface Hooks { Before(code: HookCode): void; After(code: HookCode): void; @@ -72,6 +78,7 @@ declare namespace cucumber { setWorldConstructor(world: () => void): void; registerHandler(handlerOption:string, code:(event:any, callback:CallbackStepDefinition) =>void): void; registerListener(listener: EventListener): void; + addTransform(transform: Transform): void; } export class EventListener { From 01c7444ba550742becb93db5158b193d1430693e Mon Sep 17 00:00:00 2001 From: Yongliang Zhan Date: Thu, 16 Feb 2017 16:43:58 +0100 Subject: [PATCH 105/797] Change SupportCodeConsumer argument type from Union to Intersection Enables the usage of both Hooks and StepDefinitions under a single defineSupportCode call as in the official examples. --- cucumber/cucumber-tests.ts | 10 ++++++++++ cucumber/index.d.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/cucumber/cucumber-tests.ts b/cucumber/cucumber-tests.ts index 4df99f82f8..3eb86b223f 100644 --- a/cucumber/cucumber-tests.ts +++ b/cucumber/cucumber-tests.ts @@ -105,6 +105,16 @@ function StepSample() { }); }); + cucumber.defineSupportCode(function({After, Given}) { + Given( /^a variable set to (\d+)$/, (x:string) => { + console.log("the number is: " + x); + }); + After((scenario: HookScenario, callback?: Callback) => { + console.log("After"); + callback(); + }); + }); + let fns : cucumber.SupportCodeConsumer[] = cucumber.getSupportCodeFns() cucumber.clearSupportCodeFns(); diff --git a/cucumber/index.d.ts b/cucumber/index.d.ts index cba6ecab24..99f31c5372 100644 --- a/cucumber/index.d.ts +++ b/cucumber/index.d.ts @@ -215,7 +215,7 @@ declare namespace cucumber { } export interface SupportCodeConsumer { - (stepDefinitions:StepDefinitions | Hooks):void; + (stepDefinitions:StepDefinitions & Hooks):void; } export function defineSupportCode(consumer:SupportCodeConsumer): void; From ea24d85942496d27305c3cd6359d112329632386 Mon Sep 17 00:00:00 2001 From: Bastien Date: Thu, 16 Feb 2017 17:02:18 +0100 Subject: [PATCH 106/797] tmhDynamicLocaleService set() return promise --- angular-dynamic-locale/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular-dynamic-locale/index.d.ts b/angular-dynamic-locale/index.d.ts index 788c3ad87b..4ee0e6eb89 100644 --- a/angular-dynamic-locale/index.d.ts +++ b/angular-dynamic-locale/index.d.ts @@ -11,7 +11,7 @@ declare module 'angular' { export namespace dynamicLocale { interface tmhDynamicLocaleService { - set(locale: string): void; + set(locale: string): angular.IPromise; get(): string; } From 3479affcfe6394800fc3562be7461552c3ed1326 Mon Sep 17 00:00:00 2001 From: Yuya Tanaka Date: Wed, 15 Feb 2017 03:06:14 +0900 Subject: [PATCH 107/797] react: Fix SVGAttributes contains all HTMLAttributes --- react/index.d.ts | 21 +++++++++++++++++++-- react/test/index.ts | 3 +++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/react/index.d.ts b/react/index.d.ts index b2be91bf62..61b282dfc7 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -2203,7 +2203,25 @@ declare namespace React { // - "number | string" // - "string" // - union of string literals - interface SVGAttributes extends HTMLAttributes { + interface SVGAttributes extends DOMAttributes { + // Attributes which also defined in HTMLAttributes + // See comment in SVGDOMPropertyConfig.js + className?: string; + color?: string; + height?: number | string; + id?: string; + lang?: string; + max?: number | string; + media?: string; + method?: string; + min?: number | string; + name?: string; + style?: CSSProperties; + target?: string; + type?: string; + width?: number | string; + + // SVG Specific attributes accentHeight?: number | string; accumulate?: "none" | "sum"; additive?: "replace" | "sum"; @@ -2396,7 +2414,6 @@ declare namespace React { textRendering?: number | string; to?: number | string; transform?: string; - type?: string; u1?: number | string; u2?: number | string; underlinePosition?: number | string; diff --git a/react/test/index.ts b/react/test/index.ts index 4b00e988bf..702f1632c9 100644 --- a/react/test/index.ts +++ b/react/test/index.ts @@ -341,6 +341,9 @@ React.DOM.svg({ xmlns: "http://www.w3.org/2000/svg" }, React.DOM.rect({ + className: 'foobar', + id: 'foo', + color: 'black', x: 22, y: 10, width: 4, From a302f69580ad40511c18a61d5e8bcbdabcf4f16a Mon Sep 17 00:00:00 2001 From: Yuya Tanaka Date: Wed, 15 Feb 2017 04:30:20 +0900 Subject: [PATCH 108/797] react: Add type parameter to SVGProps --- react/index.d.ts | 108 +++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/react/index.d.ts b/react/index.d.ts index 61b282dfc7..867e066c7e 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -437,7 +437,7 @@ declare namespace React { interface ChangeTargetHTMLProps extends ChangeTargetHTMLAttributes, ClassAttributes { } - interface SVGProps extends SVGAttributes, ClassAttributes { + interface SVGProps extends SVGAttributes, ClassAttributes { } interface DOMAttributes { @@ -2810,60 +2810,60 @@ declare global { wbr: React.HTMLProps; // SVG - svg: React.SVGProps; + svg: React.SVGProps; - circle: React.SVGProps; - clipPath: React.SVGProps; - defs: React.SVGProps; - desc: React.SVGProps; - ellipse: React.SVGProps; - feBlend: React.SVGProps; - feColorMatrix: React.SVGProps; - feComponentTransfer: React.SVGProps; - feComposite: React.SVGProps; - feConvolveMatrix: React.SVGProps; - feDiffuseLighting: React.SVGProps; - feDisplacementMap: React.SVGProps; - feDistantLight: React.SVGProps; - feFlood: React.SVGProps; - feFuncA: React.SVGProps; - feFuncB: React.SVGProps; - feFuncG: React.SVGProps; - feFuncR: React.SVGProps; - feGaussianBlur: React.SVGProps; - feImage: React.SVGProps; - feMerge: React.SVGProps; - feMergeNode: React.SVGProps; - feMorphology: React.SVGProps; - feOffset: React.SVGProps; - fePointLight: React.SVGProps; - feSpecularLighting: React.SVGProps; - feSpotLight: React.SVGProps; - feTile: React.SVGProps; - feTurbulence: React.SVGProps; - filter: React.SVGProps; - foreignObject: React.SVGProps; - g: React.SVGProps; - image: React.SVGProps; - line: React.SVGProps; - linearGradient: React.SVGProps; - marker: React.SVGProps; - mask: React.SVGProps; - metadata: React.SVGProps; - path: React.SVGProps; - pattern: React.SVGProps; - polygon: React.SVGProps; - polyline: React.SVGProps; - radialGradient: React.SVGProps; - rect: React.SVGProps; - stop: React.SVGProps; - switch: React.SVGProps; - symbol: React.SVGProps; - text: React.SVGProps; - textPath: React.SVGProps; - tspan: React.SVGProps; - use: React.SVGProps; - view: React.SVGProps; + circle: React.SVGProps; + clipPath: React.SVGProps; + defs: React.SVGProps; + desc: React.SVGProps; + ellipse: React.SVGProps; + feBlend: React.SVGProps; + feColorMatrix: React.SVGProps; + feComponentTransfer: React.SVGProps; + feComposite: React.SVGProps; + feConvolveMatrix: React.SVGProps; + feDiffuseLighting: React.SVGProps; + feDisplacementMap: React.SVGProps; + feDistantLight: React.SVGProps; + feFlood: React.SVGProps; + feFuncA: React.SVGProps; + feFuncB: React.SVGProps; + feFuncG: React.SVGProps; + feFuncR: React.SVGProps; + feGaussianBlur: React.SVGProps; + feImage: React.SVGProps; + feMerge: React.SVGProps; + feMergeNode: React.SVGProps; + feMorphology: React.SVGProps; + feOffset: React.SVGProps; + fePointLight: React.SVGProps; + feSpecularLighting: React.SVGProps; + feSpotLight: React.SVGProps; + feTile: React.SVGProps; + feTurbulence: React.SVGProps; + filter: React.SVGProps; + foreignObject: React.SVGProps; + g: React.SVGProps; + image: React.SVGProps; + line: React.SVGProps; + linearGradient: React.SVGProps; + marker: React.SVGProps; + mask: React.SVGProps; + metadata: React.SVGProps; + path: React.SVGProps; + pattern: React.SVGProps; + polygon: React.SVGProps; + polyline: React.SVGProps; + radialGradient: React.SVGProps; + rect: React.SVGProps; + stop: React.SVGProps; + switch: React.SVGProps; + symbol: React.SVGProps; + text: React.SVGProps; + textPath: React.SVGProps; + tspan: React.SVGProps; + use: React.SVGProps; + view: React.SVGProps; } } } 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 109/797] 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 c66aab069131bbb933e5cc1ca9cd0f5fa9939939 Mon Sep 17 00:00:00 2001 From: Julien CROUZET Date: Thu, 16 Feb 2017 22:19:22 +0100 Subject: [PATCH 110/797] gettext.js definition --- gettext.js/gettext.js-tests.ts | 21 ++++++++++++++++ gettext.js/index.d.ts | 45 ++++++++++++++++++++++++++++++++++ gettext.js/tsconfig.json | 22 +++++++++++++++++ gettext.js/tslint.json | 1 + 4 files changed, 89 insertions(+) create mode 100644 gettext.js/gettext.js-tests.ts create mode 100644 gettext.js/index.d.ts create mode 100644 gettext.js/tsconfig.json create mode 100644 gettext.js/tslint.json diff --git a/gettext.js/gettext.js-tests.ts b/gettext.js/gettext.js-tests.ts new file mode 100644 index 0000000000..6e5b4448ae --- /dev/null +++ b/gettext.js/gettext.js-tests.ts @@ -0,0 +1,21 @@ +import * as Gettext from 'gettext.js'; + +const json: Gettext.JsonData = { + "": { + "locale": "fr", + "plural-forms": "nplurals=2; plural=n>1;" + }, + "Welcome": "Bienvenue", + "There is %1 apple": [ + "Il y a %1 pomme", + "Il y a %1 pommes" + ] +}; + +const instance: Gettext.Gettext = Gettext.i18n(); + +instance.loadJSON(json, 'messages'); +instance.setLocale('fr'); +if (instance.ngettext('There is %1 apple', 'There are %1 apples', 0) === 'Il y a %1 pomme') { + throw new Error('Failed test'); +} diff --git a/gettext.js/index.d.ts b/gettext.js/index.d.ts new file mode 100644 index 0000000000..5096490721 --- /dev/null +++ b/gettext.js/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for gettext.js 0.5 +// Project: https://github.com/guillaumepotier/gettext.js +// Definitions by: Julien Crouzet +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export type PluralForm = (n: number) => number; + +export type GettextStatic = (options?: GettextOptions) => Gettext; + +export interface GettextOptions { + domain?: string; + locale?: string; + plural_func?: PluralForm; + ctxt_delimiter?: string; +} + +export interface JsonDataHeader { + locale: string; + "plural-forms": string; +} + +export interface JsonDataMessages { + [key: string]: string | string[] | JsonDataHeader; +} + +export interface JsonData extends JsonDataMessages { + "": JsonDataHeader; +} + +export interface Gettext { + setMessages: (domain: string, locale: string, messages: JsonDataMessages, plural_forms?: PluralForm) => Gettext; + loadJSON: (jsonData: JsonData, domain?: string) => Gettext; + setLocale: (locale: string) => Gettext; + getLocale: () => string; + textdomain: (domain?: string) => Gettext | string; + gettext: (msgid: string, ...args: any[]) => string; + ngettext: (msgid: string, msgid_plural: string, n: number, ...args: any[]) => string; + pgettext: (msgctxt: string, msgid: string, ...args: any[]) => string; + dcnpgettext: (domain: string, msgctxt: string, msgid: string, msgid_plural: string, n: number, ...args: any[]) => string; + __: (msgid: string, ...args: any[]) => string; + _n: (msgid: string, msgid_plural: string, n: number, ...args: any[]) => string; + _p: (msgctxt: string, msgid: string, ...args: any[]) => string; +} + +export const i18n: GettextStatic; diff --git a/gettext.js/tsconfig.json b/gettext.js/tsconfig.json new file mode 100644 index 0000000000..d01ec061ab --- /dev/null +++ b/gettext.js/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", + "gettext.js-tests.ts" + ] +} diff --git a/gettext.js/tslint.json b/gettext.js/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/gettext.js/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file From 84c6b159fabb826b1caef2204199e5b444f84016 Mon Sep 17 00:00:00 2001 From: Baris Cicek Date: Fri, 17 Feb 2017 11:18:43 +0300 Subject: [PATCH 111/797] FIX: app.middleware, PersistedModel and Invalid Settings definitions FIX for app.middleware should have Handler istead of empty function, also settings in the built-in models are not array of ACLs which they should be. PersistedModel is also not extending Model. --- loopback/index.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/loopback/index.d.ts b/loopback/index.d.ts index 64aac97c92..6712c6ae3a 100644 --- a/loopback/index.d.ts +++ b/loopback/index.d.ts @@ -245,7 +245,7 @@ declare namespace l { * @header app.middleware(name, handler */ - middleware(name: string, paths?: any[]|string|RegExp, handler?: () => void): any; + middleware(name: string, paths?: any[]|string|RegExp, handler?: core.Handler): any; } // interface CookieOptions extends core.CookieOptions { } @@ -1060,7 +1060,7 @@ declare namespace l { * @class PersistedModel */ - class PersistedModel { + class PersistedModel extends Model { /** * Apply an update list @@ -1714,7 +1714,7 @@ declare namespace l { created: Date; /** Extends the `Model.settings` object. */ - settings: { http: { path: string }; acls: ACL, accessTokenIdLength: number}; + settings: { http: { path: string }; acls: ACL[], accessTokenIdLength: number}; /** * Create a cryptographically random access token id @@ -1811,7 +1811,7 @@ declare namespace l { principalId: string; /** settings Extends the `Model.settings` object. */ - settings: { http: { path: string }; acls: ACL, defaultPermission: 'DENY'}; + settings: { http: { path: string }; acls: ACL[], defaultPermission: 'DENY'}; /** * Check if the request has the permission to access. @@ -2098,7 +2098,7 @@ declare namespace l { * settings.ignoreErrors By default, when changes are rectified, an error will throw an exception. * However, if this setting is true, then errors will not throw exceptions. */ - settings: { http: { path: string }; acls: ACL; hashAlgorithm: string; ignoreErrors: boolean; }; + settings: { http: { path: string }; acls: ACL[]; hashAlgorithm: string; ignoreErrors: boolean; }; /** * Are both changes deletes? @@ -2771,7 +2771,7 @@ declare namespace l { * settings.saltWorkFactor The `bcrypt` salt work factor. Default is `10`. * settings.caseSensitiveEmail Enable case sensitive email. */ - settings: { http: { path: string }; acls: ACL; emailVerificationRequired: boolean; ttl: number; maxTTL: number; realmRequired: boolean; realmDelimiter: string; resetPasswordTokenTTL: number; saltWorkFactor: number; caseSensitiveEmail: boolean; }; + settings: { http: { path: string }; acls: ACL[]; emailVerificationRequired: boolean; ttl: number; maxTTL: number; realmRequired: boolean; realmDelimiter: string; resetPasswordTokenTTL: number; saltWorkFactor: number; caseSensitiveEmail: boolean; }; /** * Confirm the user's identity From 05f99bc119f75b94ce2dabf4cf17c6f7f336dde8 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 14:45:56 +0530 Subject: [PATCH 112/797] tslint.json added. --- ej.web.all/tsconfig.json | 2 +- ej.web.all/tslint.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 ej.web.all/tslint.json diff --git a/ej.web.all/tsconfig.json b/ej.web.all/tsconfig.json index 3a1cd27967..0594221ccb 100644 --- a/ej.web.all/tsconfig.json +++ b/ej.web.all/tsconfig.json @@ -12,7 +12,7 @@ "typeRoots": [ "../" ], - "types": [], + "types": ["jquery"], "noEmit": true, "forceConsistentCasingInFileNames": true }, diff --git a/ej.web.all/tslint.json b/ej.web.all/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/ej.web.all/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file From 654fdfc0acfeba628bf08c0dc18a2b776ca65c52 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 14:54:14 +0530 Subject: [PATCH 113/797] tsconfig.json updated. --- ej.web.all/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ej.web.all/tsconfig.json b/ej.web.all/tsconfig.json index 0594221ccb..3a1cd27967 100644 --- a/ej.web.all/tsconfig.json +++ b/ej.web.all/tsconfig.json @@ -12,7 +12,7 @@ "typeRoots": [ "../" ], - "types": ["jquery"], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, From 1f6493eb91b4d9bce9f157dc3afeaf69c432500a Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 15:11:15 +0530 Subject: [PATCH 114/797] index.d.ts updated --- ej.web.all/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 975a5baa70..009dd3b762 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1,3 +1,5 @@ +/* tslint:disable */ + // Type definitions for ej.web.all 15.1.33 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion From ae79c4c69545fefabfa6fbbe995b182f9f98d8e8 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 15:22:54 +0530 Subject: [PATCH 115/797] index.d.ts updated. --- ej.web.all/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 009dd3b762..5fd0c7b4dd 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1,5 +1,6 @@ /* tslint:disable */ + // Type definitions for ej.web.all 15.1.33 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion From 5db3349306cda486469bfba0d2e2cbc3f3483204 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 15:43:39 +0530 Subject: [PATCH 116/797] index.d.ts updated. --- ej.web.all/ej.web.all-tests.ts | 6479 ++++++++++++++++---------------- ej.web.all/tsconfig.json | 2 +- 2 files changed, 3240 insertions(+), 3241 deletions(-) diff --git a/ej.web.all/ej.web.all-tests.ts b/ej.web.all/ej.web.all-tests.ts index 294f52b097..57f6650a5b 100644 --- a/ej.web.all/ej.web.all-tests.ts +++ b/ej.web.all/ej.web.all-tests.ts @@ -1,3240 +1,3239 @@ -/// -/// - - - - -module AccordionComponent { - $(function () { - var sample = new ej.Accordion($("#basicAccordion"), { - width: "100%", - allowKeyboardNavigation: true, - collapseSpeed: 500, - collapsible: true, - enableAnimation: true, - enableMultipleOpen: true, - events: "click", - expandSpeed: 500, - headerSize: "40px", - htmlAttributes: { title: "Demo" }, - selectedItemIndex: 1, - showCloseButton: true, - showRoundedCorner: true - }); - }); -} - - - -module AutocompleteComponent{ - var carList = [ - "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", - "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", - "Chevrolet Camaro", "Cadillac", - "Duesenberg J", "Dodge Sprinter", - "Elantra", "Excavator", - "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", - "GAZ Siber", - "Honda S2000", "Hyundai Santro", - "Isuzu Swift", "Infiniti Skyline", - "Jaguar XJS", - "Kia Sedona EX", "Koenigsegg Agera", - "Lotus Esprit", "Lamborghini Diablo", - "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", - "Nissan Qashqai", - "Oldsmobile S98", "Opel Superboss", - "Porsche 356", "Pontiac Sunbird", - "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", - "Triumph Spitfire", "Toyota 2000GT", - "Volvo P1800", "Volkswagen Shirako" - ]; - $(function () { - var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { - width: "100%", - watermarkText: "Select a car", - dataSource: carList, - enableAutoFill: true, - showPopupButton: true, - multiSelectMode: "delimiter" - }); - }); -} - - - - - -module Barcodecomponent { - $(function () { - var barcodesample = new ej.datavisualization.Barcode($("#Barcode"), { - text:"http://www.syncfusion.com" - }); - }); -} - - - - - -module Bulletgraphcomponent { - $(function () { - var bulletsample = new ej.datavisualization.BulletGraph($("#BulletGraph"), { - isResponsive: true, - tooltipSettings: { visible: true }, - quantitativeScaleSettings: { - featureMeasures: [{ - value: 8, comparativeMeasureValue:6.7 - }] - }, - qualitativeRanges: [{ - rangeEnd: 4.3, rangeStroke:"#ebebeb", - }, - { - rangeEnd: 7.3, rangeStroke:"#d8d8d8" - }, - { - rangeEnd: 10, rangeStroke: "#7f7f7f" - } - ], - captionSettings: { - textPosition: 'right', text: 'Revenue YTD', - subTitle: { - text: "$ in Thousands", textPosition:"right" - } - } - }); - }); -} - - - - - -module ButtonComponent { - $(function () { - var basicButton = new ej.Button($("#buttonnormal"), { - size: "large", - showRoundedCorner: true, - contentType: "textandimage", - prefixIcon: "e-icon e-save", - text: "Save" - }); - var toggleButton = new ej.ToggleButton($("#TextOnly"), { - showRoundedCorner: true, - size: "large", - contentType: "textandimage", - defaultPrefixIcon: "e-icon e-save", - activePrefixIcon: "e-icon e-delete", - defaultText: "Save", - activeText: "Delete" - }); - var splitbuttonnormal = new ej.SplitButton($("#splitbuttonnormal"), { - showRoundedCorner: true, - size: "large", - prefixIcon: "e-icon e-file-empty", - targetID: "menu1", - contentType: "textandimage", - text: "File" - }); - var groupButton = new ej.GroupButton($("#groupButton"), { - showRoundedCorner: true, - size: "large" - }); - var check1 = new ej.CheckBox($("#check1"), { - size: "medium", enableTriState: true - }); - var check2 = new ej.CheckBox($("#check2"), { - size: "medium", enableTriState: true - }); - var radio1 = new ej.RadioButton($("#radio1"), { - size: "medium" - }); - var radio2 = new ej.RadioButton($("#radio2"), { - size: "medium", checked: true - }); - }); -} - - - - -module ChartComponent { - $(function () { - var chartsample = new ej.datavisualization.Chart($("#Chart"), { - primaryXAxis: { - range: { min: 2005, max: 2011, interval: 1 }, - title: { text: "Year" }, - valueType: "category" - }, - primaryYAxis: { - range: { min: 25, max: 50, interval: 5 }, - labelFormat: "{value}%", - title: { text: "Efficiency" }, - - }, - commonSeriesOptions: - { - type: 'line', enableAnimation: true, - tooltip:{ visible :true, template:'Tooltip'}, - marker: - { - shape: 'circle', - size: - { - height: 10, width: 10 - }, - visible: true - }, - border : {width: 2} - }, - series: - [ - { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], - name: 'India' - }, - { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], - name: 'Germany' - }, - { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], - name: 'England' - }, - { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], - name: 'France' - } - ], - isResponsive: true, - load: function () { - var sender = $("#Chart").data("ejChart"); - if (!!window.orientation && sender) { //to modify chart properties for mobile view - var model = sender.model, - seriesLength = model.series.length; - model.legend.visible = false; - model.size.height = null; - model.size.width = null; - for (var i = 0; i < seriesLength; i++) { - if (!model.series[i].marker) - model.series[i].marker = {}; - if (!model.series[i].marker.size) - model.series[i].marker.size = {}; - model.series[i].marker.size.width = 6; - model.series[i].marker.size.height = 6; - } - model.primaryXAxis.labelIntersectAction = "rotate45"; - if (model.primaryXAxis.title) - model.primaryXAxis.title.text = ""; - if (model.primaryYAxis.title) - model.primaryYAxis.title.text = ""; - model.primaryXAxis.edgeLabelPlacement = "hide"; - model.primaryYAxis.labelIntersectAction = "rotate45"; - model.primaryYAxis.edgeLabelPlacement = "hide"; - } - }, - title: { text: 'Efficiency of oil-fired power production' }, - size: { height: "600" }, - legend: { visible: true} - }); - }); -} - - - - - -module circulargaugecomponent { - $(function () { - var circularsample = new ej.datavisualization.CircularGauge($("#CircularGauge"), { - enableAnimation: false, - isResponsive: true, - backgroundColor: "transparent", width: 500, - scales: [{ - showRanges: true, - startAngle: 122, sweepAngle: 296, radius: 130, showScaleBar: true, size: 1, maximum: 120, majorIntervalValue: 20, minorIntervalValue: 10, - border: { - width: 0.5, - }, - pointers: [{ - value: 60, - showBackNeedle: true, - backNeedleLength: 20, - length: 95, - width: 7 - }], - ticks: [{ - type: "major", - distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, { type: "minor", height: 8, width: 1, distanceFromScale: 2, color: "#8c8c8c" }], - labels: [{ - color: "#8c8c8c" - }], - ranges: [{ - distanceFromScale: -30, - startValue: 0, - endValue: 70 - }, { - distanceFromScale: -30, - startValue: 70, - endValue: 110, - backgroundColor: "#fc0606", - border: { color: "#fc0606" } - }, - { - distanceFromScale: -30, - startValue: 110, - endValue: 120, - backgroundColor: "#f5b43f", - border: { color: "#f5b43f" } - }] - }] - }); - }); -} - - - - -module ColorPickerComponent { - $(function () { - var colorSample = new ej.ColorPicker($("#colorpick"), { - value: "#278787" - }); - }); -} - - - - -module DatePickerComponent { - $(function () { - var dateSample = new ej.DatePicker($("#datepick"), { - width: "100%" - }); - }); -} - - - - -module DateTimePickerComponent { - $(function () { - var datetimeSample = new ej.DateTimePicker($("#datetimepick"), { - width: "100%" - }); - }); -} - - - -$(function () { - var diagram = new ej.datavisualization.Diagram($("#diagram"), { - width: "1000px", - height: "600px", - pageSettings: { - //Sets page size - pageHeight: 500, - pageWidth: 500, - //Customizes the appearance of page - pageBorderWidth: 4, - pageBackgroundColor: "white", - pageBorderColor: "lightgray", - pageMargin: 25, - showPageBreak: true, - multiplePage: true, - pageOrientation: ej.datavisualization.Diagram.PageOrientations.Portrait - }, - scrollSettings: { - horizontalOffset: 0, - verticalOffset: 0 - }, - snapSettings: { - snapConstraints: ej.datavisualization.Diagram.SnapConstraints.ShowLines - }, - nodes: [ - createNode({ name: "NewIdea", width: 150, height: 60, offsetX: 300, offsetY: 60, labels: [createLabel({ "text": "New idea identified" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Terminator }), - createNode({ name: "Meeting", width: 150, height: 60, offsetX: 300, offsetY: 155, labels: [createLabel({ "text": "Meeting with board" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), - createNode({ - name: "BoardDecision", width: 150, height: 110, offsetX: 300, offsetY: 280, labels: [createLabel({ text: "Board decides \nwhether \nto proceed", wrapText: "true", "margin": { left: 20, top: 0, right: 20, bottom: 0 } })], - type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision - }), - createNode({ name: "Project", width: 150, height: 100, offsetX: 300, offsetY: 430, labels: [createLabel({ "text": "Find Project \nmanager" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision }), - createNode({ - name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), - createNode({ name: "Decision", width: 250, height: 60, offsetX: 550, offsetY: 60, labels: [createLabel({ "text": "Decision Process for new software ideas" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Card, fillColor: "#858585", borderColor: "#858585" }), - createNode({ name: "Reject", width: 150, height: 60, offsetX: 550, offsetY: 285, labels: [createLabel({ "text": "Reject and write report" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), - createNode({ name: "Resources", width: 150, height: 60, offsetX: 550, offsetY: 430, labels: [createLabel({ "text": "Hire new resources" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }) - ], - connectors: [ - createConnector({ name: "connector1", sourceNode: "NewIdea", targetNode: "Meeting" }), - createConnector({ name: "connector2", sourceNode: "Meeting", targetNode: "BoardDecision" }), - createConnector({ name: "connector3", sourceNode: "BoardDecision", targetNode: "Project", labels: [createLabel({ "text": "Yes" })] }), - createConnector({ name: "connector4", sourceNode: "Project", targetNode: "End", labels: [createLabel({ "text": "Yes" })] }), - createConnector({ name: "connector5", sourceNode: "BoardDecision", targetNode: "Reject", labels: [createLabel({ "text": "No" })] }), - createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) - ] - }); - -}); - -function createNode(option: ej.datavisualization.Diagram.Node) { - if (!option.fillColor) { - option.borderColor = "#1BA0E2"; - option.fillColor = "#1BA0E2"; - } - option.labels[0].fontColor = "white"; - return option; -} - -function createConnector(option: ej.datavisualization.Diagram.Connector) { - option.targetDecorator = { shape: ej.datavisualization.Diagram.DecoratorShapes.Arrow, borderColor: "#606060", width: 10, height: 10 }; - option.lineColor = "#606060"; - if (option.labels && option.labels.length > 0) { - option.labels[0].fillColor = "white"; - } - return option; -} - -function createLabel(options : any) { - return options; -} - - - -module DialogComponent { - $(function () { - var dialogInstance = new ej.Dialog($("#basicDialog"), { - width: 550, - minWidth: 310, - minHeight: 215, - target:".control", - close:()=>{ - $("#btnOpen").show();} - }); - var btnInstance = new ej.Button($("#btnOpen"), { - size: "medium", - click: ()=>{ - $("#btnOpen").hide(); - $("#basicDialog").ejDialog("open");}, - type: "button", - height: 30, - width: 150 - }); - }); -} - - - - -module digitalgaugecomponent { - $(function () { - var digitalgaugesample = new ej.datavisualization.DigitalGauge($("#DigitalGauge"), { - width: 525, - height: 305, - isResponsive: true, - items: [{ - segmentSettings: { - width: 1, - spacing: 0, - color: "#8c8c8c" - }, - characterSettings: { - opacity: 0.8, - }, - value: "Syncfusion", - position: { x: 52, y: 52 } - }] - }); - }); -} - - - - - - -module DropDownListComponent { - var BikeList = [ - { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, - { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, - { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, - { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } - ]; - $(function () { - var sample = new ej.DropDownList($("#bikeList"),{ - dataSource: BikeList, - width: "100%", - watermarkText: "Select a bike", - fields: { id: "empid", text: "text", value: "text" }, - enableFilterSearch: true, - caseSensitiveSearch: true, - enableIncrementalSearch: true, - enablePopupResize: true, - delimiterChar: ";", - multiSelectMode: ej.MultiSelectMode.Delimiter, - maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", - minPopupWidth: "350px", - showCheckbox: true, - showRoundedCorner: true - }); - }); - -} - - - - - - -module ExplorerComponent { - $(function () { - var file = new ej.FileExplorer($("#fileExplorer"), { - path: (window).baseurl + "Content/FileBrowser/", - width: "100%", - minWidth: "150px", - layout: "tile", - isResponsive: true, - ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" - }); - }); -} - - - - -module GanttComponent { - $(function () { - var ganttInstance = new ej.Gantt($("#GanttContainer"), { - dataSource: (window).projectData, - allowColumnResize: true, - allowSorting: true, - allowSelection: true, - enableContextMenu: true, - taskIdMapping: "taskID", - allowDragAndDrop: true, - taskNameMapping: "taskName", - startDateMapping: "startDate", - showColumnChooser: true, - showColumnOptions: true, - progressMapping: "progress", - durationMapping: "duration", - endDateMapping: "endDate", - childMapping: "subtasks", - scheduleStartDate: "02/01/2014", - scheduleEndDate: "04/09/2014", - //Resources mapping - resourceInfoMapping: "resourceId", - resourceNameMapping: "resourceName", - resourceIdMapping: "resourceId", - resources: (window).projectResources, - predecessorMapping: "predecessor", - showResourceNames: true, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add","edit","delete","update","cancel","indent","outdent","expandAll","collapseAll","search"] - }, - editSettings: { - allowEditing: true, - allowAdding: true, - allowDeleting: true, - allowIndent: true, - editMode: "cellEditing" - }, - sizeSettings: { - width: "100%", - height: "100%" - }, - dragTooltip: { showTooltip: true }, - showGridCellTooltip: true, - treeColumnIndex: 1, - isResponsive: true, - }); -}); -} - - - -module GridComponent { - $(function () { - var gridInstance = new ej.Grid($("#Grid"), { - dataSource: (window).gridData, - allowGrouping: true, - allowSorting: true, - allowMultiSorting: true, - enableAltRow: true, - allowPaging: true, - allowReordering: true, - allowResizing: true, - allowFiltering: true, - allowScrolling: true, - enableRowHover: true, - selectionType: "multiple", - selectionSettings: { enableToggle: true, selectionMode: ["row", "cell", "column"] }, - allowKeyboardNavigation: true, - editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, allowEditOnDblClick: true, showDeleteConfirmDialog: true }, - toolbarSettings: { showToolbar: true, toolbarItems: ["add", "edit", "delete", "update", "cancel", "search"] }, - columns: [ - { field: "OrderID", headerText: "Order ID", isPrimaryKey: true, width: 75, textAlign: ej.TextAlign.Right }, - { field: "CustomerID", headerText: "Customer ID", editType: ej.Grid.EditingType.String, width: 80 }, - { field: "EmployeeID", headerText: "Employee ID", width: 75, editType: ej.Grid.EditingType.Dropdown, textAlign: ej.TextAlign.Right, priority: 4 }, - { field: "Freight", width: 75, format: "{0:C}", editType: ej.Grid.EditingType.Numeric, textAlign: ej.TextAlign.Right, priority: 3 }, - { field: "OrderDate", headerText: "Order Date", width: 80, format: "{0:MM/dd/yyyy}", textAlign: ej.TextAlign.Right, priority: 2 }, - { field: "ShipCity", headerText: "Ship City", editType: ej.Grid.EditingType.Dropdown, width: 110, priority: 2 } - ], - isResponsive: true, - minWidth: 700, - showSummary: true, - summaryRows: [{ title: "Sum", summaryColumns: [{ summaryType: ej.Grid.SummaryType.Sum, displayColumn: "Freight", dataMember: "Freight", format: "{0:C2}" }] }] - }); - }); -} - - - -var columns = ["Vegie-spread", "Tofuaa", "Alice Mutton", "Konbu", "Fløtemysost"] -var itemSource: any[] = []; -for (var i = 0; i < columns.length; i++) { - for (var j = 0; j < 6; j++) { - var value = Math.floor((Math.random() * 100) + 1); - itemSource.push({ ProductName: columns[i], Year: "Y" + (2011 + j), Value: value }) - } -} - -$(function () { - var heatmap = new ej.datavisualization.HeatMap($("#heatmap"), { - colorMappingCollection: [ - { value: 0, color: "#8ec8f8", label: { text: "0" } }, - { value: 100, color: "#0d47a1", label: { text: "100" } } - ], - isResponsive: true, - itemsSource: itemSource, - width: "100%", - itemsMapping: { - column: { propertyName: "ProductName", displayName: "Product Name" }, - row: { propertyName: "Year", displayName: "Year" }, - value: { propertyName: "Value" }, - columnMapping: [ - { "propertyName": columns[0], "displayName": columns[0] }, - { "propertyName": columns[1], "displayName": columns[1] }, - { "propertyName": columns[2], "displayName": columns[2] }, - { "propertyName": columns[3], "displayName": columns[3] }, - { "propertyName": columns[4], "displayName": columns[4] }, - { "propertyName": columns[5], "displayName": columns[5] } - ], - headerMapping: { propertyName: "Year", displayName: "Year", columnStyle: { width: 105, textAlign: "right" } }, - }, - legendCollection: ["heatmap_legend"] - }); - var heatmaplegend = new ej.datavisualization.HeatMapLegend($("#heatmap_legend"), { - colorMappingCollection: [ - { value: 0, color: "#8ec8f8", label: { text: "0" } }, - { value: 100, color: "#0d47a1", label: { text: "100" } } - ], - height: "50px", - width: "75%", - isResponsive: true - }); -}); - - - - -declare var window:myWindow; -export interface myWindow extends Window{ -kanbanData:any; -} -module KanbanComponent { - $(function () { - var sample = new ej.Kanban($("#Kanban"), { - dataSource: new ej.DataManager(window["kanbanData"]).executeLocal(new ej.Query().take(20)), - columns: [ - { headerText: "Backlog", key: "Open" }, - { headerText: "In Progress", key: "InProgress" }, - { headerText: "Testing", key: "Testing" }, - { headerText: "Done", key: "Close" } - ], - keyField: "Status", - allowTitle: true, - fields: { - content: "Summary", - primaryKey: "Id", - imageUrl: "ImgUrl" - }, - allowSelection: false - }); - }); -} - - - - -module lineargaugecomponent { - $(function () { - var linearsample = new ej.datavisualization.LinearGauge($("#LinearGauge"), { - labelColor: "#8c8c8c", width: 500, - isResponsive: true, enableAnimation: false, - scales: [{ - width: 4, border: { color: "transparent", width: 0 }, showBarPointers: false, showRanges: true, length: 310, - position: { x: 52, y: 50 }, markerPointers: [{ - value: 50, length: 10, width: 10, backgroundColor: "#4D4D4D", border: { color: "#4D4D4D" } - }], - labels: [{ font: { size: "11px", fontFamily: "Segoe UI", fontStyle: "bold" }, distanceFromScale: { x: -13 } }], - ticks: [{ type: "majorinterval", width: 1, color: "#8c8c8c" }], - ranges: [{ - endValue: 60, - startValue: 0, - backgroundColor: "#F6B53F", - border: { color: "#F6B53F" }, startWidth: 4, endWidth: 4 - }, { - endValue: 100, - startValue: 60, - backgroundColor: "#E94649", - border: { color: "#E94649" }, startWidth: 4, endWidth: 4 - }] - }] - }); - }); -} - - - - - -module ListBoxComponent { - $(function () { - var listboxInstance = new ej.ListBox($("#selectcar"), { - showCheckbox: true - }); - }); -} - - - -module ListviewComponent { - $(function () { - var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, - width: 400 - }); - }); -} - - -var world_map= - { - "type": "FeatureCollection", - "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, - "features": [ - { "type": "Feature", "properties": { "admin": "Afghanistan", "name": "Afghanistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[61.21081709172573, 35.650072333309218], [62.230651483005879, 35.270663967422287], [62.984662306576588, 35.404040839167614], [63.193538445900337, 35.857165635718907], [63.982895949158696, 36.007957465146596], [64.546479119733888, 36.31207326918426], [64.746105177677393, 37.111817735333297], [65.588947788357828, 37.305216783185628], [65.745630731066811, 37.661164048812061], [66.217384881459324, 37.393790188133913], [66.518606805288655, 37.362784328758785], [67.075782098259609, 37.35614390720928], [67.829999627559502, 37.144994004864678], [68.135562371701369, 37.023115139304302], [68.859445835245921, 37.344335842430588], [69.196272820924364, 37.15114350030742], [69.518785434857946, 37.608996690413413], [70.116578403610319, 37.588222764632086], [70.270574171840124, 37.73516469985401], [70.376304152309274, 38.138395901027515], [70.806820509732873, 38.486281643216408], [71.348131137990251, 38.258905341132156], [71.239403924448155, 37.953265082341879], [71.541917759084768, 37.905774441065631], [71.448693475230229, 37.065644843080513], [71.84463829945058, 36.738171291646914], [72.193040805962383, 36.94828766534566], [72.636889682917271, 37.047558091778349], [73.260055779924983, 37.495256862938994], [73.948695916646486, 37.421566270490786], [74.980002475895404, 37.419990139305888], [75.158027785140902, 37.13303091078911], [74.575892775372964, 37.02084137628345], [74.067551710917812, 36.836175645488446], [72.920024855444453, 36.720007025696312], [71.846291945283909, 36.509942328429851], [71.262348260385735, 36.074387518857797], [71.498767938121077, 35.650563259415996], [71.613076206350698, 35.153203436822857], [71.115018751921625, 34.733125718722228], [71.156773309213449, 34.348911444632144], [70.881803012988385, 33.988855902638512], [69.93054324735958, 34.020120144175102], [70.323594191371583, 33.358532619758385], [69.687147251264847, 33.105498969041228], [69.262522007122541, 32.501944078088293], [69.317764113242546, 31.901412258424436], [68.926676873657655, 31.620189113892064], [68.556932000609308, 31.713310044882011], [67.792689243444769, 31.582930406209623], [67.683393589147457, 31.303154201781414], [66.938891229118454, 31.304911200479346], [66.38145755398601, 30.738899237586448], [66.346472609324408, 29.88794342703617], [65.046862013616092, 29.472180691031902], [64.350418735618504, 29.560030625928089], [64.148002150331237, 29.340819200145965], [63.550260858011164, 29.468330796826162], [62.549856805272775, 29.318572496044304], [60.874248488208778, 29.829238999952604], [61.78122155136343, 30.735850328081231], [61.699314406180811, 31.379506130492661], [60.941944614511115, 31.548074652628745], [60.863654819588952, 32.182919623334421], [60.536077915290761, 32.981268825811561], [60.963700392505991, 33.528832302376252], [60.528429803311575, 33.676446031217999], [60.80319339380744, 34.404101874319856], [61.21081709172573, 35.650072333309218]]] } }, - { "type": "Feature", "properties": { "admin": "Angola", "name": "Angola", "continent": "Africa" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[16.326528354567042, -5.877470391466217], [16.573179965896141, -6.622644545115092], [16.860190870845226, -7.222297865429978], [17.089995965247166, -7.545688978712474], [17.472970004962288, -8.068551120641656], [18.134221632569048, -7.987677504104865], [18.464175652752683, -7.847014255406475], [19.016751743249664, -7.988245944860138], [19.166613396896079, -7.738183688999724], [19.417502475673214, -7.155428562044277], [20.037723016040214, -7.116361179231658], [20.091621534920616, -6.943090101756949], [20.60182295093832, -6.939317722199688], [20.514748162526526, -7.299605808138663], [21.728110792739752, -7.290872491081315], [21.74645592620336, -7.920084730667113], [21.949130893652033, -8.305900974158304], [21.80180138518795, -8.908706556842985], [21.875181919042397, -9.523707777548564], [22.208753289486417, -9.894796237836529], [22.155268182064326, -11.084801120653777], [22.402798292742428, -10.99307545333569], [22.837345411884762, -11.017621758674334], [23.456790805767461, -10.867863457892481], [23.912215203555743, -10.926826267137541], [24.017893507592614, -11.237298272347115], [23.904153680118235, -11.722281589406332], [24.079905226342895, -12.191296888887305], [23.930922072045373, -12.565847670138821], [24.0161365088947, -12.91104623784855], [21.933886346125941, -12.898437188369353], [21.887842644953871, -16.080310153876891], [22.562478468524283, -16.898451429921831], [23.215048455506086, -17.523116143465952], [21.377176141045592, -17.930636488519706], [18.956186964603628, -17.789094740472233], [18.263309360434217, -17.309950860262003], [14.209706658595049, -17.353100681225708], [14.058501417709035, -17.423380629142653], [13.462362094789963, -16.971211846588741], [12.814081251688405, -16.941342868724075], [12.21546146001938, -17.111668389558059], [11.734198846085146, -17.301889336824498], [11.640096062881609, -16.673142185129205], [11.778537224991563, -15.793816013250687], [12.123580763404444, -14.878316338767927], [12.175618930722264, -14.449143568583889], [12.500095249083014, -13.547699883684398], [12.738478631245439, -13.137905775609934], [13.312913852601834, -12.483630466362511], [13.633721144269824, -12.038644707897189], [13.738727654686924, -11.297863050993142], [13.686379428775293, -10.73107594161584], [13.38732791510216, -10.373578383020726], [13.120987583069873, -9.766897067914112], [12.875369500386567, -9.166933689005488], [12.929061313537797, -8.959091078327573], [13.23643273280987, -8.56262948978434], [12.933040398824314, -7.596538588087752], [12.728298374083916, -6.927122084178803], [12.227347039446441, -6.294447523629372], [12.322431674863562, -6.100092461779651], [12.735171339578695, -5.965682061388476], [13.024869419006988, -5.984388929878106], [13.375597364971892, -5.864241224799555], [16.326528354567042, -5.877470391466217]]], [[[12.436688266660919, -5.684303887559223], [12.182336866920277, -5.789930515163801], [11.914963006242115, -5.037986748884733], [12.318607618873923, -4.606230157086158], [12.620759718484548, -4.438023369976121], [12.995517205465202, -4.781103203961918], [12.631611769265842, -4.991271254092935], [12.468004184629759, -5.248361504744991], [12.436688266660919, -5.684303887559223]]]] } }, - { "type": "Feature", "properties": { "admin": "Albania", "name": "Albania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.590247430104906, 41.855404161133592], [20.463175083099195, 41.515089016275333], [20.605181919037356, 41.086226304685219], [21.020040317476397, 40.842726955725873], [20.99998986174722, 40.580003973953964], [20.67499677906363, 40.43499990494302], [20.61500044117275, 40.110006822259365], [20.150015903410516, 39.624997666983965], [19.980000441170144, 39.694993394523401], [19.9600016618732, 39.915005805006039], [19.40608198413673, 40.250773423822459], [19.319058872157139, 40.727230129553554], [19.403549838954287, 41.409565741535445], [19.540027296637099, 41.71998607031275], [19.371768833094958, 41.87754751237064], [19.304486118250786, 42.195745144207812], [19.738051385179627, 42.688247382165564], [19.801613396898681, 42.500093492190835], [20.0707, 42.58863], [20.28375451018189, 42.320259507815074], [20.52295, 42.21787], [20.590247430104906, 41.855404161133592]]] } }, - { "type": "Feature", "properties": { "admin": "United Arab Emirates", "name": "United Arab Emirates", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[51.579518670463258, 24.245497137951102], [51.757440626844172, 24.294072984305462], [51.794389275932865, 24.019826158132499], [52.577080519425593, 24.177439276622703], [53.404006788960139, 24.151316840099167], [54.008000929587574, 24.121757920828212], [54.693023716048614, 24.797892360935084], [55.439024692614126, 25.439145209244934], [56.070820753814544, 26.055464178973978], [56.261041701080948, 25.714606431576762], [56.396847365143991, 24.924732163995483], [55.886232537667993, 24.92083059335744], [55.804118686756212, 24.269604193615258], [55.981213820220454, 24.130542914317822], [55.528631626208231, 23.933604030853498], [55.525841098864461, 23.524869289640929], [55.234489373602869, 23.110992743415316], [55.208341098863187, 22.708329982997039], [55.006803012924898, 22.496947536707129], [52.000733270074321, 23.001154486578937], [51.617707553926969, 24.014219265228824], [51.579518670463258, 24.245497137951102]]] } }, - { "type": "Feature", "properties": { "admin": "Argentina", "name": "Argentina", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-65.5, -55.2], [-66.45, -55.25], [-66.95992, -54.89681], [-67.56244, -54.87001], [-68.63335, -54.8695], [-68.634010227583147, -52.636370458874453], [-68.25, -53.1], [-67.75, -53.85], [-66.45, -54.45], [-65.05, -54.7], [-65.5, -55.2]]], [[[-64.964892137294569, -22.075861504812348], [-64.377021043542257, -22.79809132252354], [-63.986838141522462, -21.993644301035953], [-62.84646847192154, -22.034985446869452], [-62.685057135657885, -22.249029229422401], [-60.846564704009928, -23.880712579038299], [-60.028966030503973, -24.032796319273238], [-58.807128465394939, -24.771459242453268], [-57.777217169817952, -25.162339776309032], [-57.633660040911124, -25.603656508081666], [-58.618173590719707, -27.123718763947117], [-57.609759690976134, -27.395898532828419], [-56.486701626192989, -27.548499037386243], [-55.695845506398186, -27.387837009390815], [-54.788794928595038, -26.621785577096087], [-54.625290696823541, -25.739255466415479], [-54.130049607954412, -25.547639255477243], [-53.628348965048716, -26.12486500417743], [-53.648735317587885, -26.923472588816104], [-54.490725267135517, -27.474756768505767], [-55.162286342984586, -27.881915378533414], [-56.290899624239088, -28.852760512000849], [-57.62513342958291, -30.21629485445424], [-57.874937303281897, -31.016556084926158], [-58.14244035504074, -32.044503676076182], [-58.132647671121404, -33.040566908502008], [-58.349611172098818, -33.263188978815428], [-58.427074144104367, -33.909454441057541], [-58.495442064026541, -34.4314897600701], [-57.225829637263629, -35.288026625307886], [-57.362358771378737, -35.977390232081497], [-56.737487352105447, -36.413125909166574], [-56.788285285048339, -36.901571547189327], [-57.749156867083421, -38.183870538079901], [-59.231857062401865, -38.720220228837199], [-61.2374452378656, -38.92842457454114], [-62.335956997310134, -38.827707208004362], [-62.125763108962914, -39.424104913084868], [-62.33053097191943, -40.172586358400316], [-62.145994432205228, -40.676896661136723], [-62.74580278181697, -41.028761488612083], [-63.770494757732514, -41.166789239263657], [-64.732089809819698, -40.802677097335128], [-65.118035244391578, -41.064314874028874], [-64.97856055363583, -42.058000990569312], [-64.303407965742466, -42.359016208669495], [-63.755947842042339, -42.043686618824495], [-63.458059048095883, -42.563138116222355], [-64.378803880456289, -42.873558444999638], [-65.181803961839691, -43.495380954767782], [-65.328823411710133, -44.501366062193689], [-65.565268927661592, -45.03678557716978], [-66.509965786389344, -45.039627780945843], [-67.293793911392427, -45.551896254255183], [-67.580546434180079, -46.301772963242527], [-66.597066413017259, -47.033924655953804], [-65.641026577401433, -47.23613453551188], [-65.98508826360073, -48.133289076531128], [-67.166178961847649, -48.697337334996931], [-67.816087612566449, -49.869668877970412], [-68.728745083273154, -50.26421843851886], [-69.138539191347789, -50.732510267947788], [-68.815561489523517, -51.771104011594097], [-68.149994879820397, -52.349983406127699], [-68.571545376241332, -52.299443855346247], [-69.498362189396076, -52.142760912637236], [-71.914803839796321, -52.009022305865912], [-72.329403856074023, -51.425956312872394], [-72.309973517532342, -50.677009779666342], [-72.975746832964617, -50.741450290734299], [-73.328050910114456, -50.378785088909865], [-73.415435757120022, -49.318436374712952], [-72.648247443314929, -48.878618259476774], [-72.331160854771937, -48.244238376661819], [-72.44735531278026, -47.738532810253517], [-71.917258470330196, -46.884838148791786], [-71.552009446891233, -45.560732924177117], [-71.659315558545316, -44.973688653341434], [-71.222778896759721, -44.784242852559409], [-71.329800788036195, -44.407521661151677], [-71.793622606071935, -44.207172133156099], [-71.464056159130493, -43.787611179378324], [-71.915423956983901, -43.408564548517404], [-72.148898078078517, -42.254888197601375], [-71.746803758415453, -42.051386407235988], [-71.915734015577542, -40.832339369470716], [-71.680761277946445, -39.808164157878061], [-71.413516608349042, -38.916022230791107], [-70.814664272734703, -38.552995293940732], [-71.118625047475419, -37.576827487947192], [-71.121880662709771, -36.65812387466233], [-70.364769253201658, -36.005088799789931], [-70.388049485949082, -35.169687595359441], [-69.817309129501453, -34.193571465798279], [-69.814776984319209, -33.273886000299839], [-70.074399380153622, -33.09120981214803], [-70.535068935819439, -31.365010267870279], [-69.919008348251921, -30.336339206668306], [-70.013550381129861, -29.367922865518544], [-69.656130337183143, -28.459141127233686], [-69.001234910748266, -27.521213881136127], [-68.295541551370391, -26.899339694935787], [-68.594799770772667, -26.50690886811126], [-68.386001146097342, -26.185016371365229], [-68.417652960876111, -24.518554782816874], [-67.328442959244128, -24.025303236590908], [-66.985233934177629, -22.986348565362825], [-67.106673550063604, -22.735924574476392], [-66.273339402924833, -21.832310479420677], [-64.964892137294569, -22.075861504812348]]]] } }, - { "type": "Feature", "properties": { "admin": "Armenia", "name": "Armenia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[43.582745802592726, 41.09214325618256], [44.972480096218071, 41.248128567055588], [45.179495883979335, 40.985353908851401], [45.560351189970433, 40.812289537105919], [45.359174839058156, 40.561503811193447], [45.891907179555076, 40.218475653639992], [45.610012241402913, 39.899993801425175], [46.034534132680662, 39.628020738273058], [46.483498976432443, 39.464154771475528], [46.505719842317966, 38.770605373686287], [46.143623081248812, 38.74120148371221], [45.735379266143006, 39.319719143219736], [45.739978468616975, 39.473999131827114], [45.298144972521456, 39.471751207022422], [45.00198733905674, 39.740003567049548], [44.793989699081934, 39.713002631177041], [44.400008579288695, 40.005000311842267], [43.656436395040934, 40.253563951166178], [43.752657911968399, 40.740200914058754], [43.582745802592726, 41.09214325618256]]] } }, - { "type": "Feature", "properties": { "admin": "French Southern and Antarctic Lands", "name": "Fr. S. Antarctic Lands", "continent": "Seven seas (open ocean)" }, "geometry": { "type": "Polygon", "coordinates": [[[68.935, -48.625], [69.58, -48.94], [70.525, -49.065], [70.56, -49.255], [70.28, -49.71], [68.745, -49.775], [68.72, -49.2425], [68.8675, -48.83], [68.935, -48.625]]] } }, - { "type": "Feature", "properties": { "admin": "Australia", "name": "Australia", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[145.397978143494782, -40.792548516605883], [146.364120721623692, -41.137695407883335], [146.908583612250823, -41.000546156580668], [147.689259474884125, -40.808258152022681], [148.289067824495987, -40.875437514002122], [148.359864536735785, -42.062445163746439], [148.017301467073082, -42.40702361426861], [147.914051955353784, -43.211522312188485], [147.564564243763982, -42.937688897473855], [146.87034305235494, -43.634597263362082], [146.663327264593647, -43.580853773778543], [146.048377720320389, -43.54974456153888], [145.431929559510536, -42.693776137056268], [145.295090366801674, -42.03360971452755], [144.7180713238306, -41.162551771815707], [144.743754510679622, -40.703975111657705], [145.397978143494782, -40.792548516605883]]], [[[143.561811151299935, -13.763655694232209], [143.922099237238882, -14.548310642152], [144.563713820574804, -14.171176039285879], [144.894908075133515, -14.594457696188622], [145.374723748963419, -14.984976495018284], [145.271991001567244, -15.428205254785691], [145.48525963763575, -16.285672295804769], [145.637033319276952, -16.784918308176611], [145.888904250267672, -16.906926364817647], [146.160308872664473, -17.76165455492524], [146.063673944278662, -18.280072523677315], [146.387478469019584, -18.958274021075905], [147.471081577747896, -19.480722751546676], [148.177601760042478, -19.955939222902767], [148.848413527623222, -20.391209812097252], [148.717465448195583, -20.633468926681513], [149.289420200802056, -21.260510756111096], [149.678337030230637, -22.342511895438388], [150.07738244038859, -22.122783705333315], [150.482939081015161, -22.556142266533012], [150.727265252891158, -22.402404880464655], [150.899554478152254, -23.462236830338679], [151.609175246384211, -24.076256198830755], [152.07353966695905, -24.45788665130619], [152.855197381805908, -25.267501316023008], [153.136162144176751, -26.071173191026187], [153.161948683890358, -26.641319268502439], [153.09290897034856, -27.260299574494503], [153.569469028944184, -28.110066827102099], [153.512108189100218, -28.995077406532751], [153.339095493787056, -29.458201592732443], [153.069241164358857, -30.350240166954809], [153.089601678681788, -30.923641859665445], [152.891577590139377, -31.640445651985949], [152.450002476205327, -32.550002536755237], [151.709117466436766, -33.041342054986337], [151.343971795862387, -33.816023451473846], [151.010555454715103, -34.310360202777879], [150.714139439089024, -35.173459974916803], [150.328219842733233, -35.671879164371923], [150.075212030232251, -36.420205580390508], [149.946124302367139, -37.109052422841224], [149.997283970336127, -37.425260512035123], [149.423882277625523, -37.772681166333463], [148.304622430615893, -37.809061374666875], [147.38173302631526, -38.219217217767543], [146.922122837511324, -38.606532077795116], [146.317921991154776, -39.035756524411433], [145.489652134380549, -38.593767999019043], [144.876976353128157, -38.41744801203911], [145.032212355732952, -37.896187839510972], [144.485682407814011, -38.085323581699257], [143.609973586196077, -38.809465427405321], [142.745426873952965, -38.538267510737519], [142.17832970598198, -38.380034275059835], [141.606581659104677, -38.308514092767872], [140.638578729413211, -38.019332777662541], [139.992158237874321, -37.402936293285094], [139.806588169514043, -36.643602797188272], [139.574147577065219, -36.138362318670666], [139.082808058834075, -35.732754001611774], [138.120747918856296, -35.612296237939397], [138.449461704664998, -35.127261244447887], [138.207564325106659, -34.384722588845925], [137.719170363516128, -35.07682504653102], [136.829405552314711, -35.260534763328614], [137.352371047108477, -34.707338555644093], [137.503886346588331, -34.130267836240769], [137.890116001537649, -33.640478610978327], [137.810327590079112, -32.900007012668105], [136.996837192940347, -33.752771498348629], [136.372069126531642, -34.094766127256186], [135.98904341038434, -34.89011809666048], [135.208212518454104, -34.478670342752601], [135.239218377829161, -33.947953383114971], [134.613416782774607, -33.222778008763136], [134.085903761939107, -32.848072198214759], [134.273902622617015, -32.617233575166949], [132.990776808809812, -32.011224053680188], [132.288080682504869, -31.982646986622761], [131.326330601120901, -31.495803318001041], [129.535793898639668, -31.590422865527476], [128.240937534702198, -31.948488864877849], [127.102867466338282, -32.282266941051041], [126.148713820501129, -32.2159660784206], [125.088623488465586, -32.728751316052829], [124.22164798390493, -32.959486586236061], [124.028946567888511, -33.483847344701708], [123.65966678273071, -33.890179131812722], [122.811036411633609, -33.914467054989835], [122.18306440642283, -34.003402194964217], [121.299190708502579, -33.821036065406126], [120.580268182458113, -33.930176690406618], [119.893695103028222, -33.976065362281808], [119.298899367348781, -34.50936614353396], [119.007340936357977, -34.464149265278529], [118.505717808100769, -34.746819349915093], [118.024971958489516, -35.064732761374707], [117.295507440257438, -35.025458672832862], [116.62510908413492, -35.025096937806829], [115.564346958479689, -34.386427911111547], [115.026808709779516, -34.196517022438918], [115.048616164206763, -33.623425388322026], [115.545123325667078, -33.487257989232951], [115.714673700016661, -33.259571628554944], [115.679378696761376, -32.900368747694124], [115.801645135563959, -32.205062351207026], [115.689610630355105, -31.612437025683782], [115.160909051576937, -30.601594333622455], [114.99704308477942, -30.030724786094162], [115.040037876446249, -29.461095472940794], [114.64197431850198, -28.810230808224706], [114.61649783738217, -28.516398614213042], [114.173579136208446, -28.118076674107321], [114.048883905088132, -27.33476531342712], [113.477497593236876, -26.543134047147898], [113.338953078262477, -26.116545098578477], [113.77835778204026, -26.549025160429174], [113.440962355606587, -25.621278171493152], [113.936901076311642, -25.911234633082877], [114.232852004047288, -26.298446140245868], [114.216160516417006, -25.786281019801105], [113.721255324357685, -24.998938897402123], [113.625343866024025, -24.683971042583146], [113.393523390762667, -24.384764499613262], [113.502043898575607, -23.80635019297025], [113.706992629045146, -23.56021534596406], [113.843418410295669, -23.059987481378734], [113.736551548316072, -22.475475355725372], [114.149756300921865, -21.755881036061009], [114.225307244932651, -22.51748829517863], [114.64776207891866, -21.829519952076904], [115.460167270979298, -21.495173435148541], [115.94737267462699, -21.068687839443708], [116.711615431791529, -20.701681817306817], [117.166316359527684, -20.623598728113802], [117.441545037914238, -20.746898695562162], [118.229558953932951, -20.374208265873232], [118.836085239742701, -20.263310642174822], [118.987807244951753, -20.044202569257319], [119.252493931150624, -19.952941989829835], [119.805225050944543, -19.976506442954978], [120.856220330896633, -19.683707777589188], [121.399856398607199, -19.239755547769729], [121.655137974129062, -18.70531788500713], [122.241665480641757, -18.197648614171765], [122.286623976735655, -17.798603204013911], [122.312772251475408, -17.254967136303446], [123.012574497571904, -16.405199883695854], [123.433789097183009, -17.268558037996225], [123.859344517106592, -17.069035332917249], [123.503242222183232, -16.596506036040363], [123.817073195491915, -16.11131601325199], [124.258286574399847, -16.32794361741956], [124.379726190285794, -15.567059828353973], [124.926152785340022, -15.07510019293532], [125.167275018413875, -14.680395603090004], [125.670086704613823, -14.510070082256018], [125.685796340030493, -14.230655612853834], [126.125149367376096, -14.347340996968949], [126.142822707219864, -14.095986830301211], [126.582589146023736, -13.95279143642041], [127.065867140817332, -13.817967624570922], [127.804633416861932, -14.276906019755042], [128.359689976108939, -14.869169610252253], [128.985543247595899, -14.875990899314738], [129.621473423379598, -14.969783623924553], [129.409600050982988, -14.420669854391031], [129.888640578328591, -13.618703301653481], [130.339465773642928, -13.357375583553473], [130.183506300985982, -13.107520033422301], [130.617795037966971, -12.536392103732464], [131.223494500859999, -12.183648776908113], [131.73509118054946, -12.302452894747159], [132.575298293183096, -12.114040622611013], [132.557211541881031, -11.603012383676683], [131.824698114143644, -11.273781833545097], [132.357223748911395, -11.128519382372641], [133.019560581596409, -11.376411228076844], [133.550845981989028, -11.786515394745134], [134.393068475481982, -12.042365411022173], [134.678632440327021, -11.9411829565947], [135.298491245667975, -12.248606052299051], [135.882693312727611, -11.962266940969796], [136.258380975489445, -12.049341729381606], [136.492475213771627, -11.857208754120389], [136.951620314684988, -12.351958916882735], [136.685124953355739, -12.887223402562054], [136.305406528875096, -13.291229750219895], [135.961758254134111, -13.324509372615889], [136.077616815332533, -13.72427825282578], [135.783836297753226, -14.223989353088211], [135.4286641786112, -14.715432224183896], [135.500184360903177, -14.997740573794427], [136.295174595281367, -15.550264987859121], [137.065360142159477, -15.870762220933353], [137.580470819244795, -16.215082289294084], [138.303217401278971, -16.807604261952658], [138.58516401586337, -16.806622409739173], [139.108542922115475, -17.062679131745366], [139.260574985918197, -17.371600843986183], [140.215245396078274, -17.710804945550063], [140.875463495039241, -17.36906869880394], [141.071110467696258, -16.832047214426719], [141.274095493738798, -16.388870131091604], [141.398222284103781, -15.840531508042584], [141.702183058844611, -15.044921156476928], [141.563380161708665, -14.561333103089506], [141.635520461188094, -14.270394789286284], [141.519868605718955, -13.698078301653805], [141.650920038011009, -12.944687595270562], [141.842691278246207, -12.741547539931187], [141.68699018775078, -12.407614434461134], [141.928629185147543, -11.877465915578778], [142.118488397387978, -11.328042087451619], [142.14370649634634, -11.04273650476814], [142.51526004452495, -10.668185723516642], [142.797310011974048, -11.157354831591515], [142.866763136974271, -11.784706719614929], [143.11594689348567, -11.90562957117791], [143.158631626558758, -12.325655612846187], [143.522123651299864, -12.834358412327429], [143.597157830987669, -13.400422051652594], [143.561811151299935, -13.763655694232209]]]] } }, - { "type": "Feature", "properties": { "admin": "Austria", "name": "Austria", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.979666782304033, 48.123497015976298], [16.903754103267257, 47.714865627628321], [16.340584344150411, 47.712901923201215], [16.534267612380372, 47.496170966169103], [16.202298211337361, 46.852385972676949], [16.011663852612653, 46.683610744811688], [15.137091912504982, 46.658702704447016], [14.632471551174827, 46.431817328469535], [13.806475457421524, 46.509306138691201], [12.376485223040813, 46.767559109069843], [12.153088006243051, 47.115393174826437], [11.164827915093268, 46.941579494812721], [11.048555942436533, 46.751358547546324], [10.442701450246627, 46.893546250997424], [9.932448357796657, 46.920728054382948], [9.479969516649019, 47.102809963563367], [9.632931756232974, 47.347601223329974], [9.594226108446346, 47.525058091820256], [9.896068149463188, 47.58019684507569], [10.402083774465209, 47.302487697939156], [10.544504021861625, 47.566399237653762], [11.426414015354736, 47.523766181012967], [12.141357456112784, 47.703083401065761], [12.620759718484491, 47.672387600284395], [12.932626987365945, 47.467645575543983], [13.025851271220487, 47.637583523135824], [12.884102817443901, 48.289145819687903], [13.243357374736998, 48.41611481382904], [13.595945672264433, 48.877171942737135], [14.33889773932472, 48.555305284207193], [14.901447381254055, 48.964401760445817], [15.253415561593979, 49.039074205107575], [16.029647251050218, 48.733899034207916], [16.49928266771877, 48.785808010445095], [16.960288120194573, 48.596982326850593], [16.879982944412998, 48.470013332709463], [16.979666782304033, 48.123497015976298]]] } }, - { "type": "Feature", "properties": { "admin": "Azerbaijan", "name": "Azerbaijan", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[45.001987339056789, 39.740003567049591], [45.298144972521435, 39.471751207022422], [45.739978468616997, 39.473999131827149], [45.735379266143092, 39.319719143219785], [46.143623081248812, 38.74120148371221], [45.457721795438729, 38.874139105783108], [44.952688022650264, 39.33576467544642], [44.79398969908199, 39.713002631177027], [45.001987339056789, 39.740003567049591]]], [[[47.373315464066216, 41.219732367511249], [47.81566572448471, 41.151416124021338], [47.987283156126033, 41.405819200194223], [48.584352654826283, 41.808869533854669], [49.110263706260653, 41.282286688800518], [49.618914829309588, 40.572924302729966], [50.084829542853093, 40.526157131505776], [50.392821079312704, 40.256561184239096], [49.569202101444795, 40.176100979160701], [49.395259230350419, 39.39948171646224], [49.2232283872507, 39.04921885838791], [48.856532423707584, 38.815486355131775], [48.883249139202533, 38.320245266262638], [48.634375441284831, 38.270377509100925], [48.010744256386502, 38.794014797514528], [48.355529412637928, 39.288764960276886], [48.060095249225256, 39.582235419262439], [47.685079380083117, 39.508363959301185], [46.505719842317966, 38.770605373686251], [46.483498976432443, 39.464154771475528], [46.034534132680697, 39.628020738273044], [45.610012241402913, 39.899993801425175], [45.891907179555133, 40.21847565363997], [45.359174839058156, 40.561503811193482], [45.560351189970469, 40.812289537105947], [45.179495883979392, 40.98535390885143], [44.972480096218156, 41.248128567055623], [45.217426385281634, 41.411451931314041], [45.962600538930438, 41.123872585609789], [46.501637404166978, 41.064444688474104], [46.637908156120567, 41.181672675128219], [46.145431756378983, 41.72280243587263], [46.404950799348818, 41.860675157227341], [46.686070591016652, 41.827137152669899], [47.373315464066216, 41.219732367511249]]]] } }, - { "type": "Feature", "properties": { "admin": "Burundi", "name": "Burundi", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[29.339997592900342, -4.499983412294092], [29.276383904749046, -3.293907159034063], [29.02492638521678, -2.839257907730157], [29.632176141078585, -2.917857761246096], [29.938359002407935, -2.348486830254238], [30.469696079232978, -2.413857517103458], [30.527677036264457, -2.807631931167534], [30.743012729624692, -3.034284763199686], [30.752262811004943, -3.359329522315569], [30.505559523243559, -3.568567396665364], [30.116332635221166, -4.090137627787242], [29.753512404099919, -4.45238941815328], [29.339997592900342, -4.499983412294092]]] } }, - { "type": "Feature", "properties": { "admin": "Belgium", "name": "Belgium", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[3.314971144228536, 51.345780951536071], [4.047071160507527, 51.267258612668556], [4.973991326526913, 51.475023708698124], [5.60697594567, 51.037298488969768], [6.156658155958779, 50.803721015010574], [6.043073357781109, 50.128051662794221], [5.782417433300905, 50.090327867221205], [5.674051954784828, 49.52948354755749], [4.799221632515809, 49.985373033236371], [4.286022983425084, 49.90749664977254], [3.588184441755685, 50.378992418003563], [3.123251580425801, 50.780363267614561], [2.658422071960274, 50.796848049515731], [2.513573032246142, 51.148506171261815], [3.314971144228536, 51.345780951536071]]] } }, - { "type": "Feature", "properties": { "admin": "Benin", "name": "Benin", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[2.691701694356254, 6.258817246928628], [1.865240512712318, 6.14215770102973], [1.618950636409238, 6.832038072126236], [1.664477573258381, 9.128590399609378], [1.46304284018467, 9.334624335157086], [1.425060662450136, 9.825395412632998], [1.077795037448737, 10.175606594275022], [0.772335646171484, 10.470808213742357], [0.899563022474069, 10.997339382364258], [1.243469679376488, 11.11051076908346], [1.447178175471066, 11.547719224488857], [1.93598554851988, 11.641150214072551], [2.154473504249921, 11.940150051313337], [2.49016360841793, 12.233052069543671], [2.84864301922667, 12.235635891158266], [3.611180454125558, 11.660167141155966], [3.572216424177469, 11.327939357951516], [3.797112257511713, 10.734745591673104], [3.600070021182801, 10.332186184119406], [3.705438266625918, 10.063210354040207], [3.220351596702101, 9.4441525333997], [2.912308383810255, 9.13760793704432], [2.723792758809509, 8.506845404489708], [2.74906253420022, 7.870734361192886], [2.691701694356254, 6.258817246928628]]] } }, - { "type": "Feature", "properties": { "admin": "Burkina Faso", "name": "Burkina Faso", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.827496303712706, 9.642460842319775], [-3.511898972986272, 9.900326239456216], [-3.980449184576684, 9.862344061721698], [-4.330246954760383, 9.610834865757139], [-4.779883592131966, 9.821984768101741], [-4.954653286143098, 10.152713934769732], [-5.404341599946973, 10.370736802609144], [-5.470564947929004, 10.951269842976044], [-5.197842576508648, 11.375145778850136], [-5.220941941743119, 11.713858954307224], [-4.427166103523802, 12.542645575404292], [-4.280405035814879, 13.228443508349738], [-4.006390753587225, 13.472485459848112], [-3.52280270019986, 13.337661647998612], [-3.103706834312759, 13.54126679122859], [-2.967694464520576, 13.798150336151506], [-2.191824510090384, 14.246417548067352], [-2.001035122068771, 14.559008287000887], [-1.066363491205663, 14.973815009007764], [-0.515854458000348, 15.116157741755725], [-0.26625729003058, 14.924308986872147], [0.374892205414682, 14.928908189346128], [0.295646396495101, 14.444234930880651], [0.429927605805517, 13.988733018443922], [0.993045688490071, 13.335749620003821], [1.024103224297477, 12.851825669806573], [2.177107781593775, 12.625017808477532], [2.154473504249921, 11.940150051313337], [1.93598554851988, 11.641150214072551], [1.447178175471066, 11.547719224488857], [1.243469679376488, 11.11051076908346], [0.899563022474069, 10.997339382364258], [0.023802524423701, 11.018681748900802], [-0.438701544588582, 11.09834096927872], [-0.761575893548183, 10.936929633015053], [-1.203357713211431, 11.009819240762736], [-2.94040930827046, 10.962690334512557], [-2.963896246747111, 10.395334784380081], [-2.827496303712706, 9.642460842319775]]] } }, - { "type": "Feature", "properties": { "admin": "Bangladesh", "name": "Bangladesh", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[92.672720981825549, 22.041238918541247], [92.652257114637976, 21.324047552978481], [92.30323449093865, 21.475485337809815], [92.368553501355606, 20.670883287025344], [92.082886183646124, 21.192195135985767], [92.025215285208361, 21.701569729086764], [91.834890985077408, 22.182935695885561], [91.417087029997646, 22.765019029221218], [90.496006300827247, 22.805016587815125], [90.586956821660948, 22.392793687422863], [90.272970819055544, 21.836367702720107], [89.847467075564268, 22.039146023033421], [89.70204959509492, 21.857115790285299], [89.41886274613546, 21.966178900637296], [89.031961297566198, 22.055708319582973], [88.876311883503064, 22.879146429937826], [88.529769728553759, 23.631141872649163], [88.699940220090895, 24.233714911388557], [88.084422235062405, 24.501657212821918], [88.30637251175601, 24.866079413344199], [88.931553989623069, 25.238692328384769], [88.209789259802477, 25.768065700782707], [88.56304935094974, 26.446525580342716], [89.355094028687276, 26.014407253518065], [89.832480910199592, 25.965082098895476], [89.920692580121838, 25.269749864192171], [90.872210727912105, 25.13260061288954], [91.799595981822065, 25.14743174895731], [92.376201613334786, 24.976692816664961], [91.915092807994398, 24.130413723237108], [91.467729933643668, 24.072639471934789], [91.158963250699713, 23.503526923104381], [91.706475050832083, 22.985263983649183], [91.869927606171302, 23.62434642180278], [92.146034783906799, 23.62749868417259], [92.672720981825549, 22.041238918541247]]] } }, - { "type": "Feature", "properties": { "admin": "Bulgaria", "name": "Bulgaria", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.657149692482985, 44.234923000661276], [22.94483239105184, 43.823785305347123], [23.332302280376322, 43.897010809904707], [24.100679152124169, 43.741051337247846], [25.569271681426923, 43.688444729174712], [26.065158725699739, 43.943493760751259], [27.242399529740904, 44.175986029632398], [27.970107049275068, 43.812468166675202], [28.55808149589199, 43.707461656258118], [28.039095086384712, 43.293171698574177], [27.673897739378042, 42.577892361006214], [27.996720411905383, 42.007358710287775], [27.135739373490473, 42.141484890301335], [26.117041863720793, 41.826904608724554], [26.106138136507205, 41.328898830727766], [25.197201368925441, 41.234485988930523], [24.492644891058031, 41.583896185872028], [23.692073601992345, 41.309080918943842], [22.952377150166445, 41.337993882811141], [22.881373732197424, 41.999297186850242], [22.380525750424585, 42.320259507815081], [22.545011834409614, 42.461362006188025], [22.436594679461273, 42.580321153323929], [22.604801466571324, 42.898518785161137], [22.986018507588479, 43.211161200526959], [22.500156691180276, 43.642814439460977], [22.410446404721593, 44.008063462899948], [22.657149692482985, 44.234923000661276]]] } }, - { "type": "Feature", "properties": { "admin": "The Bahamas", "name": "Bahamas", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-77.53466, 23.75975], [-77.78, 23.71], [-78.03405, 24.28615], [-78.40848, 24.57564], [-78.19087, 25.2103], [-77.89, 25.17], [-77.54, 24.34], [-77.53466, 23.75975]]], [[[-77.82, 26.58], [-78.91, 26.42], [-78.98, 26.79], [-78.51, 26.87], [-77.85, 26.84], [-77.82, 26.58]]], [[[-77.0, 26.59], [-77.17255, 25.87918], [-77.35641, 26.00735], [-77.34, 26.53], [-77.78802, 26.92516], [-77.79, 27.04], [-77.0, 26.59]]]] } }, - { "type": "Feature", "properties": { "admin": "Bosnia and Herzegovina", "name": "Bosnia and Herz.", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[19.005486281010118, 44.860233669609144], [19.36803, 44.863], [19.11761, 44.42307], [19.59976, 44.03847], [19.454, 43.568100000000115], [19.21852, 43.52384], [19.03165, 43.43253], [18.70648, 43.20011], [18.56, 42.65], [17.674921502358981, 43.028562527023603], [17.297373488034449, 43.446340643887353], [16.916156447017325, 43.667722479825663], [16.456442905348862, 44.041239732431265], [16.239660271884528, 44.351143296885695], [15.750026075918978, 44.81871165626255], [15.959367303133373, 45.233776760430935], [16.318156772535868, 45.004126695325901], [16.534939406000202, 45.211607570977705], [17.00214603035101, 45.233776760430935], [17.861783481526398, 45.067740383477137], [18.553214145591646, 45.08158966733145], [19.005486281010118, 44.860233669609144]]] } }, - { "type": "Feature", "properties": { "admin": "Belarus", "name": "Belarus", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[23.484127638449841, 53.912497667041123], [24.45068362803703, 53.905702216194747], [25.536353794056989, 54.282423407602515], [25.768432651479792, 54.846962592175082], [26.588279249790386, 55.167175604871659], [26.494331495883749, 55.61510691997762], [27.102459751094525, 55.783313707087672], [28.17670942557799, 56.169129950578807], [29.2295133806603, 55.918344224666356], [29.371571893030669, 55.67009064393617], [29.896294386522353, 55.789463202530406], [30.87390913262, 55.550976467503396], [30.971835971813132, 55.081547756564028], [30.75753380709871, 54.811770941784303], [31.384472283663733, 54.157056382862422], [31.791424187962232, 53.974638576872117], [31.731272820774503, 53.794029446012011], [32.405598585751157, 53.618045355842028], [32.693643019346034, 53.351420803432106], [32.304519484188226, 53.132726141972903], [31.497643670382924, 53.167426866256889], [31.30520063652801, 53.073995876673195], [31.540018344862254, 52.742052313846344], [31.78599816257158, 52.10167796488544], [30.927549269338975, 52.042353420614383], [30.619454380014837, 51.822806098022362], [30.55511722181145, 51.319503485715643], [30.157363722460889, 51.416138414101454], [29.254938185347921, 51.368234361366881], [28.992835320763522, 51.602044379271462], [28.617612745892242, 51.427713934934836], [28.241615024536564, 51.572227077839059], [27.454066196408426, 51.59230337178446], [26.337958611768549, 51.832288723347915], [25.327787713327005, 51.910656032918538], [24.553106316839511, 51.888461005249177], [24.005077752384206, 51.617443956094448], [23.52707075368437, 51.578454087930233], [23.508002150168689, 52.023646552124717], [23.19949384938618, 52.486977444053664], [23.799198846133375, 52.691099351606553], [23.804934930117774, 53.08973135030606], [23.527535841574995, 53.47012156840654], [23.484127638449841, 53.912497667041123]]] } }, - { "type": "Feature", "properties": { "admin": "Belize", "name": "Belize", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-89.143080410503302, 17.808318996649316], [-89.150909389995519, 17.955467637600414], [-89.029857347351808, 18.001511338772485], [-88.848343878926585, 17.883198147040229], [-88.490122850279334, 18.486830552641603], [-88.300031094093669, 18.499982204659897], [-88.296336229184803, 18.353272813383263], [-88.106812913754368, 18.348673610909284], [-88.123478563168476, 18.076674709541003], [-88.285354987322776, 17.644142971258031], [-88.197866787452625, 17.489475409408453], [-88.302640753924422, 17.13169363043566], [-88.239517991879893, 17.036066392479551], [-88.355428229510551, 16.530774237529624], [-88.551824510435821, 16.265467434143144], [-88.732433641295927, 16.233634751851351], [-88.930612759135244, 15.887273464415072], [-89.229121670269265, 15.886937567605166], [-89.15080603713092, 17.015576687075832], [-89.143080410503302, 17.808318996649316]]] } }, - { "type": "Feature", "properties": { "admin": "Bolivia", "name": "Bolivia", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-62.84646847192154, -22.034985446869442], [-63.986838141522462, -21.993644301035946], [-64.377021043542243, -22.798091322523533], [-64.964892137294598, -22.07586150481232], [-66.273339402924833, -21.832310479420713], [-67.10667355006359, -22.735924574476414], [-67.82817989772272, -22.872918796482171], [-68.219913092711266, -21.494346612231858], [-68.757167121033731, -20.372657972904459], [-68.442225104430904, -19.405068454671426], [-68.966818406841853, -18.9816834449041], [-69.100246955019472, -18.260125420812674], [-69.590423753524036, -17.580011895419329], [-68.959635382753291, -16.500697930571267], [-69.389764166934697, -15.66012908291165], [-69.160346645774936, -15.323973890853015], [-69.339534674747, -14.953195489158828], [-68.94888668483658, -14.45363941819328], [-68.929223802349526, -13.602683607643007], [-68.880079515239956, -12.89972909917665], [-68.665079718689611, -12.561300144097171], [-69.52967810736493, -10.951734307502193], [-68.786157599549469, -11.036380303596276], [-68.27125362819325, -11.014521172736817], [-68.048192308205373, -10.712059014532484], [-67.173801235610725, -10.30681243249961], [-66.646908331962791, -9.931331475466861], [-65.33843522811641, -9.76198780684639], [-65.444837002205375, -10.51145110437543], [-65.321898769783004, -10.895872084194675], [-65.402281460213018, -11.566270440317151], [-64.31635291203159, -12.461978041232191], [-63.196498786050562, -12.627032565972433], [-62.803060268796372, -13.000653171442682], [-62.127080857986371, -13.19878061284972], [-61.713204311760769, -13.489202162330049], [-61.084121263255646, -13.479383640194595], [-60.503304002511122, -13.775954685117656], [-60.459198167550014, -14.354007256734551], [-60.264326341377355, -14.645979099183638], [-60.251148851142922, -15.077218926659318], [-60.542965664295131, -15.093910414289592], [-60.158389655179022, -16.258283786690082], [-58.241219855366673, -16.299573256091289], [-58.388058437724027, -16.877109063385273], [-58.280804002502244, -17.271710300366014], [-57.734558274960989, -17.552468357007765], [-57.498371141170971, -18.174187513911289], [-57.676008877174297, -18.961839694904025], [-57.949997321185819, -19.400004164306814], [-57.853801642474494, -19.969995212486186], [-58.166392381408038, -20.176700941653674], [-58.183471442280492, -19.868399346600359], [-59.11504248720609, -19.356906019775398], [-60.043564622626477, -19.342746677327419], [-61.786326463453761, -19.633736667562957], [-62.265961269770784, -20.513734633061272], [-62.291179368729203, -21.051634616787389], [-62.685057135657871, -22.24902922942238], [-62.84646847192154, -22.034985446869442]]] } }, - { "type": "Feature", "properties": { "admin": "Brazil", "name": "Brazil", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.625133429582945, -30.216294854454258], [-56.290899624239067, -28.852760512000884], [-55.162286342984558, -27.881915378533456], [-54.49072526713551, -27.474756768505785], [-53.648735317587885, -26.923472588816086], [-53.628348965048737, -26.124865004177465], [-54.130049607954376, -25.547639255477247], [-54.625290696823562, -25.739255466415507], [-54.428946092330577, -25.162184747012162], [-54.293476325077435, -24.570799655863958], [-54.292959560754511, -24.021014092710722], [-54.652834235235119, -23.839578138933955], [-55.027901780809543, -24.001273695575225], [-55.400747239795407, -23.956935316668797], [-55.517639329639621, -23.57199757252663], [-55.61068274598113, -22.655619398694839], [-55.797958136606894, -22.356929620047815], [-56.473317430229379, -22.086300144135279], [-56.881509568902885, -22.282153822521476], [-57.937155727761287, -22.090175876557169], [-57.870673997617786, -20.732687676681948], [-58.166392381408038, -20.176700941653674], [-57.853801642474494, -19.969995212486186], [-57.949997321185819, -19.400004164306814], [-57.676008877174297, -18.961839694904025], [-57.498371141170971, -18.174187513911289], [-57.734558274960989, -17.552468357007765], [-58.280804002502244, -17.271710300366014], [-58.388058437724027, -16.877109063385273], [-58.241219855366673, -16.299573256091289], [-60.158389655179022, -16.258283786690082], [-60.542965664295131, -15.093910414289592], [-60.251148851142922, -15.077218926659318], [-60.264326341377355, -14.645979099183638], [-60.459198167550014, -14.354007256734551], [-60.503304002511122, -13.775954685117656], [-61.084121263255646, -13.479383640194595], [-61.713204311760769, -13.489202162330049], [-62.127080857986371, -13.19878061284972], [-62.803060268796372, -13.000653171442682], [-63.196498786050562, -12.627032565972433], [-64.31635291203159, -12.461978041232191], [-65.402281460213018, -11.566270440317151], [-65.321898769783004, -10.895872084194675], [-65.444837002205375, -10.51145110437543], [-65.33843522811641, -9.76198780684639], [-66.646908331962791, -9.931331475466861], [-67.173801235610725, -10.30681243249961], [-68.048192308205373, -10.712059014532484], [-68.27125362819325, -11.014521172736817], [-68.786157599549469, -11.036380303596276], [-69.52967810736493, -10.951734307502193], [-70.093752204046879, -11.123971856331011], [-70.548685675728393, -11.009146823778462], [-70.481893886991159, -9.490118096558842], [-71.302412278921523, -10.079436130415372], [-72.184890713169821, -10.05359791426943], [-72.563033006465631, -9.520193780152715], [-73.226713426390148, -9.462212823121233], [-73.015382656532537, -9.03283334720806], [-73.571059332967053, -8.424446709835832], [-73.987235480429646, -7.523829847853063], [-73.723401455363486, -7.340998630404412], [-73.724486660441627, -6.918595472850638], [-73.120027431923575, -6.629930922068238], [-73.219711269814596, -6.089188734566076], [-72.964507208941185, -5.741251315944892], [-72.891927659787243, -5.274561455916979], [-71.748405727816532, -4.59398284263301], [-70.928843349883564, -4.401591485210367], [-70.79476884630229, -4.251264743673302], [-69.893635219996611, -4.298186944194326], [-69.444101935489599, -1.556287123219817], [-69.420485805932216, -1.122618503426409], [-69.577065395776586, -0.549991957200163], [-70.02065589057004, -0.185156345219539], [-70.015565761989293, 0.541414292804205], [-69.452396002872447, 0.706158758950693], [-69.252434048119042, 0.602650865070075], [-69.218637661400166, 0.985676581217433], [-69.804596727157701, 1.089081122233466], [-69.816973232691609, 1.714805202639624], [-67.868565029558823, 1.692455145673392], [-67.537810024674684, 2.037162787276329], [-67.25999752467358, 1.719998684084956], [-67.065048183852483, 1.130112209473225], [-66.876325853122566, 1.253360500489336], [-66.325765143484944, 0.724452215982012], [-65.548267381437554, 0.78925446207603], [-65.354713304288353, 1.0952822941085], [-64.611011928959854, 1.328730576987041], [-64.199305792890499, 1.49285492594602], [-64.083085496666072, 1.91636912679408], [-63.368788011311644, 2.200899562993129], [-63.422867397705105, 2.411067613124174], [-64.269999152265783, 2.497005520025566], [-64.408827887617903, 3.126786200366623], [-64.368494432214092, 3.797210394705246], [-64.816064012294007, 4.056445217297422], [-64.628659430587533, 4.14848094320925], [-63.888342861574145, 4.020530096854571], [-63.093197597899092, 3.770571193858784], [-62.804533047116692, 4.006965033377951], [-62.085429653559125, 4.162123521334308], [-60.966893276601517, 4.536467596856638], [-60.601179165271922, 4.918098049332129], [-60.733574184803707, 5.2002772078619], [-60.213683437731319, 5.2444863956876], [-59.980958624904865, 5.014061184098138], [-60.111002366767373, 4.574966538914082], [-59.767405768458701, 4.423502915866606], [-59.538039923731219, 3.958802598481937], [-59.815413174057852, 3.606498521332085], [-59.974524909084543, 2.755232652188055], [-59.718545701726732, 2.249630438644359], [-59.646043667221242, 1.786893825686789], [-59.030861579002639, 1.317697658692722], [-58.540012986878288, 1.26808828369252], [-58.429477098205957, 1.46394196207872], [-58.113449876525003, 1.507195135907025], [-57.660971035377358, 1.682584947105638], [-57.33582292339689, 1.948537705895759], [-56.782704230360814, 1.863710842288653], [-56.53938574891454, 1.89952260986692], [-55.995698004771739, 1.817667141116601], [-55.905600145070871, 2.021995754398659], [-56.073341844290283, 2.220794989425499], [-55.973322109589361, 2.510363877773016], [-55.569755011605984, 2.42150625244713], [-55.097587449755125, 2.523748073736612], [-54.524754197799709, 2.311848863123785], [-54.088062506717243, 2.105556545414629], [-53.778520677288903, 2.376702785650081], [-53.554839240113537, 2.33489655192595], [-53.4184651352953, 2.05338918701598], [-52.939657151894949, 2.124857692875636], [-52.556424730018414, 2.504705308437053], [-52.249337531123942, 3.241094468596244], [-51.657797410678882, 4.156232408053028], [-51.317146369010842, 4.203490505383953], [-51.069771287629649, 3.65039765056403], [-50.508875291533641, 1.901563828942456], [-49.974075893745045, 1.736483465986069], [-49.947100796088705, 1.046189683431223], [-50.699251268096901, 0.222984117021681], [-50.388210822132123, -0.078444512536819], [-48.620566779156313, -0.235489190271821], [-48.584496629416577, -1.237805271005001], [-47.824956427590621, -0.5816179337628], [-46.566583624851219, -0.941027520352776], [-44.9057030909904, -1.551739597178134], [-44.417619187993658, -2.137750339367975], [-44.581588507655773, -2.691308282078523], [-43.418791266440188, -2.383110039889793], [-41.47265682632824, -2.912018324397116], [-39.97866533055403, -2.87305429444904], [-38.50038347019656, -3.700652357603394], [-37.223252122535193, -4.820945733258915], [-36.45293738457638, -5.109403578312153], [-35.597795783010454, -5.149504489770648], [-35.235388963347553, -5.464937432480245], [-34.896029832486825, -6.738193047719709], [-34.729993455533027, -7.343220716992965], [-35.128212042774216, -8.996401462442284], [-35.636966518687707, -9.649281508017811], [-37.046518724096991, -11.040721123908799], [-37.683611619607355, -12.17119475672582], [-38.423876512188436, -13.038118584854285], [-38.673887091616507, -13.057652276260615], [-38.953275722802537, -13.79336964280002], [-38.882298143049645, -15.667053724838764], [-39.161092495264306, -17.208406670808468], [-39.267339240056394, -17.867746270420479], [-39.583521491034219, -18.262295830968934], [-39.76082333022763, -19.599113457927402], [-40.774740770010332, -20.90451181405242], [-40.944756232250597, -21.937316989837807], [-41.75416419123821, -22.370675551037454], [-41.988284267736546, -22.970070489190888], [-43.074703742024738, -22.967693373305462], [-44.647811855637798, -23.351959323827838], [-45.35213578955991, -23.796841729428579], [-46.472093268405523, -24.088968601174539], [-47.648972337420645, -24.885199069927715], [-48.495458136577689, -25.877024834905647], [-48.641004808127725, -26.623697605090928], [-48.474735887228647, -27.175911960561887], [-48.661520351747612, -28.186134535435713], [-48.888457404157393, -28.674115085567877], [-49.587329474472668, -29.224469089476333], [-50.696874152211478, -30.984465020472953], [-51.576226162306149, -31.777698256153204], [-52.256081305538032, -32.245369968394662], [-52.71209998229768, -33.196578057591175], [-53.373661668498229, -33.768377780900757], [-53.650543992718084, -33.202004082981823], [-53.209588995971529, -32.727666110974717], [-53.787951626182185, -32.047242526987617], [-54.572451544805105, -31.494511407193745], [-55.601510179249331, -30.853878676071385], [-55.97324459494093, -30.883075860316296], [-56.976025763564721, -30.109686374636119], [-57.625133429582945, -30.216294854454258]]] } }, - { "type": "Feature", "properties": { "admin": "Brunei", "name": "Brunei", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[114.204016554828343, 4.525873928236805], [114.599961379048707, 4.900011298029965], [115.450710483869798, 5.447729803891532], [115.405700311343566, 4.955227565933837], [115.347460972150643, 4.316636053887009], [114.869557326315373, 4.348313706881924], [114.659595981913498, 4.007636826997753], [114.204016554828343, 4.525873928236805]]] } }, - { "type": "Feature", "properties": { "admin": "Bhutan", "name": "Bhutan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[91.69665652869665, 27.771741848251661], [92.10371178585973, 27.4526140406332], [92.033483514375078, 26.838310451763554], [91.217512648486405, 26.808648179628019], [90.37327477413406, 26.875724188742872], [89.744527622438838, 26.71940298105995], [88.835642531289366, 27.098966376243755], [88.814248488320544, 27.299315904239361], [89.475810174521101, 28.04275889740639], [90.015828891971154, 28.296438503527209], [90.730513950567769, 28.064953925075748], [91.258853794319904, 28.040614325466287], [91.69665652869665, 27.771741848251661]]] } }, - { "type": "Feature", "properties": { "admin": "Botswana", "name": "Botswana", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[25.649163445750155, -18.536025892818987], [25.850391473094724, -18.714412937090533], [26.164790887158478, -19.293085625894935], [27.296504754350501, -20.391519870690995], [27.724747348753247, -20.499058526290387], [27.727227817503252, -20.851801853114711], [28.02137007010861, -21.485975030200578], [28.794656202924209, -21.639454034107445], [29.432188348109033, -22.091312758067584], [28.017235955525244, -22.827753594659072], [27.119409620886238, -23.574323011979772], [26.78640669119741, -24.240690606383478], [26.485753208123292, -24.616326592713097], [25.941652052522151, -24.696373386333214], [25.765848829865206, -25.174845472923671], [25.664666375437712, -25.486816094669706], [25.025170525825782, -25.719670098576891], [24.211266717228792, -25.670215752873567], [23.733569777122703, -25.39012948985161], [23.312096795350179, -25.268689873965712], [22.824271274514896, -25.500458672794768], [22.579531691180584, -25.979447523708142], [22.105968865657864, -26.28025603607913], [21.60589603036939, -26.726533705351748], [20.889609002371731, -26.828542982695907], [20.666470167735437, -26.477453301704916], [20.758609246511831, -25.868136488551446], [20.165725538827186, -24.917961928000768], [19.895767856534427, -24.767790215760588], [19.895457797940672, -21.849156996347865], [20.881134067475866, -21.814327080983144], [20.910641310314531, -18.252218926672018], [21.655040317478971, -18.219146010005222], [23.196858351339298, -17.869038181227783], [23.579005568137713, -18.281261081620055], [24.217364536239209, -17.889347019118485], [24.520705193792534, -17.887124932529932], [25.084443393664564, -17.661815687737366], [25.264225701608005, -17.736539808831413], [25.649163445750155, -18.536025892818987]]] } }, - { "type": "Feature", "properties": { "admin": "Central African Republic", "name": "Central African Rep.", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[15.279460483469107, 7.421924546737968], [16.106231723706767, 7.497087917506504], [16.290561557691884, 7.754307359239304], [16.456184523187343, 7.734773667832966], [16.705988396886251, 7.508327541529978], [17.964929640380884, 7.890914008002865], [18.389554884523218, 8.281303615751822], [18.911021762780504, 8.630894680206351], [18.81200971850927, 8.982914536978596], [19.094008009526018, 9.074846910025837], [20.059685499764267, 9.01270600019485], [21.00086836109616, 9.475985215691507], [21.723821648859452, 10.567055568885973], [22.231129184668784, 10.971888739460507], [22.864165480244218, 11.142395127807543], [22.977543572692603, 10.714462591998538], [23.554304233502187, 10.089255275915306], [23.557249790142826, 9.681218166538683], [23.394779087017181, 9.26506785729222], [23.459012892355979, 8.954285793488891], [23.805813429466745, 8.666318874542425], [24.567369012152078, 8.229187933785466], [25.114932488716786, 7.825104071479172], [25.12413089366472, 7.500085150579436], [25.796647983511171, 6.979315904158069], [26.21341840994511, 6.546603298362071], [26.465909458123232, 5.94671743410187], [27.213409051225163, 5.550953477394557], [27.374226108517483, 5.233944403500059], [27.044065382604703, 5.127852688004835], [26.402760857862535, 5.150874538590869], [25.650455356557465, 5.256087754737123], [25.278798455514302, 5.170408229997191], [25.128833449003274, 4.927244777847789], [24.805028924262409, 4.897246608902349], [24.41053104014625, 5.108784084489129], [23.297213982850135, 4.609693101414221], [22.841479526468103, 4.710126247573483], [22.704123569436284, 4.633050848810156], [22.405123732195531, 4.02916006104732], [21.659122755630019, 4.224341945813719], [20.927591180106273, 4.322785549329736], [20.290679152108932, 4.691677761245287], [19.467783644293146, 5.031527818212779], [18.932312452884755, 4.709506130385973], [18.542982211997778, 4.201785183118317], [18.453065219809925, 3.504385891123348], [17.809900343505259, 3.560196437998569], [17.133042433346297, 3.728196519379451], [16.537058139724135, 3.198254706226278], [16.01285241055535, 2.267639675298084], [15.907380812247649, 2.557389431158612], [15.862732374747479, 3.013537298998982], [15.405395948964379, 3.335300604664339], [15.036219516671249, 3.851367295747123], [14.950953403389658, 4.21038930909492], [14.478372430080466, 4.732605495620446], [14.558935988023501, 5.03059764243153], [14.459407179429345, 5.451760565610299], [14.536560092841111, 6.22695872642069], [14.776545444404572, 6.408498033062044], [15.279460483469107, 7.421924546737968]]] } }, - { "type": "Feature", "properties": { "admin": "Canada", "name": "Canada", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-63.6645, 46.55001], [-62.9393, 46.41587], [-62.01208, 46.44314], [-62.50391, 46.03339], [-62.87433, 45.96818], [-64.1428, 46.39265], [-64.39261, 46.72747], [-64.01486, 47.03601], [-63.6645, 46.55001]]], [[[-61.806305, 49.10506], [-62.29318, 49.08717], [-63.58926, 49.40069], [-64.51912, 49.87304], [-64.17322, 49.95718], [-62.85829, 49.70641], [-61.835585, 49.28855], [-61.806305, 49.10506]]], [[[-123.510001587551116, 48.51001089130343], [-124.012890788399474, 48.370846259141402], [-125.655012777338342, 48.825004584338494], [-125.954994466792726, 49.179995835967638], [-126.850004435871853, 49.530000311880421], [-127.029993449544392, 49.814995835970073], [-128.059336304366212, 49.994959011426594], [-128.444584107102145, 50.53913768167611], [-128.358413656255408, 50.770648098343678], [-127.308581096029883, 50.552573554071948], [-126.695000977212302, 50.40090322529538], [-125.755006673823161, 50.295018215529367], [-125.415001587558791, 49.950000515332604], [-124.920768189119315, 49.47527497008339], [-123.92250870832099, 49.062483628935794], [-123.510001587551116, 48.51001089130343]]], [[[-56.134035814017111, 50.687009792679298], [-56.795881720595261, 49.812308661490945], [-56.143105027884289, 50.15011749938283], [-55.471492275602934, 49.935815334668447], [-55.822401089080913, 49.587128607779093], [-54.93514258484565, 49.313010972686833], [-54.473775397343772, 49.556691189159167], [-53.47654944519131, 49.24913890237405], [-53.786013759971233, 48.516780503933617], [-53.086133999226249, 48.687803656603528], [-52.95864824076223, 48.157164211614472], [-52.648098720904173, 47.53554840757549], [-53.069158291218336, 46.655498765644936], [-53.521456264853029, 46.618291734394823], [-54.178935512902527, 46.807065741556997], [-53.961868659060471, 47.625207017601909], [-54.240482143762122, 47.752279364607617], [-55.400773078011483, 46.88499380145312], [-55.997480841685835, 46.919720363953289], [-55.291219041552765, 47.389562486350982], [-56.250798712780508, 47.632545070987383], [-57.325229254777085, 47.572807115257987], [-59.26601518414676, 47.603347886742498], [-59.41949418805369, 47.89945384377485], [-58.796586473207398, 48.251525376979473], [-59.23162451845652, 48.523188381537793], [-58.391804979065213, 49.125580552764163], [-57.358689744686025, 50.718274034215845], [-56.738650071831998, 51.287438259478527], [-55.87097693543528, 51.632094224649187], [-55.406974249886602, 51.588272610065722], [-55.600218268442077, 51.317074693397913], [-56.134035814017111, 50.687009792679298]]], [[[-133.180004041711669, 54.169975490935308], [-132.710007884431292, 54.040009315423518], [-131.749989584003259, 54.120004380909208], [-132.049480347350965, 52.984621487024519], [-131.179042521826574, 52.18043284769827], [-131.577829549822894, 52.182370713909236], [-132.180428426778519, 52.639707139692391], [-132.549992432313843, 53.100014960332132], [-133.054611178755493, 53.411468817755363], [-133.239664482792676, 53.851080227262386], [-133.180004041711669, 54.169975490935308]]], [[[-79.26582, 62.158675], [-79.65752, 61.63308], [-80.09956, 61.7181], [-80.36215, 62.01649], [-80.315395, 62.085565], [-79.92939, 62.3856], [-79.52002, 62.36371], [-79.26582, 62.158675]]], [[[-81.89825, 62.7108], [-83.06857, 62.15922], [-83.77462, 62.18231], [-83.99367, 62.4528], [-83.25048, 62.91409], [-81.87699, 62.90458], [-81.89825, 62.7108]]], [[[-85.161307949549851, 65.657284654392797], [-84.975763719405933, 65.217518215588981], [-84.464012010419495, 65.371772365980163], [-83.88262630891974, 65.109617824963536], [-82.78757687043877, 64.766693020274673], [-81.642013719392509, 64.455135809986942], [-81.553440314444245, 63.979609280037131], [-80.817361212878851, 64.057485663500998], [-80.103451300766594, 63.725981350348597], [-80.991019863595653, 63.41124603947496], [-82.547178107416997, 63.651722317145229], [-83.108797573565042, 64.101875718839707], [-84.100416632813847, 63.569711819098004], [-85.523404710618991, 63.052379055424076], [-85.866768764982339, 63.637252916103542], [-87.221983201836721, 63.541238104905212], [-86.352759772471259, 64.035833238370699], [-86.224886440765133, 64.822916978608262], [-85.883847825854858, 65.738778388117041], [-85.161307949549851, 65.657284654392797]]], [[[-75.86588, 67.14886], [-76.98687, 67.09873], [-77.2364, 67.58809], [-76.81166, 68.14856], [-75.89521, 68.28721], [-75.1145, 68.01036], [-75.10333, 67.58202], [-75.21597, 67.44425], [-75.86588, 67.14886]]], [[[-95.647681203800488, 69.107690358321761], [-96.269521203800579, 68.757040358321731], [-97.61740120380054, 69.060030358321782], [-98.431801203800504, 68.950700358321768], [-99.797401203800504, 69.400030358321786], [-98.917401203800523, 69.710030358321788], [-98.218261203800466, 70.143540358321744], [-97.157401203800532, 69.860030358321794], [-96.557401203800524, 69.680030358321758], [-96.257401203800498, 69.490030358321761], [-95.647681203800488, 69.107690358321761]]], [[[-90.5471, 69.49766], [-90.55151, 68.47499], [-89.21515, 69.25873], [-88.01966, 68.61508], [-88.31749, 67.87338], [-87.35017, 67.19872], [-86.30607, 67.92146], [-85.57664, 68.78456], [-85.52197, 69.88211], [-84.10081, 69.80539], [-82.62258, 69.65826], [-81.28043, 69.16202], [-81.2202, 68.66567], [-81.96436, 68.13253], [-81.25928, 67.59716], [-81.38653, 67.11078], [-83.34456, 66.41154], [-84.73542, 66.2573], [-85.76943, 66.55833], [-86.0676, 66.05625], [-87.03143, 65.21297], [-87.32324, 64.77563], [-88.48296, 64.09897], [-89.91444, 64.03273], [-90.70398, 63.61017], [-90.77004, 62.96021], [-91.93342, 62.83508], [-93.15698, 62.02469], [-94.24153, 60.89865], [-94.62931, 60.11021], [-94.6846, 58.94882], [-93.21502, 58.78212], [-92.76462, 57.84571], [-92.297029999999893, 57.08709], [-90.89769, 57.28468], [-89.03953, 56.85172], [-88.03978, 56.47162], [-87.32421, 55.99914], [-86.07121, 55.72383], [-85.01181, 55.3026], [-83.36055, 55.24489], [-82.27285, 55.14832], [-82.4362, 54.28227], [-82.12502, 53.27703], [-81.40075, 52.15788], [-79.91289, 51.20842], [-79.14301, 51.53393], [-78.60191, 52.56208], [-79.12421, 54.14145], [-79.82958, 54.66772], [-78.22874, 55.13645], [-77.0956, 55.83741], [-76.54137, 56.53423], [-76.62319, 57.20263], [-77.30226, 58.05209], [-78.51688, 58.80458], [-77.33676, 59.85261], [-77.77272, 60.75788], [-78.10687, 62.31964], [-77.41067, 62.55053], [-75.69621, 62.2784], [-74.6682, 62.18111], [-73.83988, 62.4438], [-72.90853, 62.10507], [-71.67708, 61.52535], [-71.37369, 61.13717], [-69.59042, 61.06141], [-69.62033, 60.22125], [-69.2879, 58.95736], [-68.37455, 58.80106], [-67.64976, 58.21206], [-66.20178, 58.76731], [-65.24517, 59.87071], [-64.58352, 60.33558], [-63.80475, 59.4426], [-62.50236, 58.16708], [-61.39655, 56.96745], [-61.79866, 56.33945], [-60.46853, 55.77548], [-59.56962, 55.20407], [-57.97508, 54.94549], [-57.3332, 54.6265], [-56.93689, 53.78032], [-56.15811, 53.64749], [-55.75632, 53.27036], [-55.68338, 52.14664], [-56.40916, 51.7707], [-57.12691, 51.41972], [-58.77482, 51.0643], [-60.03309, 50.24277], [-61.72366, 50.08046], [-63.86251, 50.29099], [-65.36331, 50.2982], [-66.39905, 50.22897], [-67.23631, 49.51156], [-68.51114, 49.06836], [-69.95362, 47.74488], [-71.10458, 46.82171], [-70.25522, 46.98606], [-68.65, 48.3], [-66.55243, 49.1331], [-65.05626, 49.23278], [-64.17099, 48.74248], [-65.11545, 48.07085], [-64.79854, 46.99297], [-64.47219, 46.23849], [-63.17329, 45.73902], [-61.52072, 45.88377], [-60.51815, 47.00793], [-60.4486, 46.28264], [-59.80287, 45.9204], [-61.03988, 45.26525], [-63.25471, 44.67014], [-64.24656, 44.26553], [-65.36406, 43.54523], [-66.1234, 43.61867], [-66.16173, 44.46512], [-64.42549, 45.29204], [-66.02605, 45.25931], [-67.13741, 45.13753], [-67.79134, 45.70281], [-67.79046, 47.06636], [-68.23444, 47.35486], [-68.905, 47.185], [-69.237216, 47.447781], [-69.99997, 46.69307], [-70.305, 45.915], [-70.66, 45.46], [-71.08482, 45.30524], [-71.405, 45.255], [-71.50506, 45.0082], [-73.34783, 45.00738], [-74.867, 45.00048], [-75.31821, 44.81645], [-76.375, 44.09631], [-76.5, 44.018458893758712], [-76.820034145805565, 43.628784288093748], [-77.737885097957687, 43.62905558936329], [-78.720279914042365, 43.625089423184868], [-79.171673550111862, 43.466339423184216], [-79.01, 43.27], [-78.92, 42.965], [-78.939362148743683, 42.863611355148031], [-80.247447679347928, 42.366199856122584], [-81.277746548167144, 42.209025987306845], [-82.439277716791608, 41.675105088867149], [-82.690089280920162, 41.675105088867149], [-83.029810146806909, 41.832795722005834], [-83.141999681312555, 41.975681057292825], [-83.12, 42.08], [-82.9, 42.43], [-82.43, 42.98], [-82.137642381503881, 43.571087551439909], [-82.337763125431053, 44.44], [-82.550924648758169, 45.347516587905368], [-83.592850714843067, 45.816893622412373], [-83.469550747394621, 45.994686387712584], [-83.616130947590563, 46.116926988299056], [-83.890765347005726, 46.116926988299056], [-84.091851264161463, 46.27541860613816], [-84.14211951367335, 46.512225857115723], [-84.3367, 46.40877], [-84.6049, 46.4396], [-84.543748745445853, 46.538684190449132], [-84.779238247399888, 46.637101955749038], [-84.876079881514855, 46.900083319682366], [-85.652363247403414, 47.220218817730498], [-86.461990831228249, 47.553338019392037], [-87.439792623300207, 47.94], [-88.378114183286698, 48.302917588893727], [-89.272917446636654, 48.019808254582657], [-89.6, 48.01], [-90.83, 48.27], [-91.64, 48.14], [-92.61, 48.45], [-93.63087, 48.60926], [-94.32914, 48.67074], [-94.64, 48.84], [-94.81758, 49.38905], [-95.15609, 49.38425], [-95.159069509172014, 49.0], [-97.228720000004799, 49.0007], [-100.65, 49.0], [-104.04826, 48.99986], [-107.05, 49.0], [-110.05, 49.0], [-113.0, 49.0], [-116.04818, 49.0], [-117.03121, 49.0], [-120.0, 49.0], [-122.84, 49.0], [-122.97421, 49.002537777777789], [-124.91024, 49.98456], [-125.62461, 50.41656], [-127.43561, 50.83061], [-127.99276, 51.71583], [-127.85032, 52.32961], [-129.12979, 52.75538], [-129.30523, 53.56159], [-130.51497, 54.28757], [-130.53611, 54.80278], [-129.98, 55.285], [-130.00778, 55.91583], [-131.70781, 56.55212], [-132.73042, 57.69289], [-133.35556, 58.41028], [-134.27111, 58.86111], [-134.945, 59.27056], [-135.47583, 59.78778], [-136.47972, 59.46389], [-137.4525, 58.905], [-138.34089, 59.56211], [-139.039, 60.0], [-140.013, 60.27682], [-140.99778, 60.30639], [-140.9925, 66.00003], [-140.986, 69.712], [-139.12052, 69.47102], [-137.54636, 68.99002], [-136.50358, 68.89804], [-135.62576, 69.31512], [-134.41464, 69.62743], [-132.92925, 69.50534], [-131.43136, 69.94451], [-129.79471, 70.19369], [-129.10773, 69.77927], [-128.36156, 70.01286], [-128.13817, 70.48384], [-127.44712, 70.37721], [-125.75632, 69.48058], [-124.42483, 70.1584], [-124.28968, 69.39969], [-123.06108, 69.56372], [-122.6835, 69.85553], [-121.47226, 69.79778], [-119.94288, 69.37786], [-117.60268, 69.01128], [-116.22643, 68.84151], [-115.2469, 68.90591], [-113.89794, 68.3989], [-115.30489, 67.90261], [-113.49727, 67.68815], [-110.798, 67.80612], [-109.94619, 67.98104], [-108.8802, 67.38144], [-107.79239, 67.88736], [-108.81299, 68.31164], [-108.16721, 68.65392], [-106.95, 68.7], [-106.15, 68.8], [-105.34282, 68.56122], [-104.33791, 68.018], [-103.22115, 68.09775], [-101.45433, 67.64689], [-99.90195, 67.80566], [-98.4432, 67.78165], [-98.5586, 68.40394], [-97.66948, 68.57864], [-96.11991, 68.23939], [-96.12588, 67.29338], [-95.48943, 68.0907], [-94.685, 68.06383], [-94.23282, 69.06903], [-95.30408, 69.68571], [-96.47131, 70.08976], [-96.39115, 71.19482], [-95.2088, 71.92053], [-93.88997, 71.76015], [-92.87818, 71.31869], [-91.51964, 70.19129], [-92.40692, 69.69997], [-90.5471, 69.49766]]], [[[-114.167169999999871, 73.12145], [-114.66634, 72.65277], [-112.441019999999867, 72.9554], [-111.05039, 72.4504], [-109.920349999999857, 72.96113], [-109.00654, 72.63335], [-108.188349999999886, 71.65089], [-107.68599, 72.06548], [-108.39639, 73.08953], [-107.51645, 73.23598], [-106.522589999999866, 73.07601], [-105.402459999999877, 72.67259], [-104.77484, 71.6984], [-104.464759999999814, 70.99297], [-102.78537, 70.49776], [-100.980779999999868, 70.02432], [-101.089289999999892, 69.58447000000011], [-102.731159999999875, 69.50402], [-102.09329, 69.11962], [-102.43024, 68.75282], [-104.24, 68.91], [-105.96, 69.180000000000135], [-107.12254, 69.11922], [-108.999999999999872, 68.78], [-111.534148875200117, 68.630059156817921], [-113.3132, 68.53554], [-113.854959999999807, 69.007440000000102], [-115.22, 69.28], [-116.10794, 69.16821], [-117.34, 69.960000000000107], [-116.674729999999869, 70.06655], [-115.13112, 70.2373], [-113.72141, 70.19237], [-112.4161, 70.36638], [-114.35, 70.6], [-116.48684, 70.52045], [-117.9048, 70.540560000000127], [-118.43238, 70.9092], [-116.11311, 71.30918], [-117.65568, 71.2952], [-119.40199, 71.55859], [-118.56267, 72.30785], [-117.866419999999877, 72.70594], [-115.18909, 73.314590000000109], [-114.167169999999871, 73.12145]]], [[[-104.5, 73.42], [-105.38, 72.76], [-106.94, 73.46], [-106.6, 73.6], [-105.26, 73.64], [-104.5, 73.42]]], [[[-76.34, 73.102684989953005], [-76.251403808593736, 72.826385498046861], [-77.314437866210895, 72.85554504394527], [-78.391670227050795, 72.876655578613253], [-79.486251831054645, 72.742202758789062], [-79.775833129882827, 72.80290222167973], [-80.876098632812514, 73.333183288574205], [-80.833885192871051, 73.693183898925767], [-80.353057861328111, 73.75971984863277], [-78.064437866210923, 73.651931762695327], [-76.34, 73.102684989953005]]], [[[-86.562178514334107, 73.157447007938444], [-85.774371304044521, 72.534125881633798], [-84.850112474288224, 73.34027822538711], [-82.315590176100969, 73.750950832810574], [-80.600087653307611, 72.716543687624181], [-80.748941616524391, 72.061906643350753], [-78.770638597310764, 72.352173163534147], [-77.824623989559569, 72.749616604291035], [-75.605844692675717, 72.243678493937381], [-74.228616095664975, 71.767144273557889], [-74.099140794557698, 71.330840155717638], [-72.242225714797641, 71.556924546994495], [-71.200015428335192, 70.920012518997211], [-68.78605424668487, 70.525023708774242], [-67.914970465756923, 70.121947536897594], [-66.969033372654152, 69.18608734809186], [-68.805122850200533, 68.720198472764409], [-66.449866095633851, 68.067163397892003], [-64.862314419195215, 67.847538560651614], [-63.424934454996745, 66.928473212340649], [-61.851981370680569, 66.862120673277829], [-62.163176845942296, 66.160251369889593], [-63.91844438338417, 64.998668524832837], [-65.148860236253611, 65.426032619886669], [-66.72121904159853, 66.388041083432185], [-68.015016038673949, 66.262725735124391], [-68.141287400979152, 65.689789130304362], [-67.089646165623392, 65.108455105236985], [-65.732080451099748, 64.64840566675862], [-65.320167609301265, 64.382737128346051], [-64.669406297449669, 63.392926744227474], [-65.013803880458894, 62.674185085695974], [-66.275044725190455, 62.945098781986069], [-68.783186204692711, 63.745670071051805], [-67.369680752213029, 62.883965562584869], [-66.328297288667201, 62.28007477482204], [-66.165568203380147, 61.930897121825879], [-68.877366502544632, 62.330149237712803], [-71.023437059193824, 62.910708116295829], [-72.23537858751898, 63.397836005295154], [-71.886278449171286, 63.679989325608837], [-73.37830624051837, 64.193963121183813], [-74.834418911422588, 64.679075629323776], [-74.818502570276706, 64.389093329517962], [-77.709979824520019, 64.229542344816778], [-78.55594885935416, 64.572906399180127], [-77.897281053361908, 65.309192206474776], [-76.018274298797181, 65.326968899183143], [-73.95979529488271, 65.454764716240888], [-74.293883429649625, 65.81177134872938], [-73.94491248238262, 66.310578111426722], [-72.65116716173938, 67.284575507263853], [-72.926059943316076, 67.726925767682374], [-73.311617804645721, 68.069437160912898], [-74.8433072577768, 68.554627183701271], [-76.869100918266739, 68.894735622830254], [-76.228649054657339, 69.147769273547411], [-77.28736996123709, 69.769540106883269], [-78.168633999326588, 69.826487535268896], [-78.95724219431672, 70.166880194775402], [-79.492455003563649, 69.871807766388898], [-81.305470954091732, 69.743185126414332], [-84.944706183598456, 69.966634019644388], [-87.060003424817864, 70.260001125765356], [-88.681713223001495, 70.410741278760796], [-89.513419562523012, 70.762037665480975], [-88.467721116880753, 71.218185533321318], [-89.888151211287465, 71.222552191849942], [-90.205160285181989, 72.235074367960792], [-89.43657670770493, 73.129464219852352], [-88.408241543312784, 73.537888902471209], [-85.826151089200906, 73.803815823045213], [-86.562178514334107, 73.157447007938444]]], [[[-100.35642, 73.84389], [-99.16387, 73.63339], [-97.38, 73.76], [-97.12, 73.47], [-98.05359, 72.99052], [-96.54, 72.56], [-96.72, 71.66], [-98.35966, 71.27285], [-99.32286, 71.35639], [-100.01482, 71.73827], [-102.5, 72.51], [-102.48, 72.83], [-100.43836, 72.70588], [-101.54, 73.36], [-100.35642, 73.84389]]], [[[-93.196295539100205, 72.771992499473342], [-94.26904659704725, 72.024596259235949], [-95.409855516322637, 72.061880805134578], [-96.033745083382428, 72.940276801231789], [-96.01826799191096, 73.437429918095788], [-95.495793423224001, 73.862416897264154], [-94.503657599652328, 74.134906724739196], [-92.420012173211745, 74.100025132942179], [-90.509792853542578, 73.85673248971203], [-92.003965216829869, 72.966244208458477], [-93.196295539100205, 72.771992499473342]]], [[[-120.46, 71.383601793087578], [-123.09219, 70.90164], [-123.62, 71.34], [-125.92894873747332, 71.868688463011395], [-125.499999999999872, 72.292260811795003], [-124.80729, 73.02256], [-123.94, 73.680000000000135], [-124.917749999999899, 74.292750000000112], [-121.53788, 74.44893], [-120.10978, 74.24135], [-117.55564, 74.18577], [-116.58442, 73.89607], [-115.51081, 73.47519], [-116.767939999999882, 73.22292], [-119.22, 72.52], [-120.46, 71.82], [-120.46, 71.383601793087578]]], [[[-93.612755906940464, 74.979997260224437], [-94.156908738973812, 74.59234650338685], [-95.60868058956558, 74.666863918751758], [-96.820932176484561, 74.927623196096576], [-96.288587409229791, 75.377828274223333], [-94.850819871789113, 75.647217515760886], [-93.977746548217908, 75.296489569795952], [-93.612755906940464, 74.979997260224437]]], [[[-98.5, 76.72], [-97.735585, 76.25656], [-97.704415, 75.74344], [-98.16, 75.0], [-99.80874, 74.89744], [-100.88366, 75.05736], [-100.86292, 75.64075], [-102.50209, 75.5638], [-102.56552, 76.3366], [-101.48973, 76.30537], [-99.98349, 76.64634], [-98.57699, 76.58859], [-98.5, 76.72]]], [[[-108.21141, 76.20168], [-107.81943, 75.84552], [-106.92893, 76.01282], [-105.881, 75.9694], [-105.70498, 75.47951], [-106.31347, 75.00527], [-109.7, 74.85], [-112.22307, 74.41696], [-113.74381, 74.39427], [-113.87135, 74.72029], [-111.79421, 75.1625], [-116.31221, 75.04343], [-117.7104, 75.2222], [-116.34602, 76.19903], [-115.40487, 76.47887], [-112.59056, 76.14134], [-110.81422, 75.54919], [-109.0671, 75.47321], [-110.49726, 76.42982], [-109.5811, 76.79417], [-108.54859, 76.67832], [-108.21141, 76.20168]]], [[[-94.684085862999439, 77.097878323058367], [-93.573921068073105, 76.776295884906062], [-91.605023159536586, 76.778517971494594], [-90.741845872749209, 76.449597479956807], [-90.969661424507976, 76.074013170059445], [-89.822237921899244, 75.847773749485626], [-89.187082892599776, 75.610165513807615], [-87.838276333349611, 75.566188869927217], [-86.379192267588664, 75.482421373182163], [-84.789625210290595, 75.699204006646497], [-82.753444586910049, 75.784315090631225], [-81.12853084992436, 75.713983466282016], [-80.05751095245914, 75.336848863415867], [-79.833932868148324, 74.923127346487192], [-80.457770758775823, 74.657303778777774], [-81.948842536125511, 74.442459011524321], [-83.2288936022114, 74.564027818490928], [-86.097452358733292, 74.410032050261137], [-88.150350307960196, 74.392307033984977], [-89.764722052758358, 74.515555325001117], [-92.422440965529418, 74.837757880340973], [-92.768285488642789, 75.38681997344213], [-92.889905972041717, 75.882655341282629], [-93.893824022175977, 76.319243679500516], [-95.962457445035795, 76.44138092722244], [-97.121378953829463, 76.751077785947587], [-96.745122850312342, 77.161388658345132], [-94.684085862999439, 77.097878323058367]]], [[[-116.198586595507322, 77.645286770326194], [-116.335813361458349, 76.876961575010554], [-117.106050584768766, 76.530031846819114], [-118.040412157038119, 76.481171780087081], [-119.899317586885687, 76.053213406061971], [-121.499995077126471, 75.900018622532784], [-122.85492448615895, 76.116542873835684], [-122.854925293603188, 76.116542873835684], [-121.157535360328239, 76.864507554828336], [-119.103938971821023, 77.512219957174608], [-117.570130784965954, 77.498318996888102], [-116.198586595507322, 77.645286770326194]]], [[[-93.840003017943971, 77.51999726023449], [-94.295608283245244, 77.491342678528682], [-96.169654100310055, 77.55511139597688], [-96.436304490936109, 77.83462921824362], [-94.422577277386353, 77.820004787904978], [-93.720656297565867, 77.634331366680314], [-93.840003017943971, 77.51999726023449]]], [[[-110.186938035912945, 77.697014879050286], [-112.051191169058455, 77.409228827616843], [-113.534278937619035, 77.732206529441143], [-112.724586758253835, 78.051050116681935], [-111.264443325630822, 78.152956041161545], [-109.854451870547067, 77.996324774884812], [-110.186938035912945, 77.697014879050286]]], [[[-109.663145718202557, 78.601972561345676], [-110.88131425661885, 78.406919867659994], [-112.542091437615142, 78.407901719873493], [-112.525890876091566, 78.550554511215225], [-111.500010342233367, 78.849993598130538], [-110.96366065147599, 78.804440823065207], [-109.663145718202557, 78.601972561345676]]], [[[-95.830294969449312, 78.056941229963243], [-97.309842902397975, 77.85059723582178], [-98.124289313533964, 78.082856960757567], [-98.55286780474664, 78.458105373845086], [-98.631984422585504, 78.871930243638374], [-97.337231411512604, 78.831984361476756], [-96.754398769908761, 78.765812689926989], [-95.559277920294562, 78.41831452098026], [-95.830294969449312, 78.056941229963243]]], [[[-100.060191820052111, 78.324754340315891], [-99.670939093813601, 77.907544664207393], [-101.303940192452984, 78.018984890444798], [-102.949808722733025, 78.343228664860206], [-105.176132778731514, 78.38033234324574], [-104.210429450277147, 78.677420152491777], [-105.419580451258511, 78.918335679836431], [-105.492289191493128, 79.301593939929177], [-103.529282396237917, 79.16534902619162], [-100.8251580472688, 78.80046173777869], [-100.060191820052111, 78.324754340315891]]], [[[-87.02, 79.66], [-85.81435, 79.3369], [-87.18756, 79.0393], [-89.03535, 78.28723], [-90.80436, 78.21533], [-92.87669, 78.34333], [-93.95116, 78.75099], [-93.93574, 79.11373], [-93.14524, 79.3801], [-94.974, 79.37248], [-96.07614, 79.70502], [-96.70972, 80.15777], [-96.01644, 80.60233], [-95.32345, 80.90729], [-94.29843, 80.97727], [-94.73542, 81.20646], [-92.40984, 81.25739], [-91.13289, 80.72345], [-89.45, 80.509322033898258], [-87.81, 80.32], [-87.02, 79.66]]], [[[-68.5, 83.106321516765732], [-65.82735, 83.02801], [-63.68, 82.9], [-61.85, 82.6286], [-61.89388, 82.36165], [-64.334, 81.92775], [-66.75342, 81.72527], [-67.65755, 81.50141], [-65.48031, 81.50657], [-67.84, 80.9], [-69.4697, 80.61683], [-71.18, 79.8], [-73.2428, 79.63415], [-73.88, 79.430162204802073], [-76.90773, 79.32309], [-75.52924, 79.19766], [-76.22046, 79.01907], [-75.39345, 78.52581], [-76.34354, 78.18296], [-77.88851, 77.89991], [-78.36269, 77.50859], [-79.75951, 77.20968], [-79.61965, 76.98336], [-77.91089, 77.022045], [-77.88911, 76.777955], [-80.56125, 76.17812], [-83.17439, 76.45403], [-86.11184, 76.29901], [-87.6, 76.42], [-89.49068, 76.47239], [-89.6161, 76.95213], [-87.76739, 77.17833], [-88.26, 77.9], [-87.65, 77.970222222222205], [-84.97634, 77.53873], [-86.34, 78.18], [-87.96192, 78.37181], [-87.15198, 78.75867], [-85.37868, 78.9969], [-85.09495, 79.34543], [-86.50734, 79.73624], [-86.93179, 80.25145], [-84.19844, 80.20836], [-83.408695652173819, 80.1], [-81.84823, 80.46442], [-84.1, 80.58], [-87.59895, 80.51627], [-89.36663, 80.85569], [-90.2, 81.26], [-91.36786, 81.5531], [-91.58702, 81.89429], [-90.1, 82.085], [-88.93227, 82.11751], [-86.97024, 82.27961], [-85.5, 82.652273458057024], [-84.260005, 82.6], [-83.18, 82.32], [-82.42, 82.86], [-81.1, 83.02], [-79.30664, 83.13056], [-76.25, 83.172058823529369], [-75.71878, 83.06404], [-72.83153, 83.23324], [-70.665765, 83.169780758382828], [-68.5, 83.106321516765732]]]] } }, - { "type": "Feature", "properties": { "admin": "Switzerland", "name": "Switzerland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.594226108446346, 47.525058091820256], [9.632931756232974, 47.347601223329974], [9.479969516649019, 47.102809963563367], [9.932448357796657, 46.920728054382948], [10.442701450246627, 46.893546250997424], [10.36337812667861, 46.483571275409851], [9.922836541390378, 46.314899400409182], [9.182881707403054, 46.440214748716976], [8.966305779667804, 46.036931871111186], [8.489952426801322, 46.005150865251672], [8.316629672894377, 46.163642483090847], [7.755992058959832, 45.824490057959302], [7.273850945676655, 45.776947740250769], [6.843592970414504, 45.991146552100595], [6.500099724970424, 46.429672756529428], [6.022609490593537, 46.272989813820466], [6.037388950229, 46.725778713561859], [6.768713820023605, 47.287708238303686], [6.736571079138058, 47.541801255882838], [7.192202182655505, 47.449765529971003], [7.466759067422228, 47.620581976911794], [8.31730146651415, 47.613579820336255], [8.522611932009765, 47.830827541691285], [9.594226108446346, 47.525058091820256]]] } }, - { "type": "Feature", "properties": { "admin": "Chile", "name": "Chile", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-68.634010227583147, -52.636370458874353], [-68.633349999999879, -54.8695], [-67.56244, -54.87001], [-66.95992, -54.89681], [-67.291029999999878, -55.30124], [-68.148629999999841, -55.61183], [-68.639990810811796, -55.580017999086877], [-69.2321, -55.49906], [-69.95809, -55.19843], [-71.00568, -55.05383], [-72.2639, -54.49514], [-73.2852, -53.957519999999874], [-74.66253, -52.83749], [-73.8381, -53.04743], [-72.43418, -53.7154], [-71.10773, -54.07433], [-70.591779999999787, -53.61583], [-70.26748, -52.93123], [-69.345649999999878, -52.5183], [-68.634010227583147, -52.636370458874353]]], [[[-68.219913092711224, -21.49434661223183], [-67.828179897722634, -22.872918796482178], [-67.106673550063604, -22.735924574476392], [-66.985233934177629, -22.986348565362825], [-67.328442959244128, -24.025303236590908], [-68.417652960876111, -24.518554782816874], [-68.386001146097342, -26.185016371365229], [-68.594799770772667, -26.50690886811126], [-68.295541551370391, -26.899339694935787], [-69.001234910748266, -27.521213881136127], [-69.656130337183143, -28.459141127233686], [-70.013550381129861, -29.367922865518544], [-69.919008348251921, -30.336339206668306], [-70.535068935819439, -31.365010267870279], [-70.074399380153622, -33.09120981214803], [-69.814776984319209, -33.273886000299839], [-69.817309129501453, -34.193571465798279], [-70.388049485949082, -35.169687595359441], [-70.364769253201658, -36.005088799789931], [-71.121880662709771, -36.65812387466233], [-71.118625047475419, -37.576827487947192], [-70.814664272734703, -38.552995293940732], [-71.413516608349042, -38.916022230791107], [-71.680761277946445, -39.808164157878061], [-71.915734015577542, -40.832339369470716], [-71.746803758415453, -42.051386407235988], [-72.148898078078517, -42.254888197601375], [-71.915423956983901, -43.408564548517404], [-71.464056159130493, -43.787611179378324], [-71.793622606071935, -44.207172133156099], [-71.329800788036195, -44.407521661151677], [-71.222778896759721, -44.784242852559409], [-71.659315558545316, -44.973688653341434], [-71.552009446891233, -45.560732924177117], [-71.917258470330196, -46.884838148791786], [-72.44735531278026, -47.738532810253517], [-72.331160854771937, -48.244238376661819], [-72.648247443314929, -48.878618259476774], [-73.415435757120022, -49.318436374712952], [-73.328050910114456, -50.378785088909865], [-72.975746832964617, -50.741450290734299], [-72.309973517532342, -50.677009779666342], [-72.329403856074023, -51.425956312872394], [-71.914803839796321, -52.009022305865912], [-69.498362189396076, -52.142760912637236], [-68.571545376241332, -52.299443855346247], [-69.461284349226617, -52.291950772663924], [-69.94277950710611, -52.537930590373243], [-70.8451016913545, -52.899200528525711], [-71.006332160105217, -53.833252042201345], [-71.429794684520928, -53.856454760300373], [-72.557942877884855, -53.531410001184447], [-73.702756720662862, -52.835069268607249], [-73.702756720662862, -52.835070076051487], [-74.946763475225154, -52.262753588419017], [-75.260026007778507, -51.62935475037321], [-74.976632453089806, -51.043395684615675], [-75.47975419788348, -50.378371677451547], [-75.608015102831942, -48.673772881871784], [-75.182769741502128, -47.711919447623153], [-74.126580980104677, -46.939253431995084], [-75.644395311165439, -46.647643324572016], [-74.69215369332305, -45.76397633238097], [-74.351709357384252, -44.10304412208788], [-73.240356004515192, -44.454960625995611], [-72.717803921179765, -42.383355808278985], [-73.388899909138232, -42.117532240569567], [-73.701335618774834, -43.365776462579738], [-74.33194312203257, -43.224958184584395], [-74.017957119427152, -41.794812920906828], [-73.677099372029943, -39.942212823243111], [-73.217592536090663, -39.258688653318508], [-73.505559455037044, -38.282882582351064], [-73.588060879191076, -37.156284681956016], [-73.166717088499283, -37.123780206044351], [-72.553136969681717, -35.508840020491022], [-71.861732143832555, -33.909092706031522], [-71.438450486929895, -32.418899428030819], [-71.668720669222424, -30.920644626592516], [-71.370082567007714, -30.095682061484997], [-71.48989437527645, -28.861442152625909], [-70.905123867461569, -27.640379734001193], [-70.724953986275963, -25.705924167587209], [-70.403965827095035, -23.628996677344542], [-70.091245897080668, -21.393319187101223], [-70.164419725205974, -19.756468194256183], [-70.372572394477714, -18.347975355708879], [-69.858443569605797, -18.092693780187027], [-69.590423753523979, -17.580011895419286], [-69.100246955019401, -18.260125420812653], [-68.966818406841824, -18.981683444904089], [-68.442225104430918, -19.405068454671419], [-68.757167121033703, -20.37265797290447], [-68.219913092711224, -21.49434661223183]]]] } }, - { "type": "Feature", "properties": { "admin": "China", "name": "China", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[110.339187860151526, 18.678395087147603], [109.475209588663702, 18.19770091396861], [108.655207961056135, 18.507681993071397], [108.626217482540426, 19.367887885001974], [109.119055617308007, 19.821038519769385], [110.211598748822837, 20.101253973872073], [110.786550734502228, 20.077534491450077], [111.01005130416462, 19.695929877190732], [110.570646600386794, 19.255879218009305], [110.339187860151526, 18.678395087147603]]], [[[127.657407261262378, 49.760270494172929], [129.397817824420429, 49.440600084015429], [130.58229332898236, 48.729687404976112], [130.987281528853828, 47.790132351261391], [132.506671991099495, 47.788969631534876], [133.373595819228001, 48.183441677434914], [135.026311476786702, 48.478229885443902], [134.500813836810607, 47.578439846377833], [134.112362095272601, 47.212467352886719], [133.76964399631288, 46.116926988299056], [133.097126906466428, 45.14406647397216], [131.883454217659562, 45.32116160743643], [131.025212030156069, 44.967953192721573], [131.288555129115537, 44.111519680348252], [131.144687941614848, 42.929989732426932], [130.633866408409801, 42.903014634770543], [130.640015903852429, 42.39500946712527], [129.994267205933227, 42.985386867843793], [129.596668735879462, 42.424981797854592], [128.05221520397231, 41.994284572917984], [128.208433058790717, 41.466771552082534], [127.343782993683021, 41.503151760415953], [126.869083286649854, 41.816569322266155], [126.18204511932943, 41.107336127276362], [125.079941847840587, 40.569823716792449], [124.265624627785314, 39.928493353834135], [122.86757042856101, 39.637787583976255], [122.131387974130917, 39.170451768544623], [121.054554478032856, 38.89747101496291], [121.585994907722466, 39.360853583324136], [121.376757033372641, 39.750261338859524], [122.168595005381007, 40.422442531896046], [121.640358514493528, 40.946389878903304], [120.768628778161954, 40.593388169917596], [119.639602085449056, 39.898055935214209], [119.023463983233015, 39.252333075511096], [118.042748651197897, 39.204273993479674], [117.532702264477052, 38.73763580988409], [118.05969852098967, 38.061475531561051], [118.878149855628351, 37.897325344385898], [118.911636183753501, 37.448463853498723], [119.702802362142037, 37.156388658185072], [120.823457472823648, 37.870427761377968], [121.711258579597938, 37.481123358707165], [122.357937453298462, 37.454484157860684], [122.519994744965814, 36.930614325501828], [121.104163853033029, 36.651329047180432], [120.63700890511457, 36.111439520811125], [119.66456180224607, 35.609790554337728], [119.151208123858567, 34.909859117160458], [120.227524855633717, 34.360331936168613], [120.620369093916565, 33.37672272392512], [121.229014113450219, 32.460318711877186], [121.908145786630044, 31.692174384074683], [121.891919386890336, 30.949351508095098], [121.264257440273298, 30.676267401648712], [121.503519321784722, 30.14291494396425], [122.092113885589086, 29.832520453403156], [121.93842817595305, 29.018022365834803], [121.684438511238469, 28.225512600206677], [121.125661248866436, 28.135673122667178], [120.395473260582307, 27.053206895449385], [119.585496860839555, 25.740780544532605], [118.656871372554519, 24.547390855400234], [117.281606479970833, 23.624501451099714], [115.890735304835118, 22.782873236578094], [114.763827345846209, 22.668074042241663], [114.152546828265656, 22.223760077396204], [113.806779819800752, 22.548339748621423], [113.241077915501592, 22.051367499270462], [111.843592157032447, 21.550493679281512], [110.78546552942413, 21.39714386645533], [110.444039341271662, 20.34103261970639], [109.88986128137357, 20.282457383703441], [109.627655063924635, 21.008227037026725], [109.864488153118316, 21.395050970947516], [108.522812941524421, 21.715212307211821], [108.050180291782979, 21.552379869060101], [107.043420037872636, 21.8118989120299], [106.567273390735352, 22.21820486092474], [106.725403273548466, 22.794267889898375], [105.811247186305209, 22.976892401617899], [105.329209425886631, 23.352063300056976], [104.476858351664475, 22.819150092046918], [103.504514601660503, 22.703756618739217], [102.706992222100155, 22.708795070887696], [102.170435825613552, 22.464753119389336], [101.652017856861576, 22.318198757409554], [101.803119744882906, 21.174366766845051], [101.27002566936001, 21.201651923095167], [101.180005324307558, 21.436572984294052], [101.150032993578236, 21.849984442629015], [100.416537713627349, 21.558839423096654], [99.983489211021549, 21.742936713136451], [99.240898878987196, 22.118314317304559], [99.53199222208741, 22.949038804612591], [98.898749220782804, 23.142722072842581], [98.66026248575578, 24.063286037690002], [97.604719679762027, 23.897404690033049], [97.724609002679131, 25.083637193293036], [98.671838006589212, 25.91870250091349], [98.712093947344556, 26.743535874940243], [98.682690057370507, 27.508812160750658], [98.246230910233351, 27.747221381129172], [97.91198774616943, 28.335945136014367], [97.327113885490007, 28.261582749946339], [96.248833449287829, 28.411030992134467], [96.586590610747521, 28.830979519154361], [96.117678664131006, 29.452802028922513], [95.404802280664626, 29.031716620392157], [94.565990431702929, 29.27743805593996], [93.413347609432662, 28.640629380807233], [92.503118931043616, 27.896876329046442], [91.696656528696693, 27.771741848251615], [91.258853794319876, 28.040614325466343], [90.730513950567797, 28.064953925075738], [90.015828891971182, 28.296438503527177], [89.475810174521158, 28.042758897406365], [88.814248488320573, 27.299315904239389], [88.730325962278528, 28.086864732367552], [88.120440708369941, 27.876541652939572], [86.954517043000635, 27.974261786403524], [85.823319940131526, 28.203575954698742], [85.011638218123053, 28.642773952747369], [84.23457970575015, 28.839893703724691], [83.89899295444674, 29.320226141877633], [83.337115106137176, 29.463731594352193], [82.327512648450877, 30.115268052688204], [81.525804477874786, 30.422716986608659], [81.111256138029276, 30.183480943313402], [79.721366815107118, 30.882714748654728], [78.738894484374001, 31.515906073527045], [78.458446486326025, 32.61816437431272], [79.176128777995544, 32.483779812137747], [79.208891636068543, 32.994394639613738], [78.811086460285722, 33.506198025032397], [78.912268914713209, 34.321936346975768], [77.83745079947461, 35.494009507787794], [76.192848341785705, 35.89840342868785], [75.896897414050173, 36.666806138651872], [75.158027785140987, 37.133030910789152], [74.980002475895404, 37.419990139305888], [74.829985792952144, 37.990007025701445], [74.864815708316783, 38.378846340481587], [74.25751427602269, 38.606506862943476], [73.928852166646394, 38.505815334622717], [73.675379266254836, 39.431236884105566], [73.960013055318427, 39.660008449861714], [73.822243686828315, 39.893973497063136], [74.776862420556043, 40.366425279291619], [75.467827996730719, 40.56207225194867], [76.526368035797432, 40.427946071935132], [76.90448449087711, 41.066485907549648], [78.187196893226044, 41.185315863604799], [78.543660923175253, 41.582242540038713], [80.119430373051401, 42.12394074153822], [80.259990268885318, 42.34999929459908], [80.180150180994374, 42.920067857426844], [80.866206496101213, 43.180362046881008], [79.966106398441426, 44.917516994804622], [81.947070753918084, 45.317027492853143], [82.458925815769035, 45.539649563166499], [83.180483839860543, 47.330031236350735], [85.164290399113213, 47.000955715516099], [85.720483839870667, 47.452969468773077], [85.76823286330837, 48.455750637396896], [86.59877648310335, 48.549181626980605], [87.359970330762692, 49.214980780629148], [87.751264276076668, 49.297197984405464], [88.013832228551678, 48.599462795600594], [88.854297723346747, 48.069081732773007], [90.280825636763893, 47.693549099307901], [90.970809360724957, 46.88814606382293], [90.585768263718307, 45.719716091487491], [90.945539585334316, 45.286073309910243], [92.133890822318222, 45.115075995456429], [93.480733677141316, 44.97547211362], [94.688928664125356, 44.352331854828456], [95.306875441471504, 44.241330878265458], [95.762454868556688, 43.319449164394619], [96.349395786527808, 42.725635280928643], [97.451757440177971, 42.74888967546007], [99.515817498779995, 42.524691473961688], [100.845865513108279, 42.663804429691417], [101.833040399179936, 42.51487295182627], [103.312278273534787, 41.907468166667613], [104.522281935649005, 41.90834666601662], [104.964993931093431, 41.597409572916334], [106.129315627061658, 42.134327704428891], [107.744772576937976, 42.481515814781908], [109.243595819131428, 42.519446316084149], [110.412103306115299, 42.871233628911014], [111.129682244920218, 43.406834011400171], [111.82958784388137, 43.743118394539486], [111.667737257943202, 44.073175767587706], [111.348376906379428, 44.457441718110047], [111.87330610560025, 45.102079372735112], [112.436062453258842, 45.01164561622425], [113.463906691544196, 44.808893134127111], [114.46033165899604, 45.339816799493875], [115.985096470200133, 45.727235012386004], [116.717868280098855, 46.38820241961524], [117.421701287914246, 46.67273285581421], [118.874325799638711, 46.805412095723646], [119.663269891438745, 46.692679958678944], [119.772823927897562, 47.048058783550132], [118.866574334794947, 47.747060044946195], [118.064142694166719, 48.06673045510373], [117.295507440257438, 47.697709052107385], [116.308952671373234, 47.853410142602812], [115.742837355615734, 47.726544501326273], [115.485282017073018, 48.135382595403442], [116.191802199367601, 49.134598090199056], [116.67880089728618, 49.888531399121398], [117.879244419426371, 49.510983384796944], [119.288460728025839, 50.142882798862033], [119.279365675942358, 50.582907619827282], [120.182049595216924, 51.64356639261802], [120.738191359541972, 51.964115302124547], [120.725789015791975, 52.516226304730814], [120.177088657716865, 52.753886216841195], [121.003084751470226, 53.251401068731226], [122.245747918792858, 53.431725979213681], [123.571506789240843, 53.458804429734627], [125.068211297710434, 53.161044826868832], [125.946348911646169, 52.792798570356936], [126.564399041856959, 51.784255479532689], [126.939156528837657, 51.353894151405896], [127.287455682484904, 50.739797268265434], [127.657407261262378, 49.760270494172929]]]] } }, - { "type": "Feature", "properties": { "admin": "Ivory Coast", "name": "Côte d'Ivoire", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.856125047202397, 4.994475816259508], [-3.311084357100071, 4.984295559098014], [-4.008819545904941, 5.179813340674314], [-4.64991736491791, 5.168263658057084], [-5.834496222344525, 4.993700669775135], [-6.528769090185845, 4.705087795425015], [-7.518941209330434, 4.338288479017307], [-7.712159389669749, 4.364565944837721], [-7.63536821128403, 5.188159084489455], [-7.53971513511176, 5.313345241716517], [-7.570152553731686, 5.707352199725903], [-7.993692592795879, 6.126189683451541], [-8.311347622094017, 6.193033148621081], [-8.602880214868618, 6.467564195171659], [-8.385451626000572, 6.911800645368742], [-8.485445522485348, 7.395207831243068], [-8.439298468448696, 7.686042792181736], [-8.280703497744936, 7.687179673692156], [-8.221792364932197, 8.123328762235571], [-8.299048631208562, 8.316443589710302], [-8.203498907900878, 8.455453192575446], [-7.832100389019186, 8.575704250518625], [-8.079113735374348, 9.376223863152033], [-8.309616461612249, 9.789531968622439], [-8.22933712404682, 10.129020290563897], [-8.029943610048617, 10.206534939001711], [-7.89958980959237, 10.297382106970824], [-7.622759161804808, 10.147236232946792], [-6.850506557635057, 10.138993841996237], [-6.666460944027547, 10.430810655148447], [-6.493965013037267, 10.411302801958268], [-6.205222947606429, 10.524060777219132], [-6.050452032892266, 10.096360785355442], [-5.816926235365286, 10.222554633012191], [-5.404341599946973, 10.370736802609144], [-4.954653286143098, 10.152713934769732], [-4.779883592131966, 9.821984768101741], [-4.330246954760383, 9.610834865757139], [-3.980449184576684, 9.862344061721698], [-3.511898972986272, 9.900326239456216], [-2.827496303712706, 9.642460842319775], [-2.56218950032624, 8.219627793811481], [-2.983584967450326, 7.379704901555511], [-3.244370083011261, 6.2504715031135], [-2.810701463217839, 5.389051215024109], [-2.856125047202397, 4.994475816259508]]] } }, - { "type": "Feature", "properties": { "admin": "Cameroon", "name": "Cameroon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[13.07582238124675, 2.267097072759014], [12.951333855855605, 2.321615708826939], [12.359380323952218, 2.19281220133945], [11.751665480199787, 2.326757513839993], [11.276449008843711, 2.261050930180871], [9.649158155972627, 2.283866075037735], [9.795195753629455, 3.073404445809117], [9.404366896205998, 3.734526882335202], [8.948115675501068, 3.904128933117135], [8.744923943729416, 4.352215277519959], [8.488815545290889, 4.495617377129917], [8.500287713259693, 4.771982937026847], [8.757532993208626, 5.47966583904791], [9.233162876023043, 6.444490668153334], [9.522705926154398, 6.453482367372116], [10.118276808318255, 7.038769639509879], [10.497375115611417, 7.055357774275562], [11.058787876030349, 6.644426784690593], [11.745774366918509, 6.981382961449753], [11.839308709366801, 7.397042344589434], [12.063946160539556, 7.799808457872301], [12.218872104550597, 8.305824082874322], [12.753671502339214, 8.717762762888993], [12.955467970438971, 9.417771714714702], [13.1675997249971, 9.64062632897341], [13.308676385153914, 10.160362046748926], [13.572949659894558, 10.798565985553564], [14.415378859116682, 11.572368882692071], [14.468192172918974, 11.90475169519341], [14.57717776862253, 12.085360826053501], [14.181336297266792, 12.483656927943112], [14.213530714584634, 12.802035427293344], [14.495787387762842, 12.859396267137326], [14.893385857816522, 12.219047756392582], [14.960151808337598, 11.555574042197222], [14.923564894274955, 10.891325181517471], [15.467872755605269, 9.982336737503429], [14.909353875394713, 9.99212942142273], [14.627200555081057, 9.920919297724536], [14.171466098699025, 10.021378282099928], [13.954218377344002, 9.549494940626685], [14.544466586981766, 8.965861314322266], [14.979995558337688, 8.796104234243471], [15.120865512765331, 8.382150173369423], [15.436091749745765, 7.692812404811971], [15.279460483469107, 7.421924546737968], [14.776545444404572, 6.408498033062044], [14.536560092841111, 6.22695872642069], [14.459407179429345, 5.451760565610299], [14.558935988023501, 5.03059764243153], [14.478372430080466, 4.732605495620446], [14.950953403389658, 4.21038930909492], [15.036219516671249, 3.851367295747123], [15.405395948964379, 3.335300604664339], [15.862732374747479, 3.013537298998982], [15.907380812247649, 2.557389431158612], [16.01285241055535, 2.267639675298084], [15.940918816805061, 1.727672634280295], [15.14634199388524, 1.964014797367184], [14.337812534246577, 2.22787466064949], [13.07582238124675, 2.267097072759014]]] } }, - { "type": "Feature", "properties": { "admin": "Democratic Republic of the Congo", "name": "Dem. Rep. Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.833859897593801, 3.50916596111034], [30.773346795380036, 2.339883327642127], [31.174149204235807, 2.204465236821263], [30.852670118948048, 1.849396470543809], [30.468507521290292, 1.58380544677972], [30.086153598762703, 1.062312730306288], [29.875778842902488, 0.597379868976304], [29.819503208136634, -0.205310153813372], [29.587837762172164, -0.58740569417948], [29.579466180140876, -1.341313164885626], [29.29188683443661, -1.620055840667987], [29.254834832483336, -2.215109958508911], [29.117478875451546, -2.292211195488384], [29.02492638521678, -2.839257907730157], [29.276383904749046, -3.293907159034063], [29.339997592900342, -4.499983412294092], [29.519986606572925, -5.419978936386313], [29.41999271008816, -5.939998874539432], [29.620032179490003, -6.520015150583424], [30.199996779101692, -7.079980970898161], [30.740015496551781, -8.340007419470913], [30.34608605319081, -8.238256524288216], [29.002912225060467, -8.40703175215347], [28.734866570762495, -8.526559340044576], [28.449871046672818, -9.164918308146083], [28.673681674928922, -9.605924981324931], [28.496069777141763, -10.789883721564044], [28.372253045370421, -11.793646742401389], [28.642417433392346, -11.971568698782312], [29.341547885869087, -12.36074391037241], [29.616001417771223, -12.178894545137307], [29.699613885219485, -13.257226657771827], [28.934285922976834, -13.248958428605132], [28.52356163912102, -12.698604424696679], [28.15510867687998, -12.272480564017894], [27.38879886242378, -12.132747491100663], [27.164419793412456, -11.608748467661071], [26.55308759939961, -11.924439792532125], [25.752309604604726, -11.784965101776356], [25.418118116973197, -11.330935967659958], [24.783169793402948, -11.238693536018962], [24.314516228947948, -11.262826429899269], [24.257155389103982, -10.951992689663655], [23.912215203555714, -10.926826267137512], [23.456790805767433, -10.867863457892481], [22.837345411884733, -11.017621758674329], [22.402798292742371, -10.99307545333569], [22.155268182064304, -11.084801120653768], [22.208753289486388, -9.894796237836507], [21.87518191904234, -9.523707777548564], [21.801801385187897, -8.908706556842978], [21.949130893652036, -8.305900974158275], [21.746455926203303, -7.920084730667147], [21.728110792739695, -7.2908724910813], [20.514748162526498, -7.299605808138629], [20.601822950938292, -6.93931772219968], [20.091621534920645, -6.943090101756993], [20.037723016040214, -7.116361179231644], [19.417502475673157, -7.155428562044297], [19.166613396896107, -7.738183688999753], [19.016751743249664, -7.988245944860132], [18.464175652752683, -7.847014255406442], [18.134221632569048, -7.98767750410492], [17.472970004962232, -8.068551120641699], [17.089995965247166, -7.545688978712525], [16.860190870845198, -7.222297865429984], [16.573179965896141, -6.622644545115087], [16.326528354567042, -5.877470391466267], [13.375597364971892, -5.864241224799548], [13.02486941900696, -5.984388929878157], [12.735171339578695, -5.965682061388497], [12.322431674863507, -6.100092461779658], [12.182336866920249, -5.789930515163837], [12.436688266660866, -5.684303887559245], [12.468004184629734, -5.248361504745003], [12.631611769265788, -4.991271254092935], [12.995517205465173, -4.781103203961883], [13.258240187237044, -4.882957452009165], [13.600234816144676, -4.500138441590969], [14.144956088933295, -4.510008640158715], [14.209034864975219, -4.793092136253597], [14.582603794013179, -4.970238946150139], [15.170991652088441, -4.3435071753143], [15.753540073314749, -3.855164890156096], [16.006289503654298, -3.535132744972528], [15.972803175529149, -2.712392266453612], [16.407091912510051, -1.740927015798682], [16.86530683764212, -1.225816338713287], [17.523716261472853, -0.743830254726987], [17.638644646889983, -0.424831638189246], [17.663552687254676, -0.058083998213817], [17.826540154703245, 0.288923244626105], [17.774191928791563, 0.855658677571085], [17.89883548347958, 1.741831976728278], [18.09427575040743, 2.365721543788055], [18.39379235197114, 2.90044342692822], [18.453065219809925, 3.504385891123348], [18.542982211997778, 4.201785183118317], [18.932312452884755, 4.709506130385973], [19.467783644293146, 5.031527818212779], [20.290679152108932, 4.691677761245287], [20.927591180106273, 4.322785549329736], [21.659122755630019, 4.224341945813719], [22.405123732195531, 4.02916006104732], [22.704123569436284, 4.633050848810156], [22.841479526468103, 4.710126247573483], [23.297213982850135, 4.609693101414221], [24.41053104014625, 5.108784084489129], [24.805028924262409, 4.897246608902349], [25.128833449003274, 4.927244777847789], [25.278798455514302, 5.170408229997191], [25.650455356557465, 5.256087754737123], [26.402760857862535, 5.150874538590869], [27.044065382604703, 5.127852688004835], [27.374226108517483, 5.233944403500059], [27.979977247842807, 4.408413397637373], [28.428993768026906, 4.287154649264493], [28.696677687298795, 4.455077215996936], [29.159078403446497, 4.38926727947323], [29.715995314256013, 4.600804755060024], [29.953500197069467, 4.173699042167683], [30.833859897593801, 3.50916596111034]]] } }, - { "type": "Feature", "properties": { "admin": "Republic of Congo", "name": "Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[12.995517205465173, -4.781103203961883], [12.620759718484491, -4.438023369976135], [12.318607618873923, -4.606230157086187], [11.914963006242086, -5.037986748884789], [11.093772820691923, -3.978826592630546], [11.855121697648114, -3.42687061932105], [11.478038771214299, -2.765618991714241], [11.820963575903189, -2.514161472181982], [12.495702752338159, -2.391688327650242], [12.575284458067639, -1.948511244315134], [13.109618767965626, -2.428740329603513], [13.992407260807706, -2.470804945489099], [14.299210239324564, -1.998275648612213], [14.425455763413593, -1.333406670744971], [14.316418491277741, -0.552627455247048], [13.843320753645653, 0.038757635901149], [14.276265903386953, 1.196929836426619], [14.026668735417214, 1.395677395021153], [13.282631463278816, 1.31418366129688], [13.003113641012074, 1.830896307783319], [13.07582238124675, 2.267097072759014], [14.337812534246577, 2.22787466064949], [15.14634199388524, 1.964014797367184], [15.940918816805061, 1.727672634280295], [16.01285241055535, 2.267639675298084], [16.537058139724135, 3.198254706226278], [17.133042433346297, 3.728196519379451], [17.809900343505259, 3.560196437998569], [18.453065219809925, 3.504385891123348], [18.39379235197114, 2.90044342692822], [18.09427575040743, 2.365721543788055], [17.89883548347958, 1.741831976728278], [17.774191928791563, 0.855658677571085], [17.826540154703245, 0.288923244626105], [17.663552687254676, -0.058083998213817], [17.638644646889983, -0.424831638189246], [17.523716261472853, -0.743830254726987], [16.86530683764212, -1.225816338713287], [16.407091912510051, -1.740927015798682], [15.972803175529149, -2.712392266453612], [16.006289503654298, -3.535132744972528], [15.753540073314749, -3.855164890156096], [15.170991652088441, -4.3435071753143], [14.582603794013179, -4.970238946150139], [14.209034864975219, -4.793092136253597], [14.144956088933295, -4.510008640158715], [13.600234816144676, -4.500138441590969], [13.258240187237044, -4.882957452009165], [12.995517205465173, -4.781103203961883]]] } }, - { "type": "Feature", "properties": { "admin": "Colombia", "name": "Colombia", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-75.373223232713841, -0.15203175212045], [-75.801465827116587, 0.084801337073202], [-76.292314419240938, 0.416047268064119], [-76.576379767549383, 0.256935533037435], [-77.424984300430367, 0.395686753741117], [-77.668612840470416, 0.825893052570961], [-77.855061408179509, 0.809925034992773], [-78.855258755188686, 1.380923773601822], [-78.990935228171026, 1.691369940595251], [-78.617831387023699, 1.766404120283056], [-78.662118089497838, 2.267355454920476], [-78.427610439757302, 2.629555568854215], [-77.931542527971473, 2.696605739752925], [-77.510431281224996, 3.325016994638246], [-77.127689785455246, 3.849636135265356], [-77.496271938776999, 4.087606105969427], [-77.307601284479375, 4.667984117039452], [-77.533220587865713, 5.582811997902496], [-77.318815070286718, 5.845354112161359], [-77.476660732722266, 6.691116441266301], [-77.881571417945239, 7.223771267114783], [-77.75341386586139, 7.709839789252141], [-77.431107957656977, 7.638061224798733], [-77.242566494440069, 7.935278225125442], [-77.474722866511314, 8.524286200388216], [-77.353360765273848, 8.670504665558068], [-76.836673957003541, 8.638749497914715], [-76.086383836557843, 9.336820583529486], [-75.674600185840035, 9.443248195834597], [-75.664704149056149, 9.774003200718736], [-75.480425991503338, 10.618990383339305], [-74.906895107711975, 11.08304474532032], [-74.276752692344871, 11.102035834187586], [-74.197222663047683, 11.310472723836865], [-73.414763963500278, 11.227015285685479], [-72.62783525255962, 11.731971543825519], [-72.238194953078903, 11.955549628136325], [-71.754090135368628, 12.437303168177305], [-71.399822353791691, 12.376040757695289], [-71.137461107045866, 12.112981879113503], [-71.331583624950284, 11.776284084515805], [-71.973921678338272, 11.608671576377116], [-72.227575446242923, 11.108702093953237], [-72.614657762325194, 10.821975409381777], [-72.905286017534692, 10.45034434655477], [-73.027604132769554, 9.736770331252441], [-73.304951544880026, 9.151999823437604], [-72.788729824500379, 9.085027167187331], [-72.660494757768092, 8.62528778730268], [-72.439862230097944, 8.405275376820027], [-72.360900641555958, 8.002638454617893], [-72.479678921178831, 7.632506008327352], [-72.444487270788059, 7.42378489830048], [-72.19835242378187, 7.340430813013682], [-71.960175747348629, 6.991614895043538], [-70.674233567981503, 7.087784735538717], [-70.093312954372408, 6.960376491723109], [-69.389479946557103, 6.099860541198835], [-68.985318569602327, 6.206804917826856], [-68.265052456318216, 6.153268133972473], [-67.695087246355001, 6.267318020040645], [-67.34143958196556, 6.095468044454021], [-67.521531948502741, 5.556870428891968], [-67.744696621355203, 5.221128648291667], [-67.823012254493534, 4.503937282728898], [-67.621835903581271, 3.839481716319994], [-67.33756384954367, 3.542342230641721], [-67.303173183853417, 3.31845408773718], [-67.809938117123693, 2.820655015469569], [-67.447092047786299, 2.600280869960869], [-67.181294318293041, 2.250638129074062], [-66.876325853122566, 1.253360500489336], [-67.065048183852483, 1.130112209473225], [-67.25999752467358, 1.719998684084956], [-67.537810024674684, 2.037162787276329], [-67.868565029558823, 1.692455145673392], [-69.816973232691609, 1.714805202639624], [-69.804596727157701, 1.089081122233466], [-69.218637661400166, 0.985676581217433], [-69.252434048119042, 0.602650865070075], [-69.452396002872447, 0.706158758950693], [-70.015565761989293, 0.541414292804205], [-70.02065589057004, -0.185156345219539], [-69.577065395776586, -0.549991957200163], [-69.420485805932216, -1.122618503426409], [-69.444101935489599, -1.556287123219817], [-69.893635219996611, -4.298186944194326], [-70.394043952094975, -3.766591485207825], [-70.692682054309699, -3.742872002785858], [-70.047708502874841, -2.725156345229699], [-70.813475714791949, -2.256864515800742], [-71.413645799429773, -2.342802422702128], [-71.774760708285385, -2.169789727388937], [-72.325786505813639, -2.434218031426453], [-73.070392218707212, -2.308954359550952], [-73.659503546834586, -1.260491224781134], [-74.122395189089048, -1.002832533373848], [-74.441600511355958, -0.530820000819887], [-75.106624518520064, -0.05720549886486], [-75.373223232713841, -0.15203175212045]]] } }, - { "type": "Feature", "properties": { "admin": "Costa Rica", "name": "Costa Rica", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-82.965783047197348, 8.225027980985983], [-83.508437262694287, 8.446926581247281], [-83.711473965169063, 8.656836249216864], [-83.596313035806631, 8.830443223501417], [-83.632641567707822, 9.051385809765319], [-83.909885626953724, 9.290802720573579], [-84.303401658856345, 9.487354030795712], [-84.64764421256865, 9.615537421095707], [-84.713350796227743, 9.908051866083849], [-84.975660366541319, 10.086723130733004], [-84.911374884770211, 9.795991522658921], [-85.110923428065291, 9.557039699741308], [-85.339488288092255, 9.834542141148658], [-85.660786505866966, 9.93334747969072], [-85.797444831062819, 10.134885565629032], [-85.791708747078417, 10.439337266476612], [-85.65931372754666, 10.754330959511718], [-85.941725430021748, 10.895278428587799], [-85.712540452807289, 11.088444932494822], [-85.561851976244171, 11.217119248901593], [-84.903003302738924, 10.952303371621895], [-84.673069017256239, 11.082657172078139], [-84.355930752281026, 10.999225572142901], [-84.190178595704822, 10.793450018756671], [-83.895054490885926, 10.726839097532444], [-83.655611741861563, 10.938764146361418], [-83.402319708982944, 10.39543813724465], [-83.015676642575158, 9.992982082555553], [-82.546196255203469, 9.566134751824674], [-82.932890998043561, 9.476812038608172], [-82.927154914059145, 9.074330145702914], [-82.719183112300513, 8.925708726431493], [-82.868657192704759, 8.807266343618521], [-82.829770677405151, 8.626295477732368], [-82.9131764391242, 8.423517157419068], [-82.965783047197348, 8.225027980985983]]] } }, - { "type": "Feature", "properties": { "admin": "Cuba", "name": "Cuba", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-82.268151211257035, 23.188610744717703], [-81.404457160146819, 23.117271429938775], [-80.61876868358118, 23.105980129482994], [-79.679523688460222, 22.765303249598823], [-79.281485968732071, 22.399201565027049], [-78.347434455056472, 22.512166246017085], [-77.993295864560253, 22.277193508385928], [-77.146422492161037, 21.657851467367831], [-76.523824835908528, 21.20681956632437], [-76.194620123993175, 21.220565497314006], [-75.598222418912655, 21.01662445727413], [-75.671060350228032, 20.735091254147999], [-74.933896043584483, 20.693905137611381], [-74.178024868451246, 20.284627793859737], [-74.296648118777242, 20.050378526280678], [-74.961594611292924, 19.923435370355687], [-75.634680141894577, 19.873774318923193], [-76.323656175425981, 19.952890936762056], [-77.755480923153044, 19.855480861891873], [-77.085108405246729, 20.413353786698789], [-77.492654588516601, 20.673105373613886], [-78.137292243141573, 20.739948838783427], [-78.482826707661161, 21.028613389565848], [-78.719866502583997, 21.598113511638431], [-79.284999966127913, 21.559175319906497], [-80.217475348618635, 21.827324327069032], [-80.517534552721401, 22.037078965741756], [-81.820943366203167, 22.192056586185068], [-82.169991828118611, 22.387109279870746], [-81.79500179719264, 22.636964830001951], [-82.775897996740838, 22.688150336187057], [-83.494458787759328, 22.168517971276124], [-83.908800421875611, 22.154565334557329], [-84.052150845053248, 21.910575059491251], [-84.547030198896351, 21.801227728761639], [-84.974911058273079, 21.896028143801082], [-84.44706214062775, 22.204949856041903], [-84.23035702181177, 22.56575470630376], [-83.778239915690165, 22.78811839445569], [-83.267547573565736, 22.983041897060641], [-82.510436164057495, 23.078746649665181], [-82.268151211257035, 23.188610744717703]]] } }, - { "type": "Feature", "properties": { "admin": "Northern Cyprus", "name": "N. Cyprus", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[32.731780226377445, 35.14002594658843], [32.802473585752743, 35.145503648411363], [32.946960890440799, 35.38670339613369], [33.667227003724939, 35.373215847305509], [34.576473829900458, 35.671595567358786], [33.900804477684197, 35.245755927057608], [33.973616570783456, 35.058506374647997], [33.866439650210104, 35.093594672174177], [33.675391880027057, 35.017862860650446], [33.525685255677494, 35.038688462864066], [33.475817498515845, 35.000344550103499], [33.45592207208346, 35.101423651666401], [33.383833449036295, 35.162711900364563], [33.190977003723042, 35.173124701471373], [32.919572381326127, 35.087832749973636], [32.731780226377445, 35.14002594658843]]] } }, - { "type": "Feature", "properties": { "admin": "Cyprus", "name": "Cyprus", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[33.973616570783456, 35.058506374647997], [34.004880812320032, 34.978097846001852], [32.97982710137844, 34.571869411755436], [32.490296258277532, 34.701654771456468], [32.256667107885953, 35.103232326796622], [32.731780226377445, 35.14002594658843], [32.919572381326127, 35.087832749973636], [33.190977003723042, 35.173124701471373], [33.383833449036295, 35.162711900364563], [33.45592207208346, 35.101423651666401], [33.475817498515845, 35.000344550103499], [33.525685255677494, 35.038688462864066], [33.675391880027057, 35.017862860650446], [33.866439650210104, 35.093594672174177], [33.973616570783456, 35.058506374647997]]] } }, - { "type": "Feature", "properties": { "admin": "Czech Republic", "name": "Czech Rep.", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.960288120194573, 48.596982326850593], [16.49928266771877, 48.785808010445095], [16.029647251050218, 48.733899034207916], [15.253415561593979, 49.039074205107575], [14.901447381254055, 48.964401760445817], [14.33889773932472, 48.555305284207193], [13.595945672264433, 48.877171942737135], [13.031328973043427, 49.307068182973232], [12.52102420416119, 49.54741526956272], [12.415190870827441, 49.96912079528056], [12.240111118222556, 50.266337795607271], [12.96683678554319, 50.484076443069071], [13.338131951560282, 50.733234361364346], [14.05622765468817, 50.926917629594286], [14.307013380600633, 51.117267767941399], [14.570718214586062, 51.002339382524262], [15.016995883858666, 51.106674099321566], [15.490972120839725, 50.7847299261432], [16.238626743238566, 50.697732652379827], [16.176253289462263, 50.4226073268579], [16.719475945714429, 50.215746568393527], [16.868769158605655, 50.473973700556016], [17.554567091551117, 50.36214590107641], [17.649445021238986, 50.049038397819942], [18.392913852622168, 49.988628648470737], [18.85314415861361, 49.496229763377634], [18.554971144289478, 49.495015367218777], [18.399993523846174, 49.315000515330034], [18.170498488037961, 49.271514797556421], [18.104972771891848, 49.043983466175298], [17.913511590250462, 48.996492824899072], [17.886484816161808, 48.903475246773695], [17.545006951577101, 48.800019029325362], [17.101984897538895, 48.8169688991171], [16.960288120194573, 48.596982326850593]]] } }, - { "type": "Feature", "properties": { "admin": "Germany", "name": "Germany", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.92190636560923, 54.983104153048025], [9.939579705452898, 54.596641954153242], [10.950112338920517, 54.363607082733147], [10.939466993868447, 54.008693345752583], [11.95625247564328, 54.196485500701144], [12.518440382546711, 54.470370591847988], [13.647467075259495, 54.075510972705885], [14.119686313542555, 53.757029120491026], [14.353315463934164, 53.248171291713092], [14.074521111719431, 52.981262518925334], [14.437599725002197, 52.62485016540829], [14.685026482815713, 52.089947414755208], [14.607098422919645, 51.745188096719964], [15.016995883858781, 51.106674099321701], [14.570718214586119, 51.002339382524369], [14.307013380600662, 51.117267767941364], [14.05622765468831, 50.92691762959435], [13.338131951560397, 50.733234361364268], [12.966836785543249, 50.484076443069164], [12.240111118222668, 50.266337795607214], [12.41519087082747, 49.969120795280602], [12.521024204161332, 49.547415269562741], [13.031328973043513, 49.307068182973232], [13.595945672264575, 48.877171942737156], [13.243357374737112, 48.416114813829026], [12.884102817443873, 48.289145819687846], [13.025851271220514, 47.637583523135945], [12.93262698736606, 47.467645575543983], [12.620759718484519, 47.672387600284409], [12.141357456112869, 47.703083401065768], [11.426414015354847, 47.523766181013045], [10.544504021861597, 47.566399237653783], [10.402083774465321, 47.302487697939164], [9.896068149463188, 47.58019684507569], [9.594226108446376, 47.525058091820185], [8.522611932009793, 47.830827541691342], [8.317301466514092, 47.613579820336263], [7.466759067422286, 47.620581976911907], [7.59367638513106, 48.333019110703724], [8.099278598674855, 49.017783515003423], [6.658229607783709, 49.201958319691627], [6.186320428094176, 49.4638028021145], [6.242751092156992, 49.90222565367872], [6.043073357781109, 50.128051662794221], [6.156658155958779, 50.803721015010574], [5.988658074577812, 51.85161570902504], [6.589396599970825, 51.85202912048338], [6.842869500362381, 52.228440253297542], [7.092053256873895, 53.14404328064488], [6.905139601274128, 53.482162177130633], [7.100424838905268, 53.693932196662658], [7.936239454793961, 53.748295803433777], [8.121706170289483, 53.527792466844275], [8.800734490604667, 54.02078563090889], [8.572117954145368, 54.395646470754045], [8.526229282270206, 54.962743638725144], [9.282048780971136, 54.830865383516297], [9.92190636560923, 54.983104153048025]]] } }, - { "type": "Feature", "properties": { "admin": "Djibouti", "name": "Djibouti", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[43.081226027200152, 12.699638576707112], [43.317852410664663, 12.390148423711022], [43.286381463398911, 11.974928290245883], [42.715873650896519, 11.735640570518338], [43.145304803242126, 11.462039699748853], [42.776851841000948, 10.926878566934416], [42.55493000000012, 11.105110000000193], [42.314140000000116, 11.0342], [41.755570000000191, 11.05091], [41.739590000000177, 11.355110000000137], [41.661760000000122, 11.6312], [42.000000000000107, 12.100000000000133], [42.351560000000106, 12.54223000000013], [42.779642368344739, 12.455415757695672], [43.081226027200152, 12.699638576707112]]] } }, - { "type": "Feature", "properties": { "admin": "Denmark", "name": "Denmark", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[12.690006137755629, 55.60999095318077], [12.089991082414738, 54.800014553437919], [11.043543328504226, 55.36486379660424], [10.90391360845163, 55.779954738988735], [12.370904168353288, 56.111407375708822], [12.690006137755629, 55.60999095318077]]], [[[10.912181837618359, 56.4586213242779], [10.667803989309986, 56.081383368547208], [10.369992710011983, 56.190007229224719], [9.649984978889306, 55.469999498102041], [9.921906365609173, 54.983104153048046], [9.282048780971136, 54.830865383516155], [8.526229282270235, 54.962743638724973], [8.120310906617588, 55.517722683323612], [8.089976840862247, 56.540011705137587], [8.256581658571262, 56.809969387430286], [8.543437534223385, 57.110002753316891], [9.424469028367609, 57.172066148499468], [9.775558709358561, 57.447940782289649], [10.580005730846151, 57.730016587954843], [10.54610599126269, 57.21573273378614], [10.250000034230222, 56.890016181050456], [10.369992710011983, 56.60998159446082], [10.912181837618359, 56.4586213242779]]]] } }, - { "type": "Feature", "properties": { "admin": "Dominican Republic", "name": "Dominican Rep.", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-71.71236141629295, 19.714455878167353], [-71.587304450146604, 19.884910590082093], [-70.806706102161726, 19.880285549391981], [-70.214364997016119, 19.622885240146157], [-69.950815192327568, 19.647999986240002], [-69.769250047470067, 19.293267116772437], [-69.222125820579862, 19.313214219637096], [-69.254346076113819, 19.015196234609871], [-68.809411994080818, 18.979074408437846], [-68.317943284768958, 18.612197577381689], [-68.689315965434503, 18.205142320218609], [-69.164945848248905, 18.422648423735108], [-69.623987596297624, 18.380712998930246], [-69.952933926051529, 18.428306993071057], [-70.133232998317879, 18.245915025296892], [-70.517137213814195, 18.184290879788829], [-70.669298468697619, 18.42688589118303], [-70.999950120717173, 18.283328762276206], [-71.400209927033885, 17.598564357976596], [-71.657661912712001, 17.757572740138695], [-71.708304816358037, 18.044997056546091], [-71.687737596305865, 18.316660061104468], [-71.945112067335543, 18.616900132720257], [-71.701302659782485, 18.785416978424049], [-71.624873216422813, 19.169837958243303], [-71.71236141629295, 19.714455878167353]]] } }, - { "type": "Feature", "properties": { "admin": "Algeria", "name": "Algeria", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[11.99950564947161, 23.471668402596443], [8.572893100629782, 21.565660712159136], [5.677565952180684, 19.601206976799713], [4.267419467800038, 19.155265204336995], [3.158133172222704, 19.057364203360034], [3.146661004253899, 19.693578599521441], [2.683588494486428, 19.856230170160114], [2.060990838233919, 20.142233384679482], [1.823227573259032, 20.61080943448604], [-1.550054897457613, 22.792665920497377], [-4.92333736817423, 24.974574082940993], [-8.684399786809051, 27.395744126895998], [-8.66512447756419, 27.58947907155822], [-8.665589565454805, 27.656425889592349], [-8.674116176782972, 28.841288967396572], [-7.059227667661928, 29.579228420524522], [-6.060632290053772, 29.731699734001687], [-5.242129278982786, 30.000443020135581], [-4.859646165374469, 30.501187649043839], [-3.690441046554695, 30.896951605751152], [-3.647497931320145, 31.637294012980668], [-3.068980271812647, 31.724497992473207], [-2.616604783529567, 32.094346218386143], [-1.30789913573787, 32.262888902306095], [-1.124551153966308, 32.651521511357124], [-1.388049282222567, 32.864015000941301], [-1.733454555661467, 33.91971283623198], [-1.792985805661686, 34.527918606091198], [-2.169913702798624, 35.168396307916673], [-1.208602871089056, 35.71484874118709], [-0.127454392894606, 35.888662421200799], [0.503876580415209, 36.301272894835272], [1.466918572606545, 36.605647081034398], [3.161698846050824, 36.783904934225205], [4.815758090849129, 36.865036932923452], [5.320120070017792, 36.716518866516616], [6.261819695672611, 37.110655015606731], [7.330384962603969, 37.118380642234364], [7.737078484741003, 36.885707505840209], [8.420964389691674, 36.946427313783154], [8.217824334352313, 36.433176988260271], [8.376367628623766, 35.479876003555937], [8.140981479534302, 34.655145982393783], [7.524481642292242, 34.097376410451453], [7.612641635782181, 33.344114895148955], [8.430472853233367, 32.748337307255944], [8.439102817426116, 32.506284898400814], [9.055602654668148, 32.102691962201284], [9.482139926805273, 30.307556057246181], [9.805634392952411, 29.424638373323383], [9.859997999723443, 28.959989732371007], [9.683884718472765, 28.144173895779193], [9.756128370816779, 27.688258571884141], [9.629056023811073, 27.140953477480913], [9.716285841519747, 26.512206325785691], [9.319410841518161, 26.094324856057447], [9.910692579801774, 25.365454616796733], [9.948261346077969, 24.93695364023251], [10.30384687667836, 24.37931325937091], [10.771363559622925, 24.562532050061744], [11.560669386449002, 24.097909247325511], [11.99950564947161, 23.471668402596443]]] } }, - { "type": "Feature", "properties": { "admin": "Ecuador", "name": "Ecuador", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-80.302560594387188, -3.404856459164712], [-79.770293341780913, -2.65751189535964], [-79.986559210922394, -2.220794366061014], [-80.368783942369234, -2.685158786635788], [-80.967765469064332, -2.246942640800703], [-80.764806281238023, -1.965047702648532], [-80.933659023751702, -1.057454522306358], [-80.583370327461239, -0.906662692878683], [-80.39932471385373, -0.283703301600141], [-80.020898200180355, 0.360340074053468], [-80.090609707342097, 0.768428859862396], [-79.542762010399784, 0.982937730305963], [-78.855258755188686, 1.380923773601822], [-77.855061408179509, 0.809925034992773], [-77.668612840470416, 0.825893052570961], [-77.424984300430367, 0.395686753741117], [-76.576379767549383, 0.256935533037435], [-76.292314419240938, 0.416047268064119], [-75.801465827116587, 0.084801337073202], [-75.373223232713841, -0.15203175212045], [-75.233722703741932, -0.911416924649529], [-75.544995693652027, -1.56160979574588], [-76.635394253226707, -2.608677666843817], [-77.83790483265858, -3.003020521663103], [-78.450683966775628, -3.873096612161375], [-78.639897223612323, -4.547784112164072], [-79.205289069317715, -4.959128513207388], [-79.62497921417615, -4.454198093283494], [-80.028908047185581, -4.346090996928893], [-80.442241990872134, -4.425724379090673], [-80.46929460317692, -4.059286797708999], [-80.184014858709645, -3.821161797708043], [-80.302560594387188, -3.404856459164712]]] } }, - { "type": "Feature", "properties": { "admin": "Egypt", "name": "Egypt", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.9226, 29.50133], [34.64174, 29.09942], [34.42655, 28.34399], [34.15451, 27.8233], [33.92136, 27.6487], [33.58811, 27.97136], [33.13676, 28.41765], [32.42323, 29.85108], [32.32046, 29.76043], [32.73482, 28.70523], [33.34876, 27.69989], [34.10455, 26.14227], [34.47387, 25.59856], [34.79507, 25.03375], [35.69241, 23.92671], [35.49372, 23.75237], [35.52598, 23.10244], [36.69069, 22.20485], [36.86623, 22.0], [32.9, 22.0], [29.02, 22.0], [25.0, 22.0], [25.0, 25.682499996360992], [25.0, 29.238654529533452], [24.70007, 30.04419], [24.95762, 30.6616], [24.80287, 31.08929], [25.16482, 31.56915], [26.49533, 31.58568], [27.45762, 31.32126], [28.45048, 31.02577], [28.91353, 30.87005], [29.68342, 31.18686], [30.09503, 31.4734], [30.97693, 31.55586], [31.68796, 31.4296], [31.96041, 30.9336], [32.19247, 31.26034], [32.99392, 31.02407], [33.7734, 30.96746], [34.26544, 31.21936], [34.9226, 29.50133]]] } }, - { "type": "Feature", "properties": { "admin": "Eritrea", "name": "Eritrea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[42.351560000000106, 12.54223000000013], [42.00975, 12.86582], [41.59856, 13.452090000000108], [41.15519371924983, 13.773319810435224], [40.8966, 14.118640000000138], [40.026218702969167, 14.519579169162281], [39.34061, 14.53155], [39.0994, 14.74064], [38.51295, 14.50547], [37.90607, 14.959430000000165], [37.59377, 14.2131], [36.42951, 14.42211], [36.323188917798113, 14.822480577041057], [36.753860304518575, 16.291874091044289], [36.852530000000108, 16.95655], [37.16747, 17.263140000000128], [37.904000000000103, 17.42754], [38.410089959473218, 17.998307399970312], [38.990622999839999, 16.84062612555169], [39.266110060388016, 15.922723496967246], [39.814293654140208, 15.435647284400314], [41.179274936697645, 14.491079616753209], [41.734951613132345, 13.921036892141554], [42.276830682144848, 13.34399201095442], [42.589576450375255, 13.000421250861901], [43.081226027200152, 12.699638576707112], [42.779642368344739, 12.455415757695672], [42.351560000000106, 12.54223000000013]]] } }, - { "type": "Feature", "properties": { "admin": "Spain", "name": "Spain", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-9.034817674180244, 41.880570583659669], [-8.98443315269567, 42.592775173506261], [-9.392883673530644, 43.026624660812686], [-7.978189663108308, 43.748337714200979], [-6.754491746436754, 43.567909450853918], [-5.411886359061596, 43.574239813809669], [-4.347842779955783, 43.403449205085025], [-3.51753170410609, 43.455900783861296], [-1.901351284177764, 43.422802028978332], [-1.502770961910528, 43.034014390630425], [0.338046909190581, 42.579546006839543], [0.701590610363894, 42.795734361332599], [1.826793247087153, 42.343384711265678], [2.985998976258457, 42.473015041669854], [3.039484083680548, 41.892120266276891], [2.091841668312184, 41.226088568683082], [0.810524529635188, 41.014731960609332], [0.721331007499401, 40.678318386389229], [0.106691521819869, 40.123933620762003], [-0.278711310212941, 39.309978135732713], [0.111290724293838, 38.738514309233032], [-0.467123582349103, 38.292365831041138], [-0.683389451490598, 37.642353827457811], [-1.438382127274849, 37.443063666324214], [-2.146452602538119, 36.674144192037282], [-3.415780808923386, 36.658899644511173], [-4.368900926114718, 36.677839056946141], [-4.995219285492211, 36.32470815687963], [-5.377159796561457, 35.946850083961458], [-5.866432257500902, 36.02981659600605], [-6.236693894872174, 36.367677110330327], [-6.520190802425402, 36.942913316387312], [-7.45372555177809, 37.097787583966053], [-7.537105475281022, 37.428904323876232], [-7.166507941099863, 37.803894354802217], [-7.029281175148794, 38.075764065089757], [-7.374092169616317, 38.373058580064914], [-7.098036668313126, 39.03007274022378], [-7.498632371439724, 39.629571031241802], [-7.066591559263527, 39.711891587882768], [-7.026413133156593, 40.184524237624238], [-6.864019944679383, 40.330871893874821], [-6.851126674822551, 41.111082668617513], [-6.389087693700914, 41.381815497394641], [-6.668605515967655, 41.883386949219577], [-7.251308966490822, 41.91834605566504], [-7.422512986673794, 41.792074693359822], [-8.01317460776991, 41.790886135417118], [-8.26385698081779, 42.280468654950326], [-8.671945766626719, 42.134689439454952], [-9.034817674180244, 41.880570583659669]]] } }, - { "type": "Feature", "properties": { "admin": "Estonia", "name": "Estonia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[24.312862583114615, 57.793423570376966], [24.428927850042154, 58.383413397853275], [24.061198357853179, 58.257374579493394], [23.426560092876681, 58.612753404364618], [23.339795363058641, 59.187240302153363], [24.604214308376182, 59.465853786855007], [25.864189080516631, 59.611090399811324], [26.949135776484518, 59.445803331125767], [27.981114129353237, 59.47538808861286], [28.131699253051742, 59.300825100330904], [27.420166456824941, 58.724581203844224], [27.716685825315714, 57.791899115624354], [27.288184848751509, 57.474528306703817], [26.46353234223778, 57.476388658266316], [25.602809685984365, 57.847528794986559], [25.164593540149262, 57.970156968815175], [24.312862583114615, 57.793423570376966]]] } }, - { "type": "Feature", "properties": { "admin": "Ethiopia", "name": "Ethiopia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[37.90607, 14.959430000000165], [38.51295, 14.50547], [39.0994, 14.74064], [39.34061, 14.53155], [40.026250000000111, 14.51959], [40.8966, 14.118640000000138], [41.1552, 13.77333], [41.59856, 13.452090000000108], [42.00975, 12.86582], [42.351560000000106, 12.54223000000013], [42.000000000000107, 12.100000000000133], [41.661760000000122, 11.6312], [41.739590000000177, 11.355110000000137], [41.755570000000191, 11.05091], [42.314140000000116, 11.0342], [42.55493000000012, 11.105110000000193], [42.776851841000948, 10.926878566934416], [42.55876, 10.572580000000126], [42.92812, 10.021940000000139], [43.29699, 9.540480000000169], [43.67875, 9.183580000000116], [46.94834, 7.99688], [47.78942, 8.003], [44.9636, 5.001620000000115], [43.66087, 4.95755], [42.769670000000119, 4.252590000000223], [42.12861, 4.234130000000163], [41.855083092644108, 3.918911920483764], [41.171800000000125, 3.91909], [40.768480000000118, 4.257020000000124], [39.854940000000106, 3.83879000000013], [39.559384258765917, 3.422060000000215], [38.89251, 3.50074], [38.67114, 3.61607], [38.436970000000137, 3.58851], [38.120915000000132, 3.598605], [36.85509323800823, 4.447864127672857], [36.159078632855646, 4.447864127672857], [35.817447662353622, 4.776965663462021], [35.817447662353622, 5.338232082790852], [35.298007118233095, 5.506], [34.70702, 6.59422000000012], [34.25032, 6.82607], [34.075100000000184, 7.22595], [33.56829, 7.71334], [32.954180000000228, 7.7849700000001], [33.294800000000116, 8.35458], [33.82550000000014, 8.37916], [33.97498, 8.684560000000145], [33.96162, 9.58358], [34.25745, 10.63009], [34.73115000000012, 10.910170000000106], [34.831630000000125, 11.318960000000116], [35.26049, 12.08286], [35.863630000000164, 12.57828], [36.27022, 13.563330000000118], [36.42951, 14.42211], [37.59377, 14.2131], [37.90607, 14.959430000000165]]] } }, - { "type": "Feature", "properties": { "admin": "Finland", "name": "Finland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[28.591929559043187, 69.064776923286644], [28.445943637818651, 68.36461294216403], [29.9774263852206, 67.698297024192641], [29.054588657352319, 66.944286200621917], [30.21765, 65.80598], [29.544429559046982, 64.948671576590471], [30.444684686003704, 64.204453436939076], [30.035872430142714, 63.552813625738544], [31.516092156711117, 62.867687486412869], [31.139991082490891, 62.357692776124395], [30.211107212044443, 61.780027777749673], [28.06999759289527, 60.503516547275829], [26.25517296723697, 60.423960679762487], [24.496623976344516, 60.057316392651636], [22.869694858499454, 59.846373196036211], [22.290763787533589, 60.391921291741525], [21.322244093519313, 60.720169989659503], [21.544866163832687, 61.705329494871783], [21.059211053153682, 62.607393296958726], [21.536029493910799, 63.189735012455863], [22.442744174903986, 63.817810370531276], [24.730511508897528, 64.902343655040823], [25.398067661243939, 65.111426500093728], [25.2940430030404, 65.53434642197044], [23.903378533633795, 66.006927395279604], [23.565879754335576, 66.396050930437411], [23.539473097434435, 67.936008612735236], [21.978534783626113, 68.616845608180682], [20.645592889089521, 69.106247260200846], [21.244936150810666, 69.370443020293067], [22.356237827247405, 68.841741441514898], [23.662049594830751, 68.891247463650529], [24.735679152126721, 68.649556789821446], [25.689212680776361, 69.092113755969024], [26.179622023226241, 69.825298977326113], [27.732292107867856, 70.164193020296239], [29.015572950971968, 69.766491197377974], [28.591929559043187, 69.064776923286644]]] } }, - { "type": "Feature", "properties": { "admin": "Fiji", "name": "Fiji", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[178.3736, -17.33992], [178.71806, -17.62846], [178.55271, -18.15059], [177.93266, -18.28799], [177.38146, -18.16432], [177.28504, -17.72465], [177.67087, -17.38114], [178.12557, -17.50481], [178.3736, -17.33992]]], [[[179.364142661964223, -16.801354076946847], [178.725059362997058, -17.012041674368017], [178.596838595117021, -16.63915], [179.096609362997128, -16.43398427754742], [179.413509362997075, -16.379054277547393], [180.000000000000114, -16.067132663642436], [180.000000000000114, -16.555216566639157], [179.364142661964223, -16.801354076946847]]], [[[-179.917369384765237, -16.501783135649358], [-180.0, -16.555216566639157], [-180.0, -16.067132663642436], [-179.793320109048551, -16.020882256741228], [-179.917369384765237, -16.501783135649358]]]] } }, - { "type": "Feature", "properties": { "admin": "Falkland Islands", "name": "Falkland Is.", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-61.2, -51.85], [-60.0, -51.25], [-59.15, -51.5], [-58.55, -51.1], [-57.75, -51.55], [-58.05, -51.9], [-59.4, -52.2], [-59.85, -51.85], [-60.7, -52.3], [-61.2, -51.85]]] } }, - { "type": "Feature", "properties": { "admin": "France", "name": "France", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-52.556424730018378, 2.504705308437053], [-52.939657151894963, 2.124857692875622], [-53.41846513529525, 2.053389187016037], [-53.554839240113481, 2.334896551925964], [-53.778520677288881, 2.376702785650053], [-54.088062506717264, 2.105556545414629], [-54.524754197799737, 2.311848863123785], [-54.271229620975781, 2.738747870286942], [-54.184284023644743, 3.194172268075234], [-54.011503872276812, 3.622569891774857], [-54.3995422023565, 4.212611395683481], [-54.478632981979203, 4.896755682795642], [-53.958044603070917, 5.756548163267808], [-53.618452928264837, 5.646529038918401], [-52.882141282754063, 5.409850979021598], [-51.823342861525916, 4.565768133966144], [-51.657797410678874, 4.156232408053028], [-52.249337531123977, 3.241094468596287], [-52.556424730018378, 2.504705308437053]]], [[[9.560016310269132, 42.152491970379558], [9.229752231491771, 41.380006822264441], [8.77572309737536, 41.583611965494427], [8.544212680707828, 42.256516628583078], [8.746009148807586, 42.628121853193946], [9.390000848028901, 43.009984849614725], [9.560016310269132, 42.152491970379558]]], [[[3.588184441755714, 50.378992418003563], [4.28602298342514, 49.90749664977254], [4.799221632515752, 49.985373033236314], [5.674051954784885, 49.529483547557433], [5.897759230176375, 49.442667141307155], [6.186320428094204, 49.463802802114444], [6.658229607783538, 49.201958319691549], [8.09927859867477, 49.017783515003366], [7.59367638513106, 48.333019110703724], [7.466759067422228, 47.620581976911851], [7.192202182655533, 47.449765529970982], [6.736571079138086, 47.541801255882874], [6.768713820023634, 47.287708238303672], [6.037388950228971, 46.725778713561894], [6.022609490593566, 46.272989813820502], [6.500099724970453, 46.429672756529428], [6.84359297041456, 45.991146552100659], [6.80235517744566, 45.708579820328673], [7.096652459347835, 45.333098863295859], [6.749955275101711, 45.028517971367584], [7.007562290076661, 44.254766750661382], [7.549596388386161, 44.127901109384808], [7.435184767291841, 43.693844916349164], [6.529245232783068, 43.12889232031835], [4.556962517931395, 43.399650987311581], [3.100410597352719, 43.075200507167118], [2.985998976258486, 42.473015041669882], [1.826793247087181, 42.343384711265649], [0.701590610363922, 42.795734361332642], [0.338046909190581, 42.57954600683955], [-1.502770961910471, 43.034014390630482], [-1.901351284177735, 43.422802028978332], [-1.384225226232956, 44.022610378590166], [-1.193797573237361, 46.014917710954862], [-2.225724249673788, 47.064362697938201], [-2.963276129559573, 47.570326646507958], [-4.491554938159481, 47.95495433205641], [-4.592349819344746, 48.68416046812694], [-3.295813971357745, 48.901692409859628], [-1.616510789384932, 48.644421291694577], [-1.933494025063254, 49.776341864615759], [-0.98946895995536, 49.347375800160869], [1.338761020522753, 50.127173163445256], [1.6390010921385, 50.9466063502975], [2.51357303224617, 51.14850617126185], [2.65842207196033, 50.796848049515646], [3.123251580425716, 50.780363267614504], [3.588184441755714, 50.378992418003563]]]] } }, - { "type": "Feature", "properties": { "admin": "Gabon", "name": "Gabon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[11.093772820691923, -3.978826592630546], [10.066135288135738, -2.969482517105681], [9.405245395554969, -2.144313246269042], [8.797995639693168, -1.111301364754496], [8.830086704146423, -0.779073581550037], [9.048419630579586, -0.459351494960217], [9.291350538783687, 0.268666083167687], [9.492888624721981, 1.010119533691494], [9.83028405115564, 1.067893784993799], [11.285078973036461, 1.057661851400013], [11.276449008843711, 2.261050930180871], [11.751665480199787, 2.326757513839993], [12.359380323952218, 2.19281220133945], [12.951333855855605, 2.321615708826939], [13.07582238124675, 2.267097072759014], [13.003113641012074, 1.830896307783319], [13.282631463278816, 1.31418366129688], [14.026668735417214, 1.395677395021153], [14.276265903386953, 1.196929836426619], [13.843320753645653, 0.038757635901149], [14.316418491277741, -0.552627455247048], [14.425455763413593, -1.333406670744971], [14.299210239324564, -1.998275648612213], [13.992407260807706, -2.470804945489099], [13.109618767965626, -2.428740329603513], [12.575284458067639, -1.948511244315134], [12.495702752338159, -2.391688327650242], [11.820963575903189, -2.514161472181982], [11.478038771214299, -2.765618991714241], [11.855121697648114, -3.42687061932105], [11.093772820691923, -3.978826592630546]]] } }, - { "type": "Feature", "properties": { "admin": "United Kingdom", "name": "United Kingdom", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-5.661948614921896, 54.554603176483838], [-6.197884894220976, 53.867565009163329], [-6.953730231137994, 54.073702297575622], [-7.572167934591078, 54.059956366585979], [-7.366030646178785, 54.595840969452688], [-7.572167934591078, 55.131622219454883], [-6.733847011736144, 55.172860012423783], [-5.661948614921896, 54.554603176483838]]], [[[-3.00500484863528, 58.635000108466322], [-4.073828497728015, 57.55302480735525], [-3.055001796877661, 57.690019029360933], [-1.959280564776918, 57.684799709699512], [-2.219988165689301, 56.870017401753515], [-3.119003058271118, 55.97379303651546], [-2.085009324543023, 55.909998480851264], [-2.005675679673856, 55.804902850350217], [-1.11499101399221, 54.624986477265388], [-0.4304849918542, 54.464376125702145], [0.184981316742039, 53.325014146531018], [0.469976840831777, 52.929999498091959], [1.681530795914739, 52.739520168663987], [1.559987827164377, 52.099998480836], [1.050561557630914, 51.806760565795678], [1.4498653499503, 51.289427802121949], [0.550333693045502, 50.765738837275862], [-0.787517462558639, 50.774988918656206], [-2.489997524414377, 50.500018622431227], [-2.956273972984035, 50.696879991247002], [-3.617448085942327, 50.228355617872708], [-4.542507900399243, 50.341837063185658], [-5.245023159191134, 49.959999904981082], [-5.776566941745299, 50.159677639356815], [-4.309989793301837, 51.210001125689146], [-3.414850633142122, 51.426008612669236], [-3.422719467108322, 51.426848167406078], [-4.984367234710873, 51.593466091510962], [-5.267295701508885, 51.991400458374571], [-4.222346564134852, 52.30135569926135], [-4.770013393564112, 52.840004991255611], [-4.579999152026914, 53.495003770555165], [-3.093830673788658, 53.404547400669671], [-3.092079637047106, 53.404440822963544], [-2.945008510744343, 53.98499970154667], [-3.614700825433033, 54.60093677329256], [-3.63000545898933, 54.615012925833], [-4.844169073903003, 54.790971177786837], [-5.082526617849224, 55.061600653699358], [-4.719112107756643, 55.508472601943467], [-5.047980922862108, 55.783985500707516], [-5.586397670911139, 55.311146145236805], [-5.64499874513018, 56.275014960344791], [-6.149980841486352, 56.785009670633528], [-5.78682471355529, 57.818848375064633], [-5.009998745127574, 58.630013332750039], [-4.211494513353555, 58.550845038479153], [-3.00500484863528, 58.635000108466322]]]] } }, - { "type": "Feature", "properties": { "admin": "Georgia", "name": "Georgia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[41.55408410011065, 41.535656236327561], [41.703170607272703, 41.962942816732912], [41.453470086438379, 42.645123399417926], [40.875469191253785, 43.013628038091277], [40.321394484220313, 43.128633938156831], [39.955008579270917, 43.434997666999216], [40.07696495947976, 43.553104153002309], [40.922184686045618, 43.38215851498078], [42.394394565608806, 43.220307929042619], [43.756016880067378, 42.74082815202248], [43.931199985536828, 42.554973863284758], [44.537622918481979, 42.71199270280362], [45.470279168485703, 42.502780666669963], [45.776410353382758, 42.09244395605635], [46.404950799348818, 41.860675157227298], [46.145431756379004, 41.722802435872573], [46.637908156120574, 41.181672675128219], [46.501637404166921, 41.064444688474104], [45.962600538930381, 41.123872585609767], [45.217426385281577, 41.411451931314041], [44.972480096218071, 41.248128567055588], [43.582745802592726, 41.09214325618256], [42.619548781104484, 41.583172715819934], [41.55408410011065, 41.535656236327561]]] } }, - { "type": "Feature", "properties": { "admin": "Ghana", "name": "Ghana", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[1.060121697604927, 5.928837388528875], [-0.507637905265938, 5.343472601742675], [-1.063624640294193, 5.000547797053811], [-1.964706590167594, 4.71046214438337], [-2.856125047202397, 4.994475816259508], [-2.810701463217839, 5.389051215024109], [-3.244370083011261, 6.2504715031135], [-2.983584967450326, 7.379704901555511], [-2.56218950032624, 8.219627793811481], [-2.827496303712706, 9.642460842319775], [-2.963896246747111, 10.395334784380081], [-2.94040930827046, 10.962690334512557], [-1.203357713211431, 11.009819240762736], [-0.761575893548183, 10.936929633015053], [-0.438701544588582, 11.09834096927872], [0.023802524423701, 11.018681748900802], [-0.049784715159944, 10.706917832883928], [0.367579990245389, 10.191212876827176], [0.365900506195885, 9.46500397382948], [0.461191847342121, 8.677222601756013], [0.712029249686878, 8.312464504423827], [0.490957472342245, 7.411744289576474], [0.570384148774849, 6.914358628767188], [0.836931186536333, 6.279978745952147], [1.060121697604927, 5.928837388528875]]] } }, - { "type": "Feature", "properties": { "admin": "Guinea", "name": "Guinea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-8.439298468448696, 7.686042792181736], [-8.722123582382123, 7.711674302598509], [-8.926064622422002, 7.309037380396375], [-9.208786383490844, 7.313920803247952], [-9.403348151069748, 7.526905218938906], [-9.33727983238458, 7.928534450711351], [-9.755342169625832, 8.541055202666923], [-10.016566534861253, 8.42850393313523], [-10.230093553091276, 8.406205552601291], [-10.505477260774667, 8.348896389189603], [-10.494315151399629, 8.715540676300433], [-10.65477047366589, 8.977178452994194], [-10.622395188835037, 9.267910061068276], [-10.839151984083299, 9.688246161330367], [-11.117481248407328, 10.045872911006283], [-11.917277390988655, 10.046983954300556], [-12.150338100625003, 9.858571682164378], [-12.425928514037562, 9.835834051955953], [-12.596719122762206, 9.620188300001969], [-12.711957566773076, 9.342711696810765], [-13.246550258832512, 8.903048610871506], [-13.685153977909788, 9.494743760613458], [-14.074044969122278, 9.886166897008248], [-14.330075852912367, 10.015719712763966], [-14.579698859098254, 10.214467271358513], [-14.693231980843501, 10.65630076745404], [-14.83955379887794, 10.876571560098139], [-15.130311245168167, 11.040411688679525], [-14.685687221728896, 11.527823798056485], [-14.382191534878727, 11.509271958863691], [-14.121406419317776, 11.677117010947693], [-13.900799729863772, 11.678718980348744], [-13.743160773157411, 11.811269029177408], [-13.828271857142122, 12.142644151249041], [-13.718743658899511, 12.247185573775507], [-13.700476040084322, 12.586182969610192], [-13.217818162478235, 12.575873521367964], [-12.499050665730561, 12.332089952031053], [-12.278599005573438, 12.354440008997285], [-12.20356482588563, 12.465647691289401], [-11.658300950557928, 12.386582749882834], [-11.513942836950587, 12.442987575729415], [-11.456168585648269, 12.076834214725336], [-11.297573614944508, 12.077971096235768], [-11.036555955438256, 12.211244615116513], [-10.870829637078211, 12.177887478072106], [-10.593223842806278, 11.923975328005977], [-10.165213792348835, 11.844083563682743], [-9.890992804392011, 12.060478623904968], [-9.567911749703212, 12.194243068892472], [-9.327616339546008, 12.334286200403451], [-9.127473517279581, 12.308060411015331], [-8.905264858424529, 12.088358059126433], [-8.786099005559462, 11.812560939984705], [-8.376304897484911, 11.393645941610627], [-8.581305304386772, 11.136245632364801], [-8.620321010767126, 10.810890814655181], [-8.407310756860026, 10.90925690352276], [-8.282357143578279, 10.792597357623842], [-8.335377163109738, 10.494811916541932], [-8.029943610048617, 10.206534939001711], [-8.22933712404682, 10.129020290563897], [-8.309616461612249, 9.789531968622439], [-8.079113735374348, 9.376223863152033], [-7.832100389019186, 8.575704250518625], [-8.203498907900878, 8.455453192575446], [-8.299048631208562, 8.316443589710302], [-8.221792364932197, 8.123328762235571], [-8.280703497744936, 7.687179673692156], [-8.439298468448696, 7.686042792181736]]] } }, - { "type": "Feature", "properties": { "admin": "Gambia", "name": "Gambia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-16.84152462408127, 13.151393947802557], [-16.713728807023468, 13.594958604379853], [-15.624596320039936, 13.623587347869556], [-15.398770310924457, 13.860368760630916], [-15.081735398813816, 13.876491807505982], [-14.687030808968483, 13.63035696049978], [-14.376713833055785, 13.625680243377371], [-14.046992356817478, 13.794067898000446], [-13.844963344772404, 13.505041612191999], [-14.277701788784553, 13.28058502853224], [-14.712197231494626, 13.298206691943774], [-15.141163295949463, 13.509511623585235], [-15.511812506562931, 13.278569647672864], [-15.691000535534991, 13.270353094938455], [-15.931295945692208, 13.130284125211331], [-16.84152462408127, 13.151393947802557]]] } }, - { "type": "Feature", "properties": { "admin": "Guinea Bissau", "name": "Guinea-Bissau", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-15.130311245168167, 11.040411688679525], [-15.664180467175523, 11.458474025920792], [-16.085214199273562, 11.524594021038236], [-16.314786749730199, 11.806514797406548], [-16.308947312881227, 11.958701890506116], [-16.613838263403277, 12.170911159712698], [-16.67745195155457, 12.38485158940105], [-16.147716844130581, 12.547761542201185], [-15.816574266004251, 12.515567124883345], [-15.548476935274005, 12.628170070847343], [-13.700476040084322, 12.586182969610192], [-13.718743658899511, 12.247185573775507], [-13.828271857142122, 12.142644151249041], [-13.743160773157411, 11.811269029177408], [-13.900799729863772, 11.678718980348744], [-14.121406419317776, 11.677117010947693], [-14.382191534878727, 11.509271958863691], [-14.685687221728896, 11.527823798056485], [-15.130311245168167, 11.040411688679525]]] } }, - { "type": "Feature", "properties": { "admin": "Equatorial Guinea", "name": "Eq. Guinea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[9.492888624721981, 1.010119533691494], [9.305613234096255, 1.160911363119183], [9.649158155972627, 2.283866075037735], [11.276449008843711, 2.261050930180871], [11.285078973036461, 1.057661851400013], [9.83028405115564, 1.067893784993799], [9.492888624721981, 1.010119533691494]]] } }, - { "type": "Feature", "properties": { "admin": "Greece", "name": "Greece", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[23.699980096133, 35.705004380835526], [24.246665073348673, 35.368022365860149], [25.025015496528873, 35.424995632461979], [25.769207797964182, 35.354018052709073], [25.745023227651579, 35.179997666966209], [26.290002882601719, 35.299990342747911], [26.164997592887651, 35.004995429009789], [24.724982130642299, 34.919987697889603], [24.735007358506941, 35.084990546197581], [23.514978468528106, 35.27999156345097], [23.699980096133, 35.705004380835526]]], [[[26.604195590936282, 41.562114569661098], [26.294602085075777, 40.936261298174244], [26.056942172965499, 40.824123440100827], [25.44767703624418, 40.852545477861455], [24.925848422960932, 40.947061672523226], [23.714811232200809, 40.687129218095116], [24.407998894964063, 40.124992987624083], [23.89996788910258, 39.962005520175573], [23.342999301860797, 39.960997829745786], [22.813987664488959, 40.476005153966547], [22.626298862404777, 40.256561184239175], [22.849747755634805, 39.659310818025759], [23.350027296652595, 39.190011298167256], [22.97309939951554, 38.97090322524965], [23.53001631032495, 38.51000112563846], [24.025024855248937, 38.219992987616443], [24.040011020613601, 37.655014553369419], [23.115002882589145, 37.920011298162215], [23.409971958111065, 37.409990749657389], [22.77497195810863, 37.305010077456551], [23.154225294698612, 36.422505804992042], [22.4900281104511, 36.410000108377446], [21.670026482843692, 36.84498647719419], [21.295010613701574, 37.644989325504689], [21.120034213961329, 38.31032339126272], [20.730032179454579, 38.769985256498778], [20.217712029712853, 39.340234686839629], [20.150015903410516, 39.624997666984022], [20.615000441172779, 40.110006822259422], [20.67499677906363, 40.434999904943048], [20.999989861747274, 40.580003973953964], [21.020040317476422, 40.842726955725873], [21.674160597426969, 40.931274522457976], [22.055377638444266, 41.149865831052686], [22.597308383889008, 41.130487168943198], [22.76177, 41.3048], [22.952377150166562, 41.337993882811212], [23.692073601992455, 41.309080918943849], [24.492644891058031, 41.583896185872035], [25.19720136892553, 41.234485988930651], [26.106138136507177, 41.328898830727823], [26.11704186372091, 41.826904608724725], [26.604195590936282, 41.562114569661098]]]] } }, - { "type": "Feature", "properties": { "admin": "Greenland", "name": "Greenland", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-46.76379, 82.62796], [-43.40644, 83.22516], [-39.89753, 83.18018], [-38.62214, 83.54905], [-35.08787, 83.64513], [-27.10046, 83.51966], [-20.84539, 82.72669], [-22.69182, 82.34165], [-26.51753, 82.29765], [-31.9, 82.2], [-31.39646, 82.02154], [-27.85666, 82.13178], [-24.84448, 81.78697], [-22.90328, 82.09317], [-22.07175, 81.73449], [-23.16961, 81.15271], [-20.62363, 81.52462], [-15.76818, 81.91245], [-12.77018, 81.71885], [-12.20855, 81.29154], [-16.28533, 80.58004], [-16.85, 80.35], [-20.04624, 80.17708], [-17.73035, 80.12912], [-18.9, 79.4], [-19.70499, 78.75128], [-19.67353, 77.63859], [-18.47285, 76.98565], [-20.03503, 76.94434], [-21.67944, 76.62795], [-19.83407, 76.09808], [-19.59896, 75.24838], [-20.66818, 75.15585], [-19.37281, 74.29561], [-21.59422, 74.22382], [-20.43454, 73.81713], [-20.76234, 73.46436], [-22.17221, 73.30955], [-23.56593, 73.30663], [-22.31311, 72.62928], [-22.29954, 72.18409], [-24.27834, 72.59788], [-24.79296, 72.3302], [-23.44296, 72.08016], [-22.13281, 71.46898], [-21.75356, 70.66369], [-23.53603, 70.471], [-24.30702, 70.85649], [-25.54341, 71.43094], [-25.20135, 70.75226], [-26.36276, 70.22646], [-23.72742, 70.18401], [-22.34902, 70.12946], [-25.02927, 69.2588], [-27.74737, 68.47046], [-30.67371, 68.12503], [-31.77665, 68.12078], [-32.81105, 67.73547], [-34.20196, 66.67974], [-36.35284, 65.9789], [-37.04378, 65.93768], [-38.37505, 65.69213], [-39.81222, 65.45848], [-40.66899, 64.83997], [-40.68281, 64.13902], [-41.1887, 63.48246], [-42.81938, 62.68233], [-42.41666, 61.90093], [-42.86619, 61.07404], [-43.3784, 60.09772], [-44.7875, 60.03676], [-46.26364, 60.85328], [-48.26294, 60.85843], [-49.23308, 61.40681], [-49.90039, 62.38336], [-51.63325, 63.62691], [-52.14014, 64.27842], [-52.27659, 65.1767], [-53.66166, 66.09957], [-53.30161, 66.8365], [-53.96911, 67.18899], [-52.9804, 68.35759], [-51.47536, 68.72958], [-51.08041, 69.14781], [-50.87122, 69.9291], [-52.013585, 69.574925], [-52.55792, 69.42616], [-53.45629, 69.283625], [-54.68336, 69.61003], [-54.75001, 70.28932], [-54.35884, 70.821315], [-53.431315, 70.835755], [-51.39014, 70.56978], [-53.10937, 71.20485], [-54.00422, 71.54719], [-55.0, 71.406536967272558], [-55.83468, 71.65444], [-54.71819, 72.58625], [-55.32634, 72.95861], [-56.12003, 73.64977], [-57.32363, 74.71026], [-58.59679, 75.09861], [-58.58516, 75.51727], [-61.26861, 76.10238], [-63.39165, 76.1752], [-66.06427, 76.13486], [-68.50438, 76.06141], [-69.66485, 76.37975], [-71.40257, 77.00857], [-68.77671, 77.32312], [-66.76397, 77.37595], [-71.04293, 77.63595], [-73.297, 78.04419], [-73.15938, 78.43271], [-69.37345, 78.91388], [-65.7107, 79.39436], [-65.3239, 79.75814], [-68.02298, 80.11721], [-67.15129, 80.51582], [-63.68925, 81.21396], [-62.23444, 81.3211], [-62.65116, 81.77042], [-60.28249, 82.03363], [-57.20744, 82.19074], [-54.13442, 82.19962], [-53.04328, 81.88833], [-50.39061, 82.43883], [-48.00386, 82.06481], [-46.59984, 81.985945], [-44.523, 81.6607], [-46.9007, 82.19979], [-46.76379, 82.62796]]] } }, - { "type": "Feature", "properties": { "admin": "Guatemala", "name": "Guatemala", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-90.095554572290951, 13.73533763270073], [-90.608624030300817, 13.909771429901948], [-91.232410244496037, 13.927832342987953], [-91.689746670279106, 14.126218166556452], [-92.227750006869812, 14.538828640190925], [-92.203229539747298, 14.830102850804066], [-92.087215949252041, 15.064584662328436], [-92.229248623406249, 15.251446641495857], [-91.747960171255912, 16.066564846251719], [-90.464472622422647, 16.069562079324651], [-90.438866950222021, 16.410109768128091], [-90.600846727240906, 16.470777899638758], [-90.711821865587694, 16.687483018454724], [-91.081670091500641, 16.918476670799404], [-91.453921271515128, 17.252177232324168], [-91.002269253284197, 17.254657701074176], [-91.001519945015943, 17.817594916245707], [-90.067933519230948, 17.819326076727474], [-89.143080410503302, 17.808318996649316], [-89.15080603713092, 17.015576687075832], [-89.229121670269265, 15.886937567605166], [-88.930612759135244, 15.887273464415072], [-88.604586147805833, 15.706380113177358], [-88.518364020526846, 15.855389105690971], [-88.22502275262201, 15.727722479713901], [-88.680679694355618, 15.346247056535301], [-89.15481096063354, 15.066419175674806], [-89.225220099631244, 14.874286200413618], [-89.145535041037149, 14.67801911056908], [-89.353325975282772, 14.424132798719112], [-89.587342698916544, 14.362586167859485], [-89.5342193265205, 14.244815578666302], [-89.7219339668207, 14.134228013561694], [-90.064677903996568, 13.881969509328924], [-90.095554572290951, 13.73533763270073]]] } }, - { "type": "Feature", "properties": { "admin": "Guyana", "name": "Guyana", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-59.758284878159181, 8.367034816924045], [-59.10168412945864, 7.99920197187049], [-58.482962205628041, 7.347691351750696], [-58.454876064677414, 6.832787380394463], [-58.078103196837361, 6.809093736188641], [-57.542218593970631, 6.321268215353355], [-57.147436489476874, 5.973149929219161], [-57.307245856339492, 5.073566595882225], [-57.914288906472123, 4.812626451024413], [-57.860209520078691, 4.576801052260449], [-58.044694383360664, 4.060863552258382], [-57.601568976457848, 3.334654649260684], [-57.281433478409703, 3.333491929534119], [-57.150097825739898, 2.768926906745406], [-56.53938574891454, 1.89952260986692], [-56.782704230360814, 1.863710842288653], [-57.33582292339689, 1.948537705895759], [-57.660971035377358, 1.682584947105638], [-58.113449876525003, 1.507195135907025], [-58.429477098205957, 1.46394196207872], [-58.540012986878288, 1.26808828369252], [-59.030861579002639, 1.317697658692722], [-59.646043667221242, 1.786893825686789], [-59.718545701726732, 2.249630438644359], [-59.974524909084543, 2.755232652188055], [-59.815413174057852, 3.606498521332085], [-59.538039923731219, 3.958802598481937], [-59.767405768458701, 4.423502915866606], [-60.111002366767373, 4.574966538914082], [-59.980958624904865, 5.014061184098138], [-60.213683437731319, 5.2444863956876], [-60.733574184803707, 5.2002772078619], [-61.410302903881941, 5.959068101419616], [-61.139415045807937, 6.234296779806142], [-61.159336310456467, 6.696077378766317], [-60.543999192940966, 6.856584377464881], [-60.295668097562377, 7.043911444522918], [-60.637972785063752, 7.414999904810853], [-60.550587938058186, 7.779602972846178], [-59.758284878159181, 8.367034816924045]]] } }, - { "type": "Feature", "properties": { "admin": "Honduras", "name": "Honduras", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-87.316654425795463, 12.984685777229], [-87.48940873894712, 13.29753489832393], [-87.793111131526501, 13.384480495655165], [-87.723502977229288, 13.785050360565602], [-87.859515347021599, 13.893312486217097], [-88.065342576840109, 13.964625962779788], [-88.503997972349609, 13.845485948130939], [-88.541230841815931, 13.98015473068352], [-88.843072882832743, 14.140506700085208], [-89.058511929057644, 14.340029405164213], [-89.353325975282786, 14.424132798719084], [-89.145535041037164, 14.678019110569149], [-89.22522009963123, 14.874286200413675], [-89.154810960633526, 15.066419175674863], [-88.680679694355575, 15.346247056535386], [-88.225022752621925, 15.727722479714027], [-88.121153123715359, 15.688655096901355], [-87.901812506852394, 15.864458319558194], [-87.615680101252309, 15.878798529519198], [-87.522920905288444, 15.797278957578779], [-87.367762417332116, 15.846940009011286], [-86.903191291028165, 15.756712958229565], [-86.440945604177372, 15.782835394753189], [-86.119233974944322, 15.893448798073958], [-86.00195431185783, 16.005405788634388], [-85.68331743034625, 15.953651841693949], [-85.444003872402547, 15.885749009662444], [-85.182443610357183, 15.909158433490628], [-84.98372188997881, 15.995923163308698], [-84.526979743167118, 15.857223619037423], [-84.36825558138257, 15.835157782448729], [-84.063054572266807, 15.648244126849132], [-83.773976610026111, 15.42407176356687], [-83.410381232420363, 15.27090281825377], [-83.147219000974104, 14.995829169164207], [-83.489988776366005, 15.01626719813566], [-83.628584967772866, 14.880073960830368], [-83.975721401693576, 14.749435939996483], [-84.228341640952394, 14.748764146376626], [-84.449335903648588, 14.62161428472251], [-84.64958207877963, 14.666805324761865], [-84.820036790694289, 14.819586696832628], [-84.924500698572302, 14.790492865452332], [-85.052787441736868, 14.551541042534719], [-85.148750576502877, 14.560196844943615], [-85.165364549484806, 14.354369615125048], [-85.514413011400265, 14.079011745657905], [-85.698665330736944, 13.960078436737998], [-85.801294725268505, 13.8360549992376], [-86.096263800790595, 14.03818736414723], [-86.312142096689826, 13.771356106008223], [-86.520708177419891, 13.778487453664464], [-86.755086636079596, 13.754845485890936], [-86.733821784191463, 13.263092556201398], [-86.880557013684353, 13.254204209847213], [-87.005769009127434, 13.025794379117254], [-87.316654425795463, 12.984685777229]]] } }, - { "type": "Feature", "properties": { "admin": "Croatia", "name": "Croatia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[18.829838087650039, 45.908877671891837], [19.072768995854172, 45.521511135432078], [19.390475701584588, 45.236515611342369], [19.005486281010118, 44.860233669609144], [18.553214145591646, 45.08158966733145], [17.861783481526398, 45.067740383477137], [17.00214603035101, 45.233776760430935], [16.534939406000202, 45.211607570977705], [16.318156772535868, 45.004126695325901], [15.959367303133373, 45.233776760430935], [15.750026075918978, 44.81871165626255], [16.239660271884528, 44.351143296885695], [16.456442905348862, 44.041239732431265], [16.916156447017325, 43.667722479825663], [17.297373488034449, 43.446340643887353], [17.674921502358981, 43.028562527023603], [18.56, 42.65], [18.450016310304814, 42.47999136002931], [17.509970330483323, 42.84999461523914], [16.930005730871638, 43.209998480800373], [16.015384555737679, 43.507215481127204], [15.174453973052094, 44.243191229827907], [15.376250441151793, 44.317915350922064], [14.920309279040504, 44.73848399512945], [14.901602410550874, 45.076060289076104], [14.258747592839992, 45.233776760430935], [13.952254672917032, 44.802123521496853], [13.65697553880119, 45.136935126315947], [13.679403110415816, 45.484149074884996], [13.715059848697248, 45.500323798192419], [14.411968214585496, 45.466165676447403], [14.595109490627916, 45.63494090431282], [14.935243767972961, 45.471695054702757], [15.327674594797424, 45.452316392593325], [15.323953891672428, 45.731782538427687], [15.671529575267638, 45.8341535507979], [15.768732944408608, 46.23810822202352], [16.564808383864939, 46.503750922219794], [16.882515089595412, 46.380631822284428], [17.630066359129554, 45.951769110694087], [18.456062452882858, 45.759481106136143], [18.829838087650039, 45.908877671891837]]] } }, - { "type": "Feature", "properties": { "admin": "Haiti", "name": "Haiti", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-73.189790615517595, 19.915683905511909], [-72.579672817663607, 19.871500555902351], [-71.71236141629295, 19.714455878167353], [-71.624873216422813, 19.169837958243303], [-71.701302659782485, 18.785416978424049], [-71.945112067335543, 18.616900132720257], [-71.687737596305865, 18.316660061104468], [-71.708304816358037, 18.044997056546091], [-72.372476162389333, 18.214960842354053], [-72.844411180294856, 18.145611070218362], [-73.454554816365018, 18.217906398994696], [-73.922433234335642, 18.030992743395], [-74.458033616824764, 18.342549953682703], [-74.369925299767118, 18.664907538319408], [-73.449542202432696, 18.526052964751141], [-72.694937099890623, 18.445799465401858], [-72.334881557896992, 18.66842153571525], [-72.791649542924873, 19.101625067618027], [-72.784104783810264, 19.483591416903405], [-73.41502234566174, 19.639550889560276], [-73.189790615517595, 19.915683905511909]]] } }, - { "type": "Feature", "properties": { "admin": "Hungary", "name": "Hungary", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.202298211337361, 46.852385972676949], [16.534267612380372, 47.496170966169103], [16.340584344150411, 47.712901923201215], [16.903754103267257, 47.714865627628321], [16.979666782304033, 48.123497015976298], [17.488472934649813, 47.867466132186209], [17.857132602620023, 47.758428860050365], [18.696512892336923, 47.88095368101439], [18.777024773847668, 48.081768296900627], [19.174364861739885, 48.111378892603859], [19.66136355965849, 48.266614895208647], [19.769470656013109, 48.2026911484636], [20.239054396249344, 48.327567247096916], [20.473562045989862, 48.562850043321809], [20.801293979584919, 48.62385407164237], [21.872236362401729, 48.319970811550007], [22.085608351334848, 48.422264309271782], [22.640819939878746, 48.150239569687351], [22.710531447040488, 47.882193915389394], [22.09976769378283, 47.672439276716695], [21.626514926853869, 46.994237779318148], [21.021952345471245, 46.316087958351886], [20.220192498462833, 46.127468980486547], [19.596044549241579, 46.171729844744533], [18.829838087649957, 45.908877671891915], [18.456062452882858, 45.759481106136121], [17.630066359129554, 45.95176911069418], [16.882515089595298, 46.380631822284428], [16.564808383864854, 46.503750922219822], [16.370504998447412, 46.841327216166498], [16.202298211337361, 46.852385972676949]]] } }, - { "type": "Feature", "properties": { "admin": "Indonesia", "name": "Indonesia", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[120.715608758630438, -10.239581394087862], [120.295014276206871, -10.258649997603525], [118.967808465654684, -9.55796925215803], [119.900309686361609, -9.361340427287514], [120.425755649905398, -9.665921319215796], [120.775501743656719, -9.969675388227456], [120.715608758630438, -10.239581394087862]]], [[[124.435950148619384, -10.14000090906144], [123.579981724136701, -10.359987481327961], [123.459989048354998, -10.239994805546171], [123.55000939340745, -9.900015557497978], [123.980008986508096, -9.290026950724693], [124.96868248911619, -8.892790215697046], [125.070019972840612, -9.089987481322835], [125.088520135601073, -9.393173109579321], [124.435950148619384, -10.14000090906144]]], [[[117.900018345207741, -8.095681247594923], [118.260616489740471, -8.362383314653327], [118.87845991422212, -8.280682875199828], [119.126506789223086, -8.705824883665072], [117.97040164598927, -8.906639499551257], [117.277730747549015, -9.040894870645557], [116.74014082241662, -9.032936700072637], [117.083737420725313, -8.457157891476539], [117.632024367342126, -8.44930307376819], [117.900018345207741, -8.095681247594923]]], [[[122.903537225436082, -8.094234307490735], [122.756982863456287, -8.649807631060638], [121.2544905945701, -8.933666273639941], [119.924390903809567, -8.810417982623873], [119.920928582846102, -8.44485890059107], [120.715091994307542, -8.236964613480863], [121.341668735846554, -8.53673959720602], [122.007364536630405, -8.46062021244016], [122.903537225436082, -8.094234307490735]]], [[[108.623478631628927, -6.777673841990675], [110.539227329553285, -6.877357679881682], [110.759575636845909, -6.465186455921751], [112.614811232556349, -6.946035658397589], [112.978768345188087, -7.594213148634578], [114.478935174621142, -7.776527601760277], [115.705526971501058, -8.370806573116864], [114.564511346496488, -8.75181690840483], [113.464733514460875, -8.348947442257424], [112.559672479301028, -8.376180922075163], [111.522061395312448, -8.302128594600957], [110.586149530074294, -8.122604668819021], [109.427667270955183, -7.740664157749761], [108.693655226681301, -7.641600437046219], [108.277763299596302, -7.766657403192579], [106.454102004016136, -7.354899590690947], [106.280624220812285, -6.924899997590201], [105.365486281355516, -6.851416110871169], [106.051645949327053, -5.895918877794499], [107.265008579540165, -5.954985039904058], [108.072091099074683, -6.345762220895237], [108.486846144649235, -6.421984958525768], [108.623478631628927, -6.777673841990675]]], [[[134.724624465066654, -6.214400730009286], [134.210133905168902, -6.895237725454704], [134.112775506730998, -6.142467136259014], [134.290335728085779, -5.783057549669038], [134.499625278867882, -5.445042006047898], [134.727001580952106, -5.737582289252158], [134.724624465066654, -6.214400730009286]]], [[[127.249215122588893, -3.459065036638889], [126.874922723498855, -3.790982761249579], [126.183802118027302, -3.607376397316556], [125.989033644719257, -3.177273451351325], [127.00065148326496, -3.12931772218441], [127.249215122588893, -3.459065036638889]]], [[[130.471344028851775, -3.09376433676762], [130.834836053592767, -3.858472181822761], [129.990546502808115, -3.446300957862817], [129.155248651242403, -3.362636813982248], [128.590683628453633, -3.428679294451256], [127.898891229362334, -3.393435967628192], [128.135879347852779, -2.843650404474914], [129.370997756060888, -2.802154229344551], [130.471344028851775, -3.09376433676762]]], [[[134.143367954647772, -1.151867364103594], [134.422627394753022, -2.769184665542383], [135.457602980694674, -3.367752780779113], [136.293314243718754, -2.30704233155609], [137.4407377463275, -1.703513278819372], [138.329727411044757, -1.70268645590265], [139.18492068904294, -2.051295668143637], [139.926684198160387, -2.409051608900284], [141.000210402591847, -2.600151055515624], [141.017056919519007, -5.85902190513802], [141.033851760013874, -9.117892754760417], [140.143415155192542, -8.297167657100955], [139.127766554928087, -8.096042982620942], [138.881476678624949, -8.380935153846094], [137.614473911692812, -8.41168263105976], [138.039099155835174, -7.597882175327354], [138.668621454014783, -7.320224704623072], [138.407913853102343, -6.232849216337483], [137.927839797110835, -5.393365573755998], [135.989250116113453, -4.546543877789047], [135.164597609599667, -4.462931410340771], [133.662880487197867, -3.538853448097526], [133.367704705946778, -4.024818617370314], [132.983955519747326, -4.112978610860281], [132.75694095268895, -3.746282647317129], [132.753788690319197, -3.311787204607071], [131.989804315316178, -2.820551039240455], [133.066844517143466, -2.460417982598443], [133.780030959203486, -2.479848321140209], [133.69621178602614, -2.214541517753687], [132.232373488494204, -2.212526136894325], [131.836221958544684, -1.617161960459597], [130.942839797082797, -1.432522067880796], [130.519558140180038, -0.937720228686075], [131.867537876513609, -0.695461114101818], [132.380116408416768, -0.369537855636977], [133.985548130428384, -0.780210463060442], [134.143367954647772, -1.151867364103594]]], [[[125.240500522971573, 1.419836127117605], [124.43703535369734, 0.427881171058971], [123.685504998876695, 0.235593166500877], [122.723083123872854, 0.431136786293337], [121.056724888189081, 0.381217352699451], [120.18308312386273, 0.23724681233422], [120.040869582195455, -0.519657891444851], [120.935905389490699, -1.408905938323372], [121.475820754076167, -0.955962009285116], [123.34056481332847, -0.615672702643081], [123.258399285984481, -1.076213067228337], [122.822715285331597, -0.930950616055881], [122.388529901215364, -1.516858005381124], [121.508273553555455, -1.904482924002422], [122.454572381684272, -3.186058444840881], [122.271896193532541, -3.529500013852696], [123.170962762546537, -4.683693129091707], [123.162332798353759, -5.34060393638596], [122.628515252778683, -5.634591159694494], [122.236394484548057, -5.282933037948281], [122.71956912647704, -4.46417164471579], [121.738233677254357, -4.851331475446499], [121.48946333220124, -4.574552504091215], [121.619171177253861, -4.188477878438674], [120.898181593917684, -3.602105401222828], [120.972388950688767, -2.627642917494909], [120.305452915529884, -2.931603692235725], [120.39004723519173, -4.097579034037223], [120.430716587405371, -5.528241062037778], [119.796543410319487, -5.67340016034565], [119.36690555224493, -5.379878024927804], [119.653606398600104, -4.459417412944958], [119.498835483885969, -3.49441171632651], [119.078344354326987, -3.487021986508764], [118.767768996252869, -2.801999200047688], [119.180973748858662, -2.147103773612798], [119.323393996255049, -1.35314706788047], [119.825998976725828, 0.154254462073496], [120.035701938966341, 0.566477362465804], [120.885779250167687, 1.309222723796835], [121.666816847826965, 1.013943589681076], [122.927566766451818, 0.875192368977465], [124.077522414242836, 0.917101955566139], [125.065989211121803, 1.643259182131558], [125.240500522971573, 1.419836127117605]]], [[[128.688248732620707, 1.132385972494106], [128.635952183141342, 0.258485826006179], [128.120169712436166, 0.356412665199286], [127.968034295768845, -0.252077325037533], [128.379998813999691, -0.780003757331286], [128.100015903842291, -0.899996433112974], [127.69647464407501, -0.266598402511505], [127.399490187693743, 1.011721503092573], [127.600511509309044, 1.81069082275718], [127.932377557487484, 2.174596258956555], [128.004156121940809, 1.628531398928331], [128.594559360875451, 1.540810655112864], [128.688248732620707, 1.132385972494106]]], [[[117.875627069166001, 1.827640692548911], [118.996747267738158, 0.902219143066048], [117.811858351717788, 0.784241848143722], [117.478338657706047, 0.102474676917026], [117.521643507966587, -0.803723239753211], [116.560048455879496, -1.487660821136231], [116.533796828275158, -2.483517347832901], [116.148083937648607, -4.012726332214014], [116.000857782049067, -3.657037448749008], [114.864803094544513, -4.106984144714416], [114.468651564595064, -3.49570362713382], [113.755671828264099, -3.439169610206519], [113.256994256647545, -3.118775729996854], [112.068126255340644, -3.478392022316071], [111.703290643359992, -2.994442233902631], [111.04824018762821, -3.049425957861188], [110.223846063275971, -2.934032484553483], [110.070935500124335, -1.592874037282414], [109.571947869914041, -1.314906507984489], [109.091873813922518, -0.459506524257051], [108.952657505328162, 0.415375474444346], [109.069136183714036, 1.341933905437642], [109.663260125773718, 2.006466986494984], [109.830226678508836, 1.338135687664191], [110.514060907027101, 0.773131415200993], [111.159137811326559, 0.976478176269509], [111.797548455860408, 0.904441229654651], [112.380251906383648, 1.410120957846757], [112.859809198052176, 1.497790025229946], [113.805849644019531, 1.217548732911041], [114.621355422017473, 1.430688177898886], [115.134037306785231, 2.821481838386219], [115.51907840379198, 3.169238389494395], [115.86551720587677, 4.306559149590156], [117.01521447150634, 4.306094061699468], [117.882034946770162, 4.137551377779487], [117.313232456533513, 3.234428208830578], [118.048329705885351, 2.287690131027361], [117.875627069166001, 1.827640692548911]]], [[[105.817655063909356, -5.852355645372411], [104.710384149191498, -5.873284600450644], [103.868213332130736, -5.037314955264974], [102.584260695406897, -4.220258884298203], [102.156173130300999, -3.614146009946765], [101.399113397225051, -2.799777113459171], [100.902502882900137, -2.05026213949786], [100.141980828860596, -0.650347588710957], [99.26373986206022, 0.183141587724663], [98.970011020913319, 1.042882391764536], [98.601351352943084, 1.823506577965616], [97.699597609449881, 2.453183905442116], [97.17694217324987, 3.30879059489861], [96.424016554757316, 3.86885976807791], [95.380876092513475, 4.970782172053673], [95.293026157617305, 5.479820868344816], [95.936862827541745, 5.439513251157108], [97.484882033277088, 5.24632090903401], [98.369169142655679, 4.268370266126366], [99.142558628335792, 3.590349636240915], [99.693997837322399, 3.174328518075156], [100.641433546961665, 2.099381211755798], [101.658012323007313, 2.083697414555189], [102.498271112073212, 1.398700466310217], [103.076840448013002, 0.561361395668854], [103.838396030698348, 0.104541734208666], [103.437645298274973, -0.711945896002845], [104.010788608824001, -1.059211521004229], [104.369991489684878, -1.084843031421016], [104.539490187602155, -1.782371514496716], [104.887892694113987, -2.340425306816655], [105.622111444116982, -2.42884368246807], [106.10859337771268, -3.06177662517895], [105.857445916774111, -4.305524997579723], [105.817655063909356, -5.852355645372411]]]] } }, - { "type": "Feature", "properties": { "admin": "India", "name": "India", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[77.837450799474553, 35.494009507787759], [78.912268914713209, 34.321936346975782], [78.811086460285722, 33.506198025032404], [79.208891636068572, 32.994394639613709], [79.176128777995501, 32.483779812137705], [78.458446486325997, 32.61816437431272], [78.738894484374001, 31.515906073527056], [79.721366815107089, 30.882714748654724], [81.11125613802929, 30.183480943313398], [80.476721225917373, 29.729865220655334], [80.088424513676259, 28.794470119740136], [81.057202589851997, 28.416095282499036], [81.999987420584958, 27.925479234319987], [83.304248895199535, 27.364505723575554], [84.675017938173767, 27.234901231387528], [85.25177859898335, 26.726198431906337], [86.024392938179147, 26.630984605408567], [87.22747195836628, 26.39789805755607], [88.060237664749806, 26.414615383402484], [88.174804315140904, 26.810405178325944], [88.043132765661198, 27.445818589786818], [88.120440708369841, 27.876541652939586], [88.730325962278528, 28.086864732367509], [88.814248488320544, 27.299315904239361], [88.835642531289366, 27.098966376243755], [89.744527622438838, 26.71940298105995], [90.37327477413406, 26.875724188742872], [91.217512648486405, 26.808648179628019], [92.033483514375078, 26.838310451763554], [92.10371178585973, 27.4526140406332], [91.69665652869665, 27.771741848251661], [92.503118931043616, 27.896876329046442], [93.413347609432662, 28.640629380807219], [94.565990431702929, 29.277438055939978], [95.404802280664612, 29.031716620392125], [96.117678664131006, 29.452802028922459], [96.586590610747479, 28.830979519154337], [96.248833449287758, 28.411030992134435], [97.327113885490007, 28.261582749946331], [97.402561476636123, 27.88253611908544], [97.051988559968066, 27.699058946233144], [97.133999058015277, 27.08377350514996], [96.419365675850941, 27.264589341739221], [95.124767694074933, 26.573572089132295], [95.155153436262566, 26.001307277932078], [94.603249139385355, 25.162495428970399], [94.552657912171611, 24.675238348890328], [94.106741977925054, 23.850740871673477], [93.325187615942767, 24.078556423432197], [93.286326938859247, 23.043658352138998], [93.060294224014598, 22.703110663335565], [93.166127557348361, 22.278459580977099], [92.672720981825549, 22.041238918541247], [92.146034783906799, 23.62749868417259], [91.869927606171302, 23.62434642180278], [91.706475050832083, 22.985263983649183], [91.158963250699713, 23.503526923104381], [91.467729933643668, 24.072639471934789], [91.915092807994398, 24.130413723237108], [92.376201613334786, 24.976692816664961], [91.799595981822065, 25.14743174895731], [90.872210727912105, 25.13260061288954], [89.920692580121838, 25.269749864192171], [89.832480910199592, 25.965082098895476], [89.355094028687276, 26.014407253518065], [88.56304935094974, 26.446525580342716], [88.209789259802477, 25.768065700782707], [88.931553989623069, 25.238692328384769], [88.30637251175601, 24.866079413344199], [88.084422235062405, 24.501657212821918], [88.699940220090895, 24.233714911388557], [88.529769728553759, 23.631141872649163], [88.876311883503064, 22.879146429937826], [89.031961297566198, 22.055708319582973], [88.888765903685396, 21.690588487224741], [88.208497348995209, 21.703171698487804], [86.975704380240259, 21.495561631755201], [87.033168572948853, 20.743307806882406], [86.499351027373777, 20.151638495356604], [85.060265740909671, 19.478578802971096], [83.941005893899998, 18.302009792549722], [83.189217156917834, 17.671221421778977], [82.192792189465905, 17.016636053937813], [82.191241896497175, 16.556664130107844], [81.692719354177456, 16.3102192245079], [80.791999139330116, 15.951972357644488], [80.324895867843864, 15.899184882058346], [80.025069207686428, 15.136414903214144], [80.23327355339039, 13.835770778859978], [80.286293572921849, 13.006260687710832], [79.862546828128487, 12.056215318240886], [79.85799930208681, 10.357275091997108], [79.340511509115984, 10.308854274939618], [78.885345493489169, 9.54613597252772], [79.189719679688281, 9.216543687370146], [78.27794070833049, 8.933046779816932], [77.94116539908434, 8.25295909263974], [77.539897902337927, 7.965534776232331], [76.592978957021657, 8.899276231314188], [76.130061476551063, 10.299630031775518], [75.746467319648488, 11.308250637248303], [75.396101108709573, 11.781245022015822], [74.864815708316812, 12.741935736537895], [74.616717156883524, 13.992582912649677], [74.443859490867197, 14.617221787977693], [73.534199253233368, 15.990652167214957], [73.119909295549419, 17.928570054592495], [72.820909458308634, 19.208233547436162], [72.824475132136783, 20.41950328214153], [72.630533481745388, 21.356009426351001], [71.175273471973938, 20.757441311114228], [70.470458611945091, 20.877330634031381], [69.164130080038817, 22.089298000572697], [69.644927606082391, 22.450774644454334], [69.349596795534325, 22.843179633062686], [68.176645135373377, 23.691965033456704], [68.842599318318761, 24.359133612560932], [71.0432401874682, 24.356523952730193], [70.844699334602822, 25.215102037043511], [70.282873162725579, 25.722228705339823], [70.168926629522005, 26.491871649678835], [69.514392938113119, 26.940965684511365], [70.61649620960192, 27.989196275335861], [71.777665643200308, 27.913180243434521], [72.823751662084689, 28.961591701772047], [73.450638462217412, 29.976413479119863], [74.421380242820263, 30.97981476493117], [74.405928989564998, 31.692639471965272], [75.258641798813187, 32.271105455040491], [74.451559279278698, 32.764899603805489], [74.104293654277328, 33.441473293586846], [73.749948358051952, 34.317698879527846], [74.240202671204955, 34.748887030571247], [75.757060988268321, 34.504922593721311], [76.871721632804011, 34.653544012992732], [77.837450799474553, 35.494009507787759]]] } }, - { "type": "Feature", "properties": { "admin": "Ireland", "name": "Ireland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-6.197884894220989, 53.86756500916335], [-6.032985398777609, 53.153164170944336], [-6.788856573910847, 52.260117906292322], [-8.561616583683557, 51.669301255899349], [-9.977085740590267, 51.820454820353071], [-9.16628251793078, 52.864628811242667], [-9.688524542672452, 53.881362616585285], [-8.327987433292007, 54.664518947968624], [-7.572167934591064, 55.131622219454854], [-7.366030646178785, 54.595840969452709], [-7.572167934591064, 54.059956366585986], [-6.953730231138065, 54.073702297575622], [-6.197884894220989, 53.86756500916335]]] } }, - { "type": "Feature", "properties": { "admin": "Iran", "name": "Iran", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[53.921597934795543, 37.198918361961255], [54.800303989486558, 37.392420762678178], [55.511578403551894, 37.964117133123153], [56.180374790273319, 37.935126654607423], [56.619366082592805, 38.121394354803478], [57.330433790928964, 38.029229437810933], [58.436154412678192, 37.522309475243794], [59.234761997316795, 37.412987982730336], [60.377637973883864, 36.52738312432836], [61.123070509694131, 36.491597194966239], [61.21081709172573, 35.650072333309218], [60.80319339380744, 34.404101874319856], [60.528429803311575, 33.676446031217999], [60.963700392505991, 33.528832302376252], [60.536077915290761, 32.981268825811561], [60.863654819588952, 32.182919623334421], [60.941944614511115, 31.548074652628745], [61.699314406180811, 31.379506130492661], [61.78122155136343, 30.735850328081231], [60.874248488208778, 29.829238999952604], [61.369308709564926, 29.303276272085917], [61.771868117118615, 28.699333807890792], [62.727830438085974, 28.259644883735383], [62.755425652929851, 27.378923448184985], [63.23389773952028, 27.217047024030702], [63.316631707619578, 26.756532497661659], [61.874187453056535, 26.239974880472097], [61.497362908784183, 25.078237006118492], [59.616134067630831, 25.380156561783775], [58.525761346272297, 25.609961656185725], [57.39725141788238, 25.739902045183634], [56.97076582217754, 26.966106268821356], [56.492138706290199, 27.14330475515019], [55.723710158110059, 26.964633490501036], [54.715089552637252, 26.480657863871507], [53.493096958231334, 26.812368882753042], [52.483597853409599, 27.580849107365488], [51.520762566947404, 27.865689602158291], [50.852948032439528, 28.814520575469377], [50.115008579311571, 30.14777252859971], [49.576850213423988, 29.9857152369324], [48.941333449098536, 30.31709035900403], [48.567971225789748, 29.926778265903515], [48.014568312376085, 30.452456773392594], [48.00469811380831, 30.985137437457237], [47.685286085812258, 30.984853217079621], [47.849203729042095, 31.709175930298663], [47.334661492711895, 32.469155381799105], [46.109361606639304, 33.017287299118998], [45.416690708199035, 33.967797756479577], [45.648459507028079, 34.748137722303007], [46.15178795755093, 35.093258775364284], [46.076340366404786, 35.67738332777548], [45.420618117053202, 35.977545884742817], [44.77267, 37.17045], [44.225755649600522, 37.971584377589345], [44.421402622257538, 38.281281236314534], [44.109225294782334, 39.428136298168091], [44.793989699081934, 39.713002631177041], [44.9526880226503, 39.335764675446363], [45.457721795438765, 38.874139105783051], [46.143623081248812, 38.74120148371221], [46.505719842317966, 38.770605373686287], [47.685079380083081, 39.508363959301207], [48.060095249225235, 39.582235419262453], [48.355529412637871, 39.2887649602769], [48.010744256386474, 38.794014797514514], [48.634375441284803, 38.27037750910096], [48.883249139202483, 38.32024526626261], [49.199612257693332, 37.582874253889877], [50.147771437384606, 37.37456655532133], [50.842354363819695, 36.872814235983384], [52.26402469260141, 36.700421657857696], [53.825789829326411, 36.965030829408228], [53.921597934795543, 37.198918361961255]]] } }, - { "type": "Feature", "properties": { "admin": "Iraq", "name": "Iraq", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[45.420618117053202, 35.977545884742817], [46.076340366404786, 35.67738332777548], [46.15178795755093, 35.093258775364284], [45.648459507028079, 34.748137722303007], [45.416690708199035, 33.967797756479577], [46.109361606639304, 33.017287299118998], [47.334661492711895, 32.469155381799105], [47.849203729042095, 31.709175930298663], [47.685286085812258, 30.984853217079621], [48.00469811380831, 30.985137437457237], [48.014568312376085, 30.452456773392594], [48.567971225789748, 29.926778265903515], [47.974519077349889, 29.975819200148493], [47.302622104690947, 30.059069932570711], [46.568713413281742, 29.099025173452283], [44.709498732284736, 29.178891099559376], [41.889980910007829, 31.190008653278362], [40.399994337736238, 31.889991766887931], [39.195468377444961, 32.16100881604266], [38.792340529136077, 33.378686428352218], [41.00615888851992, 34.419372260062111], [41.383965285005807, 35.628316555314349], [41.289707472505448, 36.358814602192261], [41.837064243340954, 36.605853786763568], [42.349591098811764, 37.22987254490409], [42.779125604021822, 37.385263576805741], [43.942258742047287, 37.256227525372942], [44.293451775902852, 37.001514390606289], [44.772699008977689, 37.170444647768427], [45.420618117053202, 35.977545884742817]]] } }, - { "type": "Feature", "properties": { "admin": "Iceland", "name": "Iceland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-14.508695441129232, 66.455892239031414], [-14.739637417041605, 65.808748277440287], [-13.609732224979807, 65.126671047619851], [-14.9098337467949, 64.36408193628867], [-17.794438035543418, 63.67874909123384], [-18.656245896874989, 63.496382961675806], [-19.972754685942757, 63.643634955491514], [-22.762971971110154, 63.960178941495371], [-21.778484259517676, 64.402115790455497], [-23.955043911219104, 64.891129869233481], [-22.184402635170354, 65.084968166760291], [-22.227423265053329, 65.378593655042721], [-24.326184047939332, 65.611189276788451], [-23.650514695723082, 66.262519029395207], [-22.134922451250883, 66.410468655046856], [-20.576283738679543, 65.732112128351417], [-19.056841600001587, 66.276600857194751], [-17.798623826559048, 65.993853257909763], [-16.167818976292121, 66.526792304135853], [-14.508695441129232, 66.455892239031414]]] } }, - { "type": "Feature", "properties": { "admin": "Israel", "name": "Israel", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.719918247222743, 32.709192409794859], [35.545665317534535, 32.393992011030569], [35.183930291491428, 32.532510687788935], [34.974640740709319, 31.866582343059715], [35.225891554512422, 31.754341132121759], [34.970506626125989, 31.616778469360803], [34.927408481594554, 31.35343537040141], [35.397560662586038, 31.489086005167572], [35.420918409981958, 31.100065822874349], [34.922602573391423, 29.501326198844517], [34.26543338393568, 31.219360866820146], [34.556371697738903, 31.548823960896989], [34.48810713068135, 31.605538845337314], [34.752587111151165, 32.07292633720116], [34.955417107896771, 32.827376410446369], [35.098457472480668, 33.080539252244257], [35.126052687324538, 33.090900376918775], [35.460709262846699, 33.089040025356276], [35.552796665190805, 33.264274807258012], [35.821100701650231, 33.277426459276292], [35.836396925608618, 32.868123277308506], [35.700797967274745, 32.716013698857374], [35.719918247222743, 32.709192409794859]]] } }, - { "type": "Feature", "properties": { "admin": "Italy", "name": "Italy", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[15.52037601081383, 38.231155096991465], [15.160242954171732, 37.444045518537813], [15.309897902089002, 37.134219468731793], [15.099988234119445, 36.61998729099539], [14.335228712632013, 36.996630967754747], [13.826732618879927, 37.104531358380186], [12.431003859108809, 37.612949937483812], [12.570943637755132, 38.126381130519682], [13.741156447004581, 38.03496552179535], [14.761249220446157, 38.143873602850498], [15.52037601081383, 38.231155096991465]]], [[[9.210011834356264, 41.209991360024212], [9.809975213264973, 40.500008856766094], [9.669518670295671, 39.177376410471787], [9.214817742559486, 39.240473334300127], [8.806935662479729, 38.906617743478471], [8.428302443077113, 39.171847032216611], [8.388253208050939, 40.378310858718798], [8.159998406617659, 40.950007229163774], [8.709990675500107, 40.899984442705225], [9.210011834356264, 41.209991360024212]]], [[[12.376485223040842, 46.767559109069872], [13.806475457421552, 46.50930613869118], [13.698109978905475, 46.016778062517368], [13.937630242578335, 45.59101593686465], [13.141606479554294, 45.736691799495411], [12.328581170306304, 45.38177806251484], [12.383874952858601, 44.885374253919075], [12.261453484759157, 44.600482082694008], [12.589237094786482, 44.091365871754462], [13.526905958722491, 43.587727362637899], [14.029820997787024, 42.761007798832473], [15.142569614327952, 41.955139675456891], [15.926191033601892, 41.961315009115729], [16.169897088290409, 41.740294908203417], [15.889345737377793, 41.541082261718195], [16.785001661860573, 41.179605617836579], [17.519168735431204, 40.877143459632229], [18.376687452882575, 40.355624904942651], [18.4802470231954, 40.168866278639818], [18.293385044028096, 39.810774441073235], [17.738380161213279, 40.277671006830289], [16.869595981522334, 40.442234605463838], [16.448743116937319, 39.795400702466473], [17.171489698971495, 39.424699815420716], [17.052840610429339, 38.902871202137291], [16.635088331781841, 38.843572496082395], [16.100960727613053, 37.985898749334176], [15.684086948314498, 37.908849188787023], [15.687962680736318, 38.214592800441849], [15.891981235424705, 38.750942491199218], [16.109332309644312, 38.964547024077682], [15.718813510814638, 39.544072374014938], [15.413612501698818, 40.048356838535163], [14.998495721098234, 40.172948716790913], [14.703268263414767, 40.604550279292617], [14.06067182786526, 40.786347968095434], [13.627985060285393, 41.188287258461649], [12.888081902730418, 41.253089504555604], [12.106682570044907, 41.7045348170574], [11.191906365614184, 42.355425319989671], [10.511947869517794, 42.93146251074721], [10.200028924204046, 43.920006822274608], [9.702488234097812, 44.036278794931313], [8.888946160526869, 44.366336167979533], [8.428560825238575, 44.23122813575241], [7.8507666357832, 43.767147935555236], [7.435184767291841, 43.693844916349164], [7.549596388386161, 44.127901109384808], [7.007562290076661, 44.254766750661382], [6.749955275101711, 45.028517971367584], [7.096652459347835, 45.333098863295859], [6.80235517744566, 45.708579820328673], [6.84359297041456, 45.991146552100659], [7.273850945676683, 45.776947740250748], [7.755992058959832, 45.824490057959267], [8.316629672894377, 46.16364248309084], [8.489952426801294, 46.005150865251736], [8.966305779667833, 46.03693187111115], [9.18288170740311, 46.440214748716976], [9.92283654139035, 46.314899400409182], [10.363378126678665, 46.48357127540983], [10.4427014502466, 46.893546250997431], [11.048555942436504, 46.751358547546396], [11.164827915093325, 46.941579494812729], [12.153088006243079, 47.115393174826423], [12.376485223040842, 46.767559109069872]]]] } }, - { "type": "Feature", "properties": { "admin": "Jamaica", "name": "Jamaica", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-77.569600796199197, 18.490525417550483], [-76.896618618462114, 18.400866807524078], [-76.365359056285527, 18.16070058844759], [-76.19965857614163, 17.886867173732963], [-76.902561408175671, 17.868237819891743], [-77.206341315403449, 17.701116237859818], [-77.766022915340599, 17.861597398342237], [-78.337719285785596, 18.225967922432226], [-78.217726610003865, 18.454532782459193], [-77.797364671525614, 18.524218451404774], [-77.569600796199197, 18.490525417550483]]] } }, - { "type": "Feature", "properties": { "admin": "Jordan", "name": "Jordan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.545665317534535, 32.393992011030569], [35.719918247222743, 32.709192409794859], [36.834062127435537, 32.312937526980768], [38.792340529136077, 33.378686428352218], [39.195468377444961, 32.16100881604266], [39.004885695152545, 32.010216986614971], [37.002165561681004, 31.508412990844736], [37.998848911294367, 30.508499864213128], [37.668119744626374, 30.338665269485894], [37.503581984209028, 30.003776150018396], [36.740527784987243, 29.865283311476183], [36.501214227043583, 29.505253607698702], [36.068940870922049, 29.19749461518445], [34.956037225084252, 29.356554673778835], [34.922602573391423, 29.501326198844517], [35.420918409981958, 31.100065822874349], [35.397560662586038, 31.489086005167572], [35.545251906076196, 31.782504787720832], [35.545665317534535, 32.393992011030569]]] } }, - { "type": "Feature", "properties": { "admin": "Japan", "name": "Japan", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[134.638428176003856, 34.149233710256418], [134.766379022358478, 33.806334743783673], [134.20341596897083, 33.201177883429622], [133.792950067276479, 33.521985175097583], [133.280268182508848, 33.289570420864941], [133.014858026257855, 32.704567369104772], [132.363114862192674, 32.989382025681373], [132.371176385630179, 33.463642483040068], [132.924372593314786, 34.060298570282036], [133.492968377822194, 33.944620876596694], [133.904106073136347, 34.364931138642611], [134.638428176003856, 34.149233710256418]]], [[[140.976387567305267, 37.142074286440156], [140.599769728762084, 36.343983466124534], [140.774074334882641, 35.842877102190229], [140.253279250245072, 35.138113918593653], [138.975527785396196, 34.667600002576101], [137.217598911691198, 34.606285915661843], [135.792983026268871, 33.46480520276662], [135.120982700745401, 33.849071153289053], [135.07943484918269, 34.596544908174813], [133.340316196831964, 34.375938218720755], [132.156770868051296, 33.904933376596503], [130.986144647343451, 33.885761420216276], [132.000036248910021, 33.149992377244608], [131.33279015515734, 31.450354519164836], [130.68631798718593, 31.029579169228235], [130.202419875204953, 31.418237616495411], [130.447676222862128, 32.319474595665717], [129.81469160371887, 32.610309556604385], [129.408463169472554, 33.296055813117583], [130.353935174684636, 33.604150702441693], [130.878450962447118, 34.232742824840031], [131.884229364143891, 34.749713853487911], [132.617672967662486, 35.433393052709413], [134.608300815977771, 35.731617743465812], [135.677537876528902, 35.527134100886819], [136.723830601142424, 37.304984239240376], [137.390611607004473, 36.827390651998819], [138.857602166906247, 37.827484646143454], [139.426404657142882, 38.215962225897634], [140.054790073812057, 39.438807481436378], [139.883379347899847, 40.563312486323682], [140.305782505453664, 41.195005194659551], [141.368973423426667, 41.378559882160282], [141.914263136970476, 39.991616115878678], [141.884600864834965, 39.18086456965149], [140.959489373945729, 38.174000962876583], [140.976387567305267, 37.142074286440156]]], [[[143.910161981379474, 44.174099839853724], [144.613426548439634, 43.960882880217511], [145.320825230083074, 44.384732977875437], [145.543137241802754, 43.262088324550596], [144.059661899999867, 42.988358262700551], [143.183849725517291, 41.995214748699183], [141.611490920172457, 42.678790595056071], [141.067286411706618, 41.58459381770799], [139.95510623592105, 41.56955597591103], [139.817543573159924, 42.563758856774392], [140.312087030193169, 43.333272610032644], [141.380548944259999, 43.388824774746489], [141.671952345953912, 44.772125352551477], [141.967644891527982, 45.551483466161343], [143.142870314709796, 44.510358384776957], [143.910161981379474, 44.174099839853724]]]] } }, - { "type": "Feature", "properties": { "admin": "Kazakhstan", "name": "Kazakhstan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[70.962314894499272, 42.26615428320553], [70.388964878220776, 42.081307684897517], [69.070027296835221, 41.384244289712335], [68.632482944620037, 40.668680731766855], [68.259895867795635, 40.662324530594894], [67.985855747351806, 41.135990708982199], [66.714047072216587, 41.168443508461557], [66.510648634715707, 41.987644151368549], [66.023391554635609, 41.994646307944031], [66.098012322865188, 42.997660020513074], [64.90082441595932, 43.728080552742647], [63.18578698105658, 43.650074978197999], [62.013300408786264, 43.504476630215649], [61.05831994003249, 44.405816962250576], [60.239971958258472, 44.784036770194739], [58.689989048095796, 45.500013739598721], [58.503127068928428, 45.58680430763296], [55.928917270741167, 44.995858466159163], [55.968191359283011, 41.30864166926937], [55.455251092353805, 41.259859117185826], [54.755345493392653, 42.04397146256661], [54.079417759014959, 42.324109402020831], [52.944293247291725, 42.116034247397572], [52.502459751196277, 41.783315538086462], [52.446339145727208, 42.027150783855561], [52.692112257707251, 42.443895372073364], [52.501426222550315, 42.792297878585188], [51.342427199108201, 43.132974758469338], [50.891291945200223, 44.031033637053774], [50.339129266161358, 44.284015611338468], [50.305642938036257, 44.609835516938908], [51.278503452363211, 44.514854234386448], [51.316899041556034, 45.245998236667894], [52.167389764215713, 45.408391425145098], [53.040876499245194, 45.259046535821753], [53.220865512917712, 46.23464590105992], [53.042736850807771, 46.853006089864486], [52.042022739475598, 46.804636949239232], [51.191945428274252, 47.048704738953909], [50.034083286342465, 46.608989976582208], [49.10116, 46.39933000000012], [48.593241001180495, 46.561034247415471], [48.694733514201729, 47.075628160177921], [48.057253045449258, 47.743752753279516], [47.315231154170242, 47.715847479841948], [46.466445753776256, 48.394152330104923], [47.043671502476506, 49.1520388860976], [46.751596307162728, 49.35600576435376], [47.549480421749301, 50.454698391311119], [48.577841424357523, 49.874759629915658], [48.702381626181008, 50.605128485712825], [50.766648390512145, 51.692762356159889], [52.328723585830957, 51.71865224873811], [54.53287845237621, 51.026239732459302], [55.716940545479801, 50.62171662047853], [56.777961053296551, 51.043551337277037], [58.363290643146733, 51.063653469438563], [59.642282342370599, 50.545442206415707], [59.932807244715484, 50.842194118851857], [61.337424350840919, 50.799070136104248], [61.588003371024158, 51.2726587998432], [59.967533807215531, 51.960420437215696], [60.927268507740258, 52.447548326215028], [60.739993117114572, 52.719986477257734], [61.699986199800584, 52.979996446334255], [60.978066440683151, 53.664993394579128], [61.436591424409052, 54.006264553434775], [65.178533563095911, 54.354227810272093], [65.66687584825398, 54.601266994843449], [68.169100376258811, 54.970391750704309], [69.068166945272864, 55.385250149143516], [70.865266554655122, 55.169733588270091], [71.180131056609397, 54.133285224008247], [72.224150018202167, 54.376655381886728], [73.508516066384388, 54.035616766976588], [73.425678745420427, 53.489810289109741], [74.384845005190044, 53.546861070360066], [76.891100294913414, 54.490524400441913], [76.525179477854735, 54.177003485727127], [77.800915561844221, 53.404414984747561], [80.035559523441663, 50.864750881547238], [80.568446893235475, 51.388336493528456], [81.945985548839914, 50.812195949906354], [83.383003778012366, 51.069182847693909], [83.935114780618832, 50.889245510453563], [84.416377394553052, 50.311399644565817], [85.115559523462011, 50.117302964877631], [85.541269972682457, 49.69285858824815], [86.829356723989619, 49.826674709668154], [87.359970330762664, 49.214980780629148], [86.598776483103379, 48.549181626980605], [85.768232863308285, 48.455750637396974], [85.72048383987071, 47.452969468773112], [85.164290399113355, 47.000955715516099], [83.180483839860443, 47.330031236350848], [82.458925815769106, 45.539649563166499], [81.947070753918112, 45.317027492853235], [79.966106398441397, 44.917516994804643], [80.866206496101356, 43.180362046881037], [80.180150180994289, 42.920067857426936], [80.259990268885332, 42.349999294599101], [79.643645460940135, 42.496682847659649], [79.142177361979776, 42.856092434249589], [77.658391961583206, 42.960685533208327], [76.000353631498555, 42.988022365890622], [75.636964959622091, 42.877899888676765], [74.212865838522575, 43.298339341803505], [73.645303582660901, 43.091271877609863], [73.489757521462337, 42.500894476891276], [71.844638299450637, 42.845395412765178], [71.186280552052253, 42.704292914392219], [70.962314894499272, 42.26615428320553]]] } }, - { "type": "Feature", "properties": { "admin": "Kenya", "name": "Kenya", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[40.993, -0.85829], [41.58513, -1.68325], [40.88477, -2.08255], [40.63785, -2.49979], [40.26304, -2.57309], [40.12119, -3.27768], [39.80006, -3.68116], [39.60489, -4.34653], [39.20222, -4.67677], [37.7669, -3.67712], [37.69869, -3.09699], [34.07262, -1.05982], [33.903711197104521, -0.95], [33.893568969666937, 0.109813537861896], [34.18, 0.515], [34.6721, 1.17694], [35.03599, 1.90584], [34.59607, 3.05374], [34.47913, 3.5556], [34.005, 4.249884947362047], [34.620196267853871, 4.847122742081987], [35.298007118232974, 5.506], [35.817447662353501, 5.338232082790795], [35.817447662353501, 4.776965663461889], [36.159078632855639, 4.447864127672768], [36.855093238008116, 4.447864127672768], [38.120915, 3.598605], [38.43697, 3.58851], [38.67114, 3.61607], [38.89251, 3.50074], [39.559384258765846, 3.42206], [39.85494, 3.83879], [40.76848, 4.25702], [41.1718, 3.91909], [41.855083092643966, 3.918911920483726], [40.98105, 2.78452], [40.993, -0.85829]]] } }, - { "type": "Feature", "properties": { "admin": "Kyrgyzstan", "name": "Kyrgyzstan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[70.96231489449913, 42.266154283205481], [71.186280552052111, 42.704292914392127], [71.84463829945058, 42.845395412765093], [73.489757521462337, 42.500894476891311], [73.645303582660901, 43.09127187760982], [74.212865838522546, 43.298339341803363], [75.636964959622006, 42.877899888676673], [76.000353631498442, 42.988022365890664], [77.658391961583206, 42.960685533208256], [79.142177361979762, 42.856092434249511], [79.643645460940107, 42.496682847659514], [80.259990268885289, 42.349999294599044], [80.119430373051358, 42.123940741538235], [78.543660923175295, 41.582242540038685], [78.187196893225959, 41.185315863604792], [76.904484490877067, 41.066485907549634], [76.526368035797432, 40.427946071935111], [75.467827996730691, 40.562072251948663], [74.776862420556043, 40.366425279291619], [73.822243686828287, 39.893973497063179], [73.960013055318413, 39.660008449861721], [73.67537926625478, 39.431236884105594], [71.784693637991992, 39.279463202464363], [70.549161818325601, 39.604197902986492], [69.464886915977516, 39.526683254548693], [69.559609816368507, 40.103211371412968], [70.648018833299957, 39.935753892571157], [71.014198032520156, 40.244365546218226], [71.774875115856545, 40.145844428053763], [73.055417108049156, 40.86603302668945], [71.870114780570447, 41.392900092121259], [71.157858514291576, 41.143587144529107], [70.420022414028196, 41.519998277343134], [71.259247674448218, 42.167710679689456], [70.96231489449913, 42.266154283205481]]] } }, - { "type": "Feature", "properties": { "admin": "Cambodia", "name": "Cambodia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[103.497279901139677, 10.632555446815926], [103.090689731867229, 11.153660590047162], [102.58493248902667, 12.186594956913279], [102.348099399833004, 13.39424734135822], [102.988422072361601, 14.225721136934464], [104.281418084736586, 14.416743068901363], [105.218776890078871, 14.27321177821069], [106.04394616091551, 13.881091009979952], [106.496373325630856, 14.57058380783428], [107.382727492301058, 14.202440904186968], [107.614547967562402, 13.535530707244202], [107.491403029410861, 12.337205918827944], [105.810523716253101, 11.567614650921225], [106.249670037869436, 10.961811835163585], [105.199914992292321, 10.889309800658094], [104.334334751403446, 10.486543687375228], [103.497279901139677, 10.632555446815926]]] } }, - { "type": "Feature", "properties": { "admin": "South Korea", "name": "Korea", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[128.349716424676586, 38.612242946927843], [129.212919549680038, 37.432392483055942], [129.460449660358137, 36.784189154602821], [129.468304478066472, 35.632140611303939], [129.091376580929563, 35.08248423923142], [128.18585045787907, 34.890377102186385], [127.386519403188373, 34.475673733044111], [126.485747511908713, 34.390045884736473], [126.3739197124291, 34.934560451795939], [126.559231398627773, 35.684540513647896], [126.117397902532261, 36.725484727519252], [126.860143263863364, 36.893924058574612], [126.174758742376213, 37.749685777328033], [126.237338901881742, 37.840377916000271], [126.683719924018888, 37.804772854151174], [127.073308547067342, 38.256114813788393], [127.780035435090966, 38.304535630845884], [128.205745884311426, 38.370397243801882], [128.349716424676586, 38.612242946927843]]] } }, - { "type": "Feature", "properties": { "admin": "Kosovo", "name": "Kosovo", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.76216, 42.05186], [20.717310000000108, 41.84711], [20.59023, 41.85541], [20.52295, 42.21787], [20.28374, 42.32025], [20.0707, 42.58863], [20.25758, 42.81275], [20.49679, 42.88469], [20.63508, 43.21671], [20.81448, 43.27205], [20.95651, 43.13094], [21.143395, 43.068685000000123], [21.27421, 42.90959], [21.43866, 42.86255], [21.63302, 42.67717], [21.77505, 42.6827], [21.66292, 42.43922], [21.54332, 42.32025], [21.576635989402117, 42.245224397061847], [21.352700000000134, 42.2068], [20.76216, 42.05186]]] } }, - { "type": "Feature", "properties": { "admin": "Kuwait", "name": "Kuwait", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[47.974519077349889, 29.975819200148493], [48.183188510944483, 29.534476630159759], [48.09394331237641, 29.306299343374999], [48.416094191283939, 28.552004299426663], [47.708850538937376, 28.526062730416136], [47.459821811722819, 29.002519436147217], [46.568713413281742, 29.099025173452283], [47.302622104690947, 30.059069932570711], [47.974519077349889, 29.975819200148493]]] } }, - { "type": "Feature", "properties": { "admin": "Laos", "name": "Lao PDR", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[105.218776890078871, 14.27321177821069], [105.544338413517664, 14.723933620660414], [105.589038527450128, 15.570316066952856], [104.779320509868768, 16.441864935771445], [104.716947056092465, 17.428858954330078], [103.956476678485288, 18.240954087796872], [103.200192091893726, 18.309632066312769], [102.998705682387694, 17.961694647691598], [102.413004998791592, 17.932781683824281], [102.113591750092453, 18.109101670804161], [101.059547560635139, 17.512497259994486], [101.035931431077742, 18.408928330961611], [101.282014601651667, 19.462584947176762], [100.606293573003128, 19.508344427971217], [100.548881056726856, 20.109237982661124], [100.115987583417819, 20.41784963630818], [100.329101190189519, 20.786121731036229], [101.180005324307515, 21.436572984294024], [101.270025669359939, 21.201651923095177], [101.803119744882906, 21.174366766845065], [101.652017856861491, 22.318198757409544], [102.170435825613552, 22.464753119389297], [102.754896274834636, 21.675137233969462], [103.203861118586431, 20.766562201413745], [104.435000441508024, 20.758733221921528], [104.822573683697073, 19.886641750563879], [104.183387892678908, 19.624668077060214], [103.896532017026701, 19.265180975821799], [105.094598423281496, 18.666974595611073], [105.925762160264, 17.485315456608955], [106.55600792849566, 16.604283962464802], [107.312705926545576, 15.908538316303177], [107.564525181103875, 15.202173163305554], [107.382727492301058, 14.202440904186968], [106.496373325630856, 14.57058380783428], [106.04394616091551, 13.881091009979952], [105.218776890078871, 14.27321177821069]]] } }, - { "type": "Feature", "properties": { "admin": "Lebanon", "name": "Lebanon", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.821100701650231, 33.277426459276292], [35.552796665190805, 33.264274807258012], [35.460709262846699, 33.089040025356276], [35.126052687324538, 33.090900376918775], [35.48220665868012, 33.905450140919434], [35.979592319489392, 34.610058295219126], [35.998402540843628, 34.644914048799997], [36.448194207512095, 34.59393524834406], [36.611750115715886, 34.201788641897174], [36.066460402172048, 33.824912421192543], [35.821100701650231, 33.277426459276292]]] } }, - { "type": "Feature", "properties": { "admin": "Liberia", "name": "Liberia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-7.712159389669749, 4.364565944837721], [-7.974107224957249, 4.355755113131961], [-9.004793667018673, 4.832418524592199], [-9.913420376006682, 5.593560695819205], [-10.765383876986643, 6.140710760925556], [-11.438779466182053, 6.785916856305746], [-11.199801805048278, 7.105845648624735], [-11.14670427086838, 7.396706447779534], [-10.695594855176477, 7.939464016141085], [-10.230093553091276, 8.406205552601291], [-10.016566534861253, 8.42850393313523], [-9.755342169625832, 8.541055202666923], [-9.33727983238458, 7.928534450711351], [-9.403348151069748, 7.526905218938906], [-9.208786383490844, 7.313920803247952], [-8.926064622422002, 7.309037380396375], [-8.722123582382123, 7.711674302598509], [-8.439298468448696, 7.686042792181736], [-8.485445522485348, 7.395207831243068], [-8.385451626000572, 6.911800645368742], [-8.602880214868618, 6.467564195171659], [-8.311347622094017, 6.193033148621081], [-7.993692592795879, 6.126189683451541], [-7.570152553731686, 5.707352199725903], [-7.53971513511176, 5.313345241716517], [-7.63536821128403, 5.188159084489455], [-7.712159389669749, 4.364565944837721]]] } }, - { "type": "Feature", "properties": { "admin": "Libya", "name": "Libya", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[14.8513, 22.862950000000119], [14.143870883855239, 22.491288967371126], [13.581424594790459, 23.040506089769274], [11.999505649471697, 23.471668402596432], [11.560669386449032, 24.09790924732561], [10.771363559622952, 24.562532050061741], [10.303846876678445, 24.379313259370967], [9.948261346078024, 24.936953640232613], [9.910692579801774, 25.365454616796789], [9.319410841518218, 26.094324856057476], [9.716285841519662, 26.512206325785652], [9.629056023811073, 27.140953477481041], [9.756128370816779, 27.688258571884198], [9.68388471847288, 28.144173895779311], [9.859997999723472, 28.959989732371064], [9.805634392952353, 29.424638373323369], [9.482139926805415, 30.307556057246181], [9.970017124072966, 30.539324856075375], [10.056575148161697, 30.961831366493517], [9.950225050505194, 31.376069647745275], [10.636901482799484, 31.761420803345679], [10.944789666394511, 32.081814683555358], [11.43225345220378, 32.368903103152824], [11.488787469131008, 33.136995754523234], [12.66331, 32.79278], [13.08326, 32.87882], [13.91868, 32.71196], [15.24563, 32.26508], [15.71394, 31.37626], [16.61162, 31.18218], [18.02109, 30.76357], [19.08641, 30.26639], [19.57404, 30.52582], [20.05335, 30.98576], [19.82033, 31.751790000000135], [20.13397, 32.2382], [20.85452, 32.7068], [21.54298, 32.8432], [22.89576, 32.63858], [23.2368, 32.19149], [23.6091300000001, 32.18726], [23.9275, 32.01667], [24.92114, 31.89936], [25.16482, 31.56915], [24.80287, 31.08929], [24.95762, 30.6616], [24.70007, 30.04419], [25.00000000000011, 29.238654529533552], [25.00000000000011, 25.682499996360995], [25.00000000000011, 22.0], [25.00000000000011, 20.00304], [23.850000000000129, 20.0], [23.837660000000135, 19.580470000000101], [19.84926, 21.49509], [15.86085, 23.40972], [14.8513, 22.862950000000119]]] } }, - { "type": "Feature", "properties": { "admin": "Sri Lanka", "name": "Sri Lanka", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[81.787959018891371, 7.523055324733162], [81.637322218760573, 6.481775214051921], [81.218019647144317, 6.197141424988287], [80.348356968104397, 5.968369859232154], [79.872468703128519, 6.763463446474928], [79.6951668639351, 8.200843410673384], [80.147800734379629, 9.824077663609554], [80.838817986986541, 9.268426825391186], [81.304319289071756, 8.564206244333688], [81.787959018891371, 7.523055324733162]]] } }, - { "type": "Feature", "properties": { "admin": "Lesotho", "name": "Lesotho", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[28.978262566857236, -28.955596612261708], [29.325166456832587, -29.257386976846245], [29.018415154748016, -29.743765557577362], [28.848399692507734, -30.070050551068245], [28.291069370239903, -30.226216729454293], [28.107204624145421, -30.545732110314944], [27.749397006956478, -30.645105889612214], [26.999261915807629, -29.875953871379977], [27.532511020627471, -29.242710870075353], [28.07433841320778, -28.851468601193581], [28.541700066855491, -28.647501722937562], [28.978262566857236, -28.955596612261708]]] } }, - { "type": "Feature", "properties": { "admin": "Lithuania", "name": "Lithuania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.731098667092649, 54.327536932993311], [22.651051873472536, 54.582740993866729], [22.757763706155256, 54.856574408581366], [22.31572350433057, 55.01529857036585], [21.26844892750346, 55.190481675835301], [21.05580040862241, 56.031076361711051], [22.201156853939491, 56.337801825579483], [23.878263787539957, 56.273671373105259], [24.860684441840753, 56.372528388079616], [25.000934279080887, 56.164530748104831], [25.533046502390327, 56.100296942766029], [26.494331495883749, 55.61510691997762], [26.588279249790386, 55.167175604871659], [25.768432651479792, 54.846962592175082], [25.536353794056989, 54.282423407602515], [24.45068362803703, 53.905702216194747], [23.484127638449841, 53.912497667041123], [23.243987257589506, 54.220566718149129], [22.731098667092649, 54.327536932993311]]] } }, - { "type": "Feature", "properties": { "admin": "Luxembourg", "name": "Luxembourg", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[6.043073357781109, 50.128051662794221], [6.242751092156992, 49.90222565367872], [6.186320428094176, 49.4638028021145], [5.897759230176403, 49.442667141307012], [5.674051954784828, 49.52948354755749], [5.782417433300905, 50.090327867221205], [6.043073357781109, 50.128051662794221]]] } }, - { "type": "Feature", "properties": { "admin": "Latvia", "name": "Latvia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[21.05580040862241, 56.031076361711051], [21.090423618257965, 56.783872789122924], [21.581866489353668, 57.411870632549913], [22.524341261492872, 57.753374335350756], [23.31845299652209, 57.006236477274854], [24.120729607853423, 57.025692654032753], [24.312862583114615, 57.793423570376966], [25.164593540149262, 57.970156968815175], [25.602809685984365, 57.847528794986559], [26.46353234223778, 57.476388658266316], [27.288184848751509, 57.474528306703817], [27.770015903440925, 57.244258124411218], [27.855282016722519, 56.759326483784278], [28.17670942557799, 56.169129950578807], [27.102459751094525, 55.783313707087672], [26.494331495883749, 55.61510691997762], [25.533046502390327, 56.100296942766029], [25.000934279080887, 56.164530748104831], [24.860684441840753, 56.372528388079616], [23.878263787539957, 56.273671373105259], [22.201156853939491, 56.337801825579483], [21.05580040862241, 56.031076361711051]]] } }, - { "type": "Feature", "properties": { "admin": "Morocco", "name": "Morocco", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-5.193863491222031, 35.755182196590845], [-4.591006232105143, 35.330711981745644], [-3.640056525070007, 35.39985504815197], [-2.604305792644111, 35.17909332940112], [-2.169913702798624, 35.168396307916694], [-1.792985805661658, 34.527918606091298], [-1.73345455566141, 33.919712836232115], [-1.388049282222596, 32.864015000941372], [-1.124551153966195, 32.651521511357195], [-1.30789913573787, 32.262888902306024], [-2.616604783529567, 32.094346218386157], [-3.068980271812648, 31.724497992473285], [-3.647497931320145, 31.637294012980814], [-3.690441046554666, 30.896951605751152], [-4.859646165374442, 30.501187649043874], [-5.242129278982786, 30.00044302013557], [-6.060632290053745, 29.731699734001801], [-7.059227667661899, 29.57922842052465], [-8.67411617678283, 28.841288967396643], [-8.665589565454836, 27.656425889592462], [-8.817809007940523, 27.656425889592462], [-8.817828334986642, 27.656425889592462], [-8.794883999049032, 27.120696316022553], [-9.413037482124507, 27.088476060488539], [-9.735343390328749, 26.860944729107409], [-10.189424200877452, 26.860944729107409], [-10.551262579785258, 26.990807603456879], [-11.392554897496948, 26.883423977154386], [-11.718219773800339, 26.104091701760801], [-12.030758836301654, 26.030866197203121], [-12.500962693725368, 24.770116278578136], [-13.891110398809044, 23.691009019459383], [-14.22116777185715, 22.310163072188338], [-14.630832688850942, 21.860939846274867], [-14.750954555713404, 21.500600083903802], [-17.002961798561071, 21.42073415779668], [-17.020428432675768, 21.422310288981631], [-16.973247849993182, 21.88574453377495], [-16.589136928767626, 22.158234361250091], [-16.26192175949566, 22.679339504481273], [-16.326413946995896, 23.017768459560894], [-15.982610642958059, 23.723358466074096], [-15.426003790742183, 24.359133612561035], [-15.089331834360729, 24.520260728446964], [-14.824645148161689, 25.103532619725307], [-14.800925665739666, 25.636264960222285], [-14.439939947964827, 26.254418443297645], [-13.773804897506462, 26.618892320252279], [-13.13994177901429, 27.640147813420491], [-13.121613369914709, 27.654147671719805], [-12.61883663578311, 28.038185533148656], [-11.688919236690761, 28.148643907172577], [-10.9009569971044, 28.832142238880913], [-10.39959225100864, 29.09858592377778], [-9.564811163765624, 29.933573716749855], [-9.814718390329174, 31.177735500609053], [-9.434793260119362, 32.038096421836478], [-9.300692918321827, 32.564679266890629], [-8.657476365585039, 33.24024526624239], [-7.654178432638217, 33.697064927702506], [-6.912544114601358, 34.11047638603744], [-6.24434200685141, 35.145865383437517], [-5.929994269219832, 35.759988104793983], [-5.193863491222031, 35.755182196590845]]] } }, - { "type": "Feature", "properties": { "admin": "Moldova", "name": "Moldova", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[26.619336785597788, 48.220726223333457], [26.857823520624798, 48.368210761094488], [27.52253746919515, 48.467119452501102], [28.259546746541837, 48.155562242213406], [28.670891147585163, 48.118148505234089], [29.122698195113024, 47.849095160506458], [29.050867954227321, 47.510226955752493], [29.415135125452732, 47.346645209332571], [29.559674106573105, 46.928582872091312], [29.908851759569295, 46.67436066343145], [29.838210076626289, 46.525325832701675], [30.024658644335364, 46.423936672545032], [29.759971958136383, 46.349987697935354], [29.170653924279879, 46.379262396828693], [29.072106967899288, 46.517677720722482], [28.862972446414055, 46.437889309263824], [28.933717482221621, 46.258830471372491], [28.659987420371575, 45.939986884131628], [28.48526940279276, 45.596907050145887], [28.233553501099035, 45.488283189468369], [28.054442986775392, 45.944586086605618], [28.160017937947707, 46.371562608417207], [28.128030226359037, 46.81047638608824], [27.551166212684841, 47.405117092470817], [27.233872918412736, 47.826770941756365], [26.924176059687561, 48.123264472030982], [26.619336785597788, 48.220726223333457]]] } }, - { "type": "Feature", "properties": { "admin": "Madagascar", "name": "Madagascar", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[49.543518914595737, -12.469832858940553], [49.80898074727908, -12.895284925999551], [50.05651085795715, -13.555761407121981], [50.217431268114055, -14.758788750876795], [50.476536899625515, -15.226512139550541], [50.377111443895942, -15.706069431219122], [50.200274692593169, -16.000263360256763], [49.860605503138665, -15.414252618066913], [49.672606642460849, -15.710203545802477], [49.863344354050142, -16.451036879138773], [49.774564243372694, -16.875042006093597], [49.49861209493411, -17.10603565843827], [49.435618523970298, -17.953064060134363], [49.04179243347393, -19.118781019774442], [48.548540887247995, -20.496888116134119], [47.930749139198653, -22.391501153251077], [47.547723423051295, -23.781958916928513], [47.095761346226588, -24.941629733990446], [46.282477654817079, -25.178462823184102], [45.409507684110444, -25.601434421493082], [44.833573846217547, -25.346101169538933], [44.039720493349755, -24.9883452287823], [43.763768344911156, -24.460677178649988], [43.697777540874441, -23.574116306250595], [43.345654331237611, -22.77690398528387], [43.254187046080986, -22.057413018484116], [43.433297560404633, -21.336475111580185], [43.893682895692919, -21.163307386970121], [43.89637007017209, -20.830459486578167], [44.374325392439644, -20.072366224856385], [44.464397413924374, -19.435454196859045], [44.23242190936616, -18.961994724200899], [44.042976108584149, -18.331387220943167], [43.963084344260899, -17.409944756746778], [44.312468702986273, -16.850495700754951], [44.446517368351387, -16.216219170804504], [44.944936557806521, -16.179373874580396], [45.502731967964976, -15.974373467678538], [45.872993605336255, -15.793454278224681], [46.312243279817203, -15.780018405828795], [46.882182651564271, -15.210182386946309], [47.70512983581235, -14.594302666891762], [48.005214878131241, -14.091232598530372], [47.869047479042152, -13.663868503476582], [48.29382775248137, -13.784067884987483], [48.845060255738773, -13.08917489995866], [48.863508742066976, -12.487867933810417], [49.194651320193302, -12.040556735891967], [49.543518914595737, -12.469832858940553]]] } }, - { "type": "Feature", "properties": { "admin": "Mexico", "name": "Mexico", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-97.140008307670684, 25.869997463478395], [-97.528072475966539, 24.992144069920297], [-97.702945522842214, 24.272343044526728], [-97.776041836319024, 22.932579860927653], [-97.872366706111094, 22.444211737553356], [-97.699043952204164, 21.898689480064256], [-97.388959520236739, 21.411018988525818], [-97.189333462293277, 20.635433254473124], [-96.525575527720306, 19.890930894444061], [-96.292127244841737, 19.32037140550954], [-95.90088497595994, 18.828024196848727], [-94.8390634834427, 18.562717393462204], [-94.425729539756205, 18.144370835843343], [-93.548651292682365, 18.423836981677933], [-92.786113857783477, 18.524838568592255], [-92.037348192090391, 18.704569200103432], [-91.407903408559235, 18.876083278880227], [-90.771869879910852, 19.284120388256778], [-90.533589850613026, 19.867418117751292], [-90.451475999701231, 20.707521877520428], [-90.278618333684889, 20.999855454995547], [-89.601321173851474, 21.261725775634485], [-88.543866339862845, 21.493675441976613], [-87.658416510757704, 21.458845526611977], [-87.051890224948053, 21.543543199138295], [-86.811982388032931, 21.331514797444747], [-86.845907965832595, 20.849864610268348], [-87.383291185235848, 20.255404771398727], [-87.621054450210721, 19.646553046135917], [-87.436750454441764, 19.472403469312265], [-87.586560431655911, 19.040130113190738], [-87.837191128271485, 18.259815985583426], [-88.090664028663156, 18.516647854074048], [-88.300031094093626, 18.499982204659997], [-88.490122850279278, 18.486830552641717], [-88.84834387892657, 17.883198147040329], [-89.029857347351737, 18.001511338772556], [-89.150909389995462, 17.955467637600403], [-89.143080410503316, 17.808318996649401], [-90.067933519230891, 17.819326076727517], [-91.001519945015943, 17.817594916245692], [-91.002269253284155, 17.254657701074272], [-91.453921271515114, 17.252177232324183], [-91.08167009150057, 16.918476670799517], [-90.711821865587623, 16.687483018454767], [-90.600846727240921, 16.470777899638787], [-90.438866950221993, 16.410109768128105], [-90.464472622422633, 16.069562079324722], [-91.747960171255926, 16.066564846251762], [-92.229248623406278, 15.251446641495871], [-92.087215949252013, 15.06458466232851], [-92.203229539747255, 14.830102850804108], [-92.227750006869812, 14.538828640190953], [-93.359463874061746, 15.61542959234367], [-93.875168830118511, 15.94016429286591], [-94.691656460330108, 16.20097524664288], [-95.250227016973014, 16.128318182840641], [-96.053382127653293, 15.752087917539592], [-96.557434048228274, 15.653515122942787], [-97.263592495496624, 15.917064927631312], [-98.013029954809596, 16.107311713113912], [-98.947675747456486, 16.566043402568763], [-99.697397427147024, 16.706164048728166], [-100.829498867581293, 17.171071071842047], [-101.666088629954444, 17.649026394109622], [-101.918528001700196, 17.916090196193974], [-102.478132086988907, 17.975750637275095], [-103.500989549558057, 18.292294623278845], [-103.917527432046811, 18.748571682200005], [-104.992009650475467, 19.316133938061679], [-105.493038499761411, 19.946767279535429], [-105.731396043707633, 20.434101874264108], [-105.397772996831321, 20.531718654863422], [-105.500660773524402, 20.816895046466122], [-105.27075232625792, 21.076284898355137], [-105.265817226974022, 21.422103583252348], [-105.603160976975374, 21.871145941652568], [-105.693413865973113, 22.269080308516148], [-106.028716396898943, 22.77375234627862], [-106.909980434988341, 23.767774359628895], [-107.91544877809136, 24.548915310152946], [-108.401904873470954, 25.172313951105931], [-109.260198737406625, 25.580609442644054], [-109.444089321717314, 25.824883938087673], [-109.291643846456267, 26.44293406829842], [-109.801457689231796, 26.676175645447923], [-110.391731737085692, 27.162114976504533], [-110.641018846461606, 27.859876003525521], [-111.178918830187826, 27.941240546169062], [-111.759606899851619, 28.467952582303944], [-112.228234626090369, 28.954408677683482], [-112.27182369672866, 29.266844387320074], [-112.80959448937395, 30.021113593052341], [-113.163810594518651, 30.786880804969424], [-113.148669399857141, 31.170965887978912], [-113.871881069781836, 31.56760834403519], [-114.205736660603506, 31.524045111613123], [-114.776451178835003, 31.79953217216114], [-114.936699795372121, 31.393484605427595], [-114.771231859173483, 30.91361725516526], [-114.673899298951739, 30.162681179315985], [-114.330974494262918, 29.750432440707407], [-113.588875088335413, 29.061611436473008], [-113.424053107540516, 28.826173610951223], [-113.271969367305502, 28.754782619739892], [-113.140039435664363, 28.411289374295954], [-112.962298346796473, 28.425190334582503], [-112.761587083774856, 27.78021678314752], [-112.457910529411635, 27.525813706974752], [-112.24495195193677, 27.171726792910754], [-111.616489020619184, 26.662817287700474], [-111.284674648872993, 25.732589830014426], [-110.987819383572386, 25.294606228124557], [-110.71000688357131, 24.826004340101854], [-110.655048997828871, 24.298594672131113], [-110.17285620811343, 24.265547593680417], [-109.771847093528521, 23.811182562754194], [-109.409104377055698, 23.364672349536242], [-109.433392300232896, 23.185587673428696], [-109.85421932660168, 22.818271592698061], [-110.031391974714424, 22.823077500901199], [-110.295070970483636, 23.430973212166684], [-110.949501309028022, 24.000964260345988], [-111.670568407012681, 24.484423122652508], [-112.182035895621468, 24.73841278736716], [-112.148988817170817, 25.470125230404044], [-112.300710822379671, 26.012004299416613], [-112.777296719191526, 26.321959540303162], [-113.464670783321907, 26.768185533143416], [-113.596729906043805, 26.639459540304465], [-113.848936733844241, 26.900063788352437], [-114.465746629680027, 27.142090358991361], [-115.055142178184965, 27.722726752222904], [-114.982252570437382, 27.798200181585109], [-114.570365566854917, 27.741485297144884], [-114.199328782999231, 28.115002549750553], [-114.162018398884612, 28.566111965442296], [-114.931842210736605, 29.279479275015483], [-115.518653937626965, 29.556361599235395], [-115.887365282029563, 30.180793768834171], [-116.2583503894529, 30.836464341753572], [-116.721526252084956, 31.635743720012037], [-117.127759999999839, 32.53534], [-115.99135, 32.612390000000111], [-114.72139, 32.72083], [-114.815, 32.52528], [-113.30498, 32.03914], [-111.02361, 31.33472], [-109.035, 31.341940000000129], [-108.24194, 31.34222], [-108.24, 31.754853718166366], [-106.507589999999851, 31.75452], [-106.1429, 31.39995], [-105.63159, 31.08383], [-105.03737, 30.64402], [-104.70575, 30.12173], [-104.456969999999885, 29.57196], [-103.94, 29.27], [-103.11, 28.97], [-102.48, 29.76], [-101.6624, 29.7793], [-100.9576, 29.380710000000125], [-100.45584, 28.696120000000118], [-100.11, 28.11000000000012], [-99.52, 27.54], [-99.3, 26.84], [-99.019999999999897, 26.37], [-98.24, 26.06], [-97.529999999999887, 25.84], [-97.140008307670684, 25.869997463478395]]] } }, - { "type": "Feature", "properties": { "admin": "Macedonia", "name": "Macedonia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.59023, 41.85541], [20.717310000000108, 41.84711], [20.76216, 42.05186], [21.352700000000134, 42.2068], [21.576635989402117, 42.245224397061847], [21.917080000000105, 42.30364], [22.380525750424674, 42.320259507815074], [22.881373732197339, 41.999297186850349], [22.952377150166505, 41.337993882811176], [22.76177, 41.3048], [22.597308383889008, 41.130487168943198], [22.055377638444266, 41.149865831052686], [21.674160597426969, 40.93127452245794], [21.020040317476397, 40.842726955725873], [20.60518, 41.08622], [20.46315, 41.51509], [20.59023, 41.85541]]] } }, - { "type": "Feature", "properties": { "admin": "Mali", "name": "Mali", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-12.170750291380299, 14.616834214735503], [-11.834207526079465, 14.799096991428936], [-11.666078253617853, 15.388208319556295], [-11.349095017939502, 15.411256008358475], [-10.650791388379414, 15.132745876521422], [-10.086846482778212, 15.330485744686269], [-9.700255092802703, 15.264107367407359], [-9.550238409859388, 15.486496893775435], [-5.537744309908446, 15.501689764869253], [-5.315277268891931, 16.201853745991837], [-5.488522508150438, 16.325102037007962], [-5.971128709324247, 20.640833441647626], [-6.453786586930334, 24.956590684503418], [-4.92333736817423, 24.974574082940993], [-1.550054897457613, 22.792665920497377], [1.823227573259032, 20.61080943448604], [2.060990838233919, 20.142233384679482], [2.683588494486428, 19.856230170160114], [3.146661004253899, 19.693578599521441], [3.158133172222704, 19.057364203360034], [4.267419467800038, 19.155265204336995], [4.270209995143801, 16.852227484601212], [3.723421665063482, 16.184283759012612], [3.638258904646476, 15.568119818580453], [2.749992709981483, 15.409524847876693], [1.385528191746857, 15.323561102759168], [1.01578331869851, 14.968182277887944], [0.374892205414682, 14.928908189346128], [-0.26625729003058, 14.924308986872147], [-0.515854458000348, 15.116157741755725], [-1.066363491205663, 14.973815009007764], [-2.001035122068771, 14.559008287000887], [-2.191824510090384, 14.246417548067352], [-2.967694464520576, 13.798150336151506], [-3.103706834312759, 13.54126679122859], [-3.52280270019986, 13.337661647998612], [-4.006390753587225, 13.472485459848112], [-4.280405035814879, 13.228443508349738], [-4.427166103523802, 12.542645575404292], [-5.220941941743119, 11.713858954307224], [-5.197842576508648, 11.375145778850136], [-5.470564947929004, 10.951269842976044], [-5.404341599946973, 10.370736802609144], [-5.816926235365286, 10.222554633012191], [-6.050452032892266, 10.096360785355442], [-6.205222947606429, 10.524060777219132], [-6.493965013037267, 10.411302801958268], [-6.666460944027547, 10.430810655148447], [-6.850506557635057, 10.138993841996237], [-7.622759161804808, 10.147236232946792], [-7.89958980959237, 10.297382106970824], [-8.029943610048617, 10.206534939001711], [-8.335377163109738, 10.494811916541932], [-8.282357143578279, 10.792597357623842], [-8.407310756860026, 10.90925690352276], [-8.620321010767126, 10.810890814655181], [-8.581305304386772, 11.136245632364801], [-8.376304897484911, 11.393645941610627], [-8.786099005559462, 11.812560939984705], [-8.905264858424529, 12.088358059126433], [-9.127473517279581, 12.308060411015331], [-9.327616339546008, 12.334286200403451], [-9.567911749703212, 12.194243068892472], [-9.890992804392011, 12.060478623904968], [-10.165213792348835, 11.844083563682743], [-10.593223842806278, 11.923975328005977], [-10.870829637078211, 12.177887478072106], [-11.036555955438256, 12.211244615116513], [-11.297573614944508, 12.077971096235768], [-11.456168585648269, 12.076834214725336], [-11.513942836950587, 12.442987575729415], [-11.467899135778522, 12.754518947800973], [-11.553397793005427, 13.141213690641063], [-11.927716030311613, 13.422075100147392], [-12.124887457721256, 13.994727484589784], [-12.170750291380299, 14.616834214735503]]] } }, - { "type": "Feature", "properties": { "admin": "Myanmar", "name": "Myanmar", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[99.543309360759281, 20.186597601802056], [98.959675734454848, 19.752980658440944], [98.253723992915582, 19.708203029860041], [97.797782830804394, 18.627080389881751], [97.375896437573516, 18.445437730375811], [97.859122755934848, 17.567946071843657], [98.493761020911322, 16.837835598207928], [98.90334842325673, 16.177824204976115], [98.537375929765687, 15.308497422746081], [98.192074009191373, 15.123702500870349], [98.430819126379859, 14.622027696180831], [99.097755161538728, 13.827502549693275], [99.212011753336071, 13.269293728076462], [99.196353794351637, 12.804748439988666], [99.587286004639694, 11.892762762901695], [99.038120558673953, 10.960545762572435], [98.553550653073017, 9.932959906448543], [98.457174106848697, 10.675266018105146], [98.764545526120756, 11.441291612183745], [98.428338657629823, 12.032986761925681], [98.509574009192661, 13.122377631070675], [98.103603957107666, 13.64045970301285], [97.777732375075161, 14.837285874892638], [97.597071567782749, 16.100567938699765], [97.164539829499773, 16.928734442609336], [96.505768670642965, 16.427240505432845], [95.369352248112378, 15.714389960182599], [94.808404575584092, 15.803454291237637], [94.188804152404515, 16.037936102762014], [94.533485955791321, 17.277240301985724], [94.324816522196741, 18.213513902249893], [93.540988397193615, 19.366492621330021], [93.663254835996199, 19.726961574781992], [93.078277622452163, 19.855144965081973], [92.368553501355606, 20.670883287025344], [92.30323449093865, 21.475485337809815], [92.652257114637976, 21.324047552978481], [92.672720981825549, 22.041238918541247], [93.166127557348361, 22.278459580977099], [93.060294224014598, 22.703110663335565], [93.286326938859247, 23.043658352138998], [93.325187615942767, 24.078556423432197], [94.106741977925054, 23.850740871673477], [94.552657912171611, 24.675238348890328], [94.603249139385355, 25.162495428970399], [95.155153436262566, 26.001307277932078], [95.124767694074933, 26.573572089132295], [96.419365675850941, 27.264589341739221], [97.133999058015277, 27.08377350514996], [97.051988559968066, 27.699058946233144], [97.402561476636123, 27.88253611908544], [97.327113885490007, 28.261582749946331], [97.91198774616943, 28.335945136014338], [98.24623091023328, 27.747221381129172], [98.682690057370451, 27.508812160750612], [98.712093947344499, 26.74353587494026], [98.671838006589127, 25.918702500913518], [97.724609002679117, 25.083637193292994], [97.604719679761956, 23.897404690033039], [98.660262485755737, 24.063286037689959], [98.898749220782747, 23.142722072842524], [99.531992222087382, 22.949038804612574], [99.240898878987224, 22.118314317304577], [99.983489211021464, 21.742936713136398], [100.416537713627349, 21.558839423096607], [101.150032993578222, 21.849984442629015], [101.180005324307515, 21.436572984294024], [100.329101190189519, 20.786121731036229], [100.115987583417819, 20.41784963630818], [99.543309360759281, 20.186597601802056]]] } }, - { "type": "Feature", "properties": { "admin": "Montenegro", "name": "Montenegro", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[19.801613396898681, 42.500093492190835], [19.738051385179627, 42.688247382165564], [19.30449, 42.19574], [19.371770000000136, 41.87755], [19.16246, 41.95502], [18.88214, 42.28151], [18.45, 42.48], [18.56, 42.65], [18.70648, 43.20011], [19.03165, 43.43253], [19.21852, 43.52384], [19.48389, 43.35229], [19.63, 43.213779970270522], [19.95857, 43.10604], [20.3398, 42.89852], [20.25758, 42.81275], [20.0707, 42.58863], [19.801613396898681, 42.500093492190835]]] } }, - { "type": "Feature", "properties": { "admin": "Mongolia", "name": "Mongolia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[87.751264276076697, 49.297197984405479], [88.805566847695488, 49.470520738312409], [90.713667433640666, 50.331811835321076], [92.234711541719662, 50.802170722041716], [93.104219191462661, 50.495290228876414], [94.147566359435615, 50.480536607457083], [94.815949334698701, 50.013433335970838], [95.814027947983973, 49.977466539095708], [97.259727817781396, 49.726060695995727], [98.231761509191543, 50.422400621128737], [97.825739780674283, 51.010995184933165], [98.861490513100307, 52.047366034546684], [99.981732212323507, 51.634006252643978], [100.889480421962588, 51.516855780638316], [102.065222609467298, 51.25992055928311], [102.255908644624299, 50.510560614618669], [103.676545444760194, 50.089966132195109], [104.621552362081687, 50.275329494826067], [105.886591424586726, 50.406019192092209], [106.888804152455336, 50.274295966180219], [107.868175897250936, 49.793705145865808], [108.475167270951275, 49.282547715850725], [109.402449171996636, 49.292960516957535], [110.662010532678764, 49.130128078805861], [111.581230910286607, 49.377968248077678], [112.897739699354361, 49.543565375356984], [114.362456496235239, 50.248302720737399], [114.962109816550154, 50.140247300815112], [115.485695428531386, 49.805177313834591], [116.678800897286152, 49.888531399121376], [116.191802199367544, 49.134598090199091], [115.485282017073018, 48.135382595403428], [115.742837355615748, 47.726544501326273], [116.308952671373206, 47.853410142602826], [117.295507440257396, 47.69770905210742], [118.064142694166691, 48.066730455103674], [118.866574334794933, 47.747060044946153], [119.772823927897477, 47.048058783550125], [119.66326989143873, 46.692679958678909], [118.874325799638711, 46.805412095723646], [117.421701287914175, 46.672732855814253], [116.717868280098841, 46.388202419615205], [115.985096470200062, 45.727235012385989], [114.46033165899604, 45.339816799493811], [113.463906691544139, 44.808893134127111], [112.436062453258785, 45.011645616224278], [111.873306105600278, 45.102079372735055], [111.348376906379428, 44.457441718110083], [111.667737257943202, 44.073175767587706], [111.829587843881342, 43.743118394539515], [111.129682244920218, 43.406834011400136], [110.412103306115256, 42.871233628911014], [109.243595819131428, 42.519446316084093], [107.744772576937933, 42.481515814781865], [106.129315627061658, 42.134327704428898], [104.964993931093446, 41.597409572916334], [104.522281935648977, 41.908346666016541], [103.312278273534787, 41.907468166667591], [101.833040399179922, 42.51487295182627], [100.845865513108237, 42.663804429691439], [99.515817498780009, 42.524691473961717], [97.451757440177985, 42.748889675460013], [96.349395786527793, 42.725635280928678], [95.762454868556674, 43.319449164394598], [95.306875441471504, 44.241330878265458], [94.688928664125299, 44.352331854828414], [93.480733677141274, 44.975472113619951], [92.133890822318193, 45.115075995456444], [90.945539585334288, 45.286073309910265], [90.585768263718265, 45.719716091487513], [90.970809360724985, 46.888146063822923], [90.280825636763893, 47.693549099307923], [88.854297723346733, 48.06908173277295], [88.013832228551721, 48.599462795600601], [87.751264276076697, 49.297197984405479]]] } }, - { "type": "Feature", "properties": { "admin": "Mozambique", "name": "Mozambique", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.559989047999345, -11.520020033415923], [35.312397902169032, -11.439146416879145], [36.514081658684248, -11.720938002166733], [36.775150994622791, -11.594537448780804], [37.471284214026596, -11.568750909067157], [37.827644891111383, -11.268769219612834], [38.427556593587745, -11.285202325081654], [39.521029900883768, -10.896853936408224], [40.316588576017182, -10.317096042525696], [40.478387485523022, -10.765440769089992], [40.437253045418672, -11.761710707245014], [40.560811395028558, -12.639176527561023], [40.599620395679743, -14.201975192931858], [40.775475294768988, -14.691764418194239], [40.477250604012596, -15.406294447493968], [40.089263950365208, -16.100774021064456], [39.452558628097044, -16.720891208566936], [38.53835086442151, -17.101023044505954], [37.411132846838875, -17.586368096591233], [36.281279331209348, -18.659687595293445], [35.896496616364054, -18.842260430580634], [35.198399692533137, -19.552811374593887], [34.786383497870041, -19.784011732667732], [34.701892531072836, -20.497043145431007], [35.176127150215358, -21.254361260668407], [35.373427768705731, -21.840837090748874], [35.385848253705397, -22.14], [35.562545536369079, -22.09], [35.533934767404297, -23.070787855727751], [35.371774122872374, -23.535358982031692], [35.607470330555621, -23.706563002214676], [35.458745558419615, -24.122609958596545], [35.040734897610655, -24.478350518493798], [34.215824008935463, -24.816314385682652], [33.013210076639005, -25.357573337507731], [32.574632195777859, -25.727318210556088], [32.660363396950082, -26.148584486599443], [32.915955031065685, -26.215867201443459], [32.830120477028878, -26.74219166433619], [32.071665480281062, -26.733820082304902], [31.985779249811962, -26.29177988048022], [31.837777947728057, -25.843331801051342], [31.752408481581874, -25.484283949487406], [31.930588820124242, -24.369416599222532], [31.670397983534645, -23.658969008073861], [31.191409132621278, -22.251509698172395], [32.244988234188007, -21.116488539313689], [32.508693068173436, -20.395292250248303], [32.659743279762573, -20.30429005298231], [32.772707960752619, -19.715592136313294], [32.611994256324884, -19.419382826416268], [32.654885695127142, -18.672089939043492], [32.849860874164385, -17.979057305577175], [32.847638787575839, -16.713398125884613], [32.328238966610222, -16.392074069893749], [31.852040643040592, -16.319417006091374], [31.636498243951188, -16.071990248277881], [31.173063999157673, -15.860943698797868], [30.338954705534537, -15.880839125230242], [30.274255812305103, -15.507786960515208], [30.179481235481827, -14.796099134991525], [33.214024692525207, -13.97186003993615], [33.789700148256678, -14.451830743063068], [34.064825473778619, -14.359950046448118], [34.459633416488536, -14.613009535381421], [34.517666049952304, -15.013708591372609], [34.307291294092089, -15.478641452702592], [34.381291945134045, -16.183559665596039], [35.033810255683527, -16.801299737213089], [35.339062941231639, -16.107440280830108], [35.771904738108347, -15.896858819240721], [35.686845330555926, -14.611045830954328], [35.267956170398001, -13.887834161029563], [34.907151320136158, -13.565424899960565], [34.559989047999345, -13.579997653866872], [34.280006137841973, -12.280025323132504], [34.559989047999345, -11.520020033415923]]] } }, - { "type": "Feature", "properties": { "admin": "Mauritania", "name": "Mauritania", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-12.170750291380299, 14.616834214735503], [-12.830658331747513, 15.303691514542942], [-13.43573767745306, 16.039383042866188], [-14.099521450242175, 16.304302273010489], [-14.577347581428977, 16.598263658102805], [-15.135737270558813, 16.587282416240779], [-15.623666144258689, 16.369337063049809], [-16.120690070041928, 16.45566254319338], [-16.463098110407881, 16.135036119038457], [-16.549707810929061, 16.673892116761959], [-16.270551723688353, 17.166962795474866], [-16.146347418674846, 18.108481553616652], [-16.256883307347163, 19.096715806550304], [-16.377651129613266, 19.593817246981981], [-16.277838100641514, 20.092520656814695], [-16.536323614965465, 20.567866319251486], [-17.063423224342568, 20.99975210213082], [-16.845193650773989, 21.333323472574875], [-12.929101935263528, 21.327070624267559], [-13.118754441774708, 22.771220201096249], [-12.874221564169574, 23.284832261645171], [-11.93722449385332, 23.374594224536164], [-11.969418911171159, 25.933352769468261], [-8.687293667017398, 25.881056219988899], [-8.684399786809051, 27.395744126895998], [-4.92333736817423, 24.974574082940993], [-6.453786586930334, 24.956590684503418], [-5.971128709324247, 20.640833441647626], [-5.488522508150438, 16.325102037007962], [-5.315277268891931, 16.201853745991837], [-5.537744309908446, 15.501689764869253], [-9.550238409859388, 15.486496893775435], [-9.700255092802703, 15.264107367407359], [-10.086846482778212, 15.330485744686269], [-10.650791388379414, 15.132745876521422], [-11.349095017939502, 15.411256008358475], [-11.666078253617853, 15.388208319556295], [-11.834207526079465, 14.799096991428936], [-12.170750291380299, 14.616834214735503]]] } }, - { "type": "Feature", "properties": { "admin": "Malawi", "name": "Malawi", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.559989047999345, -11.520020033415923], [34.280006137841973, -12.280025323132504], [34.559989047999345, -13.579997653866872], [34.907151320136158, -13.565424899960565], [35.267956170398001, -13.887834161029563], [35.686845330555926, -14.611045830954328], [35.771904738108347, -15.896858819240721], [35.339062941231639, -16.107440280830108], [35.033810255683527, -16.801299737213089], [34.381291945134045, -16.183559665596039], [34.307291294092089, -15.478641452702592], [34.517666049952304, -15.013708591372609], [34.459633416488536, -14.613009535381421], [34.064825473778619, -14.359950046448118], [33.789700148256678, -14.451830743063068], [33.214024692525207, -13.97186003993615], [32.688165317523122, -13.712857761289273], [32.991764357237876, -12.783870537978272], [33.306422153463068, -12.435778090060214], [33.114289178201908, -11.607198174692311], [33.315310499817279, -10.796549981329695], [33.485687697083584, -10.525558770391111], [33.231387973775291, -9.676721693564799], [32.759375441221316, -9.230599053589058], [33.739729038230443, -9.417150974162722], [33.940837724096532, -9.693673841980292], [34.280006137841973, -10.159999688358402], [34.559989047999345, -11.520020033415923]]] } }, - { "type": "Feature", "properties": { "admin": "Malaysia", "name": "Malaysia", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[101.075515578213299, 6.204867051615891], [101.154218784593809, 5.691384182147713], [101.814281854258013, 5.810808417174228], [102.141186964936423, 6.221636053894655], [102.371147088635212, 6.12820506431096], [102.961705356866673, 5.524495144061077], [103.381214634212142, 4.855001125503746], [103.438575474056165, 4.181605536308381], [103.332122023534851, 3.72669790284297], [103.42942874554052, 3.382868760589019], [103.502447544368877, 2.791018581550204], [103.854674106870334, 2.515454006353763], [104.247931756611479, 1.631141058759055], [104.228811476663523, 1.293048000489534], [103.519707472754433, 1.226333726400682], [102.573615350354771, 1.967115383304744], [101.39063846232915, 2.760813706875623], [101.273539666755838, 3.27029165284118], [100.69543541870668, 3.939139715994869], [100.557407668055092, 4.767280381688279], [100.19670617065772, 5.312492580583678], [100.306260207116509, 6.040561835143875], [100.085756870527078, 6.46448944745029], [100.259596388756918, 6.64282481528957], [101.075515578213299, 6.204867051615891]]], [[[118.618320754064825, 4.47820241944754], [117.882034946770162, 4.137551377779487], [117.01521447150634, 4.306094061699468], [115.86551720587677, 4.306559149590156], [115.51907840379198, 3.169238389494395], [115.134037306785231, 2.821481838386219], [114.621355422017473, 1.430688177898886], [113.805849644019531, 1.217548732911041], [112.859809198052176, 1.497790025229946], [112.380251906383648, 1.410120957846757], [111.797548455860408, 0.904441229654651], [111.159137811326559, 0.976478176269509], [110.514060907027101, 0.773131415200993], [109.830226678508836, 1.338135687664191], [109.663260125773718, 2.006466986494984], [110.396135288537039, 1.663774725751395], [111.168852980597478, 1.850636704918784], [111.370081007942076, 2.697303371588872], [111.796928338672842, 2.885896511238073], [112.995614862115247, 3.102394924324869], [113.712935418758718, 3.893509426281127], [114.204016554828399, 4.525873928236819], [114.659595981913526, 4.00763682699781], [114.869557326315373, 4.348313706881952], [115.347460972150671, 4.316636053887009], [115.405700311343594, 4.955227565933824], [115.450710483869798, 5.447729803891561], [116.220741001450961, 6.143191229675621], [116.725102980619752, 6.924771429873998], [117.129626092600461, 6.928052883324566], [117.643393182446303, 6.422166449403305], [117.689075148592337, 5.98749013918018], [118.347691278152197, 5.708695786965462], [119.181903924639926, 5.407835598162249], [119.110693800941718, 5.016128241389864], [118.439727004064082, 4.966518866389619], [118.618320754064825, 4.47820241944754]]]] } }, - { "type": "Feature", "properties": { "admin": "Namibia", "name": "Namibia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[16.344976840895239, -28.576705010697697], [15.601818068105812, -27.821247247022797], [15.210472446359457, -27.09095590587404], [14.989710727608548, -26.117371921495153], [14.74321414557633, -25.392920017195376], [14.40814415859583, -23.85301401132984], [14.385716586981145, -22.656652927340687], [14.257714064194172, -22.111208184499951], [13.868642205468657, -21.699036960539974], [13.352497999737437, -20.872834161057497], [12.82684533046449, -19.673165785401661], [12.608564080463617, -19.045348809487695], [11.794918654028063, -18.069129327061912], [11.734198846085118, -17.30188933682447], [12.215461460019352, -17.11166838955808], [12.814081251688405, -16.941342868724067], [13.462362094789963, -16.971211846588769], [14.058501417709007, -17.42338062914266], [14.209706658595021, -17.353100681225715], [18.26330936043416, -17.309950860262003], [18.956186964603599, -17.789094740472255], [21.377176141045563, -17.930636488519688], [23.215048455506057, -17.52311614346598], [24.033861525170771, -17.29584319424632], [24.6823490740015, -17.35341073981947], [25.076950310982255, -17.578823337476617], [25.084443393664564, -17.661815687737366], [24.520705193792534, -17.887124932529932], [24.217364536239209, -17.889347019118485], [23.579005568137713, -18.281261081620055], [23.196858351339298, -17.869038181227783], [21.655040317478971, -18.219146010005222], [20.910641310314531, -18.252218926672018], [20.881134067475866, -21.814327080983144], [19.895457797940672, -21.849156996347865], [19.895767856534427, -24.767790215760588], [19.89473432788861, -28.461104831660769], [19.002127312911082, -28.972443129188857], [18.464899122804745, -29.045461928017271], [17.836151971109526, -28.856377862261311], [17.387497185951499, -28.783514092729774], [17.218928663815401, -28.355943291946804], [16.824017368240899, -28.082161553664466], [16.344976840895239, -28.576705010697697]]] } }, - { "type": "Feature", "properties": { "admin": "New Caledonia", "name": "New Caledonia", "continent": "Oceania" }, "geometry": { "type": "Polygon", "coordinates": [[[165.779989862326346, -21.080004978115621], [166.599991489933814, -21.700018812753523], [167.120011428086883, -22.159990736583488], [166.74003462144475, -22.399976088146943], [166.189732293968632, -22.129708347260447], [165.474375441752159, -21.679606621998229], [164.829815301775653, -21.149819838141948], [164.16799523341362, -20.444746595951624], [164.029605747735957, -20.105645847252347], [164.459967075862664, -20.120011895429492], [165.020036249041993, -20.459991143477726], [165.460009393575064, -20.800022067958253], [165.779989862326346, -21.080004978115621]]] } }, - { "type": "Feature", "properties": { "admin": "Niger", "name": "Niger", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[2.154473504249949, 11.940150051313422], [2.177107781593917, 12.625017808477534], [1.024103224297619, 12.851825669806598], [0.993045688490156, 13.335749620003865], [0.429927605805517, 13.988733018443893], [0.295646396495215, 14.444234930880663], [0.374892205414767, 14.928908189346144], [1.015783318698481, 14.968182277887989], [1.385528191746971, 15.323561102759237], [2.74999270998154, 15.409524847876751], [3.63825890464659, 15.56811981858044], [3.723421665063596, 16.184283759012654], [4.270209995143886, 16.852227484601311], [4.267419467800095, 19.155265204337123], [5.677565952180712, 19.601206976799794], [8.572893100629868, 21.565660712159225], [11.999505649471697, 23.471668402596432], [13.581424594790459, 23.040506089769274], [14.143870883855239, 22.491288967371126], [14.8513, 22.862950000000119], [15.096887648181847, 21.308518785074902], [15.471076694407314, 21.048457139565979], [15.487148064850143, 20.730414537025634], [15.90324669766431, 20.387618923417499], [15.68574059414777, 19.957180080642384], [15.300441114979716, 17.927949937405], [15.247731154041842, 16.627305813050778], [13.972201775781681, 15.684365953021139], [13.540393507550785, 14.36713369390122], [13.956698846094124, 13.996691189016925], [13.954476759505607, 13.353448798063765], [14.595781284247604, 13.330426947477859], [14.495787387762899, 12.859396267137353], [14.213530714584746, 12.80203542729333], [14.181336297266906, 12.483656927943169], [13.995352817448289, 12.4615652531383], [13.318701613018558, 13.55635630945795], [13.083987257548809, 13.596147162322492], [12.302071160540546, 13.037189032437535], [11.527803175511504, 13.328980007373556], [10.989593133191532, 13.387322699431191], [10.701031935273816, 13.246917832894038], [10.114814487354748, 13.277251898649464], [9.524928012743088, 12.85110219975456], [9.014933302454436, 12.826659247280414], [7.804671258178869, 13.343526923063731], [7.330746697630046, 13.098038031461213], [6.82044192874781, 13.115091254117598], [6.445426059605721, 13.492768459522718], [5.443058302440135, 13.865923977102225], [4.368343540066006, 13.747481594289408], [4.107945997747378, 13.531215725147941], [3.967282749048933, 12.956108710171574], [3.680633579125924, 12.552903347214167], [3.611180454125587, 11.660167141155965], [2.848643019226585, 12.235635891158207], [2.490163608418015, 12.233052069543588], [2.154473504249949, 11.940150051313422]]] } }, - { "type": "Feature", "properties": { "admin": "Nigeria", "name": "Nigeria", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[8.500287713259693, 4.771982937026847], [7.462108188515939, 4.41210826254624], [7.082596469764438, 4.464689032403228], [6.698072137080598, 4.240594183769516], [5.898172641634686, 4.262453314628984], [5.362804803090881, 4.887970689305957], [5.033574252959368, 5.611802476418233], [4.325607130560683, 6.270651149923466], [3.574180128604552, 6.258300482605717], [2.691701694356254, 6.258817246928628], [2.74906253420022, 7.870734361192886], [2.723792758809509, 8.506845404489708], [2.912308383810255, 9.13760793704432], [3.220351596702101, 9.4441525333997], [3.705438266625918, 10.063210354040207], [3.600070021182801, 10.332186184119406], [3.797112257511713, 10.734745591673104], [3.572216424177469, 11.327939357951516], [3.611180454125558, 11.660167141155966], [3.68063357912581, 12.552903347214222], [3.967282749048848, 12.956108710171572], [4.107945997747321, 13.531215725147829], [4.368343540066063, 13.747481594289324], [5.443058302440163, 13.865923977102295], [6.445426059605636, 13.492768459522676], [6.820441928747753, 13.115091254117514], [7.330746697630017, 13.098038031461199], [7.804671258178784, 13.343526923063745], [9.014933302454462, 12.826659247280427], [9.524928012742945, 12.851102199754477], [10.114814487354689, 13.277251898649409], [10.701031935273702, 13.246917832894081], [10.989593133191532, 13.387322699431108], [11.527803175511393, 13.328980007373584], [12.302071160540521, 13.037189032437521], [13.083987257548866, 13.596147162322563], [13.318701613018558, 13.556356309457824], [13.995352817448346, 12.461565253138343], [14.181336297266792, 12.483656927943112], [14.57717776862253, 12.085360826053501], [14.468192172918974, 11.90475169519341], [14.415378859116682, 11.572368882692071], [13.572949659894558, 10.798565985553564], [13.308676385153914, 10.160362046748926], [13.1675997249971, 9.64062632897341], [12.955467970438971, 9.417771714714702], [12.753671502339214, 8.717762762888993], [12.218872104550597, 8.305824082874322], [12.063946160539556, 7.799808457872301], [11.839308709366801, 7.397042344589434], [11.745774366918509, 6.981382961449753], [11.058787876030349, 6.644426784690593], [10.497375115611417, 7.055357774275562], [10.118276808318255, 7.038769639509879], [9.522705926154398, 6.453482367372116], [9.233162876023043, 6.444490668153334], [8.757532993208626, 5.47966583904791], [8.500287713259693, 4.771982937026847]]] } }, - { "type": "Feature", "properties": { "admin": "Nicaragua", "name": "Nicaragua", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-85.712540452807289, 11.088444932494822], [-86.058488328785245, 11.40343862552994], [-86.525849982432931, 11.806876532432593], [-86.7459915839963, 12.143961900272483], [-87.167516242201131, 12.458257961471656], [-87.668493415054698, 12.909909979702629], [-87.557466600275603, 13.064551703336061], [-87.392386237319201, 12.914018256069836], [-87.316654425795463, 12.984685777228972], [-87.005769009127562, 13.025794379117157], [-86.880557013684339, 13.254204209847241], [-86.733821784191576, 13.263092556201441], [-86.755086636079696, 13.754845485890909], [-86.520708177419877, 13.778487453664436], [-86.312142096689911, 13.771356106008167], [-86.096263800790581, 14.038187364147245], [-85.801294725268576, 13.836054999237586], [-85.698665330736901, 13.960078436738083], [-85.514413011400222, 14.079011745657834], [-85.165364549484792, 14.354369615125076], [-85.148750576502948, 14.560196844943615], [-85.052787441736925, 14.551541042534719], [-84.924500698572388, 14.790492865452348], [-84.820036790694346, 14.819586696832669], [-84.649582078779602, 14.66680532476175], [-84.449335903648588, 14.621614284722494], [-84.228341640952394, 14.748764146376654], [-83.975721401693576, 14.749435939996458], [-83.628584967772895, 14.880073960830298], [-83.489988776366104, 15.016267198135534], [-83.147219000974104, 14.995829169164109], [-83.233234422523907, 14.8998660343981], [-83.28416154654758, 14.676623846897197], [-83.182126430987267, 14.310703029838447], [-83.412499966144424, 13.970077826386554], [-83.519831916014667, 13.56769928634588], [-83.55220720084553, 13.127054348193084], [-83.498515387694255, 12.869292303921226], [-83.473323126951968, 12.419087225794424], [-83.626104499022887, 12.320850328007563], [-83.719613003255034, 11.893124497927724], [-83.650857510090702, 11.629032090700116], [-83.855470343750369, 11.373311265503785], [-83.808935716471538, 11.103043524617274], [-83.655611741861563, 10.938764146361418], [-83.895054490885926, 10.726839097532444], [-84.190178595704822, 10.793450018756671], [-84.355930752281026, 10.999225572142901], [-84.673069017256239, 11.082657172078139], [-84.903003302738924, 10.952303371621895], [-85.561851976244171, 11.217119248901593], [-85.712540452807289, 11.088444932494822]]] } }, - { "type": "Feature", "properties": { "admin": "Netherlands", "name": "Netherlands", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[6.074182570020922, 53.51040334737813], [6.905139601274128, 53.482162177130633], [7.092053256873895, 53.14404328064488], [6.842869500362381, 52.228440253297542], [6.589396599970825, 51.85202912048338], [5.988658074577812, 51.85161570902504], [6.156658155958779, 50.803721015010574], [5.60697594567, 51.037298488969768], [4.973991326526913, 51.475023708698124], [4.047071160507527, 51.267258612668556], [3.314971144228536, 51.345755113319903], [3.830288527043137, 51.620544542031936], [4.705997348661184, 53.091798407597757], [6.074182570020922, 53.51040334737813]]] } }, - { "type": "Feature", "properties": { "admin": "Norway", "name": "Norway", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[28.165547316202911, 71.185474351680497], [31.293418409965472, 70.453787746859902], [30.005435011522785, 70.186258856884876], [31.101078728975118, 69.558080145944857], [29.399580519332879, 69.156916002063056], [28.591929559043187, 69.064776923286686], [29.015572950971968, 69.76649119737796], [27.732292107867885, 70.164193020296281], [26.179622023226298, 69.825298977326142], [25.689212680776389, 69.092113755968995], [24.735679152126714, 68.649556789821432], [23.662049594830759, 68.891247463650515], [22.356237827247405, 68.841741441514941], [21.244936150810723, 69.370443020293109], [20.645592889089581, 69.106247260200846], [20.02526899585791, 69.065138658312705], [19.878559604581248, 68.407194322372604], [17.993868442464386, 68.567391262477329], [17.729181756265344, 68.01055186631622], [16.768878614985535, 68.013936672631374], [16.108712192456832, 67.302455552836889], [15.108411492583055, 66.193866889095418], [13.555689731509087, 64.787027696381458], [13.919905226302202, 64.445420640716108], [13.571916131248766, 64.049114081469654], [12.57993533697393, 64.066218980558332], [11.930569288794228, 63.128317572676977], [11.992064243221531, 61.800362453856557], [12.63114668137524, 61.293571682370079], [12.300365838274896, 60.117932847730046], [11.468271925511173, 59.432393296945989], [11.027368605196925, 58.856149400459394], [10.356556837616095, 59.469807033925363], [8.382000359743641, 58.313288479233265], [7.048748406613297, 58.078884182357271], [5.665835402050418, 58.588155422593658], [5.308234490590733, 59.663231919993805], [4.992078077829005, 61.97099803328426], [5.912900424837885, 62.614472968182682], [8.553411085655766, 63.454008287196459], [10.527709181366784, 64.486038316497471], [12.358346795306371, 65.879725857193151], [14.7611458675816, 67.810641587995121], [16.435927361728968, 68.563205471461671], [19.184028354578512, 69.817444159617807], [21.378416375420606, 70.255169379346043], [23.02374230316158, 70.202071845166259], [24.546543409938515, 71.030496731237221], [26.370049676221807, 70.986261705195361], [28.165547316202911, 71.185474351680497]]], [[[24.72412, 77.85385], [22.49032, 77.44493], [20.72601, 77.67704], [21.41611, 77.93504], [20.8119, 78.25463], [22.88426, 78.45494], [23.28134, 78.07954], [24.72412, 77.85385]]], [[[18.25183, 79.70175], [21.54383, 78.95611], [19.02737, 78.5626], [18.47172, 77.82669], [17.59441, 77.63796], [17.1182, 76.80941], [15.91315, 76.77045], [13.76259, 77.38035], [14.66956, 77.73565], [13.1706, 78.02493], [11.22231, 78.8693], [10.44453, 79.65239], [13.17077, 80.01046], [13.71852, 79.66039], [15.14282, 79.67431], [15.52255, 80.01608], [16.99085, 80.05086], [18.25183, 79.70175]]], [[[25.447625359811887, 80.407340399894494], [27.407505730913492, 80.056405748200447], [25.924650506298171, 79.517833970854539], [23.024465773213613, 79.40001170522909], [20.075188429451877, 79.566823228667232], [19.897266473070907, 79.842361965647498], [18.46226362475792, 79.859880276194403], [17.368015170977454, 80.318896186027004], [20.455992059010693, 80.598155626132225], [21.907944777115397, 80.357679348462071], [22.919252557067431, 80.657144273593488], [25.447625359811887, 80.407340399894494]]]] } }, - { "type": "Feature", "properties": { "admin": "Nepal", "name": "Nepal", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[88.120440708369841, 27.876541652939586], [88.043132765661198, 27.445818589786818], [88.174804315140904, 26.810405178325944], [88.060237664749806, 26.414615383402484], [87.22747195836628, 26.39789805755607], [86.024392938179147, 26.630984605408567], [85.25177859898335, 26.726198431906337], [84.675017938173767, 27.234901231387528], [83.304248895199535, 27.364505723575554], [81.999987420584958, 27.925479234319987], [81.057202589851997, 28.416095282499036], [80.088424513676259, 28.794470119740136], [80.476721225917373, 29.729865220655334], [81.11125613802929, 30.183480943313398], [81.525804477874729, 30.422716986608627], [82.327512648450863, 30.115268052688126], [83.337115106137176, 29.463731594352193], [83.898992954446712, 29.320226141877654], [84.234579705750136, 28.839893703724691], [85.011638218123025, 28.642773952747337], [85.823319940131498, 28.203575954698699], [86.954517043000592, 27.97426178640351], [88.120440708369841, 27.876541652939586]]] } }, - { "type": "Feature", "properties": { "admin": "New Zealand", "name": "New Zealand", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[173.020374790740703, -40.919052422856417], [173.247234328502003, -41.331998793300777], [173.958405389702875, -40.926700534835604], [174.2475867048081, -41.349155368821663], [174.248516880589449, -41.770008233406749], [173.876446568087886, -42.233184096038819], [173.222739699595621, -42.970038344088557], [172.711246372770717, -43.372287693048492], [173.080112746470206, -43.853343601253577], [172.308583612352464, -43.865694268571332], [171.452925246463622, -44.24251881284372], [171.185137974327233, -44.897104180684885], [170.616697219116588, -45.908928724959701], [169.83142215400926, -46.355774834987585], [169.332331170934253, -46.641235446967848], [168.411353794628525, -46.619944756863582], [167.763744745146823, -46.290197442409195], [166.676886021184202, -46.219917494492236], [166.509144321964669, -45.852704766626204], [167.046424188503238, -45.110941257508664], [168.303763462596862, -44.12397307716612], [168.949408807651508, -43.93581918719142], [169.667814569373149, -43.555325616226334], [170.524919875366152, -43.031688327812823], [171.125089960004004, -42.512753594737781], [171.569713983443194, -41.767424411792128], [171.948708937871885, -41.514416599291145], [172.097227004278722, -40.956104424809674], [172.798579543343948, -40.493962090823466], [173.020374790740703, -40.919052422856417]]], [[[174.612008905330526, -36.156397393540537], [175.336615838927173, -37.209097995758263], [175.3575964704375, -36.52619394302112], [175.808886753642469, -36.798942152657681], [175.958490025127475, -37.555381768546063], [176.763195428776555, -37.881253350578696], [177.438813104560495, -37.961248467766488], [178.010354445708657, -37.579824721020124], [178.517093540762801, -37.695373223624792], [178.274731073313802, -38.582812595373092], [177.970460239979332, -39.166342868812968], [177.206992629299123, -39.145775648760839], [176.939980503647007, -39.449736423501562], [177.032946405340113, -39.879942722331471], [176.8858236026052, -40.06597787858216], [176.508017206119348, -40.60480803808958], [176.012440220440283, -41.289624118821493], [175.239567499082966, -41.688307793953236], [175.067898391009408, -41.425894870775075], [174.650972935278418, -41.281820977545443], [175.227630243223615, -40.459235528323397], [174.900156691789959, -39.908933200847216], [173.824046665743992, -39.508854262043506], [173.852261997775315, -39.146602471677461], [174.57480187408035, -38.797683200842748], [174.743473749081033, -38.027807712558378], [174.69701663645057, -37.381128838857954], [174.292028436579187, -36.71109221776144], [174.319003534235549, -36.534823907213884], [173.840996535535766, -36.121980889634109], [173.05417117745958, -35.237125339500331], [172.636005487353714, -34.529106540669382], [173.007042271209457, -34.450661716450334], [173.551298456107475, -35.006183363587958], [174.329390497126241, -35.265495700828616], [174.612008905330526, -36.156397393540537]]]] } }, - { "type": "Feature", "properties": { "admin": "Oman", "name": "Oman", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[58.861141391846573, 21.114034532144299], [58.487985874266961, 20.428985907467101], [58.03431847517659, 20.481437486243347], [57.826372511634098, 20.24300242764863], [57.66576216007094, 19.736004950433109], [57.788700392493368, 19.067570298737646], [57.694390903560667, 18.944709580963799], [57.2342639504338, 18.947991034414255], [56.609650913321971, 18.574267076079476], [56.512189162019482, 18.087113348863934], [56.283520949128011, 17.876066799383945], [55.661491733630683, 17.884128322821535], [55.269939406155189, 17.632309068263194], [55.274900343655091, 17.228354397037659], [54.791002231674113, 16.950696926333357], [54.239252964093751, 17.04498057704998], [53.57050825380459, 16.707662665264674], [53.108572625547502, 16.651051133688977], [52.782184279192066, 17.349742336491229], [52.000009800022227, 19.000003363516068], [54.999981723862405, 19.999994004796118], [55.666659376859869, 22.000001125572307], [55.208341098863187, 22.708329982997007], [55.234489373602869, 23.110992743415348], [55.52584109886449, 23.524869289640911], [55.528631626208288, 23.933604030853498], [55.981213820220503, 24.130542914317854], [55.80411868675624, 24.269604193615287], [55.88623253766805, 24.920830593357486], [56.396847365143984, 24.924732163995508], [56.845140415276049, 24.241673081961487], [57.403452589757428, 23.878594468678834], [58.136947869708322, 23.747930609628835], [58.729211460205427, 23.565667832935414], [59.180501743410346, 22.992395331305456], [59.450097690677033, 22.660270900965592], [59.80806033716285, 22.533611965418199], [59.806148309168087, 22.31052480721419], [59.442191196536399, 21.71454051359208], [59.282407667889871, 21.433885809814875], [58.861141391846573, 21.114034532144299]]], [[[56.391421339753393, 25.895990708921254], [56.261041701080913, 25.714606431576748], [56.070820753814544, 26.055464178973946], [56.362017449779344, 26.395934353128947], [56.485679152253809, 26.309117946878665], [56.391421339753393, 25.895990708921254]]]] } }, - { "type": "Feature", "properties": { "admin": "Pakistan", "name": "Pakistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[75.158027785140902, 37.13303091078911], [75.896897414050116, 36.666806138651829], [76.192848341785677, 35.898403428687821], [77.837450799474553, 35.494009507787759], [76.871721632804011, 34.653544012992732], [75.757060988268321, 34.504922593721311], [74.240202671204955, 34.748887030571247], [73.749948358051952, 34.317698879527846], [74.104293654277328, 33.441473293586846], [74.451559279278698, 32.764899603805489], [75.258641798813187, 32.271105455040491], [74.405928989564998, 31.692639471965272], [74.421380242820263, 30.97981476493117], [73.450638462217412, 29.976413479119863], [72.823751662084689, 28.961591701772047], [71.777665643200308, 27.913180243434521], [70.61649620960192, 27.989196275335861], [69.514392938113119, 26.940965684511365], [70.168926629522005, 26.491871649678835], [70.282873162725579, 25.722228705339823], [70.844699334602822, 25.215102037043511], [71.0432401874682, 24.356523952730193], [68.842599318318761, 24.359133612560932], [68.176645135373377, 23.691965033456704], [67.443666619745457, 23.944843654876983], [67.145441928989058, 24.663611151624639], [66.37282758979326, 25.425140896093847], [64.530407749291115, 25.237038682551425], [62.905700718034595, 25.218409328710202], [61.497362908784183, 25.078237006118492], [61.874187453056535, 26.239974880472097], [63.316631707619578, 26.756532497661659], [63.23389773952028, 27.217047024030702], [62.755425652929851, 27.378923448184985], [62.727830438085974, 28.259644883735383], [61.771868117118615, 28.699333807890792], [61.369308709564926, 29.303276272085917], [60.874248488208778, 29.829238999952604], [62.549856805272775, 29.318572496044304], [63.550260858011164, 29.468330796826162], [64.148002150331237, 29.340819200145965], [64.350418735618504, 29.560030625928089], [65.046862013616092, 29.472180691031902], [66.346472609324408, 29.88794342703617], [66.38145755398601, 30.738899237586448], [66.938891229118454, 31.304911200479346], [67.683393589147457, 31.303154201781414], [67.792689243444769, 31.582930406209623], [68.556932000609308, 31.713310044882011], [68.926676873657655, 31.620189113892064], [69.317764113242546, 31.901412258424436], [69.262522007122541, 32.501944078088293], [69.687147251264847, 33.105498969041228], [70.323594191371583, 33.358532619758385], [69.93054324735958, 34.020120144175102], [70.881803012988385, 33.988855902638512], [71.156773309213449, 34.348911444632144], [71.115018751921625, 34.733125718722228], [71.613076206350698, 35.153203436822857], [71.498767938121077, 35.650563259415996], [71.262348260385735, 36.074387518857797], [71.846291945283909, 36.509942328429851], [72.920024855444453, 36.720007025696312], [74.067551710917812, 36.836175645488446], [74.575892775372964, 37.02084137628345], [75.158027785140902, 37.13303091078911]]] } }, - { "type": "Feature", "properties": { "admin": "Panama", "name": "Panama", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-77.881571417945239, 7.223771267114783], [-78.214936082660103, 7.512254950384159], [-78.429160732726061, 8.052041123888925], [-78.182095709938608, 8.319182440621772], [-78.43546525746568, 8.387705389840788], [-78.622120530903928, 8.718124497915026], [-79.120307176413732, 8.996092027213022], [-79.557877366845176, 8.932374986197145], [-79.760578172510037, 8.584515082224398], [-80.164481167303322, 8.333315944853593], [-80.382659064439608, 8.29840851484043], [-80.480689256497286, 8.090307522001067], [-80.003689948227148, 7.54752411542337], [-80.276670701808982, 7.419754136581713], [-80.421158006497066, 7.271571966984763], [-80.886400926420791, 7.220541490096535], [-81.059542812814698, 7.817921047390596], [-81.189715745757937, 7.647905585150339], [-81.519514736644666, 7.706610012233908], [-81.721311204744453, 8.108962714058434], [-82.131441209628889, 8.175392767769635], [-82.390934414382542, 8.292362372262287], [-82.820081346350406, 8.290863755725821], [-82.850958014644803, 8.073822740099954], [-82.965783047197348, 8.225027980985983], [-82.9131764391242, 8.423517157419068], [-82.829770677405151, 8.626295477732368], [-82.868657192704759, 8.807266343618521], [-82.719183112300513, 8.925708726431493], [-82.927154914059145, 9.074330145702914], [-82.932890998043561, 9.476812038608172], [-82.546196255203469, 9.566134751824674], [-82.187122565423394, 9.207448635286779], [-82.207586432610952, 8.995575262890098], [-81.808566860669259, 8.95061676679617], [-81.714154018872023, 9.031955471223581], [-81.43928707551153, 8.786234035675715], [-80.947301601876745, 8.858503526235905], [-80.521901211250054, 9.11107208906243], [-79.914599778955974, 9.312765204297618], [-79.573302781884294, 9.611610012241526], [-79.021191779277913, 9.552931423374103], [-79.058450486960353, 9.454565334506523], [-78.500887620747164, 9.420458889193879], [-78.055927700497989, 9.247730414258296], [-77.729513515926399, 8.946844387238867], [-77.353360765273848, 8.670504665558068], [-77.474722866511314, 8.524286200388216], [-77.242566494440069, 7.935278225125442], [-77.431107957656977, 7.638061224798733], [-77.75341386586139, 7.709839789252141], [-77.881571417945239, 7.223771267114783]]] } }, - { "type": "Feature", "properties": { "admin": "Peru", "name": "Peru", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-69.590423753524036, -17.580011895419329], [-69.858443569605839, -18.092693780187009], [-70.3725723944777, -18.347975355708861], [-71.375250210236914, -17.77379851651385], [-71.462040778271117, -17.363487644116379], [-73.444529588500401, -16.359362888252992], [-75.23788265654143, -15.26568287522778], [-76.009205084929931, -14.649286390850317], [-76.423469204397733, -13.823186944232431], [-76.259241502574156, -13.535039157772939], [-77.10619238962181, -12.222716159720816], [-78.092152879534623, -10.377712497604062], [-79.036953091126918, -8.38656788496589], [-79.445920376284832, -7.930833428583859], [-79.760578172510037, -7.194340915560081], [-80.537481655586049, -6.541667575713715], [-81.249996304026411, -6.136834405139182], [-80.926346808582423, -5.690556735866563], [-81.410942552399433, -4.736764825055459], [-81.099669562489353, -4.036394138203696], [-80.302560594387188, -3.404856459164712], [-80.184014858709645, -3.821161797708043], [-80.46929460317692, -4.059286797708999], [-80.442241990872134, -4.425724379090673], [-80.028908047185581, -4.346090996928893], [-79.62497921417615, -4.454198093283494], [-79.205289069317715, -4.959128513207388], [-78.639897223612323, -4.547784112164072], [-78.450683966775628, -3.873096612161375], [-77.83790483265858, -3.003020521663103], [-76.635394253226707, -2.608677666843817], [-75.544995693652027, -1.56160979574588], [-75.233722703741932, -0.911416924649529], [-75.373223232713841, -0.15203175212045], [-75.106624518520064, -0.05720549886486], [-74.441600511355958, -0.530820000819887], [-74.122395189089048, -1.002832533373848], [-73.659503546834586, -1.260491224781134], [-73.070392218707212, -2.308954359550952], [-72.325786505813639, -2.434218031426453], [-71.774760708285385, -2.169789727388937], [-71.413645799429773, -2.342802422702128], [-70.813475714791949, -2.256864515800742], [-70.047708502874841, -2.725156345229699], [-70.692682054309699, -3.742872002785858], [-70.394043952094975, -3.766591485207825], [-69.893635219996611, -4.298186944194326], [-70.79476884630229, -4.251264743673302], [-70.928843349883564, -4.401591485210367], [-71.748405727816532, -4.59398284263301], [-72.891927659787243, -5.274561455916979], [-72.964507208941185, -5.741251315944892], [-73.219711269814596, -6.089188734566076], [-73.120027431923575, -6.629930922068238], [-73.724486660441627, -6.918595472850638], [-73.723401455363486, -7.340998630404412], [-73.987235480429646, -7.523829847853063], [-73.571059332967053, -8.424446709835832], [-73.015382656532537, -9.03283334720806], [-73.226713426390148, -9.462212823121233], [-72.563033006465631, -9.520193780152715], [-72.184890713169821, -10.05359791426943], [-71.302412278921523, -10.079436130415372], [-70.481893886991159, -9.490118096558842], [-70.548685675728393, -11.009146823778462], [-70.093752204046879, -11.123971856331011], [-69.52967810736493, -10.951734307502193], [-68.665079718689611, -12.561300144097171], [-68.880079515239956, -12.89972909917665], [-68.929223802349526, -13.602683607643007], [-68.94888668483658, -14.45363941819328], [-69.339534674747, -14.953195489158828], [-69.160346645774936, -15.323973890853015], [-69.389764166934697, -15.66012908291165], [-68.959635382753291, -16.500697930571267], [-69.590423753524036, -17.580011895419329]]] } }, - { "type": "Feature", "properties": { "admin": "Philippines", "name": "Philippines", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[126.376813592637447, 8.414706325713352], [126.478512811387873, 7.750354112168976], [126.537423944200611, 7.189380601424572], [126.19677290253253, 6.274294338400038], [125.831420526229081, 7.293715318221855], [125.363852166852283, 6.78648529706099], [125.683160841983707, 6.049656887227257], [125.396511672060626, 5.581003322772288], [124.219787632342332, 6.16135549562618], [123.938719517106918, 6.88513560630612], [124.243662144061318, 7.360610459823659], [123.610212437027542, 7.833527329942753], [123.29607140512519, 7.418875637232786], [122.825505812675388, 7.457374579290216], [122.085499302255769, 6.899424139834847], [121.919928013192603, 7.192119452336072], [122.312358840017112, 8.034962063016506], [122.94239790251963, 8.316236883981174], [123.487687616063511, 8.693009751821192], [123.841154412939815, 8.240324204944384], [124.6014697612502, 8.514157619659015], [124.764612257995623, 8.960409450715458], [125.471390822451539, 8.986996975129641], [125.412117954612754, 9.760334784377545], [126.222714471543156, 9.28607432701885], [126.306636997585073, 8.782487494334573], [126.376813592637447, 8.414706325713352]]], [[[123.982437778825798, 10.278778591345811], [123.62318322153277, 9.950090643753297], [123.309920688979332, 9.318268744336676], [122.995883009941636, 9.022188625520398], [122.380054966319463, 9.713360907424201], [122.586088901867072, 9.981044826696104], [122.837081333508706, 10.261156927934234], [122.947410516451896, 10.881868394408029], [123.498849725438447, 10.940624497923945], [123.337774285984722, 10.267383938025445], [124.077935825701218, 11.232725531453706], [123.982437778825798, 10.278778591345811]]], [[[118.504580926590336, 9.316382554558087], [117.174274530100675, 8.367499904814663], [117.664477166821371, 9.066888739452933], [118.386913690261736, 9.684499619989223], [118.98734215706105, 10.376292019080507], [119.511496209797528, 11.36966807702721], [119.689676548339889, 10.554291490109872], [119.029458449378978, 10.003653265823869], [118.504580926590336, 9.316382554558087]]], [[[121.883547804859106, 11.891755072471977], [122.483821242361458, 11.582187404827506], [123.120216506035959, 11.583660183147867], [123.100837843926442, 11.165933742716486], [122.637713657726692, 10.741308498574226], [122.002610304859559, 10.441016750526087], [121.967366978036523, 10.905691229694622], [122.038370396005519, 11.415840969280039], [121.883547804859106, 11.891755072471977]]], [[[125.502551711123488, 12.162694606978347], [125.783464797062152, 11.046121934447767], [125.01188398651226, 11.311454576050377], [125.032761265158115, 10.975816148314703], [125.277449172060244, 10.358722032101308], [124.801819289245714, 10.134678859899889], [124.760168084818474, 10.8379951033923], [124.459101190286049, 10.889929917845633], [124.302521600441722, 11.495370998577227], [124.891012811381572, 11.415582587118589], [124.877990350443952, 11.794189968304988], [124.266761509295705, 12.557760931849682], [125.22711632700782, 12.53572093347719], [125.502551711123488, 12.162694606978347]]], [[[121.527393833503481, 13.069590155484516], [121.262190382981544, 12.2055602075644], [120.833896112146533, 12.704496161342416], [120.323436313967477, 13.466413479053866], [121.18012820850214, 13.429697373910439], [121.527393833503481, 13.069590155484516]]], [[[121.321308221523566, 18.504064642811013], [121.937601353036371, 18.21855235439838], [122.246006300954264, 18.478949896717094], [122.336956821787965, 18.224882717354173], [122.174279412933174, 17.810282701076371], [122.51565392465335, 17.09350474697197], [122.252310825693883, 16.262444362854122], [121.662786086108255, 15.931017564350125], [121.505069614753367, 15.124813544164621], [121.728828566577249, 14.328376369682244], [122.258925409027313, 14.218202216035973], [122.701275669445636, 14.336541245984417], [123.950295037940236, 13.782130642141066], [123.855107049658599, 13.237771104378464], [124.181288690284873, 12.997527370653469], [124.077419061378222, 12.536676947474573], [123.298035109552245, 13.027525539598981], [122.928651971529902, 13.552919826710404], [122.671355015148663, 13.185836289925131], [122.034649692880521, 13.784481919810343], [121.126384718918587, 13.636687323455559], [120.628637323083296, 13.857655747935649], [120.679383579593832, 14.271015529838319], [120.99181928923052, 14.525392767795079], [120.693336216312687, 14.756670640517282], [120.564145135582976, 14.396279201713821], [120.070428501466367, 14.970869452367094], [119.920928582846102, 15.406346747290735], [119.883773228028247, 16.363704331929963], [120.286487664878791, 16.034628811095327], [120.39004723519173, 17.599081122299506], [120.7158671407919, 18.505227362537536], [121.321308221523566, 18.504064642811013]]]] } }, - { "type": "Feature", "properties": { "admin": "Papua New Guinea", "name": "Papua New Guinea", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[155.880025669578401, -6.819996840037758], [155.599991082988765, -6.919990736522491], [155.166994256815087, -6.535931491729299], [154.729191522438327, -5.900828138862208], [154.514114211239644, -5.139117526880012], [154.652503696917336, -5.042430922061839], [154.759990676084357, -5.339983819198493], [155.062917922179338, -5.566791680527486], [155.547746209941693, -6.200654799019658], [156.019965448224752, -6.540013929880386], [155.880025669578401, -6.819996840037758]]], [[[151.982795851854462, -5.478063246282344], [151.459106887008659, -5.560280450058739], [151.301390415653884, -5.840728448106701], [150.754447056276661, -6.083762709175387], [150.241196730753813, -6.317753594592984], [149.709963006793316, -6.316513360218051], [148.890064732050462, -6.026040134305432], [148.318936802360696, -5.74714242922613], [148.401825799756864, -5.437755629094722], [149.298411900020824, -5.583741550319216], [149.845561965127217, -5.505503431829339], [149.996250441690279, -5.026101169457674], [150.139755894164921, -5.001348158389788], [150.236907586873485, -5.53222014732428], [150.807467075808063, -5.455842380396886], [151.089672072553981, -5.113692722192368], [151.647880894170811, -4.757073662946168], [151.537861769821518, -4.167807305521889], [152.136791620084352, -4.148790378438519], [152.338743117480988, -4.31296640382976], [152.318692661751754, -4.867661228050748], [151.982795851854462, -5.478063246282344]]], [[[147.191873814074938, -7.388024183789978], [148.084635858349372, -8.044108168167609], [148.734105259393573, -9.104663588093755], [149.306835158484432, -9.071435642130067], [149.266630894161324, -9.514406019736027], [150.038728469034311, -9.684318129111698], [149.738798456012262, -9.872937106977002], [150.801627638959133, -10.29368661869742], [150.690574985963849, -10.582712904505865], [150.028393182575826, -10.652476088099929], [149.782310012001972, -10.393267103723941], [148.923137648717216, -10.28092253992136], [147.913018426707993, -10.130440769087469], [147.135443150012236, -9.492443536012017], [146.567880894150619, -8.942554619994153], [146.048481073184917, -8.067414239131308], [144.74416792213799, -7.630128269077473], [143.897087844009661, -7.915330498896279], [143.286375767184268, -8.245491224809056], [143.413913202080664, -8.983068942910945], [142.628431431244223, -9.326820570516501], [142.068258905200196, -9.159595635620034], [141.033851760013874, -9.117892754760417], [141.017056919519007, -5.85902190513802], [141.000210402591847, -2.600151055515624], [142.735246616791443, -3.289152927263216], [144.583970982033236, -3.861417738463401], [145.27317955950997, -4.373737888205027], [145.829786411725649, -4.876497897972683], [145.981921828392956, -5.465609226100012], [147.648073358347574, -6.083659356310803], [147.891107619416175, -6.614014580922315], [146.970905389594861, -6.721656589386255], [147.191873814074938, -7.388024183789978]]], [[[153.14003787659874, -4.499983412294113], [152.827292108368255, -4.766427097190998], [152.63867313050298, -4.176127211120927], [152.406025832324929, -3.789742526874561], [151.953236932583536, -3.462062269711821], [151.384279413050024, -3.035421644710111], [150.6620495953388, -2.741486097833956], [150.939965448204532, -2.500002129734028], [151.479984165654514, -2.779985039891386], [151.820015090135087, -2.999971612157907], [152.239989455371074, -3.24000864015366], [152.640016717742526, -3.659983005389647], [153.019993524384631, -3.980015150573293], [153.14003787659874, -4.499983412294113]]]] } }, - { "type": "Feature", "properties": { "admin": "Poland", "name": "Poland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[15.016995883858666, 51.106674099321566], [14.607098422919531, 51.745188096719964], [14.685026482815685, 52.089947414755187], [14.437599725002197, 52.624850165408382], [14.074521111719488, 52.981262518925426], [14.353315463934136, 53.248171291712957], [14.119686313542584, 53.757029120491026], [14.802900424873455, 54.050706285205735], [16.363477003655728, 54.513158677785711], [17.622831658608671, 54.851535956432897], [18.620858595461637, 54.682605699270766], [18.696254510175461, 54.438718777069276], [19.6606400896064, 54.426083889373913], [20.89224450041862, 54.312524929412518], [22.731098667092649, 54.327536932993311], [23.243987257589506, 54.220566718149129], [23.484127638449841, 53.912497667041123], [23.527535841574995, 53.47012156840654], [23.804934930117774, 53.08973135030606], [23.799198846133375, 52.691099351606553], [23.19949384938618, 52.486977444053664], [23.508002150168689, 52.023646552124717], [23.52707075368437, 51.578454087930233], [24.029985792748899, 50.705406602575174], [23.922757195743259, 50.424881089878738], [23.426508416444388, 50.308505764357449], [22.518450148211596, 49.476773586619736], [22.776418898212619, 49.027395331409608], [22.558137648211751, 49.08573802346713], [21.607808058364206, 49.470107326854077], [20.887955356538406, 49.328772284535823], [20.415839471119849, 49.431453355499755], [19.825022820726865, 49.217125352569219], [19.320712517990469, 49.571574001659179], [18.909574822676316, 49.435845852244562], [18.85314415861361, 49.496229763377634], [18.392913852622168, 49.988628648470737], [17.649445021238986, 50.049038397819942], [17.554567091551117, 50.36214590107641], [16.868769158605655, 50.473973700556016], [16.719475945714429, 50.215746568393527], [16.176253289462263, 50.4226073268579], [16.238626743238566, 50.697732652379827], [15.490972120839725, 50.7847299261432], [15.016995883858666, 51.106674099321566]]] } }, - { "type": "Feature", "properties": { "admin": "Puerto Rico", "name": "Puerto Rico", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-66.2824344550082, 18.51476166429536], [-65.771302863209286, 18.426679185453875], [-65.591003790942935, 18.228034979723912], [-65.847163865813755, 17.975905666571855], [-66.599934455009475, 17.98182261806927], [-67.184162360285256, 17.946553453030074], [-67.24242753769434, 18.374460150622934], [-67.100679083917726, 18.520601101144347], [-66.2824344550082, 18.51476166429536]]] } }, - { "type": "Feature", "properties": { "admin": "North Korea", "name": "Dem. Rep. Korea", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[130.640015903852401, 42.39500946712527], [130.780007358931101, 42.220007229168843], [130.400030552288996, 42.280003567059701], [129.965948521037234, 41.941367906251052], [129.667362095254788, 41.601104437825221], [129.705189243692445, 40.882827867184318], [129.188114862179958, 40.661807766271984], [129.010399611528186, 40.485436102859801], [128.633368361526692, 40.189846910150301], [127.967414178581322, 40.025412502597547], [127.533435500194145, 39.756850083976694], [127.502119582225276, 39.323930772451526], [127.385434198110261, 39.213472398427648], [127.783342726757709, 39.050898342437414], [128.349716424676586, 38.612242946927843], [128.205745884311426, 38.370397243801882], [127.780035435090966, 38.304535630845884], [127.073308547067342, 38.256114813788393], [126.683719924018888, 37.804772854151174], [126.237338901881742, 37.840377916000271], [126.174758742376213, 37.749685777328033], [125.689103631697165, 37.940010077459014], [125.568439162295675, 37.752088731429616], [125.275330438336184, 37.66907054295271], [125.24008711151312, 37.857224432927424], [124.981033156433952, 37.948820909164773], [124.712160679219352, 38.108346055649783], [124.985994093933954, 38.548474229479673], [125.221948683778677, 38.665857245430665], [125.13285851450749, 38.848559271798578], [125.386589797060566, 39.387957872061158], [125.321115757346774, 39.551384589184202], [124.737482131042384, 39.660344346671614], [124.265624627785286, 39.928493353834149], [125.079941847840615, 40.569823716792442], [126.182045119329402, 41.107336127276362], [126.86908328664984, 41.816569322266176], [127.343782993682993, 41.50315176041596], [128.208433058790632, 41.466771552082477], [128.052215203972281, 41.994284572917934], [129.59666873587949, 42.424981797854542], [129.994267205933198, 42.985386867843779], [130.640015903852401, 42.39500946712527]]] } }, - { "type": "Feature", "properties": { "admin": "Portugal", "name": "Portugal", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-9.034817674180244, 41.880570583659669], [-8.671945766626719, 42.134689439454952], [-8.26385698081779, 42.280468654950326], [-8.01317460776991, 41.790886135417118], [-7.422512986673794, 41.792074693359822], [-7.251308966490822, 41.91834605566504], [-6.668605515967655, 41.883386949219577], [-6.389087693700914, 41.381815497394641], [-6.851126674822551, 41.111082668617513], [-6.864019944679383, 40.330871893874821], [-7.026413133156593, 40.184524237624238], [-7.066591559263527, 39.711891587882768], [-7.498632371439724, 39.629571031241802], [-7.098036668313126, 39.03007274022378], [-7.374092169616317, 38.373058580064914], [-7.029281175148794, 38.075764065089757], [-7.166507941099863, 37.803894354802217], [-7.537105475281022, 37.428904323876232], [-7.45372555177809, 37.097787583966053], [-7.855613165711985, 36.838268540996253], [-8.382816127953687, 36.978880113262449], [-8.898856980820325, 36.868809312480771], [-8.746101446965552, 37.6513455266766], [-8.839997524439879, 38.266243394517609], [-9.287463751655221, 38.358485826158592], [-9.526570603869713, 38.737429104154906], [-9.44698889814023, 39.392066148428363], [-9.048305223008425, 39.755093085278766], [-8.977353481471679, 40.159306138665798], [-8.7686840478771, 40.76063894303018], [-8.790853237330309, 41.18433401139125], [-8.990789353867568, 41.543459377603625], [-9.034817674180244, 41.880570583659669]]] } }, - { "type": "Feature", "properties": { "admin": "Paraguay", "name": "Paraguay", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-62.685057135657871, -22.24902922942238], [-62.291179368729203, -21.051634616787389], [-62.265961269770784, -20.513734633061272], [-61.786326463453761, -19.633736667562957], [-60.043564622626477, -19.342746677327419], [-59.11504248720609, -19.356906019775398], [-58.183471442280492, -19.868399346600359], [-58.166392381408038, -20.176700941653674], [-57.870673997617786, -20.732687676681948], [-57.937155727761287, -22.090175876557169], [-56.881509568902885, -22.282153822521476], [-56.473317430229379, -22.086300144135279], [-55.797958136606894, -22.356929620047815], [-55.61068274598113, -22.655619398694839], [-55.517639329639621, -23.57199757252663], [-55.400747239795407, -23.956935316668797], [-55.027901780809543, -24.001273695575225], [-54.652834235235119, -23.839578138933955], [-54.292959560754511, -24.021014092710722], [-54.293476325077435, -24.570799655863958], [-54.428946092330577, -25.162184747012162], [-54.625290696823562, -25.739255466415507], [-54.788794928595038, -26.621785577096126], [-55.695845506398143, -27.387837009390857], [-56.486701626192989, -27.548499037386286], [-57.609759690976134, -27.395898532828383], [-58.618173590719735, -27.123718763947089], [-57.633660040911117, -25.603656508081638], [-57.777217169817924, -25.162339776309032], [-58.807128465394968, -24.771459242453307], [-60.028966030504016, -24.032796319273267], [-60.846564704009907, -23.880712579038288], [-62.685057135657871, -22.24902922942238]]] } }, - { "type": "Feature", "properties": { "admin": "Palestine", "name": "Palestine", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.545665317534535, 32.393992011030569], [35.545251906076196, 31.782504787720832], [35.397560662586038, 31.489086005167572], [34.927408481594554, 31.35343537040141], [34.970506626125989, 31.616778469360803], [35.225891554512422, 31.754341132121759], [34.974640740709319, 31.866582343059715], [35.183930291491428, 32.532510687788935], [35.545665317534535, 32.393992011030569]]] } }, - { "type": "Feature", "properties": { "admin": "Qatar", "name": "Qatar", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[50.810108270069563, 24.754742539971371], [50.743910760303677, 25.482424221289389], [51.01335167827348, 26.006991685484191], [51.286461622936045, 26.114582017515865], [51.589078810437243, 25.801112779233375], [51.606700473848804, 25.215670477798735], [51.389607781790623, 24.627385972588051], [51.112415398977006, 24.556330878186721], [50.810108270069563, 24.754742539971371]]] } }, - { "type": "Feature", "properties": { "admin": "Romania", "name": "Romania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.710531447040488, 47.882193915389394], [23.142236362406798, 48.096341050806942], [23.760958286237404, 47.985598456405448], [24.402056105250374, 47.981877753280422], [24.866317172960571, 47.737525743188307], [25.207743361112986, 47.891056423527459], [25.945941196402394, 47.987148749374207], [26.197450392366925, 48.220881252630342], [26.619336785597788, 48.220726223333457], [26.924176059687561, 48.123264472030982], [27.233872918412736, 47.826770941756365], [27.551166212684841, 47.405117092470817], [28.128030226359037, 46.81047638608824], [28.160017937947707, 46.371562608417207], [28.054442986775392, 45.944586086605618], [28.233553501099035, 45.488283189468369], [28.679779493939371, 45.30403087013169], [29.149724969201646, 45.464925442072442], [29.603289015427425, 45.293308010431119], [29.62654340995876, 45.035390936862392], [29.141611769331831, 44.820210272799038], [28.837857700320196, 44.913873806328041], [28.55808149589199, 43.707461656258118], [27.970107049275068, 43.812468166675202], [27.242399529740904, 44.175986029632398], [26.065158725699739, 43.943493760751259], [25.569271681426923, 43.688444729174712], [24.100679152124169, 43.741051337247846], [23.332302280376322, 43.897010809904707], [22.94483239105184, 43.823785305347123], [22.657149692482985, 44.234923000661276], [22.474008416440594, 44.409227606781762], [22.705725538837349, 44.578002834647016], [22.459022251075933, 44.702517198254291], [22.145087924902807, 44.478422349620573], [21.562022739353605, 44.768947251965486], [21.483526238702233, 45.181170152357772], [20.874312778413351, 45.416375433934228], [20.76217492033998, 45.734573065771428], [20.220192498462833, 46.127468980486547], [21.021952345471245, 46.316087958351886], [21.626514926853869, 46.994237779318148], [22.09976769378283, 47.672439276716695], [22.710531447040488, 47.882193915389394]]] } }, - { "type": "Feature", "properties": { "admin": "Russia", "name": "Russia", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[143.648007440362846, 50.747600409541512], [144.65414757708561, 48.976390692737581], [143.173927850517174, 49.306551418650365], [142.558668247650076, 47.861575018904908], [143.533492466404027, 46.836728013692479], [143.505277134372591, 46.137907619809475], [142.747700636973889, 46.740764878926562], [142.092030064054484, 45.966755276058777], [141.906925083585008, 46.805928860046535], [142.018442824470867, 47.780132961612921], [141.904444614835029, 48.859188544299563], [142.135800002205656, 49.615163072297449], [142.179983351815281, 50.952342434281903], [141.594075962490024, 51.935434882202529], [141.682546014573632, 53.301966457728767], [142.606934035410745, 53.762145087287891], [142.209748976815376, 54.225475979216853], [142.654786411712934, 54.365880845753864], [142.914615513276544, 53.704577541714734], [143.260847609632037, 52.740760403039033], [143.235267775647628, 51.756660264688733], [143.648007440362846, 50.747600409541512]]], [[[22.731098667092649, 54.327536932993311], [20.892244500418652, 54.312524929412568], [19.6606400896064, 54.42608388937397], [19.88848147958134, 54.866160386771483], [21.268448927503492, 55.190481675835279], [22.315723504330599, 55.015298570365886], [22.757763706155281, 54.856574408581416], [22.651051873472564, 54.582740993866693], [22.731098667092649, 54.327536932993311]]], [[[180.000000000000114, 70.832199208546669], [178.903425, 70.78114], [178.7253, 71.0988], [180.000000000000114, 71.515714336428246], [180.000000000000114, 70.832199208546669]]], [[[143.60385, 73.21244], [142.08763, 73.20544], [140.038155, 73.31692], [139.86312, 73.36983], [140.81171, 73.76506], [142.06207, 73.85758], [143.48283, 73.47525], [143.60385, 73.21244]]], [[[150.73167, 75.08406], [149.575925, 74.68892], [147.977465, 74.778355], [146.11919, 75.17298], [146.358485, 75.49682], [148.22223, 75.345845], [150.73167, 75.08406]]], [[[145.086285, 75.562625], [144.3, 74.82], [140.61381, 74.84768], [138.95544, 74.61148], [136.97439, 75.26167], [137.51176, 75.94917], [138.831075, 76.13676], [141.471615, 76.09289], [145.086285, 75.562625]]], [[[57.535692579992386, 70.720463975702145], [56.944979282463933, 70.63274323188665], [53.677375115784187, 70.762657782668455], [53.412016635965372, 71.206661688920192], [51.601894565645708, 71.474759019650477], [51.455753615124209, 72.014881089965129], [52.478275180883564, 72.229441636840946], [52.444168735570841, 72.77473135038484], [54.427613559797649, 73.627547512497571], [53.508289829325136, 73.749813951300141], [55.902458937407644, 74.627486477345329], [55.631932814359701, 75.081412258597155], [57.868643833248839, 75.609390367323186], [61.170044386647497, 76.251883450008123], [64.498368361270209, 76.439055487769267], [66.210977003855092, 76.809782213031227], [68.157059767534818, 76.939696763812904], [68.852211134725124, 76.544811306454605], [68.180572544227644, 76.233641669409096], [64.637326287703004, 75.737754625136219], [61.583507521414752, 75.260884507946784], [58.477082147053366, 74.309056301562819], [56.986785516187993, 73.333043524866227], [55.41933597191094, 72.371267605265956], [55.622837762276291, 71.540594794390316], [57.535692579992386, 70.720463975702145]]], [[[106.970130000000111, 76.97419], [107.240000000000123, 76.48], [108.1538, 76.723350000000138], [111.077260000000138, 76.71], [113.33151, 76.22224], [114.13417, 75.84764], [113.88539, 75.327790000000121], [112.77918, 75.03186], [110.151250000000175, 74.47673], [109.4, 74.18], [110.64, 74.04], [112.11919, 73.787740000000113], [113.019540000000234, 73.976930000000138], [113.529580000000294, 73.33505], [113.96881, 73.59488], [115.56782, 73.75285], [118.776330000000215, 73.58772], [119.02, 73.12], [123.20066, 72.97122], [123.257770000000178, 73.73503], [125.380000000000166, 73.56], [126.97644, 73.56549], [128.59126, 73.03871], [129.05157, 72.39872], [128.46, 71.98], [129.715990000000204, 71.19304], [131.288580000000252, 70.786990000000102], [132.253500000000145, 71.8363], [133.857660000000294, 71.386420000000143], [135.56193, 71.655250000000123], [137.49755, 71.34763], [138.234090000000123, 71.62803], [139.86983, 71.487830000000116], [139.14791, 72.4161900000001], [140.46817, 72.849410000000134], [149.5, 72.2], [150.35118000000017, 71.60643], [152.96890000000019, 70.84222], [157.00688, 71.03141], [158.99779, 70.86672], [159.830310000000225, 70.45324], [159.70866, 69.72198], [160.94053000000028, 69.43728], [162.279070000000104, 69.64204], [164.05248, 69.66823], [165.940370000000172, 69.47199], [167.83567, 69.58269], [169.57763000000017, 68.6938], [170.816880000000253, 69.01363], [170.008200000000159, 69.65276], [170.453450000000259, 70.09703], [173.643910000000204, 69.81743], [175.72403000000017, 69.877250000000217], [178.6, 69.4], [180.000000000000114, 68.963636363636553], [180.000000000000114, 64.979708702198465], [179.99281, 64.97433], [178.707200000000199, 64.53493], [177.411280000000147, 64.60821], [178.313000000000187, 64.07593], [178.90825000000018, 63.251970000000128], [179.37034, 62.98262], [179.48636, 62.56894], [179.228250000000116, 62.304100000000133], [177.3643, 62.5219], [174.569290000000194, 61.76915], [173.68013, 61.65261], [172.15, 60.95], [170.6985, 60.33618], [170.330850000000282, 59.88177], [168.90046, 60.57355], [166.294980000000265, 59.7885500000002], [165.840000000000202, 60.16], [164.87674, 59.7316], [163.539290000000108, 59.86871], [163.217110000000218, 59.21101], [162.01733, 58.24328], [162.05297, 57.83912], [163.19191, 57.61503], [163.057940000000144, 56.159240000000111], [162.129580000000203, 56.12219], [161.70146, 55.285680000000148], [162.117490000000117, 54.85514], [160.368770000000325, 54.34433], [160.021730000000218, 53.20257], [158.530940000000157, 52.958680000000236], [158.23118, 51.94269], [156.789790000000266, 51.01105], [156.42000000000013, 51.7], [155.99182, 53.15895], [155.43366, 55.381030000000109], [155.914420000000291, 56.767920000000132], [156.75815, 57.3647], [156.81035, 57.83204], [158.364330000000166, 58.05575], [160.150640000000124, 59.314770000000109], [161.87204, 60.343000000000117], [163.66969, 61.1409], [164.473550000000103, 62.55061], [163.258420000000172, 62.46627], [162.65791, 61.6425], [160.12148, 60.54423], [159.30232, 61.77396], [156.72068, 61.43442], [154.218060000000293, 59.758180000000117], [155.04375, 59.14495], [152.81185, 58.88385], [151.265730000000246, 58.78089], [151.33815, 59.50396], [149.78371, 59.655730000000126], [148.54481, 59.16448], [145.48722, 59.33637], [142.197820000000121, 59.03998], [138.958480000000293, 57.08805], [135.12619, 54.72959], [136.70171, 54.603550000000112], [137.19342, 53.97732], [138.1647, 53.755010000000247], [138.80463, 54.25455], [139.90151, 54.189680000000166], [141.34531, 53.089570000000109], [141.37923, 52.23877], [140.59742000000017, 51.23967], [140.51308, 50.045530000000113], [140.061930000000189, 48.446710000000152], [138.554720000000202, 46.99965], [138.21971, 46.30795], [136.86232, 45.143500000000174], [135.515350000000183, 43.989], [134.869390000000237, 43.39821], [133.536870000000249, 42.81147], [132.90627, 42.79849], [132.278070000000241, 43.284560000000106], [130.935870000000136, 42.55274], [130.78, 42.220000000000191], [130.640000000000157, 42.395], [130.633866408409801, 42.903014634770543], [131.144687941614961, 42.929989732426932], [131.288555129115593, 44.111519680348252], [131.025190000000237, 44.96796], [131.883454217659562, 45.321161607436508], [133.097120000000189, 45.14409], [133.769643996313164, 46.116926988299149], [134.112350000000163, 47.212480000000127], [134.50081, 47.578450000000139], [135.026311476786759, 48.478229885443902], [133.373595819228001, 48.183441677434836], [132.506690000000106, 47.78896], [130.987260000000106, 47.79013], [130.582293328982644, 48.72968740497619], [129.397817824420486, 49.4406000840156], [127.657400000000351, 49.76027], [127.287455682484904, 50.739797268265434], [126.939156528837827, 51.353894151405896], [126.564399041856959, 51.784255479532689], [125.946348911646439, 52.792798570356936], [125.068211297710434, 53.161044826868924], [123.57147, 53.4588], [122.245747918793043, 53.431725979213681], [121.003084751470354, 53.251401068731226], [120.177088657716865, 52.753886216841195], [120.725789015791975, 52.516226304730893], [120.7382, 51.96411], [120.182080000000155, 51.64355], [119.27939, 50.58292], [119.288460728025839, 50.142882798861947], [117.87924441942647, 49.510983384797036], [116.67880089728618, 49.888531399121398], [115.485695428531415, 49.805177313834733], [114.962109816550353, 50.140247300815119], [114.362456496235325, 50.24830272073747], [112.897739699354361, 49.543565375356984], [111.581230910286649, 49.377968248077671], [110.662010532678835, 49.130128078805846], [109.402449171996707, 49.292960516957685], [108.475167270951275, 49.282547715850704], [107.868175897251092, 49.793705145865871], [106.888804152455293, 50.274295966180276], [105.886591424586868, 50.40601919209216], [104.62158, 50.275320000000157], [103.676545444760336, 50.08996613219513], [102.25589, 50.510560000000105], [102.06521, 51.25991], [100.889480421962631, 51.516855780638409], [99.981732212323564, 51.63400625264395], [98.861490513100492, 52.047366034546698], [97.82573978067451, 51.010995184933236], [98.231761509191699, 50.422400621128716], [97.259760000000199, 49.72605], [95.814020000000156, 49.977460000000114], [94.815949334698757, 50.01343333597088], [94.147566359435601, 50.480536607457161], [93.10421, 50.49529], [92.234711541719676, 50.802170722041737], [90.713667433640765, 50.331811835321098], [88.805566847695573, 49.470520738312459], [87.751264276076824, 49.297197984405543], [87.359970330762692, 49.214980780629148], [86.829356723989648, 49.826674709668133], [85.541269972682485, 49.69285858824815], [85.115559523462082, 50.117302964877631], [84.416377394553038, 50.311399644565817], [83.935114780618903, 50.889245510453563], [83.383003778012451, 51.069182847693881], [81.945985548839943, 50.812195949906325], [80.568446893235446, 51.388336493528435], [80.035559523441705, 50.864750881547209], [77.80091556184432, 53.404414984747532], [76.525179477854749, 54.177003485727127], [76.891100294913443, 54.490524400441913], [74.384820000000119, 53.546850000000113], [73.425678745420512, 53.489810289109741], [73.50851606638436, 54.035616766976588], [72.224150018202195, 54.376655381886778], [71.180131056609468, 54.133285224008247], [70.86526655465515, 55.169733588270091], [69.068166945272893, 55.385250149143488], [68.169100376258896, 54.970391750704366], [65.66687, 54.601250000000149], [65.178533563095939, 54.354227810272064], [61.436600000000126, 54.00625], [60.978066440683236, 53.664993394579128], [61.69998619980062, 52.979996446334255], [60.73999311711453, 52.719986477257734], [60.927268507740237, 52.447548326214999], [59.967533807215567, 51.96042043721566], [61.588003371024136, 51.272658799843171], [61.337424350840998, 50.799070136104248], [59.932807244715555, 50.842194118851822], [59.642282342370564, 50.545442206415707], [58.363320000000122, 51.06364], [56.77798, 51.04355], [55.71694, 50.621710000000142], [54.532878452376181, 51.026239732459359], [52.328723585831042, 51.718652248738088], [50.766648390512174, 51.692762356159861], [48.702381626181044, 50.605128485712825], [48.577841424357601, 49.87475962991563], [47.549480421749379, 50.454698391311119], [46.751596307162764, 49.356005764353725], [47.043671502476585, 49.152038886097571], [46.466445753776291, 48.394152330104923], [47.315240000000152, 47.71585], [48.05725, 47.74377], [48.694733514201872, 47.075628160177885], [48.59325000000014, 46.56104], [49.101160000000121, 46.39933], [48.645410000000105, 45.80629], [47.67591, 45.641490000000111], [46.68201, 44.6092], [47.59094, 43.660160000000118], [47.49252, 42.98658], [48.58437000000017, 41.80888], [47.987283156126033, 41.405819200194387], [47.815665724484653, 41.151416124021338], [47.373315464066387, 41.219732367511135], [46.686070591016708, 41.827137152669899], [46.404950799348924, 41.860675157227426], [45.7764, 42.092440000000224], [45.470279168485909, 42.502780666670041], [44.537622918482057, 42.711992702803677], [43.93121, 42.554960000000101], [43.755990000000182, 42.74083], [42.394400000000154, 43.2203], [40.922190000000128, 43.382150000000131], [40.076964959479838, 43.553104153002486], [39.95500857927108, 43.434997666999287], [38.68, 44.28], [37.539120000000104, 44.65721], [36.675460000000122, 45.24469], [37.40317, 45.40451], [38.23295, 46.24087], [37.67372, 46.63657], [39.14767, 47.044750000000128], [39.121200000000123, 47.26336], [38.22353803889947, 47.102189846375971], [38.2551123390298, 47.546400458356956], [38.77057, 47.825620000000228], [39.738277622238982, 47.898937079452068], [39.895620000000136, 48.23241], [39.67465, 48.783820000000127], [40.080789015469477, 49.307429917999364], [40.069040000000108, 49.60105], [38.594988234213552, 49.926461900423718], [38.010631137857068, 49.915661526074715], [37.393459506995228, 50.383953355503664], [36.626167840325387, 50.225590928745127], [35.35611616388811, 50.577197374059139], [35.37791, 50.77394], [35.02218305841793, 51.207572333371495], [34.224815708154402, 51.255993150428921], [34.141978387190612, 51.56641347920619], [34.391730584457228, 51.768881740925892], [33.75269982273587, 52.335074571331646], [32.715760532367163, 52.238465481162159], [32.412058139787767, 52.288694973349763], [32.15944000000021, 52.061250000000101], [31.78597, 52.10168], [31.540018344862254, 52.742052313846429], [31.305200636527978, 53.073995876673301], [31.49764, 53.167430000000124], [32.304519484188368, 53.132726141972839], [32.693643019346119, 53.351420803432141], [32.405598585751157, 53.618045355842], [31.731272820774585, 53.794029446012011], [31.791424187962399, 53.974638576872181], [31.384472283663818, 54.157056382862365], [30.757533807098774, 54.811770941784388], [30.971835971813245, 55.08154775656412], [30.873909132620064, 55.55097646750351], [29.896294386522435, 55.789463202530484], [29.371571893030783, 55.670090643936263], [29.229513380660389, 55.918344224666399], [28.176709425577933, 56.169129950578778], [27.855282016722519, 56.759326483784363], [27.770015903440985, 57.244258124411189], [27.288184848751648, 57.474528306703903], [27.716685825315771, 57.791899115624439], [27.420150000000202, 58.724570000000128], [28.131699253051856, 59.300825100330982], [27.98112, 59.47537], [29.1177, 60.028050000000107], [28.07, 60.503520000000137], [30.211107212044645, 61.780027777749673], [31.139991082491029, 62.357692776124431], [31.516092156711263, 62.867687486412898], [30.035872430142796, 63.552813625738551], [30.444684686003736, 64.204453436939062], [29.544429559047014, 64.948671576590542], [30.21765, 65.80598], [29.054588657352376, 66.944286200622017], [29.977426385220689, 67.69829702419274], [28.445943637818765, 68.364612942163987], [28.591929559043358, 69.064776923286686], [29.39955, 69.15692000000017], [31.101080000000103, 69.55811], [32.132720000000255, 69.905950000000232], [33.77547, 69.301420000000107], [36.51396, 69.06342], [40.292340000000159, 67.9324], [41.059870000000124, 67.457130000000106], [41.125950000000174, 66.79158000000011], [40.01583, 66.266180000000119], [38.38295, 65.99953], [33.918710000000168, 66.75961], [33.18444, 66.63253], [34.81477, 65.900150000000124], [34.87857425307876, 65.436212877048192], [34.943910000000152, 64.414370000000147], [36.23129, 64.10945], [37.012730000000111, 63.84983], [37.141970000000143, 64.33471], [36.539579035089801, 64.76446], [37.176040000000135, 65.143220000000113], [39.59345, 64.520790000000162], [40.4356, 64.76446], [39.762600000000148, 65.49682], [42.09309, 66.47623], [43.01604000000011, 66.41858], [43.94975000000013, 66.06908], [44.53226, 66.756340000000122], [43.69839, 67.35245], [44.187950000000136, 67.95051], [43.45282, 68.57079], [46.250000000000135, 68.25], [46.821340000000156, 67.68997], [45.55517, 67.56652], [45.56202, 67.010050000000192], [46.349150000000137, 66.66767], [47.894160000000248, 66.884550000000146], [48.13876, 67.52238], [50.227660000000142, 67.998670000000132], [53.717430000000164, 68.85738], [54.47171, 68.80815], [53.485820000000118, 68.20131], [54.72628, 68.09702], [55.442680000000124, 68.43866], [57.317020000000149, 68.46628], [58.802000000000206, 68.88082], [59.941420000000178, 68.27844], [61.077840000000165, 68.94069], [60.03, 69.52], [60.55, 69.85], [63.504000000000147, 69.54739], [64.888115, 69.234835000000132], [68.512160000000108, 68.09233000000016], [69.18068, 68.61563000000011], [68.16444, 69.14436], [68.13522, 69.35649], [66.930080000000103, 69.454610000000102], [67.25976, 69.92873], [66.724920000000125, 70.708890000000125], [66.69466, 71.028970000000228], [68.540060000000111, 71.934500000000227], [69.19636, 72.843360000000146], [69.94, 73.04000000000012], [72.58754, 72.77629], [72.79603, 72.22006], [71.84811, 71.40898], [72.47011, 71.09019], [72.79188, 70.39114], [72.564700000000201, 69.02085], [73.66787, 68.4079], [73.2387, 67.7404], [71.280000000000101, 66.320000000000149], [72.423010000000147, 66.172670000000167], [72.82077, 66.53267], [73.920990000000131, 66.789460000000119], [74.186510000000183, 67.28429], [75.052, 67.760470000000154], [74.469260000000148, 68.32899], [74.93584, 68.98918], [73.84236, 69.07146], [73.601870000000204, 69.62763], [74.3998, 70.63175], [73.1011, 71.447170000000241], [74.890820000000204, 72.12119], [74.65926, 72.83227], [75.158010000000175, 72.854970000000108], [75.68351, 72.300560000000118], [75.288980000000109, 71.33556], [76.35911, 71.152870000000135], [75.903130000000161, 71.87401], [77.5766500000001, 72.26717], [79.652020000000107, 72.32011], [81.5, 71.75], [80.61071, 72.582850000000107], [80.51109, 73.6482], [82.25, 73.85], [84.65526, 73.805910000000154], [86.822300000000226, 73.93688], [86.00956, 74.459670000000145], [87.166820000000143, 75.11643], [88.31571, 75.14393], [90.26, 75.64], [92.90058, 75.77333], [93.234210000000132, 76.0472], [95.860000000000127, 76.14], [96.67821, 75.91548], [98.922540000000197, 76.44689], [100.759670000000199, 76.43028], [101.03532, 76.86189], [101.990840000000105, 77.287540000000192], [104.3516, 77.69792], [106.066640000000135, 77.37389], [104.705000000000211, 77.1274], [106.970130000000111, 76.97419]]], [[[105.07547, 78.30689], [99.43814, 77.921], [101.2649, 79.23399], [102.08635, 79.34641], [102.837815, 79.28129], [105.37243, 78.71334], [105.07547, 78.30689]]], [[[51.136186557831266, 80.54728017854093], [49.793684523320692, 80.415427761548202], [48.894411248577526, 80.33956675894369], [48.75493655782175, 80.175468248200829], [47.586119012244147, 80.010181179515328], [46.502825962109647, 80.247246812654339], [47.072455275262897, 80.559424140129451], [44.846958042181107, 80.589809882317169], [46.799138624871226, 80.771917629713627], [48.31847741068465, 80.784009914869927], [48.52280602396668, 80.514568996900138], [49.097189568890897, 80.753985907708412], [50.039767693894603, 80.918885403151791], [51.522932977103679, 80.699725653801906], [51.136186557831266, 80.54728017854093]]], [[[99.93976, 78.88094], [97.75794, 78.7562], [94.97259, 79.044745], [93.31288, 79.4265], [92.5454, 80.14379], [91.18107, 80.34146], [93.77766, 81.0246], [95.940895, 81.2504], [97.88385, 80.746975], [100.186655, 79.780135], [99.93976, 78.88094]]]] } }, - { "type": "Feature", "properties": { "admin": "Rwanda", "name": "Rwanda", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.419104852019235, -1.134659112150416], [30.816134881317705, -1.698914076345388], [30.758308953583104, -2.287250257988368], [30.469696079232978, -2.413857517103458], [29.938359002407935, -2.348486830254238], [29.632176141078585, -2.917857761246096], [29.02492638521678, -2.839257907730157], [29.117478875451546, -2.292211195488384], [29.254834832483336, -2.215109958508911], [29.29188683443661, -1.620055840667987], [29.579466180140876, -1.341313164885626], [29.821518588996003, -1.443322442229785], [30.419104852019235, -1.134659112150416]]] } }, - { "type": "Feature", "properties": { "admin": "Western Sahara", "name": "W. Sahara", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-8.794883999049075, 27.120696316022503], [-8.81782833498667, 27.656425889592349], [-8.665589565454805, 27.656425889592349], [-8.66512447756419, 27.58947907155822], [-8.684399786809051, 27.395744126895998], [-8.687293667017398, 25.881056219988899], [-11.969418911171159, 25.933352769468261], [-11.93722449385332, 23.374594224536164], [-12.874221564169574, 23.284832261645171], [-13.118754441774708, 22.771220201096249], [-12.929101935263528, 21.327070624267559], [-16.845193650773989, 21.333323472574875], [-17.063423224342568, 20.99975210213082], [-17.020428432675736, 21.422310288981475], [-17.002961798561085, 21.420734157796574], [-14.750954555713532, 21.50060008390366], [-14.630832688851068, 21.860939846274899], [-14.221167771857251, 22.310163072188153], [-13.891110398809044, 23.691009019459297], [-12.500962693725368, 24.770116278578193], [-12.030758836301613, 26.030866197203036], [-11.718219773800353, 26.104091701760616], [-11.392554897496977, 26.883423977154358], [-10.551262579785272, 26.990807603456879], [-10.18942420087758, 26.860944729107398], [-9.735343390328877, 26.860944729107398], [-9.413037482124464, 27.088476060488514], [-8.794883999049075, 27.120696316022503]]] } }, - { "type": "Feature", "properties": { "admin": "Saudi Arabia", "name": "Saudi Arabia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[42.779332309750963, 16.34789134364868], [42.64957278826607, 16.77463532151496], [42.347989129410706, 17.075805568911996], [42.270887892431219, 17.474721787989122], [41.754381951673949, 17.833046169500971], [41.221391229015573, 18.671599636301206], [40.939341261566533, 19.486485297111752], [40.247652215339819, 20.174634507726488], [39.801684604660934, 20.338862209550054], [39.139399448408277, 21.29190481209293], [39.023695916506782, 21.986875311770191], [39.066328973147577, 22.579655666590263], [38.492772251140075, 23.688451036060851], [38.023860304523616, 24.078685614512928], [37.483634881344379, 24.285494696545008], [37.154817742671177, 24.858482977797301], [37.209491408035994, 25.084541530858104], [36.931627231602583, 25.602959499610172], [36.639603712721218, 25.826227525327219], [36.249136590323808, 26.570135606384873], [35.640181512196385, 27.376520494083415], [35.130186801907875, 28.063351955674712], [34.632336053207972, 28.058546047471559], [34.787778761541936, 28.607427273059692], [34.832220493312938, 28.957483425404838], [34.956037225084252, 29.356554673778835], [36.068940870922049, 29.19749461518445], [36.501214227043583, 29.505253607698702], [36.740527784987243, 29.865283311476183], [37.503581984209028, 30.003776150018396], [37.668119744626374, 30.338665269485894], [37.998848911294367, 30.508499864213128], [37.002165561681004, 31.508412990844736], [39.004885695152545, 32.010216986614971], [39.195468377444961, 32.16100881604266], [40.399994337736238, 31.889991766887931], [41.889980910007829, 31.190008653278362], [44.709498732284736, 29.178891099559376], [46.568713413281742, 29.099025173452283], [47.459821811722819, 29.002519436147217], [47.708850538937376, 28.526062730416136], [48.416094191283939, 28.552004299426663], [48.807594842327163, 27.689627997339876], [49.299554477745815, 27.461218166609804], [49.470913527225647, 27.109999294538078], [50.152422316290874, 26.689663194275994], [50.212935418504671, 26.277026882425371], [50.113303257045928, 25.943972276304248], [50.23985883972874, 25.608049628190923], [50.527386509000728, 25.327808335872099], [50.660556675016885, 24.999895534764018], [50.810108270069563, 24.754742539971371], [51.112415398977006, 24.556330878186721], [51.389607781790623, 24.627385972588051], [51.579518670463258, 24.245497137951102], [51.617707553926969, 24.014219265228824], [52.000733270074321, 23.001154486578937], [55.006803012924898, 22.496947536707129], [55.208341098863187, 22.708329982997039], [55.666659376859812, 22.000001125572336], [54.999981723862355, 19.999994004796104], [52.000009800022227, 19.000003363516054], [49.116671583864857, 18.616667588774941], [48.183343540241324, 18.166669216377311], [47.466694777217626, 17.116681626854877], [47.000004917189749, 16.949999294497438], [46.749994337761642, 17.283338120996174], [46.366658563020529, 17.233315334537632], [45.399999220568752, 17.333335069238554], [45.216651238797184, 17.43332896572333], [44.062613152855072, 17.410358791569589], [43.791518589051904, 17.319976711491105], [43.380794305196098, 17.579986680567668], [43.115797560403351, 17.088440456607369], [43.218375278502734, 16.666889960186406], [42.779332309750963, 16.34789134364868]]] } }, - { "type": "Feature", "properties": { "admin": "Sudan", "name": "Sudan", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.963392794971178, 9.464285229420623], [33.824963480907506, 9.48406084571536], [33.842130853028145, 9.981914637215992], [33.721959248183097, 10.325262079630191], [33.206938084561777, 10.720111638406591], [33.086766479716729, 11.441141267476493], [33.206938084561777, 12.179338268667093], [32.743419037302537, 12.24800775714999], [32.674749548819641, 12.024831919580716], [32.073891524594778, 11.973329803218517], [32.314234734284746, 11.681484477166519], [32.400071594888338, 11.080626452941486], [31.850715687025509, 10.531270545078822], [31.352861895524875, 9.810240916008693], [30.837840731903377, 9.707236683284519], [29.996639497988546, 10.290927335388684], [29.618957311332842, 10.084918869940223], [29.515953078608607, 9.793073543888053], [29.000931914987166, 9.604232450560287], [28.966597170745779, 9.398223985111654], [27.970889587744345, 9.398223985111654], [27.833550610778783, 9.604232450560287], [27.112520981708876, 9.638567194801622], [26.752006167173811, 9.466893473594492], [26.477328213242508, 9.552730334198086], [25.96230704962101, 10.136420986302422], [25.790633328413943, 10.411098940233726], [25.069603699343979, 10.27375996326799], [24.79492574541268, 9.810240916008693], [24.537415163602017, 8.917537565731719], [24.194067721187643, 8.728696472403895], [23.886979580860665, 8.619729712933063], [23.805813429466745, 8.666318874542522], [23.459012892355979, 8.954285793489019], [23.394779087017291, 9.26506785729225], [23.557249790142915, 9.681218166538766], [23.554304233502187, 10.089255275915319], [22.977543572692749, 10.714462591998538], [22.864165480244246, 11.142395127807616], [22.87622, 11.384610000000119], [22.50869, 11.67936], [22.49762, 12.26024], [22.28801, 12.64605], [21.93681, 12.588180000000133], [22.03759, 12.95546], [22.29658, 13.37232], [22.18329, 13.78648], [22.51202, 14.09318], [22.30351, 14.32682], [22.567950000000106, 14.944290000000134], [23.02459, 15.68072], [23.886890000000101, 15.61084], [23.837660000000135, 19.580470000000101], [23.850000000000129, 20.0], [25.00000000000011, 20.00304], [25.00000000000011, 22.0], [29.02, 22.0], [32.9, 22.0], [36.86623, 22.0], [37.18872, 21.01885], [36.96941, 20.837440000000125], [37.114700000000134, 19.80796], [37.48179, 18.61409], [37.86276, 18.36786], [38.410089959473218, 17.998307399970312], [37.904000000000103, 17.42754], [37.16747, 17.263140000000128], [36.852530000000108, 16.95655], [36.75389, 16.29186], [36.32322, 14.82249], [36.42951, 14.42211], [36.27022, 13.563330000000118], [35.86363, 12.57828], [35.26049, 12.08286], [34.831630000000125, 11.318960000000116], [34.73115000000012, 10.910170000000106], [34.25745, 10.63009], [33.96162, 9.58358], [33.963392794971178, 9.464285229420623]]] } }, - { "type": "Feature", "properties": { "admin": "South Sudan", "name": "S. Sudan", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.963392794971178, 9.464285229420623], [33.97498, 8.68456], [33.82550000000014, 8.37916], [33.294800000000116, 8.35458], [32.95418, 7.7849700000001], [33.56829, 7.71334], [34.0751, 7.22595], [34.25032, 6.82607], [34.70702, 6.59422000000012], [35.298007118233095, 5.506], [34.620196267853935, 4.847122742082034], [34.005, 4.249884947362147], [33.39, 3.79], [32.68642, 3.79232], [31.881450000000136, 3.55827], [31.24556, 3.7819], [30.83385, 3.50917], [29.95349, 4.1737], [29.715995314256013, 4.600804755060152], [29.159078403446635, 4.389267279473244], [28.696677687298795, 4.455077215996993], [28.428993768026992, 4.287154649264607], [27.979977247842946, 4.408413397637388], [27.374226108517625, 5.233944403500173], [27.213409051225248, 5.550953477394613], [26.465909458123289, 5.946717434101855], [26.213418409945113, 6.546603298362127], [25.796647983511257, 6.979315904158169], [25.124130893664805, 7.500085150579422], [25.114932488716867, 7.825104071479244], [24.567369012152191, 8.229187933785452], [23.886979580860665, 8.619729712933063], [24.194067721187643, 8.728696472403895], [24.537415163602017, 8.917537565731719], [24.79492574541268, 9.810240916008693], [25.069603699343979, 10.27375996326799], [25.790633328413943, 10.411098940233726], [25.96230704962101, 10.136420986302422], [26.477328213242508, 9.552730334198086], [26.752006167173811, 9.466893473594492], [27.112520981708876, 9.638567194801622], [27.833550610778783, 9.604232450560287], [27.970889587744345, 9.398223985111654], [28.966597170745779, 9.398223985111654], [29.000931914987166, 9.604232450560287], [29.515953078608607, 9.793073543888053], [29.618957311332842, 10.084918869940223], [29.996639497988546, 10.290927335388684], [30.837840731903377, 9.707236683284519], [31.352861895524875, 9.810240916008693], [31.850715687025509, 10.531270545078822], [32.400071594888338, 11.080626452941486], [32.314234734284746, 11.681484477166519], [32.073891524594778, 11.973329803218517], [32.674749548819641, 12.024831919580716], [32.743419037302537, 12.24800775714999], [33.206938084561777, 12.179338268667093], [33.086766479716729, 11.441141267476493], [33.206938084561777, 10.720111638406591], [33.721959248183097, 10.325262079630191], [33.842130853028145, 9.981914637215992], [33.824963480907506, 9.48406084571536], [33.963392794971178, 9.464285229420623]]] } }, - { "type": "Feature", "properties": { "admin": "Senegal", "name": "Senegal", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-16.713728807023468, 13.594958604379853], [-17.126106736712611, 14.373515733289221], [-17.625042690490655, 14.72954051356407], [-17.185172898822227, 14.91947724045286], [-16.700706346085919, 15.621527411354107], [-16.463098110407881, 16.135036119038457], [-16.120690070041928, 16.45566254319338], [-15.623666144258689, 16.369337063049809], [-15.135737270558813, 16.587282416240779], [-14.577347581428977, 16.598263658102805], [-14.099521450242175, 16.304302273010489], [-13.43573767745306, 16.039383042866188], [-12.830658331747513, 15.303691514542942], [-12.170750291380299, 14.616834214735503], [-12.124887457721256, 13.994727484589784], [-11.927716030311613, 13.422075100147392], [-11.553397793005427, 13.141213690641063], [-11.467899135778522, 12.754518947800973], [-11.513942836950587, 12.442987575729415], [-11.658300950557928, 12.386582749882834], [-12.20356482588563, 12.465647691289401], [-12.278599005573438, 12.354440008997285], [-12.499050665730561, 12.332089952031053], [-13.217818162478235, 12.575873521367964], [-13.700476040084322, 12.586182969610192], [-15.548476935274005, 12.628170070847343], [-15.816574266004251, 12.515567124883345], [-16.147716844130581, 12.547761542201185], [-16.67745195155457, 12.38485158940105], [-16.84152462408127, 13.151393947802557], [-15.931295945692208, 13.130284125211331], [-15.691000535534991, 13.270353094938455], [-15.511812506562931, 13.278569647672864], [-15.141163295949463, 13.509511623585235], [-14.712197231494626, 13.298206691943774], [-14.277701788784553, 13.28058502853224], [-13.844963344772404, 13.505041612191999], [-14.046992356817478, 13.794067898000446], [-14.376713833055785, 13.625680243377371], [-14.687030808968483, 13.63035696049978], [-15.081735398813816, 13.876491807505982], [-15.398770310924457, 13.860368760630916], [-15.624596320039936, 13.623587347869556], [-16.713728807023468, 13.594958604379853]]] } }, - { "type": "Feature", "properties": { "admin": "Solomon Islands", "name": "Solomon Is.", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[162.119024693040842, -10.482719008021133], [162.398645868172196, -10.826367282762119], [161.700032180018354, -10.820011081590222], [161.319796991214702, -10.204751478723123], [161.917383254237933, -10.446700534713653], [162.119024693040842, -10.482719008021133]]], [[[160.852228631837903, -9.872937106977002], [160.462588332357228, -9.89520964929484], [159.849447463214176, -9.794027194867367], [159.640002883135139, -9.639979750205269], [159.70294477766663, -9.242949720906777], [160.362956170898428, -9.400304457235533], [160.688517694337179, -9.610162448772808], [160.852228631837903, -9.872937106977002]]], [[[161.679981724289121, -9.599982191611373], [161.52939660059053, -9.784312025596433], [160.788253208660507, -8.917543226764918], [160.579997186524338, -8.320008640173965], [160.92002811100491, -8.320008640173965], [161.280006138349961, -9.120011488484449], [161.679981724289121, -9.599982191611373]]], [[[159.875027297198585, -8.337320244991714], [159.917401971677975, -8.538289890174864], [159.133677199539335, -8.114181410355398], [158.586113722974687, -7.754823500197713], [158.211149530264834, -7.421872246941147], [158.359977655265425, -7.320017998893915], [158.820001255527671, -7.56000335045739], [159.640002883135139, -8.020026950719567], [159.875027297198585, -8.337320244991714]]], [[[157.53842573468927, -7.347819919466928], [157.339419793933217, -7.404767347852554], [156.902030471014768, -7.176874281445391], [156.491357863591304, -6.765943291860394], [156.542827590153934, -6.599338474151478], [157.140000441718882, -7.021638278840653], [157.53842573468927, -7.347819919466928]]]] } }, - { "type": "Feature", "properties": { "admin": "Sierra Leone", "name": "Sierra Leone", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-11.438779466182053, 6.785916856305746], [-11.708194545935736, 6.860098374860724], [-12.428098924193815, 7.262942002792029], [-12.949049038128193, 7.798645738145736], [-13.124025437868479, 8.163946438016977], [-13.246550258832512, 8.903048610871506], [-12.711957566773076, 9.342711696810765], [-12.596719122762206, 9.620188300001969], [-12.425928514037562, 9.835834051955953], [-12.150338100625003, 9.858571682164378], [-11.917277390988655, 10.046983954300556], [-11.117481248407328, 10.045872911006283], [-10.839151984083299, 9.688246161330367], [-10.622395188835037, 9.267910061068276], [-10.65477047366589, 8.977178452994194], [-10.494315151399629, 8.715540676300433], [-10.505477260774667, 8.348896389189603], [-10.230093553091276, 8.406205552601291], [-10.695594855176477, 7.939464016141085], [-11.14670427086838, 7.396706447779534], [-11.199801805048278, 7.105845648624735], [-11.438779466182053, 6.785916856305746]]] } }, - { "type": "Feature", "properties": { "admin": "El Salvador", "name": "El Salvador", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-87.793111131526558, 13.384480495655051], [-87.904112108089507, 13.149016831917134], [-88.483301561216791, 13.163951320849488], [-88.843227912129692, 13.259733588102474], [-89.256742723329282, 13.4585328231293], [-89.812393561547637, 13.520622056527994], [-90.095554572290951, 13.73533763270073], [-90.064677903996568, 13.881969509328924], [-89.7219339668207, 14.134228013561694], [-89.5342193265205, 14.244815578666302], [-89.587342698916544, 14.362586167859485], [-89.353325975282772, 14.424132798719112], [-89.058511929057644, 14.340029405164085], [-88.843072882832814, 14.140506700085169], [-88.541230841815974, 13.980154730683475], [-88.50399797234968, 13.845485948130854], [-88.065342576840123, 13.964625962779774], [-87.859515347021585, 13.893312486216979], [-87.723502977229387, 13.785050360565503], [-87.793111131526558, 13.384480495655051]]] } }, - { "type": "Feature", "properties": { "admin": "Somaliland", "name": "Somaliland", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[48.938129510296491, 9.451748968946672], [48.486735874226994, 8.837626247589979], [47.78942, 8.003], [46.948328484897942, 7.996876532417386], [43.67875, 9.183580000000116], [43.296975132018744, 9.540477403191742], [42.92812, 10.021940000000139], [42.55876, 10.572580000000126], [42.776851841000948, 10.926878566934416], [43.145304803242126, 11.462039699748853], [43.470659620951658, 11.27770986576388], [43.666668328634834, 10.864169216348158], [44.117803582542805, 10.445538438351603], [44.614259067570849, 10.442205308468941], [45.556940545439133, 10.698029486529775], [46.645401238802997, 10.816549383991171], [47.525657586462778, 11.127228094929986], [48.021596307167769, 11.193063869669741], [48.378783807169263, 11.375481675660122], [48.948206414593457, 11.410621649618516], [48.942005242718423, 11.394266058798163], [48.938491245322595, 10.982327378783451], [48.938232863161076, 9.973500067581481], [48.938129510296491, 9.451748968946672]]] } }, - { "type": "Feature", "properties": { "admin": "Somalia", "name": "Somalia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[49.72862, 11.5789], [50.25878, 11.67957], [50.73202, 12.0219], [51.1112, 12.02464], [51.13387, 11.74815], [51.04153, 11.16651], [51.04531, 10.6409], [50.83418, 10.27972], [50.55239, 9.19874], [50.07092, 8.08173], [49.4527, 6.80466], [48.59455, 5.33911], [47.74079, 4.2194], [46.56476, 2.85529], [45.56399, 2.04576], [44.06815, 1.05283], [43.13597, 0.2922], [42.04157, -0.91916], [41.81095, -1.44647], [41.58513, -1.68325], [40.993, -0.85829], [40.98105, 2.78452], [41.855083092643966, 3.918911920483726], [42.12861, 4.23413], [42.76967, 4.25259], [43.66087, 4.95755], [44.9636, 5.00162], [47.78942, 8.003], [48.486735874226937, 8.837626247589993], [48.938129510296442, 9.451748968946616], [48.938232863161026, 9.973500067581508], [48.938491245322481, 10.982327378783465], [48.942005242718345, 11.394266058798136], [48.948204758509732, 11.410617281697961], [49.26776, 11.43033], [49.72862, 11.5789]]] } }, - { "type": "Feature", "properties": { "admin": "Republic of Serbia", "name": "Serbia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.874312778413408, 45.416375433934306], [21.483526238702204, 45.181170152357865], [21.562022739353718, 44.768947251965635], [22.145087924902892, 44.478422349620573], [22.459022251075961, 44.702517198254426], [22.705725538837434, 44.578002834647002], [22.47400841644065, 44.409227606781762], [22.657149692483067, 44.234923000661347], [22.410446404721593, 44.008063462900047], [22.500156691180219, 43.642814439460999], [22.986018507588479, 43.211161200527094], [22.604801466571352, 42.898518785161109], [22.43659467946139, 42.580321153323943], [22.545011834409642, 42.461362006188025], [22.380525750424674, 42.320259507815074], [21.917080000000105, 42.30364], [21.576635989402117, 42.245224397061847], [21.54332, 42.32025], [21.66292, 42.43922], [21.77505, 42.6827], [21.63302, 42.67717], [21.43866, 42.86255], [21.27421, 42.90959], [21.143395, 43.068685000000123], [20.95651, 43.13094], [20.81448, 43.27205], [20.63508, 43.21671], [20.49679, 42.88469], [20.25758, 42.81275], [20.3398, 42.89852], [19.95857, 43.10604], [19.63, 43.213779970270522], [19.48389, 43.35229], [19.21852, 43.52384], [19.454, 43.568100000000115], [19.59976, 44.03847], [19.11761, 44.42307], [19.36803, 44.863], [19.00548, 44.86023], [19.390475701584588, 45.236515611342369], [19.072768995854172, 45.521511135432078], [18.82982, 45.90888], [19.596044549241636, 46.171729844744547], [20.22019249846289, 46.127468980486569], [20.76217492033998, 45.734573065771478], [20.874312778413408, 45.416375433934306]]] } }, - { "type": "Feature", "properties": { "admin": "Suriname", "name": "Suriname", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.147436489476874, 5.973149929219161], [-55.949318406789786, 5.772877915872], [-55.841779751190408, 5.953125311706059], [-55.033250291551759, 6.025291449401662], [-53.958044603070888, 5.756548163267764], [-54.478632981979224, 4.896755682795585], [-54.3995422023565, 4.212611395683466], [-54.006930508018996, 3.620037746592558], [-54.181726040246261, 3.189779771330421], [-54.269705166223183, 2.732391669115046], [-54.524754197799709, 2.311848863123785], [-55.097587449755125, 2.523748073736612], [-55.569755011605984, 2.42150625244713], [-55.973322109589361, 2.510363877773016], [-56.073341844290283, 2.220794989425499], [-55.905600145070871, 2.021995754398659], [-55.995698004771739, 1.817667141116601], [-56.53938574891454, 1.89952260986692], [-57.150097825739898, 2.768926906745406], [-57.281433478409703, 3.333491929534119], [-57.601568976457848, 3.334654649260684], [-58.044694383360664, 4.060863552258382], [-57.860209520078691, 4.576801052260449], [-57.914288906472123, 4.812626451024413], [-57.307245856339492, 5.073566595882225], [-57.147436489476874, 5.973149929219161]]] } }, - { "type": "Feature", "properties": { "admin": "Slovakia", "name": "Slovakia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[18.85314415861361, 49.496229763377634], [18.909574822676316, 49.435845852244562], [19.320712517990469, 49.571574001659179], [19.825022820726865, 49.217125352569219], [20.415839471119849, 49.431453355499755], [20.887955356538406, 49.328772284535823], [21.607808058364206, 49.470107326854077], [22.558137648211751, 49.08573802346713], [22.280841912533553, 48.825392157580659], [22.085608351334848, 48.422264309271782], [21.872236362401729, 48.319970811550007], [20.801293979584919, 48.62385407164237], [20.473562045989862, 48.562850043321809], [20.239054396249344, 48.327567247096916], [19.769470656013109, 48.2026911484636], [19.66136355965849, 48.266614895208647], [19.174364861739885, 48.111378892603859], [18.777024773847668, 48.081768296900627], [18.696512892336923, 47.88095368101439], [17.857132602620023, 47.758428860050365], [17.488472934649813, 47.867466132186209], [16.979666782304033, 48.123497015976298], [16.879982944412998, 48.470013332709463], [16.960288120194573, 48.596982326850593], [17.101984897538895, 48.8169688991171], [17.545006951577101, 48.800019029325362], [17.886484816161808, 48.903475246773695], [17.913511590250462, 48.996492824899072], [18.104972771891848, 49.043983466175298], [18.170498488037961, 49.271514797556421], [18.399993523846174, 49.315000515330034], [18.554971144289478, 49.495015367218777], [18.85314415861361, 49.496229763377634]]] } }, - { "type": "Feature", "properties": { "admin": "Slovenia", "name": "Slovenia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[13.806475457421524, 46.509306138691201], [14.632471551174827, 46.431817328469535], [15.137091912504982, 46.658702704447016], [16.011663852612653, 46.683610744811688], [16.202298211337361, 46.852385972676949], [16.370504998447412, 46.841327216166498], [16.564808383864854, 46.503750922219822], [15.768732944408548, 46.238108222023442], [15.671529575267552, 45.834153550797865], [15.323953891672403, 45.731782538427673], [15.327674594797424, 45.452316392593218], [14.935243767972931, 45.471695054702671], [14.595109490627804, 45.6349409043127], [14.411968214585411, 45.466165676447446], [13.715059848697221, 45.500323798192369], [13.937630242578305, 45.591015936864608], [13.698109978905475, 46.016778062517339], [13.806475457421524, 46.509306138691201]]] } }, - { "type": "Feature", "properties": { "admin": "Sweden", "name": "Sweden", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.183173455501922, 65.723740546320158], [21.213516879977213, 65.02600535751526], [21.369631381930954, 64.413587958424273], [19.778875766690216, 63.609554348395022], [17.847779168375208, 62.749400132896803], [17.11955488451812, 61.341165676510954], [17.831346062906388, 60.636583360427394], [18.787721795332086, 60.081914374422581], [17.869224887776337, 58.95376618105869], [16.829185011470084, 58.719826972073385], [16.44770958829147, 57.041118069071871], [15.87978559740378, 56.104301866268649], [14.666681349352071, 56.20088511822216], [14.100721062891461, 55.407781073622637], [12.942910597392054, 55.361737372450563], [12.625100538797025, 56.307080186581956], [11.787942335668671, 57.441817125063061], [11.027368605196866, 58.856149400459344], [11.468271925511145, 59.432393296946024], [12.300365838274896, 60.117932847730025], [12.631146681375181, 61.293571682370121], [11.992064243221559, 61.800362453856543], [11.930569288794228, 63.128317572676963], [12.57993533697393, 64.066218980558318], [13.571916131248711, 64.049114081469696], [13.9199052263022, 64.445420640716065], [13.555689731509087, 64.7870276963815], [15.108411492582999, 66.19386688909546], [16.108712192456775, 67.302455552836875], [16.768878614985478, 68.013936672631388], [17.729181756265344, 68.010551866316263], [17.993868442464329, 68.567391262477344], [19.878559604581248, 68.407194322372561], [20.025268995857882, 69.065138658312691], [20.645592889089521, 69.106247260200846], [21.978534783626113, 68.616845608180682], [23.539473097434435, 67.936008612735236], [23.565879754335576, 66.396050930437411], [23.903378533633795, 66.006927395279604], [22.183173455501922, 65.723740546320158]]] } }, - { "type": "Feature", "properties": { "admin": "Swaziland", "name": "Swaziland", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[32.071665480281062, -26.733820082304902], [31.868060337051073, -27.17792734142127], [31.282773064913325, -27.285879408478991], [30.685961948374477, -26.743845310169526], [30.676608514129633, -26.398078301704604], [30.949666782359905, -26.022649021104144], [31.044079624157146, -25.731452325139436], [31.333157586397899, -25.660190525008943], [31.837777947728057, -25.843331801051342], [31.985779249811962, -26.29177988048022], [32.071665480281062, -26.733820082304902]]] } }, - { "type": "Feature", "properties": { "admin": "Syria", "name": "Syria", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[38.792340529136077, 33.378686428352218], [36.834062127435537, 32.312937526980768], [35.719918247222743, 32.709192409794859], [35.700797967274745, 32.716013698857374], [35.836396925608618, 32.868123277308506], [35.821100701650231, 33.277426459276292], [36.066460402172048, 33.824912421192543], [36.611750115715886, 34.201788641897174], [36.448194207512095, 34.59393524834406], [35.998402540843628, 34.644914048799997], [35.905023227692219, 35.410009467097318], [36.149762811026527, 35.821534735653664], [36.417550083163029, 36.040616970355053], [36.685389031731795, 36.259699205056457], [36.739494256341395, 36.817520453431079], [37.066761102045824, 36.623036200500614], [38.167727492024191, 36.901210435527766], [38.699891391765895, 36.712927354472335], [39.522580193852541, 36.716053778625984], [40.673259311695681, 37.091276353497285], [41.212089471203043, 37.074352321921687], [42.349591098811764, 37.22987254490409], [41.837064243340954, 36.605853786763568], [41.289707472505448, 36.358814602192261], [41.383965285005807, 35.628316555314349], [41.00615888851992, 34.419372260062111], [38.792340529136077, 33.378686428352218]]] } }, - { "type": "Feature", "properties": { "admin": "Chad", "name": "Chad", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[14.495787387762899, 12.859396267137353], [14.595781284247604, 13.330426947477859], [13.954476759505607, 13.353448798063765], [13.956698846094124, 13.996691189016925], [13.540393507550785, 14.36713369390122], [13.97217, 15.68437], [15.247731154041842, 16.627305813050778], [15.300441114979716, 17.927949937405], [15.68574059414777, 19.957180080642384], [15.90324669766431, 20.387618923417499], [15.487148064850143, 20.730414537025634], [15.47106, 21.04845], [15.096887648181847, 21.308518785074902], [14.8513, 22.862950000000119], [15.86085, 23.40972], [19.84926, 21.49509], [23.837660000000135, 19.580470000000101], [23.886890000000101, 15.61084], [23.02459, 15.68072], [22.567950000000106, 14.944290000000134], [22.30351, 14.32682], [22.51202, 14.09318], [22.18329, 13.78648], [22.29658, 13.37232], [22.03759, 12.95546], [21.93681, 12.588180000000133], [22.28801, 12.64605], [22.49762, 12.26024], [22.50869, 11.67936], [22.87622, 11.384610000000119], [22.864165480244246, 11.142395127807616], [22.231129184668756, 10.971888739460608], [21.723821648859538, 10.567055568885959], [21.000868361096305, 9.475985215691479], [20.059685499764267, 9.012706000194838], [19.094008009526071, 9.074846910025768], [18.81200971850927, 8.982914536978623], [18.911021762780589, 8.630894680206435], [18.389554884523303, 8.281303615751879], [17.964929640380884, 7.890914008002992], [16.705988396886365, 7.508327541529978], [16.4561845231874, 7.734773667832938], [16.290561557691884, 7.754307359239417], [16.106231723706738, 7.497087917506461], [15.279460483469164, 7.42192454673801], [15.436091749745737, 7.692812404811887], [15.120865512765302, 8.382150173369437], [14.979995558337688, 8.796104234243442], [14.544466586981851, 8.965861314322238], [13.954218377344088, 9.549494940626685], [14.17146609869911, 10.021378282100043], [14.627200555081057, 9.920919297724591], [14.909353875394796, 9.992129421422758], [15.46787275560524, 9.982336737503543], [14.923564894275042, 10.891325181517514], [14.960151808337679, 11.555574042197234], [14.89336, 12.21905], [14.495787387762899, 12.859396267137353]]] } }, - { "type": "Feature", "properties": { "admin": "Togo", "name": "Togo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[1.865240512712318, 6.14215770102973], [1.060121697604927, 5.928837388528875], [0.836931186536333, 6.279978745952147], [0.570384148774849, 6.914358628767188], [0.490957472342245, 7.411744289576474], [0.712029249686878, 8.312464504423827], [0.461191847342121, 8.677222601756013], [0.365900506195885, 9.46500397382948], [0.367579990245389, 10.191212876827176], [-0.049784715159944, 10.706917832883928], [0.023802524423701, 11.018681748900802], [0.899563022474069, 10.997339382364258], [0.772335646171484, 10.470808213742357], [1.077795037448737, 10.175606594275022], [1.425060662450136, 9.825395412632998], [1.46304284018467, 9.334624335157086], [1.664477573258381, 9.128590399609378], [1.618950636409238, 6.832038072126236], [1.865240512712318, 6.14215770102973]]] } }, - { "type": "Feature", "properties": { "admin": "Thailand", "name": "Thailand", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[102.58493248902667, 12.186594956913279], [101.687157830819928, 12.645740057826568], [100.831809523524839, 12.627084865769204], [100.978467238369191, 13.412721665902563], [100.097797479251099, 13.406856390837429], [100.018732537844528, 12.307001044153353], [99.478920526123602, 10.846366685423545], [99.153772414143134, 9.963061428258554], [99.222398716226749, 9.239255479362425], [99.873831821698118, 9.207862046745118], [100.279646844486194, 8.29515289960605], [100.45927412313273, 7.429572658717175], [101.017327915452697, 6.856868597842476], [101.623079054778032, 6.740622463401918], [102.141186964936367, 6.221636053894626], [101.81428185425797, 5.810808417174242], [101.154218784593837, 5.691384182147713], [101.075515578213327, 6.20486705161592], [100.259596388756933, 6.642824815289542], [100.085756870527092, 6.46448944745029], [99.690690545655727, 6.848212795433595], [99.519641554769606, 7.343453884302759], [98.988252801512289, 7.907993068875325], [98.503786248775967, 8.382305202666286], [98.339661899816988, 7.794511623562384], [98.150009393305808, 8.350007432483876], [98.259150018306229, 8.973922837759799], [98.553550653073017, 9.932959906448543], [99.038120558673953, 10.960545762572435], [99.587286004639694, 11.892762762901695], [99.196353794351637, 12.804748439988666], [99.212011753336071, 13.269293728076462], [99.097755161538728, 13.827502549693275], [98.430819126379859, 14.622027696180831], [98.192074009191373, 15.123702500870349], [98.537375929765687, 15.308497422746081], [98.90334842325673, 16.177824204976115], [98.493761020911322, 16.837835598207928], [97.859122755934848, 17.567946071843657], [97.375896437573516, 18.445437730375811], [97.797782830804394, 18.627080389881751], [98.253723992915582, 19.708203029860041], [98.959675734454848, 19.752980658440944], [99.543309360759281, 20.186597601802056], [100.115987583417819, 20.41784963630818], [100.548881056726856, 20.109237982661124], [100.606293573003128, 19.508344427971217], [101.282014601651667, 19.462584947176762], [101.035931431077742, 18.408928330961611], [101.059547560635139, 17.512497259994486], [102.113591750092453, 18.109101670804161], [102.413004998791592, 17.932781683824281], [102.998705682387694, 17.961694647691598], [103.200192091893726, 18.309632066312769], [103.956476678485288, 18.240954087796872], [104.716947056092465, 17.428858954330078], [104.779320509868768, 16.441864935771445], [105.589038527450128, 15.570316066952856], [105.544338413517664, 14.723933620660414], [105.218776890078871, 14.27321177821069], [104.281418084736586, 14.416743068901363], [102.988422072361601, 14.225721136934464], [102.348099399833004, 13.39424734135822], [102.58493248902667, 12.186594956913279]]] } }, - { "type": "Feature", "properties": { "admin": "Tajikistan", "name": "Tajikistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[71.014198032520156, 40.244365546218226], [70.648018833299957, 39.935753892571157], [69.559609816368507, 40.103211371412968], [69.464886915977516, 39.526683254548693], [70.549161818325601, 39.604197902986492], [71.784693637991992, 39.279463202464363], [73.67537926625478, 39.431236884105594], [73.928852166646408, 38.505815334622724], [74.257514276022718, 38.606506862943441], [74.864815708316812, 38.378846340481587], [74.829985792952087, 37.990007025701388], [74.980002475895404, 37.419990139305888], [73.948695916646486, 37.421566270490786], [73.260055779924983, 37.495256862938994], [72.636889682917271, 37.047558091778349], [72.193040805962383, 36.94828766534566], [71.84463829945058, 36.738171291646914], [71.448693475230229, 37.065644843080513], [71.541917759084768, 37.905774441065631], [71.239403924448155, 37.953265082341879], [71.348131137990251, 38.258905341132156], [70.806820509732873, 38.486281643216408], [70.376304152309274, 38.138395901027515], [70.270574171840124, 37.73516469985401], [70.116578403610319, 37.588222764632086], [69.518785434857946, 37.608996690413413], [69.196272820924364, 37.15114350030742], [68.859445835245921, 37.344335842430588], [68.135562371701369, 37.023115139304302], [67.829999627559502, 37.144994004864678], [68.392032505165943, 38.157025254868728], [68.176025018185911, 38.901553453113898], [67.442219679641298, 39.140143541005479], [67.701428664017342, 39.580478420564518], [68.536416456989414, 39.533452867178923], [69.011632928345477, 40.086158148756653], [69.329494663372813, 40.727824408524839], [70.666622348925031, 40.960213324541407], [70.458159621059608, 40.49649485937028], [70.601406691372674, 40.218527330072284], [71.014198032520156, 40.244365546218226]]] } }, - { "type": "Feature", "properties": { "admin": "Turkmenistan", "name": "Turkmenistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[61.21081709172573, 35.650072333309218], [61.123070509694131, 36.491597194966239], [60.377637973883864, 36.52738312432836], [59.234761997316795, 37.412987982730336], [58.436154412678192, 37.522309475243794], [57.330433790928964, 38.029229437810933], [56.619366082592805, 38.121394354803478], [56.180374790273319, 37.935126654607423], [55.511578403551894, 37.964117133123153], [54.800303989486558, 37.392420762678178], [53.921597934795543, 37.198918361961255], [53.735511102112504, 37.906136176091685], [53.880928582581831, 38.952093003895349], [53.101027866432894, 39.290573635407121], [53.357808058491216, 39.975286363274442], [52.693972609269807, 40.033629055331964], [52.91525109234361, 40.87652334244472], [53.85813927594112, 40.631034450842165], [54.736845330632136, 40.951014919593455], [54.0083109881813, 41.551210842447404], [53.721713494690576, 42.123191433270016], [52.916749708880069, 41.868116563477322], [52.81468875510361, 41.135370591794704], [52.502459751196135, 41.783315538086356], [52.94429324729164, 42.116034247397586], [54.079417759014937, 42.324109402020817], [54.755345493392625, 42.04397146256656], [55.455251092353755, 41.259859117185826], [55.968191359282898, 41.308641669269356], [57.096391229079089, 41.32231008561056], [56.93221520368779, 41.82602610937559], [57.786529982337065, 42.170552883465511], [58.629010857991453, 42.751551011723045], [59.976422153569771, 42.223081976890199], [60.083340691981654, 41.425146185871391], [60.46595299667068, 41.22032664648254], [61.547178989513547, 41.2663703476546], [61.882714064384679, 41.084856879229392], [62.374260288344992, 40.053886216790382], [63.518014764261018, 39.363256537425627], [64.170223016216752, 38.892406724598231], [65.215998976507379, 38.402695013984292], [66.546150343700205, 37.974684963526855], [66.518606805288655, 37.362784328758785], [66.217384881459324, 37.393790188133913], [65.745630731066811, 37.661164048812061], [65.588947788357828, 37.305216783185628], [64.746105177677393, 37.111817735333297], [64.546479119733888, 36.31207326918426], [63.982895949158696, 36.007957465146596], [63.193538445900337, 35.857165635718907], [62.984662306576588, 35.404040839167614], [62.230651483005879, 35.270663967422287], [61.21081709172573, 35.650072333309218]]] } }, - { "type": "Feature", "properties": { "admin": "East Timor", "name": "Timor-Leste", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[124.96868248911619, -8.892790215697081], [125.086246372580248, -8.656887302284678], [125.947072381698234, -8.432094821815033], [126.64470421763852, -8.39824675866385], [126.957243280139792, -8.273344821814396], [127.335928175974615, -8.397316582882601], [126.967991978056517, -8.668256117388891], [125.925885044458568, -9.106007175333351], [125.088520135601073, -9.393173109579292], [125.070019972840583, -9.08998748132287], [124.96868248911619, -8.892790215697081]]] } }, - { "type": "Feature", "properties": { "admin": "Trinidad and Tobago", "name": "Trinidad and Tobago", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-61.68, 10.76], [-61.105, 10.89], [-60.895, 10.855], [-60.935, 10.11], [-61.77, 10.0], [-61.95, 10.09], [-61.66, 10.365], [-61.68, 10.76]]] } }, - { "type": "Feature", "properties": { "admin": "Tunisia", "name": "Tunisia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[9.482139926805273, 30.307556057246181], [9.055602654668148, 32.102691962201284], [8.439102817426116, 32.506284898400814], [8.430472853233367, 32.748337307255944], [7.612641635782181, 33.344114895148955], [7.524481642292242, 34.097376410451453], [8.140981479534302, 34.655145982393783], [8.376367628623766, 35.479876003555937], [8.217824334352313, 36.433176988260271], [8.420964389691674, 36.946427313783154], [9.509993523810605, 37.349994411766531], [10.210002475636315, 37.230001735984807], [10.180650262094529, 36.724037787415071], [11.028867221733348, 37.09210317641395], [11.100025668999249, 36.899996039368908], [10.600004510143092, 36.410000108377368], [10.593286573945134, 35.947444362932806], [10.939518670300686, 35.698984076473486], [10.807847120821007, 34.833507188449182], [10.149592726287123, 34.330773016897702], [10.339658644256613, 33.785741685515312], [10.856836378633684, 33.768740139291275], [11.108500603895118, 33.293342800422188], [11.488787469131008, 33.136995754523134], [11.432253452203692, 32.368903103152867], [10.944789666394453, 32.081814683555358], [10.636901482799484, 31.761420803345747], [9.950225050505081, 31.376069647745251], [10.056575148161752, 30.961831366493595], [9.97001712407285, 30.539324856075236], [9.482139926805273, 30.307556057246181]]] } }, - { "type": "Feature", "properties": { "admin": "Turkey", "name": "Turkey", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[36.913127068842151, 41.335358384764291], [38.347664829264502, 40.948586127275711], [39.512606642420238, 41.102762763018561], [40.373432651538245, 41.013672593747337], [41.554084100110707, 41.535656236327604], [42.619548781104548, 41.58317271581992], [43.582745802592704, 41.09214325618256], [43.752657911968491, 40.740200914058811], [43.656436395040963, 40.253563951166157], [44.400008579288759, 40.005000311842302], [44.79398969908199, 39.713002631177027], [44.109225294782355, 39.428136298168049], [44.421402622257595, 38.281281236314513], [44.225755649600522, 37.971584377589345], [44.772699008977739, 37.170444647768441], [44.293451775902852, 37.001514390606353], [43.942258742047343, 37.256227525372928], [42.77912560402185, 37.385263576805798], [42.349591098811764, 37.229872544904104], [41.212089471203015, 37.074352321921729], [40.673259311695702, 37.091276353497356], [39.522580193852512, 36.716053778626012], [38.699891391765917, 36.712927354472313], [38.167727492024156, 36.90121043552778], [37.066761102045824, 36.623036200500614], [36.739494256341366, 36.817520453431108], [36.685389031731816, 36.259699205056499], [36.417550083163086, 36.040616970355096], [36.149762811026584, 35.821534735653664], [35.782084995269848, 36.274995429014915], [36.160821567537049, 36.650605577128367], [35.550936313628334, 36.565442816711325], [34.714553256984367, 36.795532131490909], [34.026894972476455, 36.219960028623966], [32.509158156064096, 36.107563788389193], [31.69959516777956, 36.644275214172602], [30.621624790171062, 36.677864895162308], [30.391096225717114, 36.262980658506983], [29.69997562024556, 36.144357408181001], [28.732902866335387, 36.676831366516431], [27.641186557737363, 36.658822129862749], [27.048767937943289, 37.653360907536005], [26.318218214633042, 38.208133246405382], [26.804700148228726, 38.985760199533551], [26.170785353304375, 39.463612168936457], [27.280019972449388, 40.420013739578302], [28.819977654747209, 40.460011298172212], [29.240003696415574, 41.219990749672682], [31.145933872204434, 41.087621568357058], [32.347979363745786, 41.736264146484629], [33.513282911927512, 42.018960069337304], [35.167703891751863, 42.040224921225438], [36.913127068842151, 41.335358384764291]]], [[[27.192376743282406, 40.690565700842448], [26.358009067497782, 40.151993923496477], [26.043351271272535, 40.617753607743161], [26.056942172965332, 40.824123440100735], [26.294602085075692, 40.936261298174166], [26.604195590936282, 41.562114569661013], [26.117041863720825, 41.826904608724554], [27.135739373490505, 42.141484890301307], [27.996720411905407, 42.007358710287768], [28.115524529744441, 41.622886054036279], [28.988442824018779, 41.299934190428175], [28.806438429486743, 41.05496206314853], [27.619017368284112, 40.999823309893102], [27.192376743282406, 40.690565700842448]]]] } }, - { "type": "Feature", "properties": { "admin": "Taiwan", "name": "Taiwan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[121.777817824389899, 24.394273586519393], [121.175632358892713, 22.790857245367164], [120.747079705896198, 21.970571397382106], [120.220083449383651, 22.814860948166732], [120.106188592612369, 23.556262722258229], [120.694679803552233, 24.53845083261373], [121.49504438688875, 25.295458889257379], [121.951243931161429, 24.997595933527034], [121.777817824389899, 24.394273586519393]]] } }, - { "type": "Feature", "properties": { "admin": "United Republic of Tanzania", "name": "Tanzania", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.903711197104592, -0.95], [34.07262, -1.05982], [37.69869, -3.09699], [37.7669, -3.67712], [39.20222, -4.67677], [38.74054, -5.90895], [38.79977, -6.47566], [39.44, -6.84], [39.470000000000134, -7.1], [39.19469, -7.7039], [39.25203, -8.00781], [39.18652, -8.48551], [39.53574, -9.112369999999883], [39.9496, -10.0984], [40.31659, -10.317099999999867], [39.521, -10.89688], [38.427556593587767, -11.285202325081626], [37.82764, -11.26879], [37.47129, -11.56876], [36.775150994622884, -11.59453744878078], [36.514081658684397, -11.720938002166745], [35.312397902169145, -11.439146416879165], [34.559989047999451, -11.520020033415845], [34.28, -10.16], [33.940837724096518, -9.693673841980283], [33.73972, -9.41715], [32.759375441221373, -9.230599053589001], [32.191864861791935, -8.930358981973255], [31.556348097466628, -8.762048841998647], [31.157751336950064, -8.594578747317312], [30.74, -8.34], [30.2, -7.08], [29.62, -6.52], [29.419992710088305, -5.939998874539297], [29.519986606573063, -5.419978936386257], [29.339997592900367, -4.499983412294113], [29.753512404099858, -4.452389418153301], [30.11632, -4.09012], [30.50554, -3.56858], [30.75224, -3.35931], [30.74301, -3.03431], [30.52766, -2.80762], [30.46967, -2.41383], [30.758308953583132, -2.287250257988375], [30.816134881317844, -1.698914076345374], [30.419104852019291, -1.134659112150416], [30.769860000000101, -1.01455], [31.86617, -1.02736], [33.903711197104592, -0.95]]] } }, - { "type": "Feature", "properties": { "admin": "Uganda", "name": "Uganda", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.86617, -1.02736], [30.769860000000101, -1.01455], [30.419104852019291, -1.134659112150416], [29.821518588996121, -1.443322442229771], [29.579466180141019, -1.341313164885605], [29.587837762172164, -0.587405694179381], [29.8195, -0.2053], [29.875778842902431, 0.597379868976361], [30.086153598762785, 1.062312730306416], [30.468507521290285, 1.583805446779706], [30.852670118948133, 1.849396470543752], [31.174149204235952, 2.204465236821306], [30.77332, 2.339890000000139], [30.83385, 3.50917], [31.24556, 3.7819], [31.88145, 3.55827], [32.68642, 3.79232], [33.39, 3.79], [34.005, 4.249884947362147], [34.47913, 3.5556], [34.59607, 3.053740000000118], [35.03599, 1.90584], [34.6721, 1.17694], [34.18, 0.515], [33.893568969666994, 0.109813537861839], [33.903711197104592, -0.95], [31.86617, -1.02736]]] } }, - { "type": "Feature", "properties": { "admin": "Ukraine", "name": "Ukraine", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[31.78599816257158, 52.10167796488544], [32.159412062312661, 52.061266994833204], [32.412058139787625, 52.288694973349735], [32.715760532366964, 52.238465481162038], [33.7526998227357, 52.335074571331681], [34.391730584457001, 51.768881740925778], [34.141978387190385, 51.566413479206226], [34.22481570815426, 51.255993150428942], [35.022183058417873, 51.207572333371445], [35.377923618315116, 50.773955390010343], [35.35611616388794, 50.577197374059054], [36.62616784032533, 50.225590928745127], [37.393459506995065, 50.383953355503586], [38.01063113785689, 49.915661526074622], [38.59498823421341, 49.926461900423618], [40.069058465339097, 49.601055406281688], [40.080789015469342, 49.307429917999272], [39.674663934087526, 48.783818467801872], [39.895632358567575, 48.232405097031425], [39.738277622238819, 47.898937079451983], [38.770584751141186, 47.825608222029807], [38.255112339029743, 47.546400458356807], [38.223538038899413, 47.102189846375872], [37.42513715998998, 47.022220567404197], [36.759854770664383, 46.698700263040919], [35.823684523264816, 46.645964463887054], [34.962341749823871, 46.273196519549636], [35.020787794745978, 45.65121898048465], [35.51000857925316, 45.409993394546177], [36.529997999830151, 45.46998973243705], [36.334712762199146, 45.113215643893952], [35.239999220528112, 44.939996242851599], [33.882511020652878, 44.361478583344066], [33.326420932760037, 44.564877020844875], [33.546924269349446, 45.034770819674883], [32.454174432105496, 45.327466132176063], [32.630804477679128, 45.519185695978905], [33.588162062318382, 45.851568508480227], [33.298567335754704, 46.08059845639783], [31.744140252415171, 46.333347886737378], [31.675307244602401, 46.706245022155528], [30.748748813609094, 46.583100084003995], [30.37760867688888, 46.032410183285663], [29.603289015427425, 45.293308010431119], [29.149724969201646, 45.464925442072442], [28.679779493939371, 45.30403087013169], [28.233553501099035, 45.488283189468369], [28.48526940279276, 45.596907050145887], [28.659987420371575, 45.939986884131628], [28.933717482221621, 46.258830471372491], [28.862972446414055, 46.437889309263824], [29.072106967899288, 46.517677720722482], [29.170653924279879, 46.379262396828693], [29.759971958136383, 46.349987697935354], [30.024658644335364, 46.423936672545032], [29.838210076626289, 46.525325832701675], [29.908851759569295, 46.67436066343145], [29.559674106573105, 46.928582872091312], [29.415135125452732, 47.346645209332571], [29.050867954227321, 47.510226955752493], [29.122698195113024, 47.849095160506458], [28.670891147585163, 48.118148505234089], [28.259546746541837, 48.155562242213406], [27.52253746919515, 48.467119452501102], [26.857823520624798, 48.368210761094488], [26.619336785597788, 48.220726223333457], [26.197450392366925, 48.220881252630342], [25.945941196402394, 47.987148749374207], [25.207743361112986, 47.891056423527459], [24.866317172960571, 47.737525743188307], [24.402056105250374, 47.981877753280422], [23.760958286237404, 47.985598456405448], [23.142236362406798, 48.096341050806942], [22.710531447040488, 47.882193915389394], [22.640819939878746, 48.150239569687351], [22.085608351334848, 48.422264309271782], [22.280841912533553, 48.825392157580659], [22.558137648211751, 49.08573802346713], [22.776418898212619, 49.027395331409608], [22.518450148211596, 49.476773586619736], [23.426508416444388, 50.308505764357449], [23.922757195743259, 50.424881089878738], [24.029985792748899, 50.705406602575174], [23.52707075368437, 51.578454087930233], [24.005077752384206, 51.617443956094448], [24.553106316839511, 51.888461005249177], [25.327787713327005, 51.910656032918538], [26.337958611768549, 51.832288723347915], [27.454066196408426, 51.59230337178446], [28.241615024536564, 51.572227077839059], [28.617612745892242, 51.427713934934836], [28.992835320763522, 51.602044379271462], [29.254938185347921, 51.368234361366881], [30.157363722460889, 51.416138414101454], [30.55511722181145, 51.319503485715643], [30.619454380014837, 51.822806098022362], [30.927549269338975, 52.042353420614383], [31.78599816257158, 52.10167796488544]]] } }, - { "type": "Feature", "properties": { "admin": "Uruguay", "name": "Uruguay", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.625133429582945, -30.216294854454258], [-56.976025763564721, -30.109686374636119], [-55.97324459494093, -30.883075860316296], [-55.601510179249331, -30.853878676071385], [-54.572451544805105, -31.494511407193745], [-53.787951626182185, -32.047242526987617], [-53.209588995971529, -32.727666110974717], [-53.650543992718084, -33.202004082981823], [-53.373661668498229, -33.768377780900757], [-53.806425950726521, -34.396814874002224], [-54.935866054897716, -34.952646579733617], [-55.674089728403274, -34.752658786764066], [-56.215297003796053, -34.85983570733741], [-57.139685024633096, -34.430456231424238], [-57.817860683815489, -34.462547295877492], [-58.427074144104381, -33.909454441057569], [-58.349611172098854, -33.2631889788154], [-58.132647671121433, -33.040566908502008], [-58.142440355040748, -32.044503676076147], [-57.874937303281875, -31.016556084926201], [-57.625133429582945, -30.216294854454258]]] } }, - { "type": "Feature", "properties": { "admin": "United States of America", "name": "United States", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-155.54211, 19.08348], [-155.68817, 18.91619], [-155.93665, 19.05939], [-155.90806, 19.33888], [-156.07347, 19.70294], [-156.02368, 19.81422], [-155.85008, 19.97729], [-155.91907, 20.17395], [-155.86108, 20.26721], [-155.78505, 20.2487], [-155.40214, 20.07975], [-155.22452, 19.99302], [-155.06226, 19.8591], [-154.80741, 19.50871], [-154.83147, 19.45328], [-155.222169999999892, 19.23972], [-155.54211, 19.08348]]], [[[-156.07926, 20.64397], [-156.41445, 20.57241], [-156.58673, 20.783], [-156.70167, 20.8643], [-156.71055, 20.92676], [-156.61258, 21.01249], [-156.25711, 20.91745], [-155.99566, 20.76404], [-156.07926, 20.64397]]], [[[-156.75824, 21.17684], [-156.78933, 21.06873], [-157.32521, 21.09777], [-157.25027, 21.21958], [-156.75824, 21.17684]]], [[[-157.65283, 21.32217], [-157.70703, 21.26442], [-157.7786, 21.27729], [-158.12667, 21.31244], [-158.2538, 21.53919], [-158.29265, 21.57912], [-158.0252, 21.71696], [-157.94161, 21.65272], [-157.65283, 21.32217]]], [[[-159.34512, 21.982], [-159.46372, 21.88299], [-159.80051, 22.06533], [-159.74877, 22.1382], [-159.5962, 22.23618], [-159.36569, 22.21494], [-159.34512, 21.982]]], [[[-94.81758, 49.38905], [-94.639999999999858, 48.840000000000103], [-94.32914, 48.67074], [-93.63087, 48.60926], [-92.61, 48.45], [-91.64, 48.14], [-90.829999999999856, 48.27], [-89.6, 48.01], [-89.272917446636654, 48.019808254582834], [-88.378114183286513, 48.302917588893806], [-87.439792623300207, 47.94], [-86.461990831228135, 47.553338019392037], [-85.652363247403215, 47.220218817730498], [-84.876079881514855, 46.900083319682366], [-84.779238247399817, 46.637101955749117], [-84.54374874544564, 46.538684190449224], [-84.6049, 46.4396], [-84.3367, 46.408770000000104], [-84.142119513673279, 46.512225857115723], [-84.091851264161463, 46.275418606138253], [-83.890765347005654, 46.116926988299149], [-83.616130947590491, 46.116926988299149], [-83.469550747394621, 45.994686387712584], [-83.592850714843067, 45.816893622412543], [-82.550924648758169, 45.347516587905446], [-82.337763125431053, 44.44], [-82.137642381503952, 43.571087551439987], [-82.43, 42.98], [-82.899999999999878, 42.430000000000135], [-83.119999999999877, 42.08], [-83.141999681312555, 41.975681057292995], [-83.029810146806909, 41.832795722005997], [-82.690089280920162, 41.675105088867319], [-82.439277716791608, 41.675105088867319], [-81.277746548167059, 42.209025987306845], [-80.247447679347843, 42.36619985612267], [-78.939362148743683, 42.863611355148116], [-78.92, 42.965], [-79.009999999999863, 43.27], [-79.171673550111862, 43.466339423184301], [-78.720279914042365, 43.625089423184953], [-77.737885097957601, 43.629055589363382], [-76.820034145805565, 43.628784288093748], [-76.5, 44.018458893758599], [-76.375, 44.09631], [-75.31821, 44.81645000000016], [-74.867, 45.00048000000011], [-73.347829999999874, 45.00738], [-71.505059999999858, 45.0082], [-71.405, 45.255000000000123], [-71.08482, 45.305240000000154], [-70.659999999999783, 45.46], [-70.305, 45.915], [-69.99997, 46.69307], [-69.237216, 47.447781], [-68.905, 47.185], [-68.23444, 47.35486], [-67.79046, 47.06636], [-67.79134, 45.702810000000134], [-67.13741, 45.13753], [-66.96466, 44.809700000000149], [-68.03252, 44.3252], [-69.059999999999874, 43.98], [-70.116169999999897, 43.684050000000141], [-70.645475633410967, 43.090238348964043], [-70.81489, 42.8653], [-70.825, 42.335], [-70.494999999999891, 41.805], [-70.08, 41.78], [-70.185, 42.145], [-69.88497, 41.922830000000111], [-69.96503, 41.637170000000161], [-70.64, 41.475], [-71.12039, 41.494450000000164], [-71.859999999999829, 41.32], [-72.295, 41.27], [-72.87643, 41.22065], [-73.71, 40.931102351654481], [-72.24126, 41.119480000000138], [-71.944999999999808, 40.93], [-73.345, 40.63], [-73.982, 40.628], [-73.952325, 40.75075], [-74.25671, 40.47351], [-73.96244, 40.42763], [-74.17838, 39.70926], [-74.90604, 38.93954], [-74.98041, 39.1964], [-75.20002, 39.24845], [-75.52805, 39.4985], [-75.32, 38.96], [-75.071834764789784, 38.782032230179276], [-75.05673, 38.404120000000106], [-75.37747, 38.01551], [-75.94023, 37.21689], [-76.03127, 37.2566], [-75.722049999999783, 37.937050000000106], [-76.23287, 38.319215], [-76.35, 39.15], [-76.542725, 38.717615], [-76.32933, 38.08326], [-76.98999793161353, 38.239991766913384], [-76.301619999999886, 37.917945], [-76.25874, 36.9664000000001], [-75.9718, 36.89726], [-75.868039999999809, 36.55125], [-75.72749, 35.550740000000125], [-76.36318, 34.808540000000129], [-77.39763499999988, 34.51201], [-78.05496, 33.92547], [-78.554349999999815, 33.861330000000116], [-79.06067, 33.49395], [-79.20357, 33.15839], [-80.301325, 32.509355], [-80.86498, 32.0333], [-81.33629, 31.44049], [-81.49042, 30.729990000000122], [-81.31371, 30.03552], [-80.98, 29.18000000000011], [-80.53558499999987, 28.47213], [-80.529999999999774, 28.04], [-80.056539284977532, 26.88000000000013], [-80.088015, 26.205765], [-80.131559999999837, 25.816775], [-80.38103, 25.20616], [-80.679999999999879, 25.08], [-81.17213, 25.201260000000126], [-81.33, 25.64], [-81.709999999999795, 25.87], [-82.239999999999895, 26.730000000000125], [-82.70515, 27.49504], [-82.85526, 27.88624], [-82.65, 28.550000000000146], [-82.929999999999865, 29.100000000000129], [-83.70959, 29.93656], [-84.1, 30.090000000000114], [-85.10882, 29.63615], [-85.28784, 29.686120000000127], [-85.7731, 30.152610000000116], [-86.399999999999878, 30.400000000000112], [-87.530359999999831, 30.27433], [-88.41782, 30.3849], [-89.180489999999836, 30.31598], [-89.593831178419748, 30.159994004836843], [-89.413735, 29.89419], [-89.43, 29.48864], [-89.21767, 29.29108], [-89.40823, 29.15961], [-89.77928, 29.307140000000135], [-90.15463, 29.11743], [-90.880224999999896, 29.148535000000116], [-91.626784999999842, 29.677000000000127], [-92.49906, 29.5523], [-93.22637, 29.78375], [-93.84842, 29.71363], [-94.69, 29.480000000000125], [-95.60026, 28.73863], [-96.59404, 28.30748], [-97.139999999999802, 27.83], [-97.37, 27.38], [-97.379999999999853, 26.69], [-97.33, 26.210000000000115], [-97.139999999999802, 25.87], [-97.529999999999859, 25.84], [-98.239999999999895, 26.060000000000109], [-99.019999999999854, 26.37], [-99.3, 26.84], [-99.52, 27.54], [-100.11, 28.11000000000012], [-100.45584, 28.696120000000118], [-100.957599999999886, 29.380710000000125], [-101.6624, 29.779300000000113], [-102.48, 29.76], [-103.11, 28.97], [-103.94, 29.27], [-104.456969999999814, 29.57196], [-104.705749999999895, 30.12173], [-105.03737, 30.64402], [-105.63159, 31.083830000000113], [-106.1429, 31.39995], [-106.507589999999794, 31.75452], [-108.24, 31.754853718166398], [-108.24194, 31.34222], [-109.035, 31.341940000000161], [-111.02361, 31.33472], [-113.30498, 32.03914], [-114.815, 32.52528], [-114.721389999999829, 32.72083], [-115.991349999999869, 32.61239000000014], [-117.127759999999753, 32.53534], [-117.295937691273863, 33.04622461520389], [-117.944, 33.621236431201389], [-118.410602275897475, 33.740909223124497], [-118.519894822799685, 34.027781577575745], [-119.081, 34.078], [-119.438840642016658, 34.348477178284291], [-120.36778, 34.44711], [-120.62286, 34.60855], [-120.74433, 35.156860000000101], [-121.714569999999853, 36.16153], [-122.54747, 37.551760000000101], [-122.51201, 37.783390000000132], [-122.95319, 38.113710000000104], [-123.7272, 38.951660000000111], [-123.865169999999878, 39.766990000000128], [-124.39807, 40.3132], [-124.17886, 41.142020000000109], [-124.2137, 41.999640000000134], [-124.532839999999894, 42.76599], [-124.14214, 43.70838], [-124.020535, 44.615895], [-123.898929999999893, 45.52341], [-124.079635, 46.86475], [-124.395669999999896, 47.72017], [-124.687210083007812, 48.184432983398537], [-124.566101074218736, 48.379714965820384], [-123.12, 48.04], [-122.587359999999876, 47.096], [-122.34, 47.36], [-122.5, 48.18], [-122.84, 49.0], [-120.0, 49.0], [-117.03121, 49.0], [-116.04818, 49.0], [-112.999999999999872, 49.0], [-110.049999999999812, 49.0], [-107.049999999999898, 49.0], [-104.04826, 48.99986], [-100.65, 49.0], [-97.228720000004699, 49.0007], [-95.159069509171943, 49.0], [-95.15609, 49.38425], [-94.81758, 49.38905]]], [[[-153.006314053336837, 57.115842190165878], [-154.0050902984581, 56.734676825581047], [-154.516402757770067, 56.992748928446687], [-154.670992804971092, 57.461195787172493], [-153.762779507441451, 57.816574612043773], [-153.228729417921073, 57.968968410872421], [-152.564790615835108, 57.901427313866961], [-152.141147223906273, 57.591058661521977], [-153.006314053336837, 57.115842190165878]]], [[[-165.579164191733554, 59.909986884187539], [-166.192770148767238, 59.754440822988961], [-166.848337368821944, 59.941406155020942], [-167.455277066090048, 60.213069159579376], [-166.467792121424566, 60.384169826897775], [-165.674429694663644, 60.293606879306232], [-165.579164191733554, 59.909986884187539]]], [[[-171.731656867539357, 63.782515367275906], [-171.114433560245175, 63.592191067144981], [-170.491112433940657, 63.694975490973505], [-169.682505459653555, 63.431115627691142], [-168.689439460300662, 63.297506212000584], [-168.77194088445458, 63.188598130945437], [-169.529439867204985, 62.976931464277882], [-170.290556200215917, 63.194437567794452], [-170.671385667990847, 63.375821845138965], [-171.553063117538642, 63.317789211675077], [-171.791110602891166, 63.40584585230048], [-171.731656867539357, 63.782515367275906]]], [[[-155.067790290324211, 71.147776394323685], [-154.344165208941206, 70.696408596470192], [-153.900006273392563, 70.889988511835682], [-152.210006069935275, 70.829992173944831], [-152.270002407826127, 70.60000621202984], [-150.739992438744508, 70.430016588005699], [-149.720003018167489, 70.530010484490433], [-147.613361579357047, 70.214034939241785], [-145.689989800225248, 70.120009670686741], [-144.920010959076393, 69.989991767040479], [-143.58944618042517, 70.152514146598307], [-142.072510348713365, 69.851938178172631], [-140.985987521560702, 69.711998399526365], [-140.985988329004869, 69.711998399526365], [-140.992498752029377, 66.000028591568665], [-140.997769748123119, 60.306396796298593], [-140.012997816153074, 60.276837877027575], [-139.03900042031583, 60.000007229240012], [-138.340889999999888, 59.562110000000146], [-137.4525, 58.905000000000101], [-136.47972, 59.46389], [-135.47583, 59.78778], [-134.945, 59.270560000000117], [-134.27111, 58.86111], [-133.355548882207188, 58.410285142645151], [-132.73042, 57.692890000000105], [-131.707809999999853, 56.55212], [-130.00778, 55.91583], [-129.979994263358265, 55.284997870497207], [-130.536110189467223, 54.802753404349389], [-131.08581823797212, 55.178906155002025], [-131.967211467142278, 55.497775580459049], [-132.250010742859445, 56.369996242897443], [-133.539181084356386, 57.178887437562125], [-134.07806292029602, 58.123067531966889], [-135.038211032279037, 58.187714748763931], [-136.628062309954629, 58.212209377670447], [-137.800006279686016, 58.499995429103777], [-139.867787041412981, 59.537761542389134], [-140.825273817133024, 59.72751740176507], [-142.574443535564427, 60.084446519604981], [-143.958880994879848, 59.99918040632339], [-145.925556816827822, 60.458609727614274], [-147.114373949146625, 60.884656073644628], [-148.224306200127643, 60.672989406977152], [-148.018065558850736, 59.978328965893631], [-148.570822516860858, 59.914172675203297], [-149.727857835875824, 59.705658270905545], [-150.608243374616421, 59.368211168039487], [-151.716392788683294, 59.155821031319974], [-151.859433153267105, 59.74498403587959], [-151.40971900124714, 60.725802720779392], [-150.346941494732505, 61.033587551509854], [-150.621110806256951, 61.284424953854447], [-151.895839199816834, 60.727197984451273], [-152.578329841095581, 60.061657212964285], [-154.019172126257558, 59.350279446034264], [-153.287511359653166, 58.864727688219787], [-154.232492438758442, 58.146373602930531], [-155.307491421510207, 57.727794501366319], [-156.308334723923082, 57.422774359763636], [-156.556097378546298, 56.979984849670636], [-158.117216559867728, 56.463608099994175], [-158.433321296197136, 55.994153550838533], [-159.603327399717415, 55.566686102920116], [-160.289719611634183, 55.643580634170561], [-161.223047655257773, 55.364734605523481], [-162.23776607974105, 55.024186916720097], [-163.069446581046378, 54.689737046927171], [-164.785569221027174, 54.40417308208216], [-164.942226325520011, 54.572224839895327], [-163.84833960676562, 55.039431464246107], [-162.870001390615897, 55.348043117893198], [-161.804174974596009, 55.894986477270429], [-160.563604702781134, 56.008054511125025], [-160.070559862284483, 56.418055324928744], [-158.684442918919416, 57.016675116597852], [-158.461097378553944, 57.216921291728866], [-157.722770352183858, 57.570000515363056], [-157.550274421193564, 58.328326321030218], [-157.041674974576949, 58.918884589261708], [-158.194731208305427, 58.615802313869828], [-158.517217984023034, 58.787781480537305], [-159.058606126928709, 58.424186102931671], [-159.711667040017318, 58.931390285876333], [-159.981288825500144, 58.572549140041623], [-160.355271165996498, 59.071123358793628], [-161.355003425115001, 58.670837714260742], [-161.968893602526293, 58.671664537177371], [-162.054986538724648, 59.266925360747436], [-161.874170702135331, 59.633621324290587], [-162.518059048492034, 59.989723619213905], [-163.818341437820123, 59.798055731843377], [-164.662217577146407, 60.267484442782639], [-165.346387702474772, 60.507495632562396], [-165.350831875651835, 61.073895168697497], [-166.121379157555907, 61.500019029376212], [-165.734451870770471, 62.074996853271792], [-164.919178636717788, 62.633076483807919], [-164.562507901039339, 63.146378485763044], [-163.753332485996964, 63.219448961023758], [-163.067224494457832, 63.05945872664801], [-162.260555386381697, 63.541935736741159], [-161.534449836248569, 63.455816962326757], [-160.772506680321101, 63.76610810002326], [-160.958335130842528, 64.222798570402759], [-161.518068407212184, 64.402787584075313], [-160.777777676414729, 64.788603827566405], [-161.391926235987597, 64.777235012462327], [-162.453050096668818, 64.559444688568206], [-162.757786017894034, 64.338605455168803], [-163.54639421288428, 64.559160468190484], [-164.960829841145141, 64.446945095468848], [-166.425288255864473, 64.686672064870706], [-166.845004238939026, 65.088895575614529], [-168.110560065767146, 65.669997056736733], [-166.70527116602193, 66.088317776139391], [-164.474709642575448, 66.576660061297488], [-163.652511766595637, 66.576660061297488], [-163.788601651036117, 66.077207343196662], [-161.677774421210131, 66.116119696712403], [-162.489714525379981, 66.735565090595102], [-163.719716966791083, 67.116394558370089], [-164.430991380856511, 67.616338202577779], [-165.390286831706703, 68.042772121850234], [-166.764440680995989, 68.35887685817967], [-166.204707404626561, 68.883030910916162], [-164.430810513343431, 68.915535386827727], [-163.168613654614489, 69.371114813912882], [-162.930566169261965, 69.858061835399255], [-161.908897264635499, 70.333329983187625], [-160.93479651593367, 70.447689927849567], [-159.039175788387126, 70.891642157668926], [-158.119722866833939, 70.824721177851032], [-156.580824551398024, 71.357763576941736], [-155.067790290324211, 71.147776394323685]]]] } }, - { "type": "Feature", "properties": { "admin": "Uzbekistan", "name": "Uzbekistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[66.518606805288655, 37.362784328758785], [66.546150343700205, 37.974684963526855], [65.215998976507379, 38.402695013984292], [64.170223016216752, 38.892406724598231], [63.518014764261018, 39.363256537425627], [62.374260288344992, 40.053886216790382], [61.882714064384679, 41.084856879229392], [61.547178989513547, 41.2663703476546], [60.46595299667068, 41.22032664648254], [60.083340691981654, 41.425146185871391], [59.976422153569771, 42.223081976890199], [58.629010857991453, 42.751551011723045], [57.786529982337065, 42.170552883465511], [56.93221520368779, 41.82602610937559], [57.096391229079089, 41.32231008561056], [55.968191359282898, 41.308641669269356], [55.928917270741081, 44.995858466159099], [58.503127068928457, 45.586804307632818], [58.689989048095882, 45.500013739598621], [60.239971958258316, 44.784036770194717], [61.05831994003244, 44.405816962250505], [62.013300408786236, 43.504476630215642], [63.185786981056559, 43.650074978197999], [64.900824415959264, 43.728080552742576], [66.098012322865074, 42.997660020513088], [66.023391554635609, 41.994646307943974], [66.510648634715707, 41.987644151368436], [66.714047072216502, 41.168443508461493], [67.985855747351806, 41.135990708982213], [68.259895867795606, 40.662324530594894], [68.632482944620008, 40.668680731766798], [69.070027296835306, 41.384244289712363], [70.388964878220776, 42.081307684897439], [70.96231489449913, 42.266154283205481], [71.259247674448218, 42.167710679689456], [70.420022414028196, 41.519998277343134], [71.157858514291576, 41.143587144529107], [71.870114780570447, 41.392900092121259], [73.055417108049156, 40.86603302668945], [71.774875115856545, 40.145844428053763], [71.014198032520156, 40.244365546218226], [70.601406691372674, 40.218527330072284], [70.458159621059608, 40.49649485937028], [70.666622348925031, 40.960213324541407], [69.329494663372813, 40.727824408524839], [69.011632928345477, 40.086158148756653], [68.536416456989414, 39.533452867178923], [67.701428664017342, 39.580478420564518], [67.442219679641298, 39.140143541005479], [68.176025018185911, 38.901553453113898], [68.392032505165943, 38.157025254868728], [67.829999627559502, 37.144994004864678], [67.075782098259609, 37.35614390720928], [66.518606805288655, 37.362784328758785]]] } }, - { "type": "Feature", "properties": { "admin": "Venezuela", "name": "Venezuela", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-71.331583624950284, 11.776284084515805], [-71.36000566271079, 11.53999359786121], [-71.947049933546495, 11.423282375530018], [-71.620868292920164, 10.969459947142791], [-71.633063930941063, 10.446494452349027], [-72.074173956984495, 9.865651353388369], [-71.695644090446521, 9.072263088411246], [-71.26455929226772, 9.137194525585981], [-71.039999355743376, 9.859992784052407], [-71.350083787710773, 10.211935126176213], [-71.400623338492224, 10.968969021036013], [-70.155298834906503, 11.375481675660039], [-70.293843349881016, 11.846822414594211], [-69.943244594996813, 12.162307033736095], [-69.584300096297454, 11.459610907431211], [-68.882999233664435, 11.44338450769156], [-68.233271450458716, 10.885744126829945], [-68.194126552997616, 10.554653225135921], [-67.296248541926317, 10.545868231646306], [-66.227864142507983, 10.648626817258684], [-65.655237596281737, 10.20079885501732], [-64.890452236578156, 10.077214667191296], [-64.329478725833724, 10.389598700395679], [-64.318006557864933, 10.641417954953978], [-63.079322475828725, 10.701724351438598], [-61.880946010980182, 10.7156253117251], [-62.730118984616396, 10.420268662960904], [-62.388511928950969, 9.948204453974636], [-61.588767462801918, 9.873066921422263], [-60.830596686431711, 9.38133982994894], [-60.671252407459718, 8.580174261911877], [-60.150095587796166, 8.602756862823425], [-59.758284878159181, 8.367034816924045], [-60.550587938058186, 7.779602972846178], [-60.637972785063752, 7.414999904810853], [-60.295668097562377, 7.043911444522918], [-60.543999192940966, 6.856584377464881], [-61.159336310456467, 6.696077378766317], [-61.139415045807937, 6.234296779806142], [-61.410302903881941, 5.959068101419616], [-60.733574184803707, 5.2002772078619], [-60.601179165271922, 4.918098049332129], [-60.966893276601517, 4.536467596856638], [-62.085429653559125, 4.162123521334308], [-62.804533047116692, 4.006965033377951], [-63.093197597899092, 3.770571193858784], [-63.888342861574145, 4.020530096854571], [-64.628659430587533, 4.14848094320925], [-64.816064012294007, 4.056445217297422], [-64.368494432214092, 3.797210394705246], [-64.408827887617903, 3.126786200366623], [-64.269999152265783, 2.497005520025566], [-63.422867397705105, 2.411067613124174], [-63.368788011311644, 2.200899562993129], [-64.083085496666072, 1.91636912679408], [-64.199305792890499, 1.49285492594602], [-64.611011928959854, 1.328730576987041], [-65.354713304288353, 1.0952822941085], [-65.548267381437554, 0.78925446207603], [-66.325765143484944, 0.724452215982012], [-66.876325853122566, 1.253360500489336], [-67.181294318293041, 2.250638129074062], [-67.447092047786299, 2.600280869960869], [-67.809938117123693, 2.820655015469569], [-67.303173183853417, 3.31845408773718], [-67.33756384954367, 3.542342230641721], [-67.621835903581271, 3.839481716319994], [-67.823012254493534, 4.503937282728898], [-67.744696621355203, 5.221128648291667], [-67.521531948502741, 5.556870428891968], [-67.34143958196556, 6.095468044454021], [-67.695087246355001, 6.267318020040645], [-68.265052456318216, 6.153268133972473], [-68.985318569602327, 6.206804917826856], [-69.389479946557103, 6.099860541198835], [-70.093312954372408, 6.960376491723109], [-70.674233567981503, 7.087784735538717], [-71.960175747348629, 6.991614895043538], [-72.19835242378187, 7.340430813013682], [-72.444487270788059, 7.42378489830048], [-72.479678921178831, 7.632506008327352], [-72.360900641555958, 8.002638454617893], [-72.439862230097944, 8.405275376820027], [-72.660494757768092, 8.62528778730268], [-72.788729824500379, 9.085027167187331], [-73.304951544880026, 9.151999823437604], [-73.027604132769554, 9.736770331252441], [-72.905286017534692, 10.45034434655477], [-72.614657762325194, 10.821975409381777], [-72.227575446242923, 11.108702093953237], [-71.973921678338272, 11.608671576377116], [-71.331583624950284, 11.776284084515805]]] } }, - { "type": "Feature", "properties": { "admin": "Vietnam", "name": "Vietnam", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[108.050180291782908, 21.552379869060111], [106.715067987090066, 20.696850694252014], [105.881682163519002, 19.752050482659694], [105.662005649846279, 19.058165188060567], [106.426816847765991, 18.004120998603224], [107.36195356651973, 16.697456569887049], [108.269495070429599, 16.079742336486145], [108.877106561317447, 15.276690578670436], [109.335269810017209, 13.42602834721772], [109.200135939573954, 11.666859239137761], [108.366129998815424, 11.00832062422627], [107.22092858279521, 10.36448395430183], [106.4051127462034, 9.530839748569317], [105.158263787865081, 8.599759629750492], [104.795185174582372, 9.2410383162765], [105.076201613385592, 9.918490505406806], [104.334334751403446, 10.486543687375228], [105.199914992292321, 10.889309800658094], [106.249670037869436, 10.961811835163585], [105.810523716253101, 11.567614650921225], [107.491403029410861, 12.337205918827944], [107.614547967562402, 13.535530707244202], [107.382727492301058, 14.202440904186968], [107.564525181103875, 15.202173163305554], [107.312705926545576, 15.908538316303177], [106.55600792849566, 16.604283962464802], [105.925762160264, 17.485315456608955], [105.094598423281496, 18.666974595611073], [103.896532017026701, 19.265180975821799], [104.183387892678908, 19.624668077060214], [104.822573683697073, 19.886641750563879], [104.435000441508024, 20.758733221921528], [103.203861118586431, 20.766562201413745], [102.754896274834636, 21.675137233969462], [102.170435825613552, 22.464753119389297], [102.706992222100084, 22.708795070887668], [103.504514601660546, 22.703756618739202], [104.476858351664447, 22.819150092046961], [105.329209425886603, 23.352063300056908], [105.811247186305209, 22.976892401617899], [106.725403273548451, 22.794267889898414], [106.567273390735295, 22.218204860924768], [107.043420037872608, 21.811898912029907], [108.050180291782908, 21.552379869060111]]] } }, - { "type": "Feature", "properties": { "admin": "Vanuatu", "name": "Vanuatu", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[167.844876743845077, -16.466333103097153], [167.515181105822847, -16.597849623279966], [167.180007765977791, -16.159995212470957], [167.2168013857696, -15.891846205308449], [167.844876743845077, -16.466333103097153]]], [[[167.107712437201485, -14.933920179913951], [167.2700281110302, -15.74002084723487], [167.001207310247935, -15.614602146062492], [166.79315799384085, -15.668810723536719], [166.649859247095549, -15.392703545801192], [166.629136997746429, -14.6264970842096], [167.107712437201485, -14.933920179913951]]]] } }, - { "type": "Feature", "properties": { "admin": "Yemen", "name": "Yemen", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[53.108572625547502, 16.651051133688949], [52.385205926325874, 16.38241120041965], [52.191729363825075, 15.938433132384018], [52.168164910699986, 15.597420355689945], [51.172515089732471, 15.175249742081489], [49.574576450403136, 14.708766587782746], [48.679230584514151, 14.003202419485657], [48.238947381387412, 13.948089504446369], [47.938914015500771, 14.007233181204423], [47.354453566279702, 13.592219753468379], [46.71707645039173, 13.399699204965016], [45.877592807810252, 13.347764390511681], [45.625050083199874, 13.290946153206759], [45.406458774605241, 13.02690542241143], [45.144355910020849, 12.953938300015306], [44.9895333188744, 12.699586900274708], [44.494576450382844, 12.721652736863344], [44.175112745954486, 12.585950425664873], [43.48295861183712, 12.63680003504008], [43.222871128112118, 13.220950425667422], [43.251448195169516, 13.767583726450848], [43.087943963398047, 14.062630316621306], [42.892245314308717, 14.802249253798745], [42.604872674333606, 15.213335272680592], [42.805015496600042, 15.261962795467252], [42.702437778500652, 15.718885809791995], [42.823670688657408, 15.911742255105263], [42.779332309750963, 16.34789134364868], [43.218375278502734, 16.666889960186406], [43.115797560403351, 17.088440456607369], [43.380794305196098, 17.579986680567668], [43.791518589051904, 17.319976711491105], [44.062613152855072, 17.410358791569589], [45.216651238797184, 17.43332896572333], [45.399999220568752, 17.333335069238554], [46.366658563020529, 17.233315334537632], [46.749994337761642, 17.283338120996174], [47.000004917189749, 16.949999294497438], [47.466694777217626, 17.116681626854877], [48.183343540241324, 18.166669216377311], [49.116671583864857, 18.616667588774941], [52.000009800022227, 19.000003363516054], [52.782184279192037, 17.349742336491229], [53.108572625547502, 16.651051133688949]]] } }, - { "type": "Feature", "properties": { "admin": "South Africa", "name": "South Africa", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.521001417778869, -29.257386976846245], [31.325561150850994, -29.401977634398907], [30.901762729625336, -29.909956963828034], [30.622813348113816, -30.423775730106122], [30.055716180142774, -31.140269463832951], [28.925552605919535, -32.172041110972494], [28.219755893677092, -32.771952813448848], [27.464608188595967, -33.226963799778794], [26.419452345492818, -33.614950453426175], [25.909664340933482, -33.667040297176392], [25.78062828950069, -33.944646091448334], [25.172861769315965, -33.796851495093577], [24.67785322439212, -33.987175795224537], [23.594043409934635, -33.794474379208147], [22.988188917744729, -33.916430759416976], [22.574157342222232, -33.864082533505304], [21.542799106541022, -34.258838799782922], [20.689052768646999, -34.417175388325226], [20.071261020597628, -34.795136814107984], [19.616405063564567, -34.819166355123706], [19.193278435958714, -34.462598972309777], [18.855314568769867, -34.444305515278458], [18.424643182049376, -33.997872816708963], [18.377410922934612, -34.13652068454806], [18.244499139079917, -33.867751560198023], [18.250080193767442, -33.281430759414434], [17.925190463948436, -32.61129078545342], [18.247909783611185, -32.429131361624563], [18.221761508871477, -31.661632989225662], [17.566917758868861, -30.72572112398754], [17.0644161312627, -29.878641045859158], [17.06291751472622, -29.875953871379977], [16.344976840895239, -28.576705010697697], [16.824017368240899, -28.082161553664466], [17.218928663815401, -28.355943291946804], [17.387497185951499, -28.783514092729774], [17.836151971109526, -28.856377862261311], [18.464899122804745, -29.045461928017271], [19.002127312911082, -28.972443129188857], [19.89473432788861, -28.461104831660769], [19.895767856534427, -24.767790215760588], [20.165725538827186, -24.917961928000768], [20.758609246511831, -25.868136488551446], [20.666470167735437, -26.477453301704916], [20.889609002371731, -26.828542982695907], [21.60589603036939, -26.726533705351748], [22.105968865657864, -26.28025603607913], [22.579531691180584, -25.979447523708142], [22.824271274514896, -25.500458672794768], [23.312096795350179, -25.268689873965712], [23.733569777122703, -25.39012948985161], [24.211266717228792, -25.670215752873567], [25.025170525825782, -25.719670098576891], [25.664666375437712, -25.486816094669706], [25.765848829865206, -25.174845472923671], [25.941652052522151, -24.696373386333214], [26.485753208123292, -24.616326592713097], [26.78640669119741, -24.240690606383478], [27.119409620886238, -23.574323011979772], [28.017235955525244, -22.827753594659072], [29.432188348109033, -22.091312758067584], [29.839036899542965, -22.102216485281172], [30.322883335091767, -22.271611830333931], [30.659865350067083, -22.151567478119912], [31.191409132621278, -22.251509698172395], [31.670397983534645, -23.658969008073861], [31.930588820124242, -24.369416599222532], [31.752408481581874, -25.484283949487406], [31.837777947728057, -25.843331801051342], [31.333157586397899, -25.660190525008943], [31.044079624157146, -25.731452325139436], [30.949666782359905, -26.022649021104144], [30.676608514129633, -26.398078301704604], [30.685961948374477, -26.743845310169526], [31.282773064913325, -27.285879408478991], [31.868060337051073, -27.17792734142127], [32.071665480281062, -26.733820082304902], [32.830120477028878, -26.74219166433619], [32.580264926897677, -27.470157566031808], [32.462132602678444, -28.30101124442055], [32.203388706193032, -28.752404880490065], [31.521001417778869, -29.257386976846245]], [[28.978262566857236, -28.955596612261708], [28.541700066855491, -28.647501722937562], [28.07433841320778, -28.851468601193581], [27.532511020627471, -29.242710870075353], [26.999261915807629, -29.875953871379977], [27.749397006956478, -30.645105889612214], [28.107204624145421, -30.545732110314944], [28.291069370239903, -30.226216729454293], [28.848399692507734, -30.070050551068245], [29.018415154748016, -29.743765557577362], [29.325166456832587, -29.257386976846245], [28.978262566857236, -28.955596612261708]]] } }, - { "type": "Feature", "properties": { "admin": "Zambia", "name": "Zambia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[32.759375441221316, -9.230599053589058], [33.231387973775291, -9.676721693564799], [33.485687697083584, -10.525558770391111], [33.315310499817279, -10.796549981329695], [33.114289178201908, -11.607198174692311], [33.306422153463068, -12.435778090060214], [32.991764357237876, -12.783870537978272], [32.688165317523122, -13.712857761289273], [33.214024692525207, -13.97186003993615], [30.179481235481827, -14.796099134991525], [30.274255812305103, -15.507786960515208], [29.51683434420314, -15.644677829656386], [28.947463413211256, -16.043051446194436], [28.825868768028492, -16.389748630440611], [28.467906121542676, -16.468400160388843], [27.598243442502753, -17.290830580314005], [27.044427117630729, -17.938026218337427], [26.706773309035633, -17.961228936436477], [26.381935255648919, -17.846042168857892], [25.264225701608005, -17.736539808831413], [25.084443393664564, -17.661815687737366], [25.076950310982255, -17.578823337476617], [24.6823490740015, -17.35341073981947], [24.033861525170771, -17.29584319424632], [23.215048455506057, -17.52311614346598], [22.562478468524255, -16.89845142992181], [21.887842644953867, -16.080310153876876], [21.933886346125913, -12.898437188369357], [24.016136508894672, -12.91104623784857], [23.930922072045373, -12.565847670138854], [24.079905226342838, -12.191296888887361], [23.904153680118181, -11.722281589406318], [24.017893507592586, -11.237298272347088], [23.912215203555714, -10.926826267137512], [24.257155389103982, -10.951992689663655], [24.314516228947948, -11.262826429899269], [24.783169793402948, -11.238693536018962], [25.418118116973197, -11.330935967659958], [25.752309604604726, -11.784965101776356], [26.55308759939961, -11.924439792532125], [27.164419793412456, -11.608748467661071], [27.38879886242378, -12.132747491100663], [28.15510867687998, -12.272480564017894], [28.52356163912102, -12.698604424696679], [28.934285922976834, -13.248958428605132], [29.699613885219485, -13.257226657771827], [29.616001417771223, -12.178894545137307], [29.341547885869087, -12.36074391037241], [28.642417433392346, -11.971568698782312], [28.372253045370421, -11.793646742401389], [28.496069777141763, -10.789883721564044], [28.673681674928922, -9.605924981324931], [28.449871046672818, -9.164918308146083], [28.734866570762495, -8.526559340044576], [29.002912225060467, -8.40703175215347], [30.34608605319081, -8.238256524288216], [30.740015496551781, -8.340007419470913], [31.157751336950042, -8.594578747317362], [31.55634809746649, -8.76204884199864], [32.191864861791963, -8.930358981973276], [32.759375441221316, -9.230599053589058]]] } }, - { "type": "Feature", "properties": { "admin": "Zimbabwe", "name": "Zimbabwe", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.191409132621278, -22.251509698172395], [30.659865350067083, -22.151567478119912], [30.322883335091767, -22.271611830333931], [29.839036899542965, -22.102216485281172], [29.432188348109033, -22.091312758067584], [28.794656202924209, -21.639454034107445], [28.02137007010861, -21.485975030200578], [27.727227817503252, -20.851801853114711], [27.724747348753247, -20.499058526290387], [27.296504754350501, -20.391519870690995], [26.164790887158478, -19.293085625894935], [25.850391473094724, -18.714412937090533], [25.649163445750155, -18.536025892818987], [25.264225701608005, -17.736539808831413], [26.381935255648919, -17.846042168857892], [26.706773309035633, -17.961228936436477], [27.044427117630729, -17.938026218337427], [27.598243442502753, -17.290830580314005], [28.467906121542676, -16.468400160388843], [28.825868768028492, -16.389748630440611], [28.947463413211256, -16.043051446194436], [29.51683434420314, -15.644677829656386], [30.274255812305103, -15.507786960515208], [30.338954705534537, -15.880839125230242], [31.173063999157673, -15.860943698797868], [31.636498243951188, -16.071990248277881], [31.852040643040592, -16.319417006091374], [32.328238966610222, -16.392074069893749], [32.847638787575839, -16.713398125884613], [32.849860874164385, -17.979057305577175], [32.654885695127142, -18.672089939043492], [32.611994256324884, -19.419382826416268], [32.772707960752619, -19.715592136313294], [32.659743279762573, -20.30429005298231], [32.508693068173436, -20.395292250248303], [32.244988234188007, -21.116488539313689], [31.191409132621278, -22.251509698172395]]] } } - ] - }; - -var randomcountriesData1 = [ - { country: "Iran", "continent": "Asia", "CategoryName": "Books", "Sales": 550 }, - { country: "Benin", "continent": "Africa", "CategoryName": "Books", "Sales": 1000 }, - { country: "China", "continent": "Asia", "CategoryName": "Books", "Sales": 420 }, - { country: "Chile", "continent": "South America", "CategoryName": "Books", "Sales": 1100 }, - { country: "Cuba", "continent": "North America", "CategoryName": "Books", "Sales": 450 }, - { country: "Spain", "continent": "Europe", "CategoryName": "Books", "Sales": 1200 }, - { country: "Fiji", "continent": "Oceania", "CategoryName": "Books", "Sales": 618.0 }, -]; - -module mapcomponenet { - $(function () { - var mapsample = new ej.datavisualization.Map($("#map"), { - enableAnimation: true, - navigationControl: { - enableNavigation: true, - orientation: 'vertical', - absolutePosition: { x: 5, y: 15 }, - dockPosition: 'none' - }, - layers: [ - { - layerType: 'geometry', - enableMouseHover: false, - enableSelection: false, - shapeSettings: { - fill: "#626171", - autoFill: false, - highlightStroke: "white", - stroke: "white", - strokeThickness: 0.5, - highlightColor: "#BFBFBF" - }, - shapeData: world_map, - legendSettings: { dockOnMap: false } - } - ] - }); - }); -} - - - - - - - -module MenuComponent { - $(function () { - var sample = new ej.Menu($("#syncfusionProducts"),{ - width: "100%", - animationType: ej.AnimationType.Default, - cssClass: 'gradient-lime ', - enableAnimation: true, - enableSeparator: true, - height: 40, - htmlAttributes: { "aria-label": "menu" }, - menuType: "normalmenu", - orientation: ej.Orientation.Horizontal, - showRootLevelArrows: true, - showSubLevelArrows: true, - subMenuDirection: ej.Direction.Right, - titleText: "Menu", - - }); - }); - -} - - - - - - - - -module NavigationDrawerComponent { - $(function () { - var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { - targetId: "butdrawer", - contentId: "content_container", - type: "overlay", - direction: "left", - enableListView: true, - listViewSettings: { - width: 300, - selectedItemIndex: 0 - }, - position: "normal" - }); - $("#navpane_listview").click(function(e: any) { - var text=e.target["text"]||$(e.target).closest("li.e-list").text(); - $("#butdrawer").parent().children("h2").text(text); - }); - }); -} - - - -module PDFViewerComponent { - $(function () { - var pdfviewerControl = new ej.PdfViewer($("#pdfviewer"), { - serviceUrl:(window).baseurl+ "api/PdfViewer", - isResponsive: true - }); - }); -} - - - -module PivotChartOlap { - $(function () { - var sample = new ej.PivotChart($("#PivotChart"),{ - dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - } - ], - axis: "columns" - } - ], - filters:[] - }, - isResponsive: true,zooming:{enableScrollbar: true}, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, - primaryYAxis: { title: { text: "Internet Sales Amount" } }, - legend: { visible: true, rowCount: 2 } - }); - }); -} - - - -var pivot_dataset = [ - { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, - { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, - { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, - { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, - { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, - { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, - { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, - { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, - { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, - { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, - { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, - { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, - { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, - { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, - { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, - { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, - { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, - { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, - { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, - { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, - { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, - { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, - { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, - { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } -] - -module PivotChartRelational { - - $(function () { - var sample = new ej.PivotChart($("#PivotChart"),{ - dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - }, - { - fieldName: "Date", - fieldCaption: "Date" - } - ], - columns: [ - { - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - } - ], - filters:[] - }, - isResponsive: true,zooming:{enableScrollbar: true}, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryYAxis: { title: { text: "Amount" } }, - legend: { visible: true } - }); - }); -} - - - -module PivotGaugeOlap { - - $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"),{ - dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]", - filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } - }, - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - }, - { - fieldName: "[Measures].[Internet Revenue Status]" - }, - { - fieldName: "[Measures].[Internet Revenue Trend]" - }, - { - fieldName: "[Measures].[Internet Revenue Goal]" - }, - ], - axis: "columns" - } - ], - filters:[] - }, - enableTooltip: true, isResponsive: true, - labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, - border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, - pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 - }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], - ticks: [{ - type: "major", - distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], - labels: [{ - color: "#8c8c8c" - }], - ranges: [{ - distanceFromScale: -5, - backgroundColor: "#fc0606", - border: { color: "#fc0606" } - }, - { - distanceFromScale: -5 - }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] - }] - }); - }); -} - - - -var pivot_dataset = [ - { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, - { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, - { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, - { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, - { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, - { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, - { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, - { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, - { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, - { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, - { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, - { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, - { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, - { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, - { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, - { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, - { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, - { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, - { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, - { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, - { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, - { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, - { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, - { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } -] - -module PivotGaugeRelational { - $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"),{ - dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - }, - { - fieldName: "State", - } - ], - columns: [ - { - fieldName: "Product", - } - ], - values: [ - { - fieldName: "Amount", - }, - { - fieldName: "Quantity", - } - ] - }, - enableTooltip: true, isResponsive: true, - labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, - border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, - pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 - }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], - ticks: [{ - type: "major", - distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], - labels: [{ - color: "#8c8c8c" - }], - ranges: [{ - distanceFromScale: -5, - backgroundColor: "#fc0606", - border: { color: "#fc0606" } - }, - { - distanceFromScale: -5 - }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] - }] - }); - }); -} - - - -module PivotGridOlap { - - $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"),{ - dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]", - } - ], - axis: "columns" - } - ], - filters:[] - }, - enableGroupingBar: true, - pivotTableFieldListID:"PivotSchemaDesigner" - }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); - }); -} - - - -var pivot_dataset = [ - { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, - { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, - { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, - { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, - { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, - { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, - { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, - { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, - { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, - { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, - { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, - { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, - { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, - { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, - { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, - { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, - { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, - { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, - { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, - { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, - { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, - { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, - { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, - { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } -] - -module PivotGridRelational { - $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"),{ - dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - } - ], - columns: - [{ - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - }, - { - fieldName: "Quantity", - fieldCaption: "Quantity" - } - ], - filters:[] - }, - enableGroupingBar: true, - pivotTableFieldListID:"PivotSchemaDesigner" - }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); - - }); -} - - - -module PivotTreeMap { - $(function () { - var sample = new ej.PivotTreeMap($("#PivotTreeMap"),{ - dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - columns: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Customer Count]", - } - ], - axis: "columns" - } - ], - filters:[] - } - }); - }); -} - - - -module ProgressBarComponent { - $(function () { - var sample = new ej.ProgressBar($("#progressBar"),{ - width: 200, - value: 45, - height: 20, - enablePersistence: true, - maxValue: 200, - minValue: 0, - showRoundedCorner: true, - text: 'loading...' - }); - }); - -} - - - - -declare var rteObj: any; -declare var data: any; -var radialEle = $('#defaultradialmenu'), action = 0, forRedo = 0; -var rteEle = $("#rteSample1"); -module RadialMenuComponent { - $(function () { - - if (!(ej.browserInfo().name == "msie" && parseInt(ej.browserInfo().version) < 9)) { - var radialmenuInstance = new ej.RadialMenu($("#defaultradialmenu"), { - imageClass: "imageclass", - backImageClass: "backimageclass", - targetElementId: "radialtarget1" - }); - $("#radialtarget1").parent().css("position", "relative"); - } - else { - $("#contentDiv").html("Radial Menu is only supported from Internet Explorer Versioned 9 and above.").css({ "font-size": "20px", "color": "red" }); - } - var rteInstance = new ej.RTE($("#rteSample1"), { - width: "100%", - minWidth: "10px", - change: (e) => { radialEle.ejRadialMenu("enableItem", "Undo"); }, - select: (e) => { - var target = $("#radialtarget1"), radialRadius = 150, radialDiameter = 2 * radialRadius, - // To get Iframe positions - iframeY = e.event.clientY, iframeX = e.event.clientX, - // To set Radial Menu position within target - x = iframeX > target.width() - radialRadius ? target.width() - radialDiameter : (iframeX > radialRadius ? iframeX - radialRadius : 0), - y = iframeY > target.height() - radialRadius ? target.height() - radialDiameter : (iframeY > radialRadius ? iframeY - radialRadius : 0); - radialEle.ejRadialMenu("setPosition", x, y); - radialEle.focus(); - $('iframe').contents().find('body').blur(); - }, - showToolbar: false, - showContextMenu: false - }); - $(window).resize(function () { - if (ej.isMobile() && ej.isPortrait()) - $('#defaultradialmenu').css({ "left": 25 }); - }); - }); -} - - -function bold(e: any) { - - rteObj = rteEle.data("ejRTE"); - rteObj.executeCommand("bold"); - data = rteObj._getSelectedHtmlString() ? true : false; - if (data) action += 1; - forRedo = action; - radialEle.focus(); -} -function italic(e: any) { - rteObj = rteEle.data("ejRTE"); - rteObj.executeCommand("italic"); - data = rteObj._getSelectedHtmlString() ? true : false; - if (data) action += 1; - forRedo = action; - radialEle.focus(); -} -function undo(e: any) { - rteObj = rteEle.data("ejRTE"); - rteObj.executeCommand("undo"); - action -= 1; - if (action == 0) - radialEle.ejRadialMenu("disableItem", "Undo"); - radialEle.ejRadialMenu("enableItem", "Redo"); - radialEle.focus(); -} -function redo(e: any) { - rteObj = rteEle.data("ejRTE"); - rteObj.executeCommand("redo"); - action += 1; - if (forRedo == action) radialEle.ejRadialMenu("disableItem", "Redo"); - radialEle.ejRadialMenu("enableItem", "Undo"); - radialEle.focus(); -} - - - - -module RadialSliderComponent { - $(function () { - var radialsliderInstance = new ej.RadialSlider($("#radialSlider"), { - innerCircleImageUrl: "../images/radialslider/chevron-right.png" - }); - }); -} - - -module rangecomponent { - $(function () { - var linearsample = new ej.datavisualization.RangeNavigator($("#RangeNavigator"), { - enableDeferredUpdate: true, - padding: "15", - allowSnapping: true, - selectedRangeSettings: { - start: "2010/5/1", end: "2011/10/1" - }, - isResponsive: true, - tooltipSettings: { - visible: true, labelFormat: "MM/dd/yyyy", backgroundColor: "gray", tooltipDisplayMode: "ondemand" - }, - load: () => { - var rn = $("#RangeNavigator").data("ejRangeNavigator"); - rn.model.series = [ - { - type: 'line', - dataSource: data.Open, xName: "XValue", yName: "YValue", - fill: '#69D2E7' - } - ]; - } - - }); - }); -} -var data; -data = GetData(); - -function GetData() { - var series1:any[]=[]; - var series2:any[]= []; - var value = 100; - var value1 = 120; - for (var i = 1; i < 730; i++) { - - if (Math.random() > .5) { - value += Math.random(); - value1 += Math.random(); - } else { - value -= Math.random(); - value1 -= Math.random(); - } - var point1 = { XValue: new Date(2010, 0, i), YValue: value }; - var point2 = { XValue: new Date(2010, 0, i), YValue: value1 }; - series1.push(point1); - series2.push(point2); - } - - data = { Open: series1, Close: series2 }; - return data; -}; - - - -module RatingComponent { - $(function () { - - var sample1 = new ej.Rating($("#fullRating"),{ - value: 4, - precision: ej.Rating.Precision.Full, - allowReset: true, - cssClass: "gradient-lime", - enabled: true, - enablePersistence: true, - incrementStep: 2, - maxValue: 10, - minValue: 0, - orientation: ej.Orientation.Horizontal, - shapeHeight: 25, - shapeWidth: 25, - showTooltip: true - }); - - var sample2 = new ej.Rating($("#halfRating"),{ - precision: ej.Rating.Precision.Half, - value: 3.5, - allowReset: true, - cssClass: "gradient-lime", - enabled: true, - enablePersistence: true, - incrementStep: 2, - maxValue: 10, - minValue: 0, - orientation: "horizontal", - shapeHeight: 25, - shapeWidth: 25, - showTooltip: true - }); - - var sample3 = new ej.Rating($("#exactRating"),{ - precision: ej.Rating.Precision.Exact, - value: 3.7, - allowReset: true, - cssClass: "gradient-lime", - enabled: true, - enablePersistence: true, - incrementStep: 2, - maxValue: 10, - minValue: 0, - orientation: "horizontal", - shapeHeight: 25, - shapeWidth: 25, - showTooltip: true - }); - }); - -} - - - -module ReportViewerComponent { - $(function () { - var report = new ej.ReportViewer($("#territoryReportViewer"), { - reportServiceUrl: (window).baseurl + 'api/ReportViewer', - reportServerUrl: 'http://mvc.syncfusion.com/reportserver', - processingMode: ej.ReportViewer.ProcessingMode.Remote, - reportPath: "/SSRSSamples2/Territory Sales new", - isResponsive: true - }); - }); -} - - - -var fontfamily = ["Segoe UI", "Arial", "Times New Roman", "Tahoma", "Helvetica"], fontsize = ["1pt", "2pt", "3pt", "4pt", "5pt"], action1 = ["New", "Clear"], action2 = ["Bold", "Italic", "Underline", "strikethrough", "superscript", "subscript", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyFull", "Undo", "Redo"]; -module RibbonComponent { - $(function () { - var sample = new ej.Ribbon($("#defaultRibbon"), { - width: "100%", - expandPinSettings: { - toolTip: "Collapse the Ribbon" - }, - collapsePinSettings: { - toolTip: "Pin the Ribbon" - }, - applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } - }, - tabs: [{ - id: "home", text: "HOME", groups: [{ - text: "New", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "new", - text: "New", - toolTip: "New", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-new" - } - } - ], - defaults: { - type: "button", - width: 60, - height: 70 - } - }] - }, - { - text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{ - groups: [{ - id: "paste", - text: "paste", - toolTip: "Paste", - splitButtonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-ribbonpaste", - targetID: "pasteSplit", - buttonMode: "dropdown", - arrowPosition: ej.ArrowPosition.Bottom - } - } - ], - defaults: { - type: "splitbutton", - width: 50, - height: 70 - } - }, - { - groups: [{ - id: "cut", - text: "Cut", - toolTip: "Cut", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - prefixIcon: "e-icon e-ribbon e-ribboncut" - } - }, - { - id: "copy", - text: "Copy", - toolTip: "Copy", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - prefixIcon: "e-icon e-ribbon e-ribboncopy" - } - }, - { - id: "clear", - text: "Clear", - toolTip: "Clear All", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - prefixIcon: "e-icon e-ribbon clearAll" - } - }], - defaults: { - type: "button", - width: 60, - isBig: false - } - }] - }, - { - text: "Font", alignType: "rows", content: [{ - groups: [{ - id: "fontfamily", - toolTip: "Font", - dropdownSettings: { - dataSource: fontfamily, - text: "Segoe UI", - width: 150 - } - }, - { - id: "fontsize", - toolTip: "FontSize", - dropdownSettings: { - dataSource: fontsize, - text: "1pt", - width: 65 - } - }], - defaults: { - type: "dropdownlist", - height: 28 - } - }, - { - groups: [{ - id: "bold", - toolTip: "Bold", - type: ej.Ribbon.Type.ToggleButton, - toggleButtonSettings: { - contentType: ej.ContentType.ImageOnly, - defaultText: "Bold", - activeText: "Bold", - defaultPrefixIcon: "e-icon e-ribbon bold", - activePrefixIcon: "e-icon e-ribbon bold" - } - }, - { - id: "italic", - toolTip: "Italic", - type: ej.Ribbon.Type.ToggleButton, - toggleButtonSettings: { - contentType: ej.ContentType.ImageOnly, - defaultText: "Italic", - activeText: "Italic", - defaultPrefixIcon: "e-icon e-ribbon e-ribbonitalic", - activePrefixIcon: "e-icon e-ribbon e-ribbonitalic" - } - }, - { - id: "underline", - text: "Underline", - toolTip: "Underline", - type: ej.Ribbon.Type.ToggleButton, - toggleButtonSettings: { - contentType: ej.ContentType.ImageOnly, - defaultText: "Underline", - activeText: "Underline", - defaultPrefixIcon: "e-icon e-ribbon e-ribbonunderline", - activePrefixIcon: "e-icon e-ribbon e-ribbonunderline" - } - }, - { - id: "strikethrough", - text: "strikethrough", - toolTip: "Strikethrough", - type: ej.Ribbon.Type.ToggleButton, - toggleButtonSettings: { - contentType: ej.ContentType.ImageOnly, - defaultText: "Strikethrough", - activeText: "Strikethrough", - defaultPrefixIcon: "e-icon e-ribbon strikethrough", - activePrefixIcon: "e-icon e-ribbon strikethrough" - } - }, - { - id: "superscript", - text: "superscript", - toolTip: "Superscript", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-superscripticon" - } - }, - { - id: "subscript", - text: "subscript", - toolTip: "Subscript", - enableSeparator: true, - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-subscripticon" - } - }, - { - id: "fontcolor", - text: "Font Color", - toolTip: "Font Color", - type: ej.Ribbon.Type.Custom, - contentID: "fontcolor" - }, - { - id: "fillcolor", - text: "Fill Color", - toolTip: "Fill Color", - type: ej.Ribbon.Type.Custom, - contentID: "fillcolor" - } - ], - defaults: { - isBig: false - } - }] - }, - { - text: "Alignment", alignType: ej.Ribbon.AlignType.Rows, content: [ - { - groups: [{ - id: "bullet", - text: "Bullet Format", - toolTip: "Bullets", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-bullet" - } - }, - { - id: "number", - text: "Number Format", - toolTip: "Numbering", - enableSeparator: true, - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-numbericon" - } - }, - { - id: "textindent", - text: "Indent", - toolTip: "Text Indent", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-indent" - } - }, - { - id: "textoudent", - text: "Outdent", - toolTip: "Text Outdent", - enableSeparator: true, - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-outdent" - } - }, - { - id: "sortascending", - text: "Sort", - toolTip: "Sort", - enableSeparator: true, - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-sort" - } - }, - { - id: "border", - text: "Border", - toolTip: "Border", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-border" - } - }], - defaults: { - type: "button", - isBig: false - } - }, - { - groups: [{ - id: "alignleft", - text: "JustifyLeft", - toolTip: "Align Left", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon alignleft" - } - }, - { - id: "aligncenter", - text: "JustifyCenter", - toolTip: "Align Center", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon aligncenter" - } - }, - { - id: "alignright", - text: "JustifyRight", - toolTip: "Align Right", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon alignright" - } - }, - { - id: "justify", - text: "JustifyFull", - toolTip: "Justify", - enableSeparator: true, - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon justify" - } - }, - { - id: "uppercase", - text: "Upper Case", - toolTip: "Upper Case", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-uppercase" - } - }, - { - id: "lowercase", - text: "Lower Case", - toolTip: "Lower Case", - buttonSettings: { - contentType: ej.ContentType.ImageOnly, - prefixIcon: "e-icon e-ribbon e-lowercase" - } - }], - defaults: { - type: "button", - isBig: false - } - }] - }, - { - text: "Actions", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "undo", - text: "Undo", - toolTip: "Undo", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-undo" - } - }, - { - id: "redo", - text: "Redo", - toolTip: "Redo", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-redo" - } - } - ], - defaults: { - type: "button", - width: 40, - height: 70 - } - }] - }, - { - text: "View", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "zoomin", - text: "Zoom In", - toolTip: "Zoom In", - buttonSettings: { - width: 58, - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-zoomin" - } - }, - { - id: "zoomout", - text: "Zoom Out", - toolTip: "Zoom Out", - buttonSettings: { - width: 70, - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-zoomout" - } - }, - { - id: "fullscreen", - text: "Full Screen", - toolTip: "Full Screen", - buttonSettings: { - width: 73, - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-fullscreen" - } - } - ], - defaults: { - type: "button", - height: 70 - } - }] - }] - },{ - id: "insert", text: "INSERT", groups: [{ - text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{ - groups: [{ - id: "tables", - text: "Tables", - toolTip: "Tables", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-table" - } - } - ], - defaults: { - type: "button", - width: 50, - height: 70 - } - }] - }, - { - text: "Illustrations", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "pictures", - text: "Pictures", - toolTip: "Pictures", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-picture" - } - }, - { - id: "videos", - text: "Videos", - toolTip: "Videos", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-video" - } - }, - { - id: "shapes", - text: "Shapes", - toolTip: "Shapes", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-shape" - } - }, - { - id: "charts", - text: "Charts", - toolTip: "Charts", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-chart" - } - } - ], - defaults: { - type: "button", - width: 56, - height: 70 - } - }] - }, - { - text: "Comments", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "comments", - text: "Comments", - toolTip: "Comments", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-comment" - } - } - ], - defaults: { - type: "button", - width: 70, - height: 70 - } - }] - }, - { - text: "Text", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "text", - text: "Text", - toolTip: "Text", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-text", - width: 50 - } - }, - { - id: "datetime", - text: "Date Time", - toolTip: "DateTime", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-datetimenew" - } - } - ], - defaults: { - type: "button", - width: 70, - height: 70 - } - }] - }, - { - text: "Hyperlink", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "hyperlink", - text: "Hyperlink", - toolTip: "Hyperlink", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-hyperlink" - } - } - ], - defaults: { - type: "button", - width: 70, - height: 70 - } - }] - }, - { - text: "Equation", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "equation", - text: "Equation", - toolTip: "Equation", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-equation" - } - } - ], - defaults: { - type: "button", - width: 60, - height: 70 - } - }] - }, - { - text: "Print Layout", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "printlayout", - text: "Print Layout", - toolTip: "Print Layout", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-printlayout" - } - } - ], - defaults: { - type: "button", - width: 80, - height: 70 - } - }] - }, - { - text: "Save", alignType: ej.Ribbon.AlignType.Rows, content: [{ - groups: [{ - id: "print", - text: "Print", - toolTip: "Print", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-print" - } - }, - { - id: "save", - text: "Save", - toolTip: "Save", - buttonSettings: { - contentType: ej.ContentType.TextAndImage, - imagePosition: ej.ImagePosition.ImageTop, - prefixIcon: "e-icon e-ribbon e-save" - } - } - ], - defaults: { - type: "button", - width: 50, - height: 70 - } - }] - } - ] - } - ], - create: function createControl(args) { - var ribbon = $("#defaultRibbon").data("ejRibbon"); - $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); - $("#fillcolor").ejColorPicker({ value: "#FF0000", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fillcoloricon", select: colorHandler }); - } - }); - }); -} -function colorHandler(args:any) { - (this._id.indexOf("fillcolor") != -1) ? $("#contenteditor").css('background-color', args.value) : document.execCommand('forecolor', false, args.value); -} - - - - - - -module RotatorComponent { - $(function () { - var rotatorInstance = new ej.Rotator($("#sliderContent"), { - slideWidth: "100%", - frameSpace: "0px", - slideHeight: "auto", - displayItemsCount: "1", - navigateSteps: "1", - pagerPosition:"outside", - orientation: "horizontal", - showPager: true, - enabled: true, - showCaption: true, - allowKeyboardNavigation: true, - showPlayButton: true, - isResponsive:true, - animationType: "slide", - }); - }); -} - - - -module RTEComponent { - $(function () { - var sample = new ej.RTE($("#rteSample"),{ - width: "100%", - minWidth: "150px", - showFooter: true, - showHtmlSource: true, - allowEditing: true, - allowKeyboardNavigation: true, - autoFocus: true, - autoHeight: true, - colorPaletteColumns: 10, - colorPaletteRows: 5, - cssClass: 'gradient-lime', - enableResize: true, - enableTabKeyNavigation: true, - fileBrowser: { - filePath: (window).baseurl + "Content/FileBrowser/", - extensionAllow: "*.png, *.doc, *.pdf, *.txt, *.docx", - ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" - }, - imageBrowser: { - filePath: (window).baseurl + "Content/FileBrowser/", - extensionAllow: "*.png, *.gif, *.jpg, *.jpeg, *.docx", - ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" - }, - isResponsive: true, - showClearAll: true, - showClearFormat: true, - showDimensions: true, - showCharCount: true, - tools: { - formatStyle: ["format"], - edit: ["findAndReplace"], - font: ["fontName", "fontSize", "fontColor", "backgroundColor"], - style: ["bold", "italic", "underline", "strikethrough"], - alignment: ["justifyLeft", "justifyCenter", "justifyRight", "justifyFull"], - lists: ["unorderedList", "orderedList"], - clipboard: ["cut", "copy", "paste"], - doAction: ["undo", "redo"], - indenting: ["outdent", "indent"], - clear: ["clearFormat", "clearAll"], - links: ["createLink", "removeLink"], - images: ["image"], - media: ["video"], - tables: ["createTable", "addRowAbove", "addRowBelow", "addColumnLeft", "addColumnRight", "deleteRow", "deleteColumn", "deleteTable"], - effects: ["superscript", "subscript"], - casing: ["upperCase", "lowerCase"], - view: ["fullScreen", "zoomIn", "zoomOut"], - print: ["print"], - customUnorderedList: [{ - name: "unOrderInsert", - tooltip: "Custom UnOrderList", - css: "e-rte-toolbar-icon e-rte-unlistitems customUnOrder", - text: "Smiley", - listImage: "url('../content/images/rte/Smiley-GIF.gif')" - }], - customOrderedList: [{ - name: "orderInsert", - tooltip: "Custom OrderList", - css: "e-rte-toolbar-icon e-rte-listitems customOrder", - text: "Lower-Greek", - listStyle: "lower-greek" - }] - } - }); - }); - -} - - - -module ScheduleComponent { - $(function () { - var sample = new ej.Schedule($("#Schedule1"), { - width: "100%", - height: "525px", - currentDate: new Date(2014, 4, 5), - timeScale: { - minorSlotCount: 4, - majorSlot: 60 - }, - contextMenuSettings: { - enable: true, - menuItems: { - appointment: [ - { id: "open", text: "Open Appointment" }, - { id: "delete", text: "Delete Appointment" }, - { id: "customMenu3", text: "Menu Item 3" }, - { id: "customMenu4", text: "Menu Item 4" } - ], - cells: [ - { id: "new", text: "New Appointment" }, - { id: "recurrence", text: "New Recurring Appointment" }, - { id: "today", text: "Today" }, - { id: "gotodate", text: "Go to date" }, - { id: "settings", text: "Settings" }, - { id: "view", text: "View", parentId: "settings" }, - { id: "timemode", text: "TimeMode", parentId: "settings" }, - { id: "view_Day", text: "Day", parentId: "view" }, - { id: "view_Week", text: "Week", parentId: "view" }, - { id: "view_Workweek", text: "Workweek", parentId: "view" }, - { id: "view_Month", text: "Month", parentId: "view" }, - { id: "timemode_Hour12", text: "12 Hours", parentId: "timemode" }, - { id: "timemode_Hour24", text: "24 Hours", parentId: "timemode" }, - { id: "workhours", text: "Work Hours", parentId: "settings" }, - { id: "customMenu1", text: "Menu Item 1" }, - { id: "customMenu2", text: "Menu Item 2" } - ] - } - }, - resources: [{ - field: "ownerId", - title: "Owner", - name: "Owners", allowMultiple: true, - resourceSettings: { - dataSource: [ - { text: "Nancy", id: 1, groupId: 1, color: "#f8a398" }, - { text: "Steven", id: 3, groupId: 2, color: "#56ca85" }, - { text: "Michael", id: 5, groupId: 1, color: "#51a0ed" } - ], - text: "text", id: "id", groupId: "groupId", color: "color" - } - }], - appointmentSettings: { - dataSource: new ej.DataManager((window).Default).executeLocal(new ej.Query().take(10)), - id: "Id", - subject: "Subject", - startTime: "StartTime", - endTime: "EndTime", - description: "Description", - allDay: "AllDay", - recurrence: "Recurrence", - recurrenceRule: "RecurrenceRule", - resourceFields: "ownerId" - } - }); - }); -} - - - -module ScrollerComponent { - $(function () { - var scrollerSample = new ej.Scroller($("#scrollcontent"), { - height: "300px", - width: "100%" - }); - $(window).bind('resize', function () { - scrollerSample.refresh(); - }); - }); -} - - - -module SignatureComponent { - $(function () { - var basicSignature = new ej.Signature($("#signature"), { - height: "400px", - isResponsive: true, - strokeWidth: 3 - }); - }); -} - - - - -module SliderComponent { - $(function () { - var slider = new ej.Slider($("#minSlider"), { - sliderType: "MinRange", - height: "16px", - width: "300px", - value: 60, - minValue: 0, - maxValue: 100 - }); - var rangeslider = new ej.Slider($("#rangeSlider"), { - sliderType: "Range", - height: "16px", - width: "300px", - values: [30, 60], - minValue: 0 - }); - - }); -} - - - - - - -module linesparkline { - $(function () { - - var sparklinesample = new ej.Sparkline($("#line"), { - dataSource: [12, 14, 11, 12, 11, 15, 12, 10, 11, 12, 15, 13, 12, 11, 10, 13, 15, 12, 14, 16, 14, 12, 11], - tooltip: { - visible: true, - font: { size:"12px" } - }, - type: "line", - size: { height: "40", width:"170" }, - }); - }); -} - -module columnsparkline { - $(function () { - var sparkcolumnsample = new ej.Sparkline($("#column"), { - dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10,], - negativePointColor: "red", - highPointColor: "blue", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - type: "column", - size: { height: "100", width: "150" }, - }); - }); -} - -module areasparkline { - $(function () { - var sparkareasample = new ej.Sparkline($("#area"), { - dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10,], - markerSettings: { visible: true }, - highPointColor: "blue", - lowPointColor: "orange", - type: "area", - opacity: 0.5, - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "100", width: "150" }, - }); - }); -} - -module windlosssparkline { - $(function () { - var sparkwinlosssample = new ej.Sparkline($("#winloss"), { - dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10,], - type: "winloss", - size: { height: "100", width: "150" }, - }); - }); -} - -module piesparkline1 { - $(function () { - var sparkpiesample1 = new ej.Sparkline($("#pie1"), { - dataSource: [4, 6, 7], - type: "pie", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "40", width: "40" }, - }); - }); -} - -module piesparkline2 { - $(function () { - var sparkpiesample2 = new ej.Sparkline($("#pie2"), { - dataSource: [8, 9, 1,], - type: "pie", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "40", width: "40" }, - }); - }); -} - -module piesparkline3 { - $(function () { - var sparkpiesample3 = new ej.Sparkline($("#pie3"), { - dataSource: [2, 3, 5], - type: "pie", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "40", width: "40" }, - }); - }); -} - -module piesparkline4 { - $(function () { - var sparkpiesample4 = new ej.Sparkline($("#pie4"), { - dataSource: [10, 12, 11], - type: "pie", - tooltip: { - visible: true, - font: { - size: "12px", - } - }, - size: { height: "40", width: "40" }, - }); - }); -} - - - - - - -module SplitterComponent { - $(function () { - var splitterInstance = new ej.Splitter($("#outterSpliter"), { - height: "250px", - width: "50%", - orientation: ej.Orientation.Vertical, - properties: [{}, { paneSize: 80 }], - isResponsive:true - }); - var splitterInstance1 = new ej.Splitter($("#innerSpliter"), { - isResponsive:true, - }); - }); -} - - - -module SpreadsheetComponent { -$(function () { - var sample = new ej.Spreadsheet($("#basicSpreadsheet"), { - scrollSettings: { - height: 550, - }, - importSettings: { - importMapper: (window).baseurl + "api/Spreadsheet/Import" - }, - exportSettings: { - excelUrl: (window).baseurl + "api/Spreadsheet/ExcelExport", - csvUrl: (window).baseurl + "api/Spreadsheet/CsvExport", - pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" - }, - sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { - var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; - if (!(spreadsheet).isImport) { - spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); - xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); - xlFormat.format({ "type": "currency" }, "E2:H11"); - spreadsheet.XLRibbon.updateRibbonIcons(); - }} - }); - }); -} - - - - -var default_data: Array = [ - { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup:"Executive", EmployeesCount : 50 }, - { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, - { Category : "Employees", Country : "USA", JobDescription : "Marketing", EmployeesCount : 40 }, - { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 55 }, - { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 175}, - { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, - { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, - { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, - - { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, - { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, - { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, - { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, - { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, - - { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, - { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, - { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, - { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, - { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, - { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, - { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, - { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, - - { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, - { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, - { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, - { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, - { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, - - { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, - { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, - { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, - { Category : "Employees", Country : "France", JobDescription: "Marketing", EmployeesCount: 50 } -]; - -module sunburstcomponent { - $(function () { - var sunburstsample = new ej.SunburstChart($("#Sunburst"), { - valueMemberPath: "EmployeesCount", - levels: [ - {groupMemberPath: "Country"}, - {groupMemberPath: "JobDescription"}, - {groupMemberPath: "JobGroup"}, - {groupMemberPath: "JobRole"} - ], - dataSource: default_data, - dataLabelSettings:{visible:true}, - tooltip:{visible:false}, - enableAnimation:false, - size:{height:"600"}, - innerRadius:0.2, - title:{text:"Employees Count"}, - zoomSettings:{enable:false}, - legend:{visible:true,position:'top'} - }); - }); -} - - - - -module TabComponent { - $(function () { - var sample = new ej.Tab($("#defaultTab"),{ - width: "500px", - collapsible: true, - events: "click", - heightAdjustMode: ej.Tab.HeightAdjustMode.Content, - showCloseButton: true, - showRoundedCorner: false - }); - }); -} - - - -module TagCloudComponent { - - - var websiteCollection = [ - { text: "Google", url: "http://www.google.com", frequency: 12 }, - { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, - { text: "Arts Technica", url: "http://arstechnica.com/", frequency: 8 }, - { text: "Business Week", url: "http://www.businessweek.com/", frequency: 2 }, - { text: "Yahoo", url: "http://in.yahoo.com/", frequency: 12 }, - { text: "Center Networks", url: "http://www.centernetworks.com/", frequency: 5 }, - { text: "Crave", url: "http://news.cnet.com/crave/", frequency: 8 }, - { text: "Crunch Gear", url: "http://techcrunch.com/gadgets/", frequency: 20 }, - { text: "Daily Tech", url: "http://www.dailytech.com/", frequency: 1 }, - { text: "Electronista", url: "http://www.electronista.com/", frequency: 3 }, - { text: "Engadget", url: "http://www.engadget.com/", frequency: 5 }, - { text: "Gearlog", url: "http://www.gearlog.com/", frequency: 9 }, - { text: "Information Week", url: "http://www.informationweek.com/", frequency: 0 }, - { text: "PCWorld", url: "http://www.pcworld.com/", frequency: 11 }, - { text: "Tech Republic", url: "http://techrepublic.com/", frequency: 3 }, - { text: "Valleywag", url: "http://valleywag.gawker.com/", frequency: 6 }, - { text: "Rediff", url: "http://in.rediff.com/", frequency: 9 }, - { text: "WebProNews", url: "http://www.webpronews.com/", frequency: 2 } - ]; - - $(function () { - var sample = new ej.TagCloud($("#techWebList"), { - titleText: "Tech Sites", - dataSource: websiteCollection, - cssClass: "gradient-lime", - fields: { - text: "text", url: "url", frequency: "frequency" - } - }); - - }); -} - - - -module EditorComponent { - $(function () { - var num = new ej.NumericTextbox($("#numeric"), { - value: 30, - minValue: 1, - maxValue: 100, - name: "numeric", - width: "100%" - }); - var per = new ej.PercentageTextbox($("#percent"), { - value: 60, - minValue: 10, - maxValue: 1000, - name: "percent", - width: "100%" - }); - var cur = new ej.CurrencyTextbox($("#currency"), { - value: 100, - minValue: 10, - maxValue: 1000, - name: "currency", - width: "100%" - }); - var mask = new ej.MaskEdit($("#maskedit"), { - name: "mask", - value: "4242422424", - maskFormat: "99 999-99999", - width: "100%" - }) - }); -} - - - - - -module TileViewComponent { - $(function () { - var tile1 = new ej.Tile($("#tile1"), { - imagePosition:"fill", - caption:{text:"People"}, - tileSize:"medium", - imageUrl:'content/images/tile/windows/people_1.png' - }); - var tile2 = new ej.Tile($("#tile2"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/alerts.png', - - }); - var tile3 = new ej.Tile($("#tile3"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/bing.png', - }); - var tile4 = new ej.Tile($("#tile4"), { - tileSize:"small", - imageUrl:'content/images/tile/windows/camera.png', - }); - var tile5 = new ej.Tile($("#tile5"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/messages.png', - }); - var tile6 = new ej.Tile($("#tile6"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/games.png', - caption:{text:"Play"} - }); - var tile7 = new ej.Tile($("#tile7"), { - tileSize:"medium", - imageUrl:'content/images/tile/windows/map.png', - caption:{text:"Maps"} - }); - var tile8 = new ej.Tile($("#tile8"), { - imagePosition:"fill", - tileSize:"wide", - imageUrl:'content/images/tile/windows/sports.png', - caption:{text:"Sports"} - }); - var tile9 = new ej.Tile($("#tile9"), { - imagePosition:"fill", - tileSize:"medium", - imageUrl:'content/images/tile/windows/people_2.png', - caption:{text:"People"} - }); - var tile10 = new ej.Tile($("#tile10"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/pictures.png', - caption:{text:"Photo"} - }); - var tile11 = new ej.Tile($("#tile11"), { - imagePosition:"center", - tileSize:"wide", - imageUrl:'content/images/tile/windows/weather.png', - caption:{text:"Weather"} - }); - var tile12 = new ej.Tile($("#tile12"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/music.png', - caption:{text:"Music"} - }); - var tile13 = new ej.Tile($("#tile13"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/favs.png', - caption:{text:"Favorites"} - }); - }); -} - - - -module TimePickerComponent { - $(function () { - var timeSample = new ej.TimePicker($("#timepick"), { - width: "100%" - }); - }); -} - - - - -module ToolbarComponent { - - $(function () { - var sample = new ej.Toolbar($("#editingToolbar"),{ - width: "100%", - cssClass: "gradient-lime", - enableSeparator: true, - height: 30, - isResponsive: true, - orientation: ej.Orientation.Horizontal, - showRoundedCorner: true - }); - }); - -} - - - - -module TooltipComponent { - - $(function () { - - var sample1 = new ej.Tooltip($("#link1"),{ - content: "ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.", - associate: "mousefollow", - autoCloseTimeout: 5000, - collision: "fit", - containment: ".frame", - showRoundedCorner: true, - showShadow: true - }); - - var sample2 = new ej.Tooltip($("#link2"),{ - content: "The World Wide Web (WWW) is an information space where documents and other web resources are identified by URLs, interlinked by hypertext links, and can be accessed via the Internet.", - position: { - stem: { - horizontal: "right", - vertical: "center" - }, - target: { - horizontal: "left", - vertical: "center" - } - }, - autoCloseTimeout: 5000, - collision: "fit", - containment: ".frame", - showRoundedCorner: true, - showShadow: true - }); - - var sample3 = new ej.Tooltip($("#link3"),{ - content: 'Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic.', - position: { - stem: { - horizontal: "right", - vertical: "center" - }, - target: { - horizontal: "left", - vertical: "center", - }, - }, - associate: "mousefollow", - autoCloseTimeout: 5000, - collision: "fit", - containment: ".frame", - showRoundedCorner: true, - showShadow: true - }); - }); -} - - - -module TreeGridComponent { - $(function () { - var treegridInstance = new ej.TreeGrid($("#TreeGridContainer"), { - dataSource: (window).treeGridData, - childMapping: "subtasks", - allowSorting: true, - allowMultiSorting: true, - enableAltRow: true, - allowFiltering: true, - treeColumnIndex: 1, - allowKeyboardNavigation: true, - showColumnChooser: true, - showColumnOptions: true, - contextMenuSettings: { - showContextMenu: true, - contextMenuItems: ["add", "edit", "delete"] - }, - columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], - editSettings: { - allowAdding: true, - allowEditing: true, - allowDeleting: true, - editMode: "cellEditing", - rowPosition: "belowSelectedRow" - }, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add","edit","delete","update","cancel","expandAll","collapseAll"] - }, - columns: [ - { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, - { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, - { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, - { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, - { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } - ], - isResponsive: true, - }); -}); -} - - - - -var population_data: Array = [ - { Continent: "Asia", Country: "Indonesia", Growth: 3, Population: 237641326 }, - { Continent: "Asia", Country: "Russia", Growth: 2, Population: 152518015 }, - { Continent: "Asia", Country: "Malaysia", Growth: 1, Population: 29672000 }, - { Continent: "North America", Country: "United States", Growth: 4, Population: 315645000 }, - { Continent: "North America", Country: "Mexico", Growth: 2, Population: 112336538 }, - { Continent: "North America", Country: "Canada", Growth: 1, Population: 39056064 }, - { Continent: "South America", Country: "Colombia", Growth: 1, Population: 47000000 }, - { Continent: "South America", Country: "Brazil", Growth: 3, Population: 193946886 }, - { Continent: "Africa", Country: "Nigeria", Growth: 2, Population: 170901000 }, - { Continent: "Africa", Country: "Egypt", Growth: 1, Population: 83661000 }, - { Continent: "Europe", Country: "Germany", Growth: 1, Population: 81993000 }, - { Continent: "Europe", Country: "France", Growth: 1, Population: 65605000 }, - { Continent: "Europe", Country: "UK", Growth: 1, Population: 63181775 } -]; - -module treemapcomponent { - $(function () { - var treemapsample = new ej.datavisualization.TreeMap($("#treemap"), { - leafItemSettings: { showLabels: true, labelPath: "Country" }, - rangeColorMapping: [ - { color: "#77D8D8", legendLabel: "1% Growth", from: 0, to: 1 }, - { color: "#AED960", from: 0, legendLabel: "2% Growth", to: 2 }, - { color: "#FFAF51", from: 0, legendLabel: "3% Growth", to: 3 }, - { color: "#F3D240", from: 0, legendLabel: "4% Growth", to: 4 } - ], - levels: [ - { groupPath: "Continent", groupGap: 5, headerHeight: 25, showHeader: true, headerTemplate: 'headertemplate' } - ], - dataSource: population_data, - colorValuePath: "Growth", - weightValuePath: "Population", - borderThickness: 0, - showLegend: true - }); - }); -} - - - - - -module TreeViewComponent { - $(function () { - var tree = new ej.TreeView($("#treeView"), { - allowEditing: true, - allowDragAndDrop: true, - allowDropChild: true, - allowDropSibling: true, - }); - }); -} - - - - -module UploadboxComponent { - - $(function () { - var sample = new ej.Uploadbox($("#UploadDefault"),{ - saveUrl: "uploadbox/saveFiles.ashx", - removeUrl: "uploadbox/removeFiles.ashx", - buttonText: { - browse: "Choose File", upload: "Upload", cancel: "Cancel" - }, - cssClass: "gradient- purple", - dialogAction: { - modal: false, closeOnComplete: false, drag: true - }, - extensionsAllow: ".zip", - multipleFilesSelection: true, - showFileDetails: true - }); - }); - -} - - - - -module WaitingPopupComponent { - $(function () { - var sample = new ej.WaitingPopup($("#target"),{ - showOnInit: true, - showImage: true, - text: 'waiting…', - target: "#target", - appendTo: "#waiting" - }); - }); - -} +/// +/// + + + + +module AccordionComponent { + $(function () { + var sample = new ej.Accordion($("#basicAccordion"), { + width: "100%", + allowKeyboardNavigation: true, + collapseSpeed: 500, + collapsible: true, + enableAnimation: true, + enableMultipleOpen: true, + events: "click", + expandSpeed: 500, + headerSize: "40px", + htmlAttributes: { title: "Demo" }, + selectedItemIndex: 1, + showCloseButton: true, + showRoundedCorner: true + }); + }); +} + + + +module AutocompleteComponent{ + var carList = [ + "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", + "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", + "Chevrolet Camaro", "Cadillac", + "Duesenberg J", "Dodge Sprinter", + "Elantra", "Excavator", + "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", + "GAZ Siber", + "Honda S2000", "Hyundai Santro", + "Isuzu Swift", "Infiniti Skyline", + "Jaguar XJS", + "Kia Sedona EX", "Koenigsegg Agera", + "Lotus Esprit", "Lamborghini Diablo", + "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", + "Nissan Qashqai", + "Oldsmobile S98", "Opel Superboss", + "Porsche 356", "Pontiac Sunbird", + "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", + "Triumph Spitfire", "Toyota 2000GT", + "Volvo P1800", "Volkswagen Shirako" + ]; + $(function () { + var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { + width: "100%", + watermarkText: "Select a car", + dataSource: carList, + enableAutoFill: true, + showPopupButton: true, + multiSelectMode: "delimiter" + }); + }); +} + + + + + +module Barcodecomponent { + $(function () { + var barcodesample = new ej.datavisualization.Barcode($("#Barcode"), { + text:"http://www.syncfusion.com" + }); + }); +} + + + + + +module Bulletgraphcomponent { + $(function () { + var bulletsample = new ej.datavisualization.BulletGraph($("#BulletGraph"), { + isResponsive: true, + tooltipSettings: { visible: true }, + quantitativeScaleSettings: { + featureMeasures: [{ + value: 8, comparativeMeasureValue:6.7 + }] + }, + qualitativeRanges: [{ + rangeEnd: 4.3, rangeStroke:"#ebebeb", + }, + { + rangeEnd: 7.3, rangeStroke:"#d8d8d8" + }, + { + rangeEnd: 10, rangeStroke: "#7f7f7f" + } + ], + captionSettings: { + textPosition: 'right', text: 'Revenue YTD', + subTitle: { + text: "$ in Thousands", textPosition:"right" + } + } + }); + }); +} + + + + + +module ButtonComponent { + $(function () { + var basicButton = new ej.Button($("#buttonnormal"), { + size: "large", + showRoundedCorner: true, + contentType: "textandimage", + prefixIcon: "e-icon e-save", + text: "Save" + }); + var toggleButton = new ej.ToggleButton($("#TextOnly"), { + showRoundedCorner: true, + size: "large", + contentType: "textandimage", + defaultPrefixIcon: "e-icon e-save", + activePrefixIcon: "e-icon e-delete", + defaultText: "Save", + activeText: "Delete" + }); + var splitbuttonnormal = new ej.SplitButton($("#splitbuttonnormal"), { + showRoundedCorner: true, + size: "large", + prefixIcon: "e-icon e-file-empty", + targetID: "menu1", + contentType: "textandimage", + text: "File" + }); + var groupButton = new ej.GroupButton($("#groupButton"), { + showRoundedCorner: true, + size: "large" + }); + var check1 = new ej.CheckBox($("#check1"), { + size: "medium", enableTriState: true + }); + var check2 = new ej.CheckBox($("#check2"), { + size: "medium", enableTriState: true + }); + var radio1 = new ej.RadioButton($("#radio1"), { + size: "medium" + }); + var radio2 = new ej.RadioButton($("#radio2"), { + size: "medium", checked: true + }); + }); +} + + + + +module ChartComponent { + $(function () { + var chartsample = new ej.datavisualization.Chart($("#Chart"), { + primaryXAxis: { + range: { min: 2005, max: 2011, interval: 1 }, + title: { text: "Year" }, + valueType: "category" + }, + primaryYAxis: { + range: { min: 25, max: 50, interval: 5 }, + labelFormat: "{value}%", + title: { text: "Efficiency" }, + + }, + commonSeriesOptions: + { + type: 'line', enableAnimation: true, + tooltip:{ visible :true, template:'Tooltip'}, + marker: + { + shape: 'circle', + size: + { + height: 10, width: 10 + }, + visible: true + }, + border : {width: 2} + }, + series: + [ + { + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + name: 'India' + }, + { + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + name: 'Germany' + }, + { + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + name: 'England' + }, + { + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + name: 'France' + } + ], + isResponsive: true, + load: function () { + var sender = $("#Chart").data("ejChart"); + if (!!window.orientation && sender) { //to modify chart properties for mobile view + var model = sender.model, + seriesLength = model.series.length; + model.legend.visible = false; + model.size.height = null; + model.size.width = null; + for (var i = 0; i < seriesLength; i++) { + if (!model.series[i].marker) + model.series[i].marker = {}; + if (!model.series[i].marker.size) + model.series[i].marker.size = {}; + model.series[i].marker.size.width = 6; + model.series[i].marker.size.height = 6; + } + model.primaryXAxis.labelIntersectAction = "rotate45"; + if (model.primaryXAxis.title) + model.primaryXAxis.title.text = ""; + if (model.primaryYAxis.title) + model.primaryYAxis.title.text = ""; + model.primaryXAxis.edgeLabelPlacement = "hide"; + model.primaryYAxis.labelIntersectAction = "rotate45"; + model.primaryYAxis.edgeLabelPlacement = "hide"; + } + }, + title: { text: 'Efficiency of oil-fired power production' }, + size: { height: "600" }, + legend: { visible: true} + }); + }); +} + + + + + +module circulargaugecomponent { + $(function () { + var circularsample = new ej.datavisualization.CircularGauge($("#CircularGauge"), { + enableAnimation: false, + isResponsive: true, + backgroundColor: "transparent", width: 500, + scales: [{ + showRanges: true, + startAngle: 122, sweepAngle: 296, radius: 130, showScaleBar: true, size: 1, maximum: 120, majorIntervalValue: 20, minorIntervalValue: 10, + border: { + width: 0.5, + }, + pointers: [{ + value: 60, + showBackNeedle: true, + backNeedleLength: 20, + length: 95, + width: 7 + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, { type: "minor", height: 8, width: 1, distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -30, + startValue: 0, + endValue: 70 + }, { + distanceFromScale: -30, + startValue: 70, + endValue: 110, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -30, + startValue: 110, + endValue: 120, + backgroundColor: "#f5b43f", + border: { color: "#f5b43f" } + }] + }] + }); + }); +} + + + + +module ColorPickerComponent { + $(function () { + var colorSample = new ej.ColorPicker($("#colorpick"), { + value: "#278787" + }); + }); +} + + + + +module DatePickerComponent { + $(function () { + var dateSample = new ej.DatePicker($("#datepick"), { + width: "100%" + }); + }); +} + + + + +module DateTimePickerComponent { + $(function () { + var datetimeSample = new ej.DateTimePicker($("#datetimepick"), { + width: "100%" + }); + }); +} + + + +$(function () { + var diagram = new ej.datavisualization.Diagram($("#diagram"), { + width: "1000px", + height: "600px", + pageSettings: { + //Sets page size + pageHeight: 500, + pageWidth: 500, + //Customizes the appearance of page + pageBorderWidth: 4, + pageBackgroundColor: "white", + pageBorderColor: "lightgray", + pageMargin: 25, + showPageBreak: true, + multiplePage: true, + pageOrientation: ej.datavisualization.Diagram.PageOrientations.Portrait + }, + scrollSettings: { + horizontalOffset: 0, + verticalOffset: 0 + }, + snapSettings: { + snapConstraints: ej.datavisualization.Diagram.SnapConstraints.ShowLines + }, + nodes: [ + createNode({ name: "NewIdea", width: 150, height: 60, offsetX: 300, offsetY: 60, labels: [createLabel({ "text": "New idea identified" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Terminator }), + createNode({ name: "Meeting", width: 150, height: 60, offsetX: 300, offsetY: 155, labels: [createLabel({ "text": "Meeting with board" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), + createNode({ + name: "BoardDecision", width: 150, height: 110, offsetX: 300, offsetY: 280, labels: [createLabel({ text: "Board decides \nwhether \nto proceed", wrapText: "true", "margin": { left: 20, top: 0, right: 20, bottom: 0 } })], + type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision + }), + createNode({ name: "Project", width: 150, height: 100, offsetX: 300, offsetY: 430, labels: [createLabel({ "text": "Find Project \nmanager" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision }), + createNode({ + name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), + createNode({ name: "Decision", width: 250, height: 60, offsetX: 550, offsetY: 60, labels: [createLabel({ "text": "Decision Process for new software ideas" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Card, fillColor: "#858585", borderColor: "#858585" }), + createNode({ name: "Reject", width: 150, height: 60, offsetX: 550, offsetY: 285, labels: [createLabel({ "text": "Reject and write report" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), + createNode({ name: "Resources", width: 150, height: 60, offsetX: 550, offsetY: 430, labels: [createLabel({ "text": "Hire new resources" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }) + ], + connectors: [ + createConnector({ name: "connector1", sourceNode: "NewIdea", targetNode: "Meeting" }), + createConnector({ name: "connector2", sourceNode: "Meeting", targetNode: "BoardDecision" }), + createConnector({ name: "connector3", sourceNode: "BoardDecision", targetNode: "Project", labels: [createLabel({ "text": "Yes" })] }), + createConnector({ name: "connector4", sourceNode: "Project", targetNode: "End", labels: [createLabel({ "text": "Yes" })] }), + createConnector({ name: "connector5", sourceNode: "BoardDecision", targetNode: "Reject", labels: [createLabel({ "text": "No" })] }), + createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) + ] + }); + +}); + +function createNode(option: ej.datavisualization.Diagram.Node) { + if (!option.fillColor) { + option.borderColor = "#1BA0E2"; + option.fillColor = "#1BA0E2"; + } + option.labels[0].fontColor = "white"; + return option; +} + +function createConnector(option: ej.datavisualization.Diagram.Connector) { + option.targetDecorator = { shape: ej.datavisualization.Diagram.DecoratorShapes.Arrow, borderColor: "#606060", width: 10, height: 10 }; + option.lineColor = "#606060"; + if (option.labels && option.labels.length > 0) { + option.labels[0].fillColor = "white"; + } + return option; +} + +function createLabel(options : any) { + return options; +} + + + +module DialogComponent { + $(function () { + var dialogInstance = new ej.Dialog($("#basicDialog"), { + width: 550, + minWidth: 310, + minHeight: 215, + target:".control", + close:()=>{ + $("#btnOpen").show();} + }); + var btnInstance = new ej.Button($("#btnOpen"), { + size: "medium", + click: ()=>{ + $("#btnOpen").hide(); + $("#basicDialog").ejDialog("open");}, + type: "button", + height: 30, + width: 150 + }); + }); +} + + + + +module digitalgaugecomponent { + $(function () { + var digitalgaugesample = new ej.datavisualization.DigitalGauge($("#DigitalGauge"), { + width: 525, + height: 305, + isResponsive: true, + items: [{ + segmentSettings: { + width: 1, + spacing: 0, + color: "#8c8c8c" + }, + characterSettings: { + opacity: 0.8, + }, + value: "Syncfusion", + position: { x: 52, y: 52 } + }] + }); + }); +} + + + + + + +module DropDownListComponent { + var BikeList = [ + { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, + { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, + { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, + { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } + ]; + $(function () { + var sample = new ej.DropDownList($("#bikeList"),{ + dataSource: BikeList, + width: "100%", + watermarkText: "Select a bike", + fields: { id: "empid", text: "text", value: "text" }, + enableFilterSearch: true, + caseSensitiveSearch: true, + enableIncrementalSearch: true, + enablePopupResize: true, + delimiterChar: ";", + multiSelectMode: ej.MultiSelectMode.Delimiter, + maxPopupHeight: "300px", + minPopupHeight: "150px", + maxPopupWidth: "500px", + minPopupWidth: "350px", + showCheckbox: true, + showRoundedCorner: true + }); + }); + +} + + + + + + +module ExplorerComponent { + $(function () { + var file = new ej.FileExplorer($("#fileExplorer"), { + path: (window).baseurl + "Content/FileBrowser/", + width: "100%", + minWidth: "150px", + layout: "tile", + isResponsive: true, + ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" + }); + }); +} + + + + +module GanttComponent { + $(function () { + var ganttInstance = new ej.Gantt($("#GanttContainer"), { + dataSource: (window).projectData, + allowColumnResize: true, + allowSorting: true, + allowSelection: true, + enableContextMenu: true, + taskIdMapping: "taskID", + allowDragAndDrop: true, + taskNameMapping: "taskName", + startDateMapping: "startDate", + showColumnChooser: true, + showColumnOptions: true, + progressMapping: "progress", + durationMapping: "duration", + endDateMapping: "endDate", + childMapping: "subtasks", + scheduleStartDate: "02/01/2014", + scheduleEndDate: "04/09/2014", + //Resources mapping + resourceInfoMapping: "resourceId", + resourceNameMapping: "resourceName", + resourceIdMapping: "resourceId", + resources: (window).projectResources, + predecessorMapping: "predecessor", + showResourceNames: true, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add","edit","delete","update","cancel","indent","outdent","expandAll","collapseAll","search"] + }, + editSettings: { + allowEditing: true, + allowAdding: true, + allowDeleting: true, + allowIndent: true, + editMode: "cellEditing" + }, + sizeSettings: { + width: "100%", + height: "100%" + }, + dragTooltip: { showTooltip: true }, + showGridCellTooltip: true, + treeColumnIndex: 1, + isResponsive: true, + }); +}); +} + + + +module GridComponent { + $(function () { + var gridInstance = new ej.Grid($("#Grid"), { + dataSource: (window).gridData, + allowGrouping: true, + allowSorting: true, + allowMultiSorting: true, + enableAltRow: true, + allowPaging: true, + allowReordering: true, + allowResizing: true, + allowFiltering: true, + allowScrolling: true, + enableRowHover: true, + selectionType: "multiple", + selectionSettings: { enableToggle: true, selectionMode: ["row", "cell", "column"] }, + allowKeyboardNavigation: true, + editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true, allowEditOnDblClick: true, showDeleteConfirmDialog: true }, + toolbarSettings: { showToolbar: true, toolbarItems: ["add", "edit", "delete", "update", "cancel", "search"] }, + columns: [ + { field: "OrderID", headerText: "Order ID", isPrimaryKey: true, width: 75, textAlign: ej.TextAlign.Right }, + { field: "CustomerID", headerText: "Customer ID", editType: ej.Grid.EditingType.String, width: 80 }, + { field: "EmployeeID", headerText: "Employee ID", width: 75, editType: ej.Grid.EditingType.Dropdown, textAlign: ej.TextAlign.Right, priority: 4 }, + { field: "Freight", width: 75, format: "{0:C}", editType: ej.Grid.EditingType.Numeric, textAlign: ej.TextAlign.Right, priority: 3 }, + { field: "OrderDate", headerText: "Order Date", width: 80, format: "{0:MM/dd/yyyy}", textAlign: ej.TextAlign.Right, priority: 2 }, + { field: "ShipCity", headerText: "Ship City", editType: ej.Grid.EditingType.Dropdown, width: 110, priority: 2 } + ], + isResponsive: true, + minWidth: 700, + showSummary: true, + summaryRows: [{ title: "Sum", summaryColumns: [{ summaryType: ej.Grid.SummaryType.Sum, displayColumn: "Freight", dataMember: "Freight", format: "{0:C2}" }] }] + }); + }); +} + + + +var columns = ["Vegie-spread", "Tofuaa", "Alice Mutton", "Konbu", "Fløtemysost"] +var itemSource: any[] = []; +for (var i = 0; i < columns.length; i++) { + for (var j = 0; j < 6; j++) { + var value = Math.floor((Math.random() * 100) + 1); + itemSource.push({ ProductName: columns[i], Year: "Y" + (2011 + j), Value: value }) + } +} + +$(function () { + var heatmap = new ej.datavisualization.HeatMap($("#heatmap"), { + colorMappingCollection: [ + { value: 0, color: "#8ec8f8", label: { text: "0" } }, + { value: 100, color: "#0d47a1", label: { text: "100" } } + ], + isResponsive: true, + itemsSource: itemSource, + width: "100%", + itemsMapping: { + column: { propertyName: "ProductName", displayName: "Product Name" }, + row: { propertyName: "Year", displayName: "Year" }, + value: { propertyName: "Value" }, + columnMapping: [ + { "propertyName": columns[0], "displayName": columns[0] }, + { "propertyName": columns[1], "displayName": columns[1] }, + { "propertyName": columns[2], "displayName": columns[2] }, + { "propertyName": columns[3], "displayName": columns[3] }, + { "propertyName": columns[4], "displayName": columns[4] }, + { "propertyName": columns[5], "displayName": columns[5] } + ], + headerMapping: { propertyName: "Year", displayName: "Year", columnStyle: { width: 105, textAlign: "right" } }, + }, + legendCollection: ["heatmap_legend"] + }); + var heatmaplegend = new ej.datavisualization.HeatMapLegend($("#heatmap_legend"), { + colorMappingCollection: [ + { value: 0, color: "#8ec8f8", label: { text: "0" } }, + { value: 100, color: "#0d47a1", label: { text: "100" } } + ], + height: "50px", + width: "75%", + isResponsive: true + }); +}); + + + + +declare var window:myWindow; +export interface myWindow extends Window{ +kanbanData:any; +} +module KanbanComponent { + $(function () { + var sample = new ej.Kanban($("#Kanban"), { + dataSource: new ej.DataManager(window["kanbanData"]).executeLocal(new ej.Query().take(20)), + columns: [ + { headerText: "Backlog", key: "Open" }, + { headerText: "In Progress", key: "InProgress" }, + { headerText: "Testing", key: "Testing" }, + { headerText: "Done", key: "Close" } + ], + keyField: "Status", + allowTitle: true, + fields: { + content: "Summary", + primaryKey: "Id", + imageUrl: "ImgUrl" + }, + allowSelection: false + }); + }); +} + + + + +module lineargaugecomponent { + $(function () { + var linearsample = new ej.datavisualization.LinearGauge($("#LinearGauge"), { + labelColor: "#8c8c8c", width: 500, + isResponsive: true, enableAnimation: false, + scales: [{ + width: 4, border: { color: "transparent", width: 0 }, showBarPointers: false, showRanges: true, length: 310, + position: { x: 52, y: 50 }, markerPointers: [{ + value: 50, length: 10, width: 10, backgroundColor: "#4D4D4D", border: { color: "#4D4D4D" } + }], + labels: [{ font: { size: "11px", fontFamily: "Segoe UI", fontStyle: "bold" }, distanceFromScale: { x: -13 } }], + ticks: [{ type: "majorinterval", width: 1, color: "#8c8c8c" }], + ranges: [{ + endValue: 60, + startValue: 0, + backgroundColor: "#F6B53F", + border: { color: "#F6B53F" }, startWidth: 4, endWidth: 4 + }, { + endValue: 100, + startValue: 60, + backgroundColor: "#E94649", + border: { color: "#E94649" }, startWidth: 4, endWidth: 4 + }] + }] + }); + }); +} + + + + + +module ListBoxComponent { + $(function () { + var listboxInstance = new ej.ListBox($("#selectcar"), { + showCheckbox: true + }); + }); +} + + + +module ListviewComponent { + $(function () { + var listviewInstance = new ej.ListView($("#defaultlistview"), { + enableCheckMark: true, + width: 400 + }); + }); +} + + +var world_map= + { + "type": "FeatureCollection", + "crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, + "features": [ + { "type": "Feature", "properties": { "admin": "Afghanistan", "name": "Afghanistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[61.21081709172573, 35.650072333309218], [62.230651483005879, 35.270663967422287], [62.984662306576588, 35.404040839167614], [63.193538445900337, 35.857165635718907], [63.982895949158696, 36.007957465146596], [64.546479119733888, 36.31207326918426], [64.746105177677393, 37.111817735333297], [65.588947788357828, 37.305216783185628], [65.745630731066811, 37.661164048812061], [66.217384881459324, 37.393790188133913], [66.518606805288655, 37.362784328758785], [67.075782098259609, 37.35614390720928], [67.829999627559502, 37.144994004864678], [68.135562371701369, 37.023115139304302], [68.859445835245921, 37.344335842430588], [69.196272820924364, 37.15114350030742], [69.518785434857946, 37.608996690413413], [70.116578403610319, 37.588222764632086], [70.270574171840124, 37.73516469985401], [70.376304152309274, 38.138395901027515], [70.806820509732873, 38.486281643216408], [71.348131137990251, 38.258905341132156], [71.239403924448155, 37.953265082341879], [71.541917759084768, 37.905774441065631], [71.448693475230229, 37.065644843080513], [71.84463829945058, 36.738171291646914], [72.193040805962383, 36.94828766534566], [72.636889682917271, 37.047558091778349], [73.260055779924983, 37.495256862938994], [73.948695916646486, 37.421566270490786], [74.980002475895404, 37.419990139305888], [75.158027785140902, 37.13303091078911], [74.575892775372964, 37.02084137628345], [74.067551710917812, 36.836175645488446], [72.920024855444453, 36.720007025696312], [71.846291945283909, 36.509942328429851], [71.262348260385735, 36.074387518857797], [71.498767938121077, 35.650563259415996], [71.613076206350698, 35.153203436822857], [71.115018751921625, 34.733125718722228], [71.156773309213449, 34.348911444632144], [70.881803012988385, 33.988855902638512], [69.93054324735958, 34.020120144175102], [70.323594191371583, 33.358532619758385], [69.687147251264847, 33.105498969041228], [69.262522007122541, 32.501944078088293], [69.317764113242546, 31.901412258424436], [68.926676873657655, 31.620189113892064], [68.556932000609308, 31.713310044882011], [67.792689243444769, 31.582930406209623], [67.683393589147457, 31.303154201781414], [66.938891229118454, 31.304911200479346], [66.38145755398601, 30.738899237586448], [66.346472609324408, 29.88794342703617], [65.046862013616092, 29.472180691031902], [64.350418735618504, 29.560030625928089], [64.148002150331237, 29.340819200145965], [63.550260858011164, 29.468330796826162], [62.549856805272775, 29.318572496044304], [60.874248488208778, 29.829238999952604], [61.78122155136343, 30.735850328081231], [61.699314406180811, 31.379506130492661], [60.941944614511115, 31.548074652628745], [60.863654819588952, 32.182919623334421], [60.536077915290761, 32.981268825811561], [60.963700392505991, 33.528832302376252], [60.528429803311575, 33.676446031217999], [60.80319339380744, 34.404101874319856], [61.21081709172573, 35.650072333309218]]] } }, + { "type": "Feature", "properties": { "admin": "Angola", "name": "Angola", "continent": "Africa" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[16.326528354567042, -5.877470391466217], [16.573179965896141, -6.622644545115092], [16.860190870845226, -7.222297865429978], [17.089995965247166, -7.545688978712474], [17.472970004962288, -8.068551120641656], [18.134221632569048, -7.987677504104865], [18.464175652752683, -7.847014255406475], [19.016751743249664, -7.988245944860138], [19.166613396896079, -7.738183688999724], [19.417502475673214, -7.155428562044277], [20.037723016040214, -7.116361179231658], [20.091621534920616, -6.943090101756949], [20.60182295093832, -6.939317722199688], [20.514748162526526, -7.299605808138663], [21.728110792739752, -7.290872491081315], [21.74645592620336, -7.920084730667113], [21.949130893652033, -8.305900974158304], [21.80180138518795, -8.908706556842985], [21.875181919042397, -9.523707777548564], [22.208753289486417, -9.894796237836529], [22.155268182064326, -11.084801120653777], [22.402798292742428, -10.99307545333569], [22.837345411884762, -11.017621758674334], [23.456790805767461, -10.867863457892481], [23.912215203555743, -10.926826267137541], [24.017893507592614, -11.237298272347115], [23.904153680118235, -11.722281589406332], [24.079905226342895, -12.191296888887305], [23.930922072045373, -12.565847670138821], [24.0161365088947, -12.91104623784855], [21.933886346125941, -12.898437188369353], [21.887842644953871, -16.080310153876891], [22.562478468524283, -16.898451429921831], [23.215048455506086, -17.523116143465952], [21.377176141045592, -17.930636488519706], [18.956186964603628, -17.789094740472233], [18.263309360434217, -17.309950860262003], [14.209706658595049, -17.353100681225708], [14.058501417709035, -17.423380629142653], [13.462362094789963, -16.971211846588741], [12.814081251688405, -16.941342868724075], [12.21546146001938, -17.111668389558059], [11.734198846085146, -17.301889336824498], [11.640096062881609, -16.673142185129205], [11.778537224991563, -15.793816013250687], [12.123580763404444, -14.878316338767927], [12.175618930722264, -14.449143568583889], [12.500095249083014, -13.547699883684398], [12.738478631245439, -13.137905775609934], [13.312913852601834, -12.483630466362511], [13.633721144269824, -12.038644707897189], [13.738727654686924, -11.297863050993142], [13.686379428775293, -10.73107594161584], [13.38732791510216, -10.373578383020726], [13.120987583069873, -9.766897067914112], [12.875369500386567, -9.166933689005488], [12.929061313537797, -8.959091078327573], [13.23643273280987, -8.56262948978434], [12.933040398824314, -7.596538588087752], [12.728298374083916, -6.927122084178803], [12.227347039446441, -6.294447523629372], [12.322431674863562, -6.100092461779651], [12.735171339578695, -5.965682061388476], [13.024869419006988, -5.984388929878106], [13.375597364971892, -5.864241224799555], [16.326528354567042, -5.877470391466217]]], [[[12.436688266660919, -5.684303887559223], [12.182336866920277, -5.789930515163801], [11.914963006242115, -5.037986748884733], [12.318607618873923, -4.606230157086158], [12.620759718484548, -4.438023369976121], [12.995517205465202, -4.781103203961918], [12.631611769265842, -4.991271254092935], [12.468004184629759, -5.248361504744991], [12.436688266660919, -5.684303887559223]]]] } }, + { "type": "Feature", "properties": { "admin": "Albania", "name": "Albania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.590247430104906, 41.855404161133592], [20.463175083099195, 41.515089016275333], [20.605181919037356, 41.086226304685219], [21.020040317476397, 40.842726955725873], [20.99998986174722, 40.580003973953964], [20.67499677906363, 40.43499990494302], [20.61500044117275, 40.110006822259365], [20.150015903410516, 39.624997666983965], [19.980000441170144, 39.694993394523401], [19.9600016618732, 39.915005805006039], [19.40608198413673, 40.250773423822459], [19.319058872157139, 40.727230129553554], [19.403549838954287, 41.409565741535445], [19.540027296637099, 41.71998607031275], [19.371768833094958, 41.87754751237064], [19.304486118250786, 42.195745144207812], [19.738051385179627, 42.688247382165564], [19.801613396898681, 42.500093492190835], [20.0707, 42.58863], [20.28375451018189, 42.320259507815074], [20.52295, 42.21787], [20.590247430104906, 41.855404161133592]]] } }, + { "type": "Feature", "properties": { "admin": "United Arab Emirates", "name": "United Arab Emirates", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[51.579518670463258, 24.245497137951102], [51.757440626844172, 24.294072984305462], [51.794389275932865, 24.019826158132499], [52.577080519425593, 24.177439276622703], [53.404006788960139, 24.151316840099167], [54.008000929587574, 24.121757920828212], [54.693023716048614, 24.797892360935084], [55.439024692614126, 25.439145209244934], [56.070820753814544, 26.055464178973978], [56.261041701080948, 25.714606431576762], [56.396847365143991, 24.924732163995483], [55.886232537667993, 24.92083059335744], [55.804118686756212, 24.269604193615258], [55.981213820220454, 24.130542914317822], [55.528631626208231, 23.933604030853498], [55.525841098864461, 23.524869289640929], [55.234489373602869, 23.110992743415316], [55.208341098863187, 22.708329982997039], [55.006803012924898, 22.496947536707129], [52.000733270074321, 23.001154486578937], [51.617707553926969, 24.014219265228824], [51.579518670463258, 24.245497137951102]]] } }, + { "type": "Feature", "properties": { "admin": "Argentina", "name": "Argentina", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-65.5, -55.2], [-66.45, -55.25], [-66.95992, -54.89681], [-67.56244, -54.87001], [-68.63335, -54.8695], [-68.634010227583147, -52.636370458874453], [-68.25, -53.1], [-67.75, -53.85], [-66.45, -54.45], [-65.05, -54.7], [-65.5, -55.2]]], [[[-64.964892137294569, -22.075861504812348], [-64.377021043542257, -22.79809132252354], [-63.986838141522462, -21.993644301035953], [-62.84646847192154, -22.034985446869452], [-62.685057135657885, -22.249029229422401], [-60.846564704009928, -23.880712579038299], [-60.028966030503973, -24.032796319273238], [-58.807128465394939, -24.771459242453268], [-57.777217169817952, -25.162339776309032], [-57.633660040911124, -25.603656508081666], [-58.618173590719707, -27.123718763947117], [-57.609759690976134, -27.395898532828419], [-56.486701626192989, -27.548499037386243], [-55.695845506398186, -27.387837009390815], [-54.788794928595038, -26.621785577096087], [-54.625290696823541, -25.739255466415479], [-54.130049607954412, -25.547639255477243], [-53.628348965048716, -26.12486500417743], [-53.648735317587885, -26.923472588816104], [-54.490725267135517, -27.474756768505767], [-55.162286342984586, -27.881915378533414], [-56.290899624239088, -28.852760512000849], [-57.62513342958291, -30.21629485445424], [-57.874937303281897, -31.016556084926158], [-58.14244035504074, -32.044503676076182], [-58.132647671121404, -33.040566908502008], [-58.349611172098818, -33.263188978815428], [-58.427074144104367, -33.909454441057541], [-58.495442064026541, -34.4314897600701], [-57.225829637263629, -35.288026625307886], [-57.362358771378737, -35.977390232081497], [-56.737487352105447, -36.413125909166574], [-56.788285285048339, -36.901571547189327], [-57.749156867083421, -38.183870538079901], [-59.231857062401865, -38.720220228837199], [-61.2374452378656, -38.92842457454114], [-62.335956997310134, -38.827707208004362], [-62.125763108962914, -39.424104913084868], [-62.33053097191943, -40.172586358400316], [-62.145994432205228, -40.676896661136723], [-62.74580278181697, -41.028761488612083], [-63.770494757732514, -41.166789239263657], [-64.732089809819698, -40.802677097335128], [-65.118035244391578, -41.064314874028874], [-64.97856055363583, -42.058000990569312], [-64.303407965742466, -42.359016208669495], [-63.755947842042339, -42.043686618824495], [-63.458059048095883, -42.563138116222355], [-64.378803880456289, -42.873558444999638], [-65.181803961839691, -43.495380954767782], [-65.328823411710133, -44.501366062193689], [-65.565268927661592, -45.03678557716978], [-66.509965786389344, -45.039627780945843], [-67.293793911392427, -45.551896254255183], [-67.580546434180079, -46.301772963242527], [-66.597066413017259, -47.033924655953804], [-65.641026577401433, -47.23613453551188], [-65.98508826360073, -48.133289076531128], [-67.166178961847649, -48.697337334996931], [-67.816087612566449, -49.869668877970412], [-68.728745083273154, -50.26421843851886], [-69.138539191347789, -50.732510267947788], [-68.815561489523517, -51.771104011594097], [-68.149994879820397, -52.349983406127699], [-68.571545376241332, -52.299443855346247], [-69.498362189396076, -52.142760912637236], [-71.914803839796321, -52.009022305865912], [-72.329403856074023, -51.425956312872394], [-72.309973517532342, -50.677009779666342], [-72.975746832964617, -50.741450290734299], [-73.328050910114456, -50.378785088909865], [-73.415435757120022, -49.318436374712952], [-72.648247443314929, -48.878618259476774], [-72.331160854771937, -48.244238376661819], [-72.44735531278026, -47.738532810253517], [-71.917258470330196, -46.884838148791786], [-71.552009446891233, -45.560732924177117], [-71.659315558545316, -44.973688653341434], [-71.222778896759721, -44.784242852559409], [-71.329800788036195, -44.407521661151677], [-71.793622606071935, -44.207172133156099], [-71.464056159130493, -43.787611179378324], [-71.915423956983901, -43.408564548517404], [-72.148898078078517, -42.254888197601375], [-71.746803758415453, -42.051386407235988], [-71.915734015577542, -40.832339369470716], [-71.680761277946445, -39.808164157878061], [-71.413516608349042, -38.916022230791107], [-70.814664272734703, -38.552995293940732], [-71.118625047475419, -37.576827487947192], [-71.121880662709771, -36.65812387466233], [-70.364769253201658, -36.005088799789931], [-70.388049485949082, -35.169687595359441], [-69.817309129501453, -34.193571465798279], [-69.814776984319209, -33.273886000299839], [-70.074399380153622, -33.09120981214803], [-70.535068935819439, -31.365010267870279], [-69.919008348251921, -30.336339206668306], [-70.013550381129861, -29.367922865518544], [-69.656130337183143, -28.459141127233686], [-69.001234910748266, -27.521213881136127], [-68.295541551370391, -26.899339694935787], [-68.594799770772667, -26.50690886811126], [-68.386001146097342, -26.185016371365229], [-68.417652960876111, -24.518554782816874], [-67.328442959244128, -24.025303236590908], [-66.985233934177629, -22.986348565362825], [-67.106673550063604, -22.735924574476392], [-66.273339402924833, -21.832310479420677], [-64.964892137294569, -22.075861504812348]]]] } }, + { "type": "Feature", "properties": { "admin": "Armenia", "name": "Armenia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[43.582745802592726, 41.09214325618256], [44.972480096218071, 41.248128567055588], [45.179495883979335, 40.985353908851401], [45.560351189970433, 40.812289537105919], [45.359174839058156, 40.561503811193447], [45.891907179555076, 40.218475653639992], [45.610012241402913, 39.899993801425175], [46.034534132680662, 39.628020738273058], [46.483498976432443, 39.464154771475528], [46.505719842317966, 38.770605373686287], [46.143623081248812, 38.74120148371221], [45.735379266143006, 39.319719143219736], [45.739978468616975, 39.473999131827114], [45.298144972521456, 39.471751207022422], [45.00198733905674, 39.740003567049548], [44.793989699081934, 39.713002631177041], [44.400008579288695, 40.005000311842267], [43.656436395040934, 40.253563951166178], [43.752657911968399, 40.740200914058754], [43.582745802592726, 41.09214325618256]]] } }, + { "type": "Feature", "properties": { "admin": "French Southern and Antarctic Lands", "name": "Fr. S. Antarctic Lands", "continent": "Seven seas (open ocean)" }, "geometry": { "type": "Polygon", "coordinates": [[[68.935, -48.625], [69.58, -48.94], [70.525, -49.065], [70.56, -49.255], [70.28, -49.71], [68.745, -49.775], [68.72, -49.2425], [68.8675, -48.83], [68.935, -48.625]]] } }, + { "type": "Feature", "properties": { "admin": "Australia", "name": "Australia", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[145.397978143494782, -40.792548516605883], [146.364120721623692, -41.137695407883335], [146.908583612250823, -41.000546156580668], [147.689259474884125, -40.808258152022681], [148.289067824495987, -40.875437514002122], [148.359864536735785, -42.062445163746439], [148.017301467073082, -42.40702361426861], [147.914051955353784, -43.211522312188485], [147.564564243763982, -42.937688897473855], [146.87034305235494, -43.634597263362082], [146.663327264593647, -43.580853773778543], [146.048377720320389, -43.54974456153888], [145.431929559510536, -42.693776137056268], [145.295090366801674, -42.03360971452755], [144.7180713238306, -41.162551771815707], [144.743754510679622, -40.703975111657705], [145.397978143494782, -40.792548516605883]]], [[[143.561811151299935, -13.763655694232209], [143.922099237238882, -14.548310642152], [144.563713820574804, -14.171176039285879], [144.894908075133515, -14.594457696188622], [145.374723748963419, -14.984976495018284], [145.271991001567244, -15.428205254785691], [145.48525963763575, -16.285672295804769], [145.637033319276952, -16.784918308176611], [145.888904250267672, -16.906926364817647], [146.160308872664473, -17.76165455492524], [146.063673944278662, -18.280072523677315], [146.387478469019584, -18.958274021075905], [147.471081577747896, -19.480722751546676], [148.177601760042478, -19.955939222902767], [148.848413527623222, -20.391209812097252], [148.717465448195583, -20.633468926681513], [149.289420200802056, -21.260510756111096], [149.678337030230637, -22.342511895438388], [150.07738244038859, -22.122783705333315], [150.482939081015161, -22.556142266533012], [150.727265252891158, -22.402404880464655], [150.899554478152254, -23.462236830338679], [151.609175246384211, -24.076256198830755], [152.07353966695905, -24.45788665130619], [152.855197381805908, -25.267501316023008], [153.136162144176751, -26.071173191026187], [153.161948683890358, -26.641319268502439], [153.09290897034856, -27.260299574494503], [153.569469028944184, -28.110066827102099], [153.512108189100218, -28.995077406532751], [153.339095493787056, -29.458201592732443], [153.069241164358857, -30.350240166954809], [153.089601678681788, -30.923641859665445], [152.891577590139377, -31.640445651985949], [152.450002476205327, -32.550002536755237], [151.709117466436766, -33.041342054986337], [151.343971795862387, -33.816023451473846], [151.010555454715103, -34.310360202777879], [150.714139439089024, -35.173459974916803], [150.328219842733233, -35.671879164371923], [150.075212030232251, -36.420205580390508], [149.946124302367139, -37.109052422841224], [149.997283970336127, -37.425260512035123], [149.423882277625523, -37.772681166333463], [148.304622430615893, -37.809061374666875], [147.38173302631526, -38.219217217767543], [146.922122837511324, -38.606532077795116], [146.317921991154776, -39.035756524411433], [145.489652134380549, -38.593767999019043], [144.876976353128157, -38.41744801203911], [145.032212355732952, -37.896187839510972], [144.485682407814011, -38.085323581699257], [143.609973586196077, -38.809465427405321], [142.745426873952965, -38.538267510737519], [142.17832970598198, -38.380034275059835], [141.606581659104677, -38.308514092767872], [140.638578729413211, -38.019332777662541], [139.992158237874321, -37.402936293285094], [139.806588169514043, -36.643602797188272], [139.574147577065219, -36.138362318670666], [139.082808058834075, -35.732754001611774], [138.120747918856296, -35.612296237939397], [138.449461704664998, -35.127261244447887], [138.207564325106659, -34.384722588845925], [137.719170363516128, -35.07682504653102], [136.829405552314711, -35.260534763328614], [137.352371047108477, -34.707338555644093], [137.503886346588331, -34.130267836240769], [137.890116001537649, -33.640478610978327], [137.810327590079112, -32.900007012668105], [136.996837192940347, -33.752771498348629], [136.372069126531642, -34.094766127256186], [135.98904341038434, -34.89011809666048], [135.208212518454104, -34.478670342752601], [135.239218377829161, -33.947953383114971], [134.613416782774607, -33.222778008763136], [134.085903761939107, -32.848072198214759], [134.273902622617015, -32.617233575166949], [132.990776808809812, -32.011224053680188], [132.288080682504869, -31.982646986622761], [131.326330601120901, -31.495803318001041], [129.535793898639668, -31.590422865527476], [128.240937534702198, -31.948488864877849], [127.102867466338282, -32.282266941051041], [126.148713820501129, -32.2159660784206], [125.088623488465586, -32.728751316052829], [124.22164798390493, -32.959486586236061], [124.028946567888511, -33.483847344701708], [123.65966678273071, -33.890179131812722], [122.811036411633609, -33.914467054989835], [122.18306440642283, -34.003402194964217], [121.299190708502579, -33.821036065406126], [120.580268182458113, -33.930176690406618], [119.893695103028222, -33.976065362281808], [119.298899367348781, -34.50936614353396], [119.007340936357977, -34.464149265278529], [118.505717808100769, -34.746819349915093], [118.024971958489516, -35.064732761374707], [117.295507440257438, -35.025458672832862], [116.62510908413492, -35.025096937806829], [115.564346958479689, -34.386427911111547], [115.026808709779516, -34.196517022438918], [115.048616164206763, -33.623425388322026], [115.545123325667078, -33.487257989232951], [115.714673700016661, -33.259571628554944], [115.679378696761376, -32.900368747694124], [115.801645135563959, -32.205062351207026], [115.689610630355105, -31.612437025683782], [115.160909051576937, -30.601594333622455], [114.99704308477942, -30.030724786094162], [115.040037876446249, -29.461095472940794], [114.64197431850198, -28.810230808224706], [114.61649783738217, -28.516398614213042], [114.173579136208446, -28.118076674107321], [114.048883905088132, -27.33476531342712], [113.477497593236876, -26.543134047147898], [113.338953078262477, -26.116545098578477], [113.77835778204026, -26.549025160429174], [113.440962355606587, -25.621278171493152], [113.936901076311642, -25.911234633082877], [114.232852004047288, -26.298446140245868], [114.216160516417006, -25.786281019801105], [113.721255324357685, -24.998938897402123], [113.625343866024025, -24.683971042583146], [113.393523390762667, -24.384764499613262], [113.502043898575607, -23.80635019297025], [113.706992629045146, -23.56021534596406], [113.843418410295669, -23.059987481378734], [113.736551548316072, -22.475475355725372], [114.149756300921865, -21.755881036061009], [114.225307244932651, -22.51748829517863], [114.64776207891866, -21.829519952076904], [115.460167270979298, -21.495173435148541], [115.94737267462699, -21.068687839443708], [116.711615431791529, -20.701681817306817], [117.166316359527684, -20.623598728113802], [117.441545037914238, -20.746898695562162], [118.229558953932951, -20.374208265873232], [118.836085239742701, -20.263310642174822], [118.987807244951753, -20.044202569257319], [119.252493931150624, -19.952941989829835], [119.805225050944543, -19.976506442954978], [120.856220330896633, -19.683707777589188], [121.399856398607199, -19.239755547769729], [121.655137974129062, -18.70531788500713], [122.241665480641757, -18.197648614171765], [122.286623976735655, -17.798603204013911], [122.312772251475408, -17.254967136303446], [123.012574497571904, -16.405199883695854], [123.433789097183009, -17.268558037996225], [123.859344517106592, -17.069035332917249], [123.503242222183232, -16.596506036040363], [123.817073195491915, -16.11131601325199], [124.258286574399847, -16.32794361741956], [124.379726190285794, -15.567059828353973], [124.926152785340022, -15.07510019293532], [125.167275018413875, -14.680395603090004], [125.670086704613823, -14.510070082256018], [125.685796340030493, -14.230655612853834], [126.125149367376096, -14.347340996968949], [126.142822707219864, -14.095986830301211], [126.582589146023736, -13.95279143642041], [127.065867140817332, -13.817967624570922], [127.804633416861932, -14.276906019755042], [128.359689976108939, -14.869169610252253], [128.985543247595899, -14.875990899314738], [129.621473423379598, -14.969783623924553], [129.409600050982988, -14.420669854391031], [129.888640578328591, -13.618703301653481], [130.339465773642928, -13.357375583553473], [130.183506300985982, -13.107520033422301], [130.617795037966971, -12.536392103732464], [131.223494500859999, -12.183648776908113], [131.73509118054946, -12.302452894747159], [132.575298293183096, -12.114040622611013], [132.557211541881031, -11.603012383676683], [131.824698114143644, -11.273781833545097], [132.357223748911395, -11.128519382372641], [133.019560581596409, -11.376411228076844], [133.550845981989028, -11.786515394745134], [134.393068475481982, -12.042365411022173], [134.678632440327021, -11.9411829565947], [135.298491245667975, -12.248606052299051], [135.882693312727611, -11.962266940969796], [136.258380975489445, -12.049341729381606], [136.492475213771627, -11.857208754120389], [136.951620314684988, -12.351958916882735], [136.685124953355739, -12.887223402562054], [136.305406528875096, -13.291229750219895], [135.961758254134111, -13.324509372615889], [136.077616815332533, -13.72427825282578], [135.783836297753226, -14.223989353088211], [135.4286641786112, -14.715432224183896], [135.500184360903177, -14.997740573794427], [136.295174595281367, -15.550264987859121], [137.065360142159477, -15.870762220933353], [137.580470819244795, -16.215082289294084], [138.303217401278971, -16.807604261952658], [138.58516401586337, -16.806622409739173], [139.108542922115475, -17.062679131745366], [139.260574985918197, -17.371600843986183], [140.215245396078274, -17.710804945550063], [140.875463495039241, -17.36906869880394], [141.071110467696258, -16.832047214426719], [141.274095493738798, -16.388870131091604], [141.398222284103781, -15.840531508042584], [141.702183058844611, -15.044921156476928], [141.563380161708665, -14.561333103089506], [141.635520461188094, -14.270394789286284], [141.519868605718955, -13.698078301653805], [141.650920038011009, -12.944687595270562], [141.842691278246207, -12.741547539931187], [141.68699018775078, -12.407614434461134], [141.928629185147543, -11.877465915578778], [142.118488397387978, -11.328042087451619], [142.14370649634634, -11.04273650476814], [142.51526004452495, -10.668185723516642], [142.797310011974048, -11.157354831591515], [142.866763136974271, -11.784706719614929], [143.11594689348567, -11.90562957117791], [143.158631626558758, -12.325655612846187], [143.522123651299864, -12.834358412327429], [143.597157830987669, -13.400422051652594], [143.561811151299935, -13.763655694232209]]]] } }, + { "type": "Feature", "properties": { "admin": "Austria", "name": "Austria", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.979666782304033, 48.123497015976298], [16.903754103267257, 47.714865627628321], [16.340584344150411, 47.712901923201215], [16.534267612380372, 47.496170966169103], [16.202298211337361, 46.852385972676949], [16.011663852612653, 46.683610744811688], [15.137091912504982, 46.658702704447016], [14.632471551174827, 46.431817328469535], [13.806475457421524, 46.509306138691201], [12.376485223040813, 46.767559109069843], [12.153088006243051, 47.115393174826437], [11.164827915093268, 46.941579494812721], [11.048555942436533, 46.751358547546324], [10.442701450246627, 46.893546250997424], [9.932448357796657, 46.920728054382948], [9.479969516649019, 47.102809963563367], [9.632931756232974, 47.347601223329974], [9.594226108446346, 47.525058091820256], [9.896068149463188, 47.58019684507569], [10.402083774465209, 47.302487697939156], [10.544504021861625, 47.566399237653762], [11.426414015354736, 47.523766181012967], [12.141357456112784, 47.703083401065761], [12.620759718484491, 47.672387600284395], [12.932626987365945, 47.467645575543983], [13.025851271220487, 47.637583523135824], [12.884102817443901, 48.289145819687903], [13.243357374736998, 48.41611481382904], [13.595945672264433, 48.877171942737135], [14.33889773932472, 48.555305284207193], [14.901447381254055, 48.964401760445817], [15.253415561593979, 49.039074205107575], [16.029647251050218, 48.733899034207916], [16.49928266771877, 48.785808010445095], [16.960288120194573, 48.596982326850593], [16.879982944412998, 48.470013332709463], [16.979666782304033, 48.123497015976298]]] } }, + { "type": "Feature", "properties": { "admin": "Azerbaijan", "name": "Azerbaijan", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[45.001987339056789, 39.740003567049591], [45.298144972521435, 39.471751207022422], [45.739978468616997, 39.473999131827149], [45.735379266143092, 39.319719143219785], [46.143623081248812, 38.74120148371221], [45.457721795438729, 38.874139105783108], [44.952688022650264, 39.33576467544642], [44.79398969908199, 39.713002631177027], [45.001987339056789, 39.740003567049591]]], [[[47.373315464066216, 41.219732367511249], [47.81566572448471, 41.151416124021338], [47.987283156126033, 41.405819200194223], [48.584352654826283, 41.808869533854669], [49.110263706260653, 41.282286688800518], [49.618914829309588, 40.572924302729966], [50.084829542853093, 40.526157131505776], [50.392821079312704, 40.256561184239096], [49.569202101444795, 40.176100979160701], [49.395259230350419, 39.39948171646224], [49.2232283872507, 39.04921885838791], [48.856532423707584, 38.815486355131775], [48.883249139202533, 38.320245266262638], [48.634375441284831, 38.270377509100925], [48.010744256386502, 38.794014797514528], [48.355529412637928, 39.288764960276886], [48.060095249225256, 39.582235419262439], [47.685079380083117, 39.508363959301185], [46.505719842317966, 38.770605373686251], [46.483498976432443, 39.464154771475528], [46.034534132680697, 39.628020738273044], [45.610012241402913, 39.899993801425175], [45.891907179555133, 40.21847565363997], [45.359174839058156, 40.561503811193482], [45.560351189970469, 40.812289537105947], [45.179495883979392, 40.98535390885143], [44.972480096218156, 41.248128567055623], [45.217426385281634, 41.411451931314041], [45.962600538930438, 41.123872585609789], [46.501637404166978, 41.064444688474104], [46.637908156120567, 41.181672675128219], [46.145431756378983, 41.72280243587263], [46.404950799348818, 41.860675157227341], [46.686070591016652, 41.827137152669899], [47.373315464066216, 41.219732367511249]]]] } }, + { "type": "Feature", "properties": { "admin": "Burundi", "name": "Burundi", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[29.339997592900342, -4.499983412294092], [29.276383904749046, -3.293907159034063], [29.02492638521678, -2.839257907730157], [29.632176141078585, -2.917857761246096], [29.938359002407935, -2.348486830254238], [30.469696079232978, -2.413857517103458], [30.527677036264457, -2.807631931167534], [30.743012729624692, -3.034284763199686], [30.752262811004943, -3.359329522315569], [30.505559523243559, -3.568567396665364], [30.116332635221166, -4.090137627787242], [29.753512404099919, -4.45238941815328], [29.339997592900342, -4.499983412294092]]] } }, + { "type": "Feature", "properties": { "admin": "Belgium", "name": "Belgium", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[3.314971144228536, 51.345780951536071], [4.047071160507527, 51.267258612668556], [4.973991326526913, 51.475023708698124], [5.60697594567, 51.037298488969768], [6.156658155958779, 50.803721015010574], [6.043073357781109, 50.128051662794221], [5.782417433300905, 50.090327867221205], [5.674051954784828, 49.52948354755749], [4.799221632515809, 49.985373033236371], [4.286022983425084, 49.90749664977254], [3.588184441755685, 50.378992418003563], [3.123251580425801, 50.780363267614561], [2.658422071960274, 50.796848049515731], [2.513573032246142, 51.148506171261815], [3.314971144228536, 51.345780951536071]]] } }, + { "type": "Feature", "properties": { "admin": "Benin", "name": "Benin", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[2.691701694356254, 6.258817246928628], [1.865240512712318, 6.14215770102973], [1.618950636409238, 6.832038072126236], [1.664477573258381, 9.128590399609378], [1.46304284018467, 9.334624335157086], [1.425060662450136, 9.825395412632998], [1.077795037448737, 10.175606594275022], [0.772335646171484, 10.470808213742357], [0.899563022474069, 10.997339382364258], [1.243469679376488, 11.11051076908346], [1.447178175471066, 11.547719224488857], [1.93598554851988, 11.641150214072551], [2.154473504249921, 11.940150051313337], [2.49016360841793, 12.233052069543671], [2.84864301922667, 12.235635891158266], [3.611180454125558, 11.660167141155966], [3.572216424177469, 11.327939357951516], [3.797112257511713, 10.734745591673104], [3.600070021182801, 10.332186184119406], [3.705438266625918, 10.063210354040207], [3.220351596702101, 9.4441525333997], [2.912308383810255, 9.13760793704432], [2.723792758809509, 8.506845404489708], [2.74906253420022, 7.870734361192886], [2.691701694356254, 6.258817246928628]]] } }, + { "type": "Feature", "properties": { "admin": "Burkina Faso", "name": "Burkina Faso", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.827496303712706, 9.642460842319775], [-3.511898972986272, 9.900326239456216], [-3.980449184576684, 9.862344061721698], [-4.330246954760383, 9.610834865757139], [-4.779883592131966, 9.821984768101741], [-4.954653286143098, 10.152713934769732], [-5.404341599946973, 10.370736802609144], [-5.470564947929004, 10.951269842976044], [-5.197842576508648, 11.375145778850136], [-5.220941941743119, 11.713858954307224], [-4.427166103523802, 12.542645575404292], [-4.280405035814879, 13.228443508349738], [-4.006390753587225, 13.472485459848112], [-3.52280270019986, 13.337661647998612], [-3.103706834312759, 13.54126679122859], [-2.967694464520576, 13.798150336151506], [-2.191824510090384, 14.246417548067352], [-2.001035122068771, 14.559008287000887], [-1.066363491205663, 14.973815009007764], [-0.515854458000348, 15.116157741755725], [-0.26625729003058, 14.924308986872147], [0.374892205414682, 14.928908189346128], [0.295646396495101, 14.444234930880651], [0.429927605805517, 13.988733018443922], [0.993045688490071, 13.335749620003821], [1.024103224297477, 12.851825669806573], [2.177107781593775, 12.625017808477532], [2.154473504249921, 11.940150051313337], [1.93598554851988, 11.641150214072551], [1.447178175471066, 11.547719224488857], [1.243469679376488, 11.11051076908346], [0.899563022474069, 10.997339382364258], [0.023802524423701, 11.018681748900802], [-0.438701544588582, 11.09834096927872], [-0.761575893548183, 10.936929633015053], [-1.203357713211431, 11.009819240762736], [-2.94040930827046, 10.962690334512557], [-2.963896246747111, 10.395334784380081], [-2.827496303712706, 9.642460842319775]]] } }, + { "type": "Feature", "properties": { "admin": "Bangladesh", "name": "Bangladesh", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[92.672720981825549, 22.041238918541247], [92.652257114637976, 21.324047552978481], [92.30323449093865, 21.475485337809815], [92.368553501355606, 20.670883287025344], [92.082886183646124, 21.192195135985767], [92.025215285208361, 21.701569729086764], [91.834890985077408, 22.182935695885561], [91.417087029997646, 22.765019029221218], [90.496006300827247, 22.805016587815125], [90.586956821660948, 22.392793687422863], [90.272970819055544, 21.836367702720107], [89.847467075564268, 22.039146023033421], [89.70204959509492, 21.857115790285299], [89.41886274613546, 21.966178900637296], [89.031961297566198, 22.055708319582973], [88.876311883503064, 22.879146429937826], [88.529769728553759, 23.631141872649163], [88.699940220090895, 24.233714911388557], [88.084422235062405, 24.501657212821918], [88.30637251175601, 24.866079413344199], [88.931553989623069, 25.238692328384769], [88.209789259802477, 25.768065700782707], [88.56304935094974, 26.446525580342716], [89.355094028687276, 26.014407253518065], [89.832480910199592, 25.965082098895476], [89.920692580121838, 25.269749864192171], [90.872210727912105, 25.13260061288954], [91.799595981822065, 25.14743174895731], [92.376201613334786, 24.976692816664961], [91.915092807994398, 24.130413723237108], [91.467729933643668, 24.072639471934789], [91.158963250699713, 23.503526923104381], [91.706475050832083, 22.985263983649183], [91.869927606171302, 23.62434642180278], [92.146034783906799, 23.62749868417259], [92.672720981825549, 22.041238918541247]]] } }, + { "type": "Feature", "properties": { "admin": "Bulgaria", "name": "Bulgaria", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.657149692482985, 44.234923000661276], [22.94483239105184, 43.823785305347123], [23.332302280376322, 43.897010809904707], [24.100679152124169, 43.741051337247846], [25.569271681426923, 43.688444729174712], [26.065158725699739, 43.943493760751259], [27.242399529740904, 44.175986029632398], [27.970107049275068, 43.812468166675202], [28.55808149589199, 43.707461656258118], [28.039095086384712, 43.293171698574177], [27.673897739378042, 42.577892361006214], [27.996720411905383, 42.007358710287775], [27.135739373490473, 42.141484890301335], [26.117041863720793, 41.826904608724554], [26.106138136507205, 41.328898830727766], [25.197201368925441, 41.234485988930523], [24.492644891058031, 41.583896185872028], [23.692073601992345, 41.309080918943842], [22.952377150166445, 41.337993882811141], [22.881373732197424, 41.999297186850242], [22.380525750424585, 42.320259507815081], [22.545011834409614, 42.461362006188025], [22.436594679461273, 42.580321153323929], [22.604801466571324, 42.898518785161137], [22.986018507588479, 43.211161200526959], [22.500156691180276, 43.642814439460977], [22.410446404721593, 44.008063462899948], [22.657149692482985, 44.234923000661276]]] } }, + { "type": "Feature", "properties": { "admin": "The Bahamas", "name": "Bahamas", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-77.53466, 23.75975], [-77.78, 23.71], [-78.03405, 24.28615], [-78.40848, 24.57564], [-78.19087, 25.2103], [-77.89, 25.17], [-77.54, 24.34], [-77.53466, 23.75975]]], [[[-77.82, 26.58], [-78.91, 26.42], [-78.98, 26.79], [-78.51, 26.87], [-77.85, 26.84], [-77.82, 26.58]]], [[[-77.0, 26.59], [-77.17255, 25.87918], [-77.35641, 26.00735], [-77.34, 26.53], [-77.78802, 26.92516], [-77.79, 27.04], [-77.0, 26.59]]]] } }, + { "type": "Feature", "properties": { "admin": "Bosnia and Herzegovina", "name": "Bosnia and Herz.", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[19.005486281010118, 44.860233669609144], [19.36803, 44.863], [19.11761, 44.42307], [19.59976, 44.03847], [19.454, 43.568100000000115], [19.21852, 43.52384], [19.03165, 43.43253], [18.70648, 43.20011], [18.56, 42.65], [17.674921502358981, 43.028562527023603], [17.297373488034449, 43.446340643887353], [16.916156447017325, 43.667722479825663], [16.456442905348862, 44.041239732431265], [16.239660271884528, 44.351143296885695], [15.750026075918978, 44.81871165626255], [15.959367303133373, 45.233776760430935], [16.318156772535868, 45.004126695325901], [16.534939406000202, 45.211607570977705], [17.00214603035101, 45.233776760430935], [17.861783481526398, 45.067740383477137], [18.553214145591646, 45.08158966733145], [19.005486281010118, 44.860233669609144]]] } }, + { "type": "Feature", "properties": { "admin": "Belarus", "name": "Belarus", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[23.484127638449841, 53.912497667041123], [24.45068362803703, 53.905702216194747], [25.536353794056989, 54.282423407602515], [25.768432651479792, 54.846962592175082], [26.588279249790386, 55.167175604871659], [26.494331495883749, 55.61510691997762], [27.102459751094525, 55.783313707087672], [28.17670942557799, 56.169129950578807], [29.2295133806603, 55.918344224666356], [29.371571893030669, 55.67009064393617], [29.896294386522353, 55.789463202530406], [30.87390913262, 55.550976467503396], [30.971835971813132, 55.081547756564028], [30.75753380709871, 54.811770941784303], [31.384472283663733, 54.157056382862422], [31.791424187962232, 53.974638576872117], [31.731272820774503, 53.794029446012011], [32.405598585751157, 53.618045355842028], [32.693643019346034, 53.351420803432106], [32.304519484188226, 53.132726141972903], [31.497643670382924, 53.167426866256889], [31.30520063652801, 53.073995876673195], [31.540018344862254, 52.742052313846344], [31.78599816257158, 52.10167796488544], [30.927549269338975, 52.042353420614383], [30.619454380014837, 51.822806098022362], [30.55511722181145, 51.319503485715643], [30.157363722460889, 51.416138414101454], [29.254938185347921, 51.368234361366881], [28.992835320763522, 51.602044379271462], [28.617612745892242, 51.427713934934836], [28.241615024536564, 51.572227077839059], [27.454066196408426, 51.59230337178446], [26.337958611768549, 51.832288723347915], [25.327787713327005, 51.910656032918538], [24.553106316839511, 51.888461005249177], [24.005077752384206, 51.617443956094448], [23.52707075368437, 51.578454087930233], [23.508002150168689, 52.023646552124717], [23.19949384938618, 52.486977444053664], [23.799198846133375, 52.691099351606553], [23.804934930117774, 53.08973135030606], [23.527535841574995, 53.47012156840654], [23.484127638449841, 53.912497667041123]]] } }, + { "type": "Feature", "properties": { "admin": "Belize", "name": "Belize", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-89.143080410503302, 17.808318996649316], [-89.150909389995519, 17.955467637600414], [-89.029857347351808, 18.001511338772485], [-88.848343878926585, 17.883198147040229], [-88.490122850279334, 18.486830552641603], [-88.300031094093669, 18.499982204659897], [-88.296336229184803, 18.353272813383263], [-88.106812913754368, 18.348673610909284], [-88.123478563168476, 18.076674709541003], [-88.285354987322776, 17.644142971258031], [-88.197866787452625, 17.489475409408453], [-88.302640753924422, 17.13169363043566], [-88.239517991879893, 17.036066392479551], [-88.355428229510551, 16.530774237529624], [-88.551824510435821, 16.265467434143144], [-88.732433641295927, 16.233634751851351], [-88.930612759135244, 15.887273464415072], [-89.229121670269265, 15.886937567605166], [-89.15080603713092, 17.015576687075832], [-89.143080410503302, 17.808318996649316]]] } }, + { "type": "Feature", "properties": { "admin": "Bolivia", "name": "Bolivia", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-62.84646847192154, -22.034985446869442], [-63.986838141522462, -21.993644301035946], [-64.377021043542243, -22.798091322523533], [-64.964892137294598, -22.07586150481232], [-66.273339402924833, -21.832310479420713], [-67.10667355006359, -22.735924574476414], [-67.82817989772272, -22.872918796482171], [-68.219913092711266, -21.494346612231858], [-68.757167121033731, -20.372657972904459], [-68.442225104430904, -19.405068454671426], [-68.966818406841853, -18.9816834449041], [-69.100246955019472, -18.260125420812674], [-69.590423753524036, -17.580011895419329], [-68.959635382753291, -16.500697930571267], [-69.389764166934697, -15.66012908291165], [-69.160346645774936, -15.323973890853015], [-69.339534674747, -14.953195489158828], [-68.94888668483658, -14.45363941819328], [-68.929223802349526, -13.602683607643007], [-68.880079515239956, -12.89972909917665], [-68.665079718689611, -12.561300144097171], [-69.52967810736493, -10.951734307502193], [-68.786157599549469, -11.036380303596276], [-68.27125362819325, -11.014521172736817], [-68.048192308205373, -10.712059014532484], [-67.173801235610725, -10.30681243249961], [-66.646908331962791, -9.931331475466861], [-65.33843522811641, -9.76198780684639], [-65.444837002205375, -10.51145110437543], [-65.321898769783004, -10.895872084194675], [-65.402281460213018, -11.566270440317151], [-64.31635291203159, -12.461978041232191], [-63.196498786050562, -12.627032565972433], [-62.803060268796372, -13.000653171442682], [-62.127080857986371, -13.19878061284972], [-61.713204311760769, -13.489202162330049], [-61.084121263255646, -13.479383640194595], [-60.503304002511122, -13.775954685117656], [-60.459198167550014, -14.354007256734551], [-60.264326341377355, -14.645979099183638], [-60.251148851142922, -15.077218926659318], [-60.542965664295131, -15.093910414289592], [-60.158389655179022, -16.258283786690082], [-58.241219855366673, -16.299573256091289], [-58.388058437724027, -16.877109063385273], [-58.280804002502244, -17.271710300366014], [-57.734558274960989, -17.552468357007765], [-57.498371141170971, -18.174187513911289], [-57.676008877174297, -18.961839694904025], [-57.949997321185819, -19.400004164306814], [-57.853801642474494, -19.969995212486186], [-58.166392381408038, -20.176700941653674], [-58.183471442280492, -19.868399346600359], [-59.11504248720609, -19.356906019775398], [-60.043564622626477, -19.342746677327419], [-61.786326463453761, -19.633736667562957], [-62.265961269770784, -20.513734633061272], [-62.291179368729203, -21.051634616787389], [-62.685057135657871, -22.24902922942238], [-62.84646847192154, -22.034985446869442]]] } }, + { "type": "Feature", "properties": { "admin": "Brazil", "name": "Brazil", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.625133429582945, -30.216294854454258], [-56.290899624239067, -28.852760512000884], [-55.162286342984558, -27.881915378533456], [-54.49072526713551, -27.474756768505785], [-53.648735317587885, -26.923472588816086], [-53.628348965048737, -26.124865004177465], [-54.130049607954376, -25.547639255477247], [-54.625290696823562, -25.739255466415507], [-54.428946092330577, -25.162184747012162], [-54.293476325077435, -24.570799655863958], [-54.292959560754511, -24.021014092710722], [-54.652834235235119, -23.839578138933955], [-55.027901780809543, -24.001273695575225], [-55.400747239795407, -23.956935316668797], [-55.517639329639621, -23.57199757252663], [-55.61068274598113, -22.655619398694839], [-55.797958136606894, -22.356929620047815], [-56.473317430229379, -22.086300144135279], [-56.881509568902885, -22.282153822521476], [-57.937155727761287, -22.090175876557169], [-57.870673997617786, -20.732687676681948], [-58.166392381408038, -20.176700941653674], [-57.853801642474494, -19.969995212486186], [-57.949997321185819, -19.400004164306814], [-57.676008877174297, -18.961839694904025], [-57.498371141170971, -18.174187513911289], [-57.734558274960989, -17.552468357007765], [-58.280804002502244, -17.271710300366014], [-58.388058437724027, -16.877109063385273], [-58.241219855366673, -16.299573256091289], [-60.158389655179022, -16.258283786690082], [-60.542965664295131, -15.093910414289592], [-60.251148851142922, -15.077218926659318], [-60.264326341377355, -14.645979099183638], [-60.459198167550014, -14.354007256734551], [-60.503304002511122, -13.775954685117656], [-61.084121263255646, -13.479383640194595], [-61.713204311760769, -13.489202162330049], [-62.127080857986371, -13.19878061284972], [-62.803060268796372, -13.000653171442682], [-63.196498786050562, -12.627032565972433], [-64.31635291203159, -12.461978041232191], [-65.402281460213018, -11.566270440317151], [-65.321898769783004, -10.895872084194675], [-65.444837002205375, -10.51145110437543], [-65.33843522811641, -9.76198780684639], [-66.646908331962791, -9.931331475466861], [-67.173801235610725, -10.30681243249961], [-68.048192308205373, -10.712059014532484], [-68.27125362819325, -11.014521172736817], [-68.786157599549469, -11.036380303596276], [-69.52967810736493, -10.951734307502193], [-70.093752204046879, -11.123971856331011], [-70.548685675728393, -11.009146823778462], [-70.481893886991159, -9.490118096558842], [-71.302412278921523, -10.079436130415372], [-72.184890713169821, -10.05359791426943], [-72.563033006465631, -9.520193780152715], [-73.226713426390148, -9.462212823121233], [-73.015382656532537, -9.03283334720806], [-73.571059332967053, -8.424446709835832], [-73.987235480429646, -7.523829847853063], [-73.723401455363486, -7.340998630404412], [-73.724486660441627, -6.918595472850638], [-73.120027431923575, -6.629930922068238], [-73.219711269814596, -6.089188734566076], [-72.964507208941185, -5.741251315944892], [-72.891927659787243, -5.274561455916979], [-71.748405727816532, -4.59398284263301], [-70.928843349883564, -4.401591485210367], [-70.79476884630229, -4.251264743673302], [-69.893635219996611, -4.298186944194326], [-69.444101935489599, -1.556287123219817], [-69.420485805932216, -1.122618503426409], [-69.577065395776586, -0.549991957200163], [-70.02065589057004, -0.185156345219539], [-70.015565761989293, 0.541414292804205], [-69.452396002872447, 0.706158758950693], [-69.252434048119042, 0.602650865070075], [-69.218637661400166, 0.985676581217433], [-69.804596727157701, 1.089081122233466], [-69.816973232691609, 1.714805202639624], [-67.868565029558823, 1.692455145673392], [-67.537810024674684, 2.037162787276329], [-67.25999752467358, 1.719998684084956], [-67.065048183852483, 1.130112209473225], [-66.876325853122566, 1.253360500489336], [-66.325765143484944, 0.724452215982012], [-65.548267381437554, 0.78925446207603], [-65.354713304288353, 1.0952822941085], [-64.611011928959854, 1.328730576987041], [-64.199305792890499, 1.49285492594602], [-64.083085496666072, 1.91636912679408], [-63.368788011311644, 2.200899562993129], [-63.422867397705105, 2.411067613124174], [-64.269999152265783, 2.497005520025566], [-64.408827887617903, 3.126786200366623], [-64.368494432214092, 3.797210394705246], [-64.816064012294007, 4.056445217297422], [-64.628659430587533, 4.14848094320925], [-63.888342861574145, 4.020530096854571], [-63.093197597899092, 3.770571193858784], [-62.804533047116692, 4.006965033377951], [-62.085429653559125, 4.162123521334308], [-60.966893276601517, 4.536467596856638], [-60.601179165271922, 4.918098049332129], [-60.733574184803707, 5.2002772078619], [-60.213683437731319, 5.2444863956876], [-59.980958624904865, 5.014061184098138], [-60.111002366767373, 4.574966538914082], [-59.767405768458701, 4.423502915866606], [-59.538039923731219, 3.958802598481937], [-59.815413174057852, 3.606498521332085], [-59.974524909084543, 2.755232652188055], [-59.718545701726732, 2.249630438644359], [-59.646043667221242, 1.786893825686789], [-59.030861579002639, 1.317697658692722], [-58.540012986878288, 1.26808828369252], [-58.429477098205957, 1.46394196207872], [-58.113449876525003, 1.507195135907025], [-57.660971035377358, 1.682584947105638], [-57.33582292339689, 1.948537705895759], [-56.782704230360814, 1.863710842288653], [-56.53938574891454, 1.89952260986692], [-55.995698004771739, 1.817667141116601], [-55.905600145070871, 2.021995754398659], [-56.073341844290283, 2.220794989425499], [-55.973322109589361, 2.510363877773016], [-55.569755011605984, 2.42150625244713], [-55.097587449755125, 2.523748073736612], [-54.524754197799709, 2.311848863123785], [-54.088062506717243, 2.105556545414629], [-53.778520677288903, 2.376702785650081], [-53.554839240113537, 2.33489655192595], [-53.4184651352953, 2.05338918701598], [-52.939657151894949, 2.124857692875636], [-52.556424730018414, 2.504705308437053], [-52.249337531123942, 3.241094468596244], [-51.657797410678882, 4.156232408053028], [-51.317146369010842, 4.203490505383953], [-51.069771287629649, 3.65039765056403], [-50.508875291533641, 1.901563828942456], [-49.974075893745045, 1.736483465986069], [-49.947100796088705, 1.046189683431223], [-50.699251268096901, 0.222984117021681], [-50.388210822132123, -0.078444512536819], [-48.620566779156313, -0.235489190271821], [-48.584496629416577, -1.237805271005001], [-47.824956427590621, -0.5816179337628], [-46.566583624851219, -0.941027520352776], [-44.9057030909904, -1.551739597178134], [-44.417619187993658, -2.137750339367975], [-44.581588507655773, -2.691308282078523], [-43.418791266440188, -2.383110039889793], [-41.47265682632824, -2.912018324397116], [-39.97866533055403, -2.87305429444904], [-38.50038347019656, -3.700652357603394], [-37.223252122535193, -4.820945733258915], [-36.45293738457638, -5.109403578312153], [-35.597795783010454, -5.149504489770648], [-35.235388963347553, -5.464937432480245], [-34.896029832486825, -6.738193047719709], [-34.729993455533027, -7.343220716992965], [-35.128212042774216, -8.996401462442284], [-35.636966518687707, -9.649281508017811], [-37.046518724096991, -11.040721123908799], [-37.683611619607355, -12.17119475672582], [-38.423876512188436, -13.038118584854285], [-38.673887091616507, -13.057652276260615], [-38.953275722802537, -13.79336964280002], [-38.882298143049645, -15.667053724838764], [-39.161092495264306, -17.208406670808468], [-39.267339240056394, -17.867746270420479], [-39.583521491034219, -18.262295830968934], [-39.76082333022763, -19.599113457927402], [-40.774740770010332, -20.90451181405242], [-40.944756232250597, -21.937316989837807], [-41.75416419123821, -22.370675551037454], [-41.988284267736546, -22.970070489190888], [-43.074703742024738, -22.967693373305462], [-44.647811855637798, -23.351959323827838], [-45.35213578955991, -23.796841729428579], [-46.472093268405523, -24.088968601174539], [-47.648972337420645, -24.885199069927715], [-48.495458136577689, -25.877024834905647], [-48.641004808127725, -26.623697605090928], [-48.474735887228647, -27.175911960561887], [-48.661520351747612, -28.186134535435713], [-48.888457404157393, -28.674115085567877], [-49.587329474472668, -29.224469089476333], [-50.696874152211478, -30.984465020472953], [-51.576226162306149, -31.777698256153204], [-52.256081305538032, -32.245369968394662], [-52.71209998229768, -33.196578057591175], [-53.373661668498229, -33.768377780900757], [-53.650543992718084, -33.202004082981823], [-53.209588995971529, -32.727666110974717], [-53.787951626182185, -32.047242526987617], [-54.572451544805105, -31.494511407193745], [-55.601510179249331, -30.853878676071385], [-55.97324459494093, -30.883075860316296], [-56.976025763564721, -30.109686374636119], [-57.625133429582945, -30.216294854454258]]] } }, + { "type": "Feature", "properties": { "admin": "Brunei", "name": "Brunei", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[114.204016554828343, 4.525873928236805], [114.599961379048707, 4.900011298029965], [115.450710483869798, 5.447729803891532], [115.405700311343566, 4.955227565933837], [115.347460972150643, 4.316636053887009], [114.869557326315373, 4.348313706881924], [114.659595981913498, 4.007636826997753], [114.204016554828343, 4.525873928236805]]] } }, + { "type": "Feature", "properties": { "admin": "Bhutan", "name": "Bhutan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[91.69665652869665, 27.771741848251661], [92.10371178585973, 27.4526140406332], [92.033483514375078, 26.838310451763554], [91.217512648486405, 26.808648179628019], [90.37327477413406, 26.875724188742872], [89.744527622438838, 26.71940298105995], [88.835642531289366, 27.098966376243755], [88.814248488320544, 27.299315904239361], [89.475810174521101, 28.04275889740639], [90.015828891971154, 28.296438503527209], [90.730513950567769, 28.064953925075748], [91.258853794319904, 28.040614325466287], [91.69665652869665, 27.771741848251661]]] } }, + { "type": "Feature", "properties": { "admin": "Botswana", "name": "Botswana", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[25.649163445750155, -18.536025892818987], [25.850391473094724, -18.714412937090533], [26.164790887158478, -19.293085625894935], [27.296504754350501, -20.391519870690995], [27.724747348753247, -20.499058526290387], [27.727227817503252, -20.851801853114711], [28.02137007010861, -21.485975030200578], [28.794656202924209, -21.639454034107445], [29.432188348109033, -22.091312758067584], [28.017235955525244, -22.827753594659072], [27.119409620886238, -23.574323011979772], [26.78640669119741, -24.240690606383478], [26.485753208123292, -24.616326592713097], [25.941652052522151, -24.696373386333214], [25.765848829865206, -25.174845472923671], [25.664666375437712, -25.486816094669706], [25.025170525825782, -25.719670098576891], [24.211266717228792, -25.670215752873567], [23.733569777122703, -25.39012948985161], [23.312096795350179, -25.268689873965712], [22.824271274514896, -25.500458672794768], [22.579531691180584, -25.979447523708142], [22.105968865657864, -26.28025603607913], [21.60589603036939, -26.726533705351748], [20.889609002371731, -26.828542982695907], [20.666470167735437, -26.477453301704916], [20.758609246511831, -25.868136488551446], [20.165725538827186, -24.917961928000768], [19.895767856534427, -24.767790215760588], [19.895457797940672, -21.849156996347865], [20.881134067475866, -21.814327080983144], [20.910641310314531, -18.252218926672018], [21.655040317478971, -18.219146010005222], [23.196858351339298, -17.869038181227783], [23.579005568137713, -18.281261081620055], [24.217364536239209, -17.889347019118485], [24.520705193792534, -17.887124932529932], [25.084443393664564, -17.661815687737366], [25.264225701608005, -17.736539808831413], [25.649163445750155, -18.536025892818987]]] } }, + { "type": "Feature", "properties": { "admin": "Central African Republic", "name": "Central African Rep.", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[15.279460483469107, 7.421924546737968], [16.106231723706767, 7.497087917506504], [16.290561557691884, 7.754307359239304], [16.456184523187343, 7.734773667832966], [16.705988396886251, 7.508327541529978], [17.964929640380884, 7.890914008002865], [18.389554884523218, 8.281303615751822], [18.911021762780504, 8.630894680206351], [18.81200971850927, 8.982914536978596], [19.094008009526018, 9.074846910025837], [20.059685499764267, 9.01270600019485], [21.00086836109616, 9.475985215691507], [21.723821648859452, 10.567055568885973], [22.231129184668784, 10.971888739460507], [22.864165480244218, 11.142395127807543], [22.977543572692603, 10.714462591998538], [23.554304233502187, 10.089255275915306], [23.557249790142826, 9.681218166538683], [23.394779087017181, 9.26506785729222], [23.459012892355979, 8.954285793488891], [23.805813429466745, 8.666318874542425], [24.567369012152078, 8.229187933785466], [25.114932488716786, 7.825104071479172], [25.12413089366472, 7.500085150579436], [25.796647983511171, 6.979315904158069], [26.21341840994511, 6.546603298362071], [26.465909458123232, 5.94671743410187], [27.213409051225163, 5.550953477394557], [27.374226108517483, 5.233944403500059], [27.044065382604703, 5.127852688004835], [26.402760857862535, 5.150874538590869], [25.650455356557465, 5.256087754737123], [25.278798455514302, 5.170408229997191], [25.128833449003274, 4.927244777847789], [24.805028924262409, 4.897246608902349], [24.41053104014625, 5.108784084489129], [23.297213982850135, 4.609693101414221], [22.841479526468103, 4.710126247573483], [22.704123569436284, 4.633050848810156], [22.405123732195531, 4.02916006104732], [21.659122755630019, 4.224341945813719], [20.927591180106273, 4.322785549329736], [20.290679152108932, 4.691677761245287], [19.467783644293146, 5.031527818212779], [18.932312452884755, 4.709506130385973], [18.542982211997778, 4.201785183118317], [18.453065219809925, 3.504385891123348], [17.809900343505259, 3.560196437998569], [17.133042433346297, 3.728196519379451], [16.537058139724135, 3.198254706226278], [16.01285241055535, 2.267639675298084], [15.907380812247649, 2.557389431158612], [15.862732374747479, 3.013537298998982], [15.405395948964379, 3.335300604664339], [15.036219516671249, 3.851367295747123], [14.950953403389658, 4.21038930909492], [14.478372430080466, 4.732605495620446], [14.558935988023501, 5.03059764243153], [14.459407179429345, 5.451760565610299], [14.536560092841111, 6.22695872642069], [14.776545444404572, 6.408498033062044], [15.279460483469107, 7.421924546737968]]] } }, + { "type": "Feature", "properties": { "admin": "Canada", "name": "Canada", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-63.6645, 46.55001], [-62.9393, 46.41587], [-62.01208, 46.44314], [-62.50391, 46.03339], [-62.87433, 45.96818], [-64.1428, 46.39265], [-64.39261, 46.72747], [-64.01486, 47.03601], [-63.6645, 46.55001]]], [[[-61.806305, 49.10506], [-62.29318, 49.08717], [-63.58926, 49.40069], [-64.51912, 49.87304], [-64.17322, 49.95718], [-62.85829, 49.70641], [-61.835585, 49.28855], [-61.806305, 49.10506]]], [[[-123.510001587551116, 48.51001089130343], [-124.012890788399474, 48.370846259141402], [-125.655012777338342, 48.825004584338494], [-125.954994466792726, 49.179995835967638], [-126.850004435871853, 49.530000311880421], [-127.029993449544392, 49.814995835970073], [-128.059336304366212, 49.994959011426594], [-128.444584107102145, 50.53913768167611], [-128.358413656255408, 50.770648098343678], [-127.308581096029883, 50.552573554071948], [-126.695000977212302, 50.40090322529538], [-125.755006673823161, 50.295018215529367], [-125.415001587558791, 49.950000515332604], [-124.920768189119315, 49.47527497008339], [-123.92250870832099, 49.062483628935794], [-123.510001587551116, 48.51001089130343]]], [[[-56.134035814017111, 50.687009792679298], [-56.795881720595261, 49.812308661490945], [-56.143105027884289, 50.15011749938283], [-55.471492275602934, 49.935815334668447], [-55.822401089080913, 49.587128607779093], [-54.93514258484565, 49.313010972686833], [-54.473775397343772, 49.556691189159167], [-53.47654944519131, 49.24913890237405], [-53.786013759971233, 48.516780503933617], [-53.086133999226249, 48.687803656603528], [-52.95864824076223, 48.157164211614472], [-52.648098720904173, 47.53554840757549], [-53.069158291218336, 46.655498765644936], [-53.521456264853029, 46.618291734394823], [-54.178935512902527, 46.807065741556997], [-53.961868659060471, 47.625207017601909], [-54.240482143762122, 47.752279364607617], [-55.400773078011483, 46.88499380145312], [-55.997480841685835, 46.919720363953289], [-55.291219041552765, 47.389562486350982], [-56.250798712780508, 47.632545070987383], [-57.325229254777085, 47.572807115257987], [-59.26601518414676, 47.603347886742498], [-59.41949418805369, 47.89945384377485], [-58.796586473207398, 48.251525376979473], [-59.23162451845652, 48.523188381537793], [-58.391804979065213, 49.125580552764163], [-57.358689744686025, 50.718274034215845], [-56.738650071831998, 51.287438259478527], [-55.87097693543528, 51.632094224649187], [-55.406974249886602, 51.588272610065722], [-55.600218268442077, 51.317074693397913], [-56.134035814017111, 50.687009792679298]]], [[[-133.180004041711669, 54.169975490935308], [-132.710007884431292, 54.040009315423518], [-131.749989584003259, 54.120004380909208], [-132.049480347350965, 52.984621487024519], [-131.179042521826574, 52.18043284769827], [-131.577829549822894, 52.182370713909236], [-132.180428426778519, 52.639707139692391], [-132.549992432313843, 53.100014960332132], [-133.054611178755493, 53.411468817755363], [-133.239664482792676, 53.851080227262386], [-133.180004041711669, 54.169975490935308]]], [[[-79.26582, 62.158675], [-79.65752, 61.63308], [-80.09956, 61.7181], [-80.36215, 62.01649], [-80.315395, 62.085565], [-79.92939, 62.3856], [-79.52002, 62.36371], [-79.26582, 62.158675]]], [[[-81.89825, 62.7108], [-83.06857, 62.15922], [-83.77462, 62.18231], [-83.99367, 62.4528], [-83.25048, 62.91409], [-81.87699, 62.90458], [-81.89825, 62.7108]]], [[[-85.161307949549851, 65.657284654392797], [-84.975763719405933, 65.217518215588981], [-84.464012010419495, 65.371772365980163], [-83.88262630891974, 65.109617824963536], [-82.78757687043877, 64.766693020274673], [-81.642013719392509, 64.455135809986942], [-81.553440314444245, 63.979609280037131], [-80.817361212878851, 64.057485663500998], [-80.103451300766594, 63.725981350348597], [-80.991019863595653, 63.41124603947496], [-82.547178107416997, 63.651722317145229], [-83.108797573565042, 64.101875718839707], [-84.100416632813847, 63.569711819098004], [-85.523404710618991, 63.052379055424076], [-85.866768764982339, 63.637252916103542], [-87.221983201836721, 63.541238104905212], [-86.352759772471259, 64.035833238370699], [-86.224886440765133, 64.822916978608262], [-85.883847825854858, 65.738778388117041], [-85.161307949549851, 65.657284654392797]]], [[[-75.86588, 67.14886], [-76.98687, 67.09873], [-77.2364, 67.58809], [-76.81166, 68.14856], [-75.89521, 68.28721], [-75.1145, 68.01036], [-75.10333, 67.58202], [-75.21597, 67.44425], [-75.86588, 67.14886]]], [[[-95.647681203800488, 69.107690358321761], [-96.269521203800579, 68.757040358321731], [-97.61740120380054, 69.060030358321782], [-98.431801203800504, 68.950700358321768], [-99.797401203800504, 69.400030358321786], [-98.917401203800523, 69.710030358321788], [-98.218261203800466, 70.143540358321744], [-97.157401203800532, 69.860030358321794], [-96.557401203800524, 69.680030358321758], [-96.257401203800498, 69.490030358321761], [-95.647681203800488, 69.107690358321761]]], [[[-90.5471, 69.49766], [-90.55151, 68.47499], [-89.21515, 69.25873], [-88.01966, 68.61508], [-88.31749, 67.87338], [-87.35017, 67.19872], [-86.30607, 67.92146], [-85.57664, 68.78456], [-85.52197, 69.88211], [-84.10081, 69.80539], [-82.62258, 69.65826], [-81.28043, 69.16202], [-81.2202, 68.66567], [-81.96436, 68.13253], [-81.25928, 67.59716], [-81.38653, 67.11078], [-83.34456, 66.41154], [-84.73542, 66.2573], [-85.76943, 66.55833], [-86.0676, 66.05625], [-87.03143, 65.21297], [-87.32324, 64.77563], [-88.48296, 64.09897], [-89.91444, 64.03273], [-90.70398, 63.61017], [-90.77004, 62.96021], [-91.93342, 62.83508], [-93.15698, 62.02469], [-94.24153, 60.89865], [-94.62931, 60.11021], [-94.6846, 58.94882], [-93.21502, 58.78212], [-92.76462, 57.84571], [-92.297029999999893, 57.08709], [-90.89769, 57.28468], [-89.03953, 56.85172], [-88.03978, 56.47162], [-87.32421, 55.99914], [-86.07121, 55.72383], [-85.01181, 55.3026], [-83.36055, 55.24489], [-82.27285, 55.14832], [-82.4362, 54.28227], [-82.12502, 53.27703], [-81.40075, 52.15788], [-79.91289, 51.20842], [-79.14301, 51.53393], [-78.60191, 52.56208], [-79.12421, 54.14145], [-79.82958, 54.66772], [-78.22874, 55.13645], [-77.0956, 55.83741], [-76.54137, 56.53423], [-76.62319, 57.20263], [-77.30226, 58.05209], [-78.51688, 58.80458], [-77.33676, 59.85261], [-77.77272, 60.75788], [-78.10687, 62.31964], [-77.41067, 62.55053], [-75.69621, 62.2784], [-74.6682, 62.18111], [-73.83988, 62.4438], [-72.90853, 62.10507], [-71.67708, 61.52535], [-71.37369, 61.13717], [-69.59042, 61.06141], [-69.62033, 60.22125], [-69.2879, 58.95736], [-68.37455, 58.80106], [-67.64976, 58.21206], [-66.20178, 58.76731], [-65.24517, 59.87071], [-64.58352, 60.33558], [-63.80475, 59.4426], [-62.50236, 58.16708], [-61.39655, 56.96745], [-61.79866, 56.33945], [-60.46853, 55.77548], [-59.56962, 55.20407], [-57.97508, 54.94549], [-57.3332, 54.6265], [-56.93689, 53.78032], [-56.15811, 53.64749], [-55.75632, 53.27036], [-55.68338, 52.14664], [-56.40916, 51.7707], [-57.12691, 51.41972], [-58.77482, 51.0643], [-60.03309, 50.24277], [-61.72366, 50.08046], [-63.86251, 50.29099], [-65.36331, 50.2982], [-66.39905, 50.22897], [-67.23631, 49.51156], [-68.51114, 49.06836], [-69.95362, 47.74488], [-71.10458, 46.82171], [-70.25522, 46.98606], [-68.65, 48.3], [-66.55243, 49.1331], [-65.05626, 49.23278], [-64.17099, 48.74248], [-65.11545, 48.07085], [-64.79854, 46.99297], [-64.47219, 46.23849], [-63.17329, 45.73902], [-61.52072, 45.88377], [-60.51815, 47.00793], [-60.4486, 46.28264], [-59.80287, 45.9204], [-61.03988, 45.26525], [-63.25471, 44.67014], [-64.24656, 44.26553], [-65.36406, 43.54523], [-66.1234, 43.61867], [-66.16173, 44.46512], [-64.42549, 45.29204], [-66.02605, 45.25931], [-67.13741, 45.13753], [-67.79134, 45.70281], [-67.79046, 47.06636], [-68.23444, 47.35486], [-68.905, 47.185], [-69.237216, 47.447781], [-69.99997, 46.69307], [-70.305, 45.915], [-70.66, 45.46], [-71.08482, 45.30524], [-71.405, 45.255], [-71.50506, 45.0082], [-73.34783, 45.00738], [-74.867, 45.00048], [-75.31821, 44.81645], [-76.375, 44.09631], [-76.5, 44.018458893758712], [-76.820034145805565, 43.628784288093748], [-77.737885097957687, 43.62905558936329], [-78.720279914042365, 43.625089423184868], [-79.171673550111862, 43.466339423184216], [-79.01, 43.27], [-78.92, 42.965], [-78.939362148743683, 42.863611355148031], [-80.247447679347928, 42.366199856122584], [-81.277746548167144, 42.209025987306845], [-82.439277716791608, 41.675105088867149], [-82.690089280920162, 41.675105088867149], [-83.029810146806909, 41.832795722005834], [-83.141999681312555, 41.975681057292825], [-83.12, 42.08], [-82.9, 42.43], [-82.43, 42.98], [-82.137642381503881, 43.571087551439909], [-82.337763125431053, 44.44], [-82.550924648758169, 45.347516587905368], [-83.592850714843067, 45.816893622412373], [-83.469550747394621, 45.994686387712584], [-83.616130947590563, 46.116926988299056], [-83.890765347005726, 46.116926988299056], [-84.091851264161463, 46.27541860613816], [-84.14211951367335, 46.512225857115723], [-84.3367, 46.40877], [-84.6049, 46.4396], [-84.543748745445853, 46.538684190449132], [-84.779238247399888, 46.637101955749038], [-84.876079881514855, 46.900083319682366], [-85.652363247403414, 47.220218817730498], [-86.461990831228249, 47.553338019392037], [-87.439792623300207, 47.94], [-88.378114183286698, 48.302917588893727], [-89.272917446636654, 48.019808254582657], [-89.6, 48.01], [-90.83, 48.27], [-91.64, 48.14], [-92.61, 48.45], [-93.63087, 48.60926], [-94.32914, 48.67074], [-94.64, 48.84], [-94.81758, 49.38905], [-95.15609, 49.38425], [-95.159069509172014, 49.0], [-97.228720000004799, 49.0007], [-100.65, 49.0], [-104.04826, 48.99986], [-107.05, 49.0], [-110.05, 49.0], [-113.0, 49.0], [-116.04818, 49.0], [-117.03121, 49.0], [-120.0, 49.0], [-122.84, 49.0], [-122.97421, 49.002537777777789], [-124.91024, 49.98456], [-125.62461, 50.41656], [-127.43561, 50.83061], [-127.99276, 51.71583], [-127.85032, 52.32961], [-129.12979, 52.75538], [-129.30523, 53.56159], [-130.51497, 54.28757], [-130.53611, 54.80278], [-129.98, 55.285], [-130.00778, 55.91583], [-131.70781, 56.55212], [-132.73042, 57.69289], [-133.35556, 58.41028], [-134.27111, 58.86111], [-134.945, 59.27056], [-135.47583, 59.78778], [-136.47972, 59.46389], [-137.4525, 58.905], [-138.34089, 59.56211], [-139.039, 60.0], [-140.013, 60.27682], [-140.99778, 60.30639], [-140.9925, 66.00003], [-140.986, 69.712], [-139.12052, 69.47102], [-137.54636, 68.99002], [-136.50358, 68.89804], [-135.62576, 69.31512], [-134.41464, 69.62743], [-132.92925, 69.50534], [-131.43136, 69.94451], [-129.79471, 70.19369], [-129.10773, 69.77927], [-128.36156, 70.01286], [-128.13817, 70.48384], [-127.44712, 70.37721], [-125.75632, 69.48058], [-124.42483, 70.1584], [-124.28968, 69.39969], [-123.06108, 69.56372], [-122.6835, 69.85553], [-121.47226, 69.79778], [-119.94288, 69.37786], [-117.60268, 69.01128], [-116.22643, 68.84151], [-115.2469, 68.90591], [-113.89794, 68.3989], [-115.30489, 67.90261], [-113.49727, 67.68815], [-110.798, 67.80612], [-109.94619, 67.98104], [-108.8802, 67.38144], [-107.79239, 67.88736], [-108.81299, 68.31164], [-108.16721, 68.65392], [-106.95, 68.7], [-106.15, 68.8], [-105.34282, 68.56122], [-104.33791, 68.018], [-103.22115, 68.09775], [-101.45433, 67.64689], [-99.90195, 67.80566], [-98.4432, 67.78165], [-98.5586, 68.40394], [-97.66948, 68.57864], [-96.11991, 68.23939], [-96.12588, 67.29338], [-95.48943, 68.0907], [-94.685, 68.06383], [-94.23282, 69.06903], [-95.30408, 69.68571], [-96.47131, 70.08976], [-96.39115, 71.19482], [-95.2088, 71.92053], [-93.88997, 71.76015], [-92.87818, 71.31869], [-91.51964, 70.19129], [-92.40692, 69.69997], [-90.5471, 69.49766]]], [[[-114.167169999999871, 73.12145], [-114.66634, 72.65277], [-112.441019999999867, 72.9554], [-111.05039, 72.4504], [-109.920349999999857, 72.96113], [-109.00654, 72.63335], [-108.188349999999886, 71.65089], [-107.68599, 72.06548], [-108.39639, 73.08953], [-107.51645, 73.23598], [-106.522589999999866, 73.07601], [-105.402459999999877, 72.67259], [-104.77484, 71.6984], [-104.464759999999814, 70.99297], [-102.78537, 70.49776], [-100.980779999999868, 70.02432], [-101.089289999999892, 69.58447000000011], [-102.731159999999875, 69.50402], [-102.09329, 69.11962], [-102.43024, 68.75282], [-104.24, 68.91], [-105.96, 69.180000000000135], [-107.12254, 69.11922], [-108.999999999999872, 68.78], [-111.534148875200117, 68.630059156817921], [-113.3132, 68.53554], [-113.854959999999807, 69.007440000000102], [-115.22, 69.28], [-116.10794, 69.16821], [-117.34, 69.960000000000107], [-116.674729999999869, 70.06655], [-115.13112, 70.2373], [-113.72141, 70.19237], [-112.4161, 70.36638], [-114.35, 70.6], [-116.48684, 70.52045], [-117.9048, 70.540560000000127], [-118.43238, 70.9092], [-116.11311, 71.30918], [-117.65568, 71.2952], [-119.40199, 71.55859], [-118.56267, 72.30785], [-117.866419999999877, 72.70594], [-115.18909, 73.314590000000109], [-114.167169999999871, 73.12145]]], [[[-104.5, 73.42], [-105.38, 72.76], [-106.94, 73.46], [-106.6, 73.6], [-105.26, 73.64], [-104.5, 73.42]]], [[[-76.34, 73.102684989953005], [-76.251403808593736, 72.826385498046861], [-77.314437866210895, 72.85554504394527], [-78.391670227050795, 72.876655578613253], [-79.486251831054645, 72.742202758789062], [-79.775833129882827, 72.80290222167973], [-80.876098632812514, 73.333183288574205], [-80.833885192871051, 73.693183898925767], [-80.353057861328111, 73.75971984863277], [-78.064437866210923, 73.651931762695327], [-76.34, 73.102684989953005]]], [[[-86.562178514334107, 73.157447007938444], [-85.774371304044521, 72.534125881633798], [-84.850112474288224, 73.34027822538711], [-82.315590176100969, 73.750950832810574], [-80.600087653307611, 72.716543687624181], [-80.748941616524391, 72.061906643350753], [-78.770638597310764, 72.352173163534147], [-77.824623989559569, 72.749616604291035], [-75.605844692675717, 72.243678493937381], [-74.228616095664975, 71.767144273557889], [-74.099140794557698, 71.330840155717638], [-72.242225714797641, 71.556924546994495], [-71.200015428335192, 70.920012518997211], [-68.78605424668487, 70.525023708774242], [-67.914970465756923, 70.121947536897594], [-66.969033372654152, 69.18608734809186], [-68.805122850200533, 68.720198472764409], [-66.449866095633851, 68.067163397892003], [-64.862314419195215, 67.847538560651614], [-63.424934454996745, 66.928473212340649], [-61.851981370680569, 66.862120673277829], [-62.163176845942296, 66.160251369889593], [-63.91844438338417, 64.998668524832837], [-65.148860236253611, 65.426032619886669], [-66.72121904159853, 66.388041083432185], [-68.015016038673949, 66.262725735124391], [-68.141287400979152, 65.689789130304362], [-67.089646165623392, 65.108455105236985], [-65.732080451099748, 64.64840566675862], [-65.320167609301265, 64.382737128346051], [-64.669406297449669, 63.392926744227474], [-65.013803880458894, 62.674185085695974], [-66.275044725190455, 62.945098781986069], [-68.783186204692711, 63.745670071051805], [-67.369680752213029, 62.883965562584869], [-66.328297288667201, 62.28007477482204], [-66.165568203380147, 61.930897121825879], [-68.877366502544632, 62.330149237712803], [-71.023437059193824, 62.910708116295829], [-72.23537858751898, 63.397836005295154], [-71.886278449171286, 63.679989325608837], [-73.37830624051837, 64.193963121183813], [-74.834418911422588, 64.679075629323776], [-74.818502570276706, 64.389093329517962], [-77.709979824520019, 64.229542344816778], [-78.55594885935416, 64.572906399180127], [-77.897281053361908, 65.309192206474776], [-76.018274298797181, 65.326968899183143], [-73.95979529488271, 65.454764716240888], [-74.293883429649625, 65.81177134872938], [-73.94491248238262, 66.310578111426722], [-72.65116716173938, 67.284575507263853], [-72.926059943316076, 67.726925767682374], [-73.311617804645721, 68.069437160912898], [-74.8433072577768, 68.554627183701271], [-76.869100918266739, 68.894735622830254], [-76.228649054657339, 69.147769273547411], [-77.28736996123709, 69.769540106883269], [-78.168633999326588, 69.826487535268896], [-78.95724219431672, 70.166880194775402], [-79.492455003563649, 69.871807766388898], [-81.305470954091732, 69.743185126414332], [-84.944706183598456, 69.966634019644388], [-87.060003424817864, 70.260001125765356], [-88.681713223001495, 70.410741278760796], [-89.513419562523012, 70.762037665480975], [-88.467721116880753, 71.218185533321318], [-89.888151211287465, 71.222552191849942], [-90.205160285181989, 72.235074367960792], [-89.43657670770493, 73.129464219852352], [-88.408241543312784, 73.537888902471209], [-85.826151089200906, 73.803815823045213], [-86.562178514334107, 73.157447007938444]]], [[[-100.35642, 73.84389], [-99.16387, 73.63339], [-97.38, 73.76], [-97.12, 73.47], [-98.05359, 72.99052], [-96.54, 72.56], [-96.72, 71.66], [-98.35966, 71.27285], [-99.32286, 71.35639], [-100.01482, 71.73827], [-102.5, 72.51], [-102.48, 72.83], [-100.43836, 72.70588], [-101.54, 73.36], [-100.35642, 73.84389]]], [[[-93.196295539100205, 72.771992499473342], [-94.26904659704725, 72.024596259235949], [-95.409855516322637, 72.061880805134578], [-96.033745083382428, 72.940276801231789], [-96.01826799191096, 73.437429918095788], [-95.495793423224001, 73.862416897264154], [-94.503657599652328, 74.134906724739196], [-92.420012173211745, 74.100025132942179], [-90.509792853542578, 73.85673248971203], [-92.003965216829869, 72.966244208458477], [-93.196295539100205, 72.771992499473342]]], [[[-120.46, 71.383601793087578], [-123.09219, 70.90164], [-123.62, 71.34], [-125.92894873747332, 71.868688463011395], [-125.499999999999872, 72.292260811795003], [-124.80729, 73.02256], [-123.94, 73.680000000000135], [-124.917749999999899, 74.292750000000112], [-121.53788, 74.44893], [-120.10978, 74.24135], [-117.55564, 74.18577], [-116.58442, 73.89607], [-115.51081, 73.47519], [-116.767939999999882, 73.22292], [-119.22, 72.52], [-120.46, 71.82], [-120.46, 71.383601793087578]]], [[[-93.612755906940464, 74.979997260224437], [-94.156908738973812, 74.59234650338685], [-95.60868058956558, 74.666863918751758], [-96.820932176484561, 74.927623196096576], [-96.288587409229791, 75.377828274223333], [-94.850819871789113, 75.647217515760886], [-93.977746548217908, 75.296489569795952], [-93.612755906940464, 74.979997260224437]]], [[[-98.5, 76.72], [-97.735585, 76.25656], [-97.704415, 75.74344], [-98.16, 75.0], [-99.80874, 74.89744], [-100.88366, 75.05736], [-100.86292, 75.64075], [-102.50209, 75.5638], [-102.56552, 76.3366], [-101.48973, 76.30537], [-99.98349, 76.64634], [-98.57699, 76.58859], [-98.5, 76.72]]], [[[-108.21141, 76.20168], [-107.81943, 75.84552], [-106.92893, 76.01282], [-105.881, 75.9694], [-105.70498, 75.47951], [-106.31347, 75.00527], [-109.7, 74.85], [-112.22307, 74.41696], [-113.74381, 74.39427], [-113.87135, 74.72029], [-111.79421, 75.1625], [-116.31221, 75.04343], [-117.7104, 75.2222], [-116.34602, 76.19903], [-115.40487, 76.47887], [-112.59056, 76.14134], [-110.81422, 75.54919], [-109.0671, 75.47321], [-110.49726, 76.42982], [-109.5811, 76.79417], [-108.54859, 76.67832], [-108.21141, 76.20168]]], [[[-94.684085862999439, 77.097878323058367], [-93.573921068073105, 76.776295884906062], [-91.605023159536586, 76.778517971494594], [-90.741845872749209, 76.449597479956807], [-90.969661424507976, 76.074013170059445], [-89.822237921899244, 75.847773749485626], [-89.187082892599776, 75.610165513807615], [-87.838276333349611, 75.566188869927217], [-86.379192267588664, 75.482421373182163], [-84.789625210290595, 75.699204006646497], [-82.753444586910049, 75.784315090631225], [-81.12853084992436, 75.713983466282016], [-80.05751095245914, 75.336848863415867], [-79.833932868148324, 74.923127346487192], [-80.457770758775823, 74.657303778777774], [-81.948842536125511, 74.442459011524321], [-83.2288936022114, 74.564027818490928], [-86.097452358733292, 74.410032050261137], [-88.150350307960196, 74.392307033984977], [-89.764722052758358, 74.515555325001117], [-92.422440965529418, 74.837757880340973], [-92.768285488642789, 75.38681997344213], [-92.889905972041717, 75.882655341282629], [-93.893824022175977, 76.319243679500516], [-95.962457445035795, 76.44138092722244], [-97.121378953829463, 76.751077785947587], [-96.745122850312342, 77.161388658345132], [-94.684085862999439, 77.097878323058367]]], [[[-116.198586595507322, 77.645286770326194], [-116.335813361458349, 76.876961575010554], [-117.106050584768766, 76.530031846819114], [-118.040412157038119, 76.481171780087081], [-119.899317586885687, 76.053213406061971], [-121.499995077126471, 75.900018622532784], [-122.85492448615895, 76.116542873835684], [-122.854925293603188, 76.116542873835684], [-121.157535360328239, 76.864507554828336], [-119.103938971821023, 77.512219957174608], [-117.570130784965954, 77.498318996888102], [-116.198586595507322, 77.645286770326194]]], [[[-93.840003017943971, 77.51999726023449], [-94.295608283245244, 77.491342678528682], [-96.169654100310055, 77.55511139597688], [-96.436304490936109, 77.83462921824362], [-94.422577277386353, 77.820004787904978], [-93.720656297565867, 77.634331366680314], [-93.840003017943971, 77.51999726023449]]], [[[-110.186938035912945, 77.697014879050286], [-112.051191169058455, 77.409228827616843], [-113.534278937619035, 77.732206529441143], [-112.724586758253835, 78.051050116681935], [-111.264443325630822, 78.152956041161545], [-109.854451870547067, 77.996324774884812], [-110.186938035912945, 77.697014879050286]]], [[[-109.663145718202557, 78.601972561345676], [-110.88131425661885, 78.406919867659994], [-112.542091437615142, 78.407901719873493], [-112.525890876091566, 78.550554511215225], [-111.500010342233367, 78.849993598130538], [-110.96366065147599, 78.804440823065207], [-109.663145718202557, 78.601972561345676]]], [[[-95.830294969449312, 78.056941229963243], [-97.309842902397975, 77.85059723582178], [-98.124289313533964, 78.082856960757567], [-98.55286780474664, 78.458105373845086], [-98.631984422585504, 78.871930243638374], [-97.337231411512604, 78.831984361476756], [-96.754398769908761, 78.765812689926989], [-95.559277920294562, 78.41831452098026], [-95.830294969449312, 78.056941229963243]]], [[[-100.060191820052111, 78.324754340315891], [-99.670939093813601, 77.907544664207393], [-101.303940192452984, 78.018984890444798], [-102.949808722733025, 78.343228664860206], [-105.176132778731514, 78.38033234324574], [-104.210429450277147, 78.677420152491777], [-105.419580451258511, 78.918335679836431], [-105.492289191493128, 79.301593939929177], [-103.529282396237917, 79.16534902619162], [-100.8251580472688, 78.80046173777869], [-100.060191820052111, 78.324754340315891]]], [[[-87.02, 79.66], [-85.81435, 79.3369], [-87.18756, 79.0393], [-89.03535, 78.28723], [-90.80436, 78.21533], [-92.87669, 78.34333], [-93.95116, 78.75099], [-93.93574, 79.11373], [-93.14524, 79.3801], [-94.974, 79.37248], [-96.07614, 79.70502], [-96.70972, 80.15777], [-96.01644, 80.60233], [-95.32345, 80.90729], [-94.29843, 80.97727], [-94.73542, 81.20646], [-92.40984, 81.25739], [-91.13289, 80.72345], [-89.45, 80.509322033898258], [-87.81, 80.32], [-87.02, 79.66]]], [[[-68.5, 83.106321516765732], [-65.82735, 83.02801], [-63.68, 82.9], [-61.85, 82.6286], [-61.89388, 82.36165], [-64.334, 81.92775], [-66.75342, 81.72527], [-67.65755, 81.50141], [-65.48031, 81.50657], [-67.84, 80.9], [-69.4697, 80.61683], [-71.18, 79.8], [-73.2428, 79.63415], [-73.88, 79.430162204802073], [-76.90773, 79.32309], [-75.52924, 79.19766], [-76.22046, 79.01907], [-75.39345, 78.52581], [-76.34354, 78.18296], [-77.88851, 77.89991], [-78.36269, 77.50859], [-79.75951, 77.20968], [-79.61965, 76.98336], [-77.91089, 77.022045], [-77.88911, 76.777955], [-80.56125, 76.17812], [-83.17439, 76.45403], [-86.11184, 76.29901], [-87.6, 76.42], [-89.49068, 76.47239], [-89.6161, 76.95213], [-87.76739, 77.17833], [-88.26, 77.9], [-87.65, 77.970222222222205], [-84.97634, 77.53873], [-86.34, 78.18], [-87.96192, 78.37181], [-87.15198, 78.75867], [-85.37868, 78.9969], [-85.09495, 79.34543], [-86.50734, 79.73624], [-86.93179, 80.25145], [-84.19844, 80.20836], [-83.408695652173819, 80.1], [-81.84823, 80.46442], [-84.1, 80.58], [-87.59895, 80.51627], [-89.36663, 80.85569], [-90.2, 81.26], [-91.36786, 81.5531], [-91.58702, 81.89429], [-90.1, 82.085], [-88.93227, 82.11751], [-86.97024, 82.27961], [-85.5, 82.652273458057024], [-84.260005, 82.6], [-83.18, 82.32], [-82.42, 82.86], [-81.1, 83.02], [-79.30664, 83.13056], [-76.25, 83.172058823529369], [-75.71878, 83.06404], [-72.83153, 83.23324], [-70.665765, 83.169780758382828], [-68.5, 83.106321516765732]]]] } }, + { "type": "Feature", "properties": { "admin": "Switzerland", "name": "Switzerland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.594226108446346, 47.525058091820256], [9.632931756232974, 47.347601223329974], [9.479969516649019, 47.102809963563367], [9.932448357796657, 46.920728054382948], [10.442701450246627, 46.893546250997424], [10.36337812667861, 46.483571275409851], [9.922836541390378, 46.314899400409182], [9.182881707403054, 46.440214748716976], [8.966305779667804, 46.036931871111186], [8.489952426801322, 46.005150865251672], [8.316629672894377, 46.163642483090847], [7.755992058959832, 45.824490057959302], [7.273850945676655, 45.776947740250769], [6.843592970414504, 45.991146552100595], [6.500099724970424, 46.429672756529428], [6.022609490593537, 46.272989813820466], [6.037388950229, 46.725778713561859], [6.768713820023605, 47.287708238303686], [6.736571079138058, 47.541801255882838], [7.192202182655505, 47.449765529971003], [7.466759067422228, 47.620581976911794], [8.31730146651415, 47.613579820336255], [8.522611932009765, 47.830827541691285], [9.594226108446346, 47.525058091820256]]] } }, + { "type": "Feature", "properties": { "admin": "Chile", "name": "Chile", "continent": "South America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-68.634010227583147, -52.636370458874353], [-68.633349999999879, -54.8695], [-67.56244, -54.87001], [-66.95992, -54.89681], [-67.291029999999878, -55.30124], [-68.148629999999841, -55.61183], [-68.639990810811796, -55.580017999086877], [-69.2321, -55.49906], [-69.95809, -55.19843], [-71.00568, -55.05383], [-72.2639, -54.49514], [-73.2852, -53.957519999999874], [-74.66253, -52.83749], [-73.8381, -53.04743], [-72.43418, -53.7154], [-71.10773, -54.07433], [-70.591779999999787, -53.61583], [-70.26748, -52.93123], [-69.345649999999878, -52.5183], [-68.634010227583147, -52.636370458874353]]], [[[-68.219913092711224, -21.49434661223183], [-67.828179897722634, -22.872918796482178], [-67.106673550063604, -22.735924574476392], [-66.985233934177629, -22.986348565362825], [-67.328442959244128, -24.025303236590908], [-68.417652960876111, -24.518554782816874], [-68.386001146097342, -26.185016371365229], [-68.594799770772667, -26.50690886811126], [-68.295541551370391, -26.899339694935787], [-69.001234910748266, -27.521213881136127], [-69.656130337183143, -28.459141127233686], [-70.013550381129861, -29.367922865518544], [-69.919008348251921, -30.336339206668306], [-70.535068935819439, -31.365010267870279], [-70.074399380153622, -33.09120981214803], [-69.814776984319209, -33.273886000299839], [-69.817309129501453, -34.193571465798279], [-70.388049485949082, -35.169687595359441], [-70.364769253201658, -36.005088799789931], [-71.121880662709771, -36.65812387466233], [-71.118625047475419, -37.576827487947192], [-70.814664272734703, -38.552995293940732], [-71.413516608349042, -38.916022230791107], [-71.680761277946445, -39.808164157878061], [-71.915734015577542, -40.832339369470716], [-71.746803758415453, -42.051386407235988], [-72.148898078078517, -42.254888197601375], [-71.915423956983901, -43.408564548517404], [-71.464056159130493, -43.787611179378324], [-71.793622606071935, -44.207172133156099], [-71.329800788036195, -44.407521661151677], [-71.222778896759721, -44.784242852559409], [-71.659315558545316, -44.973688653341434], [-71.552009446891233, -45.560732924177117], [-71.917258470330196, -46.884838148791786], [-72.44735531278026, -47.738532810253517], [-72.331160854771937, -48.244238376661819], [-72.648247443314929, -48.878618259476774], [-73.415435757120022, -49.318436374712952], [-73.328050910114456, -50.378785088909865], [-72.975746832964617, -50.741450290734299], [-72.309973517532342, -50.677009779666342], [-72.329403856074023, -51.425956312872394], [-71.914803839796321, -52.009022305865912], [-69.498362189396076, -52.142760912637236], [-68.571545376241332, -52.299443855346247], [-69.461284349226617, -52.291950772663924], [-69.94277950710611, -52.537930590373243], [-70.8451016913545, -52.899200528525711], [-71.006332160105217, -53.833252042201345], [-71.429794684520928, -53.856454760300373], [-72.557942877884855, -53.531410001184447], [-73.702756720662862, -52.835069268607249], [-73.702756720662862, -52.835070076051487], [-74.946763475225154, -52.262753588419017], [-75.260026007778507, -51.62935475037321], [-74.976632453089806, -51.043395684615675], [-75.47975419788348, -50.378371677451547], [-75.608015102831942, -48.673772881871784], [-75.182769741502128, -47.711919447623153], [-74.126580980104677, -46.939253431995084], [-75.644395311165439, -46.647643324572016], [-74.69215369332305, -45.76397633238097], [-74.351709357384252, -44.10304412208788], [-73.240356004515192, -44.454960625995611], [-72.717803921179765, -42.383355808278985], [-73.388899909138232, -42.117532240569567], [-73.701335618774834, -43.365776462579738], [-74.33194312203257, -43.224958184584395], [-74.017957119427152, -41.794812920906828], [-73.677099372029943, -39.942212823243111], [-73.217592536090663, -39.258688653318508], [-73.505559455037044, -38.282882582351064], [-73.588060879191076, -37.156284681956016], [-73.166717088499283, -37.123780206044351], [-72.553136969681717, -35.508840020491022], [-71.861732143832555, -33.909092706031522], [-71.438450486929895, -32.418899428030819], [-71.668720669222424, -30.920644626592516], [-71.370082567007714, -30.095682061484997], [-71.48989437527645, -28.861442152625909], [-70.905123867461569, -27.640379734001193], [-70.724953986275963, -25.705924167587209], [-70.403965827095035, -23.628996677344542], [-70.091245897080668, -21.393319187101223], [-70.164419725205974, -19.756468194256183], [-70.372572394477714, -18.347975355708879], [-69.858443569605797, -18.092693780187027], [-69.590423753523979, -17.580011895419286], [-69.100246955019401, -18.260125420812653], [-68.966818406841824, -18.981683444904089], [-68.442225104430918, -19.405068454671419], [-68.757167121033703, -20.37265797290447], [-68.219913092711224, -21.49434661223183]]]] } }, + { "type": "Feature", "properties": { "admin": "China", "name": "China", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[110.339187860151526, 18.678395087147603], [109.475209588663702, 18.19770091396861], [108.655207961056135, 18.507681993071397], [108.626217482540426, 19.367887885001974], [109.119055617308007, 19.821038519769385], [110.211598748822837, 20.101253973872073], [110.786550734502228, 20.077534491450077], [111.01005130416462, 19.695929877190732], [110.570646600386794, 19.255879218009305], [110.339187860151526, 18.678395087147603]]], [[[127.657407261262378, 49.760270494172929], [129.397817824420429, 49.440600084015429], [130.58229332898236, 48.729687404976112], [130.987281528853828, 47.790132351261391], [132.506671991099495, 47.788969631534876], [133.373595819228001, 48.183441677434914], [135.026311476786702, 48.478229885443902], [134.500813836810607, 47.578439846377833], [134.112362095272601, 47.212467352886719], [133.76964399631288, 46.116926988299056], [133.097126906466428, 45.14406647397216], [131.883454217659562, 45.32116160743643], [131.025212030156069, 44.967953192721573], [131.288555129115537, 44.111519680348252], [131.144687941614848, 42.929989732426932], [130.633866408409801, 42.903014634770543], [130.640015903852429, 42.39500946712527], [129.994267205933227, 42.985386867843793], [129.596668735879462, 42.424981797854592], [128.05221520397231, 41.994284572917984], [128.208433058790717, 41.466771552082534], [127.343782993683021, 41.503151760415953], [126.869083286649854, 41.816569322266155], [126.18204511932943, 41.107336127276362], [125.079941847840587, 40.569823716792449], [124.265624627785314, 39.928493353834135], [122.86757042856101, 39.637787583976255], [122.131387974130917, 39.170451768544623], [121.054554478032856, 38.89747101496291], [121.585994907722466, 39.360853583324136], [121.376757033372641, 39.750261338859524], [122.168595005381007, 40.422442531896046], [121.640358514493528, 40.946389878903304], [120.768628778161954, 40.593388169917596], [119.639602085449056, 39.898055935214209], [119.023463983233015, 39.252333075511096], [118.042748651197897, 39.204273993479674], [117.532702264477052, 38.73763580988409], [118.05969852098967, 38.061475531561051], [118.878149855628351, 37.897325344385898], [118.911636183753501, 37.448463853498723], [119.702802362142037, 37.156388658185072], [120.823457472823648, 37.870427761377968], [121.711258579597938, 37.481123358707165], [122.357937453298462, 37.454484157860684], [122.519994744965814, 36.930614325501828], [121.104163853033029, 36.651329047180432], [120.63700890511457, 36.111439520811125], [119.66456180224607, 35.609790554337728], [119.151208123858567, 34.909859117160458], [120.227524855633717, 34.360331936168613], [120.620369093916565, 33.37672272392512], [121.229014113450219, 32.460318711877186], [121.908145786630044, 31.692174384074683], [121.891919386890336, 30.949351508095098], [121.264257440273298, 30.676267401648712], [121.503519321784722, 30.14291494396425], [122.092113885589086, 29.832520453403156], [121.93842817595305, 29.018022365834803], [121.684438511238469, 28.225512600206677], [121.125661248866436, 28.135673122667178], [120.395473260582307, 27.053206895449385], [119.585496860839555, 25.740780544532605], [118.656871372554519, 24.547390855400234], [117.281606479970833, 23.624501451099714], [115.890735304835118, 22.782873236578094], [114.763827345846209, 22.668074042241663], [114.152546828265656, 22.223760077396204], [113.806779819800752, 22.548339748621423], [113.241077915501592, 22.051367499270462], [111.843592157032447, 21.550493679281512], [110.78546552942413, 21.39714386645533], [110.444039341271662, 20.34103261970639], [109.88986128137357, 20.282457383703441], [109.627655063924635, 21.008227037026725], [109.864488153118316, 21.395050970947516], [108.522812941524421, 21.715212307211821], [108.050180291782979, 21.552379869060101], [107.043420037872636, 21.8118989120299], [106.567273390735352, 22.21820486092474], [106.725403273548466, 22.794267889898375], [105.811247186305209, 22.976892401617899], [105.329209425886631, 23.352063300056976], [104.476858351664475, 22.819150092046918], [103.504514601660503, 22.703756618739217], [102.706992222100155, 22.708795070887696], [102.170435825613552, 22.464753119389336], [101.652017856861576, 22.318198757409554], [101.803119744882906, 21.174366766845051], [101.27002566936001, 21.201651923095167], [101.180005324307558, 21.436572984294052], [101.150032993578236, 21.849984442629015], [100.416537713627349, 21.558839423096654], [99.983489211021549, 21.742936713136451], [99.240898878987196, 22.118314317304559], [99.53199222208741, 22.949038804612591], [98.898749220782804, 23.142722072842581], [98.66026248575578, 24.063286037690002], [97.604719679762027, 23.897404690033049], [97.724609002679131, 25.083637193293036], [98.671838006589212, 25.91870250091349], [98.712093947344556, 26.743535874940243], [98.682690057370507, 27.508812160750658], [98.246230910233351, 27.747221381129172], [97.91198774616943, 28.335945136014367], [97.327113885490007, 28.261582749946339], [96.248833449287829, 28.411030992134467], [96.586590610747521, 28.830979519154361], [96.117678664131006, 29.452802028922513], [95.404802280664626, 29.031716620392157], [94.565990431702929, 29.27743805593996], [93.413347609432662, 28.640629380807233], [92.503118931043616, 27.896876329046442], [91.696656528696693, 27.771741848251615], [91.258853794319876, 28.040614325466343], [90.730513950567797, 28.064953925075738], [90.015828891971182, 28.296438503527177], [89.475810174521158, 28.042758897406365], [88.814248488320573, 27.299315904239389], [88.730325962278528, 28.086864732367552], [88.120440708369941, 27.876541652939572], [86.954517043000635, 27.974261786403524], [85.823319940131526, 28.203575954698742], [85.011638218123053, 28.642773952747369], [84.23457970575015, 28.839893703724691], [83.89899295444674, 29.320226141877633], [83.337115106137176, 29.463731594352193], [82.327512648450877, 30.115268052688204], [81.525804477874786, 30.422716986608659], [81.111256138029276, 30.183480943313402], [79.721366815107118, 30.882714748654728], [78.738894484374001, 31.515906073527045], [78.458446486326025, 32.61816437431272], [79.176128777995544, 32.483779812137747], [79.208891636068543, 32.994394639613738], [78.811086460285722, 33.506198025032397], [78.912268914713209, 34.321936346975768], [77.83745079947461, 35.494009507787794], [76.192848341785705, 35.89840342868785], [75.896897414050173, 36.666806138651872], [75.158027785140987, 37.133030910789152], [74.980002475895404, 37.419990139305888], [74.829985792952144, 37.990007025701445], [74.864815708316783, 38.378846340481587], [74.25751427602269, 38.606506862943476], [73.928852166646394, 38.505815334622717], [73.675379266254836, 39.431236884105566], [73.960013055318427, 39.660008449861714], [73.822243686828315, 39.893973497063136], [74.776862420556043, 40.366425279291619], [75.467827996730719, 40.56207225194867], [76.526368035797432, 40.427946071935132], [76.90448449087711, 41.066485907549648], [78.187196893226044, 41.185315863604799], [78.543660923175253, 41.582242540038713], [80.119430373051401, 42.12394074153822], [80.259990268885318, 42.34999929459908], [80.180150180994374, 42.920067857426844], [80.866206496101213, 43.180362046881008], [79.966106398441426, 44.917516994804622], [81.947070753918084, 45.317027492853143], [82.458925815769035, 45.539649563166499], [83.180483839860543, 47.330031236350735], [85.164290399113213, 47.000955715516099], [85.720483839870667, 47.452969468773077], [85.76823286330837, 48.455750637396896], [86.59877648310335, 48.549181626980605], [87.359970330762692, 49.214980780629148], [87.751264276076668, 49.297197984405464], [88.013832228551678, 48.599462795600594], [88.854297723346747, 48.069081732773007], [90.280825636763893, 47.693549099307901], [90.970809360724957, 46.88814606382293], [90.585768263718307, 45.719716091487491], [90.945539585334316, 45.286073309910243], [92.133890822318222, 45.115075995456429], [93.480733677141316, 44.97547211362], [94.688928664125356, 44.352331854828456], [95.306875441471504, 44.241330878265458], [95.762454868556688, 43.319449164394619], [96.349395786527808, 42.725635280928643], [97.451757440177971, 42.74888967546007], [99.515817498779995, 42.524691473961688], [100.845865513108279, 42.663804429691417], [101.833040399179936, 42.51487295182627], [103.312278273534787, 41.907468166667613], [104.522281935649005, 41.90834666601662], [104.964993931093431, 41.597409572916334], [106.129315627061658, 42.134327704428891], [107.744772576937976, 42.481515814781908], [109.243595819131428, 42.519446316084149], [110.412103306115299, 42.871233628911014], [111.129682244920218, 43.406834011400171], [111.82958784388137, 43.743118394539486], [111.667737257943202, 44.073175767587706], [111.348376906379428, 44.457441718110047], [111.87330610560025, 45.102079372735112], [112.436062453258842, 45.01164561622425], [113.463906691544196, 44.808893134127111], [114.46033165899604, 45.339816799493875], [115.985096470200133, 45.727235012386004], [116.717868280098855, 46.38820241961524], [117.421701287914246, 46.67273285581421], [118.874325799638711, 46.805412095723646], [119.663269891438745, 46.692679958678944], [119.772823927897562, 47.048058783550132], [118.866574334794947, 47.747060044946195], [118.064142694166719, 48.06673045510373], [117.295507440257438, 47.697709052107385], [116.308952671373234, 47.853410142602812], [115.742837355615734, 47.726544501326273], [115.485282017073018, 48.135382595403442], [116.191802199367601, 49.134598090199056], [116.67880089728618, 49.888531399121398], [117.879244419426371, 49.510983384796944], [119.288460728025839, 50.142882798862033], [119.279365675942358, 50.582907619827282], [120.182049595216924, 51.64356639261802], [120.738191359541972, 51.964115302124547], [120.725789015791975, 52.516226304730814], [120.177088657716865, 52.753886216841195], [121.003084751470226, 53.251401068731226], [122.245747918792858, 53.431725979213681], [123.571506789240843, 53.458804429734627], [125.068211297710434, 53.161044826868832], [125.946348911646169, 52.792798570356936], [126.564399041856959, 51.784255479532689], [126.939156528837657, 51.353894151405896], [127.287455682484904, 50.739797268265434], [127.657407261262378, 49.760270494172929]]]] } }, + { "type": "Feature", "properties": { "admin": "Ivory Coast", "name": "Côte d'Ivoire", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-2.856125047202397, 4.994475816259508], [-3.311084357100071, 4.984295559098014], [-4.008819545904941, 5.179813340674314], [-4.64991736491791, 5.168263658057084], [-5.834496222344525, 4.993700669775135], [-6.528769090185845, 4.705087795425015], [-7.518941209330434, 4.338288479017307], [-7.712159389669749, 4.364565944837721], [-7.63536821128403, 5.188159084489455], [-7.53971513511176, 5.313345241716517], [-7.570152553731686, 5.707352199725903], [-7.993692592795879, 6.126189683451541], [-8.311347622094017, 6.193033148621081], [-8.602880214868618, 6.467564195171659], [-8.385451626000572, 6.911800645368742], [-8.485445522485348, 7.395207831243068], [-8.439298468448696, 7.686042792181736], [-8.280703497744936, 7.687179673692156], [-8.221792364932197, 8.123328762235571], [-8.299048631208562, 8.316443589710302], [-8.203498907900878, 8.455453192575446], [-7.832100389019186, 8.575704250518625], [-8.079113735374348, 9.376223863152033], [-8.309616461612249, 9.789531968622439], [-8.22933712404682, 10.129020290563897], [-8.029943610048617, 10.206534939001711], [-7.89958980959237, 10.297382106970824], [-7.622759161804808, 10.147236232946792], [-6.850506557635057, 10.138993841996237], [-6.666460944027547, 10.430810655148447], [-6.493965013037267, 10.411302801958268], [-6.205222947606429, 10.524060777219132], [-6.050452032892266, 10.096360785355442], [-5.816926235365286, 10.222554633012191], [-5.404341599946973, 10.370736802609144], [-4.954653286143098, 10.152713934769732], [-4.779883592131966, 9.821984768101741], [-4.330246954760383, 9.610834865757139], [-3.980449184576684, 9.862344061721698], [-3.511898972986272, 9.900326239456216], [-2.827496303712706, 9.642460842319775], [-2.56218950032624, 8.219627793811481], [-2.983584967450326, 7.379704901555511], [-3.244370083011261, 6.2504715031135], [-2.810701463217839, 5.389051215024109], [-2.856125047202397, 4.994475816259508]]] } }, + { "type": "Feature", "properties": { "admin": "Cameroon", "name": "Cameroon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[13.07582238124675, 2.267097072759014], [12.951333855855605, 2.321615708826939], [12.359380323952218, 2.19281220133945], [11.751665480199787, 2.326757513839993], [11.276449008843711, 2.261050930180871], [9.649158155972627, 2.283866075037735], [9.795195753629455, 3.073404445809117], [9.404366896205998, 3.734526882335202], [8.948115675501068, 3.904128933117135], [8.744923943729416, 4.352215277519959], [8.488815545290889, 4.495617377129917], [8.500287713259693, 4.771982937026847], [8.757532993208626, 5.47966583904791], [9.233162876023043, 6.444490668153334], [9.522705926154398, 6.453482367372116], [10.118276808318255, 7.038769639509879], [10.497375115611417, 7.055357774275562], [11.058787876030349, 6.644426784690593], [11.745774366918509, 6.981382961449753], [11.839308709366801, 7.397042344589434], [12.063946160539556, 7.799808457872301], [12.218872104550597, 8.305824082874322], [12.753671502339214, 8.717762762888993], [12.955467970438971, 9.417771714714702], [13.1675997249971, 9.64062632897341], [13.308676385153914, 10.160362046748926], [13.572949659894558, 10.798565985553564], [14.415378859116682, 11.572368882692071], [14.468192172918974, 11.90475169519341], [14.57717776862253, 12.085360826053501], [14.181336297266792, 12.483656927943112], [14.213530714584634, 12.802035427293344], [14.495787387762842, 12.859396267137326], [14.893385857816522, 12.219047756392582], [14.960151808337598, 11.555574042197222], [14.923564894274955, 10.891325181517471], [15.467872755605269, 9.982336737503429], [14.909353875394713, 9.99212942142273], [14.627200555081057, 9.920919297724536], [14.171466098699025, 10.021378282099928], [13.954218377344002, 9.549494940626685], [14.544466586981766, 8.965861314322266], [14.979995558337688, 8.796104234243471], [15.120865512765331, 8.382150173369423], [15.436091749745765, 7.692812404811971], [15.279460483469107, 7.421924546737968], [14.776545444404572, 6.408498033062044], [14.536560092841111, 6.22695872642069], [14.459407179429345, 5.451760565610299], [14.558935988023501, 5.03059764243153], [14.478372430080466, 4.732605495620446], [14.950953403389658, 4.21038930909492], [15.036219516671249, 3.851367295747123], [15.405395948964379, 3.335300604664339], [15.862732374747479, 3.013537298998982], [15.907380812247649, 2.557389431158612], [16.01285241055535, 2.267639675298084], [15.940918816805061, 1.727672634280295], [15.14634199388524, 1.964014797367184], [14.337812534246577, 2.22787466064949], [13.07582238124675, 2.267097072759014]]] } }, + { "type": "Feature", "properties": { "admin": "Democratic Republic of the Congo", "name": "Dem. Rep. Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.833859897593801, 3.50916596111034], [30.773346795380036, 2.339883327642127], [31.174149204235807, 2.204465236821263], [30.852670118948048, 1.849396470543809], [30.468507521290292, 1.58380544677972], [30.086153598762703, 1.062312730306288], [29.875778842902488, 0.597379868976304], [29.819503208136634, -0.205310153813372], [29.587837762172164, -0.58740569417948], [29.579466180140876, -1.341313164885626], [29.29188683443661, -1.620055840667987], [29.254834832483336, -2.215109958508911], [29.117478875451546, -2.292211195488384], [29.02492638521678, -2.839257907730157], [29.276383904749046, -3.293907159034063], [29.339997592900342, -4.499983412294092], [29.519986606572925, -5.419978936386313], [29.41999271008816, -5.939998874539432], [29.620032179490003, -6.520015150583424], [30.199996779101692, -7.079980970898161], [30.740015496551781, -8.340007419470913], [30.34608605319081, -8.238256524288216], [29.002912225060467, -8.40703175215347], [28.734866570762495, -8.526559340044576], [28.449871046672818, -9.164918308146083], [28.673681674928922, -9.605924981324931], [28.496069777141763, -10.789883721564044], [28.372253045370421, -11.793646742401389], [28.642417433392346, -11.971568698782312], [29.341547885869087, -12.36074391037241], [29.616001417771223, -12.178894545137307], [29.699613885219485, -13.257226657771827], [28.934285922976834, -13.248958428605132], [28.52356163912102, -12.698604424696679], [28.15510867687998, -12.272480564017894], [27.38879886242378, -12.132747491100663], [27.164419793412456, -11.608748467661071], [26.55308759939961, -11.924439792532125], [25.752309604604726, -11.784965101776356], [25.418118116973197, -11.330935967659958], [24.783169793402948, -11.238693536018962], [24.314516228947948, -11.262826429899269], [24.257155389103982, -10.951992689663655], [23.912215203555714, -10.926826267137512], [23.456790805767433, -10.867863457892481], [22.837345411884733, -11.017621758674329], [22.402798292742371, -10.99307545333569], [22.155268182064304, -11.084801120653768], [22.208753289486388, -9.894796237836507], [21.87518191904234, -9.523707777548564], [21.801801385187897, -8.908706556842978], [21.949130893652036, -8.305900974158275], [21.746455926203303, -7.920084730667147], [21.728110792739695, -7.2908724910813], [20.514748162526498, -7.299605808138629], [20.601822950938292, -6.93931772219968], [20.091621534920645, -6.943090101756993], [20.037723016040214, -7.116361179231644], [19.417502475673157, -7.155428562044297], [19.166613396896107, -7.738183688999753], [19.016751743249664, -7.988245944860132], [18.464175652752683, -7.847014255406442], [18.134221632569048, -7.98767750410492], [17.472970004962232, -8.068551120641699], [17.089995965247166, -7.545688978712525], [16.860190870845198, -7.222297865429984], [16.573179965896141, -6.622644545115087], [16.326528354567042, -5.877470391466267], [13.375597364971892, -5.864241224799548], [13.02486941900696, -5.984388929878157], [12.735171339578695, -5.965682061388497], [12.322431674863507, -6.100092461779658], [12.182336866920249, -5.789930515163837], [12.436688266660866, -5.684303887559245], [12.468004184629734, -5.248361504745003], [12.631611769265788, -4.991271254092935], [12.995517205465173, -4.781103203961883], [13.258240187237044, -4.882957452009165], [13.600234816144676, -4.500138441590969], [14.144956088933295, -4.510008640158715], [14.209034864975219, -4.793092136253597], [14.582603794013179, -4.970238946150139], [15.170991652088441, -4.3435071753143], [15.753540073314749, -3.855164890156096], [16.006289503654298, -3.535132744972528], [15.972803175529149, -2.712392266453612], [16.407091912510051, -1.740927015798682], [16.86530683764212, -1.225816338713287], [17.523716261472853, -0.743830254726987], [17.638644646889983, -0.424831638189246], [17.663552687254676, -0.058083998213817], [17.826540154703245, 0.288923244626105], [17.774191928791563, 0.855658677571085], [17.89883548347958, 1.741831976728278], [18.09427575040743, 2.365721543788055], [18.39379235197114, 2.90044342692822], [18.453065219809925, 3.504385891123348], [18.542982211997778, 4.201785183118317], [18.932312452884755, 4.709506130385973], [19.467783644293146, 5.031527818212779], [20.290679152108932, 4.691677761245287], [20.927591180106273, 4.322785549329736], [21.659122755630019, 4.224341945813719], [22.405123732195531, 4.02916006104732], [22.704123569436284, 4.633050848810156], [22.841479526468103, 4.710126247573483], [23.297213982850135, 4.609693101414221], [24.41053104014625, 5.108784084489129], [24.805028924262409, 4.897246608902349], [25.128833449003274, 4.927244777847789], [25.278798455514302, 5.170408229997191], [25.650455356557465, 5.256087754737123], [26.402760857862535, 5.150874538590869], [27.044065382604703, 5.127852688004835], [27.374226108517483, 5.233944403500059], [27.979977247842807, 4.408413397637373], [28.428993768026906, 4.287154649264493], [28.696677687298795, 4.455077215996936], [29.159078403446497, 4.38926727947323], [29.715995314256013, 4.600804755060024], [29.953500197069467, 4.173699042167683], [30.833859897593801, 3.50916596111034]]] } }, + { "type": "Feature", "properties": { "admin": "Republic of Congo", "name": "Congo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[12.995517205465173, -4.781103203961883], [12.620759718484491, -4.438023369976135], [12.318607618873923, -4.606230157086187], [11.914963006242086, -5.037986748884789], [11.093772820691923, -3.978826592630546], [11.855121697648114, -3.42687061932105], [11.478038771214299, -2.765618991714241], [11.820963575903189, -2.514161472181982], [12.495702752338159, -2.391688327650242], [12.575284458067639, -1.948511244315134], [13.109618767965626, -2.428740329603513], [13.992407260807706, -2.470804945489099], [14.299210239324564, -1.998275648612213], [14.425455763413593, -1.333406670744971], [14.316418491277741, -0.552627455247048], [13.843320753645653, 0.038757635901149], [14.276265903386953, 1.196929836426619], [14.026668735417214, 1.395677395021153], [13.282631463278816, 1.31418366129688], [13.003113641012074, 1.830896307783319], [13.07582238124675, 2.267097072759014], [14.337812534246577, 2.22787466064949], [15.14634199388524, 1.964014797367184], [15.940918816805061, 1.727672634280295], [16.01285241055535, 2.267639675298084], [16.537058139724135, 3.198254706226278], [17.133042433346297, 3.728196519379451], [17.809900343505259, 3.560196437998569], [18.453065219809925, 3.504385891123348], [18.39379235197114, 2.90044342692822], [18.09427575040743, 2.365721543788055], [17.89883548347958, 1.741831976728278], [17.774191928791563, 0.855658677571085], [17.826540154703245, 0.288923244626105], [17.663552687254676, -0.058083998213817], [17.638644646889983, -0.424831638189246], [17.523716261472853, -0.743830254726987], [16.86530683764212, -1.225816338713287], [16.407091912510051, -1.740927015798682], [15.972803175529149, -2.712392266453612], [16.006289503654298, -3.535132744972528], [15.753540073314749, -3.855164890156096], [15.170991652088441, -4.3435071753143], [14.582603794013179, -4.970238946150139], [14.209034864975219, -4.793092136253597], [14.144956088933295, -4.510008640158715], [13.600234816144676, -4.500138441590969], [13.258240187237044, -4.882957452009165], [12.995517205465173, -4.781103203961883]]] } }, + { "type": "Feature", "properties": { "admin": "Colombia", "name": "Colombia", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-75.373223232713841, -0.15203175212045], [-75.801465827116587, 0.084801337073202], [-76.292314419240938, 0.416047268064119], [-76.576379767549383, 0.256935533037435], [-77.424984300430367, 0.395686753741117], [-77.668612840470416, 0.825893052570961], [-77.855061408179509, 0.809925034992773], [-78.855258755188686, 1.380923773601822], [-78.990935228171026, 1.691369940595251], [-78.617831387023699, 1.766404120283056], [-78.662118089497838, 2.267355454920476], [-78.427610439757302, 2.629555568854215], [-77.931542527971473, 2.696605739752925], [-77.510431281224996, 3.325016994638246], [-77.127689785455246, 3.849636135265356], [-77.496271938776999, 4.087606105969427], [-77.307601284479375, 4.667984117039452], [-77.533220587865713, 5.582811997902496], [-77.318815070286718, 5.845354112161359], [-77.476660732722266, 6.691116441266301], [-77.881571417945239, 7.223771267114783], [-77.75341386586139, 7.709839789252141], [-77.431107957656977, 7.638061224798733], [-77.242566494440069, 7.935278225125442], [-77.474722866511314, 8.524286200388216], [-77.353360765273848, 8.670504665558068], [-76.836673957003541, 8.638749497914715], [-76.086383836557843, 9.336820583529486], [-75.674600185840035, 9.443248195834597], [-75.664704149056149, 9.774003200718736], [-75.480425991503338, 10.618990383339305], [-74.906895107711975, 11.08304474532032], [-74.276752692344871, 11.102035834187586], [-74.197222663047683, 11.310472723836865], [-73.414763963500278, 11.227015285685479], [-72.62783525255962, 11.731971543825519], [-72.238194953078903, 11.955549628136325], [-71.754090135368628, 12.437303168177305], [-71.399822353791691, 12.376040757695289], [-71.137461107045866, 12.112981879113503], [-71.331583624950284, 11.776284084515805], [-71.973921678338272, 11.608671576377116], [-72.227575446242923, 11.108702093953237], [-72.614657762325194, 10.821975409381777], [-72.905286017534692, 10.45034434655477], [-73.027604132769554, 9.736770331252441], [-73.304951544880026, 9.151999823437604], [-72.788729824500379, 9.085027167187331], [-72.660494757768092, 8.62528778730268], [-72.439862230097944, 8.405275376820027], [-72.360900641555958, 8.002638454617893], [-72.479678921178831, 7.632506008327352], [-72.444487270788059, 7.42378489830048], [-72.19835242378187, 7.340430813013682], [-71.960175747348629, 6.991614895043538], [-70.674233567981503, 7.087784735538717], [-70.093312954372408, 6.960376491723109], [-69.389479946557103, 6.099860541198835], [-68.985318569602327, 6.206804917826856], [-68.265052456318216, 6.153268133972473], [-67.695087246355001, 6.267318020040645], [-67.34143958196556, 6.095468044454021], [-67.521531948502741, 5.556870428891968], [-67.744696621355203, 5.221128648291667], [-67.823012254493534, 4.503937282728898], [-67.621835903581271, 3.839481716319994], [-67.33756384954367, 3.542342230641721], [-67.303173183853417, 3.31845408773718], [-67.809938117123693, 2.820655015469569], [-67.447092047786299, 2.600280869960869], [-67.181294318293041, 2.250638129074062], [-66.876325853122566, 1.253360500489336], [-67.065048183852483, 1.130112209473225], [-67.25999752467358, 1.719998684084956], [-67.537810024674684, 2.037162787276329], [-67.868565029558823, 1.692455145673392], [-69.816973232691609, 1.714805202639624], [-69.804596727157701, 1.089081122233466], [-69.218637661400166, 0.985676581217433], [-69.252434048119042, 0.602650865070075], [-69.452396002872447, 0.706158758950693], [-70.015565761989293, 0.541414292804205], [-70.02065589057004, -0.185156345219539], [-69.577065395776586, -0.549991957200163], [-69.420485805932216, -1.122618503426409], [-69.444101935489599, -1.556287123219817], [-69.893635219996611, -4.298186944194326], [-70.394043952094975, -3.766591485207825], [-70.692682054309699, -3.742872002785858], [-70.047708502874841, -2.725156345229699], [-70.813475714791949, -2.256864515800742], [-71.413645799429773, -2.342802422702128], [-71.774760708285385, -2.169789727388937], [-72.325786505813639, -2.434218031426453], [-73.070392218707212, -2.308954359550952], [-73.659503546834586, -1.260491224781134], [-74.122395189089048, -1.002832533373848], [-74.441600511355958, -0.530820000819887], [-75.106624518520064, -0.05720549886486], [-75.373223232713841, -0.15203175212045]]] } }, + { "type": "Feature", "properties": { "admin": "Costa Rica", "name": "Costa Rica", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-82.965783047197348, 8.225027980985983], [-83.508437262694287, 8.446926581247281], [-83.711473965169063, 8.656836249216864], [-83.596313035806631, 8.830443223501417], [-83.632641567707822, 9.051385809765319], [-83.909885626953724, 9.290802720573579], [-84.303401658856345, 9.487354030795712], [-84.64764421256865, 9.615537421095707], [-84.713350796227743, 9.908051866083849], [-84.975660366541319, 10.086723130733004], [-84.911374884770211, 9.795991522658921], [-85.110923428065291, 9.557039699741308], [-85.339488288092255, 9.834542141148658], [-85.660786505866966, 9.93334747969072], [-85.797444831062819, 10.134885565629032], [-85.791708747078417, 10.439337266476612], [-85.65931372754666, 10.754330959511718], [-85.941725430021748, 10.895278428587799], [-85.712540452807289, 11.088444932494822], [-85.561851976244171, 11.217119248901593], [-84.903003302738924, 10.952303371621895], [-84.673069017256239, 11.082657172078139], [-84.355930752281026, 10.999225572142901], [-84.190178595704822, 10.793450018756671], [-83.895054490885926, 10.726839097532444], [-83.655611741861563, 10.938764146361418], [-83.402319708982944, 10.39543813724465], [-83.015676642575158, 9.992982082555553], [-82.546196255203469, 9.566134751824674], [-82.932890998043561, 9.476812038608172], [-82.927154914059145, 9.074330145702914], [-82.719183112300513, 8.925708726431493], [-82.868657192704759, 8.807266343618521], [-82.829770677405151, 8.626295477732368], [-82.9131764391242, 8.423517157419068], [-82.965783047197348, 8.225027980985983]]] } }, + { "type": "Feature", "properties": { "admin": "Cuba", "name": "Cuba", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-82.268151211257035, 23.188610744717703], [-81.404457160146819, 23.117271429938775], [-80.61876868358118, 23.105980129482994], [-79.679523688460222, 22.765303249598823], [-79.281485968732071, 22.399201565027049], [-78.347434455056472, 22.512166246017085], [-77.993295864560253, 22.277193508385928], [-77.146422492161037, 21.657851467367831], [-76.523824835908528, 21.20681956632437], [-76.194620123993175, 21.220565497314006], [-75.598222418912655, 21.01662445727413], [-75.671060350228032, 20.735091254147999], [-74.933896043584483, 20.693905137611381], [-74.178024868451246, 20.284627793859737], [-74.296648118777242, 20.050378526280678], [-74.961594611292924, 19.923435370355687], [-75.634680141894577, 19.873774318923193], [-76.323656175425981, 19.952890936762056], [-77.755480923153044, 19.855480861891873], [-77.085108405246729, 20.413353786698789], [-77.492654588516601, 20.673105373613886], [-78.137292243141573, 20.739948838783427], [-78.482826707661161, 21.028613389565848], [-78.719866502583997, 21.598113511638431], [-79.284999966127913, 21.559175319906497], [-80.217475348618635, 21.827324327069032], [-80.517534552721401, 22.037078965741756], [-81.820943366203167, 22.192056586185068], [-82.169991828118611, 22.387109279870746], [-81.79500179719264, 22.636964830001951], [-82.775897996740838, 22.688150336187057], [-83.494458787759328, 22.168517971276124], [-83.908800421875611, 22.154565334557329], [-84.052150845053248, 21.910575059491251], [-84.547030198896351, 21.801227728761639], [-84.974911058273079, 21.896028143801082], [-84.44706214062775, 22.204949856041903], [-84.23035702181177, 22.56575470630376], [-83.778239915690165, 22.78811839445569], [-83.267547573565736, 22.983041897060641], [-82.510436164057495, 23.078746649665181], [-82.268151211257035, 23.188610744717703]]] } }, + { "type": "Feature", "properties": { "admin": "Northern Cyprus", "name": "N. Cyprus", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[32.731780226377445, 35.14002594658843], [32.802473585752743, 35.145503648411363], [32.946960890440799, 35.38670339613369], [33.667227003724939, 35.373215847305509], [34.576473829900458, 35.671595567358786], [33.900804477684197, 35.245755927057608], [33.973616570783456, 35.058506374647997], [33.866439650210104, 35.093594672174177], [33.675391880027057, 35.017862860650446], [33.525685255677494, 35.038688462864066], [33.475817498515845, 35.000344550103499], [33.45592207208346, 35.101423651666401], [33.383833449036295, 35.162711900364563], [33.190977003723042, 35.173124701471373], [32.919572381326127, 35.087832749973636], [32.731780226377445, 35.14002594658843]]] } }, + { "type": "Feature", "properties": { "admin": "Cyprus", "name": "Cyprus", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[33.973616570783456, 35.058506374647997], [34.004880812320032, 34.978097846001852], [32.97982710137844, 34.571869411755436], [32.490296258277532, 34.701654771456468], [32.256667107885953, 35.103232326796622], [32.731780226377445, 35.14002594658843], [32.919572381326127, 35.087832749973636], [33.190977003723042, 35.173124701471373], [33.383833449036295, 35.162711900364563], [33.45592207208346, 35.101423651666401], [33.475817498515845, 35.000344550103499], [33.525685255677494, 35.038688462864066], [33.675391880027057, 35.017862860650446], [33.866439650210104, 35.093594672174177], [33.973616570783456, 35.058506374647997]]] } }, + { "type": "Feature", "properties": { "admin": "Czech Republic", "name": "Czech Rep.", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.960288120194573, 48.596982326850593], [16.49928266771877, 48.785808010445095], [16.029647251050218, 48.733899034207916], [15.253415561593979, 49.039074205107575], [14.901447381254055, 48.964401760445817], [14.33889773932472, 48.555305284207193], [13.595945672264433, 48.877171942737135], [13.031328973043427, 49.307068182973232], [12.52102420416119, 49.54741526956272], [12.415190870827441, 49.96912079528056], [12.240111118222556, 50.266337795607271], [12.96683678554319, 50.484076443069071], [13.338131951560282, 50.733234361364346], [14.05622765468817, 50.926917629594286], [14.307013380600633, 51.117267767941399], [14.570718214586062, 51.002339382524262], [15.016995883858666, 51.106674099321566], [15.490972120839725, 50.7847299261432], [16.238626743238566, 50.697732652379827], [16.176253289462263, 50.4226073268579], [16.719475945714429, 50.215746568393527], [16.868769158605655, 50.473973700556016], [17.554567091551117, 50.36214590107641], [17.649445021238986, 50.049038397819942], [18.392913852622168, 49.988628648470737], [18.85314415861361, 49.496229763377634], [18.554971144289478, 49.495015367218777], [18.399993523846174, 49.315000515330034], [18.170498488037961, 49.271514797556421], [18.104972771891848, 49.043983466175298], [17.913511590250462, 48.996492824899072], [17.886484816161808, 48.903475246773695], [17.545006951577101, 48.800019029325362], [17.101984897538895, 48.8169688991171], [16.960288120194573, 48.596982326850593]]] } }, + { "type": "Feature", "properties": { "admin": "Germany", "name": "Germany", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[9.92190636560923, 54.983104153048025], [9.939579705452898, 54.596641954153242], [10.950112338920517, 54.363607082733147], [10.939466993868447, 54.008693345752583], [11.95625247564328, 54.196485500701144], [12.518440382546711, 54.470370591847988], [13.647467075259495, 54.075510972705885], [14.119686313542555, 53.757029120491026], [14.353315463934164, 53.248171291713092], [14.074521111719431, 52.981262518925334], [14.437599725002197, 52.62485016540829], [14.685026482815713, 52.089947414755208], [14.607098422919645, 51.745188096719964], [15.016995883858781, 51.106674099321701], [14.570718214586119, 51.002339382524369], [14.307013380600662, 51.117267767941364], [14.05622765468831, 50.92691762959435], [13.338131951560397, 50.733234361364268], [12.966836785543249, 50.484076443069164], [12.240111118222668, 50.266337795607214], [12.41519087082747, 49.969120795280602], [12.521024204161332, 49.547415269562741], [13.031328973043513, 49.307068182973232], [13.595945672264575, 48.877171942737156], [13.243357374737112, 48.416114813829026], [12.884102817443873, 48.289145819687846], [13.025851271220514, 47.637583523135945], [12.93262698736606, 47.467645575543983], [12.620759718484519, 47.672387600284409], [12.141357456112869, 47.703083401065768], [11.426414015354847, 47.523766181013045], [10.544504021861597, 47.566399237653783], [10.402083774465321, 47.302487697939164], [9.896068149463188, 47.58019684507569], [9.594226108446376, 47.525058091820185], [8.522611932009793, 47.830827541691342], [8.317301466514092, 47.613579820336263], [7.466759067422286, 47.620581976911907], [7.59367638513106, 48.333019110703724], [8.099278598674855, 49.017783515003423], [6.658229607783709, 49.201958319691627], [6.186320428094176, 49.4638028021145], [6.242751092156992, 49.90222565367872], [6.043073357781109, 50.128051662794221], [6.156658155958779, 50.803721015010574], [5.988658074577812, 51.85161570902504], [6.589396599970825, 51.85202912048338], [6.842869500362381, 52.228440253297542], [7.092053256873895, 53.14404328064488], [6.905139601274128, 53.482162177130633], [7.100424838905268, 53.693932196662658], [7.936239454793961, 53.748295803433777], [8.121706170289483, 53.527792466844275], [8.800734490604667, 54.02078563090889], [8.572117954145368, 54.395646470754045], [8.526229282270206, 54.962743638725144], [9.282048780971136, 54.830865383516297], [9.92190636560923, 54.983104153048025]]] } }, + { "type": "Feature", "properties": { "admin": "Djibouti", "name": "Djibouti", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[43.081226027200152, 12.699638576707112], [43.317852410664663, 12.390148423711022], [43.286381463398911, 11.974928290245883], [42.715873650896519, 11.735640570518338], [43.145304803242126, 11.462039699748853], [42.776851841000948, 10.926878566934416], [42.55493000000012, 11.105110000000193], [42.314140000000116, 11.0342], [41.755570000000191, 11.05091], [41.739590000000177, 11.355110000000137], [41.661760000000122, 11.6312], [42.000000000000107, 12.100000000000133], [42.351560000000106, 12.54223000000013], [42.779642368344739, 12.455415757695672], [43.081226027200152, 12.699638576707112]]] } }, + { "type": "Feature", "properties": { "admin": "Denmark", "name": "Denmark", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[12.690006137755629, 55.60999095318077], [12.089991082414738, 54.800014553437919], [11.043543328504226, 55.36486379660424], [10.90391360845163, 55.779954738988735], [12.370904168353288, 56.111407375708822], [12.690006137755629, 55.60999095318077]]], [[[10.912181837618359, 56.4586213242779], [10.667803989309986, 56.081383368547208], [10.369992710011983, 56.190007229224719], [9.649984978889306, 55.469999498102041], [9.921906365609173, 54.983104153048046], [9.282048780971136, 54.830865383516155], [8.526229282270235, 54.962743638724973], [8.120310906617588, 55.517722683323612], [8.089976840862247, 56.540011705137587], [8.256581658571262, 56.809969387430286], [8.543437534223385, 57.110002753316891], [9.424469028367609, 57.172066148499468], [9.775558709358561, 57.447940782289649], [10.580005730846151, 57.730016587954843], [10.54610599126269, 57.21573273378614], [10.250000034230222, 56.890016181050456], [10.369992710011983, 56.60998159446082], [10.912181837618359, 56.4586213242779]]]] } }, + { "type": "Feature", "properties": { "admin": "Dominican Republic", "name": "Dominican Rep.", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-71.71236141629295, 19.714455878167353], [-71.587304450146604, 19.884910590082093], [-70.806706102161726, 19.880285549391981], [-70.214364997016119, 19.622885240146157], [-69.950815192327568, 19.647999986240002], [-69.769250047470067, 19.293267116772437], [-69.222125820579862, 19.313214219637096], [-69.254346076113819, 19.015196234609871], [-68.809411994080818, 18.979074408437846], [-68.317943284768958, 18.612197577381689], [-68.689315965434503, 18.205142320218609], [-69.164945848248905, 18.422648423735108], [-69.623987596297624, 18.380712998930246], [-69.952933926051529, 18.428306993071057], [-70.133232998317879, 18.245915025296892], [-70.517137213814195, 18.184290879788829], [-70.669298468697619, 18.42688589118303], [-70.999950120717173, 18.283328762276206], [-71.400209927033885, 17.598564357976596], [-71.657661912712001, 17.757572740138695], [-71.708304816358037, 18.044997056546091], [-71.687737596305865, 18.316660061104468], [-71.945112067335543, 18.616900132720257], [-71.701302659782485, 18.785416978424049], [-71.624873216422813, 19.169837958243303], [-71.71236141629295, 19.714455878167353]]] } }, + { "type": "Feature", "properties": { "admin": "Algeria", "name": "Algeria", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[11.99950564947161, 23.471668402596443], [8.572893100629782, 21.565660712159136], [5.677565952180684, 19.601206976799713], [4.267419467800038, 19.155265204336995], [3.158133172222704, 19.057364203360034], [3.146661004253899, 19.693578599521441], [2.683588494486428, 19.856230170160114], [2.060990838233919, 20.142233384679482], [1.823227573259032, 20.61080943448604], [-1.550054897457613, 22.792665920497377], [-4.92333736817423, 24.974574082940993], [-8.684399786809051, 27.395744126895998], [-8.66512447756419, 27.58947907155822], [-8.665589565454805, 27.656425889592349], [-8.674116176782972, 28.841288967396572], [-7.059227667661928, 29.579228420524522], [-6.060632290053772, 29.731699734001687], [-5.242129278982786, 30.000443020135581], [-4.859646165374469, 30.501187649043839], [-3.690441046554695, 30.896951605751152], [-3.647497931320145, 31.637294012980668], [-3.068980271812647, 31.724497992473207], [-2.616604783529567, 32.094346218386143], [-1.30789913573787, 32.262888902306095], [-1.124551153966308, 32.651521511357124], [-1.388049282222567, 32.864015000941301], [-1.733454555661467, 33.91971283623198], [-1.792985805661686, 34.527918606091198], [-2.169913702798624, 35.168396307916673], [-1.208602871089056, 35.71484874118709], [-0.127454392894606, 35.888662421200799], [0.503876580415209, 36.301272894835272], [1.466918572606545, 36.605647081034398], [3.161698846050824, 36.783904934225205], [4.815758090849129, 36.865036932923452], [5.320120070017792, 36.716518866516616], [6.261819695672611, 37.110655015606731], [7.330384962603969, 37.118380642234364], [7.737078484741003, 36.885707505840209], [8.420964389691674, 36.946427313783154], [8.217824334352313, 36.433176988260271], [8.376367628623766, 35.479876003555937], [8.140981479534302, 34.655145982393783], [7.524481642292242, 34.097376410451453], [7.612641635782181, 33.344114895148955], [8.430472853233367, 32.748337307255944], [8.439102817426116, 32.506284898400814], [9.055602654668148, 32.102691962201284], [9.482139926805273, 30.307556057246181], [9.805634392952411, 29.424638373323383], [9.859997999723443, 28.959989732371007], [9.683884718472765, 28.144173895779193], [9.756128370816779, 27.688258571884141], [9.629056023811073, 27.140953477480913], [9.716285841519747, 26.512206325785691], [9.319410841518161, 26.094324856057447], [9.910692579801774, 25.365454616796733], [9.948261346077969, 24.93695364023251], [10.30384687667836, 24.37931325937091], [10.771363559622925, 24.562532050061744], [11.560669386449002, 24.097909247325511], [11.99950564947161, 23.471668402596443]]] } }, + { "type": "Feature", "properties": { "admin": "Ecuador", "name": "Ecuador", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-80.302560594387188, -3.404856459164712], [-79.770293341780913, -2.65751189535964], [-79.986559210922394, -2.220794366061014], [-80.368783942369234, -2.685158786635788], [-80.967765469064332, -2.246942640800703], [-80.764806281238023, -1.965047702648532], [-80.933659023751702, -1.057454522306358], [-80.583370327461239, -0.906662692878683], [-80.39932471385373, -0.283703301600141], [-80.020898200180355, 0.360340074053468], [-80.090609707342097, 0.768428859862396], [-79.542762010399784, 0.982937730305963], [-78.855258755188686, 1.380923773601822], [-77.855061408179509, 0.809925034992773], [-77.668612840470416, 0.825893052570961], [-77.424984300430367, 0.395686753741117], [-76.576379767549383, 0.256935533037435], [-76.292314419240938, 0.416047268064119], [-75.801465827116587, 0.084801337073202], [-75.373223232713841, -0.15203175212045], [-75.233722703741932, -0.911416924649529], [-75.544995693652027, -1.56160979574588], [-76.635394253226707, -2.608677666843817], [-77.83790483265858, -3.003020521663103], [-78.450683966775628, -3.873096612161375], [-78.639897223612323, -4.547784112164072], [-79.205289069317715, -4.959128513207388], [-79.62497921417615, -4.454198093283494], [-80.028908047185581, -4.346090996928893], [-80.442241990872134, -4.425724379090673], [-80.46929460317692, -4.059286797708999], [-80.184014858709645, -3.821161797708043], [-80.302560594387188, -3.404856459164712]]] } }, + { "type": "Feature", "properties": { "admin": "Egypt", "name": "Egypt", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.9226, 29.50133], [34.64174, 29.09942], [34.42655, 28.34399], [34.15451, 27.8233], [33.92136, 27.6487], [33.58811, 27.97136], [33.13676, 28.41765], [32.42323, 29.85108], [32.32046, 29.76043], [32.73482, 28.70523], [33.34876, 27.69989], [34.10455, 26.14227], [34.47387, 25.59856], [34.79507, 25.03375], [35.69241, 23.92671], [35.49372, 23.75237], [35.52598, 23.10244], [36.69069, 22.20485], [36.86623, 22.0], [32.9, 22.0], [29.02, 22.0], [25.0, 22.0], [25.0, 25.682499996360992], [25.0, 29.238654529533452], [24.70007, 30.04419], [24.95762, 30.6616], [24.80287, 31.08929], [25.16482, 31.56915], [26.49533, 31.58568], [27.45762, 31.32126], [28.45048, 31.02577], [28.91353, 30.87005], [29.68342, 31.18686], [30.09503, 31.4734], [30.97693, 31.55586], [31.68796, 31.4296], [31.96041, 30.9336], [32.19247, 31.26034], [32.99392, 31.02407], [33.7734, 30.96746], [34.26544, 31.21936], [34.9226, 29.50133]]] } }, + { "type": "Feature", "properties": { "admin": "Eritrea", "name": "Eritrea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[42.351560000000106, 12.54223000000013], [42.00975, 12.86582], [41.59856, 13.452090000000108], [41.15519371924983, 13.773319810435224], [40.8966, 14.118640000000138], [40.026218702969167, 14.519579169162281], [39.34061, 14.53155], [39.0994, 14.74064], [38.51295, 14.50547], [37.90607, 14.959430000000165], [37.59377, 14.2131], [36.42951, 14.42211], [36.323188917798113, 14.822480577041057], [36.753860304518575, 16.291874091044289], [36.852530000000108, 16.95655], [37.16747, 17.263140000000128], [37.904000000000103, 17.42754], [38.410089959473218, 17.998307399970312], [38.990622999839999, 16.84062612555169], [39.266110060388016, 15.922723496967246], [39.814293654140208, 15.435647284400314], [41.179274936697645, 14.491079616753209], [41.734951613132345, 13.921036892141554], [42.276830682144848, 13.34399201095442], [42.589576450375255, 13.000421250861901], [43.081226027200152, 12.699638576707112], [42.779642368344739, 12.455415757695672], [42.351560000000106, 12.54223000000013]]] } }, + { "type": "Feature", "properties": { "admin": "Spain", "name": "Spain", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-9.034817674180244, 41.880570583659669], [-8.98443315269567, 42.592775173506261], [-9.392883673530644, 43.026624660812686], [-7.978189663108308, 43.748337714200979], [-6.754491746436754, 43.567909450853918], [-5.411886359061596, 43.574239813809669], [-4.347842779955783, 43.403449205085025], [-3.51753170410609, 43.455900783861296], [-1.901351284177764, 43.422802028978332], [-1.502770961910528, 43.034014390630425], [0.338046909190581, 42.579546006839543], [0.701590610363894, 42.795734361332599], [1.826793247087153, 42.343384711265678], [2.985998976258457, 42.473015041669854], [3.039484083680548, 41.892120266276891], [2.091841668312184, 41.226088568683082], [0.810524529635188, 41.014731960609332], [0.721331007499401, 40.678318386389229], [0.106691521819869, 40.123933620762003], [-0.278711310212941, 39.309978135732713], [0.111290724293838, 38.738514309233032], [-0.467123582349103, 38.292365831041138], [-0.683389451490598, 37.642353827457811], [-1.438382127274849, 37.443063666324214], [-2.146452602538119, 36.674144192037282], [-3.415780808923386, 36.658899644511173], [-4.368900926114718, 36.677839056946141], [-4.995219285492211, 36.32470815687963], [-5.377159796561457, 35.946850083961458], [-5.866432257500902, 36.02981659600605], [-6.236693894872174, 36.367677110330327], [-6.520190802425402, 36.942913316387312], [-7.45372555177809, 37.097787583966053], [-7.537105475281022, 37.428904323876232], [-7.166507941099863, 37.803894354802217], [-7.029281175148794, 38.075764065089757], [-7.374092169616317, 38.373058580064914], [-7.098036668313126, 39.03007274022378], [-7.498632371439724, 39.629571031241802], [-7.066591559263527, 39.711891587882768], [-7.026413133156593, 40.184524237624238], [-6.864019944679383, 40.330871893874821], [-6.851126674822551, 41.111082668617513], [-6.389087693700914, 41.381815497394641], [-6.668605515967655, 41.883386949219577], [-7.251308966490822, 41.91834605566504], [-7.422512986673794, 41.792074693359822], [-8.01317460776991, 41.790886135417118], [-8.26385698081779, 42.280468654950326], [-8.671945766626719, 42.134689439454952], [-9.034817674180244, 41.880570583659669]]] } }, + { "type": "Feature", "properties": { "admin": "Estonia", "name": "Estonia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[24.312862583114615, 57.793423570376966], [24.428927850042154, 58.383413397853275], [24.061198357853179, 58.257374579493394], [23.426560092876681, 58.612753404364618], [23.339795363058641, 59.187240302153363], [24.604214308376182, 59.465853786855007], [25.864189080516631, 59.611090399811324], [26.949135776484518, 59.445803331125767], [27.981114129353237, 59.47538808861286], [28.131699253051742, 59.300825100330904], [27.420166456824941, 58.724581203844224], [27.716685825315714, 57.791899115624354], [27.288184848751509, 57.474528306703817], [26.46353234223778, 57.476388658266316], [25.602809685984365, 57.847528794986559], [25.164593540149262, 57.970156968815175], [24.312862583114615, 57.793423570376966]]] } }, + { "type": "Feature", "properties": { "admin": "Ethiopia", "name": "Ethiopia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[37.90607, 14.959430000000165], [38.51295, 14.50547], [39.0994, 14.74064], [39.34061, 14.53155], [40.026250000000111, 14.51959], [40.8966, 14.118640000000138], [41.1552, 13.77333], [41.59856, 13.452090000000108], [42.00975, 12.86582], [42.351560000000106, 12.54223000000013], [42.000000000000107, 12.100000000000133], [41.661760000000122, 11.6312], [41.739590000000177, 11.355110000000137], [41.755570000000191, 11.05091], [42.314140000000116, 11.0342], [42.55493000000012, 11.105110000000193], [42.776851841000948, 10.926878566934416], [42.55876, 10.572580000000126], [42.92812, 10.021940000000139], [43.29699, 9.540480000000169], [43.67875, 9.183580000000116], [46.94834, 7.99688], [47.78942, 8.003], [44.9636, 5.001620000000115], [43.66087, 4.95755], [42.769670000000119, 4.252590000000223], [42.12861, 4.234130000000163], [41.855083092644108, 3.918911920483764], [41.171800000000125, 3.91909], [40.768480000000118, 4.257020000000124], [39.854940000000106, 3.83879000000013], [39.559384258765917, 3.422060000000215], [38.89251, 3.50074], [38.67114, 3.61607], [38.436970000000137, 3.58851], [38.120915000000132, 3.598605], [36.85509323800823, 4.447864127672857], [36.159078632855646, 4.447864127672857], [35.817447662353622, 4.776965663462021], [35.817447662353622, 5.338232082790852], [35.298007118233095, 5.506], [34.70702, 6.59422000000012], [34.25032, 6.82607], [34.075100000000184, 7.22595], [33.56829, 7.71334], [32.954180000000228, 7.7849700000001], [33.294800000000116, 8.35458], [33.82550000000014, 8.37916], [33.97498, 8.684560000000145], [33.96162, 9.58358], [34.25745, 10.63009], [34.73115000000012, 10.910170000000106], [34.831630000000125, 11.318960000000116], [35.26049, 12.08286], [35.863630000000164, 12.57828], [36.27022, 13.563330000000118], [36.42951, 14.42211], [37.59377, 14.2131], [37.90607, 14.959430000000165]]] } }, + { "type": "Feature", "properties": { "admin": "Finland", "name": "Finland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[28.591929559043187, 69.064776923286644], [28.445943637818651, 68.36461294216403], [29.9774263852206, 67.698297024192641], [29.054588657352319, 66.944286200621917], [30.21765, 65.80598], [29.544429559046982, 64.948671576590471], [30.444684686003704, 64.204453436939076], [30.035872430142714, 63.552813625738544], [31.516092156711117, 62.867687486412869], [31.139991082490891, 62.357692776124395], [30.211107212044443, 61.780027777749673], [28.06999759289527, 60.503516547275829], [26.25517296723697, 60.423960679762487], [24.496623976344516, 60.057316392651636], [22.869694858499454, 59.846373196036211], [22.290763787533589, 60.391921291741525], [21.322244093519313, 60.720169989659503], [21.544866163832687, 61.705329494871783], [21.059211053153682, 62.607393296958726], [21.536029493910799, 63.189735012455863], [22.442744174903986, 63.817810370531276], [24.730511508897528, 64.902343655040823], [25.398067661243939, 65.111426500093728], [25.2940430030404, 65.53434642197044], [23.903378533633795, 66.006927395279604], [23.565879754335576, 66.396050930437411], [23.539473097434435, 67.936008612735236], [21.978534783626113, 68.616845608180682], [20.645592889089521, 69.106247260200846], [21.244936150810666, 69.370443020293067], [22.356237827247405, 68.841741441514898], [23.662049594830751, 68.891247463650529], [24.735679152126721, 68.649556789821446], [25.689212680776361, 69.092113755969024], [26.179622023226241, 69.825298977326113], [27.732292107867856, 70.164193020296239], [29.015572950971968, 69.766491197377974], [28.591929559043187, 69.064776923286644]]] } }, + { "type": "Feature", "properties": { "admin": "Fiji", "name": "Fiji", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[178.3736, -17.33992], [178.71806, -17.62846], [178.55271, -18.15059], [177.93266, -18.28799], [177.38146, -18.16432], [177.28504, -17.72465], [177.67087, -17.38114], [178.12557, -17.50481], [178.3736, -17.33992]]], [[[179.364142661964223, -16.801354076946847], [178.725059362997058, -17.012041674368017], [178.596838595117021, -16.63915], [179.096609362997128, -16.43398427754742], [179.413509362997075, -16.379054277547393], [180.000000000000114, -16.067132663642436], [180.000000000000114, -16.555216566639157], [179.364142661964223, -16.801354076946847]]], [[[-179.917369384765237, -16.501783135649358], [-180.0, -16.555216566639157], [-180.0, -16.067132663642436], [-179.793320109048551, -16.020882256741228], [-179.917369384765237, -16.501783135649358]]]] } }, + { "type": "Feature", "properties": { "admin": "Falkland Islands", "name": "Falkland Is.", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-61.2, -51.85], [-60.0, -51.25], [-59.15, -51.5], [-58.55, -51.1], [-57.75, -51.55], [-58.05, -51.9], [-59.4, -52.2], [-59.85, -51.85], [-60.7, -52.3], [-61.2, -51.85]]] } }, + { "type": "Feature", "properties": { "admin": "France", "name": "France", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-52.556424730018378, 2.504705308437053], [-52.939657151894963, 2.124857692875622], [-53.41846513529525, 2.053389187016037], [-53.554839240113481, 2.334896551925964], [-53.778520677288881, 2.376702785650053], [-54.088062506717264, 2.105556545414629], [-54.524754197799737, 2.311848863123785], [-54.271229620975781, 2.738747870286942], [-54.184284023644743, 3.194172268075234], [-54.011503872276812, 3.622569891774857], [-54.3995422023565, 4.212611395683481], [-54.478632981979203, 4.896755682795642], [-53.958044603070917, 5.756548163267808], [-53.618452928264837, 5.646529038918401], [-52.882141282754063, 5.409850979021598], [-51.823342861525916, 4.565768133966144], [-51.657797410678874, 4.156232408053028], [-52.249337531123977, 3.241094468596287], [-52.556424730018378, 2.504705308437053]]], [[[9.560016310269132, 42.152491970379558], [9.229752231491771, 41.380006822264441], [8.77572309737536, 41.583611965494427], [8.544212680707828, 42.256516628583078], [8.746009148807586, 42.628121853193946], [9.390000848028901, 43.009984849614725], [9.560016310269132, 42.152491970379558]]], [[[3.588184441755714, 50.378992418003563], [4.28602298342514, 49.90749664977254], [4.799221632515752, 49.985373033236314], [5.674051954784885, 49.529483547557433], [5.897759230176375, 49.442667141307155], [6.186320428094204, 49.463802802114444], [6.658229607783538, 49.201958319691549], [8.09927859867477, 49.017783515003366], [7.59367638513106, 48.333019110703724], [7.466759067422228, 47.620581976911851], [7.192202182655533, 47.449765529970982], [6.736571079138086, 47.541801255882874], [6.768713820023634, 47.287708238303672], [6.037388950228971, 46.725778713561894], [6.022609490593566, 46.272989813820502], [6.500099724970453, 46.429672756529428], [6.84359297041456, 45.991146552100659], [6.80235517744566, 45.708579820328673], [7.096652459347835, 45.333098863295859], [6.749955275101711, 45.028517971367584], [7.007562290076661, 44.254766750661382], [7.549596388386161, 44.127901109384808], [7.435184767291841, 43.693844916349164], [6.529245232783068, 43.12889232031835], [4.556962517931395, 43.399650987311581], [3.100410597352719, 43.075200507167118], [2.985998976258486, 42.473015041669882], [1.826793247087181, 42.343384711265649], [0.701590610363922, 42.795734361332642], [0.338046909190581, 42.57954600683955], [-1.502770961910471, 43.034014390630482], [-1.901351284177735, 43.422802028978332], [-1.384225226232956, 44.022610378590166], [-1.193797573237361, 46.014917710954862], [-2.225724249673788, 47.064362697938201], [-2.963276129559573, 47.570326646507958], [-4.491554938159481, 47.95495433205641], [-4.592349819344746, 48.68416046812694], [-3.295813971357745, 48.901692409859628], [-1.616510789384932, 48.644421291694577], [-1.933494025063254, 49.776341864615759], [-0.98946895995536, 49.347375800160869], [1.338761020522753, 50.127173163445256], [1.6390010921385, 50.9466063502975], [2.51357303224617, 51.14850617126185], [2.65842207196033, 50.796848049515646], [3.123251580425716, 50.780363267614504], [3.588184441755714, 50.378992418003563]]]] } }, + { "type": "Feature", "properties": { "admin": "Gabon", "name": "Gabon", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[11.093772820691923, -3.978826592630546], [10.066135288135738, -2.969482517105681], [9.405245395554969, -2.144313246269042], [8.797995639693168, -1.111301364754496], [8.830086704146423, -0.779073581550037], [9.048419630579586, -0.459351494960217], [9.291350538783687, 0.268666083167687], [9.492888624721981, 1.010119533691494], [9.83028405115564, 1.067893784993799], [11.285078973036461, 1.057661851400013], [11.276449008843711, 2.261050930180871], [11.751665480199787, 2.326757513839993], [12.359380323952218, 2.19281220133945], [12.951333855855605, 2.321615708826939], [13.07582238124675, 2.267097072759014], [13.003113641012074, 1.830896307783319], [13.282631463278816, 1.31418366129688], [14.026668735417214, 1.395677395021153], [14.276265903386953, 1.196929836426619], [13.843320753645653, 0.038757635901149], [14.316418491277741, -0.552627455247048], [14.425455763413593, -1.333406670744971], [14.299210239324564, -1.998275648612213], [13.992407260807706, -2.470804945489099], [13.109618767965626, -2.428740329603513], [12.575284458067639, -1.948511244315134], [12.495702752338159, -2.391688327650242], [11.820963575903189, -2.514161472181982], [11.478038771214299, -2.765618991714241], [11.855121697648114, -3.42687061932105], [11.093772820691923, -3.978826592630546]]] } }, + { "type": "Feature", "properties": { "admin": "United Kingdom", "name": "United Kingdom", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-5.661948614921896, 54.554603176483838], [-6.197884894220976, 53.867565009163329], [-6.953730231137994, 54.073702297575622], [-7.572167934591078, 54.059956366585979], [-7.366030646178785, 54.595840969452688], [-7.572167934591078, 55.131622219454883], [-6.733847011736144, 55.172860012423783], [-5.661948614921896, 54.554603176483838]]], [[[-3.00500484863528, 58.635000108466322], [-4.073828497728015, 57.55302480735525], [-3.055001796877661, 57.690019029360933], [-1.959280564776918, 57.684799709699512], [-2.219988165689301, 56.870017401753515], [-3.119003058271118, 55.97379303651546], [-2.085009324543023, 55.909998480851264], [-2.005675679673856, 55.804902850350217], [-1.11499101399221, 54.624986477265388], [-0.4304849918542, 54.464376125702145], [0.184981316742039, 53.325014146531018], [0.469976840831777, 52.929999498091959], [1.681530795914739, 52.739520168663987], [1.559987827164377, 52.099998480836], [1.050561557630914, 51.806760565795678], [1.4498653499503, 51.289427802121949], [0.550333693045502, 50.765738837275862], [-0.787517462558639, 50.774988918656206], [-2.489997524414377, 50.500018622431227], [-2.956273972984035, 50.696879991247002], [-3.617448085942327, 50.228355617872708], [-4.542507900399243, 50.341837063185658], [-5.245023159191134, 49.959999904981082], [-5.776566941745299, 50.159677639356815], [-4.309989793301837, 51.210001125689146], [-3.414850633142122, 51.426008612669236], [-3.422719467108322, 51.426848167406078], [-4.984367234710873, 51.593466091510962], [-5.267295701508885, 51.991400458374571], [-4.222346564134852, 52.30135569926135], [-4.770013393564112, 52.840004991255611], [-4.579999152026914, 53.495003770555165], [-3.093830673788658, 53.404547400669671], [-3.092079637047106, 53.404440822963544], [-2.945008510744343, 53.98499970154667], [-3.614700825433033, 54.60093677329256], [-3.63000545898933, 54.615012925833], [-4.844169073903003, 54.790971177786837], [-5.082526617849224, 55.061600653699358], [-4.719112107756643, 55.508472601943467], [-5.047980922862108, 55.783985500707516], [-5.586397670911139, 55.311146145236805], [-5.64499874513018, 56.275014960344791], [-6.149980841486352, 56.785009670633528], [-5.78682471355529, 57.818848375064633], [-5.009998745127574, 58.630013332750039], [-4.211494513353555, 58.550845038479153], [-3.00500484863528, 58.635000108466322]]]] } }, + { "type": "Feature", "properties": { "admin": "Georgia", "name": "Georgia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[41.55408410011065, 41.535656236327561], [41.703170607272703, 41.962942816732912], [41.453470086438379, 42.645123399417926], [40.875469191253785, 43.013628038091277], [40.321394484220313, 43.128633938156831], [39.955008579270917, 43.434997666999216], [40.07696495947976, 43.553104153002309], [40.922184686045618, 43.38215851498078], [42.394394565608806, 43.220307929042619], [43.756016880067378, 42.74082815202248], [43.931199985536828, 42.554973863284758], [44.537622918481979, 42.71199270280362], [45.470279168485703, 42.502780666669963], [45.776410353382758, 42.09244395605635], [46.404950799348818, 41.860675157227298], [46.145431756379004, 41.722802435872573], [46.637908156120574, 41.181672675128219], [46.501637404166921, 41.064444688474104], [45.962600538930381, 41.123872585609767], [45.217426385281577, 41.411451931314041], [44.972480096218071, 41.248128567055588], [43.582745802592726, 41.09214325618256], [42.619548781104484, 41.583172715819934], [41.55408410011065, 41.535656236327561]]] } }, + { "type": "Feature", "properties": { "admin": "Ghana", "name": "Ghana", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[1.060121697604927, 5.928837388528875], [-0.507637905265938, 5.343472601742675], [-1.063624640294193, 5.000547797053811], [-1.964706590167594, 4.71046214438337], [-2.856125047202397, 4.994475816259508], [-2.810701463217839, 5.389051215024109], [-3.244370083011261, 6.2504715031135], [-2.983584967450326, 7.379704901555511], [-2.56218950032624, 8.219627793811481], [-2.827496303712706, 9.642460842319775], [-2.963896246747111, 10.395334784380081], [-2.94040930827046, 10.962690334512557], [-1.203357713211431, 11.009819240762736], [-0.761575893548183, 10.936929633015053], [-0.438701544588582, 11.09834096927872], [0.023802524423701, 11.018681748900802], [-0.049784715159944, 10.706917832883928], [0.367579990245389, 10.191212876827176], [0.365900506195885, 9.46500397382948], [0.461191847342121, 8.677222601756013], [0.712029249686878, 8.312464504423827], [0.490957472342245, 7.411744289576474], [0.570384148774849, 6.914358628767188], [0.836931186536333, 6.279978745952147], [1.060121697604927, 5.928837388528875]]] } }, + { "type": "Feature", "properties": { "admin": "Guinea", "name": "Guinea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-8.439298468448696, 7.686042792181736], [-8.722123582382123, 7.711674302598509], [-8.926064622422002, 7.309037380396375], [-9.208786383490844, 7.313920803247952], [-9.403348151069748, 7.526905218938906], [-9.33727983238458, 7.928534450711351], [-9.755342169625832, 8.541055202666923], [-10.016566534861253, 8.42850393313523], [-10.230093553091276, 8.406205552601291], [-10.505477260774667, 8.348896389189603], [-10.494315151399629, 8.715540676300433], [-10.65477047366589, 8.977178452994194], [-10.622395188835037, 9.267910061068276], [-10.839151984083299, 9.688246161330367], [-11.117481248407328, 10.045872911006283], [-11.917277390988655, 10.046983954300556], [-12.150338100625003, 9.858571682164378], [-12.425928514037562, 9.835834051955953], [-12.596719122762206, 9.620188300001969], [-12.711957566773076, 9.342711696810765], [-13.246550258832512, 8.903048610871506], [-13.685153977909788, 9.494743760613458], [-14.074044969122278, 9.886166897008248], [-14.330075852912367, 10.015719712763966], [-14.579698859098254, 10.214467271358513], [-14.693231980843501, 10.65630076745404], [-14.83955379887794, 10.876571560098139], [-15.130311245168167, 11.040411688679525], [-14.685687221728896, 11.527823798056485], [-14.382191534878727, 11.509271958863691], [-14.121406419317776, 11.677117010947693], [-13.900799729863772, 11.678718980348744], [-13.743160773157411, 11.811269029177408], [-13.828271857142122, 12.142644151249041], [-13.718743658899511, 12.247185573775507], [-13.700476040084322, 12.586182969610192], [-13.217818162478235, 12.575873521367964], [-12.499050665730561, 12.332089952031053], [-12.278599005573438, 12.354440008997285], [-12.20356482588563, 12.465647691289401], [-11.658300950557928, 12.386582749882834], [-11.513942836950587, 12.442987575729415], [-11.456168585648269, 12.076834214725336], [-11.297573614944508, 12.077971096235768], [-11.036555955438256, 12.211244615116513], [-10.870829637078211, 12.177887478072106], [-10.593223842806278, 11.923975328005977], [-10.165213792348835, 11.844083563682743], [-9.890992804392011, 12.060478623904968], [-9.567911749703212, 12.194243068892472], [-9.327616339546008, 12.334286200403451], [-9.127473517279581, 12.308060411015331], [-8.905264858424529, 12.088358059126433], [-8.786099005559462, 11.812560939984705], [-8.376304897484911, 11.393645941610627], [-8.581305304386772, 11.136245632364801], [-8.620321010767126, 10.810890814655181], [-8.407310756860026, 10.90925690352276], [-8.282357143578279, 10.792597357623842], [-8.335377163109738, 10.494811916541932], [-8.029943610048617, 10.206534939001711], [-8.22933712404682, 10.129020290563897], [-8.309616461612249, 9.789531968622439], [-8.079113735374348, 9.376223863152033], [-7.832100389019186, 8.575704250518625], [-8.203498907900878, 8.455453192575446], [-8.299048631208562, 8.316443589710302], [-8.221792364932197, 8.123328762235571], [-8.280703497744936, 7.687179673692156], [-8.439298468448696, 7.686042792181736]]] } }, + { "type": "Feature", "properties": { "admin": "Gambia", "name": "Gambia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-16.84152462408127, 13.151393947802557], [-16.713728807023468, 13.594958604379853], [-15.624596320039936, 13.623587347869556], [-15.398770310924457, 13.860368760630916], [-15.081735398813816, 13.876491807505982], [-14.687030808968483, 13.63035696049978], [-14.376713833055785, 13.625680243377371], [-14.046992356817478, 13.794067898000446], [-13.844963344772404, 13.505041612191999], [-14.277701788784553, 13.28058502853224], [-14.712197231494626, 13.298206691943774], [-15.141163295949463, 13.509511623585235], [-15.511812506562931, 13.278569647672864], [-15.691000535534991, 13.270353094938455], [-15.931295945692208, 13.130284125211331], [-16.84152462408127, 13.151393947802557]]] } }, + { "type": "Feature", "properties": { "admin": "Guinea Bissau", "name": "Guinea-Bissau", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-15.130311245168167, 11.040411688679525], [-15.664180467175523, 11.458474025920792], [-16.085214199273562, 11.524594021038236], [-16.314786749730199, 11.806514797406548], [-16.308947312881227, 11.958701890506116], [-16.613838263403277, 12.170911159712698], [-16.67745195155457, 12.38485158940105], [-16.147716844130581, 12.547761542201185], [-15.816574266004251, 12.515567124883345], [-15.548476935274005, 12.628170070847343], [-13.700476040084322, 12.586182969610192], [-13.718743658899511, 12.247185573775507], [-13.828271857142122, 12.142644151249041], [-13.743160773157411, 11.811269029177408], [-13.900799729863772, 11.678718980348744], [-14.121406419317776, 11.677117010947693], [-14.382191534878727, 11.509271958863691], [-14.685687221728896, 11.527823798056485], [-15.130311245168167, 11.040411688679525]]] } }, + { "type": "Feature", "properties": { "admin": "Equatorial Guinea", "name": "Eq. Guinea", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[9.492888624721981, 1.010119533691494], [9.305613234096255, 1.160911363119183], [9.649158155972627, 2.283866075037735], [11.276449008843711, 2.261050930180871], [11.285078973036461, 1.057661851400013], [9.83028405115564, 1.067893784993799], [9.492888624721981, 1.010119533691494]]] } }, + { "type": "Feature", "properties": { "admin": "Greece", "name": "Greece", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[23.699980096133, 35.705004380835526], [24.246665073348673, 35.368022365860149], [25.025015496528873, 35.424995632461979], [25.769207797964182, 35.354018052709073], [25.745023227651579, 35.179997666966209], [26.290002882601719, 35.299990342747911], [26.164997592887651, 35.004995429009789], [24.724982130642299, 34.919987697889603], [24.735007358506941, 35.084990546197581], [23.514978468528106, 35.27999156345097], [23.699980096133, 35.705004380835526]]], [[[26.604195590936282, 41.562114569661098], [26.294602085075777, 40.936261298174244], [26.056942172965499, 40.824123440100827], [25.44767703624418, 40.852545477861455], [24.925848422960932, 40.947061672523226], [23.714811232200809, 40.687129218095116], [24.407998894964063, 40.124992987624083], [23.89996788910258, 39.962005520175573], [23.342999301860797, 39.960997829745786], [22.813987664488959, 40.476005153966547], [22.626298862404777, 40.256561184239175], [22.849747755634805, 39.659310818025759], [23.350027296652595, 39.190011298167256], [22.97309939951554, 38.97090322524965], [23.53001631032495, 38.51000112563846], [24.025024855248937, 38.219992987616443], [24.040011020613601, 37.655014553369419], [23.115002882589145, 37.920011298162215], [23.409971958111065, 37.409990749657389], [22.77497195810863, 37.305010077456551], [23.154225294698612, 36.422505804992042], [22.4900281104511, 36.410000108377446], [21.670026482843692, 36.84498647719419], [21.295010613701574, 37.644989325504689], [21.120034213961329, 38.31032339126272], [20.730032179454579, 38.769985256498778], [20.217712029712853, 39.340234686839629], [20.150015903410516, 39.624997666984022], [20.615000441172779, 40.110006822259422], [20.67499677906363, 40.434999904943048], [20.999989861747274, 40.580003973953964], [21.020040317476422, 40.842726955725873], [21.674160597426969, 40.931274522457976], [22.055377638444266, 41.149865831052686], [22.597308383889008, 41.130487168943198], [22.76177, 41.3048], [22.952377150166562, 41.337993882811212], [23.692073601992455, 41.309080918943849], [24.492644891058031, 41.583896185872035], [25.19720136892553, 41.234485988930651], [26.106138136507177, 41.328898830727823], [26.11704186372091, 41.826904608724725], [26.604195590936282, 41.562114569661098]]]] } }, + { "type": "Feature", "properties": { "admin": "Greenland", "name": "Greenland", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-46.76379, 82.62796], [-43.40644, 83.22516], [-39.89753, 83.18018], [-38.62214, 83.54905], [-35.08787, 83.64513], [-27.10046, 83.51966], [-20.84539, 82.72669], [-22.69182, 82.34165], [-26.51753, 82.29765], [-31.9, 82.2], [-31.39646, 82.02154], [-27.85666, 82.13178], [-24.84448, 81.78697], [-22.90328, 82.09317], [-22.07175, 81.73449], [-23.16961, 81.15271], [-20.62363, 81.52462], [-15.76818, 81.91245], [-12.77018, 81.71885], [-12.20855, 81.29154], [-16.28533, 80.58004], [-16.85, 80.35], [-20.04624, 80.17708], [-17.73035, 80.12912], [-18.9, 79.4], [-19.70499, 78.75128], [-19.67353, 77.63859], [-18.47285, 76.98565], [-20.03503, 76.94434], [-21.67944, 76.62795], [-19.83407, 76.09808], [-19.59896, 75.24838], [-20.66818, 75.15585], [-19.37281, 74.29561], [-21.59422, 74.22382], [-20.43454, 73.81713], [-20.76234, 73.46436], [-22.17221, 73.30955], [-23.56593, 73.30663], [-22.31311, 72.62928], [-22.29954, 72.18409], [-24.27834, 72.59788], [-24.79296, 72.3302], [-23.44296, 72.08016], [-22.13281, 71.46898], [-21.75356, 70.66369], [-23.53603, 70.471], [-24.30702, 70.85649], [-25.54341, 71.43094], [-25.20135, 70.75226], [-26.36276, 70.22646], [-23.72742, 70.18401], [-22.34902, 70.12946], [-25.02927, 69.2588], [-27.74737, 68.47046], [-30.67371, 68.12503], [-31.77665, 68.12078], [-32.81105, 67.73547], [-34.20196, 66.67974], [-36.35284, 65.9789], [-37.04378, 65.93768], [-38.37505, 65.69213], [-39.81222, 65.45848], [-40.66899, 64.83997], [-40.68281, 64.13902], [-41.1887, 63.48246], [-42.81938, 62.68233], [-42.41666, 61.90093], [-42.86619, 61.07404], [-43.3784, 60.09772], [-44.7875, 60.03676], [-46.26364, 60.85328], [-48.26294, 60.85843], [-49.23308, 61.40681], [-49.90039, 62.38336], [-51.63325, 63.62691], [-52.14014, 64.27842], [-52.27659, 65.1767], [-53.66166, 66.09957], [-53.30161, 66.8365], [-53.96911, 67.18899], [-52.9804, 68.35759], [-51.47536, 68.72958], [-51.08041, 69.14781], [-50.87122, 69.9291], [-52.013585, 69.574925], [-52.55792, 69.42616], [-53.45629, 69.283625], [-54.68336, 69.61003], [-54.75001, 70.28932], [-54.35884, 70.821315], [-53.431315, 70.835755], [-51.39014, 70.56978], [-53.10937, 71.20485], [-54.00422, 71.54719], [-55.0, 71.406536967272558], [-55.83468, 71.65444], [-54.71819, 72.58625], [-55.32634, 72.95861], [-56.12003, 73.64977], [-57.32363, 74.71026], [-58.59679, 75.09861], [-58.58516, 75.51727], [-61.26861, 76.10238], [-63.39165, 76.1752], [-66.06427, 76.13486], [-68.50438, 76.06141], [-69.66485, 76.37975], [-71.40257, 77.00857], [-68.77671, 77.32312], [-66.76397, 77.37595], [-71.04293, 77.63595], [-73.297, 78.04419], [-73.15938, 78.43271], [-69.37345, 78.91388], [-65.7107, 79.39436], [-65.3239, 79.75814], [-68.02298, 80.11721], [-67.15129, 80.51582], [-63.68925, 81.21396], [-62.23444, 81.3211], [-62.65116, 81.77042], [-60.28249, 82.03363], [-57.20744, 82.19074], [-54.13442, 82.19962], [-53.04328, 81.88833], [-50.39061, 82.43883], [-48.00386, 82.06481], [-46.59984, 81.985945], [-44.523, 81.6607], [-46.9007, 82.19979], [-46.76379, 82.62796]]] } }, + { "type": "Feature", "properties": { "admin": "Guatemala", "name": "Guatemala", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-90.095554572290951, 13.73533763270073], [-90.608624030300817, 13.909771429901948], [-91.232410244496037, 13.927832342987953], [-91.689746670279106, 14.126218166556452], [-92.227750006869812, 14.538828640190925], [-92.203229539747298, 14.830102850804066], [-92.087215949252041, 15.064584662328436], [-92.229248623406249, 15.251446641495857], [-91.747960171255912, 16.066564846251719], [-90.464472622422647, 16.069562079324651], [-90.438866950222021, 16.410109768128091], [-90.600846727240906, 16.470777899638758], [-90.711821865587694, 16.687483018454724], [-91.081670091500641, 16.918476670799404], [-91.453921271515128, 17.252177232324168], [-91.002269253284197, 17.254657701074176], [-91.001519945015943, 17.817594916245707], [-90.067933519230948, 17.819326076727474], [-89.143080410503302, 17.808318996649316], [-89.15080603713092, 17.015576687075832], [-89.229121670269265, 15.886937567605166], [-88.930612759135244, 15.887273464415072], [-88.604586147805833, 15.706380113177358], [-88.518364020526846, 15.855389105690971], [-88.22502275262201, 15.727722479713901], [-88.680679694355618, 15.346247056535301], [-89.15481096063354, 15.066419175674806], [-89.225220099631244, 14.874286200413618], [-89.145535041037149, 14.67801911056908], [-89.353325975282772, 14.424132798719112], [-89.587342698916544, 14.362586167859485], [-89.5342193265205, 14.244815578666302], [-89.7219339668207, 14.134228013561694], [-90.064677903996568, 13.881969509328924], [-90.095554572290951, 13.73533763270073]]] } }, + { "type": "Feature", "properties": { "admin": "Guyana", "name": "Guyana", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-59.758284878159181, 8.367034816924045], [-59.10168412945864, 7.99920197187049], [-58.482962205628041, 7.347691351750696], [-58.454876064677414, 6.832787380394463], [-58.078103196837361, 6.809093736188641], [-57.542218593970631, 6.321268215353355], [-57.147436489476874, 5.973149929219161], [-57.307245856339492, 5.073566595882225], [-57.914288906472123, 4.812626451024413], [-57.860209520078691, 4.576801052260449], [-58.044694383360664, 4.060863552258382], [-57.601568976457848, 3.334654649260684], [-57.281433478409703, 3.333491929534119], [-57.150097825739898, 2.768926906745406], [-56.53938574891454, 1.89952260986692], [-56.782704230360814, 1.863710842288653], [-57.33582292339689, 1.948537705895759], [-57.660971035377358, 1.682584947105638], [-58.113449876525003, 1.507195135907025], [-58.429477098205957, 1.46394196207872], [-58.540012986878288, 1.26808828369252], [-59.030861579002639, 1.317697658692722], [-59.646043667221242, 1.786893825686789], [-59.718545701726732, 2.249630438644359], [-59.974524909084543, 2.755232652188055], [-59.815413174057852, 3.606498521332085], [-59.538039923731219, 3.958802598481937], [-59.767405768458701, 4.423502915866606], [-60.111002366767373, 4.574966538914082], [-59.980958624904865, 5.014061184098138], [-60.213683437731319, 5.2444863956876], [-60.733574184803707, 5.2002772078619], [-61.410302903881941, 5.959068101419616], [-61.139415045807937, 6.234296779806142], [-61.159336310456467, 6.696077378766317], [-60.543999192940966, 6.856584377464881], [-60.295668097562377, 7.043911444522918], [-60.637972785063752, 7.414999904810853], [-60.550587938058186, 7.779602972846178], [-59.758284878159181, 8.367034816924045]]] } }, + { "type": "Feature", "properties": { "admin": "Honduras", "name": "Honduras", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-87.316654425795463, 12.984685777229], [-87.48940873894712, 13.29753489832393], [-87.793111131526501, 13.384480495655165], [-87.723502977229288, 13.785050360565602], [-87.859515347021599, 13.893312486217097], [-88.065342576840109, 13.964625962779788], [-88.503997972349609, 13.845485948130939], [-88.541230841815931, 13.98015473068352], [-88.843072882832743, 14.140506700085208], [-89.058511929057644, 14.340029405164213], [-89.353325975282786, 14.424132798719084], [-89.145535041037164, 14.678019110569149], [-89.22522009963123, 14.874286200413675], [-89.154810960633526, 15.066419175674863], [-88.680679694355575, 15.346247056535386], [-88.225022752621925, 15.727722479714027], [-88.121153123715359, 15.688655096901355], [-87.901812506852394, 15.864458319558194], [-87.615680101252309, 15.878798529519198], [-87.522920905288444, 15.797278957578779], [-87.367762417332116, 15.846940009011286], [-86.903191291028165, 15.756712958229565], [-86.440945604177372, 15.782835394753189], [-86.119233974944322, 15.893448798073958], [-86.00195431185783, 16.005405788634388], [-85.68331743034625, 15.953651841693949], [-85.444003872402547, 15.885749009662444], [-85.182443610357183, 15.909158433490628], [-84.98372188997881, 15.995923163308698], [-84.526979743167118, 15.857223619037423], [-84.36825558138257, 15.835157782448729], [-84.063054572266807, 15.648244126849132], [-83.773976610026111, 15.42407176356687], [-83.410381232420363, 15.27090281825377], [-83.147219000974104, 14.995829169164207], [-83.489988776366005, 15.01626719813566], [-83.628584967772866, 14.880073960830368], [-83.975721401693576, 14.749435939996483], [-84.228341640952394, 14.748764146376626], [-84.449335903648588, 14.62161428472251], [-84.64958207877963, 14.666805324761865], [-84.820036790694289, 14.819586696832628], [-84.924500698572302, 14.790492865452332], [-85.052787441736868, 14.551541042534719], [-85.148750576502877, 14.560196844943615], [-85.165364549484806, 14.354369615125048], [-85.514413011400265, 14.079011745657905], [-85.698665330736944, 13.960078436737998], [-85.801294725268505, 13.8360549992376], [-86.096263800790595, 14.03818736414723], [-86.312142096689826, 13.771356106008223], [-86.520708177419891, 13.778487453664464], [-86.755086636079596, 13.754845485890936], [-86.733821784191463, 13.263092556201398], [-86.880557013684353, 13.254204209847213], [-87.005769009127434, 13.025794379117254], [-87.316654425795463, 12.984685777229]]] } }, + { "type": "Feature", "properties": { "admin": "Croatia", "name": "Croatia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[18.829838087650039, 45.908877671891837], [19.072768995854172, 45.521511135432078], [19.390475701584588, 45.236515611342369], [19.005486281010118, 44.860233669609144], [18.553214145591646, 45.08158966733145], [17.861783481526398, 45.067740383477137], [17.00214603035101, 45.233776760430935], [16.534939406000202, 45.211607570977705], [16.318156772535868, 45.004126695325901], [15.959367303133373, 45.233776760430935], [15.750026075918978, 44.81871165626255], [16.239660271884528, 44.351143296885695], [16.456442905348862, 44.041239732431265], [16.916156447017325, 43.667722479825663], [17.297373488034449, 43.446340643887353], [17.674921502358981, 43.028562527023603], [18.56, 42.65], [18.450016310304814, 42.47999136002931], [17.509970330483323, 42.84999461523914], [16.930005730871638, 43.209998480800373], [16.015384555737679, 43.507215481127204], [15.174453973052094, 44.243191229827907], [15.376250441151793, 44.317915350922064], [14.920309279040504, 44.73848399512945], [14.901602410550874, 45.076060289076104], [14.258747592839992, 45.233776760430935], [13.952254672917032, 44.802123521496853], [13.65697553880119, 45.136935126315947], [13.679403110415816, 45.484149074884996], [13.715059848697248, 45.500323798192419], [14.411968214585496, 45.466165676447403], [14.595109490627916, 45.63494090431282], [14.935243767972961, 45.471695054702757], [15.327674594797424, 45.452316392593325], [15.323953891672428, 45.731782538427687], [15.671529575267638, 45.8341535507979], [15.768732944408608, 46.23810822202352], [16.564808383864939, 46.503750922219794], [16.882515089595412, 46.380631822284428], [17.630066359129554, 45.951769110694087], [18.456062452882858, 45.759481106136143], [18.829838087650039, 45.908877671891837]]] } }, + { "type": "Feature", "properties": { "admin": "Haiti", "name": "Haiti", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-73.189790615517595, 19.915683905511909], [-72.579672817663607, 19.871500555902351], [-71.71236141629295, 19.714455878167353], [-71.624873216422813, 19.169837958243303], [-71.701302659782485, 18.785416978424049], [-71.945112067335543, 18.616900132720257], [-71.687737596305865, 18.316660061104468], [-71.708304816358037, 18.044997056546091], [-72.372476162389333, 18.214960842354053], [-72.844411180294856, 18.145611070218362], [-73.454554816365018, 18.217906398994696], [-73.922433234335642, 18.030992743395], [-74.458033616824764, 18.342549953682703], [-74.369925299767118, 18.664907538319408], [-73.449542202432696, 18.526052964751141], [-72.694937099890623, 18.445799465401858], [-72.334881557896992, 18.66842153571525], [-72.791649542924873, 19.101625067618027], [-72.784104783810264, 19.483591416903405], [-73.41502234566174, 19.639550889560276], [-73.189790615517595, 19.915683905511909]]] } }, + { "type": "Feature", "properties": { "admin": "Hungary", "name": "Hungary", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[16.202298211337361, 46.852385972676949], [16.534267612380372, 47.496170966169103], [16.340584344150411, 47.712901923201215], [16.903754103267257, 47.714865627628321], [16.979666782304033, 48.123497015976298], [17.488472934649813, 47.867466132186209], [17.857132602620023, 47.758428860050365], [18.696512892336923, 47.88095368101439], [18.777024773847668, 48.081768296900627], [19.174364861739885, 48.111378892603859], [19.66136355965849, 48.266614895208647], [19.769470656013109, 48.2026911484636], [20.239054396249344, 48.327567247096916], [20.473562045989862, 48.562850043321809], [20.801293979584919, 48.62385407164237], [21.872236362401729, 48.319970811550007], [22.085608351334848, 48.422264309271782], [22.640819939878746, 48.150239569687351], [22.710531447040488, 47.882193915389394], [22.09976769378283, 47.672439276716695], [21.626514926853869, 46.994237779318148], [21.021952345471245, 46.316087958351886], [20.220192498462833, 46.127468980486547], [19.596044549241579, 46.171729844744533], [18.829838087649957, 45.908877671891915], [18.456062452882858, 45.759481106136121], [17.630066359129554, 45.95176911069418], [16.882515089595298, 46.380631822284428], [16.564808383864854, 46.503750922219822], [16.370504998447412, 46.841327216166498], [16.202298211337361, 46.852385972676949]]] } }, + { "type": "Feature", "properties": { "admin": "Indonesia", "name": "Indonesia", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[120.715608758630438, -10.239581394087862], [120.295014276206871, -10.258649997603525], [118.967808465654684, -9.55796925215803], [119.900309686361609, -9.361340427287514], [120.425755649905398, -9.665921319215796], [120.775501743656719, -9.969675388227456], [120.715608758630438, -10.239581394087862]]], [[[124.435950148619384, -10.14000090906144], [123.579981724136701, -10.359987481327961], [123.459989048354998, -10.239994805546171], [123.55000939340745, -9.900015557497978], [123.980008986508096, -9.290026950724693], [124.96868248911619, -8.892790215697046], [125.070019972840612, -9.089987481322835], [125.088520135601073, -9.393173109579321], [124.435950148619384, -10.14000090906144]]], [[[117.900018345207741, -8.095681247594923], [118.260616489740471, -8.362383314653327], [118.87845991422212, -8.280682875199828], [119.126506789223086, -8.705824883665072], [117.97040164598927, -8.906639499551257], [117.277730747549015, -9.040894870645557], [116.74014082241662, -9.032936700072637], [117.083737420725313, -8.457157891476539], [117.632024367342126, -8.44930307376819], [117.900018345207741, -8.095681247594923]]], [[[122.903537225436082, -8.094234307490735], [122.756982863456287, -8.649807631060638], [121.2544905945701, -8.933666273639941], [119.924390903809567, -8.810417982623873], [119.920928582846102, -8.44485890059107], [120.715091994307542, -8.236964613480863], [121.341668735846554, -8.53673959720602], [122.007364536630405, -8.46062021244016], [122.903537225436082, -8.094234307490735]]], [[[108.623478631628927, -6.777673841990675], [110.539227329553285, -6.877357679881682], [110.759575636845909, -6.465186455921751], [112.614811232556349, -6.946035658397589], [112.978768345188087, -7.594213148634578], [114.478935174621142, -7.776527601760277], [115.705526971501058, -8.370806573116864], [114.564511346496488, -8.75181690840483], [113.464733514460875, -8.348947442257424], [112.559672479301028, -8.376180922075163], [111.522061395312448, -8.302128594600957], [110.586149530074294, -8.122604668819021], [109.427667270955183, -7.740664157749761], [108.693655226681301, -7.641600437046219], [108.277763299596302, -7.766657403192579], [106.454102004016136, -7.354899590690947], [106.280624220812285, -6.924899997590201], [105.365486281355516, -6.851416110871169], [106.051645949327053, -5.895918877794499], [107.265008579540165, -5.954985039904058], [108.072091099074683, -6.345762220895237], [108.486846144649235, -6.421984958525768], [108.623478631628927, -6.777673841990675]]], [[[134.724624465066654, -6.214400730009286], [134.210133905168902, -6.895237725454704], [134.112775506730998, -6.142467136259014], [134.290335728085779, -5.783057549669038], [134.499625278867882, -5.445042006047898], [134.727001580952106, -5.737582289252158], [134.724624465066654, -6.214400730009286]]], [[[127.249215122588893, -3.459065036638889], [126.874922723498855, -3.790982761249579], [126.183802118027302, -3.607376397316556], [125.989033644719257, -3.177273451351325], [127.00065148326496, -3.12931772218441], [127.249215122588893, -3.459065036638889]]], [[[130.471344028851775, -3.09376433676762], [130.834836053592767, -3.858472181822761], [129.990546502808115, -3.446300957862817], [129.155248651242403, -3.362636813982248], [128.590683628453633, -3.428679294451256], [127.898891229362334, -3.393435967628192], [128.135879347852779, -2.843650404474914], [129.370997756060888, -2.802154229344551], [130.471344028851775, -3.09376433676762]]], [[[134.143367954647772, -1.151867364103594], [134.422627394753022, -2.769184665542383], [135.457602980694674, -3.367752780779113], [136.293314243718754, -2.30704233155609], [137.4407377463275, -1.703513278819372], [138.329727411044757, -1.70268645590265], [139.18492068904294, -2.051295668143637], [139.926684198160387, -2.409051608900284], [141.000210402591847, -2.600151055515624], [141.017056919519007, -5.85902190513802], [141.033851760013874, -9.117892754760417], [140.143415155192542, -8.297167657100955], [139.127766554928087, -8.096042982620942], [138.881476678624949, -8.380935153846094], [137.614473911692812, -8.41168263105976], [138.039099155835174, -7.597882175327354], [138.668621454014783, -7.320224704623072], [138.407913853102343, -6.232849216337483], [137.927839797110835, -5.393365573755998], [135.989250116113453, -4.546543877789047], [135.164597609599667, -4.462931410340771], [133.662880487197867, -3.538853448097526], [133.367704705946778, -4.024818617370314], [132.983955519747326, -4.112978610860281], [132.75694095268895, -3.746282647317129], [132.753788690319197, -3.311787204607071], [131.989804315316178, -2.820551039240455], [133.066844517143466, -2.460417982598443], [133.780030959203486, -2.479848321140209], [133.69621178602614, -2.214541517753687], [132.232373488494204, -2.212526136894325], [131.836221958544684, -1.617161960459597], [130.942839797082797, -1.432522067880796], [130.519558140180038, -0.937720228686075], [131.867537876513609, -0.695461114101818], [132.380116408416768, -0.369537855636977], [133.985548130428384, -0.780210463060442], [134.143367954647772, -1.151867364103594]]], [[[125.240500522971573, 1.419836127117605], [124.43703535369734, 0.427881171058971], [123.685504998876695, 0.235593166500877], [122.723083123872854, 0.431136786293337], [121.056724888189081, 0.381217352699451], [120.18308312386273, 0.23724681233422], [120.040869582195455, -0.519657891444851], [120.935905389490699, -1.408905938323372], [121.475820754076167, -0.955962009285116], [123.34056481332847, -0.615672702643081], [123.258399285984481, -1.076213067228337], [122.822715285331597, -0.930950616055881], [122.388529901215364, -1.516858005381124], [121.508273553555455, -1.904482924002422], [122.454572381684272, -3.186058444840881], [122.271896193532541, -3.529500013852696], [123.170962762546537, -4.683693129091707], [123.162332798353759, -5.34060393638596], [122.628515252778683, -5.634591159694494], [122.236394484548057, -5.282933037948281], [122.71956912647704, -4.46417164471579], [121.738233677254357, -4.851331475446499], [121.48946333220124, -4.574552504091215], [121.619171177253861, -4.188477878438674], [120.898181593917684, -3.602105401222828], [120.972388950688767, -2.627642917494909], [120.305452915529884, -2.931603692235725], [120.39004723519173, -4.097579034037223], [120.430716587405371, -5.528241062037778], [119.796543410319487, -5.67340016034565], [119.36690555224493, -5.379878024927804], [119.653606398600104, -4.459417412944958], [119.498835483885969, -3.49441171632651], [119.078344354326987, -3.487021986508764], [118.767768996252869, -2.801999200047688], [119.180973748858662, -2.147103773612798], [119.323393996255049, -1.35314706788047], [119.825998976725828, 0.154254462073496], [120.035701938966341, 0.566477362465804], [120.885779250167687, 1.309222723796835], [121.666816847826965, 1.013943589681076], [122.927566766451818, 0.875192368977465], [124.077522414242836, 0.917101955566139], [125.065989211121803, 1.643259182131558], [125.240500522971573, 1.419836127117605]]], [[[128.688248732620707, 1.132385972494106], [128.635952183141342, 0.258485826006179], [128.120169712436166, 0.356412665199286], [127.968034295768845, -0.252077325037533], [128.379998813999691, -0.780003757331286], [128.100015903842291, -0.899996433112974], [127.69647464407501, -0.266598402511505], [127.399490187693743, 1.011721503092573], [127.600511509309044, 1.81069082275718], [127.932377557487484, 2.174596258956555], [128.004156121940809, 1.628531398928331], [128.594559360875451, 1.540810655112864], [128.688248732620707, 1.132385972494106]]], [[[117.875627069166001, 1.827640692548911], [118.996747267738158, 0.902219143066048], [117.811858351717788, 0.784241848143722], [117.478338657706047, 0.102474676917026], [117.521643507966587, -0.803723239753211], [116.560048455879496, -1.487660821136231], [116.533796828275158, -2.483517347832901], [116.148083937648607, -4.012726332214014], [116.000857782049067, -3.657037448749008], [114.864803094544513, -4.106984144714416], [114.468651564595064, -3.49570362713382], [113.755671828264099, -3.439169610206519], [113.256994256647545, -3.118775729996854], [112.068126255340644, -3.478392022316071], [111.703290643359992, -2.994442233902631], [111.04824018762821, -3.049425957861188], [110.223846063275971, -2.934032484553483], [110.070935500124335, -1.592874037282414], [109.571947869914041, -1.314906507984489], [109.091873813922518, -0.459506524257051], [108.952657505328162, 0.415375474444346], [109.069136183714036, 1.341933905437642], [109.663260125773718, 2.006466986494984], [109.830226678508836, 1.338135687664191], [110.514060907027101, 0.773131415200993], [111.159137811326559, 0.976478176269509], [111.797548455860408, 0.904441229654651], [112.380251906383648, 1.410120957846757], [112.859809198052176, 1.497790025229946], [113.805849644019531, 1.217548732911041], [114.621355422017473, 1.430688177898886], [115.134037306785231, 2.821481838386219], [115.51907840379198, 3.169238389494395], [115.86551720587677, 4.306559149590156], [117.01521447150634, 4.306094061699468], [117.882034946770162, 4.137551377779487], [117.313232456533513, 3.234428208830578], [118.048329705885351, 2.287690131027361], [117.875627069166001, 1.827640692548911]]], [[[105.817655063909356, -5.852355645372411], [104.710384149191498, -5.873284600450644], [103.868213332130736, -5.037314955264974], [102.584260695406897, -4.220258884298203], [102.156173130300999, -3.614146009946765], [101.399113397225051, -2.799777113459171], [100.902502882900137, -2.05026213949786], [100.141980828860596, -0.650347588710957], [99.26373986206022, 0.183141587724663], [98.970011020913319, 1.042882391764536], [98.601351352943084, 1.823506577965616], [97.699597609449881, 2.453183905442116], [97.17694217324987, 3.30879059489861], [96.424016554757316, 3.86885976807791], [95.380876092513475, 4.970782172053673], [95.293026157617305, 5.479820868344816], [95.936862827541745, 5.439513251157108], [97.484882033277088, 5.24632090903401], [98.369169142655679, 4.268370266126366], [99.142558628335792, 3.590349636240915], [99.693997837322399, 3.174328518075156], [100.641433546961665, 2.099381211755798], [101.658012323007313, 2.083697414555189], [102.498271112073212, 1.398700466310217], [103.076840448013002, 0.561361395668854], [103.838396030698348, 0.104541734208666], [103.437645298274973, -0.711945896002845], [104.010788608824001, -1.059211521004229], [104.369991489684878, -1.084843031421016], [104.539490187602155, -1.782371514496716], [104.887892694113987, -2.340425306816655], [105.622111444116982, -2.42884368246807], [106.10859337771268, -3.06177662517895], [105.857445916774111, -4.305524997579723], [105.817655063909356, -5.852355645372411]]]] } }, + { "type": "Feature", "properties": { "admin": "India", "name": "India", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[77.837450799474553, 35.494009507787759], [78.912268914713209, 34.321936346975782], [78.811086460285722, 33.506198025032404], [79.208891636068572, 32.994394639613709], [79.176128777995501, 32.483779812137705], [78.458446486325997, 32.61816437431272], [78.738894484374001, 31.515906073527056], [79.721366815107089, 30.882714748654724], [81.11125613802929, 30.183480943313398], [80.476721225917373, 29.729865220655334], [80.088424513676259, 28.794470119740136], [81.057202589851997, 28.416095282499036], [81.999987420584958, 27.925479234319987], [83.304248895199535, 27.364505723575554], [84.675017938173767, 27.234901231387528], [85.25177859898335, 26.726198431906337], [86.024392938179147, 26.630984605408567], [87.22747195836628, 26.39789805755607], [88.060237664749806, 26.414615383402484], [88.174804315140904, 26.810405178325944], [88.043132765661198, 27.445818589786818], [88.120440708369841, 27.876541652939586], [88.730325962278528, 28.086864732367509], [88.814248488320544, 27.299315904239361], [88.835642531289366, 27.098966376243755], [89.744527622438838, 26.71940298105995], [90.37327477413406, 26.875724188742872], [91.217512648486405, 26.808648179628019], [92.033483514375078, 26.838310451763554], [92.10371178585973, 27.4526140406332], [91.69665652869665, 27.771741848251661], [92.503118931043616, 27.896876329046442], [93.413347609432662, 28.640629380807219], [94.565990431702929, 29.277438055939978], [95.404802280664612, 29.031716620392125], [96.117678664131006, 29.452802028922459], [96.586590610747479, 28.830979519154337], [96.248833449287758, 28.411030992134435], [97.327113885490007, 28.261582749946331], [97.402561476636123, 27.88253611908544], [97.051988559968066, 27.699058946233144], [97.133999058015277, 27.08377350514996], [96.419365675850941, 27.264589341739221], [95.124767694074933, 26.573572089132295], [95.155153436262566, 26.001307277932078], [94.603249139385355, 25.162495428970399], [94.552657912171611, 24.675238348890328], [94.106741977925054, 23.850740871673477], [93.325187615942767, 24.078556423432197], [93.286326938859247, 23.043658352138998], [93.060294224014598, 22.703110663335565], [93.166127557348361, 22.278459580977099], [92.672720981825549, 22.041238918541247], [92.146034783906799, 23.62749868417259], [91.869927606171302, 23.62434642180278], [91.706475050832083, 22.985263983649183], [91.158963250699713, 23.503526923104381], [91.467729933643668, 24.072639471934789], [91.915092807994398, 24.130413723237108], [92.376201613334786, 24.976692816664961], [91.799595981822065, 25.14743174895731], [90.872210727912105, 25.13260061288954], [89.920692580121838, 25.269749864192171], [89.832480910199592, 25.965082098895476], [89.355094028687276, 26.014407253518065], [88.56304935094974, 26.446525580342716], [88.209789259802477, 25.768065700782707], [88.931553989623069, 25.238692328384769], [88.30637251175601, 24.866079413344199], [88.084422235062405, 24.501657212821918], [88.699940220090895, 24.233714911388557], [88.529769728553759, 23.631141872649163], [88.876311883503064, 22.879146429937826], [89.031961297566198, 22.055708319582973], [88.888765903685396, 21.690588487224741], [88.208497348995209, 21.703171698487804], [86.975704380240259, 21.495561631755201], [87.033168572948853, 20.743307806882406], [86.499351027373777, 20.151638495356604], [85.060265740909671, 19.478578802971096], [83.941005893899998, 18.302009792549722], [83.189217156917834, 17.671221421778977], [82.192792189465905, 17.016636053937813], [82.191241896497175, 16.556664130107844], [81.692719354177456, 16.3102192245079], [80.791999139330116, 15.951972357644488], [80.324895867843864, 15.899184882058346], [80.025069207686428, 15.136414903214144], [80.23327355339039, 13.835770778859978], [80.286293572921849, 13.006260687710832], [79.862546828128487, 12.056215318240886], [79.85799930208681, 10.357275091997108], [79.340511509115984, 10.308854274939618], [78.885345493489169, 9.54613597252772], [79.189719679688281, 9.216543687370146], [78.27794070833049, 8.933046779816932], [77.94116539908434, 8.25295909263974], [77.539897902337927, 7.965534776232331], [76.592978957021657, 8.899276231314188], [76.130061476551063, 10.299630031775518], [75.746467319648488, 11.308250637248303], [75.396101108709573, 11.781245022015822], [74.864815708316812, 12.741935736537895], [74.616717156883524, 13.992582912649677], [74.443859490867197, 14.617221787977693], [73.534199253233368, 15.990652167214957], [73.119909295549419, 17.928570054592495], [72.820909458308634, 19.208233547436162], [72.824475132136783, 20.41950328214153], [72.630533481745388, 21.356009426351001], [71.175273471973938, 20.757441311114228], [70.470458611945091, 20.877330634031381], [69.164130080038817, 22.089298000572697], [69.644927606082391, 22.450774644454334], [69.349596795534325, 22.843179633062686], [68.176645135373377, 23.691965033456704], [68.842599318318761, 24.359133612560932], [71.0432401874682, 24.356523952730193], [70.844699334602822, 25.215102037043511], [70.282873162725579, 25.722228705339823], [70.168926629522005, 26.491871649678835], [69.514392938113119, 26.940965684511365], [70.61649620960192, 27.989196275335861], [71.777665643200308, 27.913180243434521], [72.823751662084689, 28.961591701772047], [73.450638462217412, 29.976413479119863], [74.421380242820263, 30.97981476493117], [74.405928989564998, 31.692639471965272], [75.258641798813187, 32.271105455040491], [74.451559279278698, 32.764899603805489], [74.104293654277328, 33.441473293586846], [73.749948358051952, 34.317698879527846], [74.240202671204955, 34.748887030571247], [75.757060988268321, 34.504922593721311], [76.871721632804011, 34.653544012992732], [77.837450799474553, 35.494009507787759]]] } }, + { "type": "Feature", "properties": { "admin": "Ireland", "name": "Ireland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-6.197884894220989, 53.86756500916335], [-6.032985398777609, 53.153164170944336], [-6.788856573910847, 52.260117906292322], [-8.561616583683557, 51.669301255899349], [-9.977085740590267, 51.820454820353071], [-9.16628251793078, 52.864628811242667], [-9.688524542672452, 53.881362616585285], [-8.327987433292007, 54.664518947968624], [-7.572167934591064, 55.131622219454854], [-7.366030646178785, 54.595840969452709], [-7.572167934591064, 54.059956366585986], [-6.953730231138065, 54.073702297575622], [-6.197884894220989, 53.86756500916335]]] } }, + { "type": "Feature", "properties": { "admin": "Iran", "name": "Iran", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[53.921597934795543, 37.198918361961255], [54.800303989486558, 37.392420762678178], [55.511578403551894, 37.964117133123153], [56.180374790273319, 37.935126654607423], [56.619366082592805, 38.121394354803478], [57.330433790928964, 38.029229437810933], [58.436154412678192, 37.522309475243794], [59.234761997316795, 37.412987982730336], [60.377637973883864, 36.52738312432836], [61.123070509694131, 36.491597194966239], [61.21081709172573, 35.650072333309218], [60.80319339380744, 34.404101874319856], [60.528429803311575, 33.676446031217999], [60.963700392505991, 33.528832302376252], [60.536077915290761, 32.981268825811561], [60.863654819588952, 32.182919623334421], [60.941944614511115, 31.548074652628745], [61.699314406180811, 31.379506130492661], [61.78122155136343, 30.735850328081231], [60.874248488208778, 29.829238999952604], [61.369308709564926, 29.303276272085917], [61.771868117118615, 28.699333807890792], [62.727830438085974, 28.259644883735383], [62.755425652929851, 27.378923448184985], [63.23389773952028, 27.217047024030702], [63.316631707619578, 26.756532497661659], [61.874187453056535, 26.239974880472097], [61.497362908784183, 25.078237006118492], [59.616134067630831, 25.380156561783775], [58.525761346272297, 25.609961656185725], [57.39725141788238, 25.739902045183634], [56.97076582217754, 26.966106268821356], [56.492138706290199, 27.14330475515019], [55.723710158110059, 26.964633490501036], [54.715089552637252, 26.480657863871507], [53.493096958231334, 26.812368882753042], [52.483597853409599, 27.580849107365488], [51.520762566947404, 27.865689602158291], [50.852948032439528, 28.814520575469377], [50.115008579311571, 30.14777252859971], [49.576850213423988, 29.9857152369324], [48.941333449098536, 30.31709035900403], [48.567971225789748, 29.926778265903515], [48.014568312376085, 30.452456773392594], [48.00469811380831, 30.985137437457237], [47.685286085812258, 30.984853217079621], [47.849203729042095, 31.709175930298663], [47.334661492711895, 32.469155381799105], [46.109361606639304, 33.017287299118998], [45.416690708199035, 33.967797756479577], [45.648459507028079, 34.748137722303007], [46.15178795755093, 35.093258775364284], [46.076340366404786, 35.67738332777548], [45.420618117053202, 35.977545884742817], [44.77267, 37.17045], [44.225755649600522, 37.971584377589345], [44.421402622257538, 38.281281236314534], [44.109225294782334, 39.428136298168091], [44.793989699081934, 39.713002631177041], [44.9526880226503, 39.335764675446363], [45.457721795438765, 38.874139105783051], [46.143623081248812, 38.74120148371221], [46.505719842317966, 38.770605373686287], [47.685079380083081, 39.508363959301207], [48.060095249225235, 39.582235419262453], [48.355529412637871, 39.2887649602769], [48.010744256386474, 38.794014797514514], [48.634375441284803, 38.27037750910096], [48.883249139202483, 38.32024526626261], [49.199612257693332, 37.582874253889877], [50.147771437384606, 37.37456655532133], [50.842354363819695, 36.872814235983384], [52.26402469260141, 36.700421657857696], [53.825789829326411, 36.965030829408228], [53.921597934795543, 37.198918361961255]]] } }, + { "type": "Feature", "properties": { "admin": "Iraq", "name": "Iraq", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[45.420618117053202, 35.977545884742817], [46.076340366404786, 35.67738332777548], [46.15178795755093, 35.093258775364284], [45.648459507028079, 34.748137722303007], [45.416690708199035, 33.967797756479577], [46.109361606639304, 33.017287299118998], [47.334661492711895, 32.469155381799105], [47.849203729042095, 31.709175930298663], [47.685286085812258, 30.984853217079621], [48.00469811380831, 30.985137437457237], [48.014568312376085, 30.452456773392594], [48.567971225789748, 29.926778265903515], [47.974519077349889, 29.975819200148493], [47.302622104690947, 30.059069932570711], [46.568713413281742, 29.099025173452283], [44.709498732284736, 29.178891099559376], [41.889980910007829, 31.190008653278362], [40.399994337736238, 31.889991766887931], [39.195468377444961, 32.16100881604266], [38.792340529136077, 33.378686428352218], [41.00615888851992, 34.419372260062111], [41.383965285005807, 35.628316555314349], [41.289707472505448, 36.358814602192261], [41.837064243340954, 36.605853786763568], [42.349591098811764, 37.22987254490409], [42.779125604021822, 37.385263576805741], [43.942258742047287, 37.256227525372942], [44.293451775902852, 37.001514390606289], [44.772699008977689, 37.170444647768427], [45.420618117053202, 35.977545884742817]]] } }, + { "type": "Feature", "properties": { "admin": "Iceland", "name": "Iceland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-14.508695441129232, 66.455892239031414], [-14.739637417041605, 65.808748277440287], [-13.609732224979807, 65.126671047619851], [-14.9098337467949, 64.36408193628867], [-17.794438035543418, 63.67874909123384], [-18.656245896874989, 63.496382961675806], [-19.972754685942757, 63.643634955491514], [-22.762971971110154, 63.960178941495371], [-21.778484259517676, 64.402115790455497], [-23.955043911219104, 64.891129869233481], [-22.184402635170354, 65.084968166760291], [-22.227423265053329, 65.378593655042721], [-24.326184047939332, 65.611189276788451], [-23.650514695723082, 66.262519029395207], [-22.134922451250883, 66.410468655046856], [-20.576283738679543, 65.732112128351417], [-19.056841600001587, 66.276600857194751], [-17.798623826559048, 65.993853257909763], [-16.167818976292121, 66.526792304135853], [-14.508695441129232, 66.455892239031414]]] } }, + { "type": "Feature", "properties": { "admin": "Israel", "name": "Israel", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.719918247222743, 32.709192409794859], [35.545665317534535, 32.393992011030569], [35.183930291491428, 32.532510687788935], [34.974640740709319, 31.866582343059715], [35.225891554512422, 31.754341132121759], [34.970506626125989, 31.616778469360803], [34.927408481594554, 31.35343537040141], [35.397560662586038, 31.489086005167572], [35.420918409981958, 31.100065822874349], [34.922602573391423, 29.501326198844517], [34.26543338393568, 31.219360866820146], [34.556371697738903, 31.548823960896989], [34.48810713068135, 31.605538845337314], [34.752587111151165, 32.07292633720116], [34.955417107896771, 32.827376410446369], [35.098457472480668, 33.080539252244257], [35.126052687324538, 33.090900376918775], [35.460709262846699, 33.089040025356276], [35.552796665190805, 33.264274807258012], [35.821100701650231, 33.277426459276292], [35.836396925608618, 32.868123277308506], [35.700797967274745, 32.716013698857374], [35.719918247222743, 32.709192409794859]]] } }, + { "type": "Feature", "properties": { "admin": "Italy", "name": "Italy", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[15.52037601081383, 38.231155096991465], [15.160242954171732, 37.444045518537813], [15.309897902089002, 37.134219468731793], [15.099988234119445, 36.61998729099539], [14.335228712632013, 36.996630967754747], [13.826732618879927, 37.104531358380186], [12.431003859108809, 37.612949937483812], [12.570943637755132, 38.126381130519682], [13.741156447004581, 38.03496552179535], [14.761249220446157, 38.143873602850498], [15.52037601081383, 38.231155096991465]]], [[[9.210011834356264, 41.209991360024212], [9.809975213264973, 40.500008856766094], [9.669518670295671, 39.177376410471787], [9.214817742559486, 39.240473334300127], [8.806935662479729, 38.906617743478471], [8.428302443077113, 39.171847032216611], [8.388253208050939, 40.378310858718798], [8.159998406617659, 40.950007229163774], [8.709990675500107, 40.899984442705225], [9.210011834356264, 41.209991360024212]]], [[[12.376485223040842, 46.767559109069872], [13.806475457421552, 46.50930613869118], [13.698109978905475, 46.016778062517368], [13.937630242578335, 45.59101593686465], [13.141606479554294, 45.736691799495411], [12.328581170306304, 45.38177806251484], [12.383874952858601, 44.885374253919075], [12.261453484759157, 44.600482082694008], [12.589237094786482, 44.091365871754462], [13.526905958722491, 43.587727362637899], [14.029820997787024, 42.761007798832473], [15.142569614327952, 41.955139675456891], [15.926191033601892, 41.961315009115729], [16.169897088290409, 41.740294908203417], [15.889345737377793, 41.541082261718195], [16.785001661860573, 41.179605617836579], [17.519168735431204, 40.877143459632229], [18.376687452882575, 40.355624904942651], [18.4802470231954, 40.168866278639818], [18.293385044028096, 39.810774441073235], [17.738380161213279, 40.277671006830289], [16.869595981522334, 40.442234605463838], [16.448743116937319, 39.795400702466473], [17.171489698971495, 39.424699815420716], [17.052840610429339, 38.902871202137291], [16.635088331781841, 38.843572496082395], [16.100960727613053, 37.985898749334176], [15.684086948314498, 37.908849188787023], [15.687962680736318, 38.214592800441849], [15.891981235424705, 38.750942491199218], [16.109332309644312, 38.964547024077682], [15.718813510814638, 39.544072374014938], [15.413612501698818, 40.048356838535163], [14.998495721098234, 40.172948716790913], [14.703268263414767, 40.604550279292617], [14.06067182786526, 40.786347968095434], [13.627985060285393, 41.188287258461649], [12.888081902730418, 41.253089504555604], [12.106682570044907, 41.7045348170574], [11.191906365614184, 42.355425319989671], [10.511947869517794, 42.93146251074721], [10.200028924204046, 43.920006822274608], [9.702488234097812, 44.036278794931313], [8.888946160526869, 44.366336167979533], [8.428560825238575, 44.23122813575241], [7.8507666357832, 43.767147935555236], [7.435184767291841, 43.693844916349164], [7.549596388386161, 44.127901109384808], [7.007562290076661, 44.254766750661382], [6.749955275101711, 45.028517971367584], [7.096652459347835, 45.333098863295859], [6.80235517744566, 45.708579820328673], [6.84359297041456, 45.991146552100659], [7.273850945676683, 45.776947740250748], [7.755992058959832, 45.824490057959267], [8.316629672894377, 46.16364248309084], [8.489952426801294, 46.005150865251736], [8.966305779667833, 46.03693187111115], [9.18288170740311, 46.440214748716976], [9.92283654139035, 46.314899400409182], [10.363378126678665, 46.48357127540983], [10.4427014502466, 46.893546250997431], [11.048555942436504, 46.751358547546396], [11.164827915093325, 46.941579494812729], [12.153088006243079, 47.115393174826423], [12.376485223040842, 46.767559109069872]]]] } }, + { "type": "Feature", "properties": { "admin": "Jamaica", "name": "Jamaica", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-77.569600796199197, 18.490525417550483], [-76.896618618462114, 18.400866807524078], [-76.365359056285527, 18.16070058844759], [-76.19965857614163, 17.886867173732963], [-76.902561408175671, 17.868237819891743], [-77.206341315403449, 17.701116237859818], [-77.766022915340599, 17.861597398342237], [-78.337719285785596, 18.225967922432226], [-78.217726610003865, 18.454532782459193], [-77.797364671525614, 18.524218451404774], [-77.569600796199197, 18.490525417550483]]] } }, + { "type": "Feature", "properties": { "admin": "Jordan", "name": "Jordan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.545665317534535, 32.393992011030569], [35.719918247222743, 32.709192409794859], [36.834062127435537, 32.312937526980768], [38.792340529136077, 33.378686428352218], [39.195468377444961, 32.16100881604266], [39.004885695152545, 32.010216986614971], [37.002165561681004, 31.508412990844736], [37.998848911294367, 30.508499864213128], [37.668119744626374, 30.338665269485894], [37.503581984209028, 30.003776150018396], [36.740527784987243, 29.865283311476183], [36.501214227043583, 29.505253607698702], [36.068940870922049, 29.19749461518445], [34.956037225084252, 29.356554673778835], [34.922602573391423, 29.501326198844517], [35.420918409981958, 31.100065822874349], [35.397560662586038, 31.489086005167572], [35.545251906076196, 31.782504787720832], [35.545665317534535, 32.393992011030569]]] } }, + { "type": "Feature", "properties": { "admin": "Japan", "name": "Japan", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[134.638428176003856, 34.149233710256418], [134.766379022358478, 33.806334743783673], [134.20341596897083, 33.201177883429622], [133.792950067276479, 33.521985175097583], [133.280268182508848, 33.289570420864941], [133.014858026257855, 32.704567369104772], [132.363114862192674, 32.989382025681373], [132.371176385630179, 33.463642483040068], [132.924372593314786, 34.060298570282036], [133.492968377822194, 33.944620876596694], [133.904106073136347, 34.364931138642611], [134.638428176003856, 34.149233710256418]]], [[[140.976387567305267, 37.142074286440156], [140.599769728762084, 36.343983466124534], [140.774074334882641, 35.842877102190229], [140.253279250245072, 35.138113918593653], [138.975527785396196, 34.667600002576101], [137.217598911691198, 34.606285915661843], [135.792983026268871, 33.46480520276662], [135.120982700745401, 33.849071153289053], [135.07943484918269, 34.596544908174813], [133.340316196831964, 34.375938218720755], [132.156770868051296, 33.904933376596503], [130.986144647343451, 33.885761420216276], [132.000036248910021, 33.149992377244608], [131.33279015515734, 31.450354519164836], [130.68631798718593, 31.029579169228235], [130.202419875204953, 31.418237616495411], [130.447676222862128, 32.319474595665717], [129.81469160371887, 32.610309556604385], [129.408463169472554, 33.296055813117583], [130.353935174684636, 33.604150702441693], [130.878450962447118, 34.232742824840031], [131.884229364143891, 34.749713853487911], [132.617672967662486, 35.433393052709413], [134.608300815977771, 35.731617743465812], [135.677537876528902, 35.527134100886819], [136.723830601142424, 37.304984239240376], [137.390611607004473, 36.827390651998819], [138.857602166906247, 37.827484646143454], [139.426404657142882, 38.215962225897634], [140.054790073812057, 39.438807481436378], [139.883379347899847, 40.563312486323682], [140.305782505453664, 41.195005194659551], [141.368973423426667, 41.378559882160282], [141.914263136970476, 39.991616115878678], [141.884600864834965, 39.18086456965149], [140.959489373945729, 38.174000962876583], [140.976387567305267, 37.142074286440156]]], [[[143.910161981379474, 44.174099839853724], [144.613426548439634, 43.960882880217511], [145.320825230083074, 44.384732977875437], [145.543137241802754, 43.262088324550596], [144.059661899999867, 42.988358262700551], [143.183849725517291, 41.995214748699183], [141.611490920172457, 42.678790595056071], [141.067286411706618, 41.58459381770799], [139.95510623592105, 41.56955597591103], [139.817543573159924, 42.563758856774392], [140.312087030193169, 43.333272610032644], [141.380548944259999, 43.388824774746489], [141.671952345953912, 44.772125352551477], [141.967644891527982, 45.551483466161343], [143.142870314709796, 44.510358384776957], [143.910161981379474, 44.174099839853724]]]] } }, + { "type": "Feature", "properties": { "admin": "Kazakhstan", "name": "Kazakhstan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[70.962314894499272, 42.26615428320553], [70.388964878220776, 42.081307684897517], [69.070027296835221, 41.384244289712335], [68.632482944620037, 40.668680731766855], [68.259895867795635, 40.662324530594894], [67.985855747351806, 41.135990708982199], [66.714047072216587, 41.168443508461557], [66.510648634715707, 41.987644151368549], [66.023391554635609, 41.994646307944031], [66.098012322865188, 42.997660020513074], [64.90082441595932, 43.728080552742647], [63.18578698105658, 43.650074978197999], [62.013300408786264, 43.504476630215649], [61.05831994003249, 44.405816962250576], [60.239971958258472, 44.784036770194739], [58.689989048095796, 45.500013739598721], [58.503127068928428, 45.58680430763296], [55.928917270741167, 44.995858466159163], [55.968191359283011, 41.30864166926937], [55.455251092353805, 41.259859117185826], [54.755345493392653, 42.04397146256661], [54.079417759014959, 42.324109402020831], [52.944293247291725, 42.116034247397572], [52.502459751196277, 41.783315538086462], [52.446339145727208, 42.027150783855561], [52.692112257707251, 42.443895372073364], [52.501426222550315, 42.792297878585188], [51.342427199108201, 43.132974758469338], [50.891291945200223, 44.031033637053774], [50.339129266161358, 44.284015611338468], [50.305642938036257, 44.609835516938908], [51.278503452363211, 44.514854234386448], [51.316899041556034, 45.245998236667894], [52.167389764215713, 45.408391425145098], [53.040876499245194, 45.259046535821753], [53.220865512917712, 46.23464590105992], [53.042736850807771, 46.853006089864486], [52.042022739475598, 46.804636949239232], [51.191945428274252, 47.048704738953909], [50.034083286342465, 46.608989976582208], [49.10116, 46.39933000000012], [48.593241001180495, 46.561034247415471], [48.694733514201729, 47.075628160177921], [48.057253045449258, 47.743752753279516], [47.315231154170242, 47.715847479841948], [46.466445753776256, 48.394152330104923], [47.043671502476506, 49.1520388860976], [46.751596307162728, 49.35600576435376], [47.549480421749301, 50.454698391311119], [48.577841424357523, 49.874759629915658], [48.702381626181008, 50.605128485712825], [50.766648390512145, 51.692762356159889], [52.328723585830957, 51.71865224873811], [54.53287845237621, 51.026239732459302], [55.716940545479801, 50.62171662047853], [56.777961053296551, 51.043551337277037], [58.363290643146733, 51.063653469438563], [59.642282342370599, 50.545442206415707], [59.932807244715484, 50.842194118851857], [61.337424350840919, 50.799070136104248], [61.588003371024158, 51.2726587998432], [59.967533807215531, 51.960420437215696], [60.927268507740258, 52.447548326215028], [60.739993117114572, 52.719986477257734], [61.699986199800584, 52.979996446334255], [60.978066440683151, 53.664993394579128], [61.436591424409052, 54.006264553434775], [65.178533563095911, 54.354227810272093], [65.66687584825398, 54.601266994843449], [68.169100376258811, 54.970391750704309], [69.068166945272864, 55.385250149143516], [70.865266554655122, 55.169733588270091], [71.180131056609397, 54.133285224008247], [72.224150018202167, 54.376655381886728], [73.508516066384388, 54.035616766976588], [73.425678745420427, 53.489810289109741], [74.384845005190044, 53.546861070360066], [76.891100294913414, 54.490524400441913], [76.525179477854735, 54.177003485727127], [77.800915561844221, 53.404414984747561], [80.035559523441663, 50.864750881547238], [80.568446893235475, 51.388336493528456], [81.945985548839914, 50.812195949906354], [83.383003778012366, 51.069182847693909], [83.935114780618832, 50.889245510453563], [84.416377394553052, 50.311399644565817], [85.115559523462011, 50.117302964877631], [85.541269972682457, 49.69285858824815], [86.829356723989619, 49.826674709668154], [87.359970330762664, 49.214980780629148], [86.598776483103379, 48.549181626980605], [85.768232863308285, 48.455750637396974], [85.72048383987071, 47.452969468773112], [85.164290399113355, 47.000955715516099], [83.180483839860443, 47.330031236350848], [82.458925815769106, 45.539649563166499], [81.947070753918112, 45.317027492853235], [79.966106398441397, 44.917516994804643], [80.866206496101356, 43.180362046881037], [80.180150180994289, 42.920067857426936], [80.259990268885332, 42.349999294599101], [79.643645460940135, 42.496682847659649], [79.142177361979776, 42.856092434249589], [77.658391961583206, 42.960685533208327], [76.000353631498555, 42.988022365890622], [75.636964959622091, 42.877899888676765], [74.212865838522575, 43.298339341803505], [73.645303582660901, 43.091271877609863], [73.489757521462337, 42.500894476891276], [71.844638299450637, 42.845395412765178], [71.186280552052253, 42.704292914392219], [70.962314894499272, 42.26615428320553]]] } }, + { "type": "Feature", "properties": { "admin": "Kenya", "name": "Kenya", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[40.993, -0.85829], [41.58513, -1.68325], [40.88477, -2.08255], [40.63785, -2.49979], [40.26304, -2.57309], [40.12119, -3.27768], [39.80006, -3.68116], [39.60489, -4.34653], [39.20222, -4.67677], [37.7669, -3.67712], [37.69869, -3.09699], [34.07262, -1.05982], [33.903711197104521, -0.95], [33.893568969666937, 0.109813537861896], [34.18, 0.515], [34.6721, 1.17694], [35.03599, 1.90584], [34.59607, 3.05374], [34.47913, 3.5556], [34.005, 4.249884947362047], [34.620196267853871, 4.847122742081987], [35.298007118232974, 5.506], [35.817447662353501, 5.338232082790795], [35.817447662353501, 4.776965663461889], [36.159078632855639, 4.447864127672768], [36.855093238008116, 4.447864127672768], [38.120915, 3.598605], [38.43697, 3.58851], [38.67114, 3.61607], [38.89251, 3.50074], [39.559384258765846, 3.42206], [39.85494, 3.83879], [40.76848, 4.25702], [41.1718, 3.91909], [41.855083092643966, 3.918911920483726], [40.98105, 2.78452], [40.993, -0.85829]]] } }, + { "type": "Feature", "properties": { "admin": "Kyrgyzstan", "name": "Kyrgyzstan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[70.96231489449913, 42.266154283205481], [71.186280552052111, 42.704292914392127], [71.84463829945058, 42.845395412765093], [73.489757521462337, 42.500894476891311], [73.645303582660901, 43.09127187760982], [74.212865838522546, 43.298339341803363], [75.636964959622006, 42.877899888676673], [76.000353631498442, 42.988022365890664], [77.658391961583206, 42.960685533208256], [79.142177361979762, 42.856092434249511], [79.643645460940107, 42.496682847659514], [80.259990268885289, 42.349999294599044], [80.119430373051358, 42.123940741538235], [78.543660923175295, 41.582242540038685], [78.187196893225959, 41.185315863604792], [76.904484490877067, 41.066485907549634], [76.526368035797432, 40.427946071935111], [75.467827996730691, 40.562072251948663], [74.776862420556043, 40.366425279291619], [73.822243686828287, 39.893973497063179], [73.960013055318413, 39.660008449861721], [73.67537926625478, 39.431236884105594], [71.784693637991992, 39.279463202464363], [70.549161818325601, 39.604197902986492], [69.464886915977516, 39.526683254548693], [69.559609816368507, 40.103211371412968], [70.648018833299957, 39.935753892571157], [71.014198032520156, 40.244365546218226], [71.774875115856545, 40.145844428053763], [73.055417108049156, 40.86603302668945], [71.870114780570447, 41.392900092121259], [71.157858514291576, 41.143587144529107], [70.420022414028196, 41.519998277343134], [71.259247674448218, 42.167710679689456], [70.96231489449913, 42.266154283205481]]] } }, + { "type": "Feature", "properties": { "admin": "Cambodia", "name": "Cambodia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[103.497279901139677, 10.632555446815926], [103.090689731867229, 11.153660590047162], [102.58493248902667, 12.186594956913279], [102.348099399833004, 13.39424734135822], [102.988422072361601, 14.225721136934464], [104.281418084736586, 14.416743068901363], [105.218776890078871, 14.27321177821069], [106.04394616091551, 13.881091009979952], [106.496373325630856, 14.57058380783428], [107.382727492301058, 14.202440904186968], [107.614547967562402, 13.535530707244202], [107.491403029410861, 12.337205918827944], [105.810523716253101, 11.567614650921225], [106.249670037869436, 10.961811835163585], [105.199914992292321, 10.889309800658094], [104.334334751403446, 10.486543687375228], [103.497279901139677, 10.632555446815926]]] } }, + { "type": "Feature", "properties": { "admin": "South Korea", "name": "Korea", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[128.349716424676586, 38.612242946927843], [129.212919549680038, 37.432392483055942], [129.460449660358137, 36.784189154602821], [129.468304478066472, 35.632140611303939], [129.091376580929563, 35.08248423923142], [128.18585045787907, 34.890377102186385], [127.386519403188373, 34.475673733044111], [126.485747511908713, 34.390045884736473], [126.3739197124291, 34.934560451795939], [126.559231398627773, 35.684540513647896], [126.117397902532261, 36.725484727519252], [126.860143263863364, 36.893924058574612], [126.174758742376213, 37.749685777328033], [126.237338901881742, 37.840377916000271], [126.683719924018888, 37.804772854151174], [127.073308547067342, 38.256114813788393], [127.780035435090966, 38.304535630845884], [128.205745884311426, 38.370397243801882], [128.349716424676586, 38.612242946927843]]] } }, + { "type": "Feature", "properties": { "admin": "Kosovo", "name": "Kosovo", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.76216, 42.05186], [20.717310000000108, 41.84711], [20.59023, 41.85541], [20.52295, 42.21787], [20.28374, 42.32025], [20.0707, 42.58863], [20.25758, 42.81275], [20.49679, 42.88469], [20.63508, 43.21671], [20.81448, 43.27205], [20.95651, 43.13094], [21.143395, 43.068685000000123], [21.27421, 42.90959], [21.43866, 42.86255], [21.63302, 42.67717], [21.77505, 42.6827], [21.66292, 42.43922], [21.54332, 42.32025], [21.576635989402117, 42.245224397061847], [21.352700000000134, 42.2068], [20.76216, 42.05186]]] } }, + { "type": "Feature", "properties": { "admin": "Kuwait", "name": "Kuwait", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[47.974519077349889, 29.975819200148493], [48.183188510944483, 29.534476630159759], [48.09394331237641, 29.306299343374999], [48.416094191283939, 28.552004299426663], [47.708850538937376, 28.526062730416136], [47.459821811722819, 29.002519436147217], [46.568713413281742, 29.099025173452283], [47.302622104690947, 30.059069932570711], [47.974519077349889, 29.975819200148493]]] } }, + { "type": "Feature", "properties": { "admin": "Laos", "name": "Lao PDR", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[105.218776890078871, 14.27321177821069], [105.544338413517664, 14.723933620660414], [105.589038527450128, 15.570316066952856], [104.779320509868768, 16.441864935771445], [104.716947056092465, 17.428858954330078], [103.956476678485288, 18.240954087796872], [103.200192091893726, 18.309632066312769], [102.998705682387694, 17.961694647691598], [102.413004998791592, 17.932781683824281], [102.113591750092453, 18.109101670804161], [101.059547560635139, 17.512497259994486], [101.035931431077742, 18.408928330961611], [101.282014601651667, 19.462584947176762], [100.606293573003128, 19.508344427971217], [100.548881056726856, 20.109237982661124], [100.115987583417819, 20.41784963630818], [100.329101190189519, 20.786121731036229], [101.180005324307515, 21.436572984294024], [101.270025669359939, 21.201651923095177], [101.803119744882906, 21.174366766845065], [101.652017856861491, 22.318198757409544], [102.170435825613552, 22.464753119389297], [102.754896274834636, 21.675137233969462], [103.203861118586431, 20.766562201413745], [104.435000441508024, 20.758733221921528], [104.822573683697073, 19.886641750563879], [104.183387892678908, 19.624668077060214], [103.896532017026701, 19.265180975821799], [105.094598423281496, 18.666974595611073], [105.925762160264, 17.485315456608955], [106.55600792849566, 16.604283962464802], [107.312705926545576, 15.908538316303177], [107.564525181103875, 15.202173163305554], [107.382727492301058, 14.202440904186968], [106.496373325630856, 14.57058380783428], [106.04394616091551, 13.881091009979952], [105.218776890078871, 14.27321177821069]]] } }, + { "type": "Feature", "properties": { "admin": "Lebanon", "name": "Lebanon", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.821100701650231, 33.277426459276292], [35.552796665190805, 33.264274807258012], [35.460709262846699, 33.089040025356276], [35.126052687324538, 33.090900376918775], [35.48220665868012, 33.905450140919434], [35.979592319489392, 34.610058295219126], [35.998402540843628, 34.644914048799997], [36.448194207512095, 34.59393524834406], [36.611750115715886, 34.201788641897174], [36.066460402172048, 33.824912421192543], [35.821100701650231, 33.277426459276292]]] } }, + { "type": "Feature", "properties": { "admin": "Liberia", "name": "Liberia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-7.712159389669749, 4.364565944837721], [-7.974107224957249, 4.355755113131961], [-9.004793667018673, 4.832418524592199], [-9.913420376006682, 5.593560695819205], [-10.765383876986643, 6.140710760925556], [-11.438779466182053, 6.785916856305746], [-11.199801805048278, 7.105845648624735], [-11.14670427086838, 7.396706447779534], [-10.695594855176477, 7.939464016141085], [-10.230093553091276, 8.406205552601291], [-10.016566534861253, 8.42850393313523], [-9.755342169625832, 8.541055202666923], [-9.33727983238458, 7.928534450711351], [-9.403348151069748, 7.526905218938906], [-9.208786383490844, 7.313920803247952], [-8.926064622422002, 7.309037380396375], [-8.722123582382123, 7.711674302598509], [-8.439298468448696, 7.686042792181736], [-8.485445522485348, 7.395207831243068], [-8.385451626000572, 6.911800645368742], [-8.602880214868618, 6.467564195171659], [-8.311347622094017, 6.193033148621081], [-7.993692592795879, 6.126189683451541], [-7.570152553731686, 5.707352199725903], [-7.53971513511176, 5.313345241716517], [-7.63536821128403, 5.188159084489455], [-7.712159389669749, 4.364565944837721]]] } }, + { "type": "Feature", "properties": { "admin": "Libya", "name": "Libya", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[14.8513, 22.862950000000119], [14.143870883855239, 22.491288967371126], [13.581424594790459, 23.040506089769274], [11.999505649471697, 23.471668402596432], [11.560669386449032, 24.09790924732561], [10.771363559622952, 24.562532050061741], [10.303846876678445, 24.379313259370967], [9.948261346078024, 24.936953640232613], [9.910692579801774, 25.365454616796789], [9.319410841518218, 26.094324856057476], [9.716285841519662, 26.512206325785652], [9.629056023811073, 27.140953477481041], [9.756128370816779, 27.688258571884198], [9.68388471847288, 28.144173895779311], [9.859997999723472, 28.959989732371064], [9.805634392952353, 29.424638373323369], [9.482139926805415, 30.307556057246181], [9.970017124072966, 30.539324856075375], [10.056575148161697, 30.961831366493517], [9.950225050505194, 31.376069647745275], [10.636901482799484, 31.761420803345679], [10.944789666394511, 32.081814683555358], [11.43225345220378, 32.368903103152824], [11.488787469131008, 33.136995754523234], [12.66331, 32.79278], [13.08326, 32.87882], [13.91868, 32.71196], [15.24563, 32.26508], [15.71394, 31.37626], [16.61162, 31.18218], [18.02109, 30.76357], [19.08641, 30.26639], [19.57404, 30.52582], [20.05335, 30.98576], [19.82033, 31.751790000000135], [20.13397, 32.2382], [20.85452, 32.7068], [21.54298, 32.8432], [22.89576, 32.63858], [23.2368, 32.19149], [23.6091300000001, 32.18726], [23.9275, 32.01667], [24.92114, 31.89936], [25.16482, 31.56915], [24.80287, 31.08929], [24.95762, 30.6616], [24.70007, 30.04419], [25.00000000000011, 29.238654529533552], [25.00000000000011, 25.682499996360995], [25.00000000000011, 22.0], [25.00000000000011, 20.00304], [23.850000000000129, 20.0], [23.837660000000135, 19.580470000000101], [19.84926, 21.49509], [15.86085, 23.40972], [14.8513, 22.862950000000119]]] } }, + { "type": "Feature", "properties": { "admin": "Sri Lanka", "name": "Sri Lanka", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[81.787959018891371, 7.523055324733162], [81.637322218760573, 6.481775214051921], [81.218019647144317, 6.197141424988287], [80.348356968104397, 5.968369859232154], [79.872468703128519, 6.763463446474928], [79.6951668639351, 8.200843410673384], [80.147800734379629, 9.824077663609554], [80.838817986986541, 9.268426825391186], [81.304319289071756, 8.564206244333688], [81.787959018891371, 7.523055324733162]]] } }, + { "type": "Feature", "properties": { "admin": "Lesotho", "name": "Lesotho", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[28.978262566857236, -28.955596612261708], [29.325166456832587, -29.257386976846245], [29.018415154748016, -29.743765557577362], [28.848399692507734, -30.070050551068245], [28.291069370239903, -30.226216729454293], [28.107204624145421, -30.545732110314944], [27.749397006956478, -30.645105889612214], [26.999261915807629, -29.875953871379977], [27.532511020627471, -29.242710870075353], [28.07433841320778, -28.851468601193581], [28.541700066855491, -28.647501722937562], [28.978262566857236, -28.955596612261708]]] } }, + { "type": "Feature", "properties": { "admin": "Lithuania", "name": "Lithuania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.731098667092649, 54.327536932993311], [22.651051873472536, 54.582740993866729], [22.757763706155256, 54.856574408581366], [22.31572350433057, 55.01529857036585], [21.26844892750346, 55.190481675835301], [21.05580040862241, 56.031076361711051], [22.201156853939491, 56.337801825579483], [23.878263787539957, 56.273671373105259], [24.860684441840753, 56.372528388079616], [25.000934279080887, 56.164530748104831], [25.533046502390327, 56.100296942766029], [26.494331495883749, 55.61510691997762], [26.588279249790386, 55.167175604871659], [25.768432651479792, 54.846962592175082], [25.536353794056989, 54.282423407602515], [24.45068362803703, 53.905702216194747], [23.484127638449841, 53.912497667041123], [23.243987257589506, 54.220566718149129], [22.731098667092649, 54.327536932993311]]] } }, + { "type": "Feature", "properties": { "admin": "Luxembourg", "name": "Luxembourg", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[6.043073357781109, 50.128051662794221], [6.242751092156992, 49.90222565367872], [6.186320428094176, 49.4638028021145], [5.897759230176403, 49.442667141307012], [5.674051954784828, 49.52948354755749], [5.782417433300905, 50.090327867221205], [6.043073357781109, 50.128051662794221]]] } }, + { "type": "Feature", "properties": { "admin": "Latvia", "name": "Latvia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[21.05580040862241, 56.031076361711051], [21.090423618257965, 56.783872789122924], [21.581866489353668, 57.411870632549913], [22.524341261492872, 57.753374335350756], [23.31845299652209, 57.006236477274854], [24.120729607853423, 57.025692654032753], [24.312862583114615, 57.793423570376966], [25.164593540149262, 57.970156968815175], [25.602809685984365, 57.847528794986559], [26.46353234223778, 57.476388658266316], [27.288184848751509, 57.474528306703817], [27.770015903440925, 57.244258124411218], [27.855282016722519, 56.759326483784278], [28.17670942557799, 56.169129950578807], [27.102459751094525, 55.783313707087672], [26.494331495883749, 55.61510691997762], [25.533046502390327, 56.100296942766029], [25.000934279080887, 56.164530748104831], [24.860684441840753, 56.372528388079616], [23.878263787539957, 56.273671373105259], [22.201156853939491, 56.337801825579483], [21.05580040862241, 56.031076361711051]]] } }, + { "type": "Feature", "properties": { "admin": "Morocco", "name": "Morocco", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-5.193863491222031, 35.755182196590845], [-4.591006232105143, 35.330711981745644], [-3.640056525070007, 35.39985504815197], [-2.604305792644111, 35.17909332940112], [-2.169913702798624, 35.168396307916694], [-1.792985805661658, 34.527918606091298], [-1.73345455566141, 33.919712836232115], [-1.388049282222596, 32.864015000941372], [-1.124551153966195, 32.651521511357195], [-1.30789913573787, 32.262888902306024], [-2.616604783529567, 32.094346218386157], [-3.068980271812648, 31.724497992473285], [-3.647497931320145, 31.637294012980814], [-3.690441046554666, 30.896951605751152], [-4.859646165374442, 30.501187649043874], [-5.242129278982786, 30.00044302013557], [-6.060632290053745, 29.731699734001801], [-7.059227667661899, 29.57922842052465], [-8.67411617678283, 28.841288967396643], [-8.665589565454836, 27.656425889592462], [-8.817809007940523, 27.656425889592462], [-8.817828334986642, 27.656425889592462], [-8.794883999049032, 27.120696316022553], [-9.413037482124507, 27.088476060488539], [-9.735343390328749, 26.860944729107409], [-10.189424200877452, 26.860944729107409], [-10.551262579785258, 26.990807603456879], [-11.392554897496948, 26.883423977154386], [-11.718219773800339, 26.104091701760801], [-12.030758836301654, 26.030866197203121], [-12.500962693725368, 24.770116278578136], [-13.891110398809044, 23.691009019459383], [-14.22116777185715, 22.310163072188338], [-14.630832688850942, 21.860939846274867], [-14.750954555713404, 21.500600083903802], [-17.002961798561071, 21.42073415779668], [-17.020428432675768, 21.422310288981631], [-16.973247849993182, 21.88574453377495], [-16.589136928767626, 22.158234361250091], [-16.26192175949566, 22.679339504481273], [-16.326413946995896, 23.017768459560894], [-15.982610642958059, 23.723358466074096], [-15.426003790742183, 24.359133612561035], [-15.089331834360729, 24.520260728446964], [-14.824645148161689, 25.103532619725307], [-14.800925665739666, 25.636264960222285], [-14.439939947964827, 26.254418443297645], [-13.773804897506462, 26.618892320252279], [-13.13994177901429, 27.640147813420491], [-13.121613369914709, 27.654147671719805], [-12.61883663578311, 28.038185533148656], [-11.688919236690761, 28.148643907172577], [-10.9009569971044, 28.832142238880913], [-10.39959225100864, 29.09858592377778], [-9.564811163765624, 29.933573716749855], [-9.814718390329174, 31.177735500609053], [-9.434793260119362, 32.038096421836478], [-9.300692918321827, 32.564679266890629], [-8.657476365585039, 33.24024526624239], [-7.654178432638217, 33.697064927702506], [-6.912544114601358, 34.11047638603744], [-6.24434200685141, 35.145865383437517], [-5.929994269219832, 35.759988104793983], [-5.193863491222031, 35.755182196590845]]] } }, + { "type": "Feature", "properties": { "admin": "Moldova", "name": "Moldova", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[26.619336785597788, 48.220726223333457], [26.857823520624798, 48.368210761094488], [27.52253746919515, 48.467119452501102], [28.259546746541837, 48.155562242213406], [28.670891147585163, 48.118148505234089], [29.122698195113024, 47.849095160506458], [29.050867954227321, 47.510226955752493], [29.415135125452732, 47.346645209332571], [29.559674106573105, 46.928582872091312], [29.908851759569295, 46.67436066343145], [29.838210076626289, 46.525325832701675], [30.024658644335364, 46.423936672545032], [29.759971958136383, 46.349987697935354], [29.170653924279879, 46.379262396828693], [29.072106967899288, 46.517677720722482], [28.862972446414055, 46.437889309263824], [28.933717482221621, 46.258830471372491], [28.659987420371575, 45.939986884131628], [28.48526940279276, 45.596907050145887], [28.233553501099035, 45.488283189468369], [28.054442986775392, 45.944586086605618], [28.160017937947707, 46.371562608417207], [28.128030226359037, 46.81047638608824], [27.551166212684841, 47.405117092470817], [27.233872918412736, 47.826770941756365], [26.924176059687561, 48.123264472030982], [26.619336785597788, 48.220726223333457]]] } }, + { "type": "Feature", "properties": { "admin": "Madagascar", "name": "Madagascar", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[49.543518914595737, -12.469832858940553], [49.80898074727908, -12.895284925999551], [50.05651085795715, -13.555761407121981], [50.217431268114055, -14.758788750876795], [50.476536899625515, -15.226512139550541], [50.377111443895942, -15.706069431219122], [50.200274692593169, -16.000263360256763], [49.860605503138665, -15.414252618066913], [49.672606642460849, -15.710203545802477], [49.863344354050142, -16.451036879138773], [49.774564243372694, -16.875042006093597], [49.49861209493411, -17.10603565843827], [49.435618523970298, -17.953064060134363], [49.04179243347393, -19.118781019774442], [48.548540887247995, -20.496888116134119], [47.930749139198653, -22.391501153251077], [47.547723423051295, -23.781958916928513], [47.095761346226588, -24.941629733990446], [46.282477654817079, -25.178462823184102], [45.409507684110444, -25.601434421493082], [44.833573846217547, -25.346101169538933], [44.039720493349755, -24.9883452287823], [43.763768344911156, -24.460677178649988], [43.697777540874441, -23.574116306250595], [43.345654331237611, -22.77690398528387], [43.254187046080986, -22.057413018484116], [43.433297560404633, -21.336475111580185], [43.893682895692919, -21.163307386970121], [43.89637007017209, -20.830459486578167], [44.374325392439644, -20.072366224856385], [44.464397413924374, -19.435454196859045], [44.23242190936616, -18.961994724200899], [44.042976108584149, -18.331387220943167], [43.963084344260899, -17.409944756746778], [44.312468702986273, -16.850495700754951], [44.446517368351387, -16.216219170804504], [44.944936557806521, -16.179373874580396], [45.502731967964976, -15.974373467678538], [45.872993605336255, -15.793454278224681], [46.312243279817203, -15.780018405828795], [46.882182651564271, -15.210182386946309], [47.70512983581235, -14.594302666891762], [48.005214878131241, -14.091232598530372], [47.869047479042152, -13.663868503476582], [48.29382775248137, -13.784067884987483], [48.845060255738773, -13.08917489995866], [48.863508742066976, -12.487867933810417], [49.194651320193302, -12.040556735891967], [49.543518914595737, -12.469832858940553]]] } }, + { "type": "Feature", "properties": { "admin": "Mexico", "name": "Mexico", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-97.140008307670684, 25.869997463478395], [-97.528072475966539, 24.992144069920297], [-97.702945522842214, 24.272343044526728], [-97.776041836319024, 22.932579860927653], [-97.872366706111094, 22.444211737553356], [-97.699043952204164, 21.898689480064256], [-97.388959520236739, 21.411018988525818], [-97.189333462293277, 20.635433254473124], [-96.525575527720306, 19.890930894444061], [-96.292127244841737, 19.32037140550954], [-95.90088497595994, 18.828024196848727], [-94.8390634834427, 18.562717393462204], [-94.425729539756205, 18.144370835843343], [-93.548651292682365, 18.423836981677933], [-92.786113857783477, 18.524838568592255], [-92.037348192090391, 18.704569200103432], [-91.407903408559235, 18.876083278880227], [-90.771869879910852, 19.284120388256778], [-90.533589850613026, 19.867418117751292], [-90.451475999701231, 20.707521877520428], [-90.278618333684889, 20.999855454995547], [-89.601321173851474, 21.261725775634485], [-88.543866339862845, 21.493675441976613], [-87.658416510757704, 21.458845526611977], [-87.051890224948053, 21.543543199138295], [-86.811982388032931, 21.331514797444747], [-86.845907965832595, 20.849864610268348], [-87.383291185235848, 20.255404771398727], [-87.621054450210721, 19.646553046135917], [-87.436750454441764, 19.472403469312265], [-87.586560431655911, 19.040130113190738], [-87.837191128271485, 18.259815985583426], [-88.090664028663156, 18.516647854074048], [-88.300031094093626, 18.499982204659997], [-88.490122850279278, 18.486830552641717], [-88.84834387892657, 17.883198147040329], [-89.029857347351737, 18.001511338772556], [-89.150909389995462, 17.955467637600403], [-89.143080410503316, 17.808318996649401], [-90.067933519230891, 17.819326076727517], [-91.001519945015943, 17.817594916245692], [-91.002269253284155, 17.254657701074272], [-91.453921271515114, 17.252177232324183], [-91.08167009150057, 16.918476670799517], [-90.711821865587623, 16.687483018454767], [-90.600846727240921, 16.470777899638787], [-90.438866950221993, 16.410109768128105], [-90.464472622422633, 16.069562079324722], [-91.747960171255926, 16.066564846251762], [-92.229248623406278, 15.251446641495871], [-92.087215949252013, 15.06458466232851], [-92.203229539747255, 14.830102850804108], [-92.227750006869812, 14.538828640190953], [-93.359463874061746, 15.61542959234367], [-93.875168830118511, 15.94016429286591], [-94.691656460330108, 16.20097524664288], [-95.250227016973014, 16.128318182840641], [-96.053382127653293, 15.752087917539592], [-96.557434048228274, 15.653515122942787], [-97.263592495496624, 15.917064927631312], [-98.013029954809596, 16.107311713113912], [-98.947675747456486, 16.566043402568763], [-99.697397427147024, 16.706164048728166], [-100.829498867581293, 17.171071071842047], [-101.666088629954444, 17.649026394109622], [-101.918528001700196, 17.916090196193974], [-102.478132086988907, 17.975750637275095], [-103.500989549558057, 18.292294623278845], [-103.917527432046811, 18.748571682200005], [-104.992009650475467, 19.316133938061679], [-105.493038499761411, 19.946767279535429], [-105.731396043707633, 20.434101874264108], [-105.397772996831321, 20.531718654863422], [-105.500660773524402, 20.816895046466122], [-105.27075232625792, 21.076284898355137], [-105.265817226974022, 21.422103583252348], [-105.603160976975374, 21.871145941652568], [-105.693413865973113, 22.269080308516148], [-106.028716396898943, 22.77375234627862], [-106.909980434988341, 23.767774359628895], [-107.91544877809136, 24.548915310152946], [-108.401904873470954, 25.172313951105931], [-109.260198737406625, 25.580609442644054], [-109.444089321717314, 25.824883938087673], [-109.291643846456267, 26.44293406829842], [-109.801457689231796, 26.676175645447923], [-110.391731737085692, 27.162114976504533], [-110.641018846461606, 27.859876003525521], [-111.178918830187826, 27.941240546169062], [-111.759606899851619, 28.467952582303944], [-112.228234626090369, 28.954408677683482], [-112.27182369672866, 29.266844387320074], [-112.80959448937395, 30.021113593052341], [-113.163810594518651, 30.786880804969424], [-113.148669399857141, 31.170965887978912], [-113.871881069781836, 31.56760834403519], [-114.205736660603506, 31.524045111613123], [-114.776451178835003, 31.79953217216114], [-114.936699795372121, 31.393484605427595], [-114.771231859173483, 30.91361725516526], [-114.673899298951739, 30.162681179315985], [-114.330974494262918, 29.750432440707407], [-113.588875088335413, 29.061611436473008], [-113.424053107540516, 28.826173610951223], [-113.271969367305502, 28.754782619739892], [-113.140039435664363, 28.411289374295954], [-112.962298346796473, 28.425190334582503], [-112.761587083774856, 27.78021678314752], [-112.457910529411635, 27.525813706974752], [-112.24495195193677, 27.171726792910754], [-111.616489020619184, 26.662817287700474], [-111.284674648872993, 25.732589830014426], [-110.987819383572386, 25.294606228124557], [-110.71000688357131, 24.826004340101854], [-110.655048997828871, 24.298594672131113], [-110.17285620811343, 24.265547593680417], [-109.771847093528521, 23.811182562754194], [-109.409104377055698, 23.364672349536242], [-109.433392300232896, 23.185587673428696], [-109.85421932660168, 22.818271592698061], [-110.031391974714424, 22.823077500901199], [-110.295070970483636, 23.430973212166684], [-110.949501309028022, 24.000964260345988], [-111.670568407012681, 24.484423122652508], [-112.182035895621468, 24.73841278736716], [-112.148988817170817, 25.470125230404044], [-112.300710822379671, 26.012004299416613], [-112.777296719191526, 26.321959540303162], [-113.464670783321907, 26.768185533143416], [-113.596729906043805, 26.639459540304465], [-113.848936733844241, 26.900063788352437], [-114.465746629680027, 27.142090358991361], [-115.055142178184965, 27.722726752222904], [-114.982252570437382, 27.798200181585109], [-114.570365566854917, 27.741485297144884], [-114.199328782999231, 28.115002549750553], [-114.162018398884612, 28.566111965442296], [-114.931842210736605, 29.279479275015483], [-115.518653937626965, 29.556361599235395], [-115.887365282029563, 30.180793768834171], [-116.2583503894529, 30.836464341753572], [-116.721526252084956, 31.635743720012037], [-117.127759999999839, 32.53534], [-115.99135, 32.612390000000111], [-114.72139, 32.72083], [-114.815, 32.52528], [-113.30498, 32.03914], [-111.02361, 31.33472], [-109.035, 31.341940000000129], [-108.24194, 31.34222], [-108.24, 31.754853718166366], [-106.507589999999851, 31.75452], [-106.1429, 31.39995], [-105.63159, 31.08383], [-105.03737, 30.64402], [-104.70575, 30.12173], [-104.456969999999885, 29.57196], [-103.94, 29.27], [-103.11, 28.97], [-102.48, 29.76], [-101.6624, 29.7793], [-100.9576, 29.380710000000125], [-100.45584, 28.696120000000118], [-100.11, 28.11000000000012], [-99.52, 27.54], [-99.3, 26.84], [-99.019999999999897, 26.37], [-98.24, 26.06], [-97.529999999999887, 25.84], [-97.140008307670684, 25.869997463478395]]] } }, + { "type": "Feature", "properties": { "admin": "Macedonia", "name": "Macedonia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.59023, 41.85541], [20.717310000000108, 41.84711], [20.76216, 42.05186], [21.352700000000134, 42.2068], [21.576635989402117, 42.245224397061847], [21.917080000000105, 42.30364], [22.380525750424674, 42.320259507815074], [22.881373732197339, 41.999297186850349], [22.952377150166505, 41.337993882811176], [22.76177, 41.3048], [22.597308383889008, 41.130487168943198], [22.055377638444266, 41.149865831052686], [21.674160597426969, 40.93127452245794], [21.020040317476397, 40.842726955725873], [20.60518, 41.08622], [20.46315, 41.51509], [20.59023, 41.85541]]] } }, + { "type": "Feature", "properties": { "admin": "Mali", "name": "Mali", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-12.170750291380299, 14.616834214735503], [-11.834207526079465, 14.799096991428936], [-11.666078253617853, 15.388208319556295], [-11.349095017939502, 15.411256008358475], [-10.650791388379414, 15.132745876521422], [-10.086846482778212, 15.330485744686269], [-9.700255092802703, 15.264107367407359], [-9.550238409859388, 15.486496893775435], [-5.537744309908446, 15.501689764869253], [-5.315277268891931, 16.201853745991837], [-5.488522508150438, 16.325102037007962], [-5.971128709324247, 20.640833441647626], [-6.453786586930334, 24.956590684503418], [-4.92333736817423, 24.974574082940993], [-1.550054897457613, 22.792665920497377], [1.823227573259032, 20.61080943448604], [2.060990838233919, 20.142233384679482], [2.683588494486428, 19.856230170160114], [3.146661004253899, 19.693578599521441], [3.158133172222704, 19.057364203360034], [4.267419467800038, 19.155265204336995], [4.270209995143801, 16.852227484601212], [3.723421665063482, 16.184283759012612], [3.638258904646476, 15.568119818580453], [2.749992709981483, 15.409524847876693], [1.385528191746857, 15.323561102759168], [1.01578331869851, 14.968182277887944], [0.374892205414682, 14.928908189346128], [-0.26625729003058, 14.924308986872147], [-0.515854458000348, 15.116157741755725], [-1.066363491205663, 14.973815009007764], [-2.001035122068771, 14.559008287000887], [-2.191824510090384, 14.246417548067352], [-2.967694464520576, 13.798150336151506], [-3.103706834312759, 13.54126679122859], [-3.52280270019986, 13.337661647998612], [-4.006390753587225, 13.472485459848112], [-4.280405035814879, 13.228443508349738], [-4.427166103523802, 12.542645575404292], [-5.220941941743119, 11.713858954307224], [-5.197842576508648, 11.375145778850136], [-5.470564947929004, 10.951269842976044], [-5.404341599946973, 10.370736802609144], [-5.816926235365286, 10.222554633012191], [-6.050452032892266, 10.096360785355442], [-6.205222947606429, 10.524060777219132], [-6.493965013037267, 10.411302801958268], [-6.666460944027547, 10.430810655148447], [-6.850506557635057, 10.138993841996237], [-7.622759161804808, 10.147236232946792], [-7.89958980959237, 10.297382106970824], [-8.029943610048617, 10.206534939001711], [-8.335377163109738, 10.494811916541932], [-8.282357143578279, 10.792597357623842], [-8.407310756860026, 10.90925690352276], [-8.620321010767126, 10.810890814655181], [-8.581305304386772, 11.136245632364801], [-8.376304897484911, 11.393645941610627], [-8.786099005559462, 11.812560939984705], [-8.905264858424529, 12.088358059126433], [-9.127473517279581, 12.308060411015331], [-9.327616339546008, 12.334286200403451], [-9.567911749703212, 12.194243068892472], [-9.890992804392011, 12.060478623904968], [-10.165213792348835, 11.844083563682743], [-10.593223842806278, 11.923975328005977], [-10.870829637078211, 12.177887478072106], [-11.036555955438256, 12.211244615116513], [-11.297573614944508, 12.077971096235768], [-11.456168585648269, 12.076834214725336], [-11.513942836950587, 12.442987575729415], [-11.467899135778522, 12.754518947800973], [-11.553397793005427, 13.141213690641063], [-11.927716030311613, 13.422075100147392], [-12.124887457721256, 13.994727484589784], [-12.170750291380299, 14.616834214735503]]] } }, + { "type": "Feature", "properties": { "admin": "Myanmar", "name": "Myanmar", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[99.543309360759281, 20.186597601802056], [98.959675734454848, 19.752980658440944], [98.253723992915582, 19.708203029860041], [97.797782830804394, 18.627080389881751], [97.375896437573516, 18.445437730375811], [97.859122755934848, 17.567946071843657], [98.493761020911322, 16.837835598207928], [98.90334842325673, 16.177824204976115], [98.537375929765687, 15.308497422746081], [98.192074009191373, 15.123702500870349], [98.430819126379859, 14.622027696180831], [99.097755161538728, 13.827502549693275], [99.212011753336071, 13.269293728076462], [99.196353794351637, 12.804748439988666], [99.587286004639694, 11.892762762901695], [99.038120558673953, 10.960545762572435], [98.553550653073017, 9.932959906448543], [98.457174106848697, 10.675266018105146], [98.764545526120756, 11.441291612183745], [98.428338657629823, 12.032986761925681], [98.509574009192661, 13.122377631070675], [98.103603957107666, 13.64045970301285], [97.777732375075161, 14.837285874892638], [97.597071567782749, 16.100567938699765], [97.164539829499773, 16.928734442609336], [96.505768670642965, 16.427240505432845], [95.369352248112378, 15.714389960182599], [94.808404575584092, 15.803454291237637], [94.188804152404515, 16.037936102762014], [94.533485955791321, 17.277240301985724], [94.324816522196741, 18.213513902249893], [93.540988397193615, 19.366492621330021], [93.663254835996199, 19.726961574781992], [93.078277622452163, 19.855144965081973], [92.368553501355606, 20.670883287025344], [92.30323449093865, 21.475485337809815], [92.652257114637976, 21.324047552978481], [92.672720981825549, 22.041238918541247], [93.166127557348361, 22.278459580977099], [93.060294224014598, 22.703110663335565], [93.286326938859247, 23.043658352138998], [93.325187615942767, 24.078556423432197], [94.106741977925054, 23.850740871673477], [94.552657912171611, 24.675238348890328], [94.603249139385355, 25.162495428970399], [95.155153436262566, 26.001307277932078], [95.124767694074933, 26.573572089132295], [96.419365675850941, 27.264589341739221], [97.133999058015277, 27.08377350514996], [97.051988559968066, 27.699058946233144], [97.402561476636123, 27.88253611908544], [97.327113885490007, 28.261582749946331], [97.91198774616943, 28.335945136014338], [98.24623091023328, 27.747221381129172], [98.682690057370451, 27.508812160750612], [98.712093947344499, 26.74353587494026], [98.671838006589127, 25.918702500913518], [97.724609002679117, 25.083637193292994], [97.604719679761956, 23.897404690033039], [98.660262485755737, 24.063286037689959], [98.898749220782747, 23.142722072842524], [99.531992222087382, 22.949038804612574], [99.240898878987224, 22.118314317304577], [99.983489211021464, 21.742936713136398], [100.416537713627349, 21.558839423096607], [101.150032993578222, 21.849984442629015], [101.180005324307515, 21.436572984294024], [100.329101190189519, 20.786121731036229], [100.115987583417819, 20.41784963630818], [99.543309360759281, 20.186597601802056]]] } }, + { "type": "Feature", "properties": { "admin": "Montenegro", "name": "Montenegro", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[19.801613396898681, 42.500093492190835], [19.738051385179627, 42.688247382165564], [19.30449, 42.19574], [19.371770000000136, 41.87755], [19.16246, 41.95502], [18.88214, 42.28151], [18.45, 42.48], [18.56, 42.65], [18.70648, 43.20011], [19.03165, 43.43253], [19.21852, 43.52384], [19.48389, 43.35229], [19.63, 43.213779970270522], [19.95857, 43.10604], [20.3398, 42.89852], [20.25758, 42.81275], [20.0707, 42.58863], [19.801613396898681, 42.500093492190835]]] } }, + { "type": "Feature", "properties": { "admin": "Mongolia", "name": "Mongolia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[87.751264276076697, 49.297197984405479], [88.805566847695488, 49.470520738312409], [90.713667433640666, 50.331811835321076], [92.234711541719662, 50.802170722041716], [93.104219191462661, 50.495290228876414], [94.147566359435615, 50.480536607457083], [94.815949334698701, 50.013433335970838], [95.814027947983973, 49.977466539095708], [97.259727817781396, 49.726060695995727], [98.231761509191543, 50.422400621128737], [97.825739780674283, 51.010995184933165], [98.861490513100307, 52.047366034546684], [99.981732212323507, 51.634006252643978], [100.889480421962588, 51.516855780638316], [102.065222609467298, 51.25992055928311], [102.255908644624299, 50.510560614618669], [103.676545444760194, 50.089966132195109], [104.621552362081687, 50.275329494826067], [105.886591424586726, 50.406019192092209], [106.888804152455336, 50.274295966180219], [107.868175897250936, 49.793705145865808], [108.475167270951275, 49.282547715850725], [109.402449171996636, 49.292960516957535], [110.662010532678764, 49.130128078805861], [111.581230910286607, 49.377968248077678], [112.897739699354361, 49.543565375356984], [114.362456496235239, 50.248302720737399], [114.962109816550154, 50.140247300815112], [115.485695428531386, 49.805177313834591], [116.678800897286152, 49.888531399121376], [116.191802199367544, 49.134598090199091], [115.485282017073018, 48.135382595403428], [115.742837355615748, 47.726544501326273], [116.308952671373206, 47.853410142602826], [117.295507440257396, 47.69770905210742], [118.064142694166691, 48.066730455103674], [118.866574334794933, 47.747060044946153], [119.772823927897477, 47.048058783550125], [119.66326989143873, 46.692679958678909], [118.874325799638711, 46.805412095723646], [117.421701287914175, 46.672732855814253], [116.717868280098841, 46.388202419615205], [115.985096470200062, 45.727235012385989], [114.46033165899604, 45.339816799493811], [113.463906691544139, 44.808893134127111], [112.436062453258785, 45.011645616224278], [111.873306105600278, 45.102079372735055], [111.348376906379428, 44.457441718110083], [111.667737257943202, 44.073175767587706], [111.829587843881342, 43.743118394539515], [111.129682244920218, 43.406834011400136], [110.412103306115256, 42.871233628911014], [109.243595819131428, 42.519446316084093], [107.744772576937933, 42.481515814781865], [106.129315627061658, 42.134327704428898], [104.964993931093446, 41.597409572916334], [104.522281935648977, 41.908346666016541], [103.312278273534787, 41.907468166667591], [101.833040399179922, 42.51487295182627], [100.845865513108237, 42.663804429691439], [99.515817498780009, 42.524691473961717], [97.451757440177985, 42.748889675460013], [96.349395786527793, 42.725635280928678], [95.762454868556674, 43.319449164394598], [95.306875441471504, 44.241330878265458], [94.688928664125299, 44.352331854828414], [93.480733677141274, 44.975472113619951], [92.133890822318193, 45.115075995456444], [90.945539585334288, 45.286073309910265], [90.585768263718265, 45.719716091487513], [90.970809360724985, 46.888146063822923], [90.280825636763893, 47.693549099307923], [88.854297723346733, 48.06908173277295], [88.013832228551721, 48.599462795600601], [87.751264276076697, 49.297197984405479]]] } }, + { "type": "Feature", "properties": { "admin": "Mozambique", "name": "Mozambique", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.559989047999345, -11.520020033415923], [35.312397902169032, -11.439146416879145], [36.514081658684248, -11.720938002166733], [36.775150994622791, -11.594537448780804], [37.471284214026596, -11.568750909067157], [37.827644891111383, -11.268769219612834], [38.427556593587745, -11.285202325081654], [39.521029900883768, -10.896853936408224], [40.316588576017182, -10.317096042525696], [40.478387485523022, -10.765440769089992], [40.437253045418672, -11.761710707245014], [40.560811395028558, -12.639176527561023], [40.599620395679743, -14.201975192931858], [40.775475294768988, -14.691764418194239], [40.477250604012596, -15.406294447493968], [40.089263950365208, -16.100774021064456], [39.452558628097044, -16.720891208566936], [38.53835086442151, -17.101023044505954], [37.411132846838875, -17.586368096591233], [36.281279331209348, -18.659687595293445], [35.896496616364054, -18.842260430580634], [35.198399692533137, -19.552811374593887], [34.786383497870041, -19.784011732667732], [34.701892531072836, -20.497043145431007], [35.176127150215358, -21.254361260668407], [35.373427768705731, -21.840837090748874], [35.385848253705397, -22.14], [35.562545536369079, -22.09], [35.533934767404297, -23.070787855727751], [35.371774122872374, -23.535358982031692], [35.607470330555621, -23.706563002214676], [35.458745558419615, -24.122609958596545], [35.040734897610655, -24.478350518493798], [34.215824008935463, -24.816314385682652], [33.013210076639005, -25.357573337507731], [32.574632195777859, -25.727318210556088], [32.660363396950082, -26.148584486599443], [32.915955031065685, -26.215867201443459], [32.830120477028878, -26.74219166433619], [32.071665480281062, -26.733820082304902], [31.985779249811962, -26.29177988048022], [31.837777947728057, -25.843331801051342], [31.752408481581874, -25.484283949487406], [31.930588820124242, -24.369416599222532], [31.670397983534645, -23.658969008073861], [31.191409132621278, -22.251509698172395], [32.244988234188007, -21.116488539313689], [32.508693068173436, -20.395292250248303], [32.659743279762573, -20.30429005298231], [32.772707960752619, -19.715592136313294], [32.611994256324884, -19.419382826416268], [32.654885695127142, -18.672089939043492], [32.849860874164385, -17.979057305577175], [32.847638787575839, -16.713398125884613], [32.328238966610222, -16.392074069893749], [31.852040643040592, -16.319417006091374], [31.636498243951188, -16.071990248277881], [31.173063999157673, -15.860943698797868], [30.338954705534537, -15.880839125230242], [30.274255812305103, -15.507786960515208], [30.179481235481827, -14.796099134991525], [33.214024692525207, -13.97186003993615], [33.789700148256678, -14.451830743063068], [34.064825473778619, -14.359950046448118], [34.459633416488536, -14.613009535381421], [34.517666049952304, -15.013708591372609], [34.307291294092089, -15.478641452702592], [34.381291945134045, -16.183559665596039], [35.033810255683527, -16.801299737213089], [35.339062941231639, -16.107440280830108], [35.771904738108347, -15.896858819240721], [35.686845330555926, -14.611045830954328], [35.267956170398001, -13.887834161029563], [34.907151320136158, -13.565424899960565], [34.559989047999345, -13.579997653866872], [34.280006137841973, -12.280025323132504], [34.559989047999345, -11.520020033415923]]] } }, + { "type": "Feature", "properties": { "admin": "Mauritania", "name": "Mauritania", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-12.170750291380299, 14.616834214735503], [-12.830658331747513, 15.303691514542942], [-13.43573767745306, 16.039383042866188], [-14.099521450242175, 16.304302273010489], [-14.577347581428977, 16.598263658102805], [-15.135737270558813, 16.587282416240779], [-15.623666144258689, 16.369337063049809], [-16.120690070041928, 16.45566254319338], [-16.463098110407881, 16.135036119038457], [-16.549707810929061, 16.673892116761959], [-16.270551723688353, 17.166962795474866], [-16.146347418674846, 18.108481553616652], [-16.256883307347163, 19.096715806550304], [-16.377651129613266, 19.593817246981981], [-16.277838100641514, 20.092520656814695], [-16.536323614965465, 20.567866319251486], [-17.063423224342568, 20.99975210213082], [-16.845193650773989, 21.333323472574875], [-12.929101935263528, 21.327070624267559], [-13.118754441774708, 22.771220201096249], [-12.874221564169574, 23.284832261645171], [-11.93722449385332, 23.374594224536164], [-11.969418911171159, 25.933352769468261], [-8.687293667017398, 25.881056219988899], [-8.684399786809051, 27.395744126895998], [-4.92333736817423, 24.974574082940993], [-6.453786586930334, 24.956590684503418], [-5.971128709324247, 20.640833441647626], [-5.488522508150438, 16.325102037007962], [-5.315277268891931, 16.201853745991837], [-5.537744309908446, 15.501689764869253], [-9.550238409859388, 15.486496893775435], [-9.700255092802703, 15.264107367407359], [-10.086846482778212, 15.330485744686269], [-10.650791388379414, 15.132745876521422], [-11.349095017939502, 15.411256008358475], [-11.666078253617853, 15.388208319556295], [-11.834207526079465, 14.799096991428936], [-12.170750291380299, 14.616834214735503]]] } }, + { "type": "Feature", "properties": { "admin": "Malawi", "name": "Malawi", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[34.559989047999345, -11.520020033415923], [34.280006137841973, -12.280025323132504], [34.559989047999345, -13.579997653866872], [34.907151320136158, -13.565424899960565], [35.267956170398001, -13.887834161029563], [35.686845330555926, -14.611045830954328], [35.771904738108347, -15.896858819240721], [35.339062941231639, -16.107440280830108], [35.033810255683527, -16.801299737213089], [34.381291945134045, -16.183559665596039], [34.307291294092089, -15.478641452702592], [34.517666049952304, -15.013708591372609], [34.459633416488536, -14.613009535381421], [34.064825473778619, -14.359950046448118], [33.789700148256678, -14.451830743063068], [33.214024692525207, -13.97186003993615], [32.688165317523122, -13.712857761289273], [32.991764357237876, -12.783870537978272], [33.306422153463068, -12.435778090060214], [33.114289178201908, -11.607198174692311], [33.315310499817279, -10.796549981329695], [33.485687697083584, -10.525558770391111], [33.231387973775291, -9.676721693564799], [32.759375441221316, -9.230599053589058], [33.739729038230443, -9.417150974162722], [33.940837724096532, -9.693673841980292], [34.280006137841973, -10.159999688358402], [34.559989047999345, -11.520020033415923]]] } }, + { "type": "Feature", "properties": { "admin": "Malaysia", "name": "Malaysia", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[101.075515578213299, 6.204867051615891], [101.154218784593809, 5.691384182147713], [101.814281854258013, 5.810808417174228], [102.141186964936423, 6.221636053894655], [102.371147088635212, 6.12820506431096], [102.961705356866673, 5.524495144061077], [103.381214634212142, 4.855001125503746], [103.438575474056165, 4.181605536308381], [103.332122023534851, 3.72669790284297], [103.42942874554052, 3.382868760589019], [103.502447544368877, 2.791018581550204], [103.854674106870334, 2.515454006353763], [104.247931756611479, 1.631141058759055], [104.228811476663523, 1.293048000489534], [103.519707472754433, 1.226333726400682], [102.573615350354771, 1.967115383304744], [101.39063846232915, 2.760813706875623], [101.273539666755838, 3.27029165284118], [100.69543541870668, 3.939139715994869], [100.557407668055092, 4.767280381688279], [100.19670617065772, 5.312492580583678], [100.306260207116509, 6.040561835143875], [100.085756870527078, 6.46448944745029], [100.259596388756918, 6.64282481528957], [101.075515578213299, 6.204867051615891]]], [[[118.618320754064825, 4.47820241944754], [117.882034946770162, 4.137551377779487], [117.01521447150634, 4.306094061699468], [115.86551720587677, 4.306559149590156], [115.51907840379198, 3.169238389494395], [115.134037306785231, 2.821481838386219], [114.621355422017473, 1.430688177898886], [113.805849644019531, 1.217548732911041], [112.859809198052176, 1.497790025229946], [112.380251906383648, 1.410120957846757], [111.797548455860408, 0.904441229654651], [111.159137811326559, 0.976478176269509], [110.514060907027101, 0.773131415200993], [109.830226678508836, 1.338135687664191], [109.663260125773718, 2.006466986494984], [110.396135288537039, 1.663774725751395], [111.168852980597478, 1.850636704918784], [111.370081007942076, 2.697303371588872], [111.796928338672842, 2.885896511238073], [112.995614862115247, 3.102394924324869], [113.712935418758718, 3.893509426281127], [114.204016554828399, 4.525873928236819], [114.659595981913526, 4.00763682699781], [114.869557326315373, 4.348313706881952], [115.347460972150671, 4.316636053887009], [115.405700311343594, 4.955227565933824], [115.450710483869798, 5.447729803891561], [116.220741001450961, 6.143191229675621], [116.725102980619752, 6.924771429873998], [117.129626092600461, 6.928052883324566], [117.643393182446303, 6.422166449403305], [117.689075148592337, 5.98749013918018], [118.347691278152197, 5.708695786965462], [119.181903924639926, 5.407835598162249], [119.110693800941718, 5.016128241389864], [118.439727004064082, 4.966518866389619], [118.618320754064825, 4.47820241944754]]]] } }, + { "type": "Feature", "properties": { "admin": "Namibia", "name": "Namibia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[16.344976840895239, -28.576705010697697], [15.601818068105812, -27.821247247022797], [15.210472446359457, -27.09095590587404], [14.989710727608548, -26.117371921495153], [14.74321414557633, -25.392920017195376], [14.40814415859583, -23.85301401132984], [14.385716586981145, -22.656652927340687], [14.257714064194172, -22.111208184499951], [13.868642205468657, -21.699036960539974], [13.352497999737437, -20.872834161057497], [12.82684533046449, -19.673165785401661], [12.608564080463617, -19.045348809487695], [11.794918654028063, -18.069129327061912], [11.734198846085118, -17.30188933682447], [12.215461460019352, -17.11166838955808], [12.814081251688405, -16.941342868724067], [13.462362094789963, -16.971211846588769], [14.058501417709007, -17.42338062914266], [14.209706658595021, -17.353100681225715], [18.26330936043416, -17.309950860262003], [18.956186964603599, -17.789094740472255], [21.377176141045563, -17.930636488519688], [23.215048455506057, -17.52311614346598], [24.033861525170771, -17.29584319424632], [24.6823490740015, -17.35341073981947], [25.076950310982255, -17.578823337476617], [25.084443393664564, -17.661815687737366], [24.520705193792534, -17.887124932529932], [24.217364536239209, -17.889347019118485], [23.579005568137713, -18.281261081620055], [23.196858351339298, -17.869038181227783], [21.655040317478971, -18.219146010005222], [20.910641310314531, -18.252218926672018], [20.881134067475866, -21.814327080983144], [19.895457797940672, -21.849156996347865], [19.895767856534427, -24.767790215760588], [19.89473432788861, -28.461104831660769], [19.002127312911082, -28.972443129188857], [18.464899122804745, -29.045461928017271], [17.836151971109526, -28.856377862261311], [17.387497185951499, -28.783514092729774], [17.218928663815401, -28.355943291946804], [16.824017368240899, -28.082161553664466], [16.344976840895239, -28.576705010697697]]] } }, + { "type": "Feature", "properties": { "admin": "New Caledonia", "name": "New Caledonia", "continent": "Oceania" }, "geometry": { "type": "Polygon", "coordinates": [[[165.779989862326346, -21.080004978115621], [166.599991489933814, -21.700018812753523], [167.120011428086883, -22.159990736583488], [166.74003462144475, -22.399976088146943], [166.189732293968632, -22.129708347260447], [165.474375441752159, -21.679606621998229], [164.829815301775653, -21.149819838141948], [164.16799523341362, -20.444746595951624], [164.029605747735957, -20.105645847252347], [164.459967075862664, -20.120011895429492], [165.020036249041993, -20.459991143477726], [165.460009393575064, -20.800022067958253], [165.779989862326346, -21.080004978115621]]] } }, + { "type": "Feature", "properties": { "admin": "Niger", "name": "Niger", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[2.154473504249949, 11.940150051313422], [2.177107781593917, 12.625017808477534], [1.024103224297619, 12.851825669806598], [0.993045688490156, 13.335749620003865], [0.429927605805517, 13.988733018443893], [0.295646396495215, 14.444234930880663], [0.374892205414767, 14.928908189346144], [1.015783318698481, 14.968182277887989], [1.385528191746971, 15.323561102759237], [2.74999270998154, 15.409524847876751], [3.63825890464659, 15.56811981858044], [3.723421665063596, 16.184283759012654], [4.270209995143886, 16.852227484601311], [4.267419467800095, 19.155265204337123], [5.677565952180712, 19.601206976799794], [8.572893100629868, 21.565660712159225], [11.999505649471697, 23.471668402596432], [13.581424594790459, 23.040506089769274], [14.143870883855239, 22.491288967371126], [14.8513, 22.862950000000119], [15.096887648181847, 21.308518785074902], [15.471076694407314, 21.048457139565979], [15.487148064850143, 20.730414537025634], [15.90324669766431, 20.387618923417499], [15.68574059414777, 19.957180080642384], [15.300441114979716, 17.927949937405], [15.247731154041842, 16.627305813050778], [13.972201775781681, 15.684365953021139], [13.540393507550785, 14.36713369390122], [13.956698846094124, 13.996691189016925], [13.954476759505607, 13.353448798063765], [14.595781284247604, 13.330426947477859], [14.495787387762899, 12.859396267137353], [14.213530714584746, 12.80203542729333], [14.181336297266906, 12.483656927943169], [13.995352817448289, 12.4615652531383], [13.318701613018558, 13.55635630945795], [13.083987257548809, 13.596147162322492], [12.302071160540546, 13.037189032437535], [11.527803175511504, 13.328980007373556], [10.989593133191532, 13.387322699431191], [10.701031935273816, 13.246917832894038], [10.114814487354748, 13.277251898649464], [9.524928012743088, 12.85110219975456], [9.014933302454436, 12.826659247280414], [7.804671258178869, 13.343526923063731], [7.330746697630046, 13.098038031461213], [6.82044192874781, 13.115091254117598], [6.445426059605721, 13.492768459522718], [5.443058302440135, 13.865923977102225], [4.368343540066006, 13.747481594289408], [4.107945997747378, 13.531215725147941], [3.967282749048933, 12.956108710171574], [3.680633579125924, 12.552903347214167], [3.611180454125587, 11.660167141155965], [2.848643019226585, 12.235635891158207], [2.490163608418015, 12.233052069543588], [2.154473504249949, 11.940150051313422]]] } }, + { "type": "Feature", "properties": { "admin": "Nigeria", "name": "Nigeria", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[8.500287713259693, 4.771982937026847], [7.462108188515939, 4.41210826254624], [7.082596469764438, 4.464689032403228], [6.698072137080598, 4.240594183769516], [5.898172641634686, 4.262453314628984], [5.362804803090881, 4.887970689305957], [5.033574252959368, 5.611802476418233], [4.325607130560683, 6.270651149923466], [3.574180128604552, 6.258300482605717], [2.691701694356254, 6.258817246928628], [2.74906253420022, 7.870734361192886], [2.723792758809509, 8.506845404489708], [2.912308383810255, 9.13760793704432], [3.220351596702101, 9.4441525333997], [3.705438266625918, 10.063210354040207], [3.600070021182801, 10.332186184119406], [3.797112257511713, 10.734745591673104], [3.572216424177469, 11.327939357951516], [3.611180454125558, 11.660167141155966], [3.68063357912581, 12.552903347214222], [3.967282749048848, 12.956108710171572], [4.107945997747321, 13.531215725147829], [4.368343540066063, 13.747481594289324], [5.443058302440163, 13.865923977102295], [6.445426059605636, 13.492768459522676], [6.820441928747753, 13.115091254117514], [7.330746697630017, 13.098038031461199], [7.804671258178784, 13.343526923063745], [9.014933302454462, 12.826659247280427], [9.524928012742945, 12.851102199754477], [10.114814487354689, 13.277251898649409], [10.701031935273702, 13.246917832894081], [10.989593133191532, 13.387322699431108], [11.527803175511393, 13.328980007373584], [12.302071160540521, 13.037189032437521], [13.083987257548866, 13.596147162322563], [13.318701613018558, 13.556356309457824], [13.995352817448346, 12.461565253138343], [14.181336297266792, 12.483656927943112], [14.57717776862253, 12.085360826053501], [14.468192172918974, 11.90475169519341], [14.415378859116682, 11.572368882692071], [13.572949659894558, 10.798565985553564], [13.308676385153914, 10.160362046748926], [13.1675997249971, 9.64062632897341], [12.955467970438971, 9.417771714714702], [12.753671502339214, 8.717762762888993], [12.218872104550597, 8.305824082874322], [12.063946160539556, 7.799808457872301], [11.839308709366801, 7.397042344589434], [11.745774366918509, 6.981382961449753], [11.058787876030349, 6.644426784690593], [10.497375115611417, 7.055357774275562], [10.118276808318255, 7.038769639509879], [9.522705926154398, 6.453482367372116], [9.233162876023043, 6.444490668153334], [8.757532993208626, 5.47966583904791], [8.500287713259693, 4.771982937026847]]] } }, + { "type": "Feature", "properties": { "admin": "Nicaragua", "name": "Nicaragua", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-85.712540452807289, 11.088444932494822], [-86.058488328785245, 11.40343862552994], [-86.525849982432931, 11.806876532432593], [-86.7459915839963, 12.143961900272483], [-87.167516242201131, 12.458257961471656], [-87.668493415054698, 12.909909979702629], [-87.557466600275603, 13.064551703336061], [-87.392386237319201, 12.914018256069836], [-87.316654425795463, 12.984685777228972], [-87.005769009127562, 13.025794379117157], [-86.880557013684339, 13.254204209847241], [-86.733821784191576, 13.263092556201441], [-86.755086636079696, 13.754845485890909], [-86.520708177419877, 13.778487453664436], [-86.312142096689911, 13.771356106008167], [-86.096263800790581, 14.038187364147245], [-85.801294725268576, 13.836054999237586], [-85.698665330736901, 13.960078436738083], [-85.514413011400222, 14.079011745657834], [-85.165364549484792, 14.354369615125076], [-85.148750576502948, 14.560196844943615], [-85.052787441736925, 14.551541042534719], [-84.924500698572388, 14.790492865452348], [-84.820036790694346, 14.819586696832669], [-84.649582078779602, 14.66680532476175], [-84.449335903648588, 14.621614284722494], [-84.228341640952394, 14.748764146376654], [-83.975721401693576, 14.749435939996458], [-83.628584967772895, 14.880073960830298], [-83.489988776366104, 15.016267198135534], [-83.147219000974104, 14.995829169164109], [-83.233234422523907, 14.8998660343981], [-83.28416154654758, 14.676623846897197], [-83.182126430987267, 14.310703029838447], [-83.412499966144424, 13.970077826386554], [-83.519831916014667, 13.56769928634588], [-83.55220720084553, 13.127054348193084], [-83.498515387694255, 12.869292303921226], [-83.473323126951968, 12.419087225794424], [-83.626104499022887, 12.320850328007563], [-83.719613003255034, 11.893124497927724], [-83.650857510090702, 11.629032090700116], [-83.855470343750369, 11.373311265503785], [-83.808935716471538, 11.103043524617274], [-83.655611741861563, 10.938764146361418], [-83.895054490885926, 10.726839097532444], [-84.190178595704822, 10.793450018756671], [-84.355930752281026, 10.999225572142901], [-84.673069017256239, 11.082657172078139], [-84.903003302738924, 10.952303371621895], [-85.561851976244171, 11.217119248901593], [-85.712540452807289, 11.088444932494822]]] } }, + { "type": "Feature", "properties": { "admin": "Netherlands", "name": "Netherlands", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[6.074182570020922, 53.51040334737813], [6.905139601274128, 53.482162177130633], [7.092053256873895, 53.14404328064488], [6.842869500362381, 52.228440253297542], [6.589396599970825, 51.85202912048338], [5.988658074577812, 51.85161570902504], [6.156658155958779, 50.803721015010574], [5.60697594567, 51.037298488969768], [4.973991326526913, 51.475023708698124], [4.047071160507527, 51.267258612668556], [3.314971144228536, 51.345755113319903], [3.830288527043137, 51.620544542031936], [4.705997348661184, 53.091798407597757], [6.074182570020922, 53.51040334737813]]] } }, + { "type": "Feature", "properties": { "admin": "Norway", "name": "Norway", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[28.165547316202911, 71.185474351680497], [31.293418409965472, 70.453787746859902], [30.005435011522785, 70.186258856884876], [31.101078728975118, 69.558080145944857], [29.399580519332879, 69.156916002063056], [28.591929559043187, 69.064776923286686], [29.015572950971968, 69.76649119737796], [27.732292107867885, 70.164193020296281], [26.179622023226298, 69.825298977326142], [25.689212680776389, 69.092113755968995], [24.735679152126714, 68.649556789821432], [23.662049594830759, 68.891247463650515], [22.356237827247405, 68.841741441514941], [21.244936150810723, 69.370443020293109], [20.645592889089581, 69.106247260200846], [20.02526899585791, 69.065138658312705], [19.878559604581248, 68.407194322372604], [17.993868442464386, 68.567391262477329], [17.729181756265344, 68.01055186631622], [16.768878614985535, 68.013936672631374], [16.108712192456832, 67.302455552836889], [15.108411492583055, 66.193866889095418], [13.555689731509087, 64.787027696381458], [13.919905226302202, 64.445420640716108], [13.571916131248766, 64.049114081469654], [12.57993533697393, 64.066218980558332], [11.930569288794228, 63.128317572676977], [11.992064243221531, 61.800362453856557], [12.63114668137524, 61.293571682370079], [12.300365838274896, 60.117932847730046], [11.468271925511173, 59.432393296945989], [11.027368605196925, 58.856149400459394], [10.356556837616095, 59.469807033925363], [8.382000359743641, 58.313288479233265], [7.048748406613297, 58.078884182357271], [5.665835402050418, 58.588155422593658], [5.308234490590733, 59.663231919993805], [4.992078077829005, 61.97099803328426], [5.912900424837885, 62.614472968182682], [8.553411085655766, 63.454008287196459], [10.527709181366784, 64.486038316497471], [12.358346795306371, 65.879725857193151], [14.7611458675816, 67.810641587995121], [16.435927361728968, 68.563205471461671], [19.184028354578512, 69.817444159617807], [21.378416375420606, 70.255169379346043], [23.02374230316158, 70.202071845166259], [24.546543409938515, 71.030496731237221], [26.370049676221807, 70.986261705195361], [28.165547316202911, 71.185474351680497]]], [[[24.72412, 77.85385], [22.49032, 77.44493], [20.72601, 77.67704], [21.41611, 77.93504], [20.8119, 78.25463], [22.88426, 78.45494], [23.28134, 78.07954], [24.72412, 77.85385]]], [[[18.25183, 79.70175], [21.54383, 78.95611], [19.02737, 78.5626], [18.47172, 77.82669], [17.59441, 77.63796], [17.1182, 76.80941], [15.91315, 76.77045], [13.76259, 77.38035], [14.66956, 77.73565], [13.1706, 78.02493], [11.22231, 78.8693], [10.44453, 79.65239], [13.17077, 80.01046], [13.71852, 79.66039], [15.14282, 79.67431], [15.52255, 80.01608], [16.99085, 80.05086], [18.25183, 79.70175]]], [[[25.447625359811887, 80.407340399894494], [27.407505730913492, 80.056405748200447], [25.924650506298171, 79.517833970854539], [23.024465773213613, 79.40001170522909], [20.075188429451877, 79.566823228667232], [19.897266473070907, 79.842361965647498], [18.46226362475792, 79.859880276194403], [17.368015170977454, 80.318896186027004], [20.455992059010693, 80.598155626132225], [21.907944777115397, 80.357679348462071], [22.919252557067431, 80.657144273593488], [25.447625359811887, 80.407340399894494]]]] } }, + { "type": "Feature", "properties": { "admin": "Nepal", "name": "Nepal", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[88.120440708369841, 27.876541652939586], [88.043132765661198, 27.445818589786818], [88.174804315140904, 26.810405178325944], [88.060237664749806, 26.414615383402484], [87.22747195836628, 26.39789805755607], [86.024392938179147, 26.630984605408567], [85.25177859898335, 26.726198431906337], [84.675017938173767, 27.234901231387528], [83.304248895199535, 27.364505723575554], [81.999987420584958, 27.925479234319987], [81.057202589851997, 28.416095282499036], [80.088424513676259, 28.794470119740136], [80.476721225917373, 29.729865220655334], [81.11125613802929, 30.183480943313398], [81.525804477874729, 30.422716986608627], [82.327512648450863, 30.115268052688126], [83.337115106137176, 29.463731594352193], [83.898992954446712, 29.320226141877654], [84.234579705750136, 28.839893703724691], [85.011638218123025, 28.642773952747337], [85.823319940131498, 28.203575954698699], [86.954517043000592, 27.97426178640351], [88.120440708369841, 27.876541652939586]]] } }, + { "type": "Feature", "properties": { "admin": "New Zealand", "name": "New Zealand", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[173.020374790740703, -40.919052422856417], [173.247234328502003, -41.331998793300777], [173.958405389702875, -40.926700534835604], [174.2475867048081, -41.349155368821663], [174.248516880589449, -41.770008233406749], [173.876446568087886, -42.233184096038819], [173.222739699595621, -42.970038344088557], [172.711246372770717, -43.372287693048492], [173.080112746470206, -43.853343601253577], [172.308583612352464, -43.865694268571332], [171.452925246463622, -44.24251881284372], [171.185137974327233, -44.897104180684885], [170.616697219116588, -45.908928724959701], [169.83142215400926, -46.355774834987585], [169.332331170934253, -46.641235446967848], [168.411353794628525, -46.619944756863582], [167.763744745146823, -46.290197442409195], [166.676886021184202, -46.219917494492236], [166.509144321964669, -45.852704766626204], [167.046424188503238, -45.110941257508664], [168.303763462596862, -44.12397307716612], [168.949408807651508, -43.93581918719142], [169.667814569373149, -43.555325616226334], [170.524919875366152, -43.031688327812823], [171.125089960004004, -42.512753594737781], [171.569713983443194, -41.767424411792128], [171.948708937871885, -41.514416599291145], [172.097227004278722, -40.956104424809674], [172.798579543343948, -40.493962090823466], [173.020374790740703, -40.919052422856417]]], [[[174.612008905330526, -36.156397393540537], [175.336615838927173, -37.209097995758263], [175.3575964704375, -36.52619394302112], [175.808886753642469, -36.798942152657681], [175.958490025127475, -37.555381768546063], [176.763195428776555, -37.881253350578696], [177.438813104560495, -37.961248467766488], [178.010354445708657, -37.579824721020124], [178.517093540762801, -37.695373223624792], [178.274731073313802, -38.582812595373092], [177.970460239979332, -39.166342868812968], [177.206992629299123, -39.145775648760839], [176.939980503647007, -39.449736423501562], [177.032946405340113, -39.879942722331471], [176.8858236026052, -40.06597787858216], [176.508017206119348, -40.60480803808958], [176.012440220440283, -41.289624118821493], [175.239567499082966, -41.688307793953236], [175.067898391009408, -41.425894870775075], [174.650972935278418, -41.281820977545443], [175.227630243223615, -40.459235528323397], [174.900156691789959, -39.908933200847216], [173.824046665743992, -39.508854262043506], [173.852261997775315, -39.146602471677461], [174.57480187408035, -38.797683200842748], [174.743473749081033, -38.027807712558378], [174.69701663645057, -37.381128838857954], [174.292028436579187, -36.71109221776144], [174.319003534235549, -36.534823907213884], [173.840996535535766, -36.121980889634109], [173.05417117745958, -35.237125339500331], [172.636005487353714, -34.529106540669382], [173.007042271209457, -34.450661716450334], [173.551298456107475, -35.006183363587958], [174.329390497126241, -35.265495700828616], [174.612008905330526, -36.156397393540537]]]] } }, + { "type": "Feature", "properties": { "admin": "Oman", "name": "Oman", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[58.861141391846573, 21.114034532144299], [58.487985874266961, 20.428985907467101], [58.03431847517659, 20.481437486243347], [57.826372511634098, 20.24300242764863], [57.66576216007094, 19.736004950433109], [57.788700392493368, 19.067570298737646], [57.694390903560667, 18.944709580963799], [57.2342639504338, 18.947991034414255], [56.609650913321971, 18.574267076079476], [56.512189162019482, 18.087113348863934], [56.283520949128011, 17.876066799383945], [55.661491733630683, 17.884128322821535], [55.269939406155189, 17.632309068263194], [55.274900343655091, 17.228354397037659], [54.791002231674113, 16.950696926333357], [54.239252964093751, 17.04498057704998], [53.57050825380459, 16.707662665264674], [53.108572625547502, 16.651051133688977], [52.782184279192066, 17.349742336491229], [52.000009800022227, 19.000003363516068], [54.999981723862405, 19.999994004796118], [55.666659376859869, 22.000001125572307], [55.208341098863187, 22.708329982997007], [55.234489373602869, 23.110992743415348], [55.52584109886449, 23.524869289640911], [55.528631626208288, 23.933604030853498], [55.981213820220503, 24.130542914317854], [55.80411868675624, 24.269604193615287], [55.88623253766805, 24.920830593357486], [56.396847365143984, 24.924732163995508], [56.845140415276049, 24.241673081961487], [57.403452589757428, 23.878594468678834], [58.136947869708322, 23.747930609628835], [58.729211460205427, 23.565667832935414], [59.180501743410346, 22.992395331305456], [59.450097690677033, 22.660270900965592], [59.80806033716285, 22.533611965418199], [59.806148309168087, 22.31052480721419], [59.442191196536399, 21.71454051359208], [59.282407667889871, 21.433885809814875], [58.861141391846573, 21.114034532144299]]], [[[56.391421339753393, 25.895990708921254], [56.261041701080913, 25.714606431576748], [56.070820753814544, 26.055464178973946], [56.362017449779344, 26.395934353128947], [56.485679152253809, 26.309117946878665], [56.391421339753393, 25.895990708921254]]]] } }, + { "type": "Feature", "properties": { "admin": "Pakistan", "name": "Pakistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[75.158027785140902, 37.13303091078911], [75.896897414050116, 36.666806138651829], [76.192848341785677, 35.898403428687821], [77.837450799474553, 35.494009507787759], [76.871721632804011, 34.653544012992732], [75.757060988268321, 34.504922593721311], [74.240202671204955, 34.748887030571247], [73.749948358051952, 34.317698879527846], [74.104293654277328, 33.441473293586846], [74.451559279278698, 32.764899603805489], [75.258641798813187, 32.271105455040491], [74.405928989564998, 31.692639471965272], [74.421380242820263, 30.97981476493117], [73.450638462217412, 29.976413479119863], [72.823751662084689, 28.961591701772047], [71.777665643200308, 27.913180243434521], [70.61649620960192, 27.989196275335861], [69.514392938113119, 26.940965684511365], [70.168926629522005, 26.491871649678835], [70.282873162725579, 25.722228705339823], [70.844699334602822, 25.215102037043511], [71.0432401874682, 24.356523952730193], [68.842599318318761, 24.359133612560932], [68.176645135373377, 23.691965033456704], [67.443666619745457, 23.944843654876983], [67.145441928989058, 24.663611151624639], [66.37282758979326, 25.425140896093847], [64.530407749291115, 25.237038682551425], [62.905700718034595, 25.218409328710202], [61.497362908784183, 25.078237006118492], [61.874187453056535, 26.239974880472097], [63.316631707619578, 26.756532497661659], [63.23389773952028, 27.217047024030702], [62.755425652929851, 27.378923448184985], [62.727830438085974, 28.259644883735383], [61.771868117118615, 28.699333807890792], [61.369308709564926, 29.303276272085917], [60.874248488208778, 29.829238999952604], [62.549856805272775, 29.318572496044304], [63.550260858011164, 29.468330796826162], [64.148002150331237, 29.340819200145965], [64.350418735618504, 29.560030625928089], [65.046862013616092, 29.472180691031902], [66.346472609324408, 29.88794342703617], [66.38145755398601, 30.738899237586448], [66.938891229118454, 31.304911200479346], [67.683393589147457, 31.303154201781414], [67.792689243444769, 31.582930406209623], [68.556932000609308, 31.713310044882011], [68.926676873657655, 31.620189113892064], [69.317764113242546, 31.901412258424436], [69.262522007122541, 32.501944078088293], [69.687147251264847, 33.105498969041228], [70.323594191371583, 33.358532619758385], [69.93054324735958, 34.020120144175102], [70.881803012988385, 33.988855902638512], [71.156773309213449, 34.348911444632144], [71.115018751921625, 34.733125718722228], [71.613076206350698, 35.153203436822857], [71.498767938121077, 35.650563259415996], [71.262348260385735, 36.074387518857797], [71.846291945283909, 36.509942328429851], [72.920024855444453, 36.720007025696312], [74.067551710917812, 36.836175645488446], [74.575892775372964, 37.02084137628345], [75.158027785140902, 37.13303091078911]]] } }, + { "type": "Feature", "properties": { "admin": "Panama", "name": "Panama", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-77.881571417945239, 7.223771267114783], [-78.214936082660103, 7.512254950384159], [-78.429160732726061, 8.052041123888925], [-78.182095709938608, 8.319182440621772], [-78.43546525746568, 8.387705389840788], [-78.622120530903928, 8.718124497915026], [-79.120307176413732, 8.996092027213022], [-79.557877366845176, 8.932374986197145], [-79.760578172510037, 8.584515082224398], [-80.164481167303322, 8.333315944853593], [-80.382659064439608, 8.29840851484043], [-80.480689256497286, 8.090307522001067], [-80.003689948227148, 7.54752411542337], [-80.276670701808982, 7.419754136581713], [-80.421158006497066, 7.271571966984763], [-80.886400926420791, 7.220541490096535], [-81.059542812814698, 7.817921047390596], [-81.189715745757937, 7.647905585150339], [-81.519514736644666, 7.706610012233908], [-81.721311204744453, 8.108962714058434], [-82.131441209628889, 8.175392767769635], [-82.390934414382542, 8.292362372262287], [-82.820081346350406, 8.290863755725821], [-82.850958014644803, 8.073822740099954], [-82.965783047197348, 8.225027980985983], [-82.9131764391242, 8.423517157419068], [-82.829770677405151, 8.626295477732368], [-82.868657192704759, 8.807266343618521], [-82.719183112300513, 8.925708726431493], [-82.927154914059145, 9.074330145702914], [-82.932890998043561, 9.476812038608172], [-82.546196255203469, 9.566134751824674], [-82.187122565423394, 9.207448635286779], [-82.207586432610952, 8.995575262890098], [-81.808566860669259, 8.95061676679617], [-81.714154018872023, 9.031955471223581], [-81.43928707551153, 8.786234035675715], [-80.947301601876745, 8.858503526235905], [-80.521901211250054, 9.11107208906243], [-79.914599778955974, 9.312765204297618], [-79.573302781884294, 9.611610012241526], [-79.021191779277913, 9.552931423374103], [-79.058450486960353, 9.454565334506523], [-78.500887620747164, 9.420458889193879], [-78.055927700497989, 9.247730414258296], [-77.729513515926399, 8.946844387238867], [-77.353360765273848, 8.670504665558068], [-77.474722866511314, 8.524286200388216], [-77.242566494440069, 7.935278225125442], [-77.431107957656977, 7.638061224798733], [-77.75341386586139, 7.709839789252141], [-77.881571417945239, 7.223771267114783]]] } }, + { "type": "Feature", "properties": { "admin": "Peru", "name": "Peru", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-69.590423753524036, -17.580011895419329], [-69.858443569605839, -18.092693780187009], [-70.3725723944777, -18.347975355708861], [-71.375250210236914, -17.77379851651385], [-71.462040778271117, -17.363487644116379], [-73.444529588500401, -16.359362888252992], [-75.23788265654143, -15.26568287522778], [-76.009205084929931, -14.649286390850317], [-76.423469204397733, -13.823186944232431], [-76.259241502574156, -13.535039157772939], [-77.10619238962181, -12.222716159720816], [-78.092152879534623, -10.377712497604062], [-79.036953091126918, -8.38656788496589], [-79.445920376284832, -7.930833428583859], [-79.760578172510037, -7.194340915560081], [-80.537481655586049, -6.541667575713715], [-81.249996304026411, -6.136834405139182], [-80.926346808582423, -5.690556735866563], [-81.410942552399433, -4.736764825055459], [-81.099669562489353, -4.036394138203696], [-80.302560594387188, -3.404856459164712], [-80.184014858709645, -3.821161797708043], [-80.46929460317692, -4.059286797708999], [-80.442241990872134, -4.425724379090673], [-80.028908047185581, -4.346090996928893], [-79.62497921417615, -4.454198093283494], [-79.205289069317715, -4.959128513207388], [-78.639897223612323, -4.547784112164072], [-78.450683966775628, -3.873096612161375], [-77.83790483265858, -3.003020521663103], [-76.635394253226707, -2.608677666843817], [-75.544995693652027, -1.56160979574588], [-75.233722703741932, -0.911416924649529], [-75.373223232713841, -0.15203175212045], [-75.106624518520064, -0.05720549886486], [-74.441600511355958, -0.530820000819887], [-74.122395189089048, -1.002832533373848], [-73.659503546834586, -1.260491224781134], [-73.070392218707212, -2.308954359550952], [-72.325786505813639, -2.434218031426453], [-71.774760708285385, -2.169789727388937], [-71.413645799429773, -2.342802422702128], [-70.813475714791949, -2.256864515800742], [-70.047708502874841, -2.725156345229699], [-70.692682054309699, -3.742872002785858], [-70.394043952094975, -3.766591485207825], [-69.893635219996611, -4.298186944194326], [-70.79476884630229, -4.251264743673302], [-70.928843349883564, -4.401591485210367], [-71.748405727816532, -4.59398284263301], [-72.891927659787243, -5.274561455916979], [-72.964507208941185, -5.741251315944892], [-73.219711269814596, -6.089188734566076], [-73.120027431923575, -6.629930922068238], [-73.724486660441627, -6.918595472850638], [-73.723401455363486, -7.340998630404412], [-73.987235480429646, -7.523829847853063], [-73.571059332967053, -8.424446709835832], [-73.015382656532537, -9.03283334720806], [-73.226713426390148, -9.462212823121233], [-72.563033006465631, -9.520193780152715], [-72.184890713169821, -10.05359791426943], [-71.302412278921523, -10.079436130415372], [-70.481893886991159, -9.490118096558842], [-70.548685675728393, -11.009146823778462], [-70.093752204046879, -11.123971856331011], [-69.52967810736493, -10.951734307502193], [-68.665079718689611, -12.561300144097171], [-68.880079515239956, -12.89972909917665], [-68.929223802349526, -13.602683607643007], [-68.94888668483658, -14.45363941819328], [-69.339534674747, -14.953195489158828], [-69.160346645774936, -15.323973890853015], [-69.389764166934697, -15.66012908291165], [-68.959635382753291, -16.500697930571267], [-69.590423753524036, -17.580011895419329]]] } }, + { "type": "Feature", "properties": { "admin": "Philippines", "name": "Philippines", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[126.376813592637447, 8.414706325713352], [126.478512811387873, 7.750354112168976], [126.537423944200611, 7.189380601424572], [126.19677290253253, 6.274294338400038], [125.831420526229081, 7.293715318221855], [125.363852166852283, 6.78648529706099], [125.683160841983707, 6.049656887227257], [125.396511672060626, 5.581003322772288], [124.219787632342332, 6.16135549562618], [123.938719517106918, 6.88513560630612], [124.243662144061318, 7.360610459823659], [123.610212437027542, 7.833527329942753], [123.29607140512519, 7.418875637232786], [122.825505812675388, 7.457374579290216], [122.085499302255769, 6.899424139834847], [121.919928013192603, 7.192119452336072], [122.312358840017112, 8.034962063016506], [122.94239790251963, 8.316236883981174], [123.487687616063511, 8.693009751821192], [123.841154412939815, 8.240324204944384], [124.6014697612502, 8.514157619659015], [124.764612257995623, 8.960409450715458], [125.471390822451539, 8.986996975129641], [125.412117954612754, 9.760334784377545], [126.222714471543156, 9.28607432701885], [126.306636997585073, 8.782487494334573], [126.376813592637447, 8.414706325713352]]], [[[123.982437778825798, 10.278778591345811], [123.62318322153277, 9.950090643753297], [123.309920688979332, 9.318268744336676], [122.995883009941636, 9.022188625520398], [122.380054966319463, 9.713360907424201], [122.586088901867072, 9.981044826696104], [122.837081333508706, 10.261156927934234], [122.947410516451896, 10.881868394408029], [123.498849725438447, 10.940624497923945], [123.337774285984722, 10.267383938025445], [124.077935825701218, 11.232725531453706], [123.982437778825798, 10.278778591345811]]], [[[118.504580926590336, 9.316382554558087], [117.174274530100675, 8.367499904814663], [117.664477166821371, 9.066888739452933], [118.386913690261736, 9.684499619989223], [118.98734215706105, 10.376292019080507], [119.511496209797528, 11.36966807702721], [119.689676548339889, 10.554291490109872], [119.029458449378978, 10.003653265823869], [118.504580926590336, 9.316382554558087]]], [[[121.883547804859106, 11.891755072471977], [122.483821242361458, 11.582187404827506], [123.120216506035959, 11.583660183147867], [123.100837843926442, 11.165933742716486], [122.637713657726692, 10.741308498574226], [122.002610304859559, 10.441016750526087], [121.967366978036523, 10.905691229694622], [122.038370396005519, 11.415840969280039], [121.883547804859106, 11.891755072471977]]], [[[125.502551711123488, 12.162694606978347], [125.783464797062152, 11.046121934447767], [125.01188398651226, 11.311454576050377], [125.032761265158115, 10.975816148314703], [125.277449172060244, 10.358722032101308], [124.801819289245714, 10.134678859899889], [124.760168084818474, 10.8379951033923], [124.459101190286049, 10.889929917845633], [124.302521600441722, 11.495370998577227], [124.891012811381572, 11.415582587118589], [124.877990350443952, 11.794189968304988], [124.266761509295705, 12.557760931849682], [125.22711632700782, 12.53572093347719], [125.502551711123488, 12.162694606978347]]], [[[121.527393833503481, 13.069590155484516], [121.262190382981544, 12.2055602075644], [120.833896112146533, 12.704496161342416], [120.323436313967477, 13.466413479053866], [121.18012820850214, 13.429697373910439], [121.527393833503481, 13.069590155484516]]], [[[121.321308221523566, 18.504064642811013], [121.937601353036371, 18.21855235439838], [122.246006300954264, 18.478949896717094], [122.336956821787965, 18.224882717354173], [122.174279412933174, 17.810282701076371], [122.51565392465335, 17.09350474697197], [122.252310825693883, 16.262444362854122], [121.662786086108255, 15.931017564350125], [121.505069614753367, 15.124813544164621], [121.728828566577249, 14.328376369682244], [122.258925409027313, 14.218202216035973], [122.701275669445636, 14.336541245984417], [123.950295037940236, 13.782130642141066], [123.855107049658599, 13.237771104378464], [124.181288690284873, 12.997527370653469], [124.077419061378222, 12.536676947474573], [123.298035109552245, 13.027525539598981], [122.928651971529902, 13.552919826710404], [122.671355015148663, 13.185836289925131], [122.034649692880521, 13.784481919810343], [121.126384718918587, 13.636687323455559], [120.628637323083296, 13.857655747935649], [120.679383579593832, 14.271015529838319], [120.99181928923052, 14.525392767795079], [120.693336216312687, 14.756670640517282], [120.564145135582976, 14.396279201713821], [120.070428501466367, 14.970869452367094], [119.920928582846102, 15.406346747290735], [119.883773228028247, 16.363704331929963], [120.286487664878791, 16.034628811095327], [120.39004723519173, 17.599081122299506], [120.7158671407919, 18.505227362537536], [121.321308221523566, 18.504064642811013]]]] } }, + { "type": "Feature", "properties": { "admin": "Papua New Guinea", "name": "Papua New Guinea", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[155.880025669578401, -6.819996840037758], [155.599991082988765, -6.919990736522491], [155.166994256815087, -6.535931491729299], [154.729191522438327, -5.900828138862208], [154.514114211239644, -5.139117526880012], [154.652503696917336, -5.042430922061839], [154.759990676084357, -5.339983819198493], [155.062917922179338, -5.566791680527486], [155.547746209941693, -6.200654799019658], [156.019965448224752, -6.540013929880386], [155.880025669578401, -6.819996840037758]]], [[[151.982795851854462, -5.478063246282344], [151.459106887008659, -5.560280450058739], [151.301390415653884, -5.840728448106701], [150.754447056276661, -6.083762709175387], [150.241196730753813, -6.317753594592984], [149.709963006793316, -6.316513360218051], [148.890064732050462, -6.026040134305432], [148.318936802360696, -5.74714242922613], [148.401825799756864, -5.437755629094722], [149.298411900020824, -5.583741550319216], [149.845561965127217, -5.505503431829339], [149.996250441690279, -5.026101169457674], [150.139755894164921, -5.001348158389788], [150.236907586873485, -5.53222014732428], [150.807467075808063, -5.455842380396886], [151.089672072553981, -5.113692722192368], [151.647880894170811, -4.757073662946168], [151.537861769821518, -4.167807305521889], [152.136791620084352, -4.148790378438519], [152.338743117480988, -4.31296640382976], [152.318692661751754, -4.867661228050748], [151.982795851854462, -5.478063246282344]]], [[[147.191873814074938, -7.388024183789978], [148.084635858349372, -8.044108168167609], [148.734105259393573, -9.104663588093755], [149.306835158484432, -9.071435642130067], [149.266630894161324, -9.514406019736027], [150.038728469034311, -9.684318129111698], [149.738798456012262, -9.872937106977002], [150.801627638959133, -10.29368661869742], [150.690574985963849, -10.582712904505865], [150.028393182575826, -10.652476088099929], [149.782310012001972, -10.393267103723941], [148.923137648717216, -10.28092253992136], [147.913018426707993, -10.130440769087469], [147.135443150012236, -9.492443536012017], [146.567880894150619, -8.942554619994153], [146.048481073184917, -8.067414239131308], [144.74416792213799, -7.630128269077473], [143.897087844009661, -7.915330498896279], [143.286375767184268, -8.245491224809056], [143.413913202080664, -8.983068942910945], [142.628431431244223, -9.326820570516501], [142.068258905200196, -9.159595635620034], [141.033851760013874, -9.117892754760417], [141.017056919519007, -5.85902190513802], [141.000210402591847, -2.600151055515624], [142.735246616791443, -3.289152927263216], [144.583970982033236, -3.861417738463401], [145.27317955950997, -4.373737888205027], [145.829786411725649, -4.876497897972683], [145.981921828392956, -5.465609226100012], [147.648073358347574, -6.083659356310803], [147.891107619416175, -6.614014580922315], [146.970905389594861, -6.721656589386255], [147.191873814074938, -7.388024183789978]]], [[[153.14003787659874, -4.499983412294113], [152.827292108368255, -4.766427097190998], [152.63867313050298, -4.176127211120927], [152.406025832324929, -3.789742526874561], [151.953236932583536, -3.462062269711821], [151.384279413050024, -3.035421644710111], [150.6620495953388, -2.741486097833956], [150.939965448204532, -2.500002129734028], [151.479984165654514, -2.779985039891386], [151.820015090135087, -2.999971612157907], [152.239989455371074, -3.24000864015366], [152.640016717742526, -3.659983005389647], [153.019993524384631, -3.980015150573293], [153.14003787659874, -4.499983412294113]]]] } }, + { "type": "Feature", "properties": { "admin": "Poland", "name": "Poland", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[15.016995883858666, 51.106674099321566], [14.607098422919531, 51.745188096719964], [14.685026482815685, 52.089947414755187], [14.437599725002197, 52.624850165408382], [14.074521111719488, 52.981262518925426], [14.353315463934136, 53.248171291712957], [14.119686313542584, 53.757029120491026], [14.802900424873455, 54.050706285205735], [16.363477003655728, 54.513158677785711], [17.622831658608671, 54.851535956432897], [18.620858595461637, 54.682605699270766], [18.696254510175461, 54.438718777069276], [19.6606400896064, 54.426083889373913], [20.89224450041862, 54.312524929412518], [22.731098667092649, 54.327536932993311], [23.243987257589506, 54.220566718149129], [23.484127638449841, 53.912497667041123], [23.527535841574995, 53.47012156840654], [23.804934930117774, 53.08973135030606], [23.799198846133375, 52.691099351606553], [23.19949384938618, 52.486977444053664], [23.508002150168689, 52.023646552124717], [23.52707075368437, 51.578454087930233], [24.029985792748899, 50.705406602575174], [23.922757195743259, 50.424881089878738], [23.426508416444388, 50.308505764357449], [22.518450148211596, 49.476773586619736], [22.776418898212619, 49.027395331409608], [22.558137648211751, 49.08573802346713], [21.607808058364206, 49.470107326854077], [20.887955356538406, 49.328772284535823], [20.415839471119849, 49.431453355499755], [19.825022820726865, 49.217125352569219], [19.320712517990469, 49.571574001659179], [18.909574822676316, 49.435845852244562], [18.85314415861361, 49.496229763377634], [18.392913852622168, 49.988628648470737], [17.649445021238986, 50.049038397819942], [17.554567091551117, 50.36214590107641], [16.868769158605655, 50.473973700556016], [16.719475945714429, 50.215746568393527], [16.176253289462263, 50.4226073268579], [16.238626743238566, 50.697732652379827], [15.490972120839725, 50.7847299261432], [15.016995883858666, 51.106674099321566]]] } }, + { "type": "Feature", "properties": { "admin": "Puerto Rico", "name": "Puerto Rico", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-66.2824344550082, 18.51476166429536], [-65.771302863209286, 18.426679185453875], [-65.591003790942935, 18.228034979723912], [-65.847163865813755, 17.975905666571855], [-66.599934455009475, 17.98182261806927], [-67.184162360285256, 17.946553453030074], [-67.24242753769434, 18.374460150622934], [-67.100679083917726, 18.520601101144347], [-66.2824344550082, 18.51476166429536]]] } }, + { "type": "Feature", "properties": { "admin": "North Korea", "name": "Dem. Rep. Korea", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[130.640015903852401, 42.39500946712527], [130.780007358931101, 42.220007229168843], [130.400030552288996, 42.280003567059701], [129.965948521037234, 41.941367906251052], [129.667362095254788, 41.601104437825221], [129.705189243692445, 40.882827867184318], [129.188114862179958, 40.661807766271984], [129.010399611528186, 40.485436102859801], [128.633368361526692, 40.189846910150301], [127.967414178581322, 40.025412502597547], [127.533435500194145, 39.756850083976694], [127.502119582225276, 39.323930772451526], [127.385434198110261, 39.213472398427648], [127.783342726757709, 39.050898342437414], [128.349716424676586, 38.612242946927843], [128.205745884311426, 38.370397243801882], [127.780035435090966, 38.304535630845884], [127.073308547067342, 38.256114813788393], [126.683719924018888, 37.804772854151174], [126.237338901881742, 37.840377916000271], [126.174758742376213, 37.749685777328033], [125.689103631697165, 37.940010077459014], [125.568439162295675, 37.752088731429616], [125.275330438336184, 37.66907054295271], [125.24008711151312, 37.857224432927424], [124.981033156433952, 37.948820909164773], [124.712160679219352, 38.108346055649783], [124.985994093933954, 38.548474229479673], [125.221948683778677, 38.665857245430665], [125.13285851450749, 38.848559271798578], [125.386589797060566, 39.387957872061158], [125.321115757346774, 39.551384589184202], [124.737482131042384, 39.660344346671614], [124.265624627785286, 39.928493353834149], [125.079941847840615, 40.569823716792442], [126.182045119329402, 41.107336127276362], [126.86908328664984, 41.816569322266176], [127.343782993682993, 41.50315176041596], [128.208433058790632, 41.466771552082477], [128.052215203972281, 41.994284572917934], [129.59666873587949, 42.424981797854542], [129.994267205933198, 42.985386867843779], [130.640015903852401, 42.39500946712527]]] } }, + { "type": "Feature", "properties": { "admin": "Portugal", "name": "Portugal", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[-9.034817674180244, 41.880570583659669], [-8.671945766626719, 42.134689439454952], [-8.26385698081779, 42.280468654950326], [-8.01317460776991, 41.790886135417118], [-7.422512986673794, 41.792074693359822], [-7.251308966490822, 41.91834605566504], [-6.668605515967655, 41.883386949219577], [-6.389087693700914, 41.381815497394641], [-6.851126674822551, 41.111082668617513], [-6.864019944679383, 40.330871893874821], [-7.026413133156593, 40.184524237624238], [-7.066591559263527, 39.711891587882768], [-7.498632371439724, 39.629571031241802], [-7.098036668313126, 39.03007274022378], [-7.374092169616317, 38.373058580064914], [-7.029281175148794, 38.075764065089757], [-7.166507941099863, 37.803894354802217], [-7.537105475281022, 37.428904323876232], [-7.45372555177809, 37.097787583966053], [-7.855613165711985, 36.838268540996253], [-8.382816127953687, 36.978880113262449], [-8.898856980820325, 36.868809312480771], [-8.746101446965552, 37.6513455266766], [-8.839997524439879, 38.266243394517609], [-9.287463751655221, 38.358485826158592], [-9.526570603869713, 38.737429104154906], [-9.44698889814023, 39.392066148428363], [-9.048305223008425, 39.755093085278766], [-8.977353481471679, 40.159306138665798], [-8.7686840478771, 40.76063894303018], [-8.790853237330309, 41.18433401139125], [-8.990789353867568, 41.543459377603625], [-9.034817674180244, 41.880570583659669]]] } }, + { "type": "Feature", "properties": { "admin": "Paraguay", "name": "Paraguay", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-62.685057135657871, -22.24902922942238], [-62.291179368729203, -21.051634616787389], [-62.265961269770784, -20.513734633061272], [-61.786326463453761, -19.633736667562957], [-60.043564622626477, -19.342746677327419], [-59.11504248720609, -19.356906019775398], [-58.183471442280492, -19.868399346600359], [-58.166392381408038, -20.176700941653674], [-57.870673997617786, -20.732687676681948], [-57.937155727761287, -22.090175876557169], [-56.881509568902885, -22.282153822521476], [-56.473317430229379, -22.086300144135279], [-55.797958136606894, -22.356929620047815], [-55.61068274598113, -22.655619398694839], [-55.517639329639621, -23.57199757252663], [-55.400747239795407, -23.956935316668797], [-55.027901780809543, -24.001273695575225], [-54.652834235235119, -23.839578138933955], [-54.292959560754511, -24.021014092710722], [-54.293476325077435, -24.570799655863958], [-54.428946092330577, -25.162184747012162], [-54.625290696823562, -25.739255466415507], [-54.788794928595038, -26.621785577096126], [-55.695845506398143, -27.387837009390857], [-56.486701626192989, -27.548499037386286], [-57.609759690976134, -27.395898532828383], [-58.618173590719735, -27.123718763947089], [-57.633660040911117, -25.603656508081638], [-57.777217169817924, -25.162339776309032], [-58.807128465394968, -24.771459242453307], [-60.028966030504016, -24.032796319273267], [-60.846564704009907, -23.880712579038288], [-62.685057135657871, -22.24902922942238]]] } }, + { "type": "Feature", "properties": { "admin": "Palestine", "name": "Palestine", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[35.545665317534535, 32.393992011030569], [35.545251906076196, 31.782504787720832], [35.397560662586038, 31.489086005167572], [34.927408481594554, 31.35343537040141], [34.970506626125989, 31.616778469360803], [35.225891554512422, 31.754341132121759], [34.974640740709319, 31.866582343059715], [35.183930291491428, 32.532510687788935], [35.545665317534535, 32.393992011030569]]] } }, + { "type": "Feature", "properties": { "admin": "Qatar", "name": "Qatar", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[50.810108270069563, 24.754742539971371], [50.743910760303677, 25.482424221289389], [51.01335167827348, 26.006991685484191], [51.286461622936045, 26.114582017515865], [51.589078810437243, 25.801112779233375], [51.606700473848804, 25.215670477798735], [51.389607781790623, 24.627385972588051], [51.112415398977006, 24.556330878186721], [50.810108270069563, 24.754742539971371]]] } }, + { "type": "Feature", "properties": { "admin": "Romania", "name": "Romania", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.710531447040488, 47.882193915389394], [23.142236362406798, 48.096341050806942], [23.760958286237404, 47.985598456405448], [24.402056105250374, 47.981877753280422], [24.866317172960571, 47.737525743188307], [25.207743361112986, 47.891056423527459], [25.945941196402394, 47.987148749374207], [26.197450392366925, 48.220881252630342], [26.619336785597788, 48.220726223333457], [26.924176059687561, 48.123264472030982], [27.233872918412736, 47.826770941756365], [27.551166212684841, 47.405117092470817], [28.128030226359037, 46.81047638608824], [28.160017937947707, 46.371562608417207], [28.054442986775392, 45.944586086605618], [28.233553501099035, 45.488283189468369], [28.679779493939371, 45.30403087013169], [29.149724969201646, 45.464925442072442], [29.603289015427425, 45.293308010431119], [29.62654340995876, 45.035390936862392], [29.141611769331831, 44.820210272799038], [28.837857700320196, 44.913873806328041], [28.55808149589199, 43.707461656258118], [27.970107049275068, 43.812468166675202], [27.242399529740904, 44.175986029632398], [26.065158725699739, 43.943493760751259], [25.569271681426923, 43.688444729174712], [24.100679152124169, 43.741051337247846], [23.332302280376322, 43.897010809904707], [22.94483239105184, 43.823785305347123], [22.657149692482985, 44.234923000661276], [22.474008416440594, 44.409227606781762], [22.705725538837349, 44.578002834647016], [22.459022251075933, 44.702517198254291], [22.145087924902807, 44.478422349620573], [21.562022739353605, 44.768947251965486], [21.483526238702233, 45.181170152357772], [20.874312778413351, 45.416375433934228], [20.76217492033998, 45.734573065771428], [20.220192498462833, 46.127468980486547], [21.021952345471245, 46.316087958351886], [21.626514926853869, 46.994237779318148], [22.09976769378283, 47.672439276716695], [22.710531447040488, 47.882193915389394]]] } }, + { "type": "Feature", "properties": { "admin": "Russia", "name": "Russia", "continent": "Europe" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[143.648007440362846, 50.747600409541512], [144.65414757708561, 48.976390692737581], [143.173927850517174, 49.306551418650365], [142.558668247650076, 47.861575018904908], [143.533492466404027, 46.836728013692479], [143.505277134372591, 46.137907619809475], [142.747700636973889, 46.740764878926562], [142.092030064054484, 45.966755276058777], [141.906925083585008, 46.805928860046535], [142.018442824470867, 47.780132961612921], [141.904444614835029, 48.859188544299563], [142.135800002205656, 49.615163072297449], [142.179983351815281, 50.952342434281903], [141.594075962490024, 51.935434882202529], [141.682546014573632, 53.301966457728767], [142.606934035410745, 53.762145087287891], [142.209748976815376, 54.225475979216853], [142.654786411712934, 54.365880845753864], [142.914615513276544, 53.704577541714734], [143.260847609632037, 52.740760403039033], [143.235267775647628, 51.756660264688733], [143.648007440362846, 50.747600409541512]]], [[[22.731098667092649, 54.327536932993311], [20.892244500418652, 54.312524929412568], [19.6606400896064, 54.42608388937397], [19.88848147958134, 54.866160386771483], [21.268448927503492, 55.190481675835279], [22.315723504330599, 55.015298570365886], [22.757763706155281, 54.856574408581416], [22.651051873472564, 54.582740993866693], [22.731098667092649, 54.327536932993311]]], [[[180.000000000000114, 70.832199208546669], [178.903425, 70.78114], [178.7253, 71.0988], [180.000000000000114, 71.515714336428246], [180.000000000000114, 70.832199208546669]]], [[[143.60385, 73.21244], [142.08763, 73.20544], [140.038155, 73.31692], [139.86312, 73.36983], [140.81171, 73.76506], [142.06207, 73.85758], [143.48283, 73.47525], [143.60385, 73.21244]]], [[[150.73167, 75.08406], [149.575925, 74.68892], [147.977465, 74.778355], [146.11919, 75.17298], [146.358485, 75.49682], [148.22223, 75.345845], [150.73167, 75.08406]]], [[[145.086285, 75.562625], [144.3, 74.82], [140.61381, 74.84768], [138.95544, 74.61148], [136.97439, 75.26167], [137.51176, 75.94917], [138.831075, 76.13676], [141.471615, 76.09289], [145.086285, 75.562625]]], [[[57.535692579992386, 70.720463975702145], [56.944979282463933, 70.63274323188665], [53.677375115784187, 70.762657782668455], [53.412016635965372, 71.206661688920192], [51.601894565645708, 71.474759019650477], [51.455753615124209, 72.014881089965129], [52.478275180883564, 72.229441636840946], [52.444168735570841, 72.77473135038484], [54.427613559797649, 73.627547512497571], [53.508289829325136, 73.749813951300141], [55.902458937407644, 74.627486477345329], [55.631932814359701, 75.081412258597155], [57.868643833248839, 75.609390367323186], [61.170044386647497, 76.251883450008123], [64.498368361270209, 76.439055487769267], [66.210977003855092, 76.809782213031227], [68.157059767534818, 76.939696763812904], [68.852211134725124, 76.544811306454605], [68.180572544227644, 76.233641669409096], [64.637326287703004, 75.737754625136219], [61.583507521414752, 75.260884507946784], [58.477082147053366, 74.309056301562819], [56.986785516187993, 73.333043524866227], [55.41933597191094, 72.371267605265956], [55.622837762276291, 71.540594794390316], [57.535692579992386, 70.720463975702145]]], [[[106.970130000000111, 76.97419], [107.240000000000123, 76.48], [108.1538, 76.723350000000138], [111.077260000000138, 76.71], [113.33151, 76.22224], [114.13417, 75.84764], [113.88539, 75.327790000000121], [112.77918, 75.03186], [110.151250000000175, 74.47673], [109.4, 74.18], [110.64, 74.04], [112.11919, 73.787740000000113], [113.019540000000234, 73.976930000000138], [113.529580000000294, 73.33505], [113.96881, 73.59488], [115.56782, 73.75285], [118.776330000000215, 73.58772], [119.02, 73.12], [123.20066, 72.97122], [123.257770000000178, 73.73503], [125.380000000000166, 73.56], [126.97644, 73.56549], [128.59126, 73.03871], [129.05157, 72.39872], [128.46, 71.98], [129.715990000000204, 71.19304], [131.288580000000252, 70.786990000000102], [132.253500000000145, 71.8363], [133.857660000000294, 71.386420000000143], [135.56193, 71.655250000000123], [137.49755, 71.34763], [138.234090000000123, 71.62803], [139.86983, 71.487830000000116], [139.14791, 72.4161900000001], [140.46817, 72.849410000000134], [149.5, 72.2], [150.35118000000017, 71.60643], [152.96890000000019, 70.84222], [157.00688, 71.03141], [158.99779, 70.86672], [159.830310000000225, 70.45324], [159.70866, 69.72198], [160.94053000000028, 69.43728], [162.279070000000104, 69.64204], [164.05248, 69.66823], [165.940370000000172, 69.47199], [167.83567, 69.58269], [169.57763000000017, 68.6938], [170.816880000000253, 69.01363], [170.008200000000159, 69.65276], [170.453450000000259, 70.09703], [173.643910000000204, 69.81743], [175.72403000000017, 69.877250000000217], [178.6, 69.4], [180.000000000000114, 68.963636363636553], [180.000000000000114, 64.979708702198465], [179.99281, 64.97433], [178.707200000000199, 64.53493], [177.411280000000147, 64.60821], [178.313000000000187, 64.07593], [178.90825000000018, 63.251970000000128], [179.37034, 62.98262], [179.48636, 62.56894], [179.228250000000116, 62.304100000000133], [177.3643, 62.5219], [174.569290000000194, 61.76915], [173.68013, 61.65261], [172.15, 60.95], [170.6985, 60.33618], [170.330850000000282, 59.88177], [168.90046, 60.57355], [166.294980000000265, 59.7885500000002], [165.840000000000202, 60.16], [164.87674, 59.7316], [163.539290000000108, 59.86871], [163.217110000000218, 59.21101], [162.01733, 58.24328], [162.05297, 57.83912], [163.19191, 57.61503], [163.057940000000144, 56.159240000000111], [162.129580000000203, 56.12219], [161.70146, 55.285680000000148], [162.117490000000117, 54.85514], [160.368770000000325, 54.34433], [160.021730000000218, 53.20257], [158.530940000000157, 52.958680000000236], [158.23118, 51.94269], [156.789790000000266, 51.01105], [156.42000000000013, 51.7], [155.99182, 53.15895], [155.43366, 55.381030000000109], [155.914420000000291, 56.767920000000132], [156.75815, 57.3647], [156.81035, 57.83204], [158.364330000000166, 58.05575], [160.150640000000124, 59.314770000000109], [161.87204, 60.343000000000117], [163.66969, 61.1409], [164.473550000000103, 62.55061], [163.258420000000172, 62.46627], [162.65791, 61.6425], [160.12148, 60.54423], [159.30232, 61.77396], [156.72068, 61.43442], [154.218060000000293, 59.758180000000117], [155.04375, 59.14495], [152.81185, 58.88385], [151.265730000000246, 58.78089], [151.33815, 59.50396], [149.78371, 59.655730000000126], [148.54481, 59.16448], [145.48722, 59.33637], [142.197820000000121, 59.03998], [138.958480000000293, 57.08805], [135.12619, 54.72959], [136.70171, 54.603550000000112], [137.19342, 53.97732], [138.1647, 53.755010000000247], [138.80463, 54.25455], [139.90151, 54.189680000000166], [141.34531, 53.089570000000109], [141.37923, 52.23877], [140.59742000000017, 51.23967], [140.51308, 50.045530000000113], [140.061930000000189, 48.446710000000152], [138.554720000000202, 46.99965], [138.21971, 46.30795], [136.86232, 45.143500000000174], [135.515350000000183, 43.989], [134.869390000000237, 43.39821], [133.536870000000249, 42.81147], [132.90627, 42.79849], [132.278070000000241, 43.284560000000106], [130.935870000000136, 42.55274], [130.78, 42.220000000000191], [130.640000000000157, 42.395], [130.633866408409801, 42.903014634770543], [131.144687941614961, 42.929989732426932], [131.288555129115593, 44.111519680348252], [131.025190000000237, 44.96796], [131.883454217659562, 45.321161607436508], [133.097120000000189, 45.14409], [133.769643996313164, 46.116926988299149], [134.112350000000163, 47.212480000000127], [134.50081, 47.578450000000139], [135.026311476786759, 48.478229885443902], [133.373595819228001, 48.183441677434836], [132.506690000000106, 47.78896], [130.987260000000106, 47.79013], [130.582293328982644, 48.72968740497619], [129.397817824420486, 49.4406000840156], [127.657400000000351, 49.76027], [127.287455682484904, 50.739797268265434], [126.939156528837827, 51.353894151405896], [126.564399041856959, 51.784255479532689], [125.946348911646439, 52.792798570356936], [125.068211297710434, 53.161044826868924], [123.57147, 53.4588], [122.245747918793043, 53.431725979213681], [121.003084751470354, 53.251401068731226], [120.177088657716865, 52.753886216841195], [120.725789015791975, 52.516226304730893], [120.7382, 51.96411], [120.182080000000155, 51.64355], [119.27939, 50.58292], [119.288460728025839, 50.142882798861947], [117.87924441942647, 49.510983384797036], [116.67880089728618, 49.888531399121398], [115.485695428531415, 49.805177313834733], [114.962109816550353, 50.140247300815119], [114.362456496235325, 50.24830272073747], [112.897739699354361, 49.543565375356984], [111.581230910286649, 49.377968248077671], [110.662010532678835, 49.130128078805846], [109.402449171996707, 49.292960516957685], [108.475167270951275, 49.282547715850704], [107.868175897251092, 49.793705145865871], [106.888804152455293, 50.274295966180276], [105.886591424586868, 50.40601919209216], [104.62158, 50.275320000000157], [103.676545444760336, 50.08996613219513], [102.25589, 50.510560000000105], [102.06521, 51.25991], [100.889480421962631, 51.516855780638409], [99.981732212323564, 51.63400625264395], [98.861490513100492, 52.047366034546698], [97.82573978067451, 51.010995184933236], [98.231761509191699, 50.422400621128716], [97.259760000000199, 49.72605], [95.814020000000156, 49.977460000000114], [94.815949334698757, 50.01343333597088], [94.147566359435601, 50.480536607457161], [93.10421, 50.49529], [92.234711541719676, 50.802170722041737], [90.713667433640765, 50.331811835321098], [88.805566847695573, 49.470520738312459], [87.751264276076824, 49.297197984405543], [87.359970330762692, 49.214980780629148], [86.829356723989648, 49.826674709668133], [85.541269972682485, 49.69285858824815], [85.115559523462082, 50.117302964877631], [84.416377394553038, 50.311399644565817], [83.935114780618903, 50.889245510453563], [83.383003778012451, 51.069182847693881], [81.945985548839943, 50.812195949906325], [80.568446893235446, 51.388336493528435], [80.035559523441705, 50.864750881547209], [77.80091556184432, 53.404414984747532], [76.525179477854749, 54.177003485727127], [76.891100294913443, 54.490524400441913], [74.384820000000119, 53.546850000000113], [73.425678745420512, 53.489810289109741], [73.50851606638436, 54.035616766976588], [72.224150018202195, 54.376655381886778], [71.180131056609468, 54.133285224008247], [70.86526655465515, 55.169733588270091], [69.068166945272893, 55.385250149143488], [68.169100376258896, 54.970391750704366], [65.66687, 54.601250000000149], [65.178533563095939, 54.354227810272064], [61.436600000000126, 54.00625], [60.978066440683236, 53.664993394579128], [61.69998619980062, 52.979996446334255], [60.73999311711453, 52.719986477257734], [60.927268507740237, 52.447548326214999], [59.967533807215567, 51.96042043721566], [61.588003371024136, 51.272658799843171], [61.337424350840998, 50.799070136104248], [59.932807244715555, 50.842194118851822], [59.642282342370564, 50.545442206415707], [58.363320000000122, 51.06364], [56.77798, 51.04355], [55.71694, 50.621710000000142], [54.532878452376181, 51.026239732459359], [52.328723585831042, 51.718652248738088], [50.766648390512174, 51.692762356159861], [48.702381626181044, 50.605128485712825], [48.577841424357601, 49.87475962991563], [47.549480421749379, 50.454698391311119], [46.751596307162764, 49.356005764353725], [47.043671502476585, 49.152038886097571], [46.466445753776291, 48.394152330104923], [47.315240000000152, 47.71585], [48.05725, 47.74377], [48.694733514201872, 47.075628160177885], [48.59325000000014, 46.56104], [49.101160000000121, 46.39933], [48.645410000000105, 45.80629], [47.67591, 45.641490000000111], [46.68201, 44.6092], [47.59094, 43.660160000000118], [47.49252, 42.98658], [48.58437000000017, 41.80888], [47.987283156126033, 41.405819200194387], [47.815665724484653, 41.151416124021338], [47.373315464066387, 41.219732367511135], [46.686070591016708, 41.827137152669899], [46.404950799348924, 41.860675157227426], [45.7764, 42.092440000000224], [45.470279168485909, 42.502780666670041], [44.537622918482057, 42.711992702803677], [43.93121, 42.554960000000101], [43.755990000000182, 42.74083], [42.394400000000154, 43.2203], [40.922190000000128, 43.382150000000131], [40.076964959479838, 43.553104153002486], [39.95500857927108, 43.434997666999287], [38.68, 44.28], [37.539120000000104, 44.65721], [36.675460000000122, 45.24469], [37.40317, 45.40451], [38.23295, 46.24087], [37.67372, 46.63657], [39.14767, 47.044750000000128], [39.121200000000123, 47.26336], [38.22353803889947, 47.102189846375971], [38.2551123390298, 47.546400458356956], [38.77057, 47.825620000000228], [39.738277622238982, 47.898937079452068], [39.895620000000136, 48.23241], [39.67465, 48.783820000000127], [40.080789015469477, 49.307429917999364], [40.069040000000108, 49.60105], [38.594988234213552, 49.926461900423718], [38.010631137857068, 49.915661526074715], [37.393459506995228, 50.383953355503664], [36.626167840325387, 50.225590928745127], [35.35611616388811, 50.577197374059139], [35.37791, 50.77394], [35.02218305841793, 51.207572333371495], [34.224815708154402, 51.255993150428921], [34.141978387190612, 51.56641347920619], [34.391730584457228, 51.768881740925892], [33.75269982273587, 52.335074571331646], [32.715760532367163, 52.238465481162159], [32.412058139787767, 52.288694973349763], [32.15944000000021, 52.061250000000101], [31.78597, 52.10168], [31.540018344862254, 52.742052313846429], [31.305200636527978, 53.073995876673301], [31.49764, 53.167430000000124], [32.304519484188368, 53.132726141972839], [32.693643019346119, 53.351420803432141], [32.405598585751157, 53.618045355842], [31.731272820774585, 53.794029446012011], [31.791424187962399, 53.974638576872181], [31.384472283663818, 54.157056382862365], [30.757533807098774, 54.811770941784388], [30.971835971813245, 55.08154775656412], [30.873909132620064, 55.55097646750351], [29.896294386522435, 55.789463202530484], [29.371571893030783, 55.670090643936263], [29.229513380660389, 55.918344224666399], [28.176709425577933, 56.169129950578778], [27.855282016722519, 56.759326483784363], [27.770015903440985, 57.244258124411189], [27.288184848751648, 57.474528306703903], [27.716685825315771, 57.791899115624439], [27.420150000000202, 58.724570000000128], [28.131699253051856, 59.300825100330982], [27.98112, 59.47537], [29.1177, 60.028050000000107], [28.07, 60.503520000000137], [30.211107212044645, 61.780027777749673], [31.139991082491029, 62.357692776124431], [31.516092156711263, 62.867687486412898], [30.035872430142796, 63.552813625738551], [30.444684686003736, 64.204453436939062], [29.544429559047014, 64.948671576590542], [30.21765, 65.80598], [29.054588657352376, 66.944286200622017], [29.977426385220689, 67.69829702419274], [28.445943637818765, 68.364612942163987], [28.591929559043358, 69.064776923286686], [29.39955, 69.15692000000017], [31.101080000000103, 69.55811], [32.132720000000255, 69.905950000000232], [33.77547, 69.301420000000107], [36.51396, 69.06342], [40.292340000000159, 67.9324], [41.059870000000124, 67.457130000000106], [41.125950000000174, 66.79158000000011], [40.01583, 66.266180000000119], [38.38295, 65.99953], [33.918710000000168, 66.75961], [33.18444, 66.63253], [34.81477, 65.900150000000124], [34.87857425307876, 65.436212877048192], [34.943910000000152, 64.414370000000147], [36.23129, 64.10945], [37.012730000000111, 63.84983], [37.141970000000143, 64.33471], [36.539579035089801, 64.76446], [37.176040000000135, 65.143220000000113], [39.59345, 64.520790000000162], [40.4356, 64.76446], [39.762600000000148, 65.49682], [42.09309, 66.47623], [43.01604000000011, 66.41858], [43.94975000000013, 66.06908], [44.53226, 66.756340000000122], [43.69839, 67.35245], [44.187950000000136, 67.95051], [43.45282, 68.57079], [46.250000000000135, 68.25], [46.821340000000156, 67.68997], [45.55517, 67.56652], [45.56202, 67.010050000000192], [46.349150000000137, 66.66767], [47.894160000000248, 66.884550000000146], [48.13876, 67.52238], [50.227660000000142, 67.998670000000132], [53.717430000000164, 68.85738], [54.47171, 68.80815], [53.485820000000118, 68.20131], [54.72628, 68.09702], [55.442680000000124, 68.43866], [57.317020000000149, 68.46628], [58.802000000000206, 68.88082], [59.941420000000178, 68.27844], [61.077840000000165, 68.94069], [60.03, 69.52], [60.55, 69.85], [63.504000000000147, 69.54739], [64.888115, 69.234835000000132], [68.512160000000108, 68.09233000000016], [69.18068, 68.61563000000011], [68.16444, 69.14436], [68.13522, 69.35649], [66.930080000000103, 69.454610000000102], [67.25976, 69.92873], [66.724920000000125, 70.708890000000125], [66.69466, 71.028970000000228], [68.540060000000111, 71.934500000000227], [69.19636, 72.843360000000146], [69.94, 73.04000000000012], [72.58754, 72.77629], [72.79603, 72.22006], [71.84811, 71.40898], [72.47011, 71.09019], [72.79188, 70.39114], [72.564700000000201, 69.02085], [73.66787, 68.4079], [73.2387, 67.7404], [71.280000000000101, 66.320000000000149], [72.423010000000147, 66.172670000000167], [72.82077, 66.53267], [73.920990000000131, 66.789460000000119], [74.186510000000183, 67.28429], [75.052, 67.760470000000154], [74.469260000000148, 68.32899], [74.93584, 68.98918], [73.84236, 69.07146], [73.601870000000204, 69.62763], [74.3998, 70.63175], [73.1011, 71.447170000000241], [74.890820000000204, 72.12119], [74.65926, 72.83227], [75.158010000000175, 72.854970000000108], [75.68351, 72.300560000000118], [75.288980000000109, 71.33556], [76.35911, 71.152870000000135], [75.903130000000161, 71.87401], [77.5766500000001, 72.26717], [79.652020000000107, 72.32011], [81.5, 71.75], [80.61071, 72.582850000000107], [80.51109, 73.6482], [82.25, 73.85], [84.65526, 73.805910000000154], [86.822300000000226, 73.93688], [86.00956, 74.459670000000145], [87.166820000000143, 75.11643], [88.31571, 75.14393], [90.26, 75.64], [92.90058, 75.77333], [93.234210000000132, 76.0472], [95.860000000000127, 76.14], [96.67821, 75.91548], [98.922540000000197, 76.44689], [100.759670000000199, 76.43028], [101.03532, 76.86189], [101.990840000000105, 77.287540000000192], [104.3516, 77.69792], [106.066640000000135, 77.37389], [104.705000000000211, 77.1274], [106.970130000000111, 76.97419]]], [[[105.07547, 78.30689], [99.43814, 77.921], [101.2649, 79.23399], [102.08635, 79.34641], [102.837815, 79.28129], [105.37243, 78.71334], [105.07547, 78.30689]]], [[[51.136186557831266, 80.54728017854093], [49.793684523320692, 80.415427761548202], [48.894411248577526, 80.33956675894369], [48.75493655782175, 80.175468248200829], [47.586119012244147, 80.010181179515328], [46.502825962109647, 80.247246812654339], [47.072455275262897, 80.559424140129451], [44.846958042181107, 80.589809882317169], [46.799138624871226, 80.771917629713627], [48.31847741068465, 80.784009914869927], [48.52280602396668, 80.514568996900138], [49.097189568890897, 80.753985907708412], [50.039767693894603, 80.918885403151791], [51.522932977103679, 80.699725653801906], [51.136186557831266, 80.54728017854093]]], [[[99.93976, 78.88094], [97.75794, 78.7562], [94.97259, 79.044745], [93.31288, 79.4265], [92.5454, 80.14379], [91.18107, 80.34146], [93.77766, 81.0246], [95.940895, 81.2504], [97.88385, 80.746975], [100.186655, 79.780135], [99.93976, 78.88094]]]] } }, + { "type": "Feature", "properties": { "admin": "Rwanda", "name": "Rwanda", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[30.419104852019235, -1.134659112150416], [30.816134881317705, -1.698914076345388], [30.758308953583104, -2.287250257988368], [30.469696079232978, -2.413857517103458], [29.938359002407935, -2.348486830254238], [29.632176141078585, -2.917857761246096], [29.02492638521678, -2.839257907730157], [29.117478875451546, -2.292211195488384], [29.254834832483336, -2.215109958508911], [29.29188683443661, -1.620055840667987], [29.579466180140876, -1.341313164885626], [29.821518588996003, -1.443322442229785], [30.419104852019235, -1.134659112150416]]] } }, + { "type": "Feature", "properties": { "admin": "Western Sahara", "name": "W. Sahara", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-8.794883999049075, 27.120696316022503], [-8.81782833498667, 27.656425889592349], [-8.665589565454805, 27.656425889592349], [-8.66512447756419, 27.58947907155822], [-8.684399786809051, 27.395744126895998], [-8.687293667017398, 25.881056219988899], [-11.969418911171159, 25.933352769468261], [-11.93722449385332, 23.374594224536164], [-12.874221564169574, 23.284832261645171], [-13.118754441774708, 22.771220201096249], [-12.929101935263528, 21.327070624267559], [-16.845193650773989, 21.333323472574875], [-17.063423224342568, 20.99975210213082], [-17.020428432675736, 21.422310288981475], [-17.002961798561085, 21.420734157796574], [-14.750954555713532, 21.50060008390366], [-14.630832688851068, 21.860939846274899], [-14.221167771857251, 22.310163072188153], [-13.891110398809044, 23.691009019459297], [-12.500962693725368, 24.770116278578193], [-12.030758836301613, 26.030866197203036], [-11.718219773800353, 26.104091701760616], [-11.392554897496977, 26.883423977154358], [-10.551262579785272, 26.990807603456879], [-10.18942420087758, 26.860944729107398], [-9.735343390328877, 26.860944729107398], [-9.413037482124464, 27.088476060488514], [-8.794883999049075, 27.120696316022503]]] } }, + { "type": "Feature", "properties": { "admin": "Saudi Arabia", "name": "Saudi Arabia", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[42.779332309750963, 16.34789134364868], [42.64957278826607, 16.77463532151496], [42.347989129410706, 17.075805568911996], [42.270887892431219, 17.474721787989122], [41.754381951673949, 17.833046169500971], [41.221391229015573, 18.671599636301206], [40.939341261566533, 19.486485297111752], [40.247652215339819, 20.174634507726488], [39.801684604660934, 20.338862209550054], [39.139399448408277, 21.29190481209293], [39.023695916506782, 21.986875311770191], [39.066328973147577, 22.579655666590263], [38.492772251140075, 23.688451036060851], [38.023860304523616, 24.078685614512928], [37.483634881344379, 24.285494696545008], [37.154817742671177, 24.858482977797301], [37.209491408035994, 25.084541530858104], [36.931627231602583, 25.602959499610172], [36.639603712721218, 25.826227525327219], [36.249136590323808, 26.570135606384873], [35.640181512196385, 27.376520494083415], [35.130186801907875, 28.063351955674712], [34.632336053207972, 28.058546047471559], [34.787778761541936, 28.607427273059692], [34.832220493312938, 28.957483425404838], [34.956037225084252, 29.356554673778835], [36.068940870922049, 29.19749461518445], [36.501214227043583, 29.505253607698702], [36.740527784987243, 29.865283311476183], [37.503581984209028, 30.003776150018396], [37.668119744626374, 30.338665269485894], [37.998848911294367, 30.508499864213128], [37.002165561681004, 31.508412990844736], [39.004885695152545, 32.010216986614971], [39.195468377444961, 32.16100881604266], [40.399994337736238, 31.889991766887931], [41.889980910007829, 31.190008653278362], [44.709498732284736, 29.178891099559376], [46.568713413281742, 29.099025173452283], [47.459821811722819, 29.002519436147217], [47.708850538937376, 28.526062730416136], [48.416094191283939, 28.552004299426663], [48.807594842327163, 27.689627997339876], [49.299554477745815, 27.461218166609804], [49.470913527225647, 27.109999294538078], [50.152422316290874, 26.689663194275994], [50.212935418504671, 26.277026882425371], [50.113303257045928, 25.943972276304248], [50.23985883972874, 25.608049628190923], [50.527386509000728, 25.327808335872099], [50.660556675016885, 24.999895534764018], [50.810108270069563, 24.754742539971371], [51.112415398977006, 24.556330878186721], [51.389607781790623, 24.627385972588051], [51.579518670463258, 24.245497137951102], [51.617707553926969, 24.014219265228824], [52.000733270074321, 23.001154486578937], [55.006803012924898, 22.496947536707129], [55.208341098863187, 22.708329982997039], [55.666659376859812, 22.000001125572336], [54.999981723862355, 19.999994004796104], [52.000009800022227, 19.000003363516054], [49.116671583864857, 18.616667588774941], [48.183343540241324, 18.166669216377311], [47.466694777217626, 17.116681626854877], [47.000004917189749, 16.949999294497438], [46.749994337761642, 17.283338120996174], [46.366658563020529, 17.233315334537632], [45.399999220568752, 17.333335069238554], [45.216651238797184, 17.43332896572333], [44.062613152855072, 17.410358791569589], [43.791518589051904, 17.319976711491105], [43.380794305196098, 17.579986680567668], [43.115797560403351, 17.088440456607369], [43.218375278502734, 16.666889960186406], [42.779332309750963, 16.34789134364868]]] } }, + { "type": "Feature", "properties": { "admin": "Sudan", "name": "Sudan", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.963392794971178, 9.464285229420623], [33.824963480907506, 9.48406084571536], [33.842130853028145, 9.981914637215992], [33.721959248183097, 10.325262079630191], [33.206938084561777, 10.720111638406591], [33.086766479716729, 11.441141267476493], [33.206938084561777, 12.179338268667093], [32.743419037302537, 12.24800775714999], [32.674749548819641, 12.024831919580716], [32.073891524594778, 11.973329803218517], [32.314234734284746, 11.681484477166519], [32.400071594888338, 11.080626452941486], [31.850715687025509, 10.531270545078822], [31.352861895524875, 9.810240916008693], [30.837840731903377, 9.707236683284519], [29.996639497988546, 10.290927335388684], [29.618957311332842, 10.084918869940223], [29.515953078608607, 9.793073543888053], [29.000931914987166, 9.604232450560287], [28.966597170745779, 9.398223985111654], [27.970889587744345, 9.398223985111654], [27.833550610778783, 9.604232450560287], [27.112520981708876, 9.638567194801622], [26.752006167173811, 9.466893473594492], [26.477328213242508, 9.552730334198086], [25.96230704962101, 10.136420986302422], [25.790633328413943, 10.411098940233726], [25.069603699343979, 10.27375996326799], [24.79492574541268, 9.810240916008693], [24.537415163602017, 8.917537565731719], [24.194067721187643, 8.728696472403895], [23.886979580860665, 8.619729712933063], [23.805813429466745, 8.666318874542522], [23.459012892355979, 8.954285793489019], [23.394779087017291, 9.26506785729225], [23.557249790142915, 9.681218166538766], [23.554304233502187, 10.089255275915319], [22.977543572692749, 10.714462591998538], [22.864165480244246, 11.142395127807616], [22.87622, 11.384610000000119], [22.50869, 11.67936], [22.49762, 12.26024], [22.28801, 12.64605], [21.93681, 12.588180000000133], [22.03759, 12.95546], [22.29658, 13.37232], [22.18329, 13.78648], [22.51202, 14.09318], [22.30351, 14.32682], [22.567950000000106, 14.944290000000134], [23.02459, 15.68072], [23.886890000000101, 15.61084], [23.837660000000135, 19.580470000000101], [23.850000000000129, 20.0], [25.00000000000011, 20.00304], [25.00000000000011, 22.0], [29.02, 22.0], [32.9, 22.0], [36.86623, 22.0], [37.18872, 21.01885], [36.96941, 20.837440000000125], [37.114700000000134, 19.80796], [37.48179, 18.61409], [37.86276, 18.36786], [38.410089959473218, 17.998307399970312], [37.904000000000103, 17.42754], [37.16747, 17.263140000000128], [36.852530000000108, 16.95655], [36.75389, 16.29186], [36.32322, 14.82249], [36.42951, 14.42211], [36.27022, 13.563330000000118], [35.86363, 12.57828], [35.26049, 12.08286], [34.831630000000125, 11.318960000000116], [34.73115000000012, 10.910170000000106], [34.25745, 10.63009], [33.96162, 9.58358], [33.963392794971178, 9.464285229420623]]] } }, + { "type": "Feature", "properties": { "admin": "South Sudan", "name": "S. Sudan", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.963392794971178, 9.464285229420623], [33.97498, 8.68456], [33.82550000000014, 8.37916], [33.294800000000116, 8.35458], [32.95418, 7.7849700000001], [33.56829, 7.71334], [34.0751, 7.22595], [34.25032, 6.82607], [34.70702, 6.59422000000012], [35.298007118233095, 5.506], [34.620196267853935, 4.847122742082034], [34.005, 4.249884947362147], [33.39, 3.79], [32.68642, 3.79232], [31.881450000000136, 3.55827], [31.24556, 3.7819], [30.83385, 3.50917], [29.95349, 4.1737], [29.715995314256013, 4.600804755060152], [29.159078403446635, 4.389267279473244], [28.696677687298795, 4.455077215996993], [28.428993768026992, 4.287154649264607], [27.979977247842946, 4.408413397637388], [27.374226108517625, 5.233944403500173], [27.213409051225248, 5.550953477394613], [26.465909458123289, 5.946717434101855], [26.213418409945113, 6.546603298362127], [25.796647983511257, 6.979315904158169], [25.124130893664805, 7.500085150579422], [25.114932488716867, 7.825104071479244], [24.567369012152191, 8.229187933785452], [23.886979580860665, 8.619729712933063], [24.194067721187643, 8.728696472403895], [24.537415163602017, 8.917537565731719], [24.79492574541268, 9.810240916008693], [25.069603699343979, 10.27375996326799], [25.790633328413943, 10.411098940233726], [25.96230704962101, 10.136420986302422], [26.477328213242508, 9.552730334198086], [26.752006167173811, 9.466893473594492], [27.112520981708876, 9.638567194801622], [27.833550610778783, 9.604232450560287], [27.970889587744345, 9.398223985111654], [28.966597170745779, 9.398223985111654], [29.000931914987166, 9.604232450560287], [29.515953078608607, 9.793073543888053], [29.618957311332842, 10.084918869940223], [29.996639497988546, 10.290927335388684], [30.837840731903377, 9.707236683284519], [31.352861895524875, 9.810240916008693], [31.850715687025509, 10.531270545078822], [32.400071594888338, 11.080626452941486], [32.314234734284746, 11.681484477166519], [32.073891524594778, 11.973329803218517], [32.674749548819641, 12.024831919580716], [32.743419037302537, 12.24800775714999], [33.206938084561777, 12.179338268667093], [33.086766479716729, 11.441141267476493], [33.206938084561777, 10.720111638406591], [33.721959248183097, 10.325262079630191], [33.842130853028145, 9.981914637215992], [33.824963480907506, 9.48406084571536], [33.963392794971178, 9.464285229420623]]] } }, + { "type": "Feature", "properties": { "admin": "Senegal", "name": "Senegal", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-16.713728807023468, 13.594958604379853], [-17.126106736712611, 14.373515733289221], [-17.625042690490655, 14.72954051356407], [-17.185172898822227, 14.91947724045286], [-16.700706346085919, 15.621527411354107], [-16.463098110407881, 16.135036119038457], [-16.120690070041928, 16.45566254319338], [-15.623666144258689, 16.369337063049809], [-15.135737270558813, 16.587282416240779], [-14.577347581428977, 16.598263658102805], [-14.099521450242175, 16.304302273010489], [-13.43573767745306, 16.039383042866188], [-12.830658331747513, 15.303691514542942], [-12.170750291380299, 14.616834214735503], [-12.124887457721256, 13.994727484589784], [-11.927716030311613, 13.422075100147392], [-11.553397793005427, 13.141213690641063], [-11.467899135778522, 12.754518947800973], [-11.513942836950587, 12.442987575729415], [-11.658300950557928, 12.386582749882834], [-12.20356482588563, 12.465647691289401], [-12.278599005573438, 12.354440008997285], [-12.499050665730561, 12.332089952031053], [-13.217818162478235, 12.575873521367964], [-13.700476040084322, 12.586182969610192], [-15.548476935274005, 12.628170070847343], [-15.816574266004251, 12.515567124883345], [-16.147716844130581, 12.547761542201185], [-16.67745195155457, 12.38485158940105], [-16.84152462408127, 13.151393947802557], [-15.931295945692208, 13.130284125211331], [-15.691000535534991, 13.270353094938455], [-15.511812506562931, 13.278569647672864], [-15.141163295949463, 13.509511623585235], [-14.712197231494626, 13.298206691943774], [-14.277701788784553, 13.28058502853224], [-13.844963344772404, 13.505041612191999], [-14.046992356817478, 13.794067898000446], [-14.376713833055785, 13.625680243377371], [-14.687030808968483, 13.63035696049978], [-15.081735398813816, 13.876491807505982], [-15.398770310924457, 13.860368760630916], [-15.624596320039936, 13.623587347869556], [-16.713728807023468, 13.594958604379853]]] } }, + { "type": "Feature", "properties": { "admin": "Solomon Islands", "name": "Solomon Is.", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[162.119024693040842, -10.482719008021133], [162.398645868172196, -10.826367282762119], [161.700032180018354, -10.820011081590222], [161.319796991214702, -10.204751478723123], [161.917383254237933, -10.446700534713653], [162.119024693040842, -10.482719008021133]]], [[[160.852228631837903, -9.872937106977002], [160.462588332357228, -9.89520964929484], [159.849447463214176, -9.794027194867367], [159.640002883135139, -9.639979750205269], [159.70294477766663, -9.242949720906777], [160.362956170898428, -9.400304457235533], [160.688517694337179, -9.610162448772808], [160.852228631837903, -9.872937106977002]]], [[[161.679981724289121, -9.599982191611373], [161.52939660059053, -9.784312025596433], [160.788253208660507, -8.917543226764918], [160.579997186524338, -8.320008640173965], [160.92002811100491, -8.320008640173965], [161.280006138349961, -9.120011488484449], [161.679981724289121, -9.599982191611373]]], [[[159.875027297198585, -8.337320244991714], [159.917401971677975, -8.538289890174864], [159.133677199539335, -8.114181410355398], [158.586113722974687, -7.754823500197713], [158.211149530264834, -7.421872246941147], [158.359977655265425, -7.320017998893915], [158.820001255527671, -7.56000335045739], [159.640002883135139, -8.020026950719567], [159.875027297198585, -8.337320244991714]]], [[[157.53842573468927, -7.347819919466928], [157.339419793933217, -7.404767347852554], [156.902030471014768, -7.176874281445391], [156.491357863591304, -6.765943291860394], [156.542827590153934, -6.599338474151478], [157.140000441718882, -7.021638278840653], [157.53842573468927, -7.347819919466928]]]] } }, + { "type": "Feature", "properties": { "admin": "Sierra Leone", "name": "Sierra Leone", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[-11.438779466182053, 6.785916856305746], [-11.708194545935736, 6.860098374860724], [-12.428098924193815, 7.262942002792029], [-12.949049038128193, 7.798645738145736], [-13.124025437868479, 8.163946438016977], [-13.246550258832512, 8.903048610871506], [-12.711957566773076, 9.342711696810765], [-12.596719122762206, 9.620188300001969], [-12.425928514037562, 9.835834051955953], [-12.150338100625003, 9.858571682164378], [-11.917277390988655, 10.046983954300556], [-11.117481248407328, 10.045872911006283], [-10.839151984083299, 9.688246161330367], [-10.622395188835037, 9.267910061068276], [-10.65477047366589, 8.977178452994194], [-10.494315151399629, 8.715540676300433], [-10.505477260774667, 8.348896389189603], [-10.230093553091276, 8.406205552601291], [-10.695594855176477, 7.939464016141085], [-11.14670427086838, 7.396706447779534], [-11.199801805048278, 7.105845648624735], [-11.438779466182053, 6.785916856305746]]] } }, + { "type": "Feature", "properties": { "admin": "El Salvador", "name": "El Salvador", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-87.793111131526558, 13.384480495655051], [-87.904112108089507, 13.149016831917134], [-88.483301561216791, 13.163951320849488], [-88.843227912129692, 13.259733588102474], [-89.256742723329282, 13.4585328231293], [-89.812393561547637, 13.520622056527994], [-90.095554572290951, 13.73533763270073], [-90.064677903996568, 13.881969509328924], [-89.7219339668207, 14.134228013561694], [-89.5342193265205, 14.244815578666302], [-89.587342698916544, 14.362586167859485], [-89.353325975282772, 14.424132798719112], [-89.058511929057644, 14.340029405164085], [-88.843072882832814, 14.140506700085169], [-88.541230841815974, 13.980154730683475], [-88.50399797234968, 13.845485948130854], [-88.065342576840123, 13.964625962779774], [-87.859515347021585, 13.893312486216979], [-87.723502977229387, 13.785050360565503], [-87.793111131526558, 13.384480495655051]]] } }, + { "type": "Feature", "properties": { "admin": "Somaliland", "name": "Somaliland", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[48.938129510296491, 9.451748968946672], [48.486735874226994, 8.837626247589979], [47.78942, 8.003], [46.948328484897942, 7.996876532417386], [43.67875, 9.183580000000116], [43.296975132018744, 9.540477403191742], [42.92812, 10.021940000000139], [42.55876, 10.572580000000126], [42.776851841000948, 10.926878566934416], [43.145304803242126, 11.462039699748853], [43.470659620951658, 11.27770986576388], [43.666668328634834, 10.864169216348158], [44.117803582542805, 10.445538438351603], [44.614259067570849, 10.442205308468941], [45.556940545439133, 10.698029486529775], [46.645401238802997, 10.816549383991171], [47.525657586462778, 11.127228094929986], [48.021596307167769, 11.193063869669741], [48.378783807169263, 11.375481675660122], [48.948206414593457, 11.410621649618516], [48.942005242718423, 11.394266058798163], [48.938491245322595, 10.982327378783451], [48.938232863161076, 9.973500067581481], [48.938129510296491, 9.451748968946672]]] } }, + { "type": "Feature", "properties": { "admin": "Somalia", "name": "Somalia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[49.72862, 11.5789], [50.25878, 11.67957], [50.73202, 12.0219], [51.1112, 12.02464], [51.13387, 11.74815], [51.04153, 11.16651], [51.04531, 10.6409], [50.83418, 10.27972], [50.55239, 9.19874], [50.07092, 8.08173], [49.4527, 6.80466], [48.59455, 5.33911], [47.74079, 4.2194], [46.56476, 2.85529], [45.56399, 2.04576], [44.06815, 1.05283], [43.13597, 0.2922], [42.04157, -0.91916], [41.81095, -1.44647], [41.58513, -1.68325], [40.993, -0.85829], [40.98105, 2.78452], [41.855083092643966, 3.918911920483726], [42.12861, 4.23413], [42.76967, 4.25259], [43.66087, 4.95755], [44.9636, 5.00162], [47.78942, 8.003], [48.486735874226937, 8.837626247589993], [48.938129510296442, 9.451748968946616], [48.938232863161026, 9.973500067581508], [48.938491245322481, 10.982327378783465], [48.942005242718345, 11.394266058798136], [48.948204758509732, 11.410617281697961], [49.26776, 11.43033], [49.72862, 11.5789]]] } }, + { "type": "Feature", "properties": { "admin": "Republic of Serbia", "name": "Serbia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[20.874312778413408, 45.416375433934306], [21.483526238702204, 45.181170152357865], [21.562022739353718, 44.768947251965635], [22.145087924902892, 44.478422349620573], [22.459022251075961, 44.702517198254426], [22.705725538837434, 44.578002834647002], [22.47400841644065, 44.409227606781762], [22.657149692483067, 44.234923000661347], [22.410446404721593, 44.008063462900047], [22.500156691180219, 43.642814439460999], [22.986018507588479, 43.211161200527094], [22.604801466571352, 42.898518785161109], [22.43659467946139, 42.580321153323943], [22.545011834409642, 42.461362006188025], [22.380525750424674, 42.320259507815074], [21.917080000000105, 42.30364], [21.576635989402117, 42.245224397061847], [21.54332, 42.32025], [21.66292, 42.43922], [21.77505, 42.6827], [21.63302, 42.67717], [21.43866, 42.86255], [21.27421, 42.90959], [21.143395, 43.068685000000123], [20.95651, 43.13094], [20.81448, 43.27205], [20.63508, 43.21671], [20.49679, 42.88469], [20.25758, 42.81275], [20.3398, 42.89852], [19.95857, 43.10604], [19.63, 43.213779970270522], [19.48389, 43.35229], [19.21852, 43.52384], [19.454, 43.568100000000115], [19.59976, 44.03847], [19.11761, 44.42307], [19.36803, 44.863], [19.00548, 44.86023], [19.390475701584588, 45.236515611342369], [19.072768995854172, 45.521511135432078], [18.82982, 45.90888], [19.596044549241636, 46.171729844744547], [20.22019249846289, 46.127468980486569], [20.76217492033998, 45.734573065771478], [20.874312778413408, 45.416375433934306]]] } }, + { "type": "Feature", "properties": { "admin": "Suriname", "name": "Suriname", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.147436489476874, 5.973149929219161], [-55.949318406789786, 5.772877915872], [-55.841779751190408, 5.953125311706059], [-55.033250291551759, 6.025291449401662], [-53.958044603070888, 5.756548163267764], [-54.478632981979224, 4.896755682795585], [-54.3995422023565, 4.212611395683466], [-54.006930508018996, 3.620037746592558], [-54.181726040246261, 3.189779771330421], [-54.269705166223183, 2.732391669115046], [-54.524754197799709, 2.311848863123785], [-55.097587449755125, 2.523748073736612], [-55.569755011605984, 2.42150625244713], [-55.973322109589361, 2.510363877773016], [-56.073341844290283, 2.220794989425499], [-55.905600145070871, 2.021995754398659], [-55.995698004771739, 1.817667141116601], [-56.53938574891454, 1.89952260986692], [-57.150097825739898, 2.768926906745406], [-57.281433478409703, 3.333491929534119], [-57.601568976457848, 3.334654649260684], [-58.044694383360664, 4.060863552258382], [-57.860209520078691, 4.576801052260449], [-57.914288906472123, 4.812626451024413], [-57.307245856339492, 5.073566595882225], [-57.147436489476874, 5.973149929219161]]] } }, + { "type": "Feature", "properties": { "admin": "Slovakia", "name": "Slovakia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[18.85314415861361, 49.496229763377634], [18.909574822676316, 49.435845852244562], [19.320712517990469, 49.571574001659179], [19.825022820726865, 49.217125352569219], [20.415839471119849, 49.431453355499755], [20.887955356538406, 49.328772284535823], [21.607808058364206, 49.470107326854077], [22.558137648211751, 49.08573802346713], [22.280841912533553, 48.825392157580659], [22.085608351334848, 48.422264309271782], [21.872236362401729, 48.319970811550007], [20.801293979584919, 48.62385407164237], [20.473562045989862, 48.562850043321809], [20.239054396249344, 48.327567247096916], [19.769470656013109, 48.2026911484636], [19.66136355965849, 48.266614895208647], [19.174364861739885, 48.111378892603859], [18.777024773847668, 48.081768296900627], [18.696512892336923, 47.88095368101439], [17.857132602620023, 47.758428860050365], [17.488472934649813, 47.867466132186209], [16.979666782304033, 48.123497015976298], [16.879982944412998, 48.470013332709463], [16.960288120194573, 48.596982326850593], [17.101984897538895, 48.8169688991171], [17.545006951577101, 48.800019029325362], [17.886484816161808, 48.903475246773695], [17.913511590250462, 48.996492824899072], [18.104972771891848, 49.043983466175298], [18.170498488037961, 49.271514797556421], [18.399993523846174, 49.315000515330034], [18.554971144289478, 49.495015367218777], [18.85314415861361, 49.496229763377634]]] } }, + { "type": "Feature", "properties": { "admin": "Slovenia", "name": "Slovenia", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[13.806475457421524, 46.509306138691201], [14.632471551174827, 46.431817328469535], [15.137091912504982, 46.658702704447016], [16.011663852612653, 46.683610744811688], [16.202298211337361, 46.852385972676949], [16.370504998447412, 46.841327216166498], [16.564808383864854, 46.503750922219822], [15.768732944408548, 46.238108222023442], [15.671529575267552, 45.834153550797865], [15.323953891672403, 45.731782538427673], [15.327674594797424, 45.452316392593218], [14.935243767972931, 45.471695054702671], [14.595109490627804, 45.6349409043127], [14.411968214585411, 45.466165676447446], [13.715059848697221, 45.500323798192369], [13.937630242578305, 45.591015936864608], [13.698109978905475, 46.016778062517339], [13.806475457421524, 46.509306138691201]]] } }, + { "type": "Feature", "properties": { "admin": "Sweden", "name": "Sweden", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[22.183173455501922, 65.723740546320158], [21.213516879977213, 65.02600535751526], [21.369631381930954, 64.413587958424273], [19.778875766690216, 63.609554348395022], [17.847779168375208, 62.749400132896803], [17.11955488451812, 61.341165676510954], [17.831346062906388, 60.636583360427394], [18.787721795332086, 60.081914374422581], [17.869224887776337, 58.95376618105869], [16.829185011470084, 58.719826972073385], [16.44770958829147, 57.041118069071871], [15.87978559740378, 56.104301866268649], [14.666681349352071, 56.20088511822216], [14.100721062891461, 55.407781073622637], [12.942910597392054, 55.361737372450563], [12.625100538797025, 56.307080186581956], [11.787942335668671, 57.441817125063061], [11.027368605196866, 58.856149400459344], [11.468271925511145, 59.432393296946024], [12.300365838274896, 60.117932847730025], [12.631146681375181, 61.293571682370121], [11.992064243221559, 61.800362453856543], [11.930569288794228, 63.128317572676963], [12.57993533697393, 64.066218980558318], [13.571916131248711, 64.049114081469696], [13.9199052263022, 64.445420640716065], [13.555689731509087, 64.7870276963815], [15.108411492582999, 66.19386688909546], [16.108712192456775, 67.302455552836875], [16.768878614985478, 68.013936672631388], [17.729181756265344, 68.010551866316263], [17.993868442464329, 68.567391262477344], [19.878559604581248, 68.407194322372561], [20.025268995857882, 69.065138658312691], [20.645592889089521, 69.106247260200846], [21.978534783626113, 68.616845608180682], [23.539473097434435, 67.936008612735236], [23.565879754335576, 66.396050930437411], [23.903378533633795, 66.006927395279604], [22.183173455501922, 65.723740546320158]]] } }, + { "type": "Feature", "properties": { "admin": "Swaziland", "name": "Swaziland", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[32.071665480281062, -26.733820082304902], [31.868060337051073, -27.17792734142127], [31.282773064913325, -27.285879408478991], [30.685961948374477, -26.743845310169526], [30.676608514129633, -26.398078301704604], [30.949666782359905, -26.022649021104144], [31.044079624157146, -25.731452325139436], [31.333157586397899, -25.660190525008943], [31.837777947728057, -25.843331801051342], [31.985779249811962, -26.29177988048022], [32.071665480281062, -26.733820082304902]]] } }, + { "type": "Feature", "properties": { "admin": "Syria", "name": "Syria", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[38.792340529136077, 33.378686428352218], [36.834062127435537, 32.312937526980768], [35.719918247222743, 32.709192409794859], [35.700797967274745, 32.716013698857374], [35.836396925608618, 32.868123277308506], [35.821100701650231, 33.277426459276292], [36.066460402172048, 33.824912421192543], [36.611750115715886, 34.201788641897174], [36.448194207512095, 34.59393524834406], [35.998402540843628, 34.644914048799997], [35.905023227692219, 35.410009467097318], [36.149762811026527, 35.821534735653664], [36.417550083163029, 36.040616970355053], [36.685389031731795, 36.259699205056457], [36.739494256341395, 36.817520453431079], [37.066761102045824, 36.623036200500614], [38.167727492024191, 36.901210435527766], [38.699891391765895, 36.712927354472335], [39.522580193852541, 36.716053778625984], [40.673259311695681, 37.091276353497285], [41.212089471203043, 37.074352321921687], [42.349591098811764, 37.22987254490409], [41.837064243340954, 36.605853786763568], [41.289707472505448, 36.358814602192261], [41.383965285005807, 35.628316555314349], [41.00615888851992, 34.419372260062111], [38.792340529136077, 33.378686428352218]]] } }, + { "type": "Feature", "properties": { "admin": "Chad", "name": "Chad", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[14.495787387762899, 12.859396267137353], [14.595781284247604, 13.330426947477859], [13.954476759505607, 13.353448798063765], [13.956698846094124, 13.996691189016925], [13.540393507550785, 14.36713369390122], [13.97217, 15.68437], [15.247731154041842, 16.627305813050778], [15.300441114979716, 17.927949937405], [15.68574059414777, 19.957180080642384], [15.90324669766431, 20.387618923417499], [15.487148064850143, 20.730414537025634], [15.47106, 21.04845], [15.096887648181847, 21.308518785074902], [14.8513, 22.862950000000119], [15.86085, 23.40972], [19.84926, 21.49509], [23.837660000000135, 19.580470000000101], [23.886890000000101, 15.61084], [23.02459, 15.68072], [22.567950000000106, 14.944290000000134], [22.30351, 14.32682], [22.51202, 14.09318], [22.18329, 13.78648], [22.29658, 13.37232], [22.03759, 12.95546], [21.93681, 12.588180000000133], [22.28801, 12.64605], [22.49762, 12.26024], [22.50869, 11.67936], [22.87622, 11.384610000000119], [22.864165480244246, 11.142395127807616], [22.231129184668756, 10.971888739460608], [21.723821648859538, 10.567055568885959], [21.000868361096305, 9.475985215691479], [20.059685499764267, 9.012706000194838], [19.094008009526071, 9.074846910025768], [18.81200971850927, 8.982914536978623], [18.911021762780589, 8.630894680206435], [18.389554884523303, 8.281303615751879], [17.964929640380884, 7.890914008002992], [16.705988396886365, 7.508327541529978], [16.4561845231874, 7.734773667832938], [16.290561557691884, 7.754307359239417], [16.106231723706738, 7.497087917506461], [15.279460483469164, 7.42192454673801], [15.436091749745737, 7.692812404811887], [15.120865512765302, 8.382150173369437], [14.979995558337688, 8.796104234243442], [14.544466586981851, 8.965861314322238], [13.954218377344088, 9.549494940626685], [14.17146609869911, 10.021378282100043], [14.627200555081057, 9.920919297724591], [14.909353875394796, 9.992129421422758], [15.46787275560524, 9.982336737503543], [14.923564894275042, 10.891325181517514], [14.960151808337679, 11.555574042197234], [14.89336, 12.21905], [14.495787387762899, 12.859396267137353]]] } }, + { "type": "Feature", "properties": { "admin": "Togo", "name": "Togo", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[1.865240512712318, 6.14215770102973], [1.060121697604927, 5.928837388528875], [0.836931186536333, 6.279978745952147], [0.570384148774849, 6.914358628767188], [0.490957472342245, 7.411744289576474], [0.712029249686878, 8.312464504423827], [0.461191847342121, 8.677222601756013], [0.365900506195885, 9.46500397382948], [0.367579990245389, 10.191212876827176], [-0.049784715159944, 10.706917832883928], [0.023802524423701, 11.018681748900802], [0.899563022474069, 10.997339382364258], [0.772335646171484, 10.470808213742357], [1.077795037448737, 10.175606594275022], [1.425060662450136, 9.825395412632998], [1.46304284018467, 9.334624335157086], [1.664477573258381, 9.128590399609378], [1.618950636409238, 6.832038072126236], [1.865240512712318, 6.14215770102973]]] } }, + { "type": "Feature", "properties": { "admin": "Thailand", "name": "Thailand", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[102.58493248902667, 12.186594956913279], [101.687157830819928, 12.645740057826568], [100.831809523524839, 12.627084865769204], [100.978467238369191, 13.412721665902563], [100.097797479251099, 13.406856390837429], [100.018732537844528, 12.307001044153353], [99.478920526123602, 10.846366685423545], [99.153772414143134, 9.963061428258554], [99.222398716226749, 9.239255479362425], [99.873831821698118, 9.207862046745118], [100.279646844486194, 8.29515289960605], [100.45927412313273, 7.429572658717175], [101.017327915452697, 6.856868597842476], [101.623079054778032, 6.740622463401918], [102.141186964936367, 6.221636053894626], [101.81428185425797, 5.810808417174242], [101.154218784593837, 5.691384182147713], [101.075515578213327, 6.20486705161592], [100.259596388756933, 6.642824815289542], [100.085756870527092, 6.46448944745029], [99.690690545655727, 6.848212795433595], [99.519641554769606, 7.343453884302759], [98.988252801512289, 7.907993068875325], [98.503786248775967, 8.382305202666286], [98.339661899816988, 7.794511623562384], [98.150009393305808, 8.350007432483876], [98.259150018306229, 8.973922837759799], [98.553550653073017, 9.932959906448543], [99.038120558673953, 10.960545762572435], [99.587286004639694, 11.892762762901695], [99.196353794351637, 12.804748439988666], [99.212011753336071, 13.269293728076462], [99.097755161538728, 13.827502549693275], [98.430819126379859, 14.622027696180831], [98.192074009191373, 15.123702500870349], [98.537375929765687, 15.308497422746081], [98.90334842325673, 16.177824204976115], [98.493761020911322, 16.837835598207928], [97.859122755934848, 17.567946071843657], [97.375896437573516, 18.445437730375811], [97.797782830804394, 18.627080389881751], [98.253723992915582, 19.708203029860041], [98.959675734454848, 19.752980658440944], [99.543309360759281, 20.186597601802056], [100.115987583417819, 20.41784963630818], [100.548881056726856, 20.109237982661124], [100.606293573003128, 19.508344427971217], [101.282014601651667, 19.462584947176762], [101.035931431077742, 18.408928330961611], [101.059547560635139, 17.512497259994486], [102.113591750092453, 18.109101670804161], [102.413004998791592, 17.932781683824281], [102.998705682387694, 17.961694647691598], [103.200192091893726, 18.309632066312769], [103.956476678485288, 18.240954087796872], [104.716947056092465, 17.428858954330078], [104.779320509868768, 16.441864935771445], [105.589038527450128, 15.570316066952856], [105.544338413517664, 14.723933620660414], [105.218776890078871, 14.27321177821069], [104.281418084736586, 14.416743068901363], [102.988422072361601, 14.225721136934464], [102.348099399833004, 13.39424734135822], [102.58493248902667, 12.186594956913279]]] } }, + { "type": "Feature", "properties": { "admin": "Tajikistan", "name": "Tajikistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[71.014198032520156, 40.244365546218226], [70.648018833299957, 39.935753892571157], [69.559609816368507, 40.103211371412968], [69.464886915977516, 39.526683254548693], [70.549161818325601, 39.604197902986492], [71.784693637991992, 39.279463202464363], [73.67537926625478, 39.431236884105594], [73.928852166646408, 38.505815334622724], [74.257514276022718, 38.606506862943441], [74.864815708316812, 38.378846340481587], [74.829985792952087, 37.990007025701388], [74.980002475895404, 37.419990139305888], [73.948695916646486, 37.421566270490786], [73.260055779924983, 37.495256862938994], [72.636889682917271, 37.047558091778349], [72.193040805962383, 36.94828766534566], [71.84463829945058, 36.738171291646914], [71.448693475230229, 37.065644843080513], [71.541917759084768, 37.905774441065631], [71.239403924448155, 37.953265082341879], [71.348131137990251, 38.258905341132156], [70.806820509732873, 38.486281643216408], [70.376304152309274, 38.138395901027515], [70.270574171840124, 37.73516469985401], [70.116578403610319, 37.588222764632086], [69.518785434857946, 37.608996690413413], [69.196272820924364, 37.15114350030742], [68.859445835245921, 37.344335842430588], [68.135562371701369, 37.023115139304302], [67.829999627559502, 37.144994004864678], [68.392032505165943, 38.157025254868728], [68.176025018185911, 38.901553453113898], [67.442219679641298, 39.140143541005479], [67.701428664017342, 39.580478420564518], [68.536416456989414, 39.533452867178923], [69.011632928345477, 40.086158148756653], [69.329494663372813, 40.727824408524839], [70.666622348925031, 40.960213324541407], [70.458159621059608, 40.49649485937028], [70.601406691372674, 40.218527330072284], [71.014198032520156, 40.244365546218226]]] } }, + { "type": "Feature", "properties": { "admin": "Turkmenistan", "name": "Turkmenistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[61.21081709172573, 35.650072333309218], [61.123070509694131, 36.491597194966239], [60.377637973883864, 36.52738312432836], [59.234761997316795, 37.412987982730336], [58.436154412678192, 37.522309475243794], [57.330433790928964, 38.029229437810933], [56.619366082592805, 38.121394354803478], [56.180374790273319, 37.935126654607423], [55.511578403551894, 37.964117133123153], [54.800303989486558, 37.392420762678178], [53.921597934795543, 37.198918361961255], [53.735511102112504, 37.906136176091685], [53.880928582581831, 38.952093003895349], [53.101027866432894, 39.290573635407121], [53.357808058491216, 39.975286363274442], [52.693972609269807, 40.033629055331964], [52.91525109234361, 40.87652334244472], [53.85813927594112, 40.631034450842165], [54.736845330632136, 40.951014919593455], [54.0083109881813, 41.551210842447404], [53.721713494690576, 42.123191433270016], [52.916749708880069, 41.868116563477322], [52.81468875510361, 41.135370591794704], [52.502459751196135, 41.783315538086356], [52.94429324729164, 42.116034247397586], [54.079417759014937, 42.324109402020817], [54.755345493392625, 42.04397146256656], [55.455251092353755, 41.259859117185826], [55.968191359282898, 41.308641669269356], [57.096391229079089, 41.32231008561056], [56.93221520368779, 41.82602610937559], [57.786529982337065, 42.170552883465511], [58.629010857991453, 42.751551011723045], [59.976422153569771, 42.223081976890199], [60.083340691981654, 41.425146185871391], [60.46595299667068, 41.22032664648254], [61.547178989513547, 41.2663703476546], [61.882714064384679, 41.084856879229392], [62.374260288344992, 40.053886216790382], [63.518014764261018, 39.363256537425627], [64.170223016216752, 38.892406724598231], [65.215998976507379, 38.402695013984292], [66.546150343700205, 37.974684963526855], [66.518606805288655, 37.362784328758785], [66.217384881459324, 37.393790188133913], [65.745630731066811, 37.661164048812061], [65.588947788357828, 37.305216783185628], [64.746105177677393, 37.111817735333297], [64.546479119733888, 36.31207326918426], [63.982895949158696, 36.007957465146596], [63.193538445900337, 35.857165635718907], [62.984662306576588, 35.404040839167614], [62.230651483005879, 35.270663967422287], [61.21081709172573, 35.650072333309218]]] } }, + { "type": "Feature", "properties": { "admin": "East Timor", "name": "Timor-Leste", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[124.96868248911619, -8.892790215697081], [125.086246372580248, -8.656887302284678], [125.947072381698234, -8.432094821815033], [126.64470421763852, -8.39824675866385], [126.957243280139792, -8.273344821814396], [127.335928175974615, -8.397316582882601], [126.967991978056517, -8.668256117388891], [125.925885044458568, -9.106007175333351], [125.088520135601073, -9.393173109579292], [125.070019972840583, -9.08998748132287], [124.96868248911619, -8.892790215697081]]] } }, + { "type": "Feature", "properties": { "admin": "Trinidad and Tobago", "name": "Trinidad and Tobago", "continent": "North America" }, "geometry": { "type": "Polygon", "coordinates": [[[-61.68, 10.76], [-61.105, 10.89], [-60.895, 10.855], [-60.935, 10.11], [-61.77, 10.0], [-61.95, 10.09], [-61.66, 10.365], [-61.68, 10.76]]] } }, + { "type": "Feature", "properties": { "admin": "Tunisia", "name": "Tunisia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[9.482139926805273, 30.307556057246181], [9.055602654668148, 32.102691962201284], [8.439102817426116, 32.506284898400814], [8.430472853233367, 32.748337307255944], [7.612641635782181, 33.344114895148955], [7.524481642292242, 34.097376410451453], [8.140981479534302, 34.655145982393783], [8.376367628623766, 35.479876003555937], [8.217824334352313, 36.433176988260271], [8.420964389691674, 36.946427313783154], [9.509993523810605, 37.349994411766531], [10.210002475636315, 37.230001735984807], [10.180650262094529, 36.724037787415071], [11.028867221733348, 37.09210317641395], [11.100025668999249, 36.899996039368908], [10.600004510143092, 36.410000108377368], [10.593286573945134, 35.947444362932806], [10.939518670300686, 35.698984076473486], [10.807847120821007, 34.833507188449182], [10.149592726287123, 34.330773016897702], [10.339658644256613, 33.785741685515312], [10.856836378633684, 33.768740139291275], [11.108500603895118, 33.293342800422188], [11.488787469131008, 33.136995754523134], [11.432253452203692, 32.368903103152867], [10.944789666394453, 32.081814683555358], [10.636901482799484, 31.761420803345747], [9.950225050505081, 31.376069647745251], [10.056575148161752, 30.961831366493595], [9.97001712407285, 30.539324856075236], [9.482139926805273, 30.307556057246181]]] } }, + { "type": "Feature", "properties": { "admin": "Turkey", "name": "Turkey", "continent": "Asia" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[36.913127068842151, 41.335358384764291], [38.347664829264502, 40.948586127275711], [39.512606642420238, 41.102762763018561], [40.373432651538245, 41.013672593747337], [41.554084100110707, 41.535656236327604], [42.619548781104548, 41.58317271581992], [43.582745802592704, 41.09214325618256], [43.752657911968491, 40.740200914058811], [43.656436395040963, 40.253563951166157], [44.400008579288759, 40.005000311842302], [44.79398969908199, 39.713002631177027], [44.109225294782355, 39.428136298168049], [44.421402622257595, 38.281281236314513], [44.225755649600522, 37.971584377589345], [44.772699008977739, 37.170444647768441], [44.293451775902852, 37.001514390606353], [43.942258742047343, 37.256227525372928], [42.77912560402185, 37.385263576805798], [42.349591098811764, 37.229872544904104], [41.212089471203015, 37.074352321921729], [40.673259311695702, 37.091276353497356], [39.522580193852512, 36.716053778626012], [38.699891391765917, 36.712927354472313], [38.167727492024156, 36.90121043552778], [37.066761102045824, 36.623036200500614], [36.739494256341366, 36.817520453431108], [36.685389031731816, 36.259699205056499], [36.417550083163086, 36.040616970355096], [36.149762811026584, 35.821534735653664], [35.782084995269848, 36.274995429014915], [36.160821567537049, 36.650605577128367], [35.550936313628334, 36.565442816711325], [34.714553256984367, 36.795532131490909], [34.026894972476455, 36.219960028623966], [32.509158156064096, 36.107563788389193], [31.69959516777956, 36.644275214172602], [30.621624790171062, 36.677864895162308], [30.391096225717114, 36.262980658506983], [29.69997562024556, 36.144357408181001], [28.732902866335387, 36.676831366516431], [27.641186557737363, 36.658822129862749], [27.048767937943289, 37.653360907536005], [26.318218214633042, 38.208133246405382], [26.804700148228726, 38.985760199533551], [26.170785353304375, 39.463612168936457], [27.280019972449388, 40.420013739578302], [28.819977654747209, 40.460011298172212], [29.240003696415574, 41.219990749672682], [31.145933872204434, 41.087621568357058], [32.347979363745786, 41.736264146484629], [33.513282911927512, 42.018960069337304], [35.167703891751863, 42.040224921225438], [36.913127068842151, 41.335358384764291]]], [[[27.192376743282406, 40.690565700842448], [26.358009067497782, 40.151993923496477], [26.043351271272535, 40.617753607743161], [26.056942172965332, 40.824123440100735], [26.294602085075692, 40.936261298174166], [26.604195590936282, 41.562114569661013], [26.117041863720825, 41.826904608724554], [27.135739373490505, 42.141484890301307], [27.996720411905407, 42.007358710287768], [28.115524529744441, 41.622886054036279], [28.988442824018779, 41.299934190428175], [28.806438429486743, 41.05496206314853], [27.619017368284112, 40.999823309893102], [27.192376743282406, 40.690565700842448]]]] } }, + { "type": "Feature", "properties": { "admin": "Taiwan", "name": "Taiwan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[121.777817824389899, 24.394273586519393], [121.175632358892713, 22.790857245367164], [120.747079705896198, 21.970571397382106], [120.220083449383651, 22.814860948166732], [120.106188592612369, 23.556262722258229], [120.694679803552233, 24.53845083261373], [121.49504438688875, 25.295458889257379], [121.951243931161429, 24.997595933527034], [121.777817824389899, 24.394273586519393]]] } }, + { "type": "Feature", "properties": { "admin": "United Republic of Tanzania", "name": "Tanzania", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[33.903711197104592, -0.95], [34.07262, -1.05982], [37.69869, -3.09699], [37.7669, -3.67712], [39.20222, -4.67677], [38.74054, -5.90895], [38.79977, -6.47566], [39.44, -6.84], [39.470000000000134, -7.1], [39.19469, -7.7039], [39.25203, -8.00781], [39.18652, -8.48551], [39.53574, -9.112369999999883], [39.9496, -10.0984], [40.31659, -10.317099999999867], [39.521, -10.89688], [38.427556593587767, -11.285202325081626], [37.82764, -11.26879], [37.47129, -11.56876], [36.775150994622884, -11.59453744878078], [36.514081658684397, -11.720938002166745], [35.312397902169145, -11.439146416879165], [34.559989047999451, -11.520020033415845], [34.28, -10.16], [33.940837724096518, -9.693673841980283], [33.73972, -9.41715], [32.759375441221373, -9.230599053589001], [32.191864861791935, -8.930358981973255], [31.556348097466628, -8.762048841998647], [31.157751336950064, -8.594578747317312], [30.74, -8.34], [30.2, -7.08], [29.62, -6.52], [29.419992710088305, -5.939998874539297], [29.519986606573063, -5.419978936386257], [29.339997592900367, -4.499983412294113], [29.753512404099858, -4.452389418153301], [30.11632, -4.09012], [30.50554, -3.56858], [30.75224, -3.35931], [30.74301, -3.03431], [30.52766, -2.80762], [30.46967, -2.41383], [30.758308953583132, -2.287250257988375], [30.816134881317844, -1.698914076345374], [30.419104852019291, -1.134659112150416], [30.769860000000101, -1.01455], [31.86617, -1.02736], [33.903711197104592, -0.95]]] } }, + { "type": "Feature", "properties": { "admin": "Uganda", "name": "Uganda", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.86617, -1.02736], [30.769860000000101, -1.01455], [30.419104852019291, -1.134659112150416], [29.821518588996121, -1.443322442229771], [29.579466180141019, -1.341313164885605], [29.587837762172164, -0.587405694179381], [29.8195, -0.2053], [29.875778842902431, 0.597379868976361], [30.086153598762785, 1.062312730306416], [30.468507521290285, 1.583805446779706], [30.852670118948133, 1.849396470543752], [31.174149204235952, 2.204465236821306], [30.77332, 2.339890000000139], [30.83385, 3.50917], [31.24556, 3.7819], [31.88145, 3.55827], [32.68642, 3.79232], [33.39, 3.79], [34.005, 4.249884947362147], [34.47913, 3.5556], [34.59607, 3.053740000000118], [35.03599, 1.90584], [34.6721, 1.17694], [34.18, 0.515], [33.893568969666994, 0.109813537861839], [33.903711197104592, -0.95], [31.86617, -1.02736]]] } }, + { "type": "Feature", "properties": { "admin": "Ukraine", "name": "Ukraine", "continent": "Europe" }, "geometry": { "type": "Polygon", "coordinates": [[[31.78599816257158, 52.10167796488544], [32.159412062312661, 52.061266994833204], [32.412058139787625, 52.288694973349735], [32.715760532366964, 52.238465481162038], [33.7526998227357, 52.335074571331681], [34.391730584457001, 51.768881740925778], [34.141978387190385, 51.566413479206226], [34.22481570815426, 51.255993150428942], [35.022183058417873, 51.207572333371445], [35.377923618315116, 50.773955390010343], [35.35611616388794, 50.577197374059054], [36.62616784032533, 50.225590928745127], [37.393459506995065, 50.383953355503586], [38.01063113785689, 49.915661526074622], [38.59498823421341, 49.926461900423618], [40.069058465339097, 49.601055406281688], [40.080789015469342, 49.307429917999272], [39.674663934087526, 48.783818467801872], [39.895632358567575, 48.232405097031425], [39.738277622238819, 47.898937079451983], [38.770584751141186, 47.825608222029807], [38.255112339029743, 47.546400458356807], [38.223538038899413, 47.102189846375872], [37.42513715998998, 47.022220567404197], [36.759854770664383, 46.698700263040919], [35.823684523264816, 46.645964463887054], [34.962341749823871, 46.273196519549636], [35.020787794745978, 45.65121898048465], [35.51000857925316, 45.409993394546177], [36.529997999830151, 45.46998973243705], [36.334712762199146, 45.113215643893952], [35.239999220528112, 44.939996242851599], [33.882511020652878, 44.361478583344066], [33.326420932760037, 44.564877020844875], [33.546924269349446, 45.034770819674883], [32.454174432105496, 45.327466132176063], [32.630804477679128, 45.519185695978905], [33.588162062318382, 45.851568508480227], [33.298567335754704, 46.08059845639783], [31.744140252415171, 46.333347886737378], [31.675307244602401, 46.706245022155528], [30.748748813609094, 46.583100084003995], [30.37760867688888, 46.032410183285663], [29.603289015427425, 45.293308010431119], [29.149724969201646, 45.464925442072442], [28.679779493939371, 45.30403087013169], [28.233553501099035, 45.488283189468369], [28.48526940279276, 45.596907050145887], [28.659987420371575, 45.939986884131628], [28.933717482221621, 46.258830471372491], [28.862972446414055, 46.437889309263824], [29.072106967899288, 46.517677720722482], [29.170653924279879, 46.379262396828693], [29.759971958136383, 46.349987697935354], [30.024658644335364, 46.423936672545032], [29.838210076626289, 46.525325832701675], [29.908851759569295, 46.67436066343145], [29.559674106573105, 46.928582872091312], [29.415135125452732, 47.346645209332571], [29.050867954227321, 47.510226955752493], [29.122698195113024, 47.849095160506458], [28.670891147585163, 48.118148505234089], [28.259546746541837, 48.155562242213406], [27.52253746919515, 48.467119452501102], [26.857823520624798, 48.368210761094488], [26.619336785597788, 48.220726223333457], [26.197450392366925, 48.220881252630342], [25.945941196402394, 47.987148749374207], [25.207743361112986, 47.891056423527459], [24.866317172960571, 47.737525743188307], [24.402056105250374, 47.981877753280422], [23.760958286237404, 47.985598456405448], [23.142236362406798, 48.096341050806942], [22.710531447040488, 47.882193915389394], [22.640819939878746, 48.150239569687351], [22.085608351334848, 48.422264309271782], [22.280841912533553, 48.825392157580659], [22.558137648211751, 49.08573802346713], [22.776418898212619, 49.027395331409608], [22.518450148211596, 49.476773586619736], [23.426508416444388, 50.308505764357449], [23.922757195743259, 50.424881089878738], [24.029985792748899, 50.705406602575174], [23.52707075368437, 51.578454087930233], [24.005077752384206, 51.617443956094448], [24.553106316839511, 51.888461005249177], [25.327787713327005, 51.910656032918538], [26.337958611768549, 51.832288723347915], [27.454066196408426, 51.59230337178446], [28.241615024536564, 51.572227077839059], [28.617612745892242, 51.427713934934836], [28.992835320763522, 51.602044379271462], [29.254938185347921, 51.368234361366881], [30.157363722460889, 51.416138414101454], [30.55511722181145, 51.319503485715643], [30.619454380014837, 51.822806098022362], [30.927549269338975, 52.042353420614383], [31.78599816257158, 52.10167796488544]]] } }, + { "type": "Feature", "properties": { "admin": "Uruguay", "name": "Uruguay", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-57.625133429582945, -30.216294854454258], [-56.976025763564721, -30.109686374636119], [-55.97324459494093, -30.883075860316296], [-55.601510179249331, -30.853878676071385], [-54.572451544805105, -31.494511407193745], [-53.787951626182185, -32.047242526987617], [-53.209588995971529, -32.727666110974717], [-53.650543992718084, -33.202004082981823], [-53.373661668498229, -33.768377780900757], [-53.806425950726521, -34.396814874002224], [-54.935866054897716, -34.952646579733617], [-55.674089728403274, -34.752658786764066], [-56.215297003796053, -34.85983570733741], [-57.139685024633096, -34.430456231424238], [-57.817860683815489, -34.462547295877492], [-58.427074144104381, -33.909454441057569], [-58.349611172098854, -33.2631889788154], [-58.132647671121433, -33.040566908502008], [-58.142440355040748, -32.044503676076147], [-57.874937303281875, -31.016556084926201], [-57.625133429582945, -30.216294854454258]]] } }, + { "type": "Feature", "properties": { "admin": "United States of America", "name": "United States", "continent": "North America" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[-155.54211, 19.08348], [-155.68817, 18.91619], [-155.93665, 19.05939], [-155.90806, 19.33888], [-156.07347, 19.70294], [-156.02368, 19.81422], [-155.85008, 19.97729], [-155.91907, 20.17395], [-155.86108, 20.26721], [-155.78505, 20.2487], [-155.40214, 20.07975], [-155.22452, 19.99302], [-155.06226, 19.8591], [-154.80741, 19.50871], [-154.83147, 19.45328], [-155.222169999999892, 19.23972], [-155.54211, 19.08348]]], [[[-156.07926, 20.64397], [-156.41445, 20.57241], [-156.58673, 20.783], [-156.70167, 20.8643], [-156.71055, 20.92676], [-156.61258, 21.01249], [-156.25711, 20.91745], [-155.99566, 20.76404], [-156.07926, 20.64397]]], [[[-156.75824, 21.17684], [-156.78933, 21.06873], [-157.32521, 21.09777], [-157.25027, 21.21958], [-156.75824, 21.17684]]], [[[-157.65283, 21.32217], [-157.70703, 21.26442], [-157.7786, 21.27729], [-158.12667, 21.31244], [-158.2538, 21.53919], [-158.29265, 21.57912], [-158.0252, 21.71696], [-157.94161, 21.65272], [-157.65283, 21.32217]]], [[[-159.34512, 21.982], [-159.46372, 21.88299], [-159.80051, 22.06533], [-159.74877, 22.1382], [-159.5962, 22.23618], [-159.36569, 22.21494], [-159.34512, 21.982]]], [[[-94.81758, 49.38905], [-94.639999999999858, 48.840000000000103], [-94.32914, 48.67074], [-93.63087, 48.60926], [-92.61, 48.45], [-91.64, 48.14], [-90.829999999999856, 48.27], [-89.6, 48.01], [-89.272917446636654, 48.019808254582834], [-88.378114183286513, 48.302917588893806], [-87.439792623300207, 47.94], [-86.461990831228135, 47.553338019392037], [-85.652363247403215, 47.220218817730498], [-84.876079881514855, 46.900083319682366], [-84.779238247399817, 46.637101955749117], [-84.54374874544564, 46.538684190449224], [-84.6049, 46.4396], [-84.3367, 46.408770000000104], [-84.142119513673279, 46.512225857115723], [-84.091851264161463, 46.275418606138253], [-83.890765347005654, 46.116926988299149], [-83.616130947590491, 46.116926988299149], [-83.469550747394621, 45.994686387712584], [-83.592850714843067, 45.816893622412543], [-82.550924648758169, 45.347516587905446], [-82.337763125431053, 44.44], [-82.137642381503952, 43.571087551439987], [-82.43, 42.98], [-82.899999999999878, 42.430000000000135], [-83.119999999999877, 42.08], [-83.141999681312555, 41.975681057292995], [-83.029810146806909, 41.832795722005997], [-82.690089280920162, 41.675105088867319], [-82.439277716791608, 41.675105088867319], [-81.277746548167059, 42.209025987306845], [-80.247447679347843, 42.36619985612267], [-78.939362148743683, 42.863611355148116], [-78.92, 42.965], [-79.009999999999863, 43.27], [-79.171673550111862, 43.466339423184301], [-78.720279914042365, 43.625089423184953], [-77.737885097957601, 43.629055589363382], [-76.820034145805565, 43.628784288093748], [-76.5, 44.018458893758599], [-76.375, 44.09631], [-75.31821, 44.81645000000016], [-74.867, 45.00048000000011], [-73.347829999999874, 45.00738], [-71.505059999999858, 45.0082], [-71.405, 45.255000000000123], [-71.08482, 45.305240000000154], [-70.659999999999783, 45.46], [-70.305, 45.915], [-69.99997, 46.69307], [-69.237216, 47.447781], [-68.905, 47.185], [-68.23444, 47.35486], [-67.79046, 47.06636], [-67.79134, 45.702810000000134], [-67.13741, 45.13753], [-66.96466, 44.809700000000149], [-68.03252, 44.3252], [-69.059999999999874, 43.98], [-70.116169999999897, 43.684050000000141], [-70.645475633410967, 43.090238348964043], [-70.81489, 42.8653], [-70.825, 42.335], [-70.494999999999891, 41.805], [-70.08, 41.78], [-70.185, 42.145], [-69.88497, 41.922830000000111], [-69.96503, 41.637170000000161], [-70.64, 41.475], [-71.12039, 41.494450000000164], [-71.859999999999829, 41.32], [-72.295, 41.27], [-72.87643, 41.22065], [-73.71, 40.931102351654481], [-72.24126, 41.119480000000138], [-71.944999999999808, 40.93], [-73.345, 40.63], [-73.982, 40.628], [-73.952325, 40.75075], [-74.25671, 40.47351], [-73.96244, 40.42763], [-74.17838, 39.70926], [-74.90604, 38.93954], [-74.98041, 39.1964], [-75.20002, 39.24845], [-75.52805, 39.4985], [-75.32, 38.96], [-75.071834764789784, 38.782032230179276], [-75.05673, 38.404120000000106], [-75.37747, 38.01551], [-75.94023, 37.21689], [-76.03127, 37.2566], [-75.722049999999783, 37.937050000000106], [-76.23287, 38.319215], [-76.35, 39.15], [-76.542725, 38.717615], [-76.32933, 38.08326], [-76.98999793161353, 38.239991766913384], [-76.301619999999886, 37.917945], [-76.25874, 36.9664000000001], [-75.9718, 36.89726], [-75.868039999999809, 36.55125], [-75.72749, 35.550740000000125], [-76.36318, 34.808540000000129], [-77.39763499999988, 34.51201], [-78.05496, 33.92547], [-78.554349999999815, 33.861330000000116], [-79.06067, 33.49395], [-79.20357, 33.15839], [-80.301325, 32.509355], [-80.86498, 32.0333], [-81.33629, 31.44049], [-81.49042, 30.729990000000122], [-81.31371, 30.03552], [-80.98, 29.18000000000011], [-80.53558499999987, 28.47213], [-80.529999999999774, 28.04], [-80.056539284977532, 26.88000000000013], [-80.088015, 26.205765], [-80.131559999999837, 25.816775], [-80.38103, 25.20616], [-80.679999999999879, 25.08], [-81.17213, 25.201260000000126], [-81.33, 25.64], [-81.709999999999795, 25.87], [-82.239999999999895, 26.730000000000125], [-82.70515, 27.49504], [-82.85526, 27.88624], [-82.65, 28.550000000000146], [-82.929999999999865, 29.100000000000129], [-83.70959, 29.93656], [-84.1, 30.090000000000114], [-85.10882, 29.63615], [-85.28784, 29.686120000000127], [-85.7731, 30.152610000000116], [-86.399999999999878, 30.400000000000112], [-87.530359999999831, 30.27433], [-88.41782, 30.3849], [-89.180489999999836, 30.31598], [-89.593831178419748, 30.159994004836843], [-89.413735, 29.89419], [-89.43, 29.48864], [-89.21767, 29.29108], [-89.40823, 29.15961], [-89.77928, 29.307140000000135], [-90.15463, 29.11743], [-90.880224999999896, 29.148535000000116], [-91.626784999999842, 29.677000000000127], [-92.49906, 29.5523], [-93.22637, 29.78375], [-93.84842, 29.71363], [-94.69, 29.480000000000125], [-95.60026, 28.73863], [-96.59404, 28.30748], [-97.139999999999802, 27.83], [-97.37, 27.38], [-97.379999999999853, 26.69], [-97.33, 26.210000000000115], [-97.139999999999802, 25.87], [-97.529999999999859, 25.84], [-98.239999999999895, 26.060000000000109], [-99.019999999999854, 26.37], [-99.3, 26.84], [-99.52, 27.54], [-100.11, 28.11000000000012], [-100.45584, 28.696120000000118], [-100.957599999999886, 29.380710000000125], [-101.6624, 29.779300000000113], [-102.48, 29.76], [-103.11, 28.97], [-103.94, 29.27], [-104.456969999999814, 29.57196], [-104.705749999999895, 30.12173], [-105.03737, 30.64402], [-105.63159, 31.083830000000113], [-106.1429, 31.39995], [-106.507589999999794, 31.75452], [-108.24, 31.754853718166398], [-108.24194, 31.34222], [-109.035, 31.341940000000161], [-111.02361, 31.33472], [-113.30498, 32.03914], [-114.815, 32.52528], [-114.721389999999829, 32.72083], [-115.991349999999869, 32.61239000000014], [-117.127759999999753, 32.53534], [-117.295937691273863, 33.04622461520389], [-117.944, 33.621236431201389], [-118.410602275897475, 33.740909223124497], [-118.519894822799685, 34.027781577575745], [-119.081, 34.078], [-119.438840642016658, 34.348477178284291], [-120.36778, 34.44711], [-120.62286, 34.60855], [-120.74433, 35.156860000000101], [-121.714569999999853, 36.16153], [-122.54747, 37.551760000000101], [-122.51201, 37.783390000000132], [-122.95319, 38.113710000000104], [-123.7272, 38.951660000000111], [-123.865169999999878, 39.766990000000128], [-124.39807, 40.3132], [-124.17886, 41.142020000000109], [-124.2137, 41.999640000000134], [-124.532839999999894, 42.76599], [-124.14214, 43.70838], [-124.020535, 44.615895], [-123.898929999999893, 45.52341], [-124.079635, 46.86475], [-124.395669999999896, 47.72017], [-124.687210083007812, 48.184432983398537], [-124.566101074218736, 48.379714965820384], [-123.12, 48.04], [-122.587359999999876, 47.096], [-122.34, 47.36], [-122.5, 48.18], [-122.84, 49.0], [-120.0, 49.0], [-117.03121, 49.0], [-116.04818, 49.0], [-112.999999999999872, 49.0], [-110.049999999999812, 49.0], [-107.049999999999898, 49.0], [-104.04826, 48.99986], [-100.65, 49.0], [-97.228720000004699, 49.0007], [-95.159069509171943, 49.0], [-95.15609, 49.38425], [-94.81758, 49.38905]]], [[[-153.006314053336837, 57.115842190165878], [-154.0050902984581, 56.734676825581047], [-154.516402757770067, 56.992748928446687], [-154.670992804971092, 57.461195787172493], [-153.762779507441451, 57.816574612043773], [-153.228729417921073, 57.968968410872421], [-152.564790615835108, 57.901427313866961], [-152.141147223906273, 57.591058661521977], [-153.006314053336837, 57.115842190165878]]], [[[-165.579164191733554, 59.909986884187539], [-166.192770148767238, 59.754440822988961], [-166.848337368821944, 59.941406155020942], [-167.455277066090048, 60.213069159579376], [-166.467792121424566, 60.384169826897775], [-165.674429694663644, 60.293606879306232], [-165.579164191733554, 59.909986884187539]]], [[[-171.731656867539357, 63.782515367275906], [-171.114433560245175, 63.592191067144981], [-170.491112433940657, 63.694975490973505], [-169.682505459653555, 63.431115627691142], [-168.689439460300662, 63.297506212000584], [-168.77194088445458, 63.188598130945437], [-169.529439867204985, 62.976931464277882], [-170.290556200215917, 63.194437567794452], [-170.671385667990847, 63.375821845138965], [-171.553063117538642, 63.317789211675077], [-171.791110602891166, 63.40584585230048], [-171.731656867539357, 63.782515367275906]]], [[[-155.067790290324211, 71.147776394323685], [-154.344165208941206, 70.696408596470192], [-153.900006273392563, 70.889988511835682], [-152.210006069935275, 70.829992173944831], [-152.270002407826127, 70.60000621202984], [-150.739992438744508, 70.430016588005699], [-149.720003018167489, 70.530010484490433], [-147.613361579357047, 70.214034939241785], [-145.689989800225248, 70.120009670686741], [-144.920010959076393, 69.989991767040479], [-143.58944618042517, 70.152514146598307], [-142.072510348713365, 69.851938178172631], [-140.985987521560702, 69.711998399526365], [-140.985988329004869, 69.711998399526365], [-140.992498752029377, 66.000028591568665], [-140.997769748123119, 60.306396796298593], [-140.012997816153074, 60.276837877027575], [-139.03900042031583, 60.000007229240012], [-138.340889999999888, 59.562110000000146], [-137.4525, 58.905000000000101], [-136.47972, 59.46389], [-135.47583, 59.78778], [-134.945, 59.270560000000117], [-134.27111, 58.86111], [-133.355548882207188, 58.410285142645151], [-132.73042, 57.692890000000105], [-131.707809999999853, 56.55212], [-130.00778, 55.91583], [-129.979994263358265, 55.284997870497207], [-130.536110189467223, 54.802753404349389], [-131.08581823797212, 55.178906155002025], [-131.967211467142278, 55.497775580459049], [-132.250010742859445, 56.369996242897443], [-133.539181084356386, 57.178887437562125], [-134.07806292029602, 58.123067531966889], [-135.038211032279037, 58.187714748763931], [-136.628062309954629, 58.212209377670447], [-137.800006279686016, 58.499995429103777], [-139.867787041412981, 59.537761542389134], [-140.825273817133024, 59.72751740176507], [-142.574443535564427, 60.084446519604981], [-143.958880994879848, 59.99918040632339], [-145.925556816827822, 60.458609727614274], [-147.114373949146625, 60.884656073644628], [-148.224306200127643, 60.672989406977152], [-148.018065558850736, 59.978328965893631], [-148.570822516860858, 59.914172675203297], [-149.727857835875824, 59.705658270905545], [-150.608243374616421, 59.368211168039487], [-151.716392788683294, 59.155821031319974], [-151.859433153267105, 59.74498403587959], [-151.40971900124714, 60.725802720779392], [-150.346941494732505, 61.033587551509854], [-150.621110806256951, 61.284424953854447], [-151.895839199816834, 60.727197984451273], [-152.578329841095581, 60.061657212964285], [-154.019172126257558, 59.350279446034264], [-153.287511359653166, 58.864727688219787], [-154.232492438758442, 58.146373602930531], [-155.307491421510207, 57.727794501366319], [-156.308334723923082, 57.422774359763636], [-156.556097378546298, 56.979984849670636], [-158.117216559867728, 56.463608099994175], [-158.433321296197136, 55.994153550838533], [-159.603327399717415, 55.566686102920116], [-160.289719611634183, 55.643580634170561], [-161.223047655257773, 55.364734605523481], [-162.23776607974105, 55.024186916720097], [-163.069446581046378, 54.689737046927171], [-164.785569221027174, 54.40417308208216], [-164.942226325520011, 54.572224839895327], [-163.84833960676562, 55.039431464246107], [-162.870001390615897, 55.348043117893198], [-161.804174974596009, 55.894986477270429], [-160.563604702781134, 56.008054511125025], [-160.070559862284483, 56.418055324928744], [-158.684442918919416, 57.016675116597852], [-158.461097378553944, 57.216921291728866], [-157.722770352183858, 57.570000515363056], [-157.550274421193564, 58.328326321030218], [-157.041674974576949, 58.918884589261708], [-158.194731208305427, 58.615802313869828], [-158.517217984023034, 58.787781480537305], [-159.058606126928709, 58.424186102931671], [-159.711667040017318, 58.931390285876333], [-159.981288825500144, 58.572549140041623], [-160.355271165996498, 59.071123358793628], [-161.355003425115001, 58.670837714260742], [-161.968893602526293, 58.671664537177371], [-162.054986538724648, 59.266925360747436], [-161.874170702135331, 59.633621324290587], [-162.518059048492034, 59.989723619213905], [-163.818341437820123, 59.798055731843377], [-164.662217577146407, 60.267484442782639], [-165.346387702474772, 60.507495632562396], [-165.350831875651835, 61.073895168697497], [-166.121379157555907, 61.500019029376212], [-165.734451870770471, 62.074996853271792], [-164.919178636717788, 62.633076483807919], [-164.562507901039339, 63.146378485763044], [-163.753332485996964, 63.219448961023758], [-163.067224494457832, 63.05945872664801], [-162.260555386381697, 63.541935736741159], [-161.534449836248569, 63.455816962326757], [-160.772506680321101, 63.76610810002326], [-160.958335130842528, 64.222798570402759], [-161.518068407212184, 64.402787584075313], [-160.777777676414729, 64.788603827566405], [-161.391926235987597, 64.777235012462327], [-162.453050096668818, 64.559444688568206], [-162.757786017894034, 64.338605455168803], [-163.54639421288428, 64.559160468190484], [-164.960829841145141, 64.446945095468848], [-166.425288255864473, 64.686672064870706], [-166.845004238939026, 65.088895575614529], [-168.110560065767146, 65.669997056736733], [-166.70527116602193, 66.088317776139391], [-164.474709642575448, 66.576660061297488], [-163.652511766595637, 66.576660061297488], [-163.788601651036117, 66.077207343196662], [-161.677774421210131, 66.116119696712403], [-162.489714525379981, 66.735565090595102], [-163.719716966791083, 67.116394558370089], [-164.430991380856511, 67.616338202577779], [-165.390286831706703, 68.042772121850234], [-166.764440680995989, 68.35887685817967], [-166.204707404626561, 68.883030910916162], [-164.430810513343431, 68.915535386827727], [-163.168613654614489, 69.371114813912882], [-162.930566169261965, 69.858061835399255], [-161.908897264635499, 70.333329983187625], [-160.93479651593367, 70.447689927849567], [-159.039175788387126, 70.891642157668926], [-158.119722866833939, 70.824721177851032], [-156.580824551398024, 71.357763576941736], [-155.067790290324211, 71.147776394323685]]]] } }, + { "type": "Feature", "properties": { "admin": "Uzbekistan", "name": "Uzbekistan", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[66.518606805288655, 37.362784328758785], [66.546150343700205, 37.974684963526855], [65.215998976507379, 38.402695013984292], [64.170223016216752, 38.892406724598231], [63.518014764261018, 39.363256537425627], [62.374260288344992, 40.053886216790382], [61.882714064384679, 41.084856879229392], [61.547178989513547, 41.2663703476546], [60.46595299667068, 41.22032664648254], [60.083340691981654, 41.425146185871391], [59.976422153569771, 42.223081976890199], [58.629010857991453, 42.751551011723045], [57.786529982337065, 42.170552883465511], [56.93221520368779, 41.82602610937559], [57.096391229079089, 41.32231008561056], [55.968191359282898, 41.308641669269356], [55.928917270741081, 44.995858466159099], [58.503127068928457, 45.586804307632818], [58.689989048095882, 45.500013739598621], [60.239971958258316, 44.784036770194717], [61.05831994003244, 44.405816962250505], [62.013300408786236, 43.504476630215642], [63.185786981056559, 43.650074978197999], [64.900824415959264, 43.728080552742576], [66.098012322865074, 42.997660020513088], [66.023391554635609, 41.994646307943974], [66.510648634715707, 41.987644151368436], [66.714047072216502, 41.168443508461493], [67.985855747351806, 41.135990708982213], [68.259895867795606, 40.662324530594894], [68.632482944620008, 40.668680731766798], [69.070027296835306, 41.384244289712363], [70.388964878220776, 42.081307684897439], [70.96231489449913, 42.266154283205481], [71.259247674448218, 42.167710679689456], [70.420022414028196, 41.519998277343134], [71.157858514291576, 41.143587144529107], [71.870114780570447, 41.392900092121259], [73.055417108049156, 40.86603302668945], [71.774875115856545, 40.145844428053763], [71.014198032520156, 40.244365546218226], [70.601406691372674, 40.218527330072284], [70.458159621059608, 40.49649485937028], [70.666622348925031, 40.960213324541407], [69.329494663372813, 40.727824408524839], [69.011632928345477, 40.086158148756653], [68.536416456989414, 39.533452867178923], [67.701428664017342, 39.580478420564518], [67.442219679641298, 39.140143541005479], [68.176025018185911, 38.901553453113898], [68.392032505165943, 38.157025254868728], [67.829999627559502, 37.144994004864678], [67.075782098259609, 37.35614390720928], [66.518606805288655, 37.362784328758785]]] } }, + { "type": "Feature", "properties": { "admin": "Venezuela", "name": "Venezuela", "continent": "South America" }, "geometry": { "type": "Polygon", "coordinates": [[[-71.331583624950284, 11.776284084515805], [-71.36000566271079, 11.53999359786121], [-71.947049933546495, 11.423282375530018], [-71.620868292920164, 10.969459947142791], [-71.633063930941063, 10.446494452349027], [-72.074173956984495, 9.865651353388369], [-71.695644090446521, 9.072263088411246], [-71.26455929226772, 9.137194525585981], [-71.039999355743376, 9.859992784052407], [-71.350083787710773, 10.211935126176213], [-71.400623338492224, 10.968969021036013], [-70.155298834906503, 11.375481675660039], [-70.293843349881016, 11.846822414594211], [-69.943244594996813, 12.162307033736095], [-69.584300096297454, 11.459610907431211], [-68.882999233664435, 11.44338450769156], [-68.233271450458716, 10.885744126829945], [-68.194126552997616, 10.554653225135921], [-67.296248541926317, 10.545868231646306], [-66.227864142507983, 10.648626817258684], [-65.655237596281737, 10.20079885501732], [-64.890452236578156, 10.077214667191296], [-64.329478725833724, 10.389598700395679], [-64.318006557864933, 10.641417954953978], [-63.079322475828725, 10.701724351438598], [-61.880946010980182, 10.7156253117251], [-62.730118984616396, 10.420268662960904], [-62.388511928950969, 9.948204453974636], [-61.588767462801918, 9.873066921422263], [-60.830596686431711, 9.38133982994894], [-60.671252407459718, 8.580174261911877], [-60.150095587796166, 8.602756862823425], [-59.758284878159181, 8.367034816924045], [-60.550587938058186, 7.779602972846178], [-60.637972785063752, 7.414999904810853], [-60.295668097562377, 7.043911444522918], [-60.543999192940966, 6.856584377464881], [-61.159336310456467, 6.696077378766317], [-61.139415045807937, 6.234296779806142], [-61.410302903881941, 5.959068101419616], [-60.733574184803707, 5.2002772078619], [-60.601179165271922, 4.918098049332129], [-60.966893276601517, 4.536467596856638], [-62.085429653559125, 4.162123521334308], [-62.804533047116692, 4.006965033377951], [-63.093197597899092, 3.770571193858784], [-63.888342861574145, 4.020530096854571], [-64.628659430587533, 4.14848094320925], [-64.816064012294007, 4.056445217297422], [-64.368494432214092, 3.797210394705246], [-64.408827887617903, 3.126786200366623], [-64.269999152265783, 2.497005520025566], [-63.422867397705105, 2.411067613124174], [-63.368788011311644, 2.200899562993129], [-64.083085496666072, 1.91636912679408], [-64.199305792890499, 1.49285492594602], [-64.611011928959854, 1.328730576987041], [-65.354713304288353, 1.0952822941085], [-65.548267381437554, 0.78925446207603], [-66.325765143484944, 0.724452215982012], [-66.876325853122566, 1.253360500489336], [-67.181294318293041, 2.250638129074062], [-67.447092047786299, 2.600280869960869], [-67.809938117123693, 2.820655015469569], [-67.303173183853417, 3.31845408773718], [-67.33756384954367, 3.542342230641721], [-67.621835903581271, 3.839481716319994], [-67.823012254493534, 4.503937282728898], [-67.744696621355203, 5.221128648291667], [-67.521531948502741, 5.556870428891968], [-67.34143958196556, 6.095468044454021], [-67.695087246355001, 6.267318020040645], [-68.265052456318216, 6.153268133972473], [-68.985318569602327, 6.206804917826856], [-69.389479946557103, 6.099860541198835], [-70.093312954372408, 6.960376491723109], [-70.674233567981503, 7.087784735538717], [-71.960175747348629, 6.991614895043538], [-72.19835242378187, 7.340430813013682], [-72.444487270788059, 7.42378489830048], [-72.479678921178831, 7.632506008327352], [-72.360900641555958, 8.002638454617893], [-72.439862230097944, 8.405275376820027], [-72.660494757768092, 8.62528778730268], [-72.788729824500379, 9.085027167187331], [-73.304951544880026, 9.151999823437604], [-73.027604132769554, 9.736770331252441], [-72.905286017534692, 10.45034434655477], [-72.614657762325194, 10.821975409381777], [-72.227575446242923, 11.108702093953237], [-71.973921678338272, 11.608671576377116], [-71.331583624950284, 11.776284084515805]]] } }, + { "type": "Feature", "properties": { "admin": "Vietnam", "name": "Vietnam", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[108.050180291782908, 21.552379869060111], [106.715067987090066, 20.696850694252014], [105.881682163519002, 19.752050482659694], [105.662005649846279, 19.058165188060567], [106.426816847765991, 18.004120998603224], [107.36195356651973, 16.697456569887049], [108.269495070429599, 16.079742336486145], [108.877106561317447, 15.276690578670436], [109.335269810017209, 13.42602834721772], [109.200135939573954, 11.666859239137761], [108.366129998815424, 11.00832062422627], [107.22092858279521, 10.36448395430183], [106.4051127462034, 9.530839748569317], [105.158263787865081, 8.599759629750492], [104.795185174582372, 9.2410383162765], [105.076201613385592, 9.918490505406806], [104.334334751403446, 10.486543687375228], [105.199914992292321, 10.889309800658094], [106.249670037869436, 10.961811835163585], [105.810523716253101, 11.567614650921225], [107.491403029410861, 12.337205918827944], [107.614547967562402, 13.535530707244202], [107.382727492301058, 14.202440904186968], [107.564525181103875, 15.202173163305554], [107.312705926545576, 15.908538316303177], [106.55600792849566, 16.604283962464802], [105.925762160264, 17.485315456608955], [105.094598423281496, 18.666974595611073], [103.896532017026701, 19.265180975821799], [104.183387892678908, 19.624668077060214], [104.822573683697073, 19.886641750563879], [104.435000441508024, 20.758733221921528], [103.203861118586431, 20.766562201413745], [102.754896274834636, 21.675137233969462], [102.170435825613552, 22.464753119389297], [102.706992222100084, 22.708795070887668], [103.504514601660546, 22.703756618739202], [104.476858351664447, 22.819150092046961], [105.329209425886603, 23.352063300056908], [105.811247186305209, 22.976892401617899], [106.725403273548451, 22.794267889898414], [106.567273390735295, 22.218204860924768], [107.043420037872608, 21.811898912029907], [108.050180291782908, 21.552379869060111]]] } }, + { "type": "Feature", "properties": { "admin": "Vanuatu", "name": "Vanuatu", "continent": "Oceania" }, "geometry": { "type": "MultiPolygon", "coordinates": [[[[167.844876743845077, -16.466333103097153], [167.515181105822847, -16.597849623279966], [167.180007765977791, -16.159995212470957], [167.2168013857696, -15.891846205308449], [167.844876743845077, -16.466333103097153]]], [[[167.107712437201485, -14.933920179913951], [167.2700281110302, -15.74002084723487], [167.001207310247935, -15.614602146062492], [166.79315799384085, -15.668810723536719], [166.649859247095549, -15.392703545801192], [166.629136997746429, -14.6264970842096], [167.107712437201485, -14.933920179913951]]]] } }, + { "type": "Feature", "properties": { "admin": "Yemen", "name": "Yemen", "continent": "Asia" }, "geometry": { "type": "Polygon", "coordinates": [[[53.108572625547502, 16.651051133688949], [52.385205926325874, 16.38241120041965], [52.191729363825075, 15.938433132384018], [52.168164910699986, 15.597420355689945], [51.172515089732471, 15.175249742081489], [49.574576450403136, 14.708766587782746], [48.679230584514151, 14.003202419485657], [48.238947381387412, 13.948089504446369], [47.938914015500771, 14.007233181204423], [47.354453566279702, 13.592219753468379], [46.71707645039173, 13.399699204965016], [45.877592807810252, 13.347764390511681], [45.625050083199874, 13.290946153206759], [45.406458774605241, 13.02690542241143], [45.144355910020849, 12.953938300015306], [44.9895333188744, 12.699586900274708], [44.494576450382844, 12.721652736863344], [44.175112745954486, 12.585950425664873], [43.48295861183712, 12.63680003504008], [43.222871128112118, 13.220950425667422], [43.251448195169516, 13.767583726450848], [43.087943963398047, 14.062630316621306], [42.892245314308717, 14.802249253798745], [42.604872674333606, 15.213335272680592], [42.805015496600042, 15.261962795467252], [42.702437778500652, 15.718885809791995], [42.823670688657408, 15.911742255105263], [42.779332309750963, 16.34789134364868], [43.218375278502734, 16.666889960186406], [43.115797560403351, 17.088440456607369], [43.380794305196098, 17.579986680567668], [43.791518589051904, 17.319976711491105], [44.062613152855072, 17.410358791569589], [45.216651238797184, 17.43332896572333], [45.399999220568752, 17.333335069238554], [46.366658563020529, 17.233315334537632], [46.749994337761642, 17.283338120996174], [47.000004917189749, 16.949999294497438], [47.466694777217626, 17.116681626854877], [48.183343540241324, 18.166669216377311], [49.116671583864857, 18.616667588774941], [52.000009800022227, 19.000003363516054], [52.782184279192037, 17.349742336491229], [53.108572625547502, 16.651051133688949]]] } }, + { "type": "Feature", "properties": { "admin": "South Africa", "name": "South Africa", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.521001417778869, -29.257386976846245], [31.325561150850994, -29.401977634398907], [30.901762729625336, -29.909956963828034], [30.622813348113816, -30.423775730106122], [30.055716180142774, -31.140269463832951], [28.925552605919535, -32.172041110972494], [28.219755893677092, -32.771952813448848], [27.464608188595967, -33.226963799778794], [26.419452345492818, -33.614950453426175], [25.909664340933482, -33.667040297176392], [25.78062828950069, -33.944646091448334], [25.172861769315965, -33.796851495093577], [24.67785322439212, -33.987175795224537], [23.594043409934635, -33.794474379208147], [22.988188917744729, -33.916430759416976], [22.574157342222232, -33.864082533505304], [21.542799106541022, -34.258838799782922], [20.689052768646999, -34.417175388325226], [20.071261020597628, -34.795136814107984], [19.616405063564567, -34.819166355123706], [19.193278435958714, -34.462598972309777], [18.855314568769867, -34.444305515278458], [18.424643182049376, -33.997872816708963], [18.377410922934612, -34.13652068454806], [18.244499139079917, -33.867751560198023], [18.250080193767442, -33.281430759414434], [17.925190463948436, -32.61129078545342], [18.247909783611185, -32.429131361624563], [18.221761508871477, -31.661632989225662], [17.566917758868861, -30.72572112398754], [17.0644161312627, -29.878641045859158], [17.06291751472622, -29.875953871379977], [16.344976840895239, -28.576705010697697], [16.824017368240899, -28.082161553664466], [17.218928663815401, -28.355943291946804], [17.387497185951499, -28.783514092729774], [17.836151971109526, -28.856377862261311], [18.464899122804745, -29.045461928017271], [19.002127312911082, -28.972443129188857], [19.89473432788861, -28.461104831660769], [19.895767856534427, -24.767790215760588], [20.165725538827186, -24.917961928000768], [20.758609246511831, -25.868136488551446], [20.666470167735437, -26.477453301704916], [20.889609002371731, -26.828542982695907], [21.60589603036939, -26.726533705351748], [22.105968865657864, -26.28025603607913], [22.579531691180584, -25.979447523708142], [22.824271274514896, -25.500458672794768], [23.312096795350179, -25.268689873965712], [23.733569777122703, -25.39012948985161], [24.211266717228792, -25.670215752873567], [25.025170525825782, -25.719670098576891], [25.664666375437712, -25.486816094669706], [25.765848829865206, -25.174845472923671], [25.941652052522151, -24.696373386333214], [26.485753208123292, -24.616326592713097], [26.78640669119741, -24.240690606383478], [27.119409620886238, -23.574323011979772], [28.017235955525244, -22.827753594659072], [29.432188348109033, -22.091312758067584], [29.839036899542965, -22.102216485281172], [30.322883335091767, -22.271611830333931], [30.659865350067083, -22.151567478119912], [31.191409132621278, -22.251509698172395], [31.670397983534645, -23.658969008073861], [31.930588820124242, -24.369416599222532], [31.752408481581874, -25.484283949487406], [31.837777947728057, -25.843331801051342], [31.333157586397899, -25.660190525008943], [31.044079624157146, -25.731452325139436], [30.949666782359905, -26.022649021104144], [30.676608514129633, -26.398078301704604], [30.685961948374477, -26.743845310169526], [31.282773064913325, -27.285879408478991], [31.868060337051073, -27.17792734142127], [32.071665480281062, -26.733820082304902], [32.830120477028878, -26.74219166433619], [32.580264926897677, -27.470157566031808], [32.462132602678444, -28.30101124442055], [32.203388706193032, -28.752404880490065], [31.521001417778869, -29.257386976846245]], [[28.978262566857236, -28.955596612261708], [28.541700066855491, -28.647501722937562], [28.07433841320778, -28.851468601193581], [27.532511020627471, -29.242710870075353], [26.999261915807629, -29.875953871379977], [27.749397006956478, -30.645105889612214], [28.107204624145421, -30.545732110314944], [28.291069370239903, -30.226216729454293], [28.848399692507734, -30.070050551068245], [29.018415154748016, -29.743765557577362], [29.325166456832587, -29.257386976846245], [28.978262566857236, -28.955596612261708]]] } }, + { "type": "Feature", "properties": { "admin": "Zambia", "name": "Zambia", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[32.759375441221316, -9.230599053589058], [33.231387973775291, -9.676721693564799], [33.485687697083584, -10.525558770391111], [33.315310499817279, -10.796549981329695], [33.114289178201908, -11.607198174692311], [33.306422153463068, -12.435778090060214], [32.991764357237876, -12.783870537978272], [32.688165317523122, -13.712857761289273], [33.214024692525207, -13.97186003993615], [30.179481235481827, -14.796099134991525], [30.274255812305103, -15.507786960515208], [29.51683434420314, -15.644677829656386], [28.947463413211256, -16.043051446194436], [28.825868768028492, -16.389748630440611], [28.467906121542676, -16.468400160388843], [27.598243442502753, -17.290830580314005], [27.044427117630729, -17.938026218337427], [26.706773309035633, -17.961228936436477], [26.381935255648919, -17.846042168857892], [25.264225701608005, -17.736539808831413], [25.084443393664564, -17.661815687737366], [25.076950310982255, -17.578823337476617], [24.6823490740015, -17.35341073981947], [24.033861525170771, -17.29584319424632], [23.215048455506057, -17.52311614346598], [22.562478468524255, -16.89845142992181], [21.887842644953867, -16.080310153876876], [21.933886346125913, -12.898437188369357], [24.016136508894672, -12.91104623784857], [23.930922072045373, -12.565847670138854], [24.079905226342838, -12.191296888887361], [23.904153680118181, -11.722281589406318], [24.017893507592586, -11.237298272347088], [23.912215203555714, -10.926826267137512], [24.257155389103982, -10.951992689663655], [24.314516228947948, -11.262826429899269], [24.783169793402948, -11.238693536018962], [25.418118116973197, -11.330935967659958], [25.752309604604726, -11.784965101776356], [26.55308759939961, -11.924439792532125], [27.164419793412456, -11.608748467661071], [27.38879886242378, -12.132747491100663], [28.15510867687998, -12.272480564017894], [28.52356163912102, -12.698604424696679], [28.934285922976834, -13.248958428605132], [29.699613885219485, -13.257226657771827], [29.616001417771223, -12.178894545137307], [29.341547885869087, -12.36074391037241], [28.642417433392346, -11.971568698782312], [28.372253045370421, -11.793646742401389], [28.496069777141763, -10.789883721564044], [28.673681674928922, -9.605924981324931], [28.449871046672818, -9.164918308146083], [28.734866570762495, -8.526559340044576], [29.002912225060467, -8.40703175215347], [30.34608605319081, -8.238256524288216], [30.740015496551781, -8.340007419470913], [31.157751336950042, -8.594578747317362], [31.55634809746649, -8.76204884199864], [32.191864861791963, -8.930358981973276], [32.759375441221316, -9.230599053589058]]] } }, + { "type": "Feature", "properties": { "admin": "Zimbabwe", "name": "Zimbabwe", "continent": "Africa" }, "geometry": { "type": "Polygon", "coordinates": [[[31.191409132621278, -22.251509698172395], [30.659865350067083, -22.151567478119912], [30.322883335091767, -22.271611830333931], [29.839036899542965, -22.102216485281172], [29.432188348109033, -22.091312758067584], [28.794656202924209, -21.639454034107445], [28.02137007010861, -21.485975030200578], [27.727227817503252, -20.851801853114711], [27.724747348753247, -20.499058526290387], [27.296504754350501, -20.391519870690995], [26.164790887158478, -19.293085625894935], [25.850391473094724, -18.714412937090533], [25.649163445750155, -18.536025892818987], [25.264225701608005, -17.736539808831413], [26.381935255648919, -17.846042168857892], [26.706773309035633, -17.961228936436477], [27.044427117630729, -17.938026218337427], [27.598243442502753, -17.290830580314005], [28.467906121542676, -16.468400160388843], [28.825868768028492, -16.389748630440611], [28.947463413211256, -16.043051446194436], [29.51683434420314, -15.644677829656386], [30.274255812305103, -15.507786960515208], [30.338954705534537, -15.880839125230242], [31.173063999157673, -15.860943698797868], [31.636498243951188, -16.071990248277881], [31.852040643040592, -16.319417006091374], [32.328238966610222, -16.392074069893749], [32.847638787575839, -16.713398125884613], [32.849860874164385, -17.979057305577175], [32.654885695127142, -18.672089939043492], [32.611994256324884, -19.419382826416268], [32.772707960752619, -19.715592136313294], [32.659743279762573, -20.30429005298231], [32.508693068173436, -20.395292250248303], [32.244988234188007, -21.116488539313689], [31.191409132621278, -22.251509698172395]]] } } + ] + }; + +var randomcountriesData1 = [ + { country: "Iran", "continent": "Asia", "CategoryName": "Books", "Sales": 550 }, + { country: "Benin", "continent": "Africa", "CategoryName": "Books", "Sales": 1000 }, + { country: "China", "continent": "Asia", "CategoryName": "Books", "Sales": 420 }, + { country: "Chile", "continent": "South America", "CategoryName": "Books", "Sales": 1100 }, + { country: "Cuba", "continent": "North America", "CategoryName": "Books", "Sales": 450 }, + { country: "Spain", "continent": "Europe", "CategoryName": "Books", "Sales": 1200 }, + { country: "Fiji", "continent": "Oceania", "CategoryName": "Books", "Sales": 618.0 }, +]; + +module mapcomponenet { + $(function () { + var mapsample = new ej.datavisualization.Map($("#map"), { + enableAnimation: true, + navigationControl: { + enableNavigation: true, + orientation: 'vertical', + absolutePosition: { x: 5, y: 15 }, + dockPosition: 'none' + }, + layers: [ + { + layerType: 'geometry', + enableMouseHover: false, + enableSelection: false, + shapeSettings: { + fill: "#626171", + autoFill: false, + highlightStroke: "white", + stroke: "white", + strokeThickness: 0.5, + highlightColor: "#BFBFBF" + }, + shapeData: world_map, + legendSettings: { dockOnMap: false } + } + ] + }); + }); +} + + + + + + + +module MenuComponent { + $(function () { + var sample = new ej.Menu($("#syncfusionProducts"),{ + width: "100%", + animationType: ej.AnimationType.Default, + cssClass: 'gradient-lime ', + enableAnimation: true, + enableSeparator: true, + height: 40, + htmlAttributes: { "aria-label": "menu" }, + menuType: "normalmenu", + orientation: ej.Orientation.Horizontal, + showRootLevelArrows: true, + showSubLevelArrows: true, + subMenuDirection: ej.Direction.Right, + titleText: "Menu", + + }); + }); + +} + + + + + + + + +module NavigationDrawerComponent { + $(function () { + var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { + targetId: "butdrawer", + contentId: "content_container", + type: "overlay", + direction: "left", + enableListView: true, + listViewSettings: { + width: 300, + selectedItemIndex: 0 + }, + position: "normal" + }); + $("#navpane_listview").click(function(e: any) { + var text=e.target["text"]||$(e.target).closest("li.e-list").text(); + $("#butdrawer").parent().children("h2").text(text); + }); + }); +} + + + +module PDFViewerComponent { + $(function () { + var pdfviewerControl = new ej.PdfViewer($("#pdfviewer"), { + serviceUrl:(window).baseurl+ "api/PdfViewer", + isResponsive: true + }); + }); +} + + + +module PivotChartOlap { + $(function () { + var sample = new ej.PivotChart($("#PivotChart"),{ + dataSource: { + data: "http://bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + } + ], + axis: "columns" + } + ], + filters:[] + }, + isResponsive: true,zooming:{enableScrollbar: true}, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, + primaryYAxis: { title: { text: "Internet Sales Amount" } }, + legend: { visible: true, rowCount: 2 } + }); + }); +} + + + +var pivot_dataset = [ + { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, + { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, + { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, + { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, + { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, + { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, + { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, + { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, + { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, + { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, + { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, + { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, + { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, + { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, + { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, + { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, + { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, + { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, + { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, + { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } +] + +module PivotChartRelational { + + $(function () { + var sample = new ej.PivotChart($("#PivotChart"),{ + dataSource: { + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + }, + { + fieldName: "Date", + fieldCaption: "Date" + } + ], + columns: [ + { + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + } + ], + filters:[] + }, + isResponsive: true,zooming:{enableScrollbar: true}, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryYAxis: { title: { text: "Amount" } }, + legend: { visible: true } + }); + }); +} + + + +module PivotGaugeOlap { + + $(function () { + var sample = new ej.PivotGauge($("#PivotGauge"),{ + dataSource: { + data: "http://bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]", + filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } + }, + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + }, + { + fieldName: "[Measures].[Internet Revenue Status]" + }, + { + fieldName: "[Measures].[Internet Revenue Trend]" + }, + { + fieldName: "[Measures].[Internet Revenue Goal]" + }, + ], + axis: "columns" + } + ], + filters:[] + }, + enableTooltip: true, isResponsive: true, + labelFormatSettings: { decimalPlaces: 2 }, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, + border: { + width: 0.5 + }, + showIndicators: true, showLabels: true, + pointers: [{ + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 + }, + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, + color: "#8c8c8c" + }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -5, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] + }] + }); + }); +} + + + +var pivot_dataset = [ + { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, + { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, + { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, + { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, + { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, + { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, + { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, + { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, + { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, + { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, + { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, + { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, + { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, + { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, + { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, + { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, + { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, + { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, + { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, + { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } +] + +module PivotGaugeRelational { + $(function () { + var sample = new ej.PivotGauge($("#PivotGauge"),{ + dataSource: { + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + }, + { + fieldName: "State", + } + ], + columns: [ + { + fieldName: "Product", + } + ], + values: [ + { + fieldName: "Amount", + }, + { + fieldName: "Quantity", + } + ] + }, + enableTooltip: true, isResponsive: true, + labelFormatSettings: { decimalPlaces: 2 }, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, + border: { + width: 0.5 + }, + showIndicators: true, showLabels: true, + pointers: [{ + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 + }, + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], + ticks: [{ + type: "major", + distanceFromScale: 2, + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, + color: "#8c8c8c" + }], + labels: [{ + color: "#8c8c8c" + }], + ranges: [{ + distanceFromScale: -5, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } + }, + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] + }] + }); + }); +} + + + +module PivotGridOlap { + + $(function () { + var sample = new ej.PivotGrid($("#PivotGrid"),{ + dataSource: { + data: "http://bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]", + } + ], + axis: "columns" + } + ], + filters:[] + }, + enableGroupingBar: true, + pivotTableFieldListID:"PivotSchemaDesigner" + }); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + }); +} + + + +var pivot_dataset = [ + { Amount: 100, Country: "Canada", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Alberta" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Van", Quantity: 3, State: "British Columbia" }, + { Amount: 300, Country: "Canada", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Brunswick" }, + { Amount: 150, Country: "Canada", Date: "FY 2008", Product: "Bike", Quantity: 3, State: "Manitoba" }, + { Amount: 200, Country: "Canada", Date: "FY 2006", Product: "Car", Quantity: 4, State: "Ontario" }, + { Amount: 100, Country: "Canada", Date: "FY 2007", Product: "Van", Quantity: 1, State: "Quebec" }, + { Amount: 200, Country: "France", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Charente-Maritime" }, + { Amount: 250, Country: "France", Date: "FY 2006", Product: "Van", Quantity: 4, State: "Essonne" }, + { Amount: 300, Country: "France", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Garonne (Haute)" }, + { Amount: 150, Country: "France", Date: "FY 2008", Product: "Van", Quantity: 2, State: "Gers" }, + { Amount: 200, Country: "Germany", Date: "FY 2006", Product: "Van", Quantity: 3, State: "Bayern" }, + { Amount: 250, Country: "Germany", Date: "FY 2007", Product: "Car", Quantity: 3, State: "Brandenburg" }, + { Amount: 150, Country: "Germany", Date: "FY 2008", Product: "Car", Quantity: 4, State: "Hamburg" }, + { Amount: 200, Country: "Germany", Date: "FY 2008", Product: "Bike", Quantity: 4, State: "Hessen" }, + { Amount: 150, Country: "Germany", Date: "FY 2007", Product: "Van", Quantity: 3, State: "Nordrhein-Westfalen" }, + { Amount: 100, Country: "Germany", Date: "FY 2005", Product: "Bike", Quantity: 2, State: "Saarland" }, + { Amount: 150, Country: "United Kingdom", Date: "FY 2008", Product: "Bike", Quantity: 5, State: "England" }, + { Amount: 250, Country: "United States", Date: "FY 2007", Product: "Car", Quantity: 4, State: "Alabama" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Van", Quantity: 4, State: "California" }, + { Amount: 100, Country: "United States", Date: "FY 2006", Product: "Bike", Quantity: 2, State: "Colorado" }, + { Amount: 150, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "New Mexico" }, + { Amount: 200, Country: "United States", Date: "FY 2005", Product: "Bike", Quantity: 4, State: "New York" }, + { Amount: 250, Country: "United States", Date: "FY 2008", Product: "Car", Quantity: 3, State: "North Carolina" }, + { Amount: 300, Country: "United States", Date: "FY 2007", Product: "Van", Quantity: 4, State: "South Carolina" } +] + +module PivotGridRelational { + $(function () { + var sample = new ej.PivotGrid($("#PivotGrid"),{ + dataSource: { + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + } + ], + columns: + [{ + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + }, + { + fieldName: "Quantity", + fieldCaption: "Quantity" + } + ], + filters:[] + }, + enableGroupingBar: true, + pivotTableFieldListID:"PivotSchemaDesigner" + }); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + + }); +} + + + +module PivotTreeMap { + $(function () { + var sample = new ej.PivotTreeMap($("#PivotTreeMap"),{ + dataSource: { + data: "http://bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + columns: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Customer Count]", + } + ], + axis: "columns" + } + ], + filters:[] + } + }); + }); +} + + + +module ProgressBarComponent { + $(function () { + var sample = new ej.ProgressBar($("#progressBar"),{ + width: 200, + value: 45, + height: 20, + enablePersistence: true, + maxValue: 200, + minValue: 0, + showRoundedCorner: true, + text: 'loading...' + }); + }); + +} + + + + +declare var rteObj: any; +declare var data: any; +var radialEle = $('#defaultradialmenu'), action = 0, forRedo = 0; +var rteEle = $("#rteSample1"); +module RadialMenuComponent { + $(function () { + + if (!(ej.browserInfo().name == "msie" && parseInt(ej.browserInfo().version) < 9)) { + var radialmenuInstance = new ej.RadialMenu($("#defaultradialmenu"), { + imageClass: "imageclass", + backImageClass: "backimageclass", + targetElementId: "radialtarget1" + }); + $("#radialtarget1").parent().css("position", "relative"); + } + else { + $("#contentDiv").html("Radial Menu is only supported from Internet Explorer Versioned 9 and above.").css({ "font-size": "20px", "color": "red" }); + } + var rteInstance = new ej.RTE($("#rteSample1"), { + width: "100%", + minWidth: "10px", + change: (e) => { radialEle.ejRadialMenu("enableItem", "Undo"); }, + select: (e) => { + var target = $("#radialtarget1"), radialRadius = 150, radialDiameter = 2 * radialRadius, + // To get Iframe positions + iframeY = e.event.clientY, iframeX = e.event.clientX, + // To set Radial Menu position within target + x = iframeX > target.width() - radialRadius ? target.width() - radialDiameter : (iframeX > radialRadius ? iframeX - radialRadius : 0), + y = iframeY > target.height() - radialRadius ? target.height() - radialDiameter : (iframeY > radialRadius ? iframeY - radialRadius : 0); + radialEle.ejRadialMenu("setPosition", x, y); + radialEle.focus(); + $('iframe').contents().find('body').blur(); + }, + showToolbar: false, + showContextMenu: false + }); + $(window).resize(function () { + if (ej.isMobile() && ej.isPortrait()) + $('#defaultradialmenu').css({ "left": 25 }); + }); + }); +} + + +function bold(e: any) { + + rteObj = rteEle.data("ejRTE"); + rteObj.executeCommand("bold"); + data = rteObj._getSelectedHtmlString() ? true : false; + if (data) action += 1; + forRedo = action; + radialEle.focus(); +} +function italic(e: any) { + rteObj = rteEle.data("ejRTE"); + rteObj.executeCommand("italic"); + data = rteObj._getSelectedHtmlString() ? true : false; + if (data) action += 1; + forRedo = action; + radialEle.focus(); +} +function undo(e: any) { + rteObj = rteEle.data("ejRTE"); + rteObj.executeCommand("undo"); + action -= 1; + if (action == 0) + radialEle.ejRadialMenu("disableItem", "Undo"); + radialEle.ejRadialMenu("enableItem", "Redo"); + radialEle.focus(); +} +function redo(e: any) { + rteObj = rteEle.data("ejRTE"); + rteObj.executeCommand("redo"); + action += 1; + if (forRedo == action) radialEle.ejRadialMenu("disableItem", "Redo"); + radialEle.ejRadialMenu("enableItem", "Undo"); + radialEle.focus(); +} + + + + +module RadialSliderComponent { + $(function () { + var radialsliderInstance = new ej.RadialSlider($("#radialSlider"), { + innerCircleImageUrl: "../images/radialslider/chevron-right.png" + }); + }); +} + + +module rangecomponent { + $(function () { + var linearsample = new ej.datavisualization.RangeNavigator($("#RangeNavigator"), { + enableDeferredUpdate: true, + padding: "15", + allowSnapping: true, + selectedRangeSettings: { + start: "2010/5/1", end: "2011/10/1" + }, + isResponsive: true, + tooltipSettings: { + visible: true, labelFormat: "MM/dd/yyyy", backgroundColor: "gray", tooltipDisplayMode: "ondemand" + }, + load: () => { + var rn = $("#RangeNavigator").data("ejRangeNavigator"); + rn.model.series = [ + { + type: 'line', + dataSource: data.Open, xName: "XValue", yName: "YValue", + fill: '#69D2E7' + } + ]; + } + + }); + }); +} +var data; +data = GetData(); + +function GetData() { + var series1:any[]=[]; + var series2:any[]= []; + var value = 100; + var value1 = 120; + for (var i = 1; i < 730; i++) { + + if (Math.random() > .5) { + value += Math.random(); + value1 += Math.random(); + } else { + value -= Math.random(); + value1 -= Math.random(); + } + var point1 = { XValue: new Date(2010, 0, i), YValue: value }; + var point2 = { XValue: new Date(2010, 0, i), YValue: value1 }; + series1.push(point1); + series2.push(point2); + } + + data = { Open: series1, Close: series2 }; + return data; +}; + + + +module RatingComponent { + $(function () { + + var sample1 = new ej.Rating($("#fullRating"),{ + value: 4, + precision: ej.Rating.Precision.Full, + allowReset: true, + cssClass: "gradient-lime", + enabled: true, + enablePersistence: true, + incrementStep: 2, + maxValue: 10, + minValue: 0, + orientation: ej.Orientation.Horizontal, + shapeHeight: 25, + shapeWidth: 25, + showTooltip: true + }); + + var sample2 = new ej.Rating($("#halfRating"),{ + precision: ej.Rating.Precision.Half, + value: 3.5, + allowReset: true, + cssClass: "gradient-lime", + enabled: true, + enablePersistence: true, + incrementStep: 2, + maxValue: 10, + minValue: 0, + orientation: "horizontal", + shapeHeight: 25, + shapeWidth: 25, + showTooltip: true + }); + + var sample3 = new ej.Rating($("#exactRating"),{ + precision: ej.Rating.Precision.Exact, + value: 3.7, + allowReset: true, + cssClass: "gradient-lime", + enabled: true, + enablePersistence: true, + incrementStep: 2, + maxValue: 10, + minValue: 0, + orientation: "horizontal", + shapeHeight: 25, + shapeWidth: 25, + showTooltip: true + }); + }); + +} + + + +module ReportViewerComponent { + $(function () { + var report = new ej.ReportViewer($("#territoryReportViewer"), { + reportServiceUrl: (window).baseurl + 'api/ReportViewer', + reportServerUrl: 'http://mvc.syncfusion.com/reportserver', + processingMode: ej.ReportViewer.ProcessingMode.Remote, + reportPath: "/SSRSSamples2/Territory Sales new", + isResponsive: true + }); + }); +} + + + +var fontfamily = ["Segoe UI", "Arial", "Times New Roman", "Tahoma", "Helvetica"], fontsize = ["1pt", "2pt", "3pt", "4pt", "5pt"], action1 = ["New", "Clear"], action2 = ["Bold", "Italic", "Underline", "strikethrough", "superscript", "subscript", "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyFull", "Undo", "Redo"]; +module RibbonComponent { + $(function () { + var sample = new ej.Ribbon($("#defaultRibbon"), { + width: "100%", + expandPinSettings: { + toolTip: "Collapse the Ribbon" + }, + collapsePinSettings: { + toolTip: "Pin the Ribbon" + }, + applicationTab: { + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + }, + tabs: [{ + id: "home", text: "HOME", groups: [{ + text: "New", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "new", + text: "New", + toolTip: "New", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-new" + } + } + ], + defaults: { + type: "button", + width: 60, + height: 70 + } + }] + }, + { + text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{ + groups: [{ + id: "paste", + text: "paste", + toolTip: "Paste", + splitButtonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-ribbonpaste", + targetID: "pasteSplit", + buttonMode: "dropdown", + arrowPosition: ej.ArrowPosition.Bottom + } + } + ], + defaults: { + type: "splitbutton", + width: 50, + height: 70 + } + }, + { + groups: [{ + id: "cut", + text: "Cut", + toolTip: "Cut", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + prefixIcon: "e-icon e-ribbon e-ribboncut" + } + }, + { + id: "copy", + text: "Copy", + toolTip: "Copy", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + prefixIcon: "e-icon e-ribbon e-ribboncopy" + } + }, + { + id: "clear", + text: "Clear", + toolTip: "Clear All", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + prefixIcon: "e-icon e-ribbon clearAll" + } + }], + defaults: { + type: "button", + width: 60, + isBig: false + } + }] + }, + { + text: "Font", alignType: "rows", content: [{ + groups: [{ + id: "fontfamily", + toolTip: "Font", + dropdownSettings: { + dataSource: fontfamily, + text: "Segoe UI", + width: 150 + } + }, + { + id: "fontsize", + toolTip: "FontSize", + dropdownSettings: { + dataSource: fontsize, + text: "1pt", + width: 65 + } + }], + defaults: { + type: "dropdownlist", + height: 28 + } + }, + { + groups: [{ + id: "bold", + toolTip: "Bold", + type: ej.Ribbon.Type.ToggleButton, + toggleButtonSettings: { + contentType: ej.ContentType.ImageOnly, + defaultText: "Bold", + activeText: "Bold", + defaultPrefixIcon: "e-icon e-ribbon bold", + activePrefixIcon: "e-icon e-ribbon bold" + } + }, + { + id: "italic", + toolTip: "Italic", + type: ej.Ribbon.Type.ToggleButton, + toggleButtonSettings: { + contentType: ej.ContentType.ImageOnly, + defaultText: "Italic", + activeText: "Italic", + defaultPrefixIcon: "e-icon e-ribbon e-ribbonitalic", + activePrefixIcon: "e-icon e-ribbon e-ribbonitalic" + } + }, + { + id: "underline", + text: "Underline", + toolTip: "Underline", + type: ej.Ribbon.Type.ToggleButton, + toggleButtonSettings: { + contentType: ej.ContentType.ImageOnly, + defaultText: "Underline", + activeText: "Underline", + defaultPrefixIcon: "e-icon e-ribbon e-ribbonunderline", + activePrefixIcon: "e-icon e-ribbon e-ribbonunderline" + } + }, + { + id: "strikethrough", + text: "strikethrough", + toolTip: "Strikethrough", + type: ej.Ribbon.Type.ToggleButton, + toggleButtonSettings: { + contentType: ej.ContentType.ImageOnly, + defaultText: "Strikethrough", + activeText: "Strikethrough", + defaultPrefixIcon: "e-icon e-ribbon strikethrough", + activePrefixIcon: "e-icon e-ribbon strikethrough" + } + }, + { + id: "superscript", + text: "superscript", + toolTip: "Superscript", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-superscripticon" + } + }, + { + id: "subscript", + text: "subscript", + toolTip: "Subscript", + enableSeparator: true, + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-subscripticon" + } + }, + { + id: "fontcolor", + text: "Font Color", + toolTip: "Font Color", + type: ej.Ribbon.Type.Custom, + contentID: "fontcolor" + }, + { + id: "fillcolor", + text: "Fill Color", + toolTip: "Fill Color", + type: ej.Ribbon.Type.Custom, + contentID: "fillcolor" + } + ], + defaults: { + isBig: false + } + }] + }, + { + text: "Alignment", alignType: ej.Ribbon.AlignType.Rows, content: [ + { + groups: [{ + id: "bullet", + text: "Bullet Format", + toolTip: "Bullets", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-bullet" + } + }, + { + id: "number", + text: "Number Format", + toolTip: "Numbering", + enableSeparator: true, + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-numbericon" + } + }, + { + id: "textindent", + text: "Indent", + toolTip: "Text Indent", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-indent" + } + }, + { + id: "textoudent", + text: "Outdent", + toolTip: "Text Outdent", + enableSeparator: true, + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-outdent" + } + }, + { + id: "sortascending", + text: "Sort", + toolTip: "Sort", + enableSeparator: true, + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-sort" + } + }, + { + id: "border", + text: "Border", + toolTip: "Border", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-border" + } + }], + defaults: { + type: "button", + isBig: false + } + }, + { + groups: [{ + id: "alignleft", + text: "JustifyLeft", + toolTip: "Align Left", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon alignleft" + } + }, + { + id: "aligncenter", + text: "JustifyCenter", + toolTip: "Align Center", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon aligncenter" + } + }, + { + id: "alignright", + text: "JustifyRight", + toolTip: "Align Right", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon alignright" + } + }, + { + id: "justify", + text: "JustifyFull", + toolTip: "Justify", + enableSeparator: true, + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon justify" + } + }, + { + id: "uppercase", + text: "Upper Case", + toolTip: "Upper Case", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-uppercase" + } + }, + { + id: "lowercase", + text: "Lower Case", + toolTip: "Lower Case", + buttonSettings: { + contentType: ej.ContentType.ImageOnly, + prefixIcon: "e-icon e-ribbon e-lowercase" + } + }], + defaults: { + type: "button", + isBig: false + } + }] + }, + { + text: "Actions", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "undo", + text: "Undo", + toolTip: "Undo", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-undo" + } + }, + { + id: "redo", + text: "Redo", + toolTip: "Redo", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-redo" + } + } + ], + defaults: { + type: "button", + width: 40, + height: 70 + } + }] + }, + { + text: "View", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "zoomin", + text: "Zoom In", + toolTip: "Zoom In", + buttonSettings: { + width: 58, + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-zoomin" + } + }, + { + id: "zoomout", + text: "Zoom Out", + toolTip: "Zoom Out", + buttonSettings: { + width: 70, + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-zoomout" + } + }, + { + id: "fullscreen", + text: "Full Screen", + toolTip: "Full Screen", + buttonSettings: { + width: 73, + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-fullscreen" + } + } + ], + defaults: { + type: "button", + height: 70 + } + }] + }] + },{ + id: "insert", text: "INSERT", groups: [{ + text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{ + groups: [{ + id: "tables", + text: "Tables", + toolTip: "Tables", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-table" + } + } + ], + defaults: { + type: "button", + width: 50, + height: 70 + } + }] + }, + { + text: "Illustrations", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "pictures", + text: "Pictures", + toolTip: "Pictures", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-picture" + } + }, + { + id: "videos", + text: "Videos", + toolTip: "Videos", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-video" + } + }, + { + id: "shapes", + text: "Shapes", + toolTip: "Shapes", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-shape" + } + }, + { + id: "charts", + text: "Charts", + toolTip: "Charts", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-chart" + } + } + ], + defaults: { + type: "button", + width: 56, + height: 70 + } + }] + }, + { + text: "Comments", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "comments", + text: "Comments", + toolTip: "Comments", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-comment" + } + } + ], + defaults: { + type: "button", + width: 70, + height: 70 + } + }] + }, + { + text: "Text", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "text", + text: "Text", + toolTip: "Text", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-text", + width: 50 + } + }, + { + id: "datetime", + text: "Date Time", + toolTip: "DateTime", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-datetimenew" + } + } + ], + defaults: { + type: "button", + width: 70, + height: 70 + } + }] + }, + { + text: "Hyperlink", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "hyperlink", + text: "Hyperlink", + toolTip: "Hyperlink", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-hyperlink" + } + } + ], + defaults: { + type: "button", + width: 70, + height: 70 + } + }] + }, + { + text: "Equation", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "equation", + text: "Equation", + toolTip: "Equation", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-equation" + } + } + ], + defaults: { + type: "button", + width: 60, + height: 70 + } + }] + }, + { + text: "Print Layout", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "printlayout", + text: "Print Layout", + toolTip: "Print Layout", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-printlayout" + } + } + ], + defaults: { + type: "button", + width: 80, + height: 70 + } + }] + }, + { + text: "Save", alignType: ej.Ribbon.AlignType.Rows, content: [{ + groups: [{ + id: "print", + text: "Print", + toolTip: "Print", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-print" + } + }, + { + id: "save", + text: "Save", + toolTip: "Save", + buttonSettings: { + contentType: ej.ContentType.TextAndImage, + imagePosition: ej.ImagePosition.ImageTop, + prefixIcon: "e-icon e-ribbon e-save" + } + } + ], + defaults: { + type: "button", + width: 50, + height: 70 + } + }] + } + ] + } + ], + create: function createControl(args) { + var ribbon = $("#defaultRibbon").data("ejRibbon"); + $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); + $("#fillcolor").ejColorPicker({ value: "#FF0000", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fillcoloricon", select: colorHandler }); + } + }); + }); +} +function colorHandler(args:any) { + (this._id.indexOf("fillcolor") != -1) ? $("#contenteditor").css('background-color', args.value) : document.execCommand('forecolor', false, args.value); +} + + + + + + +module RotatorComponent { + $(function () { + var rotatorInstance = new ej.Rotator($("#sliderContent"), { + slideWidth: "100%", + frameSpace: "0px", + slideHeight: "auto", + displayItemsCount: "1", + navigateSteps: "1", + pagerPosition:"outside", + orientation: "horizontal", + showPager: true, + enabled: true, + showCaption: true, + allowKeyboardNavigation: true, + showPlayButton: true, + isResponsive:true, + animationType: "slide", + }); + }); +} + + + +module RTEComponent { + $(function () { + var sample = new ej.RTE($("#rteSample"),{ + width: "100%", + minWidth: "150px", + showFooter: true, + showHtmlSource: true, + allowEditing: true, + allowKeyboardNavigation: true, + autoFocus: true, + autoHeight: true, + colorPaletteColumns: 10, + colorPaletteRows: 5, + cssClass: 'gradient-lime', + enableResize: true, + enableTabKeyNavigation: true, + fileBrowser: { + filePath: (window).baseurl + "Content/FileBrowser/", + extensionAllow: "*.png, *.doc, *.pdf, *.txt, *.docx", + ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" + }, + imageBrowser: { + filePath: (window).baseurl + "Content/FileBrowser/", + extensionAllow: "*.png, *.gif, *.jpg, *.jpeg, *.docx", + ajaxAction: (window).baseurl + "api/FileExplorer/FileOperations" + }, + isResponsive: true, + showClearAll: true, + showClearFormat: true, + showDimensions: true, + showCharCount: true, + tools: { + formatStyle: ["format"], + edit: ["findAndReplace"], + font: ["fontName", "fontSize", "fontColor", "backgroundColor"], + style: ["bold", "italic", "underline", "strikethrough"], + alignment: ["justifyLeft", "justifyCenter", "justifyRight", "justifyFull"], + lists: ["unorderedList", "orderedList"], + clipboard: ["cut", "copy", "paste"], + doAction: ["undo", "redo"], + indenting: ["outdent", "indent"], + clear: ["clearFormat", "clearAll"], + links: ["createLink", "removeLink"], + images: ["image"], + media: ["video"], + tables: ["createTable", "addRowAbove", "addRowBelow", "addColumnLeft", "addColumnRight", "deleteRow", "deleteColumn", "deleteTable"], + effects: ["superscript", "subscript"], + casing: ["upperCase", "lowerCase"], + view: ["fullScreen", "zoomIn", "zoomOut"], + print: ["print"], + customUnorderedList: [{ + name: "unOrderInsert", + tooltip: "Custom UnOrderList", + css: "e-rte-toolbar-icon e-rte-unlistitems customUnOrder", + text: "Smiley", + listImage: "url('../content/images/rte/Smiley-GIF.gif')" + }], + customOrderedList: [{ + name: "orderInsert", + tooltip: "Custom OrderList", + css: "e-rte-toolbar-icon e-rte-listitems customOrder", + text: "Lower-Greek", + listStyle: "lower-greek" + }] + } + }); + }); + +} + + + +module ScheduleComponent { + $(function () { + var sample = new ej.Schedule($("#Schedule1"), { + width: "100%", + height: "525px", + currentDate: new Date(2014, 4, 5), + timeScale: { + minorSlotCount: 4, + majorSlot: 60 + }, + contextMenuSettings: { + enable: true, + menuItems: { + appointment: [ + { id: "open", text: "Open Appointment" }, + { id: "delete", text: "Delete Appointment" }, + { id: "customMenu3", text: "Menu Item 3" }, + { id: "customMenu4", text: "Menu Item 4" } + ], + cells: [ + { id: "new", text: "New Appointment" }, + { id: "recurrence", text: "New Recurring Appointment" }, + { id: "today", text: "Today" }, + { id: "gotodate", text: "Go to date" }, + { id: "settings", text: "Settings" }, + { id: "view", text: "View", parentId: "settings" }, + { id: "timemode", text: "TimeMode", parentId: "settings" }, + { id: "view_Day", text: "Day", parentId: "view" }, + { id: "view_Week", text: "Week", parentId: "view" }, + { id: "view_Workweek", text: "Workweek", parentId: "view" }, + { id: "view_Month", text: "Month", parentId: "view" }, + { id: "timemode_Hour12", text: "12 Hours", parentId: "timemode" }, + { id: "timemode_Hour24", text: "24 Hours", parentId: "timemode" }, + { id: "workhours", text: "Work Hours", parentId: "settings" }, + { id: "customMenu1", text: "Menu Item 1" }, + { id: "customMenu2", text: "Menu Item 2" } + ] + } + }, + resources: [{ + field: "ownerId", + title: "Owner", + name: "Owners", allowMultiple: true, + resourceSettings: { + dataSource: [ + { text: "Nancy", id: 1, groupId: 1, color: "#f8a398" }, + { text: "Steven", id: 3, groupId: 2, color: "#56ca85" }, + { text: "Michael", id: 5, groupId: 1, color: "#51a0ed" } + ], + text: "text", id: "id", groupId: "groupId", color: "color" + } + }], + appointmentSettings: { + dataSource: new ej.DataManager((window).Default).executeLocal(new ej.Query().take(10)), + id: "Id", + subject: "Subject", + startTime: "StartTime", + endTime: "EndTime", + description: "Description", + allDay: "AllDay", + recurrence: "Recurrence", + recurrenceRule: "RecurrenceRule", + resourceFields: "ownerId" + } + }); + }); +} + + + +module ScrollerComponent { + $(function () { + var scrollerSample = new ej.Scroller($("#scrollcontent"), { + height: "300px", + width: "100%" + }); + $(window).bind('resize', function () { + scrollerSample.refresh(); + }); }); +} + + + +module SignatureComponent { + $(function () { + var basicSignature = new ej.Signature($("#signature"), { + height: "400px", + isResponsive: true, + strokeWidth: 3 + }); + }); +} + + + + +module SliderComponent { + $(function () { + var slider = new ej.Slider($("#minSlider"), { + sliderType: "MinRange", + height: "16px", + width: "300px", + value: 60, + minValue: 0, + maxValue: 100 + }); + var rangeslider = new ej.Slider($("#rangeSlider"), { + sliderType: "Range", + height: "16px", + width: "300px", + values: [30, 60], + minValue: 0 + }); + + }); +} + + + + + + +module linesparkline { + $(function () { + + var sparklinesample = new ej.Sparkline($("#line"), { + dataSource: [12, 14, 11, 12, 11, 15, 12, 10, 11, 12, 15, 13, 12, 11, 10, 13, 15, 12, 14, 16, 14, 12, 11], + tooltip: { + visible: true, + font: { size:"12px" } + }, + type: "line", + size: { height: "40", width:"170" }, + }); + }); +} + +module columnsparkline { + $(function () { + var sparkcolumnsample = new ej.Sparkline($("#column"), { + dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10,], + negativePointColor: "red", + highPointColor: "blue", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + type: "column", + size: { height: "100", width: "150" }, + }); + }); +} + +module areasparkline { + $(function () { + var sparkareasample = new ej.Sparkline($("#area"), { + dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10,], + markerSettings: { visible: true }, + highPointColor: "blue", + lowPointColor: "orange", + type: "area", + opacity: 0.5, + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "100", width: "150" }, + }); + }); +} + +module windlosssparkline { + $(function () { + var sparkwinlosssample = new ej.Sparkline($("#winloss"), { + dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10,], + type: "winloss", + size: { height: "100", width: "150" }, + }); + }); +} + +module piesparkline1 { + $(function () { + var sparkpiesample1 = new ej.Sparkline($("#pie1"), { + dataSource: [4, 6, 7], + type: "pie", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "40", width: "40" }, + }); + }); +} + +module piesparkline2 { + $(function () { + var sparkpiesample2 = new ej.Sparkline($("#pie2"), { + dataSource: [8, 9, 1,], + type: "pie", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "40", width: "40" }, + }); + }); +} + +module piesparkline3 { + $(function () { + var sparkpiesample3 = new ej.Sparkline($("#pie3"), { + dataSource: [2, 3, 5], + type: "pie", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "40", width: "40" }, + }); + }); +} + +module piesparkline4 { + $(function () { + var sparkpiesample4 = new ej.Sparkline($("#pie4"), { + dataSource: [10, 12, 11], + type: "pie", + tooltip: { + visible: true, + font: { + size: "12px", + } + }, + size: { height: "40", width: "40" }, + }); + }); +} + + + + + + +module SplitterComponent { + $(function () { + var splitterInstance = new ej.Splitter($("#outterSpliter"), { + height: "250px", + width: "50%", + orientation: ej.Orientation.Vertical, + properties: [{}, { paneSize: 80 }], + isResponsive:true + }); + var splitterInstance1 = new ej.Splitter($("#innerSpliter"), { + isResponsive:true, + }); + }); +} + + + +module SpreadsheetComponent { +$(function () { + var sample = new ej.Spreadsheet($("#basicSpreadsheet"), { + scrollSettings: { + height: 550, + }, + importSettings: { + importMapper: (window).baseurl + "api/Spreadsheet/Import" + }, + exportSettings: { + excelUrl: (window).baseurl + "api/Spreadsheet/ExcelExport", + csvUrl: (window).baseurl + "api/Spreadsheet/CsvExport", + pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" + }, + sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], + loadComplete: () => { + var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; + if (!(spreadsheet).isImport) { + spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); + xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); + xlFormat.format({ "type": "currency" }, "E2:H11"); + spreadsheet.XLRibbon.updateRibbonIcons(); + }} + }); + }); +} + + + + +var default_data: Array = [ + { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup:"Executive", EmployeesCount : 50 }, + { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Marketing", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 55 }, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 175}, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, + { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, + + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, + { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, + { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, + + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, + { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, + { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, + { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, + + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, + { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, + { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, + + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, + { Category : "Employees", Country : "France", JobDescription: "Marketing", EmployeesCount: 50 } +]; + +module sunburstcomponent { + $(function () { + var sunburstsample = new ej.SunburstChart($("#Sunburst"), { + valueMemberPath: "EmployeesCount", + levels: [ + {groupMemberPath: "Country"}, + {groupMemberPath: "JobDescription"}, + {groupMemberPath: "JobGroup"}, + {groupMemberPath: "JobRole"} + ], + dataSource: default_data, + dataLabelSettings:{visible:true}, + tooltip:{visible:false}, + enableAnimation:false, + size:{height:"600"}, + innerRadius:0.2, + title:{text:"Employees Count"}, + zoomSettings:{enable:false}, + legend:{visible:true,position:'top'} + }); + }); +} + + + + +module TabComponent { + $(function () { + var sample = new ej.Tab($("#defaultTab"),{ + width: "500px", + collapsible: true, + events: "click", + heightAdjustMode: ej.Tab.HeightAdjustMode.Content, + showCloseButton: true, + showRoundedCorner: false + }); + }); +} + + + +module TagCloudComponent { + + + var websiteCollection = [ + { text: "Google", url: "http://www.google.com", frequency: 12 }, + { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, + { text: "Arts Technica", url: "http://arstechnica.com/", frequency: 8 }, + { text: "Business Week", url: "http://www.businessweek.com/", frequency: 2 }, + { text: "Yahoo", url: "http://in.yahoo.com/", frequency: 12 }, + { text: "Center Networks", url: "http://www.centernetworks.com/", frequency: 5 }, + { text: "Crave", url: "http://news.cnet.com/crave/", frequency: 8 }, + { text: "Crunch Gear", url: "http://techcrunch.com/gadgets/", frequency: 20 }, + { text: "Daily Tech", url: "http://www.dailytech.com/", frequency: 1 }, + { text: "Electronista", url: "http://www.electronista.com/", frequency: 3 }, + { text: "Engadget", url: "http://www.engadget.com/", frequency: 5 }, + { text: "Gearlog", url: "http://www.gearlog.com/", frequency: 9 }, + { text: "Information Week", url: "http://www.informationweek.com/", frequency: 0 }, + { text: "PCWorld", url: "http://www.pcworld.com/", frequency: 11 }, + { text: "Tech Republic", url: "http://techrepublic.com/", frequency: 3 }, + { text: "Valleywag", url: "http://valleywag.gawker.com/", frequency: 6 }, + { text: "Rediff", url: "http://in.rediff.com/", frequency: 9 }, + { text: "WebProNews", url: "http://www.webpronews.com/", frequency: 2 } + ]; + + $(function () { + var sample = new ej.TagCloud($("#techWebList"), { + titleText: "Tech Sites", + dataSource: websiteCollection, + cssClass: "gradient-lime", + fields: { + text: "text", url: "url", frequency: "frequency" + } + }); + + }); +} + + + +module EditorComponent { + $(function () { + var num = new ej.NumericTextbox($("#numeric"), { + value: 30, + minValue: 1, + maxValue: 100, + name: "numeric", + width: "100%" + }); + var per = new ej.PercentageTextbox($("#percent"), { + value: 60, + minValue: 10, + maxValue: 1000, + name: "percent", + width: "100%" + }); + var cur = new ej.CurrencyTextbox($("#currency"), { + value: 100, + minValue: 10, + maxValue: 1000, + name: "currency", + width: "100%" + }); + var mask = new ej.MaskEdit($("#maskedit"), { + name: "mask", + value: "4242422424", + maskFormat: "99 999-99999", + width: "100%" + }) + }); +} + + + + + +module TileViewComponent { + $(function () { + var tile1 = new ej.Tile($("#tile1"), { + imagePosition:"fill", + caption:{text:"People"}, + tileSize:"medium", + imageUrl:'content/images/tile/windows/people_1.png' + }); + var tile2 = new ej.Tile($("#tile2"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/alerts.png', + + }); + var tile3 = new ej.Tile($("#tile3"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/bing.png', + }); + var tile4 = new ej.Tile($("#tile4"), { + tileSize:"small", + imageUrl:'content/images/tile/windows/camera.png', + }); + var tile5 = new ej.Tile($("#tile5"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/messages.png', + }); + var tile6 = new ej.Tile($("#tile6"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/games.png', + caption:{text:"Play"} + }); + var tile7 = new ej.Tile($("#tile7"), { + tileSize:"medium", + imageUrl:'content/images/tile/windows/map.png', + caption:{text:"Maps"} + }); + var tile8 = new ej.Tile($("#tile8"), { + imagePosition:"fill", + tileSize:"wide", + imageUrl:'content/images/tile/windows/sports.png', + caption:{text:"Sports"} + }); + var tile9 = new ej.Tile($("#tile9"), { + imagePosition:"fill", + tileSize:"medium", + imageUrl:'content/images/tile/windows/people_2.png', + caption:{text:"People"} + }); + var tile10 = new ej.Tile($("#tile10"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/pictures.png', + caption:{text:"Photo"} + }); + var tile11 = new ej.Tile($("#tile11"), { + imagePosition:"center", + tileSize:"wide", + imageUrl:'content/images/tile/windows/weather.png', + caption:{text:"Weather"} + }); + var tile12 = new ej.Tile($("#tile12"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/music.png', + caption:{text:"Music"} + }); + var tile13 = new ej.Tile($("#tile13"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/favs.png', + caption:{text:"Favorites"} + }); + }); +} + + + +module TimePickerComponent { + $(function () { + var timeSample = new ej.TimePicker($("#timepick"), { + width: "100%" + }); + }); +} + + + + +module ToolbarComponent { + + $(function () { + var sample = new ej.Toolbar($("#editingToolbar"),{ + width: "100%", + cssClass: "gradient-lime", + enableSeparator: true, + height: 30, + isResponsive: true, + orientation: ej.Orientation.Horizontal, + showRoundedCorner: true + }); + }); + +} + + + + +module TooltipComponent { + + $(function () { + + var sample1 = new ej.Tooltip($("#link1"),{ + content: "ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.", + associate: "mousefollow", + autoCloseTimeout: 5000, + collision: "fit", + containment: ".frame", + showRoundedCorner: true, + showShadow: true + }); + + var sample2 = new ej.Tooltip($("#link2"),{ + content: "The World Wide Web (WWW) is an information space where documents and other web resources are identified by URLs, interlinked by hypertext links, and can be accessed via the Internet.", + position: { + stem: { + horizontal: "right", + vertical: "center" + }, + target: { + horizontal: "left", + vertical: "center" + } + }, + autoCloseTimeout: 5000, + collision: "fit", + containment: ".frame", + showRoundedCorner: true, + showShadow: true + }); + + var sample3 = new ej.Tooltip($("#link3"),{ + content: 'Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic.', + position: { + stem: { + horizontal: "right", + vertical: "center" + }, + target: { + horizontal: "left", + vertical: "center", + }, + }, + associate: "mousefollow", + autoCloseTimeout: 5000, + collision: "fit", + containment: ".frame", + showRoundedCorner: true, + showShadow: true + }); + }); +} + + + +module TreeGridComponent { + $(function () { + var treegridInstance = new ej.TreeGrid($("#TreeGridContainer"), { + dataSource: (window).treeGridData, + childMapping: "subtasks", + allowSorting: true, + allowMultiSorting: true, + enableAltRow: true, + allowFiltering: true, + treeColumnIndex: 1, + allowKeyboardNavigation: true, + showColumnChooser: true, + showColumnOptions: true, + contextMenuSettings: { + showContextMenu: true, + contextMenuItems: ["add", "edit", "delete"] + }, + columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], + editSettings: { + allowAdding: true, + allowEditing: true, + allowDeleting: true, + editMode: "cellEditing", + rowPosition: "belowSelectedRow" + }, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add","edit","delete","update","cancel","expandAll","collapseAll"] + }, + columns: [ + { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, + { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, + { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } + ], + isResponsive: true, + }); +}); +} + + + + +var population_data: Array = [ + { Continent: "Asia", Country: "Indonesia", Growth: 3, Population: 237641326 }, + { Continent: "Asia", Country: "Russia", Growth: 2, Population: 152518015 }, + { Continent: "Asia", Country: "Malaysia", Growth: 1, Population: 29672000 }, + { Continent: "North America", Country: "United States", Growth: 4, Population: 315645000 }, + { Continent: "North America", Country: "Mexico", Growth: 2, Population: 112336538 }, + { Continent: "North America", Country: "Canada", Growth: 1, Population: 39056064 }, + { Continent: "South America", Country: "Colombia", Growth: 1, Population: 47000000 }, + { Continent: "South America", Country: "Brazil", Growth: 3, Population: 193946886 }, + { Continent: "Africa", Country: "Nigeria", Growth: 2, Population: 170901000 }, + { Continent: "Africa", Country: "Egypt", Growth: 1, Population: 83661000 }, + { Continent: "Europe", Country: "Germany", Growth: 1, Population: 81993000 }, + { Continent: "Europe", Country: "France", Growth: 1, Population: 65605000 }, + { Continent: "Europe", Country: "UK", Growth: 1, Population: 63181775 } +]; + +module treemapcomponent { + $(function () { + var treemapsample = new ej.datavisualization.TreeMap($("#treemap"), { + leafItemSettings: { showLabels: true, labelPath: "Country" }, + rangeColorMapping: [ + { color: "#77D8D8", legendLabel: "1% Growth", from: 0, to: 1 }, + { color: "#AED960", from: 0, legendLabel: "2% Growth", to: 2 }, + { color: "#FFAF51", from: 0, legendLabel: "3% Growth", to: 3 }, + { color: "#F3D240", from: 0, legendLabel: "4% Growth", to: 4 } + ], + levels: [ + { groupPath: "Continent", groupGap: 5, headerHeight: 25, showHeader: true, headerTemplate: 'headertemplate' } + ], + dataSource: population_data, + colorValuePath: "Growth", + weightValuePath: "Population", + borderThickness: 0, + showLegend: true + }); + }); +} + + + + + +module TreeViewComponent { + $(function () { + var tree = new ej.TreeView($("#treeView"), { + allowEditing: true, + allowDragAndDrop: true, + allowDropChild: true, + allowDropSibling: true, + }); + }); +} + + + + +module UploadboxComponent { + + $(function () { + var sample = new ej.Uploadbox($("#UploadDefault"),{ + saveUrl: "uploadbox/saveFiles.ashx", + removeUrl: "uploadbox/removeFiles.ashx", + buttonText: { + browse: "Choose File", upload: "Upload", cancel: "Cancel" + }, + cssClass: "gradient- purple", + dialogAction: { + modal: false, closeOnComplete: false, drag: true + }, + extensionsAllow: ".zip", + multipleFilesSelection: true, + showFileDetails: true + }); + }); + +} + + + + +module WaitingPopupComponent { + $(function () { + var sample = new ej.WaitingPopup($("#target"),{ + showOnInit: true, + showImage: true, + text: 'waiting…', + target: "#target", + appendTo: "#waiting" + }); + }); + +} diff --git a/ej.web.all/tsconfig.json b/ej.web.all/tsconfig.json index 3a1cd27967..0594221ccb 100644 --- a/ej.web.all/tsconfig.json +++ b/ej.web.all/tsconfig.json @@ -12,7 +12,7 @@ "typeRoots": [ "../" ], - "types": [], + "types": ["jquery"], "noEmit": true, "forceConsistentCasingInFileNames": true }, From 1d1e06fdc5870cf25f6ba015f24d886277389640 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 15:57:45 +0530 Subject: [PATCH 117/797] tsconfig updated --- ej.web.all/tsconfig.json | 6 +++--- ej.web.all/tslint.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ej.web.all/tsconfig.json b/ej.web.all/tsconfig.json index 0594221ccb..3e62a8cbe8 100644 --- a/ej.web.all/tsconfig.json +++ b/ej.web.all/tsconfig.json @@ -1,4 +1,4 @@ -{ +{ "compilerOptions": { "module": "commonjs", "lib": [ @@ -6,8 +6,8 @@ "dom" ], "noImplicitAny": true, - "noImplicitThis": false, - "strictNullChecks": false, + "noImplicitThis": true, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/ej.web.all/tslint.json b/ej.web.all/tslint.json index 2221e40e4a..b0b7c81ba5 100644 --- a/ej.web.all/tslint.json +++ b/ej.web.all/tslint.json @@ -1 +1 @@ -{ "extends": "../tslint.json" } \ No newline at end of file +{ "extends": "../tslint.json" } \ No newline at end of file From 668054a7a11469f4f5006fd2ca0c0dd117199bda Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 16:02:36 +0530 Subject: [PATCH 118/797] index.d.ts updated for BOM --- ej.web.all/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 5fd0c7b4dd..80cad133d5 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -/* tslint:disable */ +/* tslint:disable */ // Type definitions for ej.web.all 15.1.33 From 15c6cc2c467c5542ba9531a607d25a6a04d167b4 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 16:06:27 +0530 Subject: [PATCH 119/797] tsconfig updated --- ej.web.all/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 80cad133d5..b7fad25706 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1,7 +1,4 @@ -/* tslint:disable */ - - -// Type definitions for ej.web.all 15.1.33 +// Type definitions for ej.web.all 15.1.33 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -17,6 +14,9 @@ * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ + +/* tslint:disable */ + declare module ej { var dataUtil: dataUtil; From 54ca256594496f48fa5bd863af65a130d5a3ead7 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 16:09:53 +0530 Subject: [PATCH 120/797] index.d.ts updated for BOM --- ej.web.all/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index b7fad25706..1b7c1731fb 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ej.web.all 15.1.33 +// Type definitions for ej.web.all 15.1.33 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 9f0b0d2fad1c0a4bec87a1fb9cffd275e6ed60a9 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 16:14:09 +0530 Subject: [PATCH 121/797] tsconfig updated --- ej.web.all/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ej.web.all/tsconfig.json b/ej.web.all/tsconfig.json index 3e62a8cbe8..3d793d6f9a 100644 --- a/ej.web.all/tsconfig.json +++ b/ej.web.all/tsconfig.json @@ -12,7 +12,7 @@ "typeRoots": [ "../" ], - "types": ["jquery"], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, From d6a1f6bf73f399aa665d259d5ab20b515e8daa94 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 16:22:36 +0530 Subject: [PATCH 122/797] tsconfig reverted --- ej.web.all/tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ej.web.all/tsconfig.json b/ej.web.all/tsconfig.json index 3d793d6f9a..e5547ec2b5 100644 --- a/ej.web.all/tsconfig.json +++ b/ej.web.all/tsconfig.json @@ -6,8 +6,8 @@ "dom" ], "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, + "noImplicitThis": false, + "strictNullChecks": false, "baseUrl": "../", "typeRoots": [ "../" From 1def27df580318da9fa85d02b8fb5bb2c97a2695 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 16:32:39 +0530 Subject: [PATCH 123/797] index.d.ts updated --- ej.web.all/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 1b7c1731fb..d9b4202fc3 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -15,7 +15,7 @@ * applicable laws. */ -/* tslint:disable */ + declare module ej { From 7502c9951cdd72a0b4b50bb878d11bfa4d919a2d Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 17:38:53 +0530 Subject: [PATCH 124/797] tsconfig.json updated. --- ej.web.all/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ej.web.all/tsconfig.json b/ej.web.all/tsconfig.json index e5547ec2b5..3a1cd27967 100644 --- a/ej.web.all/tsconfig.json +++ b/ej.web.all/tsconfig.json @@ -1,4 +1,4 @@ -{ +{ "compilerOptions": { "module": "commonjs", "lib": [ From add2a283adc92700909adc8f953a1df60995d165 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 17:44:35 +0530 Subject: [PATCH 125/797] bom issue fixed --- ej.web.all/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index d9b4202fc3..7f10816c5a 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -15,7 +15,7 @@ * applicable laws. */ - +/* tslint:disabled */ declare module ej { From bb4c60bbdd2e63ccd33dcd4033ac1de86de70532 Mon Sep 17 00:00:00 2001 From: Baris Cicek Date: Fri, 17 Feb 2017 15:25:34 +0300 Subject: [PATCH 126/797] findOne Optional Fields and Return Single Model PersistedModel findOne passes single object not array, also filter have optional fields. --- loopback/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loopback/index.d.ts b/loopback/index.d.ts index 6712c6ae3a..92d3ab828e 100644 --- a/loopback/index.d.ts +++ b/loopback/index.d.ts @@ -1262,7 +1262,7 @@ declare namespace l { * @param {Array} model First model instance that matches the filter or null if none found */ - static findOne(filter?: {fields: string|any|any[]; include: string|any|any[]; order: string; skip: number; where: any; }, callback?: (err: Error, model: any[]) => void): void; + static findOne(filter?: {fields?: string|any|any[]; include?: string|any|any[]; order?: string; skip?: number; where?: any; }, callback?: (err: Error, model: any) => void): void; /** * Finds one record matching the optional filter object. If not found, creates From afa2589bf4a81c6d948adb00c06a3e7db354cb7d Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Fri, 17 Feb 2017 18:00:14 +0530 Subject: [PATCH 127/797] lint disabled --- ej.web.all/ej.web.all-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ej.web.all/ej.web.all-tests.ts b/ej.web.all/ej.web.all-tests.ts index 57f6650a5b..63928f47cc 100644 --- a/ej.web.all/ej.web.all-tests.ts +++ b/ej.web.all/ej.web.all-tests.ts @@ -1,8 +1,8 @@ -/// +/// /// - +/* tslint:disable */ module AccordionComponent { $(function () { From b6aa344a6d88e55ab0edf545d1555c6198ee6a45 Mon Sep 17 00:00:00 2001 From: Thomas Charlat Date: Fri, 17 Feb 2017 15:45:38 +0100 Subject: [PATCH 128/797] Props injection typings given : decorated = decorator(target) - decorated has no intl props - target has them intl is always injected in props --- react-intl/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react-intl/index.d.ts b/react-intl/index.d.ts index a9629c4009..7f60490d00 100644 --- a/react-intl/index.d.ts +++ b/react-intl/index.d.ts @@ -14,7 +14,7 @@ declare namespace ReactIntl { pluralRuleFunction?: (n: number, ord: boolean) => string; } - function injectIntl | React.StatelessComponent>(component: T): T; + function injectIntl(component: React.ComponentClass | React.StatelessComponent): React.ComponentClass | React.StatelessComponent; function addLocaleData(data: Locale[] | Locale): void; @@ -47,7 +47,7 @@ declare namespace ReactIntl { } interface InjectedIntlProps { - intl?: InjectedIntl + intl: InjectedIntl } namespace IntlComponent { From 0ee68dc0246c069600d2b5c7ca3bb3bc1a10888b Mon Sep 17 00:00:00 2001 From: Thomas Charlat Date: Fri, 17 Feb 2017 18:02:35 +0100 Subject: [PATCH 129/797] source react-intl implements class component as output of the decorator --- react-intl/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-intl/index.d.ts b/react-intl/index.d.ts index 7f60490d00..2c00a07dc9 100644 --- a/react-intl/index.d.ts +++ b/react-intl/index.d.ts @@ -14,7 +14,7 @@ declare namespace ReactIntl { pluralRuleFunction?: (n: number, ord: boolean) => string; } - function injectIntl(component: React.ComponentClass | React.StatelessComponent): React.ComponentClass | React.StatelessComponent; + function injectIntl(component: React.ComponentClass | React.StatelessComponent): React.ComponentClass; function addLocaleData(data: Locale[] | Locale): void; From d6db63556db0bba3ef4eea32180015e4bd0e0a65 Mon Sep 17 00:00:00 2001 From: Thomas Charlat Date: Fri, 17 Feb 2017 18:02:44 +0100 Subject: [PATCH 130/797] test coverage increased and compat with PR --- react-intl/react-intl-tests.tsx | 34 +++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/react-intl/react-intl-tests.tsx b/react-intl/react-intl-tests.tsx index 160a37bc0f..400879677f 100644 --- a/react-intl/react-intl-tests.tsx +++ b/react-intl/react-intl-tests.tsx @@ -11,6 +11,7 @@ import * as reactMixin from "react-mixin" import { IntlProvider, InjectedIntl, + InjectedIntlProps, addLocaleData, hasLocaleData, injectIntl, @@ -31,11 +32,35 @@ addLocaleData(reactIntlEn); console.log(hasLocaleData("en")); interface SomeComponentProps { - className: string, - intl?: InjectedIntl + className: string } -class SomeComponent extends React.Component { +const SomeFunctionalComponentWithIntl = injectIntl(({ + intl: { + formatDate, + formatHTMLMessage, + formatNumber, + formatMessage, + formatPlural, + formatRelative, + formatTime + }, + className +}) => { + const formattedDate = formatDate(new Date(), { format: "short" }); + const formattedTime = formatTime(new Date(), { format: "short" }); + const formattedRelative = formatRelative(new Date().getTime(), { format: "short" }); + const formattedNumber = formatNumber(123, { format: "short" }); + const formattedPlural = formatPlural(1, { one: "hai!" }); + const formattedMessage = formatMessage({ id: "hello", defaultMessage: "Hello {name}!" }, { name: "Roger" }); + const formattedHTMLMessage = formatHTMLMessage({ id: "hello", defaultMessage: "Hello {name}!" }, { name: "Roger" }); + return ( +
+
+ ); +}); + +class SomeComponent extends React.Component { static propTypes: React.ValidationMap = { intl: intlShape.isRequired }; @@ -145,7 +170,7 @@ class SomeComponent extends React.Component { } } -const SomeComponentWithIntl = injectIntl(SomeComponent); +const SomeComponentWithIntl: React.ComponentClass = injectIntl(SomeComponent); class TestApp extends React.Component<{}, {}> { public render(): React.ReactElement<{}> { @@ -162,6 +187,7 @@ class TestApp extends React.Component<{}, {}> { return ( + ); } From 3ecedc8fa8585424f2d719eee036e47a2118ad2c Mon Sep 17 00:00:00 2001 From: Thomas Charlat Date: Fri, 17 Feb 2017 18:10:54 +0100 Subject: [PATCH 131/797] Proposed modification is a priori a fix, and should increment semver as a patch --- react-intl/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-intl/index.d.ts b/react-intl/index.d.ts index 2c00a07dc9..ed0b639f92 100644 --- a/react-intl/index.d.ts +++ b/react-intl/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-intl 2.2.0 +// Type definitions for react-intl 2.2.1 // Project: http://formatjs.io/react/ // Definitions by: Bruno Grieder , Christian Droulers , Fedor Nezhivoi , Till Wolff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From a90ca0db9b9530d6f3fbbaf60b444e58886f70df Mon Sep 17 00:00:00 2001 From: Anders Hoddevik Date: Fri, 17 Feb 2017 10:44:59 -0800 Subject: [PATCH 132/797] Add missing app parameter on the Response interface. --- express-serve-static-core/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/express-serve-static-core/index.d.ts b/express-serve-static-core/index.d.ts index 42f1a535f7..a4ce9612e7 100644 --- a/express-serve-static-core/index.d.ts +++ b/express-serve-static-core/index.d.ts @@ -848,6 +848,8 @@ interface Response extends http.ServerResponse, Express.Response { * */ vary(field: string): Response; + + app: Application; } interface Handler extends RequestHandler { } From 51c50d22dcc7fbb2259be94ccf635001c29b57bf Mon Sep 17 00:00:00 2001 From: gesiu Date: Fri, 17 Feb 2017 14:59:11 -0800 Subject: [PATCH 133/797] Update 1.3 Word APIs for release Update 1.3 Word APIs for release. --- office-js/index.d.ts | 2010 +++++++++++++++++++++++++++++++++--------- 1 file changed, 1597 insertions(+), 413 deletions(-) diff --git a/office-js/index.d.ts b/office-js/index.d.ts index dd18c22914..2c78cac7f4 100644 --- a/office-js/index.d.ts +++ b/office-js/index.d.ts @@ -10328,29 +10328,7 @@ declare module Excel { //////////////////////////////////////////////////////////////// -declare module Word { - /** - * - * The Application object. - * - * [Api set: WordApi 1.3] - */ - class Application extends OfficeExtension.ClientObject { - /** - * - * Creates a new document by using a base64 encoded .docx file. - * - * @param base64File Optional. The base64 encoded .docx file. The default value is null. - * - * [Api set: WordApi 1.3] - */ - createDocument(base64File?: string): Word.Document; - /** - * Create a new instance of Word.Application object - */ - static newObject(context: OfficeExtension.ClientRequestContext): Word.Application; - toJSON(): {}; - } +declare namespace Word { /** * * Represents the body of a document or a section. @@ -10395,25 +10373,46 @@ declare module Word { paragraphs: Word.ParagraphCollection; /** * - * Gets the parent body of the body. For example, a table cell body's parent body could be a header. Read-only. + * Gets the parent body of the body. For example, a table cell body's parent body could be a header. Throws if there isn't a parent body. Read-only. * * [Api set: WordApi 1.3] */ parentBody: Word.Body; /** * - * Gets the content control that contains the body. Returns a null object if there isn't a parent content control. Read-only. + * Gets the parent body of the body. For example, a table cell body's parent body could be a header. Returns a null object if there isn't a parent body. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentBodyOrNullObject: Word.Body; + /** + * + * Gets the content control that contains the body. Throws if there isn't a parent content control. Read-only. * * [Api set: WordApi 1.1] */ parentContentControl: Word.ContentControl; /** * - * Gets the parent section of the body. Read-only. + * Gets the content control that contains the body. Returns a null object if there isn't a parent content control. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentContentControlOrNullObject: Word.ContentControl; + /** + * + * Gets the parent section of the body. Throws if there isn't a parent section. Read-only. * * [Api set: WordApi 1.3] */ parentSection: Word.Section; + /** + * + * Gets the parent section of the body. Returns a null object if there isn't a parent section. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentSectionOrNullObject: Word.Section; /** * * Gets the collection of table objects in the body. Read-only. @@ -10449,6 +10448,15 @@ declare module Word { * [Api set: WordApi 1.3] */ type: string; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.BodyUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: Body): void; /** * * Clears the contents of the body object. The user can perform the undo operation on the cleared content. @@ -10474,19 +10482,19 @@ declare module Word { * * Gets the whole body, or the starting or ending point of the body, as a range. * - * @param rangeLocation Optional. The range location can be 'Whole', 'Start', 'End', 'After' or 'Content'. - * * [Api set: WordApi 1.3] + * + * @param rangeLocation Optional. The range location can be 'Whole', 'Start', 'End', 'After' or 'Content'. */ getRange(rangeLocation?: string): Word.Range; /** * * Inserts a break at the specified location in the main document. The insertLocation value can be 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param breakType Required. The break type to add to the body. * @param insertLocation Required. The value can be 'Start' or 'End'. - * - * [Api set: WordApi 1.1] */ insertBreak(breakType: string, insertLocation: string): void; /** @@ -10500,82 +10508,82 @@ declare module Word { * * Inserts a document into the body at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param base64File Required. The base64 encoded content of a .docx file. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. - * - * [Api set: WordApi 1.1] */ insertFileFromBase64(base64File: string, insertLocation: string): Word.Range; /** * * Inserts HTML at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param html Required. The HTML to be inserted in the document. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. - * - * [Api set: WordApi 1.1] */ insertHtml(html: string, insertLocation: string): Word.Range; /** * * Inserts a picture into the body at the specified location. The insertLocation value can be 'Start' or 'End'. * + * [Api set: WordApi 1.2] + * * @param base64EncodedImage Required. The base64 encoded image to be inserted in the body. * @param insertLocation Required. The value can be 'Start' or 'End'. - * - * [Api set: WordApi 1.2] */ insertInlinePictureFromBase64(base64EncodedImage: string, insertLocation: string): Word.InlinePicture; /** * * Inserts OOXML at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param ooxml Required. The OOXML to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. - * - * [Api set: WordApi 1.1] */ insertOoxml(ooxml: string, insertLocation: string): Word.Range; /** * * Inserts a paragraph at the specified location. The insertLocation value can be 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param paragraphText Required. The paragraph text to be inserted. * @param insertLocation Required. The value can be 'Start' or 'End'. - * - * [Api set: WordApi 1.1] */ insertParagraph(paragraphText: string, insertLocation: string): Word.Paragraph; /** * * Inserts a table with the specified number of rows and columns. The insertLocation value can be 'Start' or 'End'. * + * [Api set: WordApi 1.3] + * * @param rowCount Required. The number of rows in the table. * @param columnCount Required. The number of columns in the table. * @param insertLocation Required. The value can be 'Start' or 'End'. * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. - * - * [Api set: WordApi 1.3] */ insertTable(rowCount: number, columnCount: number, insertLocation: string, values?: Array>): Word.Table; /** * * Inserts text into the body at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param text Required. Text to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. - * - * [Api set: WordApi 1.1] */ insertText(text: string, insertLocation: string): Word.Range; /** * * Performs a search with the specified searchOptions on the scope of the body object. The search results are a collection of range objects. * + * [Api set: WordApi 1.1] + * * @param searchText Required. The search text. * @param searchOptions Optional. Options for the search. - * - * [Api set: WordApi 1.1] */ search(searchText: string, searchOptions?: Word.SearchOptions | { ignorePunct?: boolean; @@ -10590,9 +10598,9 @@ declare module Word { * * Selects the body and navigates the Word UI to it. * - * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. - * * [Api set: WordApi 1.1] + * + * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. */ select(selectionMode?: string): void; /** @@ -10604,7 +10612,7 @@ declare module Word { */ track(): Word.Body; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.Body; toJSON(): { @@ -10666,25 +10674,46 @@ declare module Word { parentBody: Word.Body; /** * - * Gets the content control that contains the content control. Returns a null object if there isn't a parent content control. Read-only. + * Gets the content control that contains the content control. Throws if there isn't a parent content control. Read-only. * * [Api set: WordApi 1.1] */ parentContentControl: Word.ContentControl; /** * - * Gets the table that contains the content control. Returns a null object if it is not contained in a table. Read-only. + * Gets the content control that contains the content control. Returns a null object if there isn't a parent content control. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentContentControlOrNullObject: Word.ContentControl; + /** + * + * Gets the table that contains the content control. Throws if it is not contained in a table. Read-only. * * [Api set: WordApi 1.3] */ parentTable: Word.Table; /** * - * Gets the table cell that contains the content control. Returns a null object if it is not contained in a table cell. Read-only. + * Gets the table cell that contains the content control. Throws if it is not contained in a table cell. Read-only. * * [Api set: WordApi 1.3] */ parentTableCell: Word.TableCell; + /** + * + * Gets the table cell that contains the content control. Returns a null object if it is not contained in a table cell. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentTableCellOrNullObject: Word.TableCell; + /** + * + * Gets the table that contains the content control. Returns a null object if it is not contained in a table. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentTableOrNullObject: Word.Table; /** * * Gets the collection of table objects in the content control. Read-only. @@ -10790,6 +10819,15 @@ declare module Word { * [Api set: WordApi 1.1] */ type: string; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.ContentControlUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: ContentControl): void; /** * * Clears the contents of the content control. The user can perform the undo operation on the cleared content. @@ -10801,9 +10839,9 @@ declare module Word { * * Deletes the content control and its content. If keepContent is set to true, the content is not deleted. * - * @param keepContent Required. Indicates whether the content should be deleted with the content control. If keepContent is set to true, the content is not deleted. - * * [Api set: WordApi 1.1] + * + * @param keepContent Required. Indicates whether the content should be deleted with the content control. If keepContent is set to true, the content is not deleted. */ delete(keepContent: boolean): void; /** @@ -10824,111 +10862,111 @@ declare module Word { * * Gets the whole content control, or the starting or ending point of the content control, as a range. * - * @param rangeLocation Optional. The range location can be 'Whole', 'Before', 'Start', 'End', 'After' or 'Content'. - * * [Api set: WordApi 1.3] + * + * @param rangeLocation Optional. The range location can be 'Whole', 'Before', 'Start', 'End', 'After' or 'Content'. */ getRange(rangeLocation?: string): Word.Range; /** * * Gets the text ranges in the content control by using punctuation marks and/or other ending marks. * + * [Api set: WordApi 1.3] + * * @param endingMarks Required. The punctuation marks and/or other ending marks as an array of strings. * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the ranges returned in the range collection. Default is false which indicates that spacing characters at the start and end of the ranges are included in the range collection. - * - * [Api set: WordApi 1.3] */ getTextRanges(endingMarks: Array, trimSpacing?: boolean): Word.RangeCollection; /** * * Inserts a break at the specified location in the main document. The insertLocation value can be 'Start', 'End', 'Before' or 'After'. This method cannot be used with 'RichTextTable', 'RichTextTableRow' and 'RichTextTableCell' content controls. * + * [Api set: WordApi 1.1] + * * @param breakType Required. Type of break. * @param insertLocation Required. The value can be 'Start', 'End', 'Before' or 'After'. - * - * [Api set: WordApi 1.1] */ insertBreak(breakType: string, insertLocation: string): void; /** * * Inserts a document into the content control at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param base64File Required. The base64 encoded content of a .docx file. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. 'Replace' cannot be used with 'RichTextTable' and 'RichTextTableRow' content controls. - * - * [Api set: WordApi 1.1] */ insertFileFromBase64(base64File: string, insertLocation: string): Word.Range; /** * * Inserts HTML into the content control at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param html Required. The HTML to be inserted in to the content control. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. 'Replace' cannot be used with 'RichTextTable' and 'RichTextTableRow' content controls. - * - * [Api set: WordApi 1.1] */ insertHtml(html: string, insertLocation: string): Word.Range; /** * * Inserts an inline picture into the content control at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * + * [Api set: WordApi 1.2] + * * @param base64EncodedImage Required. The base64 encoded image to be inserted in the content control. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. 'Replace' cannot be used with 'RichTextTable' and 'RichTextTableRow' content controls. - * - * [Api set: WordApi 1.2] */ insertInlinePictureFromBase64(base64EncodedImage: string, insertLocation: string): Word.InlinePicture; /** * * Inserts OOXML into the content control at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param ooxml Required. The OOXML to be inserted in to the content control. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. 'Replace' cannot be used with 'RichTextTable' and 'RichTextTableRow' content controls. - * - * [Api set: WordApi 1.1] */ insertOoxml(ooxml: string, insertLocation: string): Word.Range; /** * * Inserts a paragraph at the specified location. The insertLocation value can be 'Start', 'End', 'Before' or 'After'. * + * [Api set: WordApi 1.1] + * * @param paragraphText Required. The paragrph text to be inserted. * @param insertLocation Required. The value can be 'Start', 'End', 'Before' or 'After'. 'Before' and 'After' cannot be used with 'RichTextTable', 'RichTextTableRow' and 'RichTextTableCell' content controls. - * - * [Api set: WordApi 1.1] */ insertParagraph(paragraphText: string, insertLocation: string): Word.Paragraph; /** * * Inserts a table with the specified number of rows and columns into, or next to, a content control. The insertLocation value can be 'Start', 'End', 'Before' or 'After'. * + * [Api set: WordApi 1.3] + * * @param rowCount Required. The number of rows in the table. * @param columnCount Required. The number of columns in the table. * @param insertLocation Required. The value can be 'Start', 'End', 'Before' or 'After'. 'Before' and 'After' cannot be used with 'RichTextTable', 'RichTextTableRow' and 'RichTextTableCell' content controls. * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. - * - * [Api set: WordApi 1.3] */ insertTable(rowCount: number, columnCount: number, insertLocation: string, values?: Array>): Word.Table; /** * * Inserts text into the content control at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param text Required. The text to be inserted in to the content control. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. 'Replace' cannot be used with 'RichTextTable' and 'RichTextTableRow' content controls. - * - * [Api set: WordApi 1.1] */ insertText(text: string, insertLocation: string): Word.Range; /** * * Performs a search with the specified searchOptions on the scope of the content control object. The search results are a collection of range objects. * + * [Api set: WordApi 1.1] + * * @param searchText Required. The search text. * @param searchOptions Optional. Options for the search. - * - * [Api set: WordApi 1.1] */ search(searchText: string, searchOptions?: Word.SearchOptions | { ignorePunct?: boolean; @@ -10943,21 +10981,21 @@ declare module Word { * * Selects the content control. This causes Word to scroll to the selection. * - * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. - * * [Api set: WordApi 1.1] + * + * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. */ select(selectionMode?: string): void; /** * * Splits the content control into child ranges by using delimiters. * + * [Api set: WordApi 1.3] + * * @param delimiters Required. The delimiters as an array of strings. * @param multiParagraphs Optional. Indicates whether a returned child range can cover multiple paragraphs. Default is false which indicates that the paragraph boundaries are also used as delimiters. * @param trimDelimiters Optional. Indicates whether to trim delimiters from the ranges in the range collection. Default is false which indicates that the delimiters are included in the ranges returned in the range collection. * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the ranges returned in the range collection. Default is false which indicates that spacing characters at the start and end of the ranges are included in the range collection. - * - * [Api set: WordApi 1.3] */ split(delimiters: Array, multiParagraphs?: boolean, trimDelimiters?: boolean, trimSpacing?: boolean): Word.RangeCollection; /** @@ -10969,7 +11007,7 @@ declare module Word { */ track(): Word.ContentControl; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.ContentControl; toJSON(): { @@ -11001,54 +11039,70 @@ declare module Word { items: Array; /** * - * Gets a content control by its identifier. - * - * @param id Required. A content control identifier. + * Gets a content control by its identifier. Throws if there isn't a content control with the identifier in this collection. * * [Api set: WordApi 1.1] + * + * @param id Required. A content control identifier. */ getById(id: number): Word.ContentControl; + /** + * + * Gets a content control by its identifier. Returns a null object if there isn't a content control with the identifier in this collection. + * + * [Api set: WordApi 1.3] + * + * @param id Required. A content control identifier. + */ + getByIdOrNullObject(id: number): Word.ContentControl; /** * * Gets the content controls that have the specified tag. * - * @param tag Required. A tag set on a content control. - * * [Api set: WordApi 1.1] + * + * @param tag Required. A tag set on a content control. */ getByTag(tag: string): Word.ContentControlCollection; /** * * Gets the content controls that have the specified title. * - * @param title Required. The title of a content control. - * * [Api set: WordApi 1.1] + * + * @param title Required. The title of a content control. */ getByTitle(title: string): Word.ContentControlCollection; /** * * Gets the content controls that have the specified types and/or subtypes. * - * @param types Required. An array of content control types and/or subtypes. - * * [Api set: WordApi 1.3] + * + * @param types Required. An array of content control types and/or subtypes. */ getByTypes(types: Array): Word.ContentControlCollection; /** * - * Gets the first content control in this collection. + * Gets the first content control in this collection. Throws if this collection is empty. * * [Api set: WordApi 1.3] */ getFirst(): Word.ContentControl; + /** + * + * Gets the first content control in this collection. Returns a null object if this collection is empty. + * + * [Api set: WordApi 1.3] + */ + getFirstOrNullObject(): Word.ContentControl; /** * * Gets a content control by its index in the collection. * - * @param index The index. - * * [Api set: WordApi 1.1] + * + * @param index The index. */ getItem(index: number): Word.ContentControl; /** @@ -11060,7 +11114,7 @@ declare module Word { */ track(): Word.ContentControlCollection; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.ContentControlCollection; toJSON(): {}; @@ -11093,6 +11147,15 @@ declare module Word { * [Api set: WordApi 1.3] */ value: any; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.CustomPropertyUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: CustomProperty): void; /** * * Deletes the custom property. @@ -11109,7 +11172,7 @@ declare module Word { */ track(): Word.CustomProperty; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.CustomProperty; toJSON(): { @@ -11127,6 +11190,16 @@ declare module Word { class CustomPropertyCollection extends OfficeExtension.ClientObject { /** Gets the loaded child items in this collection. */ items: Array; + /** + * + * Creates a new or sets an existing custom property. + * + * [Api set: WordApi 1.3] + * + * @param key Required. The custom property's key, which is case-insensitive. + * @param value Required. The custom property's value. + */ + add(key: string, value: any): Word.CustomProperty; /** * * Deletes all custom properties in this collection. @@ -11143,23 +11216,22 @@ declare module Word { getCount(): OfficeExtension.ClientResult; /** * - * Gets a custom property object by its key, which is case-insensitive. - * - * @param key The key that identifies the custom property object. + * Gets a custom property object by its key, which is case-insensitive. Throws if the custom property does not exist. * * [Api set: WordApi 1.3] + * + * @param key The key that identifies the custom property object. */ getItem(key: string): Word.CustomProperty; /** * - * Creates or sets a custom property. - * - * @param key Required. The custom property's key, which is case-insensitive. - * @param value Required. The custom property's value. + * Gets a custom property object by its key, which is case-insensitive. Returns a null object if the custom property does not exist. * * [Api set: WordApi 1.3] + * + * @param key Required. The key that identifies the custom property object. */ - set(key: string, value: any): Word.CustomProperty; + getItemOrNullObject(key: string): Word.CustomProperty; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -11169,7 +11241,7 @@ declare module Word { */ track(): Word.CustomPropertyCollection; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.CustomPropertyCollection; toJSON(): {}; @@ -11216,6 +11288,15 @@ declare module Word { * [Api set: WordApi 1.1] */ saved: boolean; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.DocumentUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: Document): void; /** * * Gets the current selection of the document. Multiple selections are not supported. @@ -11223,13 +11304,6 @@ declare module Word { * [Api set: WordApi 1.1] */ getSelection(): Word.Range; - /** - * - * Open the document. - * - * [Api set: WordApi 1.3] - */ - open(): void; /** * * Saves the document. This will use the Word default file naming convention if the document has not been saved before. @@ -11246,7 +11320,7 @@ declare module Word { */ track(): Word.Document; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.Document; toJSON(): { @@ -11327,7 +11401,7 @@ declare module Word { keywords: string; /** * - * Gets or sets the last author of the document. + * Gets the last author of the document. Read only. * * [Api set: WordApi 1.3] */ @@ -11388,6 +11462,15 @@ declare module Word { * [Api set: WordApi 1.3] */ title: string; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.DocumentPropertiesUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: DocumentProperties): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -11397,7 +11480,7 @@ declare module Word { */ track(): Word.DocumentProperties; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.DocumentProperties; toJSON(): { @@ -11504,6 +11587,15 @@ declare module Word { * [Api set: WordApi 1.1] */ underline: string; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.FontUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: Font): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -11513,7 +11605,7 @@ declare module Word { */ track(): Word.Font; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.Font; toJSON(): { @@ -11546,25 +11638,46 @@ declare module Word { paragraph: Word.Paragraph; /** * - * Gets the content control that contains the inline image. Returns a null object if there isn't a parent content control. Read-only. + * Gets the content control that contains the inline image. Throws if there isn't a parent content control. Read-only. * * [Api set: WordApi 1.1] */ parentContentControl: Word.ContentControl; /** * - * Gets the table that contains the inline image. Returns a null object if it is not contained in a table. Read-only. + * Gets the content control that contains the inline image. Returns a null object if there isn't a parent content control. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentContentControlOrNullObject: Word.ContentControl; + /** + * + * Gets the table that contains the inline image. Throws if it is not contained in a table. Read-only. * * [Api set: WordApi 1.3] */ parentTable: Word.Table; /** * - * Gets the table cell that contains the inline image. Returns a null object if it is not contained in a table cell. Read-only. + * Gets the table cell that contains the inline image. Throws if it is not contained in a table cell. Read-only. * * [Api set: WordApi 1.3] */ parentTableCell: Word.TableCell; + /** + * + * Gets the table cell that contains the inline image. Returns a null object if it is not contained in a table cell. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentTableCellOrNullObject: Word.TableCell; + /** + * + * Gets the table that contains the inline image. Returns a null object if it is not contained in a table. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentTableOrNullObject: Word.Table; /** * * Gets or sets a string that represents the alternative text associated with the inline image @@ -11588,7 +11701,7 @@ declare module Word { height: number; /** * - * Gets or sets a hyperlink on the image. Use a newline character ('\n') to separate the address part from the optional location part. + * Gets or sets a hyperlink on the image. Use a '#' to separate the address part from the optional location part. * * [Api set: WordApi 1.1] */ @@ -11607,6 +11720,15 @@ declare module Word { * [Api set: WordApi 1.1] */ width: number; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.InlinePictureUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: InlinePicture): void; /** * * Deletes the inline picture from the document. @@ -11623,28 +11745,35 @@ declare module Word { getBase64ImageSrc(): OfficeExtension.ClientResult; /** * - * Gets the next inline image. + * Gets the next inline image. Throws if this inline image is the last one. * * [Api set: WordApi 1.3] */ getNext(): Word.InlinePicture; /** * - * Gets the picture, or the starting or ending point of the picture, as a range. - * - * @param rangeLocation Optional. The range location can be 'Whole', 'Start' or 'End'. + * Gets the next inline image. Returns a null object if this inline image is the last one. * * [Api set: WordApi 1.3] */ + getNextOrNullObject(): Word.InlinePicture; + /** + * + * Gets the picture, or the starting or ending point of the picture, as a range. + * + * [Api set: WordApi 1.3] + * + * @param rangeLocation Optional. The range location can be 'Whole', 'Start' or 'End'. + */ getRange(rangeLocation?: string): Word.Range; /** * * Inserts a break at the specified location in the main document. The insertLocation value can be 'Before' or 'After'. * + * [Api set: WordApi 1.2] + * * @param breakType Required. The break type to add. * @param insertLocation Required. The value can be 'Before' or 'After'. - * - * [Api set: WordApi 1.2] */ insertBreak(breakType: string, insertLocation: string): void; /** @@ -11658,69 +11787,69 @@ declare module Word { * * Inserts a document at the specified location. The insertLocation value can be 'Before' or 'After'. * + * [Api set: WordApi 1.2] + * * @param base64File Required. The base64 encoded content of a .docx file. * @param insertLocation Required. The value can be 'Before' or 'After'. - * - * [Api set: WordApi 1.2] */ insertFileFromBase64(base64File: string, insertLocation: string): Word.Range; /** * * Inserts HTML at the specified location. The insertLocation value can be 'Before' or 'After'. * + * [Api set: WordApi 1.2] + * * @param html Required. The HTML to be inserted. * @param insertLocation Required. The value can be 'Before' or 'After'. - * - * [Api set: WordApi 1.2] */ insertHtml(html: string, insertLocation: string): Word.Range; /** * * Inserts an inline picture at the specified location. The insertLocation value can be 'Replace', 'Before' or 'After'. * + * [Api set: WordApi 1.2] + * * @param base64EncodedImage Required. The base64 encoded image to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Before' or 'After'. - * - * [Api set: WordApi 1.2] */ insertInlinePictureFromBase64(base64EncodedImage: string, insertLocation: string): Word.InlinePicture; /** * * Inserts OOXML at the specified location. The insertLocation value can be 'Before' or 'After'. * + * [Api set: WordApi 1.2] + * * @param ooxml Required. The OOXML to be inserted. * @param insertLocation Required. The value can be 'Before' or 'After'. - * - * [Api set: WordApi 1.2] */ insertOoxml(ooxml: string, insertLocation: string): Word.Range; /** * * Inserts a paragraph at the specified location. The insertLocation value can be 'Before' or 'After'. * + * [Api set: WordApi 1.2] + * * @param paragraphText Required. The paragraph text to be inserted. * @param insertLocation Required. The value can be 'Before' or 'After'. - * - * [Api set: WordApi 1.2] */ insertParagraph(paragraphText: string, insertLocation: string): Word.Paragraph; /** * * Inserts text at the specified location. The insertLocation value can be 'Before' or 'After'. * + * [Api set: WordApi 1.2] + * * @param text Required. Text to be inserted. * @param insertLocation Required. The value can be 'Before' or 'After'. - * - * [Api set: WordApi 1.2] */ insertText(text: string, insertLocation: string): Word.Range; /** * * Selects the inline picture. This causes Word to scroll to the selection. * - * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. - * * [Api set: WordApi 1.2] + * + * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. */ select(selectionMode?: string): void; /** @@ -11732,7 +11861,7 @@ declare module Word { */ track(): Word.InlinePicture; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.InlinePicture; toJSON(): { @@ -11755,11 +11884,18 @@ declare module Word { items: Array; /** * - * Gets the first inline image in this collection. + * Gets the first inline image in this collection. Throws if this collection is empty. * * [Api set: WordApi 1.3] */ getFirst(): Word.InlinePicture; + /** + * + * Gets the first inline image in this collection. Returns a null object if this collection is empty. + * + * [Api set: WordApi 1.3] + */ + getFirstOrNullObject(): Word.InlinePicture; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -11769,7 +11905,7 @@ declare module Word { */ track(): Word.InlinePictureCollection; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.InlinePictureCollection; toJSON(): {}; @@ -11813,82 +11949,82 @@ declare module Word { * * Gets the paragraphs that occur at the specified level in the list. * - * @param level Required. The level in the list. - * * [Api set: WordApi 1.3] + * + * @param level Required. The level in the list. */ getLevelParagraphs(level: number): Word.ParagraphCollection; /** * * Gets the bullet, number or picture at the specified level as a string. * - * @param level Required. The level in the list. - * * [Api set: WordApi 1.3] + * + * @param level Required. The level in the list. */ getLevelString(level: number): OfficeExtension.ClientResult; /** * * Inserts a paragraph at the specified location. The insertLocation value can be 'Start', 'End', 'Before' or 'After'. * + * [Api set: WordApi 1.3] + * * @param paragraphText Required. The paragraph text to be inserted. * @param insertLocation Required. The value can be 'Start', 'End', 'Before' or 'After'. - * - * [Api set: WordApi 1.3] */ insertParagraph(paragraphText: string, insertLocation: string): Word.Paragraph; /** * * Sets the alignment of the bullet, number or picture at the specified level in the list. * + * [Api set: WordApi 1.3] + * * @param level Required. The level in the list. * @param alignment Required. The level alignment that can be 'left', 'centered' or 'right'. - * - * [Api set: WordApi 1.3] */ setLevelAlignment(level: number, alignment: string): void; /** * * Sets the bullet format at the specified level in the list. If the bullet is 'Custom', the charCode is required. * + * [Api set: WordApi 1.3] + * * @param level Required. The level in the list. * @param listBullet Required. The bullet. * @param charCode Optional. The bullet character's code value. Used only if the bullet is 'Custom'. * @param fontName Optional. The bullet's font name. Used only if the bullet is 'Custom'. - * - * [Api set: WordApi 1.3] */ setLevelBullet(level: number, listBullet: string, charCode?: number, fontName?: string): void; /** * * Sets the two indents of the specified level in the list. * + * [Api set: WordApi 1.3] + * * @param level Required. The level in the list. * @param textIndent Required. The text indent in points. It is the same as paragraph left indent. * @param textIndent Required. The relative indent, in points, of the bullet, number or picture. It is the same as paragraph first line indent. - * - * [Api set: WordApi 1.3] */ setLevelIndents(level: number, textIndent: number, bulletNumberPictureIndent: number): void; /** * * Sets the numbering format at the specified level in the list. * + * [Api set: WordApi 1.3] + * * @param level Required. The level in the list. * @param listNumbering Required. The ordinal format. * @param formatString Optional. The numbering string format defined as an array of strings and/or integers. Each integer is a level of number type that is higher than or equal to this level. For example, an array of ["(", level - 1, ".", level, ")"] can define the format of "(2.c)", where 2 is the parent's item number and c is this level's item number. - * - * [Api set: WordApi 1.3] */ setLevelNumbering(level: number, listNumbering: string, formatString?: Array): void; /** * * Sets the starting number at the specified level in the list. Default value is 1. * + * [Api set: WordApi 1.3] + * * @param level Required. The level in the list. * @param startingNumber Required. The number to start with. - * - * [Api set: WordApi 1.3] */ setLevelStartingNumber(level: number, startingNumber: number): void; /** @@ -11900,7 +12036,7 @@ declare module Word { */ track(): Word.List; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.List; toJSON(): { @@ -11920,28 +12056,44 @@ declare module Word { items: Array; /** * - * Gets a list by its identifier. - * - * @param id Required. A list identifier. + * Gets a list by its identifier. Throws if there isn't a list with the identifier in this collection. * * [Api set: WordApi 1.3] + * + * @param id Required. A list identifier. */ getById(id: number): Word.List; /** * - * Gets the first list in this collection. + * Gets a list by its identifier. Returns a null object if there isn't a list with the identifier in this collection. + * + * [Api set: WordApi 1.3] + * + * @param id Required. A list identifier. + */ + getByIdOrNullObject(id: number): Word.List; + /** + * + * Gets the first list in this collection. Throws if this collection is empty. * * [Api set: WordApi 1.3] */ getFirst(): Word.List; /** * - * Gets a list object by its index in the collection. - * - * @param index A number that identifies the index location of a list object. + * Gets the first list in this collection. Returns a null object if this collection is empty. * * [Api set: WordApi 1.3] */ + getFirstOrNullObject(): Word.List; + /** + * + * Gets a list object by its index in the collection. + * + * [Api set: WordApi 1.3] + * + * @param index A number that identifies the index location of a list object. + */ getItem(index: number): Word.List; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. @@ -11952,7 +12104,7 @@ declare module Word { */ track(): Word.ListCollection; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.ListCollection; toJSON(): {}; @@ -11985,22 +12137,40 @@ declare module Word { * [Api set: WordApi 1.3] */ siblingIndex: number; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.ListItemUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: ListItem): void; /** * - * Gets the list item parent, or the closest ancestor if the parent does not exist. - * - * @param parentOnly Optional. Specified only the list item's parent will be returned. The default is false that specifies to get the lowest ancestor. + * Gets the list item parent, or the closest ancestor if the parent does not exist. Throws if the list item has no ancester. * * [Api set: WordApi 1.3] + * + * @param parentOnly Optional. Specified only the list item's parent will be returned. The default is false that specifies to get the lowest ancestor. */ getAncestor(parentOnly?: boolean): Word.Paragraph; /** * - * Gets all descendant list items of the list item. - * - * @param directChildrenOnly Optional. Specified only the list item's direct children will be returned. The default is false that indicates to get all descendant items. + * Gets the list item parent, or the closest ancestor if the parent does not exist. Returns a null object if the list item has no ancester. * * [Api set: WordApi 1.3] + * + * @param parentOnly Optional. Specified only the list item's parent will be returned. The default is false that specifies to get the lowest ancestor. + */ + getAncestorOrNullObject(parentOnly?: boolean): Word.Paragraph; + /** + * + * Gets all descendant list items of the list item. + * + * [Api set: WordApi 1.3] + * + * @param directChildrenOnly Optional. Specified only the list item's direct children will be returned. The default is false that indicates to get all descendant items. */ getDescendants(directChildrenOnly?: boolean): Word.ParagraphCollection; /** @@ -12012,7 +12182,7 @@ declare module Word { */ track(): Word.ListItem; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.ListItem; toJSON(): { @@ -12051,18 +12221,32 @@ declare module Word { inlinePictures: Word.InlinePictureCollection; /** * - * Gets the List to which this paragraph belongs. Returns a null object if the paragraph is not in a list. Read-only. + * Gets the List to which this paragraph belongs. Throws if the paragraph is not in a list. Read-only. * * [Api set: WordApi 1.3] */ list: Word.List; /** * - * Gets the ListItem for the paragraph. Returns a null object if the paragraph is not part of a list. Read-only. + * Gets the ListItem for the paragraph. Throws if the paragraph is not part of a list. Read-only. * * [Api set: WordApi 1.3] */ listItem: Word.ListItem; + /** + * + * Gets the ListItem for the paragraph. Returns a null object if the paragraph is not part of a list. Read-only. + * + * [Api set: WordApi 1.3] + */ + listItemOrNullObject: Word.ListItem; + /** + * + * Gets the List to which this paragraph belongs. Returns a null object if the paragraph is not in a list. Read-only. + * + * [Api set: WordApi 1.3] + */ + listOrNullObject: Word.List; /** * * Gets the parent body of the paragraph. Read-only. @@ -12072,25 +12256,46 @@ declare module Word { parentBody: Word.Body; /** * - * Gets the content control that contains the paragraph. Returns a null object if there isn't a parent content control. Read-only. + * Gets the content control that contains the paragraph. Throws if there isn't a parent content control. Read-only. * * [Api set: WordApi 1.1] */ parentContentControl: Word.ContentControl; /** * - * Gets the table that contains the paragraph. Returns a null object if it is not contained in a table. Read-only. + * Gets the content control that contains the paragraph. Returns a null object if there isn't a parent content control. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentContentControlOrNullObject: Word.ContentControl; + /** + * + * Gets the table that contains the paragraph. Throws if it is not contained in a table. Read-only. * * [Api set: WordApi 1.3] */ parentTable: Word.Table; /** * - * Gets the table cell that contains the paragraph. Returns a null object if it is not contained in a table cell. Read-only. + * Gets the table cell that contains the paragraph. Throws if it is not contained in a table cell. Read-only. * * [Api set: WordApi 1.3] */ parentTableCell: Word.TableCell; + /** + * + * Gets the table cell that contains the paragraph. Returns a null object if it is not contained in a table cell. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentTableCellOrNullObject: Word.TableCell; + /** + * + * Gets the table that contains the paragraph. Returns a null object if it is not contained in a table. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentTableOrNullObject: Word.Table; /** * * Gets or sets the alignment for a paragraph. The value can be 'left', 'centered', 'right', or 'justified'. @@ -12203,14 +12408,23 @@ declare module Word { * [Api set: WordApi 1.1] */ text: string; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.ParagraphUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: Paragraph): void; /** * * Lets the paragraph join an existing list at the specified level. Fails if the paragraph cannot join the list or if the paragraph is already a list item. * + * [Api set: WordApi 1.3] + * * @param listId Required. The ID of an existing list. * @param level Required. The level in the list. - * - * [Api set: WordApi 1.3] */ attachToList(listId: number, level: number): Word.List; /** @@ -12243,11 +12457,18 @@ declare module Word { getHtml(): OfficeExtension.ClientResult; /** * - * Gets the next paragraph. + * Gets the next paragraph. Throws if the paragraph is the last one. * * [Api set: WordApi 1.3] */ getNext(): Word.Paragraph; + /** + * + * Gets the next paragraph. Returns a null object if the paragraph is the last one. + * + * [Api set: WordApi 1.3] + */ + getNextOrNullObject(): Word.Paragraph; /** * * Gets the Office Open XML (OOXML) representation of the paragraph object. @@ -12257,38 +12478,45 @@ declare module Word { getOoxml(): OfficeExtension.ClientResult; /** * - * Gets the previous paragraph. + * Gets the previous paragraph. Throws if the paragraph is the first one. * * [Api set: WordApi 1.3] */ getPrevious(): Word.Paragraph; /** * - * Gets the whole paragraph, or the starting or ending point of the paragraph, as a range. - * - * @param rangeLocation Optional. The range location can be 'Whole', 'Start', 'End', 'After' or 'Content'. + * Gets the previous paragraph. Returns a null object if the paragraph is the first one. * * [Api set: WordApi 1.3] */ + getPreviousOrNullObject(): Word.Paragraph; + /** + * + * Gets the whole paragraph, or the starting or ending point of the paragraph, as a range. + * + * [Api set: WordApi 1.3] + * + * @param rangeLocation Optional. The range location can be 'Whole', 'Start', 'End', 'After' or 'Content'. + */ getRange(rangeLocation?: string): Word.Range; /** * * Gets the text ranges in the paragraph by using punctuation marks and/or other ending marks. * + * [Api set: WordApi 1.3] + * * @param endingMarks Required. The punctuation marks and/or other ending marks as an array of strings. * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the ranges returned in the range collection. Default is false which indicates that spacing characters at the start and end of the ranges are included in the range collection. - * - * [Api set: WordApi 1.3] */ getTextRanges(endingMarks: Array, trimSpacing?: boolean): Word.RangeCollection; /** * * Inserts a break at the specified location in the main document. The insertLocation value can be 'Before' or 'After'. * + * [Api set: WordApi 1.1] + * * @param breakType Required. The break type to add to the document. * @param insertLocation Required. The value can be 'Before' or 'After'. - * - * [Api set: WordApi 1.1] */ insertBreak(breakType: string, insertLocation: string): void; /** @@ -12302,82 +12530,82 @@ declare module Word { * * Inserts a document into the paragraph at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param base64File Required. The base64 encoded content of a .docx file. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. - * - * [Api set: WordApi 1.1] */ insertFileFromBase64(base64File: string, insertLocation: string): Word.Range; /** * * Inserts HTML into the paragraph at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param html Required. The HTML to be inserted in the paragraph. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. - * - * [Api set: WordApi 1.1] */ insertHtml(html: string, insertLocation: string): Word.Range; /** * * Inserts a picture into the paragraph at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param base64EncodedImage Required. The base64 encoded image to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. - * - * [Api set: WordApi 1.1] */ insertInlinePictureFromBase64(base64EncodedImage: string, insertLocation: string): Word.InlinePicture; /** * * Inserts OOXML into the paragraph at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param ooxml Required. The OOXML to be inserted in the paragraph. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. - * - * [Api set: WordApi 1.1] */ insertOoxml(ooxml: string, insertLocation: string): Word.Range; /** * * Inserts a paragraph at the specified location. The insertLocation value can be 'Before' or 'After'. * + * [Api set: WordApi 1.1] + * * @param paragraphText Required. The paragraph text to be inserted. * @param insertLocation Required. The value can be 'Before' or 'After'. - * - * [Api set: WordApi 1.1] */ insertParagraph(paragraphText: string, insertLocation: string): Word.Paragraph; /** * * Inserts a table with the specified number of rows and columns. The insertLocation value can be 'Before' or 'After'. * + * [Api set: WordApi 1.3] + * * @param rowCount Required. The number of rows in the table. * @param columnCount Required. The number of columns in the table. * @param insertLocation Required. The value can be 'Before' or 'After'. * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. - * - * [Api set: WordApi 1.3] */ insertTable(rowCount: number, columnCount: number, insertLocation: string, values?: Array>): Word.Table; /** * * Inserts text into the paragraph at the specified location. The insertLocation value can be 'Replace', 'Start' or 'End'. * + * [Api set: WordApi 1.1] + * * @param text Required. Text to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start' or 'End'. - * - * [Api set: WordApi 1.1] */ insertText(text: string, insertLocation: string): Word.Range; /** * * Performs a search with the specified searchOptions on the scope of the paragraph object. The search results are a collection of range objects. * + * [Api set: WordApi 1.1] + * * @param searchText Required. The search text. * @param searchOptions Optional. Options for the search. - * - * [Api set: WordApi 1.1] */ search(searchText: string, searchOptions?: Word.SearchOptions | { ignorePunct?: boolean; @@ -12392,20 +12620,20 @@ declare module Word { * * Selects and navigates the Word UI to the paragraph. * - * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. - * * [Api set: WordApi 1.1] + * + * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. */ select(selectionMode?: string): void; /** * * Splits the paragraph into child ranges by using delimiters. * + * [Api set: WordApi 1.3] + * * @param delimiters Required. The delimiters as an array of strings. * @param trimDelimiters Optional. Indicates whether to trim delimiters from the ranges in the range collection. Default is false which indicates that the delimiters are included in the ranges returned in the range collection. * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the ranges returned in the range collection. Default is false which indicates that spacing characters at the start and end of the ranges are included in the range collection. - * - * [Api set: WordApi 1.3] */ split(delimiters: Array, trimDelimiters?: boolean, trimSpacing?: boolean): Word.RangeCollection; /** @@ -12424,7 +12652,7 @@ declare module Word { */ track(): Word.Paragraph; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.Paragraph; toJSON(): { @@ -12438,6 +12666,7 @@ declare module Word { "lineUnitAfter": number; "lineUnitBefore": number; "listItem": ListItem; + "listItemOrNullObject": ListItem; "outlineLevel": number; "rightIndent": number; "spaceAfter": number; @@ -12459,18 +12688,32 @@ declare module Word { items: Array; /** * - * Gets the first paragraph in this collection. + * Gets the first paragraph in this collection. Throws if the collection is empty. * * [Api set: WordApi 1.3] */ getFirst(): Word.Paragraph; /** * - * Gets the last paragraph in this collection. + * Gets the first paragraph in this collection. Returns a null object if the collection is empty. + * + * [Api set: WordApi 1.3] + */ + getFirstOrNullObject(): Word.Paragraph; + /** + * + * Gets the last paragraph in this collection. Throws if the collection is empty. * * [Api set: WordApi 1.3] */ getLast(): Word.Paragraph; + /** + * + * Gets the last paragraph in this collection. Returns a null object if the collection is empty. + * + * [Api set: WordApi 1.3] + */ + getLastOrNullObject(): Word.Paragraph; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -12480,7 +12723,7 @@ declare module Word { */ track(): Word.ParagraphCollection; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.ParagraphCollection; toJSON(): {}; @@ -12536,25 +12779,46 @@ declare module Word { parentBody: Word.Body; /** * - * Gets the content control that contains the range. Returns a null object if there isn't a parent content control. Read-only. + * Gets the content control that contains the range. Throws if there isn't a parent content control. Read-only. * * [Api set: WordApi 1.1] */ parentContentControl: Word.ContentControl; /** * - * Gets the table that contains the range. Returns null if it is not contained in a table. Read-only. + * Gets the content control that contains the range. Returns a null object if there isn't a parent content control. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentContentControlOrNullObject: Word.ContentControl; + /** + * + * Gets the table that contains the range. Throws if it is not contained in a table. Read-only. * * [Api set: WordApi 1.3] */ parentTable: Word.Table; /** * - * Gets the table cell that contains the range. Returns a null object if it is not contained in a table cell. Read-only. + * Gets the table cell that contains the range. Throws if it is not contained in a table cell. Read-only. * * [Api set: WordApi 1.3] */ parentTableCell: Word.TableCell; + /** + * + * Gets the table cell that contains the range. Returns a null object if it is not contained in a table cell. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentTableCellOrNullObject: Word.TableCell; + /** + * + * Gets the table that contains the range. Returns a null object if it is not contained in a table. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentTableOrNullObject: Word.Table; /** * * Gets the collection of table objects in the range. Read-only. @@ -12564,7 +12828,7 @@ declare module Word { tables: Word.TableCollection; /** * - * Gets the first hyperlink in the range, or sets a hyperlink on the range. All hyperlinks in the range are deleted when you set a new hyperlink on the range. Use a newline character ('\n') to separate the address part from the optional location part. + * Gets the first hyperlink in the range, or sets a hyperlink on the range. All hyperlinks in the range are deleted when you set a new hyperlink on the range. Use a '#' to separate the address part from the optional location part. * * [Api set: WordApi 1.3] */ @@ -12597,6 +12861,15 @@ declare module Word { * [Api set: WordApi 1.1] */ text: string; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.RangeUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: Range): void; /** * * Clears the contents of the range object. The user can perform the undo operation on the cleared content. @@ -12608,9 +12881,9 @@ declare module Word { * * Compares this range's location with another range's location. * - * @param range Required. The range to compare with this range. - * * [Api set: WordApi 1.3] + * + * @param range Required. The range to compare with this range. */ compareLocationWith(range: Word.Range): OfficeExtension.ClientResult; /** @@ -12622,13 +12895,22 @@ declare module Word { delete(): void; /** * - * Returns a new range that extends from this range in either direction to cover another range. This range is not changed. - * - * @param range Required. Another range. + * Returns a new range that extends from this range in either direction to cover another range. This range is not changed. Throws if the two ranges do not have a union. * * [Api set: WordApi 1.3] + * + * @param range Required. Another range. */ expandTo(range: Word.Range): Word.Range; + /** + * + * Returns a new range that extends from this range in either direction to cover another range. This range is not changed. Returns a null object if the two ranges do not have a union. + * + * [Api set: WordApi 1.3] + * + * @param range Required. Another range. + */ + expandToOrNullObject(range: Word.Range): Word.Range; /** * * Gets the HTML representation of the range object. @@ -12645,14 +12927,24 @@ declare module Word { getHyperlinkRanges(): Word.RangeCollection; /** * - * Gets the next text range by using punctuation marks and/or other ending marks. + * Gets the next text range by using punctuation marks and/or other ending marks. Throws if this text range is the last one. + * + * [Api set: WordApi 1.3] * * @param endingMarks Required. The punctuation marks and/or other ending marks as an array of strings. * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the returned range. Default is false which indicates that spacing characters at the start and end of the range are included. - * - * [Api set: WordApi 1.3] */ getNextTextRange(endingMarks: Array, trimSpacing?: boolean): Word.Range; + /** + * + * Gets the next text range by using punctuation marks and/or other ending marks. Returns a null object if this text range is the last one. + * + * [Api set: WordApi 1.3] + * + * @param endingMarks Required. The punctuation marks and/or other ending marks as an array of strings. + * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the returned range. Default is false which indicates that spacing characters at the start and end of the range are included. + */ + getNextTextRangeOrNullObject(endingMarks: Array, trimSpacing?: boolean): Word.Range; /** * * Gets the OOXML representation of the range object. @@ -12664,29 +12956,29 @@ declare module Word { * * Clones the range, or gets the starting or ending point of the range as a new range. * - * @param rangeLocation Optional. The range location can be 'Whole', 'Start', 'End', 'After' or 'Content'. - * * [Api set: WordApi 1.3] + * + * @param rangeLocation Optional. The range location can be 'Whole', 'Start', 'End', 'After' or 'Content'. */ getRange(rangeLocation?: string): Word.Range; /** * * Gets the text child ranges in the range by using punctuation marks and/or other ending marks. * + * [Api set: WordApi 1.3] + * * @param endingMarks Required. The punctuation marks and/or other ending marks as an array of strings. * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the ranges returned in the range collection. Default is false which indicates that spacing characters at the start and end of the ranges are included in the range collection. - * - * [Api set: WordApi 1.3] */ getTextRanges(endingMarks: Array, trimSpacing?: boolean): Word.RangeCollection; /** * * Inserts a break at the specified location in the main document. The insertLocation value can be 'Before' or 'After'. * + * [Api set: WordApi 1.1] + * * @param breakType Required. The break type to add. * @param insertLocation Required. The value can be 'Before' or 'After'. - * - * [Api set: WordApi 1.1] */ insertBreak(breakType: string, insertLocation: string): void; /** @@ -12700,91 +12992,100 @@ declare module Word { * * Inserts a document at the specified location. The insertLocation value can be 'Replace', 'Start', 'End', 'Before' or 'After'. * + * [Api set: WordApi 1.1] + * * @param base64File Required. The base64 encoded content of a .docx file. * @param insertLocation Required. The value can be 'Replace', 'Start', 'End', 'Before' or 'After'. - * - * [Api set: WordApi 1.1] */ insertFileFromBase64(base64File: string, insertLocation: string): Word.Range; /** * * Inserts HTML at the specified location. The insertLocation value can be 'Replace', 'Start', 'End', 'Before' or 'After'. * + * [Api set: WordApi 1.1] + * * @param html Required. The HTML to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start', 'End', 'Before' or 'After'. - * - * [Api set: WordApi 1.1] */ insertHtml(html: string, insertLocation: string): Word.Range; /** * * Inserts a picture at the specified location. The insertLocation value can be 'Replace', 'Start', 'End', 'Before' or 'After'. * + * [Api set: WordApi 1.2] + * * @param base64EncodedImage Required. The base64 encoded image to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start', 'End', 'Before' or 'After'. - * - * [Api set: WordApi 1.2] */ insertInlinePictureFromBase64(base64EncodedImage: string, insertLocation: string): Word.InlinePicture; /** * * Inserts OOXML at the specified location. The insertLocation value can be 'Replace', 'Start', 'End', 'Before' or 'After'. * + * [Api set: WordApi 1.1] + * * @param ooxml Required. The OOXML to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start', 'End', 'Before' or 'After'. - * - * [Api set: WordApi 1.1] */ insertOoxml(ooxml: string, insertLocation: string): Word.Range; /** * * Inserts a paragraph at the specified location. The insertLocation value can be 'Before' or 'After'. * + * [Api set: WordApi 1.1] + * * @param paragraphText Required. The paragraph text to be inserted. * @param insertLocation Required. The value can be 'Before' or 'After'. - * - * [Api set: WordApi 1.1] */ insertParagraph(paragraphText: string, insertLocation: string): Word.Paragraph; /** * * Inserts a table with the specified number of rows and columns. The insertLocation value can be 'Before' or 'After'. * + * [Api set: WordApi 1.3] + * * @param rowCount Required. The number of rows in the table. * @param columnCount Required. The number of columns in the table. * @param insertLocation Required. The value can be 'Before' or 'After'. * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. - * - * [Api set: WordApi 1.3] */ insertTable(rowCount: number, columnCount: number, insertLocation: string, values?: Array>): Word.Table; /** * * Inserts text at the specified location. The insertLocation value can be 'Replace', 'Start', 'End', 'Before' or 'After'. * + * [Api set: WordApi 1.1] + * * @param text Required. Text to be inserted. * @param insertLocation Required. The value can be 'Replace', 'Start', 'End', 'Before' or 'After'. - * - * [Api set: WordApi 1.1] */ insertText(text: string, insertLocation: string): Word.Range; /** * - * Returns a new range as the intersection of this range with another range. This range is not changed. - * - * @param range Required. Another range. + * Returns a new range as the intersection of this range with another range. This range is not changed. Throws if the two ranges are not overlapped or adjacent. * * [Api set: WordApi 1.3] + * + * @param range Required. Another range. */ intersectWith(range: Word.Range): Word.Range; + /** + * + * Returns a new range as the intersection of this range with another range. This range is not changed. Returns a null object if the two ranges are not overlapped or adjacent. + * + * [Api set: WordApi 1.3] + * + * @param range Required. Another range. + */ + intersectWithOrNullObject(range: Word.Range): Word.Range; /** * * Performs a search with the specified searchOptions on the scope of the range object. The search results are a collection of range objects. * + * [Api set: WordApi 1.1] + * * @param searchText Required. The search text. * @param searchOptions Optional. Options for the search. - * - * [Api set: WordApi 1.1] */ search(searchText: string, searchOptions?: Word.SearchOptions | { ignorePunct?: boolean; @@ -12799,21 +13100,21 @@ declare module Word { * * Selects and navigates the Word UI to the range. * - * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. - * * [Api set: WordApi 1.1] + * + * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. */ select(selectionMode?: string): void; /** * * Splits the range into child ranges by using delimiters. * + * [Api set: WordApi 1.3] + * * @param delimiters Required. The delimiters as an array of strings. * @param multiParagraphs Optional. Indicates whether a returned child range can cover multiple paragraphs. Default is false which indicates that the paragraph boundaries are also used as delimiters. * @param trimDelimiters Optional. Indicates whether to trim delimiters from the ranges in the range collection. Default is false which indicates that the delimiters are included in the ranges returned in the range collection. * @param trimSpacing Optional. Indicates whether to trim spacing characters (spaces, tabs, column breaks and paragraph end marks) from the start and end of the ranges returned in the range collection. Default is false which indicates that spacing characters at the start and end of the ranges are included in the range collection. - * - * [Api set: WordApi 1.3] */ split(delimiters: Array, multiParagraphs?: boolean, trimDelimiters?: boolean, trimSpacing?: boolean): Word.RangeCollection; /** @@ -12825,7 +13126,7 @@ declare module Word { */ track(): Word.Range; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.Range; toJSON(): { @@ -12841,18 +13142,25 @@ declare module Word { * * Contains a collection of [range](range.md) objects. * - * [Api set: WordApi 1.3] + * [Api set: WordApi 1.1] */ class RangeCollection extends OfficeExtension.ClientObject { /** Gets the loaded child items in this collection. */ items: Array; /** * - * Gets the first range in this collection. + * Gets the first range in this collection. Throws if this collection is empty. * * [Api set: WordApi 1.3] */ getFirst(): Word.Range; + /** + * + * Gets the first range in this collection. Returns a null object if this collection is empty. + * + * [Api set: WordApi 1.3] + */ + getFirstOrNullObject(): Word.Range; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -12862,7 +13170,7 @@ declare module Word { */ track(): Word.RangeCollection; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.RangeCollection; toJSON(): {}; @@ -12924,6 +13232,15 @@ declare module Word { * [Api set: WordApi 1.1] */ matchWildcards: boolean; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.SearchOptionsUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: SearchOptions): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -12956,45 +13273,47 @@ declare module Word { * [Api set: WordApi 1.1] */ body: Word.Body; - /** - * - * Gets or sets a value that indicates whether even-numbered pages have a different header and footer from odd-numbered pages in the section. - * - * [Api set: WordApi 1.3] - */ - headerFooterEvenPageDifferent: boolean; - /** - * - * Gets or sets a value that indicates whether the first page has a different header and footer from the other pages in the section. - * - * [Api set: WordApi 1.3] - */ - headerFooterFirstPageDifferent: boolean; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.SectionUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: Section): void; /** * * Gets one of the section's footers. * - * @param type Required. The type of footer to return. This value can be: 'primary', 'firstPage' or 'evenPages'. - * * [Api set: WordApi 1.1] + * + * @param type Required. The type of footer to return. This value can be: 'primary', 'firstPage' or 'evenPages'. */ getFooter(type: string): Word.Body; /** * * Gets one of the section's headers. * - * @param type Required. The type of header to return. This value can be: 'primary', 'firstPage' or 'evenPages'. - * * [Api set: WordApi 1.1] + * + * @param type Required. The type of header to return. This value can be: 'primary', 'firstPage' or 'evenPages'. */ getHeader(type: string): Word.Body; /** * - * Gets the next section. + * Gets the next section. Throws if this section is the last one. * * [Api set: WordApi 1.3] */ getNext(): Word.Section; + /** + * + * Gets the next section. Returns a null object if this section is the last one. + * + * [Api set: WordApi 1.3] + */ + getNextOrNullObject(): Word.Section; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -13004,13 +13323,11 @@ declare module Word { */ track(): Word.Section; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.Section; toJSON(): { "body": Body; - "headerFooterEvenPageDifferent": boolean; - "headerFooterFirstPageDifferent": boolean; }; } /** @@ -13024,11 +13341,18 @@ declare module Word { items: Array; /** * - * Gets the first section in this collection. + * Gets the first section in this collection. Throws if this collection is empty. * * [Api set: WordApi 1.3] */ getFirst(): Word.Section; + /** + * + * Gets the first section in this collection. Returns a null object if this collection is empty. + * + * [Api set: WordApi 1.3] + */ + getFirstOrNullObject(): Word.Section; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -13038,7 +13362,7 @@ declare module Word { */ track(): Word.SectionCollection; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.SectionCollection; toJSON(): {}; @@ -13057,20 +13381,6 @@ declare module Word { * [Api set: WordApi 1.3] */ font: Word.Font; - /** - * - * Gets the paragraph after the table. Read-only. - * - * [Api set: WordApi 1.3] - */ - paragraphAfter: Word.Paragraph; - /** - * - * Gets the paragraph before the table. Read-only. - * - * [Api set: WordApi 1.3] - */ - paragraphBefore: Word.Paragraph; /** * * Gets the parent body of the table. Read-only. @@ -13080,25 +13390,46 @@ declare module Word { parentBody: Word.Body; /** * - * Gets the content control that contains the table. Read-only. + * Gets the content control that contains the table. Throws if there isn't a parent content control. Read-only. * * [Api set: WordApi 1.3] */ parentContentControl: Word.ContentControl; /** * - * Gets the table that contains this table. Returns a null object if it is not contained in a table. Read-only. + * Gets the content control that contains the table. Returns a null object if there isn't a parent content control. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentContentControlOrNullObject: Word.ContentControl; + /** + * + * Gets the table that contains this table. Throws if it is not contained in a table. Read-only. * * [Api set: WordApi 1.3] */ parentTable: Word.Table; /** * - * Gets the table cell that contains this table. Returns a null object if it is not contained in a table cell. Read-only. + * Gets the table cell that contains this table. Throws if it is not contained in a table cell. Read-only. * * [Api set: WordApi 1.3] */ parentTableCell: Word.TableCell; + /** + * + * Gets the table cell that contains this table. Returns a null object if it is not contained in a table cell. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentTableCellOrNullObject: Word.TableCell; + /** + * + * Gets the table that contains this table. Returns a null object if it is not contained in a table. Read-only. + * + * [Api set: WordApi 1.3] + */ + parentTableOrNullObject: Word.Table; /** * * Gets all of the table rows. Read-only. @@ -13127,13 +13458,6 @@ declare module Word { * [Api set: WordApi 1.3] */ headerRowCount: number; - /** - * - * Gets the height of the table in points. Read-only. - * - * [Api set: WordApi 1.3] - */ - height: number; /** * * Gets and sets the horizontal alignment of every cell in the table. The value can be 'left', 'centered', 'right', or 'justified'. @@ -13239,35 +13563,37 @@ declare module Word { * [Api set: WordApi 1.3] */ width: number; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.TableUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: Table): void; /** * * Adds columns to the start or end of the table, using the first or last existing column as a template. This is applicable to uniform tables. The string values, if specified, are set in the newly inserted rows. * + * [Api set: WordApi 1.3] + * * @param insertLocation Required. It can be 'Start' or 'End', corresponding to the appropriate side of the table. * @param columnCount Required. Number of columns to add. * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. - * - * [Api set: WordApi 1.3] */ addColumns(insertLocation: string, columnCount: number, values?: Array>): void; /** * * Adds rows to the start or end of the table, using the first or last existing row as a template. The string values, if specified, are set in the newly inserted rows. * + * [Api set: WordApi 1.3] + * * @param insertLocation Required. It can be 'Start' or 'End'. * @param rowCount Required. Number of rows to add. * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. - * - * [Api set: WordApi 1.3] */ addRows(insertLocation: string, rowCount: number, values?: Array>): Word.TableRowCollection; - /** - * - * Autofits the table columns to the width of their contents. - * - * [Api set: WordApi 1.3] - */ - autoFitContents(): void; /** * * Autofits the table columns to the width of the window. @@ -13293,79 +13619,117 @@ declare module Word { * * Deletes specific columns. This is applicable to uniform tables. * + * [Api set: WordApi 1.3] + * * @param columnIndex Required. The first column to delete. * @param columnCount Optional. The number of columns to delete. Default 1. - * - * [Api set: WordApi 1.3] */ deleteColumns(columnIndex: number, columnCount?: number): void; /** * * Deletes specific rows. * + * [Api set: WordApi 1.3] + * * @param rowIndex Required. The first row to delete. * @param rowCount Optional. The number of rows to delete. Default 1. - * - * [Api set: WordApi 1.3] */ deleteRows(rowIndex: number, rowCount?: number): void; /** * - * Distributes the column widths evenly. + * Distributes the column widths evenly. This is applicable to uniform tables. * * [Api set: WordApi 1.3] */ distributeColumns(): void; - /** - * - * Distributes the row heights evenly. - * - * [Api set: WordApi 1.3] - */ - distributeRows(): void; /** * * Gets the border style for the specified border. * - * @param borderLocation Required. The border location. - * * [Api set: WordApi 1.3] + * + * @param borderLocation Required. The border location. */ getBorder(borderLocation: string): Word.TableBorder; /** * - * Gets the table cell at a specified row and column. + * Gets the table cell at a specified row and column. Throws if the specified table cell does not exist. + * + * [Api set: WordApi 1.3] * * @param rowIndex Required. The index of the row. * @param cellIndex Required. The index of the cell in the row. - * - * [Api set: WordApi 1.3] */ getCell(rowIndex: number, cellIndex: number): Word.TableCell; /** * - * Gets cell padding in points. - * - * @param cellPaddingLocation Required. The cell padding location can be 'Top', 'Left', 'Bottom' or 'Right'. + * Gets the table cell at a specified row and column. Returns a null object if the specified table cell does not exist. * * [Api set: WordApi 1.3] + * + * @param rowIndex Required. The index of the row. + * @param cellIndex Required. The index of the cell in the row. + */ + getCellOrNullObject(rowIndex: number, cellIndex: number): Word.TableCell; + /** + * + * Gets cell padding in points. + * + * [Api set: WordApi 1.3] + * + * @param cellPaddingLocation Required. The cell padding location can be 'Top', 'Left', 'Bottom' or 'Right'. */ getCellPadding(cellPaddingLocation: string): OfficeExtension.ClientResult; /** * - * Gets the next table. + * Gets the next table. Throws if this table is the last one. * * [Api set: WordApi 1.3] */ getNext(): Word.Table; /** * - * Gets the range that contains this table, or the range at the start or end of the table. - * - * @param rangeLocation Optional. The range location can be 'Whole', 'Start', 'End' or 'After'. + * Gets the next table. Returns a null object if this table is the last one. * * [Api set: WordApi 1.3] */ + getNextOrNullObject(): Word.Table; + /** + * + * Gets the paragraph after the table. Throws if there isn't a paragraph after the table. + * + * [Api set: WordApi 1.3] + */ + getParagraphAfter(): Word.Paragraph; + /** + * + * Gets the paragraph after the table. Returns a null object if there isn't a paragraph after the table. + * + * [Api set: WordApi 1.3] + */ + getParagraphAfterOrNullObject(): Word.Paragraph; + /** + * + * Gets the paragraph before the table. Throws if there isn't a paragraph before the table. + * + * [Api set: WordApi 1.3] + */ + getParagraphBefore(): Word.Paragraph; + /** + * + * Gets the paragraph before the table. Returns a null object if there isn't a paragraph before the table. + * + * [Api set: WordApi 1.3] + */ + getParagraphBeforeOrNullObject(): Word.Paragraph; + /** + * + * Gets the range that contains this table, or the range at the start or end of the table. + * + * [Api set: WordApi 1.3] + * + * @param rangeLocation Optional. The range location can be 'Whole', 'Start', 'End' or 'After'. + */ getRange(rangeLocation?: string): Word.Range; /** * @@ -13378,32 +13742,32 @@ declare module Word { * * Inserts a paragraph at the specified location. The insertLocation value can be 'Before' or 'After'. * + * [Api set: WordApi 1.3] + * * @param paragraphText Required. The paragraph text to be inserted. * @param insertLocation Required. The value can be 'Before' or 'After'. - * - * [Api set: WordApi 1.3] */ insertParagraph(paragraphText: string, insertLocation: string): Word.Paragraph; /** * * Inserts a table with the specified number of rows and columns. The insertLocation value can be 'Before' or 'After'. * + * [Api set: WordApi 1.3] + * * @param rowCount Required. The number of rows in the table. * @param columnCount Required. The number of columns in the table. * @param insertLocation Required. The value can be 'Before' or 'After'. * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. - * - * [Api set: WordApi 1.3] */ insertTable(rowCount: number, columnCount: number, insertLocation: string, values?: Array>): Word.Table; /** * * Performs a search with the specified searchOptions on the scope of the table object. The search results are a collection of range objects. * + * [Api set: WordApi 1.3] + * * @param searchText Required. The search text. * @param searchOptions Optional. Options for the search. - * - * [Api set: WordApi 1.3] */ search(searchText: string, searchOptions?: Word.SearchOptions | { ignorePunct?: boolean; @@ -13418,18 +13782,19 @@ declare module Word { * * Selects the table, or the position at the start or end of the table, and navigates the Word UI to it. * - * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. - * * [Api set: WordApi 1.3] + * + * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. */ select(selectionMode?: string): void; /** * * Sets cell padding in points. * - * @param cellPaddingLocation Required. The cell padding location can be 'Top', 'Left', 'Bottom' or 'Right'. - * * [Api set: WordApi 1.3] + * + * @param cellPaddingLocation Required. The cell padding location can be 'Top', 'Left', 'Bottom' or 'Right'. + * @param cellPadding Required. The cell padding. */ setCellPadding(cellPaddingLocation: string, cellPadding: number): void; /** @@ -13441,14 +13806,13 @@ declare module Word { */ track(): Word.Table; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.Table; toJSON(): { "alignment": string; "font": Font; "headerRowCount": number; - "height": number; "horizontalAlignment": string; "isUniform": boolean; "nestingLevel": number; @@ -13477,11 +13841,18 @@ declare module Word { items: Array; /** * - * Gets the first table in this collection. + * Gets the first table in this collection. Throws if this collection is empty. * * [Api set: WordApi 1.3] */ getFirst(): Word.Table; + /** + * + * Gets the first table in this collection. Returns a null object if this collection is empty. + * + * [Api set: WordApi 1.3] + */ + getFirstOrNullObject(): Word.Table; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -13491,7 +13862,7 @@ declare module Word { */ track(): Word.TableCollection; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.TableCollection; toJSON(): {}; @@ -13568,11 +13939,11 @@ declare module Word { shadingColor: string; /** * - * Gets and sets the text values in the row, as a 1D Javascript array. + * Gets and sets the text values in the row, as a 2D Javascript array. * * [Api set: WordApi 1.3] */ - values: Array; + values: Array>; /** * * Gets and sets the vertical alignment of the cells in the row. The value can be 'top', 'center' or 'bottom'. @@ -13580,6 +13951,15 @@ declare module Word { * [Api set: WordApi 1.3] */ verticalAlignment: string; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.TableRowUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: TableRow): void; /** * * Clears the contents of the row. @@ -13598,46 +13978,53 @@ declare module Word { * * Gets the border style of the cells in the row. * - * @param borderLocation Required. The border location. - * * [Api set: WordApi 1.3] + * + * @param borderLocation Required. The border location. */ getBorder(borderLocation: string): Word.TableBorder; /** * * Gets cell padding in points. * - * @param cellPaddingLocation Required. The cell padding location can be 'Top', 'Left', 'Bottom' or 'Right'. - * * [Api set: WordApi 1.3] + * + * @param cellPaddingLocation Required. The cell padding location can be 'Top', 'Left', 'Bottom' or 'Right'. */ getCellPadding(cellPaddingLocation: string): OfficeExtension.ClientResult; /** * - * Gets the next row. + * Gets the next row. Throws if this row is the last one. * * [Api set: WordApi 1.3] */ getNext(): Word.TableRow; + /** + * + * Gets the next row. Returns a null object if this row is the last one. + * + * [Api set: WordApi 1.3] + */ + getNextOrNullObject(): Word.TableRow; /** * * Inserts rows using this row as a template. If values are specified, inserts the values into the new rows. * + * [Api set: WordApi 1.3] + * * @param insertLocation Required. Where the new rows should be inserted, relative to the current row. It can be 'Before' or 'After'. * @param rowCount Required. Number of rows to add * @param values Optional. Strings to insert in the new rows, specified as a 2D array. The number of cells in each row must not exceed the number of cells in the existing row. - * - * [Api set: WordApi 1.3] */ insertRows(insertLocation: string, rowCount: number, values?: Array>): Word.TableRowCollection; /** * * Performs a search with the specified searchOptions on the scope of the row. The search results are a collection of range objects. * + * [Api set: WordApi 1.3] + * * @param searchText Required. The search text. * @param searchOptions Optional. Options for the search. - * - * [Api set: WordApi 1.3] */ search(searchText: string, searchOptions?: Word.SearchOptions | { ignorePunct?: boolean; @@ -13652,18 +14039,19 @@ declare module Word { * * Selects the row and navigates the Word UI to it. * - * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. - * * [Api set: WordApi 1.3] + * + * @param selectionMode Optional. The selection mode can be 'Select', 'Start' or 'End'. 'Select' is the default. */ select(selectionMode?: string): void; /** * * Sets cell padding in points. * - * @param cellPaddingLocation Required. The cell padding location can be 'Top', 'Left', 'Bottom' or 'Right'. - * * [Api set: WordApi 1.3] + * + * @param cellPaddingLocation Required. The cell padding location can be 'Top', 'Left', 'Bottom' or 'Right'. + * @param cellPadding Required. The cell padding. */ setCellPadding(cellPaddingLocation: string, cellPadding: number): void; /** @@ -13675,7 +14063,7 @@ declare module Word { */ track(): Word.TableRow; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.TableRow; toJSON(): { @@ -13686,7 +14074,7 @@ declare module Word { "preferredHeight": number; "rowIndex": number; "shadingColor": string; - "values": string[]; + "values": string[][]; "verticalAlignment": string; }; } @@ -13701,11 +14089,18 @@ declare module Word { items: Array; /** * - * Gets the first row in this collection. + * Gets the first row in this collection. Throws if this collection is empty. * * [Api set: WordApi 1.3] */ getFirst(): Word.TableRow; + /** + * + * Gets the first row in this collection. Returns a null object if this collection is empty. + * + * [Api set: WordApi 1.3] + */ + getFirstOrNullObject(): Word.TableRow; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -13715,7 +14110,7 @@ declare module Word { */ track(): Word.TableRowCollection; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.TableRowCollection; toJSON(): {}; @@ -13804,6 +14199,15 @@ declare module Word { * [Api set: WordApi 1.3] */ width: number; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.TableCellUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: TableCell): void; /** * * Deletes the column containing this cell. This is applicable to uniform tables. @@ -13822,56 +14226,64 @@ declare module Word { * * Gets the border style for the specified border. * - * @param borderLocation Required. The border location. - * * [Api set: WordApi 1.3] + * + * @param borderLocation Required. The border location. */ getBorder(borderLocation: string): Word.TableBorder; /** * * Gets cell padding in points. * - * @param cellPaddingLocation Required. The cell padding location can be 'Top', 'Left', 'Bottom' or 'Right'. - * * [Api set: WordApi 1.3] + * + * @param cellPaddingLocation Required. The cell padding location can be 'Top', 'Left', 'Bottom' or 'Right'. */ getCellPadding(cellPaddingLocation: string): OfficeExtension.ClientResult; /** * - * Gets the next cell. + * Gets the next cell. Throws if this cell is the last one. * * [Api set: WordApi 1.3] */ getNext(): Word.TableCell; + /** + * + * Gets the next cell. Returns a null object if this cell is the last one. + * + * [Api set: WordApi 1.3] + */ + getNextOrNullObject(): Word.TableCell; /** * * Adds columns to the left or right of the cell, using the cell's column as a template. This is applicable to uniform tables. The string values, if specified, are set in the newly inserted rows. * + * [Api set: WordApi 1.3] + * * @param insertLocation Required. It can be 'Before' or 'After'. * @param columnCount Required. Number of columns to add * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. - * - * [Api set: WordApi 1.3] */ insertColumns(insertLocation: string, columnCount: number, values?: Array>): void; /** * * Inserts rows above or below the cell, using the cell's row as a template. The string values, if specified, are set in the newly inserted rows. * + * [Api set: WordApi 1.3] + * * @param insertLocation Required. It can be 'Before' or 'After'. * @param rowCount Required. Number of rows to add. * @param values Optional 2D array. Cells are filled if the corresponding strings are specified in the array. - * - * [Api set: WordApi 1.3] */ insertRows(insertLocation: string, rowCount: number, values?: Array>): Word.TableRowCollection; /** * * Sets cell padding in points. * - * @param cellPaddingLocation Required. The cell padding location can be 'Top', 'Left', 'Bottom' or 'Right'. - * * [Api set: WordApi 1.3] + * + * @param cellPaddingLocation Required. The cell padding location can be 'Top', 'Left', 'Bottom' or 'Right'. + * @param cellPadding Required. The cell padding. */ setCellPadding(cellPaddingLocation: string, cellPadding: number): void; /** @@ -13883,7 +14295,7 @@ declare module Word { */ track(): Word.TableCell; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.TableCell; toJSON(): { @@ -13909,11 +14321,18 @@ declare module Word { items: Array; /** * - * Gets the first table cell in this collection. + * Gets the first table cell in this collection. Throws if this collection is empty. * * [Api set: WordApi 1.3] */ getFirst(): Word.TableCell; + /** + * + * Gets the first table cell in this collection. Returns a null object if this collection is empty. + * + * [Api set: WordApi 1.3] + */ + getFirstOrNullObject(): Word.TableCell; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -13923,7 +14342,7 @@ declare module Word { */ track(): Word.TableCellCollection; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.TableCellCollection; toJSON(): {}; @@ -13956,6 +14375,15 @@ declare module Word { * [Api set: WordApi 1.3] */ width: number; + /** Sets multiple properties on the object at the same time, based on JSON input. */ + set(properties: Interfaces.TableBorderUpdateData, options?: { + /** + * Throw an error if the passed-in property list includes read-only properties (default = true). + */ + throwOnReadOnly?: boolean; + }): void; + /** Sets multiple properties on the object at the same time, based on an existing loaded object. */ + set(properties: TableBorder): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -13965,7 +14393,7 @@ declare module Word { */ track(): Word.TableBorder; /** - * Release the memory associated with this object, if has previous been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. + * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Word.TableBorder; toJSON(): { @@ -13980,7 +14408,7 @@ declare module Word { * * [Api set: WordApi] */ - module ContentControlType { + namespace ContentControlType { var unknown: string; var richTextInline: string; var richTextParagraphs: string; @@ -14005,7 +14433,7 @@ declare module Word { * * [Api set: WordApi] */ - module ContentControlAppearance { + namespace ContentControlAppearance { var boundingBox: string; var tags: string; var hidden: string; @@ -14016,7 +14444,7 @@ declare module Word { * * [Api set: WordApi] */ - module UnderlineType { + namespace UnderlineType { var mixed: string; var none: string; /** @@ -14053,7 +14481,7 @@ declare module Word { * * [Api set: WordApi] */ - module BreakType { + namespace BreakType { /** * * Page break. @@ -14102,7 +14530,7 @@ declare module Word { * * [Api set: WordApi] */ - module InsertLocation { + namespace InsertLocation { var before: string; var after: string; var start: string; @@ -14112,7 +14540,7 @@ declare module Word { /** * [Api set: WordApi] */ - module Alignment { + namespace Alignment { var mixed: string; var unknown: string; var left: string; @@ -14123,7 +14551,7 @@ declare module Word { /** * [Api set: WordApi] */ - module HeaderFooterType { + namespace HeaderFooterType { var primary: string; var firstPage: string; var evenPages: string; @@ -14131,7 +14559,7 @@ declare module Word { /** * [Api set: WordApi] */ - module BodyType { + namespace BodyType { var unknown: string; var mainDoc: string; var section: string; @@ -14142,7 +14570,7 @@ declare module Word { /** * [Api set: WordApi] */ - module SelectionMode { + namespace SelectionMode { var select: string; var start: string; var end: string; @@ -14150,7 +14578,7 @@ declare module Word { /** * [Api set: WordApi] */ - module ImageFormat { + namespace ImageFormat { var unsupported: string; var undefined: string; var bmp: string; @@ -14169,7 +14597,7 @@ declare module Word { /** * [Api set: WordApi] */ - module RangeLocation { + namespace RangeLocation { var whole: string; var start: string; var end: string; @@ -14180,7 +14608,7 @@ declare module Word { /** * [Api set: WordApi] */ - module LocationRelation { + namespace LocationRelation { var unrelated: string; var equal: string; var containsStart: string; @@ -14199,7 +14627,7 @@ declare module Word { /** * [Api set: WordApi] */ - module BorderLocation { + namespace BorderLocation { var top: string; var left: string; var bottom: string; @@ -14213,7 +14641,7 @@ declare module Word { /** * [Api set: WordApi] */ - module CellPaddingLocation { + namespace CellPaddingLocation { var top: string; var left: string; var bottom: string; @@ -14222,7 +14650,7 @@ declare module Word { /** * [Api set: WordApi] */ - module BorderType { + namespace BorderType { var mixed: string; var none: string; var single: string; @@ -14251,7 +14679,7 @@ declare module Word { /** * [Api set: WordApi] */ - module VerticalAlignment { + namespace VerticalAlignment { var mixed: string; var top: string; var center: string; @@ -14260,7 +14688,7 @@ declare module Word { /** * [Api set: WordApi] */ - module ListLevelType { + namespace ListLevelType { var bullet: string; var number: string; var picture: string; @@ -14268,7 +14696,7 @@ declare module Word { /** * [Api set: WordApi] */ - module ListBullet { + namespace ListBullet { var custom: string; var solid: string; var hollow: string; @@ -14280,7 +14708,7 @@ declare module Word { /** * [Api set: WordApi] */ - module ListNumbering { + namespace ListNumbering { var none: string; var arabic: string; var upperRoman: string; @@ -14291,7 +14719,7 @@ declare module Word { /** * [Api set: WordApi] */ - module Style { + namespace Style { /** * * Mixed styles or other style not in this list. @@ -14504,19 +14932,776 @@ declare module Word { /** * [Api set: WordApi] */ - module DocumentPropertyType { + namespace DocumentPropertyType { var string: string; var number: string; var date: string; var boolean: string; } - module ErrorCodes { + namespace ErrorCodes { var accessDenied: string; var generalException: string; var invalidArgument: string; var itemNotFound: string; var notImplemented: string; } + module Interfaces { + /** An interface for updating data on the Body object, for use in "body.set({ ... })". */ + interface BodyUpdateData { + /** + * + * Gets the text format of the body. Use this to get and set font name, size, color and other properties. + * + * [Api set: WordApi 1.1] + */ + font?: Word.Interfaces.FontUpdateData; + /** + * + * Gets or sets the style name for the body. Use this property for custom styles and localized style names. To use the built-in styles that are portable between locales, see the "styleBuiltIn" property. + * + * [Api set: WordApi 1.1] + */ + style?: string; + /** + * + * Gets or sets the built-in style name for the body. Use this property for built-in styles that are portable between locales. To use custom styles or localized style names, see the "style" property. + * + * [Api set: WordApi 1.3] + */ + styleBuiltIn?: string; + } + /** An interface for updating data on the ContentControl object, for use in "contentControl.set({ ... })". */ + interface ContentControlUpdateData { + /** + * + * Gets the text format of the content control. Use this to get and set font name, size, color, and other properties. + * + * [Api set: WordApi 1.1] + */ + font?: Word.Interfaces.FontUpdateData; + /** + * + * Gets or sets the appearance of the content control. The value can be 'boundingBox', 'tags' or 'hidden'. + * + * [Api set: WordApi 1.1] + */ + appearance?: string; + /** + * + * Gets or sets a value that indicates whether the user can delete the content control. Mutually exclusive with removeWhenEdited. + * + * [Api set: WordApi 1.1] + */ + cannotDelete?: boolean; + /** + * + * Gets or sets a value that indicates whether the user can edit the contents of the content control. + * + * [Api set: WordApi 1.1] + */ + cannotEdit?: boolean; + /** + * + * Gets or sets the color of the content control. Color is specified in '#RRGGBB' format or by using the color name. + * + * [Api set: WordApi 1.1] + */ + color?: string; + /** + * + * Gets or sets the placeholder text of the content control. Dimmed text will be displayed when the content control is empty. + * + * [Api set: WordApi 1.1] + */ + placeholderText?: string; + /** + * + * Gets or sets a value that indicates whether the content control is removed after it is edited. Mutually exclusive with cannotDelete. + * + * [Api set: WordApi 1.1] + */ + removeWhenEdited?: boolean; + /** + * + * Gets or sets the style name for the content control. Use this property for custom styles and localized style names. To use the built-in styles that are portable between locales, see the "styleBuiltIn" property. + * + * [Api set: WordApi 1.1] + */ + style?: string; + /** + * + * Gets or sets the built-in style name for the content control. Use this property for built-in styles that are portable between locales. To use custom styles or localized style names, see the "style" property. + * + * [Api set: WordApi 1.3] + */ + styleBuiltIn?: string; + /** + * + * Gets or sets a tag to identify a content control. + * + * [Api set: WordApi 1.1] + */ + tag?: string; + /** + * + * Gets or sets the title for a content control. + * + * [Api set: WordApi 1.1] + */ + title?: string; + } + /** An interface for updating data on the CustomProperty object, for use in "customProperty.set({ ... })". */ + interface CustomPropertyUpdateData { + /** + * + * Gets or sets the value of the custom property. + * + * [Api set: WordApi 1.3] + */ + value?: any; + } + /** An interface for updating data on the Document object, for use in "document.set({ ... })". */ + interface DocumentUpdateData { + /** + * + * Gets the body object of the document. The body is the text that excludes headers, footers, footnotes, textboxes, etc.. + * + * [Api set: WordApi 1.1] + */ + body?: Word.Interfaces.BodyUpdateData; + /** + * + * Gets the properties of the current document. + * + * [Api set: WordApi 1.3] + */ + properties?: Word.Interfaces.DocumentPropertiesUpdateData; + } + /** An interface for updating data on the DocumentProperties object, for use in "documentProperties.set({ ... })". */ + interface DocumentPropertiesUpdateData { + /** + * + * Gets or sets the author of the document. + * + * [Api set: WordApi 1.3] + */ + author?: string; + /** + * + * Gets or sets the category of the document. + * + * [Api set: WordApi 1.3] + */ + category?: string; + /** + * + * Gets or sets the comments of the document. + * + * [Api set: WordApi 1.3] + */ + comments?: string; + /** + * + * Gets or sets the company of the document. + * + * [Api set: WordApi 1.3] + */ + company?: string; + /** + * + * Gets or sets the format of the document. + * + * [Api set: WordApi 1.3] + */ + format?: string; + /** + * + * Gets or sets the keywords of the document. + * + * [Api set: WordApi 1.3] + */ + keywords?: string; + /** + * + * Gets or sets the manager of the document. + * + * [Api set: WordApi 1.3] + */ + manager?: string; + /** + * + * Gets or sets the subject of the document. + * + * [Api set: WordApi 1.3] + */ + subject?: string; + /** + * + * Gets or sets the title of the document. + * + * [Api set: WordApi 1.3] + */ + title?: string; + } + /** An interface for updating data on the Font object, for use in "font.set({ ... })". */ + interface FontUpdateData { + /** + * + * Gets or sets a value that indicates whether the font is bold. True if the font is formatted as bold, otherwise, false. + * + * [Api set: WordApi 1.1] + */ + bold?: boolean; + /** + * + * Gets or sets the color for the specified font. You can provide the value in the '#RRGGBB' format or the color name. + * + * [Api set: WordApi 1.1] + */ + color?: string; + /** + * + * Gets or sets a value that indicates whether the font has a double strike through. True if the font is formatted as double strikethrough text, otherwise, false. + * + * [Api set: WordApi 1.1] + */ + doubleStrikeThrough?: boolean; + /** + * + * Gets or sets the highlight color. To set it, use a value either in the '#RRGGBB' format or the color name. To remove highlight color, set it to null. The returned highlight color can be in the '#RRGGBB' format, or an empty string for mixed highlight colors, or null for no highlight color. + * + * [Api set: WordApi 1.1] + */ + highlightColor?: string; + /** + * + * Gets or sets a value that indicates whether the font is italicized. True if the font is italicized, otherwise, false. + * + * [Api set: WordApi 1.1] + */ + italic?: boolean; + /** + * + * Gets or sets a value that represents the name of the font. + * + * [Api set: WordApi 1.1] + */ + name?: string; + /** + * + * Gets or sets a value that represents the font size in points. + * + * [Api set: WordApi 1.1] + */ + size?: number; + /** + * + * Gets or sets a value that indicates whether the font has a strike through. True if the font is formatted as strikethrough text, otherwise, false. + * + * [Api set: WordApi 1.1] + */ + strikeThrough?: boolean; + /** + * + * Gets or sets a value that indicates whether the font is a subscript. True if the font is formatted as subscript, otherwise, false. + * + * [Api set: WordApi 1.1] + */ + subscript?: boolean; + /** + * + * Gets or sets a value that indicates whether the font is a superscript. True if the font is formatted as superscript, otherwise, false. + * + * [Api set: WordApi 1.1] + */ + superscript?: boolean; + /** + * + * Gets or sets a value that indicates the font's underline type. 'None' if the font is not underlined. + * + * [Api set: WordApi 1.1] + */ + underline?: string; + } + /** An interface for updating data on the InlinePicture object, for use in "inlinePicture.set({ ... })". */ + interface InlinePictureUpdateData { + /** + * + * Gets or sets a string that represents the alternative text associated with the inline image + * + * [Api set: WordApi 1.1] + */ + altTextDescription?: string; + /** + * + * Gets or sets a string that contains the title for the inline image. + * + * [Api set: WordApi 1.1] + */ + altTextTitle?: string; + /** + * + * Gets or sets a number that describes the height of the inline image. + * + * [Api set: WordApi 1.1] + */ + height?: number; + /** + * + * Gets or sets a hyperlink on the image. Use a '#' to separate the address part from the optional location part. + * + * [Api set: WordApi 1.1] + */ + hyperlink?: string; + /** + * + * Gets or sets a value that indicates whether the inline image retains its original proportions when you resize it. + * + * [Api set: WordApi 1.1] + */ + lockAspectRatio?: boolean; + /** + * + * Gets or sets a number that describes the width of the inline image. + * + * [Api set: WordApi 1.1] + */ + width?: number; + } + /** An interface for updating data on the ListItem object, for use in "listItem.set({ ... })". */ + interface ListItemUpdateData { + /** + * + * Gets or sets the level of the item in the list. + * + * [Api set: WordApi 1.3] + */ + level?: number; + } + /** An interface for updating data on the Paragraph object, for use in "paragraph.set({ ... })". */ + interface ParagraphUpdateData { + /** + * + * Gets the text format of the paragraph. Use this to get and set font name, size, color, and other properties. + * + * [Api set: WordApi 1.1] + */ + font?: Word.Interfaces.FontUpdateData; + /** + * + * Gets the ListItem for the paragraph. Throws if the paragraph is not part of a list. + * + * [Api set: WordApi 1.3] + */ + listItem?: Word.Interfaces.ListItemUpdateData; + /** + * + * Gets the ListItem for the paragraph. Returns a null object if the paragraph is not part of a list. + * + * [Api set: WordApi 1.3] + */ + listItemOrNullObject?: Word.Interfaces.ListItemUpdateData; + /** + * + * Gets or sets the alignment for a paragraph. The value can be 'left', 'centered', 'right', or 'justified'. + * + * [Api set: WordApi 1.1] + */ + alignment?: string; + /** + * + * Gets or sets the value, in points, for a first line or hanging indent. Use a positive value to set a first-line indent, and use a negative value to set a hanging indent. + * + * [Api set: WordApi 1.1] + */ + firstLineIndent?: number; + /** + * + * Gets or sets the left indent value, in points, for the paragraph. + * + * [Api set: WordApi 1.1] + */ + leftIndent?: number; + /** + * + * Gets or sets the line spacing, in points, for the specified paragraph. In the Word UI, this value is divided by 12. + * + * [Api set: WordApi 1.1] + */ + lineSpacing?: number; + /** + * + * Gets or sets the amount of spacing, in grid lines. after the paragraph. + * + * [Api set: WordApi 1.1] + */ + lineUnitAfter?: number; + /** + * + * Gets or sets the amount of spacing, in grid lines, before the paragraph. + * + * [Api set: WordApi 1.1] + */ + lineUnitBefore?: number; + /** + * + * Gets or sets the outline level for the paragraph. + * + * [Api set: WordApi 1.1] + */ + outlineLevel?: number; + /** + * + * Gets or sets the right indent value, in points, for the paragraph. + * + * [Api set: WordApi 1.1] + */ + rightIndent?: number; + /** + * + * Gets or sets the spacing, in points, after the paragraph. + * + * [Api set: WordApi 1.1] + */ + spaceAfter?: number; + /** + * + * Gets or sets the spacing, in points, before the paragraph. + * + * [Api set: WordApi 1.1] + */ + spaceBefore?: number; + /** + * + * Gets or sets the style name for the paragraph. Use this property for custom styles and localized style names. To use the built-in styles that are portable between locales, see the "styleBuiltIn" property. + * + * [Api set: WordApi 1.1] + */ + style?: string; + /** + * + * Gets or sets the built-in style name for the paragraph. Use this property for built-in styles that are portable between locales. To use custom styles or localized style names, see the "style" property. + * + * [Api set: WordApi 1.3] + */ + styleBuiltIn?: string; + } + /** An interface for updating data on the Range object, for use in "range.set({ ... })". */ + interface RangeUpdateData { + /** + * + * Gets the text format of the range. Use this to get and set font name, size, color, and other properties. + * + * [Api set: WordApi 1.1] + */ + font?: Word.Interfaces.FontUpdateData; + /** + * + * Gets the first hyperlink in the range, or sets a hyperlink on the range. All hyperlinks in the range are deleted when you set a new hyperlink on the range. Use a '#' to separate the address part from the optional location part. + * + * [Api set: WordApi 1.3] + */ + hyperlink?: string; + /** + * + * Gets or sets the style name for the range. Use this property for custom styles and localized style names. To use the built-in styles that are portable between locales, see the "styleBuiltIn" property. + * + * [Api set: WordApi 1.1] + */ + style?: string; + /** + * + * Gets or sets the built-in style name for the range. Use this property for built-in styles that are portable between locales. To use custom styles or localized style names, see the "style" property. + * + * [Api set: WordApi 1.3] + */ + styleBuiltIn?: string; + } + /** An interface for updating data on the SearchOptions object, for use in "searchOptions.set({ ... })". */ + interface SearchOptionsUpdateData { + /** + * + * Gets or sets a value that indicates whether to ignore all punctuation characters between words. Corresponds to the Ignore punctuation check box in the Find and Replace dialog box. + * + * [Api set: WordApi 1.1] + */ + ignorePunct?: boolean; + /** + * + * Gets or sets a value that indicates whether to ignore all whitespace between words. Corresponds to the Ignore whitespace characters check box in the Find and Replace dialog box. + * + * [Api set: WordApi 1.1] + */ + ignoreSpace?: boolean; + /** + * + * Gets or sets a value that indicates whether to perform a case sensitive search. Corresponds to the Match case check box in the Find and Replace dialog box (Edit menu). + * + * [Api set: WordApi 1.1] + */ + matchCase?: boolean; + /** + * + * Gets or sets a value that indicates whether to match words that begin with the search string. Corresponds to the Match prefix check box in the Find and Replace dialog box. + * + * [Api set: WordApi 1.1] + */ + matchPrefix?: boolean; + /** + * + * Gets or sets a value that indicates whether to match words that end with the search string. Corresponds to the Match suffix check box in the Find and Replace dialog box. + * + * [Api set: WordApi 1.1] + */ + matchSuffix?: boolean; + /** + * + * Gets or sets a value that indicates whether to find operation only entire words, not text that is part of a larger word. Corresponds to the Find whole words only check box in the Find and Replace dialog box. + * + * [Api set: WordApi 1.1] + */ + matchWholeWord?: boolean; + /** + * + * Gets or sets a value that indicates whether the search will be performed using special search operators. Corresponds to the Use wildcards check box in the Find and Replace dialog box. + * + * [Api set: WordApi 1.1] + */ + matchWildcards?: boolean; + } + /** An interface for updating data on the Section object, for use in "section.set({ ... })". */ + interface SectionUpdateData { + /** + * + * Gets the body object of the section. This does not include the header/footer and other section metadata. + * + * [Api set: WordApi 1.1] + */ + body?: Word.Interfaces.BodyUpdateData; + } + /** An interface for updating data on the Table object, for use in "table.set({ ... })". */ + interface TableUpdateData { + /** + * + * Gets the font. Use this to get and set font name, size, color, and other properties. + * + * [Api set: WordApi 1.3] + */ + font?: Word.Interfaces.FontUpdateData; + /** + * + * Gets or sets the alignment of the table against the page column. The value can be 'left', 'centered' or 'right'. + * + * [Api set: WordApi 1.3] + */ + alignment?: string; + /** + * + * Gets and sets the number of header rows. + * + * [Api set: WordApi 1.3] + */ + headerRowCount?: number; + /** + * + * Gets and sets the horizontal alignment of every cell in the table. The value can be 'left', 'centered', 'right', or 'justified'. + * + * [Api set: WordApi 1.3] + */ + horizontalAlignment?: string; + /** + * + * Gets and sets the shading color. + * + * [Api set: WordApi 1.3] + */ + shadingColor?: string; + /** + * + * Gets or sets the style name for the table. Use this property for custom styles and localized style names. To use the built-in styles that are portable between locales, see the "styleBuiltIn" property. + * + * [Api set: WordApi 1.3] + */ + style?: string; + /** + * + * Gets and sets whether the table has banded columns. + * + * [Api set: WordApi 1.3] + */ + styleBandedColumns?: boolean; + /** + * + * Gets and sets whether the table has banded rows. + * + * [Api set: WordApi 1.3] + */ + styleBandedRows?: boolean; + /** + * + * Gets or sets the built-in style name for the table. Use this property for built-in styles that are portable between locales. To use custom styles or localized style names, see the "style" property. + * + * [Api set: WordApi 1.3] + */ + styleBuiltIn?: string; + /** + * + * Gets and sets whether the table has a first column with a special style. + * + * [Api set: WordApi 1.3] + */ + styleFirstColumn?: boolean; + /** + * + * Gets and sets whether the table has a last column with a special style. + * + * [Api set: WordApi 1.3] + */ + styleLastColumn?: boolean; + /** + * + * Gets and sets whether the table has a total (last) row with a special style. + * + * [Api set: WordApi 1.3] + */ + styleTotalRow?: boolean; + /** + * + * Gets and sets the text values in the table, as a 2D Javascript array. + * + * [Api set: WordApi 1.3] + */ + values?: Array>; + /** + * + * Gets and sets the vertical alignment of every cell in the table. The value can be 'top', 'center' or 'bottom'. + * + * [Api set: WordApi 1.3] + */ + verticalAlignment?: string; + /** + * + * Gets and sets the width of the table in points. + * + * [Api set: WordApi 1.3] + */ + width?: number; + } + /** An interface for updating data on the TableRow object, for use in "tableRow.set({ ... })". */ + interface TableRowUpdateData { + /** + * + * Gets the font. Use this to get and set font name, size, color, and other properties. + * + * [Api set: WordApi 1.3] + */ + font?: Word.Interfaces.FontUpdateData; + /** + * + * Gets and sets the horizontal alignment of every cell in the row. The value can be 'left', 'centered', 'right', or 'justified'. + * + * [Api set: WordApi 1.3] + */ + horizontalAlignment?: string; + /** + * + * Gets and sets the preferred height of the row in points. + * + * [Api set: WordApi 1.3] + */ + preferredHeight?: number; + /** + * + * Gets and sets the shading color. + * + * [Api set: WordApi 1.3] + */ + shadingColor?: string; + /** + * + * Gets and sets the text values in the row, as a 2D Javascript array. + * + * [Api set: WordApi 1.3] + */ + values?: Array>; + /** + * + * Gets and sets the vertical alignment of the cells in the row. The value can be 'top', 'center' or 'bottom'. + * + * [Api set: WordApi 1.3] + */ + verticalAlignment?: string; + } + /** An interface for updating data on the TableCell object, for use in "tableCell.set({ ... })". */ + interface TableCellUpdateData { + /** + * + * Gets the body object of the cell. + * + * [Api set: WordApi 1.3] + */ + body?: Word.Interfaces.BodyUpdateData; + /** + * + * Gets and sets the width of the cell's column in points. This is applicable to uniform tables. + * + * [Api set: WordApi 1.3] + */ + columnWidth?: number; + /** + * + * Gets and sets the horizontal alignment of the cell. The value can be 'left', 'centered', 'right', or 'justified'. + * + * [Api set: WordApi 1.3] + */ + horizontalAlignment?: string; + /** + * + * Gets or sets the shading color of the cell. Color is specified in "#RRGGBB" format or by using the color name. + * + * [Api set: WordApi 1.3] + */ + shadingColor?: string; + /** + * + * Gets and sets the text of the cell. + * + * [Api set: WordApi 1.3] + */ + value?: string; + /** + * + * Gets and sets the vertical alignment of the cell. The value can be 'top', 'center' or 'bottom'. + * + * [Api set: WordApi 1.3] + */ + verticalAlignment?: string; + } + /** An interface for updating data on the TableBorder object, for use in "tableBorder.set({ ... })". */ + interface TableBorderUpdateData { + /** + * + * Gets or sets the table border color, as a hex value or name. + * + * [Api set: WordApi 1.3] + */ + color?: string; + /** + * + * Gets or sets the type of the table border. + * + * [Api set: WordApi 1.3] + */ + type?: string; + /** + * + * Gets or sets the width, in points, of the table border. Not applicable to table border types that have fixed widths. + * + * [Api set: WordApi 1.3] + */ + width?: number; + } + } } declare module Word { /** @@ -14525,7 +15710,6 @@ declare module Word { class RequestContext extends OfficeExtension.ClientRequestContext { constructor(url?: string); document: Document; - application: Application; } /** * Executes a batch script that performs actions on the Word object model, using a new RequestContext. When the promise is resolved, any tracked objects that were automatically allocated during execution will be released. From 706947d2604703a3aca41619c9fc7011a534f66d Mon Sep 17 00:00:00 2001 From: Chris Khoo Date: Fri, 17 Feb 2017 17:35:46 -0800 Subject: [PATCH 134/797] add types for stringify-object --- stringify-object/index.d.ts | 15 +++++++++++++ stringify-object/stringify-object-tests.ts | 26 ++++++++++++++++++++++ stringify-object/tsconfig.json | 22 ++++++++++++++++++ stringify-object/tslint.json | 1 + 4 files changed, 64 insertions(+) create mode 100644 stringify-object/index.d.ts create mode 100644 stringify-object/stringify-object-tests.ts create mode 100644 stringify-object/tsconfig.json create mode 100644 stringify-object/tslint.json diff --git a/stringify-object/index.d.ts b/stringify-object/index.d.ts new file mode 100644 index 0000000000..bfccb83300 --- /dev/null +++ b/stringify-object/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for stringify-object 3.1 +// Project: https://github.com/yeoman/stringify-object +// Definitions by: Chris Khoo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace stringifyObject { } + +declare function stringifyObject(o: any, options?: { + indent?: string, + singleQuotes?: boolean, + filter?: (o: any, prop: string) => boolean, + inlineCharacterLimit?: number +}): string; + +export = stringifyObject; diff --git a/stringify-object/stringify-object-tests.ts b/stringify-object/stringify-object-tests.ts new file mode 100644 index 0000000000..a00be6f1c0 --- /dev/null +++ b/stringify-object/stringify-object-tests.ts @@ -0,0 +1,26 @@ +import * as stringifyObject from 'stringify-object'; + +stringifyObject({ a: 1, b: 2, c: 3 }); + +stringifyObject('abc', { + indent: ' ' +}); + +stringifyObject('123', { + indent: ' ' +}); + +stringifyObject(123, { + indent: ' ', + singleQuotes: false +}); + +stringifyObject([1, 2, 3], { + indent: ' ', + singleQuotes: false, + inlineCharacterLimit: 12 +}); + +stringifyObject([1, 2, 3], { + filter: (o, prop) => prop !== '_hidden_' +}); diff --git a/stringify-object/tsconfig.json b/stringify-object/tsconfig.json new file mode 100644 index 0000000000..00574d2429 --- /dev/null +++ b/stringify-object/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", + "stringify-object-tests.ts" + ] +} diff --git a/stringify-object/tslint.json b/stringify-object/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/stringify-object/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 33cfb60ab2f9698bcc87c702bbe9259ef2c9b440 Mon Sep 17 00:00:00 2001 From: Christopher Currens Date: Sat, 18 Feb 2017 16:18:37 -0800 Subject: [PATCH 135/797] Use BaseIcon class in leaflet MarkerClusterGroupOptions --- leaflet-markercluster/index.d.ts | 2 +- leaflet-markercluster/leaflet-markercluster-tests.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/leaflet-markercluster/index.d.ts b/leaflet-markercluster/index.d.ts index ab8b6d9431..b1d4649b33 100644 --- a/leaflet-markercluster/index.d.ts +++ b/leaflet-markercluster/index.d.ts @@ -105,7 +105,7 @@ declare namespace L { /* * Function used to create the cluster icon */ - iconCreateFunction?: ((cluster: L.MarkerCluster) => L.Icon); + iconCreateFunction?: ((cluster: L.MarkerCluster) => L.BaseIcon); /* * Boolean to split the addLayers processing in to small intervals so that the page does not freeze. diff --git a/leaflet-markercluster/leaflet-markercluster-tests.ts b/leaflet-markercluster/leaflet-markercluster-tests.ts index 346239f836..ac607f1f5d 100644 --- a/leaflet-markercluster/leaflet-markercluster-tests.ts +++ b/leaflet-markercluster/leaflet-markercluster-tests.ts @@ -28,6 +28,10 @@ markerClusterGroupOptions = { chunkDelay: 100 } +markerClusterGroupOptions.iconCreateFunction = (cluster: L.MarkerCluster) => { + return L.divIcon(); +}; + let markerClusterGroup: L.MarkerClusterGroup; markerClusterGroup = L.markerClusterGroup(); markerClusterGroup = L.markerClusterGroup(markerClusterGroupOptions); From a40c5ca39f03f600d83eae1a4e92051ac198346f Mon Sep 17 00:00:00 2001 From: Achim Hasenmueller Date: Sun, 19 Feb 2017 09:21:37 +0100 Subject: [PATCH 136/797] Removed tests for functionality that is no longer in OpenLayers 4 --- openlayers/openlayers-tests.ts | 36 ---------------------------------- 1 file changed, 36 deletions(-) diff --git a/openlayers/openlayers-tests.ts b/openlayers/openlayers-tests.ts index 1add5f64ed..ca74a6bbc2 100644 --- a/openlayers/openlayers-tests.ts +++ b/openlayers/openlayers-tests.ts @@ -431,8 +431,6 @@ eventKeyMixed = observable.once(stringValue, fn); eventKeyMixed = observable.once([stringValue, stringValue], fn, {}); voidValue = observable.un(stringValue, fn); voidValue = observable.un([stringValue, stringValue], fn, {}); -voidValue = observable.unByKey(eventKey); -voidValue = observable.unByKey(eventKeyArray); // // ol.proj @@ -462,7 +460,6 @@ let map: ol.Map = new ol.Map({ layers: [tileLayer], target: stringValue }); -voidValue = map.beforeRender(preRenderFunction); // // ol.source.ImageWMS @@ -508,39 +505,6 @@ let wmts: ol.source.WMTS = new ol.source.WMTS({ wrapX: true, }); -// -// ol.animation -// -let bounceOptions: olx.animation.BounceOptions; -bounceOptions.duration = numberValue; -bounceOptions.start = numberValue; -bounceOptions.resolution = numberValue; -bounceOptions.easing = easingFunction; -preRenderFunction = ol.animation.bounce(bounceOptions); - -let panOptions: olx.animation.PanOptions; -panOptions.duration = numberValue; -panOptions.start = numberValue; -panOptions.source = coordinate; -panOptions.easing = easingFunction; -preRenderFunction = ol.animation.pan(panOptions); - -let rotateOptions: olx.animation.RotateOptions; -rotateOptions.duration = numberValue; -rotateOptions.start = numberValue; -rotateOptions.anchor = coordinate; -rotateOptions.rotation = numberValue; -rotateOptions.easing = easingFunction; -preRenderFunction = ol.animation.rotate(rotateOptions); - -let zoomOptions: olx.animation.ZoomOptions; -zoomOptions.duration = numberValue; -zoomOptions.start = numberValue; -zoomOptions.resolution = numberValue; -zoomOptions.easing = easingFunction; -preRenderFunction = ol.animation.zoom(zoomOptions); -voidValue = map.beforeRender(preRenderFunction); - // // ol.coordinate // From a7ffc449a43f2ac89a4ee2a57f625663abbb9ba3 Mon Sep 17 00:00:00 2001 From: morrisjdev Date: Sun, 19 Feb 2017 21:26:34 +0100 Subject: [PATCH 137/797] Added declarations for 'linq4js' --- linq4js/index.d.ts | 286 +++++++++++++++++++++++++++++++++++++++ linq4js/linq4js-tests.ts | 5 + linq4js/tsconfig.json | 22 +++ 3 files changed, 313 insertions(+) create mode 100644 linq4js/index.d.ts create mode 100644 linq4js/linq4js-tests.ts create mode 100644 linq4js/tsconfig.json diff --git a/linq4js/index.d.ts b/linq4js/index.d.ts new file mode 100644 index 0000000000..6b98907453 --- /dev/null +++ b/linq4js/index.d.ts @@ -0,0 +1,286 @@ +// Type definitions for Linq4JS 2.0.3 +// Project: https://github.com/morrisjdev/Linq4JS +// Definitions by: Morris Janatzek +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace Linq4JS { + class GeneratedEntity { + _GeneratedId_: number; + Id: number; + } +} +declare namespace Linq4JS { + class Helper { + static ConvertStringFunction: (functionString: string) => any; + static ConvertFunction: (testFunction: any) => T; + static OrderCompareFunction: (valueSelector: (item: T) => any, a: T, b: T, invert: boolean) => number; + } +} +interface Array { + Order: Array; + GroupValue: any; + /** + * Creates a copy of the array + */ + Clone(): Array; + /** + * Gets the index of the first item found by a filter + * @param filter A function (or function-string) that returns a boolean when matching element was found + */ + FindIndex(filter: ((item: T) => boolean) | string): number; + /** + * Gets the index of the last item found by a filter + * @param filter A function (or function-string) that returns a boolean when matching element was found + */ + FindLastIndex(filter: ((item: T) => boolean) | string): number; + /** + * Gets the item with the index + * @param index Item index + */ + Get(index: number): T; + /** + * Executes a method for each item in the array + * @param action A function (or function-string) that gets executed for each element. If it returns false the loop stops. + */ + ForEach(action: ((item: T, index?: number) => boolean | any) | string): Array; + /** + * Updates an object in the array + * @param object The object to update + * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array + */ + Update(object: T, primaryKeySelector?: ((item: T) => any) | string): Array; + /** + * Updates objects in the array + * @param objects The array of objects to update + * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array + */ + UpdateRange(objects: Array, primaryKeySelector?: ((item: T) => any) | string): Array; + /** + * Removes an object from the array + * @param object The object to remove + * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array + */ + Remove(object: T, primaryKeySelector?: ((item: T) => any) | string): Array; + /** + * Removes objects from the array + * @param objects The array of objects to remove + * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array + */ + RemoveRange(objects: Array, primaryKeySelector?: ((item: T) => any) | string): Array; + /** + * Adds an object to the array + * @param object The object to add + * @param generateId Auto-generate a property to identify object in later processes + */ + Add(object: T, generateId?: boolean): Array; + /** + * Adds objects to the array + * @param objects The array of objects to add + */ + AddRange(objects: Array, generateId?: boolean): Array; + /** + * Inserts an entry at a specific position + * @param object The object to insert + * @param index The position to insert + */ + Insert(object: T, index: number): Array; + /** + * Searches for all items in array that match the given filter + * @param filter A function (or function-string) that returns a boolean when matching element was found + */ + Where(filter: ((item: T, index?: number) => boolean) | string): Array; + /** + * Takes items in a specific range + * @param start The start position + * @param length The number of elements to take + */ + Range(start: number, length: number): Array; + /** + * Repeats an object in the array + * @param object The object to repeat + * @param count The count of repeats + */ + Repeat(object: T, count: number): Array; + /** + * Returns the length of the array + * @param filter If set the function returns count of elements matched by the condition + */ + Count(filter?: ((item: T) => boolean) | string): number; + /** + * Tests if all items in the array match the condition + * @param filter A function (or function-string) that returns a boolean when matching element was found + */ + All(filter: ((item: T) => boolean) | string): boolean; + /** + * Tests if any item is in the array + * @param filter If set the function tests if any item in the array matches the condition + */ + Any(filter?: ((item: T) => boolean) | string): boolean; + /** + * Returns the first item of the array - Throws an exception if no item was found + * @param filter If set the function returns the first item that matches the filter + */ + First(filter?: ((item: T) => boolean) | string): T; + /** + * Returns the first item of the array - returns `null` if no suitable item was found + * @param filter If set the function returns the first item that matches the filter + */ + FirstOrDefault(filter?: ((item: T) => boolean) | string): (T | null); + /** + * Returns the last item of the array - Throws an exception if no item was found + * @param filter If set the function returns the last item that matches the filter + */ + Last(filter?: ((item: T) => boolean) | string): T; + /** + * Returns the last item of the array - returns `null` if no suitable item was found + * @param filter If set the function returns the last item that matches the filter + */ + LastOrDefault(filter?: ((item: T) => boolean) | string): (T | null); + /** + * Select the properties for a new array + * @param selector A function (or a function-string) that returns a new object + */ + Select(selector: ((item: T) => any) | string): any[]; + /** + * Limits the number of entries taken + * @param count The count of elements taken + */ + Take(count: number): Array; + /** + * Takes entries as long as a condition is true + * @param condition The condition-function (or function-string) that returns a boolean. All elements until a false gets created are taken + * @param initial A initial-function (or function-string) that gets executed once at the start of the loop + * @param after A function that gets executed after every element-iteration after the condition-function was evaluated + */ + TakeWhile(condition: ((item: T, storage?: any) => boolean) | string, initial?: ((storage: any) => void) | string, after?: ((item: T, storage: any) => void) | string): Array; + /** + * Skips entries + * @param count The count of elements skipped + */ + Skip(count: number): Array; + /** + * Orders array by property or value in ascending direction + * @param valueSelector The selector-function (or function-string) that selects the property for sorting + */ + OrderBy(valueSelector: ((item: T) => any) | string): Array; + /** + * Orders array by additional properties in ascending direction in combination with OrderBy/OrderByDescending + * @param valueSelector The selector-function (or function-string) that selects the property for sorting + */ + ThenBy(valueSelector: ((item: T) => any) | string): Array; + /** + * Orders array by property or value in descending direction + * @param valueSelector The selector-function (or function-string) that selects the property for sorting + */ + OrderByDescending(valueSelector: ((item: T) => any) | string): Array; + /** + * Orders array by additional properties in descending direction in combination with OrderBy/OrderByDescending + * @param valueSelector The selector-function (or function-string) that selects the property for sorting + */ + ThenByDescending(valueSelector: ((item: T) => any) | string): Array; + /** + * Returns the smallest element in array + * @param valueSelector The selector-function (or function-string) that selects the property for comparison + */ + Min(valueSelector?: ((item: T) => any) | string): (T | null); + /** + * Returns the greates element in array + * @param valueSelector The selector-function (or function-string) that selects the property for comparison + */ + Max(valueSelector?: ((item: T) => any) | string): (T | null); + /** + * Groups array by property + * @param selector The selector-function (or function-string) that selects the property for grouping + */ + GroupBy(selector: ((item: T) => any) | string): Array>; + /** + * Moves an item from one index to another + * @param oldIndex The current position of the item + * @param newIndex The new position of the item + */ + Move(oldIndex: number, newIndex: number): Array; + /** + * Makes all values unique + * @param valueSelector A selector-function (or function-string) to select property for comparison and distinction + */ + Distinct(valueSelector?: ((item: T) => any) | string): Array; + /** + * Tests if array contains specific object + * @param object The object to test for + */ + Contains(object: T): boolean; + /** + * Combines two arrays + * @param array The array to combine + */ + Concat(array: Array): Array; + /** + * Combines two arrays but only applies values that are in both arrays + * @param array The array to combine + */ + Intersect(array: Array): Array; + /** + * Joins the entries by a given char + * @param character The character for joining + * @param selector A selector-function (or function-string) to select property for joining + */ + Join(character: string, selector?: ((item: T) => any) | string): string; + /** + * Combines the entries using a custom function + * @param method A function (or function-string) for aggregation + * @param startVal The value to start aggregation + */ + Aggregate(method: ((result: any, item: T) => any) | string, startVal?: any): string; + /** + * Reverses the array + */ + Reverse(): Array; + /** + * Computes the average of the elements + * @param selector A selector-function (or function-string) to select property for average computing + * @param filter If set the function computes the average of elements that match the filter + */ + Average(selector?: ((item: T) => any) | string, filter?: ((item: T) => boolean) | string): number; + /** + * Computes the sum of the elements + * @param selector A selector-function (or function-string) to select property for adding + * @param filter If set the function computes the sum of elements that match the filter + */ + Sum(selector?: ((item: T) => any) | string, filter?: ((item: T) => boolean) | string): number; + /** + * Compares to sequences of objects + * @param array The array to compare + */ + SequenceEqual(array: Array): boolean; + /** + * Combines the entries of two arrays using a custom function + * @param array The array to combine + * @param result The function (or function-string) to combine elements + */ + Zip(array: Array, result: ((first: T, second: X) => any) | string): Array; + /** + * Combines two arrays without duplicates + * @param array The array to combine + */ + Union(array: Array): Array; + /** + * Converts the array to a dictionary + * @param keySelector The selector-function (or function-string) to select property for key + * @param valueSelector A selector-function (or function-string) to select property for value + */ + ToDictionary(keySelector: ((item: T) => any) | string, valueSelector?: ((item: T) => any) | string): any; +} +declare module "linq4js" { + export = Linq4JS; +} +declare namespace Linq4JS { + class OrderEntry { + Direction: OrderDirection; + ValueSelector: (item: any) => any; + constructor(_direction: OrderDirection, _valueSelector: (item: any) => any); + } + enum OrderDirection { + Ascending = 0, + Descending = 1, + } +} diff --git a/linq4js/linq4js-tests.ts b/linq4js/linq4js-tests.ts new file mode 100644 index 0000000000..6d15649c2c --- /dev/null +++ b/linq4js/linq4js-tests.ts @@ -0,0 +1,5 @@ +import * as linq from "linq4js"; + +let array: Array = ["test", "test2", "test3", "test4", "test5"]; + +array.Add("test6").Remove("test3").Insert("test3", 2).Distinct().OrderBy(x => x).OrderByDescending(x => x).Select(x => x.length).Average(); \ No newline at end of file diff --git a/linq4js/tsconfig.json b/linq4js/tsconfig.json new file mode 100644 index 0000000000..fa4dac9326 --- /dev/null +++ b/linq4js/tsconfig.json @@ -0,0 +1,22 @@ +{ + "files": [ + "index.d.ts", + "linq4js-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "noImplicitAny": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "strictNullChecks": true, + "alwaysStrict": true, + "target": "es6", + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} \ No newline at end of file From a8a54caf2fa90399a14615348e90d4807e2604ad Mon Sep 17 00:00:00 2001 From: morrisjdev Date: Sun, 19 Feb 2017 22:02:31 +0100 Subject: [PATCH 138/797] fixed lint --- linq4js/index.d.ts | 65 +++++++++++++++++++++------------------------ linq4js/tslint.json | 1 + 2 files changed, 32 insertions(+), 34 deletions(-) create mode 100644 linq4js/tslint.json diff --git a/linq4js/index.d.ts b/linq4js/index.d.ts index 6b98907453..4fe054d5fc 100644 --- a/linq4js/index.d.ts +++ b/linq4js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Linq4JS 2.0.3 +// Type definitions for Linq4JS 2.0 // Project: https://github.com/morrisjdev/Linq4JS // Definitions by: Morris Janatzek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -17,12 +17,12 @@ declare namespace Linq4JS { } } interface Array { - Order: Array; + Order: Linq4JS.OrderEntry[]; GroupValue: any; /** * Creates a copy of the array */ - Clone(): Array; + Clone(): T[]; /** * Gets the index of the first item found by a filter * @param filter A function (or function-string) that returns a boolean when matching element was found @@ -42,65 +42,65 @@ interface Array { * Executes a method for each item in the array * @param action A function (or function-string) that gets executed for each element. If it returns false the loop stops. */ - ForEach(action: ((item: T, index?: number) => boolean | any) | string): Array; + ForEach(action: ((item: T, index?: number) => boolean | any) | string): T[]; /** * Updates an object in the array * @param object The object to update * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array */ - Update(object: T, primaryKeySelector?: ((item: T) => any) | string): Array; + Update(object: T, primaryKeySelector?: ((item: T) => any) | string): T[]; /** * Updates objects in the array * @param objects The array of objects to update * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array */ - UpdateRange(objects: Array, primaryKeySelector?: ((item: T) => any) | string): Array; + UpdateRange(objects: T[], primaryKeySelector?: ((item: T) => any) | string): T[]; /** * Removes an object from the array * @param object The object to remove * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array */ - Remove(object: T, primaryKeySelector?: ((item: T) => any) | string): Array; + Remove(object: T, primaryKeySelector?: ((item: T) => any) | string): T[]; /** * Removes objects from the array * @param objects The array of objects to remove * @param primaryKeySelector A selector-function (or function-string) to define a property to indentify object in array */ - RemoveRange(objects: Array, primaryKeySelector?: ((item: T) => any) | string): Array; + RemoveRange(objects: T[], primaryKeySelector?: ((item: T) => any) | string): T[]; /** * Adds an object to the array * @param object The object to add * @param generateId Auto-generate a property to identify object in later processes */ - Add(object: T, generateId?: boolean): Array; + Add(object: T, generateId?: boolean): T[]; /** * Adds objects to the array * @param objects The array of objects to add */ - AddRange(objects: Array, generateId?: boolean): Array; + AddRange(objects: T[], generateId?: boolean): T[]; /** * Inserts an entry at a specific position * @param object The object to insert * @param index The position to insert */ - Insert(object: T, index: number): Array; + Insert(object: T, index: number): T[]; /** * Searches for all items in array that match the given filter * @param filter A function (or function-string) that returns a boolean when matching element was found */ - Where(filter: ((item: T, index?: number) => boolean) | string): Array; + Where(filter: ((item: T, index?: number) => boolean) | string): T[]; /** * Takes items in a specific range * @param start The start position * @param length The number of elements to take */ - Range(start: number, length: number): Array; + Range(start: number, length: number): T[]; /** * Repeats an object in the array * @param object The object to repeat * @param count The count of repeats */ - Repeat(object: T, count: number): Array; + Repeat(object: T, count: number): T[]; /** * Returns the length of the array * @param filter If set the function returns count of elements matched by the condition @@ -145,39 +145,39 @@ interface Array { * Limits the number of entries taken * @param count The count of elements taken */ - Take(count: number): Array; + Take(count: number): T[]; /** * Takes entries as long as a condition is true * @param condition The condition-function (or function-string) that returns a boolean. All elements until a false gets created are taken * @param initial A initial-function (or function-string) that gets executed once at the start of the loop * @param after A function that gets executed after every element-iteration after the condition-function was evaluated */ - TakeWhile(condition: ((item: T, storage?: any) => boolean) | string, initial?: ((storage: any) => void) | string, after?: ((item: T, storage: any) => void) | string): Array; + TakeWhile(condition: ((item: T, storage?: any) => boolean) | string, initial?: ((storage: any) => void) | string, after?: ((item: T, storage: any) => void) | string): T[]; /** * Skips entries * @param count The count of elements skipped */ - Skip(count: number): Array; + Skip(count: number): T[]; /** * Orders array by property or value in ascending direction * @param valueSelector The selector-function (or function-string) that selects the property for sorting */ - OrderBy(valueSelector: ((item: T) => any) | string): Array; + OrderBy(valueSelector: ((item: T) => any) | string): T[]; /** * Orders array by additional properties in ascending direction in combination with OrderBy/OrderByDescending * @param valueSelector The selector-function (or function-string) that selects the property for sorting */ - ThenBy(valueSelector: ((item: T) => any) | string): Array; + ThenBy(valueSelector: ((item: T) => any) | string): T[]; /** * Orders array by property or value in descending direction * @param valueSelector The selector-function (or function-string) that selects the property for sorting */ - OrderByDescending(valueSelector: ((item: T) => any) | string): Array; + OrderByDescending(valueSelector: ((item: T) => any) | string): T[]; /** * Orders array by additional properties in descending direction in combination with OrderBy/OrderByDescending * @param valueSelector The selector-function (or function-string) that selects the property for sorting */ - ThenByDescending(valueSelector: ((item: T) => any) | string): Array; + ThenByDescending(valueSelector: ((item: T) => any) | string): T[]; /** * Returns the smallest element in array * @param valueSelector The selector-function (or function-string) that selects the property for comparison @@ -192,18 +192,18 @@ interface Array { * Groups array by property * @param selector The selector-function (or function-string) that selects the property for grouping */ - GroupBy(selector: ((item: T) => any) | string): Array>; + GroupBy(selector: ((item: T) => any) | string): T[][]; /** * Moves an item from one index to another * @param oldIndex The current position of the item * @param newIndex The new position of the item */ - Move(oldIndex: number, newIndex: number): Array; + Move(oldIndex: number, newIndex: number): T[]; /** * Makes all values unique * @param valueSelector A selector-function (or function-string) to select property for comparison and distinction */ - Distinct(valueSelector?: ((item: T) => any) | string): Array; + Distinct(valueSelector?: ((item: T) => any) | string): T[]; /** * Tests if array contains specific object * @param object The object to test for @@ -213,12 +213,12 @@ interface Array { * Combines two arrays * @param array The array to combine */ - Concat(array: Array): Array; + Concat(array: T[]): T[]; /** * Combines two arrays but only applies values that are in both arrays * @param array The array to combine */ - Intersect(array: Array): Array; + Intersect(array: T[]): T[]; /** * Joins the entries by a given char * @param character The character for joining @@ -234,7 +234,7 @@ interface Array { /** * Reverses the array */ - Reverse(): Array; + Reverse(): T[]; /** * Computes the average of the elements * @param selector A selector-function (or function-string) to select property for average computing @@ -251,18 +251,18 @@ interface Array { * Compares to sequences of objects * @param array The array to compare */ - SequenceEqual(array: Array): boolean; + SequenceEqual(array: T[]): boolean; /** * Combines the entries of two arrays using a custom function * @param array The array to combine * @param result The function (or function-string) to combine elements */ - Zip(array: Array, result: ((first: T, second: X) => any) | string): Array; + Zip(array: X[], result: ((first: T, second: X) => any) | string): any[]; /** * Combines two arrays without duplicates * @param array The array to combine */ - Union(array: Array): Array; + Union(array: T[]): T[]; /** * Converts the array to a dictionary * @param keySelector The selector-function (or function-string) to select property for key @@ -270,9 +270,6 @@ interface Array { */ ToDictionary(keySelector: ((item: T) => any) | string, valueSelector?: ((item: T) => any) | string): any; } -declare module "linq4js" { - export = Linq4JS; -} declare namespace Linq4JS { class OrderEntry { Direction: OrderDirection; @@ -283,4 +280,4 @@ declare namespace Linq4JS { Ascending = 0, Descending = 1, } -} +} \ No newline at end of file diff --git a/linq4js/tslint.json b/linq4js/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/linq4js/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 0b19c9cf595d7db45f437e035c762addf99f975e Mon Sep 17 00:00:00 2001 From: morrisjdev Date: Sun, 19 Feb 2017 22:03:08 +0100 Subject: [PATCH 139/797] fixed version --- linq4js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linq4js/index.d.ts b/linq4js/index.d.ts index 4fe054d5fc..e108f31a4c 100644 --- a/linq4js/index.d.ts +++ b/linq4js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Linq4JS 2.0 +// Type definitions for Linq4JS 2.1 // Project: https://github.com/morrisjdev/Linq4JS // Definitions by: Morris Janatzek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 36a25dcc742b344e98372f9cff9efadc02f2648c Mon Sep 17 00:00:00 2001 From: morrisjdev Date: Sun, 19 Feb 2017 22:19:41 +0100 Subject: [PATCH 140/797] fixed tsconfig.json --- linq4js/linq4js-tests.ts | 2 +- linq4js/tsconfig.json | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/linq4js/linq4js-tests.ts b/linq4js/linq4js-tests.ts index 6d15649c2c..9e0bbe7be5 100644 --- a/linq4js/linq4js-tests.ts +++ b/linq4js/linq4js-tests.ts @@ -1,4 +1,4 @@ -import * as linq from "linq4js"; +import "linq4js"; let array: Array = ["test", "test2", "test3", "test4", "test5"]; diff --git a/linq4js/tsconfig.json b/linq4js/tsconfig.json index fa4dac9326..2c6f199057 100644 --- a/linq4js/tsconfig.json +++ b/linq4js/tsconfig.json @@ -16,6 +16,9 @@ "../" ], "types": [], + "lib":[ + "es6" + ], "noEmit": true, "forceConsistentCasingInFileNames": true } From 32b84dfb0bb755753ed03a3cafb809cffac2426b Mon Sep 17 00:00:00 2001 From: morrisjdev Date: Sun, 19 Feb 2017 22:25:18 +0100 Subject: [PATCH 141/797] tsconfig.json fix 2 --- linq4js/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/linq4js/tsconfig.json b/linq4js/tsconfig.json index 2c6f199057..f053fa2e23 100644 --- a/linq4js/tsconfig.json +++ b/linq4js/tsconfig.json @@ -9,7 +9,6 @@ "noImplicitReturns": true, "noImplicitThis": true, "strictNullChecks": true, - "alwaysStrict": true, "target": "es6", "baseUrl": "../", "typeRoots": [ From f75faf72883be0552a54f13a96614caeab9952cf Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 20 Feb 2017 15:39:43 +1100 Subject: [PATCH 142/797] keytar will return null when it fails --- keytar/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keytar/index.d.ts b/keytar/index.d.ts index 12dbd63316..963910e4bb 100644 --- a/keytar/index.d.ts +++ b/keytar/index.d.ts @@ -12,7 +12,7 @@ * * @returns the string password or null on failures. */ -export declare function getPassword(service: string, account: string): string; +export declare function getPassword(service: string, account: string): string | null; /** * Add the password for the service and account to the keychain. @@ -33,7 +33,7 @@ export declare function addPassword(service: string, account: string, password: * * @returns the string password or null on failures. */ -export declare function deletePassword(service: string, account: string): string; +export declare function deletePassword(service: string, account: string): string | null; /** * Replace the password for the service and account in the keychain. @@ -56,4 +56,4 @@ export declare function replacePassword(service: string, account: string, passwo * * @returns the string password or null on failures. */ -export declare function findPassword(service: string): string; +export declare function findPassword(service: string): string | null; From 81b60b07a3617be29208f198ced552d8808ca7c1 Mon Sep 17 00:00:00 2001 From: Jack Works Date: Mon, 20 Feb 2017 12:46:38 +0800 Subject: [PATCH 143/797] New package: parse-unit Signed-off-by: Jack Works --- parse-unit/index.d.ts | 7 +++++++ parse-unit/parse-unit-tests.ts | 4 ++++ parse-unit/tsconfig.json | 23 +++++++++++++++++++++++ parse-unit/tslint.json | 1 + 4 files changed, 35 insertions(+) create mode 100644 parse-unit/index.d.ts create mode 100644 parse-unit/parse-unit-tests.ts create mode 100644 parse-unit/tsconfig.json create mode 100644 parse-unit/tslint.json diff --git a/parse-unit/index.d.ts b/parse-unit/index.d.ts new file mode 100644 index 0000000000..238f3cfc06 --- /dev/null +++ b/parse-unit/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for parse-unit 1.0 +// Project: https://github.com/mattdesl/parse-unit +// Definitions by: Jack Works +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function parse(value: string): [number, string]; +export = parse; diff --git a/parse-unit/parse-unit-tests.ts b/parse-unit/parse-unit-tests.ts new file mode 100644 index 0000000000..772641c302 --- /dev/null +++ b/parse-unit/parse-unit-tests.ts @@ -0,0 +1,4 @@ +import parse = require('parse-unit') +let [number, length] = parse('10px') +number === 50 +length === 'px' diff --git a/parse-unit/tsconfig.json b/parse-unit/tsconfig.json new file mode 100644 index 0000000000..4f0a626508 --- /dev/null +++ b/parse-unit/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "parse-unit-tests.ts" + ] +} diff --git a/parse-unit/tslint.json b/parse-unit/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/parse-unit/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 2338f6707140401e4c379810ccca06bf6039ad77 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 20 Feb 2017 15:46:56 +1100 Subject: [PATCH 144/797] deletePassword returns a boolean --- keytar/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keytar/index.d.ts b/keytar/index.d.ts index 963910e4bb..63690b90d7 100644 --- a/keytar/index.d.ts +++ b/keytar/index.d.ts @@ -31,9 +31,9 @@ export declare function addPassword(service: string, account: string, password: * @param service The string service name. * @param account The string account name. * - * @returns the string password or null on failures. + * @returns true on success, false on failure */ -export declare function deletePassword(service: string, account: string): string | null; +export declare function deletePassword(service: string, account: string): boolean; /** * Replace the password for the service and account in the keychain. From 0bb2a11a92a965fcefb57433a85b05e68c7d155e Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 20 Feb 2017 15:47:02 +1100 Subject: [PATCH 145/797] bump the version --- keytar/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keytar/index.d.ts b/keytar/index.d.ts index 63690b90d7..e046223ee7 100644 --- a/keytar/index.d.ts +++ b/keytar/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for keytar 3.0.0 +// Type definitions for keytar 3.0.2 // Project: http://atom.github.io/node-keytar/ // Definitions by: Milan Burda // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 83f4d4558a79089ac9a9b980792cac30eaaea888 Mon Sep 17 00:00:00 2001 From: Kay Schecker Date: Mon, 20 Feb 2017 10:00:11 +0100 Subject: [PATCH 146/797] 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 43cc32518868a92574b51bc69988e56dc8bdeb40 Mon Sep 17 00:00:00 2001 From: Thomas Bondo Homburg Date: Mon, 20 Feb 2017 10:51:45 +0100 Subject: [PATCH 147/797] react-modal: Add event parameter for onRequestClose function prop --- react-modal/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react-modal/index.d.ts b/react-modal/index.d.ts index 4e038b416c..399f779567 100644 --- a/react-modal/index.d.ts +++ b/react-modal/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for react-modal 1.6 // Project: https://github.com/reactjs/react-modal -// Definitions by: Rajab Shakirov , Drew Noakes +// Definitions by: Rajab Shakirov , Drew Noakes , Thomas B Homburg // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -32,7 +32,7 @@ declare namespace ReactModal { /* Function that will be run after the modal has opened. */ onAfterOpen?: () => void; /* Function that will be run when the modal is requested to be closed, prior to actually closing. */ - onRequestClose?: () => void; + onRequestClose?: (event: (MouseEvent | KeyboardEvent)) => void; /* Number indicating the milliseconds to wait before closing the modal. Defaults to zero (no timeout). */ closeTimeoutMS?: number; /* Boolean indicating if the appElement should be hidden. Defaults to true. */ From 592e1d4f9b91ced5297ce6630aaff136dcf5fd21 Mon Sep 17 00:00:00 2001 From: Kayo Phoenix Date: Mon, 20 Feb 2017 15:54:16 +0500 Subject: [PATCH 148/797] Updated extract-text-webpack-plugin definition --- .../extract-text-webpack-plugin-tests.ts | 27 ++++++++++--------- extract-text-webpack-plugin/index.d.ts | 12 ++++----- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/extract-text-webpack-plugin/extract-text-webpack-plugin-tests.ts b/extract-text-webpack-plugin/extract-text-webpack-plugin-tests.ts index 63177ebde3..ca992ea3ef 100644 --- a/extract-text-webpack-plugin/extract-text-webpack-plugin-tests.ts +++ b/extract-text-webpack-plugin/extract-text-webpack-plugin-tests.ts @@ -22,18 +22,18 @@ configuration = { // Extract css files { test: /\.css$/, - loader: ExtractTextPlugin.extract({ - fallbackLoader: "style-loader", - loader: "css-loader", + use: ExtractTextPlugin.extract({ + fallback: "style-loader", + use: "css-loader", }) }, // Optionally extract less files // or any other compile-to-css language { test: /\.less$/, - loader: ExtractTextPlugin.extract({ - fallbackLoader: "style-loader", - loader: ["css-loader", "less-loader"], + use: ExtractTextPlugin.extract({ + fallback: "style-loader", + use: ["css-loader", "less-loader"], }) } // You could also use other loaders the same way. I. e. the autoprefixer-loader @@ -70,10 +70,13 @@ configuration = { // ... module: { rules: [ - { test: /\.css$/, loader: ExtractTextPlugin.extract({ - fallbackLoader: "style-loader", - loader: "css-loader" - }) } + { + test: /\.css$/, + use: ExtractTextPlugin.extract({ + fallback: "style-loader", + use: "css-loader" + }) + } ] }, plugins: [ @@ -89,8 +92,8 @@ configuration = { // ... module: { rules: [ - { test: /\.scss$/i, loader: extractCSS.extract(['css','sass']) }, - { test: /\.less$/i, loader: extractLESS.extract(['css','less']) }, + { test: /\.scss$/i, use: extractCSS.extract(['css','sass']) }, + { test: /\.less$/i, use: extractLESS.extract(['css','less']) }, ] }, plugins: [ diff --git a/extract-text-webpack-plugin/index.d.ts b/extract-text-webpack-plugin/index.d.ts index 21052b08c1..6da0c183c3 100644 --- a/extract-text-webpack-plugin/index.d.ts +++ b/extract-text-webpack-plugin/index.d.ts @@ -1,15 +1,15 @@ // Type definitions for extract-text-webpack-plugin 2.0.0 -// Project: https://github.com/webpack/extract-text-webpack-plugin -// Definitions by: flying-sheep +// Project: https://github.com/webpack-contrib/extract-text-webpack-plugin +// Definitions by: flying-sheep , kayo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import { Plugin, OldLoader } from 'webpack' +import { Plugin, OldLoader, NewLoader } from 'webpack' /** * extract-text-webpack-plugin has no support for .options instead of .query yet. * See https://github.com/webpack/extract-text-webpack-plugin/issues/281 */ -type Loader = string | OldLoader +type Loader = string | OldLoader | NewLoader interface ExtractPluginOptions { /** the filename of the result file. May contain `[name]`, `[id]` and `[contenthash]` */ @@ -24,9 +24,9 @@ interface ExtractPluginOptions { interface ExtractOptions { /** the loader(s) that should be used for converting the resource to a css exporting module */ - loader: Loader | Loader[] + use: Loader | Loader[] /** the loader(s) that should be used when the css is not extracted (i.e. in an additional chunk when `allChunks: false`) */ - fallbackLoader?: Loader | Loader[] + fallback?: Loader | Loader[] /** override the `publicPath` setting for this loader */ publicPath?: string } From 81466883cc0229e6601038a9717a4584ff8fcbf7 Mon Sep 17 00:00:00 2001 From: Sergei Dorogin Date: Mon, 20 Feb 2017 16:13:19 +0300 Subject: [PATCH 149/797] select2: added options: amdBase, amdLanguageBase, maximumInputLength, dropdownParent, debug, dropdownAdapter; added Select2 class --- select2/index.d.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/select2/index.d.ts b/select2/index.d.ts index 2f6fea9063..24f4a838f2 100644 --- a/select2/index.d.ts +++ b/select2/index.d.ts @@ -38,9 +38,12 @@ interface IdTextPair { } interface Select2Options { + amdBase?: string; + amdLanguageBase?: string; width?: string; dropdownAutoWidth?: boolean; minimumInputLength?: number; + maximumInputLength?: number; minimumResultsForSearch?: number; maximumSelectionSize?: number; placeholder?: string | IdTextPair; @@ -81,6 +84,9 @@ interface Select2Options { language?: string | string[] | {}; selectOnClose?: boolean; sorter?: (data: any[]) => any[]; + dropdownParent?: JQuery; + debug?: boolean; + dropdownAdapter?: any; } interface Select2JQueryEventObject extends JQueryEventObject { @@ -192,3 +198,18 @@ interface JQuery { select2(method: string, value: any, trigger?: boolean): any; select2(options: Select2Options): JQuery; } + +declare class Select2 { + constructor(element: JQuery, options: Select2Options); + focus(): void; + destroy(): void; + on(event: string, callback: Function): void; + selection: any; + dropdown: any; + results: any; + $container: JQuery; + $dropdown: JQuery; + $selection: JQuery; + $results: JQuery; + options: {options: Select2Options}; +} \ No newline at end of file From d8edccd12a27b614e78d88342edde56379963ee8 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Mon, 20 Feb 2017 03:11:11 +0000 Subject: [PATCH 150/797] Initial commit for v17 of openfin api --- openfin/index.d.ts | 45 +- openfin/openfin-tests.ts | 6 +- openfin/v16/index.d.ts | 1581 ++++++++++++++++++++++++++++++++++ openfin/v16/openfin-tests.ts | 724 ++++++++++++++++ openfin/v16/tsconfig.json | 25 + openfin/v16/tslint.json | 1 + 6 files changed, 2373 insertions(+), 9 deletions(-) create mode 100644 openfin/v16/index.d.ts create mode 100644 openfin/v16/openfin-tests.ts create mode 100644 openfin/v16/tsconfig.json create mode 100644 openfin/v16/tslint.json diff --git a/openfin/index.d.ts b/openfin/index.d.ts index 2c1cfd648e..893a253606 100644 --- a/openfin/index.d.ts +++ b/openfin/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for OpenFin API 16.0 +// Type definitions for OpenFin API 17.0 // Project: https://openfin.co/ // Definitions by: Chris Barker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// based on v6.49.16.16 +// based on v6.49.17.14 // see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean /** @@ -63,7 +63,7 @@ declare namespace fin { */ close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Retrieves an array of wrapped fin.desktop.Windows for each of the application’s child windows. + * Retrieves an array of wrapped fin.desktop.Windows for each of the application�s child windows. */ getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; /** @@ -82,6 +82,10 @@ declare namespace fin { * Retrieves current configuration of application's shortcuts. */ getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves information about the application. + */ + getInfo(callback?: (info: LaunchInfo) => void, errorCallback?: (reason: string) => void): void; /** * Determines if the application is currently running. */ @@ -95,7 +99,7 @@ declare namespace fin { */ removeEventListener(type: OpenFinApplicationEventType, previouslyRegisteredListener: (event: ApplicationBaseEvent | TrayIconClickedEvent | WindowEvent | WindowAlertRequestedEvent | WindowAuthRequested | WindowNavigationRejectedEvent | WindowEndLoadEvent) => any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Removes the application’s icon from the tray. + * Removes the application�s icon from the tray. */ removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -185,10 +189,13 @@ declare namespace fin { */ accelerator?: { devtools?: boolean, - zoom?: boolean + zoom?: boolean, + reload?: boolean, + reloadIgnoreCache?: boolean, }; /** * A flag to always position the window at the top of the window stack. Default: false. + * Updatable */ alwaysOnTop?: boolean; /** @@ -197,10 +204,12 @@ declare namespace fin { autoShow?: boolean; /** * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + * Updatable */ contextMenu?: boolean; /** * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + * Updatable */ cornerRounding?: { width?: number; @@ -232,30 +241,37 @@ declare namespace fin { defaultLeft?: number; /** * A flag to show the frame. Default: true. + * Updatable */ frame?: boolean; /** * A flag to allow a window to be hidden when the close button is clicked.Default: false. + * Updatable */ hideOnClose?: boolean; /** * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + * Updatable */ icon?: string; /** * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable */ maxHeight?: number; /** * A flag that lets the window be maximized.Default: true. + * Updatable */ maximizable?: boolean; /** * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + * Updatable */ maxWidth?: number; /** * The minimum height of a window.Default: 0. + * Updatable */ minHeight?: number; /** @@ -272,14 +288,17 @@ declare namespace fin { name?: string; /** * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + * Updatable */ opacity?: number; /** * A flag to drop to allow the user to resize the window.Default: true. + * Updatable */ resizable?: boolean; /** * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + * Updatable */ resizeRegion?: { /** @@ -989,7 +1008,7 @@ declare namespace fin { bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Closes the window. - * @param {force} Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window. + * @param {force} Close will be prevented from closing when force is false and �close-requested� has been subscribed to for application�s main window. */ close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -1009,7 +1028,7 @@ declare namespace fin { */ enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Flashes the window’s frame and taskbar icon until the window is activated. + * Flashes the window�s frame and taskbar icon until the window is activated. */ flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -1106,7 +1125,7 @@ declare namespace fin { setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Shows the window if it is hidden. - * @param {force} Show will be prevented from closing when force is false and ‘show-requested’ has been subscribed to for application’s main window. + * @param {force} Show will be prevented from closing when force is false and �show-requested� has been subscribed to for application�s main window. */ show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -1500,6 +1519,16 @@ declare namespace fin { type: "session-changed"; } + interface LaunchInfo { + launchMode: "fin-protocol" + | "fins-protocol" + | "shortcut" + | "command-line" + | "adapter" + | "other" + | string; + } + type OpenFinTweenType = "linear" | "ease-in" | "ease-out" diff --git a/openfin/openfin-tests.ts b/openfin/openfin-tests.ts index 81ac24f937..ae5fe587d3 100644 --- a/openfin/openfin-tests.ts +++ b/openfin/openfin-tests.ts @@ -1,6 +1,6 @@ function test_application() { let application: fin.OpenFinApplication; - // constructor + // constructor application = new fin.desktop.Application({ url: "application.html", uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", @@ -69,6 +69,10 @@ console.log("Start Menu shortcut is enabled: ", config.startMenu); console.log("System Startup shortcut is enabled: ", config.systemStartup); }); + // getInfo + application.getInfo(info => { + console.log(`Launch mode: ${info.launchMode}`); + }); // isRunning application.isRunning(function (running) { console.log("the application is", running ? "running" : "not running"); diff --git a/openfin/v16/index.d.ts b/openfin/v16/index.d.ts new file mode 100644 index 0000000000..2c1cfd648e --- /dev/null +++ b/openfin/v16/index.d.ts @@ -0,0 +1,1581 @@ +// Type definitions for OpenFin API 16.0 +// Project: https://openfin.co/ +// Definitions by: Chris Barker +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// based on v6.49.16.16 +// see https://openfin.co/support/technical-faq/#what-do-the-numbers-in-the-runtime-version-mean + +/** + * JavaScript API + * The JavaScript API allows you to create an HTML/JavaScript application that has access to the native windowing environment, can communicate with other applications and has access to sandboxed system-level features. + * + * API Ready + * When using the OpenFin API, it is important to ensure that it has been fully loaded before making any API calls. To verify that the API is in fact ready, be sure to make any API calls either from within the fin.desktop.main() method or explicitly after it has returned. This avoids the situation of trying to access methods that are not yet fully injected. + * + * Overview + * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. + **/ +declare namespace fin { + const desktop: OpenFinDesktop; + + interface OpenFinDesktop { + main(f: () => any): void; + Application: OpenFinApplicationStatic; + ExternalApp: OpenFinExternalApplicationStatic; + InterApplicationBus: OpenFinInterApplicationBus; + Notification: OpenFinNotificationStatic; + System: OpenFinSystem; + Window: OpenFinWindowStatic; + } + + interface OpenFinApplicationStatic { + /** + * Creates a new Application. + * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. + */ + new (options: ApplicationOptions, callback?: (successObj: { httpResponseCode: number }) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + getCurrent(): OpenFinApplication; + /** + * Returns an Application object that represents an existing application. + */ + wrap(uuid: string): OpenFinApplication; + } + + /** + * Application + * An object representing an application.Allows the developer to create, execute, show / close an application as well as listen to application events. + */ + interface OpenFinApplication { + /** + * Returns an instance of the main Window of the application + */ + getWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener(type: OpenFinApplicationEventType, listener: (event: ApplicationBaseEvent | TrayIconClickedEvent | WindowEvent | WindowAlertRequestedEvent | WindowAuthRequested | WindowNavigationRejectedEvent | WindowEndLoadEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application and any child windows created by the application. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of wrapped fin.desktop.Windows for each of the application’s child windows. + */ + getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of active window groups for all of the application's windows. Each group is represented as an array of wrapped fin.desktop.Windows. + */ + getGroups(callback?: (groups: OpenFinWindow[][]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the JSON manifest that was used to create the application. Invokes the error callback if the application was not created from a manifest. + */ + getManifest(callback?: (manifest: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves UUID of the application that launches this application. Invokes the error callback if the application was created from a manifest. + */ + getParentUuid(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves current configuration of application's shortcuts. + */ + getShortcuts(callback?: (config: ShortCutConfig) => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the application is currently running. + */ + isRunning(callback?: (running: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Passes in custom data that will be relayed to the RVM + */ + registerCustomData(data: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener(type: OpenFinApplicationEventType, previouslyRegisteredListener: (event: ApplicationBaseEvent | TrayIconClickedEvent | WindowEvent | WindowAlertRequestedEvent | WindowAuthRequested | WindowNavigationRejectedEvent | WindowEndLoadEvent) => any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes the application’s icon from the tray. + */ + removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restarts the application. + */ + restart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Runs the application. When the application is created, run must be called. + */ + run(callback?: (successObj: SuccessObj) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Tells the rvm to relaunch the main application once upon a complete shutdown + */ + scheduleRestart(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets new shortcut configuration for current application. Application has to be launched with a manifest and has to have shortcut configuration (icon url, name, etc.) in its manifest to be able to change shortcut states. + */ + setShortcuts(config: ShortCutConfig, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Adds a customizable icon in the system tray and notifies the application when clicked. + */ + setTrayIcon(iconUrl: string, listener: (clickInfo: TrayIconClickedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the application by terminating its process. + */ + terminate(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Waits for a hanging application. This method can be called in response to an application "not-responding" to allow the application to continue and to generate another "not-responding" message after a certain period of time. + */ + wait(callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ShortCutConfig { + /** + * application has a shortcut on the desktop + */ + desktop?: boolean; + /** + * application has no shortcut in the start menu + */ + startMenu?: boolean; + /** + * application will be launched on system startup + */ + systemStartup?: boolean; + } + + interface SuccessObj { + httpResponseCode: number; + } + + interface NetworkErrorInfo extends ErrorInfo { + networkErrorCode: number; + } + + interface ErrorInfo { + stack: string; + message: string; + } + + interface ApplicationOptions { + /** + * The name of the application. + */ + name?: string; + /** + * The url to the application. + */ + url?: string; + /** + * The UUID of the application, unique within the set of all other applications running in the OpenFin Runtime. name and uuid must match. + */ + uuid?: string; + /** + * Enable Flash at the application level. Default: false. + */ + plugins?: boolean; + /** + * The options of the main window of the application. + */ + mainWindowOptions?: WindowOptions; + } + + interface WindowOptions { + /** + * Enable keyboard shortcuts for devtools and zoom. Default: false for both. + */ + accelerator?: { + devtools?: boolean, + zoom?: boolean + }; + /** + * A flag to always position the window at the top of the window stack. Default: false. + */ + alwaysOnTop?: boolean; + /** + * A flag to automatically show the Window when it is created. Default: false. + */ + autoShow?: boolean; + /** + * A flag to show the context menu when right-clicking on a window. Gives access to the Developer Console for the Window. Default: true + */ + contextMenu?: boolean; + /** + * This defines and applies rounded corners for a frameless window. Default for both width and height: 0. + */ + cornerRounding?: { + width?: number; + height?: number; + }; + /** + * A field that the user can attach serializable data to to be ferried around with the window options. Default: ''. + */ + customData?: any; + /** + * Specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the position from before the window was closed is used. This option overrides defaultLeft and defaultTop. Default: false. + */ + defaultCentered?: boolean; + /** + * The default height of the window. Specifies the height of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the height is taken to be the last height of the window before it was closed. Default: 500. + */ + defaultHeight?: number; + /** + * The default left position of the window. Specifies the position of the left of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the value of left is taken to be the last value before the window was closed. Default: 100. + */ + defaultWidth?: number; + /** + * The default top position of the window. Specifies the position of the top of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the value of top is taken to be the last value before the window was closed. Default: 100. + */ + defaultTop?: number; + /** + * The default width of the window. Specifies the width of the window when loaded for the first time on a machine. When the window corresponding to that id is loaded again, the width is taken to be the last width of the window before it was closed. Default: 800. + */ + defaultLeft?: number; + /** + * A flag to show the frame. Default: true. + */ + frame?: boolean; + /** + * A flag to allow a window to be hidden when the close button is clicked.Default: false. + */ + hideOnClose?: boolean; + /** + * A URL for the icon to be shown in the window title bar and the taskbar.Default: The parent application's applicationIcon. + */ + icon?: string; + /** + * The maximum height of a window.Will default to the OS defined value if set to - 1. Default: -1. + */ + maxHeight?: number; + /** + * A flag that lets the window be maximized.Default: true. + */ + maximizable?: boolean; + /** + * The maximum width of a window.Will default to the OS defined value if set to - 1. Default: -1. + */ + maxWidth?: number; + /** + * The minimum height of a window.Default: 0. + */ + minHeight?: number; + /** + * A flag that lets the window be minimized.Default: true. + */ + minimizable?: boolean; + /** + * The minimum width of a window.Default: 0. + */ + minWidth?: number; + /** + * The name for the window which must be unique within the context of the invoking Application. + */ + name?: string; + /** + * A flag that specifies how transparent the window will be.This value is clamped between 0.0 and 1.0.Default: 1.0. + */ + opacity?: number; + /** + * A flag to drop to allow the user to resize the window.Default: true. + */ + resizable?: boolean; + /** + * Defines a region in pixels that will respond to user mouse interaction for resizing a frameless window. + */ + resizeRegion?: { + /** + * The size in pixels (Default: 2), + */ + size?: number; + /** + * The size in pixels of an additional + * square resizable region located at the + * bottom right corner of a + * frameless window. (Default: 4) + */ + bottomRightCorner?: number; + }; + /** + * A flag to show the Window's icon in the taskbar. Default: true. + */ + showTaskbarIcon?: boolean; + /** + * A flag to cache the location of the window or not. Default: true. + */ + saveWindowState?: boolean; + /** + * Specify a taskbar group for the window. Default: app's uuid. + */ + taskbarIconGroup?: string; + /** + * A string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal". + */ + state?: string; + /** + * The URL of the window. Default: "about:blank". + */ + url?: string; + /** + * When set to false, the window will render before the "load" event is fired on the content's window. Caution, when false you will see an initial empty white window. Default: true. + */ + waitForPageLoad?: boolean; + } + + /** + * Clipboard + * Clipboard API allows reading and writting to the clipboard in multiple formats. + */ + interface OpenFinClipboard { + /** + * Reads available formats for the clipboard type + */ + availableFormats(type: string | null, callback?: (formats: string[]) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Reads available formats for the clipboard type + */ + readHtml(type: string | null, callback?: (html: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as Rtf + */ + readRtf(type: string | null, callback?: (rtf: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Read the content of the clipboard as plain text + */ + readText(type: string | null, callback?: (text: string) => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard + */ + write(data: any, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Html + */ + writeHtml(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as Rtf + */ + writeRtf(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Writes data into the clipboard as plain text + */ + writeText(data: string, type: string | null, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + interface OpenFinExternalApplicationStatic { + /** + * Returns an External Application object that represents an existing external application. + */ + wrap(uuid: string): OpenFinExternalApplication; + } + /** + * ExternalApplication + * An object representing an application. Allows the developer to create, execute, show and close an application, as well as listen to application events. + */ + interface OpenFinExternalApplication { + /** + * Registers an event listener on the specified event. + */ + addEventListener(type: OpenFinExternalApplicationEventType, listener: () => void, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener(type: OpenFinExternalApplicationEventType, listener: () => void, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + } + + /** + * InterApplicationBus + * A messaging bus that allows for pub/sub messaging between different applications. + */ + interface OpenFinInterApplicationBus { + /** + * Adds a listener that gets called when applications subscribe to the current application's messages. + */ + addSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Adds a listener that gets called when applications unsubscribe to the current application's messages. + */ + addUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered subscribe listener. + */ + removeSubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Removes a previously registered unsubscribe listener. + */ + removeUnsubscribeListener(listener: (uuid: string, topic: string, name: string) => void): void; + /** + * Publishes a message to all applications running on OpenFin Runtime that are subscribed to the specified topic. + */ + publish(topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sends a message to a specific application on a specific topic. + */ + send(destinationUuid: string, name: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + send(destinationUuid: string, topic: string, message: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. + */ + subscribe(senderUuid: string, name: string, topic: string, listener: (message: any, uuid: string, name: string) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + subscribe(senderUuid: string, topic: string, listener: (message: any, uuid: string, name: string) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Unsubscribes to messages from the specified application on the specified topic. + */ + unsubscribe(senderUuid: string, name: string, topic: string, listener: (message: any, uuid: string, name: string) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + unsubscribe(senderUuid: string, topic: string, listener: (message: any, uuid: string, name: string) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface OpenFinNotificationStatic { + /** + * ctor + */ + new (options: NotificationOptions, callback?: () => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinNotification; + /** + * Gets an instance of the current notification. For use within a notification window to close the window or send a message back to its parent application. + */ + getCurrent(): OpenFinNotification; + } + + /** + * Notification + * Notification represents a window on OpenFin Runtime which is shown briefly to the user on the bottom-right corner of the primary monitor. A notification is typically used to alert the user of some important event which requires his or her attention. Notifications are a child or your application that are controlled by the runtime. + */ + interface OpenFinNotification { + /** + * Closes the notification. + */ + close(callback?: () => void): void; + /** + * Sends a message to the notification. + */ + sendMessage(message: any, callback?: () => void): void; + /** + * Sends a message from the notification to the application that created the notification. The message is handled by the notification's onMessage callback. + */ + sendMessageToApplication(message: any, callback?: () => void): void; + } + + interface NotificationOptions { + /** + * A boolean that will force dismissal even if the mouse is hovering over the notification + */ + ignoreMouseOver?: boolean; + /** + * A message of any primitive or composite-primitive type to be passed to the notification upon creation. + */ + message?: any; + /** + * The timeout for displaying a notification.Can be in milliseconds or "never". + */ + duration?: number | "never"; + /** + * The url of the notification + */ + url?: string; + /** + * A function that is called when a notification is clicked. + */ + onClick?(callback: () => void): void; + /** + * Invoked when the notification is closed via .close() method on the created notification instance or the by the notification itself via fin.desktop.Notification.getCurrent().close(). NOTE: this is not invoked when the notification is dismissed via a swipe. For the swipe dismissal callback see onDismiss + */ + onClose?(callback: () => void): void; + /** + * Invoked when a the notification is dismissed by swiping it off the screen to the right. NOTE: this is no fired on a programmatic close. + */ + onDismiss?(callback: () => void): void; + /** + * A function that is called when an error occurs.The reason for the error is passed as an argument. + */ + onError?(errorCallback: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * The onMessage function will respond to messages sent from notification.sendMessageToApplication.The function is passed the message, which can be of any primitive or composite-primitive type. + */ + onMessage?(callback: (message: any) => void): void; + /** + * A function that is called when a notification is shown. + */ + onShow?(callback: (successObj: SuccessObj) => void): void; + } + + /** + * System + * An object representing the core of OpenFin Runtime. Allows the developer to perform system-level actions, such as accessing logs, viewing processes, clearing the cache and exiting the runtime. + */ + interface OpenFinSystem { + /** + * + */ + Clipboard: OpenFinClipboard; + /** + * Registers an event listener on the specified event. + */ + addEventListener(type: OpenFinSystemEventType, listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears cached data containing window state/positions, application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. + */ + clearCache(options: CacheOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Clears all cached data when OpenFin Runtime exits. + */ + deleteCacheOnExit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Downloads the given application asset + */ + downloadAsset(assetObj: AppAssetInfo, progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, callback?: (successObj: { path: string }) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + /** + * Exits the Runtime. + */ + exit(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all applications. + */ + getAllApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data for all external applications. + */ + getAllExternalApplications(callback?: (applicationInfoList: ApplicationInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of data (name, ids, bounds) for all application windows. + */ + getAllWindows(callback?: (windowInfoList: WindowDetails[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the command line argument string that started OpenFin Runtime. + */ + getCommandLineArguments(callback?: (args: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the configuration object that started the OpenFin Runtime. + */ + getDeviceId(callback?: (uuid: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the value of a given environment variable on the computer on which the runtime is installed. + */ + getEnvironmentVariable(envVar: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves system information. + */ + getHostSpecs(callback?: (info: HostSpecInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the contents of the log with the specified filename. + */ + getLog(logFileName: string, callback?: (variable: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing information for each log file. + */ + getLogList(callback?: (logInfoList: LogInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an object that contains data about the about the monitor setup of the computer that the runtime is running on. + */ + getMonitorInfo(callback?: (monitorInfo: MonitorInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the mouse in virtual screen coordinates (left, top). + */ + getMousePosition(callback?: (mousePosition: VirtualScreenCoordinates) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array of all of the runtime processes that are currently running. Each element in the array is an object containing the uuid and the name of the application to which the process belongs. + */ + getProcessList(callback?: (processInfoList: ProcessInfo[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves the Proxy settings. + */ + getProxySettings(callback?: (proxy: ProxyInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns information about the running RVM in an object. + */ + getRvmInfo(callback?: (rvmInfo: RvmInfo) => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the version of the runtime. The version contains the major, minor, build and revision numbers. + */ + getVersion(callback?: (version: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Runs an executable or batch file. + */ + launchExternalProcess(options: ExternalProcessLaunchInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Writes the passed message into both the log file and the console. + */ + log(level: "debug" | "info" | "warn" | "error", message: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Monitors a running process. + */ + monitorExternalProcess(options: ExternalProcessInfo, callback?: (payload: { uuid: string }) => void, errorCallback?: (reason: string) => void): void; + /** + * Opens the passed URL in the default web browser. + */ + openUrlWithBrowser(url: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * This function call will register a unique id and produce a token. The token can be used to broker an external connection. + */ + registerExternalConnection(uuid: string, callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, errorCallback?: (reason: string) => void): void; + /** + * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). + */ + releaseExternalProcess(processUuid: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener(type: OpenFinSystemEventType, listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the Chrome Developer Tools for the specified window. + */ + showDeveloperTools(uuid: string, name: string, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. + */ + terminateExternalProcess(processUuid: string, timeout: number, killTree: boolean, callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, errorCallback?: (reason: string) => void): void; + terminateExternalProcess(processUuid: string, timeout: number, callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, errorCallback?: (reason: string) => void): void; + /** + * Update the OpenFin Runtime Proxy settings. + */ + updateProxySettings(type: string, address: string, port: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + + } + + interface CacheOptions { + cache?: boolean; + cookies?: boolean; + localStorage?: boolean; + appcache?: boolean; + userData?: boolean; + } + + interface AppAssetInfo { + src?: string; + alias?: string; + version?: string; + target?: string; + args?: string; + } + + interface ApplicationInfo { + /** + * true when the application is running. + */ + isRunning?: boolean; + /** + * uuid of the application. + */ + uuid?: string; + /** + * uuid of the application that launches this application. + */ + parentUuid?: string; + } + + interface WindowDetails { + uuid?: string; + mainWindow?: WindowInfo; + childWindows?: WindowInfo[]; + } + + interface WindowInfo { + /** + * name of the child window + */ + name?: string; + /** + * top-most coordinate of the child window + */ + top?: number; + /** + * right-most coordinate of the child window + */ + right?: number; + /** + * bottom-most coordinate of the child window + */ + bottom?: number; + /** + * left-most coordinate of the child window + */ + left?: number; + } + + interface HostSpecInfo { + /** + * "x86" for 32-bit or "x86_64" for 64-bit + */ + arch: string; + /** + * Same payload as Node's os.cpus() + */ + cpus: NodeCpuInfo[]; + /** + * + */ + gpu: { + /** + * Graphics card name + */ + name: string; + }; + /** + * Same payload as Node's os.totalmem() + */ + memory: number; + /** + * OS name and version/edition + */ + name: string; + } + + interface NodeCpuInfo { + model: string; + /** + * in MHz + */ + speed: number; + times: { + /** + * The number of milliseconds the CPU has spent in user mode. + */ + user: number; + /** + * The number of milliseconds the CPU has spent in nice mode. + */ + nice: number; + /** + * The number of milliseconds the CPU has spent in sys mode. + */ + sys: number; + /** + * The number of milliseconds the CPU has spent in idle mode. + */ + idle: number; + /** + * The number of milliseconds the CPU has spent in irq mode. + */ + irq: number; + }; + } + + interface LogInfo { + /** + * the filename of the log + */ + name?: string; + /** + * the size of the log in bytes + */ + size?: number; + /** + * the unix time at which the log was created "Thu Jan 08 2015 14:40:30 GMT-0500 (Eastern Standard Time)" + */ + date?: string; + } + + interface ProcessInfo { + /** + * the percentage of total CPU usage + */ + cpuUsage?: number; + /** + * the application name + */ + name?: string; + /** + * the current nonpaged pool usage in bytes + */ + nonPagedPoolUsage?: number; + /** + * the number of page faults + */ + pageFaultCount?: number; + /** + * the current paged pool usage in bytes + */ + pagedPoolUsage?: number; + /** + * the total amount of memory in bytes that the memory manager has committed + */ + pagefileUsage?: number; + /** + * the peak nonpaged pool usage in bytes + */ + peakNonPagedPoolUsage?: number; + /** + * the peak paged pool usage in bytes + */ + peakPagedPoolUsage?: number; + /** + * the peak value in bytes of pagefileUsage during the lifetime of this process + */ + peakPagefileUsage?: number; + /** + * the peak working set size in bytes + */ + peakWorkingSetSize?: number; + /** + * the native process identifier + */ + processId?: number; + /** + * the application UUID + */ + uuid?: string; + /** + * the current working set size (both shared and private data) in bytes + */ + workingSetSize?: number; + } + + interface ProxyInfo { + /** + * the configured Proxy Address + */ + proxyAddress?: string; + /** + * the configured Proxy port + */ + proxyPort?: number; + /** + * Proxy Type + */ + type?: string; + } + + interface RvmInfo { + version?: string; + "start-time"?: string; + } + + interface ExternalProcessLaunchInfo { + path?: string; + /** + * Additionally note that the executable found in the zip file specified in appAssets + * will default to the one mentioned by appAssets.target + * If the the path below refers to a specific path it will override this default + */ + alias?: string; + /** + * When using alias; if no arguments are passed then the arguments (if any) + * are taken from the 'app.json' file, from the 'args' parameter + * of the 'appAssets' Object with the relevant 'alias'. + * If 'arguments' is passed as a parameter it takes precedence + * over any 'args' set in the 'app.json'. + */ + arguments?: string; + listener?: (result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }) => void; + certificate?: CertificationInfo; + } + + interface CertificationInfo { + /** + * A hex string with or without spaces + */ + serial?: string; + /** + * An internally tokenized and comma delimited string allowing partial or full checks of the subject fields + */ + subject?: string; + /** + * A hex string with or without spaces + */ + publickey?: string; + /** + * A hex string with or without spaces + */ + thumbprint?: string; + /** + * A boolean indicating that the certificate is trusted and not revoked + */ + trusted?: boolean; + } + + interface ExternalProcessInfo { + pid?: number; + listener?: (result: { + /** + * "Exited" Or "released" on a call to releaseExternalProcess + */ + topic?: string; + /** + * The mapped UUID which identifies the launched process + */ + uuid?: string; + /* + * Process exit code + */ + exitCode?: number; + }) => void; + } + + interface OpenFinWindowStatic { + /** + * Class: Window + * + * new Window(options, callbackopt, errorCallbackopt) + * + * Creates a new OpenFin Window + * + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. The new window appears in the same process as the parent window. + * @param {any} options - The options of the window + * @param {Function} [callback] - Called if the window creation was successful + * @param {number} [callback.successObj] - httpResponseCode + */ + new (options: WindowOptions, callback?: (successObj: { httpResponseCode: number }) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; + /** + * Returns an instance of the current window. + * @returns {OpenFinWindow} Current window + */ + getCurrent(): OpenFinWindow; + /** + * Returns a Window object that wraps an existing window. + */ + wrap(appUuid: string, windowName: string): OpenFinWindow; + } + + /** + * Window + * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. The new window appears in the same process as the parent window. + */ + interface OpenFinWindow { + /** + * Name of window + */ + name: string; + /** + * Returns the native JavaScript "window" object for the window. This method can only be used by the parent application or the window itself, otherwise it will return undefined. The same Single-Origin-Policy (SOP) rules apply for child windows created by window.open(url) in that the contents of the window object are only accessible if the URL has the same origin as the invoking window. See example below. Also, will not work with fin.desktop.Window objects created with fin.desktop.Window.wrap(). + * @returns {Window} Native window + */ + getNativeWindow(): Window; + /** + * Gets the parent application. + * @returns {OpenFinApplication} Parent application + */ + getParentApplication(): OpenFinApplication; + /** + * Gets the parent window. + */ + getParentWindow(): OpenFinWindow; + /** + * Registers an event listener on the specified event. + */ + addEventListener(type: OpenFinWindowEventType, listener: (event: WindowBaseEvent | WindowAuthRequestedEvent | WindowBoundsEvent | WindowExternalProcessStartedEvent | WindowExternalProcessExited | WindowGroupChangedEvent | WindowHiddenEvent | Window_NavigationRejectedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Performs the specified window transitions + */ + animate(transitions: AnimationTransition, options: AnimationOptions, callback?: (event: any) => void, errorCallback?: (reason: string) => void): void; + /** + * Provides credentials to authentication requests + */ + authenticate(userName: string, password: string, callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; + /** + * Removes focus from the window. + */ + blur(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Brings the window to the front of the OpenFin window stack. + */ + bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Closes the window. + * @param {force} Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window. + */ + close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Prevents a user from changing a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-disabled' is generated when an enabled frame becomes disabled. + */ + disableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Re-enables user changes to a window's size/position when using the window's frame. + * 'disabled-frame-bounds-changing' is generated at the start of and during a user move/size operation. + * 'disabled-frame-bounds-changed' is generated after a user move/size operation. + * The events provide the bounds that would have been applied if the frame was enabled. + * 'frame-enabled' is generated when a disabled frame has becomes enabled. + */ + enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Flashes the window’s frame and taskbar icon until the window is activated. + */ + flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gives focus to the window. + */ + focus(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current bounds (top, left, width, height) of the window. + */ + getBounds(callback?: (bounds: WindowBounds) => void, errorCallback?: (reason: string) => void): void; + /** + * Retrieves an array containing wrapped fin.desktop.Windows that are grouped with this window. If a window is not in a group an empty array is returned. Please note that calling window is included in the result array. + */ + getGroup(callback?: (group: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current settings of the window. + */ + getOptions(callback?: (options: WindowOptions) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets a base64 encoded PNG snapshot of the window. + */ + getSnapshot(callback?: (base64Snapshot: string) => void, errorCallback?: (reason: string) => void): void; + /** + * Gets the current state ("minimized", "maximized", or "restored") of the window. + */ + getState(callback?: (state: "minimized" | "maximized" | "restored") => void, errorCallback?: (reason: string) => void): void; + /** + * Returns the zoom level of the window. + */ + getZoomLevel(callback?: (level: number) => void, errorCallback?: (reason: string) => void): void; + /** + * Hides the window. + */ + hide(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Determines if the window is currently showing. + */ + isShowing(callback?: (showing: boolean) => void, errorCallback?: (reason: string) => void): void; + /** + * Joins the same window group as the specified window. + */ + joinGroup(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Leaves the current window group so that the window can be move independently of those in the group. + */ + leaveGroup(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Maximizes the window. + */ + maximize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Merges the instance's window group with the same window group as the specified window + */ + mergeGroups(target: OpenFinWindow, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Minimizes the window. + */ + minimize(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window by a specified amount. + */ + moveBy(deltaLeft: number, deltaTop: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Moves the window to a specified location. + */ + moveTo(left: number, top: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Removes a previously registered event listener from the specified event. + */ + removeEventListener(type: OpenFinWindowEventType, listener: (event: WindowBaseEvent | WindowAuthRequestedEvent | WindowBoundsEvent | WindowExternalProcessStartedEvent | WindowExternalProcessExited | WindowGroupChangedEvent | WindowHiddenEvent | Window_NavigationRejectedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeBy(deltaWidth: number, deltaHeight: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Resizes the window by a specified amount. + */ + resizeTo(width: number, height: number, anchor: OpenFinAnchor, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Restores the window to its normal state (i.e., unminimized, unmaximized). + */ + restore(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Will bring the window to the front of the entire stack and give it focus. + */ + setAsForeground(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the window's size and position + */ + setBounds(left: number, top: number, width: number, height: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Sets the zoom level of the window. + */ + setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden. + * @param {force} Show will be prevented from closing when force is false and ‘show-requested’ has been subscribed to for application’s main window. + */ + show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Shows the window if it is hidden at the specified location. If the toggle parameter is set to true, the window will alternate between showing and hiding. + */ + showAt(left: number, top: number, force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Stops the taskbar icon from flashing. + */ + stopFlashing(callback?: () => void, errorCallback?: (reason: string) => void): void; + /** + * Updates the window using the passed options + */ + updateOptions(options: WindowOptions, callback?: () => void, errorCallback?: (reason: string) => void): void; + } + + interface ApplicationBaseEvent { + topic: string; + type: OpenFinApplicationEventType; + uuid: string; + } + + interface TrayIconClickedEvent extends ApplicationBaseEvent { + button: number; // 0 for left, 1 for middle, 2 for right + monitorInfo: MonitorInfo; + x: number; // the cursor x coordinate + y: number; // the cursor y coordinate + } + + interface WindowEvent extends ApplicationBaseEvent { + name: string; + } + + interface WindowAlertRequestedEvent extends WindowEvent { + message: string; + url: string; + } + + interface WindowAuthRequested extends WindowEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowNavigationRejectedEvent extends WindowEvent { + sourceName: string; + url: string; + } + + interface WindowEndLoadEvent extends WindowEvent { + documentName: string; + isMain: boolean; + } + + interface MonitorInfoChangedEvent extends MonitorInfo { + topic: "system"; + type: "monitor-info-changed"; + } + + interface MonitorInfo { + nonPrimaryMonitors: MonitorInfoDetail[]; + primaryMonitor: MonitorInfoDetail; + reason: string; + taskbar: { + edge: "left" | "right" | "top" | "bottom", + rect: MontiorCoordinates + }; + topic: "system"; + type: "monitor-info-changed"; + virtualScreen: MontiorCoordinates; + } + + interface MonitorInfoDetail { + availableRect: MontiorCoordinates; + deviceId: string; + displayDeviceActive: boolean; + monitorRect: MontiorCoordinates; + name: string; + } + + interface MontiorCoordinates { + bottom: number; + left: number; + right: number; + top: number; + } + + interface VirtualScreenCoordinates { + left: number; + top: number; + } + + interface SystemBaseEvent { + topic: string; + type: OpenFinSystemEventType; + uuid: string; + } + + interface DesktopIconClickedEvent { + mouse: { + /** + * the left virtual screen coordinate of the mouse + */ + left: number, + /** + * the top virtual screen coordinate of the mouse + */ + top: number + }; + /** + * the number of milliseconds that have elapsed since the system was started, + */ + tickCount: number; + topic: "system"; + type: "desktop-icon-clicked"; + } + + interface IdleStateChangedEvent { + /** + * How long in milliseconds since the user has been idle. + */ + elapsedTime: number; + /** + * true when the user is idle,false when the user has returned; + */ + isIdle: boolean; + topic: "system"; + type: "idle-state-changed"; + } + + interface WindowBaseEvent { + /** + * the name of the window + */ + name: string; + /** + * always window + */ + topic: "window"; + /** + * window event type + */ + type: OpenFinWindowEventType; + /** + * the UUID of the application the window belongs to + */ + uuid: string; + } + + interface WindowAuthRequestedEvent extends WindowBaseEvent { + authInfo: { + host: string; + isProxy: boolean; + port: number; + realm: string; + scheme: string; + }; + } + + interface WindowBoundsEvent extends WindowBaseEvent { + /** + * describes what kind of change occurred. + * 0 means a change in position. + * 1 means a change in size. + * 2 means a change in position and size. + */ + changeType: number; + /** + * true when pending changes have been applied to the window. + */ + deferred: boolean; + /** + * the new height of the window. + */ + height: number; + /** + * the left-most coordinate of the window. + */ + left: number; + /** + * the top-most coordinate of the window. + */ + top: number; + /** + * + */ + type: "bounds-changed" | "bounds-changing" | "disabled-frame-bounds-changed" | "disabled-frame-bounds-changing"; + /** + * the new width of the window. + */ + width: number; + } + + interface WindowExternalProcessStartedEvent extends WindowBaseEvent { + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-started"; + } + + interface WindowExternalProcessExited extends WindowBaseEvent { + /** + * the process exit code + */ + exitCode: number; + /** + * the process handle uuid + */ + processUuid: string; + type: "external-process-exited"; + } + + interface WindowGroupChangedEvent extends WindowBaseEvent { + /** + * Which group array the window that the event listener was registered on is included in: + * 'source' The window is included in sourceGroup. + * 'target' The window is included in targetGroup. + * 'nothing' The window is not included in sourceGroup nor targetGroup. + */ + memberOf: "source" | "target" | "nothing"; + /** + * The reason this event was triggered. + * 'leave' A window has left the group due to a leave or merge with group. + * 'join' A window has joined the group. + * 'merge' Two groups have been merged together. + * 'disband' There are no other windows in the group. + */ + reason: "leave" | "join" | "merge" | "disband"; + /** + * All the windows in the group the sourceWindow originated from. + */ + sourceGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the sourceWindow belongs to The source window is the window in which (merge/join/leave)group(s) was called. + */ + sourceWindowAppUuid: string; + /** + * the name of the sourcewindow.The source window is the window in which(merge / join / leave) group(s) was called. + */ + sourceWindowName: string; + /** + * All the windows in the group the targetWindow orginated from + */ + targetGroup: WindowOfGroupInfo[]; + /** + * The UUID of the application the targetWindow belongs to. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowAppUuid: string; + /** + * The name of the targetWindow. The target window is the window that was passed into (merge/join) group(s). + */ + targetWindowName: string; + type: "group-changed"; + } + + interface WindowOfGroupInfo { + /** + * The UUID of the application this window entry belongs to. + */ + appUuid: string; + /** + * The name of this window entry. + */ + windowName: string; + } + + interface WindowHiddenEvent extends WindowBaseEvent { + /** + * What action prompted the close. + * The reasons are: "hide", "hide-on-close" + */ + reason: "hide" | "hide-on-close"; + type: "hidden"; + } + + interface Window_NavigationRejectedEvent { + name: string; + /** + * source of navigation window name + */ + sourceName: string; + topic: "navigation-rejected"; + /** + * Url that was not reached "http://blocked-content.url" + */ + url: string; + /** + * the UUID of the application the window belongs to. + */ + uuid: string; + } + + interface AnimationTransition { + opacity?: { + /** + * This value is clamped from 0.0 to 1.0 + */ + opacity?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'opacity' as absolute or as a delta. Defaults to false. + */ + relative?: boolean; + }; + position?: { + /** + * Defaults to the window's current left position in virtual screen coordinates. + */ + left?: number; + /** + * Defaults to the window's current top position in virtual screen coordinates. + */ + top?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'left' and 'top' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + size?: { + /** + * Optional if height is present. Defaults to the window's current width. + */ + width?: number; + /** + * Optional if width is present. Defaults to the window's current height. + */ + height?: number; + /** + * The total time in milliseconds this transition should take. + */ + duration?: number; + /** + * Treat 'width' and 'height' as absolute or as deltas. Defaults to false. + */ + relative?: boolean; + }; + } + + interface AnimationOptions { + /** + * This option interrupts the current animation. When false it pushes this animation onto the end of the animation queue. + */ + interrupt?: boolean; + /** + * Transition effect. Defaults to 'ease-in-out'. + */ + tween?: OpenFinTweenType; + } + + interface WindowBounds { + /** + * the height of the window. + */ + height?: number; + /** + * left-most coordinate of the window. + */ + left?: number; + /** + * top-most coordinate of the window. + */ + top?: number; + /** + * the width of the window. + */ + width?: number; + } + + interface SessionChangedEvent { + /** + * the action that triggered this event: + */ + reason: "lock" + | "unlock" + | "remote-connect" + | "remote-disconnect" + | "unknown"; + topic: "system"; + type: "session-changed"; + } + + type OpenFinTweenType = "linear" + | "ease-in" + | "ease-out" + | "ease-in-out" + | "ease-in-quad" + | "ease-out-quad" + | "ease-in-out-quad" + | "ease-in-cubic" + | "ease-out-cubic" + | "ease-in-out-cubic" + | "ease-out-bounce" + | "ease-in-back" + | "ease-out-back" + | "ease-in-out-back" + | "ease-in-elastic" + | "ease-out-elastic" + | "ease-in-out-elastic"; + + type OpenFinApplicationEventType = "closed" + | "connected" + | "crashed" + | "initialized" + | "manifest-changed" + | "not-responding" + | "out-of-memory" + | "responding" + | "run-requested" + | "started" + | "tray-icon-clicked" + | "window-alert-requested" + | "window-auth-requested" + | "window-closed" + | "window-created" + | "window-end-load" + | "window-navigation-rejected" + | "window-show-requested" + | "window-start-load"; + + type OpenFinExternalApplicationEventType = "connected" + | "disconnected"; + + type OpenFinSystemEventType = "application-closed" + | "application-crashed" + | "application-created" + | "application-started" + | "desktop-icon-clicked" + | "idle-state-changed" + | "monitor-info-changed" + | "session-changed"; + + type OpenFinWindowEventType = "auth-requested" + | "blurred" + | "bounds-changed" + | "bounds-changing" + | "close-requested" + | "closed" + | "disabled-frame-bounds-changed" + | "disabled-frame-bounds-changing" + | "embedded" + | "external-process-exited" + | "external-process-started" + | "focused" + | "frame-disabled" + | "frame-enabled" + | "group-changed" + | "hidden" + | "initialized" + | "maximized" + | "minimized" + | "navigation-rejected" + | "restored" + | "show-requested" + | "shown"; + + type OpenFinAnchor = "top-left" + | "top-right" + | "bottom-left" + | "bottom-right"; +} \ No newline at end of file diff --git a/openfin/v16/openfin-tests.ts b/openfin/v16/openfin-tests.ts new file mode 100644 index 0000000000..81ac24f937 --- /dev/null +++ b/openfin/v16/openfin-tests.ts @@ -0,0 +1,724 @@ +function test_application() { + let application: fin.OpenFinApplication; + // constructor + application = new fin.desktop.Application({ + url: "application.html", + uuid: "74BED629-2D8E-4141-8582-73E364BDFA74", + name: "Application Name", + plugins: false, + mainWindowOptions: { + defaultHeight: 600, + defaultWidth: 800, + defaultTop: 300, + defaultLeft: 300, + autoShow: true + } + }, function (successObj) { + console.log("Application successfully created, HTTP response code:", successObj); + application.run(); + }, function (error) { + console.log("Error creating application:", error); + }); + // getCurrent + application = fin.desktop.Application.getCurrent(); + // wrap + application = fin.desktop.Application.wrap("454C7F31-A915-4EA2-83F2-CFA655453C52"); + // getWindow + application.getWindow(); + // addEventListener + application.addEventListener("closed", function (event) { + console.log("The application has closed"); + }, function () { + console.log("The registration was successful"); + }, function (reason) { + console.log("failure: " + reason); + }); + // close + application.close(); + // getChildWindows + application.getChildWindows(function (children) { + children.forEach(function (childWindow) { + console.log("Showing child: " + childWindow.name); + childWindow.show(); + }); + }); + // getGroups + application.getGroups(function (allGroups) { + console.log("There are a total of " + allGroups.length + " groups."); + + var groupCounter = 1; + allGroups.forEach(function (windowGroup) { + console.log("Group " + groupCounter + " contains " + + windowGroup.length + " windows."); + ++groupCounter; + }); + }); + // getManifest + application.getManifest(function (manifest) { + console.log("Application manifest:"); + console.log(manifest); + }); + // getParentUuid + application.getParentUuid(function (parentUuid) { + console.log("UUID of parent application:"); + console.log(parentUuid); + }); + // getShortcuts + application.getShortcuts(function (config) { + console.log("Desktop shortcut is enabled: ", config.desktop); + console.log("Start Menu shortcut is enabled: ", config.startMenu); + console.log("System Startup shortcut is enabled: ", config.systemStartup); + }); + // isRunning + application.isRunning(function (running) { + console.log("the application is", running ? "running" : "not running"); + }); + // registerCustomData + application.registerCustomData({ + someData: "this is custom" + }, function () { + console.log("You will not read this."); + }, function (err) { + console.log("failure:", err); + }); + // removeEventListener + let previousCallback = function (event: fin.WindowEvent) { }; + application.removeEventListener("closed", previousCallback, function () { + console.log("The unregistration was successful"); + }, function (err) { + console.log("failure:", err); + }); + // removeTrayIcon + application.removeTrayIcon(function () { + console.log("Removed the tray icon."); + }, function (err) { + console.log("failure:", err); + }); + // restart + application.restart(function () { + console.log("You will not read this."); + }, function (err) { + console.log("failure:", err); + }); + // schedule restart + application.scheduleRestart(function () { + console.log("You will not read this."); + }, function (err) { + console.log("failure:", err); + }); + // setShortcuts + application.setShortcuts({ + desktop: true, + startMenu: false, + systemStartup: true + }, function () { + console.log("Successfully set new shortcut states"); + }, function (error) { + console.log("Failed to set new shortcut states. Error: ", error); + }); + // setTrayIcon + application.setTrayIcon("https://developer.openf.in/download/openfin.png", function (clickInfo) { + console.log("The mouse has clicked at (" + clickInfo.x + "," + clickInfo.y + ")"); + }); + // terminate + application.terminate(); + // wait + application.addEventListener("not-responding", function () { + console.log("waiting for hung application"); + application.wait(); + }); +} + +function test_external_application() { + let externalApp: fin.OpenFinExternalApplication; + // wrap + externalApp = fin.desktop.ExternalApp.wrap('my-uuid'); + // addEventListener + externalApp.addEventListener('connected', () => { + console.log('external app connected'); + }, () => { + console.log('The registration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); + // removeEventListener + let previousCallback = function () { }; + externalApp.removeEventListener('connected', previousCallback, () => { + console.log('The unregistration was successful'); + }, (reason, err) => { + console.log(`Error Message: ${err.message} Error Stack: ${err.stack}`); + }); +} + +function test_inter_application_bus() { + // addSubscribeListener + fin.desktop.InterApplicationBus.addSubscribeListener(function (uuid, topic, name) { + console.log("The application " + uuid + " has subscribed to " + topic); + }); + // addUnsubscribeListener + fin.desktop.InterApplicationBus.addUnsubscribeListener(function (uuid, topic, name) { + console.log("The application " + uuid + " has unsubscribed to " + topic); + }); + // removeSubscribeListener + let aRegisteredListener = function (uuid: string, topic: string, name: string) { }; + fin.desktop.InterApplicationBus.removeSubscribeListener(aRegisteredListener); + // removeUnsubscribeListener + fin.desktop.InterApplicationBus.removeUnsubscribeListener(aRegisteredListener); + // publish + fin.desktop.InterApplicationBus.publish("a topic", { + field1: "value1", + field2: "value2" + }); + // send + fin.desktop.InterApplicationBus.send("an application's uuid", "a topic", { + field1: "value1", + field2: "value2" + }); + // subscribe + fin.desktop.InterApplicationBus.subscribe("*", "a topic", function (message, uuid, name) { + console.log("The application " + uuid + " sent this message: " + message); + }); + // unsubscribe + let aRegisteredMessageListener = function (message: any, senderUuid: string) { + console.log(message, senderUuid); + }; + fin.desktop.InterApplicationBus.unsubscribe("*", "a topic", aRegisteredMessageListener); +} + +function test_notification() { + let notification: fin.OpenFinNotification; + // getCurrent + notification = fin.desktop.Notification.getCurrent(); + // close + notification.close(); + // sendMessage + notification = new fin.desktop.Notification({ + duration: 10, + url: "http://localhost:5000/Account/Register", + message: "Hello", + onShow: () => { }, + //onClose: () => { }, + onDismiss: () => { }, + //onClick: () => { }, + onMessage: () => { }, + onError: () => { } + }); + // sendMessageToApplication + notification.sendMessageToApplication("some message"); +} + +function test_system() { + // addEventListener + fin.desktop.System.addEventListener('monitor-info-changed', function (event) { + console.log("The monitor information has changed to: ", event); + }, function () { + console.log("The registration was successful"); + }, function (err) { + console.log("failure: " + err); + }); + // clearCache + fin.desktop.System.clearCache({ + cache: true, + cookies: true, + localStorage: true, + appcache: true, + userData: true + }); + // deleteCacheOnExit + fin.desktop.System.deleteCacheOnExit(function () { + console.log("successful"); + }, function (err) { + console.log("failure: " + err); + }); + // downloadAsset + let dirAppAsset = { + 'src': 'http://local:8000/dir.zip', + 'alias': 'dirApp', + 'version': '1.23.24', + 'target': 'dir.bat', + 'args': '' + }; + fin.desktop.System.downloadAsset(dirAppAsset, progress => { + let downloadedPercent = Math.floor((progress.downloadedBytes / progress.totalBytes) * 100); + console.log(`Downloaded ${downloadedPercent}%`); + }, p => { + console.log(`Downlod complete, can be found on ${p.path}`); + //lets launch our application asset. + //launchDirApp(); + }, (reason, err) => { + console.log(reason, err); + }); + // exit + fin.desktop.System.exit(function () { + console.log("successful"); + }, function (err) { + console.log("failure: " + err); + }); + // getAllApplications + fin.desktop.System.getAllApplications(function (applicationInfoList) { + applicationInfoList.forEach(function (applicationInfo) { + console.log("Showing information for application with uuid: " + + applicationInfo.uuid); + console.log("isRunning: ", applicationInfo.isRunning); + }); + }); + // getAllExternalApplications + fin.desktop.System.getAllExternalApplications(externalAppsInfoList => { + externalAppsInfoList.forEach(appInfo => { + console.log(`External app connected to the runtime with UUID ${appInfo.uuid}`); + }); + }); + // getAllWindows + fin.desktop.System.getAllWindows(function (windowInfoList) { + windowInfoList.forEach(function (windowInfo) { + console.log("Showing information for application with uuid: ", windowInfo.uuid); + console.log("Main window: ", windowInfo.mainWindow); + console.log("Child windows: ", windowInfo.childWindows); + }); + }); + // getCommandLineArguments + fin.desktop.System.getCommandLineArguments(function (args) { + console.log("The command line arguments are " + args); + }); + // getDeviceId + fin.desktop.System.getDeviceId(function (id) { + console.log("The id of the device is: " + id); + }); + // getEnvironmentVariable + fin.desktop.System.getEnvironmentVariable("APPDATA", function (variable) { + console.log("this is the APPDATA value", variable); + }); + // getHostSpecs + fin.desktop.System.getHostSpecs(function (info) { + console.log(info); + }, function (error) { + console.log('There was an error:', error); + }); + // getLog + fin.desktop.System.getLog('debug-2015-01-08-22-27-53.log', function (log) { + console.log(log); + }); + // getLogList + fin.desktop.System.getLogList(function (logList) { + logList.forEach(function (logInfo) { + console.log("The filename of the log is " + + logInfo.name + ", the size is " + + logInfo.size + ", and the date of creation is " + + logInfo.date); + }); + }); + // getMonitorInfo + fin.desktop.System.getMonitorInfo(function (monitorInfo) { + console.log("This object contains information about all monitors: ", monitorInfo); + }); + // getMousePosition + fin.desktop.System.getMousePosition(function (mousePosition) { + console.log("The mouse is located at left: " + mousePosition.left + ", top: " + mousePosition.top); + }); + // getProcessList + fin.desktop.System.getProcessList(function (list) { + list.forEach(function (process) { + console.log("UUID: " + process.uuid + ", Application Name: " + process.name); + }); + }); + // getProxySettings + fin.desktop.System.getProxySettings(function (proxy) { + console.log(proxy); + }); + // getRvmInfo + fin.desktop.System.getRvmInfo(function (rvmInfoObject) { + console.log("RVM version:", rvmInfoObject.version); + console.log("RVM has been running since:", rvmInfoObject["start-time"]); + }, function (err) { + console.log("Failed to get rvm info, error message:", err); + }); + // getVersion + fin.desktop.System.getVersion(function (version) { + console.log("The version is " + version); + }); + // launchExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener: function (result) { + console.log('the exit code', result.exitCode); + } + }, function (payload) { + console.log('Success:', payload.uuid); + }, function (error) { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + //Additionally note that the executable found in the zip file specified in appAssets + //will default to the one mentioned by appAssets.target + //If the the path below refers to a specific path it will override this default + alias: "myApp", + listener: function (result) { + console.log('the exit code', result.exitCode); + } + }, function (payload) { + console.log('Success:', payload.uuid); + }, function (error) { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + alias: "myApp", + arguments: "e f g", + listener: function (result) { + console.log('the exit code', result.exitCode); + } + }, function (payload) { + console.log('Success:', payload.uuid); + }, function (error) { + console.log('Error:', error); + }); + // + fin.desktop.System.launchExternalProcess({ + path: "C:\Users\ExampleUser\AppData\Local\OpenFin\OpenFinRVM.exe", + arguments: "--version", + certificate: { + trusted: true, + subject: 'O=OpenFin INC., L=New York, S=NY, C=US', + thumbprint: '‎3c a5 28 19 83 05 fe 69 88 e6 8f 4b 3a af c5 c5 1b 07 80 5b' + }, + listener: function (result) { + console.log('the exit code', result.exitCode); + } + }, function (payload) { + console.log('Success:', payload.uuid); + }, function (error) { + console.log('Error:', error); + }); + // log + fin.desktop.System.log("info", "An example log message", function () { + console.log("message successfully logged"); + }, function (err) { + console.log(err); + }); + // monitorExternalProcess + fin.desktop.System.monitorExternalProcess({ + pid: 2508, + listener: function (result) { + console.log('the exit code', result.exitCode); + } + }, function (payload) { + console.log("The process is now being monitored: ", payload.uuid); + }, function (error) { + console.log("Error:", error); + }); + // openUrlWithBrowser + fin.desktop.System.openUrlWithBrowser("https://developer.openf.in/", function () { + console.log("successful"); + }, function (err) { + console.log("failure: " + err); + }); + // registerExternalConnection + fin.desktop.System.registerExternalConnection("remote-connection-uuid", function () { + console.log(arguments); + }); + // releaseExternalProcess + fin.desktop.System.launchExternalProcess({ + path: "notepad", + arguments: "", + listener: function (result) { + console.log("The exit code", result.exitCode); + } + }, function (result) { + console.log("Result UUID is " + result.uuid); + + //release it. + fin.desktop.System.releaseExternalProcess(result.uuid, function () { + console.log("Process has been unmapped!"); + }, function (reason) { + console.log("failure: " + reason); + }); + }); + // removeEventListener + let aRegisteredListener = (event: fin.SystemBaseEvent) => { }; + fin.desktop.System.removeEventListener("monitor-info-changed", aRegisteredListener, function () { + console.log("successful"); + }, function (err) { + console.log("failure: " + err); + }); + // showDeveloperTools + fin.desktop.System.showDeveloperTools("uuid", "name", function () { + console.log("successful"); + }, function (err) { + console.log("failure: " + err); + }); + // terminateExternalProcess + fin.desktop.System.launchExternalProcess({ + // notepad is in the system’s PATH + path: "notepad", + arguments: "", + listener: function (result) { + console.log("The exit code", result.exitCode); + } + }, function (result) { + console.log("Result UUID is " + result.uuid); + + // Attempt to close the process. Terminate after 4 seconds if it + // has not done so. + fin.desktop.System.terminateExternalProcess(result.uuid, 4000, function (info) { + console.log("Termination result " + info.result); + }, function (reason) { + console.log("failure: " + reason); + }); + }); + // updateProxySettings + fin.desktop.System.updateProxySettings("type", "proxyAddress", 8080, function () { + console.log('success'); + }, function (err) { + console.log(err); + }); +} + +function test_system_clipboard() { + // availableFormats + fin.desktop.System.Clipboard.availableFormats(null, formats => { + formats.forEach(format => console.log(`The format ${format} is available to read`)); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readHtml + fin.desktop.System.Clipboard.readHtml(null, html => { + console.log(`This is the html from the clipboard: ${html}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readRtf + fin.desktop.System.Clipboard.readRtf(null, rtf => { + console.log(`This is the rtf from the clipboard: ${rtf}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // readText + fin.desktop.System.Clipboard.readText(null, text => { + console.log(`This is the text from the clipboard: ${text}`); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // write + fin.desktop.System.Clipboard.write({ + text: 'Hello Text!', + html: '

Hello Html

', + rtf: 'Hello Rtf' + }, null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeHtml + fin.desktop.System.Clipboard.writeHtml('

Hello World

', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeRtf + fin.desktop.System.Clipboard.writeRtf('Hello World!', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); + // writeText + fin.desktop.System.Clipboard.writeText('Hello World', null, () => { + console.log('Success!!'); + }, (reason, err) => { + console.log(`Error while reading the clipboard Message: ${err.message}, Stack: ${err.stack}`); + }); +} + +function test_window() { + let finWindow: fin.OpenFinWindow; + // constructor + finWindow = new fin.desktop.Window({ + name: "childWindow", + url: "child.html", + defaultWidth: 320, + defaultHeight: 320, + defaultTop: 10, + defaultLeft: 300, + frame: false, + resizable: false, + state: "normal" + }, function () { + var _win = finWindow.getNativeWindow(); + _win.addEventListener("DOMContentLoaded", function () { finWindow.show(); }); + }, function (error) { + console.log("Error creating window:", error); + }); + // getCurrent + finWindow = fin.desktop.Window.getCurrent(); + // getNativeWindow + let nativeWindow: Window; + nativeWindow = finWindow.getNativeWindow(); + // getParentApplication + let parentApp: fin.OpenFinApplication; + parentApp = finWindow.getParentApplication(); + // getParentWindow + let parentFinWindow: fin.OpenFinWindow; + parentFinWindow = finWindow.getParentWindow(); + // wrap + finWindow = fin.desktop.Window.wrap("uuid", "name"); + // addEventListener + finWindow.addEventListener("bounds-changed", function (event) { + console.log("The window has been moved or resized"); + }, function () { + console.log("The registration was successful"); + }, function (reason) { + console.log("failure:" + reason); + }); + // animate + finWindow.animate({ + opacity: { + opacity: 0.15, + duration: 1000 + }, + position: { + left: 10, + top: 10, + duration: 3000 + } + }, { + interrupt: false + }, function (evt) { + // Callback will only fire after both "opacity" and "position" have finished animating. + }); + // authenticate + finWindow.addEventListener('auth-requested', evt => { + finWindow.authenticate('userName', 'P@assw0rd', () => { }, (reason, err) => { + console.log("failure:", err); + }); + }); + // blur + finWindow.blur(); + // bringToFront + finWindow.bringToFront(); + // close + finWindow.close(); + // disableFrame + finWindow.disableFrame(); + // enableFrame + finWindow.enableFrame(); + // flash + finWindow.flash(); + // focus + finWindow.focus(); + // getBounds + finWindow.getBounds(function (bounds) { + console.log("top: " + bounds.top + + "left: " + bounds.left + + "height: " + bounds.height + + "width: " + bounds.width); + }); + // getOptions + finWindow.getOptions(function (options) { + console.log(options); + }); + // getSnapshot + finWindow.getSnapshot(function (base64Snapshot) { + console.log("data:image/png;base64," + base64Snapshot); + }); + // getState + finWindow.getState(function (state) { + console.log("state: " + state); + }); + // getZoomLevel + finWindow.getZoomLevel(function (level) { + console.log("zoom level: " + level); + }, function (error) { + console.log('error:', error); + }); + // hide + finWindow.hide(); + // isShowing + finWindow.isShowing(function (showing) { + console.log("the window is " + (showing ? "showing" : "hidden")); + }); + // joinGroup + let secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, function () { + // When mainWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow); + }); + // leaveGroup + secondWindow = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "secondWindow", + autoShow: true + }, function () { + // When finWindow moves or is moved, secondWindow moves by the same amount + secondWindow.joinGroup(finWindow, function () { + //once we are in the group, lets leave it. + secondWindow.leaveGroup(); + }); + }); + // maximize + finWindow.maximize(); + // mergeGroups + { + let finWindowOne = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowOne", + autoShow: true + }); + let finWindowTwo = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowTwo", + autoShow: true + }); + let finWindowThree = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowThree", + autoShow: true + }); + let finWindowFour = new fin.desktop.Window({ + url: "http://www.openfin.co", + name: "finWindowFour", + autoShow: true + }); + // When finWindowOne moves or is moved, finWindowTwo moves by the same amount + finWindowOne.joinGroup(finWindowTwo); + // When finWindowThree moves or is moved, finWindowFour moves by the same amount + finWindowThree.joinGroup(finWindowFour); + // finWindowOne, finWindowTwo, finWindowThree, and finWindowFour now move together in the same group + finWindowOne.mergeGroups(finWindowThree); + } + // minimize + finWindow.minimize(); + // moveBy + finWindow.moveBy(10, 10); + // moveTo + finWindow.moveTo(100, 200); + // removeEventListener + let aRegisteredListener = (event: fin.WindowBaseEvent) => { }; + finWindow.removeEventListener("bounds-changed", aRegisteredListener); + // resizeBy + finWindow.resizeBy(10, 10, "top-right"); + // resizeTo + finWindow.resizeTo(10, 10, "top-right"); + // restore + finWindow.restore(); + // setAsForeground + finWindow.setAsForeground(); + // setBounds + finWindow.setBounds(100, 200, 400, 400); + // setZoomLevel + finWindow.setZoomLevel(10); + // show + finWindow.show(); + // showAt + finWindow.showAt(10, 10, false); + // stopFlashing + finWindow.stopFlashing(); + // updateOptions + finWindow.updateOptions({ + frame: false, + maxWidth: 500 + }); +} \ No newline at end of file diff --git a/openfin/v16/tsconfig.json b/openfin/v16/tsconfig.json new file mode 100644 index 0000000000..24629d90e4 --- /dev/null +++ b/openfin/v16/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "types": [], + "paths": { + "openfin": [ + "openfin/v16" + ] + }, + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "openfin-tests.ts" + ] +} diff --git a/openfin/v16/tslint.json b/openfin/v16/tslint.json new file mode 100644 index 0000000000..af53769b6b --- /dev/null +++ b/openfin/v16/tslint.json @@ -0,0 +1 @@ +{ "extends": "../../tslint.json" } From e1ec05af8036aa051c57a008c8eba5009226329e Mon Sep 17 00:00:00 2001 From: Greg Ellis Date: Mon, 20 Feb 2017 12:30:05 -0500 Subject: [PATCH 151/797] Added background to set background color in gm --- gm/gm-tests.ts | 1 + gm/index.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/gm/gm-tests.ts b/gm/gm-tests.ts index debd18ecff..2189d9064d 100644 --- a/gm/gm-tests.ts +++ b/gm/gm-tests.ts @@ -78,6 +78,7 @@ gm(src) .authenticate(password) .autoOrient() .backdrop() + .background(color) .bitdepth(bits) .blackThreshold(intensity) .blackThreshold(r, g, b) diff --git a/gm/index.d.ts b/gm/index.d.ts index 288ce150ce..7fd419ede3 100644 --- a/gm/index.d.ts +++ b/gm/index.d.ts @@ -108,6 +108,7 @@ declare namespace m { authenticate(password: string): State; autoOrient(): State; backdrop(): State; + background(color: string): State; bitdepth(bits: number): State; blackThreshold(intensity: number): State; blackThreshold(red: number, green: number, blue: number, opacity?: number): State; From 847ba42ad0152d0291a68872f5f77014bb893262 Mon Sep 17 00:00:00 2001 From: kolja2 Date: Mon, 20 Feb 2017 18:57:31 +0100 Subject: [PATCH 152/797] @types/openlayers SelectEvent (<=3.18) to Select.Event (3.19+) --- openlayers/index.d.ts | 76 +++++++++++++++++++++++-------------------- 1 file changed, 41 insertions(+), 35 deletions(-) diff --git a/openlayers/index.d.ts b/openlayers/index.d.ts index f81e964b4d..8888642fc9 100644 --- a/openlayers/index.d.ts +++ b/openlayers/index.d.ts @@ -5600,20 +5600,9 @@ declare module ol { } /** - * @classdesc - * Events emitted by {@link ol.interaction.Select} instances are instances of - * this type. - * - * @param {string} type The event type. - * @param {Array.} selected Selected features. - * @param {Array.} deselected Deselected features. - * @param {ol.MapBrowserEvent} mapBrowserEvent Associated - * {@link ol.MapBrowserEvent}. - * @implements {oli.SelectEvent} - * @extends {ol.events.Event} - * @constructor + * @namespace ol.interaction.Select */ - class SelectEvent extends ol.events.Event { + module Select { /** * @classdesc * Events emitted by {@link ol.interaction.Select} instances are instances of @@ -5628,28 +5617,45 @@ declare module ol { * @extends {ol.events.Event} * @constructor */ - constructor(type: string, selected: ol.Feature[], deselected: ol.Feature[], mapBrowserEvent: ol.MapBrowserEvent); - - /** - * Selected features array. - * @type {Array.} - * @api - */ - selected: ol.Feature[]; - - /** - * Deselected features array. - * @type {Array.} - * @api - */ - deselected: ol.Feature[]; - - /** - * Associated {@link ol.MapBrowserEvent}. - * @type {ol.MapBrowserEvent} - * @api - */ - mapBrowserEvent: ol.MapBrowserEvent; + class Event extends ol.events.Event { + /** + * @classdesc + * Events emitted by {@link ol.interaction.Select} instances are instances of + * this type. + * + * @param {string} type The event type. + * @param {Array.} selected Selected features. + * @param {Array.} deselected Deselected features. + * @param {ol.MapBrowserEvent} mapBrowserEvent Associated + * {@link ol.MapBrowserEvent}. + * @implements {oli.SelectEvent} + * @extends {ol.events.Event} + * @constructor + */ + constructor(type: string, selected: ol.Feature[], deselected: ol.Feature[], mapBrowserEvent: ol.MapBrowserEvent); + + /** + * Selected features array. + * @type {Array.} + * @api + */ + selected: ol.Feature[]; + + /** + * Deselected features array. + * @type {Array.} + * @api + */ + deselected: ol.Feature[]; + + /** + * Associated {@link ol.MapBrowserEvent}. + * @type {ol.MapBrowserEvent} + * @api + */ + mapBrowserEvent: ol.MapBrowserEvent; + + } } From e9a122097f5b3cbf17170f0ad25bff7c19e2c341 Mon Sep 17 00:00:00 2001 From: Pine Mizune Date: Tue, 21 Feb 2017 03:04:30 +0900 Subject: [PATCH 153/797] add `tr` method --- voca/index.d.ts | 6 ++++++ voca/voca-tests.ts | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/voca/index.d.ts b/voca/index.d.ts index 7a7fa6e6c5..95703b49ad 100644 --- a/voca/index.d.ts +++ b/voca/index.d.ts @@ -80,6 +80,8 @@ declare namespace v { reverseGrapheme(subject?: string): string; slugify(subject?: string): string; splice(subject?: string, start?: number, deleteCount?: number, toAdd?: string): string; + tr(subject?: string, from?: string, to?: string): string; + tr(subject?: string, from?: { [key: string]: string }): string; trim(subject?: string, whitespace?: string): string; trimLeft(subject?: string, whitespace?: string): string; trimRight(subject?: string, whitespace?: string): string; @@ -177,6 +179,8 @@ declare namespace v { reverseGrapheme(): Chain; slugify(): Chain; splice(start?: number, deleteCount?: number, toAdd?: string): Chain; + tr(from?: string, to?: string): Chain; + tr(from?: { [key: string]: string }): Chain; trim(whitespace?: string): Chain; trimLeft(whitespace?: string): Chain; trimRight(whitespace?: string): Chain; @@ -270,6 +274,8 @@ declare namespace v { reverseGrapheme(): ExplicitChain; slugify(): ExplicitChain; splice(start?: number, deleteCount?: number, toAdd?: string): ExplicitChain; + tr(from?: string, to?: string): ExplicitChain; + tr(from?: { [key: string]: string }): ExplicitChain; trim(whitespace?: string): ExplicitChain; trimLeft(whitespace?: string): ExplicitChain; trimRight(whitespace?: string): ExplicitChain; diff --git a/voca/voca-tests.ts b/voca/voca-tests.ts index 3fb9d100c3..532f7861a3 100644 --- a/voca/voca-tests.ts +++ b/voca/voca-tests.ts @@ -214,6 +214,23 @@ str = v.splice('new year', 0); str = v.splice('new year', 0, 4); str = v.splice('new year', 0, 3, 'happy'); +str = v.tr(); +str = v.tr('hello', 'el', 'ip'); +str = v.tr('Yes. The fire rises.', { + 'Yes': 'Awesome', + 'fire': 'flame' +}) +str = v('hello').tr('el', 'ip').value(); +str = v('Yes. The fire rises.').tr({ + 'Yes': 'Awesome', + 'fire': 'flame' +}).value(); +str = v.chain('hello').tr('el', 'ip').value(); +str = v.chain('Yes. The fire rises.').tr({ + 'Yes': 'Awesome', + 'fire': 'flame' +}).value(); + str = v.trim(); str = v.trim(' Mother nature '); str = v.trim('--Earth--', '-'); From 42a183cbc2cc6f4a1530a3b8cb0c4c2bd671f914 Mon Sep 17 00:00:00 2001 From: Pine Mizune Date: Tue, 21 Feb 2017 03:06:36 +0900 Subject: [PATCH 154/797] add `swapCase` method --- voca/index.d.ts | 3 +++ voca/voca-tests.ts | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/voca/index.d.ts b/voca/index.d.ts index 95703b49ad..80056bf1d5 100644 --- a/voca/index.d.ts +++ b/voca/index.d.ts @@ -27,6 +27,7 @@ declare namespace v { kebabCase(subject?: string): string; lowerCase(subject?: string): string; snakeCase(subject?: string): string; + swapCase(subject?: string): string; titleCase(subject?: string, ignoreWords?: string[]): string; upperCase(subject?: string): string; @@ -126,6 +127,7 @@ declare namespace v { kebabCase(): Chain; lowerCase(): Chain; snakeCase(): Chain; + swapCase(): Chain; titleCase(ignoreWordsopt?: string[]): Chain; upperCase(): Chain; @@ -221,6 +223,7 @@ declare namespace v { kebabCase(): ExplicitChain; lowerCase(): ExplicitChain; snakeCase(): ExplicitChain; + swapCase(): ExplicitChain; titleCase(ignoreWordsopt?: string[]): ExplicitChain; upperCase(): ExplicitChain; diff --git a/voca/voca-tests.ts b/voca/voca-tests.ts index 532f7861a3..c4a342579c 100644 --- a/voca/voca-tests.ts +++ b/voca/voca-tests.ts @@ -23,6 +23,11 @@ str = v.decapitalize('Sun'); str = v.kebabCase('goodbye blue sky'); str = v.lowerCase('Green'); str = v.snakeCase('learning to fly'); + +str = v.swapCase('learning to fly'); +str = v('learning to fly').swapCase().value(); +str = v.chain('learning to fly').swapCase().value(); + str = v.titleCase('learning to fly'); str = v.titleCase('another brick in the wall', ['in', 'the']); str = v.upperCase('school'); From 12553a32ea83128def27745807fac133011c7487 Mon Sep 17 00:00:00 2001 From: Pine Mizune Date: Tue, 21 Feb 2017 03:07:02 +0900 Subject: [PATCH 155/797] support voca 1.3.0 https://github.com/panzerdp/voca/releases/tag/1.3.0 --- voca/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/voca/index.d.ts b/voca/index.d.ts index 80056bf1d5..7f4cafdd7f 100644 --- a/voca/index.d.ts +++ b/voca/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Voca 1.2 +// Type definitions for Voca 1.3 // Project: https://vocajs.com/ // Definitions by: Pine Mizune // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 020af54bafa72da742e8e0a6337e5e253d6e733e Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 20 Feb 2017 22:41:34 +0100 Subject: [PATCH 156/797] Add typings for massive-js --- massive/index.d.ts | 101 ++++++++++++++++++++++++++++++++++++++++++ massive/tsconfig.json | 11 +++++ massive/tslint.json | 1 + 3 files changed, 113 insertions(+) create mode 100755 massive/index.d.ts create mode 100755 massive/tsconfig.json create mode 100644 massive/tslint.json diff --git a/massive/index.d.ts b/massive/index.d.ts new file mode 100755 index 0000000000..480b01bc8e --- /dev/null +++ b/massive/index.d.ts @@ -0,0 +1,101 @@ +// Type definitions for massive-js 2.2 +// Project: https://github.com/robconery/massive-js +// Definitions by: Pascal Birchler +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module massive { + interface IConnectionOptions { + connectionString?: string; + db?: string; + } + + export type ResultCallback = (err: Error, res: any) => void; + export type ConnectCallback = (err: Error, db: Massive) => void; + + export interface QueryOptions { + limit?: number; + order?: string; + offset?: number; + columns?: string[]; + } + + export interface Table { + count(context: any, callback: ResultCallback): void; + find(context: any, callback: ResultCallback): void; + find(context: any, options: QueryOptions, callback: ResultCallback): void; + findOne(context: any, callback: ResultCallback): void; + findOne(context: any, options: QueryOptions, callback: ResultCallback): void; + insert(context: any, callback: ResultCallback): void; + save(context: any, callback: ResultCallback): void; + update(context: any, callback: ResultCallback): void; + update(context: any, data: any, callback: ResultCallback): void; + destroy(context: any, callback: ResultCallback): void; + } + + interface Doc { + findDoc(context: any, callback: ResultCallback): void; + searchDoc(options: { + keys: string[]; + term: string; + }, callback: ResultCallback): void; + saveDoc(context: string, callback: ResultCallback): void; + destroy(context: any, callback: ResultCallback): void; + } + + interface QueryFile { + schema: string; + name: string; + db: Massive; + delimitedName: string; + delimitedSchema: string; + fullname: string; + delimitedFullName: string; + sql: string; + filePath: string; + } + + interface QueryFunction { + find: (params: any|any[], callback: ResultCallback) => void; + } + + export interface Massive { + custom: any; + comment: Table; + friendship: Table; + participation: Table; + person: Table; + practice: Table; + practicesession: Table; + sport: Table; + testdata: (callback: ResultCallback) => void; + team: Table; + teammember: Table; + teamsport: Table; + scriptsDir: string; + connectionString: string; + query: Function; + stream: Function; + executeSqlFile: Function; + end: Function; + tables: Array; + views: any[]; + queryFiles: QueryFile[]; + schemas: any[]; + functions: any[]; + allowedSchemas: string; + blacklist: string; + exceptions: string; + excludeFunctions: boolean; + functionBlacklist: string; + } + + export function connectSync(options: IConnectionOptions): Massive + + export function connect(options: IConnectionOptions, callback: ConnectCallback): void; + + export function run(context: string, filter: number|number[], callback: ResultCallback): void; + + export function saveDoc(name: string, data: any, callback: ResultCallback): void; +} + +export = massive; diff --git a/massive/tsconfig.json b/massive/tsconfig.json new file mode 100755 index 0000000000..5025aabaa6 --- /dev/null +++ b/massive/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": true, + "sourceMap": false + }, + "files": [ + "index.d.ts" + ] +} diff --git a/massive/tslint.json b/massive/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/massive/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file From 47f4cc037609497fde2af77025d59512769473a7 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 20 Feb 2017 23:04:09 +0100 Subject: [PATCH 157/797] Fix tsconfig --- massive/tsconfig.json | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/massive/tsconfig.json b/massive/tsconfig.json index 5025aabaa6..dbec91cb4b 100755 --- a/massive/tsconfig.json +++ b/massive/tsconfig.json @@ -1,11 +1,13 @@ { - "compilerOptions": { - "module": "commonjs", - "target": "es5", - "noImplicitAny": true, - "sourceMap": false - }, - "files": [ - "index.d.ts" - ] + "compilerOptions": { + "module": "commonjs", + "target": "es5", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "sourceMap": false + }, + "files": [ + "index.d.ts" + ] } From 952587467e15be132b4c253411a83114ff0cacf2 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 20 Feb 2017 23:04:14 +0100 Subject: [PATCH 158/797] Fix warnings --- massive/index.d.ts | 185 +++++++++++++++++++++++---------------------- 1 file changed, 95 insertions(+), 90 deletions(-) diff --git a/massive/index.d.ts b/massive/index.d.ts index 480b01bc8e..53e857e689 100755 --- a/massive/index.d.ts +++ b/massive/index.d.ts @@ -3,99 +3,104 @@ // Definitions by: Pascal Birchler // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module massive { - interface IConnectionOptions { - connectionString?: string; - db?: string; - } +declare namespace massive { + interface ConnectionOptions { + connectionString?: string; + db?: string; + } - export type ResultCallback = (err: Error, res: any) => void; - export type ConnectCallback = (err: Error, db: Massive) => void; + interface Doc { + findDoc(context: any, callback: ResultCallback): void; + searchDoc(options: { + keys: string[]; + term: string; + }, callback: ResultCallback): void; + saveDoc(context: string, callback: ResultCallback): void; + destroy(context: any, callback: ResultCallback): void; + } - export interface QueryOptions { - limit?: number; - order?: string; - offset?: number; - columns?: string[]; - } + interface QueryFile { + schema: string; + name: string; + db: Massive; + delimitedName: string; + delimitedSchema: string; + fullname: string; + delimitedFullName: string; + sql: string; + filePath: string; + } - export interface Table { - count(context: any, callback: ResultCallback): void; - find(context: any, callback: ResultCallback): void; - find(context: any, options: QueryOptions, callback: ResultCallback): void; - findOne(context: any, callback: ResultCallback): void; - findOne(context: any, options: QueryOptions, callback: ResultCallback): void; - insert(context: any, callback: ResultCallback): void; - save(context: any, callback: ResultCallback): void; - update(context: any, callback: ResultCallback): void; - update(context: any, data: any, callback: ResultCallback): void; - destroy(context: any, callback: ResultCallback): void; - } + interface QueryFunction { + find: (params: any|any[], callback: ResultCallback) => void; + } - interface Doc { - findDoc(context: any, callback: ResultCallback): void; - searchDoc(options: { - keys: string[]; - term: string; - }, callback: ResultCallback): void; - saveDoc(context: string, callback: ResultCallback): void; - destroy(context: any, callback: ResultCallback): void; - } - - interface QueryFile { - schema: string; - name: string; - db: Massive; - delimitedName: string; - delimitedSchema: string; - fullname: string; - delimitedFullName: string; - sql: string; - filePath: string; - } - - interface QueryFunction { - find: (params: any|any[], callback: ResultCallback) => void; - } - - export interface Massive { - custom: any; - comment: Table; - friendship: Table; - participation: Table; - person: Table; - practice: Table; - practicesession: Table; - sport: Table; - testdata: (callback: ResultCallback) => void; - team: Table; - teammember: Table; - teamsport: Table; - scriptsDir: string; - connectionString: string; - query: Function; - stream: Function; - executeSqlFile: Function; - end: Function; - tables: Array; - views: any[]; - queryFiles: QueryFile[]; - schemas: any[]; - functions: any[]; - allowedSchemas: string; - blacklist: string; - exceptions: string; - excludeFunctions: boolean; - functionBlacklist: string; - } - - export function connectSync(options: IConnectionOptions): Massive - - export function connect(options: IConnectionOptions, callback: ConnectCallback): void; - - export function run(context: string, filter: number|number[], callback: ResultCallback): void; - - export function saveDoc(name: string, data: any, callback: ResultCallback): void; + interface QueryArguments { + sql: string; + options: any; + params: any; + next: ResultCallback; + } } -export = massive; +export interface Massive { + custom: any; + comment: Table; + friendship: Table; + participation: Table; + person: Table; + practice: Table; + practicesession: Table; + sport: Table; + testdata: (callback: ResultCallback) => void; + team: Table; + teammember: Table; + teamsport: Table; + scriptsDir: string; + connectionString: string; + query: () => void; + stream: () => void; + executeSqlFile: (args: any, next: ResultCallback) => void; + end: () => void; + tables: Array; + views: any[]; + queryFiles: massive.QueryFile[]; + schemas: any[]; + functions: any[]; + allowedSchemas: string; + blacklist: string; + exceptions: string; + excludeFunctions: boolean; + functionBlacklist: string; +} + +export type ResultCallback = (err: Error, res: any) => void; +export type ConnectCallback = (err: Error, db: Massive) => void; + +export interface QueryOptions { + limit?: number; + order?: string; + offset?: number; + columns?: string[]; +} + +export interface Table { + count(context: any, callback: ResultCallback): void; + find(context: any, callback: ResultCallback): void; + find(context: any, options: QueryOptions, callback: ResultCallback): void; + findOne(context: any, callback: ResultCallback): void; + findOne(context: any, options: QueryOptions, callback: ResultCallback): void; + insert(context: any, callback: ResultCallback): void; + save(context: any, callback: ResultCallback): void; + update(context: any, callback: ResultCallback): void; + update(context: any, data: any, callback: ResultCallback): void; + destroy(context: any, callback: ResultCallback): void; +} + +export function connectSync(options: massive.ConnectionOptions): Massive; + +export function connect(options: massive.ConnectionOptions, callback: ConnectCallback): void; + +export function run(context: string, filter: number|number[], callback: ResultCallback): void; + +export function saveDoc(name: string, data: any, callback: ResultCallback): void; From 0dd7c7a7533e8de387ac0a9794535e2b1a65f455 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Mon, 20 Feb 2017 23:25:04 +0100 Subject: [PATCH 159/797] Add some tests --- massive/massive-tests.ts | 5 +++++ massive/tsconfig.json | 33 +++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 massive/massive-tests.ts diff --git a/massive/massive-tests.ts b/massive/massive-tests.ts new file mode 100644 index 0000000000..2978440f4a --- /dev/null +++ b/massive/massive-tests.ts @@ -0,0 +1,5 @@ +import * as Massive from 'massive'; + +Massive.connect({connectionString: 'foo'}, (err: Error, db: Massive.Massive) => {}); + +Massive.run('foo', 123, (err: Error, db: Massive.Massive) => {}); \ No newline at end of file diff --git a/massive/tsconfig.json b/massive/tsconfig.json index dbec91cb4b..7c91e19b44 100755 --- a/massive/tsconfig.json +++ b/massive/tsconfig.json @@ -1,13 +1,22 @@ { - "compilerOptions": { - "module": "commonjs", - "target": "es5", - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "sourceMap": false - }, - "files": [ - "index.d.ts" - ] -} + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "massive-tests.ts" + ] +} \ No newline at end of file From f36d20dcd0aa4f92c02cbdea3638083cfd2a58e2 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Tue, 21 Feb 2017 00:14:41 +0000 Subject: [PATCH 160/797] Fixed tslint and test issue that showed up on travis --- openfin/index.d.ts | 12 ++++++------ openfin/v16/tsconfig.json | 5 ++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/openfin/index.d.ts b/openfin/index.d.ts index 893a253606..f0803864ae 100644 --- a/openfin/index.d.ts +++ b/openfin/index.d.ts @@ -307,8 +307,8 @@ declare namespace fin { size?: number; /** * The size in pixels of an additional - * square resizable region located at the - * bottom right corner of a + * square resizable region located at the + * bottom right corner of a * frameless window. (Default: 4) */ bottomRightCorner?: number; @@ -941,11 +941,11 @@ declare namespace fin { interface OpenFinWindowStatic { /** * Class: Window - * + * * new Window(options, callbackopt, errorCallbackopt) - * + * * Creates a new OpenFin Window - * + * * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. The new window appears in the same process as the parent window. * @param {any} options - The options of the window * @param {Function} [callback] - Called if the window creation was successful @@ -982,7 +982,7 @@ declare namespace fin { * @returns {OpenFinApplication} Parent application */ getParentApplication(): OpenFinApplication; - /** + /** * Gets the parent window. */ getParentWindow(): OpenFinWindow; diff --git a/openfin/v16/tsconfig.json b/openfin/v16/tsconfig.json index 24629d90e4..88e1dbe7fa 100644 --- a/openfin/v16/tsconfig.json +++ b/openfin/v16/tsconfig.json @@ -1,7 +1,10 @@ { "compilerOptions": { "module": "commonjs", - "target": "es6", + "lib": [ + "es6", + "dom" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, From a4ba9a452279b77f8c28d2506093f8956db94740 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Tue, 21 Feb 2017 00:24:31 +0000 Subject: [PATCH 161/797] And fixed one more --- openfin/v16/index.d.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/openfin/v16/index.d.ts b/openfin/v16/index.d.ts index 2c1cfd648e..0b9f3e16ac 100644 --- a/openfin/v16/index.d.ts +++ b/openfin/v16/index.d.ts @@ -63,7 +63,7 @@ declare namespace fin { */ close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Retrieves an array of wrapped fin.desktop.Windows for each of the application’s child windows. + * Retrieves an array of wrapped fin.desktop.Windows for each of the application�s child windows. */ getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; /** @@ -95,7 +95,7 @@ declare namespace fin { */ removeEventListener(type: OpenFinApplicationEventType, previouslyRegisteredListener: (event: ApplicationBaseEvent | TrayIconClickedEvent | WindowEvent | WindowAlertRequestedEvent | WindowAuthRequested | WindowNavigationRejectedEvent | WindowEndLoadEvent) => any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Removes the application’s icon from the tray. + * Removes the application�s icon from the tray. */ removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -288,8 +288,8 @@ declare namespace fin { size?: number; /** * The size in pixels of an additional - * square resizable region located at the - * bottom right corner of a + * square resizable region located at the + * bottom right corner of a * frameless window. (Default: 4) */ bottomRightCorner?: number; @@ -922,11 +922,11 @@ declare namespace fin { interface OpenFinWindowStatic { /** * Class: Window - * + * * new Window(options, callbackopt, errorCallbackopt) - * + * * Creates a new OpenFin Window - * + * * A basic window that wraps a native HTML window. Provides more fine-grained control over the window state such as the ability to minimize, maximize, restore, etc. By default a window does not show upon instantiation; instead the window's show() method must be invoked manually. The new window appears in the same process as the parent window. * @param {any} options - The options of the window * @param {Function} [callback] - Called if the window creation was successful @@ -963,7 +963,7 @@ declare namespace fin { * @returns {OpenFinApplication} Parent application */ getParentApplication(): OpenFinApplication; - /** + /** * Gets the parent window. */ getParentWindow(): OpenFinWindow; @@ -989,7 +989,7 @@ declare namespace fin { bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Closes the window. - * @param {force} Close will be prevented from closing when force is false and ‘close-requested’ has been subscribed to for application’s main window. + * @param {force} Close will be prevented from closing when force is false and �close-requested� has been subscribed to for application�s main window. */ close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -1009,7 +1009,7 @@ declare namespace fin { */ enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Flashes the window’s frame and taskbar icon until the window is activated. + * Flashes the window�s frame and taskbar icon until the window is activated. */ flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -1106,7 +1106,7 @@ declare namespace fin { setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Shows the window if it is hidden. - * @param {force} Show will be prevented from closing when force is false and ‘show-requested’ has been subscribed to for application’s main window. + * @param {force} Show will be prevented from closing when force is false and �show-requested� has been subscribed to for application�s main window. */ show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** From bc751ce74e2270bf5777b435589f82e071b51f04 Mon Sep 17 00:00:00 2001 From: Christopher Currens Date: Mon, 20 Feb 2017 17:02:29 -0800 Subject: [PATCH 162/797] Use type union instead of BaseIcon class --- leaflet-markercluster/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/leaflet-markercluster/index.d.ts b/leaflet-markercluster/index.d.ts index b1d4649b33..88fe0edd72 100644 --- a/leaflet-markercluster/index.d.ts +++ b/leaflet-markercluster/index.d.ts @@ -105,7 +105,7 @@ declare namespace L { /* * Function used to create the cluster icon */ - iconCreateFunction?: ((cluster: L.MarkerCluster) => L.BaseIcon); + iconCreateFunction?: ((cluster: L.MarkerCluster) => L.Icon | L.DivIcon); /* * Boolean to split the addLayers processing in to small intervals so that the page does not freeze. From 46ceddceffd5a16fc0e38dba98878c7f643e194b Mon Sep 17 00:00:00 2001 From: Christopher Currens Date: Mon, 20 Feb 2017 17:54:09 -0800 Subject: [PATCH 163/797] leaflet: Update marker classes to accept both Icon and DivIcon --- leaflet/index.d.ts | 4 ++-- leaflet/leaflet-tests.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/leaflet/index.d.ts b/leaflet/index.d.ts index 717e589877..20052bd30d 100644 --- a/leaflet/index.d.ts +++ b/leaflet/index.d.ts @@ -1466,7 +1466,7 @@ declare namespace L { export function divIcon(options?: DivIconOptions): DivIcon; export interface MarkerOptions extends InteractiveLayerOptions { - icon?: Icon; + icon?: Icon | DivIcon; clickable?: boolean; draggable?: boolean; keyboard?: boolean; @@ -1483,7 +1483,7 @@ declare namespace L { getLatLng(): LatLng; setLatLng(latlng: LatLngExpression): this; setZIndexOffset(offset: number): this; - setIcon(icon: Icon): this; + setIcon(icon: Icon | DivIcon): this; setOpacity(opacity: number): this; getElement(): HTMLElement; diff --git a/leaflet/leaflet-tests.ts b/leaflet/leaflet-tests.ts index bce7afdab6..a6509170ba 100644 --- a/leaflet/leaflet-tests.ts +++ b/leaflet/leaflet-tests.ts @@ -447,3 +447,13 @@ L.marker([1, 2], { iconUrl: 'my-icon.png' }) }).bindPopup('

Hi

'); + +L.marker([1, 2], { + icon: L.divIcon({ + className: 'my-icon-class' + }) +}).setIcon(L.icon({ + iconUrl: 'my-icon.png' +})).setIcon(L.divIcon({ + className: 'my-div-icon' +}));; From 5c0b86f6c0ffcaae7e6d1db17616a431ef82bca2 Mon Sep 17 00:00:00 2001 From: Cameron Crothers Date: Tue, 21 Feb 2017 14:23:53 +1100 Subject: [PATCH 164/797] Add finished function to Job --- bull/bull-tests.tsx | 15 +++++++++++++++ bull/index.d.ts | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/bull/bull-tests.tsx b/bull/bull-tests.tsx index 1d307fd31e..fcf339b3c3 100644 --- a/bull/bull-tests.tsx +++ b/bull/bull-tests.tsx @@ -98,3 +98,18 @@ videoQueue.process( ( job: VideoJob ) => { // don't forget to remove the done ca // If the job throws an unhandled exception it is also handled correctly throw new Error( 'some unexpected error' ); } ); + + +var addVideo1Job = videoQueue.add( { video: 'http://example.com/video1.mov' } ); + +addVideo1Job.then((video1Job) => { + // When job has successfully be placed in the queue the job is returned + // then wait for completion + return video1Job.finished(); +}) +.then(() => { + // video1Job completed successfully +}) +.catch((err) => { + // error +}); diff --git a/bull/index.d.ts b/bull/index.d.ts index c604fe25d6..51344c4bbc 100644 --- a/bull/index.d.ts +++ b/bull/index.d.ts @@ -47,6 +47,13 @@ declare module "bull" { * @returns {Promise} A promise that resolves when the job is scheduled for retry. */ retry(): Promise; + + /** + * Returns a promise the resolves when the job has been finished. + * TODO: Add a watchdog to check if the job has finished periodically. + * since pubsub does not give any guarantees. + */ + finished(): Promise; } export interface Backoff { From 5a545a4621567cb161fb2796838b66af2ab1fd4b Mon Sep 17 00:00:00 2001 From: Cameron Crothers Date: Tue, 21 Feb 2017 14:31:56 +1100 Subject: [PATCH 165/797] Update versions --- bull/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bull/index.d.ts b/bull/index.d.ts index 51344c4bbc..3c89655101 100644 --- a/bull/index.d.ts +++ b/bull/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for bull 1.0.0 +// Type definitions for bull 2.1.2 // Project: https://github.com/OptimalBits/bull -// Definitions by: Bruno Grieder +// Definitions by: Bruno Grieder , Cameron Crothers // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 05d4b1ab4c09ec82f203e6494adf203de7e4b883 Mon Sep 17 00:00:00 2001 From: newraina Date: Tue, 21 Feb 2017 10:17:31 +0800 Subject: [PATCH 166/797] add d.ts for fetch.io package --- fetch.io/fetch.io-tests.ts | 60 +++++++++++++++++++++++++++ fetch.io/index.d.ts | 85 ++++++++++++++++++++++++++++++++++++++ fetch.io/tsconfig.json | 24 +++++++++++ fetch.io/tslint.json | 1 + 4 files changed, 170 insertions(+) create mode 100644 fetch.io/fetch.io-tests.ts create mode 100644 fetch.io/index.d.ts create mode 100644 fetch.io/tsconfig.json create mode 100644 fetch.io/tslint.json diff --git a/fetch.io/fetch.io-tests.ts b/fetch.io/fetch.io-tests.ts new file mode 100644 index 0000000000..4e14a7a9a9 --- /dev/null +++ b/fetch.io/fetch.io-tests.ts @@ -0,0 +1,60 @@ + +import Fetch from 'fetch.io' + +const request = new Fetch() + +request + .get('') + .query({}) + .json() + +request + .delete('') + .json() + +request + .head('') + .json() + +request + .options('') + .json() + +request + .put('') + .json() + +request + .config('key', 'value') + .json() + +request + .config({key: 'value'}) + .json() + +request + .config('set', 'value') + .json() + +request + .set({key: 'value'}) + .json() + +request + .type('json') + .json() + +request + .get('') + .query({}) + .text() + +request + .get('') + .query({}) + .then(() => {}) + +request + .post('') + .send({}) + .json() diff --git a/fetch.io/index.d.ts b/fetch.io/index.d.ts new file mode 100644 index 0000000000..8a6755d7c5 --- /dev/null +++ b/fetch.io/index.d.ts @@ -0,0 +1,85 @@ +// Type definitions for fetch.io v3.1.4 +// Project: https://github.com/haoxins/fetch.io +// Definitions by: newraina +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + type TUrl = string + + type TMethod = 'delete' | 'get' | 'head' | 'options' | 'post' | 'put' + + interface IQuery { + [key: string]: number | boolean | string + } + + interface IHeader { + [key: string]: string + } + + interface IOptions extends RequestInit { + + prefix?: string + + query?: IQuery + + header?: IHeader + + beforeRequest?(url: TUrl, body: BodyInit): boolean + + afterResponse?(res: Response): void + + afterJSON?(body: any): void + } + + declare namespace FetchIo { + + class Request { + + constructor(method: TMethod, url: TUrl, options: IOptions) + + delete: (url: TUrl) => this + + get: (url: TUrl) => this + + head: (url: TUrl) => this + + options: (url: TUrl) => this + + post: (url: TUrl) => this + + put: (url: TUrl) => this + + config(key: string, value: any): this + + config(opts: {[key: string]: any}): this + + set(key: string, value: any): this + + set(opts: {[key: string]: any}): this + + type(type: 'json' | 'form' | 'urlencoded'): this + + query(object: {[key: string]: any}): this + + send(data: {[key: string]: any}): this + + append(key: string, value: string): this + + then(resolve: (value?: Response) => void, reject?: (reason?: any) => void): Promise + + then(resolve: (value?: Response) => void, reject?: (reason?: any) => void): Promise + + json(strict?: boolean): Promise + + json(strict?: boolean): Promise + + text(): Promise + + text(): Promise + } + + class Fetch extends Request { + constructor(options?: IOptions) + } +} + +export = FetchIo.Fetch diff --git a/fetch.io/tsconfig.json b/fetch.io/tsconfig.json new file mode 100644 index 0000000000..44013e849a --- /dev/null +++ b/fetch.io/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "allowSyntheticDefaultImports": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "fetch.io-tests.ts" + ] +} diff --git a/fetch.io/tslint.json b/fetch.io/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/fetch.io/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 99a5cbd9c15a35ee2e19db2187f50feae03b62d0 Mon Sep 17 00:00:00 2001 From: newraina Date: Tue, 21 Feb 2017 13:16:07 +0800 Subject: [PATCH 167/797] fix by tslint --- fetch.io/index.d.ts | 48 +++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/fetch.io/index.d.ts b/fetch.io/index.d.ts index 8a6755d7c5..1dad59b79c 100644 --- a/fetch.io/index.d.ts +++ b/fetch.io/index.d.ts @@ -1,52 +1,54 @@ -// Type definitions for fetch.io v3.1.4 +// Type definitions for fetch.io 3.1 // Project: https://github.com/haoxins/fetch.io // Definitions by: newraina // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - type TUrl = string +/// - type TMethod = 'delete' | 'get' | 'head' | 'options' | 'post' | 'put' + type TUrl = string; - interface IQuery { - [key: string]: number | boolean | string + type TMethod = 'delete' | 'get' | 'head' | 'options' | 'post' | 'put'; + + interface Query { + [key: string]: number | boolean | string; } - interface IHeader { - [key: string]: string + interface Header { + [key: string]: string; } - interface IOptions extends RequestInit { + interface Options extends RequestInit { - prefix?: string + prefix?: string; - query?: IQuery + query?: Query; - header?: IHeader + header?: Header; - beforeRequest?(url: TUrl, body: BodyInit): boolean + beforeRequest?(url: TUrl, body: BodyInit): boolean; - afterResponse?(res: Response): void + afterResponse?(res: Response): void; - afterJSON?(body: any): void + afterJSON?(body: any): void; } declare namespace FetchIo { class Request { - constructor(method: TMethod, url: TUrl, options: IOptions) + constructor(method: TMethod, url: TUrl, options: Options) - delete: (url: TUrl) => this + delete: (url: TUrl) => this; - get: (url: TUrl) => this + get: (url: TUrl) => this; - head: (url: TUrl) => this + head: (url: TUrl) => this; - options: (url: TUrl) => this + options: (url: TUrl) => this; - post: (url: TUrl) => this + post: (url: TUrl) => this; - put: (url: TUrl) => this + put: (url: TUrl) => this; config(key: string, value: any): this @@ -78,8 +80,8 @@ } class Fetch extends Request { - constructor(options?: IOptions) + constructor(options?: Options) } } -export = FetchIo.Fetch +export = FetchIo.Fetch; From 4b905aa5d1c1035955977b110757e0a7a3059006 Mon Sep 17 00:00:00 2001 From: newraina Date: Tue, 21 Feb 2017 13:31:19 +0800 Subject: [PATCH 168/797] add doc --- fetch.io/index.d.ts | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/fetch.io/index.d.ts b/fetch.io/index.d.ts index 1dad59b79c..94b3c430d4 100644 --- a/fetch.io/index.d.ts +++ b/fetch.io/index.d.ts @@ -38,42 +38,87 @@ constructor(method: TMethod, url: TUrl, options: Options) + /** + * HTTP delete method + */ delete: (url: TUrl) => this; + /** + * HTTP get method + */ get: (url: TUrl) => this; + /** + * HTTP head method + */ head: (url: TUrl) => this; + /** + * HTTP options method + */ options: (url: TUrl) => this; + /** + * HTTP post method + */ post: (url: TUrl) => this; + /** + * HTTP put method + */ put: (url: TUrl) => this; + /** + * Set Options + */ config(key: string, value: any): this config(opts: {[key: string]: any}): this + /** + * Set Header + */ set(key: string, value: any): this set(opts: {[key: string]: any}): this + /** + * Set Content-Type + */ type(type: 'json' | 'form' | 'urlencoded'): this + /** + * Add query string + */ query(object: {[key: string]: any}): this + /** + * Send data + */ send(data: {[key: string]: any}): this + /** + * ppend formData + */ append(key: string, value: string): this + /** + * Get Response directly + */ then(resolve: (value?: Response) => void, reject?: (reason?: any) => void): Promise then(resolve: (value?: Response) => void, reject?: (reason?: any) => void): Promise + /** + * Make Response to JSON + */ json(strict?: boolean): Promise json(strict?: boolean): Promise + /** + * Make Response to string + */ text(): Promise text(): Promise From 8bc9b14ca9db56afb7a7ce7b60a29c93ec165b0d Mon Sep 17 00:00:00 2001 From: Kay Schecker Date: Tue, 21 Feb 2017 08:41:00 +0100 Subject: [PATCH 169/797] 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 58fd78de8c136f3314c9d39b8bfc1d8f4e2f4f88 Mon Sep 17 00:00:00 2001 From: Andrew Nichols Date: Fri, 3 Feb 2017 10:30:52 -0800 Subject: [PATCH 170/797] Added some missing Outlook apis added Diagnostics Object added ewsUrl parameter added displayNewMessageForm added body.getAsync --- office-js/index.d.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/office-js/index.d.ts b/office-js/index.d.ts index dd18c22914..32914e0b66 100644 --- a/office-js/index.d.ts +++ b/office-js/index.d.ts @@ -1793,6 +1793,11 @@ declare namespace Office { */ saveAsync(callback?: (result: AsyncResult) => void, userContext?: any): void; } + export interface Diagnostics { + hostName: string; + hostVersion: string; + OWAView: string; + } export interface EmailAddressDetails { emailAddress: string; displayName: string; @@ -1828,6 +1833,13 @@ declare namespace Office { export interface Appointment extends Item { } export interface Body { + /** + * Returns the current body in a specified format + * @param coercionType The format of the returned body + * @param options Any optional parameters or state data passed to the method + * @param The optional method to call when the getAsync method returns + */ + getAsync(coercionType: CoercionType, options?: any, callback?: (result: AsyncResult) => void): void; /** * Gets a value that indicates whether the content is in HTML or text format * @param tableData A TableData object with the headers and rows @@ -1866,6 +1878,8 @@ declare namespace Office { setAsync(location: string, options?: any, callback?: (result: AsyncResult) => void): void; } export interface Mailbox { + diagnostics: Diagnostics; + ewsUrl: string; item: Item; userProfile: UserProfile; /** @@ -1900,6 +1914,12 @@ declare namespace Office { * @param body The body of the appointment message. The body content is limited to a maximum size of 32 KB */ displayNewAppointmentForm(requiredAttendees: any, optionalAttendees: any, start: Date, end: Date, location: string, resources: string[], subject: string, body: string): void; + /** + * Displays a new message form + * WARNING: This api is not officially released, and may not work on all platforms + * @param options A dictionary containing all values to be filled in for the user in the new form + */ + displayNewMessageForm(options?: any): void; /** * Gets a string that contains a token used to get an attachment or item from an Exchange Server * @param callback The optional method to call when the string is inserted From 295b61890a8d5cf24d8012ea928407d13158525c Mon Sep 17 00:00:00 2001 From: Andrew Nichols Date: Fri, 17 Feb 2017 12:19:04 -0800 Subject: [PATCH 171/797] Update Enums Section --- office-js/index.d.ts | 225 +++++++++++++++++++++++-------------------- 1 file changed, 122 insertions(+), 103 deletions(-) diff --git a/office-js/index.d.ts b/office-js/index.d.ts index 32914e0b66..88307e8dc2 100644 --- a/office-js/index.d.ts +++ b/office-js/index.d.ts @@ -1420,109 +1420,118 @@ declare namespace Office { //////////////////////////////////////////////////////////////// -declare namespace Office.MailboxEnums { - export enum BodyType { - /** - * The body is in HTML format - */ - Html, - /** - * The body is in text format - */ - text - } - export enum EntityType { - /** - * Specifies that the entity is a meeting suggestion - */ - MeetingSuggestion, - /** - * Specifies that the entity is a task suggestion - */ - TaskSuggestion, - /** - * Specifies that the entity is a postal address - */ - Address, - /** - * Specifies that the entity is SMTP email address - */ - EmailAddress, - /** - * Specifies that the entity is an Internet URL - */ - Url, - /** - * Specifies that the entity is US phone number - */ - PhoneNumber, - /** - * Specifies that the entity is a contact - */ - Contact - } - export enum ItemType { - /** - * A meeting request, response, or cancellation - */ - Message, - /** - * Specifies an appointment item - */ - Appointment - } - export enum ResponseType { - /** - * There has been no response from the attendee - */ - None, - /** - * The attendee is the meeting organizer - */ - Organizer, - /** - * The meeting request was tentatively accepted by the attendee - */ - Tentative, - /** - * The meeting request was accepted by the attendee - */ - Accepted, - /** - * The meeting request was declined by the attendee - */ - Declined - } - export enum RecipientType { - /** - * Specifies that the recipient is not one of the other recipient types - */ - Other, - /** - * Specifies that the recipient is a distribution list containing a list of email addresses - */ - DistributionList, - /** - * Specifies that the recipient is an SMTP email address that is on the Exchange server - */ - User, - /** - * Specifies that the recipient is an SMTP email address that is not on the Exchange server - */ - ExternalUser - } - export enum AttachmentType { - /** - * The attachment is a file - */ - File, - /** - * The attachment is an Exchange item - */ - Item - } -} declare namespace Office { + export module MailboxEnums { + export enum AttachmentType { + /** + * The attachment is a file + */ + File, + /** + * The attachment is an Exchange item + */ + Item + } + export enum EntityType { + /** + * Specifies that the entity is a meeting suggestion + */ + MeetingSuggestion, + /** + * Specifies that the entity is a task suggestion + */ + TaskSuggestion, + /** + * Specifies that the entity is a postal address + */ + Address, + /** + * Specifies that the entity is SMTP email address + */ + EmailAddress, + /** + * Specifies that the entity is an Internet URL + */ + Url, + /** + * Specifies that the entity is US phone number + */ + PhoneNumber, + /** + * Specifies that the entity is a contact + */ + Contact + } + export enum ItemNotificationMessageType { + /** + * The notificationMessage is a progress indicator. + */ + ProgressIndicator, + /** + * The notificationMessage is an informational message. + */ + InformationalMessage, + /** + * The notificationMessage is an error message. + */ + ErrorMessage + } + export enum ItemType { + /** + * A meeting request, response, or cancellation + */ + Message, + /** + * Specifies an appointment item + */ + Appointment + } + export enum ResponseType { + /** + * There has been no response from the attendee + */ + None, + /** + * The attendee is the meeting organizer + */ + Organizer, + /** + * The meeting request was tentatively accepted by the attendee + */ + Tentative, + /** + * The meeting request was accepted by the attendee + */ + Accepted, + /** + * The meeting request was declined by the attendee + */ + Declined + } + export enum RecipientType { + /** + * Specifies that the recipient is not one of the other recipient types + */ + Other, + /** + * Specifies that the recipient is a distribution list containing a list of email addresses + */ + DistributionList, + /** + * Specifies that the recipient is an SMTP email address that is on the Exchange server + */ + User, + /** + * Specifies that the recipient is an SMTP email address that is not on the Exchange server + */ + ExternalUser + } + export enum RestVersion { + v1_0, + v2_0, + Beta + } + } export module Types { export interface ItemRead extends Office.Item { subject: any; @@ -1747,6 +1756,16 @@ declare namespace Office { function toItemRead(item: Office.Item): Office.Types.ItemRead; } } + export enum SourceProperty { + /** + * The source of the data is from the body of the message. + */ + Body, + /** + * The source of the data is from the subject of the message. + */ + Subject + } export interface AttachmentDetails { attachmentType: Office.MailboxEnums.AttachmentType; contentType: string; @@ -2092,7 +2111,7 @@ declare module OfficeExtension { requestHeaders: { [name: string]: string }; /** Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ - load(object: ClientObject, option?: string | string[]| LoadOption): void; + load(object: ClientObject, option?: string | string[] | LoadOption): void; /** * Queues up a command to recursively load the specified properties of the object and its navigation properties. From cba070ff1856758f3e6d8e6a0e0a9427a960db50 Mon Sep 17 00:00:00 2001 From: Andrew Nichols Date: Fri, 17 Feb 2017 12:36:02 -0800 Subject: [PATCH 172/797] Move identifier types out of types --- office-js/index.d.ts | 434 +++++++++++++++++++++---------------------- 1 file changed, 216 insertions(+), 218 deletions(-) diff --git a/office-js/index.d.ts b/office-js/index.d.ts index 88307e8dc2..7cbad245f0 100644 --- a/office-js/index.d.ts +++ b/office-js/index.d.ts @@ -1532,228 +1532,16 @@ declare namespace Office { Beta } } - export module Types { - export interface ItemRead extends Office.Item { - subject: any; - /** - * Displays a reply form that includes the sender and all the recipients of the selected message - * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - */ - displayReplyAllForm(htmlBody: string): void; - /** - * Displays a reply form that includes only the sender of the selected message - * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - */ - displayReplyForm(htmlBody: string): void; - /** - * Gets an array of entities found in an message - */ - getEntities(): Office.Entities; - /** - * Gets an array of entities of the specified entity type found in an message - * @param entityType One of the EntityType enumeration values - */ - getEntitiesByType(entityType: Office.MailboxEnums.EntityType): Office.Entities; - /** - * Returns well-known entities that pass the named filter defined in the manifest XML file - * @param name A TableData object with the headers and rows - */ - getFilteredEntitiesByName(name: string): Office.Entities; - /** - * Returns string values in the currently selected message object that match the regular expressions defined in the manifest XML file - */ - getRegExMatches(): string[]; - /** - * Returns string values that match the named regular expression defined in the manifest XML file - */ - getRegExMatchesByName(name: string): string[]; - } - export interface ItemCompose extends Office.Item { - body: Office.Body; - subject: any; - /** - * Adds a file to a message as an attachment - * @param uri The URI that provides the location of the file to attach to the message. The maximum length is 2048 characters - * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message - * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters - * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Removes an attachment from a message - * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - removeAttachmentAsync(attachmentIndex: string, option?: any, callback?: (result: AsyncResult) => void): void; - } - export interface MessageCompose extends Office.Message { - attachments: Office.AttachmentDetails[]; - body: Office.Body; - bcc: Office.Recipients; - cc: Office.Recipients; - subject: Office.Subject; - to: Office.Recipients; - /** - * Adds a file to a message as an attachment - * @param uri The URI that provides the location of the file to attach to the message. The maximum length is 2048 characters - * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message - * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters - * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Removes an attachment from a message - * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - removeAttachmentAsync(attachmentIndex: string, option?: any, callback?: (result: AsyncResult) => void): void; - } - export interface MessageRead extends Office.Message { - cc: Office.EmailAddressDetails[]; - from: Office.EmailAddressDetails; - internetMessageId: string; - normalizedSubject: string; - sender: Office.EmailAddressDetails; - subject: string; - to: Office.EmailAddressDetails; - /** - * Displays a reply form that includes the sender and all the recipients of the selected message - * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - */ - displayReplyAllForm(htmlBody: string): void; - /** - * Displays a reply form that includes only the sender of the selected message - * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - */ - displayReplyForm(htmlBody: string): void; - /** - * Gets an array of entities found in an message - */ - getEntities(): Office.Entities; - /** - * Gets an array of entities of the specified entity type found in an message - * @param entityType One of the EntityType enumeration values - */ - getEntitiesByType(entityType: Office.MailboxEnums.EntityType): Office.Entities; - /** - * Returns well-known entities that pass the named filter defined in the manifest XML file - * @param name A TableData object with the headers and rows - */ - getFilteredEntitiesByName(name: string): Office.Entities; - /** - * Returns string values in the currently selected message object that match the regular expressions defined in the manifest XML file - */ - getRegExMatches(): string[]; - /** - * Returns string values that match the named regular expression defined in the manifest XML file - */ - getRegExMatchesByName(name: string): string[]; - } - export interface AppointmentCompose extends Office.Appointment { - body: Office.Body; - end: Office.Time; - location: Office.Location; - optionalAttendees: Office.Recipients; - requiredAttendees: Office.Recipients; - start: Office.Time; - subject: Office.Subject; - /** - * Adds a file to an appointment as an attachment - * @param uri The URI that provides the location of the file to attach to the appointment. The maximum length is 2048 characters - * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the appointment - * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters - * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Removes an attachment from a appointment - * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - removeAttachmentAsync(attachmentIndex: string, option?: any, callback?: (result: AsyncResult) => void): void; - } - export interface AppointmentRead extends Office.Appointment { - attachments: Office.AttachmentDetails[]; - end: Date; - location: string; - normalizedSubject: string; - optionalAttendees: Office.EmailAddressDetails; - organizer: Office.EmailAddressDetails; - requiredAttendees: Office.EmailAddressDetails; - resources: string[]; - start: Date; - subject: string; - /** - * Displays a reply form that includes the organizer and all the attendees of the selected appointment item - * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - */ - displayReplyAllForm(htmlBody: string): void; - /** - * Displays a reply form that includes only the organizer of the selected appointment item - * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - */ - displayReplyForm(htmlBody: string): void; - /** - * Gets an array of entities found in an appointment - */ - getEntities(): Office.Entities; - /** - * Gets an array of entities of the specified entity type found in an appointment - * @param entityType One of the EntityType enumeration values - */ - getEntitiesByType(entityType: Office.MailboxEnums.EntityType): Office.Entities; - /** - * Returns well-known entities that pass the named filter defined in the manifest XML file - * @param name A TableData object with the headers and rows - */ - getFilteredEntitiesByName(name: string): Office.Entities; - /** - * Returns string values in the currently selected appointment object that match the regular expressions defined in the manifest XML file - */ - getRegExMatches(): string[]; - /** - * Returns string values that match the named regular expression defined in the manifest XML file - */ - getRegExMatchesByName(name: string): string[]; - } - } export module cast { export module item { - function toAppointmentCompose(item: Office.Item): Office.Types.AppointmentCompose; - function toAppointmentRead(item: Office.Item): Office.Types.AppointmentRead; + function toAppointmentCompose(item: Office.Item): Office.AppointmentCompose; + function toAppointmentRead(item: Office.Item): Office.AppointmentRead; function toAppointment(item: Office.Item): Office.Appointment; - function toMessageCompose(item: Office.Item): Office.Types.MessageCompose; - function toMessageRead(item: Office.Item): Office.Types.MessageRead; + function toMessageCompose(item: Office.Item): Office.MessageCompose; + function toMessageRead(item: Office.Item): Office.MessageRead; function toMessage(item: Office.Item): Office.Message; - function toItemCompose(item: Office.Item): Office.Types.ItemCompose; - function toItemRead(item: Office.Item): Office.Types.ItemRead; + function toItemCompose(item: Office.Item): Office.ItemCompose; + function toItemRead(item: Office.Item): Office.ItemRead; } } export enum SourceProperty { @@ -1849,8 +1637,146 @@ declare namespace Office { */ loadCustomPropertiesAsync(callback?: (result: AsyncResult) => void, userContext?: any): void; } + export interface ItemCompose extends Item { + body: Body; + subject: any; + /** + * Adds a file to a message as an attachment + * @param uri The URI that provides the location of the file to attach to the message. The maximum length is 2048 characters + * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + addFileAttachmentAsync(uri: string, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Adds an Exchange item, such as a message, as an attachment to the message + * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters + * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Removes an attachment from a message + * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + removeAttachmentAsync(attachmentIndex: string, option?: any, callback?: (result: AsyncResult) => void): void; + } + export interface ItemRead extends Item { + subject: any; + /** + * Displays a reply form that includes the sender and all the recipients of the selected message + * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + */ + displayReplyAllForm(htmlBody: string): void; + /** + * Displays a reply form that includes only the sender of the selected message + * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + */ + displayReplyForm(htmlBody: string): void; + /** + * Gets an array of entities found in an message + */ + getEntities(): Entities; + /** + * Gets an array of entities of the specified entity type found in an message + * @param entityType One of the EntityType enumeration values + */ + getEntitiesByType(entityType: Office.MailboxEnums.EntityType): Entities; + /** + * Returns well-known entities that pass the named filter defined in the manifest XML file + * @param name A TableData object with the headers and rows + */ + getFilteredEntitiesByName(name: string): Entities; + /** + * Returns string values in the currently selected message object that match the regular expressions defined in the manifest XML file + */ + getRegExMatches(): string[]; + /** + * Returns string values that match the named regular expression defined in the manifest XML file + */ + getRegExMatchesByName(name: string): string[]; + } export interface Appointment extends Item { } + export interface AppointmentCompose extends Appointment { + body: Body; + end: Time; + location: Location; + optionalAttendees: Recipients; + requiredAttendees: Recipients; + start: Time; + subject: Subject; + /** + * Adds a file to an appointment as an attachment + * @param uri The URI that provides the location of the file to attach to the appointment. The maximum length is 2048 characters + * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + addFileAttachmentAsync(uri: string, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Adds an Exchange item, such as a message, as an attachment to the appointment + * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters + * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Removes an attachment from a appointment + * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + removeAttachmentAsync(attachmentIndex: string, option?: any, callback?: (result: AsyncResult) => void): void; + } + export interface AppointmentRead extends Appointment { + attachments: AttachmentDetails[]; + end: Date; + location: string; + normalizedSubject: string; + optionalAttendees: EmailAddressDetails; + organizer: EmailAddressDetails; + requiredAttendees: EmailAddressDetails; + resources: string[]; + start: Date; + subject: string; + /** + * Displays a reply form that includes the organizer and all the attendees of the selected appointment item + * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + */ + displayReplyAllForm(htmlBody: string): void; + /** + * Displays a reply form that includes only the organizer of the selected appointment item + * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + */ + displayReplyForm(htmlBody: string): void; + /** + * Gets an array of entities found in an appointment + */ + getEntities(): Entities; + /** + * Gets an array of entities of the specified entity type found in an appointment + * @param entityType One of the EntityType enumeration values + */ + getEntitiesByType(entityType: Office.MailboxEnums.EntityType): Entities; + /** + * Returns well-known entities that pass the named filter defined in the manifest XML file + * @param name A TableData object with the headers and rows + */ + getFilteredEntitiesByName(name: string): Entities; + /** + * Returns string values in the currently selected appointment object that match the regular expressions defined in the manifest XML file + */ + getRegExMatches(): string[]; + /** + * Returns string values that match the named regular expression defined in the manifest XML file + */ + getRegExMatchesByName(name: string): string[]; + } export interface Body { /** * Returns the current body in a specified format @@ -1962,6 +1888,78 @@ declare namespace Office { export interface Message extends Item { conversationId: string; } + export interface MessageCompose extends Message { + attachments: AttachmentDetails[]; + body: Body; + bcc: Recipients; + cc: Recipients; + subject: Subject; + to: Recipients; + /** + * Adds a file to a message as an attachment + * @param uri The URI that provides the location of the file to attach to the message. The maximum length is 2048 characters + * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + addFileAttachmentAsync(uri: string, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Adds an Exchange item, such as a message, as an attachment to the message + * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters + * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Removes an attachment from a message + * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + removeAttachmentAsync(attachmentIndex: string, option?: any, callback?: (result: AsyncResult) => void): void; + } + export interface MessageRead extends Message { + cc: EmailAddressDetails[]; + from: EmailAddressDetails; + internetMessageId: string; + normalizedSubject: string; + sender: EmailAddressDetails; + subject: string; + to: EmailAddressDetails; + /** + * Displays a reply form that includes the sender and all the recipients of the selected message + * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + */ + displayReplyAllForm(htmlBody: string): void; + /** + * Displays a reply form that includes only the sender of the selected message + * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + */ + displayReplyForm(htmlBody: string): void; + /** + * Gets an array of entities found in an message + */ + getEntities(): Entities; + /** + * Gets an array of entities of the specified entity type found in an message + * @param entityType One of the EntityType enumeration values + */ + getEntitiesByType(entityType: Office.MailboxEnums.EntityType): Entities; + /** + * Returns well-known entities that pass the named filter defined in the manifest XML file + * @param name A TableData object with the headers and rows + */ + getFilteredEntitiesByName(name: string): Entities; + /** + * Returns string values in the currently selected message object that match the regular expressions defined in the manifest XML file + */ + getRegExMatches(): string[]; + /** + * Returns string values that match the named regular expression defined in the manifest XML file + */ + getRegExMatchesByName(name: string): string[]; + } export interface MeetingRequest extends Message { start: Date; end: Date; From acb1ac9029a9aacf6a014eb94b77075908530095 Mon Sep 17 00:00:00 2001 From: Andrew Nichols Date: Fri, 17 Feb 2017 12:43:16 -0800 Subject: [PATCH 173/797] Alphabatize types --- office-js/index.d.ts | 221 +++++++++++++++++++++---------------------- 1 file changed, 110 insertions(+), 111 deletions(-) diff --git a/office-js/index.d.ts b/office-js/index.d.ts index 7cbad245f0..ebe6042ed2 100644 --- a/office-js/index.d.ts +++ b/office-js/index.d.ts @@ -1554,6 +1554,84 @@ declare namespace Office { */ Subject } + export interface Appointment extends Item { + } + export interface AppointmentCompose extends Appointment, ItemCompose { + body: Body; + end: Time; + location: Location; + optionalAttendees: Recipients; + requiredAttendees: Recipients; + start: Time; + subject: Subject; + /** + * Adds a file to an appointment as an attachment + * @param uri The URI that provides the location of the file to attach to the appointment. The maximum length is 2048 characters + * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + addFileAttachmentAsync(uri: string, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Adds an Exchange item, such as a message, as an attachment to the appointment + * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters + * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Removes an attachment from a appointment + * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + removeAttachmentAsync(attachmentIndex: string, option?: any, callback?: (result: AsyncResult) => void): void; + } + export interface AppointmentRead extends Appointment, ItemRead { + attachments: AttachmentDetails[]; + end: Date; + location: string; + normalizedSubject: string; + optionalAttendees: EmailAddressDetails; + organizer: EmailAddressDetails; + requiredAttendees: EmailAddressDetails; + resources: string[]; + start: Date; + subject: string; + /** + * Displays a reply form that includes the organizer and all the attendees of the selected appointment item + * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + */ + displayReplyAllForm(htmlBody: string): void; + /** + * Displays a reply form that includes only the organizer of the selected appointment item + * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + */ + displayReplyForm(htmlBody: string): void; + /** + * Gets an array of entities found in an appointment + */ + getEntities(): Entities; + /** + * Gets an array of entities of the specified entity type found in an appointment + * @param entityType One of the EntityType enumeration values + */ + getEntitiesByType(entityType: Office.MailboxEnums.EntityType): Entities; + /** + * Returns well-known entities that pass the named filter defined in the manifest XML file + * @param name A TableData object with the headers and rows + */ + getFilteredEntitiesByName(name: string): Entities; + /** + * Returns string values in the currently selected appointment object that match the regular expressions defined in the manifest XML file + */ + getRegExMatches(): string[]; + /** + * Returns string values that match the named regular expression defined in the manifest XML file + */ + getRegExMatchesByName(name: string): string[]; + } export interface AttachmentDetails { attachmentType: Office.MailboxEnums.AttachmentType; contentType: string; @@ -1562,6 +1640,36 @@ declare namespace Office { name: string; size: number; } + export interface Body { + /** + * Returns the current body in a specified format + * @param coercionType The format of the returned body + * @param options Any optional parameters or state data passed to the method + * @param The optional method to call when the getAsync method returns + */ + getAsync(coercionType: CoercionType, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Gets a value that indicates whether the content is in HTML or text format + * @param tableData A TableData object with the headers and rows + * @param options Any optional parameters or state data passed to the method + * @param callback The optional method to call when the getTypeAsync method returns + */ + getTypeAsync(options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Adds the specified content to the beginning of the item body + * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters + * @param options Any optional parameters or state data passed to the method + * @param callback The optional method to call when the string is inserted + */ + prependAsync(data: string, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Replaces the selection in the body with the specified text + * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters + * @param options Any optional parameters or state data passed to the method + * @param callback The optional method to call when the string is inserted + */ + setSelectedDataAsync(data: string, options?: any, callback?: (result: AsyncResult) => void): void; + } export interface Contact { personName: string; businessName: string; @@ -1571,7 +1679,6 @@ declare namespace Office { addresses: string[]; contactString: string; } - export interface Context { mailbox: Mailbox; roamingSettings: RoamingSettings; @@ -1699,114 +1806,6 @@ declare namespace Office { */ getRegExMatchesByName(name: string): string[]; } - export interface Appointment extends Item { - } - export interface AppointmentCompose extends Appointment { - body: Body; - end: Time; - location: Location; - optionalAttendees: Recipients; - requiredAttendees: Recipients; - start: Time; - subject: Subject; - /** - * Adds a file to an appointment as an attachment - * @param uri The URI that provides the location of the file to attach to the appointment. The maximum length is 2048 characters - * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the appointment - * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters - * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Removes an attachment from a appointment - * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - removeAttachmentAsync(attachmentIndex: string, option?: any, callback?: (result: AsyncResult) => void): void; - } - export interface AppointmentRead extends Appointment { - attachments: AttachmentDetails[]; - end: Date; - location: string; - normalizedSubject: string; - optionalAttendees: EmailAddressDetails; - organizer: EmailAddressDetails; - requiredAttendees: EmailAddressDetails; - resources: string[]; - start: Date; - subject: string; - /** - * Displays a reply form that includes the organizer and all the attendees of the selected appointment item - * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - */ - displayReplyAllForm(htmlBody: string): void; - /** - * Displays a reply form that includes only the organizer of the selected appointment item - * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - */ - displayReplyForm(htmlBody: string): void; - /** - * Gets an array of entities found in an appointment - */ - getEntities(): Entities; - /** - * Gets an array of entities of the specified entity type found in an appointment - * @param entityType One of the EntityType enumeration values - */ - getEntitiesByType(entityType: Office.MailboxEnums.EntityType): Entities; - /** - * Returns well-known entities that pass the named filter defined in the manifest XML file - * @param name A TableData object with the headers and rows - */ - getFilteredEntitiesByName(name: string): Entities; - /** - * Returns string values in the currently selected appointment object that match the regular expressions defined in the manifest XML file - */ - getRegExMatches(): string[]; - /** - * Returns string values that match the named regular expression defined in the manifest XML file - */ - getRegExMatchesByName(name: string): string[]; - } - export interface Body { - /** - * Returns the current body in a specified format - * @param coercionType The format of the returned body - * @param options Any optional parameters or state data passed to the method - * @param The optional method to call when the getAsync method returns - */ - getAsync(coercionType: CoercionType, options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Gets a value that indicates whether the content is in HTML or text format - * @param tableData A TableData object with the headers and rows - * @param options Any optional parameters or state data passed to the method - * @param callback The optional method to call when the getTypeAsync method returns - */ - getTypeAsync(options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Adds the specified content to the beginning of the item body - * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional method to call when the string is inserted - */ - prependAsync(data: string, options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Replaces the selection in the body with the specified text - * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional method to call when the string is inserted - */ - setSelectedDataAsync(data: string, options?: any, callback?: (result: AsyncResult) => void): void; - } export interface Location { /** * Begins an asynchronous request for the location of an appointment @@ -1888,7 +1887,7 @@ declare namespace Office { export interface Message extends Item { conversationId: string; } - export interface MessageCompose extends Message { + export interface MessageCompose extends Message, ItemCompose { attachments: AttachmentDetails[]; body: Body; bcc: Recipients; @@ -1919,7 +1918,7 @@ declare namespace Office { */ removeAttachmentAsync(attachmentIndex: string, option?: any, callback?: (result: AsyncResult) => void): void; } - export interface MessageRead extends Message { + export interface MessageRead extends Message, ItemRead { cc: EmailAddressDetails[]; from: EmailAddressDetails; internetMessageId: string; From 22d1a5fe5d59c69a3f8943cf4d391613c1e22bd6 Mon Sep 17 00:00:00 2001 From: Andrew Nichols Date: Fri, 17 Feb 2017 12:52:00 -0800 Subject: [PATCH 174/797] Unify Item types --- office-js/index.d.ts | 232 +++++++++++++++++-------------------------- 1 file changed, 90 insertions(+), 142 deletions(-) diff --git a/office-js/index.d.ts b/office-js/index.d.ts index ebe6042ed2..56dd22589d 100644 --- a/office-js/index.d.ts +++ b/office-js/index.d.ts @@ -1557,80 +1557,20 @@ declare namespace Office { export interface Appointment extends Item { } export interface AppointmentCompose extends Appointment, ItemCompose { - body: Body; end: Time; location: Location; optionalAttendees: Recipients; requiredAttendees: Recipients; start: Time; - subject: Subject; - /** - * Adds a file to an appointment as an attachment - * @param uri The URI that provides the location of the file to attach to the appointment. The maximum length is 2048 characters - * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the appointment - * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters - * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Removes an attachment from a appointment - * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - removeAttachmentAsync(attachmentIndex: string, option?: any, callback?: (result: AsyncResult) => void): void; } export interface AppointmentRead extends Appointment, ItemRead { - attachments: AttachmentDetails[]; end: Date; location: string; - normalizedSubject: string; - optionalAttendees: EmailAddressDetails; + optionalAttendees: Array; organizer: EmailAddressDetails; - requiredAttendees: EmailAddressDetails; - resources: string[]; + requiredAttendees: Array; + resources: EmailAddressDetails; start: Date; - subject: string; - /** - * Displays a reply form that includes the organizer and all the attendees of the selected appointment item - * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - */ - displayReplyAllForm(htmlBody: string): void; - /** - * Displays a reply form that includes only the organizer of the selected appointment item - * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - */ - displayReplyForm(htmlBody: string): void; - /** - * Gets an array of entities found in an appointment - */ - getEntities(): Entities; - /** - * Gets an array of entities of the specified entity type found in an appointment - * @param entityType One of the EntityType enumeration values - */ - getEntitiesByType(entityType: Office.MailboxEnums.EntityType): Entities; - /** - * Returns well-known entities that pass the named filter defined in the manifest XML file - * @param name A TableData object with the headers and rows - */ - getFilteredEntitiesByName(name: string): Entities; - /** - * Returns string values in the currently selected appointment object that match the regular expressions defined in the manifest XML file - */ - getRegExMatches(): string[]; - /** - * Returns string values that match the named regular expression defined in the manifest XML file - */ - getRegExMatchesByName(name: string): string[]; } export interface AttachmentDetails { attachmentType: Office.MailboxEnums.AttachmentType; @@ -1732,11 +1672,9 @@ declare namespace Office { contacts: Contact[]; } export interface Item { - dateTimeCreated: Date; - dateTimeModified: Date; - itemClass: string; - itemId: string; + body: Body; itemType: Office.MailboxEnums.ItemType; + notificationMessages: NotificationMessages; /** * Asynchronously loads custom properties that are specific to the item and a app for Office * @param callback The optional callback method @@ -1745,8 +1683,7 @@ declare namespace Office { loadCustomPropertiesAsync(callback?: (result: AsyncResult) => void, userContext?: any): void; } export interface ItemCompose extends Item { - body: Body; - subject: any; + subject: Subject; /** * Adds a file to a message as an attachment * @param uri The URI that provides the location of the file to attach to the message. The maximum length is 2048 characters @@ -1763,26 +1700,60 @@ declare namespace Office { * @param callback The optional callback method */ addItemAttachmentAsync(itemId: any, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Closes the current item that is being composed + * + * The behaviors of the close method depends on the current state of the item being composed. If the item has unsaved changes, the client + * prompts the user to save, discard, or close the action. + * + * In the Outlook desktop client, if the message is an inline reply, the close method has no effect. + */ + close(): void; + /** + * Asynchronously returns selected data from the subject or body of a message. + * + * If there is no selection but the cursor is in the body or the subject, the method returns null for the selected data. If a field other + * than the body or subject is selected, the method returns the InvalidSelection error + */ + getSelectedDataAsync(coercionType: CoercionType, options?: any, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - removeAttachmentAsync(attachmentIndex: string, option?: any, callback?: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Asynchronously saves an item. + * + * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or + * Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. + */ + saveAsync(options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Asynchronously inserts data into the body or subject of a message. + */ + setSelectedDataAsync(data: string, options?: any, callback?: (result: AsyncResult) => void): void; } export interface ItemRead extends Item { - subject: any; + itemClass: string; + itemId: string; + normalizedSubject: string; + subject: string; /** * Displays a reply form that includes the sender and all the recipients of the selected message - * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + * @param formData A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + * OR + * An object that contains body or attachment data and a callback function */ - displayReplyAllForm(htmlBody: string): void; + displayReplyAllForm(formData: string | FormData): void; /** * Displays a reply form that includes only the sender of the selected message - * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + * @param formData A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB + * OR + * An object that contains body or attachment data and a callback function */ - displayReplyForm(htmlBody: string): void; + displayReplyForm(formData: string | FormData): void; /** * Gets an array of entities found in an message */ @@ -1791,20 +1762,20 @@ declare namespace Office { * Gets an array of entities of the specified entity type found in an message * @param entityType One of the EntityType enumeration values */ - getEntitiesByType(entityType: Office.MailboxEnums.EntityType): Entities; + getEntitiesByType(entityType: Office.MailboxEnums.EntityType): Array<(string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)>; /** * Returns well-known entities that pass the named filter defined in the manifest XML file - * @param name A TableData object with the headers and rows + * @param name The name of the ItemHasKnownEntity rule element that defines the filter to match */ - getFilteredEntitiesByName(name: string): Entities; + getFilteredEntitiesByName(name: string): Array<(string | Contact | MeetingSuggestion | PhoneNumber | TaskSuggestion)>; /** * Returns string values in the currently selected message object that match the regular expressions defined in the manifest XML file */ - getRegExMatches(): string[]; + getRegExMatches(): any; /** * Returns string values that match the named regular expression defined in the manifest XML file */ - getRegExMatchesByName(name: string): string[]; + getRegExMatchesByName(name: string): Array; } export interface Location { /** @@ -1888,76 +1859,16 @@ declare namespace Office { conversationId: string; } export interface MessageCompose extends Message, ItemCompose { - attachments: AttachmentDetails[]; - body: Body; bcc: Recipients; cc: Recipients; - subject: Subject; to: Recipients; - /** - * Adds a file to a message as an attachment - * @param uri The URI that provides the location of the file to attach to the message. The maximum length is 2048 characters - * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Adds an Exchange item, such as a message, as an attachment to the message - * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters - * @param attachmentName The name of the attachment that is shown while the attachment is uploading. The maximum length is 255 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; - /** - * Removes an attachment from a message - * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters - * @param options Any optional parameters or state data passed to the method - * @param callback The optional callback method - */ - removeAttachmentAsync(attachmentIndex: string, option?: any, callback?: (result: AsyncResult) => void): void; } export interface MessageRead extends Message, ItemRead { - cc: EmailAddressDetails[]; + cc: Array; from: EmailAddressDetails; internetMessageId: string; - normalizedSubject: string; sender: EmailAddressDetails; - subject: string; - to: EmailAddressDetails; - /** - * Displays a reply form that includes the sender and all the recipients of the selected message - * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - */ - displayReplyAllForm(htmlBody: string): void; - /** - * Displays a reply form that includes only the sender of the selected message - * @param htmlBody A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB - */ - displayReplyForm(htmlBody: string): void; - /** - * Gets an array of entities found in an message - */ - getEntities(): Entities; - /** - * Gets an array of entities of the specified entity type found in an message - * @param entityType One of the EntityType enumeration values - */ - getEntitiesByType(entityType: Office.MailboxEnums.EntityType): Entities; - /** - * Returns well-known entities that pass the named filter defined in the manifest XML file - * @param name A TableData object with the headers and rows - */ - getFilteredEntitiesByName(name: string): Entities; - /** - * Returns string values in the currently selected message object that match the regular expressions defined in the manifest XML file - */ - getRegExMatches(): string[]; - /** - * Returns string values that match the named regular expression defined in the manifest XML file - */ - getRegExMatchesByName(name: string): string[]; + to: Array; } export interface MeetingRequest extends Message { start: Date; @@ -1974,6 +1885,43 @@ declare namespace Office { start: Date; end: Date; } + export interface NotificationMessage { + type: Office.MailboxEnums.ItemNotificationMessageType; + icon?: string; + message: string; + persistent: Boolean; + } + export interface NotificationMessages { + /** + * Adds a notification to an item + * @param key A developer-specified key used to refrence this notification message. Developers can use it to modify this message later. + * @param JSONmessage A JSON object that contains the notification message to be added to this item + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + addAsync(key: string, JSONmessage: NotificationMessage, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Returns all keys and messages for an item. + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + getAllAsync(options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Removes a notification message for an item. + * @param key The key for the notification message to remove + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + removeAsync(key: string, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Replaces a notification message that has a given key with another message + * @param key The key for the notification message to replace. + * @param JSONmessage A JSON object that contains the new notification message to replace the existing message + * @param options Any optional parameters or state data passed to the method + * @param callback The optional callback method + */ + replaceAsync(key: string, JSONmessage: NotificationMessage, options?: any, callback?: (result: AsyncResult) => void): void; + } export interface PhoneNumber { phoneString: string; originalPhoneString: string; From f3249da859258ea5f13dedaca1424389ee8c1853 Mon Sep 17 00:00:00 2001 From: Andrew Nichols Date: Fri, 17 Feb 2017 13:23:32 -0800 Subject: [PATCH 175/797] update wrong apis --- office-js/index.d.ts | 131 ++++++++++++++++++++++++++++--------------- 1 file changed, 86 insertions(+), 45 deletions(-) diff --git a/office-js/index.d.ts b/office-js/index.d.ts index 56dd22589d..3d3ce60171 100644 --- a/office-js/index.d.ts +++ b/office-js/index.d.ts @@ -52,6 +52,7 @@ declare namespace Office { contentLanguage: string; displayLanguage: string; license: string; + officeTheme: OfficeTheme; touchEnabled: boolean; ui: UI; requirements: { @@ -111,7 +112,12 @@ declare namespace Office { */ xFrameDenySafe?: boolean, } - + export interface OfficeTheme { + bodyBackgroundColor: string; + bodyForegroundColor: string; + controlBackgroundColor: string; + controlForgroundColor: string; + } /** * Dialog object returned as part of the displayDialogAsync callback. The object exposes methods for registering event handlers and closing the dialog */ @@ -1572,6 +1578,16 @@ declare namespace Office { resources: EmailAddressDetails; start: Date; } + export interface AppointmentForm { + requiredAttendees: Array | Array; + optionalAttendees: Array | Array; + start: Date; + end: Date; + location: string; + resources: Array; + subject: string; + body: string; + } export interface AttachmentDetails { attachmentType: Office.MailboxEnums.AttachmentType; contentType: string; @@ -1602,6 +1618,13 @@ declare namespace Office { * @param callback The optional method to call when the string is inserted */ prependAsync(data: string, options?: any, callback?: (result: AsyncResult) => void): void; + /** + * Replaces the entire body with the specified text. + * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters + * @param options Any optional parameters or state data passed to the method + * @param callback the optional method to call when the body is replaced + */ + setAsync(data: string, options?: any, callback?: (result: AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters @@ -1611,13 +1634,12 @@ declare namespace Office { setSelectedDataAsync(data: string, options?: any, callback?: (result: AsyncResult) => void): void; } export interface Contact { - personName: string; + addresses: Array; businessName: string; - phoneNumbers: PhoneNumber[]; - emailAddresses: string[]; - urls: string[]; - addresses: string[]; - contactString: string; + emailAddresses: Array; + personName: string; + phoneNumbers: Array; + urls: Array; } export interface Context { mailbox: Mailbox; @@ -1659,17 +1681,17 @@ declare namespace Office { recipientType: Office.MailboxEnums.RecipientType; } export interface EmailUser { - name: string; - userId: string; + displayName: string; + emailAddress: string; } export interface Entities { - addresses: string[]; - taskSuggestions: string[]; - meetingSuggestions: MeetingSuggestion[]; - emailAddresses: string[]; - urls: string[]; - phoneNumbers: PhoneNumber[]; - contacts: Contact[]; + addresses: Array; + contacts: Array; + emailAddresses: Array; + meetingSuggestions: Array; + phoneNumbers: Array; + taskSuggestions: Array; + urls: Array; } export interface Item { body: Body; @@ -1746,14 +1768,14 @@ declare namespace Office { * OR * An object that contains body or attachment data and a callback function */ - displayReplyAllForm(formData: string | FormData): void; + displayReplyAllForm(formData: string | ReplyFormData): void; /** * Displays a reply form that includes only the sender of the selected message * @param formData A string that contains text and HTML and that represents the body of the reply form. The string is limited to 32 KB * OR * An object that contains body or attachment data and a callback function */ - displayReplyForm(formData: string | FormData): void; + displayReplyForm(formData: string | ReplyFormData): void; /** * Gets an array of entities found in an message */ @@ -1777,6 +1799,16 @@ declare namespace Office { */ getRegExMatchesByName(name: string): Array; } + export interface LocalClientTime { + month: number; + date: number; + year: number; + hours: number; + minutes: number; + seconds: number; + milliseconds: number; + timezoneOffset: number; + } export interface Location { /** * Begins an asynchronous request for the location of an appointment @@ -1797,38 +1829,43 @@ declare namespace Office { ewsUrl: string; item: Item; userProfile: UserProfile; + /** + * Converts an item ID formatted for REST into EWS format. + * @param itemId An item ID formatted for the Outlook REST APIs + * @param restVersion A value indicating the version of the Outlook REST API used to retrieve the item ID + */ + convertToEwsId(itemId: string, restVersion: Office.MailboxEnums.RestVersion): string; /** * Gets a Date object from a dictionary containing time information * @param timeValue A Date object */ - convertToLocalClientTime(timeValue: Date): any; + convertToLocalClientTime(timeValue: Date): LocalClientTime; + /** + * Converts an item ID formatted for EWS into REST format. + * @param itemId An item ID formatted for the Outlook EWS APIs + * @param restVersion A value indicating the version of the Outlook REST API that the converted ID will be used with + */ + convertToRestId(itemId: string, restVersion: Office.MailboxEnums.RestVersion): string; /** * Gets a dictionary containing time information in local client time * @param input A dictionary containing a date. The dictionary should contain the following fields: year, month, date, hours, minutes, seconds, time zone, time zone offset */ - convertToUtcClientTime(input: any): Date; + convertToUtcClientTime(input: LocalClientTime): Date; /** * Displays an existing calendar appointment * @param itemId The Exchange Web Services (EWS) identifier for an existing calendar appointment */ - displayAppointmentForm(itemId: any): void; + displayAppointmentForm(itemId: string): void; /** * Displays an existing message * @param itemId The Exchange Web Services (EWS) identifier for an existing message */ - displayMessageForm(itemId: any): void; + displayMessageForm(itemId: string): void; /** * Displays a form for creating a new calendar appointment - * @param requiredAttendees An array of strings containing the email addresses or an array containing an EmailAddressDetails object for each of the required attendees for the appointment. The array is limited to a maximum of 100 entries - * @param optionalAttendees An array of strings containing the email addresses or an array containing an EmailAddressDetails object for each of the optional attendees for the appointment. The array is limited to a maximum of 100 entries - * @param start A Date object specifying the start date and time of the appointment - * @param end A Date object specifying the end date and time of the appointment - * @param location A string containing the location of the appointment. The string is limited to a maximum of 255 characters - * @param resources An array of strings containing the resources required for the appointment. The array is limited to a maximum of 100 entries - * @param subject A string containing the subject of the appointment. The string is limited to a maximum of 255 characters - * @param body The body of the appointment message. The body content is limited to a maximum size of 32 KB + * @param parameters A dictionary of parameters describing the new appointment. */ - displayNewAppointmentForm(requiredAttendees: any, optionalAttendees: any, start: Date, end: Date, location: string, resources: string[], subject: string, body: string): void; + displayNewAppointmentForm(parameters?: AppointmentForm): void; /** * Displays a new message form * WARNING: This api is not officially released, and may not work on all platforms @@ -1870,20 +1907,13 @@ declare namespace Office { sender: EmailAddressDetails; to: Array; } - export interface MeetingRequest extends Message { - start: Date; - end: Date; - location: string; - optionalAttendees: EmailAddressDetails[]; - requiredAttendees: EmailAddressDetails[]; - } export interface MeetingSuggestion { - meetingString: string; - attendees: EmailAddressDetails[]; + attendees: Array; + end: string; location: string; + meetingstring: string; + start: string; subject: string; - start: Date; - end: Date; } export interface NotificationMessage { type: Office.MailboxEnums.ItemNotificationMessageType; @@ -1934,7 +1964,7 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - addAsync(recipients: any, options?: any, callback?: (result: AsyncResult) => void): void; + addAsync(recipients: Array, options?: any, callback?: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to get the recipient list for an appointment or message * @param options Any optional parameters or state data passed to the method @@ -1947,7 +1977,18 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - setAsync(recipients: any, options?: any, callback?: (result: AsyncResult) => void): void; + setAsync(recipients: Array, options?: any, callback?: (result: AsyncResult) => void): void; + } + export interface ReplyFormAttachment { + type: string; + name: string; + url?: string; + itemId?: string; + } + export interface ReplyFormData { + htmlBody: string; + attachments: Array; + callback: (result: AsyncResult) => void; } export interface RoamingSettings { /** @@ -1988,7 +2029,7 @@ declare namespace Office { setAsync(data: string, options?: any, callback?: (result: AsyncResult) => void): void; } export interface TaskSuggestion { - assignees: EmailUser[]; + assignees: Array; taskString: string; } export interface Time { From 21a102dbf4e1a742a3386d53b8d9600b3aced543 Mon Sep 17 00:00:00 2001 From: Tsvetomir Tsonev Date: Wed, 22 Feb 2017 00:20:38 +0200 Subject: [PATCH 176/797] fix: bring back SizeOptions --- kendo-ui/index.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kendo-ui/index.d.ts b/kendo-ui/index.d.ts index 2d536d5e83..9511f796d6 100644 --- a/kendo-ui/index.d.ts +++ b/kendo-ui/index.d.ts @@ -18738,7 +18738,7 @@ declare namespace kendo.dataviz.geometry { options: SizeOptions; width: number; - height: number; + height: number;SizeOptions static create(width: number, height: number): kendo.geometry.Size; @@ -18753,6 +18753,10 @@ declare namespace kendo.dataviz.geometry { setHeight(value: number): kendo.geometry.Size; } + + interface SizeOptions { + name?: string; + } class Transformation extends Observable { From 36d4db3eeeb97fa7a24152193439d949ed8c36f2 Mon Sep 17 00:00:00 2001 From: Tsvetomir Tsonev Date: Wed, 22 Feb 2017 00:59:39 +0200 Subject: [PATCH 177/797] fix: typo --- kendo-ui/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kendo-ui/index.d.ts b/kendo-ui/index.d.ts index 9511f796d6..86f9624227 100644 --- a/kendo-ui/index.d.ts +++ b/kendo-ui/index.d.ts @@ -18738,7 +18738,7 @@ declare namespace kendo.dataviz.geometry { options: SizeOptions; width: number; - height: number;SizeOptions + height: number; static create(width: number, height: number): kendo.geometry.Size; From 700d3a139d81fb5e7f694aeca54569df37ff0fc6 Mon Sep 17 00:00:00 2001 From: Sean Nolan Date: Wed, 22 Feb 2017 13:11:41 +1300 Subject: [PATCH 178/797] Updated bacbone.marionette to support marionette 3.1.0 Updated tinymce --- backbone.marionette/index.d.ts | 334 ++++++++++----------------------- tinymce/index.d.ts | 172 +++++++++++++++-- 2 files changed, 256 insertions(+), 250 deletions(-) diff --git a/backbone.marionette/index.d.ts b/backbone.marionette/index.d.ts index edaab2c2d6..c9705c53c1 100644 --- a/backbone.marionette/index.d.ts +++ b/backbone.marionette/index.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as Backbone from 'backbone'; +import * as Radio from '../backbone.radio'; export as namespace Marionette; export = Marionette; @@ -22,8 +23,6 @@ declare module 'backbone' { findByIndex(index: number): TView; findByCid(cid: string): TView; remove(view: TView): void; - call(method: any): void; - apply(method: any, args?: any[]): void; //mixins from Collection (copied from Backbone's Collection declaration) @@ -180,6 +179,27 @@ declare namespace Marionette { * backbone conventions and utilities like initialize and Backbone.Events. */ class Object extends Backbone.Events { + + /** + * Defines the Radio channel that will be used for the requests and/or events + */ + channelName: string; + + /** + * Returns a Radio.Channel instance using 'channelName' + */ + getChannel(): Backbone.Radio.Channel; + + /** + * Defines an events hash with the events to be listened and its respective handlers + */ + radioEvents: any; + + /** + * Defines an events hash with the requests to be replied and its respective handlers + */ + radioRequests: any; + /** * Initialize is called immediately after the Object has been instantiated, * and is invoked with the same arguments that the constructor received. @@ -772,12 +792,37 @@ declare namespace Marionette { triggerMethod(name: string, ...args: any[]): any; /** - * Called on the view instance when the view has been rendered and - * displayed. This event can be used to react to when a view has been - * shown via a region. A common use case for the onShow method is to - * use it to add children views. + * Item views will serialize a model or collection, by default, by calling + * .toJSON on either the model or collection. If both a model and + * collection are attached to an item view, the model will be used as the + * data source. The results of the data serialization will be passed to + * the template that is rendered. + * + * If you need custom serialization for your data, you can provide a serializeData + * method on your view. It must return a valid JSON object, as if you had + * called .toJSON on a model or collection. */ - onShow(): void; + serializeData(): any; + + /** + * Renders the view. It is unwise to override the render method of any + * Marionette view. Instead, you should use the onBeforeRender and + * onRender callbacks to layer in additional functionality to the + * rendering of your view. + */ + render(): any; + + /** + * Triggered before an ItemView is rendered. + */ + onBeforeRender(): void; + + /** + * Triggered after the view has been rendered. You can implement this in + * your view to provide custom code for dealing with the view's el after + * it has been rendered. + */ + onRender(): void; /** * Triggered just after the view has been destroyed. @@ -814,49 +859,65 @@ declare namespace Marionette { isDestroyed: boolean; supportsRenderLifecycle: boolean; supportsDestroyLifecycle: boolean; - } - - /** - * An ItemView is a view that represents a single item. That item may be - * a Backbone.Model or may be a Backbone.Collection. Whichever it is though, - * it will be treated as a single item. - */ - class ItemView extends View { - - constructor(options?: Backbone.ViewOptions); /** - * Item views will serialize a model or collection, by default, by calling - * .toJSON on either the model or collection. If both a model and - * collection are attached to an item view, the model will be used as the - * data source. The results of the data serialization will be passed to - * the template that is rendered. - * - * If you need custom serialization for your data, you can provide a serializeData - * method on your view. It must return a valid JSON object, as if you had - * called .toJSON on a model or collection. + * If you have the need to replace the Region with a region class of your + * own implementation, you can specify an alternate class to use with this + * property. */ - serializeData(): any; + regionClass: any; /** - * Renders the view. It is unwise to override the render method of any - * Marionette view. Instead, you should use the onBeforeRender and - * onRender callbacks to layer in additional functionality to the - * rendering of your view. - */ - render(): ItemView; + * Regions hash or a method returning the regions hash that maps + * regions/selectors to methods on your View. + **/ + regions(): any; + + /** Adds a region to the layout view. */ + addRegion(name: string, definition: any): Region; /** - * Triggered before an ItemView is rendered. + * Add multiple regions as a {name: definition, name2: def2} object literal. */ - onBeforeRender(): void; + addRegions(regions: any): any; + + /** Returns a region from the layout view */ + getRegion(name: string): Region; /** - * Triggered after the view has been rendered. You can implement this in - * your view to provide custom code for dealing with the view's el after - * it has been rendered. + * Removes the region with the specified name. + * @param name the name of the region to remove. */ - onRender(): void; + removeRegion(name: string): Region; + + /** Enable easy overriding of the default `RegionManager` + * for customized region interactions and business specific + * view logic for better control over single regions. + */ + getRegionManager(): RegionManager; + + /** + * Show a view into the region specified by `regionName`. + */ + showChildView(regionName: string, view: any, options?: RegionShowOptions): void; + + /** + * Get the current view that is shown in the region specified by + * `regionName`. + */ + getChildView(regionName: string): Backbone.View; + + /** + * Returns all regions from the layout view. The results contains an + * Object hash that has `string`s as keys and `Region`s as values. + */ + getRegions(): {[key: string]: Region}; + + /** + * You can customize the event prefix for events that are forwarded through + * the layout view with this property. + */ + childViewEventPrefix: string; } @@ -928,12 +989,12 @@ declare namespace Marionette { childViewEventPrefix: string; /** - * You can specify a childEvents hash or method which allows you to - * capture all bubbling childEvents without having to manually set bindings. + * You can specify a childViewEvents hash or method which allows you to + * capture all bubbling childViewEvents without having to manually set bindings. * The keys of the hash can either be a function or a string that is the * name of a method on the collection view. */ - childEvents: any; + childViewEvents: any; /** * When a collection has no children, and you need to render a view other than @@ -1034,37 +1095,9 @@ declare namespace Marionette { */ attachHtml(collectionView: CollectionView, childView: TView, index: number): void; - /** - * The value returned by this method is the ChildView class that will be - * instantiated when a Model needs to be initially rendered. This method - * also gives you the ability to customize per Model ChildViews. - */ - getChildView(item: M): new (...args:any[]) => TView; - - /** - * If you need the emptyView's class chosen dynamically, specify - * getEmptyView. - */ - getEmptyView(): any; - /** Serialize a collection by serializing each of its models. */ serializeCollection(): any; - /** - * Attaches the content of a given view. - * This method can be overridden to optimize rendering, - * or to render in a non standard way. - * - * For example, using `innerHTML` instead of `$el.html` - * - * @example - * attachElContent: function(html) { - * this.el.innerHTML = html; - * return this; - * } - */ - attachElContent(html: string): ItemView; - /** * Reorder DOM after sorting. When your element's rendering * do not use their index, you can pass reorderOnSort: true @@ -1132,165 +1165,6 @@ declare namespace Marionette { onRemoveChild(childView: TView): void; } - /** - * A CompositeView extends from CollectionView to be used as a composite view - * for scenarios where it should represent both a branch and leaf in a tree - * structure, or for scenarios where a collection needs to be rendered within - * a wrapper template. - */ - class CompositeView> extends CollectionView { - - constructor(options?: CollectionViewOptions); - - /** - * Each childView will be rendered using the childView's template. The - * CompositeView's template is rendered and the childView's templates are - * added to this. - */ - childView: new (...args:any[]) => TView; - - /** - * By default the composite view uses the same attachHtml method that the - * collection view provides. This means the view will call jQuery's - * .append to move the HTML contents from the child view instance in to - * the collection view's el. - * This is typically not very useful as a composite view will usually render - * a container DOM element in which the child views should be placed. - * This can be either a string or a function returning a string. - */ - childViewContainer: any; - - /** - * Renders the view. - */ - render(): CompositeView; - - /** - * Invoked before the model has been rendered - */ - onBeforeRenderTemplate(): void; - - /** - * Invoked after the model has been rendered. - */ - onRenderTemplate(): void; - - /** - * Invoked before the collection of models is rendered - */ - onBeforeRenderCollection(): void; - - /** - * Invoked after the collection of models has been rendered - */ - onRenderCollection(): void; - } - - interface LayoutViewOptions extends Backbone.ViewOptions { - /** - * The LayoutView takes an additional parameter where you can pass the regions as option on creation. - */ - regions?:any; - - /** - * This option removes the layoutView from the DOM before destroying the - * children preventing repaints as each option is removed. However, it - * makes it difficult to do close animations for a child view (false by - * default) - */ - destroyImmediate?: boolean; - } - - /** - * A LayoutView is a hybrid of an ItemView and a collection of Region objects. - * They are ideal for rendering application layouts with multiple sub-regions - * managed by specified region managers. - * A layoutView can also act as a composite-view to aggregate multiple views - * and sub-application areas of the screen allowing applications to attach - * multiple region managers to dynamically rendered HTML. - * You can create complex views by nesting layoutView managers within Regions. - */ - class LayoutView extends ItemView { - /** - * If you have the need to replace the Region with a region class of your - * own implementation, you can specify an alternate class to use with this - * property. - */ - regionClass: any; - - /** - * Constructor. - * A hash that can contain a regions hash that allows you to specify regions per - * LayoutView instance. - */ - constructor(options?: LayoutViewOptions); - - /** - * Handle destroying regions, and then destroy the view itself. - */ - destroy(): LayoutView; - - /** - * Regions hash or a method returning the regions hash that maps - * regions/selectors to methods on your View. - **/ - regions(): any; - - /** Adds a region to the layout view. */ - addRegion(name: string, definition: any): Region; - - /** - * Add multiple regions as a {name: definition, name2: def2} object literal. - */ - addRegions(regions: any): any; - - /** Returns a region from the layout view */ - getRegion(name: string): Region; - - /** - * Renders the view. It will use the existing region objects the first - * time it is called. Subsequent calls will destroy the views that the - * regions are showing and then reset the `el` for the regions to the - * newly rendered DOM elements. - */ - render(): LayoutView; - - /** - * Removes the region with the specified name. - * @param name the name of the region to remove. - */ - removeRegion(name: string): Region; - - /** Enable easy overriding of the default `RegionManager` - * for customized region interactions and business specific - * view logic for better control over single regions. - */ - getRegionManager(): RegionManager; - - /** - * Show a view into the region specified by `regionName`. - */ - showChildView(regionName: string, view: any, options?: RegionShowOptions): void; - - /** - * Get the current view that is shown in the region specified by - * `regionName`. - */ - getChildView(regionName: string): Backbone.View; - - /** - * Returns all regions from the layout view. The results contains an - * Object hash that has `string`s as keys and `Region`s as values. - */ - getRegions(): {[key: string]: Region}; - - /** - * You can customize the event prefix for events that are forwarded through - * the layout view with this property. - */ - childViewEventPrefix: string; - } - interface AppRouterOptions extends Backbone.RouterOptions { /** * The appRoutes. @@ -1437,7 +1311,7 @@ declare namespace Marionette { options: any; - /** + /** * Behaviors can have their own ui hash, which will be mixed into the ui * hash of its associated View instance. ui elements defined on either the * Behavior or the View will be made available within events and triggers. diff --git a/tinymce/index.d.ts b/tinymce/index.d.ts index f760671a8e..e382910026 100644 --- a/tinymce/index.d.ts +++ b/tinymce/index.d.ts @@ -7,37 +7,169 @@ declare namespace TinyMCE { export interface Observable { - off: (name?: string, callback?: () => void) => any; - on: (name: string, callback: () => void) => any; - fire: (name: string, args?: any, bubble?: boolean) => Event; + off(name?: string, callback?: void): any; + on(name: string, callback: () => void): any; + fire(name: string, args?: any, bubble?: boolean): Event; } export interface Editor extends Observable { - destroy: (automatic: boolean) => void; - remove: () => void; - hide: () => void; - show: () => void; - getContent: (args?: any) => string; - setContent: (content: string, args?: any) => string; - focus: (skip_focus?: boolean) => void; + $: any; + iframeElement: string; + selection: Selection; undoManager: UndoManager; - settings: any; - getDoc: () => Document; - editorUpload: any; + formatter: Formatter; + shortcuts: Shortcuts; + dom: DOMUtils; + notificationManager: NotificationManager; + focus(): void; + getContent(args?: Object): string; + isDirty(): boolean; + insertContent(content: string, args?: any): any; + setContent(content: string, args?: any): any; + reset(): any; + execCommand(command: string, ui?: boolean, value?: any, args?: any): boolean; + remove(): any; + destroy(state?: boolean): void; + getElement(): Element; + getDoc(): Document; + queryCommandSupported(cmd: string): boolean; + getBody(): Element; + setDirty(dirty: boolean): void; + on(eventName: String, handler: Function): void; + addShortcut(pattern: string, desc: string, cmdFunc: string, scope?: any ): boolean; + addButton(name: string, settings: any): void; + addMenuItem(name: string, settings: any): void; + menuItems: any; + initialized: boolean; + } + + export interface Formatter { + remove(name: string): any; + apply(name: string): any; + toggle(name: string): any; + match(name: string, vars?: Object, node?: Node): boolean; + matchAll(names: [string], vars?: Object): [string]; } export interface UndoManager { - undo: () => any; - clear: () => void; - hasUndo: () => boolean; + transact(callback: Function): any; + undo(): any; + redo(): any; + hasRedo(): boolean; + hasUndo(): boolean; + } + + export interface DOMUtils { + DOM: any; + getParent(n: Node, s: string): Node; + setStyle(n: any, na: string, v: string): void; + select(pattern: string, scope ?: Element): Array; + getAttrib(elm: string, name: string, defaultVal ?: string): string; + isEmpty(elements: Object): boolean; + } + + export interface NotificationManager { + getNotifications(): any[]; + open(args: any): any; + close(): any; + } + + export interface Shortcuts { + addShortcut(pattern: string, desc: string, cmdFunc: string, scope?: any): boolean; + remove(pattern: string): boolean; + } + + export interface Collection { + + } + + export interface Container { + add(items: any): Collection; + items(): Collection; + } + + export interface Tooltip { + + } + + export interface Control { + renderTo(node?: Node): void; + innerHtml(html: string): Control; + $el: any; + show(): void; + hide(): void; + visible(state ?: boolean): boolean; + disabled(state: boolean): boolean; + active(state: boolean): boolean; + on(name: string, callback: Function): Control; + parent(parent ?: any): Control; + settings: any; + text(text: string): void; + tooltip(): Tooltip; + } + + export interface Moveable { + moveRel(elm: Node, rel: string): Control; + } + + export interface FloatPanel extends Control, Moveable { + + } + + export interface Menu extends FloatPanel, Control, Container { + + } + + export interface Factory { + create(settings: any): Control; + } + + export interface Tools { + grep(array: any, f: Function): any; + each(o: Object, cb: Function, s?: Object): void; + } + + export interface UI { + Factory: Factory; + Control: Control; + FloatPanel: FloatPanel; + } + + export interface util { + Tools: Tools; + } + + export interface Selection { + getContent(args?: Object): string; + getNode(): any; + getRng(): Range; + collapse(toStart?: boolean): any; + select(node: any, body: boolean): any; + getStart(): any; + getEnd(real ?: boolean): void; + selectorChanged(selector: string, handler: any): void; + getSel(): any; + } + + export interface FocusManager { + isEditorUIElement(elm: Node): boolean; + } + + export interface UI { + Factory: Factory; + Control: Control; + FloatPanel: FloatPanel; } export interface Static extends Observable { - init: (settings: any) => void; - execCommand: (c: string, u: boolean, v: string) => boolean; + init(settings: any): void; + execCommand(c: string, u: boolean, v: string): boolean; activeEditor: Editor; - get: (id: string) => Editor; - triggerSave: () => void; + FocusManager: FocusManager; + get(id: string): Editor; + triggerSave(): void; + ui: UI; + util: util; } } From 44b4d01af14305b1a18f274bb50ef2816ee73754 Mon Sep 17 00:00:00 2001 From: Sean Nolan Date: Wed, 22 Feb 2017 13:16:51 +1300 Subject: [PATCH 179/797] Remove parent relationship --- backbone.marionette/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backbone.marionette/index.d.ts b/backbone.marionette/index.d.ts index c9705c53c1..9fdfd70594 100644 --- a/backbone.marionette/index.d.ts +++ b/backbone.marionette/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as Backbone from 'backbone'; -import * as Radio from '../backbone.radio'; +import * as Radio from 'backbone.radio'; export as namespace Marionette; export = Marionette; From d701bd4a5b05fdb23eb2c23800464bee4885df30 Mon Sep 17 00:00:00 2001 From: Sean Nolan Date: Wed, 22 Feb 2017 14:25:02 +1300 Subject: [PATCH 180/797] Fixed build errors --- .../backbone.marionette-tests.ts | 8 ++--- backbone.marionette/index.d.ts | 2 +- tinymce/index.d.ts | 30 +++++++++---------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/backbone.marionette/backbone.marionette-tests.ts b/backbone.marionette/backbone.marionette-tests.ts index b5eb9d07c6..2c1f5b68bd 100644 --- a/backbone.marionette/backbone.marionette-tests.ts +++ b/backbone.marionette/backbone.marionette-tests.ts @@ -66,11 +66,11 @@ namespace MarionetteTests { let regions: {[key: string]: Marionette.Region} = this.layoutView.getRegions(); let prefix: string = this.layoutView.childViewEventPrefix; let region: Marionette.Region = this.layoutView.removeRegion('main'); - let layout: Marionette.LayoutView = this.layoutView.destroy(); + let layout: Marionette.View = this.layoutView.destroy(); } } - class AppLayoutView extends Marionette.LayoutView { + class AppLayoutView extends Marionette.View { constructor() { super({ el: 'body' }); } @@ -111,7 +111,7 @@ namespace MarionetteTests { } - class MyView extends Marionette.ItemView { + class MyView extends Marionette.View { behaviors: any; constructor(model: MyModel) { @@ -189,7 +189,7 @@ namespace MarionetteTests { constructor() { super(); this.childView = MyView; - this.childEvents = { + this.childViewEvents = { render: function () { console.log("a childView has been rendered"); } diff --git a/backbone.marionette/index.d.ts b/backbone.marionette/index.d.ts index 9fdfd70594..d24f9d64f9 100644 --- a/backbone.marionette/index.d.ts +++ b/backbone.marionette/index.d.ts @@ -770,7 +770,7 @@ declare namespace Marionette { /** * View implements a destroy method, which is called by the region managers automatically. As part of the implementation. */ - destroy(...args: any[]): void; + destroy(...args: any[]): View; /** * In several cases you need to access ui elements inside the view to diff --git a/tinymce/index.d.ts b/tinymce/index.d.ts index e382910026..b393c1c20e 100644 --- a/tinymce/index.d.ts +++ b/tinymce/index.d.ts @@ -7,8 +7,8 @@ declare namespace TinyMCE { export interface Observable { - off(name?: string, callback?: void): any; - on(name: string, callback: () => void): any; + off(name?: string, callback?: void): void; + on(name: string, callback: () => void): void; fire(name: string, args?: any, bubble?: boolean): Event; } @@ -22,7 +22,7 @@ declare namespace TinyMCE { dom: DOMUtils; notificationManager: NotificationManager; focus(): void; - getContent(args?: Object): string; + getContent(args?: any): string; isDirty(): boolean; insertContent(content: string, args?: any): any; setContent(content: string, args?: any): any; @@ -35,7 +35,7 @@ declare namespace TinyMCE { queryCommandSupported(cmd: string): boolean; getBody(): Element; setDirty(dirty: boolean): void; - on(eventName: String, handler: Function): void; + on(eventName: string, handler: () => void): void; addShortcut(pattern: string, desc: string, cmdFunc: string, scope?: any ): boolean; addButton(name: string, settings: any): void; addMenuItem(name: string, settings: any): void; @@ -47,12 +47,12 @@ declare namespace TinyMCE { remove(name: string): any; apply(name: string): any; toggle(name: string): any; - match(name: string, vars?: Object, node?: Node): boolean; - matchAll(names: [string], vars?: Object): [string]; + match(name: string, vars?: any, node?: Node): boolean; + matchAll(names: [string], vars?: any): [string]; } export interface UndoManager { - transact(callback: Function): any; + transact(callback: () => void): any; undo(): any; redo(): any; hasRedo(): boolean; @@ -63,9 +63,9 @@ declare namespace TinyMCE { DOM: any; getParent(n: Node, s: string): Node; setStyle(n: any, na: string, v: string): void; - select(pattern: string, scope ?: Element): Array; + select(pattern: string, scope ?: Element): Element[]; getAttrib(elm: string, name: string, defaultVal ?: string): string; - isEmpty(elements: Object): boolean; + isEmpty(elements: any): boolean; } export interface NotificationManager { @@ -80,7 +80,7 @@ declare namespace TinyMCE { } export interface Collection { - + active():Collection; } export interface Container { @@ -89,7 +89,7 @@ declare namespace TinyMCE { } export interface Tooltip { - + repaint(): void; } export interface Control { @@ -101,7 +101,7 @@ declare namespace TinyMCE { visible(state ?: boolean): boolean; disabled(state: boolean): boolean; active(state: boolean): boolean; - on(name: string, callback: Function): Control; + on(name: string, callback: () => void): Control; parent(parent ?: any): Control; settings: any; text(text: string): void; @@ -125,8 +125,8 @@ declare namespace TinyMCE { } export interface Tools { - grep(array: any, f: Function): any; - each(o: Object, cb: Function, s?: Object): void; + grep(array: any, f: () => void): any; + each(o: Object, cb: () => void, s?: any): void; } export interface UI { @@ -140,7 +140,7 @@ declare namespace TinyMCE { } export interface Selection { - getContent(args?: Object): string; + getContent(args?: any): string; getNode(): any; getRng(): Range; collapse(toStart?: boolean): any; From 648d85936ee669957e5d214e00a5cde7c2a3bf88 Mon Sep 17 00:00:00 2001 From: Sean Nolan Date: Wed, 22 Feb 2017 14:30:33 +1300 Subject: [PATCH 181/797] Fixed build errors --- tinymce/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tinymce/index.d.ts b/tinymce/index.d.ts index b393c1c20e..e6a9374ab4 100644 --- a/tinymce/index.d.ts +++ b/tinymce/index.d.ts @@ -7,7 +7,7 @@ declare namespace TinyMCE { export interface Observable { - off(name?: string, callback?: void): void; + off(name?: string, callback ?: () => void): void; on(name: string, callback: () => void): void; fire(name: string, args?: any, bubble?: boolean): Event; } @@ -80,7 +80,7 @@ declare namespace TinyMCE { } export interface Collection { - active():Collection; + active(): Collection; } export interface Container { @@ -126,7 +126,7 @@ declare namespace TinyMCE { export interface Tools { grep(array: any, f: () => void): any; - each(o: Object, cb: () => void, s?: any): void; + each(o: any, cb: () => void, s?: any): void; } export interface UI { From 616be533ba7a2731b394fe9552933c189e98d10c Mon Sep 17 00:00:00 2001 From: Sander Pick Date: Tue, 21 Feb 2017 19:28:31 -0800 Subject: [PATCH 182/797] Add httpAuth to ConfigOptions --- elasticsearch/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/elasticsearch/index.d.ts b/elasticsearch/index.d.ts index 84c8f281f9..a0606a4961 100644 --- a/elasticsearch/index.d.ts +++ b/elasticsearch/index.d.ts @@ -88,6 +88,7 @@ declare module Elasticsearch { export interface ConfigOptions { host?: any; hosts?: any; + httpAuth?: string; log?: any; apiVersion?: string; plugins?: any; From 5d9e3c19b7daf4f014c4fa296a661c2863507026 Mon Sep 17 00:00:00 2001 From: kolja2 Date: Wed, 22 Feb 2017 12:03:47 +0100 Subject: [PATCH 183/797] @types/openlayers - DragBoxEvent (<=3.18) to DragBox.Event (3.19+) - DragAndDropEvent (<=3.18) to DragAndDrop.Event (3.19+) - DrawEvent (<=3.18) to Draw.Event (3.19+) - ModifyEvent (<=3.18) to Modify.Event (3.19+) --- openlayers/index.d.ts | 332 +++++++++++++++++++++++------------------- 1 file changed, 182 insertions(+), 150 deletions(-) diff --git a/openlayers/index.d.ts b/openlayers/index.d.ts index 8888642fc9..9ef574de3f 100644 --- a/openlayers/index.d.ts +++ b/openlayers/index.d.ts @@ -4761,50 +4761,6 @@ declare module ol { */ function inherits(childCtor: (() => any), parentCtor: (() => any)): void; - /** - * @classdesc - * Events emitted by {@link ol.interaction.DragBox} instances are instances of - * this type. - * - * @param {string} type The event type. - * @param {ol.Coordinate} coordinate The event coordinate. - * @param {ol.MapBrowserEvent} mapBrowserEvent Originating event. - * @extends {ol.events.Event} - * @constructor - * @implements {oli.DragBoxEvent} - */ - class DragBoxEvent extends ol.events.Event { - /** - * @classdesc - * Events emitted by {@link ol.interaction.DragBox} instances are instances of - * this type. - * - * @param {string} type The event type. - * @param {ol.Coordinate} coordinate The event coordinate. - * @param {ol.MapBrowserEvent} mapBrowserEvent Originating event. - * @extends {ol.events.Event} - * @constructor - * @implements {oli.DragBoxEvent} - */ - constructor(type: string, coordinate: ol.Coordinate, mapBrowserEvent: ol.MapBrowserEvent); - - /** - * The coordinate of the drag event. - * @const - * @type {ol.Coordinate} - * @api stable - */ - coordinate: ol.Coordinate; - - /** - * @const - * @type {ol.MapBrowserEvent} - * @api - */ - mapBrowserEvent: ol.MapBrowserEvent; - - } - /** * @namespace ol.interaction */ @@ -4878,19 +4834,9 @@ declare module ol { } /** - * @classdesc - * Events emitted by {@link ol.interaction.DragAndDrop} instances are instances - * of this type. - * - * @constructor - * @extends {ol.events.Event} - * @implements {oli.interaction.DragAndDropEvent} - * @param {ol.interaction.DragAndDropEventType} type Type. - * @param {File} file File. - * @param {Array.=} opt_features Features. - * @param {ol.proj.Projection=} opt_projection Projection. + * @namespace ol.interaction.DragAndDrop */ - class DragAndDropEvent extends ol.events.Event { + module DragAndDrop { /** * @classdesc * Events emitted by {@link ol.interaction.DragAndDrop} instances are instances @@ -4904,28 +4850,44 @@ declare module ol { * @param {Array.=} opt_features Features. * @param {ol.proj.Projection=} opt_projection Projection. */ - constructor(type: ol.interaction.DragAndDropEventType, file: File, opt_features?: ol.Feature[], opt_projection?: ol.proj.Projection); - - /** - * The features parsed from dropped data. - * @type {Array.|undefined} - * @api stable - */ - features: ol.Feature[]; - - /** - * The dropped file. - * @type {File} - * @api stable - */ - file: File; - - /** - * The feature projection. - * @type {ol.proj.Projection|undefined} - * @api - */ - projection: ol.proj.Projection; + class Event extends ol.events.Event { + /** + * @classdesc + * Events emitted by {@link ol.interaction.DragAndDrop} instances are instances + * of this type. + * + * @constructor + * @extends {ol.events.Event} + * @implements {oli.interaction.DragAndDropEvent} + * @param {ol.interaction.DragAndDropEventType} type Type. + * @param {File} file File. + * @param {Array.=} opt_features Features. + * @param {ol.proj.Projection=} opt_projection Projection. + */ + constructor(type: ol.interaction.DragAndDropEventType, file: File, opt_features?: ol.Feature[], opt_projection?: ol.proj.Projection); + + /** + * The features parsed from dropped data. + * @type {Array.|undefined} + * @api stable + */ + features: ol.Feature[]; + + /** + * The dropped file. + * @type {File} + * @api stable + */ + file: File; + + /** + * The feature projection. + * @type {ol.proj.Projection|undefined} + * @api + */ + projection: ol.proj.Projection; + + } } @@ -4977,6 +4939,58 @@ declare module ol { } + /** + * @namespace ol.interaction.DragBox + */ + module DragBox { + /** + * @classdesc + * Events emitted by {@link ol.interaction.DragBox} instances are instances of + * this type. + * + * @param {string} type The event type. + * @param {ol.Coordinate} coordinate The event coordinate. + * @param {ol.MapBrowserEvent} mapBrowserEvent Originating event. + * @extends {ol.events.Event} + * @constructor + * @implements {oli.DragBoxEvent} + */ + class Event extends ol.events.Event { + /** + * @classdesc + * Events emitted by {@link ol.interaction.DragBox} instances are instances of + * this type. + * + * @param {string} type The event type. + * @param {ol.Coordinate} coordinate The event coordinate. + * @param {ol.MapBrowserEvent} mapBrowserEvent Originating event. + * @extends {ol.events.Event} + * @constructor + * @implements {oli.DragBoxEvent} + */ + constructor(type: string, coordinate: ol.Coordinate, mapBrowserEvent: ol.MapBrowserEvent); + + /** + * The coordinate of the drag event. + * @const + * @type {ol.Coordinate} + * @api stable + */ + coordinate: ol.Coordinate; + + /** + * @const + * @type {ol.MapBrowserEvent} + * @api + */ + mapBrowserEvent: ol.MapBrowserEvent; + + } + + } + + type DragBoxEventType = string; + /** * @classdesc * Allows the user to pan the map by dragging the map. @@ -5100,17 +5114,9 @@ declare module ol { } /** - * @classdesc - * Events emitted by {@link ol.interaction.Draw} instances are instances of - * this type. - * - * @constructor - * @extends {ol.events.Event} - * @implements {oli.DrawEvent} - * @param {ol.interaction.DrawEventType} type Type. - * @param {ol.Feature} feature The feature drawn. + * @namespace ol.interaction.Draw */ - class DrawEvent extends ol.events.Event { + module Draw { /** * @classdesc * Events emitted by {@link ol.interaction.Draw} instances are instances of @@ -5122,14 +5128,28 @@ declare module ol { * @param {ol.interaction.DrawEventType} type Type. * @param {ol.Feature} feature The feature drawn. */ - constructor(type: ol.interaction.DrawEventType, feature: ol.Feature); - - /** - * The feature being drawn. - * @type {ol.Feature} - * @api stable - */ - feature: ol.Feature; + class Event extends ol.events.Event { + /** + * @classdesc + * Events emitted by {@link ol.interaction.Draw} instances are instances of + * this type. + * + * @constructor + * @extends {ol.events.Event} + * @implements {oli.DrawEvent} + * @param {ol.interaction.DrawEventType} type Type. + * @param {ol.Feature} feature The feature drawn. + */ + constructor(type: ol.interaction.DrawEventType, feature: ol.Feature); + + /** + * The feature being drawn. + * @type {ol.Feature} + * @api stable + */ + feature: ol.Feature; + + } } @@ -5386,19 +5406,9 @@ declare module ol { } /** - * @classdesc - * Events emitted by {@link ol.interaction.Modify} instances are instances of - * this type. - * - * @constructor - * @extends {ol.events.Event} - * @implements {oli.ModifyEvent} - * @param {ol.ModifyEventType} type Type. - * @param {ol.Collection.} features The features modified. - * @param {ol.MapBrowserPointerEvent} mapBrowserPointerEvent Associated - * {@link ol.MapBrowserPointerEvent}. + * @namespace ol.interaction.Modify */ - class ModifyEvent extends ol.events.Event { + module Modify { /** * @classdesc * Events emitted by {@link ol.interaction.Modify} instances are instances of @@ -5412,21 +5422,37 @@ declare module ol { * @param {ol.MapBrowserPointerEvent} mapBrowserPointerEvent Associated * {@link ol.MapBrowserPointerEvent}. */ - constructor(type: ol.ModifyEventType, features: ol.Collection, mapBrowserPointerEvent: ol.MapBrowserPointerEvent); - - /** - * The features being modified. - * @type {ol.Collection.} - * @api - */ - features: ol.Collection; - - /** - * Associated {@link ol.MapBrowserEvent}. - * @type {ol.MapBrowserEvent} - * @api - */ - mapBrowserEvent: ol.MapBrowserEvent; + class Event extends ol.events.Event { + /** + * @classdesc + * Events emitted by {@link ol.interaction.Modify} instances are instances of + * this type. + * + * @constructor + * @extends {ol.events.Event} + * @implements {oli.ModifyEvent} + * @param {ol.ModifyEventType} type Type. + * @param {ol.Collection.} features The features modified. + * @param {ol.MapBrowserPointerEvent} mapBrowserPointerEvent Associated + * {@link ol.MapBrowserPointerEvent}. + */ + constructor(type: ol.ModifyEventType, features: ol.Collection, mapBrowserPointerEvent: ol.MapBrowserPointerEvent); + + /** + * The features being modified. + * @type {ol.Collection.} + * @api + */ + features: ol.Collection; + + /** + * Associated {@link ol.MapBrowserEvent}. + * @type {ol.MapBrowserEvent} + * @api + */ + mapBrowserEvent: ol.MapBrowserEvent; + + } } @@ -5804,18 +5830,9 @@ declare module ol { } /** - * @classdesc - * Events emitted by {@link ol.interaction.Translate} instances are instances of - * this type. - * - * @constructor - * @extends {ol.events.Event} - * @implements {oli.interaction.TranslateEvent} - * @param {ol.interaction.TranslateEventType} type Type. - * @param {ol.Collection.} features The features translated. - * @param {ol.Coordinate} coordinate The event coordinate. + * @namespace ol.interaction.Translate */ - class TranslateEvent extends ol.events.Event { + module Translate { /** * @classdesc * Events emitted by {@link ol.interaction.Translate} instances are instances of @@ -5828,22 +5845,37 @@ declare module ol { * @param {ol.Collection.} features The features translated. * @param {ol.Coordinate} coordinate The event coordinate. */ - constructor(type: ol.interaction.TranslateEventType, features: ol.Collection, coordinate: ol.Coordinate); - - /** - * The features being translated. - * @type {ol.Collection.} - * @api - */ - features: ol.Collection; - - /** - * The coordinate of the drag event. - * @const - * @type {ol.Coordinate} - * @api - */ - coordinate: ol.Coordinate; + class Event extends ol.events.Event { + /** + * @classdesc + * Events emitted by {@link ol.interaction.Translate} instances are instances of + * this type. + * + * @constructor + * @extends {ol.events.Event} + * @implements {oli.interaction.TranslateEvent} + * @param {ol.interaction.TranslateEventType} type Type. + * @param {ol.Collection.} features The features translated. + * @param {ol.Coordinate} coordinate The event coordinate. + */ + constructor(type: ol.interaction.TranslateEventType, features: ol.Collection, coordinate: ol.Coordinate); + + /** + * The features being translated. + * @type {ol.Collection.} + * @api + */ + features: ol.Collection; + + /** + * The coordinate of the drag event. + * @const + * @type {ol.Coordinate} + * @api + */ + coordinate: ol.Coordinate; + + } } From 4675c9b894925ba2da3ed3cb3f93953032053838 Mon Sep 17 00:00:00 2001 From: Julien CROUZET Date: Wed, 22 Feb 2017 15:28:23 +0100 Subject: [PATCH 184/797] HTTP module of uws (0.13) --- uws/index.d.ts | 13 ++++++++++++- uws/uws-tests.ts | 34 +++++++++++++++++++++++++++++++--- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/uws/index.d.ts b/uws/index.d.ts index 1d6de452c5..07554debda 100644 --- a/uws/index.d.ts +++ b/uws/index.d.ts @@ -5,11 +5,12 @@ /// - +import {Buffer} from 'buffer'; import * as events from 'events'; import * as http from 'http'; import * as https from 'https'; import * as net from 'net'; +import * as stream from 'stream'; declare class WebSocket extends events.EventEmitter { static CONNECTING: number; @@ -151,6 +152,16 @@ declare namespace WebSocket { addListener(event: string, listener: () => void): this; } + export interface UwsHttp { + createServer(requestListener?: (request: http.IncomingMessage, response: http.ServerResponse) => void): http.Server; + // any to avoid express definitions + getExpressApp(express: any): any; + getResponsePrototype(): http.ServerResponse; + getRequestPrototype(): http.IncomingMessage; + } + + export const http: UwsHttp; + export function createServer(options?: IServerOptions, connectionListener?: (client: WebSocket) => void): Server; export function connect(address: string, openListener?: Function): void; diff --git a/uws/uws-tests.ts b/uws/uws-tests.ts index 059f6b224f..5d0b2ed3c6 100644 --- a/uws/uws-tests.ts +++ b/uws/uws-tests.ts @@ -1,11 +1,13 @@ import * as WebSocket from 'uws'; -import * as fs from'fs'; +import {Buffer} from 'buffer'; +import * as http from'http'; import * as https from'https'; +import * as fs from'fs'; const WebSocketServer = WebSocket.Server; const non_ssl = new WebSocketServer({ port: 3000 }); -var non_ssl_disconnections = 0; +let non_ssl_disconnections = 0; non_ssl.on('connection', function(ws) { ws.on('message', function(message) { ws.send(message); @@ -30,7 +32,7 @@ const httpsServer = https.createServer(options, (req: any, res: any) => { const ssl = new WebSocketServer({ server: httpsServer }); -var ssl_disconnections = 0; +let ssl_disconnections = 0; ssl.on('connection', function(ws) { ws.on('message', function(message) { ws.send(message); @@ -44,3 +46,29 @@ ssl.on('connection', function(ws) { }); httpsServer.listen(3001); + +/** + * HTTP module. + */ + +const document: Buffer = Buffer.from('Hello world!'); + +const server: http.Server = WebSocket.http.createServer( + (req: http.IncomingMessage, res: http.ServerResponse): void => { + if (req.method === 'POST') { + const body: Buffer[] = []; + + req.on('data', (chunk: Buffer) => { + body.push(Buffer.from(chunk)); + }).on('end', () => { + res.end('You posted me this: ' + Buffer.concat(body).toString()); + }); + // handle some GET url + } else if (req.url === '/') { + res.end(document); + } else { + res.end('Unknown request by: ' + req.headers['user-agent']); + } +}); + +server.listen(3002); From 5144ef063c414bc0f7a0b94fbbd22eb5461dcb80 Mon Sep 17 00:00:00 2001 From: Julien CROUZET Date: Wed, 22 Feb 2017 15:43:04 +0100 Subject: [PATCH 185/797] Add version in header : 0.13 --- uws/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uws/index.d.ts b/uws/index.d.ts index 07554debda..96cf6788ac 100644 --- a/uws/index.d.ts +++ b/uws/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for µWS +// Type definitions for µWS 0.13 // Project: https://github.com/uWebSockets/uWebSockets // Definitions by: York Yao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From c8901a75b992b3c4b34ef22a8ad3c94caab03c90 Mon Sep 17 00:00:00 2001 From: Julien CROUZET Date: Wed, 22 Feb 2017 15:44:52 +0100 Subject: [PATCH 186/797] Unused imports --- uws/index.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/uws/index.d.ts b/uws/index.d.ts index 96cf6788ac..3f9098a9ef 100644 --- a/uws/index.d.ts +++ b/uws/index.d.ts @@ -5,12 +5,10 @@ /// -import {Buffer} from 'buffer'; import * as events from 'events'; import * as http from 'http'; import * as https from 'https'; import * as net from 'net'; -import * as stream from 'stream'; declare class WebSocket extends events.EventEmitter { static CONNECTING: number; From 4a4f2ba8fdcd7c7e8a262060732fcf463993da21 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Wed, 22 Feb 2017 07:15:53 -0800 Subject: [PATCH 187/797] steed: Lint --- steed/steed-tests.ts | 188 +++++++++++++++++++++---------------------- steed/tslint.json | 2 +- 2 files changed, 95 insertions(+), 95 deletions(-) diff --git a/steed/steed-tests.ts b/steed/steed-tests.ts index 685654cc52..dd89e4480b 100644 --- a/steed/steed-tests.ts +++ b/steed/steed-tests.ts @@ -1,6 +1,6 @@ /// -import steed = require('steed') +import steed = require('steed'); declare var path: { exists: (path: string, callback?: (error: Error, exists: boolean) => any) => void; @@ -10,133 +10,133 @@ function funcStringCbErrBoolean(v: string, cb: (error: Error, res: boolean) => v function callback() { } steed.parallel([ - function () { }, - function () { } + () => {}, + () => {} ], callback); steed.series([ - function () { }, - function () { } + () => {}, + () => {} ]); var data: any[] = []; function steedProcess(item: any, callback: (error: Error, result: any) => void) { } -steed.map(data, steedProcess, function (error, results) { +steed.map(data, steedProcess, (error, results) => { console.log(results); }); var openFiles = ['file1', 'file2']; -var saveFile = function (file: string, cb: (error: Error) => void) { } -steed.each(openFiles, saveFile, function (error: Error) { }); -steed.eachSeries(openFiles, saveFile, function (error: Error) { }); +var saveFile = (file: string, cb: (error: Error) => void) => {}; +steed.each(openFiles, saveFile, (error: Error) => {}); +steed.eachSeries(openFiles, saveFile, (error: Error) => {}); // Control Flow // steed.series([ - function (callback) { + callback => { callback(undefined, 'one'); }, - function (callback) { + callback => { callback(undefined, 'two'); }, ], - function (error, results) { }); + (error, results) => {}); steed.series([ - function (callback) { + callback => { callback(undefined, 'one'); }, - function (callback) { + callback => { callback(undefined, 'two'); }, ], - function (error, results) { }); + (error, results) => {}); steed.series({ - one: function (callback) { - setTimeout(function () { + one(callback) { + setTimeout(() => { callback(undefined, 1); }, 200); }, - two: function (callback) { - setTimeout(function () { + two(callback) { + setTimeout(() => { callback(undefined, 2); }, 100); }, }, - function (error, results) { }); + (error, results) => {}); steed.series({ - one: function (callback) { - setTimeout(function () { + one(callback) { + setTimeout(() => { callback(undefined, 1); }, 200); }, - two: function (callback) { - setTimeout(function () { + two(callback) { + setTimeout(() => { callback(undefined, 2); }, 100); }, }, - function (error, results) { }); + (error, results) => {}); steed.parallel([ - function (callback) { - setTimeout(function () { + callback => { + setTimeout(() => { callback(undefined, 'one'); }, 200); }, - function (callback) { - setTimeout(function () { + callback => { + setTimeout(() => { callback(undefined, 'two'); }, 100); }, ], - function (error, results) { }); + (error, results) => {}); steed.parallel([ - function (callback) { - setTimeout(function () { + callback => { + setTimeout(() => { callback(undefined, 'one'); }, 200); }, - function (callback) { - setTimeout(function () { + callback => { + setTimeout(() => { callback(undefined, 'two'); }, 100); }, ], - function (error, results) { }); + (error, results) => {}); steed.parallel({ - one: function (callback) { - setTimeout(function () { + one(callback) { + setTimeout(() => { callback(undefined, 1); }, 200); }, - two: function (callback) { - setTimeout(function () { + two(callback) { + setTimeout(() => { callback(undefined, 2); }, 100); }, }, - function (error, results) { }); + (error, results) => {}); steed.parallel({ - one: function (callback) { - setTimeout(function () { + one(callback) { + setTimeout(() => { callback(undefined, 1); }, 200); }, - two: function (callback) { - setTimeout(function () { + two(callback) { + setTimeout(() => { callback(undefined, 2); }, 100); }, }, - function (error, results) { }); + (error, results) => {}); function whileFn(callback: any) { count++; @@ -147,100 +147,100 @@ function whileTest() { return count < 5; } var count = 0; steed.waterfall([ - function (callback: any) { + (callback: any) => { callback(null, 'one', 'two'); }, - function (arg1: any, arg2: any, callback: any) { + (arg1: any, arg2: any, callback: any) => { callback(null, 'three'); }, - function (arg1: any, callback: any) { + (arg1: any, callback: any) => { callback(null, 'done'); } -], function (error, result) { }); +], (error, result) => {}); -var q = steed.queue(function (task: any, callback: () => void) { +var q = steed.queue((task: any, callback: () => void) => { console.log('hello ' + task.name); callback(); }, 2); -q.drain = function () { +q.drain = () => { console.log('all items have been processed'); -} +}; q.push({ name: 'foo' }); -q.push({ name: 'bar' }, function (err) { +q.push({ name: 'bar' }, err => { console.log('finished processing bar'); }); -q.push([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (error: Error) { +q.push([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], (error: Error) => { console.log('finished processing bar'); }); q.unshift({ name: 'foo' }); -q.unshift({ name: 'bar' }, function (err) { +q.unshift({ name: 'bar' }, err => { console.log('finished processing bar'); }); -q.unshift([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], function (error: Error) { +q.unshift([{ name: 'baz' }, { name: 'bay' }, { name: 'bax' }], (error: Error) => { console.log('finished processing bar'); }); var qLength: number = q.length(); var qIsIdle: boolean = q.idle(); -q.saturated = function () { +q.saturated = () => { console.log('queue is saturated.'); -} +}; -q.empty = function () { +q.empty = () => { console.log('queue is empty.'); -} +}; -q.drain = function () { +q.drain = () => { console.log('queue was drained.'); -} +}; q.pause(); q.resume(); q.kill(); // tests for strongly typed tasks -var q2 = steed.queue(function (task: string, callback: () => void) { +var q2 = steed.queue((task: string, callback: () => void) => { console.log('Task: ' + task); callback(); }, 1); q2.push('task1'); -q2.push('task2', function (error) { +q2.push('task2', error => { console.log('Finished tasks'); }); -q2.push(['task3', 'task4', 'task5'], function (error: Error) { +q2.push(['task3', 'task4', 'task5'], (error: Error) => { console.log('Finished tasks'); }); q2.unshift('task1'); -q2.unshift('task2', function (error) { +q2.unshift('task2', error => { console.log('Finished tasks'); }); -q2.unshift(['task3', 'task4', 'task5'], function (error: Error) { +q2.unshift(['task3', 'task4', 'task5'], (error: Error) => { console.log('Finished tasks'); }); steed.parallel([ - function (callback: (error: Error, val: string) => void) { }, - function (callback) { } + (callback: (error: Error, val: string) => void) => { }, + callback => {} ], - function (error: Error, results: Array) { + (error: Error, results: string[]) => { steed.series([ - function (callback) { }, + callback => { }, function email_link(callback) { } ]); }); @@ -248,11 +248,11 @@ steed.parallel([ // each steed.each({ - "a": 1, - "b": 2 -}, function (val: number, next: steed.ErrorCallback): void { + a: 1, + b: 2 +}, (val: number, next: steed.ErrorCallback): void => { - setTimeout(function (): void { + setTimeout((): void => { console.log(`steed.each: ${val}`); @@ -260,18 +260,18 @@ steed.each({ }, 500); -}, function (err?: Error): void { +}, (err?: Error): void => { console.log("steed.each: done."); }); steed.eachSeries({ - "a": 1, - "b": 2 -}, function (val: number, next: steed.ErrorCallback): void { + a: 1, + b: 2 +}, (val: number, next: steed.ErrorCallback): void => { - setTimeout(function (): void { + setTimeout((): void => { console.log(`steed.eachSeries: ${val}`); @@ -279,7 +279,7 @@ steed.eachSeries({ }, 500); -}, function (err?: Error): void { +}, (err?: Error): void => { console.log("steed.eachSeries: done."); @@ -288,12 +288,12 @@ steed.eachSeries({ // map steed.map({ - "a": 1, - "b": 2, - "c": 3 -}, function (val: number, next: steed.SteedResultCallback): void { + a: 1, + b: 2, + c: 3 +}, (val: number, next: steed.SteedResultCallback): void => { - setTimeout(function (): void { + setTimeout((): void => { console.log(`steed.map: ${val}`); @@ -301,19 +301,19 @@ steed.map({ }, 500); -}, function (error: Error, results: string[]): void { +}, (error: Error, results: string[]): void => { console.log("steed.map: done with results", results); }); steed.mapSeries({ - "a": 1, - "b": 2, - "c": 3 -}, function (val: number, next: steed.SteedResultCallback): void { + a: 1, + b: 2, + c: 3 +}, (val: number, next: steed.SteedResultCallback): void => { - setTimeout(function (): void { + setTimeout((): void => { console.log(`steed.mapSeries: ${val}`); @@ -321,8 +321,8 @@ steed.mapSeries({ }, 500); -}, function (error: Error, results: string[]): void { +}, (error: Error, results: string[]): void => { console.log("steed.mapSeries: done with results", results); -}); \ No newline at end of file +}); diff --git a/steed/tslint.json b/steed/tslint.json index f05741c59b..0f47deabb4 100644 --- a/steed/tslint.json +++ b/steed/tslint.json @@ -3,4 +3,4 @@ "rules": { "forbidden-types": false } -} +} \ No newline at end of file From 9d913b0229ffc45ac544433d89a4373bcf934e46 Mon Sep 17 00:00:00 2001 From: morrisjdev Date: Wed, 22 Feb 2017 19:05:16 +0100 Subject: [PATCH 188/797] small changes in function definition --- linq4js/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/linq4js/index.d.ts b/linq4js/index.d.ts index e108f31a4c..e6b9084ea3 100644 --- a/linq4js/index.d.ts +++ b/linq4js/index.d.ts @@ -11,9 +11,9 @@ declare namespace Linq4JS { } declare namespace Linq4JS { class Helper { - static ConvertStringFunction: (functionString: string) => any; - static ConvertFunction: (testFunction: any) => T; - static OrderCompareFunction: (valueSelector: (item: T) => any, a: T, b: T, invert: boolean) => number; + private static ConvertStringFunction(functionString); + static ConvertFunction(testFunction: string | T): T; + static OrderCompareFunction(valueSelector: (item: T) => any, a: T, b: T, invert: boolean): number; } } interface Array { @@ -148,7 +148,7 @@ interface Array { Take(count: number): T[]; /** * Takes entries as long as a condition is true - * @param condition The condition-function (or function-string) that returns a boolean. All elements until a false gets created are taken + * @param condition The condition-function (or function-string) that returns a boolean. All elements until a false gets thrown are taken * @param initial A initial-function (or function-string) that gets executed once at the start of the loop * @param after A function that gets executed after every element-iteration after the condition-function was evaluated */ @@ -280,4 +280,4 @@ declare namespace Linq4JS { Ascending = 0, Descending = 1, } -} \ No newline at end of file +} From 018e53711d258dcd5ff296a76d75f6e22d6fd990 Mon Sep 17 00:00:00 2001 From: Simon Soriano Date: Wed, 22 Feb 2017 13:41:00 -0500 Subject: [PATCH 189/797] Update AutoCompleteOptions according to https://developers.google.com/maps/documentation/javascript/reference#AutocompleteOptions --- googlemaps/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/googlemaps/index.d.ts b/googlemaps/index.d.ts index f94b29525c..3bb12e8d24 100644 --- a/googlemaps/index.d.ts +++ b/googlemaps/index.d.ts @@ -2205,6 +2205,8 @@ declare namespace google.maps { export interface AutocompleteOptions { bounds?: LatLngBounds|LatLngBoundsLiteral; componentRestrictions?: ComponentRestrictions; + placeIdOnly?: boolean; + strictBounds?: boolean; types?: string[]; } From e650a40fac972b3412a7e402f40146b13b691fd1 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Thu, 23 Feb 2017 12:14:22 +0100 Subject: [PATCH 190/797] Add definitions for fetch-jsonp (https://github.com/camsong/fetch-jsonp) --- fetch-jsonp/fetch-jsonp-tests.ts | 48 ++++++++++++++++++++++++++++++++ fetch-jsonp/index.d.ts | 15 ++++++++++ fetch-jsonp/tsconfig.json | 19 +++++++++++++ fetch-jsonp/tslint.json | 1 + 4 files changed, 83 insertions(+) create mode 100644 fetch-jsonp/fetch-jsonp-tests.ts create mode 100644 fetch-jsonp/index.d.ts create mode 100644 fetch-jsonp/tsconfig.json create mode 100644 fetch-jsonp/tslint.json diff --git a/fetch-jsonp/fetch-jsonp-tests.ts b/fetch-jsonp/fetch-jsonp-tests.ts new file mode 100644 index 0000000000..058f47e70c --- /dev/null +++ b/fetch-jsonp/fetch-jsonp-tests.ts @@ -0,0 +1,48 @@ +import * as fetchJsonp from 'fetch-jsonp'; + +/* Taken from https://github.com/camsong/fetch-jsonp/blob/v1.0.2/README.md */ + +fetchJsonp('/users.jsonp') + .then(function(response) { + return response.json() + }).then(function(json) { + console.log('parsed json', json) + }).catch(function(ex) { + console.log('parsing failed', ex) + }) + +fetchJsonp('/users.jsonp', { + jsonpCallback: 'custom_callback' + }) + .then(function(response) { + return response.json() + }).then(function(json) { + console.log('parsed json', json) + }).catch(function(ex) { + console.log('parsing failed', ex) + }) + +fetchJsonp('/users.jsonp', { + timeout: 3000, + jsonpCallback: 'custom_callback' + }) + .then(function(response) { + return response.json() + }).then(function(json) { + console.log('parsed json', json) + }).catch(function(ex) { + console.log('parsing failed', ex) + }) + +// Taken from https://github.com/camsong/fetch-jsonp/blob/v1.0.2/examples/index.html +var result = fetchJsonp('http://www.flickr.com/services/feeds/photos_public.gne?format=json', { + jsonpCallback: 'jsoncallback', + timeout: 3000 +}) +result.then(function(response) { + return response.json() +}).then(function(json) { + document.body.innerHTML = JSON.stringify(json); +})['catch'](function(ex) { + document.body.innerHTML = 'failed:' + ex; +}) diff --git a/fetch-jsonp/index.d.ts b/fetch-jsonp/index.d.ts new file mode 100644 index 0000000000..99867cdda2 --- /dev/null +++ b/fetch-jsonp/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for fetch-jsonp 1.0 +// Project: https://github.com/camsong/fetch-jsonp +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare namespace fetchJsonp { + interface Options { + timeout?: number; + jsonpCallback?: string; + } +} + +declare function fetchJsonp(url: RequestInfo, options?: fetchJsonp.Options): Promise; + +export = fetchJsonp; diff --git a/fetch-jsonp/tsconfig.json b/fetch-jsonp/tsconfig.json new file mode 100644 index 0000000000..0aaee7fbf4 --- /dev/null +++ b/fetch-jsonp/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "lib": ["es6", "dom"], + "noUnusedLocals": true, + "noUnusedParameters": true, + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "fetch-jsonp-tests.ts" + ] +} diff --git a/fetch-jsonp/tslint.json b/fetch-jsonp/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/fetch-jsonp/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From d69515099e629fdde9a9b5e5cdec50608427cd2a Mon Sep 17 00:00:00 2001 From: Julien CROUZET Date: Thu, 23 Feb 2017 12:25:35 +0100 Subject: [PATCH 191/797] mu to u --- uws/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uws/index.d.ts b/uws/index.d.ts index 3f9098a9ef..89578fc22d 100644 --- a/uws/index.d.ts +++ b/uws/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for µWS 0.13 +// Type definitions for uWS 0.13 // Project: https://github.com/uWebSockets/uWebSockets // Definitions by: York Yao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From b33b361bba6c18b4ce91b1f825bab4198c5be528 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Thu, 23 Feb 2017 12:41:41 +0100 Subject: [PATCH 192/797] Add "module": "commonjs" --- fetch-jsonp/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/fetch-jsonp/tsconfig.json b/fetch-jsonp/tsconfig.json index 0aaee7fbf4..05c3f994ed 100644 --- a/fetch-jsonp/tsconfig.json +++ b/fetch-jsonp/tsconfig.json @@ -3,6 +3,7 @@ "baseUrl": "../", "typeRoots": ["../"], "types": [], + "module": "commonjs", "lib": ["es6", "dom"], "noUnusedLocals": true, "noUnusedParameters": true, From df8b672c7a12c28d0cc05401529de547ec607be9 Mon Sep 17 00:00:00 2001 From: Lukas Zech Date: Thu, 23 Feb 2017 12:16:04 +0100 Subject: [PATCH 193/797] Use Partial keyword for objectContaining --- jasmine/index.d.ts | 6 +++--- jasmine/jasmine-tests.ts | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/jasmine/index.d.ts b/jasmine/index.d.ts index e18361dec4..146ab55ad4 100644 --- a/jasmine/index.d.ts +++ b/jasmine/index.d.ts @@ -49,7 +49,7 @@ declare namespace jasmine { function any(aclass: any): Any; function anything(): Any; function arrayContaining(sample: any[]): ArrayContaining; - function objectContaining(sample: any): ObjectContaining; + function objectContaining(sample: Partial): ObjectContaining; function createSpy(name: string, originalFn?: Function): Spy; function createSpyObj(baseName: string, methodNames: any[]): any; function createSpyObj(baseName: string, methodNames: any[]): T; @@ -82,8 +82,8 @@ declare namespace jasmine { jasmineToString(): string; } - interface ObjectContaining { - new (sample: any): any; + interface ObjectContaining { + new (sample: Partial): T; jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean; jasmineToString(): string; diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index 4632eb8b4c..13d80af9db 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -663,7 +663,12 @@ describe("jasmine.any", function () { }); describe("jasmine.objectContaining", function () { - var foo: any; + interface fooType { + a:number; + b:number; + bar:string; + } + var foo: fooType; beforeEach(function () { foo = { @@ -674,11 +679,11 @@ describe("jasmine.objectContaining", function () { }); it("matches objects with the expect key/value pairs", function () { - expect(foo).toEqual(jasmine.objectContaining({ + expect(foo).toEqual(jasmine.objectContaining({ bar: "baz" })); - expect(foo).not.toEqual(jasmine.objectContaining({ - c: 37 + expect(foo).not.toEqual(jasmine.objectContaining({ + a: 37 })); }); From d1a477c46afe174d349d007c1021332d8cfce73c Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Thu, 23 Feb 2017 13:29:09 +0100 Subject: [PATCH 194/797] =?UTF-8?q?Add=20=E2=80=9CTypeScript=20Version:=20?= =?UTF-8?q?2.2=E2=80=9D=20header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fetch-jsonp/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/fetch-jsonp/index.d.ts b/fetch-jsonp/index.d.ts index 99867cdda2..e37094254e 100644 --- a/fetch-jsonp/index.d.ts +++ b/fetch-jsonp/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/camsong/fetch-jsonp // Definitions by: Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 declare namespace fetchJsonp { interface Options { From fe7183b55a5d6ee28b005a5816b6641d05b0dd12 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Thu, 23 Feb 2017 13:57:11 +0100 Subject: [PATCH 195/797] Re-indent a bit + missing ; + missing spaces --- gapi/index.d.ts | 96 ++++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/gapi/index.d.ts b/gapi/index.d.ts index 28d5c990bc..3a4a78ca21 100644 --- a/gapi/index.d.ts +++ b/gapi/index.d.ts @@ -38,7 +38,7 @@ declare namespace gapi { /** * Pragmatically initialize gapi class member. */ - export function load(object: string, fn: any) : any; + export function load(object: string, fn: any): any; } @@ -155,37 +155,37 @@ declare namespace gapi.client { } /** - * Loads the client library interface to a particular API. If a callback is not provided, a promise is returned. - * @param name The name of the API to load. - * @param version The version of the API to load. - * @return promise The promise that get's resolved after the request is finished. - */ - export function load(name: string, version: string): Promise + * Loads the client library interface to a particular API. If a callback is not provided, a promise is returned. + * @param name The name of the API to load. + * @param version The version of the API to load. + * @return promise The promise that get's resolved after the request is finished. + */ + export function load(name: string, version: string): Promise; /** - * Loads the client library interface to a particular API. The new API interface will be in the form gapi.client.api.collection.method. - * @param name The name of the API to load. - * @param version The version of the API to load - * @param callback the function that is called once the API interface is loaded - * @param url optional, the url of your app - if using Google's APIs, don't set it - */ + * Loads the client library interface to a particular API. The new API interface will be in the form gapi.client.api.collection.method. + * @param name The name of the API to load. + * @param version The version of the API to load + * @param callback the function that is called once the API interface is loaded + * @param url optional, the url of your app - if using Google's APIs, don't set it + */ export function load(name: string, version: string, callback: () => any, url?: string): void; /** - * Creates a HTTP request for making RESTful requests. - * An object encapsulating the various arguments for this method. - */ + * Creates a HTTP request for making RESTful requests. + * An object encapsulating the various arguments for this method. + */ export function request(args: RequestOptions): HttpRequest; /** - * Creates an RPC Request directly. The method name and version identify the method to be executed and the RPC params are provided upon RPC creation. - * @param method The method to be executed. - * @param version The version of the API which defines the method to be executed. Defaults to v1 - * @param rpcParams A key-value pair of the params to supply to this RPC - */ + * Creates an RPC Request directly. The method name and version identify the method to be executed and the RPC params are provided upon RPC creation. + * @param method The method to be executed. + * @param version The version of the API which defines the method to be executed. Defaults to v1 + * @param rpcParams A key-value pair of the params to supply to this RPC + */ export function rpcRequest(method: string, version?: string, rpcParams?: any): RpcRequest; /** - * Sets the API key for the application. - * @param apiKey The API key to set - */ + * Sets the API key for the application. + * @param apiKey The API key to set + */ export function setApiKey(apiKey: string): void; /** @@ -210,24 +210,24 @@ declare namespace gapi.client { status: number; statusText: string; } - ) => any):void; - /** + ) => any): void; + /** * HttpRequest supports promises. */ - then(success:(response:{ - result:T; - body:string; + then(success: (response: { + result: T; + body: string; headers?: any[]; status?: number; - statusText?: string - })=>void, - failure:(response:{ - result:T; - body:string; + statusText?: string; + }) => void, + failure: (response: { + result: T; + body: string; headers?: any[]; status?: number; - statusText?: string - })=>void): void; + statusText?: string; + }) => void): void; } /** * Represents an HTTP Batch operation. Individual HTTP requests are added with the add method and the batch is executed using execute. @@ -244,16 +244,16 @@ declare namespace gapi.client { */ id: string; callback: ( - /** - * is the response for this request only. Its format is defined by the API method being called. - */ - individualResponse: any, - /** - * is the raw batch ID-response map as a string. It contains all responses to all requests in the batch. - */ - rawBatchResponse: any - ) => any - }):void; + /** + * is the response for this request only. Its format is defined by the API method being called. + */ + individualResponse: any, + /** + * is the raw batch ID-response map as a string. It contains all responses to all requests in the batch. + */ + rawBatchResponse: any + ) => any + }): void; /** * Executes all requests in the batch. The supplied callback is executed on success or failure. * @param callback The callback to execute when the batch returns. @@ -267,7 +267,7 @@ declare namespace gapi.client { * is the same response, but as an unparsed JSON-string. */ rawBatchResponse: string - ) => any):void; + ) => any): void; } /** @@ -288,7 +288,7 @@ declare namespace gapi.client { * is the same as jsonResp, except it is a raw string that has not been parsed. It is typically used when the response is not JSON. */ rawResp: string - ) => void ):void; + ) => void): void; } } From 318a5c5896c5dbee368d546f904ded23b759d2c6 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Thu, 23 Feb 2017 14:01:24 +0100 Subject: [PATCH 196/797] Better gapi.load --- gapi/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gapi/index.d.ts b/gapi/index.d.ts index 3a4a78ca21..84da600e7b 100644 --- a/gapi/index.d.ts +++ b/gapi/index.d.ts @@ -38,7 +38,7 @@ declare namespace gapi { /** * Pragmatically initialize gapi class member. */ - export function load(object: string, fn: any): any; + export function load(apiName: string, callback: () => void): void; } From 584697f34ced45ab1bd6757eedbaa6e4687eb7d5 Mon Sep 17 00:00:00 2001 From: Maksim Kozhukh Date: Thu, 23 Feb 2017 17:50:09 +0300 Subject: [PATCH 197/797] [update] updated for Webix 4.2 --- webix/index.d.ts | 70 ++++++++++++++++++++++++++++++++------------ webix/webix-tests.ts | 2 +- 2 files changed, 53 insertions(+), 19 deletions(-) diff --git a/webix/index.d.ts b/webix/index.d.ts index f441a2da8d..4ab2039fc9 100644 --- a/webix/index.d.ts +++ b/webix/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Webix UI 4.1 +// Type definitions for Webix UI 4.2 // Project: http://webix.com // Definitions by: Maksim Kozhukh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -212,7 +212,7 @@ function message(content:any):void; function modalbox(text:string, callback:WebixCallback):HTMLElement; function once(code:WebixCallback):void; function proto(target:any, ...mixins:any[]):any; -function protoUI(target:any, view:any, mixins:any):any; +function protoUI(target:any, ...mixins: any[]):any; function proxy(type:string, source:string):any; function ready(code:WebixCallback):void; function remote():void; @@ -221,6 +221,7 @@ function send(url:string, values:any, method:string, target:string):void; function single(source:WebixCallback):WebixCallback; function template(template:string):WebixCallback; function toArray(array:any[]):any[]; +function toCSV(id:any, options:any):void; function toExcel(id:any, options:any):void; function toFunctor(name:string):WebixCallback; function toNode(id:string):HTMLElement; @@ -371,6 +372,7 @@ interface DataCollection{ validate(id?:string):boolean; config: { [key: string]: any; }; name: string; + waitData: webix.promise; } interface DataDriver{ @@ -406,6 +408,7 @@ interface DataLoader{ sort(by:string, dir?:string, as?:string):void; sync(source:any, filter:WebixCallback, silent:boolean):void; updateItem(id:string|number, data:any):void; + waitData: webix.promise; } var DataLoader:DataLoader; interface DataMarks{ @@ -832,11 +835,9 @@ interface TreeCollection{ loadBranch(id:string|number, callback:WebixCallback, url:string):void; loadNext(count:number, start:number, callback:WebixCallback, url:string, now:boolean):void; mapEvent(map:any):void; - move(sid:string, tindex:number, tobj?:any, details?:any):string; + move(sid:string|number, tindex:number, tobj?:webix.ui.baseview, details?:any):string|number; moveBottom(id:string|number):void; - moveDown(id:string|number, step:number):void; moveTop(id:string|number):void; - moveUp(id:string|number, step:number):void; parse(data:any, type:string):void; refresh(id?:string|number):void; refreshCursor():void; @@ -854,6 +855,7 @@ interface TreeCollection{ validate(id?:string):boolean; config: { [key: string]: any; }; name: string; + waitData: webix.promise; } var TreeCollection:TreeCollection; interface TreeDataLoader{ @@ -1245,6 +1247,7 @@ class proto implements webix.ui.baseview{ name: string; type: { [key: string]: any; }; types: { [key: string]: any; }; + waitData: webix.promise; } interface resizeareaConfig{ view?: string; @@ -1562,6 +1565,7 @@ interface buttonConfig{ align?: string; animate?: any; autowidth?: boolean; + badge?: number|string; borderless?: boolean; click?: WebixCallback; container?: string|HTMLElement; @@ -1572,6 +1576,7 @@ interface buttonConfig{ hidden?: boolean; hotkey?: string; id?: string|number; + image?: string; inputHeight?: number; inputWidth?: number; label?: string; @@ -1950,6 +1955,7 @@ class chart implements webix.ui.baseview{ on_dblclick: WebixCallback; on_mouse_move: WebixCallback; presets: { [key: string]: any; }; + waitData: webix.promise; } interface checkboxConfig{ view?: string; @@ -2593,7 +2599,7 @@ interface contextmenuConfig{ yCount?: number; zIndex?: number; } -type contextmenuEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|''|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|''|'onBeforeDropOut'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSelect'|'onBeforeShow'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onFocus'|'onHide'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMenuItemClick'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onPaste'|'onSelectChange'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; +type contextmenuEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|'onAfterDropOrder'|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDropOrder'|'onBeforeDropOut'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSelect'|'onBeforeShow'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onFocus'|'onHide'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMenuItemClick'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onPaste'|'onSelectChange'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; class contextmenu implements webix.ui.baseview{ add(obj:any, index?:number):string|number; addCss(id:string|number, css:string, silent?:boolean):void; @@ -2711,6 +2717,7 @@ class contextmenu implements webix.ui.baseview{ on_mouse_move: WebixCallback; type: { [key: string]: any; }; types: { [key: string]: any; }; + waitData: webix.promise; } interface counterConfig{ view?: string; @@ -2927,6 +2934,7 @@ interface datatableConfig{ container?: string|HTMLElement; css?: string; data?: string|any[]; + dataFeed?: string|WebixCallback; datafetch?: number; datathrottle?: number; datatype?: string; @@ -3047,7 +3055,7 @@ class datatable implements webix.ui.baseview{ getChildViews():any[]; getColumnConfig(id:string):any; getColumnIndex(id:string|number):number; - getCss():void; + getCss(rowId:string|number, columnId:string|number):string; getEditState():any; getEditor(row?:any, column?:string|number):any; getEditorValue():string; @@ -3107,6 +3115,7 @@ class datatable implements webix.ui.baseview{ refreshColumns(config?:any[], reset?:boolean):void; refreshFilter(id:string|number):void; refreshHeaderContent():void; + refreshSelectArea():void; registerFilter(object:any, config:any, controller:any):void; remove(id:string|number):void; removeCellCss(id:string, name:string, css_name:string):void; @@ -3799,6 +3808,7 @@ interface filemanagerConfig{ minWidth?: number; mode?: string; modes?: any[]; + noFileCache?: boolean; on?: EventHash; padding?: number; paddingX?: number; @@ -3823,7 +3833,7 @@ interface filemanagerConfig{ visibleBatch?: string; width?: number; } -type filemanagerEventName ='onAfterAdd'|'onAfterDelete'|'onAfterDrop'|'onAfterEditStop'|'onAfterHideTree'|'onAfterLevelDown'|'onAfterLoad'|'onAfterRun'|'onAfterShowTree'|'onAfterSort'|'onBeforeAdd'|'onBeforeCreateFolder'|'onBeforeDelete'|'onBeforeDeleteFile'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeEditFile'|'onBeforeEditStop'|'onBeforeHideTree'|'onBeforeLevelDown'|'onBeforeLoad'|'onBeforeMarkCopy'|'onBeforeMarkCut'|'onBeforePasteFile'|'onBeforeRun'|'onBeforeShowTree'|'onBeforeSort'|'onBeforeUploadFile'|'onBindRequest'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onErrorResponse'|'onFolderSelect'|'onHideSearchResults'|'onItemRename'|'onLoadError'|'onSuccessResponse'|'onViewInit'; +type filemanagerEventName ='onAfterAdd'|'onAfterBack'|'onAfterDelete'|'onAfterDrop'|'onAfterDynParse'|'onAfterEditStop'|'onAfterHideTree'|'onAfterLevelDown'|'onAfterLevelUp'|'onAfterLoad'|'onAfterMenu'|'onAfterModeChange'|'onAfterPathClick'|'onAfterRun'|'onAfterSearch'|'onAfterShowTree'|'onAfterSort'|'onBeforeAdd'|'onBeforeBack'|'onBeforeCreateFolder'|'onBeforeDelete'|'onBeforeDeleteFile'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDynLoad'|'onBeforeDynParse'|'onBeforeEditFile'|'onBeforeEditStop'|'onBeforeFileUpload'|'onBeforeHideTree'|'onBeforeLevelDown'|'onBeforeLevelUp'|'onBeforeLoad'|'onBeforeMarkCopy'|'onBeforeMarkCut'|'onBeforeMenu'|'onBeforeModeChange'|'onBeforePasteFile'|'onBeforeRequest'|'onBeforeRun'|'onBeforeSearch'|'onBeforeSearchRequest'|'onBeforeShowTree'|'onBeforeSort'|'onBindRequest'|'onComponentInit'|'onCopyError'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDynLoadError'|'onErrorResponse'|'onFolderSelect'|'onHideSearchResults'|'onHistoryChange'|'onItemRename'|'onItemSelect'|'onLoadError'|'onMoveError'|'onPathComplete'|'onPathLevel'|'onShowSearchResults'|'onSuccessResponse'|'onViewInit'; class filemanager implements webix.ui.baseview{ add(obj:any, index?:number):string|number; addView(view:any, index?:number):webix.ui.baseview; @@ -3930,6 +3940,7 @@ class filemanager implements webix.ui.baseview{ $width: number; config: filemanagerConfig; name: string; + waitData: webix.promise; } interface formConfig{ view?: string; @@ -4107,6 +4118,7 @@ interface googleMapConfig{ datatype?: string; disabled?: boolean; gravity?: number; + heatmapConfig?: any; height?: number; hidden?: boolean; id?: string|number; @@ -4186,6 +4198,7 @@ class googleMap implements webix.ui.baseview{ $width: number; config: googleMapConfig; name: string; + waitData: webix.promise; } interface gridsuggestConfig{ view?: string; @@ -4442,6 +4455,7 @@ class grouplist implements webix.ui.baseview{ on_mouse_move: WebixCallback; type: { [key: string]: any; }; types: { [key: string]: any; }; + waitData: webix.promise; } interface headerlayoutConfig{ view?: string; @@ -4780,7 +4794,7 @@ interface kanbanConfig{ visibleBatch?: string; width?: number; } -type kanbanEventName ='onAfterAdd'|'onAfterCollapse'|'onAfterDelete'|'onAfterExpand'|'onAfterLoad'|'onAfterSort'|'onBeforeAdd'|'onBeforeDelete'|'onBeforeLoad'|'onBeforeSort'|'onBindRequest'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onLoadError'; +type kanbanEventName ='onAfterAdd'|'onAfterCollapse'|'onAfterDelete'|'onAfterExpand'|'onAfterLoad'|'onAfterSort'|'onAfterStatusChange'|'onAvatarClick'|'onBeforeAdd'|'onBeforeDelete'|'onBeforeLoad'|'onBeforeSort'|'onBeforeStatusChange'|'onBindRequest'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onListAfterContextMenu'|'onListAfterDrop'|'onListAfterSelect'|'onListBeforeContextMenu'|'onListBeforeDrag'|'onListBeforeDragIn'|'onListBeforeDrop'|'onListBeforeSelect'|'onListIconClick'|'onListItemClick'|'onListItemDblClick'|'onLoadError'; class kanban implements webix.ui.baseview{ add(obj:any, index?:number):string|number; addView(view:any, index?:number):webix.ui.baseview; @@ -4831,6 +4845,7 @@ class kanban implements webix.ui.baseview{ resizeChildren():void; select(id:string|number):void; serialize():any; + setIndex():void; show(force?:boolean, animation?:boolean):void; showBatch(name:string):void; sort(by:string, dir?:string, as?:string):void; @@ -4847,6 +4862,7 @@ class kanban implements webix.ui.baseview{ $width: number; config: kanbanConfig; name: string; + waitData: webix.promise; } interface labelConfig{ view?: string; @@ -5154,6 +5170,7 @@ class list implements webix.ui.baseview{ on_mouse_move: WebixCallback; type: { [key: string]: any; }; types: { [key: string]: any; }; + waitData: webix.promise; } interface menuConfig{ view?: string; @@ -5211,7 +5228,7 @@ interface menuConfig{ xCount?: number; yCount?: number; } -type menuEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|''|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|''|'onBeforeDropOut'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSelect'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onFocus'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMenuItemClick'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onPaste'|'onSelectChange'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewResize'; +type menuEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|'onAfterDropOrder'|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDropOrder'|'onBeforeDropOut'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSelect'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onFocus'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMenuItemClick'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onPaste'|'onSelectChange'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewResize'; class menu implements webix.ui.baseview{ add(obj:any, index?:number):string|number; addCss(id:string|number, css:string, silent?:boolean):void; @@ -5321,6 +5338,7 @@ class menu implements webix.ui.baseview{ on_mouse_move: WebixCallback; type: { [key: string]: any; }; types: { [key: string]: any; }; + waitData: webix.promise; } interface multicomboConfig{ view?: string; @@ -5972,6 +5990,7 @@ class organogram implements webix.ui.baseview{ on_mouse_move: WebixCallback; type: { [key: string]: any; }; types: { [key: string]: any; }; + waitData: webix.promise; } interface pagerConfig{ view?: string; @@ -6003,7 +6022,7 @@ interface pagerConfig{ template?: string|WebixCallback; width?: number; } -type pagerEventName ='onAfterContextMenu'|'onAfterRender'|'onAfterScroll'|'onBeforeContextMenu'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onItemClick'|'onItemDblClick'|'onKeyPress'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; +type pagerEventName ='onAfterContextMenu'|'onAfterPageChange'|'onAfterRender'|'onAfterScroll'|'onBeforeContextMenu'|'onBeforePageChange'|'onBeforeRender'|'onBindRequest'|'onBlur'|'onDestruct'|'onFocus'|'onItemClick'|'onItemDblClick'|'onKeyPress'|'onLongTouch'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onViewResize'; class pager implements webix.ui.baseview{ adjust():void; attachEvent(type:pagerEventName, functor:WebixCallback, id?:string):string|number; @@ -6137,13 +6156,18 @@ interface pivotConfig{ data?: string|any[]; datatype?: string; disabled?: boolean; + externalProcessing?: boolean; fieldMap?: any; filterLabelAlign?: string; filterLabelWidth?: number; + filterMap?: any; filterMinWidth?: number; + filterPlaceholder?: any; filterWidth?: number; footer?: string; + format?: WebixCallback; gravity?: number; + headerTemplate?: WebixCallback; height?: number; hidden?: boolean; id?: string|number; @@ -6175,7 +6199,7 @@ interface pivotConfig{ width?: number; yScaleWidth?: number; } -type pivotEventName ='onAfterAdd'|'onAfterDelete'|'onAfterLoad'|'onAfterSort'|'onBeforeAdd'|'onBeforeDelete'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSort'|'onBindRequest'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onHeaderInit'|'onLoadError'|'onPopup'|'onViewInit'; +type pivotEventName ='onAfterAdd'|'onAfterDelete'|'onAfterLoad'|'onAfterSort'|'onBeforeAdd'|'onBeforeApply'|'onBeforeDelete'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSort'|'onBindRequest'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onHeaderInit'|'onLoadError'|'onPopup'|'onViewInit'; class pivot implements webix.ui.baseview{ add(obj:any, index?:number):string|number; addOperation(name:string, functor:WebixCallback, options:any):void; @@ -6199,6 +6223,7 @@ class pivot implements webix.ui.baseview{ getChildViews():any[]; getConfigWindow():any; getFields():any; + getFilterView():any; getFirstId():string|number; getFormView():webix.ui.baseview; getIdByIndex(index:number):string|number; @@ -6249,6 +6274,7 @@ class pivot implements webix.ui.baseview{ config: pivotConfig; name: string; operations: any; + waitData: webix.promise; } interface popupConfig{ view?: string; @@ -6758,6 +6784,7 @@ class rangechart implements webix.ui.baseview{ on_dblclick: WebixCallback; on_mouse_move: WebixCallback; presets: { [key: string]: any; }; + waitData: webix.promise; } interface rangesliderConfig{ view?: string; @@ -7282,7 +7309,6 @@ interface segmentedConfig{ align?: string; animate?: any; attributes?: any; - autowidth?: boolean; borderless?: boolean; bottomLabel?: string; bottomPadding?: number; @@ -7737,7 +7763,6 @@ interface spreadsheetConfig{ isolate?: boolean; liveEditor?: boolean; margin?: number; - math?: boolean; maxHeight?: number; maxWidth?: number; menu?: boolean; @@ -7760,7 +7785,7 @@ interface spreadsheetConfig{ visibleBatch?: string; width?: number; } -type spreadsheetEventName ='onAfterLoad'|'onAfterSelect'|'onBeforeLoad'|'onBeforeSpan'|'onBeforeSplit'|'onBeforeValueChange'|'onBindRequest'|'onCellChange'|'onComponentInit'|'onDataParse'|'onDataSerialize'|'onDestruct'|'onLoadError'|'onReset'|'onStyleSet'; +type spreadsheetEventName ='onAfterLoad'|'onAfterSelect'|'onAfterSheetShow'|'onBeforeLoad'|'onBeforeSheetShow'|'onBeforeSpan'|'onBeforeSplit'|'onBeforeValueChange'|'onBindRequest'|'onCellChange'|'onComponentInit'|'onDataParse'|'onDataSerialize'|'onDestruct'|'onLoadError'|'onMathRefresh'|'onReset'|'onStyleSet'; class spreadsheet implements webix.ui.baseview{ addFilter(rowId:number, columnId:number):void; addImage(rowId:number, columnId:number, url:string):void; @@ -7777,6 +7802,7 @@ class spreadsheet implements webix.ui.baseview{ clearRange(rangeStr:string, type:any):void; clearSheet():void; combineCells(range:any):void; + compactStyles():void; confirm(config:any):void; define(property:string, value:any):void; deleteColumn(columnId:number):void; @@ -7822,9 +7848,11 @@ class spreadsheet implements webix.ui.baseview{ lockCell(rowId:number, columnId:number, state:boolean):void; mapEvent(map:any):void; parse(data:any, type:string):void; + recalculate():void; reconstruct():void; redo():void; refresh():void; + registerMathMethod(name:string, handler:WebixCallback):void; removeFilter():void; removeSheet(name:string):void; removeView(id:string|number):void; @@ -7933,7 +7961,7 @@ interface submenuConfig{ yCount?: number; zIndex?: number; } -type submenuEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|''|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|''|'onBeforeDropOut'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSelect'|'onBeforeShow'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onFocus'|'onHide'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMenuItemClick'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onPaste'|'onSelectChange'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; +type submenuEventName ='onAfterAdd'|'onAfterContextMenu'|'onAfterDelete'|'onAfterDrop'|'onAfterDropOrder'|'onAfterLoad'|'onAfterRender'|'onAfterScroll'|'onAfterSelect'|'onAfterSort'|'onBeforeAdd'|'onBeforeContextMenu'|'onBeforeDelete'|'onBeforeDrag'|'onBeforeDragIn'|'onBeforeDrop'|'onBeforeDropOrder'|'onBeforeDropOut'|'onBeforeLoad'|'onBeforeRender'|'onBeforeSelect'|'onBeforeShow'|'onBeforeSort'|'onBindRequest'|'onBlur'|'onDataRequest'|'onDataUpdate'|'onDestruct'|'onDragOut'|'onFocus'|'onHide'|'onItemClick'|'onItemDblClick'|'onItemRender'|'onKeyPress'|'onLoadError'|'onLongTouch'|'onMenuItemClick'|'onMouseMove'|'onMouseMoving'|'onMouseOut'|'onPaste'|'onSelectChange'|'onShow'|'onSwipeX'|'onSwipeY'|'onTimedKeyPress'|'onTouchEnd'|'onTouchMove'|'onTouchStart'|'onValidationError'|'onValidationSuccess'|'onViewMove'|'onViewMoveEnd'|'onViewResize'; class submenu implements webix.ui.baseview{ add(obj:any, index?:number):string|number; addCss(id:string|number, css:string, silent?:boolean):void; @@ -8048,6 +8076,7 @@ class submenu implements webix.ui.baseview{ on_mouse_move: WebixCallback; type: { [key: string]: any; }; types: { [key: string]: any; }; + waitData: webix.promise; } interface suggestConfig{ view?: string; @@ -9018,6 +9047,7 @@ class tree implements webix.ui.baseview{ $dragOut(source:HTMLElement, old_target:HTMLElement, new_target:HTMLElement, ev:Event):void; $drop(source:HTMLElement, target:HTMLElement, ev:Event):void; $dropAllow: WebixCallback; + $fixEditor: WebixCallback; $getSize():any[]; $height: number; $scope: any; @@ -9033,6 +9063,7 @@ class tree implements webix.ui.baseview{ on_mouse_move: WebixCallback; type: { [key: string]: any; }; types: { [key: string]: any; }; + waitData: webix.promise; } interface treemapConfig{ view?: string; @@ -9194,6 +9225,7 @@ class treemap implements webix.ui.baseview{ on_mouse_move: WebixCallback; type: { [key: string]: any; }; types: { [key: string]: any; }; + waitData: webix.promise; } interface treetableConfig{ view?: string; @@ -9313,7 +9345,7 @@ class treetable implements webix.ui.baseview{ detachEvent(id:string):void; disable():void; eachColumn(handler:WebixCallback, all?:boolean):void; - eachRow(handler:WebixCallback, all?:boolean):void; + eachRow(handler:WebixCallback):void; edit(id:any):void; editCancel():void; editCell(row:string|number, col:string|number, preserve?:boolean, show?:boolean):void; @@ -9333,7 +9365,7 @@ class treetable implements webix.ui.baseview{ getChildViews():any[]; getColumnConfig(id:string):any; getColumnIndex(id:string|number):number; - getCss():void; + getCss(rowId:string|number, columnId:string|number):string; getEditState():any; getEditor(row?:any, column?:string|number):any; getEditorValue():string; @@ -9608,6 +9640,7 @@ class unitlist implements webix.ui.baseview{ on_mouse_move: WebixCallback; type: { [key: string]: any; }; types: { [key: string]: any; }; + waitData: webix.promise; } interface uploaderConfig{ view?: string; @@ -9621,6 +9654,7 @@ interface uploaderConfig{ container?: string|HTMLElement; css?: string; datatype?: string; + directory?: boolean; disabled?: boolean; formData?: { [key: string]: any; }; gravity?: number; diff --git a/webix/webix-tests.ts b/webix/webix-tests.ts index 12183b70bc..bf2c6872c6 100644 --- a/webix/webix-tests.ts +++ b/webix/webix-tests.ts @@ -94,7 +94,7 @@ var next = webix.protoUI({ webix.message("test"); return 1; } -}, webix.ui.list, webix.EditAbility); +}, webix.ui.list, webix.EditAbility, webix.EventSystem); //test method of new UI var my = webix.ui({ From ea45419314f1dd5be0b5b7c30c495b4203cc098c Mon Sep 17 00:00:00 2001 From: Konrad Mattheis Date: Thu, 23 Feb 2017 16:01:54 +0100 Subject: [PATCH 198/797] add qlik-visualizationextensions as typescript definition Signed-off-by: Konrad Mattheis --- qlik-visualizationextensions/index.d.ts | 2417 +++++++++++++++++ .../qlik-visualizationextensions-tests.ts | 3 + qlik-visualizationextensions/tsconfig.json | 23 + qlik-visualizationextensions/tslint.json | 7 + 4 files changed, 2450 insertions(+) create mode 100644 qlik-visualizationextensions/index.d.ts create mode 100644 qlik-visualizationextensions/qlik-visualizationextensions-tests.ts create mode 100644 qlik-visualizationextensions/tsconfig.json create mode 100644 qlik-visualizationextensions/tslint.json diff --git a/qlik-visualizationextensions/index.d.ts b/qlik-visualizationextensions/index.d.ts new file mode 100644 index 0000000000..8a9c145969 --- /dev/null +++ b/qlik-visualizationextensions/index.d.ts @@ -0,0 +1,2417 @@ +// Type definitions for qlik-visualizationextensions +// Project: http://help.qlik.com/en-US/sense-developer/3.2/Subsystems/Extensions/Content/extensions-introduction.htm +// Definitions by: Konrad Mattheis +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace BackendAPI { + type StateType = "L" | "S" | "O" | "D" | "A" | "X" | "XS" | "XL"; + type SortIndicatorType = "N" | "A" | "D"; + type DimensionType = "D" | "N" | "T"; + type GroupingType = "N" | "H" | "C"; + type FieldAttributesType = "U" | "A" | "I" | "R" | "F" | "M" | "D" | "T" | "TS" | "IV"; + type PatchType = "Add" | "Remove" | "Replace"; + + interface ICharRange { + /** + * Position of the first search occurrence + * Integer + */ + qCharPos: number; + + /** + * Number of occurrences found + * Integer + */ + qCharCount: number; + } + + interface INxHighlightRanges { + /** + * Ranges of highlighted values + * Array of CharRange + */ + qRanges: ICharRange[]; + } + + interface INxSimpleValue { + /** + * Text related to the attribute expression value. + * This property is optional. No text is returned if the attribute expression value is a numeric. + * String + */ + qText: string; + + /** + * Numeric value of the attribute expression. + * This property is set to NaN (Not a Number) if the attribute expression value is not a numeric. + * Numerical values are not returned as text. + * Double precision floating point + */ + qNum: number; + } + + interface INxAttributeExpressionValues { + /** + * List of attribute expressions values. + * Array of NxSimpleValue + */ + qValues: INxSimpleValue[]; + } + + interface INxSimpleDimValue { + /** + * Text related to the attribute expression value. + * This property is optional. No text is returned if the attribute expression value is a numeric. + * String + */ + qText: string; + + /** + * Element number. + * Integer + */ + qElemNo: number; + } + + interface INxAttributeDimValues { + /** + * List of values. + * Array of NxSimpleDimValue + */ + qValues: INxSimpleDimValue[]; + } + + interface INxCell { + /** + * Some text. + * This parameter is optional. + */ + qText?: string; + + /** + * A value. + * This parameter is optional. + */ + qNum?: number; + + /** + * Rank number of the value, starting from 0. + * If the element number is a negative number, it means that the returned value is not an element number. + * You can get the following negative values: + * # -1: the cell is a Total cell. It shows a total. + * # -2: the cell is collapsed. Applies to pivot tables. + * # -3: the cell belongs to the group Others. + * # -4: the cell is empty. Applies to pivot tables. + */ + qElemNumber: number; + + /** + * State of the value. + * The default state for a measure is L. + * L for Locked + * S for Selected + * O for Optional + * D for Deselected + * A for Alternative + * X for eXcluded + * XS for eXcluded Selected + * XL for eXcluded Locked + */ + qState: StateType; + + /** + * Is set to true, if qText and qNum are empty. + * This parameter is optional. The default value is false. + */ + qIsEmpty: boolean; + + /** + * Is set to true if a total is displayed in the cell. + * This parameter is optional. The default value is false. + * Not applicable to list objects. + */ + qIsTotalCell: boolean; + + /** + * Is set to true if the cell belongs to the group Others. + * Dimension values can be set as Others depending on what has been defined in OtherTotalSpecProp. + * This parameter is optional. The default value is false. + * Not applicable to list objects. + */ + qIsOtherCell: boolean; + + /** + * Frequency of the value. + * This parameter is optional. + */ + qFrequency: string; + + /** + * Search hits. + * The search hits are highlighted. + * This parameter is optional. + */ + qHighlightRanges: INxHighlightRanges; + + /** + * Attribute expression values. + */ + qAttrExps: INxAttributeExpressionValues; + + /** + * Is set to true if the value is Null. + */ + qIsNull: boolean; + + /** + * Attribute dimensions values. + */ + qAttrDims: INxAttributeDimValues; + } + + interface INxPage { + /** + * Position from the left. + * Corresponds to the first column. + */ + qLeft: number; + + /** + * Position from the top. + * Corresponds to the first row. + */ + qTop: number; + + /** + * Number of columns in the page. The indexing of the columns may vary depending on whether the cells are expanded or not (parameter qAlwaysFullyExpanded in HyperCubeDef). + */ + qWidth: number; + + /** + * Number of rows or elements in the page. The indexing of the rows may vary depending on whether the cells are expanded or not (parameter qAlwaysFullyExpanded in HyperCubeDef). + */ + qHeight: number; + } + + interface INxAttrDimInfo { + /** + * Cardinality of the attribute expression. + * Integer + */ + qCardinal: number; + + /** + * Number of rows. + * Size + */ + qSize: number; + + /** + * The title for the attribute dimension. + * String + */ + qFallbackTitle: string; + + /** + * The Locked value of the dimension. + * Boolean + */ + qLocked: boolean; + + /** + * Validation error. + * REF(NxValidationError) + */ + //?Type = REF(NxValidationError)? + qError: INxValidationError; + } + + interface INxDimensionInfo { + /** + * Corresponds to the label of the dimension that is selected. + * If the label is not defined then the field name is used. + * String + */ + qFallbackTitle: string; + + /** + * Length of the longest value in the field. + * Integer + */ + qApprMaxGlyphCount: number; + + /** + * Number of distinct field values. + * Integer + */ + qCardinal: number; + + /** + * Is set to true if the field is locked. + * Boolean + */ + qLocked: boolean; + + /** + * Sort indicator. + * This parameter is optional. + * The default value is no sorting. + * One of: + * # N for no sorting + * # A for sorting ascending + * # D for sorting descending + */ + qSortIndicator: SortIndicatorType; + + /** + * Array of dimension labels. + * Contains the labels of all dimensions in a hierarchy group (for example the labels of all dimensions in a drill down group). + * Array of String + */ + qGroupFallbackTitles: string[]; + + /** + * Index of the dimension that is currently in use. + * qGroupPos is set to 0 if there are no hierarchical groups (drill-down groups) or cycle groups. + * Integer + */ + qGroupPos: number; + + /** + * Number of values in a particular state. + * NxStateCounts + */ + qStateCounts: INxStateCounts; + + /** + * Gives information on a field. For example, it can return the type of the field. + * Examples: key, text, ASCII + * Array of String + */ + qTags: string[]; + + /** + * This parameter is optional. + * Gives information on the error. + * Null or NxValidationError + */ + qError: INxValidationError; + + /** + * Binary format of the field. + * One of: + * # D for discrete (String) + * # N for numeric (Double) + * # T for Time (Timestamp) + */ + qDimensionType: DimensionType; + + /** + * If set to true, it inverts the sort criteria in the field. + * Boolean + */ + qReverseSort: boolean; + + /** + * Defines the grouping. + * One of: + * # N for no grouping + * # H for drill-down + * # C for cyclic + */ + qGrouping: GroupingType; + + /** + * If set to true, it means that the field is a semantic. + * Boolean + */ + qIsSemantic: boolean; + + /** + * Format of the field. + * This parameter is optional. + * FieldAttributes + */ + qNumFormat: FieldAttributesType; + + /** + * This parameter is set to true if qNumFormat is set to U (unknown). The engine guesses the type of the field based on the field's definition. + * Boolean + */ + qIsAutoFormat: boolean; + + /** + * Array of field names. + * Array of String + */ + qGroupFieldDefs: string[]; + + /** + * Array of attribute expressions. + * Array of NxAttrExprInfo + */ + qAttrExprInfo: INxAttrExprInfo; + + /** + * Minimum value. + * Double + */ + qMin: number; + + /** + * Maximum value. + * Double + */ + qMax: number; + + /** + * Is continuous axis used. + * Boolean + */ + qContinuousAxes: boolean; + + /** + * Is a cyclic dimension used. + * Boolean + */ + qIsCyclic: boolean; + + /** + * Is derived field is used as a dimension. + * Boolean + */ + qDerivedField: boolean; + + /** + * Array of attribute dimensions. + * Array of NxAttrDimInfo + */ + qAttrDimInfo: INxAttrDimInfo; + } + + interface INxAttrExprInfo { + /** + * Minimum value. + */ + qMin: number; + + /** + * Maximum value. + */ + qMax: number; + + /** + * Is continuous axis used. + */ + qContinuousAxes: boolean; + + /** + * Is a cyclic dimension used. + */ + qIsCyclic: boolean; + + /** + * Corresponds to the label of the dimension that is selected. + */ + qFallbackTitle: string; + } + + interface INxStateCounts { + /** + * Number of values in locked state. + * Integer + */ + qLocked: number; + + /** + * Number of values in selected state. + * Integer + */ + qSelected: number; + + /** + * Number of values in optional state. + * Integer + */ + qOption: number; + + /** + * Number of values in deselected state. + * Integer + */ + qDeselected: number; + + /** + * Number of values in alternative state. + * Integer + */ + qAlternative: number; + + /** + * Number of values in excluded state + * Integer + */ + qExcluded: number; + + /** + * Number of values in selected excluded state. + * Integer + */ + qSelectedExcluded: number; + + /** + * Number of values in locked excluded state. + * Integer + */ + qLockedExcluded: number; + } + + interface INxValidationError { + /** + * Error code. + * This parameter is always displayed in case of error. + * Integer + */ + qErrorCode: number; + + /** + * Context related to the error, from the user app domain. + * It can be the identifier of an object, a field name, a table name. + * This parameter is optional. + * String + */ + qContext: string; + + /** + * Internal information from the server. + * This parameter is optional. + * String + */ + qExtendedMessage: string; + } + + interface IFieldAttributes { + /** + * Type of the field. + * Default is U. + * One of: + * # U for UNKNOWN type. + * # A for ASCII; Numeric fields values contain only standard ASCII characters. + * # I for INTEGER; Numeric fields values are shown as integer numbers. + * # R for REAL; Numeric fields values are shown as real numbers. + * # F for FIX; Numeric fields values are shown as numbers with a fix number of decimals. + * # M for MONEY; Numeric fields values are shown as in the money format. + * # D for DATE; Numeric fields values are shown as dates. + * # T for TIME; Numeric fields values are shown as times. + * # TS TIMESTAMP; Numeric fields values are shown as time stamps. + * # IV for INTERVAL; Numeric fields values are shown as intervals. + */ + qType: FieldAttributesType; + + /** + * Number of decimals. + * Default is 10. + * Integer between 0 and 15. + */ + qnDec: number; + + /** + * Defines whether or not a thousands separator must be used. + * Default is 0. + * One of: 0 for false | 1 for true + */ + qUseThou: boolean; + + /** + * Defines the format pattern that applies to qText. + * Is used in connection to the type of the field (parameter qType). + * For more information, see Struct FieldAttributes. + * Example: YYYY-MM-DD for a date + */ + qFmt: string; + + /** + * Defines the decimal separator. + * Example: . + */ + qDec: string; + + /** + * Defines the thousand separator (if any). + * Is used if qUseThou is set to 1. + * Example: , + */ + qThou: string; + + /** + * Array + */ + qSAFEARRAY: any[]; + } + + interface INxMeasureInfo { + /** + * Corresponds to the label of the measure. If the label is not defined then the measure name is used. + * String + */ + qFallbackTitle: string; + + /** + * Length of the longest value in the field. + * Integer + */ + qApprMaxGlyphCount: number; + + /** + * Number of distinct field values. + * Integer + */ + qCardinal: number; + + /** + * Sort indicator. This parameter is optional. The default value is no sorting. + */ + qSortIndicator: SortIndicatorType; + + /** + * Format of the field. This parameter is optional. + * One of: N for no sorting, A for sorting ascending, D for sorting descending + */ + qNumFormat: IFieldAttributes; + + /** + * This parameter is set to true if qNumFormat is set to U (unknown). The engine guesses the type of the field based on the field's expression. + */ + qIsAutoFormat: boolean; + + /** + * Lowest value in the range. + */ + qMin: number; + + /** + * Highest value in the range. + */ + qMax: number; + + /** + * This parameter is optional. Gives information on the error. + */ + qError: INxValidationError; + + /** + * If set to true, it inverts the sort criteria in the field. + */ + qReverseSort: boolean; + + /** + * List of attribute expressions. + */ + qAttrExprInfo: INxAttrExprInfo[]; + + /** + * List of attribute dimensions. + */ + qAttrDimInfo: INxMeasureInfo[]; + } + + interface IRange { + /** + * Lowest value in the range + * Double + */ + qMin: number; + + /** + * Highest value in the range + * Double + */ + qMax: number; + + /** + * If set to true, the range includes the lowest value in the range of selections (Equals to ). [bn(50500)] + * Example: The range is [1,10]. If qMinInclEq is set to true it means that 1 is included in the range of selections. + */ + qMinInclEq: boolean; + + /** + * If set to true, the range includes the highest value in the range of selections (Equals to ). [bn(50500)] + * Example: The range is [1,10]. If qMinInclEq is set to true it means that 10 is included in the range of selections. + */ + qMaxInclEq: boolean; + } + + interface INxPatch { + /** + * Operation to perform. + * One of: + * # Add + * # Remove + * # Replace + */ + qOp: PatchType; + + /** + * Path to the property to add, remove or replace. + * String + */ + qPath: string; + + /** + * This parameter is not used in a remove operation. + * Corresponds to the value of the property to add or to the new value of the property to update. + * Examples: "false", "2", "\"New title\"" + * String + */ + qValue: string; + } + + interface IBackend { + /** + * Aborts the result of a search in a list object. Clears the existing search and returns the object to the state it was in prior to the search started. + */ + abortSearch(): void; + + /** + * Accepts the result of a search in a list object and the search result is selected in the field. + * @param {boolean} toggleMode - If true, toggle state for selected values + */ + acceptSearch(toggleMode: boolean): void; + + /** + * Updates the properties for this object. + * @param {array} qPatches - Array of patches. Each path contains: + * #qOp: Add/Remove/Replace + * #qPath: Path to property + * #qValue: The new value in string format. Strings need to be surrounded by \". + * @param {boolean} qSoftPatch - Set to True if properties should be soft, that is not persisted. + * @return {Promise} - A promise of a Qlik engine reply. + */ + applyPatches(qPatches: any[], qSoftPatch: boolean): ng.IPromise; + + /** + * Clears unconfirmed selections for this object. + */ + clearSelections(): void; + + /** + * Clears all soft patches that has previously been applied for this object using the applyPatches method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + clearSoftPatches(): ng.IPromise; + + /** + * Collapse the left dimensions of a pivot table. Only works for hypercubes with qMode = P which are not always fully expanded. + * @param {number} qRow - Row index. + * @param {number} qCol - Column index. + * @param {boolean} [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. + * @return {Promise} - A promise of a Qlik engine reply. + */ + collapseLeft(qRow: number, qCol: number, qAll?: boolean): ng.IPromise; + + /** + * Collapse the top dimensions of a pivot table. Only works for hypercubes with qMode = P which are not always fully expanded. + * @param {number} qRow - Row index. + * @param {number} qCol - Column index. + * @param {boolean} [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. + * @return {Promise} - A promise of a Qlik engine reply. + */ + collapseTop(qRow: number, qCol: number, qAll?: boolean): ng.IPromise; + + /** + * Loops through data rows for this object. Only rows that are available client side will be used. + * @param {function} callback - Function to call for each row. + * Parameters are row number and row data as an array of NxCell objects. + * The loop is terminated if the function returns false. + * @return {NxCell[]} - An array of NxCell. + */ + eachDataRow(callback: any): INxCell[]; + + /** + * Expands the left dimensions of a pivot table. Only works for hypercubes with qMode = P which are not always fully expanded. + * @param {number} qRow - Row index. + * @param {number} qCol - Column index. + * @param {boolean} [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. + * @return {Promise} - A promise of a Qlik engine reply. + */ + expandLeft(qRow: number, qCol: number, qAll?: boolean): ng.IPromise; + + /** + * Expands the top dimensions of a pivot table. Only works for hypercubes with qMode = P which are not always fully expanded. + * @param {number} qRow - Row index. + * @param {number} qCol - Column index. + * @param {boolean} [qAll] - Optional. If set to true, qRow and qCol are ignored and all cells are collapsed. + * @return {Promise} - A promise of a Qlik engine reply. + */ + expandTop(qRow: number, qCol: number, qAll?: boolean): ng.IPromise; + + /** + * Geta data from Qlik engine for this object. + * @param {array} qPages - An array of NxPage objects. + * @return {Promise} - A promise of qDataPages. + */ + getData(qPages: INxPage[]): ng.IPromise; + + /** + * Gets a data row for this object. + * @param {number} rownum - The row number. + * @return {NxCell} - A row of NxCell or null if the row is not available client side and need to be fetched with getData method. + */ + getDataRow(rownum: number): INxCell; + + /** + * Gets qDimensionInfo for this object. + * @return {NxDimensionInfo[]} - An array of qDimensionInfo objects. + */ + getDimensionInfos(): INxDimensionInfo[]; + + /** + * Gets qMeasureInfo for this object. + * @return {NxMeasureInfo} - An array of qMeasureInfo objects. + */ + getMeasureInfos(): INxMeasureInfo; + + /** + * Gets pivot data from the Qlik engine for this object. Only works for hypercubes with qMode = P. + * @param {array} qPages - An array of request page objects. + * @return {Promise} - A promise of pivot data pages. + */ + getPivotData(qPages: INxPage[]): ng.IPromise; + + /** + * Get properties for this object. + * @return {Promise} - A promise of object properties. + */ + getProperties(): ng.IPromise; + + /** + * Get reduced data from the Qlik engine for this object. This method is intended for preserving the shape of the data, not for viewing the actual data points. + * @param {array} qPages - An array of request page objects. + * @param {number} qZoomFactor - Zoom factor. + * If set to -1, the Qlik engine decides of the zoom factor. + * If qReductionMode is D1 or S, the zoom factor is 2â¿. If the zoom factor is 5, the data are reduced by a factor 32. + * If qReductionMode is C, the zoom factor defines the number of centroids. + * @param {string} qReductionMode - Reduction mode.Can be: + * # N for no data reduction. + * # D1 to reduce a bar chart or line chart. The profile of the chart is reduced whatever the number of dimensions in the chart. + * # S to reduce the resolution of a scatter plot. + * # C to reduce the data of a scatter plot chart. + * # ST to reduce the data of a stacked pivot table. + * @return {Promise} - A promise of reduced data pages. + */ + getReducedData(qPages: INxPage[], qZoomFactor: number, qReductionMode: string): ng.IPromise; + + /** + * Get total number of data rows for this object. + * @return {Number} - A number. + */ + getRowCount(): number; + + /** + * Get stacked data from the Qlik engine for this object. Only works for hypercubes with qMode = S. + * @param {array} qPages - An array of request page objects. + * @param {number} qMaxNbrCells - Maximum number of cells at outer level. + * @return {Promise} - A promise of stack data pages. + */ + getStackedData(qPages: INxPage[], qMaxNbrCells: number): ng.IPromise; + + /** + * Find out if there are unconfirmed selections for this object. + * @return {boolean} - True if there are unconfirmed selections. + */ + hasSelections(): boolean; + + /** + * Save this object. + * @return {Promise} - A promise. In case of success, it returns "undefined". In case of failure it returns the error. + */ + save(): ng.IPromise; + + /** + * Search for a term in a list object. Results in an updated layout, containing only matching records. + * @param {string} term - Term to search for. + */ + search(term: string): void; + + /** + * Select values in this object using ranges. + * @param {array} qRanges - Array of ranges to select. + * @param {boolean} qOrMode - If true only one of the measures needs to be in range. + */ + selectRange(qRanges: IRange[], qOrMode: boolean): void; + + /** + * Select values in this object with a Qlik engine call which triggers a repaint of the object. + * @param {number} qDimNo - Dimension number. 0 = first dimension. + * @param {array} qValues - Array of values (qElemNumber in the matrix from the Qlik engine) to select or deselect. + * @param {boolean} qToggleMode - If true, values in the field are selected in addition to any previously selected items. + * If false, values in the field are selected while previously selected items are deselected. + */ + selectValues(qDimNo: number, qValues: any[], qToggleMode: boolean): void; + + /** + * Set properties for this object. + * @param {object} props - The properties to set. + * @return {Promise} - A promise of a Qlik engine reply. + */ + setProperties(props: any): ng.IPromise; + } +} + +declare namespace RootAPI { + interface IAppConfig { + /** + * Optional Qlik host. + */ + host?: string; + + /** + * Port number. + */ + port: string | number; + + /** + * Optional. Qlik virtual proxy. "/" if no proxy. + */ + prefix?: string; + + /** + * Optional. Use SSL. + */ + isSecure?: boolean; + + /** + * Optional. Open app without loading data. Introduced in version 1.1. + */ + openWithoutData?: boolean; + + /** + * Optional. Unique identity for the session. If omitted, the session will be shared. + */ + identity?: string; + } + + interface IGlobalConfig { + /** + * Qlik Sense host + */ + host: string; + + /** + * Port number + */ + port: string; + + /** + * Qlik Sense virtual proxy. / if no virtual proxy + */ + prefix: string; + + /** + * Use SSL + */ + isSecure: boolean; + + /** + * Unique identity for the session. If omitted, the session will be shared. + */ + identity: string; + } + + interface IRoot { + /** + * Calls the Qlik Sense repository. + * @param {string} path - Path to the Qlik Sense repository. + * Refer to Qlik Sense repository documentation for the available paths. + * @param {string} [method] - Optional. HTTP method. Default is GET. + * @param {string} [body] - Optional. Body of the post. + * @return {Promise} - A promise of a Qlik engine reply. + */ + callRepository(path: string, method?: string, body?: string): ng.IPromise; + + /** currApp + * Gets a reference to the current app. Use the currApp method in an extension to get a reference to the app currently displayed. + * @param {object} [reference] - Optional. Reference to extension object. Introduced in version 1.1. + * @return {IApp} - An App JavaScript object with app methods. + */ + currApp(object?: any): AppAPI.IApp; + + /** + * Gets a list of Qlik Sense apps that you potentially can connect to and registers a callback to receive the data. + * The getAppList method opens a WebSocket, gets the app list, and then closes the WebSocket. + * @param {function} callback - Callback method. + * @param {object} [config] - Optional. Additional configuration parameters: + * Name | Type | Descr | Name + * host | String | Optional. Qlik host. | host + * port | String or integer | Port number. | port + * prefix | String | Optional. Qlik virtual proxy. "/" if no proxy. | prefix + * isSecure | Boolean | Optional. Use SSL. | isSecure + * openWithoutData | Boolean | Optional. Open app without loading data. Introduced in version 1.1. | openWithoutData + * identity | String | Optional. Unique identity for the session. If omitted, the session will be shared. | identity + */ + getAppList(callback: any, config?: any): void; + + /** + * Gets a list of extensions installed for Qlik Sense. The reply contains all extensions, that is widget libraries, visualization extensions and mashups. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getExtensionList(callback?: any): ng.IPromise; + + /** + * Opens a WebSocekt connection to the Qlik engine for global methods. + * @param {object} [config] - Optional. Parameters: + * Name | Type | Description + * host | String | Qlik Sense host + * port | String | Port number + * prefix | String | Qlik Sense virtual proxy. / if no virtual proxy + * isSecure | Boolean | Use SSL + * identity | String | Unique identity for the session. If omitted, the session will be shared. + * @return {ANY} - A global JavaScript object with global methods. + */ + getGlobal(config: any): any; + + /** Opens a Qlik Sense app. You can open multiple apps. + * Most other methods are defined on the app. Returns: App JavaScript object with app methods. + * @param {string} appId The app id. + * @param {object} [config] Optional. Additional configuration parameters: + * Name | Type | Descr + * host | String | Optional. Qlik host. + * port | String or Integer | Port number. + * prefix | String | Optional. Qlik virtual proxy. "/" if no proxy. + * isSecure | Boolean | Optional. Use SSL. + * openWithoutData | Boolean | Optional. Open app without loading data. Introduced in version 1.1. + * identity | String | Optional. Unique identity for the session. If omitted, the session will be shared. + * Parameter updated in version 2.2. + * @return {any} - App JavaScript object with app methods. + */ + openApp(appId: string, config?: any): any; + + /** + * Registers an extension for use in this mashup. The extension is not installed on the Qlik Sense server and only available in the session where it is created. + * As long as a JavaScript module is created in the correct format, it can be sent to the registerExtension function. + * @param {string} id - Set the ID of the visualization extension. + * @param {object} impl - Set the extension implementation. + * @param {object} [metadata] - Optional. Extension meta-data, same format as the QEXT file. Default: {"type":"visualization"} + */ + registerExtension(id: string, impl: any, metadata?: any): void; + + /** + * Sends a resize event to all Qlik Sense objects. + * @param {string} [ID] - Object id. Optional: if no ID resize event will be sent to all objects. + */ + resize(ID?: string): void; + + /** + * Sets a specific language for the Qlik Sense session. + * Language should be defined before the app is opened meaning the setLanguage method should be called before the openApp method is called. + * @param {string} lang - Language code. Can be: + * # German: short: de long: de-DE + * # English: short: en long: en-US + * # Spanish: short: es long: es-ES + * # French: short: fr long: fr-FR + * # Italian: short: it long: it-IT + * # Japanese: short: ja long: ja-JP + * # Korean: (introduced in version 3.0) short: ko long: ko-KR + * # Dutch: short: nl long: nl-NL + * # Polish: (introduced in version 3.0) short: pl long: pl-PL + * # Brazilian Portuguese: short: pt long: pt-BR + * # Russian: short: ru long: ru-RU + * # Swedish: short: sv long: sv-SE + * # Turkish: (introduced in version 3.0) short: tr long: tr-TR + * # Simplified Chinese: short: Do not use! long: zh-CN + * # Traditional Chinese: (introduced in version 3.0) short: Do not use! long: zh-TW + */ + setLanguage(lang: string): void; + + /** + * Registers a callback for error handling. Standard Qlik Sense error handling is used if this method is not called. + * @param {function} onError - Error handling function + * @param {function} [onWarning] - Optional. Warning handling function. Introduced in version 2.1. + */ + setOnError(onError: any, onWarning?: any): void; + + /** + * Create a QTable object that wraps data in your extension and provides an object oriented interface. + * @param {object} ext - Extension or angular scope for the extension. + * @param {string} [path] - Optional. Path to the hypercube. Default: qHyperCube + * @return {QTable} - A QTable object that holds data and options for the table. + */ + table(ext: any, path?: string): TableAPI.IQTable; + + navigation: NavigationAPI.INavigation; + } +} + +declare namespace AppAPI { + interface IApp { + /** + * Adds an alternate state in the app. Multiple states within a Qlik Sense app can be created and applied to specific objects within the app. Objects in a given state are not affected by user selection in the other states. + * @param {string} qStateName - Mandatory. Alternate state name. + * @return {Promise} - A promise of a Qlik engine reply. + */ + addAlternateState(qStateName: string): ng.IPromise; + + /** + * Steps back in the list of selections. + * @return {Promise} - A promise of a Qlik engine reply. + */ + back(): ng.IPromise; + + /** + * Clears all selections in all fields of the current Qlik Sense app. + * @param {boolean} [lockedAlso] - Optional. Alternate state name. Default: false Introduced in version 2.1. + * @param {string} [state] - Optional. Alternate state name. Default: $ Introduced in version 2.1. + * @return {Promise} - A promise of a Qlik engine reply. + */ + clearAll(lockedAlso?: boolean, state?: string): ng.IPromise; + + /** + * Closes a Qlik Sense app. Also closes the WebSocket and clears out client side data. + */ + close(): void; + + /** + * Defines a hypercube and registers a callback to receive the data. + * @param {object} qHyperCubeDef - Cube definition. + * @param {function} [callback] - Optional. Callback method. Parameter will contain a qHyperCube. + * @return {Promise} - A promise of an object model. + */ + createCube(qHyperCubeDef: any, callback?: any): ng.IPromise; + + /** + * Creates a generic object and registers a callback to receive the data. The generic object can contain the following: + * # qHyperCubeDef + * # qListObjectDef + * # qStringExpression + * # qValueExpression + * The callback method will be called whenever the selection state changes in a way that affects the generic object. The parameter will be the evaluated version of the definition. + * @param {object} [def] - Optional. Generic object definition + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of an object model. + */ + createGenericObject(def?: any, callback?: any): ng.IPromise; + + /** + * Defines a list of field values and registers a callback to receive the data. + * @param {object} qListObjectDef - List definition. + * @param {function} [callback] - Optional. Callback method. Parameter will contain a qListObject. + * @return {Promise} - A promise of an object model. + */ + createList(qListObjectDef: any, callback?: any): ng.IPromise; + + /** + * Defines a hypercube for a table and is the entry point to the Table API. It creates a table object that wraps the hypercube. + * @param {Array.} dimensions - Dimensions to use. + * Should, for each entry, be a field name or a NxDimension structure. + * @param {Array.} measures - Measures to use. + * Should, for each entry, be an expression or a NxMeasure structure. + * @param {object} [options] - Optional. Options to set. + * @return {QTable} - A table object of type QTable, which is initially empty but that eventually will contain data. The table object will be updated when selection state changes. + */ + createTable(dimensions: string[] | any[], measures: string[] | any[], options?: any): TableAPI.IQTable; + + /** + * Destroys a Qlik Sense session object created with the createGenericObject method or any of createCube, createList or getList methods. + * Calling this method removes the object from the Qlik engine, no more updates are sent to the client and all methods on the object are invalid. + * @param {string} id - Session object id. + * @return {Promise} - A promise of a Qlik engine reply. + */ + destroySessionObject(id: string): ng.IPromise; + + /** + * Reloads the data in a Qlik Sense app. + * @param {string} [qMode] - Optional. Error handling mode: + * # 0 = default mode. + * # 1 = attempt recovery on all errors. + * # 2 = fail on all errors. + * @param {boolean} [qPartial] - Optional. Set to true for partial reload. + * @param {boolean} [qDebug] - Optional. Set to true if debug breakpoints are honored. Execution of the script will be in debug mode. + * @return {Promise} - A promise of a Qlik engine reply. + */ + doReload(qMode?: string, qPartial?: boolean, qDebug?: boolean): ng.IPromise; + + /** + * Saves a Qlik Sense app, including all objects and data in the data model. + * @param {string} [qFileName] - Optional. File name of the file to save. + * @return {Promise} - A promise of a Qlik engine reply. + */ + doSave(qFileName?: string): ng.IPromise; + + /** + * Gets a field reference with methods that can be used to manipulate the field. + * @param {string} [field] - Optional. Name of the field. + * @param {string} [state] - Optional. Alternate state name. Default is $. + * @return {QField} - A QField object with methods and properties that can be used to manipulate the field. + */ + field(field?: string, state?: string): FieldAPI.IQField; + + /** + * Step forward in list of selections. + * @return {Promise} - A promise of a Qlik engine reply. + */ + forward(): ng.IPromise; + + /** + * Gets a layout for this Qlik Sense app and registers a callback to receive the data. Returns the dynamic properties (if any) in addition to the fixed properties. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getAppLayout(callback?: any): ng.IPromise; + + /** + * Gets a list of sheets and visualizations and registers a callback to receive the data. + * @param {string} [field] - Optional. Type of object. One of: + * # sheet + * # masterobject + * Default is sheet. + * @param {function} [callback] - Optional. Callback method. + */ + getAppObjectList(type?: string, callback?: any): void; + + /** + * Gets properties for a generic object, the children of the generic object and the bookmarks and/or embedded snapshots of the generic object. + * @param {string} id - Object id. + * @return {Promise} - A promise of an object model. + */ + getFullPropertyTree(id: string): ng.IPromise; + + /** + * Gets a list of internal Qlik Sense objects and registers a callback to receive the data. + * @param {string} type - Type of object: + * # FieldList + * # MeasureList + * # DimensionList + * # BookmarkList + * # SelectionObject + * # SnapshotList (Introduced in version 1.1) + * # MediaList (Introduced in version 1.1) + * # Sheet (Introduced in version 1.1) + * # MasterObject (Introduced in version 1.1) + * # VariableList (Introduced in version 2.0) + * # story (Introduced in version 2.1) + * @param {function} [callback] - Optional. Registers a callback that is executed every time data is returned. + * @return {Promise} - A promise of an object model. + */ + getList(type: string, callback?: any): ng.IPromise; + + /** + * Retrieves a Qlik Sense object from the Qlik Sense application and inserts it into a HTML element. The object fills the HTML object, so you can size and position the element to determine how large the Qlik Sense object will be. + * If you supply only one parameter, you get the model without displaying the object. + * @param {string} id - Object id or 'CurrentSelections' if used for Selections bar. + * @param {Element | string} [elem] - Optional. HTML element. + * Since version 1.1 it is also possible to define a string of the HTML element id. + * @param {object} [options] - Optional. + * Name | Type | Description + * noInteraction | Boolean | Set to true if you want to disable interaction, including selections, in the visualization. Introduced in version 1.1 and updated in version 3.0. + * noSelections | Boolean | Set to true if you want to disable selections in the visualization. Introduced in version 3.0. + * @return {Promise} - A promise of an object model. + */ + getObject(id: string, elem?: any | string, options?: any): ng.IPromise; + + /** + * Gets properties for a Qlik Sense object. + * @param {string} id - Object id. + * @return {Promise} - A promise of an object model. + */ + getObjectProperties(id: string): ng.IPromise; + + /** + * Inserts a Qlik Sense snapshot into a HTML element. The snapshot fills the HTML object so you can size and position the element to determine how large the Qlik Sense object will be. + * If you only supply one parameter, you will just get the model without displaying the object. + * @param {string} id - Snapshot ID. + * @param {element | string} [elem] - Optional. HTML element or string with HTML element id. + * @return {Promise} - A promise of an object model. + */ + getSnapshot(id: string, elem?: any | string): ng.IPromise; + + /** + * Locks all selections. + * @param {string} [state=$] - Optional. Alternate state name. + * Default: $ + * Introduced in version 2.1. + * @return {Promise} - A promise of a Qlik engine reply. + */ + lockAll(state?: string): ng.IPromise; + + /** + * Removes an alternate state in the app. + * @param {string} qStateName - Alternate state name. + * @return {Promise} - A promise of a Qlik engine reply. + */ + removeAlternateState(qStateName: string): ng.IPromise; + + /** + * Searches for one or more terms in the values of a Qlik Sense app. + * @param {array} qTerms - Terms to search for. + * @param {object} qPage - Properties: + * Name | Type | Description + * qOffset | Number | Position from the top, starting from 0. + * qCount | Number | Number of search results to return. + * qMaxNbrFieldMatches | Number | Maximum number of matching values to return per search result. + * @param {object} qOptions - Properties + * Name | Type | Description + * qSearchFields | Array | List of search fields. + * qContext | | Search context. Can be one of: + * # Cleared: In this mode, the first step is to clear any current selections in the app. The second step is to search for one or more terms in the values of the app. + * # LockedFieldsOnly: In this mode, the search applies only to the values associated with the selections made in locked fields, ignoring selections in any unlocked field. If no locked fields, the behavior is identical to the Cleared context. You cannot make any new selections in a locked field. You can get search hits for the associated values of a locked field but you cannot get the search hits for the non associative values. + * # CurrentSelections: In this mode, the current selections are kept (if any). Search for one or more terms in the values of the app. New selections are made on top of the current selections. If no selections were made before the search, this mode is identical to the Cleared context. + * | | Default value is LockedFieldsOnly. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + searchAssociations(qTerms: any[], qPage: any, qOptions: any, callback?: any): ng.IPromise; + + /** + * Searches for one or more terms in the values of a Qlik Sense app. + * @param {array} qTerms - Terms to search for. + * @param {object} qPage - Properties: + * Name | Type | Description + * qOffset | Number | Position from the top, starting from 0. + * qCount | Number | Number of search results to return. + * qGroupOptions | Array | This parameter is optional. Options of the search groups. If this property is not set, all values are returned. + * qGroupItemOptions | Array | This parameter is optional. Options of the search group items. If this property is not set, all values are returned. + * qOptions | Object | Optional. Search options. Properties: + * Name | Type | Description + * qSearchFields | Array | List of search fields. + * qContext | | Search context. Can be one of: + * # Cleared: In this mode, the first step is to clear any current selections in the app. The second step is to search for one or more terms in the values of the app. + * # LockedFieldsOnly: In this mode, the search applies only to the values associated with the selections made in locked fields, ignoring selections in any unlocked field. If no locked fields, the behavior is identical to the Cleared context. You cannot make any new selections in a locked field. You can get search hits for the associated values of a locked field but you cannot get the search hits for the non associative values. + * # CurrentSelections: In this mode, the current selections are kept (if any). Search for one or more terms in the values of the app. New selections are made on top of the current selections. If no selections were made before the search, this mode is identical to the Cleared context. + * | | Default value is LockedFieldsOnly. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + searchResults(qTerms: any[], qPage: any, qOptions?: any, callback?: any): ng.IPromise; + + /** + * Returns suggestions of words from the values entered in the search. Acts as a helper for the searchAssociations method. + * @param {array} qTerms - Terms to search for. + * @param {object} [qOptions] - Optional. Search options. Properties: + * Name | Type | Description + * qSearchFields | Array | List of search fields. + * @param {function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + searchSuggest(qTerms: any[], qOptions?: any, callback?: any): ng.IPromise; + + /** + * Makes a selection based on searchAssociation results. + * @param {number} qMatchIx - Index to search result. + * @param {array} qTerms - Values to select. + * @param {object} qOptions - Values to select. + * @param {array} [qTerms] - Optional. Parameter sent to the Qlik engine containing information about the search fields and the search context. + * @param {object} [qSoftLock] - Optional. This parameter was deprecated in version 2.0 and is ignored in newer versions. Use the qOtions.qContext parameter instead. + * @return {Promise} - A promise of a Qlik engine reply. + */ + selectAssociations(qMatchIx: number, qTerms: any[], qOptions?: any, qSoftLock?: any): ng.IPromise; + + /** + * Creates a QSelectionState object that encapsulates the selection state. Entry point to the Selection API. + * @param {string} [state] - Optional. Sets the state. Default is $. + */ + selectionState(state?: string): SelectionStateAPI.IQSelectionState; + + /** + * Unlocks all selections that has previously been locked. + * @param {string} [state] - Optional. Alternate state name. Default: $ Introduced in version 2.1. + */ + unlockAll(state?: string): ng.IPromise; + } +} + +declare namespace BookmarkAPI { + interface IBookmark { + /** + * Applies a bookmark. + * @param {string} id - Bookmark id. + * @return {Promise} - A promise of a Qlik engine reply. + */ + apply(id: string): ng.IPromise; + + /** + * Creates a bookmark based on the current selection. + * @param {string} title - Bookmark title. + * @param {string} description - Bookmark description. + * @param {string} [sheetId] - Optional. Bookmark sheet id. Introduced in version 2.2. + * @return {Promise} - A promise of a Qlik engine reply. + */ + create(title: string, description: string, sheetId?: string): ng.IPromise; + + /** + * Removes a bookmark. + * @param {string} id - Bookmark id. + * @return {Promise} - A promise of a Qlik engine reply. + */ + remove(id: string): ng.IPromise; + } +} + +declare namespace FieldAPI { + interface IQField { + /** + * Clears a field selection. + * @return {Promise} - A promise. + */ + clear(): ng.IPromise; + + /** + * Clears all fields except the selected one. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + clearOther(softlock?: boolean): ng.IPromise; + + /** + * Gets field data. The values are available as QFieldValue in array field.rows and will updated when the selection state changes. Notification OnData will be triggered after each update. + * @param {boolean} [options] - Optional. Properties: + * Name | Type | Description + * rows | Number | Number of rows to fetch. Default: 200. + * frequencyMode | String | Can be one of: + * # V=Absolute + * # P=Percent + * # R=Relative + * # N=No frequency + * | | Default: V. + * @return {IQField} - The field object. + */ + getData(options?: boolean): IQField; + + /** + * Gets more data for your field. Notification OnData is triggered when complete. + * @return {IQField} - The field object. + */ + getMoreData(): IQField; + + /** + * Locks a field selection. + * @return {Promise} - A promise. + */ + lock(): ng.IPromise; + + /** + * Selects field values using indexes. + * @param {number[]} Array - Array of index values to select + * @param {boolean} [toggle] - Optional. If true, toggle selected state. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + select(Array: number[], toggle?: boolean, softlock?: boolean): ng.IPromise; + + /** + * Selects all values in a field. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectAll(softlock?: boolean): ng.IPromise; + + /** + * Selects alternative values in a field. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectAlternative(softlock?: boolean): ng.IPromise; + + /** + * Selects excluded values in a field. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectExcluded(softlock?: boolean): ng.IPromise; + + /** + * Selects matching field values. + * @param {string} match - Match string. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectMatch(match: string, softlock?: boolean): ng.IPromise; + + /** + * Selects possible values in a field. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectPossible(softlock?: boolean): ng.IPromise; + + /** + * Selects specific values in a field. + * @param {array} array - Array of qFieldValues to select. A simplified syntax with strings or numbers also works since version 1.1. + * For a numeric field you need to provide the numeric value. + * @param {boolean} [toggle] - Optional. If true, toggle selected state. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + selectValues(array: IQFieldValue[], toggle?: boolean, softlock?: boolean): ng.IPromise; + + /** + * Toggles a field selection. + * @param {string} match - Match string. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + toggleSelect(match: string, softlock?: boolean): ng.IPromise; + + /** + * Unlocks field selections. + * @return {Promise} - A promise. + */ + unlock(): ng.IPromise; + + /** + * Field values. You need to call getData() method to make this available. Introduced in 2.1. + */ + rows: IQFieldValue[]; + + /** + * Optional. Number of different values. Only after getData() call. Introduced in 2.1. + */ + rowCount: number; + + /** + * Optional. Object with number of values in different states. Only after getData() call. Introduced in 2.1. + */ + qStateCounts: any; + } + + interface IQFieldValue { + /** + * Cell value formatted as set up in properties. + */ + qText: string; + + /** + * Cell value index. + */ + qElemNumber: number; + + /** + * Cell state. + */ + qState: any; + + /** + * Optional. Cell numeric value, if cell is numeric. + */ + qNum?: number; + + /** + * Optional. Frequency, if calculated by the Qlik engine. + */ + qFrequency?: string; + + /** + * Selects a field value. + * @param {boolean} [toggle] - Optional. If true, toggle selected state. + * @param {boolean} [softlock] - Optional. If true, locked selections can be overridden. + * @return {Promise} - A promise. + */ + select(toggle?: boolean, softlock?: boolean): ng.IPromise; + } +} + +declare namespace GlobalAPI { + interface IGlobal { + /** + * Cancels an ongoing reload. The reload of the app is stopped. + * @return {Promise} - A promise of a Qlik engine reply. + */ + cancelReload(): ng.IPromise; + + /** + * Gets a list of Qlik Sense apps that you potentially can connect to and registers a callback to receive the data. + * Calling the getAppList method opens a WebSocket, gets the app list, and then keeps the WebSocket open for you to make other calls as well. + * @param {Function} callback - Callback method. + */ + getAppList(callback: any): void; + + /** + * Gets information (user directory and user id) about the authenticated user. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getAuthenticatedUser(callback?: any): ng.IPromise; + + /** + * Gets information about progress of doReload and doSave calls. + * @param {Number} qRequestId - Request id from doReload call or 0. + * Complete information is returned if the identifier of the request is specified. + * If qRequestId = 0, less information is returned. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getProgress(qRequestId: number, callback?: any): ng.IPromise; + + /** + * Gets the product version. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getProductVersion(callback?: any): ng.IPromise; + + /** + * Gets the Qlik product name. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getQTProduct(callback?: any): ng.IPromise; + + /** + * Gets the Qlik Sense version number. + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise. + */ + getQvVersion(callback?: any): ng.IPromise; + + /** + * Gets information if the user is working in personal mode (returns true if Qlik Sense Desktop is used) or not (returns false if Qlik Sense Desktop is not used). + * @param {Function} [callback] - Optional. Callback method. + * @return {Promise} - A promise of a Qlik engine reply. + */ + isPersonalMode(callback?: any): ng.IPromise; + } +} + +declare namespace NavigationAPI { + type NavigationModeType = "ANALYSIS" | "EDIT"; + type NavigationErrorType = "NOSUCHSHEET" | "NOCURRENTSHEET" | "NOSUCHSTORY"; + + /** + * The navigation result object. + */ + interface NavigationResult { + /** + * Returns true if successful. + */ + success: boolean; + + /** + * The new sheet ID. + */ + sheetId: string; + + /** + * The new story ID. + */ + storyId: string; + + /** + * The new mode. + */ + mode: string; + + /** + * Error code. Can be: NOSUCHSHEET | NOCURRENTSHEET | NOSUCHSTORY + */ + error: NavigationErrorType; + + /** + * Error message, for example 'No current sheet'. + */ + errorMsg: string; + } + + /** Navigation API for Qlik Sense. The Navigation API allows you to navigate + * within a Qlik Sense app, and is meant to be used in visualization extensions + * and will not work in Mashup scenarios. + */ + interface INavigation { + /** + * Used for analysis mode. + */ + edit: "edit"; + + /** + * Used for edit mode. + */ + analysis: "analysis"; + + /** + * Gets the current sheet ID. + * @return {NavigationResult} - A navigation result object. + */ + getCurrentSheetId(): NavigationResult; + + /** + * Gets the current mode. + * @return {string} - The current mode as a string. + */ + getMode(): string; + + /** + * Navigate to a given sheet in the current app. The method will return before the actual navigation takes place. + * @param {string} sheetId - Set the sheet ID to navigate to. + * @return {NavigationResult} - A navigation result object. + */ + gotoSheet(sheetId: string): NavigationResult; + + /** + * Navigate to a given story in the current app. The method will return before the actual navigation takes place. + * @param {string} storyId - Set the story ID to navigate to. + * @return {NavigationResult} - A navigation result object. + */ + gotoStory(storyId: string): NavigationResult; + + /** + * Checks if a given mode is allowed. + * @param {NavigationModeType} mode - Can be one of the strings: edit | analysis + * or one of the constants: qlik.navigation.EDIT | qlik.navigation.ANALYSIS + * @return {boolean} - A Boolean value (true or false). + */ + isModeAllowed(mode: NavigationModeType): boolean; + + /** + * Go to the next sheet in the current app. It will do nothing if you do not have sheets in the current context. + * The method will return before the actual navigation takes place. + * @return {NavigationResult} - A navigation result object. + */ + nextSheet(): NavigationResult; + + /** + * Jumps to the previous sheet in the current app. It will do nothing if you do not have sheets in the current context. + * The method will return before the actual navigation takes place + * @return {NavigationResult} - A navigation result object. + */ + prevSheet(): NavigationResult; + + /** + * Sets the current working mode of Qlik Sense. + * @param {string | constant} mode - Can be one of the strings: edit | analysis + * or one of the constants: qlik.navigation.EDIT | qlik.navigation.ANALYSIS + * @return {NavigationResult} - A navigation result object. + */ + setMode(mode: string): NavigationResult; + + /** + * Switches the working mode of Qlik Sense. + * @param {NavigationModeType} mode - Can be one of the strings: edit | analysis + * or one of the constants: qlik.navigation.EDIT | qlik.navigation.ANALYSIS + * @return {NavigationResult} - A navigation result object. + */ + switchMode(mode: NavigationModeType): NavigationResult; + } +} + +declare namespace SelectionStateAPI { + interface IQFieldSelections { + /** + * Selection state for a field. + */ + fieldName: string; + + /** + * Sort index. Starting from 0. + */ + qSortIndex: number; + + /** + * Reference to the field. + */ + field: FieldAPI.IQField; + + /** + * Defines if the field is locked. + */ + locked: boolean; + + /** + * Defines if the field is numeric. + */ + isNumeric: boolean; + + /** + * Total number of values in the field. + */ + totalCount: number; + + /** + * Number of selected values. + */ + selectedCount: number; + + /** + * Number of values that will be listed. + */ + qSelectionThreshold: number; + + /** + * Object with number of values in different states. + */ + qStateCounts: any; + + /** + * Concatenated string of selected values if number of values are less than the threshold, or if the string is of format "7 of 123". + */ + qSelected: string; + + /** + * Array with maximum of qSelectionThreshold values that are selected. For each value, the text plus the selection mode (NORMAL/AND/NOT) + */ + selectedValues: number[]; + + /** + * Array with maximum of qSelectionThreshold values that are not selected. For each value, the text plus the selection mode (NORMAL/AND/NOT) + */ + notSelectedValues: number[]; + } + + interface IQSelectionState { + /** + * State name. $ for default state. + */ + stateName: string; + + /** + * Selections + */ + selections: IQFieldSelections; + + /** + * Number of back steps available. + */ + backCount: number; + + /** + * Number of forward steps available. OnData notification will be triggered after each update. + */ + forwardCount: number; + + /** + * Cleara all selections in this state. + * @param {boolean} lockedAlso - Use to also clear locked fields. + * @return {Promise} - A promise of a Qlik engine reply. + */ + clearAll(lockedAlso: boolean): ng.IPromise; + + /** + * Locks all selections in this state. + * @return {Promise} - A promise of a Qlik engine reply. + */ + lockAll(): ng.IPromise; + + /** + * Unlocks all selections in this state. + * @return {Promise} - A promise of a Qlik engine reply. + */ + unlockAll(): ng.IPromise; + } +} + +declare namespace TableAPI { + interface IQTable { + /** + * Data rows. + */ + rows: IQRow[]; + + /** + * Header information. + */ + headers: IQHeader[]; + + /** + * Total information for measures. + */ + totals: IQMeasureCell[]; + + /** + * Total number of rows for the qHyperCube, including rows not fetched from the server. + */ + rowCount: number; + + /** + * Total number of columns for the qHyperCube. + */ + colCount: number; + + /** + * Exports data of the underlying hypercube in OOXML or CSV format. + * @param {object} [options] - Optional. Properties: + * Name | Type | Description + * format | String | Data format. Can be one of: + * # OOXML: open XML, default + * # CSV_C: comma separated CSV + * # CSV_T: tab separated CSV + * filename | String | Name of the exported file after download from browser. This parameter is optional and only used in desktop. + * state | String | Can be: + * # A: all values + * # P: possible values (default) + * download | Boolean | Automatically start download of file (with window.open). + * @param {Function} [callback] - Optional. Callback function returning the link to the exported file. + */ + exportData(options?: any, callback?: any): void; + + /** + * Gets the column number for a given field name. + * @param {string} fld - Field name. + * @return {number} - Column number, starting with zero. Undefined if no column with that name exists. + */ + getColByName(fld: string): number; + + /** + * Gets more data for your qHyperCube. + */ + getMoreData(): any; + } + + interface IQHeader { + /** + * Column title. + */ + qFallbackTitle: string; + + /** + * Can be: + * # A: ascending + * # D: descending + */ + qSortIndicator: string; + + /** + * True indicates if this is the first column for sorting. + */ + isOrderedBy: boolean; + + /** + * True indicates if the sort order is reversed for this column. + */ + qReverseSort: boolean; + + /** + * Column number. + */ + col: number; + + /** + * Optional. Number of different values. Only used for dimensions. + */ + qCardinal?: number; + + /** + * Optional. Object with number of values in different states. Only used for dimensions. + */ + qStateCounts?: any; + + /** + * Optional. Field object with methods to manipulate the underlying field. Only used for dimensions. + */ + field?: any; + + /** + * Optional. Minimum value. Only used for measures. + */ + qMin?: number; + + /** + * Optional. Maximum value. Only used for measures. + */ + qMax?: number; + + /** + * Optional. Error code for this column. Only if column has an error. Introduced in version 2.2. + */ + errorCode?: number; + + /** + * Error message for this column. Only if column has an error. Introduced in version 2.2. + */ + errorMessage: number; + + /** + * Sets this column to be the first in the sort order. + */ + orderBy(): void; + + /** + * Reverses the sort order for this column. + */ + reverseOrder(): void; + + /** + * Select a range in this measure. + * @param {number} min - Sets the minimum value of the range. + * @param {number} max - Sets the maximum value of the range. + * @param {boolean} [inclMin] - Optional. Set to true to include minimum value. + * @param {boolean} [inclMax] - Optional. Set to true to include maximum value. + * @return {Promise} - A promise. + */ + selectRange(min: number, max: number, inclMin?: boolean, inclMax?: boolean): ng.IPromise; + } + + interface IQRow { + /** + * Dimension cells. + */ + dimensions: IQDimensionCell[]; + + /** + * Measure cells. + */ + measures: IQMeasureCell[]; + + /** + * All cells, in the order they are defined in the properties. + */ + cells: any[]; + } + + interface IQDimensionCell extends IQMeasureCell { + /** + * Cell value index. + */ + qElemNumber: number; + + /** + * Cell state. + */ + qState: string; + + /** + * Selects the value in this cell. + */ + select(): void; + } + + interface IQMeasureCell { + /** + * Cell value formatted as set up in properties. + */ + qText: string; + + /** + * Optional. Cell numeric value, if cell is numeric. + */ + qNum?: number; + + /** + * Gets the value of this cell as a percentage of the total. Might be more than 100% if this is an average. + */ + getPercent(): number; + + /** + * Gets the value of this cell as a percentage of the maximum. + */ + getPercentOfMax(): number; + } +} + +declare namespace VariableAPI { + interface IVariable { + /** + * Creates a variable. + * @param {string | object} qProp - Variable name or properties. Properties: + * Name | Type | Description + * qInfo.qId | String | Optional. Variable id. If the selected ID is already in use, a new ID is automatically set by the engine. + * qName | String | Variable name. The name must be unique. + * qComment | String | Optional. Comment related to the variable. + * qDefinition | String | Optional. Variable definition. + * qNumberPresentation | Object | Optional. Defines the format of the value. + * qIncludeInBookmark | Boolean | Optional. Set to true to update the variable when applying a bookmark. The variable value will be persisted in the bookmark. + * @return {Promise} - Returns a promise of a variable model. + */ + create(qProp: string | any): ng.IPromise; + + /** + * Creates a session variable, that is a temporary variable which is not persisted and needs to be recreated for each new session. + * @param {object} qProp - Variable properties: + * Name | Type | Description + * qInfo.qId | String | Optional. Variable id. + * qName | String | Variable name. + * qComment | String | Optional. Comment. + * qDefinition | String | Optional. Variable definition. + * qNumberPresentation | Object | Optional. + * qIncludeInBookmark | Boolean | Optional. Include in bookmark flag. + * @return {Promise} - A promise of a variable model. + */ + createSessionVariable(qProp: any): ng.IPromise; + + /** + * Gets a variable by id. + * @param {string} qId - Variable id. + * @return {Promise} - A promise of a variable model. + */ + get(qId: string): ng.IPromise; + + /** + * Gets a variable by name. + * @param {string} qName - Variable name. + * @return {Promise} - A promise of a variable model. + */ + getByName(qName: string): ng.IPromise; + + /** + * Gets variable content. + * @param {string} name - Variable name. + * @param {Function} callback - Callback to receive the content. + * @return {Promise} - A promise of a Qlik engine reply. + */ + getContent(name: string, callback: any): ng.IPromise; + + /** + * Sets the content of a variable. + * @param {string} name - Variable name. + * @param {string} content - Variable content. + * @return {Promise} - A promise of a Qlik engine reply. + */ + setContent(name: string, content: string): ng.IPromise; + + /** + * Sets a numeric value as a variable. + * @param {string} qName - Variable name. + * @param {Number} qVal - Variable value. + * @return {Promise} - A promise of a Qlik engine reply. + */ + setNumValue(qName: string, qVal: number): ng.IPromise; + + /** + * Sets variable string value. + * @param {string} qName - Variable name. + * @param {string} qVal - Variable value. + * @return {Promise} - A promise of a Qlik engine reply. + */ + setStringValue(qName: string, qVal: string): ng.IPromise; + } +} + +declare namespace VisualizationAPI { + type VisualizationType = "barchart" | "combochart" | "gauge" | "kpi" | "linechart" | "piechart" | "pivot-table" | + "scatterplot" | "table" | "treemap" | "extension"; + + interface IVisualization { + /** + * Create a new visualization on the fly based on a session object and will not be persisted in the app. + * @param {VisualizationType} type - Visualization type. Can be: + * # barchart + * # combochart + * # gauge + * # kpi + * # linechart + * # piechart + * # pivot-table + * # scatterplot + * # table + * # treemap + * # extension + * @param {array} [cols] - Optional. Column definitions, dimensions and measures. Each entry can be of the following structures: + * # String + * # NxDimension + * # NxMeasure + * If the NxDimension or the NxMeasure refer to a library dimension or a library measure, you also need to add qType : "measure" or "dimension". + * @param {object} [options] - Optional. Options to set. + * @return {Promise} - A promise of a QVisualization. + */ + create(type: VisualizationType, cols?: any[], options?: any): ng.IPromise; + + /** + * Gets an existing visualization. + * @param {string} id - Id for an existing visualization. + * @return {Promise} - A promise of a QVisualization. + */ + get(id: string): ng.IPromise; + } + + interface IQVisualization { + /** + * Table object for this visualization. Only for visualizations built on a hypercube. + */ + table: TableAPI.IQTable; + + /** + * Closes a visualization and releases the session object. + * @return {Promise} - A promise. + */ + close(): ng.IPromise; + + /** + * Tells the visualization it has been resized and should re-paint. + */ + resize(): void; + + /** + * Sets options for a visualization. + * @param {object} options - Options to set (using applyPatches). + */ + setOptions(options?: any): void; + + /** + * Shows the visualization in an HTML element. + * @param {Element | string} [element] - Optional. HTML element or HTML element ID. + * @param {object} [options] - Optional. + * Name | Type | Description + * noInteraction | Boolean | Set to true if you want to disable all interaction, including selections, in the visualization. + * noSelections | Boolean | Set to true if you want to disable selections in the visualization. + * | | Parameter introduced in version 3.0. + */ + show(element?: any | string, options?: any): void; + } +} + +declare namespace ExtensionAPI { + + + interface IExtensionModel { + + } + + interface IExtensionComponent { + model: IExtensionModel; + } + + interface IExtensionScope extends ng.IScope { + component: IExtensionComponent; + } + + + //ExtensionAPI + type SelectionModeType = "CONFIRM" | "QUICK"; + + interface IInitialProperties { + qHyperCubeDef?: any; //IHyperCubeDef; + qListObjectDef?: any; //IListObjectDef; + fixed?: boolean; + width?: number; + percent?: boolean; + selectionMode?: SelectionModeType; + } + + interface ISupport { + snapshot?: boolean; + export?: boolean; + exportData?: boolean; + } + + interface IExtension { + definition?: IDefinition; + paint?: ($element: HTMLElement, layout?: any) => void; + initialProperties?: IInitialProperties; + template?: string; + controller?: any; + support?: ISupport; + } + + interface ISupport { + snapshot?: boolean; // | () => boolean; + export?: boolean; // | () => boolean; + canTakeSnapshot?: boolean; + } + + interface IInitialProperties { + // qHyperCubeDef: IVisualizationHyperCubeDef; + // qListObjectDef: IVis + + //[""]: + } + + //#region IDefinition + type ExpressionType = "always" | "optional" | ""; + + type func = () => T; + type valueOrfunc = T | func; + + //#region Controls + interface ICustomControlOption { + value: string; + label: string; + } + + interface ICustomControl { + type: string; + label: string; + ref: string; + } + + interface ICustomString extends ICustomControl { + defaultValue: string; + expression: ExpressionType; + show: valueOrfunc; + maxlength: number; + } + + interface ICustomNumber extends ICustomControl { + defaultValue: number; + min: number; + max: number; + } + + interface ICustomInteger extends ICustomNumber { + } + + interface ICustomArray extends ICustomControl { + itemTitleRef: string; + addTranslation: string; + allowAdd: boolean; + allowMove: boolean; + allowRemove: boolean; + } + + interface ICustomButton extends ICustomControl { + label: string; + component: "button"; + action: valueOrfunc; + } + + interface ICustomButtonGroup extends ICustomControl { + component: "buttongroup"; + defaultValue: string; + options: valueOrfunc; + } + + interface ICustomCheckBox extends ICustomControl { + component: "checkbox"; + defaultValue: boolean; + } + + interface ICustomColorPicker extends ICustomControl { + component: "color-picker"; + defaultValue: number; + } + + interface ICustomDropDownList extends ICustomControl { + component: "dropdown"; + defaultValue: string; + options: valueOrfunc; + } + + interface ICustomLink { + type: string; + component: "link"; + label: string; + url: string; + } + + interface ICustomMedia extends ICustomControl { + component: "media"; + layoutRef: string; + } + + interface ICustomRadioButton extends ICustomControl { + component: "radiobuttons"; + defaultValue: string; + options: valueOrfunc; + } + + interface ICustomSlider extends ICustomControl { + component: "slider"; + defaultValue: number; + min: number; + max: number; + step: number; + } + + interface ICustomRangeSlider extends ICustomControl { + component: "slider"; + defaultValue: number[]; + min: number; + max: number; + step: number; + } + + interface ICustomSwitch { + component: "switch"; + defaultValue: boolean; + options: valueOrfunc; + } + + interface ICustomText { + type: "text"; + component: "text"; + label: string; + } + + interface ICustomTextArea extends ICustomControl { + component: "textarea"; + rows: number; + maxlength: number; + defaultValue: string; + show: valueOrfunc; + } + //#endregion + + interface IDefinition { + type: "items"; + component: "accordion"; + items: IItems; + } + + interface IItems { + dimentions?: IDimensions; + measures?: IMeasures; + appearance?: IAppearance; + sorting?: ISorting; + AddOns?: IAddOns; + [other: string]: any; + } + + interface IAddOns { + uses: "addons"; + } + + interface ISorting { + uses: "sorting"; + } + + interface IDimensions { + uses: "dimensions"; + min?: number; + max?: number; + } + + interface IAppearance { + uses: "settings"; + min?: number; + max?: number; + items: any; + } + + //?Das selbe wie Appearance? + interface ISettings { + uses: "settings"; + min?: number; + max?: number; + } + + interface IMeasures { + uses: "measures"; + min?: number; + max?: number; + } + + //#endregion +} + +declare module "qlik" { + var e: RootAPI.IRoot; export = e; +} + +interface IQVAngular { + /** + * Register a new directive with the compiler. + * + * @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind) + * @param directiveFactory An injectable directive factory function. + */ + directive(name: string, directiveFactory: ng.Injectable): void; + directive(object: { [directiveName: string]: ng.Injectable }): void; + + filter(name: string, filterFactoryFunction: ng.Injectable): void; + filter(object: { [name: string]: ng.Injectable }): void; + + /** + * Register a service constructor, which will be invoked with new to create the service instance. This is short for registering a service where its provider's $get property is a factory function that returns an instance instantiated by the injector from the service constructor function. + * + * @param name The name of the instance. + * @param serviceConstructor An injectable class (constructor function) that will be instantiated. + * @return Returns the constructed singleton of the service class/function. + */ + service(name: string, serviceConstructor: ng.Injectable): T; + service(object: { [name: string]: ng.Injectable }): T; + + //provider(name: string, serviceProviderFactory: ng.IServiceProviderFactory): void; + //provider(name: string, serviceProviderConstructor: ng.IServiceProviderClass): void; +} + +declare module "qvangular" { + var e: IQVAngular; export = e; +} \ No newline at end of file diff --git a/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts b/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts new file mode 100644 index 0000000000..032b755b34 --- /dev/null +++ b/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts @@ -0,0 +1,3 @@ +import * as qlik from "qlik"; + +const t = qlik.currApp(); \ No newline at end of file diff --git a/qlik-visualizationextensions/tsconfig.json b/qlik-visualizationextensions/tsconfig.json new file mode 100644 index 0000000000..47e4903e2e --- /dev/null +++ b/qlik-visualizationextensions/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "amd", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "qlik-visualizationextensions-tests.ts" + ] +} \ No newline at end of file diff --git a/qlik-visualizationextensions/tslint.json b/qlik-visualizationextensions/tslint.json new file mode 100644 index 0000000000..965a36a968 --- /dev/null +++ b/qlik-visualizationextensions/tslint.json @@ -0,0 +1,7 @@ +{ "extends": "../tslint.json", + "rules": { + "forbidden-types": false, + "no-empty-interface": false, + "interface-name": false + } +} \ No newline at end of file From 47134067acfda2acc7230e44d1c2b7ba9c6ef85b Mon Sep 17 00:00:00 2001 From: Konrad Mattheis Date: Thu, 23 Feb 2017 16:08:25 +0100 Subject: [PATCH 199/797] fixes BOM & module to run npm test Signed-off-by: Konrad Mattheis --- qlik-visualizationextensions/index.d.ts | 4 ++-- .../qlik-visualizationextensions-tests.ts | 2 +- qlik-visualizationextensions/tsconfig.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qlik-visualizationextensions/index.d.ts b/qlik-visualizationextensions/index.d.ts index 8a9c145969..c7eb32273c 100644 --- a/qlik-visualizationextensions/index.d.ts +++ b/qlik-visualizationextensions/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for qlik-visualizationextensions +// Type definitions for qlik-visualizationextensions 3.2 // Project: http://help.qlik.com/en-US/sense-developer/3.2/Subsystems/Extensions/Content/extensions-introduction.htm // Definitions by: Konrad Mattheis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -791,7 +791,7 @@ declare namespace BackendAPI { * @param {array} qPages - An array of request page objects. * @param {number} qZoomFactor - Zoom factor. * If set to -1, the Qlik engine decides of the zoom factor. - * If qReductionMode is D1 or S, the zoom factor is 2â¿. If the zoom factor is 5, the data are reduced by a factor 32. + * If qReductionMode is D1 or S, the zoom factor is 2n. If the zoom factor is 5, the data are reduced by a factor 32. * If qReductionMode is C, the zoom factor defines the number of centroids. * @param {string} qReductionMode - Reduction mode.Can be: * # N for no data reduction. diff --git a/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts b/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts index 032b755b34..2e1d738198 100644 --- a/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts +++ b/qlik-visualizationextensions/qlik-visualizationextensions-tests.ts @@ -1,3 +1,3 @@ -import * as qlik from "qlik"; +import qlik=require("qlik"); const t = qlik.currApp(); \ No newline at end of file diff --git a/qlik-visualizationextensions/tsconfig.json b/qlik-visualizationextensions/tsconfig.json index 47e4903e2e..f4a5bc132a 100644 --- a/qlik-visualizationextensions/tsconfig.json +++ b/qlik-visualizationextensions/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "module": "amd", + "module": "commonjs", "lib": [ "es6", "dom" From 9608cfb4eff05e0542e5671cc053563f9fe17ca7 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Thu, 23 Feb 2017 08:41:38 -0800 Subject: [PATCH 200/797] Fix packages that used 'jasmine' for tests. Jasmine requires TypeScript 2.1, but since these packages only use it for tests, they should stop depending on it and stay TS2.0 compatible. Similar for 'react'. --- google.analytics/google.analytics-tests.ts | 4 ++-- jasmine-fixture/index.d.ts | 10 +++++++--- jasmine-fixture/jasmine-fixture-tests.ts | 2 -- js-quantities/js-quantities-tests.ts | 17 ++++++++++++++++- react-ga/react-ga-tests.tsx | 5 +++-- react-highlighter/index.d.ts | 3 +++ redux-ui/index.d.ts | 2 ++ reflux/reflux-tests.ts | 1 - .../supertest-as-promised-tests.ts | 6 +++--- tcomb/tcomb-tests.ts | 7 +++---- 10 files changed, 39 insertions(+), 18 deletions(-) diff --git a/google.analytics/google.analytics-tests.ts b/google.analytics/google.analytics-tests.ts index 6b7962899b..32df930cc9 100644 --- a/google.analytics/google.analytics-tests.ts +++ b/google.analytics/google.analytics-tests.ts @@ -1,5 +1,5 @@ - -/// +declare function describe(desc: string, fn: () => void): void; +declare function it(desc: string, fn: () => void): void; describe("tester Google Analytics Tracker _gat object", () => { it("can set ga script element", () => { diff --git a/jasmine-fixture/index.d.ts b/jasmine-fixture/index.d.ts index 8ea5956f1e..9a8c7b98b2 100644 --- a/jasmine-fixture/index.d.ts +++ b/jasmine-fixture/index.d.ts @@ -2,10 +2,14 @@ // Project: https://github.com/searls/jasmine-fixture // Definitions by: Craig Brett // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 -/** Affixes the given jquery selectors into the body and will be removed after each spec -* @param {string} selector The JQuery selector to be added to the dom -*/ +/// + +/** + * Affixes the given jquery selectors into the body and will be removed after each spec + * @param {string} selector The JQuery selector to be added to the dom + */ declare function affix(selector: string): JQuery; interface JQuery { diff --git a/jasmine-fixture/jasmine-fixture-tests.ts b/jasmine-fixture/jasmine-fixture-tests.ts index b0ec42d512..74eb750590 100644 --- a/jasmine-fixture/jasmine-fixture-tests.ts +++ b/jasmine-fixture/jasmine-fixture-tests.ts @@ -1,8 +1,6 @@ -/// /// /// - describe("Jasmine fixture extension", () => { describe("Affixes dom elements to body", () => { it("Inserts a new element on affix", () => { diff --git a/js-quantities/js-quantities-tests.ts b/js-quantities/js-quantities-tests.ts index 95819381b5..ed69816dc3 100644 --- a/js-quantities/js-quantities-tests.ts +++ b/js-quantities/js-quantities-tests.ts @@ -1,6 +1,21 @@ -/// import Qty from "js-quantities"; +declare function describe(desc: string, fn: () => void): void; +declare function it(desc: string, fn: () => void): void; +interface Expect { + not: this; + toBe(y: T): void; + toEqual(y: T): void; + toBeTruthy(): void; + toBeNull(): void; + toBeCloseTo(this: Expect, x: number, sigFigs: number): void; + toThrow(this: Expect<() => void>, msg?: string): void; + toContain(this: Expect, x: U): void; +}; +declare function expect(x: T): Expect; +declare function beforeEach(f: () => void): void; +declare function afterEach(f: () => void): void; + // From project readme let qty: Qty; diff --git a/react-ga/react-ga-tests.tsx b/react-ga/react-ga-tests.tsx index 10770f04f5..0db1be21c2 100644 --- a/react-ga/react-ga-tests.tsx +++ b/react-ga/react-ga-tests.tsx @@ -1,7 +1,8 @@ -/// - import * as ga from "react-ga"; +declare function describe(desc: string, f: () => void): void; +declare function it(desc: string, f: () => void): void; + describe("Testing react-ga initialize object", () => { it("Able to initialize react-ga object", () => { ga.initialize("UA-65432-1"); diff --git a/react-highlighter/index.d.ts b/react-highlighter/index.d.ts index 74468c9b7c..6e34a4dbe3 100644 --- a/react-highlighter/index.d.ts +++ b/react-highlighter/index.d.ts @@ -2,6 +2,9 @@ // Project: https://github.com/helior/react-highlighter // Definitions by: Pedro Pereira // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// declare var Highlight: any; export = Highlight; diff --git a/redux-ui/index.d.ts b/redux-ui/index.d.ts index 3b1f8f4a58..1c3468233d 100644 --- a/redux-ui/index.d.ts +++ b/redux-ui/index.d.ts @@ -2,7 +2,9 @@ // Project: https://github.com/tonyhb/redux-ui // Definitions by: Andy Shu Xin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 +/// import * as Redux from 'redux'; export interface uiParams { diff --git a/reflux/reflux-tests.ts b/reflux/reflux-tests.ts index 7a392282fa..150e40db03 100644 --- a/reflux/reflux-tests.ts +++ b/reflux/reflux-tests.ts @@ -1,5 +1,4 @@ import Reflux = require("reflux"); -import React = require("react"); var syncActions = Reflux.createActions([ "statusUpdate", diff --git a/supertest-as-promised/supertest-as-promised-tests.ts b/supertest-as-promised/supertest-as-promised-tests.ts index c20f9a92b6..35cbc68388 100644 --- a/supertest-as-promised/supertest-as-promised-tests.ts +++ b/supertest-as-promised/supertest-as-promised-tests.ts @@ -1,9 +1,9 @@ - -/// - import * as request from 'supertest-as-promised'; import * as express from 'express'; +declare function describe(desc: string, f: () => void): void; +declare function it(desc: string, f: () => void): void; + var app = express(); // chain your requests like you were promised: diff --git a/tcomb/tcomb-tests.ts b/tcomb/tcomb-tests.ts index 02982faae7..7aa7d9a786 100644 --- a/tcomb/tcomb-tests.ts +++ b/tcomb/tcomb-tests.ts @@ -1,8 +1,7 @@ -// ReSharper disable InconsistentNaming -// ReSharper disable WrongExpressionStatement - /// -/// + +declare function describe(desc: string, f: () => void): void; +declare function it(desc: string, f: () => void): void; // tests adapted from/for tcomb's test folder From 23cfd3e510709aff50e42ab3c7fec666108716e4 Mon Sep 17 00:00:00 2001 From: Terry Bayne Date: Thu, 23 Feb 2017 12:39:17 -0600 Subject: [PATCH 201/797] 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 202/797] 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 203/797] 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 28cbb4fcb79d1b5a54c38d80d919e703aeba0f8d Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Fri, 24 Feb 2017 09:19:08 +1100 Subject: [PATCH 204/797] added as a contributor --- keytar/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keytar/index.d.ts b/keytar/index.d.ts index e046223ee7..5a27c0c984 100644 --- a/keytar/index.d.ts +++ b/keytar/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for keytar 3.0.2 // Project: http://atom.github.io/node-keytar/ -// Definitions by: Milan Burda +// Definitions by: Milan Burda , Brendan Forster // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From def2102ff912d538d30b60f417937c5e135f46cc Mon Sep 17 00:00:00 2001 From: Matt C Date: Fri, 24 Feb 2017 09:41:18 +1100 Subject: [PATCH 205/797] [redux-form] Allow the "reduxForm()" function to wrap stateless functional components and not just class components. --- redux-form/lib/reduxForm.d.ts | 4 +++- redux-form/redux-form-tests.tsx | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/redux-form/lib/reduxForm.d.ts b/redux-form/lib/reduxForm.d.ts index 512797a39c..0350e69f03 100644 --- a/redux-form/lib/reduxForm.d.ts +++ b/redux-form/lib/reduxForm.d.ts @@ -1,5 +1,6 @@ import { Component, + StatelessComponent, ReactElement, SyntheticEvent, ReactEventHandler, @@ -20,7 +21,8 @@ export function reduxForm( ): FormDecorator; export interface FormDecorator { - (component: T): T & Form; + )>(component: T): + T & Form; } export interface Config { diff --git a/redux-form/redux-form-tests.tsx b/redux-form/redux-form-tests.tsx index 244ab11382..e660b6b0b5 100644 --- a/redux-form/redux-form-tests.tsx +++ b/redux-form/redux-form-tests.tsx @@ -50,3 +50,9 @@ class MyForm extends Component<{}, {}> { ); } } + +const MyStatelessFunctionalComponent: React.SFC = () =>
; + +reduxForm({ + form: 'mySFCForm' +})(MyStatelessFunctionalComponent); From 1753b8c0cb1a388dd202602da5e027a86af302ff Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Fri, 24 Feb 2017 11:00:39 +1100 Subject: [PATCH 206/797] updated tests to validate returned values --- keytar/keytar-tests.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/keytar/keytar-tests.ts b/keytar/keytar-tests.ts index 91a43ebbe9..d523050650 100644 --- a/keytar/keytar-tests.ts +++ b/keytar/keytar-tests.ts @@ -1,8 +1,13 @@ import keytar = require('keytar'); -keytar.addPassword('keytar-tests', 'username', 'password'); -keytar.deletePassword('keytar-tests', 'username'); -keytar.findPassword('keytar-tests'); -keytar.getPassword('keytar-tests', 'username'); -keytar.replacePassword('keytar-tests', 'username', 'password'); +let success: boolean = false; + +success = keytar.addPassword('keytar-tests', 'username', 'password'); +success = keytar.deletePassword('keytar-tests', 'username'); +success = keytar.replacePassword('keytar-tests', 'username', 'password'); + +let password: string = ''; + +password = keytar.findPassword('keytar-tests'); +password = keytar.getPassword('keytar-tests', 'username'); From 28be3862f5ad801e7e8c23ab6052bc5bdf4d926e Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Fri, 24 Feb 2017 01:15:16 +0100 Subject: [PATCH 207/797] Basic definitions for Google+ API (gapi.plus) --- gapi.plus/gapi.plus-tests.ts | 10 ++++ gapi.plus/index.d.ts | 111 +++++++++++++++++++++++++++++++++++ gapi.plus/tsconfig.json | 18 ++++++ 3 files changed, 139 insertions(+) create mode 100644 gapi.plus/gapi.plus-tests.ts create mode 100644 gapi.plus/index.d.ts create mode 100644 gapi.plus/tsconfig.json diff --git a/gapi.plus/gapi.plus-tests.ts b/gapi.plus/gapi.plus-tests.ts new file mode 100644 index 0000000000..12368dd63c --- /dev/null +++ b/gapi.plus/gapi.plus-tests.ts @@ -0,0 +1,10 @@ +/* Example taken from https://developers.google.com/+/web/people/ */ + +gapi.client.load('plus','v1', function(){ + var request = gapi.client.plus.people.get({ + 'userId': 'me' + }); + request.execute(function(resp) { + console.log('Retrieved profile for:' + resp.displayName); + }); +}); diff --git a/gapi.plus/index.d.ts b/gapi.plus/index.d.ts new file mode 100644 index 0000000000..3e24b79ce1 --- /dev/null +++ b/gapi.plus/index.d.ts @@ -0,0 +1,111 @@ +// Type definitions for Google+ Platform API 1.0 +// Project: https://developers.google.com/+/web/people/ +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +// See Google+ REST API Reference https://developers.google.com/+/web/api/rest/latest/ +declare namespace gapi.client.plus { + export namespace people { + + interface GetParameters { + userId: string; + } + function get(parameters: GetParameters): HttpRequest; + + interface SearchParameters { + query: string; + language?: string; + maxResults?: number; + pageToken?: string; + } + function search(parameters: SearchParameters): HttpRequest; + + // Search response + interface PeopleFeed { + kind: 'plus#peopleFeed'; + etag: string; + selfLink: string; + title: string; + nextPageToken: string; + totalItems: number; + items: Person[]; + } + + interface Person { + kind: 'plus#person'; + etag: string; + nickname: string; + occupation: string; + skills: string; + birthday: string; + gender: string; + emails: { + value: string; + type: string; + }[]; + urls: { + value: string; + type: string; + label: string; + }[]; + objectType: string; + id: string; + displayName: string; + name: { + formatted: string; + familyName: string; + givenName: string; + middleName: string; + honorificPrefix: string; + honorificSuffix: string; + }; + tagline: string; + braggingRights: string; + aboutMe: string; + relationshipStatus: string; + url: string; + image: { + url: string; + }; + organizations: { + name: string; + department: string; + title: string; + type: string; + startDate: string; + endDate: string; + location: string; + description: string; + primary: boolean; + }[]; + placesLived: { + value: string; + primary: boolean; + }[]; + isPlusUser: boolean; + language: string; + ageRange: { + min: number; + max: number; + }; + plusOneCount: number; + circledByCount: number; + verified: boolean; + cover: { + layout: string; + coverPhoto: { + url: string; + height: number; + width: number; + }; + coverInfo: { + topImageOffset: number; + leftImageOffset: number; + } + }; + domain: string; + } + } +} diff --git a/gapi.plus/tsconfig.json b/gapi.plus/tsconfig.json new file mode 100644 index 0000000000..1fc2401de1 --- /dev/null +++ b/gapi.plus/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "gapi.plus-tests.ts" + ] +} From 9e80f1e890b49247de1b9fd37b6d5c68f8fc52b3 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Fri, 24 Feb 2017 01:17:28 +0100 Subject: [PATCH 208/797] Add definitions for Google People API (gapi.people) --- gapi.people/gapi.people-tests.ts | 99 +++++++++++++ gapi.people/index.d.ts | 246 +++++++++++++++++++++++++++++++ gapi.people/tsconfig.json | 18 +++ 3 files changed, 363 insertions(+) create mode 100644 gapi.people/gapi.people-tests.ts create mode 100644 gapi.people/index.d.ts create mode 100644 gapi.people/tsconfig.json diff --git a/gapi.people/gapi.people-tests.ts b/gapi.people/gapi.people-tests.ts new file mode 100644 index 0000000000..65b6339765 --- /dev/null +++ b/gapi.people/gapi.people-tests.ts @@ -0,0 +1,99 @@ +/* Example taken from Google People API JavaScript Quickstart https://developers.google.com/people/quickstart/js */ + +{ + // Your Client ID can be retrieved from your project in the Google + // Developer Console, https://console.developers.google.com + var CLIENT_ID = ''; + + var SCOPES = ["https://www.googleapis.com/auth/contacts.readonly"]; + + /** + * Check if current user has authorized this application. + */ + function checkAuth() { + gapi.auth.authorize( + { + 'client_id': CLIENT_ID, + 'scope': SCOPES.join(' '), + 'immediate': true + }, handleAuthResult); + } + + /** + * Handle response from authorization server. + * + * @param {Object} authResult Authorization result. + */ + function handleAuthResult(authResult: GoogleApiOAuth2TokenObject) { + var authorizeDiv = document.getElementById('authorize-div')!; + if (authResult && !authResult.error) { + // Hide auth UI, then load client library. + authorizeDiv.style.display = 'none'; + loadPeopleApi(); + } else { + // Show auth UI, allowing the user to initiate authorization by + // clicking authorize button. + authorizeDiv.style.display = 'inline'; + } + } + + /** + * Initiate auth flow in response to user clicking authorize button. + * + * @param {Event} event Button click event. + */ + function handleAuthClick(event: MouseEvent) { + gapi.auth.authorize( + {client_id: CLIENT_ID, scope: SCOPES, immediate: false}, + handleAuthResult); + return false; + } + + /** + * Load Google People client library. List names if available + * of 10 connections. + */ + function loadPeopleApi() { + gapi.client.load('https://people.googleapis.com/$discovery/rest', 'v1', listConnectionNames); + } + + /** + * Print the display name if available for 10 connections. + */ + function listConnectionNames() { + var request = gapi.client.people.people.connections.list({ + 'resourceName': 'people/me', + 'pageSize': 10, + }); + + request.execute(function(resp) { + var connections = resp.connections; + appendPre('Connections:'); + + if (connections.length > 0) { + for (var i = 0; i < connections.length; i++) { + var person = connections[i]; + if (person.names && person.names.length > 0) { + appendPre(person.names[0].displayName) + } else { + appendPre("No display name found for connection."); + } + } + } else { + appendPre('No upcoming events found.'); + } + }); + } + + /** + * Append a pre element to the body containing the given message + * as its text node. + * + * @param {string} message Text to be placed in pre element. + */ + function appendPre(message: string) { + var pre = document.getElementById('output')!; + var textContent = document.createTextNode(message + '\n'); + pre.appendChild(textContent); + } +} diff --git a/gapi.people/index.d.ts b/gapi.people/index.d.ts new file mode 100644 index 0000000000..86bf930beb --- /dev/null +++ b/gapi.people/index.d.ts @@ -0,0 +1,246 @@ +// Type definitions for Google People API 1.0 +// Project: https://developers.google.com/people/ +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace gapi.client.people { + export namespace people { + + interface GetParameters { + resourceName: string; + + // Query parameters + requestMask?: RequestMask; + } + + function get(parameters: GetParameters): HttpRequest; + + interface GetBatchGetParameters { + // Query parameters + resourcesName?: string; + requestMask?: RequestMask; + } + + function getBatchGet(parameters: GetBatchGetParameters): HttpRequest; + + interface BatchGetResponse { + responses: PersonResponse[]; + } + + interface PersonResponse { + httpStatusCode: number; + person: Person; + requestedResourceName: string; + } + + namespace connections { + function list(parameters: ListParameters): HttpRequest; + + type SortOrder = 'LAST_MODIFIED_ASCENDING' | 'FIRST_NAME_ASCENDING' | 'LAST_NAME_ASCENDING'; + + interface ListParameters { + resourceName: string; + + // Query parameters + pageToken?: string; + pageSize?: number; + sortOrder?: SortOrder; + syncToken?: string; + requestMask?: RequestMask; + } + + interface Response { + connections: Person[]; + nextPageToken: string; + nextSyncToken: string; + } + } + } + + interface RequestMask { + includeField: string; + } + + type SourceType = 'SOURCE_TYPE_UNSPECIFIED' | 'ACCOUNT' | 'PROFILE' | 'DOMAIN_PROFILE' | 'CONTACT'; + + interface Source { + type: SourceType; + id: string; + etag: string; + resourceName: string; + } + + type ObjectType = 'OBJECT_TYPE_UNSPECIFIED' | 'PERSON' | 'PAGE'; + + interface PersonMetadata { + sources: Source[]; + previousResourceNames: string[]; + linkedPeopleResourceNames: string[]; + deleted: boolean; + objectType: ObjectType; + } + + interface FieldMetadata { + primary: boolean; + verified: boolean; + source: Source; + } + + interface Locale { + metadata: FieldMetadata; + value: string; + } + + interface Name { + metadata: FieldMetadata; + displayName: string; + displayNameLastFirst: string; + familyName: string; + givenName: string; + middleName: string; + honorificPrefix: string; + honorificSuffix: string; + phoneticFullName: string; + phoneticFamilyName: string; + phoneticGivenName: string; + phoneticMiddleName: string; + phoneticHonorificPrefix: string; + phoneticHonorificSuffix: string; + } + + type NicknameType = 'DEFAULT' | 'MAIDEN_NAME' | 'INITIALS' | 'GPLUS' | 'OTHER_NAME'; + + interface Nickname { + metadata: FieldMetadata; + value: string; + type: NicknameType; + } + + interface CoverPhoto { + } + + interface Photo { + } + + interface Gender { + } + + interface AgeRange { + } + + interface Birthday { + } + + interface Event { + } + + interface Address { + metadata: FieldMetadata; + formattedValue: string; + type: string; + formattedType: string; + poBox: string; + streetAddress: string; + extendedAddress: string; + city: string; + region: string; + postalCode: string; + country: string; + countryCode: string; + } + + interface Residence { + metadata: FieldMetadata; + value: string; + current: boolean; + } + + interface EmailAddress { + metadata: FieldMetadata; + value: string; + type: string; + formattedType: string; + displayName: string; + } + + interface PhoneNumber { + metadata: FieldMetadata; + value: string; + canonicalForm: string; + type: string; + formattedType: string; + } + + interface ImClient { + } + + interface Tagline { + } + + interface Biography { + } + + interface Url { + } + + interface Organization { + } + + interface Occupation { + } + + interface Interest { + } + + interface Skill { + } + + interface BraggingRights { + } + + interface Relation { + } + + interface RelationshipInterest { + } + + interface RelationshipStatus { + } + + interface Membership { + } + + interface Person { + resourceName: string; + etag: string; + metadata: PersonMetadata; + locales: Locale[]; + names: Name[]; + nicknames?: Nickname[]; + coverPhotos: CoverPhoto[]; + photos?: Photo[]; + genders?: Gender[]; + ageRange?: AgeRange; + birthdays?: Birthday[]; + events?: Event[]; + addresses?: Address[]; + residences?: Residence[]; + emailAddresses?: EmailAddress[]; + phoneNumbers?: PhoneNumber[]; + imClients?: ImClient[]; + taglines?: Tagline[]; + biographies?: Biography[]; + urls?: Url[]; + organizations?: Organization[]; + occupations?: Occupation[]; + interests?: Interest[]; + skills?: Skill[]; + BraggingRights?: BraggingRights[]; + relations?: Relation[]; + relationshipInterests?: RelationshipInterest[]; + relationshipStatuses?: RelationshipStatus[]; + memberships?: Membership[]; + } +} diff --git a/gapi.people/tsconfig.json b/gapi.people/tsconfig.json new file mode 100644 index 0000000000..93fcfc59b6 --- /dev/null +++ b/gapi.people/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "gapi.people-tests.ts" + ] +} From fc9bff794033c7509144dd53f28cba8fe8748796 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Fri, 24 Feb 2017 01:18:59 +0100 Subject: [PATCH 209/797] Add tests for gapi Includes various fixes due to the tests --- gapi/gapi-tests.ts | 97 ++++++++++++++++++++++++++++++++++++++++++++++ gapi/index.d.ts | 86 ++++++++++++++++++++++++++++++---------- gapi/tsconfig.json | 10 +++-- 3 files changed, 168 insertions(+), 25 deletions(-) create mode 100644 gapi/gapi-tests.ts diff --git a/gapi/gapi-tests.ts b/gapi/gapi-tests.ts new file mode 100644 index 0000000000..b16cade6bb --- /dev/null +++ b/gapi/gapi-tests.ts @@ -0,0 +1,97 @@ +/// +/// + +/* Examples taken from https://developers.google.com/api-client-library/javascript/start/start-js */ + +{ + function start1() { + // 2. Initialize the JavaScript client library. + gapi.client.init({ + 'apiKey': 'YOUR_API_KEY', + 'discoveryDocs': ['https://people.googleapis.com/$discovery/rest'], + // clientId and scope are optional if auth is not required. + 'clientId': 'YOUR_WEB_CLIENT_ID.apps.googleusercontent.com', + 'scope': 'profile', + }).then(function() { + // 3. Initialize and make the API request. + return gapi.client.people.people.get({ + resourceName: 'people/me' + }); + }).then(function(response) { + console.log(response.result); + }, function(reason) { + console.log('Error: ' + reason.result.error.message); + }); + }; + // 1. Load the JavaScript client library. + gapi.load('client', start1); +} + +{ + function start2() { + // 2. Initialize the JavaScript client library. + gapi.client.init({ + 'apiKey': 'YOUR_API_KEY', + // clientId and scope are optional if auth is not required. + 'clientId': 'YOUR_WEB_CLIENT_ID.apps.googleusercontent.com', + 'scope': 'profile', + }).then(function() { + // 3. Initialize and make the API request. + return gapi.client.request({ + 'path': 'https://people.googleapis.com/v1/people/me', + }) + }).then(function(response) { + console.log(response.result); + }, function(reason) { + console.log('Error: ' + reason.result.error.message); + }); + }; + // 1. Load the JavaScript client library. + gapi.load('client', start2); +} + + +/* Examples taken from https://developers.google.com/api-client-library/javascript/features/promises */ + +gapi.client.request({'path': '/plus/v1/people', 'params': {'query': 'John'}}).then(function(response) { + // Handle response +}, function(reason) { + // Handle error +}); + +gapi.client.load('plus', 'v1').then(function() { + gapi.client.plus.people.search({'query': ''}).then(response => { }); +}); + +var personFetcher = { + results: [], + + // Why this: any? Check https://github.com/Microsoft/TypeScript/issues/10835 + + fetch: function(this: any, name: string) { + gapi.client.request({path: '/plus/v1/people', params:{query: name}}).then(function(this: any, response) { + this.results.push(response.result); + }, function(reason) { + console.error(name, 'was not fetched:', reason.result.error.message); + }, this); + } +}; +personFetcher.fetch('John'); + +gapi.client.request({ + 'path': 'plus/v1/people', + 'params': {'query': name} +}).execute(function(resp, rawResp) { + processResponse(resp); +}); + +gapi.client.request({ + 'path': 'plus/v1/people', + 'params': {'query': name} +}).then(function(resp) { + processResponse(resp.result); +}); + +function processResponse(response: any) { + // Stub +} diff --git a/gapi/index.d.ts b/gapi/index.d.ts index 84da600e7b..8f8e621fa3 100644 --- a/gapi/index.d.ts +++ b/gapi/index.d.ts @@ -1,8 +1,8 @@ -// Type definitions for Google API Client +// Type definitions for Google API Client 0.0 // Project: https://code.google.com/p/google-api-javascript-client/ // Definitions by: Frank M // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - +// TypeScript Version: 2.1 /** * The OAuth 2.0 token object represents the OAuth 2.0 token and any associated data. @@ -102,7 +102,7 @@ declare namespace gapi.auth { /** * A function in the global namespace, which is called when the sign-in button is rendered and also called after a sign-in flow completes. */ - callback?: Function; + callback?: () => void; /** * If true, all previously granted scopes remain granted in each incremental request, for incremental authorization. The default value true is correct for most use cases; use false only if employing delegated auth, where you pass the bearer token to a less-trusted component with lower programmatic authority. */ @@ -127,6 +127,30 @@ declare namespace gapi.auth { } declare namespace gapi.client { + /** + * Initializes the JavaScript client with API key, OAuth client ID, scope, and API discovery document(s). + * If OAuth client ID and scope are provided, this function will load the gapi.auth2 module to perform OAuth. + * The gapi.client.init function can be run multiple times, such as to set up more APIs, to change API key, or initialize OAuth lazily. + */ + export function init(args: { + /** + * The API Key to use. + */ + apiKey?: string; + /** + * An array of discovery doc URLs or discovery doc JSON objects. + */ + discoveryDocs?: string[]; + /** + * The app's client ID, found and created in the Google Developers Console. + */ + clientId?: string; + /** + * The scopes to request, as a space-delimited string. + */ + scope?: string + }): Promise; + interface RequestOptions { /** * The URL to handle the request @@ -188,10 +212,46 @@ declare namespace gapi.client { */ export function setApiKey(apiKey: string): void; + interface HttpRequestFulfilled { + result: T; + body: string; + headers?: any[]; + status?: number; + statusText?: string; + } + + interface HttpRequestRejected { + result: { + error: { + message: string; + } + }; + body: string; + headers?: any[]; + status?: number; + statusText?: string; + } + + /** + * HttpRequest supports promises. + * See Google API Client JavaScript Using Promises https://developers.google.com/api-client-library/javascript/features/promises + * + * TODO This should be updated when TypeScript 2.3 is released + * See https://github.com/Microsoft/TypeScript/issues/12409 + * See https://github.com/Microsoft/TypeScript/blob/65da012527937a3074c62655d60ee08fee809f7f/lib/lib.es5.d.ts#L1339 + */ + class HttpRequestPromise { + then( + opt_onFulfilled?: ((response: HttpRequestFulfilled) => void) | null, + opt_onRejected?: ((reason: HttpRequestRejected) => void) | null, + opt_context?: any + ): Promise; + } + /** * An object encapsulating an HTTP request. This object is not instantiated directly, rather it is returned by gapi.client.request. */ - export class HttpRequest { + export class HttpRequest extends HttpRequestPromise { /** * Executes the request and runs the supplied callback on response. * @param callback The callback function which executes when the request succeeds or fails. @@ -211,24 +271,8 @@ declare namespace gapi.client { statusText: string; } ) => any): void; - /** - * HttpRequest supports promises. - */ - then(success: (response: { - result: T; - body: string; - headers?: any[]; - status?: number; - statusText?: string; - }) => void, - failure: (response: { - result: T; - body: string; - headers?: any[]; - status?: number; - statusText?: string; - }) => void): void; } + /** * Represents an HTTP Batch operation. Individual HTTP requests are added with the add method and the batch is executed using execute. */ diff --git a/gapi/tsconfig.json b/gapi/tsconfig.json index 27e01ecd7b..22f5738c1a 100644 --- a/gapi/tsconfig.json +++ b/gapi/tsconfig.json @@ -2,11 +2,12 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es6", + "dom" ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -16,6 +17,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "gapi-tests.ts" ] -} \ No newline at end of file +} From 966f6241c6c5471138737e047b95bd404c87b8c8 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Fri, 24 Feb 2017 01:19:43 +0100 Subject: [PATCH 210/797] gapi.auth2 small fixes --- gapi.auth2/gapi.auth2-tests.ts | 12 ++++++------ gapi.auth2/index.d.ts | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/gapi.auth2/gapi.auth2-tests.ts b/gapi.auth2/gapi.auth2-tests.ts index 621ca6f056..362a60c904 100644 --- a/gapi.auth2/gapi.auth2-tests.ts +++ b/gapi.auth2/gapi.auth2-tests.ts @@ -1,6 +1,6 @@ -function test_init(){ +function test_init() { var auth = gapi.auth2.init({ client_id: 'my-id', cookie_policy: 'single_host_origin', @@ -9,7 +9,7 @@ function test_init(){ }); } -function test_getAuthInstance(){ +function test_getAuthInstance() { gapi.auth2.init({ client_id: 'my-id', cookie_policy: 'single_host_origin', @@ -19,14 +19,14 @@ function test_getAuthInstance(){ var auth = gapi.auth2.getAuthInstance(); } -function test_signIn(){ +function test_signIn() { gapi.auth2.getAuthInstance().signIn({ scope: 'email profile', prompt: 'content' }); } -function test_signInOptionsBuild(){ +function test_signInOptionsBuild() { var options = new gapi.auth2.SigninOptionsBuilder(); options.setAppPackageName('com.example.app'); options.setFetchBasicProfile(true); @@ -35,13 +35,13 @@ function test_signInOptionsBuild(){ gapi.auth2.getAuthInstance().signIn(options); } -function test_getAuthResponse(){ +function test_getAuthResponse() { var user = gapi.auth2.getAuthInstance().currentUser.get(); var authResponse = user.getAuthResponse(); var authResponseWithAuth = user.getAuthResponse(true); } -function test_render(){ +function test_render() { var success = (googleUser: gapi.auth2.GoogleUser): void => { console.log(googleUser); }; diff --git a/gapi.auth2/index.d.ts b/gapi.auth2/index.d.ts index 6146a87e28..402da68699 100644 --- a/gapi.auth2/index.d.ts +++ b/gapi.auth2/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Google Sign-In API +// Type definitions for Google Sign-In API 0.0 // Project: https://developers.google.com/identity/sign-in/web/ // Definitions by: Derek Lawless // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -21,7 +21,7 @@ declare namespace gapi.auth2 { * Calls the onInit function when the GoogleAuth object is fully initialized, or calls the onFailure function if * initialization fails. */ - then(onInit: () => any, onFailure: (reason: string) => any): any; + then(onInit: () => any, onFailure?: (reason: string) => any): any; /** * Signs in the user with the options specified to gapi.auth2.init(). @@ -58,7 +58,7 @@ declare namespace gapi.auth2 { onsuccess: (googleUser: GoogleUser) => any, onfailure: (reason: string) => any): any; } - export interface IsSignedIn{ + export interface IsSignedIn { /** * Returns whether the current user is currently signed in. */ From 2b11d2ab76a29a2dfec9972eec486d9754ec0ede Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Fri, 24 Feb 2017 01:20:07 +0100 Subject: [PATCH 211/797] More tests for gapi.auth2 --- gapi.auth2/gapi.auth2-tests.ts | 86 +++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/gapi.auth2/gapi.auth2-tests.ts b/gapi.auth2/gapi.auth2-tests.ts index 362a60c904..1d389d59e9 100644 --- a/gapi.auth2/gapi.auth2-tests.ts +++ b/gapi.auth2/gapi.auth2-tests.ts @@ -1,4 +1,4 @@ - +/// function test_init() { var auth = gapi.auth2.init({ @@ -59,3 +59,87 @@ function test_render() { onfailure: failure }); } + +/* Example taken from https://developers.google.com/identity/sign-in/web/ */ +function onSignIn(googleUser: gapi.auth2.GoogleUser) { + // Useful data for your client-side scripts: + var profile = googleUser.getBasicProfile(); + console.log("ID: " + profile.getId()); // Don't send this directly to your server! + console.log('Full Name: ' + profile.getName()); + console.log('Given Name: ' + profile.getGivenName()); + console.log('Family Name: ' + profile.getFamilyName()); + console.log("Image URL: " + profile.getImageUrl()); + console.log("Email: " + profile.getEmail()); + + // The ID token you need to pass to your backend: + var id_token = googleUser.getAuthResponse().id_token; + console.log("ID Token: " + id_token); +}; + + +/* Example taken from https://github.com/google/google-api-javascript-client/blob/master/samples/authSample.html */ + +// Enter an API key from the Google API Console: +// https://console.developers.google.com/apis/credentials +var apiKey = 'YOUR_API_KEY'; +// Enter the API Discovery Docs that describes the APIs you want to +// access. In this example, we are accessing the People API, so we load +// Discovery Doc found here: https://developers.google.com/people/api/rest/ +var discoveryDocs = ["https://people.googleapis.com/$discovery/rest?version=v1"]; +// Enter a client ID for a web application from the Google API Console: +// https://console.developers.google.com/apis/credentials?project=_ +// In your API Console project, add a JavaScript origin that corresponds +// to the domain where you will be running the script. +var clientId = 'YOUR_WEB_CLIENT_ID.apps.googleusercontent.com'; +// Enter one or more authorization scopes. Refer to the documentation for +// the API or https://developers.google.com/people/v1/how-tos/authorizing +// for details. +var scopes = 'profile'; +var authorizeButton = document.getElementById('authorize-button'); +var signoutButton = document.getElementById('signout-button'); +function handleClientLoad() { + // Load the API client and auth2 library + gapi.load('client:auth2', initClient); +} +function initClient() { + gapi.client.init({ + apiKey: apiKey, + discoveryDocs: discoveryDocs, + clientId: clientId, + scope: scopes + }).then(function () { + // Listen for sign-in state changes. + gapi.auth2.getAuthInstance().isSignedIn.listen(updateSigninStatus); + // Handle the initial sign-in state. + updateSigninStatus(gapi.auth2.getAuthInstance().isSignedIn.get()); + authorizeButton.onclick = handleAuthClick; + signoutButton.onclick = handleSignoutClick; + }); +} +function updateSigninStatus(isSignedIn: boolean) { + if (isSignedIn) { + authorizeButton.style.display = 'none'; + signoutButton.style.display = 'block'; + makeApiCall(); + } else { + authorizeButton.style.display = 'block'; + signoutButton.style.display = 'none'; + } +} +function handleAuthClick(event: MouseEvent) { + gapi.auth2.getAuthInstance().signIn(); +} +function handleSignoutClick(event: MouseEvent) { + gapi.auth2.getAuthInstance().signOut(); +} +// Load the API and make an API call. Display the results on the screen. +function makeApiCall() { + gapi.client.people.people.get({ + resourceName: 'people/me' + }).then(function(resp) { + var p = document.createElement('p'); + var name = resp.result.names[0].givenName; + p.appendChild(document.createTextNode('Hello, '+name+'!')); + document.getElementById('content').appendChild(p); + }); +} From 77af13e3b476ff344e90063a6787483bffa562ef Mon Sep 17 00:00:00 2001 From: Stefan Dobrev Date: Fri, 24 Feb 2017 11:04:40 +0200 Subject: [PATCH 212/797] [react-native] SubViewRenderer can return null SubViewRenderer could potentially return `null` along with JSX element. --- react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-native/index.d.ts b/react-native/index.d.ts index 2f95939db6..60556d3d09 100644 --- a/react-native/index.d.ts +++ b/react-native/index.d.ts @@ -7635,7 +7635,7 @@ declare module "react" { onNavigateBack?(): void; } - type SubViewRenderer = (subViewProps: SubViewProps) => JSX.Element; + type SubViewRenderer = (subViewProps: SubViewProps) => JSX.Element | null; export interface NavigationHeaderProps extends NavigationSceneRendererProps { onNavigateBack?(): void, From b6404f98898dfa9ac2f2671c60aaf4681d80d32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Elgaard=20Larsen?= Date: Fri, 24 Feb 2017 17:58:41 +0100 Subject: [PATCH 213/797] isbn-utils: Renamed tslint, added lib to tsconfig --- isbn-utils/tsconfig.json | 3 +++ isbn-utils/{tslint.conf => tslint.json} | 0 2 files changed, 3 insertions(+) rename isbn-utils/{tslint.conf => tslint.json} (100%) diff --git a/isbn-utils/tsconfig.json b/isbn-utils/tsconfig.json index f67fbd95ef..b061bf6192 100644 --- a/isbn-utils/tsconfig.json +++ b/isbn-utils/tsconfig.json @@ -6,6 +6,9 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/isbn-utils/tslint.conf b/isbn-utils/tslint.json similarity index 100% rename from isbn-utils/tslint.conf rename to isbn-utils/tslint.json From 714613318c36b3eb6e73113946f27b335740b045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Elgaard=20Larsen?= Date: Fri, 24 Feb 2017 18:03:23 +0100 Subject: [PATCH 214/797] isbn-utils: fixed tsling.json --- isbn-utils/tslint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isbn-utils/tslint.json b/isbn-utils/tslint.json index 0a0094293e..f9e30021f4 100644 --- a/isbn-utils/tslint.json +++ b/isbn-utils/tslint.json @@ -1,3 +1,3 @@ { - "extends": "../tslint.json", + "extends": "../tslint.json" } From 18e5789ae43fd02356ba2f7c68f1f8ad54ce633b Mon Sep 17 00:00:00 2001 From: Kamil Szostak Date: Mon, 30 Jan 2017 10:47:27 -0800 Subject: [PATCH 215/797] Add tslint.json and fix version number --- .../applicationinsights-js-tests.ts | 22 +++++++------- applicationinsights-js/index.d.ts | 30 +++++++++---------- applicationinsights-js/tslint.json | 8 +++++ 3 files changed, 34 insertions(+), 26 deletions(-) create mode 100644 applicationinsights-js/tslint.json diff --git a/applicationinsights-js/applicationinsights-js-tests.ts b/applicationinsights-js/applicationinsights-js-tests.ts index f493c13bf3..06a7d06bc5 100644 --- a/applicationinsights-js/applicationinsights-js-tests.ts +++ b/applicationinsights-js/applicationinsights-js-tests.ts @@ -38,17 +38,17 @@ var appInsights: Microsoft.ApplicationInsights.IAppInsights = { startTrackPage(name?: string) { return null; }, stopTrackPage(name?: string, url?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; }, trackPageView(name?: string, url?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, duration?: number) { return null; }, - startTrackEvent(name: string) { return null }, - stopTrackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null }, - trackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null }, - trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number) { return null }, - trackException(exception: Error, handledAt?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, severityLevel?: AI.SeverityLevel) { return null }, - trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: { [name: string]: string; }) { return null }, - trackTrace(message: string, properties?: { [name: string]: string; }) { return null }, - flush() { return null }, - setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string) { return null }, - clearAuthenticatedUserContext() { return null }, - _onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error) { return null } + startTrackEvent(name: string) { return null; }, + stopTrackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; }, + trackEvent(name: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }) { return null; }, + trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number) { return null; }, + trackException(exception: Error, handledAt?: string, properties?: { [name: string]: string; }, measurements?: { [name: string]: number; }, severityLevel?: AI.SeverityLevel) { return null; }, + trackMetric(name: string, average: number, sampleCount?: number, min?: number, max?: number, properties?: { [name: string]: string; }) { return null; }, + trackTrace(message: string, properties?: { [name: string]: string; }) { return null; }, + flush() { return null; }, + setAuthenticatedUserContext(authenticatedUserId: string, accountId?: string) { return null; }, + clearAuthenticatedUserContext() { return null; }, + _onerror(message: string, url: string, lineNumber: number, columnNumber: number, error: Error) { return null; } }; // trackPageView diff --git a/applicationinsights-js/index.d.ts b/applicationinsights-js/index.d.ts index e99763d983..c032919618 100644 --- a/applicationinsights-js/index.d.ts +++ b/applicationinsights-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ApplicationInsights-JS v1.0.7 +// Type definitions for ApplicationInsights-JS 1.0 // Project: https://github.com/Microsoft/ApplicationInsights-JS // Definitions by: Kamil Szostak // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -323,7 +323,7 @@ declare module Microsoft.ApplicationInsights.Telemetry { /** * Constructs a new instance of the EventTelemetry object */ - constructor(name: string, properties?: Object, measurements?: Object); + constructor(name: string, properties?: any, measurements?: any); } class Exception implements Microsoft.ApplicationInsights.ISerializable { @@ -348,7 +348,7 @@ declare module Microsoft.ApplicationInsights.Telemetry { /** * Constructs a new isntance of the ExceptionTelemetry object */ - constructor(exception: Error, handledAt?: string, properties?: Object, measurements?: Object, severityLevel?: AI.SeverityLevel); + constructor(exception: Error, handledAt?: string, properties?: any, measurements?: any, severityLevel?: AI.SeverityLevel); /** * Creates a simple exception with 1 stack frame. Useful for manual constracting of exception. */ @@ -369,7 +369,7 @@ declare module Microsoft.ApplicationInsights.Telemetry { /** * Constructs a new instance of the MetricTelemetry object */ - constructor(name: string, value: number, count?: number, min?: number, max?: number, properties?: Object); + constructor(name: string, value: number, count?: number, min?: number, max?: number, properties?: any); } class PageView extends AI.PageViewData implements Microsoft.ApplicationInsights.ISerializable { @@ -477,7 +477,7 @@ declare module Microsoft.ApplicationInsights.Telemetry { /** * Constructs a new instance of the MetricTelemetry object */ - constructor(message: string, properties?: Object); + constructor(message: string, properties?: any); } } @@ -661,7 +661,7 @@ declare module Microsoft.ApplicationInsights { interface IAppInsights { config: IConfig; context: ITelemetryContext; - queue: (() => void)[]; + queue: Array<() => void>; /** * Starts timing how long the user views a page or other item. Call this when the page opens. * This method doesn't send any telemetry. Call {@link stopTrackTelemetry} to log the page when it closes. @@ -722,13 +722,13 @@ declare module Microsoft.ApplicationInsights { }): any; /** * Log a dependency call - * @param id unique id, this is used by the backend o correlate server requests. Use Util.newId() to generate a unique Id. - * @param method represents request verb (GET, POST, etc.) - * @param absoluteUrl absolute url used to make the dependency request - * @param pathName the path part of the absolute url - * @param totalTime total request time - * @param success indicates if the request was sessessful - * @param resultCode response code returned by the dependency request + * @param id unique id, this is used by the backend o correlate server requests. Use Util.newId() to generate a unique Id. + * @param method represents request verb (GET, POST, etc.) + * @param absoluteUrl absolute url used to make the dependency request + * @param pathName the path part of the absolute url + * @param totalTime total request time + * @param success indicates if the request was sessessful + * @param resultCode response code returned by the dependency request */ trackDependency(id: string, method: string, absoluteUrl: string, pathName: string, totalTime: number, success: boolean, resultCode: number): any; /** @@ -759,7 +759,7 @@ declare module Microsoft.ApplicationInsights { /** * Log a diagnostic message. * @param message A message string - * @param properties map[string, string] - additional data used to filter traces in the portal. Defaults to empty. + * @param properties map[string, string] - additional data used to filter traces in the portal. Defaults to empty. */ trackTrace(message: string, properties?: { [name: string]: string; @@ -780,7 +780,7 @@ declare module Microsoft.ApplicationInsights { * Clears the authenticated user id and the account id from the user context. */ clearAuthenticatedUserContext(): any; - downloadAndSetup?(config: Microsoft.ApplicationInsights.IConfig): void; + downloadAndSetup?(config: Microsoft.ApplicationInsights.IConfig): any; /** * The custom error handler for Application Insights * @param {string} message - The error message diff --git a/applicationinsights-js/tslint.json b/applicationinsights-js/tslint.json new file mode 100644 index 0000000000..119a5839d0 --- /dev/null +++ b/applicationinsights-js/tslint.json @@ -0,0 +1,8 @@ +{ + "extends": "../tslint.json", + "rules": { + "interface-name": [ false ], + "no-internal-module": false, + "no-single-declare-module": false + } +} \ No newline at end of file From 1dfe4c5dada036e164d2114a1cf3ebbb71224bf0 Mon Sep 17 00:00:00 2001 From: Jan Alonzo Date: Sat, 25 Feb 2017 15:55:05 +1100 Subject: [PATCH 216/797] Remove localforage and point to upstream typings instead --- localforage/index.d.ts | 115 ------------------------------ localforage/localforage-tests.ts | 117 ------------------------------- localforage/package.json | 5 ++ localforage/tsconfig.json | 23 ------ notNeededPackages.json | 8 ++- 5 files changed, 12 insertions(+), 256 deletions(-) delete mode 100644 localforage/index.d.ts delete mode 100644 localforage/localforage-tests.ts create mode 100644 localforage/package.json delete mode 100644 localforage/tsconfig.json diff --git a/localforage/index.d.ts b/localforage/index.d.ts deleted file mode 100644 index d0194ec60f..0000000000 --- a/localforage/index.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -// Type definitions for Mozilla's localForage -// Project: https://github.com/mozilla/localforage -// Definitions by: yuichi david pichsenmeister -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface LocalForageOptions { - driver?: string | LocalForageDriver | LocalForageDriver[]; - - name?: string; - - size?: number; - - storeName?: string; - - version?: number; - - description?: string; -} - -interface LocalForageDbMethods { - getItem(key: string): Promise; - getItem(key: string, callback: (err: any, value: T) => void): void; - - setItem(key: string, value: T): Promise; - setItem(key: string, value: T, callback: (err: any, value: T) => void): void; - - removeItem(key: string): Promise; - removeItem(key: string, callback: (err: any) => void): void; - - clear(): Promise; - clear(callback: (err: any) => void): void; - - length(): Promise; - length(callback: (err: any, numberOfKeys: number) => void): void; - - key(keyIndex: number): Promise; - key(keyIndex: number, callback: (err: any, key: string) => void): void; - - keys(): Promise; - keys(callback: (err: any, keys: string[]) => void): void; - - iterate(iteratee: (value: any, key: string, iterationNumber: number) => any): Promise; - iterate(iteratee: (value: any, key: string, iterationNumber: number) => any, - callback: (err: any, result: any) => void): void; -} - -interface LocalForageDriverSupportFunc { - (): Promise; -} - -interface LocalForageDriver extends LocalForageDbMethods { - _driver: string; - - _initStorage(options: LocalForageOptions): void; - - _support?: boolean | LocalForageDriverSupportFunc; -} - -interface LocalForageSerializer { - serialize(value: T | ArrayBuffer | Blob, callback: (value: string, error: any) => void): void; - - deserialize(value: string): T | ArrayBuffer | Blob; - - stringToBuffer(serializedString: string): ArrayBuffer; - - bufferToString(buffer: ArrayBuffer): string; -} - -interface LocalForage extends LocalForageDbMethods { - LOCALSTORAGE: string; - WEBSQL: string; - INDEXEDDB: string; - - /** - * Set and persist localForage options. This must be called before any other calls to localForage are made, but can be called after localForage is loaded. - * If you set any config values with this method they will persist after driver changes, so you can call config() then setDriver() - * @param {LocalForageOptions} options? - */ - config(options: LocalForageOptions): boolean; - - /** - * Create a new instance of localForage to point to a different store. - * All the configuration options used by config are supported. - * @param {LocalForageOptions} options - */ - createInstance(options: LocalForageOptions): LocalForage; - - driver(): string; - /** - * Force usage of a particular driver or drivers, if available. - * @param {string} driver - */ - setDriver(driver: string | string[]): Promise; - setDriver(driver: string | string[], callback: () => void, errorCallback: (error: any) => void): void; - defineDriver(driver: LocalForageDriver): Promise; - defineDriver(driver: LocalForageDriver, callback: () => void, errorCallback: (error: any) => void): void; - /** - * Return a particular driver - * @param {string} driver - */ - getDriver(driver: string): Promise; - - getSerializer(): Promise; - getSerializer(callback: (serializer: LocalForageSerializer) => void): void; - - supports(driverName: string): boolean; - - ready(callback: () => void): void; - ready(): Promise; -} - -declare module "localforage" { - let localforage: LocalForage; - export = localforage; -} diff --git a/localforage/localforage-tests.ts b/localforage/localforage-tests.ts deleted file mode 100644 index e3edeba2d0..0000000000 --- a/localforage/localforage-tests.ts +++ /dev/null @@ -1,117 +0,0 @@ - - -declare let localForage: LocalForage; - -namespace LocalForageTest { - localForage.clear((err: any) => { - let newError: any = err; - }); - - localForage.iterate((str: string, key: string, num: number) => { - let newStr: string = str; - let newKey: string = key; - let newNum: number = num; - }); - - localForage.length((err: any, num: number) => { - let newError: any = err; - let newNumber: number = num; - }); - - localForage.length().then((num: number) => { - var newNumber: number = num; - }); - - localForage.key(0, (err: any, value: string) => { - let newError: any = err; - let newValue: string = value; - }); - - localForage.keys((err: any, keys: Array) => { - let newError: any = err; - let newArray: Array = keys; - }); - - localForage.keys().then((keys: Array) => { - var newArray: Array = keys; - }); - - localForage.getItem("key",(err: any, str: string) => { - let newError: any = err; - let newStr: string = str - }); - - localForage.getItem("key").then((str: string) => { - let newStr: string = str; - }); - - localForage.setItem("key", "value",(err: any, str: string) => { - let newError: any = err; - let newStr: string = str - }); - - localForage.setItem("key", "value").then((str: string) => { - let newStr: string = str; - }); - - localForage.removeItem("key",(err: any) => { - let newError: any = err; - }); - - localForage.removeItem("key").then(() => { - }); - - localForage.getDriver("CustomDriver").then((result: LocalForageDriver) => { - var driver: LocalForageDriver = result; - // we need to use a variable for proper type guards before TS 2.0 - var _support = driver._support; - if (typeof _support === "function") { - // _support = _support.bind(driver); - _support().then((result: boolean) => { - let doesSupport: boolean = result; - }); - } else if (typeof _support === "boolean") { - let doesSupport: boolean = _support; - } - }); - - { - let config: boolean; - - config = localForage.config({ - name: "testyo", - driver: localForage.LOCALSTORAGE - }); - } - - { - let store: LocalForage; - - store = localForage.createInstance({ - name: "da instance", - driver: localForage.LOCALSTORAGE - }); - } - - { - let testSerializer: LocalForageSerializer; - - localForage.getSerializer() - .then((serializer: LocalForageSerializer) => { - testSerializer = serializer; - }); - - localForage.getSerializer((serializer: LocalForageSerializer) => { - testSerializer = serializer; - }); - } - - { - let store: LocalForage; - - store.ready() - .then(() => {}); - - store.ready(() => {}); - } -} \ No newline at end of file diff --git a/localforage/package.json b/localforage/package.json new file mode 100644 index 0000000000..29f45814b2 --- /dev/null +++ b/localforage/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "localforage": ">=1.5.0" + } +} diff --git a/localforage/tsconfig.json b/localforage/tsconfig.json deleted file mode 100644 index 1e3cbf9e63..0000000000 --- a/localforage/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", - "localforage-tests.ts" - ] -} \ No newline at end of file diff --git a/notNeededPackages.json b/notNeededPackages.json index 0cd56b96d1..bcdf36987a 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": "localforage", + "typingsPackageName": "localforage", + "sourceRepoURL": "https://github.com/localForage/localForage", + "asOfVersion": "0.0.34" } ] -} +} \ No newline at end of file From dc60ef6f0ee736c3d0e53681fcef7c7215296123 Mon Sep 17 00:00:00 2001 From: Emma Date: Sat, 25 Feb 2017 00:29:57 -0700 Subject: [PATCH 217/797] add new justify-content property See https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content --- react/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/index.d.ts b/react/index.d.ts index a3b778ad48..234e3ec4f7 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -1296,7 +1296,7 @@ declare namespace React { * along the main-axis of their container. * See CSS justify-content property https://www.w3.org/TR/css-flexbox-1/#justify-content-property */ - justifyContent?: CSSWideKeyword | "flex-start" | "flex-end" | "center" | "space-between" | "space-around"; + justifyContent?: CSSWideKeyword | "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly"; layoutGrid?: CSSWideKeyword | any; From b1e059c00b640e401f7f9664e7446d4f2bb7eeb9 Mon Sep 17 00:00:00 2001 From: Jay Phelps Date: Sat, 25 Feb 2017 00:27:51 -0800 Subject: [PATCH 218/797] Jest: toThrow supports same signature as toThrowError, bump to 19.0.2 --- jest/index.d.ts | 4 ++-- jest/jest-tests.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/jest/index.d.ts b/jest/index.d.ts index 9f945ba426..4129dcc846 100644 --- a/jest/index.d.ts +++ b/jest/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Jest 18.1.0 +// Type definitions for Jest 19.2.0 // Project: http://facebook.github.io/jest/ // Definitions by: Asana , Ivo Stratev , jwbay , Alexey Svetliakov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -229,7 +229,7 @@ declare namespace jest { /** This ensures that a value matches the most recent snapshot. Check out [the Snapshot Testing guide](http://facebook.github.io/jest/docs/snapshot-testing.html) for more information. */ toMatchSnapshot(snapshotName?: string): void; /** Used to test that a function throws when it is called. */ - toThrow(): void; + toThrow(error?: string | Constructable | RegExp): void; /** If you want to test that a specific error is thrown inside a function. */ toThrowError(error?: string | Constructable | RegExp): void; /** Used to test that a function throws a error matching the most recent snapshot when it is called. */ diff --git a/jest/jest-tests.ts b/jest/jest-tests.ts index a3d84a09e3..6cfff857eb 100644 --- a/jest/jest-tests.ts +++ b/jest/jest-tests.ts @@ -160,17 +160,21 @@ describe('toThrow API', function () { it('throws', function () { expect(throwTypeError()).toThrow(); + expect(throwTypeError()).toThrowError(); }); it('throws TypeError', function () { + expect(throwTypeError()).toThrow(TypeError); expect(throwTypeError()).toThrowError(TypeError); }); it('throws \'Definition was out of date\'', function () { + expect(throwTypeError()).toThrow(/Definition was out of date/); expect(throwTypeError()).toThrowError(/Definition was out of date/); }); it('throws \'toThorow Definition was out of date\'', function () { + expect(throwTypeError()).toThrow('toThrow Definition was out of date'); expect(throwTypeError()).toThrowError('toThrow Definition was out of date'); }); }); From a8059edc7aab2c3ac955fb6049209c102fd3db86 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Sat, 25 Feb 2017 12:55:26 -0500 Subject: [PATCH 219/797] placeId => placeid As per https://developers.google.com/places/web-service/details --- googlemaps/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/googlemaps/index.d.ts b/googlemaps/index.d.ts index 06eba68a94..d4d0935717 100644 --- a/googlemaps/index.d.ts +++ b/googlemaps/index.d.ts @@ -2258,7 +2258,7 @@ declare namespace google.maps { } export interface PlaceDetailsRequest { - placeId: string; + placeid: string; } export interface PlaceGeometry { From c9bfdf9d3624a45a271c738a2678f538cb827d6b Mon Sep 17 00:00:00 2001 From: Emma Date: Sat, 25 Feb 2017 16:18:22 -0700 Subject: [PATCH 220/797] replace space-around with space-evenly for test The justifyContent style for the test now uses a new css property for `justify-content` that has been introduced. --- react/test/cssProperties.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/test/cssProperties.tsx b/react/test/cssProperties.tsx index f037c43eb4..293f0b5374 100644 --- a/react/test/cssProperties.tsx +++ b/react/test/cssProperties.tsx @@ -21,7 +21,7 @@ const fontStyleStyleTest =
; const fontWeightStyle: React.CSSProperties = { fontWeight: 400 }; const fontWeightStyleTest =
; -const justifyContentStyle: React.CSSProperties = { justifyContent: 'space-around' }; +const justifyContentStyle: React.CSSProperties = { justifyContent: 'space-evenly' }; const justifyContentStyleTest =
; From 01ad861c95798ff83d7f5a05eefafd8bace185ac Mon Sep 17 00:00:00 2001 From: Diogo Sant'Ana Date: Sat, 25 Feb 2017 21:46:31 -0300 Subject: [PATCH 221/797] Update chart.js Chart constructor from v2.4.0 Version 2.4.0 new Chart constructor signature https://github.com/chartjs/Chart.js/commit/4a5b5a0e7eba85ca44f658375cb0c78e6af93e5c --- chart.js/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chart.js/index.d.ts b/chart.js/index.d.ts index 08781f4463..d21fc3ec80 100644 --- a/chart.js/index.d.ts +++ b/chart.js/index.d.ts @@ -5,7 +5,10 @@ declare class Chart { static readonly Chart: typeof Chart; - constructor(context: CanvasRenderingContext2D | HTMLCanvasElement, options: Chart.ChartConfiguration); + constructor( + context: string | JQuery | CanvasRenderingContext2D | HTMLCanvasElement | string[] | CanvasRenderingContext2D[] | HTMLCanvasElement[], + options: Chart.ChartConfiguration + ); config: Chart.ChartConfiguration; data: Chart.ChartData; destroy: () => {}; From 279fcd17bcf56d08b1dfa423cf62381f5a1bf8f5 Mon Sep 17 00:00:00 2001 From: Diogo Sant'Ana Date: Sat, 25 Feb 2017 22:00:25 -0300 Subject: [PATCH 222/797] Added jquery import declaration --- chart.js/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/chart.js/index.d.ts b/chart.js/index.d.ts index d21fc3ec80..c103ab40ec 100644 --- a/chart.js/index.d.ts +++ b/chart.js/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Alberto Nuti // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + declare class Chart { static readonly Chart: typeof Chart; constructor( From e45de33a3f658465e6c96a6b686eea9afc49757e Mon Sep 17 00:00:00 2001 From: Lukas Zech Date: Thu, 23 Feb 2017 15:32:05 +0100 Subject: [PATCH 223/797] Add generic parameter to Matchers --- jasmine/index.d.ts | 55 ++++-- jasmine/jasmine-tests.ts | 391 ++++++++++++++++++++------------------- 2 files changed, 233 insertions(+), 213 deletions(-) diff --git a/jasmine/index.d.ts b/jasmine/index.d.ts index 146ab55ad4..78fea75ec2 100644 --- a/jasmine/index.d.ts +++ b/jasmine/index.d.ts @@ -24,8 +24,9 @@ declare function afterEach(action: (done: DoneFn) => void, timeout?: number): vo declare function beforeAll(action: (done: DoneFn) => void, timeout?: number): void; declare function afterAll(action: (done: DoneFn) => void, timeout?: number): void; -declare function expect(spy: Function): jasmine.Matchers; -declare function expect(actual: any): jasmine.Matchers; +declare function expect>(actual: ArrayLike): jasmine.ArrayLikeMatchers; +declare function expect(actual: T): jasmine.Matchers; +declare function expect(spy: Function): jasmine.Matchers; declare function fail(e?: any): void; /** Action method that should be called when the async work is complete */ @@ -43,23 +44,33 @@ declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, t declare function waits(timeout?: number): void; declare namespace jasmine { + type Expected = T | ObjectContaining | Any | Spy; var clock: () => Clock; function any(aclass: any): Any; + function anything(): Any; + function arrayContaining(sample: any[]): ArrayContaining; function objectContaining(sample: Partial): ObjectContaining; function createSpy(name: string, originalFn?: Function): Spy; + function createSpyObj(baseName: string, methodNames: any[]): any; function createSpyObj(baseName: string, methodNames: any[]): T; + function pp(value: any): string; + function getEnv(): Env; + function addCustomEqualityTester(equalityTester: CustomEqualityTester): void; + function addMatchers(matchers: CustomMatcherFactories): void; + function stringMatching(str: string): Any; function stringMatching(str: RegExp): Any; - function formatErrorMsg(domain: string, usage: string) : (msg: string) => string + + function formatErrorMsg(domain: string, usage: string): (msg: string) => string interface Any { @@ -83,7 +94,7 @@ declare namespace jasmine { } interface ObjectContaining { - new (sample: Partial): T; + new (sample: Partial): Partial; jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean; jasmineToString(): string; @@ -150,7 +161,7 @@ declare namespace jasmine { currentSpec: Spec; - matchersClass: Matchers; + matchersClass: Matchers; version(): any; versionString(): string; @@ -224,12 +235,12 @@ declare namespace jasmine { passed(): boolean; } - interface MessageResult extends Result { + interface MessageResult extends Result { values: any; trace: Trace; } - interface ExpectationResult extends Result { + interface ExpectationResult extends Result { matcherName: string; passed(): boolean; expected: any; @@ -242,12 +253,13 @@ declare namespace jasmine { new (options: {random: boolean, seed: string}): any; random: boolean; seed: string; - sort(items: T[]) : T[]; + sort(items: T[]): T[]; } namespace errors { class ExpectationFailed extends Error { constructor(); + stack: any; } } @@ -255,7 +267,7 @@ declare namespace jasmine { interface TreeProcessor { new (attrs: any): any; execute: (done: Function) => void; - processTree() : any; + processTree(): any; } interface Trace { @@ -301,18 +313,18 @@ declare namespace jasmine { results(): NestedResults; } - interface Matchers { + interface Matchers { - new (env: Env, actual: any, spec: Env, isNot?: boolean): any; + new (env: Env, actual: T, spec: Env, isNot?: boolean): any; env: Env; - actual: any; + actual: T; spec: Env; isNot?: boolean; message(): any; - toBe(expected: any, expectationFailOutput?: any): boolean; - toEqual(expected: any, expectationFailOutput?: any): boolean; + toBe(expected: Expected, expectationFailOutput?: any): boolean; + toEqual(expected: Expected, expectationFailOutput?: any): boolean; toMatch(expected: string | RegExp, expectationFailOutput?: any): boolean; toBeDefined(expectationFailOutput?: any): boolean; toBeUndefined(expectationFailOutput?: any): boolean; @@ -332,11 +344,18 @@ declare namespace jasmine { toThrow(expected?: any): boolean; toThrowError(message?: string | RegExp): boolean; toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): boolean; - not: Matchers; + not: Matchers; Any: Any; } + interface ArrayLikeMatchers> extends Matchers { + toBe(expected: Expected>, expectationFailOutput?: any): boolean; + toEqual(expected: Expected>, expectationFailOutput?: any): boolean; + toContain(expected: T, expectationFailOutput?: any): boolean; + not: ArrayLikeMatchers; + } + interface Reporter { reportRunnerStarting(runner: Runner): void; reportRunnerResults(runner: Runner): void; @@ -433,7 +452,7 @@ declare namespace jasmine { spies_: Spy[]; results_: NestedResults; - matchersClass: Matchers; + matchersClass: Matchers; getFullName(): string; results(): NestedResults; @@ -446,7 +465,7 @@ declare namespace jasmine { waits(timeout: number): Spec; waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec; fail(e?: any): void; - getMatchersClass_(): Matchers; + getMatchersClass_(): Matchers; addMatchers(matchersPrototype: CustomMatcherFactories): void; finishCallback(): void; finish(onComplete?: () => void): void; @@ -494,7 +513,7 @@ declare namespace jasmine { identity: string; and: SpyAnd; calls: Calls; - mostRecentCall: { args: any[]; }; + mostRecentCall: {args: any[];}; argsForCall: any[]; } diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index 13d80af9db..f841a613c5 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -1,34 +1,34 @@ // tests based on http://jasmine.github.io/2.2/introduction.html -describe("A suite", function () { - it("contains spec with an expectation", function () { +describe("A suite", function() { + it("contains spec with an expectation", function() { expect(true).toBe(true); }); }); -describe("A suite is just a function", function () { +describe("A suite is just a function", function() { var a: boolean; - it("and so is a spec", function () { + it("and so is a spec", function() { a = true; expect(a).toBe(true); }); }); -describe("The 'toBe' matcher compares with ===", function () { +describe("The 'toBe' matcher compares with ===", function() { - it("and has a positive case", function () { + it("and has a positive case", function() { expect(true).toBe(true); }); - it("and can have a negative case", function () { + it("and can have a negative case", function() { expect(false).not.toBe(true); }); }); -describe("Included matchers:", function () { +describe("Included matchers:", function() { - it("The 'toBe' matcher compares with ===", function () { + it("The 'toBe' matcher compares with ===", function() { var a = 12; var b = a; @@ -36,14 +36,14 @@ describe("Included matchers:", function () { expect(a).not.toBe(null); }); - describe("The 'toEqual' matcher", function () { + describe("The 'toEqual' matcher", function() { - it("works for simple literals and variables", function () { + it("works for simple literals and variables", function() { var a = 12; expect(a).toEqual(12); }); - it("should work for objects", function () { + it("should work for objects", function() { var foo = { a: 12, b: 34 @@ -56,7 +56,7 @@ describe("Included matchers:", function () { }); }); - it("The 'toMatch' matcher is for regular expressions", function () { + it("The 'toMatch' matcher is for regular expressions", function() { var message = "foo bar baz"; expect(message).toMatch(/bar/); @@ -64,7 +64,7 @@ describe("Included matchers:", function () { expect(message).not.toMatch(/quux/); }); - it("The 'toBeDefined' matcher compares against `undefined`", function () { + it("The 'toBeDefined' matcher compares against `undefined`", function() { var a = { foo: "foo" }; @@ -73,16 +73,16 @@ describe("Included matchers:", function () { expect((a).bar).not.toBeDefined(); }); - it("The `toBeUndefined` matcher compares against `undefined`", function () { + it("The `toBeUndefined` matcher compares against `undefined`", function() { var a = { foo: "foo" }; expect(a.foo).not.toBeUndefined(); - expect((a).bar).toBeUndefined(); + expect((a as any).bar).toBeUndefined(); }); - it("The 'toBeNull' matcher compares against null", function () { + it("The 'toBeNull' matcher compares against null", function() { var a: string = null; var foo = "foo"; @@ -91,28 +91,28 @@ describe("Included matchers:", function () { expect(foo).not.toBeNull(); }); - it("The 'toBeTruthy' matcher is for boolean casting testing", function () { + it("The 'toBeTruthy' matcher is for boolean casting testing", function() { var a: string, foo = "foo"; expect(foo).toBeTruthy(); expect(a).not.toBeTruthy(); }); - it("The 'toBeFalsy' matcher is for boolean casting testing", function () { + it("The 'toBeFalsy' matcher is for boolean casting testing", function() { var a: string, foo = "foo"; expect(a).toBeFalsy(); expect(foo).not.toBeFalsy(); }); - it("The 'toContain' matcher is for finding an item in an Array", function () { + it("The 'toContain' matcher is for finding an item in an Array", function() { var a = ["foo", "bar", "baz"]; - expect(a).toContain("bar"); + expect(a).toContain('foo'); expect(a).not.toContain("quux"); }); - it("The 'toBeLessThan' matcher is for mathematical comparisons", function () { + it("The 'toBeLessThan' matcher is for mathematical comparisons", function() { var pi = 3.1415926, e = 2.78; @@ -120,7 +120,7 @@ describe("Included matchers:", function () { expect(pi).not.toBeLessThan(e); }); - it("The 'toBeGreaterThan' is for mathematical comparisons", function () { + it("The 'toBeGreaterThan' is for mathematical comparisons", function() { var pi = 3.1415926, e = 2.78; @@ -128,7 +128,7 @@ describe("Included matchers:", function () { expect(e).not.toBeGreaterThan(pi); }); - it("The 'toBeCloseTo' matcher is for precision math comparison", function () { + it("The 'toBeCloseTo' matcher is for precision math comparison", function() { var pi = 3.1415926, e = 2.78; @@ -136,11 +136,11 @@ describe("Included matchers:", function () { expect(pi).toBeCloseTo(e, 0); }); - it("The 'toThrow' matcher is for testing if a function throws an exception", function () { - var foo = function () { + it("The 'toThrow' matcher is for testing if a function throws an exception", function() { + var foo = function() { return 1 + 2; }; - var bar = function () { + var bar = function() { var a: any = undefined; return a + 1; }; @@ -161,15 +161,15 @@ describe("Included matchers:", function () { }); }); -describe("A spec", function () { - it("is just a function, so it can contain any code", function () { +describe("A spec", function() { + it("is just a function, so it can contain any code", function() { var foo = 0; foo += 1; expect(foo).toEqual(1); }); - it("can have more than one expectation", function () { + it("can have more than one expectation", function() { var foo = 0; foo += 1; @@ -178,94 +178,94 @@ describe("A spec", function () { }); }); -describe("A spec (with setup and tear-down)", function () { +describe("A spec (with setup and tear-down)", function() { var foo: number; - beforeEach(function () { + beforeEach(function() { foo = 0; foo += 1; }); - afterEach(function () { + afterEach(function() { foo = 0; }); - it("is just a function, so it can contain any code", function () { + it("is just a function, so it can contain any code", function() { expect(foo).toEqual(1); }); - it("can have more than one expectation", function () { + it("can have more than one expectation", function() { expect(foo).toEqual(1); expect(true).toEqual(true); }); }); -describe("A spec", function () { +describe("A spec", function() { var foo: number; - beforeEach(function () { + beforeEach(function() { foo = 0; foo += 1; }); - afterEach(function () { + afterEach(function() { foo = 0; }); - it("is just a function, so it can contain any code", function () { + it("is just a function, so it can contain any code", function() { expect(foo).toEqual(1); }); - it("can have more than one expectation", function () { + it("can have more than one expectation", function() { expect(foo).toEqual(1); expect(true).toEqual(true); }); - describe("nested inside a second describe", function () { + describe("nested inside a second describe", function() { var bar: number; - beforeEach(function () { + beforeEach(function() { bar = 1; }); - it("can reference both scopes as needed", function () { + it("can reference both scopes as needed", function() { expect(foo).toEqual(bar); }); }); }); -xdescribe("A spec", function () { +xdescribe("A spec", function() { var foo: number; - beforeEach(function () { + beforeEach(function() { foo = 0; foo += 1; }); - it("is just a function, so it can contain any code", function () { + it("is just a function, so it can contain any code", function() { expect(foo).toEqual(1); }); }); -describe("Pending specs", function () { +describe("Pending specs", function() { - xit("can be declared 'xit'", function () { + xit("can be declared 'xit'", function() { expect(true).toBe(false); }); it("can be declared with 'it' but without a function"); - it("can be declared by calling 'pending' in the spec body", function () { + it("can be declared by calling 'pending' in the spec body", function() { expect(true).toBe(false); pending(); // without reason pending('this is why it is pending'); }); }); -describe("A spy", function () { +describe("A spy", function() { var foo: any, bar: any = null; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; @@ -278,29 +278,29 @@ describe("A spy", function () { foo.setBar(456, 'another param'); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", function() { expect(foo.setBar).toHaveBeenCalled(); }); - it("tracks all the arguments of its calls", function () { + it("tracks all the arguments of its calls", function() { expect(foo.setBar).toHaveBeenCalledWith(123); expect(foo.setBar).toHaveBeenCalledWith(456, 'another param'); }); - it("stops all execution on a function", function () { + it("stops all execution on a function", function() { expect(bar).toBeNull(); }); }); -describe("A spy, when configured to call through", function () { +describe("A spy, when configured to call through", function() { var foo: any, bar: any, fetchedBar: any; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; }, - getBar: function () { + getBar: function() { return bar; } }; @@ -311,28 +311,28 @@ describe("A spy, when configured to call through", function () { fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", function() { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function () { + it("should not effect other functions", function() { expect(bar).toEqual(123); }); - it("when called returns the requested value", function () { + it("when called returns the requested value", function() { expect(fetchedBar).toEqual(123); }); }); -describe("A spy, when configured to fake a return value", function () { +describe("A spy, when configured to fake a return value", function() { var foo: any, bar: any, fetchedBar: any; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; }, - getBar: function () { + getBar: function() { return bar; } }; @@ -343,15 +343,15 @@ describe("A spy, when configured to fake a return value", function () { fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", function() { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function () { + it("should not effect other functions", function() { expect(bar).toEqual(123); }); - it("when called returns the requested value", function () { + it("when called returns the requested value", function() { expect(fetchedBar).toEqual(745); }); }); @@ -361,7 +361,7 @@ describe("A spy, when configured to fake a series of return values", function() beforeEach(function() { foo = { - setBar: function(value: any) { + setBar: function (value: any) { bar = value; }, getBar: function() { @@ -390,20 +390,20 @@ describe("A spy, when configured to fake a series of return values", function() }); }); -describe("A spy, when configured with an alternate implementation", function () { +describe("A spy, when configured with an alternate implementation", function() { var foo: any, bar: any, fetchedBar: any; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; }, - getBar: function () { + getBar: function() { return bar; } }; - spyOn(foo, "getBar").and.callFake(function () { + spyOn(foo, "getBar").and.callFake(function() { return 1001; }); @@ -411,23 +411,23 @@ describe("A spy, when configured with an alternate implementation", function () fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", function() { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function () { + it("should not effect other functions", function() { expect(bar).toEqual(123); }); - it("when called returns the requested value", function () { + it("when called returns the requested value", function() { expect(fetchedBar).toEqual(1001); }); }); -describe("A spy, when configured to throw a value", function () { +describe("A spy, when configured to throw a value", function() { var foo: any, bar: any; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; @@ -437,55 +437,55 @@ describe("A spy, when configured to throw a value", function () { spyOn(foo, "setBar").and.throwError("quux"); }); - it("throws the value", function () { - expect(function () { + it("throws the value", function() { + expect(function() { foo.setBar(123) - }).toThrowError("quux"); + }).toThrowError("quux"); }); }); -describe("A spy, when configured with multiple actions", function () { +describe("A spy, when configured with multiple actions", function() { var foo: any, bar: any, fetchedBar: any; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; }, - getBar: function () { + getBar: function() { return bar; } }; spyOn(foo, 'getBar').and.callThrough().and.callFake(() => { - this.fakeCalled = true; + this.fakeCalled = true; }); foo.setBar(123); fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", function() { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function () { + it("should not effect other functions", function() { expect(bar).toEqual(123); }); - it("when called returns the requested value", function () { + it("when called returns the requested value", function() { expect(fetchedBar).toEqual(123); }); - it("should have called the fake implementation", function () { + it("should have called the fake implementation", function() { expect(this.fakeCalled).toEqual(true); }); }); -describe("A spy", function () { +describe("A spy", function() { var foo: any, bar: any = null; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; @@ -495,7 +495,7 @@ describe("A spy", function () { spyOn(foo, 'setBar').and.callThrough(); }); - it("can call through and then stub in the same spec", function () { + it("can call through and then stub in the same spec", function() { foo.setBar(123); expect(bar).toEqual(123); @@ -507,10 +507,10 @@ describe("A spy", function () { }); }); -describe("A spy", function () { +describe("A spy", function() { var foo: any, bar: any = null; - beforeEach(function () { + beforeEach(function() { foo = { setBar: function (value: any) { bar = value; @@ -520,7 +520,7 @@ describe("A spy", function () { spyOn(foo, 'setBar'); }); - it("tracks if it was called at all", function () { + it("tracks if it was called at all", function() { expect(foo.setBar.calls.any()).toEqual(false); foo.setBar(); @@ -528,7 +528,7 @@ describe("A spy", function () { expect(foo.setBar.calls.any()).toEqual(true); }); - it("tracks the number of times it was called", function () { + it("tracks the number of times it was called", function() { expect(foo.setBar.calls.count()).toEqual(0); foo.setBar(); @@ -537,7 +537,7 @@ describe("A spy", function () { expect(foo.setBar.calls.count()).toEqual(2); }); - it("tracks the arguments of each call", function () { + it("tracks the arguments of each call", function() { foo.setBar(123); foo.setBar(456, "baz"); @@ -545,34 +545,34 @@ describe("A spy", function () { expect(foo.setBar.calls.argsFor(1)).toEqual([456, "baz"]); }); - it("tracks the arguments of all calls", function () { + it("tracks the arguments of all calls", function() { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.allArgs()).toEqual([[123], [456, "baz"]]); }); - it("can provide the context and arguments to all calls", function () { + it("can provide the context and arguments to all calls", function() { foo.setBar(123); expect(foo.setBar.calls.all()).toEqual([{ object: foo, args: [123], returnValue: undefined }]); }); - it("has a shortcut to the most recent call", function () { + it("has a shortcut to the most recent call", function() { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.mostRecent()).toEqual({ object: foo, args: [456, "baz"], returnValue: undefined }); }); - it("has a shortcut to the first call", function () { + it("has a shortcut to the first call", function() { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.first()).toEqual({ object: foo, args: [123], returnValue: undefined }); }); - it("can be reset", function () { + it("can be reset", function() { foo.setBar(123); foo.setBar(456, "baz"); @@ -584,40 +584,40 @@ describe("A spy", function () { }); }); -describe("A spy, when created manually", function () { +describe("A spy, when created manually", function() { var whatAmI: any; - beforeEach(function () { + beforeEach(function() { whatAmI = jasmine.createSpy('whatAmI'); whatAmI("I", "am", "a", "spy"); }); - it("is named, which helps in error reporting", function () { + it("is named, which helps in error reporting", function() { expect(whatAmI.and.identity()).toEqual('whatAmI'); }); - it("tracks that the spy was called", function () { + it("tracks that the spy was called", function() { expect(whatAmI).toHaveBeenCalled(); }); - it("tracks its number of calls", function () { + it("tracks its number of calls", function() { expect(whatAmI.calls.count()).toEqual(1); }); - it("tracks all the arguments of its calls", function () { + it("tracks all the arguments of its calls", function() { expect(whatAmI).toHaveBeenCalledWith("I", "am", "a", "spy"); }); - it("allows access to the most recent call", function () { + it("allows access to the most recent call", function() { expect(whatAmI.calls.mostRecent().args[0]).toEqual("I"); }); }); -describe("Multiple spies, when created manually", function () { +describe("Multiple spies, when created manually", function() { var tape: any; - beforeEach(function () { + beforeEach(function() { tape = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); tape.play(); @@ -625,35 +625,35 @@ describe("Multiple spies, when created manually", function () { tape.rewind(0); }); - it("creates spies for each requested function", function () { + it("creates spies for each requested function", function() { expect(tape.play).toBeDefined(); expect(tape.pause).toBeDefined(); expect(tape.stop).toBeDefined(); expect(tape.rewind).toBeDefined(); }); - it("tracks that the spies were called", function () { + it("tracks that the spies were called", function() { expect(tape.play).toHaveBeenCalled(); expect(tape.pause).toHaveBeenCalled(); expect(tape.rewind).toHaveBeenCalled(); expect(tape.stop).not.toHaveBeenCalled(); }); - it("tracks all the arguments of its calls", function () { + it("tracks all the arguments of its calls", function() { expect(tape.rewind).toHaveBeenCalledWith(0); }); }); -describe("jasmine.any", function () { - it("matches any value", function () { +describe("jasmine.any", function() { + it("matches any value", function() { expect({}).toEqual(jasmine.any(Object)); expect(12).toEqual(jasmine.any(Number)); }); - describe("when used with a spy", function () { - it("is useful for comparing arguments", function () { + describe("when used with a spy", function() { + it("is useful for comparing arguments", function() { var foo = jasmine.createSpy('foo'); - foo(12, function () { + foo(12, function() { return true; }); @@ -662,15 +662,15 @@ describe("jasmine.any", function () { }); }); -describe("jasmine.objectContaining", function () { +describe("jasmine.objectContaining", function() { interface fooType { - a:number; - b:number; - bar:string; + a: number; + b: number; + bar: string; } var foo: fooType; - beforeEach(function () { + beforeEach(function() { foo = { a: 1, b: 2, @@ -678,17 +678,18 @@ describe("jasmine.objectContaining", function () { }; }); - it("matches objects with the expect key/value pairs", function () { + it("matches objects with the expect key/value pairs", function() { expect(foo).toEqual(jasmine.objectContaining({ - bar: "baz" + bar: '' })); - expect(foo).not.toEqual(jasmine.objectContaining({ + + expect(foo).not.toEqual(jasmine.objectContaining({ a: 37 })); }); - describe("when used with a spy", function () { - it("is useful for comparing arguments", function () { + describe("when used with a spy", function() { + it("is useful for comparing arguments", function() { var callback = jasmine.createSpy('callback'); callback({ @@ -706,43 +707,43 @@ describe("jasmine.objectContaining", function () { }); describe("jasmine.arrayContaining", function() { - var foo: any; + var foo: any; - beforeEach(function() { - foo = [1, 2, 3, 4]; - }); + beforeEach(function() { + foo = [1, 2, 3, 4]; + }); - it("matches arrays with some of the values", function() { - expect(foo).toEqual(jasmine.arrayContaining([3, 1])); - expect(foo).not.toEqual(jasmine.arrayContaining([6])); - }); + it("matches arrays with some of the values", function() { + expect(foo).toEqual(jasmine.arrayContaining([3, 1])); + expect(foo).not.toEqual(jasmine.arrayContaining([6])); + }); - describe("when used with a spy", function() { - it("is useful when comparing arguments", function() { - var callback = jasmine.createSpy('callback'); + describe("when used with a spy", function() { + it("is useful when comparing arguments", function() { + var callback = jasmine.createSpy('callback'); - callback([1, 2, 3, 4]); + callback([1, 2, 3, 4]); - expect(callback).toHaveBeenCalledWith(jasmine.arrayContaining([4, 2, 3])); - expect(callback).not.toHaveBeenCalledWith(jasmine.arrayContaining([5, 2])); + expect(callback).toHaveBeenCalledWith(jasmine.arrayContaining([4, 2, 3])); + expect(callback).not.toHaveBeenCalledWith(jasmine.arrayContaining([5, 2])); + }); }); - }); }); -describe("Manually ticking the Jasmine Clock", function () { +describe("Manually ticking the Jasmine Clock", function() { var timerCallback: any; - beforeEach(function () { + beforeEach(function() { timerCallback = jasmine.createSpy("timerCallback"); jasmine.clock().install(); }); - afterEach(function () { + afterEach(function() { jasmine.clock().uninstall(); }); - it("causes a timeout to be called synchronously", function () { - setTimeout(function () { + it("causes a timeout to be called synchronously", function() { + setTimeout(function() { timerCallback(); }, 100); @@ -753,8 +754,8 @@ describe("Manually ticking the Jasmine Clock", function () { expect(timerCallback).toHaveBeenCalled(); }); - it("causes an interval to be called synchronously", function () { - setInterval(function () { + it("causes an interval to be called synchronously", function() { + setInterval(function() { timerCallback(); }, 100); @@ -770,7 +771,7 @@ describe("Manually ticking the Jasmine Clock", function () { expect(timerCallback.calls.count()).toEqual(2); }); - describe("Mocking the Date object", function(){ + describe("Mocking the Date object", function() { it("mocks the Date object and sets it to a given time", function() { var baseTime = new Date(2013, 9, 23); @@ -782,10 +783,10 @@ describe("Manually ticking the Jasmine Clock", function () { }); }); -describe("Asynchronous specs", function () { +describe("Asynchronous specs", function() { var value: number; beforeEach(function (done: DoneFn) { - setTimeout(function () { + setTimeout(function() { value = 0; done(); }, 1); @@ -798,42 +799,42 @@ describe("Asynchronous specs", function () { }); describe("long asynchronous specs", function() { - beforeEach(function(done: DoneFn) { - done(); + beforeEach(function (done: DoneFn) { + done(); }, 1000); - it("takes a long time", function(done: DoneFn) { - setTimeout(function() { - done(); - }, 9000); + it("takes a long time", function (done: DoneFn) { + setTimeout(function() { + done(); + }, 9000); }, 10000); - afterEach(function(done: DoneFn) { - done(); + afterEach(function (done: DoneFn) { + done(); }, 1000); }); }); -describe("Fail", function () { +describe("Fail", function() { - it("should fail test when called without arguments", function () { - fail(); - }); + it("should fail test when called without arguments", function() { + fail(); + }); - it("should fail test when called with a fail message", function () { - fail("The test failed"); - }); + it("should fail test when called with a fail message", function() { + fail("The test failed"); + }); - it("should fail test when called an error", function () { - fail(new Error("The test failed with this error")); - }); + it("should fail test when called an error", function() { + fail(new Error("The test failed with this error")); + }); }); // test based on http://jasmine.github.io/2.2/custom_equality.html describe("custom equality", function() { - var myCustomEquality: jasmine.CustomEqualityTester = function(first: any, second: any): boolean { + var myCustomEquality: jasmine.CustomEqualityTester = function (first: any, second: any): boolean { if (typeof first == "string" && typeof second == "string") { return first[0] == second[1]; } @@ -886,29 +887,29 @@ var customMatchers: jasmine.CustomMatcherFactories = { // } // } declare namespace jasmine { - interface Matchers { - toBeGoofy(expected?: any): boolean; + interface Matchers { + toBeGoofy(expected?: jasmine.Expected): boolean; } } -describe("Custom matcher: 'toBeGoofy'", function () { - beforeEach(function () { +describe("Custom matcher: 'toBeGoofy'", function() { + beforeEach(function() { jasmine.addMatchers(customMatchers); }); - it("is available on an expectation", function () { + it("is available on an expectation", function() { expect({ hyuk: 'gawrsh' }).toBeGoofy(); }); - it("can take an 'expected' parameter", function () { + it("can take an 'expected' parameter", function() { expect({ hyuk: 'gawrsh is fun' - }).toBeGoofy(' is fun'); + }).toBeGoofy({ hyuk: ' is fun' }); }); - it("can be negated", function () { + it("can be negated", function() { expect({ hyuk: 'this is fun' }).not.toBeGoofy(); @@ -917,7 +918,7 @@ describe("Custom matcher: 'toBeGoofy'", function () { // test based on http://jasmine.github.io/2.5/custom_reporter.html var myReporter: jasmine.CustomReporter = { - jasmineStarted: function (suiteInfo: jasmine.SuiteInfo ) { + jasmineStarted: function (suiteInfo: jasmine.SuiteInfo) { console.log("Running suite with " + suiteInfo.totalSpecsDefined); }, @@ -948,7 +949,7 @@ var myReporter: jasmine.CustomReporter = { } }, - jasmineDone: function(runDetails: jasmine.RunDetails) { + jasmineDone: function (runDetails: jasmine.RunDetails) { console.log('Finished suite'); console.log('Random:', runDetails.order.random); } @@ -957,20 +958,20 @@ var myReporter: jasmine.CustomReporter = { jasmine.getEnv().addReporter(myReporter); describe("Randomize Tests", function() { - it("should allow randomization of the order of tests", function() { - expect(function() { - var env = jasmine.getEnv(); - return env.randomizeTests(true); - }).not.toThrow(); - }); + it("should allow randomization of the order of tests", function() { + expect(function() { + var env = jasmine.getEnv(); + return env.randomizeTests(true); + }).not.toThrow(); + }); - it("should allow a seed to be passed in for randomization", function() { - expect(function() { - var env = jasmine.getEnv(); - env.randomizeTests(true); - return env.seed(1234); - }).not.toThrow(); - }); + it("should allow a seed to be passed in for randomization", function() { + expect(function() { + var env = jasmine.getEnv(); + env.randomizeTests(true); + return env.seed(1234); + }).not.toThrow(); + }); }); (() => { @@ -986,7 +987,7 @@ describe("Randomize Tests", function() { }; var currentWindowOnload = window.onload; - window.onload = function () { + window.onload = function() { if (currentWindowOnload) { (currentWindowOnload)(null); } From 5d864d9772c27269b06f0ecccc2cd88e98af9428 Mon Sep 17 00:00:00 2001 From: Lukas Zech Date: Sun, 26 Feb 2017 12:29:39 +0100 Subject: [PATCH 224/797] Fix linter errors --- jasmine/index.d.ts | 34 ++-- jasmine/jasmine-tests.ts | 386 ++++++++++++++++++------------------ jasmine/v1/jasmine-tests.ts | 22 +- 3 files changed, 219 insertions(+), 223 deletions(-) diff --git a/jasmine/index.d.ts b/jasmine/index.d.ts index 78fea75ec2..03c1e30c78 100644 --- a/jasmine/index.d.ts +++ b/jasmine/index.d.ts @@ -70,7 +70,7 @@ declare namespace jasmine { function stringMatching(str: string): Any; function stringMatching(str: RegExp): Any; - function formatErrorMsg(domain: string, usage: string): (msg: string) => string + function formatErrorMsg(domain: string, usage: string): (msg: string) => string; interface Any { @@ -124,18 +124,14 @@ declare namespace jasmine { withMock(func: () => void): void; } - interface CustomEqualityTester { - (first: any, second: any): boolean; - } + type CustomEqualityTester = (first: any, second: any) => boolean; interface CustomMatcher { compare(actual: T, expected: T): CustomMatcherResult; compare(actual: any, expected: any): CustomMatcherResult; } - interface CustomMatcherFactory { - (util: MatchersUtil, customEqualityTesters: Array): CustomMatcher; - } + type CustomMatcherFactory = (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]) => CustomMatcher; interface CustomMatcherFactories { [index: string]: CustomMatcherFactory; @@ -147,9 +143,9 @@ declare namespace jasmine { } interface MatchersUtil { - equals(a: any, b: any, customTesters?: Array): boolean; - contains(haystack: ArrayLike | string, needle: any, customTesters?: Array): boolean; - buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array): string; + equals(a: any, b: any, customTesters?: CustomEqualityTester[]): boolean; + contains(haystack: ArrayLike | string, needle: any, customTesters?: CustomEqualityTester[]): boolean; + buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: any[]): string; } interface Env { @@ -390,18 +386,18 @@ declare namespace jasmine { } interface CustomReporterResult { - description: string, - failedExpectations?: FailedExpectation[], - fullName: string, + description: string; + failedExpectations?: FailedExpectation[]; + fullName: string; id: string; - passedExpectations?: PassedExpectation[], + passedExpectations?: PassedExpectation[]; pendingReason?: string; status?: string; } interface RunDetails { failedExpectations: ExpectationResult[]; - order: jasmine.Order + order: jasmine.Order; } interface CustomReporter { @@ -431,9 +427,7 @@ declare namespace jasmine { results(): NestedResults; } - interface SpecFunction { - (spec?: Spec): void; - } + type SpecFunction = (spec?: Spec) => void; interface SuiteOrSpec { id: number; @@ -513,7 +507,7 @@ declare namespace jasmine { identity: string; and: SpyAnd; calls: Calls; - mostRecentCall: {args: any[];}; + mostRecentCall: {args: any[]; }; argsForCall: any[]; } @@ -574,7 +568,7 @@ declare namespace jasmine { finished: boolean; result: any; messages: any; - runDetails: RunDetails + runDetails: RunDetails; new (): any; diff --git a/jasmine/jasmine-tests.ts b/jasmine/jasmine-tests.ts index f841a613c5..e80060510b 100644 --- a/jasmine/jasmine-tests.ts +++ b/jasmine/jasmine-tests.ts @@ -1,34 +1,34 @@ // tests based on http://jasmine.github.io/2.2/introduction.html -describe("A suite", function() { - it("contains spec with an expectation", function() { +describe("A suite", () => { + it("contains spec with an expectation", () => { expect(true).toBe(true); }); }); -describe("A suite is just a function", function() { +describe("A suite is just a function", () => { var a: boolean; - it("and so is a spec", function() { + it("and so is a spec", () => { a = true; expect(a).toBe(true); }); }); -describe("The 'toBe' matcher compares with ===", function() { +describe("The 'toBe' matcher compares with ===", () => { - it("and has a positive case", function() { + it("and has a positive case", () => { expect(true).toBe(true); }); - it("and can have a negative case", function() { + it("and can have a negative case", () => { expect(false).not.toBe(true); }); }); -describe("Included matchers:", function() { +describe("Included matchers:", () => { - it("The 'toBe' matcher compares with ===", function() { + it("The 'toBe' matcher compares with ===", () => { var a = 12; var b = a; @@ -36,14 +36,14 @@ describe("Included matchers:", function() { expect(a).not.toBe(null); }); - describe("The 'toEqual' matcher", function() { + describe("The 'toEqual' matcher", () => { - it("works for simple literals and variables", function() { + it("works for simple literals and variables", () => { var a = 12; expect(a).toEqual(12); }); - it("should work for objects", function() { + it("should work for objects", () => { var foo = { a: 12, b: 34 @@ -56,7 +56,7 @@ describe("Included matchers:", function() { }); }); - it("The 'toMatch' matcher is for regular expressions", function() { + it("The 'toMatch' matcher is for regular expressions", () => { var message = "foo bar baz"; expect(message).toMatch(/bar/); @@ -64,16 +64,16 @@ describe("Included matchers:", function() { expect(message).not.toMatch(/quux/); }); - it("The 'toBeDefined' matcher compares against `undefined`", function() { + it("The 'toBeDefined' matcher compares against `undefined`", () => { var a = { foo: "foo" }; expect(a.foo).toBeDefined(); - expect((a).bar).not.toBeDefined(); + expect((a as any).bar).not.toBeDefined(); }); - it("The `toBeUndefined` matcher compares against `undefined`", function() { + it("The `toBeUndefined` matcher compares against `undefined`", () => { var a = { foo: "foo" }; @@ -82,7 +82,7 @@ describe("Included matchers:", function() { expect((a as any).bar).toBeUndefined(); }); - it("The 'toBeNull' matcher compares against null", function() { + it("The 'toBeNull' matcher compares against null", () => { var a: string = null; var foo = "foo"; @@ -91,28 +91,28 @@ describe("Included matchers:", function() { expect(foo).not.toBeNull(); }); - it("The 'toBeTruthy' matcher is for boolean casting testing", function() { + it("The 'toBeTruthy' matcher is for boolean casting testing", () => { var a: string, foo = "foo"; expect(foo).toBeTruthy(); expect(a).not.toBeTruthy(); }); - it("The 'toBeFalsy' matcher is for boolean casting testing", function() { + it("The 'toBeFalsy' matcher is for boolean casting testing", () => { var a: string, foo = "foo"; expect(a).toBeFalsy(); expect(foo).not.toBeFalsy(); }); - it("The 'toContain' matcher is for finding an item in an Array", function() { + it("The 'toContain' matcher is for finding an item in an Array", () => { var a = ["foo", "bar", "baz"]; expect(a).toContain('foo'); expect(a).not.toContain("quux"); }); - it("The 'toBeLessThan' matcher is for mathematical comparisons", function() { + it("The 'toBeLessThan' matcher is for mathematical comparisons", () => { var pi = 3.1415926, e = 2.78; @@ -120,7 +120,7 @@ describe("Included matchers:", function() { expect(pi).not.toBeLessThan(e); }); - it("The 'toBeGreaterThan' is for mathematical comparisons", function() { + it("The 'toBeGreaterThan' is for mathematical comparisons", () => { var pi = 3.1415926, e = 2.78; @@ -128,7 +128,7 @@ describe("Included matchers:", function() { expect(e).not.toBeGreaterThan(pi); }); - it("The 'toBeCloseTo' matcher is for precision math comparison", function() { + it("The 'toBeCloseTo' matcher is for precision math comparison", () => { var pi = 3.1415926, e = 2.78; @@ -136,12 +136,12 @@ describe("Included matchers:", function() { expect(pi).toBeCloseTo(e, 0); }); - it("The 'toThrow' matcher is for testing if a function throws an exception", function() { - var foo = function() { + it("The 'toThrow' matcher is for testing if a function throws an exception", () => { + var foo = () => { return 1 + 2; }; - var bar = function() { - var a: any = undefined; + var bar = () => { + var a: any; return a + 1; }; @@ -149,8 +149,8 @@ describe("Included matchers:", function() { expect(bar).toThrow(); }); - it("The 'toThrowError' matcher is for testing a specific thrown exception", function() { - var foo = function() { + it("The 'toThrowError' matcher is for testing a specific thrown exception", () => { + var foo = () => { throw new TypeError("foo bar baz"); }; @@ -161,15 +161,15 @@ describe("Included matchers:", function() { }); }); -describe("A spec", function() { - it("is just a function, so it can contain any code", function() { +describe("A spec", () => { + it("is just a function, so it can contain any code", () => { var foo = 0; foo += 1; expect(foo).toEqual(1); }); - it("can have more than one expectation", function() { + it("can have more than one expectation", () => { var foo = 0; foo += 1; @@ -178,96 +178,96 @@ describe("A spec", function() { }); }); -describe("A spec (with setup and tear-down)", function() { +describe("A spec (with setup and tear-down)", () => { var foo: number; - beforeEach(function() { + beforeEach(() => { foo = 0; foo += 1; }); - afterEach(function() { + afterEach(() => { foo = 0; }); - it("is just a function, so it can contain any code", function() { + it("is just a function, so it can contain any code", () => { expect(foo).toEqual(1); }); - it("can have more than one expectation", function() { + it("can have more than one expectation", () => { expect(foo).toEqual(1); expect(true).toEqual(true); }); }); -describe("A spec", function() { +describe("A spec", () => { var foo: number; - beforeEach(function() { + beforeEach(() => { foo = 0; foo += 1; }); - afterEach(function() { + afterEach(() => { foo = 0; }); - it("is just a function, so it can contain any code", function() { + it("is just a function, so it can contain any code", () => { expect(foo).toEqual(1); }); - it("can have more than one expectation", function() { + it("can have more than one expectation", () => { expect(foo).toEqual(1); expect(true).toEqual(true); }); - describe("nested inside a second describe", function() { + describe("nested inside a second describe", () => { var bar: number; - beforeEach(function() { + beforeEach(() => { bar = 1; }); - it("can reference both scopes as needed", function() { + it("can reference both scopes as needed", () => { expect(foo).toEqual(bar); }); }); }); -xdescribe("A spec", function() { +xdescribe("A spec", () => { var foo: number; - beforeEach(function() { + beforeEach(() => { foo = 0; foo += 1; }); - it("is just a function, so it can contain any code", function() { + it("is just a function, so it can contain any code", () => { expect(foo).toEqual(1); }); }); -describe("Pending specs", function() { +describe("Pending specs", () => { - xit("can be declared 'xit'", function() { + xit("can be declared 'xit'", () => { expect(true).toBe(false); }); it("can be declared with 'it' but without a function"); - it("can be declared by calling 'pending' in the spec body", function() { + it("can be declared by calling 'pending' in the spec body", () => { expect(true).toBe(false); pending(); // without reason pending('this is why it is pending'); }); }); -describe("A spy", function() { +describe("A spy", () => { var foo: any, bar: any = null; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -278,29 +278,29 @@ describe("A spy", function() { foo.setBar(456, 'another param'); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { expect(foo.setBar).toHaveBeenCalled(); }); - it("tracks all the arguments of its calls", function() { + it("tracks all the arguments of its calls", () => { expect(foo.setBar).toHaveBeenCalledWith(123); expect(foo.setBar).toHaveBeenCalledWith(456, 'another param'); }); - it("stops all execution on a function", function() { + it("stops all execution on a function", () => { expect(bar).toBeNull(); }); }); -describe("A spy, when configured to call through", function() { +describe("A spy, when configured to call through", () => { var foo: any, bar: any, fetchedBar: any; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function() { + getBar: () => { return bar; } }; @@ -311,28 +311,28 @@ describe("A spy, when configured to call through", function() { fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function() { + it("should not effect other functions", () => { expect(bar).toEqual(123); }); - it("when called returns the requested value", function() { + it("when called returns the requested value", () => { expect(fetchedBar).toEqual(123); }); }); -describe("A spy, when configured to fake a return value", function() { +describe("A spy, when configured to fake a return value", () => { var foo: any, bar: any, fetchedBar: any; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function() { + getBar: () => { return bar; } }; @@ -343,28 +343,28 @@ describe("A spy, when configured to fake a return value", function() { fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function() { + it("should not effect other functions", () => { expect(bar).toEqual(123); }); - it("when called returns the requested value", function() { + it("when called returns the requested value", () => { expect(fetchedBar).toEqual(745); }); }); -describe("A spy, when configured to fake a series of return values", function() { +describe("A spy, when configured to fake a series of return values", () => { var foo: any, bar: any; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function() { + getBar: () => { return bar; } }; @@ -374,36 +374,36 @@ describe("A spy, when configured to fake a series of return values", function() foo.setBar(123); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { foo.getBar(123); expect(foo.getBar).toHaveBeenCalled(); }); - it("should not affect other functions", function() { + it("should not affect other functions", () => { expect(bar).toEqual(123); }); - it("when called multiple times returns the requested values in order", function() { + it("when called multiple times returns the requested values in order", () => { expect(foo.getBar()).toEqual("fetched first"); expect(foo.getBar()).toEqual("fetched second"); expect(foo.getBar()).toBeUndefined(); }); }); -describe("A spy, when configured with an alternate implementation", function() { +describe("A spy, when configured with an alternate implementation", () => { var foo: any, bar: any, fetchedBar: any; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function() { + getBar: () => { return bar; } }; - spyOn(foo, "getBar").and.callFake(function() { + spyOn(foo, "getBar").and.callFake(() => { return 1001; }); @@ -411,25 +411,25 @@ describe("A spy, when configured with an alternate implementation", function() { fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function() { + it("should not effect other functions", () => { expect(bar).toEqual(123); }); - it("when called returns the requested value", function() { + it("when called returns the requested value", () => { expect(fetchedBar).toEqual(1001); }); }); -describe("A spy, when configured to throw a value", function() { +describe("A spy, when configured to throw a value", () => { var foo: any, bar: any; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -437,22 +437,22 @@ describe("A spy, when configured to throw a value", function() { spyOn(foo, "setBar").and.throwError("quux"); }); - it("throws the value", function() { - expect(function() { - foo.setBar(123) + it("throws the value", () => { + expect(() => { + foo.setBar(123); }).toThrowError("quux"); }); }); -describe("A spy, when configured with multiple actions", function() { +describe("A spy, when configured with multiple actions", () => { var foo: any, bar: any, fetchedBar: any; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, - getBar: function() { + getBar: () => { return bar; } }; @@ -465,29 +465,29 @@ describe("A spy, when configured with multiple actions", function() { fetchedBar = foo.getBar(); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { expect(foo.getBar).toHaveBeenCalled(); }); - it("should not effect other functions", function() { + it("should not effect other functions", () => { expect(bar).toEqual(123); }); - it("when called returns the requested value", function() { + it("when called returns the requested value", () => { expect(fetchedBar).toEqual(123); }); - it("should have called the fake implementation", function() { + it("should have called the fake implementation", () => { expect(this.fakeCalled).toEqual(true); }); }); -describe("A spy", function() { +describe("A spy", () => { var foo: any, bar: any = null; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -495,7 +495,7 @@ describe("A spy", function() { spyOn(foo, 'setBar').and.callThrough(); }); - it("can call through and then stub in the same spec", function() { + it("can call through and then stub in the same spec", () => { foo.setBar(123); expect(bar).toEqual(123); @@ -507,12 +507,12 @@ describe("A spy", function() { }); }); -describe("A spy", function() { +describe("A spy", () => { var foo: any, bar: any = null; - beforeEach(function() { + beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -520,7 +520,7 @@ describe("A spy", function() { spyOn(foo, 'setBar'); }); - it("tracks if it was called at all", function() { + it("tracks if it was called at all", () => { expect(foo.setBar.calls.any()).toEqual(false); foo.setBar(); @@ -528,7 +528,7 @@ describe("A spy", function() { expect(foo.setBar.calls.any()).toEqual(true); }); - it("tracks the number of times it was called", function() { + it("tracks the number of times it was called", () => { expect(foo.setBar.calls.count()).toEqual(0); foo.setBar(); @@ -537,7 +537,7 @@ describe("A spy", function() { expect(foo.setBar.calls.count()).toEqual(2); }); - it("tracks the arguments of each call", function() { + it("tracks the arguments of each call", () => { foo.setBar(123); foo.setBar(456, "baz"); @@ -545,34 +545,34 @@ describe("A spy", function() { expect(foo.setBar.calls.argsFor(1)).toEqual([456, "baz"]); }); - it("tracks the arguments of all calls", function() { + it("tracks the arguments of all calls", () => { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.allArgs()).toEqual([[123], [456, "baz"]]); }); - it("can provide the context and arguments to all calls", function() { + it("can provide the context and arguments to all calls", () => { foo.setBar(123); expect(foo.setBar.calls.all()).toEqual([{ object: foo, args: [123], returnValue: undefined }]); }); - it("has a shortcut to the most recent call", function() { + it("has a shortcut to the most recent call", () => { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.mostRecent()).toEqual({ object: foo, args: [456, "baz"], returnValue: undefined }); }); - it("has a shortcut to the first call", function() { + it("has a shortcut to the first call", () => { foo.setBar(123); foo.setBar(456, "baz"); expect(foo.setBar.calls.first()).toEqual({ object: foo, args: [123], returnValue: undefined }); }); - it("can be reset", function() { + it("can be reset", () => { foo.setBar(123); foo.setBar(456, "baz"); @@ -584,40 +584,40 @@ describe("A spy", function() { }); }); -describe("A spy, when created manually", function() { +describe("A spy, when created manually", () => { var whatAmI: any; - beforeEach(function() { + beforeEach(() => { whatAmI = jasmine.createSpy('whatAmI'); whatAmI("I", "am", "a", "spy"); }); - it("is named, which helps in error reporting", function() { + it("is named, which helps in error reporting", () => { expect(whatAmI.and.identity()).toEqual('whatAmI'); }); - it("tracks that the spy was called", function() { + it("tracks that the spy was called", () => { expect(whatAmI).toHaveBeenCalled(); }); - it("tracks its number of calls", function() { + it("tracks its number of calls", () => { expect(whatAmI.calls.count()).toEqual(1); }); - it("tracks all the arguments of its calls", function() { + it("tracks all the arguments of its calls", () => { expect(whatAmI).toHaveBeenCalledWith("I", "am", "a", "spy"); }); - it("allows access to the most recent call", function() { + it("allows access to the most recent call", () => { expect(whatAmI.calls.mostRecent().args[0]).toEqual("I"); }); }); -describe("Multiple spies, when created manually", function() { +describe("Multiple spies, when created manually", () => { var tape: any; - beforeEach(function() { + beforeEach(() => { tape = jasmine.createSpyObj('tape', ['play', 'pause', 'stop', 'rewind']); tape.play(); @@ -625,35 +625,35 @@ describe("Multiple spies, when created manually", function() { tape.rewind(0); }); - it("creates spies for each requested function", function() { + it("creates spies for each requested function", () => { expect(tape.play).toBeDefined(); expect(tape.pause).toBeDefined(); expect(tape.stop).toBeDefined(); expect(tape.rewind).toBeDefined(); }); - it("tracks that the spies were called", function() { + it("tracks that the spies were called", () => { expect(tape.play).toHaveBeenCalled(); expect(tape.pause).toHaveBeenCalled(); expect(tape.rewind).toHaveBeenCalled(); expect(tape.stop).not.toHaveBeenCalled(); }); - it("tracks all the arguments of its calls", function() { + it("tracks all the arguments of its calls", () => { expect(tape.rewind).toHaveBeenCalledWith(0); }); }); -describe("jasmine.any", function() { - it("matches any value", function() { +describe("jasmine.any", () => { + it("matches any value", () => { expect({}).toEqual(jasmine.any(Object)); expect(12).toEqual(jasmine.any(Number)); }); - describe("when used with a spy", function() { - it("is useful for comparing arguments", function() { + describe("when used with a spy", () => { + it("is useful for comparing arguments", () => { var foo = jasmine.createSpy('foo'); - foo(12, function() { + foo(12, () => { return true; }); @@ -662,7 +662,7 @@ describe("jasmine.any", function() { }); }); -describe("jasmine.objectContaining", function() { +describe("jasmine.objectContaining", () => { interface fooType { a: number; b: number; @@ -670,7 +670,7 @@ describe("jasmine.objectContaining", function() { } var foo: fooType; - beforeEach(function() { + beforeEach(() => { foo = { a: 1, b: 2, @@ -678,7 +678,7 @@ describe("jasmine.objectContaining", function() { }; }); - it("matches objects with the expect key/value pairs", function() { + it("matches objects with the expect key/value pairs", () => { expect(foo).toEqual(jasmine.objectContaining({ bar: '' })); @@ -688,8 +688,8 @@ describe("jasmine.objectContaining", function() { })); }); - describe("when used with a spy", function() { - it("is useful for comparing arguments", function() { + describe("when used with a spy", () => { + it("is useful for comparing arguments", () => { var callback = jasmine.createSpy('callback'); callback({ @@ -706,20 +706,20 @@ describe("jasmine.objectContaining", function() { }); }); -describe("jasmine.arrayContaining", function() { +describe("jasmine.arrayContaining", () => { var foo: any; - beforeEach(function() { + beforeEach(() => { foo = [1, 2, 3, 4]; }); - it("matches arrays with some of the values", function() { + it("matches arrays with some of the values", () => { expect(foo).toEqual(jasmine.arrayContaining([3, 1])); expect(foo).not.toEqual(jasmine.arrayContaining([6])); }); - describe("when used with a spy", function() { - it("is useful when comparing arguments", function() { + describe("when used with a spy", () => { + it("is useful when comparing arguments", () => { var callback = jasmine.createSpy('callback'); callback([1, 2, 3, 4]); @@ -730,20 +730,20 @@ describe("jasmine.arrayContaining", function() { }); }); -describe("Manually ticking the Jasmine Clock", function() { +describe("Manually ticking the Jasmine Clock", () => { var timerCallback: any; - beforeEach(function() { + beforeEach(() => { timerCallback = jasmine.createSpy("timerCallback"); jasmine.clock().install(); }); - afterEach(function() { + afterEach(() => { jasmine.clock().uninstall(); }); - it("causes a timeout to be called synchronously", function() { - setTimeout(function() { + it("causes a timeout to be called synchronously", () => { + setTimeout(() => { timerCallback(); }, 100); @@ -754,8 +754,8 @@ describe("Manually ticking the Jasmine Clock", function() { expect(timerCallback).toHaveBeenCalled(); }); - it("causes an interval to be called synchronously", function() { - setInterval(function() { + it("causes an interval to be called synchronously", () => { + setInterval(() => { timerCallback(); }, 100); @@ -771,8 +771,8 @@ describe("Manually ticking the Jasmine Clock", function() { expect(timerCallback.calls.count()).toEqual(2); }); - describe("Mocking the Date object", function() { - it("mocks the Date object and sets it to a given time", function() { + describe("Mocking the Date object", () => { + it("mocks the Date object and sets it to a given time", () => { var baseTime = new Date(2013, 9, 23); jasmine.clock().mockDate(baseTime); @@ -783,82 +783,82 @@ describe("Manually ticking the Jasmine Clock", function() { }); }); -describe("Asynchronous specs", function() { +describe("Asynchronous specs", () => { var value: number; - beforeEach(function (done: DoneFn) { - setTimeout(function() { + beforeEach((done: DoneFn) => { + setTimeout(() => { value = 0; done(); }, 1); }); - it("should support async execution of test preparation and expectations", function (done: DoneFn) { + it("should support async execution of test preparation and expectations", (done: DoneFn) => { value++; expect(value).toBeGreaterThan(0); done(); }); - describe("long asynchronous specs", function() { - beforeEach(function (done: DoneFn) { + describe("long asynchronous specs", () => { + beforeEach((done: DoneFn) => { done(); }, 1000); - it("takes a long time", function (done: DoneFn) { - setTimeout(function() { + it("takes a long time", (done: DoneFn) => { + setTimeout(() => { done(); }, 9000); }, 10000); - afterEach(function (done: DoneFn) { + afterEach((done: DoneFn) => { done(); }, 1000); }); }); -describe("Fail", function() { +describe("Fail", () => { - it("should fail test when called without arguments", function() { + it("should fail test when called without arguments", () => { fail(); }); - it("should fail test when called with a fail message", function() { + it("should fail test when called with a fail message", () => { fail("The test failed"); }); - it("should fail test when called an error", function() { + it("should fail test when called an error", () => { fail(new Error("The test failed with this error")); }); }); // test based on http://jasmine.github.io/2.2/custom_equality.html -describe("custom equality", function() { - var myCustomEquality: jasmine.CustomEqualityTester = function (first: any, second: any): boolean { - if (typeof first == "string" && typeof second == "string") { - return first[0] == second[1]; +describe("custom equality", () => { + var myCustomEquality: jasmine.CustomEqualityTester = function(first: any, second: any): boolean { + if (typeof first === "string" && typeof second === "string") { + return first[0] === second[1]; } }; - beforeEach(function() { + beforeEach(() => { jasmine.addCustomEqualityTester(myCustomEquality); }); - it("should be custom equal", function() { + it("should be custom equal", () => { expect("abc").toEqual("aaa"); }); - it("should be custom not equal", function() { + it("should be custom not equal", () => { expect("abc").not.toEqual("abc"); }); }); // test based on http://jasmine.github.io/2.2/custom_matcher.html var customMatchers: jasmine.CustomMatcherFactories = { - toBeGoofy: function (util: jasmine.MatchersUtil, customEqualityTesters: Array) { + toBeGoofy: (util: jasmine.MatchersUtil, customEqualityTesters: jasmine.CustomEqualityTester[]) => { return { - compare: function (actual: any, expected: any): jasmine.CustomMatcherResult { + compare: (actual: any, expected: any): jasmine.CustomMatcherResult => { if (expected === undefined) { expected = ''; } @@ -892,24 +892,24 @@ declare namespace jasmine { } } -describe("Custom matcher: 'toBeGoofy'", function() { - beforeEach(function() { +describe("Custom matcher: 'toBeGoofy'", () => { + beforeEach(() => { jasmine.addMatchers(customMatchers); }); - it("is available on an expectation", function() { + it("is available on an expectation", () => { expect({ hyuk: 'gawrsh' }).toBeGoofy(); }); - it("can take an 'expected' parameter", function() { + it("can take an 'expected' parameter", () => { expect({ hyuk: 'gawrsh is fun' }).toBeGoofy({ hyuk: ' is fun' }); }); - it("can be negated", function() { + it("can be negated", () => { expect({ hyuk: 'this is fun' }).not.toBeGoofy(); @@ -918,20 +918,21 @@ describe("Custom matcher: 'toBeGoofy'", function() { // test based on http://jasmine.github.io/2.5/custom_reporter.html var myReporter: jasmine.CustomReporter = { - jasmineStarted: function (suiteInfo: jasmine.SuiteInfo) { + jasmineStarted: (suiteInfo: jasmine.SuiteInfo) => { console.log("Running suite with " + suiteInfo.totalSpecsDefined); }, - suiteStarted: function (result: jasmine.CustomReporterResult) { + suiteStarted: (result: jasmine.CustomReporterResult) => { console.log("Suite started: " + result.description + " whose full description is: " + result.fullName); }, - specStarted: function (result: jasmine.CustomReporterResult) { + specStarted: (result: jasmine.CustomReporterResult) => { console.log("Spec started: " + result.description + " whose full description is: " + result.fullName); }, - specDone: function (result: jasmine.CustomReporterResult) { + specDone: (result: jasmine.CustomReporterResult) => { console.log("Spec: " + result.description + " was " + result.status); + //tslint:disable-next-line:prefer-for-of for (var i = 0; i < result.failedExpectations.length; i++) { console.log("Failure: " + result.failedExpectations[i].message); console.log("Actual: " + result.failedExpectations[i].actual); @@ -941,15 +942,16 @@ var myReporter: jasmine.CustomReporter = { console.log(result.passedExpectations.length); }, - suiteDone: function (result: jasmine.CustomReporterResult) { + suiteDone: (result: jasmine.CustomReporterResult) => { console.log('Suite: ' + result.description + ' was ' + result.status); + //tslint:disable-next-line:prefer-for-of for (var i = 0; i < result.failedExpectations.length; i++) { console.log('AfterAll ' + result.failedExpectations[i].message); console.log(result.failedExpectations[i].stack); } }, - jasmineDone: function (runDetails: jasmine.RunDetails) { + jasmineDone: (runDetails: jasmine.RunDetails) => { console.log('Finished suite'); console.log('Random:', runDetails.order.random); } @@ -957,16 +959,16 @@ var myReporter: jasmine.CustomReporter = { jasmine.getEnv().addReporter(myReporter); -describe("Randomize Tests", function() { - it("should allow randomization of the order of tests", function() { - expect(function() { +describe("Randomize Tests", () => { + it("should allow randomization of the order of tests", () => { + expect(() => { var env = jasmine.getEnv(); return env.randomizeTests(true); }).not.toThrow(); }); - it("should allow a seed to be passed in for randomization", function() { - expect(function() { + it("should allow a seed to be passed in for randomization", () => { + expect(() => { var env = jasmine.getEnv(); env.randomizeTests(true); return env.seed(1234); @@ -982,14 +984,14 @@ describe("Randomize Tests", function() { env.addReporter(htmlReporter); var specFilter = new jasmine.HtmlSpecFilter(); - env.specFilter = function (spec) { + env.specFilter = (spec) => { return specFilter.matches(spec.getFullName()); }; var currentWindowOnload = window.onload; - window.onload = function() { + window.onload = () => { if (currentWindowOnload) { - (currentWindowOnload)(null); + (currentWindowOnload as any)(null); } htmlReporter.initialize(); env.execute(); diff --git a/jasmine/v1/jasmine-tests.ts b/jasmine/v1/jasmine-tests.ts index 9177679f8a..c47fc84007 100644 --- a/jasmine/v1/jasmine-tests.ts +++ b/jasmine/v1/jasmine-tests.ts @@ -60,7 +60,7 @@ describe("Included matchers:", () => { foo: 'foo' }; expect(a.foo).toBeDefined(); - expect((a).bar).not.toBeDefined(); + expect((a as any).bar).not.toBeDefined(); }); it("The `toBeUndefined` matcher compares against `undefined`", () => { @@ -68,7 +68,7 @@ describe("Included matchers:", () => { foo: 'foo' }; expect(a.foo).not.toBeUndefined(); - expect((a).bar).toBeUndefined(); + expect((a as any).bar).toBeUndefined(); }); it("The 'toBeNull' matcher compares against null", () => { @@ -202,7 +202,7 @@ describe("A spy", () => { var foo: any, bar: any = null; beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; } }; @@ -235,7 +235,7 @@ describe("A spy, when configured to call through", () => { var foo: any, bar: any, fetchedBar: any; beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, getBar: () => { @@ -261,7 +261,7 @@ describe("A spy, when faking a return value", () => { var foo: any, bar: any, fetchedBar: any; beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, getBar: () => { @@ -287,7 +287,7 @@ describe("A spy, when faking a return value", () => { var foo: any, bar: any, fetchedBar: any; beforeEach(() => { foo = { - setBar: function (value: any) { + setBar: (value: any) => { bar = value; }, getBar: () => { @@ -319,7 +319,7 @@ describe("A spy, when created manually", () => { whatAmI("I", "am", "a", "spy"); }); it("is named, which helps in error reporting", () => { - expect(whatAmI.identity).toEqual('whatAmI') + expect(whatAmI.identity).toEqual('whatAmI'); }); it("tracks that the spy was called", () => { expect(whatAmI).toHaveBeenCalled(); @@ -369,7 +369,7 @@ describe("jasmine.any", () => { it("is useful for comparing arguments", () => { var foo = jasmine.createSpy('foo'); foo(12, () => { - return true + return true; }); expect(foo).toHaveBeenCalledWith(jasmine.any(Number), jasmine.any(Function)); }); @@ -430,7 +430,7 @@ describe("Asynchronous specs", () => { jasmineEnv.updateInterval = 250; var htmlReporter = new jasmine.HtmlReporter(); jasmineEnv.addReporter(htmlReporter); - jasmineEnv.specFilter = function (spec) { + jasmineEnv.specFilter = (spec) => { return htmlReporter.specFilter(spec); }; var currentWindowOnload = (arg: any) => window.onload(arg); @@ -439,11 +439,11 @@ describe("Asynchronous specs", () => { currentWindowOnload(null); } - (document.querySelector('.version')).innerHTML = jasmineEnv.versionString(); + (document.querySelector('.version') as HTMLElement).innerHTML = jasmineEnv.versionString(); execJasmine(); }; function execJasmine() { jasmineEnv.execute(); } -})(); \ No newline at end of file +})(); From ba29010d1438767c5db5e73d716447178d85f0f3 Mon Sep 17 00:00:00 2001 From: Lukas Zech Date: Sun, 26 Feb 2017 13:17:07 +0100 Subject: [PATCH 225/797] Fix other jasmine packages --- jasmine-es6-promise-matchers/index.d.ts | 2 +- jasmine-expect/index.d.ts | 2 +- jasmine-jquery/index.d.ts | 6 +++--- jasmine-jquery/jasmine-jquery-tests.ts | 4 ++-- jasmine-matchers/index.d.ts | 2 +- jasmine-promise-matchers/index.d.ts | 2 +- jasmine/v1/index.d.ts | 16 ++++++++-------- jasminewd2/index.d.ts | 17 ++++++++++++----- 8 files changed, 29 insertions(+), 22 deletions(-) diff --git a/jasmine-es6-promise-matchers/index.d.ts b/jasmine-es6-promise-matchers/index.d.ts index 89e3146c2c..7d61d4d660 100644 --- a/jasmine-es6-promise-matchers/index.d.ts +++ b/jasmine-es6-promise-matchers/index.d.ts @@ -13,7 +13,7 @@ declare namespace JasminePromiseMatchers { declare namespace jasmine { - interface Matchers { + interface Matchers { /** * Verifies that a Promise is (or has been) rejected. */ diff --git a/jasmine-expect/index.d.ts b/jasmine-expect/index.d.ts index c2ee7e0ee5..25a21d49d5 100644 --- a/jasmine-expect/index.d.ts +++ b/jasmine-expect/index.d.ts @@ -7,7 +7,7 @@ /// declare namespace jasmine { - interface Matchers { + interface Matchers { // These functions are written in the order defined in the src directory of jasmine-matchers // The type system is used smartly whenever it can provide value (by looking at the code of every matcher) toBeAfter(otherDate: Date): boolean; // diff --git a/jasmine-jquery/index.d.ts b/jasmine-jquery/index.d.ts index fb91e0c37b..ebc14cee75 100644 --- a/jasmine-jquery/index.d.ts +++ b/jasmine-jquery/index.d.ts @@ -81,7 +81,7 @@ declare namespace jasmine { proxyCallTo_(methodName: string, passedArguments: any): any; } - interface Matchers { + interface Matchers { /** * Check if DOM element has class. * @@ -232,7 +232,7 @@ declare namespace jasmine { * */ toHaveData(key : string, expectedValue : string): boolean; - toBe(selector: JQuery): boolean; + toBe(selector: T): boolean; /** * Check if DOM element is matched by the given selector. @@ -241,7 +241,7 @@ declare namespace jasmine { * // returns true * expect($('
')).toContain('some-class') */ - toContain(selector: JQuery): boolean; + toContain(selector: T): boolean; /** * Check if DOM element exists inside the given parent element. diff --git a/jasmine-jquery/jasmine-jquery-tests.ts b/jasmine-jquery/jasmine-jquery-tests.ts index 67b349d45e..9d51a3775b 100644 --- a/jasmine-jquery/jasmine-jquery-tests.ts +++ b/jasmine-jquery/jasmine-jquery-tests.ts @@ -4,8 +4,8 @@ describe("Jasmine jQuery extension", () => { it("Adds jQuery matchers", () => { - expect($('
')).toBe('div'); - expect($('
')).toBe('div#some-id'); + expect($('
')).toBe($('div')); + expect($('
')).toBe($('div#some-id')); expect($('')).toBeChecked(); expect($('
')).toBeHidden(); expect($('
')).toHaveCss({ display: "none", margin: "10px" }); diff --git a/jasmine-matchers/index.d.ts b/jasmine-matchers/index.d.ts index ac44d25c1c..d4cad3b77c 100644 --- a/jasmine-matchers/index.d.ts +++ b/jasmine-matchers/index.d.ts @@ -23,7 +23,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI /// declare namespace jasmine { - interface Matchers { + interface Matchers { //toBe toBeArray(): boolean; diff --git a/jasmine-promise-matchers/index.d.ts b/jasmine-promise-matchers/index.d.ts index c511019b62..ffe4f65142 100644 --- a/jasmine-promise-matchers/index.d.ts +++ b/jasmine-promise-matchers/index.d.ts @@ -10,7 +10,7 @@ declare function installPromiseMatchers(): void; declare namespace jasmine { - interface Matchers { + interface Matchers { /** * Verifies that a Promise is (or has been) rejected. */ diff --git a/jasmine/v1/index.d.ts b/jasmine/v1/index.d.ts index 5cbb2a9f83..3f51240f63 100644 --- a/jasmine/v1/index.d.ts +++ b/jasmine/v1/index.d.ts @@ -16,9 +16,9 @@ declare function xit(expectation: string, assertion: () => void): void; declare function beforeEach(action: () => void): void; declare function afterEach(action: () => void): void; -declare function expect(spy: Function): jasmine.Matchers; -//declare function expect(spy: jasmine.Spy): jasmine.Matchers; -declare function expect(actual: any): jasmine.Matchers; +declare function expect(spy: Function): jasmine.Matchers; +//declare function expect(spy: jasmine.Spy): jasmine.Matchers; +declare function expect(actual: any): jasmine.Matchers; declare function spyOn(object: any, method: string): jasmine.Spy; @@ -91,7 +91,7 @@ declare namespace jasmine { currentSpec: Spec; - matchersClass: Matchers; + matchersClass: Matchers; version(): any; versionString(): string; @@ -204,7 +204,7 @@ declare namespace jasmine { results(): NestedResults; } - interface Matchers { + interface Matchers { new (env: Env, actual: any, spec: Env, isNot?: boolean): any; @@ -232,7 +232,7 @@ declare namespace jasmine { toContainHtml(expected: string): boolean; toContainText(expected: string): boolean; toThrow(expected?: any): boolean; - not: Matchers; + not: Matchers; Any: Any; } @@ -287,7 +287,7 @@ declare namespace jasmine { spies_: Spy[]; results_: NestedResults; - matchersClass: Matchers; + matchersClass: Matchers; getFullName(): string; results(): NestedResults; @@ -299,7 +299,7 @@ declare namespace jasmine { waits(timeout: number): Spec; waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec; fail(e?: any): void; - getMatchersClass_(): Matchers; + getMatchersClass_(): Matchers; addMatchers(matchersPrototype: any): void; finishCallback(): void; finish(onComplete?: () => void): void; diff --git a/jasminewd2/index.d.ts b/jasminewd2/index.d.ts index 9d8ecde76e..a4122c6639 100644 --- a/jasminewd2/index.d.ts +++ b/jasminewd2/index.d.ts @@ -17,10 +17,10 @@ declare function afterAll(action: () => Promise, timeout?: number): void; declare namespace jasmine { // The global `Promise` type is too strict and kinda wrong interface Promise { - then(onFulfill?: (value: T) => U | Promise, onReject?: (error: any) => U | Promise): Promise; + then(onFulfill?: (value: T) => U | Promise, onReject?: (error: any) => U | Promise): Promise; } - interface Matchers { + interface Matchers { toBe(expected: any, expectationFailOutput?: any): Promise; toEqual(expected: any, expectationFailOutput?: any): Promise; toMatch(expected: string | RegExp | Promise, expectationFailOutput?: any): Promise; @@ -44,6 +44,13 @@ declare namespace jasmine { toThrowError(expected?: new (...args: any[]) => Error | Promise Error>, message?: string | RegExp | Promise): Promise; } + interface ArrayLikeMatchers> extends Matchers { + toBe(expected: Expected>, expectationFailOutput?: any): Promise; + toEqual(expected: Expected>, expectationFailOutput?: any): Promise; + toContain(expected: T, expectationFailOutput?: any): Promise; + not: ArrayLikeMatchers; + } + function addMatchers(matchers: AsyncCustomMatcherFactories): void; interface Env { @@ -59,12 +66,12 @@ declare namespace jasmine { } interface AsyncCustomMatcherFactory { - (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]): AsyncCustomMatcher; + (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]): AsyncCustomMatcher; } interface AsyncCustomMatcher { - compare(actual: T, expected: T): AsyncCustomMatcherResult; - compare(actual: any, expected: any): AsyncCustomMatcherResult; + compare(actual: T, expected: T): AsyncCustomMatcherResult; + compare(actual: any, expected: any): AsyncCustomMatcherResult; } interface AsyncCustomMatcherResult { From 028d2d8203163859882dde1e9e972f05449fb6e0 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Sun, 26 Feb 2017 16:06:31 +0100 Subject: [PATCH 226/797] Add noHtml5Validate prop to react-jsonschema-form The `noHtml5Validate` prop was added to react-jsonschema-form
component. Update typings to reflect this new optional prop. --- react-jsonschema-form/index.d.ts | 1 + react-jsonschema-form/react-jsonschema-form-tests.tsx | 1 + 2 files changed, 2 insertions(+) diff --git a/react-jsonschema-form/index.d.ts b/react-jsonschema-form/index.d.ts index 6786862ea8..dafee87e9f 100644 --- a/react-jsonschema-form/index.d.ts +++ b/react-jsonschema-form/index.d.ts @@ -14,6 +14,7 @@ declare module "react-jsonschema-form" { widgets?: {}; fields?: {}; noValidate?: boolean; + noHtml5Validate?: boolean; showErrorList?: boolean; validate?: (formData: any, errors: any) => any; onChange?: (e: IChangeEvent) => any; diff --git a/react-jsonschema-form/react-jsonschema-form-tests.tsx b/react-jsonschema-form/react-jsonschema-form-tests.tsx index 9f2c05086d..c8d49a7628 100644 --- a/react-jsonschema-form/react-jsonschema-form-tests.tsx +++ b/react-jsonschema-form/react-jsonschema-form-tests.tsx @@ -78,6 +78,7 @@ export class Example extends React.Component { uiSchema={uiSchema} showErrorList={false} noValidate={false} + noHtml5Validate={false} formData={this.state} onChange={(formData) => this.setState({formData})} /> }
From 46d11bc6ab4a0a9b711b403662dceefb67ebb575 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Sun, 26 Feb 2017 16:21:37 +0100 Subject: [PATCH 227/797] Update version info, update authorship --- react-jsonschema-form/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react-jsonschema-form/index.d.ts b/react-jsonschema-form/index.d.ts index dafee87e9f..6ac5f40109 100644 --- a/react-jsonschema-form/index.d.ts +++ b/react-jsonschema-form/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for react-jsonschema-form 0.38.1 +// Type definitions for react-jsonschema-form 0.43.0 // Project: https://github.com/mozilla-services/react-jsonschema-form -// Definitions by: Dan Fox +// Definitions by: Dan Fox , Jon Surrell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 From ad604728f7e8ab544247fad8e81790cdd69dca19 Mon Sep 17 00:00:00 2001 From: Daniel Perez Alvarez Date: Sun, 26 Feb 2017 19:01:24 -0800 Subject: [PATCH 228/797] Move getBadgeCount and setBadgeCount under app (#14882) --- electron/index.d.ts | 30 +++++++++++++++--------------- electron/test/main.ts | 3 ++- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/electron/index.d.ts b/electron/index.d.ts index 448df1915f..0b98ae1944 100644 --- a/electron/index.d.ts +++ b/electron/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Electron v1.4.8 // Project: http://electron.atom.io/ -// Definitions by: jedmao , rhysd , Milan Burda , aliib +// Definitions by: jedmao , rhysd , Milan Burda , aliib , Daniel Perez Alvarez // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -398,6 +398,20 @@ declare namespace Electron { * This method can only be called before app is ready. */ disableHardwareAcceleration(): void; + /** + * Sets the counter badge for current app. Setting the count to 0 will hide the badge. + * + * @returns True when the call succeeded, otherwise returns false. + * + * Note: This API is only available on macOS and Linux. + */ + setBadgeCount(count: number): boolean; + /** + * @returns The current value displayed in the counter badge. + * + * Note: This API is only available on macOS and Linux. + */ + getBadgeCount(): number; /** * @returns whether current desktop environment is Unity launcher. (Linux) * @@ -505,20 +519,6 @@ declare namespace Electron { * Note: This API is only available on macOS. */ getBadge(): string; - /** - * Sets the counter badge for current app. Setting the count to 0 will hide the badge. - * - * @returns True when the call succeeded, otherwise returns false. - * - * Note: This API is only available on macOS and Linux. - */ - setBadgeCount(count: number): boolean; - /** - * @returns The current value displayed in the counter badge. - * - * Note: This API is only available on macOS and Linux. - */ - getBadgeCount(): number; /** * Hides the dock icon. * diff --git a/electron/test/main.ts b/electron/test/main.ts index 9912b62eea..276a15d851 100644 --- a/electron/test/main.ts +++ b/electron/test/main.ts @@ -232,7 +232,8 @@ app.dock.setBadge('foo'); var id = app.dock.bounce('informational'); app.dock.cancelBounce(id); app.dock.setIcon('/path/to/icon.png'); -app.dock.setBadgeCount(app.dock.getBadgeCount() + 1); + +app.setBadgeCount(app.getBadgeCount() + 1); app.setUserTasks([ { From 9915d2b7a6c2806eb2daa26e151bd8fdc86eb64f Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Mon, 27 Feb 2017 14:33:16 +0530 Subject: [PATCH 229/797] lint errors fixed. --- ej.web.all/index.d.ts | 6315 +++++++++++++++++++---------------------- 1 file changed, 2846 insertions(+), 3469 deletions(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 7f10816c5a..1e0138580e 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ej.web.all 15.1.33 +// Type definitions for ej.web.all 15.1.33 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -12,14 +12,10 @@ * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under -* applicable laws. +* applicable laws. */ - -/* tslint:disabled */ - -declare module ej { - - var dataUtil: dataUtil; +declare namespace ej { + const dataUtil: dataUtil; function isMobile(): boolean; function isIOS(): boolean; function isAndroid(): boolean; @@ -32,33 +28,33 @@ declare module ej { function isTouchDevice(): boolean; function addPrefix(style: string): string; function animationEndEvent(): string; - function blockDefaultActions(e: Object): void; - function buildTag(tag: string, innerHtml?: string, styles?: Object, attrs?: Object): JQuery; + function blockDefaultActions(e: any): void; + function buildTag(tag: string, innerHtml?: string, styles?: any, attrs?: any): JQuery; function cancelEvent(): string; function copyObject(): string; - function createObject(nameSpace: string, value: Object, initIn: any): JQuery; + function createObject(nameSpace: string, value: any, initIn: any): JQuery; function createObject(element: any, eventEmitter: any, model: any): any; function setCulture(culture: string): void; - function getObject(element :string, model :any ): T; - function defineClass(className: string, constructor:any, proto: Object, replace: boolean): Object; - function destroyWidgets(element: Object): void; + function getObject(element: string, model: any ): T; + function getObject(nameSpace: string, fromdata?: any): any; + function defineClass(className: string, constructor: any, proto: any, replace: boolean): any; + function destroyWidgets(element: any): void; function endEvent(): string; - function event(type: string, data: any, eventProp: Object): Object; - function getAndroidVersion(): Object; - function getAttrVal(ele: Object, val: string, option: Object): Object; - function getBooleanVal(ele: Object, val: string, option: Object): Object; + function event(type: string, data: any, eventProp: any): any; + function getAndroidVersion(): any; + function getAttrVal(ele: any, val: string, option: any): any; + function getBooleanVal(ele: any, val: string, option: any): any; function getClearString(): string; - function getDimension(element: Object, method: string): Object; - function getFontString(fontObj: Object): string; + function getDimension(element: any, method: string): any; + function getFontString(fontObj: any): string; function getFontStyle(style: string): string; function getMaxZindex(): number; function getNameSpace(className: string): string; - function getObject(nameSpace: string, fromdata?: any): Object; - function getOffset(ele: string): Object; + function getOffset(ele: string): any; function getRenderMode(): string; - function getScrollableParents(element: Object): void; + function getScrollableParents(element: any): void; function getTheme(): string; - function getZindexPartial(element: Object, popupEle: string): number; + function getZindexPartial(element: any, popupEle: string): number; function hasRenderMode(element: string): void; function hasStyle(prop: string): boolean; function hasTheme(element: string): string; @@ -69,91 +65,90 @@ declare module ej { function isIOS7(): boolean; function isIOSWebView(): boolean; function isLowerAndroid(): boolean; - function isNullOrUndefined(value: Object): boolean; + function isNullOrUndefined(value: any): boolean; function isPlainObject(): JQuery; function isPortrait(): any; function isTablet(): boolean; function isWindowsWebView(): string; - function listenEvents(selectors:any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; - function listenTouchEvent(selectors:any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; + function listenEvents(selectors: any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; + function listenTouchEvent(selectors: any, eventTypes: any, handlers: any, remove?: any, pluginObj?: any, disableMouse?: boolean): void; function logBase(val: string, base: string): number; function measureText(text: string, maxwidth: number, font: string): string; function moveEvent(): string; function print(element: string, printWindow: any): void; - function proxy(fn: Object, context?: string, arg?: string): any; + function proxy(fn: any, context?: string, arg?: string): any; function round(value: string, div: string, up: string): any; - function sendAjaxRequest(ajaxOptions: Object): void; + function sendAjaxRequest(ajaxOptions: any): void; function setCaretToPos(nput: string, pos1: string, pos2: string): void; function setRenderMode(element: string): void; - function setTheme(): Object; + function setTheme(): any; function startEvent(): string; function tapEvent(): string; function tapHoldEvent(): string; - function throwError(): Object; - function transitionEndEvent(): Object; + function throwError(): any; + function transitionEndEvent(): any; function userAgent(): boolean; - function widget(pluginName: string, className: string, proto: Object): Object; - function avg(json: Object, filedName: string): any; + function widget(pluginName: string, className: string, proto: any): any; + function avg(json: any, filedName: string): any; function getGuid(prefix: string): number; - function group(jsonArray: any, field: string, agg: string, level: number, groupDs: string): Object; + function group(jsonArray: any, field: string, agg: string, level: number, groupDs: string): any; function isJson(jsonData: string): string; function max(jsonArray: any, fieldName?: string, comparer?: string): any; function min(jsonArray: any, fieldName: string, comparer: string): any; function merge(first: string, second: string): any; function mergeshort(jsonArray: any, fieldName: string, comparer: string): any; function parseJson(jsonText: string): string; - function parseTable(table: number, headerOption: string, headerRowIndex: string): Object; + function parseTable(table: number, headerOption: string, headerRowIndex: string): any; function select(jsonArray: any, fields: string): any; function setTransition(): boolean; function sum(json: string, fieldName: string): string; - function swap(array: any, x: string, y: string): any; - var cssUA: string; - var serverTimezoneOffset: number; - var transform: string; - var transformOrigin: string; - var transformStyle: string; - var transition: string; - var transitionDelay: string; - var transitionDuration: string; - var transitionProperty: string; - var transitionTimingFunction: string; - var template: any; - var util: { + function swap(array: any, x: string, y: string): any; + const cssUA: string; + const serverTimezoneOffset: number; + const transform: string; + const transformOrigin: string; + const transformStyle: string; + const transition: string; + const transitionDelay: string; + const transitionDuration: string; + const transitionProperty: string; + const transitionTimingFunction: string; + const template: any; + const util: { valueFunction(val: string): any; - } - export module device { + }; + export namespace device { function isAndroid(): boolean; function isIOS(): boolean; function isFlat(): boolean; function isIOS7(): boolean; function isWindows(): boolean; } - export module widget { - var autoInit: boolean; - var registeredInstances: Array; - var registeredWidgets: Array; + export namespace widget { + const autoInit: boolean; + const registeredInstances: any[]; + const registeredWidgets: any[]; function register(pluginName: string, className: string, prototype: any): void; function destroyAll(elements: Element): void; function init(element: Element): void; - function registerInstance(element: Element, pluginName: string, className: string, prototype: any):void; - } - + function registerInstance(element: Element, pluginName: string, className: string, prototype: any): void; + } interface browserInfoOptions { name: string; version: string; - culture: Object; + culture: any; isMSPointerEnabled: boolean; } class WidgetBase { destroy(): void; element: JQuery; - setModel(options: Object, forceSet?: boolean):any; - option(prop?: Object, value?: Object, forceSet?: boolean): any; - _trigger(eventName?: string, eventProp?: Object): any; + setModel(options: any, forceSet?: boolean): any; + option(prop?: any, value?: any, forceSet?: boolean): any; + _trigger(eventName?: string, eventProp?: any): any; _on(element: JQuery, eventType?: string, handler?: (eventObject: JQueryEventObject) => any): any; _on(element: JQuery, eventType ?: string, selector ?: string, handler ?: (eventObject: JQueryEventObject) => any): any; _off(element: JQuery, eventName: string, handler ?: (eventObject: JQueryEventObject) => any): any; - _off(element: JQuery, eventType ?: string, selector ?: string, handler ?: (eventObject: JQueryEventObject) => any): any; + _off(element: JQuery, eventType ?: string, selector ?: string, handler ?: (eventObject: JQueryEventObject) => any): any; persistState(): void; restoreState(silent: boolean): void; } @@ -163,30 +158,30 @@ declare module ej { static fn: Widget; static extend(widget: Widget): any; register(pluginName: string, className: string, prototype: any): void; - destroyAll(elements: Element): void; - model: any; + destroyAll(elements: Element): void; + model: any; } interface BaseEvent { cancel: boolean; - type: string; + type: string; } class DataManager { - constructor(dataSource?: any, query?: ej.Query, adaptor?: any); + constructor(dataSource?: any, query?: ej.Query, adaptor?: any); setDefaultQuery(query: ej.Query): void; executeQuery(query?: ej.Query, done?: any, fail?: any, always?: any): JQueryPromise; executeLocal(query?: ej.Query): ej.DataManager; saveChanges(changes?: Changes, key?: string, tableName?: string): JQueryDeferred; - insert(data: Object, tableName?: string): JQueryPromise; - remove(keyField: string, value: any, tableName?: string): Object; - update(keyField: string, value: any, tableName?: string): Object; - } + insert(data: any, tableName?: string): JQueryPromise; + remove(keyField: string, value: any, tableName?: string): any; + update(keyField: string, value: any, tableName?: string): any; + } class Query { constructor(); static fn: Query; - static extend(prototype: Object): Query; + static extend(prototype: any): Query; key(field: string): ej.Query; using(dataManager: ej.DataManager): ej.Query; execute(dataManager: ej.DataManager, done: any, fail?: string, always?: string): any; @@ -196,8 +191,8 @@ declare module ej { addParams(key: string, value: string): ej.Query; expand(tables: any): ej.Query; where(fieldName: string, operator: ej.FilterOperators, value: any, ignoreCase?: boolean): ej.Query; - where(predicate:ej.Predicate):ej.Query; - search(searchKey: any, fieldNames?: any, operator?: string, ignoreCase?: boolean): ej.Query; + where(predicate: ej.Predicate): ej.Query; + search(searchKey: any, fieldNames?: any, operator?: string, ignoreCase?: boolean): ej.Query; sortBy(fieldName: string, comparer?: ej.SortOrder, isFromGroup?: boolean): ej.Query; sortByDesc(fieldName: string): ej.Query; group(fieldName: string): ej.Query; @@ -208,17 +203,17 @@ declare module ej { hierarchy(query: ej.Query, selectorFn: any): ej.Query; foreignKey(key: string): ej.Query; requiresCount(): ej.Query; - range(start:number, end:number): ej.Query; + range(start: number, end: number): ej.Query; } class Adaptor { constructor(ds: any); - pvt: Object; + pvt: any; type: ej.Adaptor; options: AdaptorOptions; extend(overrides: any): ej.Adaptor; - processQuery(dm: ej.DataManager, query: ej.Query):any; - processResponse(data: Object, ds: any, query: ej.Query, xhr: JQueryXHR, request?: Object, changes?: Changes): Object; + processQuery(dm: ej.DataManager, query: ej.Query): any; + processResponse(data: any, ds: any, query: ej.Query, xhr: JQueryXHR, request?: any, changes?: Changes): any; convertToQueryString(req: any, query: ej.Query, dm: ej.DataManager): JQueryParam; } @@ -238,18 +233,18 @@ declare module ej { class UrlAdaptor extends ej.Adaptor { constructor(); - processQuery(dm: ej.DataManager, query: ej.Query, hierarchyFilters?: Object): { - type: string; url: string; ejPvtData: Object; contentType?: string; data?: Object; + processQuery(dm: ej.DataManager, query: ej.Query, hierarchyFilters?: any): { + type: string; url: string; ejPvtData: any; contentType?: string; data?: any; } - convertToQueryString(req: Object, query: ej.Query, dm: ej.DataManager): JQueryParam; - processResponse(data: Object, ds: any, query: ej.Query, xhr: JQueryXHR, request?: Object, changes?: Changes): Object; + convertToQueryString(req: any, query: ej.Query, dm: ej.DataManager): JQueryParam; + processResponse(data: any, ds: any, query: ej.Query, xhr: JQueryXHR, request?: any, changes?: Changes): any; onGroup(e: any): void; batchRequest(dm: ej.DataManager, changes: Changes, e: any): void; - beforeSend(dm: ej.DataManager, request: any, settings?:any): void; - insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: any }; + beforeSend(dm: ej.DataManager, request: any, settings?: any): void; + insert(dm: ej.DataManager, data: any, tableName: string): { url: string; data: any }; remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data?: any }; update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data: any }; - getFiltersFrom(data: Object, query: ej.Query): ej.Predicate; + getFiltersFrom(data: any, query: ej.Query): ej.Predicate; } class ODataAdaptor extends ej.UrlAdaptor { @@ -258,26 +253,26 @@ declare module ej { onEachWhere(filter: any, requiresCast: boolean): any; onPredicate(pred: ej.Predicate, query: ej.Query, requiresCast: boolean): string; onComplexPredicate(pred: ej.Predicate, requiresCast: boolean): string; - onWhere(filters: Array): string; - onEachSearch(e: Object): void; - onSearch(e: Object): string; - onEachSort(e: Object): string; - onSortBy(e: Object): string; - onGroup(e: Object): string; - onSelect(e: Object): string; - onCount(e: Object): string; + onWhere(filters: string[]): string; + onEachSearch(e: any): void; + onSearch(e: any): string; + onEachSort(e: any): string; + onSortBy(e: any): string; + onGroup(e: any): string; + onSelect(e: any): string; + onCount(e: any): string; beforeSend(dm: ej.DataManager, request: any, settings?: any): void; - processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { - result: Object; count: number + processResponse(data: any, ds: any, query: ej.Query, xhr: any, request: any, changes: Changes): { + result: any; count: number }; - convertToQueryString(req: Object, query: ej.Query, dm: ej.DataManager): JQueryParam; - insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: Object; } + convertToQueryString(req: any, query: ej.Query, dm: ej.DataManager): JQueryParam; + insert(dm: ej.DataManager, data: any, tableName: string): { url: string; data: any; } remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; } - update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; data: Object; accept: string; } - batchRequest(dm: ej.DataManager, changes: Changes, e: any): { url: string; type: string; data: Object; contentType: string; } - generateDeleteRequest(arr: Array, e: any): string; - generateInsertRequest(arr: Array, e: any): string; - generateUpdateRequest(arr: Array, e: any): string; + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { url: string; type: string; data: any; accept: string; } + batchRequest(dm: ej.DataManager, changes: Changes, e: any): { url: string; type: string; data: any; contentType: string; } + generateDeleteRequest(arr: any[], e: any): string; + generateInsertRequest(arr: any[], e: any): string; + generateUpdateRequest(arr: any[], e: any): string; } interface UrlAdaptorOptions { requestType?: string; @@ -298,28 +293,25 @@ declare module ej { changeSetContent?: string; batchChangeSetContentType?: string; } - class WebApiAdaptor extends ej.ODataAdaptor { constructor(); - insert(dm: ej.DataManager, data: Object, tableName?: string): { url: string; type: string; data: Object; } - remove(dm: ej.DataManager, value: any, keyField?: string, tableName?: string): { url: string; type: string; data: Object; } - update(dm: ej.DataManager, value: any, keyField?: string, tableName?: string): { url: string; type: string; data: Object; accept: string; } - processResponse(data: Object, ds: Object, query: ej.Query, xhr: any, request: any, changes: Changes): { - result: Object; count: number + insert(dm: ej.DataManager, data: any, tableName?: string): { url: string; type: string; data: any; } + remove(dm: ej.DataManager, value: any, keyField?: string, tableName?: string): { url: string; type: string; data: any; } + update(dm: ej.DataManager, value: any, keyField?: string, tableName?: string): { url: string; type: string; data: any; accept: string; } + processResponse(data: any, ds: any, query: ej.Query, xhr: any, request: any, changes: Changes): { + result: any; count: number }; } - class ODataV4Adaptor extends ej.ODataAdaptor { constructor(); options: ODataAdaptorOptions; - onCount(e: Object): string; - onEachSearch(e: Object): void; - onSearch(e: Object): string; + onCount(e: any): string; + onEachSearch(e: any): void; + onSearch(e: any): string; beforeSend(dm: ej.DataManager, request: any, settings?: any): void; - processResponse(data: Object, ds: Object, query: ej.Query, xhr:any, request: any, changes: Changes): { - result: Object; count: number + processResponse(data: any, ds: any, query: ej.Query, xhr: any, request: any, changes: Changes): { + result: any; count: number }; - } interface ODataAdaptorOptions { requestType?: string; @@ -344,31 +336,31 @@ declare module ej { class JsonAdaptor extends ej.Adaptor { constructor(); - processQuery(ds: Object, query: ej.Query): string; - batchRequest(dm: ej.DataManager, changes: Changes, e:any): Changes; - onWhere(ds: Object, e: any): any; - onSearch(ds: Object, e: any): any - onSortBy(ds: Object, e: any, query: ej.Query): Object; - onGroup(ds: Object, e: any, query: ej.Query): Object; - onPage(ds: Object, e: any, query: ej.Query): Object; - onRange(ds: Object, e: any): Object; - onTake(ds: Object, e: any): Object; - onSkip(ds: Object, e: any): Object; - onSelect(ds: Object, e: any): Object; - insert(dm: ej.DataManager, data: any): Object; - remove(dm: ej.DataManager, keyField: string, value:any, tableName: string): Object; - update(dm: ej.DataManager, keyField: string, value:any, tableName: string): Object; + processQuery(ds: any, query: ej.Query): string; + batchRequest(dm: ej.DataManager, changes: Changes, e: any): Changes; + onWhere(ds: any, e: any): any; + onSearch(ds: any, e: any): any + onSortBy(ds: any, e: any, query: ej.Query): any; + onGroup(ds: any, e: any, query: ej.Query): any; + onPage(ds: any, e: any, query: ej.Query): any; + onRange(ds: any, e: any): any; + onTake(ds: any, e: any): any; + onSkip(ds: any, e: any): any; + onSelect(ds: any, e: any): any; + insert(dm: ej.DataManager, data: any): any; + remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): any; + update(dm: ej.DataManager, keyField: string, value: any, tableName: string): any; } class remoteSaveAdaptor extends ej.UrlAdaptor { constructor(); batchRequest(dm: ej.DataManager, changes: Changes, e: any): void; beforeSend(dm: ej.DataManager, request: any, settings?: any): void; - insert(dm: ej.DataManager, data: Object, tableName: string): { url: string; data: any }; + insert(dm: ej.DataManager, data: any, tableName: string): { url: string; data: any }; remove(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data?: any }; update(dm: ej.DataManager, keyField: string, value: any, tableName: string): { type: string; url: string; data: any }; } class TableModel { - constructor(name: string, jsonArray: Array, dataManager: ej.DataManager, modelComputed: any); + constructor(name: string, jsonArray: any[], dataManager: ej.DataManager, modelComputed: any); on(eventName: string, handler: any): void; off(eventName: string, handler: any): void; setDataManager(dataManager: DataManager): void; @@ -379,15 +371,15 @@ declare module ej { remove(key: string): void; isDirty(): boolean; getChanges(): Changes; - toArray(): Array; - setDirty(dirty:any, model:any): void; + toArray(): any[]; + setDirty(dirty: any, model: any): void; get(index: number): void; length(): number; bindTo(element: any): void; } class Model { constructor(json: any, table: string, name: string); - formElements: Array; + formElements: string[]; computes(value: any): void; on(eventName: string, handler: any): void; off(eventName: string, handler: any): void; @@ -403,17 +395,17 @@ declare module ej { unbind(element: any): void; } interface Changes { - changed?: Array; - added?: Array; - deleted?: Array; + changed?: any[]; + added?: any[]; + deleted?: any[]; } class Predicate { constructor(); constructor(field: string, operator: ej.FilterOperators, value: any, ignoreCase: boolean); - and(field: string, operator: any, value:any, ignoreCase:boolean): ej.Predicate; + and(field: string, operator: any, value: any, ignoreCase: boolean): ej.Predicate; or(field: string, operator: any, value: any, ignoreCase: boolean): ej.Predicate; - or(predicate: Array): any; - validate(record: Object): boolean; + or(predicate: any[]): any; + validate(record: any): boolean; toJSON(): { isComplex: boolean; field: string; @@ -424,17 +416,17 @@ declare module ej { predicates: any; }; } - interface dataUtil { - swap(array: Array, x: number, y: number): void; - mergeSort(jsonArray: Array, fieldName?: string, comparer?:any): Array; - max(jsonArray: Array, fieldName?: string, comparer?: string): Array; - min(jsonArray: Array, fieldName: string, comparer: string): Array; - distinct(jsonArray: Array, fieldName?: string, requiresCompleteRecord?:any): Array; - sum(json:any, fieldName: string): number; - avg(json:any, fieldName: string): number; - select(jsonArray: Array, fieldName: string, fields:string): Array; - group(jsonArray: Array, field: string, /* internal */ level: number): Array; - parseTable(table: string, headerOption: ej.headerOption, headerRowIndex: number): Object; + interface dataUtil { + swap(array: any[], x: number, y: number): void; + mergeSort(jsonArray: any[], fieldName?: string, comparer?: any): any[]; + max(jsonArray: any[], fieldName?: string, comparer?: string): any[]; + min(jsonArray: any[], fieldName: string, comparer: string): any[]; + distinct(jsonArray: any[], fieldName?: string, requiresCompleteRecord?: any): any[]; + sum(json: any, fieldName: string): number; + avg(json: any, fieldName: string): number; + select(jsonArray: any[], fieldName: string, fields: string): any[]; + group(jsonArray: any[], field: string, /* internal */ level: number): any[]; + parseTable(table: string, headerOption: ej.headerOption, headerRowIndex: number): any; } interface AjaxSettings { type?: string; @@ -494,8 +486,7 @@ declare module ej { row, tHead } - - enum filterType{ + enum filterType { StartsWith, Contains, EndsWith, @@ -506,33 +497,32 @@ declare module ej { Equal, NotEqual } - enum Animation{ + enum Animation { Fade, None, Slide - } - enum Type{ + } + enum Type { Overlay, Slide } - enum SortOrder{ + enum SortOrder { Ascending, Descending } class Draggable extends ej.Widget { static fn: Draggable; - constructor(element: JQuery, options?: Draggable.Model); - constructor(element: Element, options?: Draggable.Model); + constructor(element: JQuery | Element, options?: Draggable.Model); static Locale: any; - model:Draggable.Model; - defaults:Draggable.Model; + model: Draggable.Model; + defaults: Draggable.Model; /** destroy in the draggable. * @returns {void} */ _destroy(): void; } -export module Draggable{ +export namespace Draggable { export interface Model { @@ -567,19 +557,19 @@ export interface Model { scope?: string; /** This event is triggered when dragging element is destroyed. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** This event is triggered when the mouse is moved during the dragging. */ - drag? (e: DragEventArgs): void; + drag?(e: DragEventArgs): void; /** Supply a callback function to handle the drag start event as an init option. */ - dragStart? (e: DragStartEventArgs): void; + dragStart?(e: DragStartEventArgs): void; /** This event is triggered when the mouse is moved during the dragging. */ - dragStop? (e: DragStopEventArgs): void; + dragStop?(e: DragStopEventArgs): void; /** This event is triggered when dragged. */ - helper? (e: HelperEventArgs): void; + helper?(e: HelperEventArgs): void; } export interface DestroyEventArgs { @@ -680,18 +670,17 @@ export interface HelperEventArgs { class Droppable extends ej.Widget { static fn: Droppable; - constructor(element: JQuery, options?: Droppable.Model); - constructor(element: Element, options?: Droppable.Model); + constructor(element: JQuery | Element, options?: Droppable.Model); static Locale: any; - model:Droppable.Model; - defaults:Droppable.Model; + model: Droppable.Model; + defaults: Droppable.Model; /** destroy in the Droppable. * @returns {void} */ _destroy(): void; } -export module Droppable{ +export namespace Droppable { export interface Model { @@ -706,13 +695,13 @@ export interface Model { scope?: string; /** This event is triggered when the mouse up is moved during the dragging. */ - drop? (e: DropEventArgs): void; + drop?(e: DropEventArgs): void; /** This event is triggered when the mouse is moved out. */ - out? (e: OutEventArgs): void; + out?(e: OutEventArgs): void; /** This event is triggered when the mouse is moved over. */ - over? (e: OverEventArgs): void; + over?(e: OverEventArgs): void; } export interface DropEventArgs { @@ -775,18 +764,17 @@ export interface OverEventArgs { class Resizable extends ej.Widget { static fn: Resizable; - constructor(element: JQuery, options?: Resizable.Model); - constructor(element: Element, options?: Resizable.Model); + constructor(element: JQuery | Element, options?: Resizable.Model); static Locale: any; - model:Resizable.Model; - defaults:Resizable.Model; + model: Resizable.Model; + defaults: Resizable.Model; /** destroy in the Resizable. * @returns {void} */ _destroy(): void; } -export module Resizable{ +export namespace Resizable { export interface Model { @@ -831,10 +819,10 @@ export interface Model { scope?: string; /** This event is triggered when the widget destroys. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** This event is triggered when resized. */ - helper? (e: HelperEventArgs): void; + helper?(e: HelperEventArgs): void; } export interface DestroyEventArgs { @@ -869,8 +857,8 @@ export interface HelperEventArgs { } - var globalize:globalize; - var cultures:culture; + const globalize: globalize; + const cultures: culture; function addCulture(name: string, culture ?: any): void; function preferredCulture(culture ?: string): culture; function format(value: any, format: string, culture ?: string): string; @@ -879,10 +867,10 @@ export interface HelperEventArgs { function parseDate(value: string, format: string, culture ?: string): Date; function getLocalizedConstants(controlName: string, culture ?: string): any; -interface globalize { +interface globalize { addCulture(name: string, culture?: any): void; preferredCulture(culture?: string): culture; - format(value: any, format: string, culture?: string): string; + format(value: any, format: string, culture?: string): string; parseInt(value: string, radix?: any, culture?: string): number; parseFloat(value: string, radix?: any, culture?: string): number; parseDate(value: string, format: string, culture?: string): Date; @@ -898,22 +886,22 @@ interface globalize { calendars?: calendarsSettings; } interface formatSettings { - pattern: Array; + pattern: string[]; decimals: number; - groupSizes: Array; + groupSizes: number[]; percent: percentSettings; currency: currencySettings; } interface percentSettings { - pattern: Array; + pattern: string[]; decimals: number; - groupSizes: Array; + groupSizes: number[]; symbol: string; } interface currencySettings { - pattern: Array; + pattern: string[]; decimals: number; - groupSizes: Array; + groupSizes: number[]; symbol: string; } interface calendarsSettings { @@ -923,19 +911,19 @@ interface globalize { firstDay: number; days: daySettings; months: monthSettings; - AM: Array; - PM: Array; + AM: string[]; + PM: string[]; twoDigitYearMax: number; patterns: patternSettings; } interface daySettings { - names: Array; - namesAbbr: Array; - namesShort: Array; + names: string[]; + namesAbbr: string[]; + namesShort: string[]; } interface monthSettings { - names: Array; - namesAbbr: Array; + names: string[]; + namesAbbr: string[]; } interface patternSettings { d: string; @@ -947,14 +935,13 @@ interface globalize { M: string; Y: string; S: string; - } + } class Scroller extends ej.Widget { static fn: Scroller; - constructor(element: JQuery, options?: Scroller.Model); - constructor(element: Element, options?: Scroller.Model); + constructor(element: JQuery | Element, options?: Scroller.Model); static Locale: any; - model:Scroller.Model; - defaults:Scroller.Model; + model: Scroller.Model; + defaults: Scroller.Model; /** destroy the Scroller control, unbind the all ej control related events automatically and bring the control to pre-init state. * @returns {void} @@ -1002,7 +989,7 @@ class Scroller extends ej.Widget { */ scrollY(pixel: number|string, disableAnimation: boolean, animationSpeed: number): void; } -export module Scroller{ +export namespace Scroller { export interface Model { @@ -1077,28 +1064,28 @@ export interface Model { width?: number|string; /** Fires when Scroller control is created. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when Scroller control is destroyed. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires when a thumb point is moved along the touch surface. */ - thumbMove? (e: ThumbMoveEventArgs): void; + thumbMove?(e: ThumbMoveEventArgs): void; /** Fires when a thumb point is placed on the touch surface. */ - thumbStart? (e: ThumbStartEventArgs): void; + thumbStart?(e: ThumbStartEventArgs): void; /** Fires when a thumb point is removed from the touch surface. */ - thumbEnd? (e: ThumbEndEventArgs): void; + thumbEnd?(e: ThumbEndEventArgs): void; /** It fires whenever the mouse wheel is rotated either in upwards or downwards. */ - wheelMove? (e: WheelMoveEventArgs): void; + wheelMove?(e: WheelMoveEventArgs): void; /** It will fire when mouse trackball has been start to wheel. */ - wheelStart? (e: WheelStartEventArgs): void; + wheelStart?(e: WheelStartEventArgs): void; /** It will fire when mouse trackball has been stop to wheel. */ - wheelStop? (e: WheelStopEventArgs): void; + wheelStop?(e: WheelStopEventArgs): void; } export interface CreateEventArgs { @@ -1256,11 +1243,10 @@ export interface WheelStopEventArgs { class Accordion extends ej.Widget { static fn: Accordion; - constructor(element: JQuery, options?: Accordion.Model); - constructor(element: Element, options?: Accordion.Model); + constructor(element: JQuery | Element, options?: Accordion.Model); static Locale: any; - model:Accordion.Model; - defaults:Accordion.Model; + model: Accordion.Model; + defaults: Accordion.Model; /** AddItem method is used to add the panel in dynamically. It receives the following parameters * @param {string} specify the name of the header @@ -1295,7 +1281,7 @@ class Accordion extends ej.Widget { * @param {Array} index values to disable the panels * @returns {void} */ - disableItems(index: Array): void; + disableItems(index: any[]): void; /** Enable the accordion widget includes all the headers and content panels. * @returns {void} @@ -1306,7 +1292,7 @@ class Accordion extends ej.Widget { * @param {Array} index values to enable the panels * @returns {void} */ - enableItems(index: Array): void; + enableItems(index: any[]): void; /** To expand all the accordion widget items. * @returns {void} @@ -1344,7 +1330,7 @@ class Accordion extends ej.Widget { */ show(): void; } -export module Accordion{ +export namespace Accordion { export interface Model { @@ -1356,7 +1342,7 @@ export interface Model { /** Accordion headers can be expanded and collapsed on keyboard action. * @Default {true} */ - allowKeyboardNavigation?: Boolean; + allowKeyboardNavigation?: boolean; /** To set the Accordion headers Collapse Speed. * @Default {300} @@ -1370,7 +1356,7 @@ export interface Model { /** Sets the root CSS class for Accordion theme, which is used customize. */ - cssClass?: String; + cssClass?: string; /** Allows you to set the custom header Icon. It accepts two key values “headerâ€Â, â€ÂselectedHeaderâ€Â. * @Default {{ header: e-collapse, selectedHeader: e-expand }} @@ -1385,12 +1371,12 @@ export interface Model { /** Specifies the animation behavior in accordion. * @Default {true} */ - enableAnimation?: Boolean; + enableAnimation?: boolean; /** With this enabled property, you can enable or disable the Accordion. * @Default {true} */ - enabled?: Boolean; + enabled?: boolean; /** Used to enable the disabled items in accordion. * @Default {[]} @@ -1400,22 +1386,22 @@ export interface Model { /** Multiple content panels to activate at a time. * @Default {false} */ - enableMultipleOpen?: Boolean; + enableMultipleOpen?: boolean; /** Save current model value to browser cookies for maintaining states. When refreshing the accordion control page, the model value is applied from browser cookies or HTML 5local storage. * @Default {false} */ - enablePersistence?: Boolean; + enablePersistence?: boolean; /** Display headers and panel text from right-to-left. * @Default {false} */ - enableRTL?: Boolean; + enableRTL?: boolean; /** The events API binds the action for activating the accordion header. Users can activate the header by using mouse actions such as mouse-over, mouse-up, mouse-down, and soon. * @Default {click} */ - events?: String; + events?: string; /** To set the Accordion headers Expand Speed. * @Default {300} @@ -1454,7 +1440,7 @@ export interface Model { /** Used to determines the close button visibility an each accordion items. This close button helps to remove the accordion item from the control. * @Default {false} */ - showCloseButton?: Boolean; + showCloseButton?: boolean; /** Displays rounded corner borders on the Accordion control's panels and headers. * @Default {false} @@ -1467,34 +1453,34 @@ export interface Model { width?: number|string; /** Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value. */ - activate? (e: ActivateEventArgs): void; + activate?(e: ActivateEventArgs): void; /** Triggered before the AJAX content is loaded in a content panel. Arguments have location of the content (URL) and current model value. */ - ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + ajaxBeforeLoad?(e: AjaxBeforeLoadEventArgs): void; /** Triggered after AJAX load failed action. Arguments have URL, error message, and current model value. */ - ajaxError? (e: AjaxErrorEventArgs): void; + ajaxError?(e: AjaxErrorEventArgs): void; /** Triggered after the AJAX content loads. Arguments have current model values. */ - ajaxLoad? (e: AjaxLoadEventArgs): void; + ajaxLoad?(e: AjaxLoadEventArgs): void; /** Triggered after AJAX success action. Arguments have URL, content, and current model values. */ - ajaxSuccess? (e: AjaxSuccessEventArgs): void; + ajaxSuccess?(e: AjaxSuccessEventArgs): void; /** Triggered before a tab item is active. Arguments have active index and model values. */ - beforeActivate? (e: BeforeActivateEventArgs): void; + beforeActivate?(e: BeforeActivateEventArgs): void; /** Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value. */ - beforeInactivate? (e: BeforeInactivateEventArgs): void; + beforeInactivate?(e: BeforeInactivateEventArgs): void; /** Triggered after Accordion control creation. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Triggered after Accordion control destroy. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Triggered after a Accordion item is active or inactive. Argument values are activeIndex, activeHeader, inActiveHeader, inActiveIndex and current model value. */ - inActivate? (e: InActivateEventArgs): void; + inActivate?(e: InActivateEventArgs): void; } export interface ActivateEventArgs { @@ -1719,15 +1705,15 @@ export interface AjaxSettings { /** It specifies, whether to enable or disable asynchronous request. */ - async?: Boolean; + async?: boolean; /** It specifies the page will be cached in the web browser. */ - cache?: Boolean; + cache?: boolean; /** It specifies the type of data is send in the query string. */ - contentType?: String; + contentType?: string; /** It specifies the data as an object, will be passed in the query string. */ @@ -1735,25 +1721,25 @@ export interface AjaxSettings { /** It specifies the type of data that you're expecting back from the response. */ - dataType?: String; + dataType?: string; /** It specifies the HTTP request type. */ - type?: String; + type?: string; } export interface CustomIcon { /** This class name set to collapsing header. */ - header?: String; + header?: string; /** This class name set to expanded (active) header. */ - selectedHeader?: String; + selectedHeader?: string; } -enum HeightAdjustMode{ +enum HeightAdjustMode { ///Height fit to the content in the panel Content, @@ -1769,11 +1755,10 @@ enum HeightAdjustMode{ class Autocomplete extends ej.Widget { static fn: Autocomplete; - constructor(element: JQuery, options?: Autocomplete.Model); - constructor(element: Element, options?: Autocomplete.Model); + constructor(element: JQuery | Element, options?: Autocomplete.Model); static Locale: any; - model:Autocomplete.Model; - defaults:Autocomplete.Model; + model: Autocomplete.Model; + defaults: Autocomplete.Model; /** Clears the text in the Autocomplete textbox. * @returns {void} @@ -1832,7 +1817,7 @@ class Autocomplete extends ej.Widget { */ selectValueByText(Text: string): void; } -export module Autocomplete{ +export namespace Autocomplete { export interface Model { @@ -1874,7 +1859,7 @@ export interface Model { /** The data source contains the list of data for the suggestions list. It can be a string array or JSON array. * @Default {null} */ - dataSource?: any|Array; + dataSource?: any|any[]; /** The time delay (in milliseconds) after which the suggestion popup will be shown. * @Default {200} @@ -2049,52 +2034,56 @@ export interface Model { width?: string; /** Triggers when the AJAX requests Begins. */ - actionBegin? (e: ActionBeginEventArgs): void; + actionBegin?(e: ActionBeginEventArgs): void; /** Triggers when the data requested from AJAX will get successfully loaded in the Autocomplete widget. */ - actionSuccess? (e: ActionSuccessEventArgs): void; + actionSuccess?(e: ActionSuccessEventArgs): void; /** Triggers when the AJAX requests complete. The request may get failed or succeed. */ - actionComplete? (e: ActionCompleteEventArgs): void; + actionComplete?(e: ActionCompleteEventArgs): void; /** Triggers when the data requested from AJAX get failed. */ - actionFailure? (e: ActionFailureEventArgs): void; + actionFailure?(e: ActionFailureEventArgs): void; /** Triggers when the text box value is changed. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Triggers after the suggestion popup is closed. */ - close? (e: CloseEventArgs): void; + close?(e: CloseEventArgs): void; /** Triggers when Autocomplete widget is created. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Triggers after the Autocomplete widget is destroyed. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Triggers after the autocomplete textbox is focused. */ - focusIn? (e: FocusInEventArgs): void; + focusIn?(e: FocusInEventArgs): void; /** Triggers after the Autocomplete textbox gets out of the focus. */ - focusOut? (e: FocusOutEventArgs): void; + focusOut?(e: FocusOutEventArgs): void; /** Triggers after the suggestion list is opened. */ - open? (e: OpenEventArgs): void; + open?(e: OpenEventArgs): void; /** Triggers when an item has been selected from the suggestion list. */ - select? (e: SelectEventArgs): void; + select?(e: SelectEventArgs): void; } export interface ActionBeginEventArgs { + undefined; } export interface ActionSuccessEventArgs { + undefined; } export interface ActionCompleteEventArgs { + undefined; } export interface ActionFailureEventArgs { + undefined; } export interface ChangeEventArgs { @@ -2296,7 +2285,7 @@ export interface MultiColumnSettingsColumn { /** Gets or sets a value that indicates to align the text within the column. See textAlign * @Default {ej.TextAlign.Left} */ - textAlign?: ej.TextAlign|string; + textAlign?: ej.TextAlign|string; } export interface MultiColumnSettings { @@ -2317,10 +2306,10 @@ export interface MultiColumnSettings { /** Field and Header Text collections can be defined and customized through columns field. */ - columns?: Array; + columns?: MultiColumnSettingsColumn[]; } -enum Animation{ +enum Animation { ///Supports to animation type with none type only. None, @@ -2333,7 +2322,7 @@ enum Animation{ } -enum MultiSelectMode{ +enum MultiSelectMode { ///Multiple values are separated using a given special character. Delimiter, @@ -2343,7 +2332,7 @@ enum MultiSelectMode{ } -enum SortOrder{ +enum SortOrder { ///Items to be displayed in the suggestion list in ascending order. Ascending, @@ -2356,11 +2345,10 @@ enum SortOrder{ class Button extends ej.Widget { static fn: Button; - constructor(element: JQuery, options?: Button.Model); - constructor(element: Element, options?: Button.Model); + constructor(element: JQuery | Element, options?: Button.Model); static Locale: any; - model:Button.Model; - defaults:Button.Model; + model: Button.Model; + defaults: Button.Model; /** destroy the button widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. * @returns {void} @@ -2377,7 +2365,7 @@ class Button extends ej.Widget { */ enable(): void; } -export module Button{ +export namespace Button { export interface Model { @@ -2461,13 +2449,13 @@ export interface Model { width?: string|number; /** Fires when Button control is clicked successfully.Consider the scenario to perform any validation,modification of content or any other operations click on button,we can make use of this click event to achieve the scenario. */ - click? (e: ClickEventArgs): void; + click?(e: ClickEventArgs): void; /** Fires after Button control is created.If the user want to perform any operation after the button control creation then the user can make use of this create event. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when the button is destroyed successfully.If the user want to perform any operation after the destroy button control then the user can make use of this destroy event. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; } export interface ClickEventArgs { @@ -2488,7 +2476,7 @@ export interface ClickEventArgs { */ status?: boolean; - /** return the event model for sever side processing. + /** return the event model for sever side processing. */ e?: any; } @@ -2523,8 +2511,7 @@ export interface DestroyEventArgs { type?: string; } } -enum ContentType -{ +enum ContentType { //To display the text content only in button TextOnly, //To display the image only in button @@ -2536,8 +2523,7 @@ TextAndImage, //Supports to display image with both ends of the text ImageTextImage, } -enum ImagePosition -{ +enum ImagePosition { //support for aligning text in left and image in right ImageRight, //support for aligning text in right and image in left @@ -2547,24 +2533,22 @@ ImageTop, //support for aligning text in top and image in bottom ImageBottom, } -enum ButtonSize -{ +enum ButtonSize { //Creates button with Built-in default size height, width specified Normal, //Creates button with Built-in mini size height, width specified Mini, //Creates button with Built-in small size height, width specified Small, -//Creates button with Built-in medium size height, width specified +//Creates button with Built-in medium size height, width specified Medium, -//Creates button with Built-in large size height, width specified +//Creates button with Built-in large size height, width specified Large, } -enum ButtonType -{ +enum ButtonType { //Creates button with Built-in button type specified Button, -//Creates button with Built-in reset type specified +//Creates button with Built-in reset type specified Reset, //Creates button with Built-in submit type specified Submit, @@ -2572,13 +2556,12 @@ Submit, class Captcha extends ej.Widget { static fn: Captcha; - constructor(element: JQuery, options?: Captcha.Model); - constructor(element: Element, options?: Captcha.Model); + constructor(element: JQuery | Element, options?: Captcha.Model); static Locale: any; - model:Captcha.Model; - defaults:Captcha.Model; + model: Captcha.Model; + defaults: Captcha.Model; } -export module Captcha{ +export namespace Captcha { export interface Model { @@ -2651,16 +2634,16 @@ export interface Model { width?: number; /** Fires when captcha refresh begins. */ - refreshBegin? (e: RefreshBeginEventArgs): void; + refreshBegin?(e: RefreshBeginEventArgs): void; /** Fires after captcha refresh completed. */ - refreshComplete? (e: RefreshCompleteEventArgs): void; + refreshComplete?(e: RefreshCompleteEventArgs): void; /** Fires when captcha refresh fails to load. */ - refreshFailure? (e: RefreshFailureEventArgs): void; + refreshFailure?(e: RefreshFailureEventArgs): void; /** Fires after captcha refresh succeeded. */ - refreshSuccess? (e: RefreshSuccessEventArgs): void; + refreshSuccess?(e: RefreshSuccessEventArgs): void; } export interface RefreshBeginEventArgs { @@ -2723,8 +2706,7 @@ export interface RefreshSuccessEventArgs { type?: string; } } -enum HatchStyle -{ +enum HatchStyle { //Set background as None to Captcha None, //Set background as BackwardDiagonal to Captcha @@ -2803,11 +2785,10 @@ ZigZag, class ListBox extends ej.Widget { static fn: ListBox; - constructor(element: JQuery, options?: ListBox.Model); - constructor(element: Element, options?: ListBox.Model); + constructor(element: JQuery | Element, options?: ListBox.Model); static Locale: any; - model:ListBox.Model; - defaults:ListBox.Model; + model: ListBox.Model; + defaults: ListBox.Model; /** Adds a given list items in the ListBox widget at a specified index. It accepts two parameters. * @param {any|string} This can be a list item object (for JSON binding) or a string (for UL and LI rendering). Also we can the specify this as an array of list item object or an array of strings to add multiple items. @@ -2921,7 +2902,7 @@ class ListBox extends ej.Widget { * @param {Array} Data to merge in listbox. * @returns {void} */ - mergeData(data: Array): void; + mergeData(data: any[]): void; /** Selects the next item based on the current selection. * @returns {void} @@ -2950,7 +2931,7 @@ class ListBox extends ej.Widget { removeSelectedItems(): void; /** Removes a list item by using its text. - * @param {string} Text of the listbox item to be removed. + * @param {string} Text of the listbox item to be removed. * @returns {void} */ removeItemByText(text: string): void; @@ -2961,7 +2942,7 @@ class ListBox extends ej.Widget { */ removeItemByIndex(index: number): void; - /** + /** * @returns {void} */ selectAll(): void; @@ -3007,7 +2988,7 @@ class ListBox extends ej.Widget { */ uncheckItemsByIndices(indices: number[]|string): void; - /** + /** * @returns {void} */ unselectAll(): void; @@ -3057,13 +3038,13 @@ class ListBox extends ej.Widget { * @param {Array} Values of the listbox items to be shown. * @returns {void} */ - showItemsByValues(values: Array): void; + showItemsByValues(values: any[]): void; /** Hides the list item using its values. * @param {Array} Values of the listbox items to be hidden. * @returns {void} */ - hideItemsByValues(values: Array): void; + hideItemsByValues(values: any[]): void; /** Shows a hidden list item using its value. * @param {string} Value of the listbox item to be shown. @@ -3089,7 +3070,7 @@ class ListBox extends ej.Widget { */ hideItemByIndex(index: number): void; - /** + /** * @returns {void} */ show(): void; @@ -3109,7 +3090,7 @@ class ListBox extends ej.Widget { */ showAllItems(): void; } -export module ListBox{ +export namespace ListBox { export interface Model { @@ -3146,7 +3127,7 @@ export interface Model { /** Set of list items to be checked by default using its index. It works only when the showCheckbox property is set to true. * @Default {null} */ - checkedIndices?: Array; + checkedIndices?: any[]; /** The root class for the ListBox widget to customize the existing theme. * @Default {“â€Â} @@ -3230,7 +3211,7 @@ export interface Model { /** The list items to be selected by default using its indices. To use this property allowMultiSelection should be enabled. * @Default {[]} */ - selectedIndices?: Array; + selectedIndices?: any[]; /** Enables/Disables the multi selection option with the help of checkbox control. * @Default {false} @@ -3266,67 +3247,71 @@ export interface Model { targetID?: string; /** Triggers before the AJAX request begins to load data in the ListBox widget. */ - actionBegin? (e: ActionBeginEventArgs): void; + actionBegin?(e: ActionBeginEventArgs): void; /** Triggers after the data requested via AJAX is successfully loaded in the ListBox widget. */ - actionSuccess? (e: ActionSuccessEventArgs): void; + actionSuccess?(e: ActionSuccessEventArgs): void; /** Triggers when the AJAX requests complete. The request may get failed or succeed. */ - actionComplete? (e: ActionCompleteEventArgs): void; + actionComplete?(e: ActionCompleteEventArgs): void; /** Triggers when the data requested from AJAX get failed. */ - actionFailure? (e: ActionFailureEventArgs): void; + actionFailure?(e: ActionFailureEventArgs): void; /** Event will be triggered before the requested data via AJAX once loaded in successfully. */ - actionBeforeSuccess? (e: ActionBeforeSuccessEventArgs): void; + actionBeforeSuccess?(e: ActionBeforeSuccessEventArgs): void; /** Triggers when the item selection is changed. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Triggers when the list item is checked or unchecked. */ - checkChange? (e: CheckChangeEventArgs): void; + checkChange?(e: CheckChangeEventArgs): void; /** Triggers when the ListBox widget is created successfully. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Triggers when the ListBox widget is destroyed successfully. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Triggers when focus the listbox items. */ - focusIn? (e: FocusInEventArgs): void; + focusIn?(e: FocusInEventArgs): void; /** Triggers when focus out from listbox items. */ - focusOut? (e: FocusOutEventArgs): void; + focusOut?(e: FocusOutEventArgs): void; /** Triggers when the list item is being dragged. */ - itemDrag? (e: ItemDragEventArgs): void; + itemDrag?(e: ItemDragEventArgs): void; /** Triggers when the list item is ready to be dragged. */ - itemDragStart? (e: ItemDragStartEventArgs): void; + itemDragStart?(e: ItemDragStartEventArgs): void; /** Triggers when the list item stops dragging. */ - itemDragStop? (e: ItemDragStopEventArgs): void; + itemDragStop?(e: ItemDragStopEventArgs): void; /** Triggers when the list item is dropped. */ - itemDrop? (e: ItemDropEventArgs): void; + itemDrop?(e: ItemDropEventArgs): void; /** Triggers when a list item gets selected. */ - select? (e: SelectEventArgs): void; + select?(e: SelectEventArgs): void; /** Triggers when a list item gets unselected. */ - unselect? (e: UnselectEventArgs): void; + unselect?(e: UnselectEventArgs): void; } export interface ActionBeginEventArgs { + undefined; } export interface ActionSuccessEventArgs { + undefined; } export interface ActionCompleteEventArgs { + undefined; } export interface ActionFailureEventArgs { + undefined; } export interface ActionBeforeSuccessEventArgs { @@ -3353,7 +3338,7 @@ export interface ActionBeforeSuccessEventArgs { /** List of array object */ - result?: Array; + result?: any[]; /** ExecuteQuery object of DataManager */ @@ -3830,11 +3815,10 @@ export interface Fields { class Calculate { static fn: Calculate; - constructor(element: JQuery, options?: Calculate.Model); - constructor(element: Element, options?: Calculate.Model); + constructor(element: JQuery | Element, options?: Calculate.Model); static Locale: any; - model:Calculate.Model; - defaults:Calculate.Model; + model: Calculate.Model; + defaults: Calculate.Model; /** Add the custom formulas with function in CalcEngine library * @param {string} pass the formula name @@ -3885,19 +3869,19 @@ class Calculate { */ computeFormula(Formula: string): string; } -export module Calculate{ +export namespace Calculate { export interface Model { + undefined; } } class CheckBox extends ej.Widget { static fn: CheckBox; - constructor(element: JQuery, options?: CheckBox.Model); - constructor(element: Element, options?: CheckBox.Model); + constructor(element: JQuery | Element, options?: CheckBox.Model); static Locale: any; - model:CheckBox.Model; - defaults:CheckBox.Model; + model: CheckBox.Model; + defaults: CheckBox.Model; /** Destroy the CheckBox widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. * @returns {void} @@ -3919,7 +3903,7 @@ class CheckBox extends ej.Widget { */ isChecked(): boolean; } -export module CheckBox{ +export namespace CheckBox { export interface Model { @@ -4007,16 +3991,16 @@ export interface Model { value?: string; /** Fires before the CheckBox is going to changed its state successfully */ - beforeChange? (e: BeforeChangeEventArgs): void; + beforeChange?(e: BeforeChangeEventArgs): void; /** Fires when the CheckBox state is changed successfully */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Fires when the CheckBox state is created successfully */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when the CheckBox state is destroyed successfully */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; } export interface BeforeChangeEventArgs { @@ -4099,8 +4083,7 @@ export interface DestroyEventArgs { type?: string; } } -enum CheckState -{ +enum CheckState { //string Uncheck, //string @@ -4108,8 +4091,7 @@ Check, //string Indeterminate, } -enum CheckboxSize -{ +enum CheckboxSize { //Displays the CheckBox in medium size Medium, //Displays the CheckBox in small size @@ -4118,11 +4100,10 @@ Small, class ColorPicker extends ej.Widget { static fn: ColorPicker; - constructor(element: JQuery, options?: ColorPicker.Model); - constructor(element: Element, options?: ColorPicker.Model); + constructor(element: JQuery | Element, options?: ColorPicker.Model); static Locale: any; - model:ColorPicker.Model; - defaults:ColorPicker.Model; + model: ColorPicker.Model; + defaults: ColorPicker.Model; /** Disables the color picker control * @returns {void} @@ -4178,7 +4159,7 @@ class ColorPicker extends ej.Widget { */ show(): void; } -export module ColorPicker{ +export namespace ColorPicker { export interface Model { @@ -4204,7 +4185,7 @@ export interface Model { /** This property allows to define the custom colors in the palette model.Custom palettes are created by passing a comma delimited string of HEX values or an array of colors. * @Default {empty} */ - custom?: Array; + custom?: any[]; /** This property allows to embed the popup in the order of DOM element flow . When we set the value as true, the color picker popup is always in visible state. * @Default {false} @@ -4297,22 +4278,22 @@ export interface Model { value?: string; /** Fires after Color value has been changed successfully.If the user want to perform any operation after the color value changed then the user can make use of this change event. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Fires after closing the color picker popup. */ - close? (e: CloseEventArgs): void; + close?(e: CloseEventArgs): void; /** Fires after Color picker control is created. If the user want to perform any operation after the color picker control creation then the user can make use of this create event. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires after Color picker control is destroyed. If the user want to perform any operation after the color picker control destroyed then the user can make use of this destroy event. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires after opening the color picker popup */ - open? (e: OpenEventArgs): void; + open?(e: OpenEventArgs): void; /** Fires after Color value has been selected successfully. If the user want to perform any operation after the color value selected then the user can make use of this select event. */ - select? (e: SelectEventArgs): void; + select?(e: SelectEventArgs): void; } export interface ChangeEventArgs { @@ -4495,7 +4476,7 @@ export interface TooltipText { selectedcolor?: string; } -enum ModelType{ +enum ModelType { ///support palette type mode in color picker. Palette, @@ -4505,7 +4486,7 @@ enum ModelType{ } -enum Palette{ +enum Palette { ///used to show the basic palette BasicPalette, @@ -4515,7 +4496,7 @@ enum Palette{ } -enum Presets{ +enum Presets { ///used to show the basic presets Basic, @@ -4552,9 +4533,8 @@ enum Presets{ } } -enum ButtonMode -{ -//Displays the button in split mode +enum ButtonMode { +//Displays the button in split mode Split, //Displays the button in Dropdown mode Dropdown, @@ -4562,11 +4542,10 @@ Dropdown, class FileExplorer extends ej.Widget { static fn: FileExplorer; - constructor(element: JQuery, options?: FileExplorer.Model); - constructor(element: Element, options?: FileExplorer.Model); + constructor(element: JQuery | Element, options?: FileExplorer.Model); static Locale: any; - model:FileExplorer.Model; - defaults:FileExplorer.Model; + model: FileExplorer.Model; + defaults: FileExplorer.Model; /** Refresh the size of FileExplorer control. * @returns {void} @@ -4574,25 +4553,25 @@ class FileExplorer extends ej.Widget { adjustSize(): void; /** Disable the particular context menu item. - * @param {string|HTMLElement} Id of the menu item/ Menu element to be disabled + * @param {string|HTMLElement} Id of the menu item/ Menu element to be disabled * @returns {void} */ disableMenuItem(item: string|HTMLElement): void; /** Disable the particular toolbar item. - * @param {string|HTMLElement} Id of the toolbar item/ Tool item element to be disabled + * @param {string|HTMLElement} Id of the toolbar item/ Tool item element to be disabled * @returns {void} */ disableToolbarItem(item: string|HTMLElement): void; /** Enable the particular context menu item. - * @param {string|HTMLElement} Id of the menu item/ Menu element to be Enabled + * @param {string|HTMLElement} Id of the menu item/ Menu element to be Enabled * @returns {void} */ enableMenuItem(item: string|HTMLElement): void; /** Enable the particular toolbar item - * @param {string|HTMLElement} Id of the tool item/ Tool item element to be Enabled + * @param {string|HTMLElement} Id of the tool item/ Tool item element to be Enabled * @returns {void} */ enableToolbarItem(item: string|HTMLElement): void; @@ -4603,12 +4582,12 @@ class FileExplorer extends ej.Widget { refresh(): void; /** Remove the particular toolbar item. - * @param {string|HTMLElement} Id of the tool item/ tool item element to be removed + * @param {string|HTMLElement} Id of the tool item/ tool item element to be removed * @returns {void} */ removeToolbarItem(item: string|HTMLElement): void; } -export module FileExplorer{ +export namespace FileExplorer { export interface Model { @@ -4732,7 +4711,7 @@ export interface Model { /** The selectedItems is used to select the specified items (file, folder) of FileExplorer control. */ - selectedItems?: string|Array; + selectedItems?: string|any[]; /** Enables or disables the checkbox option in FileExplorer control. * @Default {true} @@ -4777,7 +4756,7 @@ export interface Model { /** The toolsList property is used to arrange the toolbar items in the FileExplorer control. * @Default {[layout, creation, navigation, addressBar, editing, copyPaste, sortBy, getProperties, searchBar]} */ - toolsList?: Array; + toolsList?: any[]; /** Gets or sets an object that indicates whether to customize the upload behavior in the FileExplorer. */ @@ -4789,91 +4768,91 @@ export interface Model { width?: string|number; /** Fires before the AJAX request is performed. */ - beforeAjaxRequest? (e: BeforeAjaxRequestEventArgs): void; + beforeAjaxRequest?(e: BeforeAjaxRequestEventArgs): void; /** Fires before downloading the files. */ - beforeDownload? (e: BeforeDownloadEventArgs): void; + beforeDownload?(e: BeforeDownloadEventArgs): void; /** Fires before getting a requested image from server. Also this event will be triggered when you have enabled thumbnail image compression option in FileExplorer.Using this event, you can customize the image compression size. */ - beforeGetImage? (e: BeforeGetImageEventArgs): void; + beforeGetImage?(e: BeforeGetImageEventArgs): void; /** Fires before files or folders open. */ - beforeOpen? (e: BeforeOpenEventArgs): void; + beforeOpen?(e: BeforeOpenEventArgs): void; /** Fires before uploading the files. */ - beforeUpload? (e: BeforeUploadEventArgs): void; + beforeUpload?(e: BeforeUploadEventArgs): void; /** Fires when FileExplorer control was created */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when file or folder is copied successfully. */ - copy? (e: CopyEventArgs): void; + copy?(e: CopyEventArgs): void; /** Fires when new folder is created successfully in file system. */ - createFolder? (e: CreateFolderEventArgs): void; + createFolder?(e: CreateFolderEventArgs): void; /** Fires when file or folder is cut successfully. */ - cut? (e: CutEventArgs): void; + cut?(e: CutEventArgs): void; /** Fires when the FileExplorer is destroyed successfully. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires when the files or directory has been started to drag over on the FileExplorer */ - dragStart? (e: DragStartEventArgs): void; + dragStart?(e: DragStartEventArgs): void; /** Fires when the files or directory is dragging over on the FileExplorer. */ - drag? (e: DragEventArgs): void; + drag?(e: DragEventArgs): void; /** Fires when the files or directory has been stopped to drag over on FileExplorer */ - dragStop? (e: DragStopEventArgs): void; + dragStop?(e: DragStopEventArgs): void; /** Fires when the files or directory is dropped to the target folder of FileExplorer */ - drop? (e: DropEventArgs): void; + drop?(e: DropEventArgs): void; /** Fires after loading the requested image from server. Using this event, you can get the details of loaded image. */ - getImage? (e: GetImageEventArgs): void; + getImage?(e: GetImageEventArgs): void; /** Fires when keydown in FileExplorer control. */ - keydown? (e: KeydownEventArgs): void; + keydown?(e: KeydownEventArgs): void; /** Fires when the file view type is changed. */ - layoutChange? (e: LayoutChangeEventArgs): void; + layoutChange?(e: LayoutChangeEventArgs): void; /** Fires when before the ContextMenu opening. */ - menuBeforeOpen? (e: MenuBeforeOpenEventArgs): void; + menuBeforeOpen?(e: MenuBeforeOpenEventArgs): void; /** Fires when click the ContextMenu item. */ - menuClick? (e: MenuClickEventArgs): void; + menuClick?(e: MenuClickEventArgs): void; /** Fires when ContextMenu is successfully opened. */ - menuOpen? (e: MenuOpenEventArgs): void; + menuOpen?(e: MenuOpenEventArgs): void; /** Fires when files are successfully opened. */ - open? (e: OpenEventArgs): void; + open?(e: OpenEventArgs): void; /** Fires when a file or folder is pasted successfully. */ - paste? (e: PasteEventArgs): void; + paste?(e: PasteEventArgs): void; /** Fires when file or folder is deleted successfully. */ - remove? (e: RemoveEventArgs): void; + remove?(e: RemoveEventArgs): void; /** Fires when resizing is performed for FileExplorer. */ - resize? (e: ResizeEventArgs): void; + resize?(e: ResizeEventArgs): void; /** Fires when resizing is started for FileExplorer. */ - resizeStart? (e: ResizeStartEventArgs): void; + resizeStart?(e: ResizeStartEventArgs): void; /** Fires this event when the resizing is stopped for FileExplorer. */ - resizeStop? (e: ResizeStopEventArgs): void; + resizeStop?(e: ResizeStopEventArgs): void; /** Fires when the items from grid view or tile view of FileExplorer control is selected. */ - select? (e: SelectEventArgs): void; + select?(e: SelectEventArgs): void; /** Triggered when refresh the template column elements in the grid view of FileExplorer control. */ - templateRefresh? (e: TemplateRefreshEventArgs): void; + templateRefresh?(e: TemplateRefreshEventArgs): void; /** Fires when the items from grid view or tile view or large icons view of FileExplorer control is unselected. */ - unselect? (e: UnselectEventArgs): void; + unselect?(e: UnselectEventArgs): void; } export interface BeforeAjaxRequestEventArgs { @@ -5335,7 +5314,7 @@ export interface MenuBeforeOpenEventArgs { /** returns the dataSource of ContextMenu. */ - dataSource?: Array; + dataSource?: any[]; /** returns the element of ContextMenu. */ @@ -5669,7 +5648,7 @@ export interface ContextMenuSettings { /** The customMenuFields property is used to define custom functionality for custom ContextMenu item's which are defined in items property. * @Default {[]} */ - customMenuFields?: Array; + customMenuFields?: any[]; } export interface FilterSettings { @@ -5705,7 +5684,7 @@ export interface GridSettings { /** Gets or sets an object that indicates to render the grid with specified columns. You can use this property same as the column property in Grid control. * @Default {[{ field: name, headerText: Name, width: 30% }, { field: dateModified, headerText: Date Modified, width: 30% }, { field: type, headerText: Type, width: 15% }, { field: size, headerText: Size, width: 12%, textAlign: right, headerTextAlign: left }]} */ - columns?: Array; + columns?: any[]; } export interface UploadSettings { @@ -5726,12 +5705,12 @@ export interface UploadSettings { autoUpload?: boolean; } -enum layoutType{ +enum layoutType { ///Supports to display files in tile view Tile, - ///Supports to display files in grid view + ///Supports to display files in grid view Grid, ///Supports to display files as large icons @@ -5742,11 +5721,10 @@ enum layoutType{ class DatePicker extends ej.Widget { static fn: DatePicker; - constructor(element: JQuery, options?: DatePicker.Model); - constructor(element: Element, options?: DatePicker.Model); + constructor(element: JQuery | Element, options?: DatePicker.Model); static Locale: any; - model:DatePicker.Model; - defaults:DatePicker.Model; + model: DatePicker.Model; + defaults: DatePicker.Model; /** Disables the DatePicker control. * @returns {void} @@ -5773,7 +5751,7 @@ class DatePicker extends ej.Widget { */ show(): void; } -export module DatePicker{ +export namespace DatePicker { export interface Model { @@ -5976,40 +5954,40 @@ export interface Model { width?: string; /** Fires before closing the DatePicker popup. */ - beforeClose? (e: BeforeCloseEventArgs): void; + beforeClose?(e: BeforeCloseEventArgs): void; /** Fires when each date is created in the DatePicker popup calendar. */ - beforeDateCreate? (e: BeforeDateCreateEventArgs): void; + beforeDateCreate?(e: BeforeDateCreateEventArgs): void; /** Fires before opening the DatePicker popup. */ - beforeOpen? (e: BeforeOpenEventArgs): void; + beforeOpen?(e: BeforeOpenEventArgs): void; /** Fires when the DatePicker input value is changed. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Fires when DatePicker popup is closed. */ - close? (e: CloseEventArgs): void; + close?(e: CloseEventArgs): void; /** Fires when the DatePicker is created successfully. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when the DatePicker is destroyed successfully. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires when DatePicker input gets focus. */ - focusIn? (e: FocusInEventArgs): void; + focusIn?(e: FocusInEventArgs): void; /** Fires when DatePicker input loses the focus. */ - focusOut? (e: FocusOutEventArgs): void; + focusOut?(e: FocusOutEventArgs): void; /** Fires when calender view navigates to month/year/decade/century. */ - navigate? (e: NavigateEventArgs): void; + navigate?(e: NavigateEventArgs): void; /** Fires when DatePicker popup is opened. */ - open? (e: OpenEventArgs): void; + open?(e: OpenEventArgs): void; /** Fires when a date is selected from the DatePicker popup. */ - select? (e: SelectEventArgs): void; + select?(e: SelectEventArgs): void; } export interface BeforeCloseEventArgs { @@ -6315,7 +6293,7 @@ export interface Fields { cssClass?: string; } -enum Header{ +enum Header { ///Removes day header in DatePicker None, @@ -6328,7 +6306,7 @@ enum Header{ } -enum Level{ +enum Level { ///allow navigation upto year level in DatePicker Year, @@ -6341,12 +6319,12 @@ enum Level{ } -enum HighlightSection{ +enum HighlightSection { - ///Highlight the week of the currently selected date in DatePicker popup calendar + ///Highlight the week of the currently selected date in DatePicker popup calendar Week, - ///Highlight the workdays in a currently selected date's week in DatePicker popup calendar + ///Highlight the workdays in a currently selected date's week in DatePicker popup calendar WorkDays, ///Nothing will be highlighted, remove highlights from DatePicker popup calendar if already exists @@ -6357,11 +6335,10 @@ enum HighlightSection{ class DateTimePicker extends ej.Widget { static fn: DateTimePicker; - constructor(element: JQuery, options?: DateTimePicker.Model); - constructor(element: Element, options?: DateTimePicker.Model); + constructor(element: JQuery | Element, options?: DateTimePicker.Model); static Locale: any; - model:DateTimePicker.Model; - defaults:DateTimePicker.Model; + model: DateTimePicker.Model; + defaults: DateTimePicker.Model; /** Disables the DateTimePicker control. * @returns {void} @@ -6393,7 +6370,7 @@ class DateTimePicker extends ej.Widget { */ show(): void; } -export module DateTimePicker{ +export namespace DateTimePicker { export interface Model { @@ -6560,31 +6537,31 @@ export interface Model { width?: string|number; /** Fires before the datetime popup closed in the DateTimePicker. */ - beforeClose? (e: BeforeCloseEventArgs): void; + beforeClose?(e: BeforeCloseEventArgs): void; /** Fires before the datetime popup open in the DateTimePicker. */ - beforeOpen? (e: BeforeOpenEventArgs): void; + beforeOpen?(e: BeforeOpenEventArgs): void; /** Fires when the datetime value changed in the DateTimePicker textbox. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Fires when DateTimePicker popup closes. */ - close? (e: CloseEventArgs): void; + close?(e: CloseEventArgs): void; /** Fires after DateTimePicker control is created. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when the DateTimePicker is destroyed successfully */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires when the focus-in happens in the DateTimePicker textbox. */ - focusIn? (e: FocusInEventArgs): void; + focusIn?(e: FocusInEventArgs): void; /** Fires when the focus-out happens in the DateTimePicker textbox. */ - focusOut? (e: FocusOutEventArgs): void; + focusOut?(e: FocusOutEventArgs): void; /** Fires when DateTimePicker popup opens. */ - open? (e: OpenEventArgs): void; + open?(e: OpenEventArgs): void; } export interface BeforeCloseEventArgs { @@ -6816,28 +6793,26 @@ export interface TimeDrillDown { autoClose?: boolean; } } -enum popupPosition -{ +enum popupPosition { //Opens the DateTimePicker popup below to the DateTimePicker input box Bottom, -//Opens the DateTimePicker popup above to the DateTimePicker input box +//Opens the DateTimePicker popup above to the DateTimePicker input box Top, } class DateRangePicker extends ej.Widget { static fn: DateRangePicker; - constructor(element: JQuery, options?: DateRangePicker.Model); - constructor(element: Element, options?: DateRangePicker.Model); + constructor(element: JQuery | Element, options?: DateRangePicker.Model); static Locale: any; - model:DateRangePicker.Model; - defaults:DateRangePicker.Model; + model: DateRangePicker.Model; + defaults: DateRangePicker.Model; /** Add the preset ranges to DateRangePicker popup. * @param {string} Display name * @param {Array} StartDate and endDate of range. * @returns {void} */ - addRanges(label: string, range: Array): void; + addRanges(label: string, range: any[]): void; /** Clears the all ranges selections in DateRangePicker popup * @returns {void} @@ -6874,7 +6849,7 @@ class DateRangePicker extends ej.Widget { */ setRange(): void; } -export module DateRangePicker{ +export namespace DateRangePicker { export interface Model { @@ -6968,28 +6943,28 @@ export interface Model { width?: string|number; /** Fires before closing the DateRangePicker popup. */ - beforeClose? (e: BeforeCloseEventArgs): void; + beforeClose?(e: BeforeCloseEventArgs): void; /** Fires before opening the DateRangePicker popup. */ - beforeOpen? (e: BeforeOpenEventArgs): void; + beforeOpen?(e: BeforeOpenEventArgs): void; /** Fires when the DateRangePicker values get changed. */ - onChange? (e: OnChangeEventArgs): void; + onChange?(e: OnChangeEventArgs): void; /** Fires when DateRangePicker popup is closed. */ - close? (e: CloseEventArgs): void; + close?(e: CloseEventArgs): void; /** Fires when the DateRangePicker is created successfully. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when the DateRangePicker is destroyed successfully. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires when DateRangePicker popup is opened. */ - open? (e: OpenEventArgs): void; + open?(e: OpenEventArgs): void; /** Fires when a date ranges is selected from the DateRangePicker popup. */ - select? (e: SelectEventArgs): void; + select?(e: SelectEventArgs): void; } export interface BeforeCloseEventArgs { @@ -7167,11 +7142,10 @@ export interface SelectEventArgs { class Dialog extends ej.Widget { static fn: Dialog; - constructor(element: JQuery, options?: Dialog.Model); - constructor(element: Element, options?: Dialog.Model); + constructor(element: JQuery | Element, options?: Dialog.Model); static Locale: any; - model:Dialog.Model; - defaults:Dialog.Model; + model: Dialog.Model; + defaults: Dialog.Model; /** Closes the dialog widget dynamically. * @returns {any} @@ -7250,7 +7224,7 @@ class Dialog extends ej.Widget { */ focus(): any; } -export module Dialog{ +export namespace Dialog { export interface Model { @@ -7319,7 +7293,7 @@ export interface Model { */ enableRTL?: boolean; - /** The CSS class name to display the favicon in the dialog header. In order to display favicon, you need to set showHeader as true since the favicon will be displayed in the dialog header. + /** The CSS class name to display the favicon in the dialog header. In order to display favicon, you need to set showHeader as true since the favicon will be displayed in the dialog header. */ faviconCSS?: string; @@ -7401,58 +7375,58 @@ export interface Model { footerTemplateId?: string; /** This event is triggered before the dialog widgets gets open. */ - beforeOpen? (e: BeforeOpenEventArgs): void; + beforeOpen?(e: BeforeOpenEventArgs): void; /** This event is triggered whenever the AJAX request fails to retrieve the dialog content. */ - ajaxError? (e: AjaxErrorEventArgs): void; + ajaxError?(e: AjaxErrorEventArgs): void; /** This event is triggered whenever the AJAX request to retrieve the dialog content, gets succeed. */ - ajaxSuccess? (e: AjaxSuccessEventArgs): void; + ajaxSuccess?(e: AjaxSuccessEventArgs): void; /** This event is triggered before the dialog widgets get closed. */ - beforeClose? (e: BeforeCloseEventArgs): void; + beforeClose?(e: BeforeCloseEventArgs): void; /** This event is triggered after the dialog widget is closed. */ - close? (e: CloseEventArgs): void; + close?(e: CloseEventArgs): void; /** Triggered after the dialog content is loaded in DOM. */ - contentLoad? (e: ContentLoadEventArgs): void; + contentLoad?(e: ContentLoadEventArgs): void; /** Triggered after the dialog is created successfully */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Triggered after the dialog widget is destroyed successfully */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Triggered while the dialog is dragged. */ - drag? (e: DragEventArgs): void; + drag?(e: DragEventArgs): void; /** Triggered when the user starts dragging the dialog. */ - dragStart? (e: DragStartEventArgs): void; + dragStart?(e: DragStartEventArgs): void; /** Triggered when the user stops dragging the dialog. */ - dragStop? (e: DragStopEventArgs): void; + dragStop?(e: DragStopEventArgs): void; /** Triggered after the dialog is opened. */ - open? (e: OpenEventArgs): void; + open?(e: OpenEventArgs): void; /** Triggered while the dialog is resized. */ - resize? (e: ResizeEventArgs): void; + resize?(e: ResizeEventArgs): void; /** Triggered when the user starts resizing the dialog. */ - resizeStart? (e: ResizeStartEventArgs): void; + resizeStart?(e: ResizeStartEventArgs): void; /** Triggered when the user stops resizing the dialog. */ - resizeStop? (e: ResizeStopEventArgs): void; + resizeStop?(e: ResizeStopEventArgs): void; /** Triggered when the dialog content is expanded. */ - expand? (e: ExpandEventArgs): void; + expand?(e: ExpandEventArgs): void; /** Triggered when the dialog content is collapsed. */ - collapse? (e: CollapseEventArgs): void; + collapse?(e: CollapseEventArgs): void; /** Triggered when the custom action button clicked. */ - actionButtonClick? (e: ActionButtonClickEventArgs): void; + actionButtonClick?(e: ActionButtonClickEventArgs): void; } export interface BeforeOpenEventArgs { @@ -7827,11 +7801,10 @@ export interface AjaxSettings { class DocumentEditor extends ej.Widget { static fn: DocumentEditor; - constructor(element: JQuery, options?: DocumentEditor.Model); - constructor(element: Element, options?: DocumentEditor.Model); + constructor(element: JQuery | Element, options?: DocumentEditor.Model); static Locale: any; - model:DocumentEditor.Model; - defaults:DocumentEditor.Model; + model: DocumentEditor.Model; + defaults: DocumentEditor.Model; /** Loads the document from specified path using web API provided by importUrl. * @param {string} Specifies the file path. @@ -7876,7 +7849,7 @@ class DocumentEditor extends ej.Widget { */ find(text: string): void; } -export module DocumentEditor{ +export namespace DocumentEditor { export interface Model { @@ -7885,16 +7858,16 @@ export interface Model { importExportSettings?: ImportExportSettings; /** Triggers when the document changes. */ - onDocumentChange? (e: OnDocumentChangeEventArgs): void; + onDocumentChange?(e: OnDocumentChangeEventArgs): void; /** Triggers when the selection changes. */ - onSelectionChange? (e: OnSelectionChangeEventArgs): void; + onSelectionChange?(e: OnSelectionChangeEventArgs): void; /** Triggers when the zoom factor changes. */ - onZoomFactorChange? (e: OnZoomFactorChangeEventArgs): void; + onZoomFactorChange?(e: OnZoomFactorChangeEventArgs): void; /** Triggers when the hyperlink is clicked. */ - onRequestNavigate? (e: OnRequestNavigateEventArgs): void; + onRequestNavigate?(e: OnRequestNavigateEventArgs): void; } export interface OnDocumentChangeEventArgs { @@ -7971,17 +7944,16 @@ export interface ImportExportSettings { class DropDownList extends ej.Widget { static fn: DropDownList; - constructor(element: JQuery, options?: DropDownList.Model); - constructor(element: Element, options?: DropDownList.Model); + constructor(element: JQuery | Element, options?: DropDownList.Model); static Locale: any; - model:DropDownList.Model; - defaults:DropDownList.Model; + model: DropDownList.Model; + defaults: DropDownList.Model; /** Adding a single item or an array of items into the DropDownList allows you to specify all the field attributes such as value, template, image URL, and HTML attributes for those items. * @param {any|Array} this parameter should have field attributes with respect to mapped field attributes and it's corresponding values to fields * @returns {void} */ - addItem(data: any|Array): void; + addItem(data: any|any[]): void; /** This method is used to select all the items in the DropDownList. * @returns {void} @@ -8007,7 +7979,7 @@ class DropDownList extends ej.Widget { * @param {string|number|Array} disable the given index list items * @returns {void} */ - disableItemsByIndices(index: string|number|Array): void; + disableItemsByIndices(index: string|number|any[]): void; /** This property enables the DropDownList control. * @returns {void} @@ -8018,13 +7990,13 @@ class DropDownList extends ej.Widget { * @param {string|number|Array} enable the given index list items if it's disabled * @returns {void} */ - enableItemsByIndices(index: string|number|Array): void; + enableItemsByIndices(index: string|number|any[]): void; /** This method retrieves the items using given value. * @param {string|number|any} Return the whole object of data based on given value * @returns {Array} */ - getItemDataByValue(value: string|number|any): Array; + getItemDataByValue(value: string|number|any): any[]; /** This method is used to retrieve the items that are bound with the DropDownList. * @returns {any} @@ -8034,7 +8006,7 @@ class DropDownList extends ej.Widget { /** This method is used to get the selected items in the DropDownList. * @returns {Array} */ - getSelectedItem(): Array; + getSelectedItem(): any[]; /** This method is used to retrieve the items value that are selected in the DropDownList. * @returns {string} @@ -8050,19 +8022,19 @@ class DropDownList extends ej.Widget { * @param {string|number|Array} select the given index list items * @returns {void} */ - selectItemsByIndices(index: string|number|Array): void; + selectItemsByIndices(index: string|number|any[]): void; /** This method is used to select an item in the DropDownList by using the given text value. * @param {string|number|Array} select the list items relates to given text * @returns {void} */ - selectItemByText(index: string|number|Array): void; + selectItemByText(index: string|number|any[]): void; /** This method is used to select an item in the DropDownList by using the given value. * @param {string|number|Array} select the list items relates to given values * @returns {void} */ - selectItemByValue(index: string|number|Array): void; + selectItemByValue(index: string|number|any[]): void; /** This method shows the DropDownList control with the suggestion popup. * @returns {void} @@ -8078,21 +8050,21 @@ class DropDownList extends ej.Widget { * @param {string|number|Array} unselect the given index list items * @returns {void} */ - unselectItemsByIndices(index: string|number|Array): void; + unselectItemsByIndices(index: string|number|any[]): void; /** This method is used to unselect an item in the DropDownList by using the given text value. * @param {string|number|Array} unselect the list items relates to given text * @returns {void} */ - unselectItemByText(index: string|number|Array): void; + unselectItemByText(index: string|number|any[]): void; /** This method is used to unselect an item in the DropDownList by using the given value. * @param {string|number|Array} unselect the list items relates to given values * @returns {void} */ - unselectItemByValue(index: string|number|Array): void; + unselectItemByValue(index: string|number|any[]): void; } -export module DropDownList{ +export namespace DropDownList { export interface Model { @@ -8253,7 +8225,7 @@ export interface Model { /** Specifies the selectedItems for the DropDownList. * @Default {[]} */ - selectedIndices?: Array; + selectedIndices?: any[]; /** Selects multiple items in the DropDownList with the help of the checkbox control. To achieve this, enable the showCheckbox option to true. * @Default {false} @@ -8321,67 +8293,67 @@ export interface Model { virtualScrollMode?: ej.VirtualScrollMode|string; /** Fires the action before the XHR request. */ - actionBegin? (e: ActionBeginEventArgs): void; + actionBegin?(e: ActionBeginEventArgs): void; /** Fires the action when the list of items is bound to the DropDownList by xhr post calling */ - actionComplete? (e: ActionCompleteEventArgs): void; + actionComplete?(e: ActionCompleteEventArgs): void; /** Fires the action when the xhr post calling failed on remote data binding with the DropDownList control. */ - actionFailure? (e: ActionFailureEventArgs): void; + actionFailure?(e: ActionFailureEventArgs): void; /** Fires the action when the xhr post calling succeed on remote data binding with the DropDownList control */ - actionSuccess? (e: ActionSuccessEventArgs): void; + actionSuccess?(e: ActionSuccessEventArgs): void; /** Fires the action before the popup is ready to hide. */ - beforePopupHide? (e: BeforePopupHideEventArgs): void; + beforePopupHide?(e: BeforePopupHideEventArgs): void; /** Fires the action before the popup is ready to be displayed. */ - beforePopupShown? (e: BeforePopupShownEventArgs): void; + beforePopupShown(e: BeforePopupShownEventArgs): void; /** Fires when the cascading happens between two DropDownList exactly after the value changes in the first dropdown and before filtering in the second Dropdown. */ - cascade? (e: CascadeEventArgs): void; + cascade?(e: CascadeEventArgs): void; /** Fires the action when the DropDownList control’s value is changed. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Fires the action when the list item checkbox value is changed. */ - checkChange? (e: CheckChangeEventArgs): void; + checkChange?(e: CheckChangeEventArgs): void; /** Fires the action once the DropDownList is created. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires the action when the list items is bound to the DropDownList. */ - dataBound? (e: DataBoundEventArgs): void; + dataBound?(e: DataBoundEventArgs): void; /** Fires the action when the DropDownList is destroyed. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires the action when the DropDownList is focused. */ - focusIn? (e: FocusInEventArgs): void; + focusIn?(e: FocusInEventArgs): void; /** Fires the action when the DropDownList is about to lose focus. */ - focusOut? (e: FocusOutEventArgs): void; + focusOut?(e: FocusOutEventArgs): void; /** Fires the action, once the popup is closed */ - popupHide? (e: PopupHideEventArgs): void; + popupHide?(e: PopupHideEventArgs): void; /** Fires the action, when the popup is resized. */ - popupResize? (e: PopupResizeEventArgs): void; + popupResize?(e: PopupResizeEventArgs): void; /** Fires the action, once the popup is opened. */ - popupShown? (e: PopupShownEventArgs): void; + popupShown?(e: PopupShownEventArgs): void; /** Fires the action, when resizing a popup starts. */ - popupResizeStart? (e: PopupResizeStartEventArgs): void; + popupResizeStart?(e: PopupResizeStartEventArgs): void; /** Fires the action, when the popup resizing is stopped. */ - popupResizeStop? (e: PopupResizeStopEventArgs): void; + popupResizeStop?(e: PopupResizeStopEventArgs): void; /** Fires the action before filtering the list items that starts in the DropDownList when the enableFilterSearch is enabled. */ - search? (e: SearchEventArgs): void; + search?(e: SearchEventArgs): void; /** Fires the action, when the list of item is selected. */ - select? (e: SelectEventArgs): void; + select?(e: SelectEventArgs): void; } export interface ActionBeginEventArgs { @@ -8413,11 +8385,11 @@ export interface ActionCompleteEventArgs { */ model?: any; - /** Returns the query for data retrieval + /** Returns the query for data retrieval */ query?: any; - /** Returns the query for data retrieval from the Database + /** Returns the query for data retrieval from the Database */ request?: any; @@ -8427,7 +8399,7 @@ export interface ActionCompleteEventArgs { /** Returns the number of items fetched from remote data */ - result?: Array; + result?: any[]; /** Returns the requested data */ @@ -8448,7 +8420,7 @@ export interface ActionFailureEventArgs { */ model?: any; - /** Returns the query for data retrieval + /** Returns the query for data retrieval */ query?: any; @@ -8471,11 +8443,11 @@ export interface ActionSuccessEventArgs { */ model?: any; - /** Returns the query for data retrieval + /** Returns the query for data retrieval */ query?: any; - /** Returns the query for data retrieval from the Database + /** Returns the query for data retrieval from the Database */ request?: any; @@ -8485,7 +8457,7 @@ export interface ActionSuccessEventArgs { /** Returns the number of items fetched from remote data */ - result?: Array; + result?: any[]; /** Returns the requested data */ @@ -8922,24 +8894,21 @@ export interface Fields { value?: string; } } -enum FilterType -{ -//filter the data wherever contains search key +enum FilterType { +//filter the data wherever contains search key Contains, //filter the data based on search key present at start position StartsWith, } -enum MultiSelectMode -{ -// can select only single item in DropDownList +enum MultiSelectMode { +// can select only single item in DropDownList None, //can select multiple items and it's separated by delimiterChar Delimiter, // can select multiple items and it's show's like visual box in textbox VisualMode, } -enum VirtualScrollMode -{ +enum VirtualScrollMode { // The data is loaded only to the corresponding page (display items). When scrolling some other position, it enables the load on demand with the DropDownList. Normal, //The data items are loaded from the remote when scroll handle reaches the end of the scrollbar like infinity scrolling. @@ -8948,11 +8917,10 @@ Continuous, class Tooltip extends ej.Widget { static fn: Tooltip; - constructor(element: JQuery, options?: Tooltip.Model); - constructor(element: Element, options?: Tooltip.Model); + constructor(element: JQuery | Element, options?: Tooltip.Model); static Locale: any; - model:Tooltip.Model; - defaults:Tooltip.Model; + model: Tooltip.Model; + defaults: Tooltip.Model; /** Destroys the Tooltip control. * @returns {void} @@ -8974,7 +8942,7 @@ class Tooltip extends ej.Widget { * @param {Function} optional custom effect takes place when hiding the tooltip. * @returns {void} */ - hide(effect?: string, func?: Function): void; + hide(effect?: string, func?: any): void; /** Shows the Tooltip popup for the given target element with the specified effect. * @param {string} optional Determines the type of effect that takes place when showing the tooltip. @@ -8982,9 +8950,9 @@ class Tooltip extends ej.Widget { * @param {JQuery} optional Tooltip will be shown for the given element * @returns {void} */ - show(effect?: string, func?: Function, target?: JQuery): void; + show(effect?: string, func?: any, target?: JQuery): void; } -export module Tooltip{ +export namespace Tooltip { export interface Model { @@ -9087,31 +9055,31 @@ export interface Model { width?: string|number; /** This event is triggered before the Tooltip widget get closed. */ - beforeClose? (e: BeforeCloseEventArgs): void; + beforeClose?(e: BeforeCloseEventArgs): void; /** This event is triggered before the Tooltip widget gets open. */ - beforeOpen? (e: BeforeOpenEventArgs): void; + beforeOpen?(e: BeforeOpenEventArgs): void; /** Fires on clicking to the target element. */ - click? (e: ClickEventArgs): void; + click?(e: ClickEventArgs): void; /** This event is triggered after the Tooltip widget is closed. */ - close? (e: CloseEventArgs): void; + close?(e: CloseEventArgs): void; /** This event is triggered after the Tooltip is created successfully. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** This event is triggered after the Tooltip widget is destroyed successfully. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** This event is triggered while hovering the target element, when tooltip positioning relates to target element. */ - hover? (e: HoverEventArgs): void; + hover?(e: HoverEventArgs): void; /** This event is triggered after the Tooltip is opened. */ - open? (e: OpenEventArgs): void; + open?(e: OpenEventArgs): void; /** This event is triggered while hover the target element, when the tooltip positioning is relates to the mouse. */ - tracking? (e: TrackingEventArgs): void; + tracking?(e: TrackingEventArgs): void; } export interface BeforeCloseEventArgs { @@ -9327,7 +9295,7 @@ export interface Position { stem?: PositionStem; } -enum effect{ +enum effect { ///No animation takes place when showing/hiding the Tooltip None, @@ -9340,7 +9308,7 @@ enum effect{ } -enum Associate{ +enum Associate { ///Sets the position related to target element. Target, @@ -9359,7 +9327,7 @@ enum Associate{ } -enum CloseMode{ +enum CloseMode { ///Enables close button in Tooltip. Sticky, @@ -9372,7 +9340,7 @@ enum CloseMode{ } -enum Collision{ +enum Collision { ///Flips the Tooltip to the opposite side of the target, if collision is occurs. Flip, @@ -9388,7 +9356,7 @@ enum Collision{ } -enum Trigger{ +enum Trigger { ///The Tooltip to be shown when the target element is clicked. Click, @@ -9404,11 +9372,10 @@ enum Trigger{ class Editor extends ej.Widget { static fn: Editor; - constructor(element: JQuery, options?: Editor.Model); - constructor(element: Element, options?: Editor.Model); + constructor(element: JQuery | Element, options?: Editor.Model); static Locale: any; - model:Editor.Model; - defaults:Editor.Model; + model: Editor.Model; + defaults: Editor.Model; /** destroy the editor widgets all events are unbind automatically and bring the control to pre-init state. * @returns {void} @@ -9431,15 +9398,15 @@ class Editor extends ej.Widget { getValue(): number; } - class NumericTextbox extends Editor{ + class NumericTextbox extends Editor { } - class CurrencyTextbox extends Editor{ + class CurrencyTextbox extends Editor { } - class PercentageTextbox extends Editor{ + class PercentageTextbox extends Editor { } -export module Editor{ +export namespace Editor { export interface Model { @@ -9573,19 +9540,19 @@ export interface Model { width?: string; /** Fires after Editor control value is changed. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Fires after Editor control is created. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when the Editor is destroyed successfully. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires after Editor control is focused. */ - focusIn? (e: FocusInEventArgs): void; + focusIn?(e: FocusInEventArgs): void; /** Fires after Editor control is loss the focus. */ - focusOut? (e: FocusOutEventArgs): void; + focusOut?(e: FocusOutEventArgs): void; } export interface ChangeEventArgs { @@ -9682,11 +9649,10 @@ export interface FocusOutEventArgs { class ListView extends ej.Widget { static fn: ListView; - constructor(element: JQuery, options?: ListView.Model); - constructor(element: Element, options?: ListView.Model); + constructor(element: JQuery | Element, options?: ListView.Model); static Locale: any; - model:ListView.Model; - defaults:ListView.Model; + model: ListView.Model; + defaults: ListView.Model; /** To add item in the given index. If you have enabled grouping in ListView then you need to pass the corresponding group list title to add item in it. * @param {any} Specifies the item to be added in ListView @@ -9743,12 +9709,12 @@ class ListView extends ej.Widget { /** To get all the checked items. * @returns {Array} */ - getCheckedItems(): Array; + getCheckedItems(): any[]; /** To get the text of all the checked items. * @returns {Array} */ - getCheckedItemsText(): Array; + getCheckedItemsText(): any[]; /** To get the total item count. * @returns {number} @@ -9835,7 +9801,7 @@ class ListView extends ej.Widget { */ unCheckItem(index: number): void; } -export module ListView{ +export namespace ListView { export interface Model { @@ -9847,7 +9813,7 @@ export interface Model { /** Set the index values to be selected on initial loading. This works only when enableCheckMark is set true. * @Default {[]} */ - checkedIndices?: Array; + checkedIndices?: any[]; /** Sets the root class for ListView theme. This cssClass API helps to use custom skinning option for ListView control. By defining the root class using this API, we need to include this root class in CSS. */ @@ -9856,7 +9822,7 @@ export interface Model { /** Contains the list of data for generating the ListView items. * @Default {[]} */ - dataSource?: Array; + dataSource?: any[]; /** Specifies whether to load AJAX content while selecting item. * @Default {false} @@ -9895,7 +9861,7 @@ export interface Model { /** Contains the array of items to be added in ListView. * @Default {[]} */ - items?: Array; + items?: any[]; /** Specifies the text of the back button in the header. * @Default {null} @@ -9962,28 +9928,28 @@ export interface Model { width?: string|number; /** Event triggers before the AJAX request happens. */ - ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + ajaxBeforeLoad?(e: AjaxBeforeLoadEventArgs): void; /** Event triggers after the AJAX content loaded completely. */ - ajaxComplete? (e: AjaxCompleteEventArgs): void; + ajaxComplete?(e: AjaxCompleteEventArgs): void; /** Event triggers when the AJAX request failed. */ - ajaxError? (e: AjaxErrorEventArgs): void; + ajaxError?(e: AjaxErrorEventArgs): void; /** Event triggers after the AJAX content loaded successfully. */ - ajaxSuccess? (e: AjaxSuccessEventArgs): void; + ajaxSuccess?(e: AjaxSuccessEventArgs): void; /** Event triggers before the items loaded. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Event triggers after the items loaded. */ - loadComplete? (e: LoadCompleteEventArgs): void; + loadComplete?(e: LoadCompleteEventArgs): void; /** Event triggers when mouse down happens on the item. */ - mouseDown? (e: MouseDownEventArgs): void; + mouseDown?(e: MouseDownEventArgs): void; /** Event triggers when mouse up happens on the item. */ - mouseUp? (e: MouseUpEventArgs): void; + mouseUp?(e: MouseUpEventArgs): void; } export interface AjaxBeforeLoadEventArgs { @@ -10236,11 +10202,10 @@ export interface AjaxSettings { class MaskEdit extends ej.Widget { static fn: MaskEdit; - constructor(element: JQuery, options?: MaskEdit.Model); - constructor(element: Element, options?: MaskEdit.Model); + constructor(element: JQuery | Element, options?: MaskEdit.Model); static Locale: any; - model:MaskEdit.Model; - defaults:MaskEdit.Model; + model: MaskEdit.Model; + defaults: MaskEdit.Model; /** To clear the text in mask edit textbox control. * @returns {void} @@ -10267,7 +10232,7 @@ class MaskEdit extends ej.Widget { */ get_UnstrippedValue(): string; } -export module MaskEdit{ +export namespace MaskEdit { export interface Model { @@ -10371,34 +10336,34 @@ export interface Model { width?: string; /** Fires when value changed in mask edit textbox control. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Fires after MaskEdit control is created. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when the MaskEdit is destroyed successfully. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires when focused in mask edit textbox control. */ - focusIn? (e: FocusInEventArgs): void; + focusIn?(e: FocusInEventArgs): void; /** Fires when focused out in mask edit textbox control. */ - focusOut? (e: FocusOutEventArgs): void; + focusOut?(e: FocusOutEventArgs): void; /** Fires when keydown in mask edit textbox control. */ - keydown? (e: KeydownEventArgs): void; + keydown?(e: KeydownEventArgs): void; /** Fires when key press in mask edit textbox control. */ - keyPress? (e: KeyPressEventArgs): void; + keyPress?(e: KeyPressEventArgs): void; /** Fires when keyup in mask edit textbox control. */ - keyup? (e: KeyupEventArgs): void; + keyup?(e: KeyupEventArgs): void; /** Fires when mouse out in mask edit textbox control. */ - mouseOut? (e: MouseOutEventArgs): void; + mouseOut?(e: MouseOutEventArgs): void; /** Fires when mouse over in mask edit textbox control. */ - mouseOver? (e: MouseOverEventArgs): void; + mouseOver?(e: MouseOverEventArgs): void; } export interface ChangeEventArgs { @@ -10615,15 +10580,13 @@ export interface MouseOverEventArgs { unmaskedValue?: string; } } -enum InputMode -{ +enum InputMode { //string Password, //string Text, } -enum TextAlign -{ +enum TextAlign { //string Center, //string @@ -10636,11 +10599,10 @@ Right, class Menu extends ej.Widget { static fn: Menu; - constructor(element: JQuery, options?: Menu.Model); - constructor(element: Element, options?: Menu.Model); + constructor(element: JQuery | Element, options?: Menu.Model); static Locale: any; - model:Menu.Model; - defaults:Menu.Model; + model: Menu.Model; + defaults: Menu.Model; /** Disables the Menu control. * @returns {void} @@ -10711,7 +10673,7 @@ class Menu extends ej.Widget { * @param {any|Array} Selector of target node or Object of target node. * @returns {void} */ - remove(target: any|Array): void; + remove(target: any|any[]): void; /** To show the Menu control. * @param {number} x co-ordinate position of context menu. @@ -10727,7 +10689,7 @@ class Menu extends ej.Widget { */ showItems(): void; } -export module Menu{ +export namespace Menu { export interface Model { @@ -10846,37 +10808,37 @@ export interface Model { overflowWidth?: string|number; /** Fires before context menu gets open. */ - beforeOpen? (e: BeforeOpenEventArgs): void; + beforeOpen?(e: BeforeOpenEventArgs): void; /** Fires when mouse click on menu items. */ - click? (e: ClickEventArgs): void; + click?(e: ClickEventArgs): void; /** Fire when context menu on close. */ - close? (e: CloseEventArgs): void; + close?(e: CloseEventArgs): void; /** Fires when context menu on open. */ - open? (e: OpenEventArgs): void; + open?(e: OpenEventArgs): void; /** Fires to create menu items. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires to destroy menu items. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires when key down on menu items. */ - keydown? (e: KeydownEventArgs): void; + keydown?(e: KeydownEventArgs): void; /** Fires when mouse out from menu items. */ - mouseout? (e: MouseoutEventArgs): void; + mouseout?(e: MouseoutEventArgs): void; /** Fires when mouse over the Menu items. */ - mouseover? (e: MouseoverEventArgs): void; + mouseover?(e: MouseoverEventArgs): void; /** Fires when overflow popup menu opens. */ - overflowOpen? (e: OverflowOpenEventArgs): void; + overflowOpen?(e: OverflowOpenEventArgs): void; /** Fires when overflow popup menu closes. */ - overflowClose? (e: OverflowCloseEventArgs): void; + overflowClose?(e: OverflowCloseEventArgs): void; } export interface BeforeOpenEventArgs { @@ -11139,22 +11101,19 @@ export interface Fields { url?: string; } } -enum AnimationType -{ +enum AnimationType { //string Default, //string None, } -enum MenuType -{ +enum MenuType { //string ContextMenu, //string NormalMenu, } -enum Direction -{ +enum Direction { //string Left, //string @@ -11165,11 +11124,10 @@ Right, class Pager extends ej.Widget { static fn: Pager; - constructor(element: JQuery, options?: Pager.Model); - constructor(element: Element, options?: Pager.Model); + constructor(element: JQuery | Element, options?: Pager.Model); static Locale: any; - model:Pager.Model; - defaults:Pager.Model; + model: Pager.Model; + defaults: Pager.Model; /** Send a paging request to specified page through the pager control. * @param {number} Specifies the index to be navigated @@ -11182,7 +11140,7 @@ class Pager extends ej.Widget { */ refreshPager(): void; } -export module Pager{ +export namespace Pager { export interface Model { @@ -11245,7 +11203,7 @@ export interface Model { showPageInfo?: boolean; /** Triggered when pager numeric item is clicked in pager control. */ - click? (e: ClickEventArgs): void; + click?(e: ClickEventArgs): void; } export interface ClickEventArgs { @@ -11274,11 +11232,10 @@ export interface ClickEventArgs { class ProgressBar extends ej.Widget { static fn: ProgressBar; - constructor(element: JQuery, options?: ProgressBar.Model); - constructor(element: Element, options?: ProgressBar.Model); + constructor(element: JQuery | Element, options?: ProgressBar.Model); static Locale: any; - model:ProgressBar.Model; - defaults:ProgressBar.Model; + model: ProgressBar.Model; + defaults: ProgressBar.Model; /** Destroy the progressbar widget * @returns {void} @@ -11305,7 +11262,7 @@ class ProgressBar extends ej.Widget { */ getValue(): number; } -export module ProgressBar{ +export namespace ProgressBar { export interface Model { @@ -11375,19 +11332,19 @@ export interface Model { width?: number|string; /** Event triggers when the progress value changed */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Event triggers when the process completes (at 100%) */ - complete? (e: CompleteEventArgs): void; + complete?(e: CompleteEventArgs): void; /** Event triggers when the progressbar are created */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Event triggers when the progressbar are destroyed */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Event triggers when the process starts (from 0%) */ - start? (e: StartEventArgs): void; + start?(e: StartEventArgs): void; } export interface ChangeEventArgs { @@ -11492,11 +11449,10 @@ export interface StartEventArgs { class RadioButton extends ej.Widget { static fn: RadioButton; - constructor(element: JQuery, options?: RadioButton.Model); - constructor(element: Element, options?: RadioButton.Model); + constructor(element: JQuery | Element, options?: RadioButton.Model); static Locale: any; - model:RadioButton.Model; - defaults:RadioButton.Model; + model: RadioButton.Model; + defaults: RadioButton.Model; /** To disable the RadioButton * @returns {void} @@ -11508,7 +11464,7 @@ class RadioButton extends ej.Widget { */ enable(): void; } -export module RadioButton{ +export namespace RadioButton { export interface Model { @@ -11581,16 +11537,16 @@ export interface Model { value?: string; /** Fires before the RadioButton is going to changed its state successfully */ - beforeChange? (e: BeforeChangeEventArgs): void; + beforeChange?(e: BeforeChangeEventArgs): void; /** Fires when the RadioButton state is changed successfully */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Fires when the RadioButton created successfully */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when the RadioButton destroyed successfully */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; } export interface BeforeChangeEventArgs { @@ -11669,8 +11625,7 @@ export interface DestroyEventArgs { type?: string; } } -enum RadioButtonSize -{ +enum RadioButtonSize { //Shows small size radio button Small, //Shows medium size radio button @@ -11679,11 +11634,10 @@ Medium, class Rating extends ej.Widget { static fn: Rating; - constructor(element: JQuery, options?: Rating.Model); - constructor(element: Element, options?: Rating.Model); + constructor(element: JQuery | Element, options?: Rating.Model); static Locale: any; - model:Rating.Model; - defaults:Rating.Model; + model: Rating.Model; + defaults: Rating.Model; /** Destroy the Rating widget all events bound will be unbind automatically and bring the control to pre-init state. * @returns {void} @@ -11721,7 +11675,7 @@ class Rating extends ej.Widget { */ show(): void; } -export module Rating{ +export namespace Rating { export interface Model { @@ -11810,22 +11764,22 @@ export interface Model { width?: string; /** Fires when Rating value changes. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Fires when Rating control is clicked successfully. */ - click? (e: ClickEventArgs): void; + click?(e: ClickEventArgs): void; /** Fires when Rating control is created. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when Rating control is destroyed successfully. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires when mouse hover is removed from Rating control. */ - mouseout? (e: MouseoutEventArgs): void; + mouseout?(e: MouseoutEventArgs): void; /** Fires when mouse hovered over the Rating control. */ - mouseover? (e: MouseoverEventArgs): void; + mouseover?(e: MouseoverEventArgs): void; } export interface ChangeEventArgs { @@ -11954,7 +11908,7 @@ export interface MouseoverEventArgs { index?: any; } -enum Precision{ +enum Precision { ///string Exact, @@ -11970,11 +11924,10 @@ enum Precision{ class Ribbon extends ej.Widget { static fn: Ribbon; - constructor(element: JQuery, options?: Ribbon.Model); - constructor(element: Element, options?: Ribbon.Model); + constructor(element: JQuery | Element, options?: Ribbon.Model); static Locale: any; - model:Ribbon.Model; - defaults:Ribbon.Model; + model: Ribbon.Model; + defaults: Ribbon.Model; /** Adds contextual tab or contextual tab set dynamically in the ribbon control with contextual tabs object and index position. When index is null, ribbon contextual tab or contextual tab set is added at the last index. * @param {any} contextual tab or contextual tab set object. @@ -11996,7 +11949,7 @@ class Ribbon extends ej.Widget { * @param {number} index of the ribbon tab,this is optional. * @returns {void} */ - addTab(tabText: string, ribbonGroups: Array, index?: number): void; + addTab(tabText: string, ribbonGroups: any[], index?: number): void; /** Adds tab group dynamically in the ribbon control with given tab index, tab group object and group index position. When group index is null, ribbon group is added at the last index. * @param {number} ribbon tab index. @@ -12040,7 +11993,7 @@ class Ribbon extends ej.Widget { * @param {number} index of the tab item. * @returns {String} */ - getTabText(index: number): String; + getTabText(index: number): string; /** Hides the given text tab in the ribbon control. * @param {string} text of the tab item. @@ -12052,13 +12005,13 @@ class Ribbon extends ej.Widget { * @param {string} text of the tab item. * @returns {Boolean} */ - isEnable(text: string): Boolean; + isEnable(text: string): boolean; /** Checks whether the given text tab in the ribbon control is visible or not. * @param {string} text of the tab item. * @returns {Boolean} */ - isVisible(text: string): Boolean; + isVisible(text: string): boolean; /** Removes the given index tab item from the ribbon control. * @param {number} index of tab item. @@ -12113,7 +12066,7 @@ class Ribbon extends ej.Widget { */ removeBackStageItem(index: number): void; } -export module Ribbon{ +export namespace Ribbon { export interface Model { @@ -12170,17 +12123,17 @@ export interface Model { /** Specifies the contextual tabs and tab set to the ribbon control with the background color and border color. Refer to the tabs section for adding tabs into the contextual tab and contextual tab set. * @Default {Array} */ - contextualTabs?: Array; + contextualTabs?: ContextualTab[]; /** Specifies the index or indexes to disable the given index tab or indexes tabs in the ribbon control. * @Default {0} */ - disabledItemIndex?: Array; + disabledItemIndex?: any[]; /** Specifies the index or indexes to enable the given index tab or indexes tabs in the ribbon control. * @Default {null} */ - enabledItemIndex?: Array; + enabledItemIndex?: any[]; /** Specifies the index of the ribbon tab to select the given index tab item in the ribbon control. * @Default {1} @@ -12190,7 +12143,7 @@ export interface Model { /** Specifies the tabs and its groups. Also specifies the control details that has to be placed in the tab area in the ribbon control. * @Default {Array} */ - tabs?: Array; + tabs?: Tab[]; /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region and it will need to use the user's preference. * @Default {en-US} @@ -12203,55 +12156,55 @@ export interface Model { width?: string|number; /** Triggered before the ribbon tab item is removed. */ - beforeTabRemove? (e: BeforeTabRemoveEventArgs): void; + beforeTabRemove?(e: BeforeTabRemoveEventArgs): void; /** Triggered before the ribbon control is created. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Triggered before the ribbon control is destroyed. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Triggered when the control in the group is clicked successfully. */ - groupClick? (e: GroupClickEventArgs): void; + groupClick?(e: GroupClickEventArgs): void; /** Triggered when the group expander in the group is clicked successfully. */ - groupExpand? (e: GroupExpandEventArgs): void; + groupExpand?(e: GroupExpandEventArgs): void; /** Triggered when an item in the Gallery control is clicked successfully. */ - galleryItemClick? (e: GalleryItemClickEventArgs): void; + galleryItemClick?(e: GalleryItemClickEventArgs): void; /** Triggered when a tab or button in the backstage page is clicked successfully. */ - backstageItemClick? (e: BackstageItemClickEventArgs): void; + backstageItemClick?(e: BackstageItemClickEventArgs): void; /** Triggered when the ribbon control is collapsed. */ - collapse? (e: CollapseEventArgs): void; + collapse?(e: CollapseEventArgs): void; /** Triggered when the ribbon control is expanded. */ - expand? (e: ExpandEventArgs): void; + expand?(e: ExpandEventArgs): void; /** Triggered before the ribbon control is load. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Triggered after adding the new ribbon tab item. */ - tabAdd? (e: TabAddEventArgs): void; + tabAdd?(e: TabAddEventArgs): void; /** Triggered when tab is clicked successfully in the ribbon control. */ - tabClick? (e: TabClickEventArgs): void; + tabClick?(e: TabClickEventArgs): void; /** Triggered before the ribbon tab is created. */ - tabCreate? (e: TabCreateEventArgs): void; + tabCreate?(e: TabCreateEventArgs): void; /** Triggered after the tab item is removed from the ribbon control. */ - tabRemove? (e: TabRemoveEventArgs): void; + tabRemove?(e: TabRemoveEventArgs): void; /** Triggered after the ribbon tab item is selected in the ribbon control. */ - tabSelect? (e: TabSelectEventArgs): void; + tabSelect?(e: TabSelectEventArgs): void; /** Triggered when the expand/collapse button is clicked successfully . */ - toggleButtonClick? (e: ToggleButtonClickEventArgs): void; + toggleButtonClick?(e: ToggleButtonClickEventArgs): void; /** Triggered when the QAT menu item is clicked successfully . */ - qatMenuItemClick? (e: QatMenuItemClickEventArgs): void; + qatMenuItemClick?(e: QatMenuItemClickEventArgs): void; } export interface BeforeTabRemoveEventArgs { @@ -12675,7 +12628,7 @@ export interface ApplicationTabBackstageSettings { /** Specifies the ribbon backstage page with its tab and button elements. * @Default {Array} */ - pages?: Array; + pages?: ApplicationTabBackstageSettingsPage[]; /** Specifies the width of backstage page header that contains tabs and buttons. * @Default {null} @@ -12721,7 +12674,7 @@ export interface ContextualTab { /** Specifies the tabs to present in the contextual tabs and tab set. Refer to the tabs section for adding tabs into the contextual tabs and tab set. * @Default {Array} */ - tabs?: Array; + tabs?: any[]; } export interface TabsGroupsContentDefaults { @@ -12856,7 +12809,7 @@ export interface TabsGroupsContentGroup { /** Specifies the Syncfusion button and menu as gallery extra items. * @Default {Array} */ - customGalleryItems?: Array; + customGalleryItems?: TabsGroupsContentGroupsCustomGalleryItem[]; /** Provides custom tooltip for button, split button, dropdown list, toggle button, custom controls in the sub groups. Text and HTML support are also provided for title and content. * @Default {Object} @@ -12881,7 +12834,7 @@ export interface TabsGroupsContentGroup { /** Defines each gallery content. * @Default {Array} */ - galleryItems?: Array; + galleryItems?: TabsGroupsContentGroupsGalleryItem[]; /** Specifies the Id for button, split button, dropdown list, toggle button, gallery, custom controls in the sub groups. * @Default {null} @@ -12944,7 +12897,7 @@ export interface TabsGroupsContent { /** Specifies the controls such as Syncfusion button, split button, dropdown list, toggle button, gallery, custom controls in the subgroup of the ribbon tab . * @Default {Array} */ - groups?: Array; + groups?: TabsGroupsContentGroup[]; } export interface TabsGroupsGroupExpanderSettings { @@ -12970,7 +12923,7 @@ export interface TabsGroup { /** Specifies the Syncfusion button, split button, dropdown list, toggle button, gallery, custom controls to the groups in the ribbon control. * @Default {Array} */ - content?: Array; + content?: TabsGroupsContent[]; /** Specifies the ID of custom items to be placed in the groups. * @Default {null} @@ -13008,7 +12961,7 @@ export interface Tab { /** Specifies single group or multiple groups and its contents to each tab in the ribbon control. * @Default {Array} */ - groups?: Array; + groups?: TabsGroup[]; /** Specifies the ID for each tab's content panel. * @Default {null} @@ -13021,7 +12974,7 @@ export interface Tab { text?: string; } -enum ItemType{ +enum ItemType { ///To render the button for ribbon backstage page’s contents Button, @@ -13031,7 +12984,7 @@ enum ItemType{ } -enum ApplicationTabType{ +enum ApplicationTabType { ///applicationTab display as menu Menu, @@ -13041,7 +12994,7 @@ enum ApplicationTabType{ } -enum AlignType{ +enum AlignType { ///To align the group content's in row Rows, @@ -13051,7 +13004,7 @@ enum AlignType{ } -enum CustomItemType{ +enum CustomItemType { ///Specifies the button type in customGalleryItems Button, @@ -13061,9 +13014,9 @@ enum CustomItemType{ } -enum QuickAccessMode{ +enum QuickAccessMode { - ///Controls are hidden in Quick Access toolbar + ///Controls are hidden in Quick Access toolbar None, ///Add controls in toolBar @@ -13074,7 +13027,7 @@ enum QuickAccessMode{ } -enum Type{ +enum Type { ///Specifies the button control Button, @@ -13099,11 +13052,10 @@ enum Type{ class Kanban extends ej.Widget { static fn: Kanban; - constructor(element: JQuery, options?: Kanban.Model); - constructor(element: Element, options?: Kanban.Model); + constructor(element: JQuery | Element, options?: Kanban.Model); static Locale: any; - model:Kanban.Model; - defaults:Kanban.Model; + model: Kanban.Model; + defaults: Kanban.Model; /** Add or remove columns in Kanban columns collections.Default action is add. * @param {Array|string} Pass array of columns or string of headerText to add/remove the column in Kanban @@ -13111,7 +13063,7 @@ class Kanban extends ej.Widget { * @param {string} optional Pass add/remove action to be performed. By default "add" action will perform * @returns {void} */ - columns(columndetails: Array|string, keyvalue: Array|string, action?: string): void; + columns(columndetails: any[]|string, keyvalue: any[]|string, action?: string): void; /** Destroy the Kanban widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. * @returns {void} @@ -13122,7 +13074,7 @@ class Kanban extends ej.Widget { * @param {Array} Pass new data source to the Kanban * @returns {void} */ - dataSource(datasource: Array): void; + dataSource(datasource: any[]): void; /** toggleColumn based on the headerText in Kanban. * @param {any} Pass the header text of the column to get the corresponding column object @@ -13131,7 +13083,7 @@ class Kanban extends ej.Widget { toggleColumn(headerText: any): void; /** Expand or collapse the card based on the state of target "div" - * @param {string|number} Pass the id of card to be toggle + * @param {string|number} Pass the id of card to be toggle * @returns {void} */ toggleCard(key: string|number): void; @@ -13139,7 +13091,7 @@ class Kanban extends ej.Widget { /** Used for get the names of all the visible column name collections in Kanban. * @returns {Array} */ - getVisibleColumnNames(): Array; + getVisibleColumnNames(): any[]; /** Get the scroller object of Kanban. * @returns {ej.Scroller} @@ -13150,18 +13102,18 @@ class Kanban extends ej.Widget { * @param {string} Pass the header text of the column to get the corresponding column object * @returns {String} */ - getColumnByHeaderText(headerText: string): String; + getColumnByHeaderText(headerText: string): string; /** Get the table details based on the given header table in Kanban. * @returns {String} */ - getHeaderTable(): String; + getHeaderTable(): string; /** Hide columns from the Kanban based on the header text * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to hide * @returns {void} */ - hideColumns(headerText: Array|string): void; + hideColumns(headerText: any[]|string): void; /** Print the Kanban Board * @returns {void} @@ -13183,14 +13135,14 @@ class Kanban extends ej.Widget { * @param {Array|string} You can pass either array of header text of various columns or a header text of a column to show * @returns {void} */ - showColumns(headerText: Array|string): void; + showColumns(headerText: any[]|string): void; /** Update a card in Kanban control based on key and JSON data given. * @param {string} Pass the key field Name of the column * @param {Array} Pass the edited JSON data of card need to be update. * @returns {void} */ - updateCard(key: string, data: Array): void; + updateCard(key: string, data: any[]): void; KanbanSelection: Kanban.KanbanSelection; @@ -13200,7 +13152,7 @@ class Kanban extends ej.Widget { KanbanEdit: Kanban.KanbanEdit; } -export module Kanban{ +export namespace Kanban { export interface KanbanSelection { @@ -13260,7 +13212,7 @@ export interface KanbanEdit { * @param {Array} Pass the edited JSON data of card need to be add. * @returns {void} */ - addCard(primaryKey: string,card: Array): void; + addCard(primaryKey: string, card: any[]): void; /** Send a cancel request of add/edit card in Kanban when allowEditing/allowAdding is set as true. * @returns {void} @@ -13289,7 +13241,7 @@ export interface KanbanEdit { * @param {any} Specify the validation rules for the field * @returns {void} */ - setValidationToField(name: string,rules: any): void; + setValidationToField(name: string, rules: any): void; } export interface Model { @@ -13357,7 +13309,7 @@ export interface Model { /** Gets or sets an object that indicates to render the Kanban with specified columns. * @Default {Array} */ - columns?: Array; + columns?: Column[]; /** Gets or sets an object that indicates whether to Customize the card settings. * @Default {Object} @@ -13367,7 +13319,7 @@ export interface Model { /** Gets or sets a value that indicates whether to add customToolbarItems within the toolbar to perform any action in the Kanban. * @Default {[]} */ - customToolbarItems?: Array; + customToolbarItems?: CustomToolbarItem[]; /** Gets or sets a value that indicates to render the Kanban with custom theme. */ @@ -13421,7 +13373,7 @@ export interface Model { /** To customize the filtering behavior based on queries given. * @Default {Array} */ - filterSettings?: Array; + filterSettings?: FilterSetting[]; /** ej Query to query database of Kanban. * @Default {null} @@ -13451,7 +13403,7 @@ export interface Model { /** Gets or sets an object that indicates to managing the collection of stacked header rows for the Kanban. * @Default {Array} */ - stackedHeaderRows?: Array; + stackedHeaderRows?: StackedHeaderRow[]; /** The tooltip allows to display card details in a tooltip while hovering on it. */ @@ -13460,7 +13412,7 @@ export interface Model { /** Gets or sets an object that indicates to render the Kanban with specified workflows. * @Default {Array} */ - workflows?: Array; + workflows?: Workflow[]; /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. * @Default {en-US} @@ -13468,79 +13420,79 @@ export interface Model { locale?: string; /** Triggered for every Kanban action before its starts. */ - actionBegin? (e: ActionBeginEventArgs): void; + actionBegin?(e: ActionBeginEventArgs): void; /** Triggered for every Kanban action success event. */ - actionComplete? (e: ActionCompleteEventArgs): void; + actionComplete?(e: ActionCompleteEventArgs): void; /** Triggered for every Kanban action server failure event. */ - actionFailure? (e: ActionFailureEventArgs): void; + actionFailure?(e: ActionFailureEventArgs): void; /** Triggered before the task is going to be edited. */ - beginEdit? (e: BeginEditEventArgs): void; + beginEdit?(e: BeginEditEventArgs): void; /** Triggered before the card is going to be added */ - beginAdd? (e: BeginAddEventArgs): void; + beginAdd?(e: BeginAddEventArgs): void; /** Triggered before the card is selected. */ - beforeCardSelect? (e: BeforeCardSelectEventArgs): void; + beforeCardSelect?(e: BeforeCardSelectEventArgs): void; /** Trigger after the card is clicked. */ - cardClick? (e: CardClickEventArgs): void; + cardClick?(e: CardClickEventArgs): void; /** Triggered when the card is being dragged. */ - cardDrag? (e: CardDragEventArgs): void; + cardDrag?(e: CardDragEventArgs): void; /** Triggered when card dragging start. */ - cardDragStart? (e: CardDragStartEventArgs): void; + cardDragStart?(e: CardDragStartEventArgs): void; /** Triggered when card dragging stops. */ - cardDragStop? (e: CardDragStopEventArgs): void; + cardDragStop?(e: CardDragStopEventArgs): void; /** Triggered when the card is Dropped. */ - cardDrop? (e: CardDropEventArgs): void; + cardDrop?(e: CardDropEventArgs): void; /** Triggered after the card is selected. */ - cardSelect? (e: CardSelectEventArgs): void; + cardSelect?(e: CardSelectEventArgs): void; /** Triggered when card is double clicked. */ - cardDoubleClick? (e: CardDoubleClickEventArgs): void; + cardDoubleClick?(e: CardDoubleClickEventArgs): void; /** Triggered before the card is selected. */ - cardSelecting? (e: CardSelectingEventArgs): void; + cardSelecting?(e: CardSelectingEventArgs): void; /** Triggered when the Kanban is rendered completely */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Triggers after the cell is clicked. */ - cellClick? (e: CellClickEventArgs): void; + cellClick?(e: CellClickEventArgs): void; /** Triggered the Kanban is bound with data during initial rendering. */ - dataBound? (e: DataBoundEventArgs): void; + dataBound?(e: DataBoundEventArgs): void; /** Triggered when Kanban going to destroy. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Triggered after the card is deleted. */ - endDelete? (e: EndDeleteEventArgs): void; + endDelete?(e: EndDeleteEventArgs): void; /** Triggered after the card is edited. */ - endEdit? (e: EndEditEventArgs): void; + endEdit?(e: EndEditEventArgs): void; /** Triggers after the header is clicked. */ - headerClick? (e: HeaderClickEventArgs): void; + headerClick?(e: HeaderClickEventArgs): void; /** Triggered initial load. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Triggered when toolbar item is clicked in Kanban. */ - toolbarClick? (e: ToolbarClickEventArgs): void; + toolbarClick?(e: ToolbarClickEventArgs): void; /** Triggered every time a single card rendered request is made to access particular card information. */ - queryCellInfo? (e: QueryCellInfoEventArgs): void; + queryCellInfo?(e: QueryCellInfoEventArgs): void; /** Triggered before the context menu is opened. */ - contextOpen? (e: ContextOpenEventArgs): void; + contextOpen?(e: ContextOpenEventArgs): void; } export interface ActionBeginEventArgs { @@ -13750,7 +13702,7 @@ export interface BeforeCardSelectEventArgs { /** Returns the previously select card indexes */ - previousRowcellindex?: Array; + previousRowcellindex?: any[]; /** Returns the Target item. */ @@ -13936,7 +13888,7 @@ export interface CardSelectEventArgs { /** Returns the previously select card indexes */ - previousRowcellindex?: Array; + previousRowcellindex?: any[]; /** Returns the current item. */ @@ -13998,7 +13950,7 @@ export interface CardSelectingEventArgs { /** Returns the previously rowcell is selecting card indexes */ - previousRowcellindex?: Array; + previousRowcellindex?: any[]; /** Returns the current item. */ @@ -14284,7 +14236,7 @@ export interface SwimlaneSettingsUnassignedGroup { /** To set the user defined values which are need to categorized as unassigned category swim lane groups. * @Default {[null,undefined,]} */ - keys?: Array; + keys?: any[]; } export interface SwimlaneSettings { @@ -14333,17 +14285,17 @@ export interface ContextMenuSettings { /** Gets or sets a value that indicates the list of items needs to be disable from default context menu items. * @Default {Array} */ - disableDefaultItems?: Array; + disableDefaultItems?: any[]; /** Its used to add specific default context menu items. * @Default {Array} */ - menuItems?: Array; + menuItems?: any[]; /** Gets or sets a value that indicates whether to add custom contextMenu items. * @Default {Array} */ - customMenuItems?: Array; + customMenuItems?: ContextMenuSettingsCustomMenuItem[]; } export interface ColumnsConstraints { @@ -14496,7 +14448,7 @@ export interface EditSettings { /** Get or sets an object that indicates whether to customize the editing fields of Kanban card. * @Default {Array} */ - editItems?: Array; + editItems?: EditSettingsEditItem[]; /** This specifies the id of the template which is require to be edited using the External edit form. * @Default {null} @@ -14593,7 +14545,7 @@ export interface SearchSettings { /** To customize the fields the searching operation can be perform. * @Default {Array} */ - fields?: Array; + fields?: any[]; /** To customize the searching string. */ @@ -14628,7 +14580,7 @@ export interface StackedHeaderRow { /** Gets or sets a value that indicates whether to add stacked header columns into the stacked header rows. * @Default {Array} */ - stackedHeaderColumns?: Array; + stackedHeaderColumns?: StackedHeaderRowsStackedHeaderColumn[]; } export interface TooltipSettings { @@ -14657,7 +14609,7 @@ export interface Workflow { allowedTransitions?: string; } -enum Target{ +enum Target { ///Sets context menu to Kanban header Header, @@ -14673,7 +14625,7 @@ enum Target{ } -enum EditMode{ +enum EditMode { ///Creates Kanban with editMode as Dialog Dialog, @@ -14689,12 +14641,12 @@ enum EditMode{ } -enum EditingType{ +enum EditingType { ///Allows to set edit type as string edit type String, - ///Allows to set edit type as numeric edit type + ///Allows to set edit type as numeric edit type Numeric, ///Allows to set edit type as drop down edit type @@ -14714,7 +14666,7 @@ enum EditingType{ } -enum FormPosition{ +enum FormPosition { ///Form position is bottom. Bottom, @@ -14724,7 +14676,7 @@ enum FormPosition{ } -enum SelectionType{ +enum SelectionType { ///Support for Single selection in Kanban Single, @@ -14737,11 +14689,10 @@ enum SelectionType{ class Rotator extends ej.Widget { static fn: Rotator; - constructor(element: JQuery, options?: Rotator.Model); - constructor(element: Element, options?: Rotator.Model); + constructor(element: JQuery | Element, options?: Rotator.Model); static Locale: any; - model:Rotator.Model; - defaults:Rotator.Model; + model: Rotator.Model; + defaults: Rotator.Model; /** Disables the Rotator control. * @returns {void} @@ -14791,7 +14742,7 @@ class Rotator extends ej.Widget { */ updateTemplateById(index: number, id: string): void; } -export module Rotator{ +export namespace Rotator { export interface Model { @@ -14934,7 +14885,7 @@ export interface Model { /** The templateId enables to bind multiple customized template items in Rotator. * @Default {null} */ - templateId?: Array; + templateId?: any[]; /** Specifies the source for thumbnail elements. * @Default {null} @@ -14942,25 +14893,25 @@ export interface Model { thumbnailSourceID?: any; /** This event is fired when the Rotator slides are changed. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** This event is fired when the Rotator control is initialized. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** This event is fired when the Rotator control is destroyed. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** This event is fired when a pager is clicked. */ - pagerClick? (e: PagerClickEventArgs): void; + pagerClick?(e: PagerClickEventArgs): void; /** This event is fired when enableAutoPlay is started. */ - start? (e: StartEventArgs): void; + start?(e: StartEventArgs): void; /** This event is fired when autoplay is stopped or paused. */ - stop? (e: StopEventArgs): void; + stop?(e: StopEventArgs): void; /** This event is fired when a thumbnail pager is clicked. */ - thumbItemClick? (e: ThumbItemClickEventArgs): void; + thumbItemClick?(e: ThumbItemClickEventArgs): void; } export interface ChangeEventArgs { @@ -15135,7 +15086,7 @@ export interface Fields { url?: string; } -enum PagerPosition{ +enum PagerPosition { ///string BottomLeft, @@ -15160,11 +15111,10 @@ enum PagerPosition{ class RTE extends ej.Widget { static fn: RTE; - constructor(element: JQuery, options?: RTE.Model); - constructor(element: Element, options?: RTE.Model); + constructor(element: JQuery | Element, options?: RTE.Model); static Locale: any; - model:RTE.Model; - defaults:RTE.Model; + model: RTE.Model; + defaults: RTE.Model; /** Returns the range object. * @returns {any} @@ -15313,7 +15263,7 @@ class RTE extends ej.Widget { */ show(): void; } -export module RTE{ +export namespace RTE { export interface Model { @@ -15573,7 +15523,7 @@ export interface Model { /** Specifies the list of groups and order of those groups displayed in the RTE toolbar. The toolsList property is used to get the root group order and tools property is used to get the inner order of the corresponding groups displayed. When the value is not specified, it gets its default display order and tools. * @Default {[formatStyle, font, style, effects, alignment, lists, indenting, clipboard, doAction, clear, links, images, media, tables, casing,view, customTools,print,edit]} */ - toolsList?: Array; + toolsList?: any[]; /** Display the hints for the tools in the Toolbar. * @Default {{ associate: mouseenter, showShadow: true, position: { stem: { horizontal: left, vertical: top } }, tip: { size: { width: 5, height: 5 }, isBalloon: false }} @@ -15611,31 +15561,31 @@ export interface Model { zoomStep?: string|number; /** Fires when changed successfully. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Fires when the RTE is created successfully */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when mouse click on menu items. */ - contextMenuClick? (e: ContextMenuClickEventArgs): void; + contextMenuClick?(e: ContextMenuClickEventArgs): void; /** Fires before the RTE is destroyed. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires when the commands are executed successfully. */ - execute? (e: ExecuteEventArgs): void; + execute?(e: ExecuteEventArgs): void; /** Fires when the keydown action is successful. */ - keydown? (e: KeydownEventArgs): void; + keydown?(e: KeydownEventArgs): void; /** Fires when the keyup action is successful. */ - keyup? (e: KeyupEventArgs): void; + keyup?(e: KeyupEventArgs): void; /** Fires before the RTE Edit area is rendered and after the toolbar is rendered. */ - preRender? (e: PreRenderEventArgs): void; + preRender?(e: PreRenderEventArgs): void; /** Fires when the text is selected in the text area */ - select? (e: SelectEventArgs): void; + select?(e: SelectEventArgs): void; } export interface ChangeEventArgs { @@ -15898,93 +15848,92 @@ export interface Tools { /** Specifies the casing tools and the display order of this tool in the RTE toolbar. */ - casing?: Array; + casing?: any[]; /** Specifies the clear tools and the display order of this tool in the RTE toolbar. */ - clear?: Array; + clear?: any[]; /** Specifies the clipboard tools and the display order of this tool in the RTE toolbar. */ - clipboard?: Array; + clipboard?: any[]; /** Specifies the edit tools and the displays tool in the RTE toolbar. */ - edit?: Array; + edit?: any[]; /** Specifies the doAction tools and the display order of this tool in the RTE toolbar. */ - doAction?: Array; + doAction?: any[]; /** Specifies the effect of tools and the display order of this tool in RTE toolbar. */ - effects?: Array; + effects?: any[]; /** Specifies the font tools and the display order of this tool in the RTE toolbar. */ - font?: Array; + font?: any[]; /** Specifies the formatStyle tools and the display order of this tool in the RTE toolbar. */ - formatStyle?: Array; + formatStyle?: any[]; /** Specifies the image tools and the display order of this tool in the RTE toolbar. */ - images?: Array; + images?: any[]; /** Specifies the indent tools and the display order of this tool in the RTE toolbar. */ - indenting?: Array; + indenting?: any[]; /** Specifies the link tools and the display order of this tool in the RTE toolbar. */ - links?: Array; + links?: any[]; /** Specifies the list tools and the display order of this tool in the RTE toolbar. */ - lists?: Array; + lists?: any[]; /** Specifies the media tools and the display order of this tool in the RTE toolbar. */ - media?: Array; + media?: any[]; /** Specifies the style tools and the display order of this tool in the RTE toolbar. */ - style?: Array; + style?: any[]; /** Specifies the table tools and the display order of this tool in the RTE toolbar. */ - tables?: Array; + tables?: any[]; /** Specifies the view tools and the display order of this tool in the RTE toolbar. */ - view?: Array; + view?: any[]; /** Specifies the print tools and the display order of this tool in the RTE toolbar. */ - print?: Array; + print?: any[]; /** Specifies the importExport tools and the display order of this tool in the RTE toolbar. */ - importExport?: Array; + importExport?: any[]; /** Specifies the customOrderedList tools and the display order of this tool in the RTE toolbar. */ - customOrderedList?: Array; + customOrderedList?: ToolsCustomOrderedList[]; /** Specifies the customUnOrderedList tools and the display order of this tool in the RTE toolbar. */ - customUnorderedList?: Array; + customUnorderedList?: ToolsCustomUnorderedList[]; } } class Slider extends ej.Widget { static fn: Slider; - constructor(element: JQuery, options?: Slider.Model); - constructor(element: Element, options?: Slider.Model); + constructor(element: JQuery | Element, options?: Slider.Model); static Locale: any; - model:Slider.Model; - defaults:Slider.Model; + model: Slider.Model; + defaults: Slider.Model; /** To disable the slider * @returns {void} @@ -16006,7 +15955,7 @@ class Slider extends ej.Widget { */ setValue(): void; } -export module Slider{ +export namespace Slider { export interface Model { @@ -16122,7 +16071,7 @@ export interface Model { /** Specifies the values of the range slider. But it's not applicable for default and minRange sliders. we can use value property for default and minRange sliders. * @Default {[minValue,maxValue]} */ - values?: Array; + values?: any[]; /** Specifies the width of the slider. * @Default {100%} @@ -16130,25 +16079,25 @@ export interface Model { width?: string; /** Fires once Slider control value is changed successfully. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Fires once Slider control has been created successfully. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when Slider control has been destroyed successfully. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires once Slider control is sliding successfully. */ - slide? (e: SlideEventArgs): void; + slide?(e: SlideEventArgs): void; /** Fires once Slider control is started successfully. */ - start? (e: StartEventArgs): void; + start?(e: StartEventArgs): void; /** Fires when Slider control is stopped successfully. */ - stop? (e: StopEventArgs): void; + stop?(e: StopEventArgs): void; /** Fires when display the custom tooltip */ - tooltipChange? (e: TooltipChangeEventArgs): void; + tooltipChange?(e: TooltipChangeEventArgs): void; } export interface ChangeEventArgs { @@ -16177,7 +16126,7 @@ export interface ChangeEventArgs { */ value?: number; - /** returns true if event triggered by interaction else returns false. + /** returns true if event triggered by interaction else returns false. */ isInteraction?: boolean; } @@ -16294,12 +16243,11 @@ export interface StopEventArgs { } export interface TooltipChangeEventArgs { + undefined; } } -module slider -{ -enum sliderType -{ +namespace slider { +enum sliderType { //Shows default slider Default, //Shows minRange slider @@ -16311,11 +16259,10 @@ Range, class SplitButton extends ej.Widget { static fn: SplitButton; - constructor(element: JQuery, options?: SplitButton.Model); - constructor(element: Element, options?: SplitButton.Model); + constructor(element: JQuery | Element, options?: SplitButton.Model); static Locale: any; - model:SplitButton.Model; - defaults:SplitButton.Model; + model: SplitButton.Model; + defaults: SplitButton.Model; /** Destroy the split button widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. * @returns {void} @@ -16342,7 +16289,7 @@ class SplitButton extends ej.Widget { */ show(): void; } -export module SplitButton{ +export namespace SplitButton { export interface Model { @@ -16422,31 +16369,31 @@ export interface Model { width?: string|number; /** Fires before menu of the split button control is opened. */ - beforeOpen? (e: BeforeOpenEventArgs): void; + beforeOpen?(e: BeforeOpenEventArgs): void; /** Fires when Button control is clicked successfully */ - click? (e: ClickEventArgs): void; + click?(e: ClickEventArgs): void; /** Fires before the list content of Button control is closed */ - close? (e: CloseEventArgs): void; + close?(e: CloseEventArgs): void; /** Fires after Split Button control is created. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when the Split Button is destroyed successfully */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires when a menu item is Hovered out successfully */ - itemMouseOut? (e: ItemMouseOutEventArgs): void; + itemMouseOut?(e: ItemMouseOutEventArgs): void; /** Fires when a menu item is Hovered in successfully */ - itemMouseOver? (e: ItemMouseOverEventArgs): void; + itemMouseOver?(e: ItemMouseOverEventArgs): void; /** Fires when a menu item is clicked successfully */ - itemSelected? (e: ItemSelectedEventArgs): void; + itemSelected?(e: ItemSelectedEventArgs): void; /** Fires before the list content of Button control is opened */ - open? (e: OpenEventArgs): void; + open?(e: OpenEventArgs): void; } export interface BeforeOpenEventArgs { @@ -16632,8 +16579,7 @@ export interface OpenEventArgs { type?: string; } } -enum ArrowPosition -{ +enum ArrowPosition { //To set Left arrowPosition of the split button Left, //To set Right arrowPosition of the split button @@ -16646,11 +16592,10 @@ Bottom, class Splitter extends ej.Widget { static fn: Splitter; - constructor(element: JQuery, options?: Splitter.Model); - constructor(element: Element, options?: Splitter.Model); + constructor(element: JQuery | Element, options?: Splitter.Model); static Locale: any; - model:Splitter.Model; - defaults:Splitter.Model; + model: Splitter.Model; + defaults: Splitter.Model; /** To add a new pane to splitter control. * @param {string} content of pane. @@ -16683,7 +16628,7 @@ class Splitter extends ej.Widget { */ removeItem(index: number): void; } -export module Splitter{ +export namespace Splitter { export interface Model { @@ -16735,7 +16680,7 @@ export interface Model { /** Specify properties for each pane like paneSize, minSize, maxSize, collapsible, expandable, resizable. * @Default {[]} */ - properties?: Array; + properties?: any[]; /** Specify width for splitter control. * @Default {null} @@ -16743,19 +16688,19 @@ export interface Model { width?: string; /** Fires before expanding / collapsing the split pane of splitter control. */ - beforeExpandCollapse? (e: BeforeExpandCollapseEventArgs): void; + beforeExpandCollapse?(e: BeforeExpandCollapseEventArgs): void; /** Fires when splitter control pane has been created. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when splitter control pane has been destroyed. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires when expand / collapse operation in splitter control pane has been performed successfully. */ - expandCollapse? (e: ExpandCollapseEventArgs): void; + expandCollapse?(e: ExpandCollapseEventArgs): void; /** Fires when resize in splitter control pane. */ - resize? (e: ResizeEventArgs): void; + resize?(e: ResizeEventArgs): void; } export interface BeforeExpandCollapseEventArgs { @@ -16872,11 +16817,10 @@ export interface ResizeEventArgs { class Tab extends ej.Widget { static fn: Tab; - constructor(element: JQuery, options?: Tab.Model); - constructor(element: Element, options?: Tab.Model); + constructor(element: JQuery | Element, options?: Tab.Model); static Locale: any; - model:Tab.Model; - defaults:Tab.Model; + model: Tab.Model; + defaults: Tab.Model; /** Add new tab items with given name, URL and given index position, if index null it’s add last item. * @param {string} URL name / tab id. @@ -16931,7 +16875,7 @@ class Tab extends ej.Widget { */ showItem(index: number): void; } -export module Tab{ +export namespace Tab { export interface Model { @@ -17016,7 +16960,7 @@ export interface Model { /** Specifies to hide a pane of Tab control. * @Default {[]} */ - hiddenItemIndex?: Array; + hiddenItemIndex?: any[]; /** Specifies the HTML Attributes of the Tab. * @Default {{}} @@ -17054,37 +16998,37 @@ export interface Model { width?: string|number; /** Triggered after a tab item activated. */ - itemActive? (e: ItemActiveEventArgs): void; + itemActive?(e: ItemActiveEventArgs): void; /** Triggered before AJAX content has been loaded. */ - ajaxBeforeLoad? (e: AjaxBeforeLoadEventArgs): void; + ajaxBeforeLoad?(e: AjaxBeforeLoadEventArgs): void; /** Triggered if error occurs in AJAX request. */ - ajaxError? (e: AjaxErrorEventArgs): void; + ajaxError?(e: AjaxErrorEventArgs): void; /** Triggered after AJAX content load action. */ - ajaxLoad? (e: AjaxLoadEventArgs): void; + ajaxLoad?(e: AjaxLoadEventArgs): void; /** Triggered after a tab item activated. */ - ajaxSuccess? (e: AjaxSuccessEventArgs): void; + ajaxSuccess?(e: AjaxSuccessEventArgs): void; /** Triggered before a tab item activated. */ - beforeActive? (e: BeforeActiveEventArgs): void; + beforeActive?(e: BeforeActiveEventArgs): void; /** Triggered before a tab item remove. */ - beforeItemRemove? (e: BeforeItemRemoveEventArgs): void; + beforeItemRemove?(e: BeforeItemRemoveEventArgs): void; /** Triggered before a tab item Create. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Triggered before a tab item destroy. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Triggered after new tab item add */ - itemAdd? (e: ItemAddEventArgs): void; + itemAdd?(e: ItemAddEventArgs): void; /** Triggered after tab item removed. */ - itemRemove? (e: ItemRemoveEventArgs): void; + itemRemove?(e: ItemRemoveEventArgs): void; } export interface ItemActiveEventArgs { @@ -17409,12 +17353,12 @@ export interface AjaxSettings { type?: string; } -enum Position{ +enum Position { ///Tab headers display to top position Top, - ///Tab headers display to bottom position + ///Tab headers display to bottom position Bottom, ///Tab headers display to left position. @@ -17425,7 +17369,7 @@ enum Position{ } -enum HeightAdjustMode{ +enum HeightAdjustMode { ///string None, @@ -17444,11 +17388,10 @@ enum HeightAdjustMode{ class TagCloud extends ej.Widget { static fn: TagCloud; - constructor(element: JQuery, options?: TagCloud.Model); - constructor(element: Element, options?: TagCloud.Model); + constructor(element: JQuery | Element, options?: TagCloud.Model); static Locale: any; - model:TagCloud.Model; - defaults:TagCloud.Model; + model: TagCloud.Model; + defaults: TagCloud.Model; /** Inserts a new item into the TagCloud * @param {string} Insert new item into the TagCloud @@ -17475,7 +17418,7 @@ class TagCloud extends ej.Widget { */ removeAt(position: number): void; } -export module TagCloud{ +export namespace TagCloud { export interface Model { @@ -17539,19 +17482,19 @@ export interface Model { titleText?: string; /** Event triggers when the TagCloud items are clicked */ - click? (e: ClickEventArgs): void; + click?(e: ClickEventArgs): void; /** Event triggers when the TagCloud are created */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Event triggers when the TagCloud are destroyed */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Event triggers when the cursor leaves out from a tag item */ - mouseout? (e: MouseoutEventArgs): void; + mouseout?(e: MouseoutEventArgs): void; /** Event triggers when the cursor hovers on a tag item */ - mouseover? (e: MouseoverEventArgs): void; + mouseover?(e: MouseoverEventArgs): void; } export interface ClickEventArgs { @@ -17672,8 +17615,7 @@ export interface Fields { url?: string; } } -enum Format -{ +enum Format { //To render the TagCloud items in cloud format Cloud, //To render the TagCloud items in list format @@ -17682,11 +17624,10 @@ List, class TimePicker extends ej.Widget { static fn: TimePicker; - constructor(element: JQuery, options?: TimePicker.Model); - constructor(element: Element, options?: TimePicker.Model); + constructor(element: JQuery | Element, options?: TimePicker.Model); static Locale: any; - model:TimePicker.Model; - defaults:TimePicker.Model; + model: TimePicker.Model; + defaults: TimePicker.Model; /** Allows you to disable the TimePicker. * @returns {void} @@ -17718,7 +17659,7 @@ class TimePicker extends ej.Widget { */ show(): void; } -export module TimePicker{ +export namespace TimePicker { export interface Model { @@ -17840,34 +17781,34 @@ export interface Model { width?: string|number; /** Fires when the time value changed in the TimePicker. */ - beforeChange? (e: BeforeChangeEventArgs): void; + beforeChange?(e: BeforeChangeEventArgs): void; /** Fires when the TimePicker popup before opened. */ - beforeOpen? (e: BeforeOpenEventArgs): void; + beforeOpen?(e: BeforeOpenEventArgs): void; /** Fires when the time value changed in the TimePicker. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Fires when the TimePicker popup closed. */ - close? (e: CloseEventArgs): void; + close?(e: CloseEventArgs): void; /** Fires when create TimePicker successfully. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when the TimePicker is destroyed successfully. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires when the TimePicker control gets focus. */ - focusIn? (e: FocusInEventArgs): void; + focusIn?(e: FocusInEventArgs): void; /** Fires when the TimePicker control get lost focus. */ - focusOut? (e: FocusOutEventArgs): void; + focusOut?(e: FocusOutEventArgs): void; /** Fires when the TimePicker popup opened. */ - open? (e: OpenEventArgs): void; + open?(e: OpenEventArgs): void; /** Fires when the value is selected from the TimePicker dropdown list. */ - select? (e: SelectEventArgs): void; + select?(e: SelectEventArgs): void; } export interface BeforeChangeEventArgs { @@ -18087,11 +18028,10 @@ export interface SelectEventArgs { class ToggleButton extends ej.Widget { static fn: ToggleButton; - constructor(element: JQuery, options?: ToggleButton.Model); - constructor(element: Element, options?: ToggleButton.Model); + constructor(element: JQuery | Element, options?: ToggleButton.Model); static Locale: any; - model:ToggleButton.Model; - defaults:ToggleButton.Model; + model: ToggleButton.Model; + defaults: ToggleButton.Model; /** Allows you to destroy the ToggleButton widget. * @returns {void} @@ -18108,7 +18048,7 @@ class ToggleButton extends ej.Widget { */ enable(): void; } -export module ToggleButton{ +export namespace ToggleButton { export interface Model { @@ -18208,16 +18148,16 @@ export interface Model { width?: number|string; /** Fires when ToggleButton control state is changed successfully. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Fires when ToggleButton control is clicked successfully. */ - click? (e: ClickEventArgs): void; + click?(e: ClickEventArgs): void; /** Fires when ToggleButton control is created successfully. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when ToggleButton control is destroyed successfully. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; } export interface ChangeEventArgs { @@ -18295,11 +18235,10 @@ export interface DestroyEventArgs { class Toolbar extends ej.Widget { static fn: Toolbar; - constructor(element: JQuery, options?: Toolbar.Model); - constructor(element: Element, options?: Toolbar.Model); + constructor(element: JQuery | Element, options?: Toolbar.Model); static Locale: any; - model:Toolbar.Model; - defaults:Toolbar.Model; + model: Toolbar.Model; + defaults: Toolbar.Model; /** Deselect the specified Toolbar item. * @param {any} The element need to be deselected @@ -18386,7 +18325,7 @@ class Toolbar extends ej.Widget { */ show(): void; } -export module Toolbar{ +export namespace Toolbar { export interface Model { @@ -18402,7 +18341,7 @@ export interface Model { /** Disables an Item or set of Items that are enabled in the Toolbar * @Default {[]} */ - disabledItemIndices?: Array; + disabledItemIndices?: any[]; /** Specifies the Toolbar control state. * @Default {true} @@ -18412,7 +18351,7 @@ export interface Model { /** Enables an Item or set of Items that are disabled in the Toolbar * @Default {[]} */ - enabledItemIndices?: Array; + enabledItemIndices?: any[]; /** Specifies enableRTL property to align the Toolbar control from right to left direction. * @Default {false} @@ -18479,28 +18418,28 @@ export interface Model { width?: number|string; /** Fires after Toolbar control is clicked. */ - click? (e: ClickEventArgs): void; + click?(e: ClickEventArgs): void; /** Fires after Toolbar control is created. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires after Toolbar control is focused. */ - focusOut? (e: FocusOutEventArgs): void; + focusOut?(e: FocusOutEventArgs): void; /** Fires when the Toolbar is destroyed successfully. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires after Toolbar control item is hovered. */ - itemHover? (e: ItemHoverEventArgs): void; + itemHover?(e: ItemHoverEventArgs): void; /** Fires after mouse leave from Toolbar control item. */ - itemLeave? (e: ItemLeaveEventArgs): void; + itemLeave?(e: ItemLeaveEventArgs): void; /** Fires when the overflow popup of toolbar is opened. */ - overflowOpen? (e: OverflowOpenEventArgs): void; + overflowOpen?(e: OverflowOpenEventArgs): void; /** Fires when the overflow popup of toolbar is closed. */ - overflowClose? (e: OverflowCloseEventArgs): void; + overflowClose?(e: OverflowCloseEventArgs): void; } export interface ClickEventArgs { @@ -18761,7 +18700,7 @@ export interface Items { template?: string; } -enum ResponsiveType{ +enum ResponsiveType { ///To display the toolbar overflow items as popup Popup, @@ -18774,11 +18713,10 @@ enum ResponsiveType{ class TreeView extends ej.Widget { static fn: TreeView; - constructor(element: JQuery, options?: TreeView.Model); - constructor(element: Element, options?: TreeView.Model); + constructor(element: JQuery | Element, options?: TreeView.Model); static Locale: any; - model:TreeView.Model; - defaults:TreeView.Model; + model: TreeView.Model; + defaults: TreeView.Model; /** To add a Node or collection of nodes in TreeView. If target tree node is specified, then the given nodes are added as child of target tree node, otherwise nodes are added in TreeView. * @param {string|any} New node text or JSON object @@ -18792,7 +18730,7 @@ class TreeView extends ej.Widget { * @param {string|any} ID of TreeView node/object of TreeView node * @returns {void} */ - addNodes(collection: any|Array, target: string|any): void; + addNodes(collection: any|any[], target: string|any): void; /** To check all the nodes in TreeView. * @returns {void} @@ -18803,7 +18741,7 @@ class TreeView extends ej.Widget { * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - checkNode(element: string|any|Array): void; + checkNode(element: string|any|any[]): void; /** This method is used to collapse all nodes in TreeView control. If you want to collapse all nodes up to the specific level in TreeView control then we need to pass levelUntil as argument to this method. * @param {number} TreeView nodes will collapse until the given level @@ -18816,19 +18754,19 @@ class TreeView extends ej.Widget { * @param {string|any|Array} ID of TreeView node|object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - collapseNode(element: string|any|Array): void; + collapseNode(element: string|any|any[]): void; /** To disable the node in the TreeView. * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - disableNode(element: string|any|Array): void; + disableNode(element: string|any|any[]): void; /** To enable the node in the TreeView. * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - enableNode(element: string|any|Array): void; + enableNode(element: string|any|any[]): void; /** To ensure that the TreeView node is visible in the TreeView. This method is useful if we need select a TreeView node dynamically. * @param {string|any} ID of TreeView node/object of TreeView node @@ -18847,7 +18785,7 @@ class TreeView extends ej.Widget { * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - expandNode(element: string|any|Array): void; + expandNode(element: string|any|any[]): void; /** To get currently checked nodes in TreeView. * @returns {any} @@ -18857,14 +18795,14 @@ class TreeView extends ej.Widget { /** To get currently checked nodes indexes in TreeView. * @returns {Array} */ - getCheckedNodesIndex(): Array; + getCheckedNodesIndex(): any[]; /** This method is used to get immediate child nodes of a node in TreeView control. If you want to get the all child nodes include nested child nodes then we need to pass includeNestedChild as true along with element arguments to this method. * @param {string|any} ID of TreeView node/object of TreeView node * @param {boolean} Weather include nested child nodes of TreeView node * @returns {Array} */ - getChildren(element: string|any, includeNestedChild?: boolean): Array; + getChildren(element: string|any, includeNestedChild?: boolean): any[]; /** To get number of nodes in TreeView. * @returns {number} @@ -18879,7 +18817,7 @@ class TreeView extends ej.Widget { /** To get currently expanded nodes indexes in TreeView. * @returns {Array} */ - getExpandedNodesIndex(): Array; + getExpandedNodesIndex(): any[]; /** To get TreeView node by using index position in TreeView. * @param {number} Index position of TreeView node @@ -18913,7 +18851,7 @@ class TreeView extends ej.Widget { /** To get the currently selected nodes in TreeView. * @returns {Array} */ - getSelectedNodes(): Array; + getSelectedNodes(): any[]; /** To get the index position of currently selected node in TreeView. * @returns {number} @@ -18923,7 +18861,7 @@ class TreeView extends ej.Widget { /** To get the index positions of currently selected nodes in TreeView. * @returns {Array} */ - getSelectedNodesIndex(): Array; + getSelectedNodesIndex(): any[]; /** To get the text of a node in TreeView. * @param {string|any} ID of TreeView node/object of TreeView node @@ -18935,7 +18873,7 @@ class TreeView extends ej.Widget { * @param {string|number} ID of TreeView node * @returns {Array} */ - getTreeData(id?: string|number): Array; + getTreeData(id?: string|number): any[]; /** To get currently visible nodes in TreeView. * @returns {any} @@ -18957,7 +18895,7 @@ class TreeView extends ej.Widget { * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - hideNode(element: string|any|Array): void; + hideNode(element: string|any|any[]): void; /** To add a Node or collection of nodes after the particular TreeView node. * @param {string|any} New node text or JSON object @@ -19044,7 +18982,7 @@ class TreeView extends ej.Widget { * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - removeNode(element: string|any|Array): void; + removeNode(element: string|any|any[]): void; /** To select all the TreeView nodes when enable allowMultiSelection property. * @returns {void} @@ -19055,7 +18993,7 @@ class TreeView extends ej.Widget { * @param {string|any|Array} ID of TreeView node/object of TreeView node/ collection of ID/object of TreeView nodes * @returns {void} */ - selectNode(element: string|any|Array): void; + selectNode(element: string|any|any[]): void; /** To show nodes in TreeView. * @returns {void} @@ -19066,7 +19004,7 @@ class TreeView extends ej.Widget { * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - showNode(element: string|any|Array): void; + showNode(element: string|any|any[]): void; /** To uncheck all the nodes in TreeView. * @returns {void} @@ -19077,7 +19015,7 @@ class TreeView extends ej.Widget { * @param {string|any|Array} ID of TreeView node/object of TreeView node/collection of ID/object of TreeView nodes * @returns {void} */ - uncheckNode(element: string|any|Array): void; + uncheckNode(element: string|any|any[]): void; /** To unselect all the TreeView nodes when enable allowMultiSelection property. * @returns {void} @@ -19088,7 +19026,7 @@ class TreeView extends ej.Widget { * @param {string|any|Array} ID of TreeView node/object of TreeView node/ collection of ID/object of TreeView nodes * @returns {void} */ - unselectNode(element: string|any|Array): void; + unselectNode(element: string|any|any[]): void; /** To edit or update the text of the TreeView node. * @param {string|any} ID of TreeView node/object of TreeView node @@ -19097,7 +19035,7 @@ class TreeView extends ej.Widget { */ updateText(target: string|any, newText: string): void; } -export module TreeView{ +export namespace TreeView { export interface Model { @@ -19149,7 +19087,7 @@ export interface Model { /** Gets or sets a value that indicates the checkedNodes index collection as an array. The given array index position denotes the nodes, that are checked while rendering TreeView. * @Default {[]} */ - checkedNodes?: Array; + checkedNodes?: any[]; /** Sets the root CSS class for TreeView which allow us to customize the appearance. */ @@ -19183,7 +19121,7 @@ export interface Model { /** Gets or sets a array of value that indicates the expandedNodes index collection as an array. The given array index position denotes the nodes, that are expanded while rendering TreeView. * @Default {[]} */ - expandedNodes?: Array; + expandedNodes?: any[]; /** Gets or sets a value that indicates the TreeView node can be expand or collapse by using the specified action. * @Default {dblclick} @@ -19223,7 +19161,7 @@ export interface Model { /** Gets or sets a value that indicates the selectedNodes index collection as an array. The given array index position denotes the nodes, that are selected while rendering TreeView. * @Default {[]} */ - selectedNodes?: Array; + selectedNodes?: any[]; /** Gets or sets a value that indicates whether to display or hide checkbox for all TreeView nodes. * @Default {false} @@ -19245,100 +19183,100 @@ export interface Model { width?: string|number; /** Fires before adding node to TreeView. */ - beforeAdd? (e: BeforeAddEventArgs): void; + beforeAdd?(e: BeforeAddEventArgs): void; /** Fires before collapse a node. */ - beforeCollapse? (e: BeforeCollapseEventArgs): void; + beforeCollapse?(e: BeforeCollapseEventArgs): void; /** Fires before cut node in TreeView. */ - beforeCut? (e: BeforeCutEventArgs): void; + beforeCut?(e: BeforeCutEventArgs): void; /** Fires before deleting node in TreeView. */ - beforeDelete? (e: BeforeDeleteEventArgs): void; + beforeDelete?(e: BeforeDeleteEventArgs): void; /** Fires before editing the node in TreeView. */ - beforeEdit? (e: BeforeEditEventArgs): void; + beforeEdit?(e: BeforeEditEventArgs): void; /** Fires before expanding the node. */ - beforeExpand? (e: BeforeExpandEventArgs): void; + beforeExpand?(e: BeforeExpandEventArgs): void; /** Fires before loading nodes to TreeView. */ - beforeLoad? (e: BeforeLoadEventArgs): void; + beforeLoad?(e: BeforeLoadEventArgs): void; /** Fires before paste node in TreeView. */ - beforePaste? (e: BeforePasteEventArgs): void; + beforePaste?(e: BeforePasteEventArgs): void; /** Fires before selecting node in TreeView. */ - beforeSelect? (e: BeforeSelectEventArgs): void; + beforeSelect?(e: BeforeSelectEventArgs): void; /** Fires when TreeView created successfully. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when TreeView destroyed successfully. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires before nodeEdit Successful. */ - inlineEditValidation? (e: InlineEditValidationEventArgs): void; + inlineEditValidation?(e: InlineEditValidationEventArgs): void; /** Fires when key pressed successfully. */ - keyPress? (e: KeyPressEventArgs): void; + keyPress?(e: KeyPressEventArgs): void; /** Fires when data load fails. */ - loadError? (e: LoadErrorEventArgs): void; + loadError?(e: LoadErrorEventArgs): void; /** Fires when data loaded successfully. */ - loadSuccess? (e: LoadSuccessEventArgs): void; + loadSuccess?(e: LoadSuccessEventArgs): void; /** Fires once node added successfully. */ - nodeAdd? (e: NodeAddEventArgs): void; + nodeAdd?(e: NodeAddEventArgs): void; /** Fires once node checked successfully. */ - nodeCheck? (e: NodeCheckEventArgs): void; + nodeCheck?(e: NodeCheckEventArgs): void; /** Fires when node clicked successfully. */ - nodeClick? (e: NodeClickEventArgs): void; + nodeClick?(e: NodeClickEventArgs): void; /** Fires when node collapsed successfully. */ - nodeCollapse? (e: NodeCollapseEventArgs): void; + nodeCollapse?(e: NodeCollapseEventArgs): void; /** Fires when node cut successfully. */ - nodeCut? (e: NodeCutEventArgs): void; + nodeCut?(e: NodeCutEventArgs): void; /** Fires when node deleted successfully. */ - nodeDelete? (e: NodeDeleteEventArgs): void; + nodeDelete?(e: NodeDeleteEventArgs): void; /** Fires when node dragging. */ - nodeDrag? (e: NodeDragEventArgs): void; + nodeDrag?(e: NodeDragEventArgs): void; /** Fires once node drag start successfully. */ - nodeDragStart? (e: NodeDragStartEventArgs): void; + nodeDragStart?(e: NodeDragStartEventArgs): void; /** Fires before the dragged node to be dropped. */ - nodeDragStop? (e: NodeDragStopEventArgs): void; + nodeDragStop?(e: NodeDragStopEventArgs): void; /** Fires once node dropped successfully. */ - nodeDropped? (e: NodeDroppedEventArgs): void; + nodeDropped?(e: NodeDroppedEventArgs): void; /** Fires once node edited successfully. */ - nodeEdit? (e: NodeEditEventArgs): void; + nodeEdit?(e: NodeEditEventArgs): void; /** Fires once node expanded successfully. */ - nodeExpand? (e: NodeExpandEventArgs): void; + nodeExpand?(e: NodeExpandEventArgs): void; /** Fires once node pasted successfully. */ - nodePaste? (e: NodePasteEventArgs): void; + nodePaste?(e: NodePasteEventArgs): void; /** Fires when node selected successfully. */ - nodeSelect? (e: NodeSelectEventArgs): void; + nodeSelect?(e: NodeSelectEventArgs): void; /** Fires once node unchecked successfully. */ - nodeUncheck? (e: NodeUncheckEventArgs): void; + nodeUncheck?(e: NodeUncheckEventArgs): void; /** Fires once node unselected successfully. */ - nodeUnselect? (e: NodeUnselectEventArgs): void; + nodeUnselect?(e: NodeUnselectEventArgs): void; /** Fires when TreeView nodes are loaded successfully */ - ready? (e: ReadyEventArgs): void; + ready?(e: ReadyEventArgs): void; } export interface BeforeAddEventArgs { @@ -19402,7 +19340,7 @@ export interface BeforeCollapseEventArgs { */ parentId?: string; - /** returns the format asynchronous or synchronous + /** returns the format asynchronous or synchronous */ async?: boolean; } @@ -19474,7 +19412,7 @@ export interface BeforeDeleteEventArgs { /** returns the currently removed nodes */ - removedNodes?: Array; + removedNodes?: any[]; } export interface BeforeEditEventArgs { @@ -19530,7 +19468,7 @@ export interface BeforeExpandEventArgs { */ parentId?: string; - /** returns the format asynchronous or synchronous + /** returns the format asynchronous or synchronous */ async?: boolean; } @@ -19829,11 +19767,11 @@ export interface NodeCheckEventArgs { /** it returns the currently checked node name */ - currentNode?: Array; + currentNode?: any[]; /** it returns the currently checked and its child node details */ - currentCheckedNodes?: Array; + currentCheckedNodes?: any[]; } export interface NodeClickEventArgs { @@ -19901,7 +19839,7 @@ export interface NodeCollapseEventArgs { */ isChildLoaded?: boolean; - /** returns the format asynchronous or synchronous + /** returns the format asynchronous or synchronous */ async?: boolean; } @@ -19965,7 +19903,7 @@ export interface NodeDeleteEventArgs { /** returns the currently removed nodes */ - removedNodes?: Array; + removedNodes?: any[]; } export interface NodeDragEventArgs { @@ -20205,7 +20143,7 @@ export interface NodeExpandEventArgs { */ parentId?: string; - /** returns the format asynchronous or synchronous + /** returns the format asynchronous or synchronous */ async?: boolean; } @@ -20265,7 +20203,7 @@ export interface NodeSelectEventArgs { /** returns the current selected nodes index of TreeView */ - selectedNodes?: Array; + selectedNodes?: any[]; /** returns the value of the node */ @@ -20320,7 +20258,7 @@ export interface NodeUncheckEventArgs { /** it returns currently unchecked node and its child node details. */ - currentUncheckedNodes?: Array; + currentUncheckedNodes?: any[]; } export interface NodeUnselectEventArgs { @@ -20347,7 +20285,7 @@ export interface NodeUnselectEventArgs { /** returns the current selected nodes index of TreeView */ - selectedNodes?: Array; + selectedNodes?: any[]; /** returns the name of the event */ @@ -20453,8 +20391,7 @@ export interface SortSettings { sortOrder?: ej.sortOrder|string; } } -enum sortOrder -{ +enum sortOrder { //Enum for Ascending sort order Ascending, //Enum for Descending sort order @@ -20463,11 +20400,10 @@ Descending, class Uploadbox extends ej.Widget { static fn: Uploadbox; - constructor(element: JQuery, options?: Uploadbox.Model); - constructor(element: Element, options?: Uploadbox.Model); + constructor(element: JQuery | Element, options?: Uploadbox.Model); static Locale: any; - model:Uploadbox.Model; - defaults:Uploadbox.Model; + model: Uploadbox.Model; + defaults: Uploadbox.Model; /** The destroy method destroys the control and brings the control to a pre-init state. All the events of the Upload control is bound by using this._on unbinds automatically. * @returns {void} @@ -20489,7 +20425,7 @@ class Uploadbox extends ej.Widget { */ refresh(): void; } -export module Uploadbox{ +export namespace Uploadbox { export interface Model { @@ -20633,37 +20569,37 @@ export interface Model { width?: string; /** Fires when the upload progress beforeSend. */ - beforeSend? (e: BeforeSendEventArgs): void; + beforeSend?(e: BeforeSendEventArgs): void; /** Fires when the upload progress begins. */ - begin? (e: BeginEventArgs): void; + begin?(e: BeginEventArgs): void; /** Fires when the upload progress is cancelled. */ - cancel? (e: CancelEventArgs): void; + cancel?(e: CancelEventArgs): void; /** Fires when the file upload progress is completed. */ - complete? (e: CompleteEventArgs): void; + complete?(e: CompleteEventArgs): void; /** Fires when the file upload progress is succeeded. */ - success? (e: SuccessEventArgs): void; + success?(e: SuccessEventArgs): void; /** Fires when the Uploadbox control is created. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when the Uploadbox control is destroyed. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires when the Upload process ends in Error. */ - error? (e: ErrorEventArgs): void; + error?(e: ErrorEventArgs): void; /** Fires when the file is selected for upload successfully. */ - fileSelect? (e: FileSelectEventArgs): void; + fileSelect?(e: FileSelectEventArgs): void; /** Fires when the file is uploading. */ - inProgress? (e: InProgressEventArgs): void; + inProgress?(e: InProgressEventArgs): void; /** Fires when the uploaded file is removed successfully. */ - remove? (e: RemoveEventArgs): void; + remove?(e: RemoveEventArgs): void; } export interface BeforeSendEventArgs { @@ -20966,11 +20902,10 @@ export interface DialogText { class WaitingPopup extends ej.Widget { static fn: WaitingPopup; - constructor(element: JQuery, options?: WaitingPopup.Model); - constructor(element: Element, options?: WaitingPopup.Model); + constructor(element: JQuery | Element, options?: WaitingPopup.Model); static Locale: any; - model:WaitingPopup.Model; - defaults:WaitingPopup.Model; + model: WaitingPopup.Model; + defaults: WaitingPopup.Model; /** To hide the waiting popup * @returns {void} @@ -20987,7 +20922,7 @@ class WaitingPopup extends ej.Widget { */ show(): void; } -export module WaitingPopup{ +export namespace WaitingPopup { export interface Model { @@ -21032,10 +20967,10 @@ export interface Model { text?: string; /** Fires after Create WaitingPopup successfully */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires after Destroy WaitingPopup successfully */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; } export interface CreateEventArgs { @@ -21071,29 +21006,28 @@ export interface DestroyEventArgs { class Grid extends ej.Widget { static fn: Grid; - constructor(element: JQuery, options?: Grid.Model); - constructor(element: Element, options?: Grid.Model); + constructor(element: JQuery | Element, options?: Grid.Model); static Locale: any; - model:Grid.Model; - defaults:Grid.Model; + model: Grid.Model; + defaults: Grid.Model; /** Adds a grid model property which is to be ignored upon exporting. - * @param {Array} Pass the array of parameters which need to be ignored on exporting + * @param {Array} Pass the array of parameters which need to be ignored on exporting * @returns {void} */ - addIgnoreOnExport(propertyNames: Array): void; + addIgnoreOnExport(propertyNames: any[]): void; /** Add a new record in grid control when allowAdding is set as true. * @returns {void} */ - addRecord(): void; + //addRecord(): void; /** Add a new record in grid control when allowAdding is set as true. * @param {Array} Pass the array of added Records * @param {Array} optionalIf we pass serverChange as true, send post to server side for server action. * @returns {void} */ - addRecord(data: Array, serverChange?: Array): void; + addRecord(data: any[], serverChange?: any[]): void; /** Cancel the modified changes in grid control when edit mode is "batch". * @returns {void} @@ -21118,20 +21052,20 @@ class Grid extends ej.Widget { /** It is used to clear all the cell selection. * @returns {Boolean} */ - clearCellSelection(): Boolean; + clearCellSelection(): boolean; /** It is used to clear specified cell selection based on the rowIndex and columnIndex provided. * @param {number} It is used to pass the row index of the cell * @param {number} It is used to pass the column index of the cell. * @returns {Boolean} */ - clearCellSelection(rowIndex: number, columnIndex: number): Boolean; + clearCellSelection(rowIndex: number, columnIndex: number): boolean; /** It is used to clear all the row selection or at specific row selection based on the index provided. * @param {number} optional If index of the column is specified then it will remove the selection from the particular column else it will clears all of the column selection * @returns {Boolean} */ - clearColumnSelection(index?: number): Boolean; + clearColumnSelection(index?: number): boolean; /** It is used to clear all the filtering done. * @param {string} If field of the column is specified then it will clear the particular filtering column @@ -21148,7 +21082,7 @@ class Grid extends ej.Widget { * @param {number} optional If index of the row is specified then it will remove the selection from the particular row else it will clears all of the row selection * @returns {Boolean} */ - clearSelection(index?: number): Boolean; + clearSelection(index?: number): boolean; /** Clear the sorting from columns in the grid * @returns {void} @@ -21170,21 +21104,21 @@ class Grid extends ej.Widget { * @param {string} optional Pass add/remove action to be performed. By default "add" action will perform * @returns {void} */ - columns(columnDetails: Array|string, action?: string): void; + columns(columnDetails: any[]|string, action?: string): void; /** Refresh the grid with new data source * @param {Array} Pass new data source to the grid * @param {boolean} optional When templateRefresh is set true, both header and contents get refreshed * @returns {void} */ - dataSource(datasource: Array, templateRefresh?: boolean): void; + dataSource(datasource: any[], templateRefresh?: boolean): void; /** Delete a record in grid control when allowDeleting is set as true * @param {string} Pass the primary key field Name of the column * @param {Array} Pass the JSON data of record need to be delete. * @returns {void} */ - deleteRecord(fieldName: string, data: Array): void; + deleteRecord(fieldName: string, data: any[]): void; /** Destroy the grid widget all events bound using this._on will be unbind automatically and bring the control to pre-init state. * @returns {void} @@ -21226,15 +21160,7 @@ class Grid extends ej.Widget { * @param {Array} optionalPass the array of the gridIds to be filtered * @returns {void} */ - export(action: string, serverEvent?: string, multipleExport?: boolean, gridIds?: Array): void; - - /** Export the grid content to excel, word or PDF document. - * @param {string} Pass the controller action name corresponding to exporting - * @param {string} optionalASP server event name corresponding to exporting - * @param {boolean} optionalPass the multiple exporting value as true/false - * @returns {void} - */ - export(action: string, serverEvent?: string, multipleExport?: boolean): void; + export(action: string, serverEvent?: string, multipleExport?: boolean, gridIds?: any[]): void; /** Send a filtering request to filter one column in grid. * @param {Array} Pass the field name of the column @@ -21245,13 +21171,13 @@ class Grid extends ej.Widget { * @param {any} optionalactualFilterValue denote the filter object of current filtered columns.Pass the value to filtered in a column * @returns {void} */ - filterColumn(fieldName: Array, filterOperator: string, filterValue: string, predicate: string, matchcase?: boolean, actualFilterValue?: any): void; + filterColumn(fieldName: any[], filterOperator: string, filterValue: string, predicate: string, matchcase?: boolean, actualFilterValue?: any): void; /** Send a filtering request to filter single or multiple column in grid. * @param {Array} Pass array of filterColumn query for performing filter operation * @returns {void} */ - filterColumn(filterQueries: Array): void; + filterColumn(filterQueries: any[]): void; /** Get the batch changes of edit, delete and add operations of grid. * @returns {any} @@ -21284,7 +21210,7 @@ class Grid extends ej.Widget { /** Get the list of field names from column collection in grid. * @returns {Array} */ - getColumnFieldNames(): Array; + getColumnFieldNames(): any[]; /** Get the column index of the given field in grid. * @param {string} Pass the field name of the column to get the corresponding column index @@ -21300,7 +21226,7 @@ class Grid extends ej.Widget { /** Get the content table element of grid * @returns {Array} */ - getContentTable(): Array; + getContentTable(): HTMLTableElement[]; /** Get the data of currently edited cell value in "batch" edit mode * @returns {any} @@ -21315,13 +21241,13 @@ class Grid extends ej.Widget { /** Get the current page data source of grid. * @returns {Array} */ - getCurrentViewData(): Array; + getCurrentViewData(): any[]; /** Get the column field name from the given header text in grid. * @param {string} Pass header text of the column to get its corresponding field name * @returns {String} */ - getFieldNameByHeaderText(headerText: string): String; + getFieldNameByHeaderText(headerText: string): string; /** Get the filter bar of grid * @returns {HTMLElement} @@ -21331,7 +21257,7 @@ class Grid extends ej.Widget { /** Get the records filtered or searched in Grid * @returns {Array} */ - getFilteredRecords(): Array; + getFilteredRecords(): any[]; /** Get the footer content of grid. * @returns {HTMLElement} @@ -21357,12 +21283,12 @@ class Grid extends ej.Widget { * @param {string} Pass field name of the column to get its corresponding header text * @returns {String} */ - getHeaderTextByFieldName(field: string): String; + getHeaderTextByFieldName(field: string): string; /** Get the names of all the hidden column collections in grid. * @returns {Array} */ - getHiddenColumnNames(): Array; + getHiddenColumnNames(): any[]; /** Get the row index based on the given tr element in grid. * @param {JQuery} Pass the tr element in grid content to get its row index @@ -21378,7 +21304,7 @@ class Grid extends ej.Widget { /** Get the names of primary key columns in Grid * @returns {Array} */ - getPrimaryKeyFieldNames(): Array; + getPrimaryKeyFieldNames(): any[]; /** Get the rows(tr element) from the given from and to row index in grid * @param {number} Pass the from index from which the rows to be returned @@ -21405,19 +21331,19 @@ class Grid extends ej.Widget { /** Get the selected records details in grid. * @returns {Array} */ - getSelectedRecords(): Array; + getSelectedRecords(): any[]; /** Get the calculated summary values of JSON data passed to it * @param {any} Pass Summary Column details * @param {any} Pass JSON Array for which its field values to be calculated * @returns {Number} */ - getSummaryValues(summaryCol: any, summaryData: any): Number; + getSummaryValues(summaryCol: any, summaryData: any): number; /** Get the names of all the visible column collections in grid * @returns {Array} */ - getVisibleColumnNames(): Array; + getVisibleColumnNames(): any[]; /** Send a paging request to specified page in grid * @param {number} Pass the page index to perform paging at specified page index @@ -21435,7 +21361,7 @@ class Grid extends ej.Widget { * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to hide * @returns {void} */ - hideColumns(headerText: Array|string): void; + hideColumns(headerText: any[]|string): void; /** Print the grid control * @returns {void} @@ -21472,7 +21398,7 @@ class Grid extends ej.Widget { * @param {Array|string} Pass array of field names of the columns to remove a collection of sorted columns or pass a string of field name to remove a column from sorted column collections * @returns {void} */ - removeSortedColumns(fieldName: Array|string): void; + removeSortedColumns(fieldName: any[]|string): void; /** Creates a grid control * @returns {void} @@ -21506,10 +21432,10 @@ class Grid extends ej.Widget { /** Save the particular edited cell in grid. * @returns {void} */ - saveCell(): void; + //saveCell(): void; /** We can prevent the client side cellSave event triggering by passing the preventSaveEvent argument as true. - * @param {boolean} optionalIf we pass preventSaveEvent as true, it prevents the client side cellSave event triggering + * @param {boolean} optionalIf we pass preventSaveEvent as true, it prevents the client side cellSave event triggering * @returns {void} */ saveCell(preventSaveEvent: boolean): void; @@ -21549,7 +21475,7 @@ class Grid extends ej.Widget { * @param {number} optionalIt is used to set the ending index of column for selecting columns. * @returns {Boolean} */ - selectColumns(columnIndex: number, toIndex?: number): Boolean; + selectColumns(columnIndex: number, toIndex?: number): boolean; /** Select rows in grid. * @param {number} It is used to set the starting index of row for selecting rows. @@ -21564,13 +21490,13 @@ class Grid extends ej.Widget { * @param {any} optionalTarget element which is clicked. * @returns {void} */ - selectRows(from: Array|number, to: number, target?: any): void; + selectRows(from: any[]|number, to: number, target?: any): void; /** Select rows in grid. * @param {Array} Pass array of rowIndexes for selecting rows * @returns {void} */ - selectRows(rowIndexes: Array): void; + selectRows(rowIndexes: any[]): void; /** Used to update a particular cell value. * @returns {void} @@ -21602,7 +21528,7 @@ class Grid extends ej.Widget { * @param {Array|string} you can pass either array of header text of various columns or a header text of a column to show * @returns {void} */ - showColumns(headerText: Array|string): void; + showColumns(headerText: any[]|string): void; /** Send a sorting request in grid. * @param {string} Pass the field name of the column as columnName for which sorting have to be performed @@ -21628,100 +21554,100 @@ class Grid extends ej.Widget { * @param {Array} Pass the edited JSON data of record need to be update. * @returns {void} */ - updateRecord(fieldName: string, data: Array): void; + updateRecord(fieldName: string, data: any[]): void; /** It adapts grid to its parent element or to the browsers window. * @returns {void} */ windowonresize(): void; } -export module Grid{ +export namespace Grid { export interface Model { /** Gets or sets a value that indicates whether to customizing cell based on our needs. * @Default {false} */ - allowCellMerging?: Boolean; + allowCellMerging?: boolean; /** Gets or sets a value that indicates whether to enable dynamic grouping behavior. Grouping can be done by drag on drop desired columns to grid’s GroupDropArea. This can be further customized through “groupSettings†property. * @Default {false} */ - allowGrouping?: Boolean; + allowGrouping?: boolean; /** Gets or sets a value that indicates whether to enable keyboard support for performing grid actions. selectionType – Gets or sets a value that indicates whether to enable single row or multiple rows selection behavior in grid. Multiple selection can be done through by holding CTRL and clicking the grid rows * @Default {true} */ - allowKeyboardNavigation?: Boolean; + allowKeyboardNavigation?: boolean; /** Gets or sets a value that indicates whether to enable dynamic filtering behavior on grid. Filtering can be used to limit the records displayed using required criteria and this can be further customized through “filterSettings†property * @Default {false} */ - allowFiltering?: Boolean; + allowFiltering?: boolean; /** Gets or sets a value that indicates whether to enable the dynamic sorting behavior on grid data. Sorting can be done through clicking on particular column header. * @Default {false} */ - allowSorting?: Boolean; + allowSorting?: boolean; /** Gets or sets a value that indicates whether to enable multi columns sorting behavior in grid. Sort multiple columns by holding CTRL and click on the corresponding column header. * @Default {false} */ - allowMultiSorting?: Boolean; + allowMultiSorting?: boolean; /** This specifies the grid to show the paginated data. Also enables pager control at the bottom of grid for dynamic navigation through data source. Paging can be further customized through “pageSettings†property. * @Default {false} */ - allowPaging?: Boolean; + allowPaging?: boolean; /** Gets or sets a value that indicates whether to enable the columns reordering behavior in the grid. Reordering can be done through by drag and drop the particular column from one index to another index within the grid. * @Default {false} */ - allowReordering?: Boolean; + allowReordering?: boolean; /** Gets or sets a value that indicates whether the column is non resizable. Column width is set automatically based on the content or header text which is large. * @Default {false} */ - allowResizeToFit?: Boolean; + allowResizeToFit?: boolean; /** Gets or sets a value that indicates whether to enable dynamic resizable of columns. Resize the width of the columns by simply click and move the particular column header line * @Default {false} */ - allowResizing?: Boolean; + allowResizing?: boolean; /** Gets or sets a value that indicates whether to enable the rows reordering in Grid and drag & drop rows between multiple Grid. * @Default {false} */ - allowRowDragAndDrop?: Boolean; + allowRowDragAndDrop?: boolean; /** Gets or sets a value that indicates whether to enable the scrollbar in the grid and view the records by scroll through the grid manually * @Default {false} */ - allowScrolling?: Boolean; + allowScrolling?: boolean; /** Gets or sets a value that indicates whether to enable dynamic searching behavior in grid. Currently search box can be enabled through “toolbarSettings†* @Default {false} */ - allowSearching?: Boolean; + allowSearching?: boolean; /** Gets or sets a value that indicates whether user can select rows on grid. On enabling feature, selected row will be highlighted. * @Default {true} */ - allowSelection?: Boolean; + allowSelection?: boolean; /** Gets or sets a value that indicates whether the Content will wrap to the next line if the content exceeds the boundary of the Column Cells. * @Default {false} */ - allowTextWrap?: Boolean; + allowTextWrap?: boolean; /** Gets or sets a value that indicates whether to enable the multiple exporting behavior on grid data. * @Default {false} */ - allowMultipleExporting?: Boolean; + allowMultipleExporting?: boolean; /** Gets or sets a value that indicates to define common width for all the columns in the grid. */ - commonWidth?: Number; + commonWidth?: number; /** Gets or sets a value that indicates to enable the visibility of the grid lines. * @Default {ej.Grid.GridLines.Both} @@ -21741,7 +21667,7 @@ export interface Model { /** Gets or sets an object that indicates to render the grid with specified columns * @Default {[]} */ - columns?: Array; + columns?: Column[]; /** Gets or sets an object that indicates whether to customize the context menu behavior of the grid. */ @@ -21749,7 +21675,7 @@ export interface Model { /** Gets or sets a value that indicates to render the grid with custom theme. */ - cssClass?: String; + cssClass?: string; /** Gets or sets the data to render the grid with records * @Default {null} @@ -21759,7 +21685,7 @@ export interface Model { /** Default Value: * @Default {null} */ - detailsTemplate?: String; + detailsTemplate?: string; /** Gets or sets an object that indicates whether to customize the editing behavior of the grid. */ @@ -21768,42 +21694,42 @@ export interface Model { /** Gets or sets a value that indicates whether to enable the alternative rows differentiation in the grid records based on corresponding theme. * @Default {true} */ - enableAltRow?: Boolean; + enableAltRow?: boolean; /** Gets or sets a value that indicates whether to enable the save action in the grid through row selection * @Default {true} */ - enableAutoSaveOnSelectionChange?: Boolean; + enableAutoSaveOnSelectionChange?: boolean; /** Gets or sets a value that indicates whether to enable mouse over effect on the corresponding column header cell of the grid * @Default {false} */ - enableHeaderHover?: Boolean; + enableHeaderHover?: boolean; /** Gets or sets a value that indicates whether to persist the grid model state in page using applicable medium i.e., HTML5 localStorage or cookies * @Default {false} */ - enablePersistence?: Boolean; + enablePersistence?: boolean; /** Gets or sets a value that indicates whether the grid rows has to be rendered as detail view in mobile mode * @Default {false} */ - enableResponsiveRow?: Boolean; + enableResponsiveRow?: boolean; /** Gets or sets a value that indicates whether to enable mouse over effect on corresponding grid row. * @Default {true} */ - enableRowHover?: Boolean; + enableRowHover?: boolean; /** Align content in the grid control from right to left by setting the property as true. * @Default {false} */ - enableRTL?: Boolean; + enableRTL?: boolean; /** To Disable the mouse swipe property as false. * @Default {true} */ - enableTouch?: Boolean; + enableTouch?: boolean; /** Act as mapper for the excel exporting URL. * @Default {ExportToExcel} @@ -21831,7 +21757,7 @@ export interface Model { /** Gets or sets a value that indicates whether the grid design has be to made responsive. * @Default {false} */ - isResponsive?: Boolean; + isResponsive?: boolean; /** This specifies to change the key in keyboard interaction to grid control * @Default {null} @@ -21841,12 +21767,12 @@ export interface Model { /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. * @Default {en-US} */ - locale?: String; + locale?: string; /** Gets or sets a value that indicates whether to set the minimum width of the responsive grid while isResponsive property is true and enableResponsiveRow property is set as false. * @Default {0} */ - minWidth?: Number; + minWidth?: number; /** Gets or sets an object that indicates whether to modify the pager default configuration. */ @@ -21864,7 +21790,7 @@ export interface Model { /** Gets or sets a value that indicates to render the grid with template rows. The template row must be a table row. That table row must have the JavaScript render binding format ({{:columnName}}) then the grid data source binds the data to the corresponding table row of the template. * @Default {null} */ - rowTemplate?: String; + rowTemplate?: string; /** Gets or sets an object that indicates whether to customize the drag and drop behavior of the grid rows */ @@ -21877,17 +21803,17 @@ export interface Model { /** Gets a value that indicates whether the grid model to hold multiple selected records . selectedRecords can be used to displayed hold the single or multiple selected records using “selectedRecords†property * @Default {null} */ - selectedRecords?: Array; + selectedRecords?: any[]; /** Gets or sets a value that indicates to select the row while initializing the grid * @Default {-1} */ - selectedRowIndex?: Number; + selectedRowIndex?: number; /** Gets or sets a value that indicates the selected rows in grid * @Default {[]} */ - selectedRowIndices?: Array; + selectedRowIndices?: any[]; /** This property is used to configure the selection behavior of the grid. */ @@ -21905,17 +21831,17 @@ export interface Model { /** Default Value: * @Default {false} */ - showColumnChooser?: Boolean; + showColumnChooser?: boolean; /** Gets or sets a value that indicates stacked header should be shown on grid layout when the property “stackedHeaderRows†is set. * @Default {false} */ - showStackedHeader?: Boolean; + showStackedHeader?: boolean; /** Gets or sets a value that indicates summary rows should be shown on grid layout when the property “summaryRows†is set * @Default {false} */ - showSummary?: Boolean; + showSummary?: boolean; /** Gets or sets a value that indicates whether to customize the sorting behavior of the grid. */ @@ -21924,12 +21850,12 @@ export interface Model { /** Gets or sets an object that indicates to managing the collection of stacked header rows for the grid. * @Default {[]} */ - stackedHeaderRows?: Array; + stackedHeaderRows?: StackedHeaderRow[]; /** Gets or sets an object that indicates to managing the collection of summary rows for the grid. * @Default {[]} */ - summaryRows?: Array; + summaryRows?: SummaryRow[]; /** Gets or sets an object that indicates whether to auto wrap the grid header or content or both */ @@ -21940,160 +21866,160 @@ export interface Model { toolbarSettings?: ToolbarSettings; /** Triggered for every grid action before its starts. */ - actionBegin? (e: ActionBeginEventArgs): void; + actionBegin?(e: ActionBeginEventArgs): void; /** Triggered for every grid action success event. */ - actionComplete? (e: ActionCompleteEventArgs): void; + actionComplete?(e: ActionCompleteEventArgs): void; /** Triggered for every grid action server failure event. */ - actionFailure? (e: ActionFailureEventArgs): void; + actionFailure?(e: ActionFailureEventArgs): void; /** Triggered when record batch add. */ - batchAdd? (e: BatchAddEventArgs): void; + batchAdd?(e: BatchAddEventArgs): void; /** Triggered when record batch delete. */ - batchDelete? (e: BatchDeleteEventArgs): void; + batchDelete?(e: BatchDeleteEventArgs): void; /** Triggered before the batch add. */ - beforeBatchAdd? (e: BeforeBatchAddEventArgs): void; + beforeBatchAdd?(e: BeforeBatchAddEventArgs): void; /** Triggered before the batch delete. */ - beforeBatchDelete? (e: BeforeBatchDeleteEventArgs): void; + beforeBatchDelete?(e: BeforeBatchDeleteEventArgs): void; /** Triggered before the batch save. */ - beforeBatchSave? (e: BeforeBatchSaveEventArgs): void; + beforeBatchSave?(e: BeforeBatchSaveEventArgs): void; /** Triggered before the record is going to be edited. */ - beginEdit? (e: BeginEditEventArgs): void; + beginEdit?(e: BeginEditEventArgs): void; /** Triggered when record cell edit. */ - cellEdit? (e: CellEditEventArgs): void; + cellEdit?(e: CellEditEventArgs): void; /** Triggered when record cell save. */ - cellSave? (e: CellSaveEventArgs): void; + cellSave?(e: CellSaveEventArgs): void; /** Triggered after the cell is selected. */ - cellSelected? (e: CellSelectedEventArgs): void; + cellSelected?(e: CellSelectedEventArgs): void; /** Triggered before the cell is going to be selected. */ - cellSelecting? (e: CellSelectingEventArgs): void; + cellSelecting?(e: CellSelectingEventArgs): void; /** Triggered after the cell is deselected. */ - cellDeselected? (e: CellDeselectedEventArgs): void; + cellDeselected?(e: CellDeselectedEventArgs): void; /** Triggered before the cell is going to be deselected. */ - cellDeselecting? (e: CellDeselectingEventArgs): void; + cellDeselecting?(e: CellDeselectingEventArgs): void; /** Triggered when the column is being dragged. */ - columnDrag? (e: ColumnDragEventArgs): void; + columnDrag?(e: ColumnDragEventArgs): void; /** Triggered when column dragging begins. */ - columnDragStart? (e: ColumnDragStartEventArgs): void; + columnDragStart?(e: ColumnDragStartEventArgs): void; /** Triggered when the column is dropped. */ - columnDrop? (e: ColumnDropEventArgs): void; + columnDrop?(e: ColumnDropEventArgs): void; /** Triggered when the row is being dragged. */ - rowDrag? (e: RowDragEventArgs): void; + rowDrag?(e: RowDragEventArgs): void; /** Triggered when row dragging begins. */ - rowDragStart? (e: RowDragStartEventArgs): void; + rowDragStart?(e: RowDragStartEventArgs): void; /** Triggered when the row is dropped. */ - rowDrop? (e: RowDropEventArgs): void; + rowDrop?(e: RowDropEventArgs): void; /** Triggered after the column is selected. */ - columnSelected? (e: ColumnSelectedEventArgs): void; + columnSelected?(e: ColumnSelectedEventArgs): void; /** Triggered before the column is going to be selected. */ - columnSelecting? (e: ColumnSelectingEventArgs): void; + columnSelecting?(e: ColumnSelectingEventArgs): void; /** Triggered after the column is deselected. */ - columnDeselected? (e: ColumnDeselectedEventArgs): void; + columnDeselected?(e: ColumnDeselectedEventArgs): void; /** Triggered before the column is going to be deselected. */ - columnDeselecting? (e: ColumnDeselectingEventArgs): void; + columnDeselecting?(e: ColumnDeselectingEventArgs): void; /** Triggered when context menu item is clicked */ - contextClick? (e: ContextClickEventArgs): void; + contextClick?(e: ContextClickEventArgs): void; /** Triggered before the context menu is opened. */ - contextOpen? (e: ContextOpenEventArgs): void; + contextOpen?(e: ContextOpenEventArgs): void; /** Triggered when the grid is rendered completely. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Triggered when the grid is bound with data during initial rendering. */ - dataBound? (e: DataBoundEventArgs): void; + dataBound?(e: DataBoundEventArgs): void; /** Triggered when grid going to destroy. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Triggered when detail template row is clicked to collapse. */ - detailsCollapse? (e: DetailsCollapseEventArgs): void; + detailsCollapse?(e: DetailsCollapseEventArgs): void; /** Triggered detail template row is initialized. */ - detailsDataBound? (e: DetailsDataBoundEventArgs): void; + detailsDataBound?(e: DetailsDataBoundEventArgs): void; /** Triggered when detail template row is clicked to expand. */ - detailsExpand? (e: DetailsExpandEventArgs): void; + detailsExpand?(e: DetailsExpandEventArgs): void; /** Triggered after the record is added. */ - endAdd? (e: EndAddEventArgs): void; + endAdd?(e: EndAddEventArgs): void; /** Triggered after the record is deleted. */ - endDelete? (e: EndDeleteEventArgs): void; + endDelete?(e: EndDeleteEventArgs): void; /** Triggered after the record is edited. */ - endEdit? (e: EndEditEventArgs): void; + endEdit?(e: EndEditEventArgs): void; /** Triggered initial load. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Triggered every time a request is made to access particular cell information, element and data. */ - mergeCellInfo? (e: MergeCellInfoEventArgs): void; + mergeCellInfo?(e: MergeCellInfoEventArgs): void; /** Triggered every time a request is made to access particular cell information, element and data. */ - queryCellInfo? (e: QueryCellInfoEventArgs): void; + queryCellInfo?(e: QueryCellInfoEventArgs): void; /** Triggered when record is clicked. */ - recordClick? (e: RecordClickEventArgs): void; + recordClick?(e: RecordClickEventArgs): void; /** Triggered when record is double clicked. */ - recordDoubleClick? (e: RecordDoubleClickEventArgs): void; + recordDoubleClick?(e: RecordDoubleClickEventArgs): void; /** Triggered after column resized. */ - resized? (e: ResizedEventArgs): void; + resized?(e: ResizedEventArgs): void; /** Triggered when column resize end. */ - resizeEnd? (e: ResizeEndEventArgs): void; + resizeEnd?(e: ResizeEndEventArgs): void; /** Triggered when column resize start. */ - resizeStart? (e: ResizeStartEventArgs): void; + resizeStart?(e: ResizeStartEventArgs): void; /** Triggered when right clicked on grid element. */ - rightClick? (e: RightClickEventArgs): void; + rightClick?(e: RightClickEventArgs): void; /** Triggered every time a request is made to access row information, element and data. */ - rowDataBound? (e: RowDataBoundEventArgs): void; + rowDataBound?(e: RowDataBoundEventArgs): void; /** Triggered after the row is selected. */ - rowSelected? (e: RowSelectedEventArgs): void; + rowSelected?(e: RowSelectedEventArgs): void; /** Triggered before the row is going to be selected. */ - rowSelecting? (e: RowSelectingEventArgs): void; + rowSelecting?(e: RowSelectingEventArgs): void; /** Triggered after the row is deselected. */ - rowDeselected? (e: RowDeselectedEventArgs): void; + rowDeselected?(e: RowDeselectedEventArgs): void; /** Triggered before the row is going to be deselected. */ - rowDeselecting? (e: RowDeselectingEventArgs): void; + rowDeselecting?(e: RowDeselectingEventArgs): void; /** Triggered when refresh the template column elements in the Grid. */ - templateRefresh? (e: TemplateRefreshEventArgs): void; + templateRefresh?(e: TemplateRefreshEventArgs): void; /** Triggered when toolbar item is clicked in grid. */ - toolbarClick? (e: ToolbarClickEventArgs): void; + toolbarClick?(e: ToolbarClickEventArgs): void; } export interface ActionBeginEventArgs { @@ -22705,7 +22631,7 @@ export interface CellSelectedEventArgs { /** Returns the selected row cell index values. */ - selectedRowCellIndex?: Array; + selectedRowCellIndex?: any[]; /** Returns the cancel option value. */ @@ -23011,7 +22937,7 @@ export interface ColumnSelectedEventArgs { /** Returns the selected columns values. */ - selectedColumnsIndex?: Array; + selectedColumnsIndex?: any[]; /** Returns the cancel option value. */ @@ -23391,15 +23317,15 @@ export interface MergeCellInfoEventArgs { /** Method to merge Grid rows. */ - rowMerge?: void; + rowMerge?: any; /** Method to merge Grid columns. */ - colMerge?: void; + colMerge?: any; /** Method to merge Grid rows and columns. */ - merge?: void; + merge?: any; /** Returns the grid model. */ @@ -23937,36 +23863,36 @@ export interface Column { /** Gets or sets a value that indicates whether to enable editing behavior for particular column. * @Default {true} */ - allowEditing?: Boolean; + allowEditing?: boolean; /** Gets or sets a value that indicates whether to enable dynamic filtering behavior for particular column. * @Default {true} */ - allowFiltering?: Boolean; + allowFiltering?: boolean; /** Gets or sets a value that indicates whether to enable dynamic grouping behavior for particular column. * @Default {true} */ - allowGrouping?: Boolean; + allowGrouping?: boolean; /** Gets or sets a value that indicates whether to enable dynamic sorting behavior for particular column. * @Default {true} */ - allowSorting?: Boolean; + allowSorting?: boolean; /** Gets or sets a value that indicates whether to enable dynamic resizable for particular column. * @Default {true} */ - allowResizing?: Boolean; + allowResizing?: boolean; /** Gets or sets an object that indicates to define a command column in the grid. * @Default {[]} */ - commands?: Array; + commands?: ColumnsCommand[]; /** Gets or sets a value that indicates to provide custom CSS for an individual column. */ - cssClass?: String; + cssClass?: string; /** Gets or sets a value that indicates the attribute values to the td element of a particular column */ @@ -23975,21 +23901,21 @@ export interface Column { /** Gets or sets a value that indicates to bind the external datasource to the particular column when column editType as dropdownedit and also it is used to bind the datasource to the foreign key column while editing the grid. //Where data is array of JSON objects of text and value for the drop-down and array of JSON objects for foreign key column. * @Default {null} */ - dataSource?: Array; + dataSource?: any[]; /** Gets or sets a value that indicates to display the specified default value while adding a new record to the grid */ - defaultValue?: String|Number|Boolean|Date; + defaultValue?: string|number|boolean|Date; /** Gets or sets a value that indicates to render the grid content and header with an HTML elements * @Default {false} */ - disableHtmlEncode?: Boolean; + disableHtmlEncode?: boolean; /** Gets or sets a value that indicates to display a column value as checkbox or string * @Default {true} */ - displayAsCheckBox?: Boolean; + displayAsCheckBox?: boolean; /** Gets or sets a value that indicates to customize ejNumericTextbox of an editable column. See editingType */ @@ -24008,11 +23934,11 @@ export interface Column { /** Gets or sets a value that indicates to groups the column based on its column format. * @Default {false} */ - enableGroupByFormat?: Boolean; + enableGroupByFormat?: boolean; /** Gets or sets a value that indicates to display the columns in the grid mapping with column name of the dataSource. */ - field?: String; + field?: string; /** Gets or sets a template that customize the filter control from default . See filterBarTemplate * @Default {null} @@ -24022,25 +23948,25 @@ export interface Column { /** Gets or sets a value that indicates to define foreign key field name of the grid datasource. * @Default {null} */ - foreignKeyField?: String; + foreignKeyField?: string; /** Gets or sets a value that indicates to bind the field which is in foreign column datasource based on the foreignKeyField * @Default {null} */ - foreignKeyValue?: String; + foreignKeyValue?: string; /** Gets or sets a value that indicates the format for the text applied on the column */ - format?: String; + format?: string; /** Gets or sets a value that indicates to add the template within the header element of the particular column. * @Default {null} */ - headerTemplateID?: String; + headerTemplateID?: string; /** Gets or sets a value that indicates to display the title of that particular column. */ - headerText?: String; + headerText?: string; /** This defines the text alignment of a particular column header cell value. See headerTextAlign * @Default {null} @@ -24050,37 +23976,37 @@ export interface Column { /** You can use this property to freeze selected columns in grid at the time of scrolling. * @Default {false} */ - isFrozen?: Boolean; + isFrozen?: boolean; /** Gets or sets a value that indicates the column has an identity in the database. * @Default {false} */ - isIdentity?: Boolean; + isIdentity?: boolean; /** Gets or sets a value that indicates the column is act as a primary key(read-only) of the grid. The editing is performed based on the primary key column * @Default {false} */ - isPrimaryKey?: Boolean; + isPrimaryKey?: boolean; /** Gets or sets a value that indicates the order of Column that are to be hidden or visible when Grid element is in responsive mode and could not occupy all columns. * @Default {null} */ - priority?: Number; + priority?: number; /** Used to hide the particular column in column chooser by giving value as false. * @Default {true} */ - showInColumnChooser?: Boolean; + showInColumnChooser?: boolean; /** Gets or sets a value that indicates whether to enables column template for a particular column. * @Default {false} */ - template?: Boolean|String; + template?: boolean|string; /** Gets or sets a value that indicates to align the text within the column. See textAlign * @Default {ej.TextAlign.Left} */ - textAlign?: ej.TextAlign|string; + textAlign?: ej.TextAlign|string; /** Sets the template for Tooltip in Grid Columns(both header and content) */ @@ -24088,7 +24014,7 @@ export interface Column { /** Gets or sets a value that indicates to specify the data type of the specified columns. */ - type?: String; + type?: string; /** Gets or sets a value that indicates to define constraints for saving data to the database. */ @@ -24097,11 +24023,11 @@ export interface Column { /** Gets or sets a value that indicates whether this column is visible in the grid. * @Default {true} */ - visible?: Boolean; + visible?: boolean; /** Gets or sets a value that indicates to define the width for a particular column in the grid. */ - width?: Number; + width?: number; } export interface ContextMenuSettingsSubContextMenu { @@ -24114,7 +24040,7 @@ export interface ContextMenuSettingsSubContextMenu { /** Used to get or set the sub menu items to the custom context menu item. * @Default {[]} */ - subMenu?: Array; + subMenu?: any[]; } export interface ContextMenuSettings { @@ -24122,26 +24048,26 @@ export interface ContextMenuSettings { /** Gets or sets a value that indicates whether to add the default context menu actions as a context menu items If enableContextMenu is true it will show all the items related to the target, if you want selected items from contextmenu you have to mention in the contextMenuItems * @Default {[]} */ - contextMenuItems?: Array; + contextMenuItems?: any[]; /** Gets or sets a value that indicates whether to add custom contextMenu items within the toolbar to perform any action in the grid * @Default {[]} */ - customContextMenuItems?: Array; + customContextMenuItems?: any[]; /** Gets or sets a value that indicates whether to enable the context menu action in the grid. * @Default {false} */ - enableContextMenu?: Boolean; + enableContextMenu?: boolean; /** Used to get or set the subMenu to the corresponding custom context menu item. */ - subContextMenu?: Array; + subContextMenu?: ContextMenuSettingsSubContextMenu[]; /** Gets or sets a value that indicates whether to disable the default context menu items in the grid. * @Default {false} */ - disableDefaultItems?: Boolean; + disableDefaultItems?: boolean; } export interface EditSettings { @@ -24149,27 +24075,27 @@ export interface EditSettings { /** Gets or sets a value that indicates whether to enable insert action in the editing mode. * @Default {false} */ - allowAdding?: Boolean; + allowAdding?: boolean; /** Gets or sets a value that indicates whether to enable the delete action in the editing mode. * @Default {false} */ - allowDeleting?: Boolean; + allowDeleting?: boolean; /** Gets or sets a value that indicates whether to enable the edit action in the editing mode. * @Default {false} */ - allowEditing?: Boolean; + allowEditing?: boolean; /** Gets or sets a value that indicates whether to enable the editing action while double click on the record * @Default {true} */ - allowEditOnDblClick?: Boolean; + allowEditOnDblClick?: boolean; /** This specifies the id of the template. This template can be used to display the data that you require to be edited using the Dialog Box * @Default {null} */ - dialogEditorTemplateID?: String; + dialogEditorTemplateID?: string; /** Gets or sets a value that indicates whether to define the mode of editing See editMode * @Default {ej.Grid.EditMode.Normal} @@ -24179,7 +24105,7 @@ export interface EditSettings { /** This specifies the id of the template. This template can be used to display the data that you require to be edited using the External edit form * @Default {null} */ - externalFormTemplateID?: String; + externalFormTemplateID?: string; /** This specifies to set the position of an External edit form either in the top-right or bottom-left of the grid * @Default {ej.Grid.FormPosition.BottomLeft} @@ -24189,7 +24115,7 @@ export interface EditSettings { /** This specifies the id of the template. This template can be used to display the data that you require to be edited using the Inline edit form * @Default {null} */ - inlineFormTemplateID?: String; + inlineFormTemplateID?: string; /** This specifies to set the position of an adding new row either in the top or bottom of the grid * @Default {ej.Grid.RowPosition.Top} @@ -24199,22 +24125,22 @@ export interface EditSettings { /** Gets or sets a value that indicates whether the confirm dialog has to be shown while saving or discarding the batch changes * @Default {true} */ - showConfirmDialog?: Boolean; + showConfirmDialog?: boolean; /** Gets or sets a value that indicates whether the confirm dialog has to be shown while deleting record * @Default {false} */ - showDeleteConfirmDialog?: Boolean; + showDeleteConfirmDialog?: boolean; /** Gets or sets a value that indicates whether the title for edit form is different from the primarykey column. * @Default {null} */ - titleColumn?: String; + titleColumn?: string; /** Gets or sets a value that indicates whether to display the add new form by default in the grid. * @Default {false} */ - showAddNewRow?: Boolean; + showAddNewRow?: boolean; } export interface FilterSettingsFilteredColumn { @@ -24241,7 +24167,7 @@ export interface FilterSettings { /** Gets or sets a value that indicates to perform the filter operation with case sensitive in excel styled filter menu mode * @Default {false} */ - enableCaseSensitivity?: Boolean; + enableCaseSensitivity?: boolean; /** This specifies the grid to starts the filter action while typing in the filterBar or after pressing the enter key. based on the filterBarMode. See filterBarMode * @Default {ej.Grid.FilterBarMode.Immediate} @@ -24251,7 +24177,7 @@ export interface FilterSettings { /** Gets or sets a value that indicates whether to define the filtered columns details programmatically at initial load * @Default {[]} */ - filteredColumns?: Array; + filteredColumns?: FilterSettingsFilteredColumn[]; /** This specifies the grid to show the filterBar or filterMenu to the grid records. See filterType * @Default {ej.Grid.FilterType.FilterBar} @@ -24261,17 +24187,17 @@ export interface FilterSettings { /** Gets or sets a value that indicates the maximum number of filter choices that can be showed in the excel styled filter menu. * @Default {1000} */ - maxFilterChoices?: Number; + maxFilterChoices?: number; /** This specifies the grid to show the filter text within the grid pager itself. * @Default {true} */ - showFilterBarMessage?: Boolean; + showFilterBarMessage?: boolean; /** Gets or sets a value that indicates whether to enable the predicate options in the filtering menu * @Default {false} */ - showPredicate?: Boolean; + showPredicate?: boolean; } export interface GroupSettings { @@ -24279,37 +24205,37 @@ export interface GroupSettings { /** Gets or sets a value that customize the group caption format. * @Default {null} */ - captionFormat?: String; + captionFormat?: string; /** Gets or sets a value that indicates whether to enable animation button option in the group drop area of the grid. * @Default {false} */ - enableDropAreaAutoSizing?: Boolean; + enableDropAreaAutoSizing?: boolean; /** Gets or sets a value that indicates whether to add grouped columns programmatically at initial load * @Default {[]} */ - groupedColumns?: Array; + groupedColumns?: any[]; /** Gets or sets a value that indicates whether to show the group drop area just above the column header. It can be used to avoid ungrouping the already grouped column using groupSettings. * @Default {true} */ - showDropArea?: Boolean; + showDropArea?: boolean; /** Gets or sets a value that indicates whether to hide the grouped columns from the grid * @Default {false} */ - showGroupedColumn?: Boolean; + showGroupedColumn?: boolean; /** Gets or sets a value that indicates whether to show the group button image(toggle button)in the column header and also in the grouped column in the group drop area . It can be used to group/ungroup the columns by click on the toggle button. * @Default {false} */ - showToggleButton?: Boolean; + showToggleButton?: boolean; /** Gets or sets a value that indicates whether to enable the close button in the grouped column which is in the group drop area to ungroup the grouped column * @Default {false} */ - showUngroupButton?: Boolean; + showUngroupButton?: boolean; } export interface PageSettings { @@ -24317,47 +24243,47 @@ export interface PageSettings { /** Gets or sets a value that indicates whether to define which page to display currently in the grid * @Default {1} */ - currentPage?: Number; + currentPage?: number; /** Gets or sets a value that indicates whether to pass the current page information as a query string along with the URL while navigating to other page. * @Default {false} */ - enableQueryString?: Boolean; + enableQueryString?: boolean; /** Gets or sets a value that indicates whether to enables pager template for the grid. * @Default {false} */ - enableTemplates?: Boolean; + enableTemplates?: boolean; /** Gets or sets a value that indicates whether to define the number of pages displayed in the pager for navigation * @Default {8} */ - pageCount?: Number; + pageCount?: number; /** Gets or sets a value that indicates whether to define the number of records displayed per page * @Default {12} */ - pageSize?: Number; + pageSize?: number; /** Gets or sets a value that indicates whether to enables default pager for the grid. * @Default {false} */ - showDefaults?: Boolean; + showDefaults?: boolean; /** Gets or sets a value that indicates to add the template as a pager template for grid. * @Default {null} */ - template?: String; + template?: string; /** Get the value of total number of pages in the grid. The totalPages value is calculated based on page size and total records of grid * @Default {null} */ - totalPages?: Number; + totalPages?: number; /** Get the value of total number of records which is bound to the grid. The totalRecordsCount value is calculated based on dataSource bound to the grid. * @Default {null} */ - totalRecordsCount?: Number; + totalRecordsCount?: number; /** Gets or sets a value that indicates whether to define the number of pages to print * @Default {ej.Grid.PrintMode.AllPages} @@ -24418,12 +24344,12 @@ export interface SelectionSettings { /** Gets or sets a value that indicates whether to enable the toggle selection behavior for row, cell and column. * @Default {false} */ - enableToggle?: Boolean; + enableToggle?: boolean; /** Gets or sets a value that indicates whether to add the default selection actions as a selection mode.See selectionMode * @Default {[row]} */ - selectionMode?: Array; + selectionMode?: any[]; } export interface ScrollSettings { @@ -24431,27 +24357,27 @@ export interface ScrollSettings { /** This specify the grid to to view data that you require without buffering the entire load of a huge database * @Default {false} */ - allowVirtualScrolling?: Boolean; + allowVirtualScrolling?: boolean; /** This specify the grid to enable/disable touch control for scrolling. * @Default {true} */ - enableTouchScroll?: Boolean; + enableTouchScroll?: boolean; /** This specify the grid to freeze particular columns at the time of scrolling. * @Default {0} */ - frozenColumns?: Number; + frozenColumns?: number; /** This specify the grid to freeze particular rows at the time of scrolling. * @Default {0} */ - frozenRows?: Number; + frozenRows?: number; /** This specify the grid to show the vertical scroll bar, to scroll and view the grid contents. * @Default {0} */ - height?: String|Number; + height?: string|number; /** This is used to define the mode of virtual scrolling in grid. See virtualScrollMode * @Default {ej.Grid.VirtualScrollMode.Normal} @@ -24461,35 +24387,35 @@ export interface ScrollSettings { /** This is used to enable the enhanced virtual scrolling in Grid. * @Default {false} */ - enableVirtualization?: Boolean; + enableVirtualization?: boolean; /** This specify the grid to show the horizontal scroll bar, to scroll and view the grid contents * @Default {250} */ - width?: String|Number; + width?: string|number; /** This specify the scroll down pixel of mouse wheel, to scroll mouse wheel and view the grid contents. * @Default {57} */ - scrollOneStepBy?: Number; + scrollOneStepBy?: number; } export interface SortSettingsSortedColumn { /** Gets or sets a value that indicates whether to define the direction to sort the column. */ - direction?: String; + direction?: string; /** Gets or sets a value that indicates whether to define the field name of the column to be sort */ - field?: String; + field?: string; } export interface SortSettings { /** Gets or sets a value that indicates whether to define the direction and field to sort the column. */ - sortedColumns?: Array; + sortedColumns?: SortSettingsSortedColumn[]; } export interface StackedHeaderRowsStackedHeaderColumn { @@ -24502,17 +24428,17 @@ export interface StackedHeaderRowsStackedHeaderColumn { /** Gets or sets a value that indicates class to the corresponding stackedHeaderColumn. * @Default {null} */ - cssClass?: String; + cssClass?: string; /** Gets or sets a value that indicates the header text for the particular stacked header column. * @Default {null} */ - headerText?: String; + headerText?: string; /** Gets or sets a value that indicates the text alignment of the corresponding headerText. * @Default {ej.TextAlign.Left} */ - textAlign?: String; + textAlign?: string; } export interface StackedHeaderRow { @@ -24520,7 +24446,7 @@ export interface StackedHeaderRow { /** Gets or sets a value that indicates whether to add stacked header columns into the stacked header rows * @Default {[]} */ - stackedHeaderColumns?: Array; + stackedHeaderColumns?: StackedHeaderRowsStackedHeaderColumn[]; } export interface SummaryRowsSummaryColumn { @@ -24528,32 +24454,32 @@ export interface SummaryRowsSummaryColumn { /** Gets or sets a value that indicates the text displayed in the summary column as a value * @Default {null} */ - customSummaryValue?: String; + customSummaryValue?: string; /** This specifies summary column used to perform the summary calculation * @Default {null} */ - dataMember?: String; + dataMember?: string; /** Gets or sets a value that indicates to define the target column at which to display the summary. * @Default {null} */ - displayColumn?: String; + displayColumn?: string; /** Gets or sets a value that indicates the format for the text applied on the column * @Default {null} */ - format?: String; + format?: string; /** Gets or sets a value that indicates the text displayed before the summary column value * @Default {null} */ - prefix?: String; + prefix?: string; /** Gets or sets a value that indicates the text displayed after the summary column value * @Default {null} */ - suffix?: String; + suffix?: string; /** Gets or sets a value that indicates the type of calculations to be performed for the corresponding summary column * @Default {[]} @@ -24563,7 +24489,7 @@ export interface SummaryRowsSummaryColumn { /** Gets or sets a value that indicates to add the template for the summary value of dataMember given. * @Default {null} */ - template?: String; + template?: string; } export interface SummaryRow { @@ -24571,31 +24497,31 @@ export interface SummaryRow { /** Gets or sets a value that indicates whether to show the summary value within the group caption area for the corresponding summary column while grouping the column * @Default {false} */ - showCaptionSummary?: Boolean; + showCaptionSummary?: boolean; /** Gets or sets a value that indicates whether to show the group summary value for the corresponding summary column while grouping a column * @Default {false} */ - showGroupSummary?: Boolean; + showGroupSummary?: boolean; /** Gets or sets a value that indicates whether to show the total summary value the for the corresponding summary column. The summary row is added after the grid content. * @Default {true} */ - showTotalSummary?: Boolean; + showTotalSummary?: boolean; /** Gets or sets a value that indicates whether to add summary columns into the summary rows. * @Default {[]} */ - summaryColumns?: Array; + summaryColumns?: SummaryRowsSummaryColumn[]; /** This specifies the grid to show the title for the summary rows. */ - title?: String; + title?: string; /** This specifies the grid to show the title of summary row in the specified column. * @Default {null} */ - titleColumn?: String; + titleColumn?: string; } export interface TextWrapSettings { @@ -24611,12 +24537,12 @@ export interface ToolbarSettings { /** Gets or sets a value that indicates whether to add custom toolbar items within the toolbar to perform any action in the grid * @Default {[]} */ - customToolbarItems?: Array; + customToolbarItems?: any[]; /** Gets or sets a value that indicates whether to enable toolbar in the grid. * @Default {false} */ - showToolbar?: Boolean; + showToolbar?: boolean; /** Gets or sets a value that indicates whether to add the default editing actions as a toolbar items * @Default {[]} @@ -24624,7 +24550,7 @@ export interface ToolbarSettings { toolbarItems?: Array; } -enum GridLines{ +enum GridLines { ///Displays both the horizontal and vertical grid lines. Both, @@ -24640,7 +24566,7 @@ enum GridLines{ } -enum ClipMode{ +enum ClipMode { ///Shows ellipsis for the overflown cell. Ellipsis, @@ -24653,7 +24579,7 @@ enum ClipMode{ } -enum ColumnLayout{ +enum ColumnLayout { ///Column layout is auto(based on width). Auto, @@ -24663,7 +24589,7 @@ enum ColumnLayout{ } -enum UnboundType{ +enum UnboundType { ///Unbound type is edit. Edit, @@ -24679,7 +24605,7 @@ enum UnboundType{ } -enum EditingType{ +enum EditingType { ///Specifies editing type as string edit. String, @@ -24701,7 +24627,7 @@ enum EditingType{ } -enum EditMode{ +enum EditMode { ///Edit mode is normal. Normal, @@ -24729,7 +24655,7 @@ enum EditMode{ } -enum FormPosition{ +enum FormPosition { ///Form position is bottomleft. BottomLeft, @@ -24739,7 +24665,7 @@ enum FormPosition{ } -enum RowPosition{ +enum RowPosition { ///Specifies position of add new row as top. Top, @@ -24749,7 +24675,7 @@ enum RowPosition{ } -enum FilterBarMode{ +enum FilterBarMode { ///Initiate filter operation on typing the filter query. Immediate, @@ -24759,7 +24685,7 @@ enum FilterBarMode{ } -enum FilterType{ +enum FilterType { ///Specifies the filter type as menu. Menu, @@ -24772,7 +24698,7 @@ enum FilterType{ } -enum PrintMode{ +enum PrintMode { ///Prints all pages. AllPages, @@ -24782,7 +24708,7 @@ enum PrintMode{ } -enum ResizeMode{ +enum ResizeMode { ///New column size will be adjusted by all other Columns Normal, @@ -24795,7 +24721,7 @@ enum ResizeMode{ } -enum SelectionType{ +enum SelectionType { ///Specifies the selection type as single. Single, @@ -24805,7 +24731,7 @@ enum SelectionType{ } -enum VirtualScrollMode{ +enum VirtualScrollMode { ///virtual scroll mode is normal. Normal, @@ -24815,7 +24741,7 @@ enum VirtualScrollMode{ } -enum SummaryType{ +enum SummaryType { ///Summary type is average. Average, @@ -24843,7 +24769,7 @@ enum SummaryType{ } -enum WrapMode{ +enum WrapMode { ///Auto wrap is applied for both content and header. Both, @@ -24856,7 +24782,7 @@ enum WrapMode{ } -enum ToolBarItems{ +enum ToolBarItems { ///Toolbar item is add. Add, @@ -24890,18 +24816,17 @@ enum ToolBarItems{ class Sparkline extends ej.Widget { static fn: Sparkline; - constructor(element: JQuery, options?: Sparkline.Model); - constructor(element: Element, options?: Sparkline.Model); + constructor(element: JQuery | Element, options?: Sparkline.Model); static Locale: any; - model:Sparkline.Model; - defaults:Sparkline.Model; + model: Sparkline.Model; + defaults: Sparkline.Model; /** Redraws the entire sparkline. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. * @returns {void} */ redraw(): void; } -export module Sparkline{ +export namespace Sparkline { export interface Model { @@ -25024,28 +24949,28 @@ export interface Model { axisLineSettings?: AxisLineSettings; /** Fires before loading the sparkline. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Fires after loaded the sparkline. */ - loaded? (e: LoadedEventArgs): void; + loaded?(e: LoadedEventArgs): void; /** Fires before rendering trackball tooltip. You can use this event to customize the text displayed in trackball tooltip. */ - tooltipInitialize? (e: TooltipInitializeEventArgs): void; + tooltipInitialize?(e: TooltipInitializeEventArgs): void; /** Fires before rendering a series. This event is fired for each series in Sparkline. */ - seriesRendering? (e: SeriesRenderingEventArgs): void; + seriesRendering?(e: SeriesRenderingEventArgs): void; /** Fires when mouse is moved over a point. */ - pointRegionMouseMove? (e: PointRegionMouseMoveEventArgs): void; + pointRegionMouseMove?(e: PointRegionMouseMoveEventArgs): void; /** Fires on clicking a point in sparkline. You can use this event to handle clicks made on points. */ - pointRegionMouseClick? (e: PointRegionMouseClickEventArgs): void; + pointRegionMouseClick?(e: PointRegionMouseClickEventArgs): void; /** Fires on moving mouse over the sparkline. */ - sparklineMouseMove? (e: SparklineMouseMoveEventArgs): void; + sparklineMouseMove?(e: SparklineMouseMoveEventArgs): void; /** Fires on moving mouse outside the sparkline. */ - sparklineMouseLeave? (e: SparklineMouseLeaveEventArgs): void; + sparklineMouseLeave?(e: SparklineMouseLeaveEventArgs): void; } export interface LoadEventArgs { @@ -25080,7 +25005,7 @@ export interface LoadedEventArgs { export interface TooltipInitializeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -25204,7 +25129,7 @@ export interface PointRegionMouseClickEventArgs { export interface SparklineMouseMoveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -25219,7 +25144,7 @@ export interface SparklineMouseMoveEventArgs { export interface SparklineMouseLeaveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -25420,10 +25345,8 @@ export interface AxisLineSettings { dashArray?: number; } } -module Sparkline -{ -enum Type -{ +namespace Sparkline { +enum Type { //string Area, //string @@ -25436,10 +25359,8 @@ Pie, WinLoss, } } -module Sparkline -{ -enum Theme -{ +namespace Sparkline { +enum Theme { //string Azure, //string @@ -25462,20 +25383,16 @@ GradientLight, GradientDark, } } -module Sparkline -{ -enum FontStyle -{ +namespace Sparkline { +enum FontStyle { //string Normal, //string Italic, } } -module Sparkline -{ -enum FontWeight -{ +namespace Sparkline { +enum FontWeight { //string Regular, //string @@ -25487,11 +25404,10 @@ Lighter, class SunburstChart extends ej.Widget { static fn: SunburstChart; - constructor(element: JQuery, options?: SunburstChart.Model); - constructor(element: Element, options?: SunburstChart.Model); + constructor(element: JQuery | Element, options?: SunburstChart.Model); static Locale: any; - model:SunburstChart.Model; - defaults:SunburstChart.Model; + model: SunburstChart.Model; + defaults: SunburstChart.Model; /** Redraws the entire sunburst. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. * @returns {void} @@ -25503,7 +25419,7 @@ class SunburstChart extends ej.Widget { */ _destroy(): void; } -export module SunburstChart{ +export namespace SunburstChart { export interface Model { @@ -25611,7 +25527,7 @@ export interface Model { /** Specify levels of sunburst for grouped visualization of data * @Default {[]} */ - levels?: Array; + levels?: Level[]; /** Options to customize the legend items and legend title. */ @@ -25646,40 +25562,40 @@ export interface Model { animationType?: ej.datavisualization.Sunburst.Animation|string; /** Fires before loading. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Fires before rendering sunburst. */ - preRender? (e: PreRenderEventArgs): void; + preRender?(e: PreRenderEventArgs): void; /** Fires after rendering sunburst. */ - loaded? (e: LoadedEventArgs): void; + loaded?(e: LoadedEventArgs): void; /** Fires before rendering the datalabel */ - dataLabelRendering? (e: DataLabelRenderingEventArgs): void; + dataLabelRendering?(e: DataLabelRenderingEventArgs): void; /** Fires before rendering each segment */ - segmentRendering? (e: SegmentRenderingEventArgs): void; + segmentRendering?(e: SegmentRenderingEventArgs): void; /** Fires before rendering sunburst title. */ - titleRendering? (e: TitleRenderingEventArgs): void; + titleRendering?(e: TitleRenderingEventArgs): void; /** Fires during initialization of tooltip. */ - tooltipInitialize? (e: TooltipInitializeEventArgs): void; + tooltipInitialize?(e: TooltipInitializeEventArgs): void; /** Fires after clicking the point in sunburst */ - pointRegionClick? (e: PointRegionClickEventArgs): void; + pointRegionClick?(e: PointRegionClickEventArgs): void; /** Fires while moving the mouse over sunburst points */ - pointRegionMousemove? (e: PointRegionMousemoveEventArgs): void; + pointRegionMousemove?(e: PointRegionMousemoveEventArgs): void; /** Fires when clicking the point to perform drilldown. */ - drillDownClick? (e: DrillDownClickEventArgs): void; + drillDownClick?(e: DrillDownClickEventArgs): void; /** Fires when resetting drilldown points. */ - drillDownBack? (e: DrillDownBackEventArgs): void; + drillDownBack?(e: DrillDownBackEventArgs): void; /** Fires after resetting the sunburst points */ - drillDownReset? (e: DrillDownResetEventArgs): void; + drillDownReset?(e: DrillDownResetEventArgs): void; } export interface LoadEventArgs { @@ -26502,20 +26418,16 @@ export interface ZoomSettings { toolbarVerticalAlignment?: ej.datavisualization.Sunburst.SunburstVerticalAlignment|string; } } -module Sunburst -{ -enum FontStyle -{ +namespace Sunburst { +enum FontStyle { //string Normal, //string Italic, } } -module Sunburst -{ -enum FontWeight -{ +namespace Sunburst { +enum FontWeight { //string Regular, //string @@ -26524,20 +26436,16 @@ Bold, Lighter, } } -module Sunburst -{ -enum SunburstLabelRotationMode -{ +namespace Sunburst { +enum SunburstLabelRotationMode { //string Angle, //string Normal, } } -module Sunburst -{ -enum SunburstLabelOverflowMode -{ +namespace Sunburst { +enum SunburstLabelOverflowMode { //string Trim, //string @@ -26546,10 +26454,8 @@ Hide, None, } } -module Sunburst -{ -enum SunburstAlignment -{ +namespace Sunburst { +enum SunburstAlignment { //string Center, //string @@ -26558,10 +26464,8 @@ Near, Far, } } -module Sunburst -{ -enum SunburstHighlightMode -{ +namespace Sunburst { +enum SunburstHighlightMode { //string Point, //string @@ -26572,20 +26476,16 @@ Child, All, } } -module Sunburst -{ -enum SunburstHighlightType -{ +namespace Sunburst { +enum SunburstHighlightType { //string Opacity, //string Color, } } -module Sunburst -{ -enum SunburstClickAction -{ +namespace Sunburst { +enum SunburstClickAction { //string None, //string @@ -26594,10 +26494,8 @@ ToggleSegmentVisibility, ToggleSegmentSelection, } } -module Sunburst -{ -enum SunburstLegendPosition -{ +namespace Sunburst { +enum SunburstLegendPosition { //string Left, //string @@ -26608,10 +26506,8 @@ Top, Bottom, } } -module Sunburst -{ -enum SunburstLegendShape -{ +namespace Sunburst { +enum SunburstLegendShape { //string Diamond, //string @@ -26626,20 +26522,16 @@ Cross, Triangle, } } -module Sunburst -{ -enum SunburstTheme -{ +namespace Sunburst { +enum SunburstTheme { //string FlatLight, //string FlatDark, } } -module Sunburst -{ -enum SunburstHorizontalAlignment -{ +namespace Sunburst { +enum SunburstHorizontalAlignment { //string Center, //string @@ -26648,10 +26540,8 @@ Left, Right, } } -module Sunburst -{ -enum SunburstVerticalAlignment -{ +namespace Sunburst { +enum SunburstVerticalAlignment { //string Top, //string @@ -26660,10 +26550,8 @@ Bottom, Middle, } } -module Sunburst -{ -enum Animation -{ +namespace Sunburst { +enum Animation { //string Rotation, //string @@ -26673,11 +26561,10 @@ FadeIn, class PivotGrid extends ej.Widget { static fn: PivotGrid; - constructor(element: JQuery, options?: PivotGrid.Model); - constructor(element: Element, options?: PivotGrid.Model); + constructor(element: JQuery | Element, options?: PivotGrid.Model); static Locale: any; - model:PivotGrid.Model; - defaults:PivotGrid.Model; + model: PivotGrid.Model; + defaults: PivotGrid.Model; /** Performs an asynchronous HTTP (AJAX) request. * @returns {void} @@ -26747,7 +26634,7 @@ class PivotGrid extends ej.Widget { /** Returns the JSON records formed to render the control. * @returns {Array} */ - getJSONRecords(): Array; + getJSONRecords(): any[]; /** Sets the JSON records formed to render the control. * @returns {void} @@ -26764,7 +26651,7 @@ class PivotGrid extends ej.Widget { */ renderControlFromJSON(): void; } -export module PivotGrid{ +export namespace PivotGrid { export interface Model { @@ -26948,64 +26835,64 @@ export interface Model { url?: string; /** Triggers when it reaches client-side after any AJAX request. */ - afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + afterServiceInvoke?(e: AfterServiceInvokeEventArgs): void; /** Triggers before any AJAX request is passed from PivotGrid to service methods. */ - beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; /** Triggers before Pivot Engine starts to populate. */ - beforePivotEnginePopulate? (e: BeforePivotEnginePopulateEventArgs): void; + beforePivotEnginePopulate?(e: BeforePivotEnginePopulateEventArgs): void; /** Triggers when double click action is performed over a cell. */ - cellDoubleClick? (e: CellDoubleClickEventArgs): void; + cellDoubleClick?(e: CellDoubleClickEventArgs): void; /** Triggers when right-click action is performed on a cell. */ - cellContext? (e: CellContextEventArgs): void; + cellContext?(e: CellContextEventArgs): void; /** Triggers when a specific range of value cells are selected. */ - cellSelection? (e: CellSelectionEventArgs): void; + cellSelection?(e: CellSelectionEventArgs): void; /** Triggers when the hyperlink of column header is clicked. */ - columnHeaderHyperlinkClick? (e: ColumnHeaderHyperlinkClickEventArgs): void; + columnHeaderHyperlinkClick?(e: ColumnHeaderHyperlinkClickEventArgs): void; /** Triggers after performing drill operation in PivotGrid. */ - drillSuccess? (e: DrillSuccessEventArgs): void; + drillSuccess?(e: DrillSuccessEventArgs): void; /** Triggers while clicking "OK" button in the drill-through dialog. */ - drillThrough? (e: DrillThroughEventArgs): void; + drillThrough?(e: DrillThroughEventArgs): void; /** Triggers when PivotGrid loading is initiated. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Triggers when PivotGrid widget completes all operations at client-side after any AJAX request. */ - renderComplete? (e: RenderCompleteEventArgs): void; + renderComplete?(e: RenderCompleteEventArgs): void; /** Triggers when any error occurred during AJAX request. */ - renderFailure? (e: RenderFailureEventArgs): void; + renderFailure?(e: RenderFailureEventArgs): void; /** Triggers when PivotGrid successfully reaches client-side after any AJAX request. */ - renderSuccess? (e: RenderSuccessEventArgs): void; + renderSuccess?(e: RenderSuccessEventArgs): void; /** Triggers when the hyperlink of row header is clicked. */ - rowHeaderHyperlinkClick? (e: RowHeaderHyperlinkClickEventArgs): void; + rowHeaderHyperlinkClick?(e: RowHeaderHyperlinkClickEventArgs): void; /** Triggers when the hyperlink of summary cell is clicked. */ - summaryCellHyperlinkClick? (e: SummaryCellHyperlinkClickEventArgs): void; + summaryCellHyperlinkClick?(e: SummaryCellHyperlinkClickEventArgs): void; /** Triggers when the hyperlink of value cell is clicked. */ - valueCellHyperlinkClick? (e: ValueCellHyperlinkClickEventArgs): void; + valueCellHyperlinkClick?(e: ValueCellHyperlinkClickEventArgs): void; /** Triggers before saving the current report to database. */ - saveReport? (e: SaveReportEventArgs): void; + saveReport?(e: SaveReportEventArgs): void; /** Triggers before loading a report from database. */ - loadReport? (e: LoadReportEventArgs): void; + loadReport?(e: LoadReportEventArgs): void; /** Triggers before performing exporting in pivot grid. */ - beforeExport? (e: BeforeExportEventArgs): void; + beforeExport?(e: BeforeExportEventArgs): void; /** Triggers before editing the cells. */ - cellEdit? (e: CellEditEventArgs): void; + cellEdit?(e: CellEditEventArgs): void; } export interface AfterServiceInvokeEventArgs { @@ -27049,7 +26936,7 @@ export interface CellDoubleClickEventArgs { /** returns the JSON details of the double clicked cell. */ - selectedData?: Array; + selectedData?: any[]; /** returns the custom object bound with PivotGrid control. */ @@ -27281,7 +27168,7 @@ export interface CellEditEventArgs { /** contains the array of cells selected for editing. */ - editCellsInfo?: Array; + editCellsInfo?: any[]; } export interface DataSourceColumnsAdvancedFilter { @@ -27310,7 +27197,7 @@ export interface DataSourceColumnsAdvancedFilter { /** Allows the user to hold the filter operand values in advanced filtering. */ - values?: Array; + values?: any[]; } export interface DataSourceColumnsFilterItems { @@ -27323,7 +27210,7 @@ export interface DataSourceColumnsFilterItems { /** Contains the collection of items to be included/excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceColumn { @@ -27339,7 +27226,7 @@ export interface DataSourceColumn { /** Allows the user to filter the report by default using advanced filtering (excel-like) option for OLAP data source in client-mode. * @Default {[]} */ - advancedFilter?: Array; + advancedFilter?: DataSourceColumnsAdvancedFilter[]; /** Allows the user to indicate whether the added item is a named set or not. * @Default {false} @@ -27359,7 +27246,7 @@ export interface DataSourceColumn { /** Contains the list of members need to be drilled down by default in the field. * @Default {[]} */ - drilledItems?: Array; + drilledItems?: any[]; /** Applies filter to the field members. * @Default {null} @@ -27393,7 +27280,7 @@ export interface DataSourceRowsAdvancedFilter { /** Allows the user to hold the filter operand values in advanced filtering. */ - values?: Array; + values?: any[]; } export interface DataSourceRowsFilterItems { @@ -27406,7 +27293,7 @@ export interface DataSourceRowsFilterItems { /** Contains the collection of items to be included/excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceRow { @@ -27422,7 +27309,7 @@ export interface DataSourceRow { /** Allows the user to filter the report by default using advanced filtering (excel-like) option for OLAP data source in client-mode. * @Default {[]} */ - advancedFilter?: Array; + advancedFilter?: DataSourceRowsAdvancedFilter[]; /** Allows the user to indicate whether the added item is a named set or not. * @Default {false} @@ -27442,7 +27329,7 @@ export interface DataSourceRow { /** Contains the list of members need to be drilled down by default in the field. * @Default {[]} */ - drilledItems?: Array; + drilledItems?: any[]; /** Applies filter to the field members. * @Default {null} @@ -27470,7 +27357,7 @@ export interface DataSourceValue { /** This holds the list of unique names of measures to bind them from the OLAP cube. * @Default {[]} */ - measures?: Array; + measures?: DataSourceValuesMeasure[]; /** Allows to set the axis name to place the measures items. * @Default {rows} @@ -27510,7 +27397,7 @@ export interface DataSourceFiltersFilterItems { /** Contains the collection of items to be included/excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceFilter { @@ -27557,22 +27444,22 @@ export interface DataSource { /** Lists out the items to be arranged in columns section of PivotGrid. * @Default {[]} */ - columns?: Array; + columns?: DataSourceColumn[]; /** Lists out the items to be arranged in rows section of PivotGrid. * @Default {[]} */ - rows?: Array; + rows?: DataSourceRow[]; /** Lists out the items which supports calculation in PivotGrid. * @Default {[]} */ - values?: Array; + values?: DataSourceValue[]; /** Lists out the items which supports filtering of values without displaying the members in UI in PivotGrid. * @Default {[]} */ - filters?: Array; + filters?: DataSourceFilter[]; /** Contains the respective cube name from OLAP database as string type. * @Default {“â€Â} @@ -27754,7 +27641,7 @@ export interface ServiceMethodSettings { writeBack?: string; } -enum Layout{ +enum Layout { ///To set normal summary layout in PivotGrid. Normal, @@ -27770,20 +27657,16 @@ enum Layout{ } } -module Pivot -{ -enum AnalysisMode -{ +namespace Pivot { +enum AnalysisMode { //To bind an OLAP data source to PivotGrid. OLAP, //To bind a relational data source to PivotGrid. Pivot, } } -module PivotAnalysis -{ -enum SortOrder -{ +namespace PivotAnalysis { +enum SortOrder { //Sorts the members of the field in ascending order. Ascending, //Sorts the members of the field in descending order. @@ -27792,20 +27675,16 @@ Descending, None, } } -module PivotAnalysis -{ -enum FilterType -{ +namespace PivotAnalysis { +enum FilterType { //Excludes the specified values among the members of the field. Exclude, //Includes the specified values alone among the members of the field. Include, } } -module PivotAnalysis -{ -enum SummaryType -{ +namespace PivotAnalysis { +enum SummaryType { //Calculates the summary as the total of all values. Sum, //Displays the average of all values as the summaries. @@ -27818,10 +27697,8 @@ Min, Max, } } -module Pivot -{ -enum OperationalMode -{ +namespace Pivot { +enum OperationalMode { //To bind data source completely from client-side. ClientMode, //To bind data source completely from server-side. @@ -27831,11 +27708,10 @@ ServerMode, class PivotSchemaDesigner extends ej.Widget { static fn: PivotSchemaDesigner; - constructor(element: JQuery, options?: PivotSchemaDesigner.Model); - constructor(element: Element, options?: PivotSchemaDesigner.Model); + constructor(element: JQuery | Element, options?: PivotSchemaDesigner.Model); static Locale: any; - model:PivotSchemaDesigner.Model; - defaults:PivotSchemaDesigner.Model; + model: PivotSchemaDesigner.Model; + defaults: PivotSchemaDesigner.Model; /** Performs an asynchronous HTTP (AJAX) request. * @returns {void} @@ -27847,7 +27723,7 @@ class PivotSchemaDesigner extends ej.Widget { */ refreshControl(): void; } -export module PivotSchemaDesigner{ +export namespace PivotSchemaDesigner { export interface Model { @@ -27917,13 +27793,13 @@ export interface Model { layout?: ej.PivotSchemaDesigner.Layouts|string; /** Triggers when it reaches client-side after any AJAX request. */ - afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + afterServiceInvoke?(e: AfterServiceInvokeEventArgs): void; /** Triggers before any AJAX request is passed from PivotSchemaDesigner to service methods. */ - beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; /** Triggers when we start dragging any field from PivotSchemaDesigner. */ - dragMove? (e: DragMoveEventArgs): void; + dragMove?(e: DragMoveEventArgs): void; } export interface AfterServiceInvokeEventArgs { @@ -28021,7 +27897,7 @@ export interface ServiceMethod { removeButton?: string; } -enum Layouts{ +enum Layouts { ///To set the layout as same in the Excel. Excel, @@ -28037,18 +27913,17 @@ enum Layouts{ class PivotPager extends ej.Widget { static fn: PivotPager; - constructor(element: JQuery, options?: PivotPager.Model); - constructor(element: Element, options?: PivotPager.Model); + constructor(element: JQuery | Element, options?: PivotPager.Model); static Locale: any; - model:PivotPager.Model; - defaults:PivotPager.Model; + model: PivotPager.Model; + defaults: PivotPager.Model; /** This function initializes the page counts and page numbers for the PivotPager. * @returns {void} */ initPagerProperties(): void; } -export module PivotPager{ +export namespace PivotPager { export interface Model { @@ -28088,7 +27963,7 @@ export interface Model { targetControlID?: string; } -enum Mode{ +enum Mode { ///To set both categorical and series pager for paging. Both, @@ -28104,11 +27979,10 @@ enum Mode{ class PivotChart extends ej.Widget { static fn: PivotChart; - constructor(element: JQuery, options?: PivotChart.Model); - constructor(element: Element, options?: PivotChart.Model); + constructor(element: JQuery | Element, options?: PivotChart.Model); static Locale: any; - model:PivotChart.Model; - defaults:PivotChart.Model; + model: PivotChart.Model; + defaults: PivotChart.Model; /** Performs an asynchronous HTTP (AJAX) request. * @returns {void} @@ -28148,7 +28022,7 @@ class PivotChart extends ej.Widget { /** Returns the JSON records formed to render the control. * @returns {Array} */ - getJSONRecords(): Array; + getJSONRecords(): any[]; /** Sets the JSON records to render the control. * @returns {void} @@ -28158,7 +28032,7 @@ class PivotChart extends ej.Widget { /** Returns the PivotEngine formed to render the control. * @returns {Array} */ - getPivotEngine(): Array; + getPivotEngine(): any[]; /** Sets the PivotEngine required to render the control. * @returns {void} @@ -28180,7 +28054,7 @@ class PivotChart extends ej.Widget { */ refreshPagedPivotChart(): void; } -export module PivotChart{ +export namespace PivotChart { export interface Model { @@ -28275,28 +28149,28 @@ export interface Model { url?: string; /** Triggers when PivotChart starts to render. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Triggers when it reaches client-side after any AJAX request. */ - afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + afterServiceInvoke?(e: AfterServiceInvokeEventArgs): void; /** Triggers before any AJAX request is passed from PivotChart to service methods. */ - beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; /** Triggers on performing drill up/down in PivotChart control. */ - drillSuccess? (e: DrillSuccessEventArgs): void; + drillSuccess?(e: DrillSuccessEventArgs): void; /** Triggers when PivotChart widget completes all operations at client-side after any AJAX request. */ - renderComplete? (e: RenderCompleteEventArgs): void; + renderComplete?(e: RenderCompleteEventArgs): void; /** Triggers when any error occurred during AJAX request. */ - renderFailure? (e: RenderFailureEventArgs): void; + renderFailure?(e: RenderFailureEventArgs): void; /** Triggers when PivotChart successfully reaches client-side after any AJAX request. */ - renderSuccess? (e: RenderSuccessEventArgs): void; + renderSuccess?(e: RenderSuccessEventArgs): void; /** Triggers before performing exporting in pivot chart. */ - beforeExport? (e: BeforeExportEventArgs): void; + beforeExport?(e: BeforeExportEventArgs): void; } export interface LoadEventArgs { @@ -28441,7 +28315,7 @@ export interface DataSourceColumnsFilterItems { /** Contains the collection of items to be included/excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceColumn { @@ -28480,7 +28354,7 @@ export interface DataSourceRowsFilterItems { /** Contains the collection of items to be included/excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceRow { @@ -28529,7 +28403,7 @@ export interface DataSourceValue { /** This holds the list of unique names of measures to bind them from the OLAP cube. * @Default {[]} */ - measures?: Array; + measures?: DataSourceValuesMeasure[]; /** Allows to set the axis name to place the measures items. * @Default {rows} @@ -28556,7 +28430,7 @@ export interface DataSourceFiltersFilterItems { /** Contains the collection of items to be included/excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceFilter { @@ -28591,22 +28465,22 @@ export interface DataSource { /** Lists out the items to be displayed as series of PivotChart. * @Default {[]} */ - columns?: Array; + columns?: DataSourceColumn[]; /** Lists out the items to be displayed as segments of PivotChart. * @Default {[]} */ - rows?: Array; + rows?: DataSourceRow[]; /** Lists out the items supports calculation in PivotChart. * @Default {[]} */ - values?: Array; + values?: DataSourceValue[]; /** Lists out the items which supports filtering of values without displaying the members in UI in PivotChart. * @Default {[]} */ - filters?: Array; + filters?: DataSourceFilter[]; } export interface ServiceMethodSettings { @@ -28632,7 +28506,7 @@ export interface ServiceMethodSettings { paging?: string; } -enum ChartTypes{ +enum ChartTypes { ///To render a Line type PivotChart. Line, @@ -28690,11 +28564,10 @@ enum ChartTypes{ class PivotClient extends ej.Widget { static fn: PivotClient; - constructor(element: JQuery, options?: PivotClient.Model); - constructor(element: Element, options?: PivotClient.Model); + constructor(element: JQuery | Element, options?: PivotClient.Model); static Locale: any; - model:PivotClient.Model; - defaults:PivotClient.Model; + model: PivotClient.Model; + defaults: PivotClient.Model; /** Performs an asynchronous HTTP (AJAX) request. * @returns {void} @@ -28739,14 +28612,14 @@ class PivotClient extends ej.Widget { /** Returns the JSON records formed to render the control. * @returns {Array} */ - getJSONRecords(): Array; + getJSONRecords(): any[]; /** Sets the JSON records formed to render the control to a property. * @returns {void} */ setJSONRecords(): void; } -export module PivotClient{ +export namespace PivotClient { export interface Model { @@ -28869,40 +28742,40 @@ export interface Model { url?: string; /** Triggers when it reaches client-side after any AJAX request. */ - afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + afterServiceInvoke?(e: AfterServiceInvokeEventArgs): void; /** Triggers before any AJAX request is passed from client-side to service methods. */ - beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; /** Triggers before saving the current collection of reports. */ - saveReport? (e: SaveReportEventArgs): void; + saveReport?(e: SaveReportEventArgs): void; /** Triggers before loading a saved collection of reports. */ - loadReport? (e: LoadReportEventArgs): void; + loadReport?(e: LoadReportEventArgs): void; /** Triggers before fetching the report collection from storage. */ - fetchReport? (e: FetchReportEventArgs): void; + fetchReport?(e: FetchReportEventArgs): void; /** Triggers before exporting the control. */ - beforeExport? (e: BeforeExportEventArgs): void; + beforeExport?(e: BeforeExportEventArgs): void; /** Triggers before rendering the PivotChart. */ - chartLoad? (e: ChartLoadEventArgs): void; + chartLoad?(e: ChartLoadEventArgs): void; /** Triggers before rendering the PivotTreeMap. */ - treeMapLoad? (e: TreeMapLoadEventArgs): void; + treeMapLoad?(e: TreeMapLoadEventArgs): void; /** Triggers while we initiate loading of the widget. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Triggers when PivotClient widget completes all operations at client-end after any AJAX request. */ - renderComplete? (e: RenderCompleteEventArgs): void; + renderComplete?(e: RenderCompleteEventArgs): void; /** Triggers when any error occurred during AJAX request. */ - renderFailure? (e: RenderFailureEventArgs): void; + renderFailure?(e: RenderFailureEventArgs): void; /** Triggers when PivotClient successfully completes rendering. */ - renderSuccess? (e: RenderSuccessEventArgs): void; + renderSuccess?(e: RenderSuccessEventArgs): void; } export interface AfterServiceInvokeEventArgs { @@ -29079,7 +28952,7 @@ export interface DataSourceColumnsAdvancedFilter { /** Allows the user to hold the filter operand values in advanced filtering. */ - values?: Array; + values?: any[]; } export interface DataSourceColumnsFilterItems { @@ -29092,7 +28965,7 @@ export interface DataSourceColumnsFilterItems { /** Contains the collection of items to be included/excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceColumn { @@ -29108,7 +28981,7 @@ export interface DataSourceColumn { /** Allows the user to filter the report by default using advanced filtering (excel-like) option for OLAP data source in client-mode. * @Default {[]} */ - advancedFilter?: Array; + advancedFilter?: DataSourceColumnsAdvancedFilter[]; /** Allows the user to indicate whether the added item is a named set or not. * @Default {false} @@ -29128,7 +29001,7 @@ export interface DataSourceColumn { /** Contains the list of members need to be drilled down by default in the field. * @Default {[]} */ - drilledItems?: Array; + drilledItems?: any[]; /** Applies filter to the field members. * @Default {null} @@ -29162,7 +29035,7 @@ export interface DataSourceRowsAdvancedFilter { /** Allows the user to hold the filter operand values in advanced filtering. */ - values?: Array; + values?: any[]; } export interface DataSourceRowsFilterItems { @@ -29175,7 +29048,7 @@ export interface DataSourceRowsFilterItems { /** Contains the collection of items to be included/excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceRow { @@ -29191,7 +29064,7 @@ export interface DataSourceRow { /** Allows the user to filter the report by default using advanced filtering (excel-like) option for OLAP data source in client-mode. * @Default {[]} */ - advancedFilter?: Array; + advancedFilter?: DataSourceRowsAdvancedFilter[]; /** Allows the user to indicate whether the added item is a named set or not. * @Default {false} @@ -29211,7 +29084,7 @@ export interface DataSourceRow { /** Contains the list of members need to be drilled down by default in the field. * @Default {[]} */ - drilledItems?: Array; + drilledItems?: any[]; /** Applies filter to the field members. * @Default {null} @@ -29239,7 +29112,7 @@ export interface DataSourceValue { /** This holds the list of unique names of measures to bind them from the OLAP cube. * @Default {[]} */ - measures?: Array; + measures?: DataSourceValuesMeasure[]; /** Allows to set the axis name to place the measures items. * @Default {rows} @@ -29279,7 +29152,7 @@ export interface DataSourceFiltersFilterItems { /** Contains the collection of items to be included/excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceFilter { @@ -29326,22 +29199,22 @@ export interface DataSource { /** Lists out the items to be arranged in columns section of PivotClient. * @Default {[]} */ - columns?: Array; + columns?: DataSourceColumn[]; /** Lists out the items to be arranged in rows section of PivotClient. * @Default {[]} */ - rows?: Array; + rows?: DataSourceRow[]; /** Lists out the items which supports calculation in PivotClient. * @Default {[]} */ - values?: Array; + values?: DataSourceValue[]; /** Lists out the items which supports filtering of values without displaying the members in UI in PivotClient. * @Default {[]} */ - filters?: Array; + filters?: DataSourceFilter[]; /** Contains the respective cube name from OLAP database as string type. * @Default {“â€Â} @@ -29494,7 +29367,7 @@ export interface ServiceMethodSettings { paging?: string; } -enum ClientExportMode{ +enum ClientExportMode { ///Exports both the PivotChart and PivotGrid on exporting. ChartAndGrid, @@ -29507,7 +29380,7 @@ enum ClientExportMode{ } -enum ControlPlacement{ +enum ControlPlacement { ///Displays PivotChart and PivotGrid widgets in separate tabs. Tab, @@ -29517,7 +29390,7 @@ enum ControlPlacement{ } -enum DefaultView{ +enum DefaultView { ///To set PivotChart as a default control in view. Chart, @@ -29527,7 +29400,7 @@ enum DefaultView{ } -enum DisplayMode{ +enum DisplayMode { ///To display only PivotChart widget. ChartOnly, @@ -29543,11 +29416,10 @@ enum DisplayMode{ class PivotGauge extends ej.Widget { static fn: PivotGauge; - constructor(element: JQuery, options?: PivotGauge.Model); - constructor(element: Element, options?: PivotGauge.Model); + constructor(element: JQuery | Element, options?: PivotGauge.Model); static Locale: any; - model:PivotGauge.Model; - defaults:PivotGauge.Model; + model: PivotGauge.Model; + defaults: PivotGauge.Model; /** Performs an asynchronous HTTP (AJAX) request. * @returns {void} @@ -29582,7 +29454,7 @@ class PivotGauge extends ej.Widget { /** Returns the JSON records formed to render the control. * @returns {Array} */ - getJSONRecords(): Array; + getJSONRecords(): any[]; /** Sets the JSON records to render the control. * @returns {void} @@ -29594,7 +29466,7 @@ class PivotGauge extends ej.Widget { */ getJSONData(): void; } -export module PivotGauge{ +export namespace PivotGauge { export interface Model { @@ -29684,25 +29556,25 @@ export interface Model { operationalMode?: ej.Pivot.OperationalMode|string; /** Triggers when it reaches client-side after any AJAX request. */ - afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + afterServiceInvoke?(e: AfterServiceInvokeEventArgs): void; /** Triggers before any AJAX request is passed from PivotGauge to service methods. */ - beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; /** Triggers before populating the pivot engine on operating in client mode. */ - beforePivotEnginePopulate? (e: BeforePivotEnginePopulateEventArgs): void; + beforePivotEnginePopulate?(e: BeforePivotEnginePopulateEventArgs): void; /** Triggers when PivotGauge started loading at client-side. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Triggers when PivotGauge widget completes all operations at client-side after any AJAX request. */ - renderComplete? (e: RenderCompleteEventArgs): void; + renderComplete?(e: RenderCompleteEventArgs): void; /** Triggers when any error occurred during AJAX request. */ - renderFailure? (e: RenderFailureEventArgs): void; + renderFailure?(e: RenderFailureEventArgs): void; /** Triggers when PivotGauge successfully reaches client-side after any AJAX request. */ - renderSuccess? (e: RenderSuccessEventArgs): void; + renderSuccess?(e: RenderSuccessEventArgs): void; } export interface AfterServiceInvokeEventArgs { @@ -29800,7 +29672,7 @@ export interface DataSourceColumnsFilterItems { /** Contains the collection of items to be included/excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceColumn { @@ -29825,7 +29697,7 @@ export interface DataSourceRowsFilterItems { /** Contains the collection of items to be included/excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceRow { @@ -29860,7 +29732,7 @@ export interface DataSourceValue { /** This holds the list of unique names of measures to bind them from the OLAP cube. * @Default {[]} */ - measures?: Array; + measures?: DataSourceValuesMeasure[]; /** Allows to set the axis name to place the measures items. * @Default {rows} @@ -29887,7 +29759,7 @@ export interface DataSourceFiltersFilterItems { /** Contains the collection of items to be included/excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceFilter { @@ -29922,22 +29794,22 @@ export interface DataSource { /** Lists out the items to bind in columns section. * @Default {[]} */ - columns?: Array; + columns?: DataSourceColumn[]; /** Lists out the items to bind in rows section. * @Default {[]} */ - rows?: Array; + rows?: DataSourceRow[]; /** Lists out the items supports calculation in PivotGauge. * @Default {[]} */ - values?: Array; + values?: DataSourceValue[]; /** Lists out the items which supports filtering of values without displaying the members in UI in PivotGauge. * @Default {[]} */ - filters?: Array; + filters?: DataSourceFilter[]; } export interface LabelFormatSettings { @@ -29969,7 +29841,7 @@ export interface ServiceMethodSettings { initialize?: string; } -enum NumberFormat{ +enum NumberFormat { ///To set default format for label values. Default, @@ -29997,11 +29869,10 @@ enum NumberFormat{ class PivotTreeMap extends ej.Widget { static fn: PivotTreeMap; - constructor(element: JQuery, options?: PivotTreeMap.Model); - constructor(element: Element, options?: PivotTreeMap.Model); + constructor(element: JQuery | Element, options?: PivotTreeMap.Model); static Locale: any; - model:PivotTreeMap.Model; - defaults:PivotTreeMap.Model; + model: PivotTreeMap.Model; + defaults: PivotTreeMap.Model; /** Performs an asynchronous HTTP (AJAX) request. * @returns {void} @@ -30021,7 +29892,7 @@ class PivotTreeMap extends ej.Widget { /** Returns the JSON records formed to render the control. * @returns {Array} */ - getJSONRecords(): Array; + getJSONRecords(): any[]; /** Sets the JSON records to render the control. * @returns {void} @@ -30043,7 +29914,7 @@ class PivotTreeMap extends ej.Widget { */ renderControlSuccess(): void; } -export module PivotTreeMap{ +export namespace PivotTreeMap { export interface Model { @@ -30088,28 +29959,28 @@ export interface Model { url?: string; /** Triggers when it reaches client-side after any AJAX request. */ - afterServiceInvoke? (e: AfterServiceInvokeEventArgs): void; + afterServiceInvoke?(e: AfterServiceInvokeEventArgs): void; /** Triggers before any AJAX request is passed from PivotTreeMap to service methods. */ - beforeServiceInvoke? (e: BeforeServiceInvokeEventArgs): void; + beforeServiceInvoke?(e: BeforeServiceInvokeEventArgs): void; /** Triggers when PivotTreeMap starts to render. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Triggers before populating the pivot engine from datasource. */ - beforePivotEnginePopulate? (e: BeforePivotEnginePopulateEventArgs): void; + beforePivotEnginePopulate?(e: BeforePivotEnginePopulateEventArgs): void; /** Triggers when drill up/down happens in PivotTreeMap control. And it returns the outer HTML of PivotTreeMap control. */ - drillSuccess? (e: DrillSuccessEventArgs): void; + drillSuccess?(e: DrillSuccessEventArgs): void; /** Triggers when PivotTreeMap widget completes all operations at client-side after any AJAX request. */ - renderComplete? (e: RenderCompleteEventArgs): void; + renderComplete?(e: RenderCompleteEventArgs): void; /** Triggers when any error occurred during AJAX request. */ - renderFailure? (e: RenderFailureEventArgs): void; + renderFailure?(e: RenderFailureEventArgs): void; /** Triggers when PivotTreeMap successfully reaches client-side after any AJAX request. */ - renderSuccess? (e: RenderSuccessEventArgs): void; + renderSuccess?(e: RenderSuccessEventArgs): void; } export interface AfterServiceInvokeEventArgs { @@ -30225,7 +30096,7 @@ export interface DataSourceColumnsFilterItems { /** Contains the collection of items to be excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceColumn { @@ -30250,7 +30121,7 @@ export interface DataSourceRowsFilterItems { /** Contains the collection of items to be excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceRow { @@ -30282,7 +30153,7 @@ export interface DataSourceValue { /** This holds the list of unique names of measures to bind them from the OLAP cube. * @Default {[]} */ - measures?: Array; + measures?: DataSourceValuesMeasure[]; /** Allows to set the axis name to place the measures items. * @Default {rows} @@ -30295,7 +30166,7 @@ export interface DataSourceFiltersFilterItems { /** Contains the collection of items to be excluded among the field members. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface DataSourceFilter { @@ -30330,22 +30201,22 @@ export interface DataSource { /** Lists out the items to be displayed as series of PivotTreeMap. * @Default {[]} */ - columns?: Array; + columns?: DataSourceColumn[]; /** Lists out the items to be displayed as segments of PivotTreeMap. * @Default {[]} */ - rows?: Array; + rows?: DataSourceRow[]; /** Lists out the items supports calculation in PivotTreeMap. * @Default {[]} */ - values?: Array; + values?: DataSourceValue[]; /** Lists out the items which supports filtering of values without displaying the members in UI in PivotTreeMap. * @Default {[]} */ - filters?: Array; + filters?: DataSourceFilter[]; } export interface ServiceMethodSettings { @@ -30364,11 +30235,10 @@ export interface ServiceMethodSettings { class Schedule extends ej.Widget { static fn: Schedule; - constructor(element: JQuery, options?: Schedule.Model); - constructor(element: Element, options?: Schedule.Model); + constructor(element: JQuery | Element, options?: Schedule.Model); static Locale: any; - model:Schedule.Model; - defaults:Schedule.Model; + model: Schedule.Model; + defaults: Schedule.Model; /** This method is used to delete the appointment based on the guid value or the appointment data passed to it. * @param {string|any} GUID value of an appointment element or an appointment object @@ -30393,12 +30263,12 @@ class Schedule extends ej.Widget { * @param {Array} Holds array of one or more conditional objects for filtering the appointments based on it. * @returns {Array} */ - filterAppointments(filterConditions: Array): Array; + filterAppointments(filterConditions: any[]): any[]; /** Gets the complete appointment list of Schedule control. * @returns {Array} */ - getAppointments(): Array; + getAppointments(): any[]; /** Prints the entire Scheduler or a single appointment based on the appointment data passed as an argument to it. Simply calling the print() method, without passing any argument will print the entire Scheduler. * @param {any} Either accepts no arguments at all or else accepts an appointment object. @@ -30435,7 +30305,7 @@ class Schedule extends ej.Widget { * @param {boolean} Defines the ignoreCase value for performing the search operation. * @returns {Array} */ - searchAppointments(searchString: any|string, field: string, operator: ej.FilterOperators|string, ignoreCase: boolean): Array; + searchAppointments(searchString: any|string, field: string, operator: ej.FilterOperators|string, ignoreCase: boolean): any[]; /** Refreshes the entire Schedule control. * @returns {void} @@ -30452,7 +30322,7 @@ class Schedule extends ej.Widget { */ notifyChanges(): void; } -export module Schedule{ +export namespace Schedule { export interface Model { @@ -30609,7 +30479,7 @@ export interface Model { /** Holds all the options related to the resources settings of the Schedule. It is a collection of one or more resource objects, where the levels of resources are rendered on the Schedule based on the order of the resource data provided within this collection. * @Default {null} */ - resources?: Array; + resources?: Resource[]; /** When set to true, displays the all-day row cells on the Schedule. * @Default {true} @@ -30663,7 +30533,7 @@ export interface Model { /** Defines the view collection to be displayed on the Schedule. By default, it displays all the views namely, Day, Week, WorkWeek and Month. * @Default {[Day, Week, WorkWeek, Month, Agenda]} */ - views?: Array; + views?: any[]; /** Sets the width of the Schedule. Accepts both pixel and percentage values. * @Default {100%} @@ -30687,7 +30557,7 @@ export interface Model { /** Sets different day collection within workWeek view. * @Default {[Monday, Tuesday, Wednesday, Thursday, Friday]} */ - workWeek?: Array; + workWeek?: any[]; /** Allows to pop-up appointment details in a tooltip while hovering over the appointments. */ @@ -30736,94 +30606,94 @@ export interface Model { blockoutSettings?: BlockoutSettings; /** Triggers on the beginning of every action that starts within the Schedule. */ - actionBegin? (e: ActionBeginEventArgs): void; + actionBegin?(e: ActionBeginEventArgs): void; /** Triggers after the completion of every action within the Schedule. */ - actionComplete? (e: ActionCompleteEventArgs): void; + actionComplete?(e: ActionCompleteEventArgs): void; /** Triggers after an appointment is clicked. */ - appointmentClick? (e: AppointmentClickEventArgs): void; + appointmentClick?(e: AppointmentClickEventArgs): void; /** Triggers before the appointment is being removed from the Scheduler. */ - beforeAppointmentRemove? (e: BeforeAppointmentRemoveEventArgs): void; + beforeAppointmentRemove?(e: BeforeAppointmentRemoveEventArgs): void; /** Triggers before the edited appointment is being saved. */ - beforeAppointmentChange? (e: BeforeAppointmentChangeEventArgs): void; + beforeAppointmentChange?(e: BeforeAppointmentChangeEventArgs): void; /** Triggers on hovering the mouse over the appointments. */ - appointmentHover? (e: AppointmentHoverEventArgs): void; + appointmentHover?(e: AppointmentHoverEventArgs): void; /** Triggers before the new appointment gets saved. */ - beforeAppointmentCreate? (e: BeforeAppointmentCreateEventArgs): void; + beforeAppointmentCreate?(e: BeforeAppointmentCreateEventArgs): void; /** Triggers before the appointment window opens. */ - appointmentWindowOpen? (e: AppointmentWindowOpenEventArgs): void; + appointmentWindowOpen?(e: AppointmentWindowOpenEventArgs): void; /** Triggers before the context menu opens. */ - beforeContextMenuOpen? (e: BeforeContextMenuOpenEventArgs): void; + beforeContextMenuOpen?(e: BeforeContextMenuOpenEventArgs): void; /** Triggers after the cell is clicked. */ - cellClick? (e: CellClickEventArgs): void; + cellClick?(e: CellClickEventArgs): void; /** Triggers after the cell is clicked twice. */ - cellDoubleClick? (e: CellDoubleClickEventArgs): void; + cellDoubleClick?(e: CellDoubleClickEventArgs): void; /** Triggers on hovering the mouse overs the cells. */ - cellHover? (e: CellHoverEventArgs): void; + cellHover?(e: CellHoverEventArgs): void; /** Triggers when the Scheduler completely renders on the page. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Triggers when the Scheduler and all its sub-components gets destroyed. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Triggers while the appointment is being dragged over the work cells. */ - drag? (e: DragEventArgs): void; + drag?(e: DragEventArgs): void; /** Triggers when the appointment dragging begins. */ - dragStart? (e: DragStartEventArgs): void; + dragStart?(e: DragStartEventArgs): void; /** Triggers when the appointment is dropped. */ - dragStop? (e: DragStopEventArgs): void; + dragStop?(e: DragStopEventArgs): void; /** Triggers after the menu/sub-menu items within the context menu is clicked. */ - menuItemClick? (e: MenuItemClickEventArgs): void; + menuItemClick?(e: MenuItemClickEventArgs): void; /** Triggers after the Schedule view or date is navigated. */ - navigation? (e: NavigationEventArgs): void; + navigation?(e: NavigationEventArgs): void; /** Triggers every time before the elements of the scheduler such as work cells, time cells or header cells and so on renders or re-renders on a page. */ - queryCellInfo? (e: QueryCellInfoEventArgs): void; + queryCellInfo?(e: QueryCellInfoEventArgs): void; /** Triggers when the reminder is raised for an appointment based on the alertBefore value. */ - reminder? (e: ReminderEventArgs): void; + reminder?(e: ReminderEventArgs): void; /** Triggers while resizing the appointment. */ - resize? (e: ResizeEventArgs): void; + resize?(e: ResizeEventArgs): void; /** Triggers when the appointment resizing begins. */ - resizeStart? (e: ResizeStartEventArgs): void; + resizeStart?(e: ResizeStartEventArgs): void; /** Triggers when an appointment resizing stops. */ - resizeStop? (e: ResizeStopEventArgs): void; + resizeStop?(e: ResizeStopEventArgs): void; /** Triggers when the overflow button is clicked. */ - overflowButtonClick? (e: OverflowButtonClickEventArgs): void; + overflowButtonClick?(e: OverflowButtonClickEventArgs): void; /** Triggers while mouse hovering on the overflow button. */ - overflowButtonHover? (e: OverflowButtonHoverEventArgs): void; + overflowButtonHover?(e: OverflowButtonHoverEventArgs): void; /** Triggers when any of the keyboard keys are pressed. */ - keyDown? (e: KeyDownEventArgs): void; + keyDown?(e: KeyDownEventArgs): void; /** Triggers after the new appointment is saved. */ - appointmentCreated? (e: AppointmentCreatedEventArgs): void; + appointmentCreated?(e: AppointmentCreatedEventArgs): void; /** Triggers after an existing appointment is edited. */ - appointmentChanged? (e: AppointmentChangedEventArgs): void; + appointmentChanged?(e: AppointmentChangedEventArgs): void; /** Triggers after the appointment is deleted. */ - appointmentRemoved? (e: AppointmentRemovedEventArgs): void; + appointmentRemoved?(e: AppointmentRemovedEventArgs): void; } export interface ActionBeginEventArgs { @@ -31464,7 +31334,7 @@ export interface ResizeStopEventArgs { export interface OverflowButtonClickEventArgs { - /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the clicked overflow button is present. + /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the clicked overflow button is present. */ object?: any; @@ -31487,7 +31357,7 @@ export interface OverflowButtonClickEventArgs { export interface OverflowButtonHoverEventArgs { - /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the overflow button is currently hovered. + /** Returns the object consisting of start time, end time and resource value of the underlying cell on which the overflow button is currently hovered. */ object?: any; @@ -31589,7 +31459,7 @@ export interface AppointmentSettings { /** The dataSource option accepts either JSON object collection or DataManager (ej.DataManager) instance that contains Schedule appointments. * @Default {[]} */ - dataSource?: any|Array; + dataSource?: any|any[]; /** It holds either the ej.Query() object or simply the query string that retrieves the specified records from the table. * @Default {null} @@ -31691,7 +31561,7 @@ export interface CategorizeSettings { /** The dataSource option accepts either the JSON object collection or DataManager [ej.DataManager] instance that contains the categorize data. */ - dataSource?: Array|any; + dataSource?: any[]|any; /** Binds id field name in the dataSource to id of category data. * @Default {id} @@ -31718,11 +31588,11 @@ export interface ContextMenuSettingsMenuItems { /** All the appointment related context menu items are grouped under this appointment menu collection. */ - appointment?: Array; + appointment?: any[]; /** All the Scheduler cell related context menu items are grouped under this cells menu item collection. */ - cells?: Array; + cells?: any[]; } export interface ContextMenuSettings { @@ -31741,7 +31611,7 @@ export interface Group { /** Holds the array of resource names to be grouped on the Schedule. */ - resources?: Array; + resources?: any[]; } export interface WorkHours { @@ -31772,7 +31642,7 @@ export interface PrioritySettings { /** The dataSource option can accept the JSON object collection that contains the priority related data. * @Default {{% highlight js%}[{ text: None, value: none },{ text: High, value: high },{ text: Medium, value: medium },{ text: Low, value: low }]{% endhighlight %}} */ - dataSource?: any|Array; + dataSource?: any|any[]; /** Binds text field name in the dataSource to prioritySettings text. These text gets listed out in priority field of the appointment window. * @Default {text} @@ -31821,7 +31691,7 @@ export interface ResourcesResourceSettings { /** The dataSource option accepts either JSON object collection or DataManager (ejDataManager) instance that contains the resources related data. * @Default {[]} */ - dataSource?: any|Array; + dataSource?: any|any[]; /** Binds text field name in the dataSource to resourceSettings text. These text gets listed out in resources field of the appointment window. * @Default {null} @@ -31987,7 +31857,7 @@ export interface BlockoutSettings { /** The dataSource option accepts either JSON object collection or DataManager (ej.DataManager) instance that contains Schedule block intervals. * @Default {[]} */ - dataSource?: any|Array; + dataSource?: any|any[]; /** It holds either the ej.Query() object or simply the query string that retrieves the specified records from the table. * @Default {null} @@ -32040,7 +31910,7 @@ export interface BlockoutSettings { customStyle?: string; } -enum CurrentView{ +enum CurrentView { ///Sets currentView of the Scheduler as Day Day, @@ -32062,7 +31932,7 @@ enum CurrentView{ } -enum Orientation{ +enum Orientation { ///Set orientation as vertical to Scheduler Vertical, @@ -32072,7 +31942,7 @@ enum Orientation{ } -enum TimeMode{ +enum TimeMode { ///Sets 12 hour time mode to Scheduler Hour12, @@ -32085,16 +31955,15 @@ enum TimeMode{ class RecurrenceEditor extends ej.Widget { static fn: RecurrenceEditor; - constructor(element: JQuery, options?: RecurrenceEditor.Model); - constructor(element: Element, options?: RecurrenceEditor.Model); + constructor(element: JQuery | Element, options?: RecurrenceEditor.Model); static Locale: any; - model:RecurrenceEditor.Model; - defaults:RecurrenceEditor.Model; + model: RecurrenceEditor.Model; + defaults: RecurrenceEditor.Model; /** Generates the recurrence rule with the options selected within the Recurrence Editor. * @returns {String} */ - getRecurrenceRule(): String; + getRecurrenceRule(): string; /** Generates the collection of date, that lies within the selected recurrence start and end date for which the recurrence pattern applies. * @param {string} It refers the recurrence rule. @@ -32110,14 +31979,14 @@ class RecurrenceEditor extends ej.Widget { */ recurrenceRuleSplit(recurrenceRule: string, exDate: any): any; } -export module RecurrenceEditor{ +export namespace RecurrenceEditor { export interface Model { /** Defines the collection of recurrence frequencies within Recurrence Editor such as Never, Daily, Weekly, Monthly, Yearly and Every Weekday. * @Default {[never, daily, weekly, monthly, yearly, everyweekday]} */ - frequencies?: Array; + frequencies?: any[]; /** Sets the starting day of the week. * @Default {null} @@ -32168,7 +32037,7 @@ export interface Model { cssClass?: string; /** Triggers whenever any of the Recurrence Editor's value is changed. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; } export interface ChangeEventArgs { @@ -32193,11 +32062,10 @@ export interface ChangeEventArgs { class Gantt extends ej.Widget { static fn: Gantt; - constructor(element: JQuery, options?: Gantt.Model); - constructor(element: Element, options?: Gantt.Model); + constructor(element: JQuery | Element, options?: Gantt.Model); static Locale: any; - model:Gantt.Model; - defaults:Gantt.Model; + model: Gantt.Model; + defaults: Gantt.Model; /** To add a new item in Gantt * @param {any} Item to add in Gantt row. @@ -32211,7 +32079,7 @@ class Gantt extends ej.Widget { * @param {boolean} Defines that we need to preserve the previously selected cells of not * @returns {void} */ - selectCells(Indexes: Array, preservePreviousSelectedCell: boolean): void; + selectCells(Indexes: any[], preservePreviousSelectedCell: boolean): void; /** Positions the splitter by the specified column index. * @param {number} Set the splitter position based on column index. @@ -32299,14 +32167,14 @@ class Gantt extends ej.Widget { */ showColumn(headerText: string): void; } -export module Gantt{ +export namespace Gantt { export interface Model { /** Specifies the fields to be included in the add dialog in Gantt * @Default {[]} */ - addDialogFields?: Array; + addDialogFields?: any[]; /** Enables or disables the ability to resize column. * @Default {false} @@ -32373,7 +32241,7 @@ export interface Model { /** To Specify the column fields to be displayed in the dialog while inserting a column using column menu. * @Default {[]} */ - columnDialogFields?: Array; + columnDialogFields?: any[]; /** Specifies the background of connector lines in Gantt */ @@ -32400,7 +32268,7 @@ export interface Model { /** Collection of data or hierarchical data to represent in Gantt * @Default {null} */ - dataSource?: Array; + dataSource?: any[]; /** Specifies the dateFormat for Gantt , given format is displayed in tooltip , Grid . * @Default {MM/dd/yyyy} @@ -32419,7 +32287,7 @@ export interface Model { /** Specifies the fields to be included in the edit dialog in Gantt * @Default {[]} */ - editDialogFields?: Array; + editDialogFields?: any[]; /** Enables or disables the responsiveness of Gantt * @Default {false} @@ -32512,7 +32380,7 @@ export interface Model { /** Collection of holidays with date, background and label information to be displayed in Gantt. * @Default {[]} */ - holidays?: Array; + holidays?: any[]; /** Specifies whether to include weekends while calculating the duration of a task. * @Default {true} @@ -32643,7 +32511,7 @@ export interface Model { /** Collection of data regarding resources involved in entire project * @Default {[]} */ - resources?: Array; + resources?: any[]; /** Specifies whether rounding off the day working time edits * @Default {true} @@ -32710,7 +32578,7 @@ export interface Model { /** Specifies the selected cell information on rendering Gantt. */ - selectedCellIndexes?: Array; + selectedCellIndexes?: SelectedCellIndex[]; /** Specifies the sorting options for Gantt. */ @@ -32728,7 +32596,7 @@ export interface Model { /** Specifies the options for striplines * @Default {[]} */ - stripLines?: Array; + stripLines?: any[]; /** Specifies the background of the taskbar in Gantt */ @@ -32796,79 +32664,79 @@ export interface Model { workingTimeScale?: ej.Gantt.workingTimeScale|string; /** Triggered for every Gantt action before its starts. */ - actionBegin? (e: ActionBeginEventArgs): void; + actionBegin?(e: ActionBeginEventArgs): void; /** Triggered for every Gantt action success event. */ - actionComplete? (e: ActionCompleteEventArgs): void; + actionComplete?(e: ActionCompleteEventArgs): void; /** Triggered while enter the edit mode in the TreeGrid cell */ - beginEdit? (e: BeginEditEventArgs): void; + beginEdit?(e: BeginEditEventArgs): void; /** Triggered before selecting a cell */ - cellSelecting? (e: CellSelectingEventArgs): void; + cellSelecting?(e: CellSelectingEventArgs): void; /** Triggered after selected a cell */ - cellSelected? (e: CellSelectedEventArgs): void; + cellSelected?(e: CellSelectedEventArgs): void; /** Triggered while dragging a row in Gantt control */ - rowDrag? (e: RowDragEventArgs): void; + rowDrag?(e: RowDragEventArgs): void; /** Triggered while start to drag row in Gantt control */ - rowDragStart? (e: RowDragStartEventArgs): void; + rowDragStart?(e: RowDragStartEventArgs): void; /** Triggered while drop a row in Gantt control */ - rowDragStop? (e: RowDragStopEventArgs): void; + rowDragStop?(e: RowDragStopEventArgs): void; /** Triggered after collapsed the Gantt record */ - collapsed? (e: CollapsedEventArgs): void; + collapsed?(e: CollapsedEventArgs): void; /** Triggered while collapsing the Gantt record */ - collapsing? (e: CollapsingEventArgs): void; + collapsing?(e: CollapsingEventArgs): void; /** Triggered while Context Menu is rendered in Gantt control */ - contextMenuOpen? (e: ContextMenuOpenEventArgs): void; + contextMenuOpen?(e: ContextMenuOpenEventArgs): void; /** Triggered when Gantt is rendered completely. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Triggered after save the modified cellValue in Gantt. */ - endEdit? (e: EndEditEventArgs): void; + endEdit?(e: EndEditEventArgs): void; /** Triggered after expand the record */ - expanded? (e: ExpandedEventArgs): void; + expanded?(e: ExpandedEventArgs): void; /** Triggered while expanding the Gantt record */ - expanding? (e: ExpandingEventArgs): void; + expanding?(e: ExpandingEventArgs): void; /** Triggered while Gantt is loaded */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Triggered while rendering each cell in the TreeGrid */ - queryCellInfo? (e: QueryCellInfoEventArgs): void; + queryCellInfo?(e: QueryCellInfoEventArgs): void; /** Triggered while rendering each taskbar in the Gantt */ - queryTaskbarInfo? (e: QueryTaskbarInfoEventArgs): void; + queryTaskbarInfo?(e: QueryTaskbarInfoEventArgs): void; /** Triggered while rendering each row */ - rowDataBound? (e: RowDataBoundEventArgs): void; + rowDataBound?(e: RowDataBoundEventArgs): void; /** Triggered after the row is selected. */ - rowSelected? (e: RowSelectedEventArgs): void; + rowSelected?(e: RowSelectedEventArgs): void; /** Triggered before the row is going to be selected. */ - rowSelecting? (e: RowSelectingEventArgs): void; + rowSelecting?(e: RowSelectingEventArgs): void; /** Triggered after completing the editing operation in taskbar */ - taskbarEdited? (e: TaskbarEditedEventArgs): void; + taskbarEdited?(e: TaskbarEditedEventArgs): void; /** Triggered while editing the Gantt chart (dragging, resizing the taskbar ) */ - taskbarEditing? (e: TaskbarEditingEventArgs): void; + taskbarEditing?(e: TaskbarEditingEventArgs): void; /** Triggered when taskbar item is clicked in Gantt. */ - taskbarClick? (e: TaskbarClickEventArgs): void; + taskbarClick?(e: TaskbarClickEventArgs): void; /** Triggered when toolbar item is clicked in Gantt. */ - toolbarClick? (e: ToolbarClickEventArgs): void; + toolbarClick?(e: ToolbarClickEventArgs): void; } export interface ActionBeginEventArgs { @@ -33205,7 +33073,7 @@ export interface ContextMenuOpenEventArgs { /** Returns the default context menu items to which we add custom items. */ - contextMenuItems?: Array; + contextMenuItems?: any[]; /** Returns the Gantt model. */ @@ -33564,7 +33432,7 @@ export interface DragTooltip { /** Specifies the data source fields to be displayed in the drag tooltip. * @Default {[]} */ - tooltipItems?: Array; + tooltipItems?: any[]; /** Specifies the custom template for drag tooltip. * @Default {null} @@ -33709,7 +33577,7 @@ export interface SortSettings { /** Specifies the sorted columns for Gantt * @Default {[]} */ - sortedColumns?: Array; + sortedColumns?: any[]; } export interface ToolbarSettings { @@ -33722,10 +33590,10 @@ export interface ToolbarSettings { /** Specifies the list of toolbar items to be rendered in Gantt toolbar * @Default {[]} */ - toolbarItems?: Array; + toolbarItems?: any[]; } -enum DurationUnit{ +enum DurationUnit { ///Sets the Duration Unit as day. Day, @@ -33738,7 +33606,7 @@ enum DurationUnit{ } -enum BeginEditAction{ +enum BeginEditAction { ///you can begin the editing at double click DblClick, @@ -33748,7 +33616,7 @@ enum BeginEditAction{ } -enum TaskType{ +enum TaskType { ///Resource unit remains constant while editing the work and duration values. FixedUnit, @@ -33761,7 +33629,7 @@ enum TaskType{ } -enum WorkUnit{ +enum WorkUnit { ///Displays the work involved in a task in days. Day, @@ -33774,7 +33642,7 @@ enum WorkUnit{ } -enum TaskSchedulingMode{ +enum TaskSchedulingMode { ///All the tasks in the project will be displayed in auto scheduled mode, where the tasks are scheduled automatically over non-working days and holidays. Auto, @@ -33787,7 +33655,7 @@ enum TaskSchedulingMode{ } -enum SelectionType{ +enum SelectionType { ///you can select a single row. Single, @@ -33797,7 +33665,7 @@ enum SelectionType{ } -enum minutesPerInterval{ +enum minutesPerInterval { ///Sets the interval automatically according with schedule start and end date. Auto, @@ -33816,7 +33684,7 @@ enum minutesPerInterval{ } -enum ScheduleHeaderType{ +enum ScheduleHeaderType { ///Sets year Schedule Mode. Year, @@ -33835,7 +33703,7 @@ enum ScheduleHeaderType{ } -enum TimescaleRoundMode{ +enum TimescaleRoundMode { ///The round-off value will be automatically calculated based on the data source values. Auto, @@ -33851,7 +33719,7 @@ enum TimescaleRoundMode{ } -enum SelectionMode{ +enum SelectionMode { ///you can select a row. Row, @@ -33861,7 +33729,7 @@ enum SelectionMode{ } -enum workingTimeScale{ +enum workingTimeScale { ///Sets eight hour timescale. TimeScale8Hours, @@ -33874,11 +33742,10 @@ enum workingTimeScale{ class ReportViewer extends ej.Widget { static fn: ReportViewer; - constructor(element: JQuery, options?: ReportViewer.Model); - constructor(element: Element, options?: ReportViewer.Model); + constructor(element: JQuery | Element, options?: ReportViewer.Model); static Locale: any; - model:ReportViewer.Model; - defaults:ReportViewer.Model; + model: ReportViewer.Model; + defaults: ReportViewer.Model; /** Export the report to the specified format. * @returns {void} @@ -33950,19 +33817,19 @@ class ReportViewer extends ej.Widget { */ refresh(): void; } -export module ReportViewer{ +export namespace ReportViewer { export interface Model { /** Gets or sets the list of data sources for the RDLC report. * @Default {[]} */ - dataSources?: Array; + dataSources?: DataSource[]; /** Enables or disables the page cache of report. * @Default {false} */ - enablePageCache?: Boolean; + enablePageCache?: boolean; /** Specifies the export settings. */ @@ -33971,12 +33838,12 @@ export interface Model { /** When set to true, adapts the report layout to fit the screen size of devices on which it renders. * @Default {true} */ - isResponsive?: Boolean; + isResponsive?: boolean; /** Specifies the locale for report viewer. * @Default {en-US} */ - locale?: String; + locale?: string; /** Specifies the page settings. */ @@ -33985,12 +33852,12 @@ export interface Model { /** Gets or sets the list of parameters associated with the report. * @Default {[]} */ - parameters?: Array; + parameters?: Parameter[]; /** Enables and disables the print mode. * @Default {false} */ - printMode?: Boolean; + printMode?: boolean; /** Specifies the print option of the report. * @Default {ej.ReportViewer.PrintOptions.Default} @@ -34010,17 +33877,17 @@ export interface Model { /** Gets or sets the path of the report file. * @Default {empty} */ - reportPath?: String; + reportPath?: string; /** Gets or sets the reports server URL. * @Default {empty} */ - reportServerUrl?: String; + reportServerUrl?: string; /** Specifies the report Web API service URL. * @Default {empty} */ - reportServiceUrl?: String; + reportServiceUrl?: string; /** Specifies the toolbar settings. */ @@ -34029,31 +33896,31 @@ export interface Model { /** Gets or sets the zoom factor for report viewer. * @Default {1} */ - zoomFactor?: Number; + zoomFactor?: number; /** Fires when the report viewer is destroyed successfully.If you want to perform any operation after destroying the reportviewer control,you can make use of the destroy event. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires during drill through action done in report.If you want to perform any operation when a drill through action is performed, you can make use of the drillThrough event. */ - drillThrough? (e: DrillThroughEventArgs): void; + drillThrough?(e: DrillThroughEventArgs): void; /** Fires before report rendering is completed.If you want to perform any operation before the rendering of report,you can make use of the renderingBegin event. */ - renderingBegin? (e: RenderingBeginEventArgs): void; + renderingBegin?(e: RenderingBeginEventArgs): void; /** Fires after report rendering completed.If you want to perform any operation after the rendering of report,you can make use of this renderingComplete event. */ - renderingComplete? (e: RenderingCompleteEventArgs): void; + renderingComplete?(e: RenderingCompleteEventArgs): void; /** Fires when any error occurred while rendering the report.If you want to perform any operation when an error occurs in the report, you can make use of the reportError event. */ - reportError? (e: ReportErrorEventArgs): void; + reportError?(e: ReportErrorEventArgs): void; /** Fires when the report is being exported.If you want to perform any operation before exporting of report, you can make use of the reportExport event. */ - reportExport? (e: ReportExportEventArgs): void; + reportExport?(e: ReportExportEventArgs): void; /** Fires when the report is loaded.If you want to perform any operation after the successful loading of report, you can make use of the reportLoaded event. */ - reportLoaded? (e: ReportLoadedEventArgs): void; + reportLoaded?(e: ReportLoadedEventArgs): void; /** Fires when click the View Report Button. */ - viewReportClick? (e: ViewReportClickEventArgs): void; + viewReportClick?(e: ViewReportClickEventArgs): void; } export interface DestroyEventArgs { @@ -34197,12 +34064,12 @@ export interface DataSource { /** Gets or sets the name of the data source. * @Default {empty} */ - name?: String; + name?: string; /** Gets or sets the values of data source. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface ExportSettings { @@ -34241,27 +34108,27 @@ export interface Parameter { /** Gets or sets the parameter labels. * @Default {null} */ - labels?: Array; + labels?: any[]; /** Gets or sets the name of the parameter. * @Default {empty} */ - name?: String; + name?: string; /** Gets or sets whether the parameter allows nullable value or not. * @Default {false} */ - nullable?: Boolean; + nullable?: boolean; /** Gets or sets the prompt message associated with the specified parameter. * @Default {empty} */ - prompt?: String; + prompt?: string; /** Gets or sets the parameter values. * @Default {[]} */ - values?: Array; + values?: any[]; } export interface ToolbarSettings { @@ -34269,7 +34136,7 @@ export interface ToolbarSettings { /** Fires when user click on toolbar item in the toolbar. * @Default {empty} */ - click?: String; + click?: string; /** Specifies the toolbar items. * @Default {ej.ReportViewer.ToolbarItems.All} @@ -34279,20 +34146,20 @@ export interface ToolbarSettings { /** Shows or hides the toolbar. * @Default {true} */ - showToolbar?: Boolean; + showToolbar?: boolean; /** Shows or hides the tooltip of toolbar items. * @Default {true} */ - showTooltip?: Boolean; + showTooltip?: boolean; /** Specifies the toolbar template ID. * @Default {empty} */ - templateId?: String; + templateId?: string; } -enum ExportOptions{ +enum ExportOptions { ///Specifies the All property in ExportOptions to get all available options. All, @@ -34311,7 +34178,7 @@ enum ExportOptions{ } -enum ExcelFormats{ +enum ExcelFormats { ///Specifies the Excel97to2003 property in ExcelFormats to get specified version of exported format. Excel97to2003, @@ -34327,7 +34194,7 @@ enum ExcelFormats{ } -enum WordFormats{ +enum WordFormats { ///Specifies the Doc property in WordFormats to get specified version of exported format. Doc, @@ -34394,7 +34261,7 @@ enum WordFormats{ } -enum Orientation{ +enum Orientation { ///Specifies the Landscape property in pageSettings.orientation to get specified layout. Landscape, @@ -34404,7 +34271,7 @@ enum Orientation{ } -enum PaperSize{ +enum PaperSize { ///Specifies the A3 as value in pageSettings.paperSize to get specified size. A3, @@ -34441,7 +34308,7 @@ enum PaperSize{ } -enum PrintOptions{ +enum PrintOptions { ///Specifies the Default property in printOptions. Default, @@ -34454,7 +34321,7 @@ enum PrintOptions{ } -enum ProcessingMode{ +enum ProcessingMode { ///Specifies the Remote property in processingMode. Remote, @@ -34464,7 +34331,7 @@ enum ProcessingMode{ } -enum RenderMode{ +enum RenderMode { ///Specifies the Default property in RenderMode to get default output. Default, @@ -34477,7 +34344,7 @@ enum RenderMode{ } -enum ToolbarItems{ +enum ToolbarItems { ///Specifies the Print as value in ToolbarItems to get specified item. Print, @@ -34511,11 +34378,10 @@ enum ToolbarItems{ class TreeGrid extends ej.Widget { static fn: TreeGrid; - constructor(element: JQuery, options?: TreeGrid.Model); - constructor(element: Element, options?: TreeGrid.Model); + constructor(element: JQuery | Element, options?: TreeGrid.Model); static Locale: any; - model:TreeGrid.Model; - defaults:TreeGrid.Model; + model: TreeGrid.Model; + defaults: TreeGrid.Model; /** Add a new row in TreeGrid, while allowAdding is set to true * @param {any} Item to add in TreeGrid row. @@ -34535,11 +34401,11 @@ class TreeGrid extends ej.Widget { * @param {boolean} Defines that we need to preserve the previously selected cells or not * @returns {void} */ - selectCells(Indexes: Array, preservePreviousSelectedCell: boolean): void; + selectCells(Indexes: any[], preservePreviousSelectedCell: boolean): void; /** To rename a column with the specified name * @param {number} Index of the column to be renamed - * @param {string} Header text of the column + * @param {string} Header text of the column * @returns {void} */ renameColumn(columnIndex: number, name: string): void; @@ -34578,7 +34444,7 @@ class TreeGrid extends ej.Widget { * @param {any} Pass which data you want to show in tree grid * @returns {void} */ - refresh(dataSource: Array, query: any): void; + refresh(dataSource: any[], query: any): void; /** Freeze all the columns preceding to the column specified by the field name. * @param {string} Freeze all Columns before this field column. @@ -34624,7 +34490,7 @@ class TreeGrid extends ej.Widget { */ reorderColumn(fieldName: string, targetIndex: string): void; } -export module TreeGrid{ +export namespace TreeGrid { export interface Model { @@ -34683,12 +34549,12 @@ export interface Model { /** Option for adding columns; each column has the option to bind to a field in the dataSource. */ - columns?: Array; + columns?: Column[]; /** To Specify the column fields to be displayed in the dialog while inserting a column using column menu. * @Default {[]} */ - columnDialogFields?: Array; + columnDialogFields?: any[]; /** Options for displaying and customizing context menu items. */ @@ -34701,7 +34567,7 @@ export interface Model { /** Specifies hierarchical or self-referential data to populate the TreeGrid. * @Default {null} */ - dataSource?: Array; + dataSource?: any[]; /** Specifies whether to wrap the header text when it is overflown i.e., when it exceeds the header width. * @Default {none} @@ -34841,7 +34707,7 @@ export interface Model { /** Specifies the summary row collection object to be displayed * @Default {[]} */ - summaryRows?: Array; + summaryRows?: any[]; /** Specifies whether to show tooltip when mouse is hovered on the cell. * @Default {true} @@ -34871,88 +34737,88 @@ export interface Model { treeColumnIndex?: number; /** Triggered before every success event of TreeGrid action. */ - actionBegin? (e: ActionBeginEventArgs): void; + actionBegin?(e: ActionBeginEventArgs): void; /** Triggered for every TreeGrid action success event. */ - actionComplete? (e: ActionCompleteEventArgs): void; + actionComplete?(e: ActionCompleteEventArgs): void; /** Triggered while enter the edit mode in the TreeGrid cell */ - beginEdit? (e: BeginEditEventArgs): void; + beginEdit?(e: BeginEditEventArgs): void; /** Triggered after collapsed the TreeGrid record */ - collapsed? (e: CollapsedEventArgs): void; + collapsed?(e: CollapsedEventArgs): void; /** Triggered while collapsing the TreeGrid record */ - collapsing? (e: CollapsingEventArgs): void; + collapsing?(e: CollapsingEventArgs): void; /** Triggered while clicking a row, even when allowSelection property is disabled. */ - recordClick? (e: RecordClickEventArgs): void; + recordClick?(e: RecordClickEventArgs): void; /** Triggered when you start to drag a column */ - columnDragStart? (e: ColumnDragStartEventArgs): void; + columnDragStart?(e: ColumnDragStartEventArgs): void; /** Triggered while dragging a column */ - columnDrag? (e: ColumnDragEventArgs): void; + columnDrag?(e: ColumnDragEventArgs): void; /** Triggered when a column is dropped */ - columnDrop? (e: ColumnDropEventArgs): void; + columnDrop?(e: ColumnDropEventArgs): void; /** Triggered after a column resized */ - columnResized? (e: ColumnResizedEventArgs): void; + columnResized?(e: ColumnResizedEventArgs): void; /** Triggered while start to resize a column */ - columnResizeStart? (e: ColumnResizeStartEventArgs): void; + columnResizeStart?(e: ColumnResizeStartEventArgs): void; /** Triggered when a column has been resized */ - columnResizeEnd? (e: ColumnResizeEndEventArgs): void; + columnResizeEnd?(e: ColumnResizeEndEventArgs): void; /** Triggered while Context Menu is rendered in TreeGrid control */ - contextMenuOpen? (e: ContextMenuOpenEventArgs): void; + contextMenuOpen?(e: ContextMenuOpenEventArgs): void; /** Triggered when TreeGrid is rendered completely */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Triggered after saved the modified cellValue in TreeGrid */ - endEdit? (e: EndEditEventArgs): void; + endEdit?(e: EndEditEventArgs): void; /** Triggered after expand the record */ - expanded? (e: ExpandedEventArgs): void; + expanded?(e: ExpandedEventArgs): void; /** Triggered while expanding the TreeGrid record */ - expanding? (e: ExpandingEventArgs): void; + expanding?(e: ExpandingEventArgs): void; /** Triggered while Treegrid is loaded */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Triggered while rendering each cell in the TreeGrid */ - queryCellInfo? (e: QueryCellInfoEventArgs): void; + queryCellInfo?(e: QueryCellInfoEventArgs): void; /** Triggered while rendering each row */ - rowDataBound? (e: RowDataBoundEventArgs): void; + rowDataBound?(e: RowDataBoundEventArgs): void; /** Triggered while dragging a row in TreeGrid control */ - rowDrag? (e: RowDragEventArgs): void; + rowDrag?(e: RowDragEventArgs): void; /** Triggered while start to drag row in TreeGrid control */ - rowDragStart? (e: RowDragStartEventArgs): void; + rowDragStart?(e: RowDragStartEventArgs): void; /** Triggered while drop a row in TreeGrid control */ - rowDragStop? (e: RowDragStopEventArgs): void; + rowDragStop?(e: RowDragStopEventArgs): void; /** Triggered before selecting a cell */ - cellSelecting? (e: CellSelectingEventArgs): void; + cellSelecting?(e: CellSelectingEventArgs): void; /** Triggered after selected a cell */ - cellSelected? (e: CellSelectedEventArgs): void; + cellSelected?(e: CellSelectedEventArgs): void; /** Triggered after the row is selected. */ - rowSelected? (e: RowSelectedEventArgs): void; + rowSelected?(e: RowSelectedEventArgs): void; /** Triggered before the row is going to be selected. */ - rowSelecting? (e: RowSelectingEventArgs): void; + rowSelecting?(e: RowSelectingEventArgs): void; /** Triggered when toolbar item is clicked in TreeGrid. */ - toolbarClick? (e: ToolbarClickEventArgs): void; + toolbarClick?(e: ToolbarClickEventArgs): void; } export interface ActionBeginEventArgs { @@ -35331,7 +35197,7 @@ export interface ContextMenuOpenEventArgs { /** Returns the default context menu items to which we add custom items. */ - contextMenuItems?: Array; + contextMenuItems?: any[]; /** Returns the TreeGrid model. */ @@ -35799,11 +35665,11 @@ export interface Column { /** Gets or sets a value for treegrid column width */ - width?: Number; + width?: number; /** Specifies the header template value for the column header */ - headerTemplateID?: String; + headerTemplateID?: string; /** Specifies the display format of a column * @Default {null} @@ -35832,7 +35698,7 @@ export interface Column { /** Specifies the template for the TreeGrid column */ - templateID?: String; + templateID?: string; /** Enables or disables the ability to edit a row or cell. * @Default {false} @@ -35850,7 +35716,7 @@ export interface ContextMenuSettings { /** Option for adding items to context menu. * @Default {[]} */ - contextMenuItems?: Array; + contextMenuItems?: any[]; /** Shows/hides the context menu. * @Default {false} @@ -35868,7 +35734,7 @@ export interface DragTooltip { /** Option to add field names whose corresponding values in the dragged row needs to be shown in the preview tooltip. * @Default {[]} */ - tooltipItems?: Array; + tooltipItems?: any[]; /** Custom template for that tooltip that is shown while dragging a row. * @Default {null} @@ -35932,7 +35798,7 @@ export interface FilterSettings { /** Specifies the column collection for filtering the TreeGrid content on initial load * @Default {[]} */ - filteredColumns?: Array; + filteredColumns?: any[]; } export interface PageSettings { @@ -36009,7 +35875,7 @@ export interface SortSettings { /** Option to add columns based on which the rows have to be sorted recursively. * @Default {[]} */ - sortedColumns?: Array; + sortedColumns?: any[]; } export interface ToolbarSettings { @@ -36022,10 +35888,10 @@ export interface ToolbarSettings { /** Specifies the list of toolbar items to be rendered in TreeGrid toolbar * @Default {[]} */ - toolbarItems?: Array; + toolbarItems?: any[]; } -enum EditingType{ +enum EditingType { ///It Specifies String edit type. String, @@ -36050,7 +35916,7 @@ enum EditingType{ } -enum BeginEditAction{ +enum BeginEditAction { ///you can begin the editing at double click DblClick, @@ -36060,7 +35926,7 @@ enum BeginEditAction{ } -enum EditMode{ +enum EditMode { ///you can edit a cell. CellEditing, @@ -36070,7 +35936,7 @@ enum EditMode{ } -enum RowPosition{ +enum RowPosition { ///you can add a new row at top. Top, @@ -36089,7 +35955,7 @@ enum RowPosition{ } -enum PageSizeMode{ +enum PageSizeMode { ///To count all the parent and child records. All, @@ -36099,7 +35965,7 @@ enum PageSizeMode{ } -enum SelectionMode{ +enum SelectionMode { ///you can select a row. Row, @@ -36109,7 +35975,7 @@ enum SelectionMode{ } -enum SelectionType{ +enum SelectionType { ///you can select a single row. Single, @@ -36125,11 +35991,10 @@ enum SelectionType{ class GroupButton extends ej.Widget { static fn: GroupButton; - constructor(element: JQuery, options?: GroupButton.Model); - constructor(element: Element, options?: GroupButton.Model); + constructor(element: JQuery | Element, options?: GroupButton.Model); static Locale: any; - model:GroupButton.Model; - defaults:GroupButton.Model; + model: GroupButton.Model; + defaults: GroupButton.Model; /** Remove the selection state of the specified the button element from the GroupButton * @param {JQuery} Specific button element @@ -36213,7 +36078,7 @@ class GroupButton extends ej.Widget { */ showItem(element: JQuery): void; } -export module GroupButton{ +export namespace GroupButton { export interface Model { @@ -36286,19 +36151,19 @@ export interface Model { width?: string|number; /** Triggered before any button element in the GroupButton get selected. */ - beforeSelect? (e: BeforeSelectEventArgs): void; + beforeSelect?(e: BeforeSelectEventArgs): void; /** Fires after GroupButton control is created.If the user want to perform any operation after the button control creation then the user can make use of this create event. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when the GroupButton is destroyed successfully.If the user want to perform any operation after the destroy button control then the user can make use of this destroy event. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Triggered once the key is pressed, when the control is in focused state. */ - keyPress? (e: KeyPressEventArgs): void; + keyPress?(e: KeyPressEventArgs): void; /** Triggered when the button element get selected. */ - select? (e: SelectEventArgs): void; + select?(e: SelectEventArgs): void; } export interface BeforeSelectEventArgs { @@ -36448,21 +36313,19 @@ export interface SelectEventArgs { status?: boolean; } } -enum GroupButtonMode -{ -//Sets the GroupButton to work as checkbox mode +enum GroupButtonMode { +//Sets the GroupButton to work as checkbox mode CheckBox, -//Sets the RadioButton to work as radio button mode +//Sets the RadioButton to work as radio button mode RadioButton, } class NavigationDrawer extends ej.Widget { static fn: NavigationDrawer; - constructor(element: JQuery, options?: NavigationDrawer.Model); - constructor(element: Element, options?: NavigationDrawer.Model); + constructor(element: JQuery | Element, options?: NavigationDrawer.Model); static Locale: any; - model:NavigationDrawer.Model; - defaults:NavigationDrawer.Model; + model: NavigationDrawer.Model; + defaults: NavigationDrawer.Model; /** To close the navigation drawer control * @returns {void} @@ -36484,7 +36347,7 @@ class NavigationDrawer extends ej.Widget { */ toggle(): void; } -export module NavigationDrawer{ +export namespace NavigationDrawer { export interface Model { @@ -36515,7 +36378,7 @@ export interface Model { /** Specifies the listview items as an array of object. * @Default {[]} */ - items?: Array; + items?: any[]; /** Sets all the properties of listview to render in navigation drawer */ @@ -36546,22 +36409,22 @@ export interface Model { isPaneOpen?: boolean; /** Event triggers after the AJAX content loaded completely. */ - ajaxComplete? (e: AjaxCompleteEventArgs): void; + ajaxComplete?(e: AjaxCompleteEventArgs): void; /** Event triggers when the AJAX request failed. */ - ajaxError? (e: AjaxErrorEventArgs): void; + ajaxError?(e: AjaxErrorEventArgs): void; /** Event triggers after the AJAX content loaded successfully. */ - ajaxSuccess? (e: AjaxSuccessEventArgs): void; + ajaxSuccess?(e: AjaxSuccessEventArgs): void; /** Event triggers before the control gets closed. */ - beforeClose? (e: BeforeCloseEventArgs): void; + beforeClose?(e: BeforeCloseEventArgs): void; /** Event triggers when the control open. */ - open? (e: OpenEventArgs): void; + open?(e: OpenEventArgs): void; /** Event triggers when the Swipe happens. */ - swipe? (e: SwipeEventArgs): void; + swipe?(e: SwipeEventArgs): void; } export interface AjaxCompleteEventArgs { @@ -36700,11 +36563,10 @@ export interface AjaxSettings { class RadialMenu extends ej.Widget { static fn: RadialMenu; - constructor(element: JQuery, options?: RadialMenu.Model); - constructor(element: Element, options?: RadialMenu.Model); + constructor(element: JQuery | Element, options?: RadialMenu.Model); static Locale: any; - model:RadialMenu.Model; - defaults:RadialMenu.Model; + model: RadialMenu.Model; + defaults: RadialMenu.Model; /** To hide the radialmenu * @returns {void} @@ -36736,7 +36598,7 @@ class RadialMenu extends ej.Widget { * @param {Array} Index of the Radialmenu to be enabled. * @returns {void} */ - enableItemsByIndices(itemIndices: Array): void; + enableItemsByIndices(itemIndices: any[]): void; /** To disable menu item using index * @param {number} Index of the Radialmenu to be disabled. @@ -36748,7 +36610,7 @@ class RadialMenu extends ej.Widget { * @param {Array} items of the Radialmenu to disable. * @returns {void} */ - disableItemsByIndices(itemIndices: Array): void; + disableItemsByIndices(itemIndices: any[]): void; /** To enable menu item using item text * @param {string} item of the Radialmenu item to enable. @@ -36766,13 +36628,13 @@ class RadialMenu extends ej.Widget { * @param {Array} items of the Radialmenu item to enable. * @returns {void} */ - enableItems(items: Array): void; + enableItems(items: any[]): void; /** To disable menu items using item texts * @param {Array} items of the Radialmenu item to disable. * @returns {void} */ - disableItems(items: Array): void; + disableItems(items: any[]): void; /** To update menu item badge value * @param {number} The index value to add the given items at the specified index. If index is not specified, the given value will not be updated. @@ -36793,7 +36655,7 @@ class RadialMenu extends ej.Widget { */ hideBadge(index: number): void; } -export module RadialMenu{ +export namespace RadialMenu { export interface Model { @@ -36819,7 +36681,7 @@ export interface Model { /** Specify the items of radial menu */ - items?: Array; + items?: Item[]; /** Specifies the radius of radial menu */ @@ -36834,13 +36696,13 @@ export interface Model { position?: any; /** Event triggers when we click an item. */ - click? (e: ClickEventArgs): void; + click?(e: ClickEventArgs): void; /** Event triggers when the menu is opened. */ - open? (e: OpenEventArgs): void; + open?(e: OpenEventArgs): void; /** Event triggers when the menu is closed. */ - close? (e: CloseEventArgs): void; + close?(e: CloseEventArgs): void; } export interface ClickEventArgs { @@ -36911,7 +36773,7 @@ export interface ItemsSliderSettings { /** Specifies the sliderSettings ticks values of nested radial menu items. */ - ticks?: Array; + ticks?: any[]; /** Specifies the sliderSettings stroke Width value. */ @@ -36954,17 +36816,16 @@ export interface Item { /** Specifies to add sub level items . */ - items?: Array; + items?: any[]; } } class Tile extends ej.Widget { static fn: Tile; - constructor(element: JQuery, options?: Tile.Model); - constructor(element: Element, options?: Tile.Model); + constructor(element: JQuery | Element, options?: Tile.Model); static Locale: any; - model:Tile.Model; - defaults:Tile.Model; + model: Tile.Model; + defaults: Tile.Model; /** Update the image template of tile item to another one. * @param {string} UpdateTemplate by using id @@ -36973,7 +36834,7 @@ class Tile extends ej.Widget { */ updateTemplate(id: string, index: number): void; } -export module Tile{ +export namespace Tile { export interface Model { @@ -37021,7 +36882,7 @@ export interface Model { /** Set the localization culture for Tile Widget. */ - locale?: String; + locale?: string; /** Section for liveTile specific functionalities. */ @@ -37053,10 +36914,10 @@ export interface Model { backgroundColor?: string; /** Event triggers when the mouseDown happens in the tile */ - mouseDown? (e: MouseDownEventArgs): void; + mouseDown?(e: MouseDownEventArgs): void; /** Event triggers when the mouseUp happens in the tile */ - mouseUp? (e: MouseUpEventArgs): void; + mouseUp?(e: MouseUpEventArgs): void; } export interface MouseDownEventArgs { @@ -37077,7 +36938,7 @@ export interface MouseDownEventArgs { */ text?: string; - /** returns the index of current tile item + /** returns the index of current tile item */ index?: number; } @@ -37100,7 +36961,7 @@ export interface MouseUpEventArgs { */ text?: boolean; - /** returns the index of current tile item + /** returns the index of current tile item */ index?: number; } @@ -37176,17 +37037,17 @@ export interface LiveTile { /** Specifies liveTile images in CSS classes. * @Default {null} */ - imageClass?: Array; + imageClass?: any[]; /** Specifies liveTile images in templates. * @Default {null} */ - imageTemplateId?: Array; + imageTemplateId?: any[]; /** Specifies liveTile images in CSS classes. * @Default {null} */ - imageUrl?: Array; + imageUrl?: any[]; /** Specifies liveTile type for Tile. See orientation * @Default {flip} @@ -37201,10 +37062,10 @@ export interface LiveTile { /** Sets the text to each living tile * @Default {Null} */ - text?: Array; + text?: any[]; } -enum BadgePosition{ +enum BadgePosition { ///To set the topright position of tile badge Topright, @@ -37214,7 +37075,7 @@ enum BadgePosition{ } -enum CaptionAlignment{ +enum CaptionAlignment { ///To set the normal alignment of text in tile control Normal, @@ -37230,7 +37091,7 @@ enum CaptionAlignment{ } -enum CaptionPosition{ +enum CaptionPosition { ///To set the inner top position of the tile text Innertop, @@ -37243,7 +37104,7 @@ enum CaptionPosition{ } -enum ImagePosition{ +enum ImagePosition { ///To set the center position of tile image Center, @@ -37277,7 +37138,7 @@ enum ImagePosition{ } -enum liveTileType{ +enum liveTileType { ///To set flip type of liveTile for tile control Flip, @@ -37290,7 +37151,7 @@ enum liveTileType{ } -enum TileSize{ +enum TileSize { ///To set the medium size for tile control Medium, @@ -37309,11 +37170,10 @@ enum TileSize{ class Signature extends ej.Widget { static fn: Signature; - constructor(element: JQuery, options?: Signature.Model); - constructor(element: Element, options?: Signature.Model); + constructor(element: JQuery | Element, options?: Signature.Model); static Locale: any; - model:Signature.Model; - defaults:Signature.Model; + model: Signature.Model; + defaults: Signature.Model; /** Clears the strokes in the signature. * @returns {void} @@ -37360,7 +37220,7 @@ class Signature extends ej.Widget { */ undo(): void; } -export module Signature{ +export namespace Signature { export interface Model { @@ -37418,16 +37278,16 @@ export interface Model { width?: string; /** Triggers when the stroke is changed. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Triggered when the pointer is clicked or touched in the signature canvas. */ - mouseDown? (e: MouseDownEventArgs): void; + mouseDown?(e: MouseDownEventArgs): void; /** Triggered when the pointer is moved in the signature canvas. */ - mouseMove? (e: MouseMoveEventArgs): void; + mouseMove?(e: MouseMoveEventArgs): void; /** Triggered when the pointer is released after click or touch in the signature canvas. */ - mouseUp? (e: MouseUpEventArgs): void; + mouseUp?(e: MouseUpEventArgs): void; } export interface ChangeEventArgs { @@ -37506,7 +37366,7 @@ export interface MouseUpEventArgs { value?: any; } -enum SaveImageFormat{ +enum SaveImageFormat { ///To save the signature image with PNG format only. PNG, @@ -37525,11 +37385,10 @@ enum SaveImageFormat{ class RadialSlider extends ej.Widget { static fn: RadialSlider; - constructor(element: JQuery, options?: RadialSlider.Model); - constructor(element: Element, options?: RadialSlider.Model); + constructor(element: JQuery | Element, options?: RadialSlider.Model); static Locale: any; - model:RadialSlider.Model; - defaults:RadialSlider.Model; + model: RadialSlider.Model; + defaults: RadialSlider.Model; /** To show the radialslider * @returns {void} @@ -37541,7 +37400,7 @@ class RadialSlider extends ej.Widget { */ hide(): void; } -export module RadialSlider{ +export namespace RadialSlider { export interface Model { @@ -37611,7 +37470,7 @@ export interface Model { /** Specifies the ticks value of radial slider */ - ticks?: Array; + ticks?: any[]; /** Specifies the value of radial slider * @Default {10} @@ -37619,142 +37478,142 @@ export interface Model { value?: number; /** Event triggers when the change occurs. */ - change? (e: ChangeEventArgs): void; + change?(e: ChangeEventArgs): void; /** Event triggers when the radial slider is created. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Event triggers when the mouse pointer is dragged over the radial slider. */ - mouseover? (e: MouseoverEventArgs): void; + mouseover?(e: MouseoverEventArgs): void; /** Event triggers when the Radial slider slides. */ - slide? (e: SlideEventArgs): void; + slide?(e: SlideEventArgs): void; /** Event triggers when the radial slider starts. */ - start? (e: StartEventArgs): void; + start?(e: StartEventArgs): void; /** Event triggers when the radial slider stops. */ - stop? (e: StopEventArgs): void; + stop?(e: StopEventArgs): void; } export interface ChangeEventArgs { - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the initial value of Radial slider + /** returns the initial value of Radial slider */ oldValue?: number; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the current value of the Radial slider + /** returns the current value of the Radial slider */ value?: number; } export interface CreateEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** returns the name of the event + /** returns the name of the event */ type?: string; } export interface MouseoverEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** returns the value selected + /** returns the value selected */ selectedValue?: number; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the current value selected in Radial slider + /** returns the current value selected in Radial slider */ value?: number; } export interface SlideEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** returns the value selected in Radial slider + /** returns the value selected in Radial slider */ selectedValue?: number; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the currently selected value + /** returns the currently selected value */ value?: number; } export interface StartEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the current value selected in Radial slider + /** returns the current value selected in Radial slider */ value?: number; } export interface StopEventArgs { - /** if the event should be canceled; otherwise, false. + /** if the event should be canceled; otherwise, false. */ cancel?: boolean; - /** returns the Radialslider model + /** returns the Radialslider model */ model?: any; - /** returns the name of the event + /** returns the name of the event */ type?: string; - /** returns the current value selected in Radial slider + /** returns the current value selected in Radial slider */ value?: number; } @@ -37762,11 +37621,10 @@ export interface StopEventArgs { class Spreadsheet extends ej.Widget { static fn: Spreadsheet; - constructor(element: JQuery, options?: Spreadsheet.Model); - constructor(element: Element, options?: Spreadsheet.Model); + constructor(element: JQuery | Element, options?: Spreadsheet.Model); static Locale: any; - model:Spreadsheet.Model; - defaults:Spreadsheet.Model; + model: Spreadsheet.Model; + defaults: Spreadsheet.Model; /** This method is used to add custom formulas in Spreadsheet. * @param {string} Pass the name of the formula. @@ -37781,28 +37639,28 @@ class Spreadsheet extends ej.Widget { addNewSheet(): void; /** It is used to clear all the data and format in the specified range of cells in Spreadsheet. - * @param {string|Array} Optional. If range is specified, then it will clear all content in the specified range else it will use the current selected range. + * @param {string|Array} Optional. If range is specified, then it will clear all content in the specified range else it will use the current selected range. * @returns {void} */ - clearAll(range?: string|Array): void; + clearAll(range?: string|any[]): void; /** This property is used to clear all the formats applied in the specified range in Spreadsheet. - * @param {string|Array} Optional. If range is specified, then it will clear all format in the specified range else it will use the current selected range. + * @param {string|Array} Optional. If range is specified, then it will clear all format in the specified range else it will use the current selected range. * @returns {void} */ - clearAllFormat(range?: string|Array): void; + clearAllFormat(range?: string|any[]): void; /** Used to clear the applied border in the specified range in Spreadsheet. * @param {string|Array} Optional. If range is specified, then it will clear border in the specified range else it will use the current selected range. * @returns {void} */ - clearBorder(range?: string|Array): void; + clearBorder(range?: string|any[]): void; /** This property is used to clear the contents in the specified range in Spreadsheet. - * @param {string|Array} Optional. If the range is specified, then it will clear the content in the specified range else it will use the current selected range. + * @param {string|Array} Optional. If the range is specified, then it will clear the content in the specified range else it will use the current selected range. * @returns {void} */ - clearContents(range?: string|Array): void; + clearContents(range?: string|any[]): void; /** This method is used to remove only the data in the range denoted by the specified range name. * @param {string} Pass the defined rangeSettings property name. @@ -37811,15 +37669,15 @@ class Spreadsheet extends ej.Widget { clearRange(rangeName: string): void; /** It is used to remove data in the specified range of cells based on the defined property. - * @param {Array|string} Optional. If range is specified, it will clear data for the specified range else it will use the current selected range. - * @param {string} Optional. If property is specified, it will remove the specified property in the range else it will remove default properties + * @param {Array|string} Optional. If range is specified, it will clear data for the specified range else it will use the current selected range. + * @param {string} Optional. If property is specified, it will remove the specified property in the range else it will remove default properties * @param {any} Optional. - * @param {boolean} Optional. pass {{'`true`' | markdownify}}, if you want to skip the hidden rows + * @param {boolean} Optional. pass {{'`true`' | markdownify}}, if you want to skip the hidden rows * @param {any} Optional. Pass the status to perform undo and redo operation. * @param {any} Optional. It specifies whether to skip element processing or not. * @returns {void} */ - clearRangeData(range?: Array|string, property?: string, cells?: any, skipHiddenRow?: boolean, status?: any, skipCell?: any): void; + clearRangeData(range?: any[]|string, property?: string, cells?: any, skipHiddenRow?: boolean, status?: any, skipCell?: any): void; /** This method is used to clear undo and redo collections in the Spreadsheet. * @returns {void} @@ -37873,7 +37731,7 @@ class Spreadsheet extends ej.Widget { * @param {Function} Pass the function that you want to perform range edit. * @returns {void} */ - editRange(rangeName: string, fn: Function): void; + editRange(rangeName: string, fn: any): void; /** This method is used to get the activation panel in the Spreadsheet. * @returns {HTMLElement} @@ -37943,16 +37801,16 @@ class Spreadsheet extends ej.Widget { getRange(range: string, sheetIdx: number, skipHiddenRow?: boolean): HTMLElement; /** This method is used to get the data in specified range in Spreadsheet. - * @param {any} Optional. Pass the range, property, sheetIdx, valueOnly in options. + * @param {any} Optional. Pass the range, property, sheetIdx, valueOnly in options. * @returns {Array} */ - getRangeData(options?: any): Array; + getRangeData(options?: any): any[]; /** This method is used to get the range indices array based on the specified alpha range in Spreadsheet. * @param {string} Pass the alpha range that you want to get range indices. * @returns {Array} */ - getRangeIndices(range: string): Array; + getRangeIndices(range: string): any[]; /** This method is used to get the sheet details based on the given sheet index in Spreadsheet. * @param {number} Pass the sheet index to get the sheet object. @@ -37969,7 +37827,7 @@ class Spreadsheet extends ej.Widget { /** This method is used to get all the sheets in workbook. * @returns {Array} */ - getSheets(): Array; + getSheets(): any[]; /** This method is used to send a paging request to the specified sheet Index in the Spreadsheet. * @param {number} Pass the sheet index to perform paging at specified sheet index @@ -38058,7 +37916,7 @@ class Spreadsheet extends ej.Widget { * @param {string} Optional. By default is {{'`true`' | markdownify}}. If it is {{'`false`' | markdownify}} locked cells are unlocked. * @returns {void} */ - lockCells(range: string|Array, isLocked?: string): void; + lockCells(range: string|any[], isLocked?: string): void; /** This method is used to merge cells by across in the Spreadsheet. * @param {string} Optional. To pass the cell range or selected cells are process. @@ -38072,7 +37930,7 @@ class Spreadsheet extends ej.Widget { * @param {boolean} Optional. If pass {{'`true`' | markdownify}} it does not show alert. * @returns {void} */ - mergeCells(range?: string|Array, alertStatus?: boolean): void; + mergeCells(range?: string|any[], alertStatus?: boolean): void; /** This method is used to select a cell or range in the Spreadsheet. * @param {any} Pass the start cell to perform selection. @@ -38125,7 +37983,7 @@ class Spreadsheet extends ej.Widget { * @param {string|Array} Pass the range. * @returns {void} */ - removeReadOnly(range?: string|Array): void; + removeReadOnly(range?: string|any[]): void; /** This method is used to save JSON data in Spreadsheet. * @returns {any} @@ -38163,7 +38021,7 @@ class Spreadsheet extends ej.Widget { * @param {Array|any} Pass the row index and height of the rows. * @returns {void} */ - setHeightToRows(heightColl: Array|any): void; + setHeightToRows(heightColl: any[]|any): void; /** This method is used to set the hyperlink in selected cells of the current sheet. * @param {string|Array} If range is specified, it will set the hyperlink in range of the cells. @@ -38171,13 +38029,13 @@ class Spreadsheet extends ej.Widget { * @param {number} If we pass cellAddress then which sheet to be navigate in the applied link. * @returns {void} */ - setHyperlink(range: string|Array, link: any, sheetIdx: number): void; + setHyperlink(range: string|any[], link: any, sheetIdx: number): void; /** This method is used to set the readonly option for the specified range. * @param {string|Array} Pass the range. * @returns {void} */ - setReadOnly(range?: string|Array): void; + setReadOnly(range?: string|any[]): void; /** This method is used to set the focus to the Spreadsheet. * @returns {void} @@ -38188,7 +38046,7 @@ class Spreadsheet extends ej.Widget { * @param {Array|any} Pass the column index and width of the columns. * @returns {void} */ - setWidthToColumns(widthColl: Array|any): void; + setWidthToColumns(widthColl: any[]|any): void; /** This method is used to rename the active sheet. * @param {string} Pass the sheet name that you want to change the current active sheet name. @@ -38265,14 +38123,14 @@ class Spreadsheet extends ej.Widget { * @param {Array|string} Optional. If the range is specified, then it will update unwrap in the specified range else it will use the current selected range. * @returns {void} */ - unWrapText(range?: Array|string): void; + unWrapText(range?: any[]|string): void; /** This method is used to update the data for the specified range of cells in the Spreadsheet. * @param {any} Pass the cells data that you want to update. - * @param {Array|string} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. + * @param {Array|string} Optional. If range is specified, it will update data for the specified range else it will use the current selected range. * @returns {void} */ - updateData(data: any, range?: Array|string): void; + updateData(data: any, range?: any[]|string): void; /** This method is used to update the formula bar in the Spreadsheet. * @returns {void} @@ -38298,13 +38156,13 @@ class Spreadsheet extends ej.Widget { * @param {any} Optional. It specifies whether to skip element processing or not. * @returns {void} */ - updateUniqueData(data: any, range?: Array|string, skipCell?: any): void; + updateUniqueData(data: any, range?: any[]|string, skipCell?: any): void; /** This method is used to wrap the selected range of cells in the Spreadsheet. * @param {Array|string} Optional. If the range is specified, then it will update wrap in the specified range else it will use the current selected range. * @returns {void} */ - wrapText(range?: Array|string): void; + wrapText(range?: any[]|string): void; XLCellType: Spreadsheet.XLCellType; @@ -38355,7 +38213,7 @@ class Spreadsheet extends ej.Widget { XLValidate: Spreadsheet.XLValidate; } -export module Spreadsheet{ +export namespace Spreadsheet { export interface XLCellType { @@ -38365,14 +38223,14 @@ export interface XLCellType { * @param {number} Optional. Pass sheet index. * @returns {void} */ - addCellTypes(range: string,settings: any,sheetIdx: number): void; + addCellTypes(range: string, settings: any, sheetIdx: number): void; /** This method is used to remove cell type from the specified range of cells in the Spreadsheet. * @param {string|Array} Pass the range where you want remove cell type. * @param {number} Optional. Pass sheet index. * @returns {void} */ - removeCellTypes(range: string|Array,sheetIdx: number): void; + removeCellTypes(range: string|any[], sheetIdx: number): void; } export interface XLCFormat { @@ -38382,14 +38240,14 @@ export interface XLCFormat { * @param {Array|string} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. * @returns {void} */ - clearCF(isSelected: boolean,range: Array|string): void; + clearCF(isSelected: boolean, range: any[]|string): void; /** This method is used to get the applied conditional formatting rules as array of objects based on the specified row Index and column Index in the Spreadsheet. * @param {number} Pass the row index. * @param {number} Pass the column index. * @returns {Array} */ - getCFRule(rowIdx: number,colIdx: number): Array; + getCFRule(rowIdx: number, colIdx: number): any[]; /** This method is used to set the conditional formatting rule in the Spreadsheet. * @param {any} Pass the rule to set. @@ -38405,14 +38263,14 @@ export interface XLChart { * @param {ej.datavisualization.Chart.Theme} Pass the chart theme which want to update. * @returns {void} */ - changeTheme(chartId: string,theme: ej.datavisualization.Chart.Theme): void; + changeTheme(chartId: string, theme: ej.datavisualization.Chart.Theme): void; /** This method is used to change the type of the chart in the Spreadsheet. * @param {string} Pass the chart id. * @param {any} Pass the chart type. * @returns {void} */ - changeType(chartId: string,option: any): void; + changeType(chartId: string, option: any): void; /** This method is used to change the data range of the chart in the Spreadsheet. * @param {string} Pass the chart id. @@ -38421,21 +38279,21 @@ export interface XLChart { * @param {string} Legend range of chart data. * @returns {void} */ - changeDataRange(chartId: string,xRange: string,yRange: string,lRange: string): void; + changeDataRange(chartId: string, xRange: string, yRange: string, lRange: string): void; /** This method is used to create a chart for specified range in Spreadsheet. * @param {string|Array} Optional. If range is specified, it will create chart for the specified range else it will use the current selected range. * @param {any} Optional. To pass the type of chart and chart name. * @returns {void} */ - createChart(range: string|Array,options: any): void; + createChart(range: string|any[], options: any): void; /** This method is used to refresh the chart in the Spreadsheet. * @param {string} To pass the chart Id. * @param {any} To pass the type of chart and chart name. * @returns {void} */ - refreshChart(id: string,options: any): void; + refreshChart(id: string, options: any): void; /** This method is used to resize the chart of specified id in the Spreadsheet. * @param {string} To pass the chart id. @@ -38443,14 +38301,14 @@ export interface XLChart { * @param {number} To pass the width value. * @returns {void} */ - resizeChart(id: string,height: number,width: number): void; + resizeChart(id: string, height: number, width: number): void; /** This method is used to update the chart element, such as axes, titles, data labels, grid lines and legends in the Spreadsheet. * @param {string} Pass the chart id. * @param {ej.Spreadsheet.ChartProperties} Pass chart element value which you want to update. * @returns {void} */ - updateChartElement(chartId: string,value: ej.Spreadsheet.ChartProperties): void; + updateChartElement(chartId: string, value: ej.Spreadsheet.ChartProperties): void; /** This method is used switch row to columns and vice versa for chart in the Spreadsheet. So that the data is displayed in the chart the way you want. * @param {string} Pass the chart id. @@ -38480,15 +38338,15 @@ export interface XLClipboard { export interface XLComment { /** This method is used to delete the comment in the specified range in Spreadsheet. - * @param {Array|string} Optional. If range is specified, it will delete comments for the specified range else it will use the current selected range. + * @param {Array|string} Optional. If range is specified, it will delete comments for the specified range else it will use the current selected range. * @param {number} Optional. If sheetIdx is specified, it will delete comment in specified sheet else it will use active sheet. * @param {boolean} Optional. Pass {{'`true`' | markdownify}}, if you want to skip the hidden rows data. * @returns {void} */ - deleteComment(range: Array|string,sheetIdx: number,skipHiddenRow: boolean): void; + deleteComment(range: any[]|string, sheetIdx: number, skipHiddenRow: boolean): void; /** This method is used to edit the comment in the target Cell in Spreadsheet. - * @param {any} Optional. Pass the row index and column index of the cell which contains comment. + * @param {any} Optional. Pass the row index and column index of the cell which contains comment. * @returns {void} */ editComment(targetCell: any): void; @@ -38510,13 +38368,13 @@ export interface XLComment { getComment(cell: HTMLElement): any; /** This method is used to set new comment in Spreadsheet. - * @param {string|Array} Optional. If we pass the range comment will set in the range otherwise it will set with selected cells. + * @param {string|Array} Optional. If we pass the range comment will set in the range otherwise it will set with selected cells. * @param {string} Optional. Pass the comment data. - * @param {boolean} Optional. Pass {{'`true`' | markdownify}} to show comment in edit mode - * @param {boolean} Optional. Pass {{'`true`' | markdownify}} to show the user name + * @param {boolean} Optional. Pass {{'`true`' | markdownify}} to show comment in edit mode + * @param {boolean} Optional. Pass {{'`true`' | markdownify}} to show the user name * @returns {void} */ - setComment(range: string|Array,data: string,showEditPanel: boolean,showUserName: boolean): void; + setComment(range: string|any[], data: string, showEditPanel: boolean, showUserName: boolean): void; /** This method is used to show all the comments in the Spreadsheet. * @returns {void} @@ -38538,35 +38396,35 @@ export interface XLCMenu { * @param {string} Specifies the type of operation to be performed * @returns {void} */ - addItem(target: string,itemColl: Array,operation: string): void; + addItem(target: string, itemColl: any[], operation: string): void; /** This method is used to change data source in the context menu. * @param {string} Specifies the context menu type to bind the data source. * @param {Array} Pass the data source to be binded * @returns {void} */ - changeDataSource(target: string,data: Array): void; + changeDataSource(target: string, data: any[]): void; /** This method is used to disable the items in the context menu. * @param {string} Specifies the context menu type in which the item to be disabled. * @param {Array} Specifies the Menu Item id collection to be disabled * @returns {void} */ - disableItem(target: string,idxColl: Array): void; + disableItem(target: string, idxColl: any[]): void; /** This method is used to enable the items in the context menu. * @param {string} Specifies the context menu type in which the item to be enabled. * @param {Array} Specifies the Menu Item id collection to be enabled * @returns {void} */ - enableItem(target: string,idxColl: Array): void; + enableItem(target: string, idxColl: any[]): void; /** This method is used to remove the items in the context menu. * @param {string} Specifies the context menu type in which the item to be removed. * @param {Array} Specifies the Menu Item id collection to be removed * @returns {void} */ - removeItem(target: string,idxColl: Array): void; + removeItem(target: string, idxColl: any[]): void; } export interface XLDragDrop { @@ -38576,7 +38434,7 @@ export interface XLDragDrop { * @param {any|Array} Pass the destination range to drop the dragged cells. * @returns {void} */ - moveRangeTo(sourceRange: any|Array,destinationRange: any|Array): void; + moveRangeTo(sourceRange: any|any[], destinationRange: any|any[]): void; } export interface XLDragFill { @@ -38618,7 +38476,7 @@ export interface XLEdit { * @param {boolean} Pass {{'`true`' | markdownify}}, if you want to maintain previous cell value. * @returns {void} */ - editCell(rowIdx: number,colIdx: number,oldData: boolean): void; + editCell(rowIdx: number, colIdx: number, oldData: boolean): void; /** This method is used to get the property value of particular cell, based on the row and column index in the Spreadsheet. * @param {number} Pass the row index to get the property value. @@ -38627,7 +38485,7 @@ export interface XLEdit { * @param {number} Optional. Pass the index of the sheet. * @returns {any|string|Array} */ - getPropertyValue(rowIdx: number,colIdx: number,prop: string,sheetIdx: number): any|string|Array; + getPropertyValue(rowIdx: number, colIdx: number, prop: string, sheetIdx: number): any|string|any[]; /** This method is used to get the property value in specified cell in Spreadsheet. * @param {HTMLElement} Pass the cell element to get property value. @@ -38635,7 +38493,7 @@ export interface XLEdit { * @param {number} Pass the index of sheet. * @returns {any|string|Array} */ - getPropertyValueByElem(elem: HTMLElement,property: string,sheetIdx: number): any|string|Array; + getPropertyValueByElem(elem: HTMLElement, property: string, sheetIdx: number): any|string|any[]; /** This method is used to save the edited cell value in the Spreadsheet. * @returns {void} @@ -38647,22 +38505,22 @@ export interface XLEdit { * @param {string|number} Pass the cell value. * @returns {void} */ - updateCell(cell: any,value: string|number): void; + updateCell(cell: any, value: string|number): void; /** This method is used to update a particular cell value and its format in the Spreadsheet. * @param {any} Pass row index and column index of the cell. * @param {string|number} Pass the cell value. - * @param {string} Pass the class name to update format. + * @param {string} Pass the class name to update format. * @param {number} Pass sheet index. * @returns {void} */ - updateCellValue(cellIdx: any,val: string|number,formatClass: string,sheetIdx: number): void; + updateCellValue(cellIdx: any, val: string|number, formatClass: string, sheetIdx: number): void; } export interface XLExport { /** This method is used to save the sheet data as Excel ,CSV or PDF document (.xls, .xlsx .csv, .pdf) in Spreadsheet. - * @param {string} Pass the export type that you want. + * @param {string} Pass the export type that you want. * @returns {void} */ export(type: string): void; @@ -38684,7 +38542,7 @@ export interface XLFilter { * @param {string|Array} Pass the range of the selected cells. * @returns {void} */ - filter(range: string|Array): void; + filter(range: string|any[]): void; /** This method is used to apply filter for the column by active cell's value in the Spreadsheet. * @returns {void} @@ -38702,24 +38560,24 @@ export interface XLFormat { /** This method is used to create a table for the selected range of cells in the Spreadsheet. * @param {any} Pass the table object. - * @param {string|Array} Optional. If the range is specified, then it will create table in the specified range else it will use the current selected range. + * @param {string|Array} Optional. If the range is specified, then it will create table in the specified range else it will use the current selected range. * @returns {string} */ - createTable(tableObject: any,range: string|Array): string; + createTable(tableObject: any, range: string|any[]): string; /** This method is used to set format style and values in a cell or range of cells. * @param {any} Pass the formatObject which contains style, type, format, groupSeparator and decimalPlaces. * @param {string} Pass the range to format cells. * @returns {void} */ - format(formatObj: any,range: string): void; + format(formatObj: any, range: string): void; /** This method is used to remove the style in the specified range. * @param {Array|string} Pass the cell range . * @param {any} Optional. Pass the options for which the style gets removed. * @returns {void} */ - removeStyle(range: Array|string,options: any): void; + removeStyle(range: any[]|string, options: any): void; /** This method is used to remove table with specified tableId in the Spreadsheet. * @param {number} Pass the tableId that you want to remove. @@ -38732,21 +38590,21 @@ export interface XLFormat { * @param {string|Array} Pass the range. * @returns {void} */ - updateDecimalPlaces(type: string,range: string|Array): void; + updateDecimalPlaces(type: string, range: string|any[]): void; /** This method is used to update the format for the selected range of cells in the Spreadsheet. * @param {any} Pass the format object that you want to update. - * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. + * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. * @returns {void} */ - updateFormat(formatObj: any,range: Array): void; + updateFormat(formatObj: any, range: any[]): void; /** This method is used to update the unique format for selected range of cells in the Spreadsheet. * @param {string} Pass the unique format class. * @param {Array} Optional. If the range is specified, then it will update format in the specified range else it will use the current selected range. * @returns {void} */ - updateUniqueFormat(formatClass: string,range: Array): void; + updateUniqueFormat(formatClass: string, range: any[]): void; } export interface XLFreeze { @@ -38783,7 +38641,7 @@ export interface XLFreeze { export interface XLPivot { /** This property is used to clear the pivot table list in Spreadsheet. - * @param {string} Pass the name of the pivot table. + * @param {string} Pass the name of the pivot table. * @returns {void} */ clearPivotFieldList(pivotName: string): void; @@ -38796,7 +38654,7 @@ export interface XLPivot { * @param {any} Pass the pivot range, sheet index, address and data source . * @returns {string} */ - createPivotTable(range: string,location: string,name: string,settings: any,pvt: any): string; + createPivotTable(range: string, location: string, name: string, settings: any, pvt: any): string; /** This method is used to delete the pivot table which is selected. * @param {string} Pass the name of the pivot table. @@ -38809,7 +38667,7 @@ export interface XLPivot { * @param {number} Optional. Pass the index of the sheet. * @returns {void} */ - refreshDataSource(name: string,sheetIdx: number): void; + refreshDataSource(name: string, sheetIdx: number): void; } export interface XLPrint { @@ -38831,13 +38689,13 @@ export interface XLResize { * @param {Array} Optional. Pass row index collection that you want to fit its height. * @returns {void} */ - fitHeight(rowIndexes: Array): void; + fitHeight(rowIndexes: any[]): void; /** This method is used to fit the width of columns in the Spreadsheet. * @param {Array} Optional. Pass column index collection that you want to fit its width. * @returns {void} */ - fitWidth(colIndexes: Array): void; + fitWidth(colIndexes: any[]): void; /** This method is used to get the column width of the specified column index in the Spreadsheet. * @param {number} Pass the column index. @@ -38856,14 +38714,14 @@ export interface XLResize { * @param {number} Pass the width value that you want to set. * @returns {void} */ - setColWidth(colIdx: number,size: number): void; + setColWidth(colIdx: number, size: number): void; /** This method is used to set the row height of the specified row index in the Spreadsheet. * @param {number} Pass the row index. * @param {number} Pass the height value that you want to set. * @returns {void} */ - setRowHeight(rowIdx: number,size: number): void; + setRowHeight(rowIdx: number, size: number): void; } export interface XLRibbon { @@ -38873,21 +38731,21 @@ export interface XLRibbon { * @param {number} pass the index of the item to be added in the backstage. * @returns {void} */ - addBackStageItem(pageItem: any,index: number): void; + addBackStageItem(pageItem: any, index: number): void; /** This method is used to dynamically add the contextual tabs in the ribbon. * @param {any} Specifies the contextual tab set object. * @param {number} pass the index of the contextual tab. * @returns {void} */ - addContextualTabs(contextualTabSet: any,index: number): void; + addContextualTabs(contextualTabSet: any, index: number): void; /** This method is used to dynamically add the menu item in the file menu. * @param {Array} Specifies the item to be added * @param {number} pass the index of the menu item. * @returns {void} */ - addMenuItem(item: Array,index: number): void; + addMenuItem(item: any[], index: number): void; /** This method is used to add a new name in the Spreadsheet name manager. * @param {string} Pass the name that you want to define in name manager. @@ -38896,7 +38754,7 @@ export interface XLRibbon { * @param {number} Optional. Pass the sheet index. * @returns {void} */ - addNamedRange(name: string,refersTo: string,comment: string,sheetIdx: number): void; + addNamedRange(name: string, refersTo: string, comment: string, sheetIdx: number): void; /** This method is used to dynamically add the tab in the ribbon. * @param {Array} Specifies the text to be displayed in the tab. @@ -38904,7 +38762,7 @@ export interface XLRibbon { * @param {number} pass the index of the tab. * @returns {void} */ - addTab(tabText: Array,ribbonGroups: number,index: number): void; + addTab(tabText: any[], ribbonGroups: number, index: number): void; /** This method is used to dynamically add the tab group in the ribbon. * @param {number} Specifies the ribbon tab index. @@ -38912,14 +38770,14 @@ export interface XLRibbon { * @param {number} pass the index of the ribbon group. * @returns {void} */ - addTabGroup(tabIndex: number,tabGroup: any,groupIndex: number): void; + addTabGroup(tabIndex: number, tabGroup: any, groupIndex: number): void; /** This method is used to insert the few type (SUM, MAX, MIN, AVG, COUNT) of formulas in the selected range of cells in the Spreadsheet. * @param {string} To pass the type("SUM","MAX","MIN","AVG","COUNT"). * @param {string|Array} If range is specified, it will apply auto sum for the specified range else it will use the current selected range. * @returns {void} */ - autoSum(type: string,range: string|Array): void; + autoSum(type: string, range: string|any[]): void; /** This method is used to hide the file menu in the ribbon tab. * @returns {void} @@ -38949,14 +38807,14 @@ export interface XLRibbon { * @param {boolean} pass the boolean value to remove the tab from ribbon * @returns {void} */ - removeTab(index: number,isRemoveMenu: boolean): void; + removeTab(index: number, isRemoveMenu: boolean): void; /** This method is used to remove the tab group form ribbon in the spreadsheet. * @param {number} Specifies the index of the tab group to be removed from the ribbon. * @param {string} Specifies the text to be displayed in the tab group * @returns {void} */ - removeTabGroup(tabIndex: number,groupText: string): void; + removeTabGroup(tabIndex: number, groupText: string): void; /** This method is used to show the file menu in the ribbon tab. * @returns {void} @@ -38968,7 +38826,7 @@ export interface XLRibbon { * @param {number} pass the index of the item to be updated * @returns {void} */ - updateMenuItem(item: any,index: number): void; + updateMenuItem(item: any, index: number): void; /** This method is used to update the ribbon icons in the Spreadsheet. * @returns {void} @@ -38985,7 +38843,7 @@ export interface XLSearch { * @param {boolean} Pass {{'`true`' | markdownify}}, if you want to match with entire cell contents. * @returns {void} */ - replaceAllByBook(findData: string,replaceData: string,isCSen: boolean,isEMatch: boolean): void; + replaceAllByBook(findData: string, replaceData: string, isCSen: boolean, isEMatch: boolean): void; /** This method is used to find and replace all data by sheet in Spreadsheet. * @param {string} Pass the search data. @@ -38994,7 +38852,7 @@ export interface XLSearch { * @param {boolean} Pass {{'`true`' | markdownify}}, if you want to match with entire cell contents. * @returns {void} */ - replaceAllBySheet(findData: string,replaceData: string,isCSen: boolean,isEMatch: boolean): void; + replaceAllBySheet(findData: string, replaceData: string, isCSen: boolean, isEMatch: boolean): void; } export interface XLSelection { @@ -39014,7 +38872,7 @@ export interface XLSelection { * @param {Array|string} Optional. Pass range to refresh selection. * @returns {void} */ - refreshSelection(range: Array|string): void; + refreshSelection(range: any[]|string): void; /** This method is used to select a single column in the Spreadsheet. * @param {number} Pass the column index value. @@ -39027,7 +38885,7 @@ export interface XLSelection { * @param {number} Pass the column end index. * @returns {void} */ - selectColumns(startIdx: number,endIdx: number): void; + selectColumns(startIdx: number, endIdx: number): void; /** This method is used to select the specified range of cells in the Spreadsheet. * @param {string} Pass range which want to select. @@ -39046,7 +38904,7 @@ export interface XLSelection { * @param {number} Pass the end row index. * @returns {void} */ - selectRows(startIdx: number,endIdx: number): void; + selectRows(startIdx: number, endIdx: number): void; /** This method is used to select all cells in active sheet. * @returns {void} @@ -39065,7 +38923,7 @@ export interface XLShape { * @param {number} Optional. Pass the left of the image that you want to set. * @returns {string} */ - setPicture(range: string,url: string,width: number,height: number,top: number,left: number): string; + setPicture(range: string, url: string, width: number, height: number, top: number, left: number): string; } export interface XLSort { @@ -39076,7 +38934,7 @@ export interface XLSort { * @param {string} Pass the range * @returns {void} */ - sortByColor(operation: string,color: any,range: string): void; + sortByColor(operation: string, color: any, range: string): void; /** This method is used to sort a particular range of cells based on its values in the Spreadsheet. * @param {Array|string} Pass the range to sort. @@ -39084,32 +38942,32 @@ export interface XLSort { * @param {any} Pass the direction to sort (ascending or descending). * @returns {boolean} */ - sortByRange(range: Array|string,columnName: string,direction: any): boolean; + sortByRange(range: any[]|string, columnName: string, direction: any): boolean; } export interface XLValidate { /** This method is used to apply data validation rules in a selected range of cells based on the defined condition in the Spreadsheet. - * @param {string|Array} If range is specified, it will apply rules for the specified range else it will use the current selected range. + * @param {string|Array} If range is specified, it will apply rules for the specified range else it will use the current selected range. * @param {Array} Pass the validation condition, value1 and value2. * @param {string} Pass the data type. * @param {boolean} Pass {{'`true`' | markdownify}} if you ignore blank values. * @param {boolean} Pass {{'`true`' | markdownify}} if you want to show an error alert. * @returns {void} */ - applyDVRules(range: string|Array,values: Array,type: string,required: boolean,showErrorAlert: boolean): void; + applyDVRules(range: string|any[], values: any[], type: string, required: boolean, showErrorAlert: boolean): void; /** This method is used to clear the applied validation rules in a specified range of cells in the Spreadsheet. - * @param {string|Array} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. + * @param {string|Array} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. * @returns {void} */ - clearDV(range: string|Array): void; + clearDV(range: string|any[]): void; /** This method is used to highlight invalid data in a specified range of cells in the Spreadsheet. * @param {string|Array} Optional. If range is specified, it will clear rules for the specified range else it will use the current selected range. * @returns {void} */ - highlightInvalidData(range: string|Array): void; + highlightInvalidData(range: string|any[]): void; } export interface Model { @@ -39309,7 +39167,7 @@ export interface Model { /** Gets or sets a value that indicates custom formulas in Spreadsheet. * @Default {[]} */ - customFormulas?: Array; + customFormulas?: any[]; /** Gets or sets a value that indicates whether to enable or disable context menu in the Spreadsheet. * @Default {true} @@ -39385,7 +39243,7 @@ export interface Model { /** Gets or sets an object that indicates to customize the sheet behavior in Spreadsheet. */ - sheets?: Array; + sheets?: Sheet[]; /** Gets or sets a value that indicates whether to show or hide pager in the Spreadsheet. * @Default {true} @@ -39408,118 +39266,118 @@ export interface Model { userName?: string; /** Triggered for every action before its starts. */ - actionBegin? (e: ActionBeginEventArgs): void; + actionBegin?(e: ActionBeginEventArgs): void; /** Triggered for every action complete. */ - actionComplete? (e: ActionCompleteEventArgs): void; + actionComplete?(e: ActionCompleteEventArgs): void; /** Triggered when the auto fill operation begins. */ - autoFillBegin? (e: AutoFillBeginEventArgs): void; + autoFillBegin?(e: AutoFillBeginEventArgs): void; /** Triggered when the auto fill operation completes. */ - autoFillComplete? (e: AutoFillCompleteEventArgs): void; + autoFillComplete?(e: AutoFillCompleteEventArgs): void; /** Triggered before the batch save. */ - beforeBatchSave? (e: BeforeBatchSaveEventArgs): void; + beforeBatchSave?(e: BeforeBatchSaveEventArgs): void; /** Triggered before the cells to be formatted. */ - beforeCellFormat? (e: BeforeCellFormatEventArgs): void; + beforeCellFormat?(e: BeforeCellFormatEventArgs): void; /** Triggered before the cell selection. */ - beforeCellSelect? (e: BeforeCellSelectEventArgs): void; + beforeCellSelect?(e: BeforeCellSelectEventArgs): void; /** Triggered before the selected cells are dropped. */ - beforeDrop? (e: BeforeDropEventArgs): void; + beforeDrop?(e: BeforeDropEventArgs): void; /** Triggered while start to edit the comment. */ - beforeEditComment? (e: BeforeEditCommentEventArgs): void; + beforeEditComment?(e: BeforeEditCommentEventArgs): void; /** Triggered before the contextmenu is open. */ - beforeOpen? (e: BeforeOpenEventArgs): void; + beforeOpen?(e: BeforeOpenEventArgs): void; /** Triggered before the activation panel is open. */ - beforePanelOpen? (e: BeforePanelOpenEventArgs): void; + beforePanelOpen?(e: BeforePanelOpenEventArgs): void; /** Triggered when click on sheet cell. */ - cellClick? (e: CellClickEventArgs): void; + cellClick?(e: CellClickEventArgs): void; /** Triggered when the cell is edited. */ - cellEdit? (e: CellEditEventArgs): void; + cellEdit?(e: CellEditEventArgs): void; /** Triggered while cell is formatting. */ - cellFormatting? (e: CellFormattingEventArgs): void; + cellFormatting?(e: CellFormattingEventArgs): void; /** Triggered when mouse hover on cell in sheets. */ - cellHover? (e: CellHoverEventArgs): void; + cellHover?(e: CellHoverEventArgs): void; /** Triggered when save the edited cell. */ - cellSave? (e: CellSaveEventArgs): void; + cellSave?(e: CellSaveEventArgs): void; /** Triggered when the cell is selected. */ - cellSelected? (e: CellSelectedEventArgs): void; + cellSelected?(e: CellSelectedEventArgs): void; /** Triggered when click the contextmenu items. */ - contextMenuClick? (e: ContextMenuClickEventArgs): void; + contextMenuClick?(e: ContextMenuClickEventArgs): void; /** Triggered when the selected cells are being dragged. */ - drag? (e: DragEventArgs): void; + drag?(e: DragEventArgs): void; /** Triggered when you start to drag the picture or chart. */ - dragShape? (e: DragShapeEventArgs): void; + dragShape?(e: DragShapeEventArgs): void; /** Triggered when the selected cells are initiated to drag. */ - dragStart? (e: DragStartEventArgs): void; + dragStart?(e: DragStartEventArgs): void; /** Triggered when the selected cells are dropped. */ - drop? (e: DropEventArgs): void; + drop?(e: DropEventArgs): void; /** Triggered before the range editing starts. */ - editRangeBegin? (e: EditRangeBeginEventArgs): void; + editRangeBegin?(e: EditRangeBeginEventArgs): void; /** Triggered after range editing completes. */ - editRangeComplete? (e: EditRangeCompleteEventArgs): void; + editRangeComplete?(e: EditRangeCompleteEventArgs): void; /** Triggered when the key is pressed down. */ - keyDown? (e: KeyDownEventArgs): void; + keyDown?(e: KeyDownEventArgs): void; /** Triggered when the key is released. */ - keyUp? (e: KeyUpEventArgs): void; + keyUp?(e: KeyUpEventArgs): void; /** Triggered before the sheet is loaded. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Triggered after the sheet is loaded. */ - loadComplete? (e: LoadCompleteEventArgs): void; + loadComplete?(e: LoadCompleteEventArgs): void; /** Triggered every click of the menu item. */ - menuClick? (e: MenuClickEventArgs): void; + menuClick?(e: MenuClickEventArgs): void; /** Triggered when a file is imported. */ - onImport? (e: OnImportEventArgs): void; + onImport?(e: OnImportEventArgs): void; /** Triggered when import sheet is failed to open. */ - openFailure? (e: OpenFailureEventArgs): void; + openFailure?(e: OpenFailureEventArgs): void; /** Triggered when pager item is clicked in the Spreadsheet. */ - pagerClick? (e: PagerClickEventArgs): void; + pagerClick?(e: PagerClickEventArgs): void; /** Triggered when you start resizing the chart, picture, row and column. */ - resizeStart? (e: ResizeStartEventArgs): void; + resizeStart?(e: ResizeStartEventArgs): void; /** Triggered after end of resizing the chart, picture, row and column. */ - resizeEnd? (e: ResizeEndEventArgs): void; + resizeEnd?(e: ResizeEndEventArgs): void; /** Triggered when click on the ribbon. */ - ribbonClick? (e: RibbonClickEventArgs): void; + ribbonClick?(e: RibbonClickEventArgs): void; /** Triggered when the chart series rendering. */ - seriesRendering? (e: SeriesRenderingEventArgs): void; + seriesRendering?(e: SeriesRenderingEventArgs): void; /** Triggered when click the ribbon tab. */ - tabClick? (e: TabClickEventArgs): void; + tabClick?(e: TabClickEventArgs): void; /** Triggered when select the ribbon tab. */ - tabSelect? (e: TabSelectEventArgs): void; + tabSelect?(e: TabSelectEventArgs): void; } export interface ActionBeginEventArgs { @@ -39538,7 +39396,7 @@ export interface ActionBeginEventArgs { /** Returns the cell range. */ - range?: Array; + range?: any[]; /** Returns the action format. */ @@ -39573,7 +39431,7 @@ export interface ActionCompleteEventArgs { /** Returns the applied cell format object. */ - selectedCell?: Array|any; + selectedCell?: any[]|any; /** Returns the sheet index. */ @@ -39596,7 +39454,7 @@ export interface AutoFillBeginEventArgs { /** Returns auto fill begin cell range. */ - dataRange?: Array; + dataRange?: any[]; /** Returns which direction drag the auto fill. */ @@ -39604,7 +39462,7 @@ export interface AutoFillBeginEventArgs { /** Returns fill cells range. */ - fillRange?: Array; + fillRange?: any[]; /** Returns the auto fill type. */ @@ -39631,7 +39489,7 @@ export interface AutoFillCompleteEventArgs { /** Returns auto fill begin cell range. */ - dataRange?: Array; + dataRange?: any[]; /** Returns which direction to drag the auto fill. */ @@ -39639,7 +39497,7 @@ export interface AutoFillCompleteEventArgs { /** Returns fill cells range. */ - fillRange?: Array; + fillRange?: any[]; /** Returns the auto fill type. */ @@ -39689,7 +39547,7 @@ export interface BeforeCellFormatEventArgs { /** Returns the selected cells. */ - cells?: Array|any; + cells?: any[]|any; /** Returns the Spreadsheet model. */ @@ -39708,11 +39566,11 @@ export interface BeforeCellSelectEventArgs { /** Returns the previous cell range. */ - prevRange?: Array; + prevRange?: any[]; /** Returns the current cell range. */ - currRange?: Array; + currRange?: any[]; /** Returns the Spreadsheet model. */ @@ -40018,7 +39876,7 @@ export interface CellSelectedEventArgs { /** Returns the selected range. */ - selectedRange?: Array; + selectedRange?: any[]; /** Returns the target element. */ @@ -40786,7 +40644,7 @@ export interface RibbonSettingsApplicationTabMenuSettings { /** Specifies the data source to append in application tab. * @Default {[]} */ - dataSource?: Array; + dataSource?: any[]; } export interface RibbonSettingsApplicationTab { @@ -40875,7 +40733,7 @@ export interface SelectionSettings { export interface SheetsBorder { - /** + /** */ type?: ej.Spreadsheet.BorderType|string; @@ -40901,7 +40759,7 @@ export interface SheetsCFormatRule { /** Specifies the inputs for conditional formatting in Spreadsheet. * @Default {[]} */ - inputs?: Array; + inputs?: any[]; /** Specifies the range for conditional formatting in Spreadsheet. */ @@ -41051,7 +40909,7 @@ export interface SheetsRow { /** Specifies the cells of a row in Spreadsheet. * @Default {[]} */ - cells?: Array; + cells?: SheetsRowsCell[]; /** Gets or sets the index of a row in Spreadsheet. * @Default {0} @@ -41064,12 +40922,12 @@ export interface Sheet { /** Specifies the border for the cell in the Spreadsheet. * @Default {[]} */ - border?: Array; + border?: SheetsBorder[]; /** Specifies the conditional formatting for the range of cell in Spreadsheet. * @Default {[]} */ - cFormatRule?: Array; + cFormatRule?: SheetsCFormatRule[]; /** Gets or sets a value that indicates to define column count in the Spreadsheet. * @Default {21} @@ -41099,17 +40957,17 @@ export interface Sheet { /** To hide the specified columns in Spreadsheet. * @Default {[]} */ - hideColumns?: Array; + hideColumns?: any[]; /** To hide the specified rows in Spreadsheet. * @Default {[]} */ - hideRows?: Array; + hideRows?: any[]; /** To merge specified ranges in Spreadsheet. * @Default {[]} */ - mergeCells?: Array; + mergeCells?: any[]; /** Specifies the primary key for the datasource in Spreadsheet. */ @@ -41123,7 +40981,7 @@ export interface Sheet { /** Specifies single range or multiple range settings for a sheet in Spreadsheet. * @Default {[]} */ - rangeSettings?: Array; + rangeSettings?: SheetsRangeSetting[]; /** Gets or sets a value that indicates to define row count in the Spreadsheet. * @Default {20} @@ -41133,7 +40991,7 @@ export interface Sheet { /** Specifies the rows for a sheet in Spreadsheet. * @Default {[]} */ - rows?: Array; + rows?: SheetsRow[]; /** Gets or sets a value that indicates whether to show or hide grid lines in the Spreadsheet. * @Default {true} @@ -41156,7 +41014,7 @@ export interface Sheet { startCell?: string; } -enum AutoFillOptions{ +enum AutoFillOptions { ///Specifies the CopyCells property in AutoFillOptions. CopyCells, @@ -41175,7 +41033,7 @@ enum AutoFillOptions{ } -enum scrollMode{ +enum scrollMode { ///To enable Infinite scroll mode for Spreadsheet. Infinite, @@ -41185,7 +41043,7 @@ enum scrollMode{ } -enum SelectionType{ +enum SelectionType { ///To select only Column in Spreadsheet. Column, @@ -41198,7 +41056,7 @@ enum SelectionType{ } -enum SelectionUnit{ +enum SelectionUnit { ///To enable Single selection in Spreadsheet Single, @@ -41211,7 +41069,7 @@ enum SelectionUnit{ } -enum BorderType{ +enum BorderType { ///To apply top border for the given range of cell. Top, @@ -41245,7 +41103,7 @@ enum BorderType{ } -enum CFormatRule{ +enum CFormatRule { ///To identify greater than values in the given range of cells. GreaterThan, @@ -41267,7 +41125,7 @@ enum CFormatRule{ } -enum CFormatHighlightColor{ +enum CFormatHighlightColor { ///Highlights red with dark red text color. RedFillwithDarkRedText, @@ -41286,7 +41144,7 @@ enum CFormatHighlightColor{ } -enum ChartProperties{ +enum ChartProperties { ///Specifies to make the data label center of the chart. DataLabelCenter, @@ -41359,11 +41217,10 @@ enum ChartProperties{ class PdfViewer extends ej.Widget { static fn: PdfViewer; - constructor(element: JQuery, options?: PdfViewer.Model); - constructor(element: Element, options?: PdfViewer.Model); + constructor(element: JQuery | Element, options?: PdfViewer.Model); static Locale: any; - model:PdfViewer.Model; - defaults:PdfViewer.Model; + model: PdfViewer.Model; + defaults: PdfViewer.Model; /** Loads the document with the filename and displays it in PDF viewer. * @param {string} File name to be loaded @@ -41473,7 +41330,7 @@ class PdfViewer extends ej.Widget { */ unload(): void; } -export module PdfViewer{ +export namespace PdfViewer { export interface Model { @@ -41542,34 +41399,34 @@ export interface Model { fileName?: string; /** Triggers when the PDF document gets loaded and is ready to view in the Control. */ - documentLoad? (e: DocumentLoadEventArgs): void; + documentLoad?(e: DocumentLoadEventArgs): void; /** Triggers when there is change in current page number. */ - pageChange? (e: PageChangeEventArgs): void; + pageChange?(e: PageChangeEventArgs): void; /** Triggers when there is change in the magnification value. */ - zoomChange? (e: ZoomChangeEventArgs): void; + zoomChange?(e: ZoomChangeEventArgs): void; /** Triggers when hyperlink in the PDF Document is clicked */ - hyperlinkClick? (e: HyperlinkClickEventArgs): void; + hyperlinkClick?(e: HyperlinkClickEventArgs): void; /** Triggers before the printing starts. */ - beforePrint? (e: BeforePrintEventArgs): void; + beforePrint?(e: BeforePrintEventArgs): void; /** Triggers after the printing is completed. */ - afterPrint? (e: AfterPrintEventArgs): void; + afterPrint?(e: AfterPrintEventArgs): void; /** Triggers when the mouse click is performed over the page of the PDF document. */ - pageClick? (e: PageClickEventArgs): void; + pageClick?(e: PageClickEventArgs): void; /** Triggers when the client buffering process starts. */ - bufferStart? (e: BufferStartEventArgs): void; + bufferStart?(e: BufferStartEventArgs): void; /** Triggers when the client buffering process ends. */ - bufferEnd? (e: BufferEndEventArgs): void; + bufferEnd?(e: BufferEndEventArgs): void; /** Triggers when PDF viewer control is destroyed successfully. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; } export interface DocumentLoadEventArgs { @@ -41784,7 +41641,7 @@ export interface ServerActionSettings { download?: string; } -enum ToolbarItems{ +enum ToolbarItems { ///Shows only magnification tools in the toolbar. MagnificationTools, @@ -41803,7 +41660,7 @@ enum ToolbarItems{ } -enum PdfService{ +enum PdfService { ///Denotes that the service is located in the local project Local, @@ -41813,9 +41670,9 @@ enum PdfService{ } -enum LinkTarget{ +enum LinkTarget { - ///Opens the hyperlink in the same tab of the browser. + ///Opens the hyperlink in the same tab of the browser. Default, ///Opens the hyperlink in a new tab of the browser. @@ -41829,11 +41686,10 @@ enum LinkTarget{ class SpellCheck extends ej.Widget { static fn: SpellCheck; - constructor(element: JQuery, options?: SpellCheck.Model); - constructor(element: Element, options?: SpellCheck.Model); + constructor(element: JQuery | Element, options?: SpellCheck.Model); static Locale: any; - model:SpellCheck.Model; - defaults:SpellCheck.Model; + model: SpellCheck.Model; + defaults: SpellCheck.Model; /** Open the dialog to correct the spelling of the target content. * @returns {void} @@ -41890,7 +41746,7 @@ class SpellCheck extends ej.Widget { */ addToDictionary(customWord: string): any; } -export module SpellCheck{ +export namespace SpellCheck { export interface Model { @@ -41916,7 +41772,7 @@ export interface Model { /** To ignore the words from the error word consideration. * @Default {[]} */ - ignoreWords?: Array; + ignoreWords?: any[]; /** Holds all options related to the context menu settings of SpellCheck. */ @@ -41937,40 +41793,39 @@ export interface Model { controlsToValidate?: string; /** Triggers on the success of AJAX call request. */ - actionSuccess? (e: ActionSuccessEventArgs): void; + actionSuccess?(e: ActionSuccessEventArgs): void; /** Triggers on the AJAX call request beginning. */ - actionBegin? (e: ActionBeginEventArgs): void; + actionBegin?(e: ActionBeginEventArgs): void; /** Triggers when the AJAX call request failure. */ - actionFailure? (e: ActionFailureEventArgs): void; + actionFailure?(e: ActionFailureEventArgs): void; /** Triggers when the dialog mode spell check starting. */ - start? (e: StartEventArgs): void; + start?(e: StartEventArgs): void; /** Triggers when the spell check operations completed through dialog mode. */ - complete? (e: CompleteEventArgs): void; + complete?(e: CompleteEventArgs): void; /** Triggers before context menu opening. */ - contextOpen? (e: ContextOpenEventArgs): void; + contextOpen?(e: ContextOpenEventArgs): void; /** Triggers when the context menu item clicked. */ - contextClick? (e: ContextClickEventArgs): void; + contextClick?(e: ContextClickEventArgs): void; /** Triggers before the spell check dialog opens. */ - dialogBeforeOpen? (e: DialogBeforeOpenEventArgs): void; - + dialogBeforeOpen?(e: DialogBeforeOpenEventArgs): void; /** Triggers after the spell check dialog opens. */ - dialogOpen? (e: DialogOpenEventArgs): void; + dialogOpen?(e: DialogOpenEventArgs): void; /** Triggers when the spell check dialog closed. */ - dialogClose? (e: DialogCloseEventArgs): void; + dialogClose?(e: DialogCloseEventArgs): void; /** Triggers when the spell check control performing the spell check operations such as ignore, ignoreAll, change, changeAll and addToDictionary. */ - validating? (e: ValidatingEventArgs): void; + validating?(e: ValidatingEventArgs): void; /** Triggers before loading the target HTML element text into the dialog sentence area. */ - targetUpdating? (e: TargetUpdatingEventArgs): void; + targetUpdating?(e: TargetUpdatingEventArgs): void; } export interface ActionSuccessEventArgs { @@ -42314,7 +42169,7 @@ export interface ContextMenuSettings { /** Contains all the default context menu options that are applicable for SpellCheck. It also supports adding custom menu items. All the SpellCheck related context menu items are grouped under this menu collection. * @Default {{% highlight javascript %}[{ id: IgnoreAll, text: Ignore All },{ id: AddToDictionary, text: Add To Dictionary }]{% endhighlight %}} */ - menuItems?: Array; + menuItems?: any[]; } export interface IgnoreSettings { @@ -42352,15 +42207,13 @@ export interface IgnoreSettings { } } -declare module ej.datavisualization { - +declare namespace ej.datavisualization { class SymbolPalette extends ej.Widget { static fn: SymbolPalette; - constructor(element: JQuery, options?: SymbolPalette.Model); - constructor(element: Element, options?: SymbolPalette.Model); + constructor(element: JQuery | Element, options?: SymbolPalette.Model); static Locale: any; - model:SymbolPalette.Model; - defaults:SymbolPalette.Model; + model: SymbolPalette.Model; + defaults: SymbolPalette.Model; /** Add items to Palettes at runtime * @param {string} name of the Palette @@ -42376,7 +42229,7 @@ class SymbolPalette extends ej.Widget { */ removePaletteItem(paletteName: string, node: any): void; } -export module SymbolPalette{ +export namespace SymbolPalette { export interface Model { @@ -42422,7 +42275,7 @@ export interface Model { /** An array of JSON objects, where each object represents a node/connector * @Default {[]} */ - palettes?: Array; + palettes?: Palette[]; /** Defines the preview height of the symbols * @Default {100} @@ -42450,7 +42303,7 @@ export interface Model { width?: number; /** Triggers when a palette item is selected or unselected */ - selectionChange? (e: SelectionChangeEventArgs): void; + selectionChange?(e: SelectionChangeEventArgs): void; } export interface SelectionChangeEventArgs { @@ -42492,17 +42345,16 @@ export interface Palette { /** Defines the palette items * @Default {[]} */ - items?: Array; + items?: any[]; } } class LinearGauge extends ej.Widget { static fn: LinearGauge; - constructor(element: JQuery, options?: LinearGauge.Model); - constructor(element: Element, options?: LinearGauge.Model); + constructor(element: JQuery | Element, options?: LinearGauge.Model); static Locale: any; - model:LinearGauge.Model; - defaults:LinearGauge.Model; + model: LinearGauge.Model; + defaults: LinearGauge.Model; /** destroy the linear gauge all events bound using this._on will be unbind automatically and bring the control to pre-init state. * @returns {void} @@ -42919,7 +42771,7 @@ class LinearGauge extends ej.Widget { */ setTickYDistanceFromScale(): void; } -export module LinearGauge{ +export namespace LinearGauge { export interface Model { @@ -43006,7 +42858,7 @@ export interface Model { /** Specifies the scales * @Default {null} */ - scales?: Array; + scales?: Scale[]; /** Specifies the theme for Linear gauge. See LinearGauge.Themes * @Default {flatlight} @@ -43034,43 +42886,43 @@ export interface Model { width?: number; /** Triggers while the bar pointer are being drawn on the gauge. */ - drawBarPointers? (e: DrawBarPointersEventArgs): void; + drawBarPointers?(e: DrawBarPointersEventArgs): void; /** Triggers while the customLabel are being drawn on the gauge. */ - drawCustomLabel? (e: DrawCustomLabelEventArgs): void; + drawCustomLabel?(e: DrawCustomLabelEventArgs): void; /** Triggers while the Indicator are being drawn on the gauge. */ - drawIndicators? (e: DrawIndicatorsEventArgs): void; + drawIndicators?(e: DrawIndicatorsEventArgs): void; /** Triggers while the label are being drawn on the gauge. */ - drawLabels? (e: DrawLabelsEventArgs): void; + drawLabels?(e: DrawLabelsEventArgs): void; /** Triggers while the marker are being drawn on the gauge. */ - drawMarkerPointers? (e: DrawMarkerPointersEventArgs): void; + drawMarkerPointers?(e: DrawMarkerPointersEventArgs): void; /** Triggers while the range are being drawn on the gauge. */ - drawRange? (e: DrawRangeEventArgs): void; + drawRange?(e: DrawRangeEventArgs): void; /** Triggers while the ticks are being drawn on the gauge. */ - drawTicks? (e: DrawTicksEventArgs): void; + drawTicks?(e: DrawTicksEventArgs): void; /** Triggers when the gauge is initialized. */ - init? (e: InitEventArgs): void; + init?(e: InitEventArgs): void; /** Triggers while the gauge start to Load. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Triggers when the left mouse button is clicked. */ - mouseClick? (e: MouseClickEventArgs): void; + mouseClick?(e: MouseClickEventArgs): void; /** Triggers when clicking and dragging the mouse pointer over the gauge pointer. */ - mouseClickMove? (e: MouseClickMoveEventArgs): void; + mouseClickMove?(e: MouseClickMoveEventArgs): void; /** Triggers when the mouse click is released. */ - mouseClickUp? (e: MouseClickUpEventArgs): void; + mouseClickUp?(e: MouseClickUpEventArgs): void; /** Triggers while the rendering of the gauge completed. */ - renderComplete? (e: RenderCompleteEventArgs): void; + renderComplete?(e: RenderCompleteEventArgs): void; } export interface DrawBarPointersEventArgs { @@ -43938,7 +43790,7 @@ export interface ScalesIndicator { /** Specifies the state ranges in bar indicators * @Default {Array} */ - stateRanges?: Array; + stateRanges?: ScalesIndicatorsStateRange[]; /** Specifies the textLocation in bar indicators * @Default {null} @@ -44250,7 +44102,7 @@ export interface Scale { /** Specifies the scaleBar Gradient of bar pointer * @Default {Array} */ - barPointers?: Array; + barPointers?: ScalesBarPointer[]; /** Specifies the border of the Scale. * @Default {null} @@ -44260,7 +44112,7 @@ export interface Scale { /** Specifies the customLabel * @Default {Array} */ - customLabels?: Array; + customLabels?: ScalesCustomLabel[]; /** Specifies the scale Direction of the Scale. See Directions * @Default {CounterClockwise} @@ -44270,12 +44122,12 @@ export interface Scale { /** Specifies the indicator * @Default {Array} */ - indicators?: Array; + indicators?: ScalesIndicator[]; /** Specifies the labels. * @Default {Array} */ - labels?: Array; + labels?: ScalesLabel[]; /** Specifies the scaleBar Length. * @Default {290} @@ -44290,7 +44142,7 @@ export interface Scale { /** Specifies the markerPointers * @Default {Array} */ - markerPointers?: Array; + markerPointers?: ScalesMarkerPointer[]; /** Specifies the maximum of the Scale. * @Default {null} @@ -44320,7 +44172,7 @@ export interface Scale { /** Specifies the ranges in the tick. * @Default {Array} */ - ranges?: Array; + ranges?: ScalesRange[]; /** Specifies the shadowOffset. * @Default {0} @@ -44365,7 +44217,7 @@ export interface Scale { /** Specifies the ticks in the scale. * @Default {Array} */ - ticks?: Array; + ticks?: ScalesTick[]; /** Specifies the scaleBar type .See ScaleType * @Default {Rectangle} @@ -44396,10 +44248,8 @@ export interface Tooltip { templateID?: string; } } -module LinearGauge -{ -enum OuterCustomLabelPosition -{ +namespace LinearGauge { +enum OuterCustomLabelPosition { //string Left, //string @@ -44410,10 +44260,8 @@ Top, Bottom, } } -module LinearGauge -{ -enum FontStyle -{ +namespace LinearGauge { +enum FontStyle { //string Bold, //string @@ -44426,20 +44274,16 @@ Strikeout, Underline, } } -module LinearGauge -{ -enum Direction -{ +namespace LinearGauge { +enum Direction { //string Clockwise, //string CounterClockwise, } } -module LinearGauge -{ -enum IndicatorTypes -{ +namespace LinearGauge { +enum IndicatorTypes { //string Rectangle, //string @@ -44450,10 +44294,8 @@ RoundedRectangle, Text, } } -module LinearGauge -{ -enum PointerPlacement -{ +namespace LinearGauge { +enum PointerPlacement { //string Near, //string @@ -44462,30 +44304,24 @@ Far, Center, } } -module LinearGauge -{ -enum ScaleType -{ +namespace LinearGauge { +enum ScaleType { //string Major, //string Minor, } } -module LinearGauge -{ -enum UnitTextPlacement -{ +namespace LinearGauge { +enum UnitTextPlacement { //string Back, //string From, } } -module LinearGauge -{ -enum MarkerType -{ +namespace LinearGauge { +enum MarkerType { //string Rectangle, //string @@ -44512,20 +44348,16 @@ Trapezoid, RoundedRectangle, } } -module LinearGauge -{ -enum TicksType -{ +namespace LinearGauge { +enum TicksType { //string Majorinterval, //string Minorinterval, } } -module LinearGauge -{ -enum Themes -{ +namespace LinearGauge { +enum Themes { //string FlatLight, //string @@ -44535,11 +44367,10 @@ FlatDark, class CircularGauge extends ej.Widget { static fn: CircularGauge; - constructor(element: JQuery, options?: CircularGauge.Model); - constructor(element: Element, options?: CircularGauge.Model); + constructor(element: JQuery | Element, options?: CircularGauge.Model); static Locale: any; - model:CircularGauge.Model; - defaults:CircularGauge.Model; + model: CircularGauge.Model; + defaults: CircularGauge.Model; /** destroy the circular gauge widget. all events bound using this._on will be unbind automatically and bring the control to pre-init state. * @returns {void} @@ -44961,7 +44792,7 @@ class CircularGauge extends ej.Widget { */ setTickWidth(): void; } -export module CircularGauge{ +export namespace CircularGauge { export interface Model { @@ -45043,7 +44874,7 @@ export interface Model { /** Specify the pointers, ticks, labels, indicators, ranges of circular gauge * @Default {null} */ - scales?: Array; + scales?: Scale[]; /** Specify the theme of circular gauge. * @Default {flatlight} @@ -45066,40 +44897,40 @@ export interface Model { width?: number; /** Triggers while the custom labels are being drawn on the gauge. */ - drawCustomLabel? (e: DrawCustomLabelEventArgs): void; + drawCustomLabel?(e: DrawCustomLabelEventArgs): void; /** Triggers while the indicators are being started to drawn on the gauge. */ - drawIndicators? (e: DrawIndicatorsEventArgs): void; + drawIndicators?(e: DrawIndicatorsEventArgs): void; /** Triggers while the labels are being drawn on the gauge. */ - drawLabels? (e: DrawLabelsEventArgs): void; + drawLabels?(e: DrawLabelsEventArgs): void; /** Triggers while the pointer cap is being drawn on the gauge. */ - drawPointerCap? (e: DrawPointerCapEventArgs): void; + drawPointerCap?(e: DrawPointerCapEventArgs): void; /** Triggers while the pointers are being drawn on the gauge. */ - drawPointers? (e: DrawPointersEventArgs): void; + drawPointers?(e: DrawPointersEventArgs): void; /** Triggers when the ranges begin to be getting drawn on the gauge. */ - drawRange? (e: DrawRangeEventArgs): void; + drawRange?(e: DrawRangeEventArgs): void; /** Triggers while the ticks are being drawn on the gauge. */ - drawTicks? (e: DrawTicksEventArgs): void; + drawTicks?(e: DrawTicksEventArgs): void; /** Triggers while the gauge start to Load. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Triggers when the left mouse button is clicked. */ - mouseClick? (e: MouseClickEventArgs): void; + mouseClick?(e: MouseClickEventArgs): void; /** Triggers when clicking and dragging the mouse pointer over the gauge pointer. */ - mouseClickMove? (e: MouseClickMoveEventArgs): void; + mouseClickMove?(e: MouseClickMoveEventArgs): void; /** Triggers when the mouse click is released. */ - mouseClickUp? (e: MouseClickUpEventArgs): void; + mouseClickUp?(e: MouseClickUpEventArgs): void; /** Triggers when the rendering of the gauge is completed. */ - renderComplete? (e: RenderCompleteEventArgs): void; + renderComplete?(e: RenderCompleteEventArgs): void; } export interface DrawCustomLabelEventArgs { @@ -45820,7 +45651,7 @@ export interface ScalesIndicator { /** Specify the various states of circular gauge * @Default {Array} */ - stateRanges?: Array; + stateRanges?: ScalesIndicatorsStateRange[]; /** Specify indicator style of circular gauge. See IndicatorType * @Default {Circle} @@ -46253,17 +46084,17 @@ export interface Scale { /** Specify the custom labels for the scales. * @Default {Array} */ - customLabels?: Array; + customLabels?: ScalesCustomLabel[]; /** Specify representing state of circular gauge * @Default {Array} */ - indicators?: Array; + indicators?: ScalesIndicator[]; /** Specify the text values displayed in a meaningful manner alongside the ticks of circular gauge * @Default {Array} */ - labels?: Array; + labels?: ScalesLabel[]; /** Specify majorIntervalValue of circular gauge * @Default {10} @@ -46298,7 +46129,7 @@ export interface Scale { /** Specify pointers value of circular gauge * @Default {Array} */ - pointers?: Array; + pointers?: ScalesPointer[]; /** Specify scale radius of circular gauge * @Default {170} @@ -46308,7 +46139,7 @@ export interface Scale { /** Specify ranges value of circular gauge * @Default {Array} */ - ranges?: Array; + ranges?: ScalesRange[]; /** Specify shadowOffset value of circular gauge * @Default {0} @@ -46358,7 +46189,7 @@ export interface Scale { /** Specify subGauge of circular gauge * @Default {Array} */ - subGauges?: Array; + subGauges?: ScalesSubGauge[]; /** Specify sweepAngle of circular gauge * @Default {310} @@ -46368,7 +46199,7 @@ export interface Scale { /** Specify ticks of circular gauge * @Default {Array} */ - ticks?: Array; + ticks?: ScalesTick[]; } export interface Tooltip { @@ -46389,20 +46220,16 @@ export interface Tooltip { templateID?: string; } } -module CircularGauge -{ -enum FrameType -{ +namespace CircularGauge { +enum FrameType { //string FullCircle, //string HalfCircle, } } -module CircularGauge -{ -enum gaugePosition -{ +namespace CircularGauge { +enum gaugePosition { //string TopLeft, //string @@ -46423,10 +46250,8 @@ BottomRight, BottomCenter, } } -module CircularGauge -{ -enum CustomLabelPositionType -{ +namespace CircularGauge { +enum CustomLabelPositionType { //string Top, //string @@ -46437,20 +46262,16 @@ Right, Left, } } -module CircularGauge -{ -enum Direction -{ +namespace CircularGauge { +enum Direction { //string Clockwise, //string CounterClockwise, } } -module CircularGauge -{ -enum IndicatorTypes -{ +namespace CircularGauge { +enum IndicatorTypes { //string Rectangle, //string @@ -46463,40 +46284,32 @@ RoundedRectangle, Image, } } -module CircularGauge -{ -enum Placement -{ +namespace CircularGauge { +enum Placement { //string Near, //string Far, } } -module CircularGauge -{ -enum LabelType -{ +namespace CircularGauge { +enum LabelType { //string Major, //string Minor, } } -module CircularGauge -{ -enum UnitTextPlacement -{ +namespace CircularGauge { +enum UnitTextPlacement { //string Back, //string Front, } } -module CircularGauge -{ -enum MarkerType -{ +namespace CircularGauge { +enum MarkerType { //string Rectangle, //string @@ -46523,10 +46336,8 @@ RoundedRectangle, Image, } } -module CircularGauge -{ -enum NeedleType -{ +namespace CircularGauge { +enum NeedleType { //string Triangle, //string @@ -46539,10 +46350,8 @@ Image, Trapezoid, } } -module CircularGauge -{ -enum PointerType -{ +namespace CircularGauge { +enum PointerType { //string Needle, //string @@ -46552,11 +46361,10 @@ Marker, class DigitalGauge extends ej.Widget { static fn: DigitalGauge; - constructor(element: JQuery, options?: DigitalGauge.Model); - constructor(element: Element, options?: DigitalGauge.Model); + constructor(element: JQuery | Element, options?: DigitalGauge.Model); static Locale: any; - model:DigitalGauge.Model; - defaults:DigitalGauge.Model; + model: DigitalGauge.Model; + defaults: DigitalGauge.Model; /** To destroy the digital gauge * @returns {void} @@ -46601,7 +46409,7 @@ class DigitalGauge extends ej.Widget { */ setValue(itemIndex: number, value: string): void; } -export module DigitalGauge{ +export namespace DigitalGauge { export interface Model { @@ -46623,7 +46431,7 @@ export interface Model { /** Specifies the items for the DigitalGauge. * @Default {null} */ - items?: Array; + items?: Item[]; /** Specifies the matrixSegmentData for the DigitalGauge. */ @@ -46649,16 +46457,16 @@ export interface Model { width?: number; /** Triggers when the gauge is initialized. */ - init? (e: InitEventArgs): void; + init?(e: InitEventArgs): void; /** Triggers when the gauge item rendering. */ - itemRendering? (e: ItemRenderingEventArgs): void; + itemRendering?(e: ItemRenderingEventArgs): void; /** Triggers when the gauge is start to load. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Triggers when the gauge render is completed. */ - renderComplete? (e: RenderCompleteEventArgs): void; + renderComplete?(e: RenderCompleteEventArgs): void; } export interface InitEventArgs { @@ -46937,10 +46745,8 @@ export interface Item { value?: string; } } -module DigitalGauge -{ -enum CharacterType -{ +namespace DigitalGauge { +enum CharacterType { //string SevenSegment, //string @@ -46953,10 +46759,8 @@ EightCrossEightDotMatrix, EightCrossEightSquareMatrix, } } -module DigitalGauge -{ -enum FontStyle -{ +namespace DigitalGauge { +enum FontStyle { //string Normal, //string @@ -46972,11 +46776,10 @@ Strikeout, class Chart extends ej.Widget { static fn: Chart; - constructor(element: JQuery, options?: Chart.Model); - constructor(element: Element, options?: Chart.Model); + constructor(element: JQuery | Element, options?: Chart.Model); static Locale: any; - model:Chart.Model; - defaults:Chart.Model; + model: Chart.Model; + defaults: Chart.Model; /** Animates the series and/or indicators in Chart. When parameter is not passed to this method, then all the series and indicators present in Chart are animated. * @param {any} If an array collection is passed as parameter, series and indicator objects passed in array collection are animated.ExampleIf a series or indicator object is passed to this method, then the specific series or indicator is animated.Example, @@ -46997,13 +46800,13 @@ class Chart extends ej.Widget { */ redraw(): void; } -export module Chart{ +export namespace Chart { export interface Model { /** Options for adding and customizing annotations in Chart. */ - annotations?: Array; + annotations?: Annotation[]; /** URL of the image to be used as chart background. * @Default {null} @@ -47024,7 +46827,7 @@ export interface Model { /** Options to split Chart into multiple plotting areas vertically. Each object in the collection represents a plotting area in Chart. */ - columnDefinitions?: Array; + columnDefinitions?: ColumnDefinition[]; /** Options for configuring the properties of all the series. You can also override the options for specific series by using series collection. */ @@ -47061,7 +46864,7 @@ export interface Model { /** Options to customize the technical indicators. */ - indicators?: Array; + indicators?: Indicator[]; /** Controls whether Chart has to be responsive while resizing. * @Default {false} @@ -47080,7 +46883,7 @@ export interface Model { /** Palette is used to store the series fill color in array and apply the color to series collection in the order of series index. * @Default {null} */ - palette?: Array; + palette?: any[]; /** Options to customize the left, right, top and bottom margins of chart area. */ @@ -47097,7 +46900,7 @@ export interface Model { /** To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s xAxisName property to link both axis and series. */ - axes?: Array; + axes?: Axis[]; /** This is a vertical axis that contains options to configure axis. This is the primary y axis for all the series in series array. To override y axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s yAxisName property to link both axis and series. */ @@ -47110,11 +46913,11 @@ export interface Model { /** Options to split Chart into multiple plotting areas horizontally. Each object in the collection represents a plotting area in Chart. */ - rowDefinitions?: Array; + rowDefinitions?: RowDefinition[]; /** Specifies the properties used for customizing the series. */ - series?: Array; + series?: Series[]; /** Controls whether data points has to be displayed side by side or along the depth of the axis. * @Default {false} @@ -47149,115 +46952,115 @@ export interface Model { zooming?: Zooming; /** Fires after the series animation is completed. This event will be triggered for each series when animation is enabled. */ - animationComplete? (e: AnimationCompleteEventArgs): void; + animationComplete?(e: AnimationCompleteEventArgs): void; /** Fires before rendering the labels. This event is fired for each label in axis. You can use this event to add custom text to axis labels. */ - axesLabelRendering? (e: AxesLabelRenderingEventArgs): void; + axesLabelRendering?(e: AxesLabelRenderingEventArgs): void; /** Fires during the initialization of axis labels. */ - axesLabelsInitialize? (e: AxesLabelsInitializeEventArgs): void; + axesLabelsInitialize?(e: AxesLabelsInitializeEventArgs): void; /** Fires during axes range calculation. This event is fired for each axis present in Chart. You can use this event to customize axis range as required. */ - axesRangeCalculate? (e: AxesRangeCalculateEventArgs): void; + axesRangeCalculate?(e: AxesRangeCalculateEventArgs): void; /** Fires before rendering the axis title. This event is triggered for each axis with title. You can use this event to add custom text to axis title. */ - axesTitleRendering? (e: AxesTitleRenderingEventArgs): void; + axesTitleRendering?(e: AxesTitleRenderingEventArgs): void; /** Fires during the calculation of chart area bounds. You can use this event to customize the bounds of chart area. */ - chartAreaBoundsCalculate? (e: ChartAreaBoundsCalculateEventArgs): void; + chartAreaBoundsCalculate?(e: ChartAreaBoundsCalculateEventArgs): void; /** Fires after chart is created. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; /** Fires when chart is destroyed completely. */ - destroy? (e: DestroyEventArgs): void; + destroy?(e: DestroyEventArgs): void; /** Fires before rendering the data labels. This event is triggered for each data label in the series. You can use this event to add custom text in data labels. */ - displayTextRendering? (e: DisplayTextRenderingEventArgs): void; + displayTextRendering?(e: DisplayTextRenderingEventArgs): void; /** Fires during the calculation of legend bounds. You can use this event to customize the bounds of legend. */ - legendBoundsCalculate? (e: LegendBoundsCalculateEventArgs): void; + legendBoundsCalculate?(e: LegendBoundsCalculateEventArgs): void; /** Fires on clicking the legend item. */ - legendItemClick? (e: LegendItemClickEventArgs): void; + legendItemClick?(e: LegendItemClickEventArgs): void; /** Fires when moving mouse over legend item. You can use this event for hit testing on legend items. */ - legendItemMouseMove? (e: LegendItemMouseMoveEventArgs): void; + legendItemMouseMove?(e: LegendItemMouseMoveEventArgs): void; /** Fires before rendering the legend item. This event is fired for each legend item in Chart. You can use this event to customize legend item shape or add custom text to legend item. */ - legendItemRendering? (e: LegendItemRenderingEventArgs): void; + legendItemRendering?(e: LegendItemRenderingEventArgs): void; /** Fires before loading the chart. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Fires after selected the data in chart. */ - rangeSelected? (e: RangeSelectedEventArgs): void; + rangeSelected?(e: RangeSelectedEventArgs): void; /** Fires on clicking a point in chart. You can use this event to handle clicks made on points. */ - pointRegionClick? (e: PointRegionClickEventArgs): void; + pointRegionClick?(e: PointRegionClickEventArgs): void; /** Fires when mouse is moved over a point. */ - pointRegionMouseMove? (e: PointRegionMouseMoveEventArgs): void; + pointRegionMouseMove?(e: PointRegionMouseMoveEventArgs): void; /** Fires before rendering chart. */ - preRender? (e: PreRenderEventArgs): void; + preRender?(e: PreRenderEventArgs): void; /** Fires after selecting a series. This event is triggered after selecting a series only if selection mode is series. */ - seriesRegionClick? (e: SeriesRegionClickEventArgs): void; + seriesRegionClick?(e: SeriesRegionClickEventArgs): void; /** Fires before rendering a series. This event is fired for each series in Chart. */ - seriesRendering? (e: SeriesRenderingEventArgs): void; + seriesRendering?(e: SeriesRenderingEventArgs): void; /** Fires before rendering the marker symbols. This event is triggered for each marker in Chart. */ - symbolRendering? (e: SymbolRenderingEventArgs): void; + symbolRendering?(e: SymbolRenderingEventArgs): void; /** Fires before rendering the Chart title. You can use this event to add custom text in Chart title. */ - titleRendering? (e: TitleRenderingEventArgs): void; + titleRendering?(e: TitleRenderingEventArgs): void; /** Fires before rendering the tooltip. This event is fired when tooltip is enabled and mouse is hovered on a Chart point. You can use this event to customize tooltip before rendering. */ - toolTipInitialize? (e: ToolTipInitializeEventArgs): void; + toolTipInitialize?(e: ToolTipInitializeEventArgs): void; /** Fires before rendering crosshair tooltip in axis. This event is fired for each axis with crosshair label enabled. You can use this event to customize crosshair label before rendering */ - trackAxisToolTip? (e: TrackAxisToolTipEventArgs): void; + trackAxisToolTip?(e: TrackAxisToolTipEventArgs): void; /** Fires before rendering trackball tooltip. This event is fired for each series in Chart because trackball tooltip is displayed for all the series. You can use this event to customize the text displayed in trackball tooltip. */ - trackToolTip? (e: TrackToolTipEventArgs): void; + trackToolTip?(e: TrackToolTipEventArgs): void; /** Fires, on clicking the axis label. */ - axisLabelClick? (e: AxisLabelClickEventArgs): void; + axisLabelClick?(e: AxisLabelClickEventArgs): void; /** Fires on moving mouse over the axis label. */ - axisLabelMouseMove? (e: AxisLabelMouseMoveEventArgs): void; + axisLabelMouseMove?(e: AxisLabelMouseMoveEventArgs): void; /** Fires, on the clicking the chart. */ - chartClick? (e: ChartClickEventArgs): void; + chartClick?(e: ChartClickEventArgs): void; /** Fires on moving mouse over the chart. */ - chartMouseMove? (e: ChartMouseMoveEventArgs): void; + chartMouseMove?(e: ChartMouseMoveEventArgs): void; /** Fires, on double clicking the chart. */ - chartDoubleClick? (e: ChartDoubleClickEventArgs): void; + chartDoubleClick?(e: ChartDoubleClickEventArgs): void; /** Fires on clicking the annotation. */ - annotationClick? (e: AnnotationClickEventArgs): void; + annotationClick?(e: AnnotationClickEventArgs): void; /** Fires, after the chart is resized. */ - afterResize? (e: AfterResizeEventArgs): void; + afterResize?(e: AfterResizeEventArgs): void; /** Fires, when chart size is changing. */ - beforeResize? (e: BeforeResizeEventArgs): void; + beforeResize?(e: BeforeResizeEventArgs): void; /** Fires, when error bar is rendering. */ - errorBarRendering? (e: ErrorBarRenderingEventArgs): void; + errorBarRendering?(e: ErrorBarRenderingEventArgs): void; /** Trigger, after the scrollbar position is changed. */ - scrollChanged? (e: ScrollChangedEventArgs): void; + scrollChanged?(e: ScrollChangedEventArgs): void; /** Event triggered when scroll starts */ - scrollStart? (e: ScrollStartEventArgs): void; + scrollStart?(e: ScrollStartEventArgs): void; /** Event triggered when scroll end */ - scrollEnd? (e: ScrollEndEventArgs): void; + scrollEnd?(e: ScrollEndEventArgs): void; } export interface AnimationCompleteEventArgs { @@ -47462,11 +47265,11 @@ export interface DisplayTextRenderingEventArgs { */ locationY?: number; - /** Index of the series in series Collection whose data label is being rendered + /** Index of the series in series Collection whose data label is being rendered */ seriesIndex?: number; - /** Index of the point in series whose data label is being rendered + /** Index of the point in series whose data label is being rendered */ pointIndex?: number; @@ -47786,7 +47589,7 @@ export interface SeriesRenderingEventArgs { export interface SymbolRenderingEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -47809,7 +47612,7 @@ export interface SymbolRenderingEventArgs { export interface TitleRenderingEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -47836,7 +47639,7 @@ export interface TitleRenderingEventArgs { export interface ToolTipInitializeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -47863,7 +47666,7 @@ export interface ToolTipInitializeEventArgs { export interface TrackAxisToolTipEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -47894,7 +47697,7 @@ export interface TrackAxisToolTipEventArgs { export interface TrackToolTipEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -47929,7 +47732,7 @@ export interface TrackToolTipEventArgs { export interface AxisLabelClickEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -47941,7 +47744,7 @@ export interface AxisLabelClickEventArgs { */ type?: string; - /** X and Y co-ordinate of the labels in chart area. + /** X and Y co-ordinate of the labels in chart area. */ location?: any; @@ -47960,7 +47763,7 @@ export interface AxisLabelClickEventArgs { export interface AxisLabelMouseMoveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -47972,7 +47775,7 @@ export interface AxisLabelMouseMoveEventArgs { */ type?: string; - /** X and Y co-ordinate of the labels in chart area. + /** X and Y co-ordinate of the labels in chart area. */ location?: any; @@ -47991,7 +47794,7 @@ export interface AxisLabelMouseMoveEventArgs { export interface ChartClickEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -48003,30 +47806,30 @@ export interface ChartClickEventArgs { */ type?: string; - /** X and Y co-ordinate of the points with respect to chart area. + /** X and Y co-ordinate of the points with respect to chart area. */ location?: any; - /** ID of the target element. + /** ID of the target element. */ id?: string; - /** Width and height of the chart. + /** Width and height of the chart. */ size?: any; - /** x-coordinate of the pointer, relative to the page + /** x-coordinate of the pointer, relative to the page */ pageX?: number; - /** y-coordinate of the pointer, relative to the page + /** y-coordinate of the pointer, relative to the page */ pageY?: number; } export interface ChartMouseMoveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -48038,30 +47841,30 @@ export interface ChartMouseMoveEventArgs { */ type?: string; - /** X and Y co-ordinate of the points with respect to chart area. + /** X and Y co-ordinate of the points with respect to chart area. */ location?: any; - /** ID of the target element. + /** ID of the target element. */ id?: string; - /** Width and height of the chart. + /** Width and height of the chart. */ size?: any; - /** x-coordinate of the pointer, relative to the page + /** x-coordinate of the pointer, relative to the page */ pageX?: number; - /** y-coordinate of the pointer, relative to the page + /** y-coordinate of the pointer, relative to the page */ pageY?: number; } export interface ChartDoubleClickEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -48073,30 +47876,30 @@ export interface ChartDoubleClickEventArgs { */ type?: string; - /** X and Y co-ordinate of the points with respect to chart area. + /** X and Y co-ordinate of the points with respect to chart area. */ location?: any; - /** ID of the target element. + /** ID of the target element. */ id?: string; - /** Width and height of the chart. + /** Width and height of the chart. */ size?: any; - /** x-coordinate of the pointer, relative to the page + /** x-coordinate of the pointer, relative to the page */ pageX?: number; - /** y-coordinate of the pointer, relative to the page + /** y-coordinate of the pointer, relative to the page */ pageY?: number; } export interface AnnotationClickEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -48108,26 +47911,26 @@ export interface AnnotationClickEventArgs { */ type?: string; - /** X and Y co-ordinate of the annotation in chart area. + /** X and Y co-ordinate of the annotation in chart area. */ location?: any; - /** Information about the annotation, like Coordinate unit, Region, content + /** Information about the annotation, like Coordinate unit, Region, content */ contentData?: any; - /** x-coordinate of the pointer, relative to the page + /** x-coordinate of the pointer, relative to the page */ pageX?: number; - /** y-coordinate of the pointer, relative to the page + /** y-coordinate of the pointer, relative to the page */ pageY?: number; } export interface AfterResizeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -48139,34 +47942,34 @@ export interface AfterResizeEventArgs { */ type?: string; - /** Chart width, after resize + /** Chart width, after resize */ width?: number; - /** Chart height, after resize + /** Chart height, after resize */ height?: number; - /** Chart width, before resize + /** Chart width, before resize */ prevWidth?: number; - /** Chart height, before resize + /** Chart height, before resize */ prevHeight?: number; - /** Chart width, when the chart was first rendered + /** Chart width, when the chart was first rendered */ originalWidth?: number; - /** Chart height, when the chart was first rendered + /** Chart height, when the chart was first rendered */ originalHeight?: number; } export interface BeforeResizeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -48178,26 +47981,26 @@ export interface BeforeResizeEventArgs { */ type?: string; - /** Chart width, before resize + /** Chart width, before resize */ currentWidth?: number; - /** Chart height, before resize + /** Chart height, before resize */ currentHeight?: number; - /** Chart width, after resize + /** Chart width, after resize */ newWidth?: number; - /** Chart height, after resize + /** Chart height, after resize */ newHeight?: number; } export interface ErrorBarRenderingEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -48209,7 +48012,7 @@ export interface ErrorBarRenderingEventArgs { */ type?: string; - /** Error bar Object + /** Error bar Object */ errorbar?: any; } @@ -49490,7 +49293,7 @@ export interface CommonSeriesOptions { /** Option to add the trendlines to chart. */ - trendlines?: Array; + trendlines?: CommonSeriesOptionsTrendline[]; /** Options for customizing the appearance of the series or data point while highlighting. */ @@ -50723,12 +50526,12 @@ export interface PrimaryXAxis { /** Options for customizing the multi level labels. * @Default {[ ]} */ - multiLevelLabels?: Array; + multiLevelLabels?: PrimaryXAxisMultiLevelLabel[]; /** Options for customizing the strip lines. * @Default {[ ]} */ - stripLine?: Array; + stripLine?: PrimaryXAxisStripLine[]; /** Specifies the position of the axis tick lines. * @Default {outside. See TickLinesPosition} @@ -51398,12 +51201,12 @@ export interface Axis { /** Options for customizing the multi level labels. * @Default {[ ]} */ - multiLevelLabels?: Array; + multiLevelLabels?: AxesMultiLevelLabel[]; /** Options for customizing the strip lines. * @Default {[ ]} */ - stripLine?: Array; + stripLine?: AxesStripLine[]; /** Specifies the position of the axis tick lines. * @Default {outside. See TickLinesPosition} @@ -52068,12 +51871,12 @@ export interface PrimaryYAxis { /** Options for customizing the multi level labels. * @Default {[ ]} */ - multiLevelLabels?: Array; + multiLevelLabels?: PrimaryYAxisMultiLevelLabel[]; /** Options for customizing the strip lines. * @Default {[ ]} */ - stripLine?: Array; + stripLine?: PrimaryYAxisStripLine[]; /** Specifies the position of the axis tick lines. * @Default {outside. See TickLinesPosition} @@ -53363,7 +53166,7 @@ export interface Series { /** Option to add data points; each point should have x and y property. Also, optionally, you can customize the points color, border, marker by using fill, border and marker options. */ - points?: Array; + points?: SeriesPoint[]; /** Specifies the mode of the pyramid series. * @Default {linear} @@ -53460,7 +53263,7 @@ export interface Series { /** Option to add trendlines to chart. */ - trendlines?: Array; + trendlines?: SeriesTrendline[]; /** Options for customizing the appearance of the series or data point while highlighting. */ @@ -53675,13 +53478,11 @@ export interface Zooming { /** To display user specified buttons in zooming toolbar. * @Default {[zoomIn, zoomOut, zoom, pan, reset]} */ - toolbarItems?: Array; + toolbarItems?: any[]; } } -module Chart -{ -enum CoordinateUnit -{ +namespace Chart { +enum CoordinateUnit { //string None, //string @@ -53690,10 +53491,8 @@ Pixels, Points, } } -module Chart -{ -enum HorizontalAlignment -{ +namespace Chart { +enum HorizontalAlignment { //string Left, //string @@ -53702,20 +53501,16 @@ Right, Middle, } } -module Chart -{ -enum Region -{ +namespace Chart { +enum Region { //string Chart, //string Series, } } -module Chart -{ -enum VerticalAlignment -{ +namespace Chart { +enum VerticalAlignment { //string Top, //string @@ -53724,10 +53519,8 @@ Bottom, Middle, } } -module Chart -{ -enum ExportingType -{ +namespace Chart { +enum ExportingType { //string PNG, //string @@ -53742,50 +53535,40 @@ XLSX, SVG, } } -module Chart -{ -enum ExportingOrientation -{ +namespace Chart { +enum ExportingOrientation { //string Portrait, //string Landscape, } } -module Chart -{ -enum ExportingMode -{ +namespace Chart { +enum ExportingMode { //string ServerSide, //string ClientSide, } } -module Chart -{ -enum Unit -{ +namespace Chart { +enum Unit { //string Percentage, //string Pixel, } } -module Chart -{ -enum ColumnFacet -{ +namespace Chart { +enum ColumnFacet { //string Rectangle, //string Cylinder, } } -module Chart -{ -enum DrawType -{ +namespace Chart { +enum DrawType { //string Line, //string @@ -53794,20 +53577,16 @@ Area, Column, } } -module Chart -{ -enum FontStyle -{ +namespace Chart { +enum FontStyle { //string Normal, //string Italic, } } -module Chart -{ -enum FontWeight -{ +namespace Chart { +enum FontWeight { //string Regular, //string @@ -53816,10 +53595,8 @@ Bold, Lighter, } } -module Chart -{ -enum LabelPosition -{ +namespace Chart { +enum LabelPosition { //string Inside, //string @@ -53828,10 +53605,8 @@ Outside, OutsideExtended, } } -module Chart -{ -enum boxPlotMode -{ +namespace Chart { +enum boxPlotMode { //string Exclusive, //string @@ -53840,10 +53615,8 @@ Inclusive, Normal, } } -module Chart -{ -enum LineCap -{ +namespace Chart { +enum LineCap { //string Butt, //string @@ -53852,10 +53625,8 @@ Round, Square, } } -module Chart -{ -enum LineJoin -{ +namespace Chart { +enum LineJoin { //string Round, //string @@ -53864,20 +53635,16 @@ Bevel, Miter, } } -module Chart -{ -enum ConnectorLineType -{ +namespace Chart { +enum ConnectorLineType { //string Line, //string Bezier, } } -module Chart -{ -enum HorizontalTextAlignment -{ +namespace Chart { +enum HorizontalTextAlignment { //string Center, //string @@ -53886,10 +53653,8 @@ Near, Far, } } -module Chart -{ -enum Shape -{ +namespace Chart { +enum Shape { //string None, //string @@ -53930,10 +53695,8 @@ Image, SeriesType, } } -module Chart -{ -enum TextPosition -{ +namespace Chart { +enum TextPosition { //string Top, //string @@ -53942,10 +53705,8 @@ Bottom, Middle, } } -module Chart -{ -enum VerticalTextAlignment -{ +namespace Chart { +enum VerticalTextAlignment { //string Center, //string @@ -53954,20 +53715,16 @@ Near, Far, } } -module Chart -{ -enum PyramidMode -{ +namespace Chart { +enum PyramidMode { //string Linear, //string Surface, } } -module Chart -{ -enum Type -{ +namespace Chart { +enum Type { //string Area, //string @@ -54024,10 +53781,8 @@ Radar, RangeArea, } } -module Chart -{ -enum EmptyPointMode -{ +namespace Chart { +enum EmptyPointMode { //string Gap, //string @@ -54036,10 +53791,8 @@ Zero, Average, } } -module Chart -{ -enum ErrorBarType -{ +namespace Chart { +enum ErrorBarType { //string FixedValue, //string @@ -54050,10 +53803,8 @@ StandardDeviation, StandardError, } } -module Chart -{ -enum ErrorBarMode -{ +namespace Chart { +enum ErrorBarMode { //string Both, //string @@ -54062,10 +53813,8 @@ Vertical, Horizontal, } } -module Chart -{ -enum ErrorBarDirection -{ +namespace Chart { +enum ErrorBarDirection { //string Both, //string @@ -54074,10 +53823,8 @@ Plus, Minus, } } -module Chart -{ -enum Mode -{ +namespace Chart { +enum Mode { //string Series, //string @@ -54088,20 +53835,16 @@ Cluster, Range, } } -module Chart -{ -enum SelectionType -{ +namespace Chart { +enum SelectionType { //string Single, //string Multiple, } } -module Chart -{ -enum RangeType -{ +namespace Chart { +enum RangeType { //string XY, //string @@ -54110,30 +53853,24 @@ X, Y, } } -module Chart -{ -enum CrosshairMode -{ +namespace Chart { +enum CrosshairMode { //string Float, //string Grouping, } } -module Chart -{ -enum CrosshairType -{ +namespace Chart { +enum CrosshairType { //string Crosshair, //string Trackball, } } -module Chart -{ -enum Alignment -{ +namespace Chart { +enum Alignment { //string Center, //string @@ -54142,10 +53879,8 @@ Near, Far, } } -module Chart -{ -enum Position -{ +namespace Chart { +enum Position { //string Left, //string @@ -54156,10 +53891,8 @@ Top, Bottom, } } -module Chart -{ -enum TextOverflow -{ +namespace Chart { +enum TextOverflow { //string None, //string @@ -54170,20 +53903,16 @@ Wrap, WrapAndTrim, } } -module Chart -{ -enum LabelPlacement -{ +namespace Chart { +enum LabelPlacement { //string OnTicks, //string BetweenTicks, } } -module Chart -{ -enum EdgeLabelPlacement -{ +namespace Chart { +enum EdgeLabelPlacement { //string None, //string @@ -54192,10 +53921,8 @@ Shift, Hide, } } -module Chart -{ -enum IntervalType -{ +namespace Chart { +enum IntervalType { //string Days, //string @@ -54212,10 +53939,8 @@ Months, Years, } } -module Chart -{ -enum LabelIntersectAction -{ +namespace Chart { +enum LabelIntersectAction { //string None, //string @@ -54234,10 +53959,8 @@ Hide, MultipleRows, } } -module Chart -{ -enum LabelAlignment -{ +namespace Chart { +enum LabelAlignment { //string Near, //string @@ -54246,10 +53969,8 @@ Far, Center, } } -module Chart -{ -enum RangePadding -{ +namespace Chart { +enum RangePadding { //string Additional, //string @@ -54260,10 +53981,8 @@ None, Round, } } -module Chart -{ -enum MultiLevelLabelsBorderType -{ +namespace Chart { +enum MultiLevelLabelsBorderType { //string Rectangle, //string @@ -54276,10 +53995,8 @@ Brace, CurlyBrace, } } -module Chart -{ -enum TextAlignment -{ +namespace Chart { +enum TextAlignment { //string MiddleTop, //string @@ -54288,30 +54005,24 @@ MiddleCenter, MiddleBottom, } } -module Chart -{ -enum ZIndex -{ +namespace Chart { +enum ZIndex { //string Inside, //string Over, } } -module Chart -{ -enum TickLinesPosition -{ +namespace Chart { +enum TickLinesPosition { //string Inside, //string Outside, } } -module Chart -{ -enum ValueType -{ +namespace Chart { +enum ValueType { //string Double, //string @@ -54322,10 +54033,8 @@ DateTime, Logarithmic, } } -module Chart -{ -enum Theme -{ +namespace Chart { +enum Theme { //string Azure, //string @@ -54351,18 +54060,17 @@ GradientDark, class RangeNavigator extends ej.Widget { static fn: RangeNavigator; - constructor(element: JQuery, options?: RangeNavigator.Model); - constructor(element: Element, options?: RangeNavigator.Model); + constructor(element: JQuery | Element, options?: RangeNavigator.Model); static Locale: any; - model:RangeNavigator.Model; - defaults:RangeNavigator.Model; + model: RangeNavigator.Model; + defaults: RangeNavigator.Model; /** destroy the range navigator widget * @returns {void} */ _destroy(): void; } -export module RangeNavigator{ +export namespace RangeNavigator { export interface Model { @@ -54381,7 +54089,7 @@ export interface Model { /** Specifies the properties used for customizing the range series. */ - series?: Array; + series?: Series[]; /** Toggles the redrawing of chart on moving the sliders. * @Default {true} @@ -54473,22 +54181,22 @@ export interface Model { yName?: any; /** Fires on load of range navigator. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Fires after range navigator is loaded. */ - loaded? (e: LoadedEventArgs): void; + loaded?(e: LoadedEventArgs): void; /** Fires on changing the range of range navigator. */ - rangeChanged? (e: RangeChangedEventArgs): void; + rangeChanged?(e: RangeChangedEventArgs): void; /** Fires on changing the scrollbar position of range navigator. */ - scrollChanged? (e: ScrollChangedEventArgs): void; + scrollChanged?(e: ScrollChangedEventArgs): void; /** Fires on when starting to change the scrollbar position of range navigator. */ - scrollStart? (e: ScrollStartEventArgs): void; + scrollStart?(e: ScrollStartEventArgs): void; /** Fires on changes ending the scrollbar position of range navigator. */ - scrollEnd? (e: ScrollEndEventArgs): void; + scrollEnd?(e: ScrollEndEventArgs): void; } export interface LoadEventArgs { @@ -55347,10 +55055,8 @@ export interface ValueAxisSettings { visible?: boolean; } } -module RangeNavigator -{ -enum Type -{ +namespace RangeNavigator { +enum Type { //string Area, //string @@ -55365,10 +55071,8 @@ SplineArea, StepLine, } } -module RangeNavigator -{ -enum IntervalType -{ +namespace RangeNavigator { +enum IntervalType { //string Years, //string @@ -55385,30 +55089,24 @@ Hours, Minutes, } } -module RangeNavigator -{ -enum LabelPlacement -{ +namespace RangeNavigator { +enum LabelPlacement { //string Inside, //string Outside, } } -module RangeNavigator -{ -enum Position -{ +namespace RangeNavigator { +enum Position { //string Top, //string Bottom, } } -module RangeNavigator -{ -enum FontStyle -{ +namespace RangeNavigator { +enum FontStyle { //string Normal, //string @@ -55417,20 +55115,16 @@ Bold, Italic, } } -module RangeNavigator -{ -enum FontWeight -{ +namespace RangeNavigator { +enum FontWeight { //string Regular, //string Lighter, } } -module RangeNavigator -{ -enum HorizontalAlignment -{ +namespace RangeNavigator { +enum HorizontalAlignment { //string Middle, //string @@ -55439,10 +55133,8 @@ Left, Right, } } -module RangeNavigator -{ -enum RangePadding -{ +namespace RangeNavigator { +enum RangePadding { //string Additional, //string @@ -55453,10 +55145,8 @@ None, Round, } } -module RangeNavigator -{ -enum ValueType -{ +namespace RangeNavigator { +enum ValueType { //string Numeric, //string @@ -55466,11 +55156,10 @@ DateTime, class BulletGraph extends ej.Widget { static fn: BulletGraph; - constructor(element: JQuery, options?: BulletGraph.Model); - constructor(element: Element, options?: BulletGraph.Model); + constructor(element: JQuery | Element, options?: BulletGraph.Model); static Locale: any; - model:BulletGraph.Model; - defaults:BulletGraph.Model; + model: BulletGraph.Model; + defaults: BulletGraph.Model; /** To destroy the bullet graph * @returns {void} @@ -55492,7 +55181,7 @@ class BulletGraph extends ej.Widget { */ setFeatureMeasureBarValue(): void; } -export module BulletGraph{ +export namespace BulletGraph { export interface Model { @@ -55542,7 +55231,7 @@ export interface Model { /** Contains property to customize the qualitative ranges. */ - qualitativeRanges?: Array; + qualitativeRanges?: QualitativeRange[]; /** Size of the qualitative range depends up on the specified value. * @Default {32} @@ -55578,28 +55267,28 @@ export interface Model { width?: number; /** Fires on rendering the caption of bullet graph. */ - drawCaption? (e: DrawCaptionEventArgs): void; + drawCaption?(e: DrawCaptionEventArgs): void; /** Fires on rendering the category. */ - drawCategory? (e: DrawCategoryEventArgs): void; + drawCategory?(e: DrawCategoryEventArgs): void; /** Fires on rendering the comparative measure symbol. */ - drawComparativeMeasureSymbol? (e: DrawComparativeMeasureSymbolEventArgs): void; + drawComparativeMeasureSymbol?(e: DrawComparativeMeasureSymbolEventArgs): void; /** Fires on rendering the feature measure bar. */ - drawFeatureMeasureBar? (e: DrawFeatureMeasureBarEventArgs): void; + drawFeatureMeasureBar?(e: DrawFeatureMeasureBarEventArgs): void; /** Fires on rendering the indicator of bullet graph. */ - drawIndicator? (e: DrawIndicatorEventArgs): void; + drawIndicator?(e: DrawIndicatorEventArgs): void; /** Fires on rendering the labels. */ - drawLabels? (e: DrawLabelsEventArgs): void; + drawLabels?(e: DrawLabelsEventArgs): void; /** Fires on rendering the qualitative ranges. */ - drawQualitativeRanges? (e: DrawQualitativeRangesEventArgs): void; + drawQualitativeRanges?(e: DrawQualitativeRangesEventArgs): void; /** Fires on loading bullet graph. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; } export interface DrawCaptionEventArgs { @@ -55736,6 +55425,7 @@ export interface DrawQualitativeRangesEventArgs { } export interface LoadEventArgs { + undefined; } export interface CaptionSettingsFont { @@ -56299,7 +55989,7 @@ export interface QuantitativeScaleSettings { /** Contains property to customize the featured measure. */ - featureMeasures?: Array; + featureMeasures?: QuantitativeScaleSettingsFeatureMeasure[]; /** Contains property to customize the fields. */ @@ -56375,10 +56065,8 @@ export interface TooltipSettings { visible?: boolean; } } -module BulletGraph -{ -enum FontStyle -{ +namespace BulletGraph { +enum FontStyle { //string Normal, //string @@ -56387,10 +56075,8 @@ Italic, Oblique, } } -module BulletGraph -{ -enum FontWeight -{ +namespace BulletGraph { +enum FontWeight { //string Normal, //string @@ -56401,10 +56087,8 @@ Bolder, Lighter, } } -module BulletGraph -{ -enum TextAlignment -{ +namespace BulletGraph { +enum TextAlignment { //string Near, //string @@ -56413,10 +56097,8 @@ Far, Center, } } -module BulletGraph -{ -enum TextAnchor -{ +namespace BulletGraph { +enum TextAnchor { //string Start, //string @@ -56425,10 +56107,8 @@ Middle, End, } } -module BulletGraph -{ -enum TextPosition -{ +namespace BulletGraph { +enum TextPosition { //string Top, //string @@ -56441,60 +56121,48 @@ Bottom, Float, } } -module BulletGraph -{ -enum FlowDirection -{ +namespace BulletGraph { +enum FlowDirection { //string Forward, //string Backward, } } -module BulletGraph -{ -enum Orientation -{ +namespace BulletGraph { +enum Orientation { //string Horizontal, //string Vertical, } } -module BulletGraph -{ -enum LabelPlacement -{ +namespace BulletGraph { +enum LabelPlacement { //string Inside, //string Outside, } } -module BulletGraph -{ -enum LabelPosition -{ +namespace BulletGraph { +enum LabelPosition { //string Above, //string Below, } } -module BulletGraph -{ -enum TickPlacement -{ +namespace BulletGraph { +enum TickPlacement { //string Inside, //string Outside, } } -module BulletGraph -{ -enum TickPosition -{ +namespace BulletGraph { +enum TickPosition { //string Below, //string @@ -56506,11 +56174,10 @@ Cross, class Barcode extends ej.Widget { static fn: Barcode; - constructor(element: JQuery, options?: Barcode.Model); - constructor(element: Element, options?: Barcode.Model); + constructor(element: JQuery | Element, options?: Barcode.Model); static Locale: any; - model:Barcode.Model; - defaults:Barcode.Model; + model: Barcode.Model; + defaults: Barcode.Model; /** To disable the barcode * @returns {void} @@ -56522,7 +56189,7 @@ class Barcode extends ej.Widget { */ enable(): void; } -export module Barcode{ +export namespace Barcode { export interface Model { @@ -56583,7 +56250,7 @@ export interface Model { xDimension?: number; /** Fires after Barcode control is loaded. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; } export interface LoadEventArgs { @@ -56628,10 +56295,8 @@ export interface QuietZone { top?: number; } } -module Barcode -{ -enum SymbologyType -{ +namespace Barcode { +enum SymbologyType { //Represents the QR code QRBarcode, //Represents the Data Matrix barcode @@ -56661,11 +56326,10 @@ Code128C, class Map extends ej.Widget { static fn: Map; - constructor(element: JQuery, options?: Map.Model); - constructor(element: Element, options?: Map.Model); + constructor(element: JQuery | Element, options?: Map.Model); static Locale: any; - model:Map.Model; - defaults:Map.Model; + model: Map.Model; + defaults: Map.Model; /** Method for navigating to specific shape based on latitude, longitude and zoom level. * @param {number} Pass the latitude value for map @@ -56704,7 +56368,7 @@ class Map extends ej.Widget { */ zoom(level: number, isAnimate: boolean): void; } -export module Map{ +export namespace Map { export interface Model { @@ -56753,31 +56417,31 @@ export interface Model { /** Layer for holding the map shapes */ - layers?: Array; + layers?: Layer[]; /** Triggered on selecting the map markers. */ - markerSelected? (e: MarkerSelectedEventArgs): void; + markerSelected?(e: MarkerSelectedEventArgs): void; /** Triggers while leaving the hovered map shape */ - mouseleave? (e: MouseleaveEventArgs): void; + mouseleave?(e: MouseleaveEventArgs): void; /** Triggers while hovering the map shape. */ - mouseover? (e: MouseoverEventArgs): void; + mouseover?(e: MouseoverEventArgs): void; /** Triggers once map render completed. */ - onRenderComplete? (e: OnRenderCompleteEventArgs): void; + onRenderComplete?(e: OnRenderCompleteEventArgs): void; /** Triggers when map panning ends. */ - panned? (e: PannedEventArgs): void; + panned?(e: PannedEventArgs): void; /** Triggered on selecting the map shapes. */ - shapeSelected? (e: ShapeSelectedEventArgs): void; + shapeSelected?(e: ShapeSelectedEventArgs): void; /** Triggered when map is zoomed-in. */ - zoomedIn? (e: ZoomedInEventArgs): void; + zoomedIn?(e: ZoomedInEventArgs): void; /** Triggers when map is zoomed out. */ - zoomedOut? (e: ZoomedOutEventArgs): void; + zoomedOut?(e: ZoomedOutEventArgs): void; } export interface MarkerSelectedEventArgs { @@ -56919,7 +56583,7 @@ export interface LayersBubbleSettingsColorMappingsRangeColorMapping { /** GradientColors in the bubble layer of map. */ - gradientColors?: Array; + gradientColors?: any[]; /** Color of the bubble layer. * @Default {null} @@ -56932,7 +56596,7 @@ export interface LayersBubbleSettingsColorMappings { /** Specifies the range colorMappings in the bubble layer. * @Default {null} */ - rangeColorMapping?: Array; + rangeColorMapping?: LayersBubbleSettingsColorMappingsRangeColorMapping[]; } export interface LayersBubbleSettings { @@ -56993,7 +56657,7 @@ export interface LayersLabelSettings { /** enable or disable the enableSmartLabel property * @Default {false} */ - enableSmartLabel?: Boolean; + enableSmartLabel?: boolean; /** set the labelLength property * @Default {'2'} @@ -57124,7 +56788,7 @@ export interface LayersShapeSettingsColorMappingsRangeColorMapping { /** Specifies the gradientColors in the shape layer of map. * @Default {null} */ - gradientColors?: Array; + gradientColors?: any[]; } export interface LayersShapeSettingsColorMappingsEqualColorMapping { @@ -57145,12 +56809,12 @@ export interface LayersShapeSettingsColorMappings { /** Specifies the range colorMappings in the shape layer of map. * @Default {null} */ - rangeColorMapping?: Array; + rangeColorMapping?: LayersShapeSettingsColorMappingsRangeColorMapping[]; /** Specifies the equalColorMapping in the shape layer of map. * @Default {null} */ - equalColorMapping?: Array; + equalColorMapping?: LayersShapeSettingsColorMappingsEqualColorMapping[]; } export interface LayersShapeSettings { @@ -57289,7 +56953,7 @@ export interface Layer { /** Specify markers for shape layer. * @Default {[]} */ - markers?: Array; + markers?: any[]; /** Specifies the map marker template for map layer. * @Default {null} @@ -57299,7 +56963,7 @@ export interface Layer { /** Specify selectedMapShapes for shape layer * @Default {[]} */ - selectedMapShapes?: Array; + selectedMapShapes?: any[]; /** Specifies the selection mode of the map. Accepted selection mode values are Default and Multiple. * @Default {default} @@ -57334,10 +56998,8 @@ export interface Layer { urlTemplate?: string; } } -module Map -{ -enum Position -{ +namespace Map { +enum Position { //specifies the none position None, //specifies the topleft position @@ -57360,20 +57022,16 @@ Bottomcenter, Bottomright, } } -module Map -{ -enum LabelOrientation -{ +namespace Map { +enum LabelOrientation { //specifies the horizontal position Horizontal, //specifies the vertical position Vertical, } } -module Map -{ -enum BingMapType -{ +namespace Map { +enum BingMapType { //specifies the aerial type Aerial, //specifies the aerialwithlabel type @@ -57382,20 +57040,16 @@ Aerialwithlabel, Road, } } -module Map -{ -enum LabelSize -{ +namespace Map { +enum LabelSize { //specifies the fixed size Fixed, //specifies the default size Default, } } -module Map -{ -enum LayerType -{ +namespace Map { +enum LayerType { //specifies the geometry type Geometry, //specifies the osm type @@ -57404,10 +57058,8 @@ Osm, Bing, } } -module Map -{ -enum DockPosition -{ +namespace Map { +enum DockPosition { //specifies the top position Top, //specifies the bottom position @@ -57418,50 +57070,40 @@ Right, Left, } } -module Map -{ -enum LegendIcons -{ +namespace Map { +enum LegendIcons { //specifies the rectangle position Rectangle, //specifies the circle position Circle, } } -module Map -{ -enum Mode -{ +namespace Map { +enum Mode { //specifies the default mode Default, //specifies the interactive mode Interactive, } } -module Map -{ -enum LegendType -{ +namespace Map { +enum LegendType { //specifies the layers type Layers, //specifies the bubbles type Bubbles, } } -module Map -{ -enum SelectionMode -{ +namespace Map { +enum SelectionMode { //specifies the default position Default, //specifies the multiple position Multiple, } } -module Map -{ -enum ColorPalette -{ +namespace Map { +enum ColorPalette { //specifies the palette1 color Palette1, //specifies the palette2 color @@ -57475,18 +57117,17 @@ Custompalette, class TreeMap extends ej.Widget { static fn: TreeMap; - constructor(element: JQuery, options?: TreeMap.Model); - constructor(element: Element, options?: TreeMap.Model); + constructor(element: JQuery | Element, options?: TreeMap.Model); static Locale: any; - model:TreeMap.Model; - defaults:TreeMap.Model; + model: TreeMap.Model; + defaults: TreeMap.Model; /** Method to reload treemap with updated values. * @returns {void} */ refresh(): void; } -export module TreeMap{ +export namespace TreeMap { export interface Model { @@ -57575,7 +57216,7 @@ export interface Model { /** Specifies the group color mapping of the treemap * @Default {[]} */ - groupColorMapping?: Array; + groupColorMapping?: GroupColorMapping[]; /** Specifies the legend settings of the treemap */ @@ -57623,7 +57264,7 @@ export interface Model { /** Specifies the rangeColorMapping settings of the treemap * @Default {[]} */ - rangeColorMapping?: Array; + rangeColorMapping?: RangeColorMapping[]; /** Specifies the selection mode of treemap item. Accepted selection mode values are Default and Multiple. * @Default {default} @@ -57657,12 +57298,12 @@ export interface Model { /** Hold the treeMapItems to be displayed in treemap * @Default {[]} */ - treeMapItems?: Array; + treeMapItems?: any[]; /** Specify levels of treemap for grouped visualization of data * @Default {[]} */ - levels?: Array; + levels?: Level[]; /** Specifies the weight value path of the treemap * @Default {null} @@ -57670,7 +57311,7 @@ export interface Model { weightValuePath?: string; /** Triggers on treemap item selected. */ - treeMapItemSelected? (e: TreeMapItemSelectedEventArgs): void; + treeMapItemSelected?(e: TreeMapItemSelectedEventArgs): void; } export interface TreeMapItemSelectedEventArgs { @@ -57721,7 +57362,7 @@ export interface PaletteColorMapping { /** Specifies the colors of the paletteColorMapping * @Default {[]} */ - colors?: Array; + colors?: any[]; } export interface GroupColorMapping { @@ -57840,7 +57481,7 @@ export interface RangeColorMapping { /** specifies the gradient colors for th given range value * @Default {[]} */ - gradientColors?: Array; + gradientColors?: any[]; /** Specifies the from value for rangeColorMapping. * @Default {-1} @@ -57930,10 +57571,8 @@ export interface Level { showLabels?: boolean; } } -module TreeMap -{ -enum DockPosition -{ +namespace TreeMap { +enum DockPosition { //specifies the top position Top, //specifies the bottom position @@ -57944,10 +57583,8 @@ Right, Left, } } -module TreeMap -{ -enum ItemsLayoutMode -{ +namespace TreeMap { +enum ItemsLayoutMode { //specifies the squarified as layout type position Squarified, //specifies the sliceanddicehorizontal as layout type position @@ -57958,10 +57595,8 @@ Sliceanddicevertical, Sliceanddiceauto, } } -module TreeMap -{ -enum Position -{ +namespace TreeMap { +enum Position { //specifies the none position None, //specifies the topleft position @@ -57984,30 +57619,24 @@ Bottomcenter, Bottomright, } } -module TreeMap -{ -enum VisibilityMode -{ +namespace TreeMap { +enum VisibilityMode { //specifies the visible mode Top, //specifies the hide on exceeded length mode Hideonexceededlength, } } -module TreeMap -{ -enum selectionMode -{ +namespace TreeMap { +enum selectionMode { //specifies the default mode Default, //specifies the multiple mode Multiple, } } -module TreeMap -{ -enum groupSelectionMode -{ +namespace TreeMap { +enum groupSelectionMode { //specifies the default mode Default, //specifies the multiple mode @@ -58017,11 +57646,10 @@ Multiple, class Diagram extends ej.Widget { static fn: Diagram; - constructor(element: JQuery, options?: Diagram.Model); - constructor(element: Element, options?: Diagram.Model); + constructor(element: JQuery | Element, options?: Diagram.Model); static Locale: any; - model:Diagram.Model; - defaults:Diagram.Model; + model: Diagram.Model; + defaults: Diagram.Model; /** Add nodes and connectors to diagram at runtime * @param {any} a JSON to define a node/connector or an array of nodes and connector @@ -58055,7 +57683,7 @@ class Diagram extends ej.Widget { * @param {Array} a collection of ports to be added to the specified node * @returns {void} */ - addPorts(name: string, ports: Array): void; + addPorts(name: string, ports: any[]): void; /** Add the specified node to selection list * @param {any} the node to be selected @@ -58336,12 +57964,12 @@ class Diagram extends ej.Widget { upgrade(data: any): void; /** Used to zoomIn/zoomOut diagram - * @param {Diagram.Zoom} options to zoom the diagram(zoom factor, zoomIn/zoomOut) + * @param {Diagram.Zoom} options to zoom the diagram(zoom factor, zoomIn/zoomOut) * @returns {void} */ zoomTo(Zoom?: Diagram.Zoom): void; } -export module Diagram{ +export namespace Diagram { export interface Options { @@ -58384,7 +58012,7 @@ export interface Zoom { */ zoomCommand?: ej.datavisualization.Diagram.ZoomCommand; - /** Used to zoom-in or zoom-out the diagram based on the point. + /** Used to zoom-in or zoom-out the diagram based on the point. */ focusPoint?: ej.datavisualization.Diagram.ConnectorsSourcePoint; } @@ -58412,7 +58040,7 @@ export interface Model { /** A collection of JSON objects where each object represents a connector * @Default {[]} */ - connectors?: Array; + connectors?: Connector[]; /** Binds the custom JSON data with connector properties * @Default {null} @@ -58478,7 +58106,7 @@ export interface Model { /** Array of JSON objects where each object represents a node * @Default {[]} */ - nodes?: Array; + nodes?: Node[]; /** Binds the custom JSON data with node properties * @Default {null} @@ -58527,94 +58155,94 @@ export interface Model { zoomFactor?: number; /** Triggers When auto scroll is changed */ - autoScrollChange? (e: AutoScrollChangeEventArgs): void; + autoScrollChange?(e: AutoScrollChangeEventArgs): void; /** Triggers when a node, connector or diagram is clicked */ - click? (e: ClickEventArgs): void; + click?(e: ClickEventArgs): void; /** Triggers when the connection is changed */ - connectionChange? (e: ConnectionChangeEventArgs): void; + connectionChange?(e: ConnectionChangeEventArgs): void; /** Triggers when the connector collection is changed */ - connectorCollectionChange? (e: ConnectorCollectionChangeEventArgs): void; + connectorCollectionChange?(e: ConnectorCollectionChangeEventArgs): void; /** Triggers when the connectors' source point is changed */ - connectorSourceChange? (e: ConnectorSourceChangeEventArgs): void; + connectorSourceChange?(e: ConnectorSourceChangeEventArgs): void; /** Triggers when the connectors' target point is changed */ - connectorTargetChange? (e: ConnectorTargetChangeEventArgs): void; + connectorTargetChange?(e: ConnectorTargetChangeEventArgs): void; /** Triggers before opening the context menu */ - contextMenuBeforeOpen? (e: ContextMenuBeforeOpenEventArgs): void; + contextMenuBeforeOpen?(e: ContextMenuBeforeOpenEventArgs): void; /** Triggers when a context menu item is clicked */ - contextMenuClick? (e: ContextMenuClickEventArgs): void; + contextMenuClick?(e: ContextMenuClickEventArgs): void; /** Triggers when a node, connector or diagram model is clicked twice */ - doubleClick? (e: DoubleClickEventArgs): void; + doubleClick?(e: DoubleClickEventArgs): void; /** Triggers while dragging the elements in diagram */ - drag? (e: DragEventArgs): void; + drag?(e: DragEventArgs): void; /** Triggers when a symbol is dragged into diagram from symbol palette */ - dragEnter? (e: DragEnterEventArgs): void; + dragEnter?(e: DragEnterEventArgs): void; /** Triggers when a symbol is dragged outside of the diagram. */ - dragLeave? (e: DragLeaveEventArgs): void; + dragLeave?(e: DragLeaveEventArgs): void; /** Triggers when a symbol is dragged over diagram */ - dragOver? (e: DragOverEventArgs): void; + dragOver?(e: DragOverEventArgs): void; /** Triggers when a symbol is dragged and dropped from symbol palette to drawing area */ - drop? (e: DropEventArgs): void; + drop?(e: DropEventArgs): void; /** Triggers when editor got focus at the time of node's label or text node editing. */ - editorFocusChange? (e: EditorFocusChangeEventArgs): void; + editorFocusChange?(e: EditorFocusChangeEventArgs): void; /** Triggers when a child is added to or removed from a group */ - groupChange? (e: GroupChangeEventArgs): void; + groupChange?(e: GroupChangeEventArgs): void; /** Triggers when a change is reverted or restored(undo/redo) */ - historyChange? (e: HistoryChangeEventArgs): void; + historyChange?(e: HistoryChangeEventArgs): void; /** Triggers when a diagram element is clicked */ - itemClick? (e: ItemClickEventArgs): void; + itemClick?(e: ItemClickEventArgs): void; /** Triggers when mouse enters a node/connector */ - mouseEnter? (e: MouseEnterEventArgs): void; + mouseEnter?(e: MouseEnterEventArgs): void; /** Triggers when mouse leaves node/connector */ - mouseLeave? (e: MouseLeaveEventArgs): void; + mouseLeave?(e: MouseLeaveEventArgs): void; /** Triggers when mouse hovers over a node/connector */ - mouseOver? (e: MouseOverEventArgs): void; + mouseOver?(e: MouseOverEventArgs): void; /** Triggers when node collection is changed */ - nodeCollectionChange? (e: NodeCollectionChangeEventArgs): void; + nodeCollectionChange?(e: NodeCollectionChangeEventArgs): void; /** Triggers when the node properties(x, y,width and height alone) are changed using nudge commands or updateNode API. */ - propertyChange? (e: PropertyChangeEventArgs): void; + propertyChange?(e: PropertyChangeEventArgs): void; /** Triggers when the diagram elements are rotated */ - rotationChange? (e: RotationChangeEventArgs): void; + rotationChange?(e: RotationChangeEventArgs): void; /** Triggers when the diagram is zoomed or panned */ - scrollChange? (e: ScrollChangeEventArgs): void; + scrollChange?(e: ScrollChangeEventArgs): void; /** Triggers when a connector segment is edited */ - segmentChange? (e: SegmentChangeEventArgs): void; + segmentChange?(e: SegmentChangeEventArgs): void; /** Triggers when the selection is changed in diagram */ - selectionChange? (e: SelectionChangeEventArgs): void; + selectionChange?(e: SelectionChangeEventArgs): void; /** Triggers when a node is resized */ - sizeChange? (e: SizeChangeEventArgs): void; + sizeChange?(e: SizeChangeEventArgs): void; /** Triggers when label editing is ended */ - textChange? (e: TextChangeEventArgs): void; + textChange?(e: TextChangeEventArgs): void; /** Triggered when the diagram is rendered completely. */ - create? (e: CreateEventArgs): void; + create?(e: CreateEventArgs): void; } export interface AutoScrollChangeEventArgs { @@ -58944,6 +58572,7 @@ export interface DropEventArgs { } export interface EditorFocusChangeEventArgs { + undefined; } export interface GroupChangeEventArgs { @@ -58973,11 +58602,11 @@ export interface HistoryChangeEventArgs { /** An array of objects, where each object represents the changes made in last undo/redo. To explore how the changes are defined, refer [Undo Redo Changes](#undo-redo-changes) */ - changes?: Array; + changes?: any[]; /** A collection of objects that are changed in the last undo/redo */ - Source?: Array; + Source?: any[]; /** parameter returns the id of the diagram */ @@ -59187,15 +58816,15 @@ export interface SelectionChangeEventArgs { /** parameter returns the collection of nodes and connectors that have to be removed from selection list */ - oldItems?: Array; + oldItems?: any[]; /** parameter returns the collection of nodes and connectors that have to be added to selection list */ - newItems?: Array; + newItems?: any[]; /** parameter returns the collection of nodes and connectors that will be selected after selection change */ - selectedItems?: Array; + selectedItems?: any[]; /** parameter to specify whether or not to cancel the selection change event */ @@ -59300,11 +58929,11 @@ export interface CommandManagerCommands { /** A method that defines whether the command is executable at the moment or not. */ - canExecute?: Function; + canExecute?: any; /** A method that defines what to be executed when the key combination is recognized. */ - execute?: Function; + execute?: any; /** Defines a combination of keys and key modifiers, on recognition of which the command will be executed */ @@ -59724,7 +59353,7 @@ export interface Connector { /** A collection of JSON objects where each object represents a label. * @Default {[]} */ - labels?: Array; + labels?: ConnectorsLabel[]; /** Sets the stroke color of the connector * @Default {black} @@ -59786,7 +59415,7 @@ export interface Connector { /** An array of JSON objects where each object represents a segment * @Default {[ { type:straight } ]} */ - segments?: Array; + segments?: ConnectorsSegment[]; /** Defines the role/meaning of the connector * @Default {null} @@ -59878,7 +59507,7 @@ export interface ContextMenu { /** Defines the collection of context menu items * @Default {[]} */ - items?: Array; + items?: ContextMenuItem[]; /** To set whether to display the default context menu items or not * @Default {false} @@ -59939,29 +59568,29 @@ export interface HistoryManager { /** A method that takes a history entry as argument and returns whether the specific entry can be popped or not */ - canPop?: Function; + canPop?: any; /** A method that ends grouping the changes */ - closeGroupAction?: Function; + closeGroupAction?: any; /** A method that removes the history of a recent change made in diagram */ - pop?: Function; + pop?: any; /** A method that allows to track the custom changes made in diagram */ - push?: Function; + push?: any; /** Defines what should be happened while trying to restore a custom change * @Default {null} */ - redo?: Function; + redo?: any; /** The redoStack property is used to get the number of redo actions to be stored on the history manager. Its an read-only property and the collection should not be modified. * @Default {[]} */ - redoStack?: Array; + redoStack?: any[]; /** The stackLimit property used to restrict the undo and redo actions to a certain limit. * @Default {null} @@ -59970,16 +59599,16 @@ export interface HistoryManager { /** A method that starts to group the changes to revert/restore them in a single undo or redo */ - startGroupAction?: Function; + startGroupAction?: any; /** Defines what should be happened while trying to revert a custom change */ - undo?: Function; + undo?: any; /** The undoStack property is used to get the number of undo actions to be stored on the history manager. Its an read-only property and the collection should not be modified. * @Default {[]} */ - undoStack?: Array; + undoStack?: any[]; } export interface Layout { @@ -60099,12 +59728,12 @@ export interface NodesClass { /** Defines the collection of attributes * @Default {[]} */ - attributes?: Array; + attributes?: NodesClassAttribute[]; /** Defines the collection of methods of a Class. * @Default {[]} */ - methods?: Array; + methods?: NodesClassMethod[]; } export interface NodesCollapseIcon { @@ -60197,7 +59826,7 @@ export interface NodesEnumeration { /** Defines the collection of enumeration members * @Default {[]} */ - members?: Array; + members?: NodesEnumerationMember[]; } export interface NodesExpandIcon { @@ -60253,7 +59882,7 @@ export interface NodesGradientLinearGradient { /** Defines the different colors and the region of color transitions * @Default {[]} */ - stops?: Array; + stops?: any[]; /** Defines the left most position(relative to node) of the rectangular region that needs to be painted * @Default {0} @@ -60301,7 +59930,7 @@ export interface NodesGradientRadialGradient { /** Defines the different colors and the region of color transitions. * @Default {[]} */ - stops?: Array; + stops?: any[]; } export interface NodesGradientStop { @@ -60367,12 +59996,12 @@ export interface NodesInterface { /** Defines a collection of attributes of the interface * @Default {[]} */ - attributes?: Array; + attributes?: NodesInterfaceAttribute[]; /** Defines the collection of public methods of an interface * @Default {[]} */ - methods?: Array; + methods?: NodesInterfaceMethod[]; } export interface NodesLabel { @@ -60526,7 +60155,7 @@ export interface NodesLane { /** An array of objects where each object represents a child node of the lane * @Default {[]} */ - children?: Array; + children?: any[]; /** Defines the fill color of the lane * @Default {white} @@ -60731,7 +60360,7 @@ export interface NodesSubProcess { /** Defines the collection of events that need to be appended with BPMN Sub-Process */ - events?: Array; + events?: any[]; /** Defines the loop type of a sub process. * @Default {ej.datavisualization.Diagram.BPMNLoops.None} @@ -60741,7 +60370,7 @@ export interface NodesSubProcess { /** Defines the children for BPMN's SubProcess * @Default {[]} */ - Processes?: Array; + Processes?: any[]; /** Defines the type of the event trigger * @Default {ej.datavisualization.Diagram.BPMNTriggers.Message} @@ -60816,7 +60445,7 @@ export interface Node { /** Array of JSON objects where each object represents a child node/connector * @Default {[]} */ - children?: Array; + children?: any[]; /** Sets the type of UML classifier. Applicable, if the node is a UML Class Diagram shape. * @Default {ej.datavisualization.Diagram.ClassifierShapes.Class} @@ -60916,7 +60545,7 @@ export interface Node { /** A read only collection of the incoming connectors/edges of the node * @Default {[]} */ - inEdges?: Array; + inEdges?: any[]; /** Defines an interface in a UML Class Diagram * @Default {null} @@ -60936,12 +60565,12 @@ export interface Node { /** A collection of objects where each object represents a label * @Default {[]} */ - labels?: Array; + labels?: NodesLabel[]; /** An array of objects where each object represents a lane. Applicable, if the node is a swimlane. * @Default {[]} */ - lanes?: Array; + lanes?: NodesLane[]; /** Defines the minimum space to be left between the bottom of parent bounds and the node. Applicable, if the parent is a container. * @Default {0} @@ -61010,7 +60639,7 @@ export interface Node { /** A read only collection of outgoing connectors/edges of the node * @Default {[]} */ - outEdges?: Array; + outEdges?: any[]; /** Defines the minimum padding value to be left between the bottom most position of a group and its children. Applicable, if the group is a container. * @Default {0} @@ -61048,7 +60677,7 @@ export interface Node { /** An array of objects, where each object represents a smaller region(phase) of a swimlane. * @Default {[]} */ - phases?: Array; + phases?: NodesPhase[]; /** Sets the height of the phase headers * @Default {0} @@ -61063,12 +60692,12 @@ export interface Node { /** Defines a collection of points to draw a polygon. Applicable, if the shape is a polygon. * @Default {[]} */ - points?: Array; + points?: any[]; /** An array of objects where each object represents a port * @Default {[]} */ - ports?: Array; + ports?: NodesPort[]; /** Sets the angle to which the node should be rotated * @Default {0} @@ -61296,7 +60925,7 @@ export interface SelectedItems { /** A read only collection of the selected items * @Default {[]} */ - children?: Array; + children?: any[]; /** Controls the visibility of selector. * @Default {ej.datavisualization.Diagram.SelectorConstraints.All} @@ -61336,7 +60965,7 @@ export interface SelectedItems { /** A collection of frequently used commands that will be added around the selector * @Default {[]} */ - userHandles?: Array; + userHandles?: SelectedItemsUserHandle[]; /** Sets the width of the selected items * @Default {0} @@ -61358,12 +60987,12 @@ export interface SnapSettingsHorizontalGridLines { /** A pattern of lines and gaps that defines a set of horizontal gridlines * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} */ - linesInterval?: Array; + linesInterval?: any[]; /** Specifies a set of intervals to snap the objects * @Default {[20]} */ - snapInterval?: Array; + snapInterval?: any[]; } export interface SnapSettingsVerticalGridLines { @@ -61380,12 +61009,12 @@ export interface SnapSettingsVerticalGridLines { /** A pattern of lines and gaps that defines a set of horizontal gridlines * @Default {[1.25, 18.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75, 0.25, 19.75]} */ - linesInterval?: Array; + linesInterval?: any[]; /** Specifies a set of intervals to snap the objects * @Default {[20]} */ - snapInterval?: Array; + snapInterval?: any[]; } export interface SnapSettings { @@ -61452,13 +61081,11 @@ export interface Tooltip { templateId?: string; } } -module Diagram -{ -enum ImageAlignment -{ +namespace Diagram { +enum ImageAlignment { //Scales the graphic content non-uniformly to the width and height of the diagram area None, -//Used to align the image at the top left of diagram area +//Used to align the image at the top left of diagram area XMinYMin, //Used to align the image at the left center of diagram area XMinYMid, @@ -61478,10 +61105,8 @@ XMaxYMid, XMaxYMax, } } -module Diagram -{ -enum BridgeDirection -{ +namespace Diagram { +enum BridgeDirection { //Used to set the direction of line bridges as left Left, //Used to set the direction of line bridges as right @@ -61492,10 +61117,8 @@ Top, Bottom, } } -module Diagram -{ -enum Keys -{ +namespace Diagram { +enum Keys { //No key pressed. None, //The A key. @@ -61588,10 +61211,8 @@ Tab, Enter, } } -module Diagram -{ -enum KeyModifiers -{ +namespace Diagram { +enum KeyModifiers { //No modifiers are pressed. None, //The ALT key. @@ -61602,10 +61223,8 @@ Control, Shift, } } -module Diagram -{ -enum ConnectorConstraints -{ +namespace Diagram { +enum ConnectorConstraints { //Disable all connector Constraints None, //Enables connector to be selected @@ -61634,10 +61253,8 @@ CrispEdges, Default, } } -module Diagram -{ -enum HorizontalAlignment -{ +namespace Diagram { +enum HorizontalAlignment { //Used to align text horizontally on left side of node/connector Left, //Used to align text horizontally on center of node/connector @@ -61646,10 +61263,8 @@ Center, Right, } } -module Diagram -{ -enum Alignment -{ +namespace Diagram { +enum Alignment { //Used to align the label either top or left(before) of the connector segment Before, //Used to align the label at center of the connector segment @@ -61658,20 +61273,16 @@ Center, After, } } -module Diagram -{ -enum LabelRelativeMode -{ +namespace Diagram { +enum LabelRelativeMode { //Sets the relativeMode as SegmentPath SegmentPath, //Sets the relativeMode as SegmentBounds SegmentBounds, } } -module Diagram -{ -enum Segments -{ +namespace Diagram { +enum Segments { //Used to specify the lines as Straight Straight, //Used to specify the lines as Orthogonal @@ -61680,10 +61291,8 @@ Orthogonal, Bezier, } } -module Diagram -{ -enum ConnectorShapes -{ +namespace Diagram { +enum ConnectorShapes { //Used to specify connector type as BPMN BPMN, //Used to specify connector type as UMLClassifier @@ -61692,22 +61301,18 @@ UMLClassifier, UMLActivity, } } -module Diagram -{ -enum BPMNFlows -{ +namespace Diagram { +enum BPMNFlows { //Used to specify the Sequence flow in a BPMN Process Sequence, -//Used to specify the Association flow in a BPMN Process +//Used to specify the Association flow in a BPMN Process Association, //Used to specify the Message flow in a BPMN Process Message, } } -module Diagram -{ -enum AssociationFlows -{ +namespace Diagram { +enum AssociationFlows { //Used to notate default association in a BPMN Process Default, //Used to notate directional association in a BPMN Process @@ -61716,10 +61321,8 @@ Directional, BiDirectional, } } -module Diagram -{ -enum BPMNMessageFlows -{ +namespace Diagram { +enum BPMNMessageFlows { //Used to notate the default message flow in a BPMN Process Default, //Used to notate the instantiating message flow in a BPMN Process @@ -61728,10 +61331,8 @@ InitiatingMessage, NonInitiatingMessage, } } -module Diagram -{ -enum BPMNSequenceFlows -{ +namespace Diagram { +enum BPMNSequenceFlows { //Used to notate the normal sequence flow in a BPMN Process Normal, //Used to notate the conditional sequence flow in a BPMN Process @@ -61740,10 +61341,8 @@ Conditional, Default, } } -module Diagram -{ -enum ClassifierShapes -{ +namespace Diagram { +enum ClassifierShapes { //Used to define a Class Class, //Used to define an Interface @@ -61762,10 +61361,8 @@ Dependency, Inheritance, } } -module Diagram -{ -enum Multiplicity -{ +namespace Diagram { +enum Multiplicity { //Each entity instance is related to a single instance of another entity OneToOne, //An entity instance can be related to multiple instances of the other entities @@ -61776,10 +61373,8 @@ ManyToOne, ManyToMany, } } -module Diagram -{ -enum UMLActivityFlow -{ +namespace Diagram { +enum UMLActivityFlow { //Defines a activity flow as Object in UML Activity Diagram Object, //Defines a activity flow as Control in UML Activity Diagram @@ -61788,10 +61383,8 @@ Control, Exception, } } -module Diagram -{ -enum DecoratorShapes -{ +namespace Diagram { +enum DecoratorShapes { //Used to set decorator shape as none None, //Used to set decorator shape as Arrow @@ -61806,10 +61399,8 @@ Diamond, Path, } } -module Diagram -{ -enum VerticalAlignment -{ +namespace Diagram { +enum VerticalAlignment { //Used to align text Vertically on left side of node/connector Top, //Used to align text Vertically on center of node/connector @@ -61818,10 +61409,8 @@ Center, Bottom, } } -module Diagram -{ -enum DiagramConstraints -{ +namespace Diagram { +enum DiagramConstraints { //Disables all DiagramConstraints None, //Enables/Disables PageEditing @@ -61844,20 +61433,16 @@ CrispEdges, Default, } } -module Diagram -{ -enum LabelRenderingMode -{ +namespace Diagram { +enum LabelRenderingMode { //Sets the labelRenderingMode as Html Html, //Sets the labelRenderingMode as Svg Svg, } } -module Diagram -{ -enum LayoutOrientations -{ +namespace Diagram { +enum LayoutOrientations { //Used to set LayoutOrientation from top to bottom TopToBottom, //Used to set LayoutOrientation from bottom to top @@ -61868,10 +61453,8 @@ LeftToRight, RightToLeft, } } -module Diagram -{ -enum LayoutTypes -{ +namespace Diagram { +enum LayoutTypes { //Used not to set any specific layout None, //Used to set layout type as hierarchical layout @@ -61880,10 +61463,8 @@ HierarchicalTree, OrganizationalChart, } } -module Diagram -{ -enum BPMNActivity -{ +namespace Diagram { +enum BPMNActivity { //Used to set BPMN Activity as None None, //Used to set BPMN Activity as Task @@ -61892,10 +61473,8 @@ Task, SubProcess, } } -module Diagram -{ -enum BPMNAnnotationDirection -{ +namespace Diagram { +enum BPMNAnnotationDirection { //Used to set the direction of BPMN Annotation as left Left, //Used to set the direction of BPMN Annotation as right @@ -61906,10 +61485,8 @@ Top, Bottom, } } -module Diagram -{ -enum IconShapes -{ +namespace Diagram { +enum IconShapes { //Used to set collapse icon shape as none None, //Used to set collapse icon shape as Arrow(Up/Down) @@ -61926,10 +61503,8 @@ Template, Image, } } -module Diagram -{ -enum NodeConstraints -{ +namespace Diagram { +enum NodeConstraints { //Disable all node Constraints None, //Enables node to be selected @@ -61976,20 +61551,16 @@ CrispEdges, Default, } } -module Diagram -{ -enum ContainerType -{ +namespace Diagram { +enum ContainerType { //Sets the container type as Canvas Canvas, //Sets the container type as Stack Stack, } } -module Diagram -{ -enum BPMNDataObjects -{ +namespace Diagram { +enum BPMNDataObjects { //Used to notate the Input type BPMN data object Input, //Used to notate the Output type BPMN data object @@ -61998,10 +61569,8 @@ Output, None, } } -module Diagram -{ -enum BPMNEvents -{ +namespace Diagram { +enum BPMNEvents { //Used to set BPMN Event as Start Start, //Used to set BPMN Event as Intermediate @@ -62016,10 +61585,8 @@ NonInterruptingIntermediate, ThrowingIntermediate, } } -module Diagram -{ -enum BPMNGateways -{ +namespace Diagram { +enum BPMNGateways { //Used to set BPMN Gateway as None None, //Used to set BPMN Gateway as Exclusive @@ -62038,30 +61605,24 @@ ExclusiveEventBased, ParallelEventBased, } } -module Diagram -{ -enum LabelEditMode -{ +namespace Diagram { +enum LabelEditMode { //Used to set label edit mode as edit Edit, //Used to set label edit mode as view View, } } -module Diagram -{ -enum OverflowType -{ +namespace Diagram { +enum OverflowType { //Set overflow Type as ellipsis Ellipsis, //Set overflow Type as Clip Clip, } } -module Diagram -{ -enum TextAlign -{ +namespace Diagram { +enum TextAlign { //Used to align text on left side of node/connector Left, //Used to align text on center of node/connector @@ -62070,10 +61631,8 @@ Center, Right, } } -module Diagram -{ -enum TextDecorations -{ +namespace Diagram { +enum TextDecorations { //Used to set text decoration of the label as Underline Underline, //Used to set text decoration of the label as Overline @@ -62084,10 +61643,8 @@ LineThrough, None, } } -module Diagram -{ -enum TextWrapping -{ +namespace Diagram { +enum TextWrapping { //Disables wrapping NoWrap, //Enables Line-break at normal word break points @@ -62096,10 +61653,8 @@ Wrap, WrapWithOverflow, } } -module Diagram -{ -enum PortConstraints -{ +namespace Diagram { +enum PortConstraints { //Disable all constraints None, //Enables connections with connector @@ -62108,10 +61663,8 @@ Connect, ConnectOnDrag, } } -module Diagram -{ -enum PortShapes -{ +namespace Diagram { +enum PortShapes { //Used to set port shape as X X, //Used to set port shape as Circle @@ -62122,10 +61675,8 @@ Square, Path, } } -module Diagram -{ -enum PortVisibility -{ +namespace Diagram { +enum PortVisibility { //Set the port visibility as Visible Visible, //Set the port visibility as Hidden @@ -62138,10 +61689,8 @@ Connect, Default, } } -module Diagram -{ -enum BasicShapes -{ +namespace Diagram { +enum BasicShapes { //Used to specify node Shape as Rectangle Rectangle, //Used to specify node Shape as Ellipse @@ -62172,10 +61721,8 @@ RightTriangle, Cylinder, } } -module Diagram -{ -enum FlowShapes -{ +namespace Diagram { +enum FlowShapes { //Used to specify node Shape as Process Process, //Used to specify node Shape as Decision @@ -62190,7 +61737,7 @@ Terminator, PaperTap, //Used to specify node Shape as DirectData DirectData, -//Used to specify node Shape as SequentialData +//Used to specify node Shape as SequentialData SequentialData, //Used to specify node Shape as Sort Sort, @@ -62220,14 +61767,12 @@ Annotation1, Annotation2, //Used to specify node Shape as Data Data, -//Used to specify node Shape as Card +//Used to specify node Shape as Card Card, } } -module Diagram -{ -enum BPMNShapes -{ +namespace Diagram { +enum BPMNShapes { //Used to specify node Shape as Event Event, //Used to specify node Shape as Gateway @@ -62244,10 +61789,8 @@ Activity, Group, } } -module Diagram -{ -enum UMLActivityShapes -{ +namespace Diagram { +enum UMLActivityShapes { //Used to set UML ActivityShapes as Action Action, //Used to set UML ActivityShapes as Decision @@ -62276,10 +61819,8 @@ StructuredNode, Note, } } -module Diagram -{ -enum BPMNBoundary -{ +namespace Diagram { +enum BPMNBoundary { //Used to set BPMN SubProcess's Boundary as Default Default, //Used to set BPMN SubProcess's Boundary as Call @@ -62288,10 +61829,8 @@ Call, Event, } } -module Diagram -{ -enum BPMNLoops -{ +namespace Diagram { +enum BPMNLoops { //Used to set BPMN Activity's Loop as None None, //Used to set BPMN Activity's Loop as Standard @@ -62302,10 +61841,8 @@ ParallelMultiInstance, SequenceMultiInstance, } } -module Diagram -{ -enum BPMNSubProcessTypes -{ +namespace Diagram { +enum BPMNSubProcessTypes { //Used to set BPMN SubProcess type as None None, //Used to set BPMN SubProcess type as Transaction @@ -62314,10 +61851,8 @@ Transaction, Event, } } -module Diagram -{ -enum BPMNTasks -{ +namespace Diagram { +enum BPMNTasks { //Used to set BPMN Task Type as None None, //Used to set BPMN Task Type as Service @@ -62340,10 +61875,8 @@ Script, Parallel, } } -module Diagram -{ -enum BPMNTriggers -{ +namespace Diagram { +enum BPMNTriggers { //Used to set Event Trigger as None None, //Used to set Event Trigger as Message @@ -62372,10 +61905,8 @@ Termination, Cancel, } } -module Diagram -{ -enum Shapes -{ +namespace Diagram { +enum Shapes { //Used to specify node type as Text Text, //Used to specify node type as Image @@ -62396,20 +61927,16 @@ UMLClassifier, UMLActivity, } } -module Diagram -{ -enum PageOrientations -{ +namespace Diagram { +enum PageOrientations { //Used to set orientation as Landscape Landscape, //Used to set orientation as portrait Portrait, } } -module Diagram -{ -enum ScrollLimit -{ +namespace Diagram { +enum ScrollLimit { //Used to set scrollLimit as Infinite Infinite, //Used to set scrollLimit as Diagram @@ -62418,10 +61945,8 @@ Diagram, Limited, } } -module Diagram -{ -enum BoundaryConstraints -{ +namespace Diagram { +enum BoundaryConstraints { //Used to set boundaryConstraints as Infinite Infinite, //Used to set boundaryConstraints as Diagram @@ -62430,10 +61955,8 @@ Diagram, Page, } } -module Diagram -{ -enum SelectorConstraints -{ +namespace Diagram { +enum SelectorConstraints { //Hides the selector None, //Sets the visibility of rotation handle as visible @@ -62446,10 +61969,8 @@ UserHandles, All, } } -module Diagram -{ -enum UserHandlePositions -{ +namespace Diagram { +enum UserHandlePositions { //Set the position of the userhandle as topleft TopLeft, //Set the position of the userhandle as topcenter @@ -62468,10 +61989,8 @@ BottomCenter, BottomRight, } } -module Diagram -{ -enum SnapConstraints -{ +namespace Diagram { +enum SnapConstraints { //Enables node to be snapped to horizontal gridlines None, //Enables node to be snapped to vertical gridlines @@ -62490,10 +62009,8 @@ ShowLines, All, } } -module Diagram -{ -enum Tool -{ +namespace Diagram { +enum Tool { //Disables all Tools None, //Enables/Disables SingleSelect tool @@ -62508,20 +62025,16 @@ DrawOnce, ContinuesDraw, } } -module Diagram -{ -enum RelativeMode -{ +namespace Diagram { +enum RelativeMode { //Shows tooltip around the node Object, //Shows tooltip at the mouse position Mouse, } } -module Diagram -{ -enum ZoomCommand -{ +namespace Diagram { +enum ZoomCommand { //Used to zoom in the Diagram ZoomIn, //Used to zoom out the diagram @@ -62531,13 +62044,12 @@ ZoomOut, class HeatMap extends ej.Widget { static fn: HeatMap; - constructor(element: JQuery, options?: HeatMap.Model); - constructor(element: Element, options?: HeatMap.Model); + constructor(element: JQuery | Element, options?: HeatMap.Model); static Locale: any; - model:HeatMap.Model; - defaults:HeatMap.Model; + model: HeatMap.Model; + defaults: HeatMap.Model; } -export module HeatMap{ +export namespace HeatMap { export interface Model { @@ -62593,7 +62105,7 @@ export interface Model { /** Specifies the no of legends can sync with heat map. * @Default {[]} */ - legendCollection?: Array; + legendCollection?: any[]; /** Specifies the property and display value of the heat map column. * @Default {[]} @@ -62603,19 +62115,19 @@ export interface Model { /** Specifies the color values of the heat map column data. * @Default {[]} */ - colorMappingCollection?: Array; + colorMappingCollection?: ColorMappingCollection[]; /** Triggered when the mouse over on the cell. */ - cellMouseOver? (e: CellMouseOverEventArgs): void; + cellMouseOver?(e: CellMouseOverEventArgs): void; /** Triggered when the mouse over on the cell. */ - cellMouseEnter? (e: CellMouseEnterEventArgs): void; + cellMouseEnter?(e: CellMouseEnterEventArgs): void; /** Triggered when the mouse over on the cell. */ - cellMouseLeave? (e: CellMouseLeaveEventArgs): void; + cellMouseLeave?(e: CellMouseLeaveEventArgs): void; /** Triggered when the mouse over on the cell. */ - cellSelected? (e: CellSelectedEventArgs): void; + cellSelected?(e: CellSelectedEventArgs): void; } export interface CellMouseOverEventArgs { @@ -62887,7 +62399,7 @@ export interface ItemsMapping { /** Specifies the property and display value of the collection of column. * @Default {[]} */ - columnMapping?: Array; + columnMapping?: any[]; } export interface ColorMappingCollectionLabel { @@ -62945,10 +62457,8 @@ export interface ColorMappingCollection { label?: ColorMappingCollectionLabel; } } -module HeatMap -{ -enum Associate -{ +namespace HeatMap { +enum Associate { //Used to set the associate of tooltip as Target Target, //Used to set the associate of tooltip as MouseFollow @@ -62957,10 +62467,8 @@ MouseFollow, MouseEnter, } } -module HeatMap -{ -enum Horizontal -{ +namespace HeatMap { +enum Horizontal { //Used to display the tooltip horizontally on left side of rows/columns Left, //Used to display the tooltip horizontally on center side of rows/columns @@ -62969,10 +62477,8 @@ Center, Right, } } -module HeatMap -{ -enum Vertical -{ +namespace HeatMap { +enum Vertical { //Used to display the tooltip horizontally on left side of rows/columns Top, //Used to display the tooltip horizontally on center side of rows/columns @@ -62981,20 +62487,16 @@ Center, Bottom, } } -module HeatMap -{ -enum Trigger -{ +namespace HeatMap { +enum Trigger { //Tooltip can be triggered on mouse hovers Hover, //Tooltip can be triggered on mouse click Click, } } -module HeatMap -{ -enum Effect -{ +namespace HeatMap { +enum Effect { //Sets tooltip animation as None None, //Sets tooltip animation as Fade @@ -63003,21 +62505,17 @@ Fade, Slide, } } -module HeatMap -{ -enum CellVisibility -{ -//Display the content of the cell +namespace HeatMap { +enum CellVisibility { +//Display the content of the cell Visible, -//Hide the content of the cell +//Hide the content of the cell Hidden, } } -module HeatMap -{ -enum TextDecoration -{ -//Defines a line below the text +namespace HeatMap { +enum TextDecoration { +//Defines a line below the text Underline, //Defines a line above the text Overline, @@ -63030,13 +62528,12 @@ None, class HeatMapLegend extends ej.Widget { static fn: HeatMapLegend; - constructor(element: JQuery, options?: HeatMapLegend.Model); - constructor(element: Element, options?: HeatMapLegend.Model); + constructor(element: JQuery | Element, options?: HeatMapLegend.Model); static Locale: any; - model:HeatMapLegend.Model; - defaults:HeatMapLegend.Model; + model: HeatMapLegend.Model; + defaults: HeatMapLegend.Model; } -export module HeatMapLegend{ +export namespace HeatMapLegend { export interface Model { @@ -63063,7 +62560,7 @@ export interface Model { /** Specifies the color values of the column data. * @Default {[]} */ - colorMappingCollection?: Array; + colorMappingCollection?: ColorMappingCollection[]; /** Specifies the orientation of the heatmap legend * @Default {ej.HeatMap.LegendOrientation.Horizontal} @@ -63131,41 +62628,36 @@ export interface ColorMappingCollection { label?: ColorMappingCollectionLabel; } } -module HeatMap -{ -enum LegendOrientation -{ -//Scales the graphic content non-uniformly to the width and height of the diagram area +namespace HeatMap { +enum LegendOrientation { +//Scales the graphic content non-uniformly to the width and height of the diagram area Horizontal, -//Used to align the image at the top left of diagram area +//Used to align the image at the top left of diagram area Vertical, } } -module HeatMap -{ -enum LegendMode -{ -//Scales the graphic content non-uniformly to the width and height of the diagram area +namespace HeatMap { +enum LegendMode { +//Scales the graphic content non-uniformly to the width and height of the diagram area Gradient, -//Used to align the image at the top left of diagram area +//Used to align the image at the top left of diagram area List, } } class Sparkline extends ej.Widget { static fn: Sparkline; - constructor(element: JQuery, options?: Sparkline.Model); - constructor(element: Element, options?: Sparkline.Model); + constructor(element: JQuery | Element, options?: Sparkline.Model); static Locale: any; - model:Sparkline.Model; - defaults:Sparkline.Model; + model: Sparkline.Model; + defaults: Sparkline.Model; /** Redraws the entire sparkline. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. * @returns {void} */ redraw(): void; } -export module Sparkline{ +export namespace Sparkline { export interface Model { @@ -63288,28 +62780,28 @@ export interface Model { axisLineSettings?: AxisLineSettings; /** Fires before loading the sparkline. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Fires after loaded the sparkline. */ - loaded? (e: LoadedEventArgs): void; + loaded?(e: LoadedEventArgs): void; /** Fires before rendering trackball tooltip. You can use this event to customize the text displayed in trackball tooltip. */ - tooltipInitialize? (e: TooltipInitializeEventArgs): void; + tooltipInitialize?(e: TooltipInitializeEventArgs): void; /** Fires before rendering a series. This event is fired for each series in Sparkline. */ - seriesRendering? (e: SeriesRenderingEventArgs): void; + seriesRendering?(e: SeriesRenderingEventArgs): void; /** Fires when mouse is moved over a point. */ - pointRegionMouseMove? (e: PointRegionMouseMoveEventArgs): void; + pointRegionMouseMove?(e: PointRegionMouseMoveEventArgs): void; /** Fires on clicking a point in sparkline. You can use this event to handle clicks made on points. */ - pointRegionMouseClick? (e: PointRegionMouseClickEventArgs): void; + pointRegionMouseClick?(e: PointRegionMouseClickEventArgs): void; /** Fires on moving mouse over the sparkline. */ - sparklineMouseMove? (e: SparklineMouseMoveEventArgs): void; + sparklineMouseMove?(e: SparklineMouseMoveEventArgs): void; /** Fires on moving mouse outside the sparkline. */ - sparklineMouseLeave? (e: SparklineMouseLeaveEventArgs): void; + sparklineMouseLeave?(e: SparklineMouseLeaveEventArgs): void; } export interface LoadEventArgs { @@ -63344,7 +62836,7 @@ export interface LoadedEventArgs { export interface TooltipInitializeEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -63468,7 +62960,7 @@ export interface PointRegionMouseClickEventArgs { export interface SparklineMouseMoveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -63483,7 +62975,7 @@ export interface SparklineMouseMoveEventArgs { export interface SparklineMouseLeaveEventArgs { - /** Set this option to true to cancel the event + /** Set this option to true to cancel the event */ cancel?: boolean; @@ -63684,10 +63176,8 @@ export interface AxisLineSettings { dashArray?: number; } } -module Sparkline -{ -enum Type -{ +namespace Sparkline { +enum Type { //string Area, //string @@ -63700,10 +63190,8 @@ Pie, WinLoss, } } -module Sparkline -{ -enum Theme -{ +namespace Sparkline { +enum Theme { //string Azure, //string @@ -63726,20 +63214,16 @@ GradientLight, GradientDark, } } -module Sparkline -{ -enum FontStyle -{ +namespace Sparkline { +enum FontStyle { //string Normal, //string Italic, } } -module Sparkline -{ -enum FontWeight -{ +namespace Sparkline { +enum FontWeight { //string Regular, //string @@ -63751,11 +63235,10 @@ Lighter, class SunburstChart extends ej.Widget { static fn: SunburstChart; - constructor(element: JQuery, options?: SunburstChart.Model); - constructor(element: Element, options?: SunburstChart.Model); + constructor(element: JQuery | Element, options?: SunburstChart.Model); static Locale: any; - model:SunburstChart.Model; - defaults:SunburstChart.Model; + model: SunburstChart.Model; + defaults: SunburstChart.Model; /** Redraws the entire sunburst. You can call this method whenever you update, add or remove points from the data source or whenever you want to refresh the UI. * @returns {void} @@ -63767,7 +63250,7 @@ class SunburstChart extends ej.Widget { */ _destroy(): void; } -export module SunburstChart{ +export namespace SunburstChart { export interface Model { @@ -63875,7 +63358,7 @@ export interface Model { /** Specify levels of sunburst for grouped visualization of data * @Default {[]} */ - levels?: Array; + levels?: Level[]; /** Options to customize the legend items and legend title. */ @@ -63910,40 +63393,40 @@ export interface Model { animationType?: ej.datavisualization.Sunburst.Animation|string; /** Fires before loading. */ - load? (e: LoadEventArgs): void; + load?(e: LoadEventArgs): void; /** Fires before rendering sunburst. */ - preRender? (e: PreRenderEventArgs): void; + preRender?(e: PreRenderEventArgs): void; /** Fires after rendering sunburst. */ - loaded? (e: LoadedEventArgs): void; + loaded?(e: LoadedEventArgs): void; /** Fires before rendering the datalabel */ - dataLabelRendering? (e: DataLabelRenderingEventArgs): void; + dataLabelRendering?(e: DataLabelRenderingEventArgs): void; /** Fires before rendering each segment */ - segmentRendering? (e: SegmentRenderingEventArgs): void; + segmentRendering?(e: SegmentRenderingEventArgs): void; /** Fires before rendering sunburst title. */ - titleRendering? (e: TitleRenderingEventArgs): void; + titleRendering?(e: TitleRenderingEventArgs): void; /** Fires during initialization of tooltip. */ - tooltipInitialize? (e: TooltipInitializeEventArgs): void; + tooltipInitialize?(e: TooltipInitializeEventArgs): void; /** Fires after clicking the point in sunburst */ - pointRegionClick? (e: PointRegionClickEventArgs): void; + pointRegionClick?(e: PointRegionClickEventArgs): void; /** Fires while moving the mouse over sunburst points */ - pointRegionMousemove? (e: PointRegionMousemoveEventArgs): void; + pointRegionMousemove?(e: PointRegionMousemoveEventArgs): void; /** Fires when clicking the point to perform drilldown. */ - drillDownClick? (e: DrillDownClickEventArgs): void; + drillDownClick?(e: DrillDownClickEventArgs): void; /** Fires when resetting drilldown points. */ - drillDownBack? (e: DrillDownBackEventArgs): void; + drillDownBack?(e: DrillDownBackEventArgs): void; /** Fires after resetting the sunburst points */ - drillDownReset? (e: DrillDownResetEventArgs): void; + drillDownReset?(e: DrillDownResetEventArgs): void; } export interface LoadEventArgs { @@ -64766,20 +64249,16 @@ export interface ZoomSettings { toolbarVerticalAlignment?: ej.datavisualization.Sunburst.SunburstVerticalAlignment|string; } } -module Sunburst -{ -enum FontStyle -{ +namespace Sunburst { +enum FontStyle { //string Normal, //string Italic, } } -module Sunburst -{ -enum FontWeight -{ +namespace Sunburst { +enum FontWeight { //string Regular, //string @@ -64788,20 +64267,16 @@ Bold, Lighter, } } -module Sunburst -{ -enum SunburstLabelRotationMode -{ +namespace Sunburst { +enum SunburstLabelRotationMode { //string Angle, //string Normal, } } -module Sunburst -{ -enum SunburstLabelOverflowMode -{ +namespace Sunburst { +enum SunburstLabelOverflowMode { //string Trim, //string @@ -64810,10 +64285,8 @@ Hide, None, } } -module Sunburst -{ -enum SunburstAlignment -{ +namespace Sunburst { +enum SunburstAlignment { //string Center, //string @@ -64822,10 +64295,8 @@ Near, Far, } } -module Sunburst -{ -enum SunburstHighlightMode -{ +namespace Sunburst { +enum SunburstHighlightMode { //string Point, //string @@ -64836,20 +64307,16 @@ Child, All, } } -module Sunburst -{ -enum SunburstHighlightType -{ +namespace Sunburst { +enum SunburstHighlightType { //string Opacity, //string Color, } } -module Sunburst -{ -enum SunburstClickAction -{ +namespace Sunburst { +enum SunburstClickAction { //string None, //string @@ -64858,10 +64325,8 @@ ToggleSegmentVisibility, ToggleSegmentSelection, } } -module Sunburst -{ -enum SunburstLegendPosition -{ +namespace Sunburst { +enum SunburstLegendPosition { //string Left, //string @@ -64872,10 +64337,8 @@ Top, Bottom, } } -module Sunburst -{ -enum SunburstLegendShape -{ +namespace Sunburst { +enum SunburstLegendShape { //string Diamond, //string @@ -64890,20 +64353,16 @@ Cross, Triangle, } } -module Sunburst -{ -enum SunburstTheme -{ +namespace Sunburst { +enum SunburstTheme { //string FlatLight, //string FlatDark, } } -module Sunburst -{ -enum SunburstHorizontalAlignment -{ +namespace Sunburst { +enum SunburstHorizontalAlignment { //string Center, //string @@ -64912,10 +64371,8 @@ Left, Right, } } -module Sunburst -{ -enum SunburstVerticalAlignment -{ +namespace Sunburst { +enum SunburstVerticalAlignment { //string Top, //string @@ -64924,10 +64381,8 @@ Bottom, Middle, } } -module Sunburst -{ -enum Animation -{ +namespace Sunburst { +enum Animation { //string Rotation, //string @@ -64937,13 +64392,12 @@ FadeIn, class Overview extends ej.Widget { static fn: Overview; - constructor(element: JQuery, options?: Overview.Model); - constructor(element: Element, options?: Overview.Model); + constructor(element: JQuery | Element, options?: Overview.Model); static Locale: any; - model:Overview.Model; - defaults:Overview.Model; + model: Overview.Model; + defaults: Overview.Model; } -export module Overview{ +export namespace Overview { export interface Model { @@ -64967,12 +64421,16 @@ export interface Model { } interface JQueryXHR { + undefined; } interface JQueryPromise { + undefined; } interface JQueryDeferred extends JQueryPromise { + undefined; } interface JQueryParam { + undefined; } interface JQuery { data(key: any): any; @@ -64982,413 +64440,332 @@ interface Window { } interface JQuery { -ejAccordion(): JQuery; ejAccordion(options?: ej.Accordion.Model): JQuery; ejAccordion(memberName: any, value?: any, param?: any): any; -data(key: "ejAccordion"): ej.Accordion; -ejAutocomplete(): JQuery; ejAutocomplete(options?: ej.Autocomplete.Model): JQuery; ejAutocomplete(memberName: any, value?: any, param?: any): any; -data(key: "ejAutocomplete"): ej.Autocomplete; -ejBarcode(): JQuery; ejBarcode(options?: ej.datavisualization.Barcode.Model): JQuery; ejBarcode(memberName: any, value?: any, param?: any): any; -data(key: "ejBarcode"): ej.datavisualization.Barcode; -ejBulletGraph(): JQuery; ejBulletGraph(options?: ej.datavisualization.BulletGraph.Model): JQuery; ejBulletGraph(memberName: any, value?: any, param?: any): any; -data(key: "ejBulletGraph"): ej.datavisualization.BulletGraph; -ejButton(): JQuery; ejButton(options?: ej.Button.Model): JQuery; ejButton(memberName: any, value?: any, param?: any): any; -data(key: "ejButton"): ej.Button; -ejCaptcha(): JQuery; ejCaptcha(options?: ej.Captcha.Model): JQuery; ejCaptcha(memberName: any, value?: any, param?: any): any; -data(key: "ejCaptcha"): ej.Captcha; -ejChart(): JQuery; ejChart(options?: ej.datavisualization.Chart.Model): JQuery; ejChart(memberName: any, value?: any, param?: any): any; -data(key: "ejChart"): ej.datavisualization.Chart; -ejCheckBox(): JQuery; ejCheckBox(options?: ej.CheckBox.Model): JQuery; ejCheckBox(memberName: any, value?: any, param?: any): any; -data(key: "ejCheckBox"): ej.CheckBox; -ejCircularGauge(): JQuery; ejCircularGauge(options?: ej.datavisualization.CircularGauge.Model): JQuery; ejCircularGauge(memberName: any, value?: any, param?: any): any; -data(key: "ejCircularGauge"): ej.datavisualization.CircularGauge; -ejColorPicker(): JQuery; ejColorPicker(options?: ej.ColorPicker.Model): JQuery; ejColorPicker(memberName: any, value?: any, param?: any): any; -data(key: "ejColorPicker"): ej.ColorPicker; -ejDatePicker(): JQuery; ejDatePicker(options?: ej.DatePicker.Model): JQuery; ejDatePicker(memberName: any, value?: any, param?: any): any; -data(key: "ejDatePicker"): ej.DatePicker; -ejDateRangePicker(): JQuery; ejDateRangePicker(options?: ej.DateRangePicker.Model): JQuery; ejDateRangePicker(memberName: any, value?: any, param?: any): any; -data(key: "ejDateRangePicker"): ej.DateRangePicker; -ejDateTimePicker(): JQuery; ejDateTimePicker(options?: ej.DateTimePicker.Model): JQuery; ejDateTimePicker(memberName: any, value?: any, param?: any): any; -data(key: "ejDateTimePicker"): ej.DateTimePicker; -ejDiagram(): JQuery; ejDiagram(options?: ej.datavisualization.Diagram.Model): JQuery; ejDiagram(memberName: any, value?: any, param?: any): any; -data(key: "ejDiagram"): ej.datavisualization.Diagram; -ejDialog(): JQuery; ejDialog(options?: ej.Dialog.Model): JQuery; ejDialog(memberName: any, value?: any, param?: any): any; -data(key: "ejDialog"): ej.Dialog; -ejDigitalGauge(): JQuery; ejDigitalGauge(options?: ej.datavisualization.DigitalGauge.Model): JQuery; ejDigitalGauge(memberName: any, value?: any, param?: any): any; -data(key: "ejDigitalGauge"): ej.datavisualization.DigitalGauge; -ejDocumentEditor(): JQuery; ejDocumentEditor(options?: ej.DocumentEditor.Model): JQuery; ejDocumentEditor(memberName: any, value?: any, param?: any): any; -data(key: "ejDocumentEditor"): ej.DocumentEditor; -ejDraggable(): JQuery; ejDraggable(options?: ej.Draggable.Model): JQuery; ejDraggable(memberName: any, value?: any, param?: any): any; -data(key: "ejDraggable"): ej.Draggable; -ejDropDownList(): JQuery; ejDropDownList(options?: ej.DropDownList.Model): JQuery; ejDropDownList(memberName: any, value?: any, param?: any): any; -data(key: "ejDropDownList"): ej.DropDownList; -ejDroppable(): JQuery; ejDroppable(options?: ej.Droppable.Model): JQuery; ejDroppable(memberName: any, value?: any, param?: any): any; -data(key: "ejDroppable"): ej.Droppable; -ejFileExplorer(): JQuery; ejFileExplorer(options?: ej.FileExplorer.Model): JQuery; ejFileExplorer(memberName: any, value?: any, param?: any): any; -data(key: "ejFileExplorer"): ej.FileExplorer; -ejGantt(): JQuery; ejGantt(options?: ej.Gantt.Model): JQuery; ejGantt(memberName: any, value?: any, param?: any): any; -data(key: "ejGantt"): ej.Gantt; -ejGrid(): JQuery; ejGrid(options?: ej.Grid.Model): JQuery; ejGrid(memberName: any, value?: any, param?: any): any; -data(key: "ejGrid"): ej.Grid; -ejGroupButton(): JQuery; ejGroupButton(options?: ej.GroupButton.Model): JQuery; ejGroupButton(memberName: any, value?: any, param?: any): any; -data(key: "ejGroupButton"): ej.GroupButton; -ejHeatMap(): JQuery; ejHeatMap(options?: ej.datavisualization.HeatMap.Model): JQuery; ejHeatMap(memberName: any, value?: any, param?: any): any; -data(key: "ejHeatMap"): ej.datavisualization.HeatMap; -ejHeatMapLegend(): JQuery; ejHeatMapLegend(options?: ej.datavisualization.HeatMapLegend.Model): JQuery; ejHeatMapLegend(memberName: any, value?: any, param?: any): any; -data(key: "ejHeatMapLegend"): ej.datavisualization.HeatMapLegend; -ejKanban(): JQuery; ejKanban(options?: ej.Kanban.Model): JQuery; ejKanban(memberName: any, value?: any, param?: any): any; -data(key: "ejKanban"): ej.Kanban; -ejLinearGauge(): JQuery; ejLinearGauge(options?: ej.datavisualization.LinearGauge.Model): JQuery; ejLinearGauge(memberName: any, value?: any, param?: any): any; -data(key: "ejLinearGauge"): ej.datavisualization.LinearGauge; -ejListBox(): JQuery; ejListBox(options?: ej.ListBox.Model): JQuery; ejListBox(memberName: any, value?: any, param?: any): any; -data(key: "ejListBox"): ej.ListBox; -ejListView(): JQuery; ejListView(options?: ej.ListView.Model): JQuery; ejListView(memberName: any, value?: any, param?: any): any; -data(key: "ejListView"): ej.ListView; -ejMap(): JQuery; ejMap(options?: ej.datavisualization.Map.Model): JQuery; ejMap(memberName: any, value?: any, param?: any): any; -data(key: "ejMap"): ej.datavisualization.Map; -ejMaskEdit(): JQuery; ejMaskEdit(options?: ej.MaskEdit.Model): JQuery; ejMaskEdit(memberName: any, value?: any, param?: any): any; -data(key: "ejMaskEdit"): ej.MaskEdit; -ejMenu(): JQuery; ejMenu(options?: ej.Menu.Model): JQuery; ejMenu(memberName: any, value?: any, param?: any): any; -data(key: "ejMenu"): ej.Menu; -ejNavigationDrawer(): JQuery; ejNavigationDrawer(options?: ej.NavigationDrawer.Model): JQuery; ejNavigationDrawer(memberName: any, value?: any, param?: any): any; -data(key: "ejNavigationDrawer"): ej.NavigationDrawer; -ejOverview(): JQuery; ejOverview(options?: ej.datavisualization.Overview.Model): JQuery; ejOverview(memberName: any, value?: any, param?: any): any; -data(key: "ejOverview"): ej.datavisualization.Overview; -ejPager(): JQuery; ejPager(options?: ej.Pager.Model): JQuery; ejPager(memberName: any, value?: any, param?: any): any; -data(key: "ejPager"): ej.Pager; -ejPdfViewer(): JQuery; ejPdfViewer(options?: ej.PdfViewer.Model): JQuery; ejPdfViewer(memberName: any, value?: any, param?: any): any; -data(key: "ejPdfViewer"): ej.PdfViewer; -ejPivotChart(): JQuery; ejPivotChart(options?: ej.PivotChart.Model): JQuery; ejPivotChart(memberName: any, value?: any, param?: any): any; -data(key: "ejPivotChart"): ej.PivotChart; -ejPivotClient(): JQuery; ejPivotClient(options?: ej.PivotClient.Model): JQuery; ejPivotClient(memberName: any, value?: any, param?: any): any; -data(key: "ejPivotClient"): ej.PivotClient; -ejPivotGauge(): JQuery; ejPivotGauge(options?: ej.PivotGauge.Model): JQuery; ejPivotGauge(memberName: any, value?: any, param?: any): any; -data(key: "ejPivotGauge"): ej.PivotGauge; -ejPivotGrid(): JQuery; ejPivotGrid(options?: ej.PivotGrid.Model): JQuery; ejPivotGrid(memberName: any, value?: any, param?: any): any; -data(key: "ejPivotGrid"): ej.PivotGrid; -ejPivotPager(): JQuery; ejPivotPager(options?: ej.PivotPager.Model): JQuery; ejPivotPager(memberName: any, value?: any, param?: any): any; -data(key: "ejPivotPager"): ej.PivotPager; -ejPivotSchemaDesigner(): JQuery; ejPivotSchemaDesigner(options?: ej.PivotSchemaDesigner.Model): JQuery; ejPivotSchemaDesigner(memberName: any, value?: any, param?: any): any; -data(key: "ejPivotSchemaDesigner"): ej.PivotSchemaDesigner; -ejPivotTreeMap(): JQuery; ejPivotTreeMap(options?: ej.PivotTreeMap.Model): JQuery; ejPivotTreeMap(memberName: any, value?: any, param?: any): any; -data(key: "ejPivotTreeMap"): ej.PivotTreeMap; -ejProgressBar(): JQuery; ejProgressBar(options?: ej.ProgressBar.Model): JQuery; ejProgressBar(memberName: any, value?: any, param?: any): any; -data(key: "ejProgressBar"): ej.ProgressBar; -ejRadialMenu(): JQuery; ejRadialMenu(options?: ej.RadialMenu.Model): JQuery; ejRadialMenu(memberName: any, value?: any, param?: any): any; -data(key: "ejRadialMenu"): ej.RadialMenu; -ejRadialSlider(): JQuery; ejRadialSlider(options?: ej.RadialSlider.Model): JQuery; ejRadialSlider(memberName: any, value?: any, param?: any): any; -data(key: "ejRadialSlider"): ej.RadialSlider; -ejRadioButton(): JQuery; ejRadioButton(options?: ej.RadioButton.Model): JQuery; ejRadioButton(memberName: any, value?: any, param?: any): any; -data(key: "ejRadioButton"): ej.RadioButton; -ejRangeNavigator(): JQuery; ejRangeNavigator(options?: ej.datavisualization.RangeNavigator.Model): JQuery; ejRangeNavigator(memberName: any, value?: any, param?: any): any; -data(key: "ejRangeNavigator"): ej.datavisualization.RangeNavigator; -ejRating(): JQuery; ejRating(options?: ej.Rating.Model): JQuery; ejRating(memberName: any, value?: any, param?: any): any; -data(key: "ejRating"): ej.Rating; -ejRecurrenceEditor(): JQuery; ejRecurrenceEditor(options?: ej.RecurrenceEditor.Model): JQuery; ejRecurrenceEditor(memberName: any, value?: any, param?: any): any; -data(key: "ejRecurrenceEditor"): ej.RecurrenceEditor; -ejReportViewer(): JQuery; ejReportViewer(options?: ej.ReportViewer.Model): JQuery; ejReportViewer(memberName: any, value?: any, param?: any): any; -data(key: "ejReportViewer"): ej.ReportViewer; -ejResizable(): JQuery; ejResizable(options?: ej.Resizable.Model): JQuery; ejResizable(memberName: any, value?: any, param?: any): any; -data(key: "ejResizable"): ej.Resizable; -ejRibbon(): JQuery; ejRibbon(options?: ej.Ribbon.Model): JQuery; ejRibbon(memberName: any, value?: any, param?: any): any; -data(key: "ejRibbon"): ej.Ribbon; -ejRotator(): JQuery; ejRotator(options?: ej.Rotator.Model): JQuery; ejRotator(memberName: any, value?: any, param?: any): any; -data(key: "ejRotator"): ej.Rotator; -ejRTE(): JQuery; ejRTE(options?: ej.RTE.Model): JQuery; ejRTE(memberName: any, value?: any, param?: any): any; -data(key: "ejRTE"): ej.RTE; -ejSchedule(): JQuery; ejSchedule(options?: ej.Schedule.Model): JQuery; ejSchedule(memberName: any, value?: any, param?: any): any; -data(key: "ejSchedule"): ej.Schedule; -ejScroller(): JQuery; ejScroller(options?: ej.Scroller.Model): JQuery; ejScroller(memberName: any, value?: any, param?: any): any; -data(key: "ejScroller"): ej.Scroller; -ejSignature(): JQuery; ejSignature(options?: ej.Signature.Model): JQuery; ejSignature(memberName: any, value?: any, param?: any): any; -data(key: "ejSignature"): ej.Signature; -ejSlider(): JQuery; ejSlider(options?: ej.Slider.Model): JQuery; ejSlider(memberName: any, value?: any, param?: any): any; -data(key: "ejSlider"): ej.Slider; -ejSparkline(): JQuery; ejSparkline(options?: ej.datavisualization.Sparkline.Model): JQuery; ejSparkline(memberName: any, value?: any, param?: any): any; -data(key: "ejSparkline"): ej.datavisualization.Sparkline; -ejSpellCheck(): JQuery; ejSpellCheck(options?: ej.SpellCheck.Model): JQuery; ejSpellCheck(memberName: any, value?: any, param?: any): any; -data(key: "ejSpellCheck"): ej.SpellCheck; -ejSplitButton(): JQuery; ejSplitButton(options?: ej.SplitButton.Model): JQuery; ejSplitButton(memberName: any, value?: any, param?: any): any; -data(key: "ejSplitButton"): ej.SplitButton; -ejSplitter(): JQuery; ejSplitter(options?: ej.Splitter.Model): JQuery; ejSplitter(memberName: any, value?: any, param?: any): any; -data(key: "ejSplitter"): ej.Splitter; -ejSpreadsheet(): JQuery; ejSpreadsheet(options?: ej.Spreadsheet.Model): JQuery; ejSpreadsheet(memberName: any, value?: any, param?: any): any; -data(key: "ejSpreadsheet"): ej.Spreadsheet; -ejSunburstChart(): JQuery; ejSunburstChart(options?: ej.datavisualization.SunburstChart.Model): JQuery; ejSunburstChart(memberName: any, value?: any, param?: any): any; -data(key: "ejSunburstChart"): ej.datavisualization.SunburstChart; -ejSymbolPalette(): JQuery; ejSymbolPalette(options?: ej.datavisualization.SymbolPalette.Model): JQuery; ejSymbolPalette(memberName: any, value?: any, param?: any): any; -data(key: "ejSymbolPalette"): ej.datavisualization.SymbolPalette; -ejTab(): JQuery; ejTab(options?: ej.Tab.Model): JQuery; ejTab(memberName: any, value?: any, param?: any): any; -data(key: "ejTab"): ej.Tab; -ejTagCloud(): JQuery; ejTagCloud(options?: ej.TagCloud.Model): JQuery; ejTagCloud(memberName: any, value?: any, param?: any): any; -data(key: "ejTagCloud"): ej.TagCloud; -ejNumericTextbox(): JQuery; ejNumericTextbox(options?: ej.Editor.Model): JQuery; ejNumericTextbox(memberName: any, value?: any, param?: any): any; -data(key: "ejNumericTextbox"): ej.NumericTextbox; -ejCurrencyTextbox(): JQuery; ejCurrencyTextbox(options?: ej.Editor.Model): JQuery; ejCurrencyTextbox(memberName: any, value?: any, param?: any): any; -data(key: "ejCurrencyTextbox"): ej.CurrencyTextbox; -ejPercentageTextbox(): JQuery; ejPercentageTextbox(options?: ej.Editor.Model): JQuery; ejPercentageTextbox(memberName: any, value?: any, param?: any): any; -data(key: "ejPercentageTextbox"): ej.PercentageTextbox; -ejTile(): JQuery; ejTile(options?: ej.Tile.Model): JQuery; ejTile(memberName: any, value?: any, param?: any): any; -data(key: "ejTile"): ej.Tile; -ejTimePicker(): JQuery; ejTimePicker(options?: ej.TimePicker.Model): JQuery; ejTimePicker(memberName: any, value?: any, param?: any): any; -data(key: "ejTimePicker"): ej.TimePicker; -ejToggleButton(): JQuery; ejToggleButton(options?: ej.ToggleButton.Model): JQuery; ejToggleButton(memberName: any, value?: any, param?: any): any; -data(key: "ejToggleButton"): ej.ToggleButton; -ejToolbar(): JQuery; ejToolbar(options?: ej.Toolbar.Model): JQuery; ejToolbar(memberName: any, value?: any, param?: any): any; -data(key: "ejToolbar"): ej.Toolbar; -ejTooltip(): JQuery; ejTooltip(options?: ej.Tooltip.Model): JQuery; ejTooltip(memberName: any, value?: any, param?: any): any; -data(key: "ejTooltip"): ej.Tooltip; -ejTreeGrid(): JQuery; ejTreeGrid(options?: ej.TreeGrid.Model): JQuery; ejTreeGrid(memberName: any, value?: any, param?: any): any; -data(key: "ejTreeGrid"): ej.TreeGrid; -ejTreeMap(): JQuery; ejTreeMap(options?: ej.datavisualization.TreeMap.Model): JQuery; ejTreeMap(memberName: any, value?: any, param?: any): any; -data(key: "ejTreeMap"): ej.datavisualization.TreeMap; -ejTreeView(): JQuery; ejTreeView(options?: ej.TreeView.Model): JQuery; ejTreeView(memberName: any, value?: any, param?: any): any; -data(key: "ejTreeView"): ej.TreeView; -ejUploadbox(): JQuery; ejUploadbox(options?: ej.Uploadbox.Model): JQuery; ejUploadbox(memberName: any, value?: any, param?: any): any; -data(key: "ejUploadbox"): ej.Uploadbox; -ejWaitingPopup(): JQuery; ejWaitingPopup(options?: ej.WaitingPopup.Model): JQuery; ejWaitingPopup(memberName: any, value?: any, param?: any): any; + +data(key: "ejAccordion"): ej.Accordion; +data(key: "ejAutocomplete"): ej.Autocomplete; +data(key: "ejBarcode"): ej.datavisualization.Barcode; +data(key: "ejBulletGraph"): ej.datavisualization.BulletGraph; +data(key: "ejButton"): ej.Button; +data(key: "ejCaptcha"): ej.Captcha; +data(key: "ejChart"): ej.datavisualization.Chart; +data(key: "ejCheckBox"): ej.CheckBox; +data(key: "ejCircularGauge"): ej.datavisualization.CircularGauge; +data(key: "ejColorPicker"): ej.ColorPicker; +data(key: "ejDatePicker"): ej.DatePicker; +data(key: "ejDateRangePicker"): ej.DateRangePicker; +data(key: "ejDateTimePicker"): ej.DateTimePicker; +data(key: "ejDiagram"): ej.datavisualization.Diagram; +data(key: "ejDialog"): ej.Dialog; +data(key: "ejDigitalGauge"): ej.datavisualization.DigitalGauge; +data(key: "ejDocumentEditor"): ej.DocumentEditor; +data(key: "ejDraggable"): ej.Draggable; +data(key: "ejDropDownList"): ej.DropDownList; +data(key: "ejDroppable"): ej.Droppable; +data(key: "ejFileExplorer"): ej.FileExplorer; +data(key: "ejGantt"): ej.Gantt; +data(key: "ejGrid"): ej.Grid; +data(key: "ejGroupButton"): ej.GroupButton; +data(key: "ejHeatMap"): ej.datavisualization.HeatMap; +data(key: "ejHeatMapLegend"): ej.datavisualization.HeatMapLegend; +data(key: "ejKanban"): ej.Kanban; +data(key: "ejLinearGauge"): ej.datavisualization.LinearGauge; +data(key: "ejListBox"): ej.ListBox; +data(key: "ejListView"): ej.ListView; +data(key: "ejMap"): ej.datavisualization.Map; +data(key: "ejMaskEdit"): ej.MaskEdit; +data(key: "ejMenu"): ej.Menu; +data(key: "ejNavigationDrawer"): ej.NavigationDrawer; +data(key: "ejOverview"): ej.datavisualization.Overview; +data(key: "ejPager"): ej.Pager; +data(key: "ejPdfViewer"): ej.PdfViewer; +data(key: "ejPivotChart"): ej.PivotChart; +data(key: "ejPivotClient"): ej.PivotClient; +data(key: "ejPivotGauge"): ej.PivotGauge; +data(key: "ejPivotGrid"): ej.PivotGrid; +data(key: "ejPivotPager"): ej.PivotPager; +data(key: "ejPivotSchemaDesigner"): ej.PivotSchemaDesigner; +data(key: "ejPivotTreeMap"): ej.PivotTreeMap; +data(key: "ejProgressBar"): ej.ProgressBar; +data(key: "ejRadialMenu"): ej.RadialMenu; +data(key: "ejRadialSlider"): ej.RadialSlider; +data(key: "ejRadioButton"): ej.RadioButton; +data(key: "ejRangeNavigator"): ej.datavisualization.RangeNavigator; +data(key: "ejRating"): ej.Rating; +data(key: "ejRecurrenceEditor"): ej.RecurrenceEditor; +data(key: "ejReportViewer"): ej.ReportViewer; +data(key: "ejResizable"): ej.Resizable; +data(key: "ejRibbon"): ej.Ribbon; +data(key: "ejRotator"): ej.Rotator; +data(key: "ejRTE"): ej.RTE; +data(key: "ejSchedule"): ej.Schedule; +data(key: "ejScroller"): ej.Scroller; +data(key: "ejSignature"): ej.Signature; +data(key: "ejSlider"): ej.Slider; +data(key: "ejSparkline"): ej.datavisualization.Sparkline; +data(key: "ejSpellCheck"): ej.SpellCheck; +data(key: "ejSplitButton"): ej.SplitButton; +data(key: "ejSplitter"): ej.Splitter; +data(key: "ejSpreadsheet"): ej.Spreadsheet; +data(key: "ejSunburstChart"): ej.datavisualization.SunburstChart; +data(key: "ejSymbolPalette"): ej.datavisualization.SymbolPalette; +data(key: "ejTab"): ej.Tab; +data(key: "ejTagCloud"): ej.TagCloud; +data(key: "ejNumericTextbox"): ej.NumericTextbox; +data(key: "ejCurrencyTextbox"): ej.CurrencyTextbox; +data(key: "ejPercentageTextbox"): ej.PercentageTextbox; +data(key: "ejTile"): ej.Tile; +data(key: "ejTimePicker"): ej.TimePicker; +data(key: "ejToggleButton"): ej.ToggleButton; +data(key: "ejToolbar"): ej.Toolbar; +data(key: "ejTooltip"): ej.Tooltip; +data(key: "ejTreeGrid"): ej.TreeGrid; +data(key: "ejTreeMap"): ej.datavisualization.TreeMap; +data(key: "ejTreeView"): ej.TreeView; +data(key: "ejUploadbox"): ej.Uploadbox; data(key: "ejWaitingPopup"): ej.WaitingPopup; -} +} \ No newline at end of file From b33a7078d52f5e9d5c79ed7382a69a1f5a560b0c Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Mon, 27 Feb 2017 14:44:46 +0530 Subject: [PATCH 230/797] BOM errors fixed. --- ej.web.all/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 1e0138580e..d40f767494 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ej.web.all 15.1.33 +// Type definitions for ej.web.all 15.1.33 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 9e2a3c68255d782096a2b8612e5f272101fff0d6 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Mon, 27 Feb 2017 18:00:51 +0530 Subject: [PATCH 231/797] Lint errors fixed. --- ej.web.all/index.d.ts | 68 +++++++++++++++++++++++++++++++------------ 1 file changed, 50 insertions(+), 18 deletions(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index d40f767494..0f7fe13c13 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// /*! * filename: ej.web.all.d.ts @@ -2071,19 +2071,27 @@ export interface Model { } export interface ActionBeginEventArgs { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } export interface ActionSuccessEventArgs { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } export interface ActionCompleteEventArgs { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } export interface ActionFailureEventArgs { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } export interface ChangeEventArgs { @@ -3299,19 +3307,27 @@ export interface Model { } export interface ActionBeginEventArgs { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } export interface ActionSuccessEventArgs { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } export interface ActionCompleteEventArgs { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } export interface ActionFailureEventArgs { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } export interface ActionBeforeSuccessEventArgs { @@ -3872,7 +3888,9 @@ class Calculate { export namespace Calculate { export interface Model { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } } @@ -8308,7 +8326,7 @@ export interface Model { beforePopupHide?(e: BeforePopupHideEventArgs): void; /** Fires the action before the popup is ready to be displayed. */ - beforePopupShown(e: BeforePopupShownEventArgs): void; + beforePopupShown?(e: BeforePopupShownEventArgs): void; /** Fires when the cascading happens between two DropDownList exactly after the value changes in the first dropdown and before filtering in the second Dropdown. */ cascade?(e: CascadeEventArgs): void; @@ -16243,7 +16261,9 @@ export interface StopEventArgs { } export interface TooltipChangeEventArgs { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } } namespace slider { @@ -55425,7 +55445,9 @@ export interface DrawQualitativeRangesEventArgs { } export interface LoadEventArgs { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } export interface CaptionSettingsFont { @@ -58572,7 +58594,9 @@ export interface DropEventArgs { } export interface EditorFocusChangeEventArgs { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } export interface GroupChangeEventArgs { @@ -64421,16 +64445,24 @@ export interface Model { } interface JQueryXHR { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } interface JQueryPromise { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } interface JQueryDeferred extends JQueryPromise { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } interface JQueryParam { - undefined; + /** Returns the cancel option value. + */ + cancel?: boolean; } interface JQuery { data(key: any): any; From 71d1224978e84eabf76de8aada2e34d8e070760f Mon Sep 17 00:00:00 2001 From: Terry Bayne Date: Mon, 27 Feb 2017 08:17:20 -0600 Subject: [PATCH 232/797] 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 5a239fffbe11a8535183da81800928e75b011e53 Mon Sep 17 00:00:00 2001 From: Steven Liekens Date: Mon, 27 Feb 2017 15:38:50 +0100 Subject: [PATCH 233/797] Rename datatables packages (#14864) * Rename jquery.datatables to datatables.net Relates to #14770 * Rename datatables-buttons to datatables.net-buttons Relates to #14770 * Add missing references --- CONTRIBUTORS.md | 4 ++-- .../datatables.net-buttons-tests.ts | 2 +- {datatables-buttons => datatables.net-buttons}/index.d.ts | 2 +- {datatables-buttons => datatables.net-buttons}/tsconfig.json | 2 +- .../datatables.net-fixedheader-tests.ts | 3 +++ datatables.net-fixedheader/index.d.ts | 2 +- datatables.net-select/datatables.net-select-tests.ts | 3 +++ datatables.net-select/index.d.ts | 2 +- .../datatables.net-tests.ts | 2 +- {jquery.datatables => datatables.net}/index.d.ts | 0 {jquery.datatables => datatables.net}/tsconfig.json | 2 +- 11 files changed, 15 insertions(+), 9 deletions(-) rename datatables-buttons/datatables-buttons-tests.ts => datatables.net-buttons/datatables.net-buttons-tests.ts (95%) rename {datatables-buttons => datatables.net-buttons}/index.d.ts (98%) rename {datatables-buttons => datatables.net-buttons}/tsconfig.json (91%) rename jquery.datatables/jquery.datatables-tests.ts => datatables.net/datatables.net-tests.ts (99%) rename {jquery.datatables => datatables.net}/index.d.ts (100%) rename {jquery.datatables => datatables.net}/tsconfig.json (92%) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 6e2c883f3a..c3218efb0a 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -811,8 +811,8 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](jquery.cookie/jquery.cookie.d.ts) [jQuery Cookie Plugin](https://github.com/carhartl/jquery-cookie) by [Roy Goode](https://github.com/RoyGoode), [Ben Lorantfy](https://github.com/BenLorantfy) * [:link:](jquery-cropbox/jquery-cropbox.d.ts) [jQuery cropbox](https://github.com/acornejo/jquery-cropbox) by [Per Kastman](https://github.com/PerKastman) * [:link:](jquery.cycle2/jquery.cycle2.d.ts) [jQuery Cycle2 version (build 20140216)](http://jquery.malsup.com/cycle2) by [Donny Nadolny](https://github.com/dnadolny) -* [:link:](jquery.dataTables/jquery.dataTables.d.ts) [JQuery DataTables](http://www.datatables.net) by [Kiarash Ghiaseddin](https://github.com/Silver-Connection/DefinitelyTyped), [Omid Rad](https://github.com/omidkrad), [Armin Sander](https://github.com/pragmatrix) -* [:link:](datatables-buttons/datatables-buttons.d.ts) [JQuery DataTables Buttons extension](http://datatables.net/extensions/buttons) by [Sam Germano](https://github.com/SammyG4Free) +* [:link:](datatables.net/index.d.ts) [JQuery DataTables](http://www.datatables.net) by [Kiarash Ghiaseddin](https://github.com/Silver-Connection/DefinitelyTyped), [Omid Rad](https://github.com/omidkrad), [Armin Sander](https://github.com/pragmatrix) +* [:link:](datatables.net-buttons/index.d.ts) [JQuery DataTables Buttons extension](http://datatables.net/extensions/buttons) by [Sam Germano](https://github.com/SammyG4Free) * [:link:](jquery.fileupload/jquery.fileupload.d.ts) [jQuery File Upload Plugin](https://github.com/blueimp/jQuery-File-Upload) by [Rob Alarcon](https://github.com/rob-alarcon) * [:link:](jquery.joyride/jquery.joyride.d.ts) [jQuery JoyRide Plugin](https://github.com/zurb/joyride) by [Vincent Bortone](https://github.com/vbortone) * [:link:](jqgrid/jqgrid.d.ts) [jQuery jqgrid Plugin](https://github.com/tonytomov/jqGrid) by [Lokesh Peta](https://github.com/lokeshpeta) diff --git a/datatables-buttons/datatables-buttons-tests.ts b/datatables.net-buttons/datatables.net-buttons-tests.ts similarity index 95% rename from datatables-buttons/datatables-buttons-tests.ts rename to datatables.net-buttons/datatables.net-buttons-tests.ts index 52a21db894..2dcdd26ff4 100644 --- a/datatables-buttons/datatables-buttons-tests.ts +++ b/datatables.net-buttons/datatables.net-buttons-tests.ts @@ -1,5 +1,5 @@ /// -/// +/// $(document).ready(function () { diff --git a/datatables-buttons/index.d.ts b/datatables.net-buttons/index.d.ts similarity index 98% rename from datatables-buttons/index.d.ts rename to datatables.net-buttons/index.d.ts index 2ce52d8483..b4ed4b0eb5 100644 --- a/datatables-buttons/index.d.ts +++ b/datatables.net-buttons/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// +/// declare namespace DataTables { export interface Settings { diff --git a/datatables-buttons/tsconfig.json b/datatables.net-buttons/tsconfig.json similarity index 91% rename from datatables-buttons/tsconfig.json rename to datatables.net-buttons/tsconfig.json index 0793cd2eb3..5e407ab2d8 100644 --- a/datatables-buttons/tsconfig.json +++ b/datatables.net-buttons/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "datatables-buttons-tests.ts" + "datatables.net-buttons-tests.ts" ] } \ No newline at end of file diff --git a/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts b/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts index 561b968ba9..949bca825c 100644 --- a/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts +++ b/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts @@ -1,3 +1,6 @@ +/// +/// + $(document).ready(() => { var config: DataTables.Settings = { // FixedHeader extension options diff --git a/datatables.net-fixedheader/index.d.ts b/datatables.net-fixedheader/index.d.ts index e72360f933..caf3987d35 100644 --- a/datatables.net-fixedheader/index.d.ts +++ b/datatables.net-fixedheader/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Jared Szechy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// +/// declare namespace DataTables { export interface Settings { diff --git a/datatables.net-select/datatables.net-select-tests.ts b/datatables.net-select/datatables.net-select-tests.ts index 5d8fdd8dc6..aa1851931c 100644 --- a/datatables.net-select/datatables.net-select-tests.ts +++ b/datatables.net-select/datatables.net-select-tests.ts @@ -1,3 +1,6 @@ +/// +/// + $(document).ready(() => { var config: DataTables.Settings = { // Select extension options diff --git a/datatables.net-select/index.d.ts b/datatables.net-select/index.d.ts index 1365ab991e..96529a10c1 100644 --- a/datatables.net-select/index.d.ts +++ b/datatables.net-select/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Jared Szechy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// +/// declare namespace DataTables { export interface Settings { diff --git a/jquery.datatables/jquery.datatables-tests.ts b/datatables.net/datatables.net-tests.ts similarity index 99% rename from jquery.datatables/jquery.datatables-tests.ts rename to datatables.net/datatables.net-tests.ts index 3bcc931a5f..0134581ee1 100644 --- a/jquery.datatables/jquery.datatables-tests.ts +++ b/datatables.net/datatables.net-tests.ts @@ -908,7 +908,7 @@ $(document).ready(function () { //#region "Methods-Static" - // Variable is a stand-in for $.fn.dataTable. See extension of JQueryStatic at the top of jquery.dataTables.d.ts. + // Variable is a stand-in for $.fn.dataTable. See extension of JQueryStatic at the top of index.d.ts. var staticFn: DataTables.StaticFunctions; // With boolean parameter type, always returns DataTables.DataTable[]. diff --git a/jquery.datatables/index.d.ts b/datatables.net/index.d.ts similarity index 100% rename from jquery.datatables/index.d.ts rename to datatables.net/index.d.ts diff --git a/jquery.datatables/tsconfig.json b/datatables.net/tsconfig.json similarity index 92% rename from jquery.datatables/tsconfig.json rename to datatables.net/tsconfig.json index 0831b7cc76..b48881c33b 100644 --- a/jquery.datatables/tsconfig.json +++ b/datatables.net/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "jquery.datatables-tests.ts" + "datatables.net-tests.ts" ] } \ No newline at end of file From 6fd0e9e82dd55e17bd44e9f5e147e4b3baa48a65 Mon Sep 17 00:00:00 2001 From: Terry Bayne Date: Mon, 27 Feb 2017 08:42:06 -0600 Subject: [PATCH 234/797] 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 235/797] 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 236/797] [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 d2267ead2004bf3e87d769808ab51532fc5db132 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Mon, 27 Feb 2017 18:00:08 +0100 Subject: [PATCH 237/797] Fix fetch-mock with TypeScript version 2.2 --- fetch-mock/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch-mock/index.d.ts b/fetch-mock/index.d.ts index 4d69096845..bda708ee55 100644 --- a/fetch-mock/index.d.ts +++ b/fetch-mock/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/wheresrhys/fetch-mock // Definitions by: Alexey Svetliakov , Tamir Duberstein , Risto Keravuori // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +// TypeScript Version: 2.2 type MockRequest = Request | RequestInit; From 2cba21e0ee730c931843fdcda7660193b5741b15 Mon Sep 17 00:00:00 2001 From: Andrew Nichols Date: Mon, 27 Feb 2017 11:12:09 -0800 Subject: [PATCH 238/797] Fix cr comments --- office-js/index.d.ts | 78 ++++++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/office-js/index.d.ts b/office-js/index.d.ts index 3d3ce60171..1f5cf0a898 100644 --- a/office-js/index.d.ts +++ b/office-js/index.d.ts @@ -1425,7 +1425,6 @@ declare namespace Office { ////////////////////// Begin Exchange APIs ///////////////////// //////////////////////////////////////////////////////////////// - declare namespace Office { export module MailboxEnums { export enum AttachmentType { @@ -1484,11 +1483,11 @@ declare namespace Office { } export enum ItemType { /** - * A meeting request, response, or cancellation + * An email, meeting request, meeting response, or meeting cancellation */ Message, /** - * Specifies an appointment item + * An appointment item */ Appointment } @@ -1515,10 +1514,6 @@ declare namespace Office { Declined } export enum RecipientType { - /** - * Specifies that the recipient is not one of the other recipient types - */ - Other, /** * Specifies that the recipient is a distribution list containing a list of email addresses */ @@ -1530,7 +1525,11 @@ declare namespace Office { /** * Specifies that the recipient is an SMTP email address that is not on the Exchange server */ - ExternalUser + ExternalUser, + /** + * Specifies that the recipient is not one of the other recipient types + */ + Other } export enum RestVersion { v1_0, @@ -1550,6 +1549,12 @@ declare namespace Office { function toItemRead(item: Office.Item): Office.ItemRead; } } + export interface asyncContextOptions { + asyncContext?: any; + } + export interface coercionTypeOptions { + coercionType?: CoercionType; + } export enum SourceProperty { /** * The source of the data is from the body of the message. @@ -1603,35 +1608,35 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param The optional method to call when the getAsync method returns */ - getAsync(coercionType: CoercionType, options?: any, callback?: (result: AsyncResult) => void): void; - /** + getAsync(coercionType: CoercionType, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + /* * Gets a value that indicates whether the content is in HTML or text format * @param tableData A TableData object with the headers and rows * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the getTypeAsync method returns */ - getTypeAsync(options?: any, callback?: (result: AsyncResult) => void): void; + getTypeAsync(options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - prependAsync(data: string, options?: any, callback?: (result: AsyncResult) => void): void; + prependAsync(data: string, options?: asyncContextOptions & coercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters * @param options Any optional parameters or state data passed to the method * @param callback the optional method to call when the body is replaced */ - setAsync(data: string, options?: any, callback?: (result: AsyncResult) => void): void; + setAsync(data: string, options?: asyncContextOptions & coercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - setSelectedDataAsync(data: string, options?: any, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: asyncContextOptions & coercionTypeOptions, callback?: (result: AsyncResult) => void): void; } export interface Contact { addresses: Array; @@ -1713,7 +1718,7 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters @@ -1721,7 +1726,7 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: any, callback?: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Closes the current item that is being composed * @@ -1737,25 +1742,25 @@ declare namespace Office { * If there is no selection but the cursor is in the body or the subject, the method returns null for the selected data. If a field other * than the body or subject is selected, the method returns the InvalidSelection error */ - getSelectedDataAsync(coercionType: CoercionType, options?: any, callback?: (result: AsyncResult) => void): void; + getSelectedDataAsync(coercionType: CoercionType, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - removeAttachmentAsync(attachmentIndex: string, options?: any, callback?: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or * Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. */ - saveAsync(options?: any, callback?: (result: AsyncResult) => void): void; + saveAsync(options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. */ - setSelectedDataAsync(data: string, options?: any, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: asyncContextOptions & coercionTypeOptions, callback?: (result: AsyncResult) => void): void; } export interface ItemRead extends Item { itemClass: string; @@ -1777,7 +1782,7 @@ declare namespace Office { */ displayReplyForm(formData: string | ReplyFormData): void; /** - * Gets an array of entities found in an message + * Gets the entities found in the selected item */ getEntities(): Entities; /** @@ -1815,14 +1820,14 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - getAsync(options?: any, callback?: (result: AsyncResult) => void): void; + getAsync(options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to set the location of an appointment * @param data The location of the appointment. The string is limited to 255 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the location is set */ - setAsync(location: string, options?: any, callback?: (result: AsyncResult) => void): void; + setAsync(location: string, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; } export interface Mailbox { diagnostics: Diagnostics; @@ -1915,11 +1920,12 @@ declare namespace Office { start: string; subject: string; } - export interface NotificationMessage { + export interface NotificationMessageDetails { + key?: string; type: Office.MailboxEnums.ItemNotificationMessageType; icon?: string; message: string; - persistent: Boolean; + persistent?: Boolean; } export interface NotificationMessages { /** @@ -1929,20 +1935,20 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - addAsync(key: string, JSONmessage: NotificationMessage, options?: any, callback?: (result: AsyncResult) => void): void; + addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns all keys and messages for an item. * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - getAllAsync(options?: any, callback?: (result: AsyncResult) => void): void; + getAllAsync(options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes a notification message for an item. * @param key The key for the notification message to remove * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - removeAsync(key: string, options?: any, callback?: (result: AsyncResult) => void): void; + removeAsync(key: string, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces a notification message that has a given key with another message * @param key The key for the notification message to replace. @@ -1950,7 +1956,7 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - replaceAsync(key: string, JSONmessage: NotificationMessage, options?: any, callback?: (result: AsyncResult) => void): void; + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; } export interface PhoneNumber { phoneString: string; @@ -1964,20 +1970,20 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - addAsync(recipients: Array, options?: any, callback?: (result: AsyncResult) => void): void; + addAsync(recipients: Array, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to get the recipient list for an appointment or message * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - getAsync(options?: any, callback?: (result: AsyncResult) => void): void; + getAsync(options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to set the recipient list for an appointment or message * @param recipients The recipients to add to the recipients list * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - setAsync(recipients: Array, options?: any, callback?: (result: AsyncResult) => void): void; + setAsync(recipients: Array, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; } export interface ReplyFormAttachment { type: string; @@ -2019,14 +2025,14 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - getAsync(options?: any, callback?: (result: AsyncResult) => void): void; + getAsync(options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Begins an asynchronous call to set the subject of an appointment or message * @param data The subject of the appointment. The string is limited to 255 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - setAsync(data: string, options?: any, callback?: (result: AsyncResult) => void): void; + setAsync(data: string, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; } export interface TaskSuggestion { assignees: Array; @@ -2038,14 +2044,14 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - getAsync(options?: any, callback?: (result: AsyncResult) => void): void; + getAsync(options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to set the start or end time * @param dateTime A date-time object in Coordinated Universal Time (UTC) * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - setAsync(dateTime: Date, options?: any, callback?: (result: AsyncResult) => void): void; + setAsync(dateTime: Date, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; } export interface UserProfile { displayName: string; From 2b11761150d1f730d34540056636ab31bd102a63 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 27 Feb 2017 14:11:16 -0800 Subject: [PATCH 239/797] jasmine-data_driven_tests: Use generics for more specific typing (#14820) * jasmine-data_driven_tests: Use generics for more specific typing Also remove the dependency on "jasmine". * Use "jasmine" dependency and add overloads for bigger tuples --- jasmine-data_driven_tests/index.d.ts | 36 +++++++++++++++++-- .../jasmine-data_driven_tests-tests.ts | 11 +++--- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/jasmine-data_driven_tests/index.d.ts b/jasmine-data_driven_tests/index.d.ts index a2a7415093..827539a3a9 100644 --- a/jasmine-data_driven_tests/index.d.ts +++ b/jasmine-data_driven_tests/index.d.ts @@ -2,6 +2,38 @@ // Project: https://github.com/gburghardt/jasmine-data_driven_tests // Definitions by: Anthony MacKinnon // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 -declare function all(description: string, dataset: any[], assertion: (...args: any[]) => void): void; -declare function xall(description: string, dataset: any[], assertion: (...args: any[]) => void): void; \ No newline at end of file +declare var all: JasmineDataDrivenTest; +declare var xall: JasmineDataDrivenTest; + +interface JasmineDataDrivenTest { + ( + description: string, + dataset: Array<[T, U, V, W, X, Y, Z]>, + assertion: (arg0: T, arg1: U, arg2: V, arg3: W, arg4: X, arg5: Y, arg6: Z, done: () => void) => void): void; + ( + description: string, + dataset: Array<[T, U, V, W, X, Y]>, + assertion: (arg0: T, arg1: U, arg2: V, arg3: W, arg4: X, arg5: Y, done: () => void) => void): void; + ( + description: string, + dataset: Array<[T, U, V, W, X]>, + assertion: (arg0: T, arg1: U, arg2: V, arg3: W, arg4: X, done: () => void) => void): void; + ( + description: string, + dataset: Array<[T, U, V, W]>, + assertion: (arg0: T, arg1: U, arg2: V, arg3: W, done: () => void) => void): void; + ( + description: string, + dataset: Array<[T, U, V]>, + assertion: (arg0: T, arg1: U, arg2: V, done: () => void) => void): void; + ( + description: string, + dataset: Array<[T, U]>, + assertion: (arg0: T, arg1: U, done: () => void) => void): void; + ( + description: string, + dataset: T[], + assertion: (value: T, done: () => void) => void): void; +} diff --git a/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts b/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts index 27509d7383..727c253ad3 100644 --- a/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts +++ b/jasmine-data_driven_tests/jasmine-data_driven_tests-tests.ts @@ -1,9 +1,8 @@ - /// all("A data driven test is a suite with multiple specs", ['a', 'b', 'c'], - (value: string) => { + value => { expect(value).not.toBe('d'); } ); @@ -13,7 +12,7 @@ all("A data driven test can have many arguments", [1, 2, 3], [2, 4, 6] ], - (a: number, b: number, c: number) => { + (a, b, c) => { expect(c - (a + b)).toBe(0); } ); @@ -23,7 +22,7 @@ all("A data driven test can be asynchronous", [3, 1], [5, 2] ], - (a: number, b: number, done: () => void) => { + (a, b, done) => { setTimeout(() => { expect(a - b > 0).toBe(true); done(); @@ -33,7 +32,7 @@ all("A data driven test can be asynchronous", xall("A data driven test can be pending", [1, 2, 3], - (value: number) => { + value => { expect(value < 4).toBe(true); } ); @@ -47,7 +46,7 @@ describe("A suite", () => { all("can contain data driven tests", [1, 2, 3], - (b: number) => { + b => { expect(a - b > 0).toBe(true); } ); From 4fa3d7fda8444f7d880aa31f0ef82ed1e7fab92d Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Fri, 24 Feb 2017 01:20:39 +0100 Subject: [PATCH 240/797] Add definitions for Google Calendar API (gapi.calendar) --- gapi.calendar/gapi.calendar-tests.ts | 152 ++++++ gapi.calendar/index.d.ts | 675 +++++++++++++++++++++++++++ gapi.calendar/tsconfig.json | 18 + 3 files changed, 845 insertions(+) create mode 100644 gapi.calendar/gapi.calendar-tests.ts create mode 100644 gapi.calendar/index.d.ts create mode 100644 gapi.calendar/tsconfig.json diff --git a/gapi.calendar/gapi.calendar-tests.ts b/gapi.calendar/gapi.calendar-tests.ts new file mode 100644 index 0000000000..de335c6a15 --- /dev/null +++ b/gapi.calendar/gapi.calendar-tests.ts @@ -0,0 +1,152 @@ +/* Example taken from Google Calendar API JavaScript Quickstart https://developers.google.com/google-apps/calendar/quickstart/js */ + +{ + // Your Client ID can be retrieved from your project in the Google + // Developer Console, https://console.developers.google.com + var CLIENT_ID = ''; + + var SCOPES = ["https://www.googleapis.com/auth/calendar.readonly"]; + + /** + * Check if current user has authorized this application. + */ + function checkAuth() { + gapi.auth.authorize( + { + 'client_id': CLIENT_ID, + 'scope': SCOPES.join(' '), + 'immediate': true + }, handleAuthResult); + } + + /** + * Handle response from authorization server. + * + * @param {Object} authResult Authorization result. + */ + function handleAuthResult(authResult: GoogleApiOAuth2TokenObject) { + var authorizeDiv = document.getElementById('authorize-div')!; + if (authResult && !authResult.error) { + // Hide auth UI, then load client library. + authorizeDiv.style.display = 'none'; + loadCalendarApi(); + } else { + // Show auth UI, allowing the user to initiate authorization by + // clicking authorize button. + authorizeDiv.style.display = 'inline'; + } + } + + /** + * Initiate auth flow in response to user clicking authorize button. + * + * @param {Event} event Button click event. + */ + function handleAuthClick(event: MouseEvent) { + gapi.auth.authorize( + {client_id: CLIENT_ID, scope: SCOPES, immediate: false}, + handleAuthResult); + return false; + } + + /** + * Load Google Calendar client library. List upcoming events + * once client library is loaded. + */ + function loadCalendarApi() { + gapi.client.load('calendar', 'v3', listUpcomingEvents); + } + + /** + * Print the summary and start datetime/date of the next ten events in + * the authorized user's calendar. If no events are found an + * appropriate message is printed. + */ + function listUpcomingEvents() { + var request = gapi.client.calendar.events.list({ + 'calendarId': 'primary', + 'timeMin': (new Date()).toISOString(), + 'showDeleted': false, + 'singleEvents': true, + 'maxResults': 10, + 'orderBy': 'startTime' + }); + + request.execute(function(resp) { + var events = resp.items; + appendPre('Upcoming events:'); + + if (events.length > 0) { + for (let i = 0; i < events.length; i++) { + var event = events[i]; + var when = event.start.dateTime; + if (!when) { + when = event.start.date; + } + appendPre(event.summary + ' (' + when + ')') + } + } else { + appendPre('No upcoming events found.'); + } + + }); + } + + /** + * Append a pre element to the body containing the given message + * as its text node. + * + * @param {string} message Text to be placed in pre element. + */ + function appendPre(message: string) { + var pre = document.getElementById('output')!; + var textContent = document.createTextNode(message + '\n'); + pre.appendChild(textContent); + } +} + +/* Example taken from https://developers.google.com/google-apps/calendar/v3/reference/events/insert#examples */ + +{ + // Refer to the JavaScript quickstart on how to setup the environment: + // https://developers.google.com/google-apps/calendar/quickstart/js + // Change the scope to 'https://www.googleapis.com/auth/calendar' and delete any + // stored credentials. + + const event = { + 'summary': 'Google I/O 2015', + 'location': '800 Howard St., San Francisco, CA 94103', + 'description': 'A chance to hear more about Google\'s developer products.', + 'start': { + 'dateTime': '2015-05-28T09:00:00-07:00', + 'timeZone': 'America/Los_Angeles' + }, + 'end': { + 'dateTime': '2015-05-28T17:00:00-07:00', + 'timeZone': 'America/Los_Angeles' + }, + 'recurrence': [ + 'RRULE:FREQ=DAILY;COUNT=2' + ], + 'attendees': [ + {'email': 'lpage@example.com'}, + {'email': 'sbrin@example.com'} + ], + 'reminders': { + 'useDefault': false, + 'overrides': [ + {'method': 'email', 'minutes': 24 * 60}, + {'method': 'popup', 'minutes': 10} + ] + } + }; + + var request = gapi.client.calendar.events.insert({ + 'calendarId': 'primary', + 'resource': event + }); + + request.execute(function(event) { + appendPre('Event created: ' + event.htmlLink); + }); +} diff --git a/gapi.calendar/index.d.ts b/gapi.calendar/index.d.ts new file mode 100644 index 0000000000..bd0e3b0d17 --- /dev/null +++ b/gapi.calendar/index.d.ts @@ -0,0 +1,675 @@ +// Type definitions for Google Calendar API 3.0 +// Project: https://developers.google.com/google-apps/calendar/ +// Definitions by: Tanguy Krotoff +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace gapi.client.calendar { + export class freebusy { + static query(parameters: FreeBusyQueryParameters): HttpRequest; + } + + interface FreeBusyQueryParameters { + timeMin: datetime; + timeMax: datetime; + timeZone?: string; + groupExpansionMax?: integer; + calendarExpansionMax?: integer; + items: {id: string}[]; + } + + interface FreeBusy { + kind: 'calendar#freeBusy'; + timeMin: datetime; + timeMax: datetime; + groups: { + (key: string): { + errors?: { + domain: string; + reason: string; + }[]; + calendars: string[]; + } + }; + calendars: { + (key: string): { + errors?: { + domain: string; + reason: string; + }[]; + busy: { + start: datetime; + end: datetime; + }[]; + } + }; + } + + export class acl { + static insert(parameters: AclInsertParameters): HttpRequest; + static get(parameters: AclGetParameters): HttpRequest; + static update(parameters: AclUpdateParameters): HttpRequest; + static delete(parameters: AclDeleteParameters): HttpRequest; + } + + // The type of the scope. Possible values are: + type ScopeType = + // The public scope. This is the default value. + // Note: The permissions granted to the "default", or public, scope apply to any user, authenticated or not. + 'default' | + // Limits the scope to a single user. + 'user' | + // Limits the scope to a group. + 'group' | + // Limits the scope to a domain. + 'domain'; + + interface Acl { + kind: 'calendar#aclRule'; + etag: etag; + id: string; + scope: { + type: ScopeType; + value: string; + }; + role: AccessRole; + } + + interface AclInsertParameters { + calendarId: string; + + // Acl resource + role: AccessRole; + scope: { + type: ScopeType; + value?: string; + }; + } + + interface AclGetParameters { + calendarId: string; + ruleId: string; + } + + interface AclUpdateParameters extends AclInsertParameters { + ruleId: string; + } + + interface AclDeleteParameters extends AclGetParameters { + } + + export class calendarList { + static list(parameters?: CalendarListListParameters): HttpRequest; + static insert(parameters: CalendarListInsertParameters): HttpRequest; + } + + type AccessRoleWithoutNone = + // The user has read access to free/busy information. + 'freeBusyReader' | + // The user has read access to the calendar. Private events will appear to users with reader access, but event details will be hidden. + 'reader' | + // The user has read and write access to the calendar. Private events will appear to users with writer access, and event details will be visible. + 'writer' | + // The user has ownership of the calendar. This role has all of the permissions of the writer role with the additional ability to see and manipulate ACLs. + 'owner'; + + // The user's access role for this calendar. Read-only. Possible values are: + type AccessRole = + // The user has no access. + 'none' | + AccessRoleWithoutNone; + + interface CalendarListListParameters { + maxResults?: integer; + // The minimum access role for the user in the returned entries. Optional. The default is no restriction. Acceptable values are: + minAccessRole?: AccessRoleWithoutNone; + pageToken?: string; + showDeleted?: boolean; + showHidden?: boolean; + syncToken?: string; + } + + interface CalendarListInsertParameters { + // Parameters + // Optional query parameters + colorRgbFormat?: boolean; + + // CalendarList resource + resource: CalendarListInput; + } + + interface CalendarListInput { + // Required Properties + id: string; + + // Optional Properties + backgroundColor?: string; + colorId?: string; + defaultReminders?: { + method: ReminderMethod; + minutes: integer; + }[]; + foregroundColor?: string; + hidden?: boolean; + notificationSettings?: { + notifications: { + type: NotificationType; + method: string; + }[]; + }; + selected?: boolean; + summaryOverride?: string; + } + + interface CalendarList { + kind: 'calendar#calendarList'; + etag: etag; + + /** + * Token used to access the next page of this result. + * Omitted if no further results are available, in which case nextSyncToken is provided. + */ + nextPageToken?: string; + + /** + * Token used at a later point in time to retrieve only the entries that have changed since this result was returned. + * Omitted if further results are available, in which case nextPageToken is provided. + */ + nextSyncToken?: string; + + items: CalendarListEntry[]; + } + + // The type of notification. Possible values are: + type NotificationType = + // Notification sent when a new event is put on the calendar. + 'eventCreation' | + // Notification sent when an event is changed. + 'eventChange' | + // Notification sent when an event is cancelled. + 'eventCancellation' | + // Notification sent when an event is changed. + 'eventResponse' | + // An agenda with the events of the day (sent out in the morning). + 'agenda'; + + interface CalendarListEntry { + kind: 'calendar#calendarListEntry'; + etag: etag; + id: string; + summary: string; + description?: string; + location?: string; + timeZone?: string; + summaryOverride?: string; + colorId?: string; + backgroundColor?: string; + foregroundColor?: string; + hidden?: boolean; + selected?: boolean; + // The effective access role that the authenticated user has on the calendar. Read-only. + accessRole: AccessRoleWithoutNone; + defaultReminders: { + method: ReminderMethod; + minutes: integer; + }[]; + notificationSettings?: { + notifications: { + type: NotificationType; + method: string; + }[]; + }; + primary?: boolean; + deleted?: boolean; + } + + export class calendars { + static insert(parameters: CalendarsInsertParameters): HttpRequest; + static update(parameters: CalendarsUpdateParameters): HttpRequest; + static delete(parameters: CalendarsDeleteParameters): HttpRequest; + } + + interface CalendarsUpdateParameters { + calendarId: string; + + // Calendars resource + // Optional Properties + description?: string; + location?: string; + summary?: string; + timeZone?: string; + } + + interface CalendarsInsertParameters { + // Calendars resource + // Required Properties + summary: string; + + description?: string; + location?: string; + timeZone?: string; + } + + interface CalendarsDeleteParameters { + calendarId: string; + } + + interface Calendar { + kind: 'calendar#calendar'; + etag: etag; + id: string; + summary: string; + description?: string; + location?: string; + timeZone?: string; + } + + export class events { + static list(parameters: EventsListParameters): HttpRequest; + static insert(parameters: EventsInsertParameters): HttpRequest; + static update(parameters: EventsUpdateParameters): HttpRequest; + static get(parameters: EventsGetParameters): HttpRequest; + } + + interface EventsGetParameters { + calendarId: string; + eventId: string; + + alwaysIncludeEmail?: boolean; + maxAttendees?: integer; + timeZone?: string; + } + + interface EventsInsertParameters { + calendarId: string; + + maxAttendees?: integer; + sendNotifications?: boolean; + supportsAttachments?: boolean; + + // Event resource + resource: EventInput; + } + + interface EventsUpdateParameters { + calendarId: string; + eventId: string; + + alwaysIncludeEmail?: boolean; + maxAttendees?: integer; + sendNotifications?: boolean; + supportsAttachments?: boolean; + + // Event resource + resource: EventInput; + } + + interface EventInput { + // Required Properties + attachments?: { + fileUrl: string; + }[]; + attendees?: { + email: string; + displayName?: string; + optional?: boolean; + responseStatus?: AttendeeResponseStatus; + comment?: string; + additionalGuests?: integer; + }[]; + end: { + date?: date; + dateTime?: datetime; + timeZone?: string + }; + reminders?: { + overrides: { + method: string; + minutes: integer; + }[]; + useDefault: boolean; + }; + start: { + date?: date; + dateTime?: datetime; + timeZone: string; + }; + + // Optional Properties + anyoneCanAddSelf?: boolean; + colorId?: string; + description?: string; + extendedProperties?: { + private: { + (key: string): string + }; + shared: { + (key: string): string + } + }; + gadget?: { + display?: GadgetDisplayMode; + height: integer; + iconLink: string; + link: string; + preferences: { + (key: string): string + } + title: string; + type: string; + width: integer; + }; + guestsCanInviteOthers?: boolean; + guestsCanSeeOtherGuests?: boolean; + id?: string; + location?: string; + originalStartTime?: { + date: date; + dateTime: datetime; + timeZone: string + }; + recurrence?: string[]; + sequence?: integer; + source?: { + url: string; + title: string + }; + status?: EventStatus; + summary?: string; + transparency?: EventTransparency; + visibility?: EventVisibility; + } + + // The order of the events returned in the result. Optional. The default is an unspecified, stable order. + // Acceptable values are: + type EventsOrder = + // Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True) + 'startTime' | + // Order by last modification time (ascending). + 'updated'; + + // Token obtained from the nextSyncToken field returned on the last page of results from the previous list request. + // It makes the result of this list request contain only entries that have changed since then. + // All events deleted since the previous list request will always be in the result set and it is not allowed to set showDeleted to False. + // There are several query parameters that cannot be specified together with nextSyncToken to ensure consistency of the client state. + // These are: + type SyncToken = + 'iCalUID' | + 'orderBy' | + 'privateExtendedProperty' | + 'q' | + 'sharedExtendedProperty' | + 'timeMin' | + 'timeMax' | + 'updatedMin'; + + interface EventsListParameters { + calendarId: string; + alwaysIncludeEmail?: boolean; + iCalUID?: string; + maxAttendees?: integer; + maxResults?: integer; + orderBy?: EventsOrder; + pageToken?: string; + privateExtendedProperty?: string; + q?: string; + sharedExtendedProperty?: string; + showDeleted?: boolean; + showHiddenInvitations?: boolean; + singleEvents?: boolean; + syncToken?: SyncToken; + timeMax?: datetime; + timeMin?: datetime; + timeZone?: string; + updatedMin?: datetime; + } + + interface Events { + kind: 'calendar#events'; + etag: etag; + summary: string; + description: string; + updated: datetime; + timeZone: string; + // The user's access role for this calendar. Read-only. Possible values are: + accessRole: AccessRole; + defaultReminders: { + method: ReminderMethod; + minutes: integer; + }[]; + nextPageToken?: string; + nextSyncToken?: string; + items: Event[]; + } + + type etag = string; + type datetime = string; + type date = string; + type integer = number; + + // The attendee's response status. Possible values are: + type AttendeeResponseStatus = + // The attendee has not responded to the invitation. + 'needsAction' | + // The attendee has declined the invitation. + 'declined' | + // The attendee has tentatively accepted the invitation. + 'tentative' | + // The attendee has accepted the invitation. + 'accepted'; + + // The gadget's display mode. Optional. Possible values are: + type GadgetDisplayMode = + // The gadget displays next to the event's title in the calendar view. + 'icon' | + // The gadget displays when the event is clicked. + 'chip'; + + // The method used by this reminder. Possible values are: + type ReminderMethod = + // Reminders are sent via email. + 'email' | + // Reminders are sent via SMS. These are only available for Google Apps for Work, Education, and Government customers. Requests to set SMS reminders for other account types are ignored. + 'sms' | + // Reminders are sent via a UI popup. + 'popup'; + + // Status of the event. Optional. Possible values are: + type EventStatus = + // The event is confirmed. This is the default status. + 'confirmed' | + // The event is tentatively confirmed. + 'tentative' | + // The event is cancelled. + 'cancelled'; + + // Whether the event blocks time on the calendar. Optional. Possible values are: + type EventTransparency = + // The event blocks time on the calendar. This is the default value. + 'opaque' | + // The event does not block time on the calendar. + 'transparent'; + + // Visibility of the event. Optional. Possible values are: + type EventVisibility = + // Uses the default visibility for events on the calendar. This is the default value. + 'default' | + // The event is public and event details are visible to all readers of the calendar. + 'public' | + // The event is private and only event attendees may view event details. + 'private' | + // The event is private. This value is provided for compatibility reasons. + 'confidential'; + + class Event { + kind: 'calendar#event'; + etag: etag; + id: string; + status?: EventStatus; + htmlLink: string; + created: datetime; + updated: datetime; + summary: string; + description: string; + location?: string; + colorId?: string; + + // The creator of the event. Read-only. + creator: { + // The creator's Profile ID, if available. + id?: string; + + // The creator's email address, if available. + email?: string; + + // The creator's name, if available. + displayName?: string; + + // Whether the creator corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. + self?: boolean; + }; + + // The organizer of the event. + organizer: { + // The organizer's Profile ID, if available. + id?: string; + + // The organizer's email address, if available. + email?: string; + + // The organizer's name, if available. + displayName?: string; + + // Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. + self?: boolean; + }; + + // The (inclusive) start time of the event. For a recurring event, this is the start time of the first instance. + start: { + // The date, in the format "yyyy-mm-dd", if this is an all-day event. + date?: date; + + // The time, as a combined date-time value (formatted according to RFC3339). + // A time zone offset is required unless a time zone is explicitly specified in timeZone. + dateTime?: datetime; + + // The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) + // For recurring events this field is required and specifies the time zone in which the recurrence is expanded. + // For single events this field is optional and indicates a custom time zone for the event start/end. + timeZone?: string; + }; + + // The (exclusive) end time of the event. For a recurring event, this is the end time of the first instance. + end: { + // The date, in the format "yyyy-mm-dd", if this is an all-day event. + date?: date; + + // The time, as a combined date-time value (formatted according to RFC3339). + // A time zone offset is required unless a time zone is explicitly specified in timeZone. + dateTime?: datetime; + + // The time zone in which the time is specified. (Formatted as an IANA Time Zone Database name, e.g. "Europe/Zurich".) + // For recurring events this field is required and specifies the time zone in which the recurrence is expanded. + // For single events this field is optional and indicates a custom time zone for the event start/end. + timeZone?: string; + }; + + // Whether the end time is actually unspecified. An end time is still provided for compatibility reasons, even if this attribute is set to True. + // The default is False. + endTimeUnspecified?: boolean; + + recurrence: string[]; + + // For an instance of a recurring event, this is the id of the recurring event to which this instance belongs. Immutable. + recurringEventId?: string; + + // Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. + originalStartTime?: { + date: date; + dateTime: datetime; + timeZone?: string; + }; + + transparency?: EventTransparency; + visibility?: EventVisibility; + iCalUID: string; + sequence: integer; + + // The attendees of the event. + attendees?: { + id: string; + email: string; + displayName?: string; + organizer: boolean; + self: boolean; + resource: boolean; + optional?: boolean; + responseStatus: AttendeeResponseStatus; + comment?: string; + additionalGuests?: integer; + }[]; + + attendeesOmitted?: boolean; + + // Extended properties of the event. + extendedProperties?: { + private: { + (key: string): string; + }; + shared: { + (key: string): string; + } + }; + + // An absolute link to the Google+ hangout associated with this event. Read-only. + hangoutLink?: string; + + // A gadget that extends this event. + gadget?: { + type: string; + title: string; + link: string; + iconLink: string; + width?: integer; + height?: integer; + display?: GadgetDisplayMode; + preferences: { + (key: string): string; + } + }; + + anyoneCanAddSelf?: boolean; + guestsCanInviteOthers?: boolean; + guestsCanModify?: boolean; + guestsCanSeeOtherGuests?: boolean; + privateCopy?: boolean; + + // Whether this is a locked event copy where no changes can be made to the main event fields "summary", "description", "location", "start", "end" or "recurrence". The default is False. Read-Only. + locked?: boolean; + + reminders: { + useDefault: boolean; + overrides?: { + method: ReminderMethod; + minutes: integer; + }[]; + }; + + // Source from which the event was created. For example, a web page, an email message or any document identifiable by an URL with HTTP or HTTPS scheme. + // Can only be seen or modified by the creator of the event. + source?: { + url: string; + title: string; + }; + + // File attachments for the event. Currently only Google Drive attachments are supported. + attachments?: { + fileUrl: string; + title: string; + mimeType: string; + iconLink: string; + fileId: string; + }[]; + } +} diff --git a/gapi.calendar/tsconfig.json b/gapi.calendar/tsconfig.json new file mode 100644 index 0000000000..7613ee5b3d --- /dev/null +++ b/gapi.calendar/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "module": "commonjs", + "lib": ["es6", "dom"], + "strictNullChecks": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true + }, + "files": [ + "index.d.ts", + "gapi.calendar-tests.ts" + ] +} From 1b052338f505a06b22c83e8c9b376fa3f00cd902 Mon Sep 17 00:00:00 2001 From: Andrew Nichols Date: Mon, 27 Feb 2017 15:00:37 -0800 Subject: [PATCH 241/797] Capitalize Interfaces --- office-js/index.d.ts | 52 ++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/office-js/index.d.ts b/office-js/index.d.ts index 1f5cf0a898..01f627a0fd 100644 --- a/office-js/index.d.ts +++ b/office-js/index.d.ts @@ -1549,10 +1549,10 @@ declare namespace Office { function toItemRead(item: Office.Item): Office.ItemRead; } } - export interface asyncContextOptions { + export interface AsyncContextOptions { asyncContext?: any; } - export interface coercionTypeOptions { + export interface CoercionTypeOptions { coercionType?: CoercionType; } export enum SourceProperty { @@ -1608,35 +1608,35 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param The optional method to call when the getAsync method returns */ - getAsync(coercionType: CoercionType, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(coercionType: CoercionType, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /* * Gets a value that indicates whether the content is in HTML or text format * @param tableData A TableData object with the headers and rows * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the getTypeAsync method returns */ - getTypeAsync(options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + getTypeAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds the specified content to the beginning of the item body * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - prependAsync(data: string, options?: asyncContextOptions & coercionTypeOptions, callback?: (result: AsyncResult) => void): void; + prependAsync(data: string, options?: AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces the entire body with the specified text. * @param data The string that will replace the existing body. The string is limited to 1,000,000 characters * @param options Any optional parameters or state data passed to the method * @param callback the optional method to call when the body is replaced */ - setAsync(data: string, options?: asyncContextOptions & coercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setAsync(data: string, options?: AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces the selection in the body with the specified text * @param data The string to be inserted at the beginning of the body. The string is limited to 1,000,000 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - setSelectedDataAsync(data: string, options?: asyncContextOptions & coercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; } export interface Contact { addresses: Array; @@ -1718,7 +1718,7 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - addFileAttachmentAsync(uri: string, attachmentName: string, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + addFileAttachmentAsync(uri: string, attachmentName: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Adds an Exchange item, such as a message, as an attachment to the message * @param itemId The Exchange identifier of the item to attach. The maximum length is 100 characters @@ -1726,7 +1726,7 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - addItemAttachmentAsync(itemId: any, attachmentName: string, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + addItemAttachmentAsync(itemId: any, attachmentName: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Closes the current item that is being composed * @@ -1742,25 +1742,25 @@ declare namespace Office { * If there is no selection but the cursor is in the body or the subject, the method returns null for the selected data. If a field other * than the body or subject is selected, the method returns the InvalidSelection error */ - getSelectedDataAsync(coercionType: CoercionType, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + getSelectedDataAsync(coercionType: CoercionType, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes an attachment from a message * @param attachmentIndex The index of the attachment to remove. The maximum length of the string is 100 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - removeAttachmentAsync(attachmentIndex: string, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAttachmentAsync(attachmentIndex: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously saves an item. * * When invoked, this method saves the current message as a draft and returns the item id via the callback method. In Outlook Web App or * Outlook in online mode, the item is saved to the server. In Outlook in cached mode, the item is saved to the local cache. */ - saveAsync(options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + saveAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Asynchronously inserts data into the body or subject of a message. */ - setSelectedDataAsync(data: string, options?: asyncContextOptions & coercionTypeOptions, callback?: (result: AsyncResult) => void): void; + setSelectedDataAsync(data: string, options?: AsyncContextOptions & CoercionTypeOptions, callback?: (result: AsyncResult) => void): void; } export interface ItemRead extends Item { itemClass: string; @@ -1820,14 +1820,14 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - getAsync(options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to set the location of an appointment * @param data The location of the appointment. The string is limited to 255 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the location is set */ - setAsync(location: string, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(location: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } export interface Mailbox { diagnostics: Diagnostics; @@ -1935,20 +1935,20 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + addAsync(key: string, JSONmessage: NotificationMessageDetails, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Returns all keys and messages for an item. * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - getAllAsync(options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAllAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Removes a notification message for an item. * @param key The key for the notification message to remove * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - removeAsync(key: string, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + removeAsync(key: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Replaces a notification message that has a given key with another message * @param key The key for the notification message to replace. @@ -1956,7 +1956,7 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional callback method */ - replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + replaceAsync(key: string, JSONmessage: NotificationMessageDetails, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } export interface PhoneNumber { phoneString: string; @@ -1970,20 +1970,20 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - addAsync(recipients: Array, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + addAsync(recipients: Array, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to get the recipient list for an appointment or message * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - getAsync(options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to set the recipient list for an appointment or message * @param recipients The recipients to add to the recipients list * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - setAsync(recipients: Array, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(recipients: Array, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } export interface ReplyFormAttachment { type: string; @@ -2025,14 +2025,14 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - getAsync(options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Begins an asynchronous call to set the subject of an appointment or message * @param data The subject of the appointment. The string is limited to 255 characters * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - setAsync(data: string, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(data: string, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } export interface TaskSuggestion { assignees: Array; @@ -2044,14 +2044,14 @@ declare namespace Office { * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - getAsync(options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + getAsync(options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; /** * Begins an asynchronous request to set the start or end time * @param dateTime A date-time object in Coordinated Universal Time (UTC) * @param options Any optional parameters or state data passed to the method * @param callback The optional method to call when the string is inserted */ - setAsync(dateTime: Date, options?: asyncContextOptions, callback?: (result: AsyncResult) => void): void; + setAsync(dateTime: Date, options?: AsyncContextOptions, callback?: (result: AsyncResult) => void): void; } export interface UserProfile { displayName: string; From 12f7edc747c6bf5a6ad0a749b050034509961817 Mon Sep 17 00:00:00 2001 From: efokschaner Date: Mon, 27 Feb 2017 23:31:21 -0800 Subject: [PATCH 242/797] three: use noImplicitAny=true wip --- three/index.d.ts | 2 +- .../test/canvas/canvas_camera_orthographic.ts | 4 ++-- three/test/canvas/canvas_geometry_cube.ts | 6 +++--- .../canvas/canvas_interactive_cubes_tween.ts | 8 ++++---- .../test/canvas/canvas_lights_pointlights.ts | 6 +++--- three/test/canvas/canvas_materials.ts | 6 +++--- three/test/canvas/canvas_particles_floor.ts | 4 ++-- three/test/css3d/css3d_periodictable.ts | 4 ++-- three/test/css3d/css3d_sprites.ts | 4 ++-- three/test/webgl/webgl_camera.ts | 6 +++--- three/test/webgl/webgl_custom_attributes.ts | 8 ++++---- three/test/webgl/webgl_geometries.ts | 6 +++--- three/test/webgl/webgl_helpers.ts | 4 ++-- three/test/webgl/webgl_interactive_cubes.ts | 20 ++++++++++--------- .../webgl_interactive_raycasting_points.ts | 10 +++++----- three/test/webgl/webgl_lensflares.ts | 6 +++--- three/test/webgl/webgl_lights_hemisphere.ts | 4 ++-- three/test/webgl/webgl_lines_colors.ts | 8 ++++---- three/test/webgl/webgl_loader_awd.ts | 6 +++--- three/test/webgl/webgl_materials.ts | 8 ++++---- three/test/webgl/webgl_morphtargets.ts | 6 +++--- three/test/webgl/webgl_points_billboards.ts | 4 ++-- three/test/webgl/webgl_postprocessing.ts | 4 ++-- three/test/webgl/webgl_shader.ts | 6 +++--- three/test/webgl/webgl_sprites.ts | 12 +++++------ three/tsconfig.json | 2 +- 26 files changed, 83 insertions(+), 81 deletions(-) diff --git a/three/index.d.ts b/three/index.d.ts index 7b76100c17..0f505620b3 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -2493,7 +2493,7 @@ declare namespace THREE { constructor(parameters?: MeshLambertMaterialParameters); color: Color; - emissive: number|string; + emissive: Color; emissiveIntensity: number; emissiveMap: Texture; map: Texture; diff --git a/three/test/canvas/canvas_camera_orthographic.ts b/three/test/canvas/canvas_camera_orthographic.ts index d6f094f03f..78476a95b5 100644 --- a/three/test/canvas/canvas_camera_orthographic.ts +++ b/three/test/canvas/canvas_camera_orthographic.ts @@ -4,8 +4,8 @@ // https://github.com/mrdoob/three.js/blob/master/examples/canvas_camera_orthographic.html () => { - var container, stats; - var camera, scene, renderer; + var container: HTMLDivElement, stats: Stats; + var camera: THREE.OrthographicCamera, scene: THREE.Scene, renderer: THREE.CanvasRenderer; init(); animate(); diff --git a/three/test/canvas/canvas_geometry_cube.ts b/three/test/canvas/canvas_geometry_cube.ts index 006ee8149c..08fac74392 100644 --- a/three/test/canvas/canvas_geometry_cube.ts +++ b/three/test/canvas/canvas_geometry_cube.ts @@ -4,11 +4,11 @@ // https://github.com/mrdoob/three.js/blob/master/examples/canvas_geometry_cube.html () => { - var container, stats; + var container: HTMLDivElement, stats: Stats; - var camera, scene, renderer; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.CanvasRenderer; - var cube, plane; + var cube: THREE.Mesh, plane: THREE.Mesh; var targetRotation = 0; var targetRotationOnMouseDown = 0; diff --git a/three/test/canvas/canvas_interactive_cubes_tween.ts b/three/test/canvas/canvas_interactive_cubes_tween.ts index a8d318be5b..90ad4fc4b5 100644 --- a/three/test/canvas/canvas_interactive_cubes_tween.ts +++ b/three/test/canvas/canvas_interactive_cubes_tween.ts @@ -5,11 +5,11 @@ // https://github.com/mrdoob/three.js/blob/master/examples/canvas_interactive_cubes_tween.html () => { - var container, stats; - var camera, scene, renderer; + var container: HTMLDivElement, stats: Stats; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.CanvasRenderer; - var raycaster; - var mouse; + var raycaster: THREE.Raycaster; + var mouse: THREE.Vector2; init(); animate(); diff --git a/three/test/canvas/canvas_lights_pointlights.ts b/three/test/canvas/canvas_lights_pointlights.ts index 16fc02cc2f..648259b6a0 100644 --- a/three/test/canvas/canvas_lights_pointlights.ts +++ b/three/test/canvas/canvas_lights_pointlights.ts @@ -6,9 +6,9 @@ () => { // ------- variable definitions that does not exist in the original code. These are for typescript. // ------- - var camera, scene, renderer, - light1, light2, light3, - loader, mesh; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.CanvasRenderer, + light1: THREE.PointLight, light2: THREE.PointLight, light3: THREE.PointLight, + loader: THREE.JSONLoader, mesh: THREE.Mesh; init(); animate(); diff --git a/three/test/canvas/canvas_materials.ts b/three/test/canvas/canvas_materials.ts index 24d5b7d8d9..9b1bff3e45 100644 --- a/three/test/canvas/canvas_materials.ts +++ b/three/test/canvas/canvas_materials.ts @@ -5,10 +5,10 @@ () => { // ------- variable definitions that does not exist in the original code. These are for typescript. - var container, stats; + var container: HTMLDivElement, stats: Stats; - var camera, scene, renderer, objects; - var pointLight; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.CanvasRenderer, objects: THREE.Mesh[]; + var pointLight: THREE.PointLight; init(); animate(); diff --git a/three/test/canvas/canvas_particles_floor.ts b/three/test/canvas/canvas_particles_floor.ts index a69dac462d..803ba52896 100644 --- a/three/test/canvas/canvas_particles_floor.ts +++ b/three/test/canvas/canvas_particles_floor.ts @@ -10,8 +10,8 @@ var AMOUNTX = 50; var AMOUNTY = 50; - var container, stats; - var camera, scene, renderer, particle; + var container: HTMLDivElement, stats: Stats; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.CanvasRenderer, particle: THREE.Sprite; var mouseX = 0, mouseY = 0; var windowHalfX = window.innerWidth / 2; diff --git a/three/test/css3d/css3d_periodictable.ts b/three/test/css3d/css3d_periodictable.ts index 5083fd4329..4e16fd1208 100644 --- a/three/test/css3d/css3d_periodictable.ts +++ b/three/test/css3d/css3d_periodictable.ts @@ -128,8 +128,8 @@ "Uuo", "Ununoctium", "(294)", 18, 7 ]; - var camera, scene, renderer; - var controls; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.CSS3DRenderer; + var controls: THREE.TrackballControls; var objects = []; var targets = { table: [], sphere: [], helix: [], grid: [] }; diff --git a/three/test/css3d/css3d_sprites.ts b/three/test/css3d/css3d_sprites.ts index 50ec5a219c..09c9899e62 100644 --- a/three/test/css3d/css3d_sprites.ts +++ b/three/test/css3d/css3d_sprites.ts @@ -8,8 +8,8 @@ // ------- variable definitions that does not exist in the original code. These are for typescript. // ------- - var camera, scene, renderer; - var controls; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.CSS3DRenderer; + var controls: THREE.TrackballControls; var particlesTotal = 512; var positions = []; diff --git a/three/test/webgl/webgl_camera.ts b/three/test/webgl/webgl_camera.ts index ed695084a2..861b7eebb5 100644 --- a/three/test/webgl/webgl_camera.ts +++ b/three/test/webgl/webgl_camera.ts @@ -14,9 +14,9 @@ var renderer: THREE.WebGLRenderer; var mesh: THREE.Mesh; - var cameraRig, activeCamera, activeHelper; - var cameraPerspective, cameraOrtho; - var cameraPerspectiveHelper, cameraOrthoHelper; + var cameraRig: THREE.Group, activeCamera: THREE.PerspectiveCamera | THREE.OrthographicCamera, activeHelper: THREE.CameraHelper; + var cameraPerspective: THREE.PerspectiveCamera, cameraOrtho: THREE.OrthographicCamera; + var cameraPerspectiveHelper: THREE.CameraHelper, cameraOrthoHelper: THREE.CameraHelper; init(); animate(); diff --git a/three/test/webgl/webgl_custom_attributes.ts b/three/test/webgl/webgl_custom_attributes.ts index 38732c2f67..884ae43144 100644 --- a/three/test/webgl/webgl_custom_attributes.ts +++ b/three/test/webgl/webgl_custom_attributes.ts @@ -6,11 +6,11 @@ () => { if (!Detector.webgl) Detector.addGetWebGLMessage(); - var renderer, scene, camera, stats; + var renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.PerspectiveCamera, stats: Stats; - var sphere, uniforms; + var sphere: THREE.Mesh, uniforms: { amplitude: { type: string; value: number; }; color: { type: string; value: THREE.Color; }; texture: { type: string; value: THREE.Texture; }; }; - var displacement, noise; + var displacement: Float32Array, noise: Float32Array; init(); animate(); @@ -116,7 +116,7 @@ } - sphere.geometry.attributes.displacement.needsUpdate = true; + ((sphere.geometry as THREE.BufferGeometry).getAttribute('displacement')as THREE.BufferAttribute).needsUpdate = true; renderer.render(scene, camera); diff --git a/three/test/webgl/webgl_geometries.ts b/three/test/webgl/webgl_geometries.ts index e21e0e99c0..efa16e108d 100644 --- a/three/test/webgl/webgl_geometries.ts +++ b/three/test/webgl/webgl_geometries.ts @@ -6,9 +6,9 @@ () => { if (!Detector.webgl) Detector.addGetWebGLMessage(); - var container, stats; + var container: HTMLDivElement, stats: Stats; - var camera, scene, renderer; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer; init(); animate(); @@ -23,7 +23,7 @@ scene = new THREE.Scene(); - var light, object; + var light: THREE.DirectionalLight, object: THREE.Mesh | THREE.AxisHelper | THREE.ArrowHelper; scene.add(new THREE.AmbientLight(0x404040)); diff --git a/three/test/webgl/webgl_helpers.ts b/three/test/webgl/webgl_helpers.ts index 13ed1f4dc0..db8cba89a7 100644 --- a/three/test/webgl/webgl_helpers.ts +++ b/three/test/webgl/webgl_helpers.ts @@ -4,8 +4,8 @@ // https://github.com/mrdoob/three.js/blob/master/examples/webgl_helpers.html () => { - var scene, renderer; - var camera, light; + var scene: THREE.Scene, renderer: THREE.WebGLRenderer; + var camera: THREE.PerspectiveCamera, light: THREE.PointLight; init(); animate(); diff --git a/three/test/webgl/webgl_interactive_cubes.ts b/three/test/webgl/webgl_interactive_cubes.ts index 952239b626..9d4c914aab 100644 --- a/three/test/webgl/webgl_interactive_cubes.ts +++ b/three/test/webgl/webgl_interactive_cubes.ts @@ -4,10 +4,10 @@ // https://github.com/mrdoob/three.js/blob/master/examples/webgl_interactive_cubes.html () => { - var container, stats; - var camera, scene, raycaster, renderer; + var container: HTMLDivElement, stats: Stats; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, raycaster: THREE.Raycaster, renderer: THREE.WebGLRenderer; - var mouse = new THREE.Vector2(), INTERSECTED; + var mouse = new THREE.Vector2(), INTERSECTED: THREE.Mesh | null; var radius = 100, theta = 0; init(); @@ -107,6 +107,8 @@ } + let INTERSECTED_currentHex = 0; + function render() { theta += 0.1; @@ -116,7 +118,7 @@ camera.position.z = radius * Math.cos(THREE.Math.degToRad(theta)); camera.lookAt(scene.position); - camera.updateMatrixWorld(); + camera.updateMatrixWorld(false); // find intersections @@ -128,17 +130,17 @@ if (INTERSECTED != intersects[0].object) { - if (INTERSECTED) INTERSECTED.material.emissive.setHex(INTERSECTED.currentHex); + if (INTERSECTED) (INTERSECTED.material as THREE.MeshLambertMaterial).emissive.setHex(INTERSECTED_currentHex); - INTERSECTED = intersects[0].object; - INTERSECTED.currentHex = INTERSECTED.material.emissive.getHex(); - INTERSECTED.material.emissive.setHex(0xff0000); + INTERSECTED = intersects[0].object as THREE.Mesh; + INTERSECTED_currentHex = (INTERSECTED.material as THREE.MeshLambertMaterial).emissive.getHex(); + (INTERSECTED.material as THREE.MeshLambertMaterial).emissive.setHex(0xff0000); } } else { - if (INTERSECTED) INTERSECTED.material.emissive.setHex(INTERSECTED.currentHex); + if (INTERSECTED) (INTERSECTED.material as THREE.MeshLambertMaterial).emissive.setHex(INTERSECTED_currentHex); INTERSECTED = null; diff --git a/three/test/webgl/webgl_interactive_raycasting_points.ts b/three/test/webgl/webgl_interactive_raycasting_points.ts index 4c1f5ec2c6..089f8cef77 100644 --- a/three/test/webgl/webgl_interactive_raycasting_points.ts +++ b/three/test/webgl/webgl_interactive_raycasting_points.ts @@ -13,14 +13,14 @@ if (!Detector.webgl) Detector.addGetWebGLMessage(); - var renderer, scene, camera, stats; - var pointclouds; - var raycaster; + var renderer: THREE.WebGLRenderer, scene: THREE.Scene, camera: THREE.PerspectiveCamera, stats: Stats; + var pointclouds: THREE.Points[]; + var raycaster: THREE.Raycaster; var mouse = new THREE.Vector2(); var intersection = null; var spheres = []; var spheresIndex = 0; - var clock; + var clock: THREE.Clock; var threshold = 0.1; var pointSize = 0.05; @@ -292,7 +292,7 @@ function render() { camera.applyMatrix(rotateY); - camera.updateMatrixWorld(); + camera.updateMatrixWorld(false); raycaster.setFromCamera(mouse, camera); diff --git a/three/test/webgl/webgl_lensflares.ts b/three/test/webgl/webgl_lensflares.ts index 1223a0dc7c..2e6be03866 100644 --- a/three/test/webgl/webgl_lensflares.ts +++ b/three/test/webgl/webgl_lensflares.ts @@ -8,9 +8,9 @@ var controls: any; // ------- - var container, stats; + var container: HTMLDivElement, stats: Stats; - var camera, scene, renderer; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer; var clock = new THREE.Clock(); @@ -150,7 +150,7 @@ function lensFlareUpdateCallback(object) { - var f, fl = object.lensFlares.length; + var f: number, fl = object.lensFlares.length; var flare; var vecX = -object.positionScreen.x * 2; var vecY = -object.positionScreen.y * 2; diff --git a/three/test/webgl/webgl_lights_hemisphere.ts b/three/test/webgl/webgl_lights_hemisphere.ts index 95c7aa914b..4f96fb9511 100644 --- a/three/test/webgl/webgl_lights_hemisphere.ts +++ b/three/test/webgl/webgl_lights_hemisphere.ts @@ -10,9 +10,9 @@ if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); - var camera, scene, renderer, dirLight, hemiLight; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer, dirLight: THREE.DirectionalLight, hemiLight: THREE.HemisphereLight; var mixers = []; - var stats; + var stats: Stats; var clock = new THREE.Clock(); diff --git a/three/test/webgl/webgl_lines_colors.ts b/three/test/webgl/webgl_lines_colors.ts index bb54df8208..04fc10b618 100644 --- a/three/test/webgl/webgl_lines_colors.ts +++ b/three/test/webgl/webgl_lines_colors.ts @@ -11,21 +11,21 @@ if (!Detector.webgl) Detector.addGetWebGLMessage(); - var effectFXAA; + var effectFXAA: THREE.ShaderPass; var mouseX = 0, mouseY = 0, windowHalfX = window.innerWidth / 2, windowHalfY = window.innerHeight / 2, - camera, scene, renderer, material, composer; + camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer, material: THREE.LineBasicMaterial, composer: THREE.EffectComposer; init(); animate(); function init() { - var i, container; + var i: number, container: HTMLDivElement; container = document.createElement('div'); document.body.appendChild(container); @@ -73,7 +73,7 @@ material = new THREE.LineBasicMaterial({ color: 0xffffff, opacity: 1, linewidth: 3, vertexColors: THREE.VertexColors }); - var line, scale = 0.3, d = 225; + var line: THREE.Line, scale = 0.3, d = 225; var parameters : [THREE.LineBasicMaterial, number, [number, number, number], THREE.Geometry][] = [ [material, scale * 1.5, [-d, 0, 0], geometry], [material, scale * 1.5, [0, 0, 0], geometry2], diff --git a/three/test/webgl/webgl_loader_awd.ts b/three/test/webgl/webgl_loader_awd.ts index 94c7e73a9b..5407ae4360 100644 --- a/three/test/webgl/webgl_loader_awd.ts +++ b/three/test/webgl/webgl_loader_awd.ts @@ -10,10 +10,10 @@ if (!Detector.webgl) Detector.addGetWebGLMessage(); - var container, stats; + var container: HTMLDivElement, stats: Stats; - var camera, scene, renderer, objects, controls; - var particleLight, pointLight; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer, objects, controls: THREE.OrbitControls; + var particleLight, pointLight: THREE.PointLight; var trunk; var loader = new THREE.AWDLoader(); diff --git a/three/test/webgl/webgl_materials.ts b/three/test/webgl/webgl_materials.ts index 1c6302ea84..409bfa5eda 100644 --- a/three/test/webgl/webgl_materials.ts +++ b/three/test/webgl/webgl_materials.ts @@ -9,10 +9,10 @@ if (!Detector.webgl) Detector.addGetWebGLMessage(); - var container, stats; + var container: HTMLDivElement, stats: Stats; - var camera, scene, renderer, objects; - var particleLight; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer, objects: THREE.Mesh[]; + var particleLight: THREE.Mesh; var materials = []; @@ -92,7 +92,7 @@ objects = []; - var sphere, geometry: THREE.Geometry, material; + var sphere: THREE.Mesh, geometry: THREE.Geometry, material; for (var i = 0, l = materials.length; i < l; i++) { diff --git a/three/test/webgl/webgl_morphtargets.ts b/three/test/webgl/webgl_morphtargets.ts index 9045f5b201..7eb641d816 100644 --- a/three/test/webgl/webgl_morphtargets.ts +++ b/three/test/webgl/webgl_morphtargets.ts @@ -6,15 +6,15 @@ () => { if (!Detector.webgl) Detector.addGetWebGLMessage(); - var container, stats; + var container: HTMLDivElement, stats; - var camera, scene, renderer; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer; var geometry, objects; var mouseX = 0, mouseY = 0; - var mesh; + var mesh: THREE.Mesh; var windowHalfX = window.innerWidth / 2; var windowHalfY = window.innerHeight / 2; diff --git a/three/test/webgl/webgl_points_billboards.ts b/three/test/webgl/webgl_points_billboards.ts index 93474493c8..4ab898462a 100644 --- a/three/test/webgl/webgl_points_billboards.ts +++ b/three/test/webgl/webgl_points_billboards.ts @@ -6,8 +6,8 @@ () => { if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); - var container, stats; - var camera, scene, renderer, particles, geometry, material, i, h, color, sprite, size; + var container: HTMLDivElement, stats: Stats; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer, particles: THREE.Points, geometry: THREE.Geometry, material: THREE.PointsMaterial, i: number, h: number, color, sprite: THREE.Texture, size; var mouseX = 0, mouseY = 0; var windowHalfX = window.innerWidth / 2; diff --git a/three/test/webgl/webgl_postprocessing.ts b/three/test/webgl/webgl_postprocessing.ts index cf0b3ffffe..8c298d66a6 100644 --- a/three/test/webgl/webgl_postprocessing.ts +++ b/three/test/webgl/webgl_postprocessing.ts @@ -4,8 +4,8 @@ // https://github.com/mrdoob/three.js/blob/master/examples/webgl_postprocessing.html () => { - var camera, scene, renderer, composer; - var object, light; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer, composer: THREE.EffectComposer; + var object: THREE.Object3D, light: THREE.DirectionalLight; init(); animate(); diff --git a/three/test/webgl/webgl_shader.ts b/three/test/webgl/webgl_shader.ts index b43044b8f1..249851d534 100644 --- a/three/test/webgl/webgl_shader.ts +++ b/three/test/webgl/webgl_shader.ts @@ -6,11 +6,11 @@ () => { if (!Detector.webgl) Detector.addGetWebGLMessage(); - var container, stats; + var container: HTMLElement, stats: Stats; - var camera, scene, renderer; + var camera: THREE.Camera, scene: THREE.Scene, renderer: THREE.WebGLRenderer; - var uniforms; + var uniforms: { time: { type: string; value: number; }; resolution: { type: string; value: THREE.Vector2; }; }; init(); animate(); diff --git a/three/test/webgl/webgl_sprites.ts b/three/test/webgl/webgl_sprites.ts index bb7139f5ab..5d5c6162d2 100644 --- a/three/test/webgl/webgl_sprites.ts +++ b/three/test/webgl/webgl_sprites.ts @@ -8,14 +8,14 @@ var material: THREE.SpriteMaterial; // ------- - var camera, scene, renderer; - var cameraOrtho, sceneOrtho; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer; + var cameraOrtho: THREE.OrthographicCamera, sceneOrtho: THREE.Scene; - var spriteTL, spriteTR, spriteBL, spriteBR, spriteC; + var spriteTL: THREE.Sprite, spriteTR: THREE.Sprite, spriteBL: THREE.Sprite, spriteBR: THREE.Sprite, spriteC: THREE.Sprite; - var mapC; + var mapC: THREE.Texture; - var group; + var group: THREE.Group; init(); animate(); @@ -178,7 +178,7 @@ for ( var i = 0, l = group.children.length; i < l; i ++ ) { - var sprite = group.children[ i ]; + var sprite = group.children[ i ] as THREE.Sprite; var material = sprite.material; var scale = Math.sin( time + sprite.position.x * 0.01 ) * 0.3 + 1.0; diff --git a/three/tsconfig.json b/three/tsconfig.json index 37a325d404..1eac096ec9 100644 --- a/three/tsconfig.json +++ b/three/tsconfig.json @@ -5,7 +5,7 @@ "es6", "dom" ], - "noImplicitAny": false, + "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, "baseUrl": "../", From 7b9f0ea10ae394a6a9ceac236126a7a3e6583523 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Tue, 28 Feb 2017 14:43:43 +0530 Subject: [PATCH 243/797] Lint errors fixed. --- ej.web.all/index.d.ts | 2 +- fix | 0 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 fix diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 0f7fe13c13..bd3c800f22 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ej.web.all 15.1.33 +// Type definitions for ej.web.all 15.1 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/fix b/fix new file mode 100644 index 0000000000..e69de29bb2 From b371b6203bee4ed2ae9de10345d9de5800122bc1 Mon Sep 17 00:00:00 2001 From: Vladimir Metelitsa Date: Tue, 28 Feb 2017 21:23:16 +0100 Subject: [PATCH 244/797] [mongoose] Adds missing retainKeyOrder option --- mongoose/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mongoose/index.d.ts b/mongoose/index.d.ts index 7ef5615436..72f0475655 100644 --- a/mongoose/index.d.ts +++ b/mongoose/index.d.ts @@ -720,6 +720,8 @@ declare module "mongoose" { validateBeforeSave?: boolean; /** defaults to "__v" */ versionKey?: string|boolean; + /** defaults to false */ + retainKeyOrder?: boolean; /** * skipVersioning allows excluding paths from * versioning (the internal revision will not be From 353676b35a7f6392a1f251c7026027570b2b7155 Mon Sep 17 00:00:00 2001 From: Flarna Date: Wed, 1 Mar 2017 10:31:03 +0100 Subject: [PATCH 245/797] add url.toJSON() and URLSearchParams.sort() added in NodeJS 7.7.0 --- node/index.d.ts | 2 ++ node/node-tests.ts | 3 +++ 2 files changed, 5 insertions(+) diff --git a/node/index.d.ts b/node/index.d.ts index e0d01d65ba..26ed35b011 100644 --- a/node/index.d.ts +++ b/node/index.d.ts @@ -1849,6 +1849,7 @@ declare module "url" { has(name: string): boolean; keys(): Iterator; set(name: string, value: string): void; + sort(): void; toString(): string; values(): Iterator; [Symbol.iterator](): Iterator; @@ -1869,6 +1870,7 @@ declare module "url" { readonly searchParams: URLSearchParams; username: string; toString(): string; + toJSON(): string; } } diff --git a/node/node-tests.ts b/node/node-tests.ts index fcd8f93a27..7a50504d5b 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -451,6 +451,7 @@ namespace url_tests { myURL = new url.URL('/foo', 'https://example.org/'); assert.equal(myURL.href, 'https://example.org/foo'); + assert.equal(myURL.toJSON(), myURL.href); } { @@ -489,6 +490,8 @@ namespace url_tests { searchParams.delete('a'); assert(!searchParams.has('a')); assert.equal(searchParams.get('a'), null); + + searchParams.sort(); } } From a37824dc8fd17a7da8a828f57426f3d8329ca3f9 Mon Sep 17 00:00:00 2001 From: Raphael Thiebault Date: Wed, 1 Mar 2017 17:23:12 +0000 Subject: [PATCH 246/797] Sequelize : Fix missing type fn on FindOptions --- sequelize/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequelize/index.d.ts b/sequelize/index.d.ts index 85283ff468..1852332f0f 100644 --- a/sequelize/index.d.ts +++ b/sequelize/index.d.ts @@ -3183,7 +3183,7 @@ declare namespace sequelize { /** * A hash of attributes to describe your search. See above for examples. */ - where?: WhereOptions | Array; + where?: WhereOptions | fn | Array; /** * A list of the attributes that you want to select. To rename an attribute, you can pass an array, with From 25252a600cdaeaa6edba511786b93c2c8892a689 Mon Sep 17 00:00:00 2001 From: Andrew Nichols Date: Wed, 1 Mar 2017 10:25:44 -0800 Subject: [PATCH 247/797] Make replyFormData optional --- office-js/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/office-js/index.d.ts b/office-js/index.d.ts index 01f627a0fd..02f21c1bc2 100644 --- a/office-js/index.d.ts +++ b/office-js/index.d.ts @@ -1992,9 +1992,9 @@ declare namespace Office { itemId?: string; } export interface ReplyFormData { - htmlBody: string; - attachments: Array; - callback: (result: AsyncResult) => void; + htmlBody?: string; + attachments?: Array; + callback?: (result: AsyncResult) => void; } export interface RoamingSettings { /** From 135d5a9ee37cf1960996d8f6416b1a43563c5352 Mon Sep 17 00:00:00 2001 From: mtgto Date: Thu, 2 Mar 2017 10:29:45 +0900 Subject: [PATCH 248/797] [soap] Add HttpClient. --- soap/index.d.ts | 8 ++++++++ soap/soap-tests.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/soap/index.d.ts b/soap/index.d.ts index 151e914f63..9fad90c236 100644 --- a/soap/index.d.ts +++ b/soap/index.d.ts @@ -50,3 +50,11 @@ export interface Server extends events.EventEmitter { } export function listen(server: any, path: string, service: any, wsdl: string): Server; declare function createClient(wsdlPath: string, options: any, fn: (err: any, client: Client) => void): void; + +export class HttpClient { + constructor(options?: any); + buildRequest(rurl: string, data: any | string, exheaders?: any, exoptions?: any): any; + handleResponse(req: any, res: any, body: any | string): any | string; + request(rurl: string, data: any | string, callback: (err: any, res: any, body: any | string) => void, exheaders?: any, exoptions?: any): any; + requestStream(rurl: string, data: any | string, exheaders?: any, exoptions?: any): any; +} diff --git a/soap/soap-tests.ts b/soap/soap-tests.ts index 9771b26efc..abd16b4a5a 100644 --- a/soap/soap-tests.ts +++ b/soap/soap-tests.ts @@ -4,7 +4,7 @@ import * as fs from "fs"; import * as http from "http"; const url = 'http://example.com/wsdl?wsdl'; -const wsdlOptions = { name: 'value' }; +const wsdlOptions = { name: 'value', httpRequest: new soap.HttpClient() }; soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) { let securityOptions = { hasTimeStamp: false }; From b052d62eb559ed6a01cc9d8f9b2b3207fe659462 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Thu, 2 Mar 2017 12:36:11 +0530 Subject: [PATCH 249/797] Jquery reference changes merged --- ej.web.all/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index bd3c800f22..5908e7cfa9 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// /*! * filename: ej.web.all.d.ts From f50190e98552b104f4936751fdfd2dacc9f352c8 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Thu, 2 Mar 2017 12:48:33 +0530 Subject: [PATCH 250/797] jquery reference path added --- ej.web.all/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 5908e7cfa9..8ac08123e5 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for ej.web.all 15.1 +// Type definitions for ej.web.all 15.1 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// /*! * filename: ej.web.all.d.ts From bdc4b5ce269a43f4101790ee550d774d51c9cd8e Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Thu, 2 Mar 2017 14:56:39 +0530 Subject: [PATCH 251/797] Encoding format changed. --- ej.web.all/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 8ac08123e5..bd3c800f22 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ej.web.all 15.1 +// Type definitions for ej.web.all 15.1 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From c5bee8f625d96242ed9874aebd6413404213024d Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Thu, 2 Mar 2017 15:52:41 +0530 Subject: [PATCH 252/797] lint errors fixed. --- ej.web.all/index.d.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index bd3c800f22..0c6cb092e1 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1826,7 +1826,8 @@ export interface Model { */ addNewText?: boolean; - /** Allows new values to be added to the autocomplete input other than the values in the suggestion list. Normally, when there are no suggestions it will display “No suggestions†label in the popup. + /** Allows new values to be added to the autocomplete input other than the values in the suggestion list. + * Normally, when there are no suggestions it will display “No suggestions†label in the popup. * @Default {false} */ allowAddNew?: boolean; @@ -1891,7 +1892,9 @@ export interface Model { */ enableDistinct?: boolean; - /** Allows the current model values to be saved in local storage or browser cookies for state maintenance when it is set to true. While refreshing the page, it retains the model value from browser cookies or local storage. + /** Allows the current model values to be saved in local storage or browser cookies for state maintenance + * when it is set to true. + * While refreshing the page, it retains the model value from browser cookies or local storage. * @Default {false} */ enablePersistence?: boolean; From f7ab322332c2a6e3d923402cec1db0811ea753f2 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Thu, 2 Mar 2017 11:36:31 +0100 Subject: [PATCH 253/797] Modernizr: various fixes. Updated version to 3.3, since all everything new since 3.2 was already added. --- modernizr/index.d.ts | 95 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 77 insertions(+), 18 deletions(-) diff --git a/modernizr/index.d.ts b/modernizr/index.d.ts index 7fd0ffa316..44d3c40775 100644 --- a/modernizr/index.d.ts +++ b/modernizr/index.d.ts @@ -1,19 +1,19 @@ -// Type definitions for Modernizr 3.2 +// Type definitions for Modernizr 3.3 // Project: http://modernizr.com/ // Definitions by: Boris Yankov , Theodore Brown , Leon Yu , Luca Trazzi // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface AudioBoolean { - ogg: boolean; - mp3: boolean; - wav: boolean; - m4a: boolean; + ogg: string; + mp3: string; + wav: string; + m4a: string; } interface VideoBoolean { - ogg: boolean; - h264: boolean; - webm: boolean; + ogg: string; + h264: string; + webm: string; } interface InputBoolean { @@ -45,6 +45,66 @@ interface InputTypesBoolean { week: boolean; } +interface CssColumnsBoolean extends Boolean { + breakafter: boolean; + breakbefore: boolean; + breakinside: boolean; + fill: boolean; + gap: boolean; + rule: boolean; + rulecolor: boolean; + rulestyle: boolean; + rulewidth: boolean; + span: boolean; + width: boolean; +} + +interface FlashBoolean extends Boolean { + blocked: boolean; +} + +interface IndexeddbBoolean extends Boolean { + deletedatabase: boolean; +} + +interface WebglextensionsBoolean extends Boolean { + ANGLE_instanced_arrays: boolean; + EXT_blend_minmax: boolean; + EXT_disjoint_timer_query: boolean; + EXT_frag_depth: boolean; + EXT_sRGB: boolean; + EXT_shader_texture_lod: boolean; + EXT_texture_filter_anisotropic: boolean; + OES_element_index_uint: boolean; + OES_standard_derivatives: boolean; + OES_texture_float: boolean; + OES_texture_float_linear: boolean; + OES_texture_half_float: boolean; + OES_texture_half_float_linear: boolean; + OES_vertex_array_object: boolean; + WEBGL_compressed_texture_etc1: boolean; + WEBGL_compressed_texture_s3tc: boolean; + WEBGL_debug_renderer_info: boolean; + WEBGL_debug_shaders: boolean; + WEBGL_depth_texture: boolean; + WEBGL_draw_buffers: boolean; + WEBGL_lose_context: boolean; + WEBKIT_EXT_texture_filter_anisotropic: boolean; + WEBKIT_WEBGL_compressed_texture_s3tc: boolean; + WEBKIT_WEBGL_depth_texture: boolean; + WEBKIT_WEBGL_lose_context: boolean; +} + +interface WebpBoolean extends Boolean { + alpha: boolean; + animation: boolean; + lossless: boolean; +} + +interface DatauriBoolean extends Boolean { + over32kb: boolean; +} + interface FeatureDetects { // Documented @@ -67,7 +127,7 @@ interface FeatureDetects { emoji: boolean; eventlistener: boolean; exiforientation: boolean; - flash: boolean; + flash: false | FlashBoolean; forcetouch: boolean; fullscreen: boolean; gamepads: boolean; @@ -77,7 +137,7 @@ interface FeatureDetects { history: boolean; htmlimports: boolean; ie8compat: boolean; - indexeddb: boolean; + indexeddb: false | IndexeddbBoolean; indexeddbblob: boolean; input: InputBoolean; search: boolean; @@ -143,7 +203,7 @@ interface FeatureDetects { csscalc: boolean; checked: boolean; csschunit: boolean; - csscolumns: boolean; + csscolumns: false | CssColumnsBoolean; cubicbezierrange: boolean; "display-runin": boolean; displaytable: boolean; @@ -266,8 +326,7 @@ interface FeatureDetects { webpalpha: boolean; webpanimation: boolean; webplossless: boolean; - "webp-lossless": boolean; - webp: boolean; + webp: false | WebpBoolean; inputformaction: boolean; inputformenctype: boolean; inputformmethod: boolean; @@ -299,12 +358,12 @@ interface FeatureDetects { smil: boolean; textareamaxlength: boolean; bloburls: boolean; - datauri: boolean; + datauri: false | DatauriBoolean; urlparser: boolean; videoautoplay: boolean; videoloop: boolean; videopreload: boolean; - webglextensions: boolean; + webglextensions: false | WebglextensionsBoolean; datachannel: boolean; getusermedia: boolean; peerconnection: boolean; @@ -344,8 +403,8 @@ interface Dictionary { interface ModernizrAPI { on(feature: string, cb: (result: boolean) => any): void; - addTest(feature: string, test: (() => boolean) | boolean): void; - addTest(feature: Dictionary): void; + addTest(feature: string, test: (() => boolean) | boolean): ModernizrStatic; + addTest(feature: Dictionary): ModernizrStatic; atRule(prop: string): boolean; @@ -360,7 +419,7 @@ interface ModernizrAPI { prefixedCSS(prop: string): string; - prefixedCSSValue(prop: string, value: string): string; + prefixedCSSValue(prop: string, value: string): boolean; _prefixes: string[]; From 5a3f029dc46eaa76ea9442b571284d2ee227f2ed Mon Sep 17 00:00:00 2001 From: Gaspard Bucher Date: Thu, 2 Mar 2017 11:48:06 +0100 Subject: [PATCH 254/797] Add suppressContentEditableWarning to react * react: add support for the new suppressContentEditableWarning flag https://github.com/facebook/react/pull/6112 --- react/index.d.ts | 1 + react/test/tsx.tsx | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/react/index.d.ts b/react/index.d.ts index d3c254f875..c8ddc717c7 100644 --- a/react/index.d.ts +++ b/react/index.d.ts @@ -2042,6 +2042,7 @@ declare namespace React { // React-specific Attributes defaultChecked?: boolean; defaultValue?: string | string[]; + suppressContentEditableWarning?: boolean; // Standard HTML Attributes accept?: string; diff --git a/react/test/tsx.tsx b/react/test/tsx.tsx index 540c712596..1d6b683bcf 100644 --- a/react/test/tsx.tsx +++ b/react/test/tsx.tsx @@ -33,3 +33,13 @@ StatelessComponent2.defaultProps = {
Hello again!
; + +// React-specific Attributes +
+ foo +
From 3aa6f05b60d9cd0759a129942dd38037a678cdea Mon Sep 17 00:00:00 2001 From: Fedor Nezhivoi Date: Thu, 2 Mar 2017 10:06:41 +0200 Subject: [PATCH 255/797] update react-native version to 0.42 and use new react-native jsx target --- react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-native/index.d.ts b/react-native/index.d.ts index 2f95939db6..9debe9bbc9 100644 --- a/react-native/index.d.ts +++ b/react-native/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-native 0.37 +// Type definitions for react-native 0.42 // Project: https://github.com/facebook/react-native // Definitions by: Needs A Maintainer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 3350914cbaa9756da09ce9bf0f40daa42ab23082 Mon Sep 17 00:00:00 2001 From: Fedor Nezhivoi Date: Thu, 2 Mar 2017 10:08:32 +0200 Subject: [PATCH 256/797] update ScrollView typings --- react-native/index.d.ts | 43 +++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/react-native/index.d.ts b/react-native/index.d.ts index 9debe9bbc9..d18d311fa3 100644 --- a/react-native/index.d.ts +++ b/react-native/index.d.ts @@ -5413,11 +5413,6 @@ declare module "react" { */ onScrollAnimationEnd?: () => void - /** - * When false, the content does not scroll. The default value is true - */ - scrollEnabled?: boolean // true - /** * This controls how often the scroll event will be fired while scrolling (in events per seconds). * A higher number yields better accuracy for code that is tracking the scroll position, @@ -5452,7 +5447,7 @@ declare module "react" { * This can be used for paginating through children that have lengths smaller than the scroll view. * Used in combination with snapToAlignment. */ - snapToInterval?: number + snapToInterval?: number[] /** * An array of child indices determining which children get docked to the @@ -5489,6 +5484,15 @@ declare module "react" { */ scrollPerfTag?: string + /** + * Used to override default value of overScroll mode. + + * Possible values: + * - 'auto' - Default value, allow a user to over-scroll this view only if the content is large enough to meaningfully scroll. + * - 'always' - Always allow a user to over-scroll this view. + * - 'never' - Never allow a user to over-scroll this view. + */ + overScrollMode?: 'auto' | 'always' | 'never' } export interface ScrollViewProperties extends ViewProperties, ScrollViewPropertiesIOS, ScrollViewPropertiesAndroid, Touchable, React.Props { @@ -5524,7 +5528,7 @@ declare module "react" { * and moves in synchrony with the touch; dragging upwards cancels the * dismissal. */ - keyboardDismissMode?: string + keyboardDismissMode?: 'none' | 'interactive' | 'on-drag' /** * When false tapping outside of the focused text input when the keyboard @@ -5532,16 +5536,16 @@ declare module "react" { * taps and the keyboard will not dismiss automatically. The default value * is false. */ - keyboardShouldPersistTaps?: boolean - - /** - * Called when scrollable content view of the ScrollView changes. - * Handler function is passed the content width and content height as parameters: (contentWidth, contentHeight) - * It's implemented using onLayout handler attached to the content container which this ScrollView renders. - * - */ - onContentSizeChange?: (w: number, h: number) => void - + keyboardShouldPersistTaps?: boolean | 'always' | 'never' | 'handled' + + /** + * Called when scrollable content view of the ScrollView changes. + * Handler function is passed the content width and content height as parameters: (contentWidth, contentHeight) + * It's implemented using onLayout handler attached to the content container which this ScrollView renders. + * + */ + onContentSizeChange?: (w: number, h: number) => void + /** * Fires at most once per frame during scrolling. * The frequency of the events can be contolled using the scrollEventThrottle prop. @@ -5575,6 +5579,11 @@ declare module "react" { */ pagingEnabled?: boolean + /** + * When false, the content does not scroll. The default value is true + */ + scrollEnabled?: boolean // true + /** * Experimental: When true offscreen child views (whose `overflow` value is * `hidden`) are removed from their native backing superview when offscreen. From ecdeab6601c2c24dc2b59bb9273db52124ce57c8 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Thu, 2 Mar 2017 17:37:04 +0530 Subject: [PATCH 257/797] Lint errors fixed --- ej.web.all/index.d.ts | 425 +++++++++++++++++++++++++++++------------- 1 file changed, 292 insertions(+), 133 deletions(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 0c6cb092e1..2e8d6b8073 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1909,7 +1909,10 @@ export interface Model { */ fields?: Fields; - /** Specifies the search filter type. There are several types of search filter available such as ‘startswith’, ‘contains’, ‘endswith’, ‘lessthan’, ‘lessthanorequal’, ‘greaterthan’, ‘greaterthanorequal’, ‘equal’, ‘notequal’. + /** Specifies the search filter type. + * There are several types of search filter available such as ‘startswith’, + * ‘contains’, ‘endswith’, ‘lessthan’, ‘lessthanorequal’, ‘greaterthan’, + * ‘greaterthanorequal’, ‘equal’, ‘notequal’. * @Default {ej.filterType.StartsWith} */ filterType?: string; @@ -2283,7 +2286,9 @@ export interface MultiColumnSettingsColumn { */ type?: ej.Type|string; - /** Specifies the search filter type. There are several types of search filter available such as ‘startswith’, ‘contains’, ‘endswith’, ‘lessthan’, ‘lessthanorequal’, ‘greaterthan’, ‘greaterthanorequal’, ‘equal’, ‘notequal’. + /** Specifies the search filter type. There are several types of search filter available such as ‘startswith’, + * ‘contains’, ‘endswith’, ‘lessthan’, ‘lessthanorequal’, ‘greaterthan’, + * ‘greaterthanorequal’, ‘equal’, ‘notequal’. * @Default {ej.filterType.StartsWith} */ filterType?: ej.filterType|string; @@ -2409,7 +2414,9 @@ export interface Model { */ htmlAttributes?: any; - /** Specifies the image position of the Button. This image position is applicable only with the textandimage contentType property. The images can be positioned in both imageLeft and imageRight options. See below to know about available ImagePosition + /** Specifies the image position of the Button. This image position is applicable + * only with the textandimage contentType property. The images can be positioned in both + * imageLeft and imageRight options. See below to know about available ImagePosition * @Default {ej.ImagePosition.ImageLeft} */ imagePosition?: ej.ImagePosition|string; @@ -2459,7 +2466,10 @@ export interface Model { */ width?: string|number; - /** Fires when Button control is clicked successfully.Consider the scenario to perform any validation,modification of content or any other operations click on button,we can make use of this click event to achieve the scenario. */ + /** Fires when Button control is clicked successfully.Consider the scenario to perform any validation, + * modification of content or any other operations click on button,we can make use of this click event + * to achieve the scenario. + */ click?(e: ClickEventArgs): void; /** Fires after Button control is created.If the user want to perform any operation after the button control creation then the user can make use of this create event. */ @@ -2802,7 +2812,8 @@ class ListBox extends ej.Widget { defaults: ListBox.Model; /** Adds a given list items in the ListBox widget at a specified index. It accepts two parameters. - * @param {any|string} This can be a list item object (for JSON binding) or a string (for UL and LI rendering). Also we can the specify this as an array of list item object or an array of strings to add multiple items. + * @param {any|string} This can be a list item object (for JSON binding) or a string (for UL and LI rendering). + * Also we can the specify this as an array of list item object or an array of strings to add multiple items. * @param {number} The index value to add the given items at the specified index. If index is not specified, the given items will be added at the end of the list. * @returns {void} */ @@ -3130,7 +3141,9 @@ export interface Model { */ caseSensitiveSearch?: boolean; - /** Dynamically populate data of a list box while selecting an item in another list box i.e. rendering child list box based on the item selection in parent list box. This property accepts the id of the child ListBox widget to populate the data. + /** Dynamically populate data of a list box while selecting an item in another list box i.e. + * rendering child list box based on the item selection in parent list box. + * This property accepts the id of the child ListBox widget to populate the data. * @Default {null} */ cascadeTo?: string; @@ -3928,7 +3941,11 @@ export namespace CheckBox { export interface Model { - /** Specifies whether CheckBox has to be in checked or not. We can also specify array of string as value for this property. If any of the value in the specified array matches the value of the textbox, then it will be considered as checked. It will be useful in MVVM binding, specify array type to identify the values of the checked CheckBoxes. + /** Specifies whether CheckBox has to be in checked or not. + * We can also specify array of string as value for this property. + * If any of the value in the specified array matches the value of the textbox, + * then it will be considered as checked. It will be useful in MVVM binding, + * specify array type to identify the values of the checked CheckBoxes. * @Default {false} */ checked?: boolean|string[]; @@ -3947,7 +3964,9 @@ export interface Model { */ enabled?: boolean; - /** Specifies the persist property for CheckBox while initialization. The persist API save current model value to browser cookies for state maintains. While refreshing the CheckBox control page the model value apply from browser cookies. + /** Specifies the persist property for CheckBox while initialization. + * The persist API save current model value to browser cookies for state maintains. + * While refreshing the CheckBox control page the model value apply from browser cookies. * @Default {false} */ enablePersistence?: boolean; @@ -4248,7 +4267,8 @@ export interface Model { */ palette?: ej.ColorPicker.Palette|string; - /** This property allows to define the preset model to be rendered initially in palette type.It consists of 12 different types of presets. Each presets have 50 colors. See below available Presets + /** This property allows to define the preset model to be rendered initially in palette type.It consists of 12 different types of presets. Each presets have 50 colors. + * See below available Presets * @Default {ej.ColorPicker.Presets.Basic} */ presetType?: ej.ColorPicker.Presets|string; @@ -4268,7 +4288,8 @@ export interface Model { */ showPreview?: boolean; - /** This property allows to store the color values in custom list.The ColorPicker will keep up to 11 colors in a custom list.By clicking the add button, the selected color from picker or palette will get added in the recent color list. + /** This property allows to store the color values in custom list.The ColorPicker will keep up to 11 colors in a custom list. + * By clicking the add button, the selected color from picker or palette will get added in the recent color list. * @Default {false} */ showRecentColors?: boolean; @@ -4289,7 +4310,9 @@ export interface Model { toolIcon?: string; /** This property allows to define the customized text or content to displayed when mouse over the following elements. This property also allows to use the culture values. - * @Default {{ switcher: Switcher, addbutton: Add Color, basic: Basic, monochrome: Mono Chrome, flatcolors: Flat Color, seawolf: Sea Wolf, webcolors: Web Colors, sandy: Sandy, pinkshades: Pink Shades, misty: Misty, citrus: Citrus, vintage: Vintage, moonlight: Moon Light, candycrush: Candy Crush, currentcolor: Current Color, selectedcolor: Selected Color }} + * @Default {{ switcher: Switcher, addbutton: Add Color, basic: Basic, monochrome: Mono Chrome, flatcolors: Flat Color, seawolf: Sea Wolf, webcolors: Web Colors, + * sandy: Sandy, pinkshades: Pink Shades, misty: Misty, citrus: Citrus, vintage: Vintage, moonlight: Moon Light, candycrush: Candy Crush, + * currentcolor: Current Color, selectedcolor: Selected Color }} */ tooltipText?: TooltipText; @@ -4621,12 +4644,14 @@ export interface Model { */ ajaxDataType?: string; - /** By using ajaxSettings property, you can customize the AJAX configurations. Normally you can customize the following option in AJAX handling data, URL, type, async, contentType, dataType and success. For upload, download and getImage API, you can only customize URL. + /** By using ajaxSettings property, you can customize the AJAX configurations. Normally you can customize the following option in AJAX handling data, URL, type, async, contentType, dataType and + * success. For upload, download and getImage API, you can only customize URL. * @Default {{ read: {}, createFolder: {}, remove: {}, rename: {}, paste: {}, getDetails: {}, download: {}, upload: {}, getImage: {}, search: {}}} */ ajaxSettings?: any; - /** The FileExplorer allows to move the files from one folder to another folder of FileExplorer by using drag and drop option. Also it supports to upload a file by dragging it from windows explorer to the necessary folder of ejFileExplorer. + /** The FileExplorer allows to move the files from one folder to another folder of FileExplorer by using drag and drop option. Also it supports to upload a file by dragging it + * from windows explorer to the necessary folder of ejFileExplorer. * @Default {true} */ allowDragAndDrop?: boolean; @@ -4744,7 +4769,8 @@ export interface Model { */ showContextMenu?: boolean; - /** Enables or disables the footer in FileExplorer control. The footer element displays the details of the current selected files and folders. And also the footer having the switcher to change the layout view. + /** Enables or disables the footer in FileExplorer control. The footer element displays the details of the current selected files and folders. + * And also the footer having the switcher to change the layout view. * @Default {true} */ showFooter?: boolean; @@ -4764,13 +4790,15 @@ export interface Model { */ showToolbar?: boolean; - /** Enables or disables the navigation pane in FileExplorer control. The navigation pane contains a tree view element that displays all the folders from the filesystem in a hierarchical manner. This is useful to a quick navigation of any folder in the filesystem. + /** Enables or disables the navigation pane in FileExplorer control. The navigation pane contains a tree view element that displays all the folders from the filesystem in a hierarchical manner. + * This is useful to a quick navigation of any folder in the filesystem. * @Default {true} */ showNavigationPane?: boolean; /** The tools property is used to configure and group required toolbar items in FileExplorer control. - * @Default {{ creation: [NewFolder], navigation: [Back, Forward, Upward], addressBar: [Addressbar], editing: [Refresh, Upload, Delete, Rename, Download], copyPaste: [Cut, Copy, Paste], getProperties: [Details], searchBar: [Searchbar], layout: [Layout], sortBy: [SortBy]}} + * @Default {{ creation: [NewFolder], navigation: [Back, Forward, Upward], addressBar: [Addressbar], editing: [Refresh, Upload, Delete, Rename, Download], copyPaste: [Cut, Copy, Paste], + * getProperties: [Details], searchBar: [Searchbar], layout: [Layout], sortBy: [SortBy]}} */ tools?: any; @@ -4794,7 +4822,9 @@ export interface Model { /** Fires before downloading the files. */ beforeDownload?(e: BeforeDownloadEventArgs): void; - /** Fires before getting a requested image from server. Also this event will be triggered when you have enabled thumbnail image compression option in FileExplorer.Using this event, you can customize the image compression size. */ + /** Fires before getting a requested image from server. Also this event will be triggered when you have enabled thumbnail image compression option in FileExplorer. + * Using this event, you can customize the image compression size. + */ beforeGetImage?(e: BeforeGetImageEventArgs): void; /** Fires before files or folders open. */ @@ -5662,7 +5692,8 @@ export interface UnselectEventArgs { export interface ContextMenuSettings { /** The items property is used to configure and group the required ContextMenu items in FileExplorer control. - * @Default {{% highlight javascript %}{navbar: [NewFolder, Upload, |, Delete, Rename, |, Cut, Copy, Paste, |, Getinfo],cwd: [Refresh, Paste,|, SortBy, |, NewFolder, Upload, |, Getinfo],files: [Open, Download, |, Upload, |, Delete, Rename, |, Cut, Copy, Paste, |, OpenFolderLocation, Getinfo]}{% endhighlight %}} + * @Default {{% highlight javascript %}{navbar: [NewFolder, Upload, |, Delete, Rename, |, Cut, Copy, Paste, |, Getinfo],cwd: [Refresh, Paste,|, SortBy, |, NewFolder, Upload, |, + * Getinfo],files: [Open, Download, |, Upload, |, Delete, Rename, |, Cut, Copy, Paste, |, OpenFolderLocation, Getinfo]}{% endhighlight %}} */ items?: any; @@ -5703,7 +5734,8 @@ export interface GridSettings { allowSorting?: boolean; /** Gets or sets an object that indicates to render the grid with specified columns. You can use this property same as the column property in Grid control. - * @Default {[{ field: name, headerText: Name, width: 30% }, { field: dateModified, headerText: Date Modified, width: 30% }, { field: type, headerText: Type, width: 15% }, { field: size, headerText: Size, width: 12%, textAlign: right, headerTextAlign: left }]} + * @Default {[{ field: name, headerText: Name, width: 30% }, { field: dateModified, headerText: Date Modified, width: 30% }, { field: type, headerText: Type, width: 15% }, + * { field: size, headerText: Size, width: 12%, textAlign: right, headerTextAlign: left }]} */ columns?: any[]; } @@ -5810,7 +5842,8 @@ export interface Model { */ dayHeaderFormat?: string | ej.DatePicker.Header; - /** Specifies the navigation depth level in DatePicker calendar. This option is not applied when start level view option is lower than depth level view. See below to know available levels in DatePicker Calendar + /** Specifies the navigation depth level in DatePicker calendar. This option is not applied when start level view option is lower than depth level view. + * See below to know available levels in DatePicker Calendar */ depthLevel?: string | ej.DatePicker.Level; @@ -5839,7 +5872,8 @@ export interface Model { */ enableRTL?: boolean; - /** Allows to enter valid or invalid date in input textbox and indicate as error if it is invalid value, when this API value is set to true. For false value, invalid date is not allowed to input field and corrected to valid date automatically, even if invalid date is given. + /** Allows to enter valid or invalid date in input textbox and indicate as error if it is invalid value, when this API value is set to true. For false value, invalid date is not allowed + * to input field and corrected to valid date automatically, even if invalid date is given. * @Default {false} */ enableStrictMode?: boolean; @@ -6414,7 +6448,8 @@ export interface Model { */ dayHeaderFormat?: ej.DatePicker.Header|string; - /** Specifies the navigation depth level in DatePicker calendar inside DateTimePicker popup. This option is not applied when start level view option is lower than depth level view. See ej.DatePicker.Level + /** Specifies the navigation depth level in DatePicker calendar inside DateTimePicker popup. This option is not applied + * when start level view option is lower than depth level view. See ej.DatePicker.Level */ depthLevel?: ej.DatePicker.Level|string; @@ -7266,7 +7301,8 @@ export interface Model { */ allowKeyboardNavigation?: boolean; - /** Customizes the Dialog widget animations. The Dialog widget can be animated while opening and closing the dialog. In order to customize animation effects, you need to set “enableAnimation†as true. It contains the following sub properties. + /** Customizes the Dialog widget animations. The Dialog widget can be animated while opening and closing the dialog. + * In order to customize animation effects, you need to set “enableAnimation†as true. It contains the following sub properties. */ animation?: any; @@ -7278,7 +7314,8 @@ export interface Model { */ containment?: string; - /** The content type to load the dialog content at run time. The possible values are null, AJAX, iframe and image. When it is null (default value), the content inside dialog element will be displayed as content and when it is not null, the content will be loaded from the URL specified in the contentUrl property. + /** The content type to load the dialog content at run time. The possible values are null, AJAX, iframe and image. When it is null (default value), + * the content inside dialog element will be displayed as content and when it is not null, the content will be loaded from the URL specified in the contentUrl property. */ contentType?: string; @@ -7318,7 +7355,8 @@ export interface Model { */ faviconCSS?: string; - /** Sets the height for the dialog widget. It accepts both string and integer values. For example, it can accepts values like “autoâ€Â, “100%â€Â, “100px†as string type and “100â€Â, “500†as integer type. + /** Sets the height for the dialog widget. It accepts both string and integer values. For example, it can accepts values like “autoâ€Â, “100%â€Â, “100px†as string type + * and “100â€Â, “500†as integer type. */ height?: string|number; @@ -7379,7 +7417,8 @@ export interface Model { */ tooltip?: any; - /** Sets the height for the dialog widget. It accepts both string and integer values. For example, it can accepts values like “autoâ€Â, “100%â€Â, “100px†as string type and “100â€Â, “500†as integer type. + /** Sets the height for the dialog widget. It accepts both string and integer values. For example, it can accepts values like “autoâ€Â, “100%â€Â, + * “100px†as string type and “100â€Â, “500†as integer type. */ width?: string|number; @@ -8089,7 +8128,8 @@ export namespace DropDownList { export interface Model { - /** The Virtual Scrolling(lazy loading) feature is used to display a large amount of data that you require without buffering the entire load of a huge database records in the DropDownList, that is, when scrolling, an AJAX request is sent to fetch some amount of data from the server dynamically. To achieve this scenario with DropDownList, set the allowVirtualScrolling to true. + /** The Virtual Scrolling(lazy loading) feature is used to display a large amount of data that you require without buffering the entire load of a huge database records in the DropDownList, + * that is, when scrolling, an AJAX request is sent to fetch some amount of data from the server dynamically. To achieve this scenario with DropDownList, set the allowVirtualScrolling to true. * @Default {false} */ allowVirtualScrolling?: boolean; @@ -8104,16 +8144,19 @@ export interface Model { */ caseSensitiveSearch?: boolean; - /** Dropdown widget's style and appearance can be controlled based on 13 different default built-in themes.You can customize the appearance of the dropdown by using the cssClass property. You need to specify a class name in the cssClass property and the same class name is used before the class definitions wherever the custom styles are applied. + /** Dropdown widget's style and appearance can be controlled based on 13 different default built-in themes.You can customize the appearance of the dropdown by using the cssClass property. + * You need to specify a class name in the cssClass property and the same class name is used before the class definitions wherever the custom styles are applied. */ cssClass?: string; - /** This property is used to serve data from the data services based on the query provided. To bind the data to the dropdown widget, the dataSource property is assigned with the instance of the ej.DataManager. + /** This property is used to serve data from the data services based on the query provided. To bind the data to the dropdown widget, + * the dataSource property is assigned with the instance of the ej.DataManager. * @Default {null} */ dataSource?: any; - /** Sets the separator when the multiSelectMode with delimiter option or checkbox is enabled with the dropdown. When you enter the delimiter value, the texts after the delimiter are considered as a separate word or query. The delimiter string is a single character and must be a symbol. Mostly, the delimiter symbol is used as comma (,) or semi-colon (;) or any other special character. + /** Sets the separator when the multiSelectMode with delimiter option or checkbox is enabled with the dropdown. When you enter the delimiter value,the texts after the delimiter are considered + * as a separate word or query. The delimiter string is a single character and must be a symbol. Mostly, the delimiter symbol is used as comma (,) or semi-colon (;) or any other special character. * @Default {','} */ delimiterChar?: string; @@ -8123,7 +8166,8 @@ export interface Model { */ enableAnimation?: boolean; - /** This property is used to indicate whether the DropDownList control responds to the user interaction or not. By default, the control is in the enabled mode and you can disable it by setting it to false. + /** This property is used to indicate whether the DropDownList control responds to the user interaction or not. By default, the control is in the enabled mode + * and you can disable it by setting it to false. * @Default {true} */ enabled?: boolean; @@ -8138,7 +8182,8 @@ export interface Model { */ enableFilterSearch?: boolean; - /** Saves the current model value to the browser cookies for state maintenance. While refreshing the DropDownList control page, it retains the model value and it is applied from the browser cookies. + /** Saves the current model value to the browser cookies for state maintenance. While refreshing the DropDownList control page, it retains the model value and + * it is applied from the browser cookies. * @Default {false} */ enablePersistence?: boolean; @@ -8213,7 +8258,9 @@ export interface Model { */ minPopupWidth?: string|number; - /** With the help of this property, you can make a single or multi selection with the DropDownList and display the text in two modes, delimiter and visual mode. In delimiter mode, you can separate the items by using the delimiter character such as comma (,) or semi-colon (;) or any other special character. In the visual mode, the items are showcased like boxes with close icon in the textbox. + /** With the help of this property, you can make a single or multi selection with the DropDownList and display the text in two modes, delimiter and visual mode. + * In delimiter mode, you can separate the items by using the delimiter character such as comma (,) or semi-colon (;) or any other special character. + * In the visual mode, the items are showcased like boxes with close icon in the textbox. * @Default {ej.MultiSelectMode.None} */ multiSelectMode?: ej.MultiSelectMode|string; @@ -8308,7 +8355,9 @@ export interface Model { */ width?: string|number; - /** The Virtual Scrolling feature is used to display a large amount of records in the DropDownList, that is, when scrolling, an AJAX request is sent to fetch some amount of data from the server dynamically. To achieve this scenario with DropDownList, set the allowVirtualScrolling to true. You can set the itemsCount property that represents the number of items to be fetched from the server on every AJAX request. + /** The Virtual Scrolling feature is used to display a large amount of records in the DropDownList, that is, when scrolling, an AJAX request is sent to fetch some amount of data from + * the server dynamically. To achieve this scenario with DropDownList, set the allowVirtualScrolling to true. + * You can set the itemsCount property that represents the number of items to be fetched from the server on every AJAX request. * @Default {normal} */ virtualScrollMode?: ej.VirtualScrollMode|string; @@ -9505,12 +9554,14 @@ export interface Model { */ name?: string; - /** Specifies the pattern for formatting positive values in editor.We have maintained some standard to define the negative pattern. you have to specify 'n' to place the digit in your pattern.ejTextbox allows you to define a currency or percent symbol where you want to place it. + /** Specifies the pattern for formatting positive values in editor.We have maintained some standard to define the negative pattern. + * you have to specify 'n' to place the digit in your pattern.ejTextbox allows you to define a currency or percent symbol where you want to place it. * @Default {Based on the culture} */ negativePattern?: string; - /** Specifies the pattern for formatting positive values in editor.We have maintained some standard to define the positive pattern. you have to specify 'n' to place the digit in your pattern.ejTextbox allows you to define a currency or percent symbol where you want to place it. + /** Specifies the pattern for formatting positive values in editor.We have maintained some standard to define the positive pattern. + * you have to specify 'n' to place the digit in your pattern.ejTextbox allows you to define a currency or percent symbol where you want to place it. * @Default {Based on the culture} */ positivePattern?: string; @@ -9836,7 +9887,8 @@ export interface Model { */ checkedIndices?: any[]; - /** Sets the root class for ListView theme. This cssClass API helps to use custom skinning option for ListView control. By defining the root class using this API, we need to include this root class in CSS. + /** Sets the root class for ListView theme. This cssClass API helps to use custom skinning option for ListView control. By defining the root class using this API, + * we need to include this root class in CSS. */ cssClass?: string; @@ -11193,7 +11245,8 @@ export interface Model { */ externalMessage?: string; - /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. + * in a language and culture specific to a particular country or region. * @Default {en-US} */ locale?: string; @@ -11503,7 +11556,8 @@ export interface Model { */ enabled?: boolean; - /** Specifies the enablePersistence property for RadioButton while initialization. The enablePersistence API save current model value to browser cookies for state maintains. While refreshing the radio button control page the model value apply from browser cookies. + /** Specifies the enablePersistence property for RadioButton while initialization. The enablePersistence API save current model value to browser cookies for state maintains. + * While refreshing the radio button control page the model value apply from browser cookies. * @Default {false} */ enablePersistence?: boolean; @@ -11950,7 +12004,8 @@ class Ribbon extends ej.Widget { model: Ribbon.Model; defaults: Ribbon.Model; - /** Adds contextual tab or contextual tab set dynamically in the ribbon control with contextual tabs object and index position. When index is null, ribbon contextual tab or contextual tab set is added at the last index. + /** Adds contextual tab or contextual tab set dynamically in the ribbon control with contextual tabs object and index position. + * When index is null, ribbon contextual tab or contextual tab set is added at the last index. * @param {any} contextual tab or contextual tab set object. * @param {number} index of the contextual tab or contextual tab set, this is optional. * @returns {void} @@ -11980,7 +12035,8 @@ class Ribbon extends ej.Widget { */ addTabGroup(tabIndex: number, tabGroup: any, groupIndex?: number): void; - /** Adds group content dynamically in the ribbon control with given tab index, group index, sub group index, content and content index position. When content index is null, content is added at the last index. + /** Adds group content dynamically in the ribbon control with given tab index, group index, sub group index, content and content index position. + * When content index is null, content is added at the last index. * @param {number} ribbon tab index. * @param {number} ribbon group index. * @param {number} sub group index in the ribbon group, @@ -12101,7 +12157,8 @@ export interface Model { */ isResponsive?: boolean; - /** Specifies the height, width, enableRTL, showRoundedCorner,enabled,cssClass property to the controls in the ribbon commonly andit will work only when those properties are not defined in buttonSettings and content defaults. + /** Specifies the height, width, enableRTL, showRoundedCorner,enabled,cssClass property to the controls in the ribbon commonly andit will work only when those properties + * are not defined in buttonSettings and content defaults. * @Default {Object} */ buttonDefaults?: any; @@ -12141,7 +12198,8 @@ export interface Model { */ applicationTab?: ApplicationTab; - /** Specifies the contextual tabs and tab set to the ribbon control with the background color and border color. Refer to the tabs section for adding tabs into the contextual tab and contextual tab set. + /** Specifies the contextual tabs and tab set to the ribbon control with the background color and border color. Refer to the tabs section for adding tabs + * into the contextual tab and contextual tab set. * @Default {Array} */ contextualTabs?: ContextualTab[]; @@ -12166,7 +12224,8 @@ export interface Model { */ tabs?: Tab[]; - /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region and it will need to use the user's preference. + /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific + * to a particular country or region and it will need to use the user's preference. * @Default {en-US} */ locale?: string; @@ -12613,7 +12672,8 @@ export interface ApplicationTabBackstageSettingsPage { */ text?: string; - /** Specifies the type for ribbon backstage page's contents. Set "ej.Ribbon.BackStageItemType.Tab" to render the tab or "ej.Ribbon.BackStageItemType.Button" to render the button. + /** Specifies the type for ribbon backstage page's contents. Set "ej.Ribbon.BackStageItemType.Tab" to render the tab or " + * ej.Ribbon.BackStageItemType.Button" to render the button. * @Default {ej.Ribbon.ItemType.Tab} */ itemType?: ej.Ribbon.ItemType|string; @@ -12674,7 +12734,8 @@ export interface ApplicationTab { */ menuSettings?: any; - /** Specifies the application menu or backstage page. Specify the type of application tab as "ej.Ribbon.ApplicationTabType.Menu" to render the application menu or "ej.Ribbon.ApplicationTabType.Backstage" to render backstage page in the ribbon control. + /** Specifies the application menu or backstage page. Specify the type of application tab as "ej.Ribbon.ApplicationTabType.Menu" to render the application menu or + * "ej.Ribbon.ApplicationTabType.Backstage" to render backstage page in the ribbon control. * @Default {ej.Ribbon.ApplicationTabType.Menu} */ type?: ej.Ribbon.ApplicationTabType|string; @@ -12902,7 +12963,8 @@ export interface TabsGroupsContentGroup { */ quickAccessMode?: ej.Ribbon.QuickAccessMode|string; - /** Specifies the type as "ej.Ribbon.Type.Button" or "ej.Ribbon.Type.SplitButton" or "ej.Ribbon.Type.DropDownList" or "ej.Ribbon.Type.ToggleButton" or "ej.Ribbon.Type.Custom" or "ej.Ribbon.Type.Gallery" to render button, split, dropdown, toggle button, gallery, custom controls. + /** Specifies the type as "ej.Ribbon.Type.Button" or "ej.Ribbon.Type.SplitButton" or "ej.Ribbon.Type.DropDownList" or "ej.Ribbon.Type.ToggleButton" + * or "ej.Ribbon.Type.Custom" or "ej.Ribbon.Type.Gallery" to render button, split, dropdown, toggle button, gallery, custom controls. * @Default {ej.Ribbon.Type.Button} */ type?: ej.Ribbon.Type|string; @@ -12936,7 +12998,8 @@ export interface TabsGroupsGroupExpanderSettings { export interface TabsGroup { - /** Specifies the alignment of controls in the groups in 'row' type or 'column' type. Value for row type is "ej.Ribbon.AlignType.Rows" and for column type is "ej.Ribbon.alignType.columns". + /** Specifies the alignment of controls in the groups in 'row' type or 'column' type. Value for row type is "ej.Ribbon.AlignType.Rows" + * and for column type is "ej.Ribbon.alignType.columns". * @Default {ej.Ribbon.AlignType.Rows} */ alignType?: ej.Ribbon.AlignType|string; @@ -13435,7 +13498,8 @@ export interface Model { */ workflows?: Workflow[]; - /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific + * to a particular country or region. * @Default {en-US} */ locale?: string; @@ -14835,7 +14899,8 @@ export interface Model { */ isResponsive?: boolean; - /** Specifies the number of Rotator Items to navigate on a single click (next/previous/play buttons). The navigateSteps property value must be less than or equal to the displayItemsCount property value. + /** Specifies the number of Rotator Items to navigate on a single click (next/previous/play buttons). + * The navigateSteps property value must be less than or equal to the displayItemsCount property value. * @Default {1} */ navigateSteps?: string|number; @@ -14855,7 +14920,8 @@ export interface Model { */ query?: string; - /** If the Rotator Item is an image, you can specify a caption for the Rotator Item. The caption text for each Rotator Item must be set by using the title attribute of the respective tag. The caption cannot be displayed if multiple Rotator Items are present. + /** If the Rotator Item is an image, you can specify a caption for the Rotator Item. The caption text for each Rotator Item must be set by using the title attribute of the respective tag. + * The caption cannot be displayed if multiple Rotator Items are present. * @Default {false} */ showCaption?: boolean; @@ -14875,7 +14941,8 @@ export interface Model { */ showPlayButton?: boolean; - /** Turns on or off thumbnail support in the Rotator control. Thumbnail is used to navigate between slides. Thumbnail supports only single slide transition You must specify the source for thumbnail elements through the thumbnailSourceID property. + /** Turns on or off thumbnail support in the Rotator control. Thumbnail is used to navigate between slides. Thumbnail supports only single slide transition + * You must specify the source for thumbnail elements through the thumbnailSourceID property. * @Default {false} */ showThumbnail?: boolean; @@ -15221,7 +15288,8 @@ class RTE extends ej.Widget { */ insertRow(before?: boolean, cell?: JQuery): HTMLElement; - /** This method helps to insert/paste the content at the current cursor (caret) position or the selected content to be replaced with our text by passing the value as parameter to the pasteContent method in the Editor. + /** This method helps to insert/paste the content at the current cursor (caret) position or the selected content to be replaced with our text by passing the value as parameter to the + * pasteContent method in the Editor. * @returns {void} */ pasteContent(): void; @@ -15309,7 +15377,8 @@ export interface Model { autoHeight?: boolean; /** Sets the colorCode to display the color of the fontColor and backgroundColor in the font tools of the RTE. - * @Default {[000000, FFFFFF, C4C4C4, ADADAD, 595959, 262626, 4f81bd, dbe5f1, b8cce4, 95b3d7, 366092, 244061, c0504d, f2dcdb, e5b9b7, d99694, 953734,632423, 9bbb59, ebf1dd, d7e3bc, c3d69b, 76923c, 4f6128, 8064a2, e5e0ec, ccc1d9, b2a2c7, 5f497a, 3f3151, f79646, fdeada, fbd5b5, fac08f,e36c09, 974806]} + * @Default {[000000, FFFFFF, C4C4C4, ADADAD, 595959, 262626, 4f81bd, dbe5f1, b8cce4, 95b3d7, 366092, 244061, c0504d, f2dcdb, e5b9b7, d99694, 953734,632423, 9bbb59, + ebf1dd, d7e3bc, c3d69b, 76923c, 4f6128, 8064a2, e5e0ec, ccc1d9, b2a2c7, 5f497a, 3f3151, f79646, fdeada, fbd5b5, fac08f,e36c09, 974806]} */ colorCode?: any; @@ -15383,17 +15452,23 @@ export interface Model { fileBrowser?: FileBrowser; /** Sets the fontName in the RTE. - * @Default {{text: Segoe UI, value: Segoe UI },{text: Arial, value: Arial,Helvetica,sans-serif },{text: Courier New, value: Courier New,Courier,Monospace },{text: Georgia, value: Georgia,serif },{text: Impact, value: Impact,Charcoal,sans-serif },{text: Lucida Console, value: Lucida Console,Monaco,Monospace },{text: Tahoma, value: Tahoma,Geneva,sans-serif },{text: Times New Roman, value: Times New Roman },{text: Trebuchet MS, value: Trebuchet MS,Helvetica,sans-serif },{text: Verdana, value: Verdana,Geneva,sans-serif}} + * @Default {{text: Segoe UI, value: Segoe UI },{text: Arial, value: Arial,Helvetica,sans-serif },{text: Courier New, value: Courier New,Courier,Monospace }, + * {text: Georgia, value: Georgia,serif },{text: Impact, value: Impact,Charcoal,sans-serif },{text: Lucida Console, value: Lucida Console,Monaco,Monospace }, + * {text: Tahoma, value: Tahoma,Geneva,sans-serif },{text: Times New Roman, value: Times New Roman },{text: Trebuchet MS, value: Trebuchet MS,Helvetica,sans-serif }, + * {text: Verdana, value: Verdana,Geneva,sans-serif}} */ fontName?: any; /** Sets the fontSize in the RTE. - * @Default {{ text: 1, value: 1 },{ text: 2 (10pt), value: 2 },{ text: 3 (12pt), value: 3 },{ text: 4 (14pt), value: 4 },{ text: 5 (18pt), value: 5 },{ text: 6 (24pt), value: 6 },{ text: 7 (36pt), value: 7 }} + * @Default {{ text: 1, value: 1 },{ text: 2 (10pt), value: 2 },{ text: 3 (12pt), value: 3 },{ text: 4 (14pt), value: 4 },{ text: 5 (18pt), value: 5 }, + * { text: 6 (24pt), value: 6 },{ text: 7 (36pt), value: 7 }} */ fontSize?: any; /** Sets the format in the RTE. - * @Default {{ text: Paragraph, value: <p>, spriteCssClass: e-paragraph },{ text: Quotation, value: <blockquote>, spriteCssClass: e-quotation },{ text: Heading 1, value: <h1>, spriteCssClass: e-h1 },{ text: Heading 2, value: <h2>, spriteCssClass: e-h2 },{ text: Heading 3, value: <h3>, spriteCssClass: e-h3 },{ text: Heading 4, value: <h4>, spriteCssClass: e-h4 },{ text: Heading 5, value: <h5>, spriteCssClass: e-h5 },{ text: Heading 6, value: <h6>, spriteCssClass: e-h6}} + * @Default {{ text: Paragraph, value: <p>, spriteCssClass: e-paragraph },{ text: Quotation, value: <blockquote>, spriteCssClass: e-quotation }, + * { text: Heading 1, value: <h1>, spriteCssClass: e-h1 },{ text: Heading 2, value: <h2>, spriteCssClass: e-h2 },{ text: Heading 3, value: <h3>, spriteCssClass: e-h3 }, + * { text: Heading 4, value: <h4>, spriteCssClass: e-h4 },{ text: Heading 5, value: <h5>, spriteCssClass: e-h5 },{ text: Heading 6, value: <h6>, spriteCssClass: e-h6}} */ format?: string; @@ -17715,7 +17790,8 @@ export interface Model { */ enableRTL?: boolean; - /** When the enableStrictMode is set as true it allows the value outside of the range and also indicate with red color border, otherwise it internally changed to the min or max range value based an input value. + /** When the enableStrictMode is set as true it allows the value outside of the range and also indicate with red color border, + * otherwise it internally changed to the min or max range value based an input value. * @Default {false} */ enableStrictMode?: boolean; @@ -18766,7 +18842,8 @@ class TreeView extends ej.Widget { */ checkNode(element: string|any|any[]): void; - /** This method is used to collapse all nodes in TreeView control. If you want to collapse all nodes up to the specific level in TreeView control then we need to pass levelUntil as argument to this method. + /** This method is used to collapse all nodes in TreeView control. If you want to collapse all nodes up to the specific level in + * TreeView control then we need to pass levelUntil as argument to this method. * @param {number} TreeView nodes will collapse until the given level * @param {boolean} Weather exclude the hidden nodes of TreeView while collapse all nodes * @returns {void} @@ -18797,7 +18874,8 @@ class TreeView extends ej.Widget { */ ensureVisible(element: string|any): boolean; - /** This method is used to expand all nodes in TreeView control. If you want to expand all nodes up to the specific level in TreeView control then we need to pass levelUntil as argument to this method. + /** This method is used to expand all nodes in TreeView control. If you want to expand all nodes up to the specific level in TreeView control + * then we need to pass levelUntil as argument to this method. * @param {number} TreeView nodes will expand until the given level * @param {boolean} Weather exclude the hidden nodes of TreeView while expand all nodes * @returns {void} @@ -18820,7 +18898,8 @@ class TreeView extends ej.Widget { */ getCheckedNodesIndex(): any[]; - /** This method is used to get immediate child nodes of a node in TreeView control. If you want to get the all child nodes include nested child nodes then we need to pass includeNestedChild as true along with element arguments to this method. + /** This method is used to get immediate child nodes of a node in TreeView control. If you want to get the all child nodes include nested + * child nodes then we need to pass includeNestedChild as true along with element arguments to this method. * @param {string|any} ID of TreeView node/object of TreeView node * @param {boolean} Weather include nested child nodes of TreeView node * @returns {Array} @@ -21593,17 +21672,20 @@ export interface Model { */ allowCellMerging?: boolean; - /** Gets or sets a value that indicates whether to enable dynamic grouping behavior. Grouping can be done by drag on drop desired columns to grid’s GroupDropArea. This can be further customized through “groupSettings†property. + /** Gets or sets a value that indicates whether to enable dynamic grouping behavior. Grouping can be done by drag on drop desired columns to grid’s GroupDropArea. + * This can be further customized through “groupSettings†property. * @Default {false} */ allowGrouping?: boolean; - /** Gets or sets a value that indicates whether to enable keyboard support for performing grid actions. selectionType – Gets or sets a value that indicates whether to enable single row or multiple rows selection behavior in grid. Multiple selection can be done through by holding CTRL and clicking the grid rows + /** Gets or sets a value that indicates whether to enable keyboard support for performing grid actions. selectionType – Gets or sets a value that indicates whether to enable single + * row or multiple rows selection behavior in grid. Multiple selection can be done through by holding CTRL and clicking the grid rows * @Default {true} */ allowKeyboardNavigation?: boolean; - /** Gets or sets a value that indicates whether to enable dynamic filtering behavior on grid. Filtering can be used to limit the records displayed using required criteria and this can be further customized through “filterSettings†property + /** Gets or sets a value that indicates whether to enable dynamic filtering behavior on grid. Filtering can be used to limit the records displayed using required criteria and + * this can be further customized through “filterSettings†property * @Default {false} */ allowFiltering?: boolean; @@ -21618,12 +21700,14 @@ export interface Model { */ allowMultiSorting?: boolean; - /** This specifies the grid to show the paginated data. Also enables pager control at the bottom of grid for dynamic navigation through data source. Paging can be further customized through “pageSettings†property. + /** This specifies the grid to show the paginated data. Also enables pager control at the bottom of grid for dynamic navigation through data source. + * Paging can be further customized through “pageSettings†property. * @Default {false} */ allowPaging?: boolean; - /** Gets or sets a value that indicates whether to enable the columns reordering behavior in the grid. Reordering can be done through by drag and drop the particular column from one index to another index within the grid. + /** Gets or sets a value that indicates whether to enable the columns reordering behavior in the grid. Reordering can be done through by drag and drop the particular column + * from one index to another index within the grid. * @Default {false} */ allowReordering?: boolean; @@ -21787,7 +21871,8 @@ export interface Model { */ keySettings?: any; - /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region. + /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and + * culture specific to a particular country or region. * @Default {en-US} */ locale?: string; @@ -21810,7 +21895,8 @@ export interface Model { */ resizeSettings?: ResizeSettings; - /** Gets or sets a value that indicates to render the grid with template rows. The template row must be a table row. That table row must have the JavaScript render binding format ({{:columnName}}) then the grid data source binds the data to the corresponding table row of the template. + /** Gets or sets a value that indicates to render the grid with template rows. The template row must be a table row. That table row must have the JavaScript render binding format ({{:columnName}}) + * then the grid data source binds the data to the corresponding table row of the template. * @Default {null} */ rowTemplate?: string; @@ -21823,7 +21909,8 @@ export interface Model { */ searchSettings?: SearchSettings; - /** Gets a value that indicates whether the grid model to hold multiple selected records . selectedRecords can be used to displayed hold the single or multiple selected records using “selectedRecords†property + /** Gets a value that indicates whether the grid model to hold multiple selected records . selectedRecords can be used to displayed hold the single + * or multiple selected records using “selectedRecords†property * @Default {null} */ selectedRecords?: any[]; @@ -23921,7 +24008,8 @@ export interface Column { */ customAttributes?: any; - /** Gets or sets a value that indicates to bind the external datasource to the particular column when column editType as dropdownedit and also it is used to bind the datasource to the foreign key column while editing the grid. //Where data is array of JSON objects of text and value for the drop-down and array of JSON objects for foreign key column. + /** Gets or sets a value that indicates to bind the external datasource to the particular column when column editType as dropdownedit and also it is used to bind the datasource + * to the foreign key column while editing the grid. //Where data is array of JSON objects of text and value for the drop-down and array of JSON objects for foreign key column. * @Default {null} */ dataSource?: any[]; @@ -24068,7 +24156,8 @@ export interface ContextMenuSettingsSubContextMenu { export interface ContextMenuSettings { - /** Gets or sets a value that indicates whether to add the default context menu actions as a context menu items If enableContextMenu is true it will show all the items related to the target, if you want selected items from contextmenu you have to mention in the contextMenuItems + /** Gets or sets a value that indicates whether to add the default context menu actions as a context menu items If enableContextMenu is true it will show all the items related to the target, + * if you want selected items from contextmenu you have to mention in the contextMenuItems * @Default {[]} */ contextMenuItems?: any[]; @@ -24250,7 +24339,8 @@ export interface GroupSettings { */ showGroupedColumn?: boolean; - /** Gets or sets a value that indicates whether to show the group button image(toggle button)in the column header and also in the grouped column in the group drop area . It can be used to group/ungroup the columns by click on the toggle button. + /** Gets or sets a value that indicates whether to show the group button image(toggle button)in the column header and also in the grouped column in the group drop area. + * It can be used to group/ungroup the columns by click on the toggle button. * @Default {false} */ showToggleButton?: boolean; @@ -27760,7 +27850,8 @@ export interface Model { */ customObject?: any; - /** For ASP.NET and MVC Wrapper, PivotSchemaDesigner will be initialized and rendered empty initially. Once the connected pivot control widget is rendered completely, PivotSchemaDesigner will just be populated with data source by setting this property to “trueâ€Â. + /** For ASP.NET and MVC Wrapper, PivotSchemaDesigner will be initialized and rendered empty initially. Once the connected pivot control widget is rendered completely, + * PivotSchemaDesigner will just be populated with data source by setting this property to “trueâ€Â. * @Default {false} */ enableWrapper?: boolean; @@ -28141,12 +28232,16 @@ export interface Model { */ operationalMode?: ej.Pivot.OperationalMode|string; - /** This is a horizontal axis that contains options to configure axis and it is the primary x axis for all the series in series array. To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s xAxisName property to link both axis and series. + /** This is a horizontal axis that contains options to configure axis and it is the primary x axis for all the series in series array. + * To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. + * Then, assign the name to the series’s xAxisName property to link both axis and series. * @Default {{}} */ primaryXAxis?: any; - /** This is a vertical axis that contains options to configure axis. This is the primary y axis for all the series in series array. To override y axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s yAxisName property to link both axis and series. + /** This is a vertical axis that contains options to configure axis. This is the primary y axis for all the series in series array. + * To override y axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. + * Then, assign the name to the series’s yAxisName property to link both axis and series. * @Default {{}} */ primaryYAxis?: any; @@ -30293,7 +30388,8 @@ class Schedule extends ej.Widget { */ getAppointments(): any[]; - /** Prints the entire Scheduler or a single appointment based on the appointment data passed as an argument to it. Simply calling the print() method, without passing any argument will print the entire Scheduler. + /** Prints the entire Scheduler or a single appointment based on the appointment data passed as an argument to it. Simply calling the print() method, + * without passing any argument will print the entire Scheduler. * @param {any} Either accepts no arguments at all or else accepts an appointment object. * @returns {void} */ @@ -30315,7 +30411,9 @@ class Schedule extends ej.Widget { */ getRecurrenceRule(): string; - /** Retrieves the time slot information (start/end time and resource details) of the given element. The parameter is optional - as when no element is passed to it, the currently selected cell information will be retrieved. When multiple cells are selected in the Scheduler, it is not necessary to provide the parameter. + /** Retrieves the time slot information (start/end time and resource details) of the given element. + * The parameter is optional - as when no element is passed to it, the currently selected cell information will be retrieved. When multiple cells are selected in the Scheduler, + * it is not necessary to provide the parameter. * @param {any} TD element object rendered as Scheduler work cell * @returns {any} */ @@ -30359,11 +30457,13 @@ export interface Model { */ allowKeyboardNavigation?: boolean; - /** It includes the dataSource option and the fields related to Schedule appointments. The appointment fields within the appointmentSettings can accept both string and object type values. To apply validation rules on the appointment window fields, then the appointment fields needs to be defined with object type values. + /** It includes the dataSource option and the fields related to Schedule appointments. The appointment fields within the appointmentSettings can accept both string and object type values. + * To apply validation rules on the appointment window fields, then the appointment fields needs to be defined with object type values. */ appointmentSettings?: AppointmentSettings; - /** Template design that applies on the Schedule appointments. All the field names that are mapped from dataSource to the appropriate field properties within the appointmentSettings can be used within the template. + /** Template design that applies on the Schedule appointments. All the field names that are mapped from dataSource + * to the appropriate field properties within the appointmentSettings can be used within the template. * @Default {null} */ appointmentTemplateId?: string; @@ -30394,7 +30494,9 @@ export interface Model { */ currentDate?: any; - /** Sets current view of the Schedule. Schedule renders initially with the view that is specified here. The available views are day, week, workweek, month, agenda and custom view - from which any one of the required view can be set to the Schedule. It accepts both string or enum values. The enum values that are accepted by currentView(ej.Schedule.CurrentView) are as follows, + /** Sets current view of the Schedule. Schedule renders initially with the view that is specified here. The available views are day, week, workweek, month, agenda and + * custom view - from which any one of the required view can be set to the Schedule. It accepts both string or enum values. The enum values that are accepted + * by currentView(ej.Schedule.CurrentView) are as follows, * @Default {ej.Schedule.CurrentView.Week} */ currentView?: string|ej.Schedule.CurrentView; @@ -30471,7 +30573,8 @@ export interface Model { */ minDate?: any; - /** Sets the mode of Schedule rendering either in a vertical or horizontal direction. It accepts either string("vertical" or "horizontal") or enum values. The enum values that are accepted by orientation(ej.Schedule.Orientation) are as follows, + /** Sets the mode of Schedule rendering either in a vertical or horizontal direction. It accepts either string("vertical" or "horizontal") or enum values. + * The enum values that are accepted by orientation(ej.Schedule.Orientation) are as follows, * @Default {ej.Schedule.Orientation.Vertical} */ orientation?: string|ej.Schedule.Orientation; @@ -30489,7 +30592,8 @@ export interface Model { */ reminderSettings?: ReminderSettings; - /** Defines the specific start and end dates to be rendered in the Schedule control. To render such user-specified custom date ranges in the Schedule control, set the currentView property to ej.Schedule.CurrentView.CustomView. + /** Defines the specific start and end dates to be rendered in the Schedule control. To render such user-specified custom date ranges in the Schedule control, + * set the currentView property to ej.Schedule.CurrentView.CustomView. * @Default {null} */ renderDates?: RenderDates; @@ -30499,7 +30603,8 @@ export interface Model { */ resourceHeaderTemplateId?: string; - /** Holds all the options related to the resources settings of the Schedule. It is a collection of one or more resource objects, where the levels of resources are rendered on the Schedule based on the order of the resource data provided within this collection. + /** Holds all the options related to the resources settings of the Schedule. It is a collection of one or more resource objects, where the levels of resources are rendered on the Schedule + * based on the order of the resource data provided within this collection. * @Default {null} */ resources?: Resource[]; @@ -30539,7 +30644,8 @@ export interface Model { */ startHour?: number; - /** Sets either 12 or 24 hour time mode on the Schedule. It accepts either the string value("12" or "24") or the below mentioned enum values. The enum values that are accepted by timeMode(ej.Schedule.TimeMode) are as follows, + /** Sets either 12 or 24 hour time mode on the Schedule. It accepts either the string value("12" or "24") or the below mentioned enum values. + * The enum values that are accepted by timeMode(ej.Schedule.TimeMode) are as follows, * @Default {null} */ timeMode?: string|ej.Schedule.TimeMode; @@ -30563,7 +30669,8 @@ export interface Model { */ width?: string; - /** When set to true, Schedule allows the validation of recurrence pattern to take place before it is being assigned to the appointments. For example, when one of the instance of recurrence appointment is dragged beyond the next or previous instance of the same recurrence appointment, a pop-up is displayed with the validation message disallowing the drag functionality. + /** When set to true, Schedule allows the validation of recurrence pattern to take place before it is being assigned to the appointments. For example, when one of the instance of + * recurrence appointment is dragged beyond the next or previous instance of the same recurrence appointment, a pop-up is displayed with the validation message disallowing the drag functionality. * @Default {true} */ enableRecurrenceValidation?: boolean; @@ -30624,7 +30731,8 @@ export interface Model { */ showNextPrevMonth?: boolean; - /** Blocks the user-specific time interval on the Scheduler, so that no appointments can be created on that particular time slots. It includes the dataSource option and also the fields related to block intervals. + /** Blocks the user-specific time interval on the Scheduler, so that no appointments can be created on that particular time slots. + * It includes the dataSource option and also the fields related to block intervals. */ blockoutSettings?: BlockoutSettings; @@ -31559,12 +31667,14 @@ export interface AppointmentSettings { */ priority?: string; - /** Binds the name of start timezone field in dataSource. It indicates the timezone of appointment start date. When startTimeZone field is not mentioned, the appointment uses the Schedule timeZone or System timeZone. + /** Binds the name of start timezone field in dataSource. It indicates the timezone of appointment start date. When startTimeZone field is not mentioned, + * the appointment uses the Schedule timeZone or System timeZone. * @Default {null} */ startTimeZone?: string; - /** Binds the name of end timezone field in dataSource. It indicates the timezone of appointment end date. When the endTimeZone field is not mentioned, the appointment uses the Schedule timeZone or System timeZone. + /** Binds the name of end timezone field in dataSource. It indicates the timezone of appointment end date. When the endTimeZone field is not mentioned, + * the appointment uses the Schedule timeZone or System timeZone. * @Default {null} */ endTimeZone?: string; @@ -31746,7 +31856,8 @@ export interface ResourcesResourceSettings { */ end?: string; - /** Binds the resources working days field name in the dataSource. It's optional, and accepts the array of strings (week day names). When provided with specific collection of days (array of day names), only those days will render for the specific resources. + /** Binds the resources working days field name in the dataSource. It's optional, and accepts the array of strings (week day names). When provided with specific collection of + * days (array of day names), only those days will render for the specific resources. * @Default {null} */ workWeek?: string; @@ -31831,7 +31942,8 @@ export interface TooltipSettings { */ enable?: boolean; - /** Template design that customizes the tooltip. All the field names that are mapped from dataSource to the appropriate field properties within the appointmentSettings can be accessed within the template. + /** Template design that customizes the tooltip. All the field names that are mapped from dataSource to the appropriate field properties within + * the appointmentSettings can be accessed within the template. * @Default {null} */ templateId?: string; @@ -31872,7 +31984,8 @@ export interface BlockoutSettings { */ enable?: boolean; - /** Template design that applies on the Schedule block intervals. All the field names that are mapped from dataSource to the appropriate field properties within the blockoutSettings can be used within the template. + /** Template design that applies on the Schedule block intervals. All the field names that are mapped from dataSource to the appropriate field + * properties within the blockoutSettings can be used within the template. * @Default {null} */ templateId?: string; @@ -32040,17 +32153,20 @@ export interface Model { */ enableRTL?: boolean; - /** Sets the active/current repeat type(frequency) on Recurrence Editor based on the index value provided. For example, setting the value 1 will initially set the repeat type as Daily and display its related options. + /** Sets the active/current repeat type(frequency) on Recurrence Editor based on the index value provided. For example, setting the value 1 will initially set the repeat type + * as Daily and display its related options. * @Default {0} */ selectedRecurrenceType?: number; - /** Sets the minimum date limit to display on the datepickers defined within the Recurrence Editor. Setting minDate with specific date value disallows the datepickers within Recurrence Editor to navigate beyond that date. + /** Sets the minimum date limit to display on the datepickers defined within the Recurrence Editor. Setting minDate with specific date value disallows the datepickers within + * Recurrence Editor to navigate beyond that date. * @Default {new Date(1900, 01, 01)} */ minDate?: any; - /** Sets the maximum date limit to display on the datepickers used within the Recurrence Editor. Setting maxDate with specific date value disallows the datepickers within the Recurrence Editor to navigate beyond that date. + /** Sets the maximum date limit to display on the datepickers used within the Recurrence Editor. Setting maxDate with specific date value disallows the + * datepickers within the Recurrence Editor to navigate beyond that date. * @Default {new Date(2099, 12, 31)} */ maxDate?: any; @@ -34532,7 +34648,8 @@ export interface Model { */ allowDragAndDrop?: boolean; - /** Enables or disables the ability to filter the data on all the columns. Enabling this property will display a row with editor controls corresponding to each column. You can restrict filtering on particular column by disabling this property directly on that column instance itself. + /** Enables or disables the ability to filter the data on all the columns. Enabling this property will display a row with editor controls corresponding to each column. + * You can restrict filtering on particular column by disabling this property directly on that column instance itself. * @Default {false} */ allowFiltering?: boolean; @@ -36384,7 +36501,8 @@ export interface Model { */ contentId?: string; - /** Sets the root class for NavigationDrawer theme. This cssClass API helps to use custom skinning option for NavigationDrawer control. By defining the root class using this API, we need to include this root class in CSS. + /** Sets the root class for NavigationDrawer theme. This cssClass API helps to use custom skinning option for NavigationDrawer control. + * By defining the root class using this API, we need to include this root class in CSS. */ cssClass?: string; @@ -36690,7 +36808,8 @@ export interface Model { */ backImageClass?: string; - /** Sets the root class for RadialMenu theme. This cssClass API helps to use custom skinning option for RadialMenu control. By defining the root class using this API, we need to include this root class in CSS. + /** Sets the root class for RadialMenu theme. This cssClass API helps to use custom skinning option for RadialMenu control. By defining the root class using this API, + * we need to include this root class in CSS. */ cssClass?: string; @@ -37432,7 +37551,8 @@ export interface Model { */ autoOpen?: boolean; - /** Sets the root class for RadialSlider theme. This cssClass API helps to use custom skinning option for RadialSlider control. By defining the root class using this API, we need to include this root class in CSS. + /** Sets the root class for RadialSlider theme. This cssClass API helps to use custom skinning option for RadialSlider control. + * By defining the root class using this API, we need to include this root class in CSS. */ cssClass?: string; @@ -38504,7 +38624,9 @@ export interface XLEdit { /** This method is used to get the property value of particular cell, based on the row and column index in the Spreadsheet. * @param {number} Pass the row index to get the property value. * @param {number} Pass the column index to get the property value. - * @param {string} Optional. Pass the property name that you want("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", "decimalPlaces", "cellType"). + * @param {string} Optional. Pass the property name that you want("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", "picture", + * "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", + * "decimalPlaces", "cellType"). * @param {number} Optional. Pass the index of the sheet. * @returns {any|string|Array} */ @@ -38512,7 +38634,9 @@ export interface XLEdit { /** This method is used to get the property value in specified cell in Spreadsheet. * @param {HTMLElement} Pass the cell element to get property value. - * @param {string} Pass the property name that you want ("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", "comment", "formatStr", "decimalPlaces", "cellType"). + * @param {string} Pass the property name that you want ("value", "value2", "type", "cFormatRule", "range", "thousandSeparator", "rule", "format", "border", + * "picture", "chart", "calcValue", "align", "hyperlink", "formats", "borders", "tformats", "tborders", "isFilterHeader", "filterState", "tableName", + * "comment", "formatStr", "decimalPlaces", "cellType"). * @param {number} Pass the index of sheet. * @returns {any|string|Array} */ @@ -39045,7 +39169,8 @@ export interface Model { */ allowComments?: boolean; - /** Gets or sets a value that indicates whether to enable or disable Conditional Format feature in the Spreadsheet. By enabling this, you can apply formatting to the selected range of cells based on the provided conditions (Greater than, Less than, Equal, Between, Contains, etc.). + /** Gets or sets a value that indicates whether to enable or disable Conditional Format feature in the Spreadsheet. By enabling this, you can apply formatting to the selected range + * of cells based on the provided conditions (Greater than, Less than, Equal, Between, Contains, etc.). * @Default {true} */ allowConditionalFormats?: boolean; @@ -39080,7 +39205,8 @@ export interface Model { */ allowFormatAsTable?: boolean; - /** Get or sets a value that indicates whether to enable or disable format painter feature in the Spreadsheet. By enabling this feature, you can copy the format from the selected range and apply it to another range. + /** Get or sets a value that indicates whether to enable or disable format painter feature in the Spreadsheet. By enabling this feature, you can copy + * the format from the selected range and apply it to another range. * @Default {true} */ allowFormatPainter?: boolean; @@ -39090,12 +39216,14 @@ export interface Model { */ allowFormulaBar?: boolean; - /** Gets or sets a value that indicates whether to enable or disable freeze pane support in Spreadsheet. After enabling this feature, you can use freeze top row, freeze first column and freeze panes options. + /** Gets or sets a value that indicates whether to enable or disable freeze pane support in Spreadsheet. After enabling this feature, + * you can use freeze top row, freeze first column and freeze panes options. * @Default {false} */ allowFreezing?: boolean; - /** Gets or sets a value that indicates whether to enable or disable hyperlink feature in the Spreadsheet. By enabling this feature, you can add hyperlink which is used to easily navigate to the cell reference from one sheet to another or a web page. + /** Gets or sets a value that indicates whether to enable or disable hyperlink feature in the Spreadsheet. By enabling this feature, you can add hyperlink which is used to + * easily navigate to the cell reference from one sheet to another or a web page. * @Default {true} */ allowHyperlink?: boolean; @@ -39130,12 +39258,14 @@ export interface Model { */ allowOverflow?: boolean; - /** Gets or sets a value that indicates whether to enable or disable resizing feature in the Spreadsheet. By enabling this feature, you can change the column width and row height by dragging its header boundaries. + /** Gets or sets a value that indicates whether to enable or disable resizing feature in the Spreadsheet. By enabling this feature, you can change the column width and + * row height by dragging its header boundaries. * @Default {true} */ allowResizing?: boolean; - /** Gets or sets a value that indicates whether to enable or disable find and replace feature in the Spreadsheet. By enabling this, you can easily find and replace a specific value in the sheet or workbook. By using goto behavior, you can select and highlight all cells that contains specific data or data types. + /** Gets or sets a value that indicates whether to enable or disable find and replace feature in the Spreadsheet. By enabling this, you can easily find and replace + * a specific value in the sheet or workbook. By using goto behavior, you can select and highlight all cells that contains specific data or data types. * @Default {true} */ allowSearching?: boolean; @@ -39155,7 +39285,8 @@ export interface Model { */ allowUndoRedo?: boolean; - /** Gets or sets a value that indicates whether to enable or disable wrap text feature in the Spreadsheet. By enabling this, cell content can wrap to the next line, if the cell content exceeds the boundary of the cell. + /** Gets or sets a value that indicates whether to enable or disable wrap text feature in the Spreadsheet. By enabling this, cell content can wrap to the next line, + * if the cell content exceeds the boundary of the cell. * @Default {true} */ allowWrap?: boolean; @@ -39224,7 +39355,8 @@ export interface Model { */ isReadOnly?: boolean; - /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data (i.e.) in a language and culture specific to a particular country or region. + /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data (i.e.) + * in a language and culture specific to a particular country or region. * @Default {en-US} */ locale?: string; @@ -42189,7 +42321,8 @@ export interface ContextMenuSettings { */ enable?: boolean; - /** Contains all the default context menu options that are applicable for SpellCheck. It also supports adding custom menu items. All the SpellCheck related context menu items are grouped under this menu collection. + /** Contains all the default context menu options that are applicable for SpellCheck. It also supports adding custom menu items. + * All the SpellCheck related context menu items are grouped under this menu collection. * @Default {{% highlight javascript %}[{ id: IgnoreAll, text: Ignore All },{ id: AddToDictionary, text: Add To Dictionary }]{% endhighlight %}} */ menuItems?: any[]; @@ -46805,7 +46938,8 @@ class Chart extends ej.Widget { defaults: Chart.Model; /** Animates the series and/or indicators in Chart. When parameter is not passed to this method, then all the series and indicators present in Chart are animated. - * @param {any} If an array collection is passed as parameter, series and indicator objects passed in array collection are animated.ExampleIf a series or indicator object is passed to this method, then the specific series or indicator is animated.Example, + * @param {any} If an array collection is passed as parameter, series and indicator objects passed in array collection are animated.ExampleIf a series + * or indicator object is passed to this method, then the specific series or indicator is animated.Example, * @returns {void} */ animate(options: any): void; @@ -46813,7 +46947,8 @@ class Chart extends ej.Widget { /** Exports chart as an image or to an excel file. Chart can be exported as an image only when exportCanvasRendering option is set to true. * @param {string} Type of the export operation to be performed. Following are the two export types that are supported now,1. 'image'2. 'excel'Example * @param {string} URL of the service, where the chart will be exported to excel.Example, - * @param {boolean} When this parameter is true, all the chart objects initialized to the same document are exported to a single excel file. This is an optional parameter. By default, it is false.Example, + * @param {boolean} When this parameter is true, all the chart objects initialized to the same document are exported to a single excel file. + * This is an optional parameter. By default, it is false.Example, * @returns {any} */ export(type: string, URL: string, exportMultipleChart: boolean): any; @@ -46875,7 +47010,8 @@ export interface Model { */ enableCanvasRendering?: boolean; - /** Controls whether the series has to be rendered at initial loading of chart, this will be useful in scenarios where chart is placed at the bottom of the web page and we need to render the series only when the chart is visible while scrolling to the top. + /** Controls whether the series has to be rendered at initial loading of chart, this will be useful in scenarios where chart is placed at the bottom of the web page + * and we need to render the series only when the chart is visible while scrolling to the top. * @Default {true} */ initSeriesRender?: boolean; @@ -46898,7 +47034,8 @@ export interface Model { */ legend?: Legend; - /** Name of the culture based on which chart should be localized. Number and date time values are localized with respect to the culture name.String type properties like title text are not localized automatically. Provide localized text as value to string type properties. + /** Name of the culture based on which chart should be localized. Number and date time values are localized with respect to the culture name.String type properties like title text are + * not localized automatically. Provide localized text as value to string type properties. * @Default {en-US} */ locale?: string; @@ -46912,20 +47049,26 @@ export interface Model { */ Margin?: any; - /** Perspective angle of the 3D view. Chart appears closer when perspective angle is decreased, and distant when perspective angle is increased.This property is applicable only when 3D view is enabled + /** Perspective angle of the 3D view. Chart appears closer when perspective angle is decreased, and distant when perspective angle is increased. + * This property is applicable only when 3D view is enabled * @Default {90} */ perspectiveAngle?: number; - /** This is a horizontal axis that contains options to configure axis and it is the primary x axis for all the series in series array. To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s xAxisName property to link both axis and series. + /** This is a horizontal axis that contains options to configure axis and it is the primary x axis for all the series in series array. + * To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. + * Then, assign the name to the series’s xAxisName property to link both axis and series. */ primaryXAxis?: PrimaryXAxis; - /** To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s xAxisName property to link both axis and series. + /** To override x axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. + * Then, assign the name to the series’s xAxisName property to link both axis and series. */ axes?: Axis[]; - /** This is a vertical axis that contains options to configure axis. This is the primary y axis for all the series in series array. To override y axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. Then, assign the name to the series’s yAxisName property to link both axis and series. + /** This is a vertical axis that contains options to configure axis. This is the primary y axis for all the series in series array. + * To override y axis for particular series, create an axis object by providing unique name by using name property and add it to axes array. + * Then, assign the name to the series’s yAxisName property to link both axis and series. */ primaryYAxis?: PrimaryYAxis; @@ -47046,7 +47189,8 @@ export interface Model { /** Fires before rendering crosshair tooltip in axis. This event is fired for each axis with crosshair label enabled. You can use this event to customize crosshair label before rendering */ trackAxisToolTip?(e: TrackAxisToolTipEventArgs): void; - /** Fires before rendering trackball tooltip. This event is fired for each series in Chart because trackball tooltip is displayed for all the series. You can use this event to customize the text displayed in trackball tooltip. */ + /** Fires before rendering trackball tooltip. This event is fired for each series in Chart because trackball tooltip is displayed for all the series. + * You can use this event to customize the text displayed in trackball tooltip. */ trackToolTip?(e: TrackToolTipEventArgs): void; /** Fires, on clicking the axis label. */ @@ -48189,7 +48333,8 @@ export interface Annotation { */ visible?: boolean; - /** Represents the horizontal offset when coordinateUnit is pixels.when coordinateUnit is points, it represents the x-coordinate of axis bounded with xAxisName property or primary X axis when xAxisName is not provided.This property is not applicable when coordinateUnit is none. + /** Represents the horizontal offset when coordinateUnit is pixels.when coordinateUnit is points, it represents the x-coordinate of axis bounded with xAxisName property + * or primary X axis when xAxisName is not provided.This property is not applicable when coordinateUnit is none. * @Default {0} */ x?: number; @@ -48198,7 +48343,8 @@ export interface Annotation { */ xAxisName?: string; - /** Represents the vertical offset when coordinateUnit is pixels.When coordinateUnit is points, it represents the y-coordinate of axis bounded with yAxisName property or primary Y axis when yAxisName is not provided.This property is not applicable when coordinateUnit is none. + /** Represents the vertical offset when coordinateUnit is pixels.When coordinateUnit is points, it represents the y-coordinate of axis bounded with + * yAxisName property or primary Y axis when yAxisName is not provided.This property is not applicable when coordinateUnit is none. * @Default {0} */ y?: number; @@ -50295,7 +50441,8 @@ export interface PrimaryXAxisStripLine { */ width?: number; - /** Specifies the order where the strip line and the series have to be rendered. When Z-order is “behindâ€Â, strip line is rendered under the series and when it is “overâ€Â, it is rendered above the series. + /** Specifies the order where the strip line and the series have to be rendered. When Z-order is “behindâ€Â, strip line is rendered + * under the series and when it is “overâ€Â, it is rendered above the series. * @Default {over. See ZIndex} */ zIndex?: ej.datavisualization.Chart.ZIndex|string; @@ -50389,12 +50536,14 @@ export interface PrimaryXAxis { */ alternateGridBand?: PrimaryXAxisAlternateGridBand; - /** Specifies where horizontal axis should intersect the vertical axis or vice versa. Value should be provided in axis co-ordinates. If provided value is greater than the maximum value of crossing axis, then axis will be placed at the opposite side. + /** Specifies where horizontal axis should intersect the vertical axis or vice versa. Value should be provided in axis co-ordinates. + * If provided value is greater than the maximum value of crossing axis, then axis will be placed at the opposite side. * @Default {null} */ crossesAt?: number; - /** Name of the axis used for crossing. Vertical axis name should be provided for horizontal axis and vice versa. If the provided name does not belongs to a valid axis, then primary X axis or primary Y axis will be used for crossing + /** Name of the axis used for crossing. Vertical axis name should be provided for horizontal axis and vice versa. + * If the provided name does not belongs to a valid axis, then primary X axis or primary Y axis will be used for crossing * @Default {null} */ crossesInAxis?: string; @@ -51650,7 +51799,8 @@ export interface PrimaryYAxisStripLine { */ width?: number; - /** Specifies the order in which strip line and the series have to be rendered. When Z-order is “behindâ€Â, strip line is rendered below the series and when it is “overâ€Â, it is rendered above the series. + /** Specifies the order in which strip line and the series have to be rendered. When Z-order is “behindâ€Â, strip line is rendered below the series and + * when it is “overâ€Â, it is rendered above the series. * @Default {over. See ZIndex} */ zIndex?: ej.datavisualization.Chart.ZIndex|string; @@ -51748,12 +51898,14 @@ export interface PrimaryYAxis { */ axisLine?: PrimaryYAxisAxisLine; - /** Specifies where horizontal axis should intersect the vertical axis or vice versa. Value should be provided in axis co-ordinates. If provided value is greater than the maximum value of crossing axis, then axis will be placed at the opposite side. + /** Specifies where horizontal axis should intersect the vertical axis or vice versa. Value should be provided in axis co-ordinates. + * If provided value is greater than the maximum value of crossing axis, then axis will be placed at the opposite side. * @Default {null} */ crossesAt?: number; - /** Name of the axis used for crossing. Vertical axis name should be provided for horizontal axis and vice versa. If the provided name does not belongs to a valid axis, then primary X axis or primary Y axis will be used for crossing + /** Name of the axis used for crossing. Vertical axis name should be provided for horizontal axis and vice versa. If the provided name does not belongs to a valid axis, + * then primary X axis or primary Y axis will be used for crossing * @Default {null} */ crossesInAxis?: string; @@ -55615,7 +55767,8 @@ export interface CaptionSettingsIndicator { */ textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; - /** Specifies where indicator text should be anchored when indicator overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + /** Specifies where indicator text should be anchored when indicator overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. + * Anchoring is not applicable for float position. * @Default {'start'} */ textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; @@ -55724,7 +55877,8 @@ export interface CaptionSettingsSubTitle { */ textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; - /** Specifies where subtitle text should be anchored when sub title text overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + /** Specifies where subtitle text should be anchored when sub title text overlaps with other caption group text. Text will be anchored when overlapping + * caption group text are at same position. Anchoring is not applicable for float position. * @Default {'start'} */ textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; @@ -55777,7 +55931,8 @@ export interface CaptionSettings { */ textAlignment?: ej.datavisualization.BulletGraph.TextAlignment|string; - /** Specifies caption text anchoring when caption text overlaps with other caption group text. Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. + /** Specifies caption text anchoring when caption text overlaps with other caption group text. + * Text will be anchored when overlapping caption group text are at same position. Anchoring is not applicable for float position. * @Default {'start'} */ textAnchor?: ej.datavisualization.BulletGraph.TextAnchor|string; @@ -56222,7 +56377,8 @@ export interface Model { */ barcodeToTextGapHeight?: number; - /** Specifies the height of bars in the Barcode. By modifying the barHeight, the entire barcode height can be customized. Please refer to xDimension for two dimensional barcode height customization. + /** Specifies the height of bars in the Barcode. By modifying the barHeight, the entire barcode height can be customized. + * Please refer to xDimension for two dimensional barcode height customization. */ barHeight?: number; @@ -56238,7 +56394,8 @@ export interface Model { */ enabled?: boolean; - /** Specifies the start and stop encode symbol in the Barcode. In one dimensional barcodes, an additional character is added as start and stop delimiters. These symbols are optional and the unique of the symbol allows the reader to determine the direction of the barcode being scanned. + /** Specifies the start and stop encode symbol in the Barcode. In one dimensional barcodes, an additional character is added as start and stop delimiters. + * These symbols are optional and the unique of the symbol allows the reader to determine the direction of the barcode being scanned. */ encodeStartStopSymbol?: number; @@ -56246,11 +56403,13 @@ export interface Model { */ lightBarColor?: any; - /** Specifies the width of the narrow bars in the barcode. The dark bars in the one dimensional barcode contains random narrow and wide bars based on the provided input which can be specified during initialization. + /** Specifies the width of the narrow bars in the barcode. The dark bars in the one dimensional barcode contains random narrow and wide bars based on + * the provided input which can be specified during initialization. */ narrowBarWidth?: number; - /** Specifies the width of the quiet zone. In barcode, a quiet zone is the blank margin on either side of a barcode which informs the reader where a barcode's symbology starts and stops. The purpose of a quiet zone is to prevent the reader from picking up unrelated information. + /** Specifies the width of the quiet zone. In barcode, a quiet zone is the blank margin on either side of a barcode which informs the reader where a barcode's symbology starts and stops. + * The purpose of a quiet zone is to prevent the reader from picking up unrelated information. */ quietZone?: QuietZone; From cbfce02564e54cbc0d6ad6f0c9d7af2a0b11e576 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Thu, 2 Mar 2017 17:49:16 +0530 Subject: [PATCH 258/797] Jquery reference issue fixed. --- ej.web.all/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 2e8d6b8073..84c10b413d 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for ej.web.all 15.1 +// Type definitions for ej.web.all 15.1 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// /*! * filename: ej.web.all.d.ts From 3b966eab2f724ca7932b4d81b18940aa2c79eae2 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Thu, 2 Mar 2017 17:53:20 +0530 Subject: [PATCH 259/797] encoding issue fixed --- ej.web.all/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 84c10b413d..de61643bd8 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ej.web.all 15.1 +// Type definitions for ej.web.all 15.1 // Project: http://help.syncfusion.com/js/typescript // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 99b3bb86af7905f1028b037e449c4c2258441f97 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Thu, 2 Mar 2017 18:13:38 +0530 Subject: [PATCH 260/797] lint errors resolved --- ej.web.all/index.d.ts | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index de61643bd8..356eb6af40 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// /*! * filename: ej.web.all.d.ts @@ -4670,7 +4670,8 @@ export interface Model { */ contextMenuSettings?: ContextMenuSettings; - /** Sets the root class for FileExplorer theme. This cssClass API allows to use custom skinning option for File Explorer control. By defining the root class by using this API, you have to include this root class in CSS. + /** Sets the root class for FileExplorer theme. This cssClass API allows to use custom skinning option for File Explorer control. + * By defining the root class by using this API, you have to include this root class in CSS. */ cssClass?: string; @@ -15612,11 +15613,14 @@ export interface Model { tableRows?: number; /** Sets the tools in the RTE and gets the inner display order of the corresponding group element. Tools are dependent on the toolsList property. - * @Default {formatStyle: [format],style: [bold, italic, underline, strikethrough],alignment: [justifyLeft, justifyCenter, justifyRight, justifyFull],lists: [unorderedList, orderedList],indenting: [outdent, indent],doAction: [undo, redo],links: [createLink,removeLink],images: [image],media: [video],tables: [createTable, addRowAbove, addRowBelow, addColumnLeft, addColumnRight, deleteRow, deleteColumn, deleteTable]],view:[“fullScreenâ€Â,zoomIn,zoomOut],print:[print]} + * @Default {formatStyle: [format],style: [bold, italic, underline, strikethrough],alignment: [justifyLeft, justifyCenter, justifyRight, justifyFull],lists: [unorderedList, orderedList], + * indenting: [outdent, indent],doAction: [undo, redo],links: [createLink,removeLink],images: [image],media: [video],tables: [createTable, addRowAbove, addRowBelow, + * addColumnLeft, addColumnRight, deleteRow, deleteColumn, deleteTable]],view:[“fullScreenâ€Â,zoomIn,zoomOut],print:[print]} */ tools?: Tools; - /** Specifies the list of groups and order of those groups displayed in the RTE toolbar. The toolsList property is used to get the root group order and tools property is used to get the inner order of the corresponding groups displayed. When the value is not specified, it gets its default display order and tools. + /** Specifies the list of groups and order of those groups displayed in the RTE toolbar. The toolsList property is used to get the root group order and tools property is used to get the + * inner order of the corresponding groups displayed. When the value is not specified, it gets its default display order and tools. * @Default {[formatStyle, font, style, effects, alignment, lists, indenting, clipboard, doAction, clear, links, images, media, tables, casing,view, customTools,print,edit]} */ toolsList?: any[]; @@ -34810,7 +34814,8 @@ export interface Model { */ showColumnOptions?: boolean; - /** Controls the visibility of the menu button, which is displayed on the column header. Clicking on this button will show a popup menu. When you choose Columns item from this popup, a list box with column names will be shown, from which you can select/deselect a column name to control the visibility of the respective columns. + /** Controls the visibility of the menu button, which is displayed on the column header. Clicking on this button will show a popup menu. When you choose Columns item from this popup, + * a list box with column names will be shown, from which you can select/deselect a column name to control the visibility of the respective columns. * @Default {false} */ showColumnChooser?: boolean; @@ -51124,7 +51129,8 @@ export interface AxesStripLine { */ width?: number; - /** Specifies the order where the strip line and the series have to be rendered. When Z-order is “behindâ€Â, strip line is rendered under the series and when it is “overâ€Â, it is rendered above the series. + /** Specifies the order where the strip line and the series have to be rendered. When Z-order is “behindâ€Â, strip line is rendered under the series and when it is “overâ€Â, + * it is rendered above the series. * @Default {over. See ZIndex} */ zIndex?: ej.datavisualization.Chart.ZIndex|string; @@ -51218,7 +51224,8 @@ export interface Axis { */ alternateGridBand?: AxesAlternateGridBand; - /** Specifies where axis should intersect the vertical axis or vice versa. Value should be provided in axis co-ordinates. If provided value is greater than the maximum value of crossing axis, then axis will be placed at the opposite side. + /** Specifies where axis should intersect the vertical axis or vice versa. Value should be provided in axis co-ordinates. If provided value is greater than the maximum value of crossing axis, + * then axis will be placed at the opposite side. * @Default {null} */ crossesAt?: number; From 52031f3484ee170fcd343fa90a7684855fb6844c Mon Sep 17 00:00:00 2001 From: Lauri Koskela Date: Thu, 2 Mar 2017 18:02:52 +0200 Subject: [PATCH 261/797] Update time scale options - add `minUnit` option - change `round` option to only accept TimeUnits - remove deprecated `format` option --- chart.js/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chart.js/index.d.ts b/chart.js/index.d.ts index 08781f4463..206be68c92 100644 --- a/chart.js/index.d.ts +++ b/chart.js/index.d.ts @@ -410,16 +410,16 @@ declare namespace Chart { } export interface TimeScale extends ChartScales { - format?: string; displayFormats?: TimeDisplayFormat; isoWeekday?: boolean; max?: string; min?: string; parser?: string | ((arg: any) => any); - round?: string; + round?: TimeUnit; tooltipFormat?: string; unit?: TimeUnit; unitStepSize?: number; + minUnit?: TimeUnit; } export interface RadialLinearScale { From 580fac6fb407cad0cade4f30d19b04d05e5629eb Mon Sep 17 00:00:00 2001 From: mtgto Date: Fri, 3 Mar 2017 06:57:46 +0900 Subject: [PATCH 262/797] [soap] Fix test code. --- soap/soap-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soap/soap-tests.ts b/soap/soap-tests.ts index abd16b4a5a..0ce95cf585 100644 --- a/soap/soap-tests.ts +++ b/soap/soap-tests.ts @@ -4,7 +4,7 @@ import * as fs from "fs"; import * as http from "http"; const url = 'http://example.com/wsdl?wsdl'; -const wsdlOptions = { name: 'value', httpRequest: new soap.HttpClient() }; +const wsdlOptions = { name: 'value', httpClient: new soap.HttpClient() }; soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) { let securityOptions = { hasTimeStamp: false }; From 3bd5205de9d922fdcacefab63d41fa90050388a6 Mon Sep 17 00:00:00 2001 From: efokschaner Date: Thu, 2 Mar 2017 20:58:59 -0800 Subject: [PATCH 263/797] three: noImplicitAny remaining fixes --- three/test/canvas/canvas_geometry_cube.ts | 12 +++---- .../canvas/canvas_interactive_cubes_tween.ts | 12 +++---- .../test/canvas/canvas_lights_pointlights.ts | 2 +- three/test/canvas/canvas_materials.ts | 10 +++--- three/test/canvas/canvas_particles_floor.ts | 6 ++-- three/test/css3d/css3d_periodictable.ts | 21 ++++++++---- three/test/css3d/css3d_sprites.ts | 8 ++--- three/test/math/test_unit_math.ts | 34 ++++++------------- three/test/webgl/webgl_animation_cloth.ts | 4 +-- .../webgl/webgl_animation_skinning_morph.ts | 6 ++-- three/test/webgl/webgl_camera.ts | 4 +-- three/test/webgl/webgl_custom_attributes.ts | 4 +-- three/test/webgl/webgl_interactive_cubes.ts | 2 +- .../webgl_interactive_raycasting_points.ts | 24 +++++-------- three/test/webgl/webgl_lensflares.ts | 6 ++-- three/test/webgl/webgl_lights_hemisphere.ts | 4 +-- three/test/webgl/webgl_lines_colors.ts | 6 ++-- three/test/webgl/webgl_loader_awd.ts | 22 ++++++------ three/test/webgl/webgl_materials.ts | 12 ++++--- three/test/webgl/webgl_morphtargets.ts | 2 +- three/test/webgl/webgl_points_billboards.ts | 6 ++-- three/test/webgl/webgl_sprites.ts | 2 +- three/three-canvasrenderer.d.ts | 4 +-- 23 files changed, 101 insertions(+), 112 deletions(-) diff --git a/three/test/canvas/canvas_geometry_cube.ts b/three/test/canvas/canvas_geometry_cube.ts index 08fac74392..46f26b10c5 100644 --- a/three/test/canvas/canvas_geometry_cube.ts +++ b/three/test/canvas/canvas_geometry_cube.ts @@ -104,7 +104,7 @@ // - function onDocumentMouseDown(event) { + function onDocumentMouseDown(event: MouseEvent) { event.preventDefault(); @@ -117,7 +117,7 @@ } - function onDocumentMouseMove(event) { + function onDocumentMouseMove(event: MouseEvent) { mouseX = event.clientX - windowHalfX; @@ -125,7 +125,7 @@ } - function onDocumentMouseUp(event) { + function onDocumentMouseUp(event: MouseEvent) { document.removeEventListener('mousemove', onDocumentMouseMove, false); document.removeEventListener('mouseup', onDocumentMouseUp, false); @@ -133,7 +133,7 @@ } - function onDocumentMouseOut(event) { + function onDocumentMouseOut(event: MouseEvent) { document.removeEventListener('mousemove', onDocumentMouseMove, false); document.removeEventListener('mouseup', onDocumentMouseUp, false); @@ -141,7 +141,7 @@ } - function onDocumentTouchStart(event) { + function onDocumentTouchStart(event: TouchEvent) { if (event.touches.length === 1) { @@ -154,7 +154,7 @@ } - function onDocumentTouchMove(event) { + function onDocumentTouchMove(event: TouchEvent) { if (event.touches.length === 1) { diff --git a/three/test/canvas/canvas_interactive_cubes_tween.ts b/three/test/canvas/canvas_interactive_cubes_tween.ts index 90ad4fc4b5..6d4cd3fce1 100644 --- a/three/test/canvas/canvas_interactive_cubes_tween.ts +++ b/three/test/canvas/canvas_interactive_cubes_tween.ts @@ -85,17 +85,17 @@ } - function onDocumentTouchStart(event) { + function onDocumentTouchStart(event: TouchEvent) { event.preventDefault(); - - event.clientX = event.touches[0].clientX; - event.clientY = event.touches[0].clientY; - onDocumentMouseDown(event); + let usurpedEvent = event as any; + usurpedEvent.clientX = event.touches[0].clientX; + usurpedEvent.clientY = event.touches[0].clientY; + onDocumentMouseDown(usurpedEvent); } - function onDocumentMouseDown(event) { + function onDocumentMouseDown(event: MouseEvent) { event.preventDefault(); diff --git a/three/test/canvas/canvas_lights_pointlights.ts b/three/test/canvas/canvas_lights_pointlights.ts index 648259b6a0..6c028abcf8 100644 --- a/three/test/canvas/canvas_lights_pointlights.ts +++ b/three/test/canvas/canvas_lights_pointlights.ts @@ -34,7 +34,7 @@ scene.add(light3); var PI2 = Math.PI * 2; - var program = function (context) { + var program = function (context: CanvasRenderingContext2D) { context.beginPath(); context.arc(0, 0, 0.5, 0, PI2, true); diff --git a/three/test/canvas/canvas_materials.ts b/three/test/canvas/canvas_materials.ts index 9b1bff3e45..21ca2b3ee1 100644 --- a/three/test/canvas/canvas_materials.ts +++ b/three/test/canvas/canvas_materials.ts @@ -90,7 +90,7 @@ } var PI2 = Math.PI * 2; - var program = function (context) { + var program = function (context: CanvasRenderingContext2D) { context.beginPath(); context.arc(0, 0, 0.5, 0, PI2, true); @@ -98,9 +98,9 @@ } - // Lights + // Lights - scene.add(new THREE.AmbientLight(Math.random() * 0x202020)); + scene.add(new THREE.AmbientLight(Math.random() * 0x202020)); var directionalLight = new THREE.DirectionalLight(Math.random() * 0xffffff); directionalLight.position.x = Math.random() - 0.5; @@ -154,12 +154,12 @@ } - function loadImage(path) { + function loadImage(path: string) { var image = document.createElement('img'); var texture = new THREE.Texture(image, THREE.UVMapping) - image.onload = function () { texture.needsUpdate = true; }; + image.onload = function () { texture.needsUpdate = true; }; image.src = path; return texture; diff --git a/three/test/canvas/canvas_particles_floor.ts b/three/test/canvas/canvas_particles_floor.ts index 803ba52896..71e121e8d0 100644 --- a/three/test/canvas/canvas_particles_floor.ts +++ b/three/test/canvas/canvas_particles_floor.ts @@ -80,13 +80,13 @@ // - function onDocumentMouseMove(event) { + function onDocumentMouseMove(event: MouseEvent) { mouseX = event.clientX - windowHalfX; mouseY = event.clientY - windowHalfY; } - function onDocumentTouchStart(event) { + function onDocumentTouchStart(event: TouchEvent) { if (event.touches.length > 1) { @@ -97,7 +97,7 @@ } } - function onDocumentTouchMove(event) { + function onDocumentTouchMove(event: TouchEvent) { if (event.touches.length == 1) { diff --git a/three/test/css3d/css3d_periodictable.ts b/three/test/css3d/css3d_periodictable.ts index 4e16fd1208..342455ff48 100644 --- a/three/test/css3d/css3d_periodictable.ts +++ b/three/test/css3d/css3d_periodictable.ts @@ -131,8 +131,15 @@ var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.CSS3DRenderer; var controls: THREE.TrackballControls; - var objects = []; - var targets = { table: [], sphere: [], helix: [], grid: [] }; + var objects: THREE.CSS3DObject[] = []; + class Targets { + constructor() {} + public table: THREE.Object3D[] = []; + public sphere: THREE.Object3D[] = []; + public helix: THREE.Object3D[] = []; + public grid: THREE.Object3D[] = []; + } + let targets = new Targets(); init(); animate(); @@ -262,28 +269,28 @@ controls.addEventListener('change', render); var button = document.getElementById('table'); - button.addEventListener('click', function (event) { + button.addEventListener('click', function (event: MouseEvent) { transform(targets.table, 2000); }, false); var button = document.getElementById('sphere'); - button.addEventListener('click', function (event) { + button.addEventListener('click', function (event: MouseEvent) { transform(targets.sphere, 2000); }, false); var button = document.getElementById('helix'); - button.addEventListener('click', function (event) { + button.addEventListener('click', function (event: MouseEvent) { transform(targets.helix, 2000); }, false); var button = document.getElementById('grid'); - button.addEventListener('click', function (event) { + button.addEventListener('click', function (event: MouseEvent) { transform(targets.grid, 2000); @@ -297,7 +304,7 @@ } - function transform(targets, duration) { + function transform(targets: THREE.Object3D[], duration: number) { TWEEN.removeAll(); diff --git a/three/test/css3d/css3d_sprites.ts b/three/test/css3d/css3d_sprites.ts index 09c9899e62..49177a9453 100644 --- a/three/test/css3d/css3d_sprites.ts +++ b/three/test/css3d/css3d_sprites.ts @@ -12,8 +12,8 @@ var controls: THREE.TrackballControls; var particlesTotal = 512; - var positions = []; - var objects = []; + var positions: number[] = []; + var objects: THREE.CSS3DSprite[] = []; var current = 0; init(); @@ -28,7 +28,7 @@ scene = new THREE.Scene(); var image = document.createElement('img'); - image.addEventListener('load', function (event) { + image.addEventListener('load', function (event: Event) { for (var i = 0; i < particlesTotal; i++) { @@ -36,7 +36,7 @@ object.position.x = Math.random() * 4000 - 2000, object.position.y = Math.random() * 4000 - 2000, object.position.z = Math.random() * 4000 - 2000 - scene.add(object); + scene.add(object); objects.push(object); diff --git a/three/test/math/test_unit_math.ts b/three/test/math/test_unit_math.ts index 91f656b8e5..2c13817782 100644 --- a/three/test/math/test_unit_math.ts +++ b/three/test/math/test_unit_math.ts @@ -524,7 +524,7 @@ declare function equal(a: T, b: T, desc?: string): void; ok( b.clone().union( c ).equals( c ), "Passed!" ); }); - var compareBox = function ( a, b, threshold? ) { + var compareBox = function ( a: THREE.Box3, b: THREE.Box3, threshold?: number ) { threshold = threshold || 0.0001; return ( a.min.distanceTo( b.min ) < threshold && a.max.distanceTo( b.max ) < threshold ); @@ -768,7 +768,7 @@ declare function equal(a: T, b: T, desc?: string): void; var eulerAxyz = new THREE.Euler( 1, 0, 0, "XYZ" ); var eulerAzyx = new THREE.Euler( 0, 1, 0, "ZYX" ); - var matrixEquals4 = function( a, b ) { + var matrixEquals4 = function( a: THREE.Matrix4, b: THREE.Matrix4 ) { var tolerance = 0.0001; if( a.elements.length != b.elements.length ) { return false; @@ -782,14 +782,14 @@ declare function equal(a: T, b: T, desc?: string): void; return true; }; - var eulerEquals = function (a, b, tolerance?: any) { + var eulerEquals = function (a: THREE.Euler, b: THREE.Euler, tolerance?: number) { tolerance = tolerance || 0.0001; var diff = Math.abs(a.x - b.x) + Math.abs(a.y - b.y) + Math.abs(a.z - b.z); return (diff < tolerance); }; - var quatEquals = function (a, b, tolerance?: any) { + var quatEquals = function (a: THREE.Quaternion, b: THREE.Quaternion, tolerance?: number) { tolerance = tolerance || 0.0001; var diff = Math.abs(a.x - b.x) + Math.abs(a.y - b.y) + Math.abs(a.z - b.z) + Math.abs(a.w - b.w); return (diff < tolerance); @@ -843,7 +843,7 @@ declare function equal(a: T, b: T, desc?: string): void; var v2 = new THREE.Euler().setFromQuaternion( q, v.order ); var q2 = new THREE.Quaternion().setFromEuler( v2 ); - ok(eulerEquals(q, q2), "Passed!"); + ok(quatEquals(q, q2), "Passed!"); } }); @@ -899,7 +899,7 @@ declare function equal(a: T, b: T, desc?: string): void; var unit3 = new THREE.Vector3( 1, 0, 0 ); - var planeEquals = function ( a, b, tolerance ) { + var planeEquals = function ( a: THREE.Plane, b: THREE.Plane, tolerance: number ) { tolerance = tolerance || 0.0001; if( a.normal.distanceTo( b.normal ) > tolerance ) { return false; @@ -1116,7 +1116,7 @@ declare function equal(a: T, b: T, desc?: string): void; // -------------------------------------------- Matrix3 - var matrixEquals3 = function( a, b, tolerance? ) { + var matrixEquals3 = function( a: THREE.Matrix, b: THREE.Matrix, tolerance?: number ) { tolerance = tolerance || 0.0001; if( a.elements.length != b.elements.length ) { return false; @@ -1131,7 +1131,7 @@ declare function equal(a: T, b: T, desc?: string): void; }; - var toMatrix4 = function( m3 ) { + var toMatrix4 = function( m3: THREE.Matrix3 ) { var result = new THREE.Matrix4(); var re = result.elements; var me = m3.elements; @@ -1330,20 +1330,6 @@ declare function equal(a: T, b: T, desc?: string): void; // -------------------------------------------- Matrix4 - var matrixEquals4 = function (a, b) { - var tolerance = 0.0001; - if( a.elements.length != b.elements.length ) { - return false; - } - for( var i = 0, il = a.elements.length; i < il; i ++ ) { - var delta = a.elements[i] - b.elements[i]; - if( delta > tolerance ) { - return false; - } - } - return true; - }; - test( "constructor", function() { var a = new THREE.Matrix4(); ok( a.determinant() == 1, "Passed!" ); @@ -1662,7 +1648,7 @@ declare function equal(a: T, b: T, desc?: string): void; // -------------------------------------------- Plane - var comparePlane = function ( a, b, threshold? ) { + var comparePlane = function ( a: THREE.Plane, b: THREE.Plane, threshold?: number ) { threshold = threshold || 0.0001; return ( a.normal.distanceTo( b.normal ) < threshold && Math.abs( a.constant - b.constant ) < threshold ); @@ -1861,7 +1847,7 @@ declare function equal(a: T, b: T, desc?: string): void; - var qSub = function ( a, b ) { + var qSub = function ( a: THREE.Quaternion, b: THREE.Quaternion ) { var result = new THREE.Quaternion(); result.copy( a ); diff --git a/three/test/webgl/webgl_animation_cloth.ts b/three/test/webgl/webgl_animation_cloth.ts index 52e36bb04b..8ea26f6114 100644 --- a/three/test/webgl/webgl_animation_cloth.ts +++ b/three/test/webgl/webgl_animation_cloth.ts @@ -15,8 +15,8 @@ // ------- /* testing cloth simulation */ - var pinsFormation = []; - var pins = [6]; + var pinsFormation: number[][] = []; + var pins: number[] = [6]; pinsFormation.push(pins); diff --git a/three/test/webgl/webgl_animation_skinning_morph.ts b/three/test/webgl/webgl_animation_skinning_morph.ts index 167a98d4d2..df085e9ac4 100644 --- a/three/test/webgl/webgl_animation_skinning_morph.ts +++ b/three/test/webgl/webgl_animation_skinning_morph.ts @@ -107,7 +107,7 @@ var loader = new THREE.JSONLoader(); loader.load( "models/skinned/knight.js", function ( geometry, materials ) { - createScene( geometry, materials, 0, FLOOR, -300, 60 ) + createScene( geometry, materials as THREE.MeshPhongMaterial[], 0, FLOOR, -300, 60 ) } ); @@ -133,7 +133,7 @@ } - function createScene( geometry, materials, x, y, z, s ) { + function createScene( geometry: THREE.Geometry, materials: THREE.MeshPhongMaterial[], x: number, y: number, z: number, s: number ) { //ensureLoop( geometry.animation ); @@ -203,7 +203,7 @@ } - function onDocumentMouseMove( event ) { + function onDocumentMouseMove( event: MouseEvent ) { mouseX = ( event.clientX - windowHalfX ); mouseY = ( event.clientY - windowHalfY ); diff --git a/three/test/webgl/webgl_camera.ts b/three/test/webgl/webgl_camera.ts index 861b7eebb5..66b60a7826 100644 --- a/three/test/webgl/webgl_camera.ts +++ b/three/test/webgl/webgl_camera.ts @@ -128,7 +128,7 @@ // - function onKeyDown ( event ) { + function onKeyDown ( event: KeyboardEvent ) { switch( event.keyCode ) { @@ -152,7 +152,7 @@ // - function onWindowResize( event ) { + function onWindowResize( event: Event ) { SCREEN_WIDTH = window.innerWidth; SCREEN_HEIGHT = window.innerHeight; diff --git a/three/test/webgl/webgl_custom_attributes.ts b/three/test/webgl/webgl_custom_attributes.ts index 884ae43144..89c25e62cf 100644 --- a/three/test/webgl/webgl_custom_attributes.ts +++ b/three/test/webgl/webgl_custom_attributes.ts @@ -45,8 +45,8 @@ var geometry = new THREE.SphereBufferGeometry( radius, segments, rings ); - displacement = new Float32Array( geometry.attributes["position"].count ); - noise = new Float32Array( geometry.attributes["position"].count ); + displacement = new Float32Array( geometry.getAttribute('position').count ); + noise = new Float32Array( geometry.getAttribute('position').count ); for ( var i = 0; i < displacement.length; i ++ ) { diff --git a/three/test/webgl/webgl_interactive_cubes.ts b/three/test/webgl/webgl_interactive_cubes.ts index 9d4c914aab..74493a5285 100644 --- a/three/test/webgl/webgl_interactive_cubes.ts +++ b/three/test/webgl/webgl_interactive_cubes.ts @@ -87,7 +87,7 @@ } - function onDocumentMouseMove(event) { + function onDocumentMouseMove(event: MouseEvent) { event.preventDefault(); diff --git a/three/test/webgl/webgl_interactive_raycasting_points.ts b/three/test/webgl/webgl_interactive_raycasting_points.ts index 089f8cef77..d7b114b8d2 100644 --- a/three/test/webgl/webgl_interactive_raycasting_points.ts +++ b/three/test/webgl/webgl_interactive_raycasting_points.ts @@ -18,7 +18,7 @@ var raycaster: THREE.Raycaster; var mouse = new THREE.Vector2(); var intersection = null; - var spheres = []; + var spheres: THREE.Mesh[] = []; var spheresIndex = 0; var clock: THREE.Clock; @@ -31,7 +31,7 @@ init(); animate(); - function generatePointCloudGeometry(color, width, length) { + function generatePointCloudGeometry(color: THREE.Color, width: number, length: number) { var geometry = new THREE.BufferGeometry(); var numPoints = width * length; @@ -74,7 +74,7 @@ } - function generatePointcloud(color, width, length) { + function generatePointcloud(color: THREE.Color, width: number, length: number) { var geometry = generatePointCloudGeometry(color, width, length); @@ -85,7 +85,7 @@ } - function generateIndexedPointcloud(color, width, length) { + function generateIndexedPointcloud(color: THREE.Color, width: number, length: number) { var geometry = generatePointCloudGeometry(color, width, length); var numPoints = width * length; @@ -113,7 +113,7 @@ } - function generateIndexedWithOffsetPointcloud(color, width, length) { + function generateIndexedWithOffsetPointcloud(color: THREE.Color, width: number, length: number) { var geometry = generatePointCloudGeometry(color, width, length); var numPoints = width * length; @@ -142,11 +142,11 @@ } - function generateRegularPointcloud(color, width, length) { + function generateRegularPointcloud(color: THREE.Color, width: number, length: number) { var geometry = new THREE.Geometry(); - var colors = []; + var colors: THREE.Color[] = []; var k = 0; @@ -160,15 +160,9 @@ var y = ( Math.cos(u * Math.PI * 8) + Math.sin(v * Math.PI * 8) ) / 20; var z = v - 0.5; var v2 = new THREE.Vector3(x, y, z); - - var intensity = ( y + 0.1 ) * 7; - colors[3 * k] = color.r * intensity; - colors[3 * k + 1] = color.g * intensity; - colors[3 * k + 2] = color.b * intensity; - geometry.vertices.push(v2); + var intensity = ( y + 0.1 ) * 7; colors[k] = ( color.clone().multiplyScalar(intensity) ); - k++; } @@ -260,7 +254,7 @@ } - function onDocumentMouseMove(event) { + function onDocumentMouseMove(event: MouseEvent) { event.preventDefault(); diff --git a/three/test/webgl/webgl_lensflares.ts b/three/test/webgl/webgl_lensflares.ts index 2e6be03866..c9b33cf25c 100644 --- a/three/test/webgl/webgl_lensflares.ts +++ b/three/test/webgl/webgl_lensflares.ts @@ -94,7 +94,7 @@ addLight(0.08, 0.8, 0.5, 0, 0, -1000); addLight(0.995, 0.5, 0.9, 5000, 5000, -1000); - function addLight(h, s, l, x, y, z) { + function addLight(h: number, s: number, l: number, x: number, y: number, z: number) { var light = new THREE.PointLight(0xffffff, 1.5, 4500); light.color.setHSL(h, s, l); @@ -148,7 +148,7 @@ // - function lensFlareUpdateCallback(object) { + function lensFlareUpdateCallback(object: THREE.LensFlare) { var f: number, fl = object.lensFlares.length; var flare; @@ -174,7 +174,7 @@ // - function onWindowResize(event) { + function onWindowResize(event: Event) { renderer.setSize(window.innerWidth, window.innerHeight); diff --git a/three/test/webgl/webgl_lights_hemisphere.ts b/three/test/webgl/webgl_lights_hemisphere.ts index 4f96fb9511..46dd9f7157 100644 --- a/three/test/webgl/webgl_lights_hemisphere.ts +++ b/three/test/webgl/webgl_lights_hemisphere.ts @@ -11,7 +11,7 @@ if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer, dirLight: THREE.DirectionalLight, hemiLight: THREE.HemisphereLight; - var mixers = []; + var mixers: THREE.AnimationMixer[] = []; var stats: Stats; var clock = new THREE.Clock(); @@ -169,7 +169,7 @@ } - function onKeyDown ( event ) { + function onKeyDown ( event: KeyboardEvent ) { switch ( event.keyCode ) { diff --git a/three/test/webgl/webgl_lines_colors.ts b/three/test/webgl/webgl_lines_colors.ts index 04fc10b618..a372a19e77 100644 --- a/three/test/webgl/webgl_lines_colors.ts +++ b/three/test/webgl/webgl_lines_colors.ts @@ -146,14 +146,14 @@ // - function onDocumentMouseMove(event) { + function onDocumentMouseMove(event: MouseEvent) { mouseX = event.clientX - windowHalfX; mouseY = event.clientY - windowHalfY; } - function onDocumentTouchStart(event) { + function onDocumentTouchStart(event: TouchEvent) { if (event.touches.length > 1) { @@ -166,7 +166,7 @@ } - function onDocumentTouchMove(event) { + function onDocumentTouchMove(event: TouchEvent) { if (event.touches.length == 1) { diff --git a/three/test/webgl/webgl_loader_awd.ts b/three/test/webgl/webgl_loader_awd.ts index 5407ae4360..0273af14dd 100644 --- a/three/test/webgl/webgl_loader_awd.ts +++ b/three/test/webgl/webgl_loader_awd.ts @@ -14,12 +14,12 @@ var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer, objects, controls: THREE.OrbitControls; var particleLight, pointLight: THREE.PointLight; - var trunk; + var trunk: THREE.Object3D; var loader = new THREE.AWDLoader(); loader.materialFactory = createMaterial; - loader.load('./models/awd/simple/simple.awd', function (_trunk) { + loader.load('./models/awd/simple/simple.awd', function (_trunk: THREE.Object3D) { trunk = _trunk; @@ -29,15 +29,13 @@ }); - function createMaterial(name) { - // console.log( name ); - // var mat = new THREE.MeshPhongMaterial({ - // color: 0xaaaaaa, - // shininess: 20 - - // }); - // return mat; - return null; + function createMaterial(name: string) { + console.log( name ); + var mat = new THREE.MeshPhongMaterial({ + color: 0xaaaaaa, + shininess: 20 + }); + return mat; } @@ -106,7 +104,7 @@ pointLight.position.x = Math.sin(timer * 4) * 3000; pointLight.position.y = 600 - pointLight.position.z = Math.cos(timer * 4) * 3000; + pointLight.position.z = Math.cos(timer * 4) * 3000; renderer.render(scene, camera); diff --git a/three/test/webgl/webgl_materials.ts b/three/test/webgl/webgl_materials.ts index 409bfa5eda..5a3538b17d 100644 --- a/three/test/webgl/webgl_materials.ts +++ b/three/test/webgl/webgl_materials.ts @@ -13,8 +13,12 @@ var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer, objects: THREE.Mesh[]; var particleLight: THREE.Mesh; - - var materials = []; + var materials: ( THREE.MeshBasicMaterial | + THREE.MeshPhongMaterial | + THREE.MeshNormalMaterial | + THREE.MeshLambertMaterial | + THREE.MeshFaceMaterial | + THREE.MeshDepthMaterial ) [] = []; init(); animate(); @@ -224,8 +228,8 @@ } - materials[materials.length - 3].emissive.setHSL(0.54, 1, 0.35 * (0.5 + 0.5 * Math.sin(35 * timer))); - materials[materials.length - 4].emissive.setHSL(0.04, 1, 0.35 * (0.5 + 0.5 * Math.cos(35 * timer))); + (materials[materials.length - 3] as THREE.MeshPhongMaterial).emissive.setHSL(0.54, 1, 0.35 * (0.5 + 0.5 * Math.sin(35 * timer))); + (materials[materials.length - 4] as THREE.MeshLambertMaterial).emissive.setHSL(0.04, 1, 0.35 * (0.5 + 0.5 * Math.cos(35 * timer))); particleLight.position.x = Math.sin(timer * 7) * 300; particleLight.position.y = Math.cos(timer * 5) * 400; diff --git a/three/test/webgl/webgl_morphtargets.ts b/three/test/webgl/webgl_morphtargets.ts index 7eb641d816..a76d4378d3 100644 --- a/three/test/webgl/webgl_morphtargets.ts +++ b/three/test/webgl/webgl_morphtargets.ts @@ -100,7 +100,7 @@ } - function onDocumentMouseMove(event) { + function onDocumentMouseMove(event: MouseEvent) { mouseX = (event.clientX - windowHalfX); mouseY = (event.clientY - windowHalfY) * 2; diff --git a/three/test/webgl/webgl_points_billboards.ts b/three/test/webgl/webgl_points_billboards.ts index 4ab898462a..c2a939456a 100644 --- a/three/test/webgl/webgl_points_billboards.ts +++ b/three/test/webgl/webgl_points_billboards.ts @@ -86,14 +86,14 @@ } - function onDocumentMouseMove( event ) { + function onDocumentMouseMove( event: MouseEvent ) { mouseX = event.clientX - windowHalfX; mouseY = event.clientY - windowHalfY; } - function onDocumentTouchStart( event ) { + function onDocumentTouchStart( event: TouchEvent ) { if ( event.touches.length == 1 ) { @@ -105,7 +105,7 @@ } } - function onDocumentTouchMove( event ) { + function onDocumentTouchMove( event: TouchEvent ) { if ( event.touches.length == 1 ) { diff --git a/three/test/webgl/webgl_sprites.ts b/three/test/webgl/webgl_sprites.ts index 5d5c6162d2..8e71285fac 100644 --- a/three/test/webgl/webgl_sprites.ts +++ b/three/test/webgl/webgl_sprites.ts @@ -96,7 +96,7 @@ } - function createHUDSprites ( texture ) { + function createHUDSprites ( texture: THREE.Texture ) { var material = new THREE.SpriteMaterial( { map: texture } ); diff --git a/three/three-canvasrenderer.d.ts b/three/three-canvasrenderer.d.ts index c37f223c56..3560963a47 100644 --- a/three/three-canvasrenderer.d.ts +++ b/three/three-canvasrenderer.d.ts @@ -6,7 +6,7 @@ declare namespace THREE { export interface SpriteCanvasMaterialParameters extends MaterialParameters { color?: number; - program?: (context: any, color: Color) => void; + program?: (context: CanvasRenderingContext2D, color: Color) => void; } export class SpriteCanvasMaterial extends Material { @@ -14,7 +14,7 @@ declare namespace THREE { color: Color; - program(context: any, color: Color): void; + program(context: CanvasRenderingContext2D, color: Color): void; } export interface CanvasRendererParameters { From 3b0875ba2fa8d2c87758c09f9419cff8c7d84ea7 Mon Sep 17 00:00:00 2001 From: efokschaner Date: Thu, 2 Mar 2017 21:20:24 -0800 Subject: [PATCH 264/797] Bump three defs version --- three/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/three/index.d.ts b/three/index.d.ts index 0f505620b3..5d49fdffde 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for three.js 0.83 +// Type definitions for three.js 0.84 // Project: http://mrdoob.github.com/three.js/ // Definitions by: Kon , Satoru Kimura , Florent Poujol , SereznoKot , HouChunlei // Definitions: https://github.com/borisyankov/DefinitelyTyped From a75a5c9386efb1398dff11432587f42364265d10 Mon Sep 17 00:00:00 2001 From: efokschaner Date: Thu, 2 Mar 2017 22:12:52 -0800 Subject: [PATCH 265/797] Fixes for TS version 2.0 --- three/test/webgl/webgl_animation_cloth.ts | 2 +- three/test/webgl/webgl_geometries.ts | 2 +- .../test/webgl/webgl_interactive_raycasting_points.ts | 2 +- three/test/webgl/webgl_lensflares.ts | 8 +++----- three/test/webgl/webgl_lines_colors.ts | 4 +++- three/test/webgl/webgl_loader_awd.ts | 4 ++-- three/test/webgl/webgl_materials.ts | 4 ++-- three/test/webgl/webgl_morphtargets.ts | 6 ++---- three/test/webgl/webgl_points_billboards.ts | 11 ++++++++++- 9 files changed, 25 insertions(+), 18 deletions(-) diff --git a/three/test/webgl/webgl_animation_cloth.ts b/three/test/webgl/webgl_animation_cloth.ts index 8ea26f6114..fff733c9c0 100644 --- a/three/test/webgl/webgl_animation_cloth.ts +++ b/three/test/webgl/webgl_animation_cloth.ts @@ -52,7 +52,7 @@ var sphere: THREE.Mesh; var object: THREE.Mesh; var arrow: THREE.ArrowHelper; - var light: THREE.DirectionalLight, materials; + var light: THREE.DirectionalLight; var rotate = true; init(); diff --git a/three/test/webgl/webgl_geometries.ts b/three/test/webgl/webgl_geometries.ts index efa16e108d..9b23dcfa1f 100644 --- a/three/test/webgl/webgl_geometries.ts +++ b/three/test/webgl/webgl_geometries.ts @@ -79,7 +79,7 @@ // - var points = []; + var points: THREE.Vector3[] = []; for (var i = 0; i < 50; i++) { diff --git a/three/test/webgl/webgl_interactive_raycasting_points.ts b/three/test/webgl/webgl_interactive_raycasting_points.ts index d7b114b8d2..6fdb24b6cc 100644 --- a/three/test/webgl/webgl_interactive_raycasting_points.ts +++ b/three/test/webgl/webgl_interactive_raycasting_points.ts @@ -17,7 +17,7 @@ var pointclouds: THREE.Points[]; var raycaster: THREE.Raycaster; var mouse = new THREE.Vector2(); - var intersection = null; + var intersection: THREE.Intersection | null = null; var spheres: THREE.Mesh[] = []; var spheresIndex = 0; var clock: THREE.Clock; diff --git a/three/test/webgl/webgl_lensflares.ts b/three/test/webgl/webgl_lensflares.ts index c9b33cf25c..1d100507a0 100644 --- a/three/test/webgl/webgl_lensflares.ts +++ b/three/test/webgl/webgl_lensflares.ts @@ -14,8 +14,6 @@ var clock = new THREE.Clock(); - var composer; - init(); animate(); @@ -37,9 +35,9 @@ controls.autoForward = false; controls.dragToLook = false - // scene + // scene - scene = new THREE.Scene(); + scene = new THREE.Scene(); scene.fog = new THREE.Fog(0x000000, 3500, 15000); scene.fog.color.setHSL(0.51, 0.4, 0.01); @@ -151,7 +149,7 @@ function lensFlareUpdateCallback(object: THREE.LensFlare) { var f: number, fl = object.lensFlares.length; - var flare; + var flare: THREE.LensFlareProperty; var vecX = -object.positionScreen.x * 2; var vecY = -object.positionScreen.y * 2; diff --git a/three/test/webgl/webgl_lines_colors.ts b/three/test/webgl/webgl_lines_colors.ts index a372a19e77..6b359b2d65 100644 --- a/three/test/webgl/webgl_lines_colors.ts +++ b/three/test/webgl/webgl_lines_colors.ts @@ -46,7 +46,9 @@ geometry2 = new THREE.Geometry(), geometry3 = new THREE.Geometry(), points = hilbert3D(new THREE.Vector3(0, 0, 0), 200.0, 2, 0, 1, 2, 3, 4, 5, 6, 7), - colors = [], colors2 = [], colors3 = []; + colors: THREE.Color[] = [], + colors2: THREE.Color[] = [], + colors3: THREE.Color[] = []; for (i = 0; i < points.length; i++) { diff --git a/three/test/webgl/webgl_loader_awd.ts b/three/test/webgl/webgl_loader_awd.ts index 0273af14dd..01f21a985e 100644 --- a/three/test/webgl/webgl_loader_awd.ts +++ b/three/test/webgl/webgl_loader_awd.ts @@ -12,8 +12,8 @@ var container: HTMLDivElement, stats: Stats; - var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer, objects, controls: THREE.OrbitControls; - var particleLight, pointLight: THREE.PointLight; + var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer, controls: THREE.OrbitControls; + var pointLight: THREE.PointLight; var trunk: THREE.Object3D; var loader = new THREE.AWDLoader(); diff --git a/three/test/webgl/webgl_materials.ts b/three/test/webgl/webgl_materials.ts index 5a3538b17d..f60da797ce 100644 --- a/three/test/webgl/webgl_materials.ts +++ b/three/test/webgl/webgl_materials.ts @@ -96,11 +96,11 @@ objects = []; - var sphere: THREE.Mesh, geometry: THREE.Geometry, material; + var sphere: THREE.Mesh, geometry: THREE.Geometry; for (var i = 0, l = materials.length; i < l; i++) { - material = materials[i]; + let material = materials[i]; geometry = material instanceof THREE.MeshFaceMaterial ? geometry_pieces : (material.shading == THREE.FlatShading ? geometry_flat : geometry_smooth); diff --git a/three/test/webgl/webgl_morphtargets.ts b/three/test/webgl/webgl_morphtargets.ts index a76d4378d3..5368dccb91 100644 --- a/three/test/webgl/webgl_morphtargets.ts +++ b/three/test/webgl/webgl_morphtargets.ts @@ -6,12 +6,10 @@ () => { if (!Detector.webgl) Detector.addGetWebGLMessage(); - var container: HTMLDivElement, stats; + var container: HTMLDivElement; var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer; - var geometry, objects; - var mouseX = 0, mouseY = 0; var mesh: THREE.Mesh; @@ -49,7 +47,7 @@ for (var i = 0; i < geometry.vertices.length; i++) { - var vertices = []; + var vertices: THREE.Vector3[] = []; for (var v = 0; v < geometry.vertices.length; v++) { diff --git a/three/test/webgl/webgl_points_billboards.ts b/three/test/webgl/webgl_points_billboards.ts index c2a939456a..11aa04270b 100644 --- a/three/test/webgl/webgl_points_billboards.ts +++ b/three/test/webgl/webgl_points_billboards.ts @@ -7,7 +7,16 @@ if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); var container: HTMLDivElement, stats: Stats; - var camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer, particles: THREE.Points, geometry: THREE.Geometry, material: THREE.PointsMaterial, i: number, h: number, color, sprite: THREE.Texture, size; + var camera: THREE.PerspectiveCamera, + scene: THREE.Scene, + renderer: THREE.WebGLRenderer, + particles: THREE.Points, + geometry: THREE.Geometry, + material: THREE.PointsMaterial, + i: number, + h: number, + color: THREE.Color, + sprite: THREE.Texture; var mouseX = 0, mouseY = 0; var windowHalfX = window.innerWidth / 2; From 35b7fd0b7f32e052c01975dece6efc03510432e3 Mon Sep 17 00:00:00 2001 From: "Rodrigo F. Fernandes" Date: Thu, 2 Mar 2017 23:25:07 -0300 Subject: [PATCH 266/797] Added typings for 'node-powershell' --- node-powershell/index.d.ts | 92 ++++++++++++++++++++++++ node-powershell/node-powershell-tests.ts | 34 +++++++++ node-powershell/tsconfig.json | 22 ++++++ 3 files changed, 148 insertions(+) create mode 100644 node-powershell/index.d.ts create mode 100644 node-powershell/node-powershell-tests.ts create mode 100644 node-powershell/tsconfig.json diff --git a/node-powershell/index.d.ts b/node-powershell/index.d.ts new file mode 100644 index 0000000000..bdddd1a448 --- /dev/null +++ b/node-powershell/index.d.ts @@ -0,0 +1,92 @@ +// Type definitions for node-powershell v3.1.1 +// Project: https://github.com/rannn505/node-powershell +// Definitions by: Rodrigo F. Fernandes +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module 'node-powershell' { + module NodePowershell { + export interface ShellOptions { + /** + * Determines whether to log verbose to the console. + */ + debugMsg?: boolean; + + /** + * Sets the input encoding for the current shell. + */ + inputEncoding?: string; + + /** + * Sets the output encoding for the current shell. + */ + outputEncoding?: string; + + /** + * Sets the default execution policy for the current shell session + */ + executionPolicy?: string; + + /** + * Determines whether to load the Windows PS profile + */ + noProfile?: boolean; + } + + export interface ShellStream { + stdin: NodeJS.WritableStream; + stdout: NodeJS.ReadableStream; + err: NodeJS.ReadableStream; + } + } + + class NodePowershell { + /** + * An array containing the command history ever added to the shell instance. + */ + public history: string[]; + + /** + * An object containing the sdtio (in,out,err) [stream.Readable] of the PowerShell Instance. + */ + public streams: NodePowershell.ShellStream; + + /** + * Creates a new Shell instance. + */ + constructor(options: NodePowershell.ShellOptions); + + /** + * Adds a command to the end of the pipeline of the shell object. + * @param {string} required - PowerShell command - PowerShell script + * @param {array} optional - {name: ‘’, value: ‘’} - {name: value} - ‘switch’ + * @returns Every command currently in the pipeline. + */ + addCommand(command: string, params?: string[] | { [key: string]: string }[]): Promise; + + /** + * Runs the commands of the shell object pipeline. + * @returns Promise with the command output. + */ + invoke(): Promise; + + /** + * Releases all resources used by the shell object and closes the PowerShell child_process. + * @returns Promise with the error message. + */ + dispose(): Promise; + + /** + * Listens to events emitted from the shell. + * @param eventName required - Possible events: + * 'output' - Emits when shell has an output. + * 'err' - Emits when shell has an error. + * 'end' - Emits when shell ends. + * @param callback required - Callback function to be called when the event emits. + */ + on(eventName: string, callback: (output: string) => void): void; + } + + export = NodePowershell; +} diff --git a/node-powershell/node-powershell-tests.ts b/node-powershell/node-powershell-tests.ts new file mode 100644 index 0000000000..e1b28e4b92 --- /dev/null +++ b/node-powershell/node-powershell-tests.ts @@ -0,0 +1,34 @@ +import * as nodePowershell from 'node-powershell'; + +var options: nodePowershell.ShellOptions = { + debugMsg: true +}; + +// Initialization +var ps = new nodePowershell(options); + +// Methods +ps.addCommand('Write-Host node-powershell', [ + { name: 'foregroundcolor', value: 'red' }, + { name: 'nonewline', value: null } //switch +]).then((cmdsArr: string[]) => { }).catch((err: any) => { }); + +ps.addCommand('Write-Host node-powershell', [ + { foregroundcolor: 'red' }, + { nonewline: null } //switch +]); + +ps.invoke().then((output: string) => { }).catch((err: any) => { }); + +ps.dispose().then((code: string) => { }).catch((err: any) => { }); + +// Properties +console.log(ps.history); + +ps.streams.stdin.write('data'); +ps.streams.stdout.on('data', (data: any) => { }); + +// Events +ps.on('output', (data: string) => { }); +ps.on('err', (err: string) => { }); +ps.on('end', (code: string) => { }); diff --git a/node-powershell/tsconfig.json b/node-powershell/tsconfig.json new file mode 100644 index 0000000000..c8ca0fed82 --- /dev/null +++ b/node-powershell/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "node-powershell-tests.ts" + ] +} From b6701c86cfd0b35587ca3c417d1b669d562992bd Mon Sep 17 00:00:00 2001 From: "Rodrigo F. Fernandes" Date: Fri, 3 Mar 2017 09:50:37 -0300 Subject: [PATCH 267/797] Updated tsconfig.json Changed strictNullCheck to true --- node-powershell/node-powershell-tests.ts | 5 ++--- node-powershell/tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/node-powershell/node-powershell-tests.ts b/node-powershell/node-powershell-tests.ts index e1b28e4b92..a60f9db331 100644 --- a/node-powershell/node-powershell-tests.ts +++ b/node-powershell/node-powershell-tests.ts @@ -10,12 +10,11 @@ var ps = new nodePowershell(options); // Methods ps.addCommand('Write-Host node-powershell', [ { name: 'foregroundcolor', value: 'red' }, - { name: 'nonewline', value: null } //switch + { name: 'nonewline' } //switch ]).then((cmdsArr: string[]) => { }).catch((err: any) => { }); ps.addCommand('Write-Host node-powershell', [ - { foregroundcolor: 'red' }, - { nonewline: null } //switch + { foregroundcolor: 'red' } ]); ps.invoke().then((output: string) => { }).catch((err: any) => { }); diff --git a/node-powershell/tsconfig.json b/node-powershell/tsconfig.json index c8ca0fed82..6cd3607f4f 100644 --- a/node-powershell/tsconfig.json +++ b/node-powershell/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" From 9d25b0419d9595cbe88b05f52ea89c824bffe053 Mon Sep 17 00:00:00 2001 From: David Asmuth Date: Fri, 3 Mar 2017 13:57:56 +0100 Subject: [PATCH 268/797] three update r84 #10393: BinaryTextureLoader deprecated in favour of DataTextureLoader #10393 --- three/index.d.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/three/index.d.ts b/three/index.d.ts index 7b76100c17..bc77b24045 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 , David Asmuth // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -2161,14 +2161,18 @@ declare namespace THREE { setPath(path: string): CubeTextureLoader; } - export class BinaryTextureLoader { + export class DataTextureLoader { constructor(manager?: LoadingManager); manager: LoadingManager; load(url: string, onLoad: (dataTexture: DataTexture) => void, onProgress?: (event: ProgressEvent) => void, onError?: (event: ErrorEvent) => void): void; } - export class DataTextureLoader extends BinaryTextureLoader {} + + /** + * @deprecated since 0.84.0. Use DataTextureLoader (renamed) + */ + export class BinaryTextureLoader extends DataTextureLoader {} export class CompressedTextureLoader { constructor(manager?: LoadingManager); From f67572a862b24b08644e725adda4b972c18286c7 Mon Sep 17 00:00:00 2001 From: David Asmuth Date: Fri, 3 Mar 2017 14:03:07 +0100 Subject: [PATCH 269/797] three update to r84 #10474: Box3 added expandByObject(). #10474 --- three/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/three/index.d.ts b/three/index.d.ts index bc77b24045..153dff8ae9 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -2851,6 +2851,7 @@ declare namespace THREE { expandByPoint(point: Vector3): Box3; expandByVector(vector: Vector3): Box3; expandByScalar(scalar: number): Box3; + expandByObject(object: Object3D): Box3; containsPoint(point: Vector3): boolean; containsBox(box: Box3): boolean; getParameter(point: Vector3): Vector3; From 5a592b859577df5a8324806be7e9460f48999c3b Mon Sep 17 00:00:00 2001 From: David Asmuth Date: Fri, 3 Mar 2017 14:12:19 +0100 Subject: [PATCH 270/797] three update to r84 c8265b9: Curve deprecated create(). c8265b9 --- three/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/three/index.d.ts b/three/index.d.ts index 153dff8ae9..f205e51f90 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -5953,6 +5953,9 @@ declare namespace THREE { */ getTangentAt(u: number): T; + /** + * @deprecated since r84. + */ static create(constructorFunc: Function, getPointFunc: Function): Function; } From 2257d472b8bac74d34aaff84919630629c1d67ea Mon Sep 17 00:00:00 2001 From: David Asmuth Date: Fri, 3 Mar 2017 16:09:22 +0100 Subject: [PATCH 271/797] three update to r84 fe98988: CurveUtils removed. fe98988 --- three/index.d.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/three/index.d.ts b/three/index.d.ts index f205e51f90..361f4d786c 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -5766,12 +5766,6 @@ declare namespace THREE { } // Extras ///////////////////////////////////////////////////////////////////// - export namespace CurveUtils { - export function tangentQuadraticBezier(t: number, p0: number, p1: number, p2: number): number; - export function tangentCubicBezier(t: number, p0: number, p1: number, p2: number, p3: number): number; - export function tangentSpline(t: number, p0: number, p1: number, p2: number, p3: number): number; - export function interpolate(p0: number, p1: number, p2: number, p3: number, t: number): number; - } export namespace ImageUtils { // deprecated export let crossOrigin: string; From 3b020cdedc0bd2c0559919c5c0044ae71f043211 Mon Sep 17 00:00:00 2001 From: David Asmuth Date: Fri, 3 Mar 2017 16:11:25 +0100 Subject: [PATCH 272/797] three update to r84 #9597: EventDispatcher removed apply(). #9597 --- three/index.d.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/three/index.d.ts b/three/index.d.ts index 361f4d786c..a57f257ccb 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -1027,9 +1027,6 @@ declare namespace THREE { * @param type The type of event that gets fired. */ dispatchEvent(event: { type: string; [attachment: string]: any; }): void; - - // deprecated - apply(target: any): void; } export interface Event { @@ -5785,8 +5782,6 @@ declare namespace THREE { export function triangulate(contour: number[], indices: boolean): number[]; export function triangulateShape(contour: number[], holes: any[]): number[]; export function isClockWise(pts: number[]): boolean; - export function b2(t: number, p0: number, p1: number, p2: number): number; - export function b3(t: number, p0: number, p1: number, p2: number, p3: number): number; } // Extras / Audio ///////////////////////////////////////////////////////////////////// @@ -6041,6 +6036,13 @@ declare namespace THREE { } // Extras / Curves ///////////////////////////////////////////////////////////////////// + export namespace CurveUtils { + export function tangentQuadraticBezier(t: number, p0: number, p1: number, p2: number): number; + export function tangentCubicBezier(t: number, p0: number, p1: number, p2: number, p3: number): number; + export function tangentSpline(t: number, p0: number, p1: number, p2: number, p3: number): number; + export function interpolate(p0: number, p1: number, p2: number, p3: number, t: number): number; + } + export class CatmullRomCurve3 extends Curve { constructor(points?: Vector3[]); From 7c89a027f88211f842fb02dee0d60ae17aefd52f Mon Sep 17 00:00:00 2001 From: David Asmuth Date: Fri, 3 Mar 2017 16:16:42 +0100 Subject: [PATCH 273/797] three update to r84 #10367, #10375: Matrix3 removed applyToVector3Array(). #10367 Matrix4 removed applyToVector3Array(). #10367 Matrix4 changed makeFrustum() to makePerspective(). #10375 --- three/index.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/three/index.d.ts b/three/index.d.ts index a57f257ccb..158810b0ac 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -3345,7 +3345,6 @@ declare namespace THREE { clone(): this; copy(m: this): this; setFromMatrix4(m: Matrix4): Matrix3; - applyToVector3Array(array: ArrayLike, offset?: number, length?: number): ArrayLike; applyToBuffer(buffer: BufferAttribute, offset?: number, length?: number): BufferAttribute; multiplyScalar(s: number): Matrix3; determinant(): number; @@ -3445,7 +3444,6 @@ declare namespace THREE { * Multiplies this matrix by s. */ multiplyScalar(s: number): Matrix4; - applyToVector3Array(array: ArrayLike, offset?: number, length?: number): ArrayLike; applyToBuffer( buffer: BufferAttribute, offset?: number, length?: number): BufferAttribute; /** * Computes determinant of this matrix. @@ -3532,7 +3530,7 @@ declare namespace THREE { /** * Creates a frustum matrix. */ - makeFrustum(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4; + makePerspective(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4; /** * Creates a perspective projection matrix. From 3a74ffa8b1477b921bbcf1b46461c6f0c03d1176 Mon Sep 17 00:00:00 2001 From: David Asmuth Date: Fri, 3 Mar 2017 16:28:28 +0100 Subject: [PATCH 274/797] three update to r84 #10415, #10397 : Spline deprecated in favour of CatmullRomCurve3. #10415 SplineCurve3 deprecated in favour of CatmullRomCurve3. #10397 --- three/index.d.ts | 50 ------------------------------------------------ 1 file changed, 50 deletions(-) diff --git a/three/index.d.ts b/three/index.d.ts index 158810b0ac..352f9e1cdb 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -3771,53 +3771,6 @@ declare namespace THREE { z: number; } - /** - * Represents a spline. - * - * @see src/math/Spline.js - */ - export class Spline { - /** - * Initialises the spline with points, which are the places through which the spline will go. - */ - constructor(points: SplineControlPoint[]); - - points: SplineControlPoint[]; - - /** - * Initialises using the data in the array as a series of points. Each value in a must be another array with three values, where a[n] is v, the value for the nth point, and v[0], v[1] and v[2] are the x, y and z coordinates of that point n, respectively. - * - * @param a array of triplets containing x, y, z coordinates - */ - initFromArray(a: number[][]): void; - - /** - * Return the interpolated point at k. - * - * @param k point index - */ - getPoint(k: number): SplineControlPoint; - - /** - * Returns an array with triplets of x, y, z coordinates that correspond to the current control points. - */ - getControlPointsArray(): number[][]; - - /** - * Returns the length of the spline when using nSubDivisions. - * @param nSubDivisions number of subdivisions between control points. Default is 100. - */ - getLength(nSubDivisions?: number): { chunks: number[]; total: number; }; - - /** - * Modifies the spline so that it looks similar to the original but has its points distributed in such way that moving along the spline it's done at a more or less constant speed. The points should also appear more uniformly spread along the curve. - * This is done by resampling the original spline, with the density of sampling controlled by samplingCoef. Here it's interesting to note that denser sampling is not necessarily better: if sampling is too high, you may get weird kinks in curvature. - * - * @param samplingCoef how many intermediate values to use between spline points - */ - reparametrizeByArcLength(samplingCoef: number): void; - } - class Triangle { constructor(a?: Vector3, b?: Vector3, c?: Vector3); @@ -6049,9 +6002,6 @@ declare namespace THREE { getPoint(t: number): Vector3; } - export class ClosedSplineCurve3 extends CatmullRomCurve3 {} // deprecated, use CatmullRomCurve3 - export class SplineCurve3 extends CatmullRomCurve3 {} // will be deprecated, use CatmullRomCurve3 - export class CubicBezierCurve extends Curve { constructor(v0: Vector2, v1: Vector2, v2: Vector2, v3: Vector2); From 45e57c68f1e4c0d7fb4ab381b8cbe59bd671a0b3 Mon Sep 17 00:00:00 2001 From: David Asmuth Date: Fri, 3 Mar 2017 16:34:00 +0100 Subject: [PATCH 275/797] three update to r84 #10405, #10412: Vector2 renamed fromAttribute() to fromBufferAttribute(). #10412 Vector3 renamed fromAttribute() to fromBufferAttribute(). #10412 Vector3 combined applyProjection() into applyMatrix4(). #10405 Vector4 renamed fromAttribute() to fromBufferAttribute(). #10412 --- three/index.d.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/three/index.d.ts b/three/index.d.ts index 352f9e1cdb..2d742b1053 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -4060,7 +4060,7 @@ declare namespace THREE { toArray(xy?: number[], offset?: number): number[]; - fromAttribute( attribute: BufferAttribute, index: number, offset?: number): Vector2; + fromBufferAttribute( attribute: BufferAttribute, index: number, offset?: number): Vector2; rotateAround( center: Vector2, angle: number ): Vector2; } @@ -4155,7 +4155,6 @@ declare namespace THREE { applyAxisAngle(axis: Vector3, angle: number): Vector3; applyMatrix3(m: Matrix3): Vector3; applyMatrix4(m: Matrix4): Vector3; - applyProjection(m: Matrix4): Vector3; applyQuaternion(q: Quaternion): Vector3; project(camrea: Camera): Vector3; unproject(camera: Camera): Vector3; @@ -4253,7 +4252,7 @@ declare namespace THREE { fromArray(xyz: number[], offset?: number): Vector3; toArray(xyz?: number[], offset?: number): number[]; - fromAttribute( attribute: BufferAttribute, index: number, offset?: number): Vector3; + fromBufferAttribute( attribute: BufferAttribute, index: number, offset?: number): Vector3; // deprecated getPositionFromMatrix(m: Matrix4): Vector3; @@ -4419,7 +4418,7 @@ declare namespace THREE { toArray(xyzw?: number[], offset?: number): number[]; - fromAttribute( attribute: BufferAttribute, index: number, offset?: number): Vector4; + fromBufferAttribute( attribute: BufferAttribute, index: number, offset?: number): Vector4; } export abstract class Interpolant { From cdf6fea21c5b1ab3f4d73a728b98a23fab5ce493 Mon Sep 17 00:00:00 2001 From: David Asmuth Date: Fri, 3 Mar 2017 17:04:03 +0100 Subject: [PATCH 276/797] three update to r84: Updated d.ts version to 0.84.0 --- three/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/three/index.d.ts b/three/index.d.ts index 2d742b1053..60d8fb8752 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for three.js 0.83 +// Type definitions for three.js 0.84 // Project: http://mrdoob.github.com/three.js/ // Definitions by: Kon , Satoru Kimura , Florent Poujol , SereznoKot , HouChunlei , David Asmuth // Definitions: https://github.com/borisyankov/DefinitelyTyped From c8e66a28cf04040e6194953ed24cc7bba03c36a1 Mon Sep 17 00:00:00 2001 From: David Asmuth Date: Fri, 3 Mar 2017 17:17:47 +0100 Subject: [PATCH 277/797] three update to r84: API changes to test_unit_math --- three/test/math/test_unit_math.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/three/test/math/test_unit_math.ts b/three/test/math/test_unit_math.ts index 91f656b8e5..b824aa3f30 100644 --- a/three/test/math/test_unit_math.ts +++ b/three/test/math/test_unit_math.ts @@ -981,7 +981,7 @@ declare function equal(a: T, b: T, desc?: string): void; }); test( "setFromMatrix/makeFrustum/containsPoint", function() { - var m = new THREE.Matrix4().makeFrustum( -1, 1, -1, 1, 1, 100 ) + var m = new THREE.Matrix4().makePerspective( -1, 1, -1, 1, 1, 100 ) var a = new THREE.Frustum().setFromMatrix( m ); ok( ! a.containsPoint( new THREE.Vector3( 0, 0, 0 ) ), "Passed!" ); @@ -1000,7 +1000,7 @@ declare function equal(a: T, b: T, desc?: string): void; }); test( "setFromMatrix/makeFrustum/intersectsSphere", function() { - var m = new THREE.Matrix4().makeFrustum( -1, 1, -1, 1, 1, 100 ) + var m = new THREE.Matrix4().makePerspective( -1, 1, -1, 1, 1, 100 ) var a = new THREE.Frustum().setFromMatrix( m ); ok( ! a.intersectsSphere( new THREE.Sphere( new THREE.Vector3( 0, 0, 0 ), 0 ) ), "Passed!" ); @@ -1514,8 +1514,8 @@ declare function equal(a: T, b: T, desc?: string): void; new THREE.Matrix4().makeRotationZ( -0.3 ), new THREE.Matrix4().makeScale( 1, 2, 3 ), new THREE.Matrix4().makeScale( 1/8, 1/2, 1/3 ), - new THREE.Matrix4().makeFrustum( -1, 1, -1, 1, 1, 1000 ), - new THREE.Matrix4().makeFrustum( -16, 16, -9, 9, 0.1, 10000 ), + new THREE.Matrix4().makePerspective( -1, 1, -1, 1, 1, 1000 ), + new THREE.Matrix4().makePerspective( -16, 16, -9, 9, 0.1, 10000 ), new THREE.Matrix4().makeTranslation( 1, 2, 3 ) ]; From 7ad5ff8bbbbfad9f5d074d1fcc5c711b881d30bd Mon Sep 17 00:00:00 2001 From: Chad Auld Date: Fri, 3 Mar 2017 10:00:42 -0700 Subject: [PATCH 278/797] 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 cf49b406fd132c50a156fff5ad8d47f435e4ef35 Mon Sep 17 00:00:00 2001 From: efokschaner Date: Fri, 3 Mar 2017 11:34:21 -0800 Subject: [PATCH 279/797] three: Revert unneccessary version bump --- three/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/three/index.d.ts b/three/index.d.ts index 5d49fdffde..0f505620b3 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for three.js 0.84 +// Type definitions for three.js 0.83 // Project: http://mrdoob.github.com/three.js/ // Definitions by: Kon , Satoru Kimura , Florent Poujol , SereznoKot , HouChunlei // Definitions: https://github.com/borisyankov/DefinitelyTyped From e2a426db0af2d8cd0aa1eb1be81d3a730ca3cc52 Mon Sep 17 00:00:00 2001 From: mtgto Date: Fri, 3 Mar 2017 20:32:19 +0900 Subject: [PATCH 280/797] [soap] Add type definition for options and HttpClient. --- soap/index.d.ts | 29 ++++++++++++++++++++++++----- soap/soap-tests.ts | 25 +++++++++++++++++++++---- 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/soap/index.d.ts b/soap/index.d.ts index 9fad90c236..eda277d575 100644 --- a/soap/index.d.ts +++ b/soap/index.d.ts @@ -49,12 +49,31 @@ export interface Server extends events.EventEmitter { log(type: any, data: any): any; } export function listen(server: any, path: string, service: any, wsdl: string): Server; -declare function createClient(wsdlPath: string, options: any, fn: (err: any, client: Client) => void): void; +declare function createClient(wsdlPath: string, options: Option, fn: (err: any, client: Client) => void): void; + +export interface Option { + attributesKey?: string; + disableCache?: boolean; + endpoint?: string; + envelopeKey?: string; + escapeXML?: boolean; + forceSoap12Headers?: boolean; + httpClient?: HttpClient; + ignoreBaseNameSpaces?: boolean, + ignoredNamespaces?: string[] | {namespaces: string[], override: boolean}; + overrideRootElement?: {namespace: string, xmlnsAttributes?: string[]}; + request?: (options: any, callback?: (error: any, res: any, body: any) => void) => void; + stream?: boolean; + valueKey?: string; + wsdl_headers?: { [key: string]: any }; + wsdl_options?: { [key: string]: any }; + xmlKey?: string; +} export class HttpClient { - constructor(options?: any); - buildRequest(rurl: string, data: any | string, exheaders?: any, exoptions?: any): any; + constructor(options?: Option); + buildRequest(rurl: string, data: any | string, exheaders?: { [key: string]: any }, exoptions?: { [key: string]: any }): any; handleResponse(req: any, res: any, body: any | string): any | string; - request(rurl: string, data: any | string, callback: (err: any, res: any, body: any | string) => void, exheaders?: any, exoptions?: any): any; - requestStream(rurl: string, data: any | string, exheaders?: any, exoptions?: any): any; + request(rurl: string, data: any | string, callback: (err: any, res: any, body: any | string) => void, exheaders?: { [key: string]: any }, exoptions?: { [key: string]: any }): any; + requestStream(rurl: string, data: any | string, exheaders?: { [key: string]: any }, exoptions?: { [key: string]: any }): any; } diff --git a/soap/soap-tests.ts b/soap/soap-tests.ts index 0ce95cf585..f07346988e 100644 --- a/soap/soap-tests.ts +++ b/soap/soap-tests.ts @@ -1,10 +1,27 @@ import * as soap from 'soap'; import * as events from 'events'; -import * as fs from "fs"; -import * as http from "http"; +import * as fs from 'fs'; +import * as http from 'http'; const url = 'http://example.com/wsdl?wsdl'; -const wsdlOptions = { name: 'value', httpClient: new soap.HttpClient() }; +// wsdlOptions set only default values +const wsdlOptions = { + attributesKey: 'attributes', + disableCache: false, + endpoint: url, + envelopeKey: 'soap', + escapeXML: true, + forceSoap12Headers: false, + httpClient: new soap.HttpClient(), + ignoreBaseNameSpaces: false, + ignoredNamespaces: ['tns', 'targetNamespace', 'typedNamespace'], + request: require('request'), + stream: false, + wsdl_headers: [], + wsdl_options: [], + valueKey: '$value', + xmlKey: '$xml' +}; soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) { let securityOptions = { hasTimeStamp: false }; @@ -74,7 +91,7 @@ var myService = { var xml = fs.readFileSync('myservice.wsdl', 'utf8'), server = http.createServer(function(request,response) { - response.end("404: Not Found: " + request.url); + response.end('404: Not Found: ' + request.url); }); server.listen(8000); From 8b0cb243ab40d94f13a8af5f7f7f40014afe5c8f Mon Sep 17 00:00:00 2001 From: Viktor Smirnov Date: Sat, 4 Mar 2017 12:32:56 +0300 Subject: [PATCH 281/797] Add type definitions for 'bignumber.js' --- bignumber.js/bignumber.js-tests.ts | 445 ++++++++++++++++++ bignumber.js/index.d.ts | 693 +++++++++++++++++++++++++++++ bignumber.js/tsconfig.json | 22 + 3 files changed, 1160 insertions(+) create mode 100644 bignumber.js/bignumber.js-tests.ts create mode 100644 bignumber.js/index.d.ts create mode 100644 bignumber.js/tsconfig.json diff --git a/bignumber.js/bignumber.js-tests.ts b/bignumber.js/bignumber.js-tests.ts new file mode 100644 index 0000000000..3818d79761 --- /dev/null +++ b/bignumber.js/bignumber.js-tests.ts @@ -0,0 +1,445 @@ +var x = new BigNumber(9) +var y = new BigNumber(x) + +BigNumber(435.345) + +new BigNumber('5032485723458348569331745.33434346346912144534543') +new BigNumber('4.321e+4') +new BigNumber('-735.0918e-430') +new BigNumber(Infinity) +new BigNumber(NaN) +new BigNumber('.5') +new BigNumber('+2') +new BigNumber(-10110100.1, 2) +new BigNumber(-0b10110100) +new BigNumber('123412421.234324', 5) +new BigNumber('ff.8', 16) +new BigNumber('0xff.8') + +new BigNumber(9, 2) + +new BigNumber(96517860459076817.4395) + +new BigNumber('blurgh') + +BigNumber.config({ DECIMAL_PLACES: 5 }) +new BigNumber(1.23456789) +new BigNumber(1.23456789, 10) + +BigNumber.config({ DECIMAL_PLACES: 5 }) +var BN = BigNumber.another({ DECIMAL_PLACES: 9 }) + +x = new BigNumber(1) +y = new BN(1) + +x.div(3) +y.div(3) + +BN = BigNumber.another() +BN.config({ DECIMAL_PLACES: 9 }) + +BigNumber.config({ DECIMAL_PLACES: 5 }) +BigNumber.set({ DECIMAL_PLACES: 5 }) +BigNumber.config(5) + +BigNumber.config({ ROUNDING_MODE: 0 }) +BigNumber.config(undefined, BigNumber.ROUND_UP) + +BigNumber.config({ EXPONENTIAL_AT: 2 }) +new BigNumber(12.3) +new BigNumber(123) +new BigNumber(0.123) +new BigNumber(0.0123) + +BigNumber.config({ EXPONENTIAL_AT: [-7, 20] }) +new BigNumber(123456789) +new BigNumber(0.000000123) + +BigNumber.config({ EXPONENTIAL_AT: 1e+9 }) + +BigNumber.config({ EXPONENTIAL_AT: 0 }) + +BigNumber.config({ RANGE: 500 }) +BigNumber.config().RANGE +new BigNumber('9.999e499') +new BigNumber('1e500') +new BigNumber('1e-499') +new BigNumber('1e-500') + +BigNumber.config({ RANGE: [-3, 4] }) +new BigNumber(99999) +new BigNumber(100000) +new BigNumber(0.001) +new BigNumber(0.0001) + +BigNumber.config({ ERRORS: false }) + +BigNumber.config({ CRYPTO: true }) +BigNumber.config().CRYPTO +BigNumber.random() + +BigNumber.config({ MODULO_MODE: BigNumber.EUCLID }) +BigNumber.config({ MODULO_MODE: 9 }) + +BigNumber.config({ POW_PRECISION: 100 }) + +BigNumber.config({ + FORMAT: { + decimalSeparator: '.', + groupSeparator: ',', + groupSize: 3, + secondaryGroupSize: 0, + fractionGroupSeparator: ' ', + fractionGroupSize: 0 + } +}); + +BigNumber.config({ + DECIMAL_PLACES: 40, + ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL, + EXPONENTIAL_AT: [-10, 20], + RANGE: [-500, 500], + ERRORS: true, + CRYPTO: true, + MODULO_MODE: BigNumber.ROUND_FLOOR, + POW_PRECISION: 80, + FORMAT: { + groupSize: 3, + groupSeparator: ' ', + decimalSeparator: ',' + } +}); + +BigNumber.config(40, 7, [-10, 20], 500, 1, 1, 3, 80) + +var obj = BigNumber.config(); +obj.ERRORS +obj.RANGE + +x = new BigNumber('3257869345.0378653') +BigNumber.max(4e9, x, '123456789.9') + +var arr = [12, '13', new BigNumber(14)] +BigNumber.max(arr) + +x = new BigNumber('3257869345.0378653') +BigNumber.min(4e9, x, '123456789.9') + +arr = [2, new BigNumber(-14), '-15.9999', -12] +BigNumber.min(arr) + +BigNumber.config({ DECIMAL_PLACES: 10 }) +BigNumber.random() +BigNumber.random(20) + +BigNumber.config({ ROUNDING_MODE: BigNumber.ROUND_CEIL }) +BigNumber.config({ ROUNDING_MODE: 2 }) + +x = new BigNumber(-0.8) +y = x.absoluteValue() +var z = y.abs() + +x = new BigNumber(1.3) +x.ceil() +y = new BigNumber(-1.8) +y.ceil() + +x = new BigNumber(Infinity) +y = new BigNumber(5) +x.comparedTo(y) +x.comparedTo(x.minus(1)) +y.cmp(NaN) +y.cmp('110', 2) + +x = new BigNumber(123.45) +x.decimalPlaces() +y = new BigNumber('9.9e-101') +y.dp() + +x = new BigNumber(355) +y = new BigNumber(113) +x.dividedBy(y) +x.div(5) +x.div(47, 16) + +x = new BigNumber(5) +y = new BigNumber(3) +x.dividedToIntegerBy(y) +x.divToInt(0.7) +x.divToInt('0.f', 16) + +0 === 1e-324 +x = new BigNumber(0) +x.equals('1e-324') +BigNumber(-0).eq(x) +BigNumber(255).eq('ff', 16) + +y = new BigNumber(NaN) +y.equals(NaN) + +x = new BigNumber(1.8) +x.floor() +y = new BigNumber(-1.3) +y.floor() + +0.1 > (0.3 - 0.2) +x = new BigNumber(0.1) +x.greaterThan(BigNumber(0.3).minus(0.2)) +BigNumber(0).gt(x) +BigNumber(11, 3).gt(11.1, 2) + +x = new BigNumber(0.3).minus(0.2) +x.greaterThanOrEqualTo(0.1) +BigNumber(1).gte(x) +BigNumber(10, 18).gte('i', 36) + +x = new BigNumber(1) +x.isFinite() +y = new BigNumber(Infinity) +y.isFinite() + +x = new BigNumber(1) +x.isInteger() +y = new BigNumber(123.456) +y.isInt() + +x = new BigNumber(NaN) +x.isNaN() +y = new BigNumber('Infinity') +y.isNaN() + +x = new BigNumber(-0) +x.isNegative() +y = new BigNumber(2) +y.isNeg() + +x = new BigNumber(-0) +x.isZero() && x.isNeg() +y = new BigNumber(Infinity) +y.isZero() + +x = new BigNumber(0.3).minus(0.2) +x.lessThan(0.1) +BigNumber(0).lt(x) +BigNumber(11.1, 2).lt(11, 3) + +x = new BigNumber(0.1) +x.lessThanOrEqualTo(BigNumber(0.3).minus(0.2)) +BigNumber(-1).lte(x) +BigNumber(10, 18).lte('i', 36) + +x = new BigNumber(0.3) +x.minus(0.1) +x.sub(0.6, 20) + +x = new BigNumber(1) +x.modulo(0.9) +y = new BigNumber(33) +y.mod('a', 33) + +x = new BigNumber(1.8) +x.negated() +y = new BigNumber(-1.3) +y.neg() + +x = new BigNumber(0.1) +y = x.plus(0.2) +BigNumber(0.7).plus(x).add(y) +x.plus('0.1', 8) + +x = new BigNumber(1.234) +x.precision() +y = new BigNumber(987000) +y.sd() +y.sd(true) + +y = new BigNumber(x) +y.round() +y.round(1) +y.round(2) +y.round(10) +y.round(0, 1) +y.round(0, 6) +y.round(1, 1) +y.round(1, BigNumber.ROUND_HALF_EVEN) +y + +x = new BigNumber(1.23) +x.shift(3) +x.shift(-3) + +x = new BigNumber(16) +x.squareRoot() +y = new BigNumber(3) +y.sqrt() + +x = new BigNumber(0.6) +y = x.times(3) +BigNumber('7e+500').times(y) +x.times('-a', 16) + +BigNumber.config({ DECIMAL_PLACES: 5, ROUNDING_MODE: 4 }) +x = new BigNumber(9876.54321) + +x.toDigits() +x.toDigits(6) +x.toDigits(6, BigNumber.ROUND_UP) +x.toDigits(2) +x.toDigits(2, 1) +x + +y = new BigNumber(45.6) +y.toExponential() +y.toExponential(0) +y.toExponential(1) +y.toExponential(1, 1) +y.toExponential(3) + +y = new BigNumber(3.456) +y.toFixed() +y.toFixed(0) +y.toFixed(2) +y.toFixed(2, 1) +y.toFixed(5) + +var format = { + decimalSeparator: '.', + groupSeparator: ',', + groupSize: 3, + secondaryGroupSize: 0, + fractionGroupSeparator: ' ', + fractionGroupSize: 0 +} +BigNumber.config({ FORMAT: format }) + +x = new BigNumber('123456789.123456789') +x.toFormat() +x.toFormat(1) + +format.groupSeparator = ' ' +format.fractionGroupSize = 5 +x.toFormat() + +BigNumber.config({ + FORMAT: { + decimalSeparator: ',', + groupSeparator: '.', + groupSize: 3, + secondaryGroupSize: 2 + } +}) + +x.toFormat(6) + +x = new BigNumber(1.75) +x.toFraction() + +var pi = new BigNumber('3.14159265358') +pi.toFraction() +pi.toFraction(100000) +pi.toFraction(10000) +pi.toFraction(100) +pi.toFraction(10) +pi.toFraction(1) + +x = new BigNumber('177.7e+457') +y = new BigNumber(235.4325) +z = new BigNumber('0.0098074') + +var str = JSON.stringify([x, y, z]) + +JSON.parse(str, (key, val) => key === '' ? val : new BigNumber(val)) + +x = new BigNumber(456.789) +x.toNumber() +{ +x } + +y = new BigNumber('45987349857634085409857349856430985') +y.toNumber() + +z = new BigNumber(-0) +1 / +z +1 / z.toNumber() + +x = new BigNumber(0.7) +x.toPower(2) +BigNumber(3).pow(-2) + +y = new BigNumber(45.6) +x.toPrecision() +y.toPrecision() +x.toPrecision(1) +y.toPrecision(1) +y.toPrecision(2, 0) +y.toPrecision(2, 1) +x.toPrecision(5) +y.toPrecision(5) + +x = new BigNumber(750000) +x.toString() +BigNumber.config({ EXPONENTIAL_AT: 5 }) +x.toString() + +y = new BigNumber(362.875) +y.toString(2) +y.toString(9) +y.toString(32) + +BigNumber.config({ DECIMAL_PLACES: 4 }); +z = new BigNumber('1.23456789') +z.toString() +z.toString(10) + +x = new BigNumber(123.456) +x.truncated() +y = new BigNumber(-12.3) +y.trunc() + +x = new BigNumber('-0') +x.toString() +x.valueOf() +y = new BigNumber('1.777e+457') +y.valueOf() + +x = new BigNumber(0.123) +x.toExponential() +x.c +x.e +x.s + +z = new BigNumber('-123.4567000e+2') +z.toExponential() +z.c +z.e +z.s + +x = new BigNumber(3) +x instanceof BigNumber +x.isBigNumber + +BN = BigNumber.another(); + +y = new BN(3) +y instanceof BigNumber +y.isBigNumber + +y = new BigNumber(-0) +y.c +y.e +y.s + +try { + // ... +} catch (e) { + if (e instanceof Error && e.name == 'BigNumber Error') { + // ... + } +} + +x = new BigNumber("1.0") +y = new BigNumber("1.1000") +z = x.add(y) + +x = new BigNumber("1.20") +y = new BigNumber("3.45000") +z = x.mul(y) diff --git a/bignumber.js/index.d.ts b/bignumber.js/index.d.ts new file mode 100644 index 0000000000..15314f30ec --- /dev/null +++ b/bignumber.js/index.d.ts @@ -0,0 +1,693 @@ +// Type definitions for bignumber.js 4.0 +// Project: https://github.com/MikeMcl/bignumber.js/ +// Definitions by: Viktor Smirnov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +declare var BigNumber: bignumber.BigNumberStatic; + +export as namespace BigNumber; +export = BigNumber; + +declare namespace bignumber { + + const enum RoundingMode { + + /** + * Rounds away from zero + */ + ROUND_UP = 0, + + /** + * Rounds towards zero + */ + ROUND_DOWN = 1, + + /** + * Rounds towards `Infinity` + */ + ROUND_CEIL = 2, + + /** + * Rounds towards `-Infinity` + */ + ROUND_FLOOR = 3, + + /** + * Rounds towards nearest neighbour. + * If equidistant, rounds away from zero. + */ + ROUND_HALF_UP = 4, + + /** + * Rounds towards nearest neighbour. + * If equidistant, rounds towards zero. + */ + ROUND_HALF_DOWN = 5, + + /** + * Rounds towards nearest neighbour. + * If equidistant, rounds towards even neighbour. + */ + ROUND_HALF_EVEN = 6, + + /** + * Rounds towards nearest neighbour. + * If equidistant, rounds towards `Infinity`. + */ + ROUND_HALF_CEIL = 7, + + /** + * Rounds towards nearest neighbour. + * If equidistant, rounds towards `-Infinity`. + */ + ROUND_HALF_FLOOR = 8, + + /** + * The remainder is always positive. + * + * Euclidian division: `q = sign(n) * floor(a / abs(n))` + */ + EUCLID = 9, + } + + interface FormatConfig { + + /** + * The decimal separator. + */ + decimalSeparator: string; + + /** + * The grouping separator of the integer part. + */ + groupSeparator: string; + + /** + * The primary grouping size of the integer part. + */ + groupSize: number; + + /** + * The secondary grouping size of the integer part. + */ + secondaryGroupSize: number; + + /** + * The grouping separator of the fraction part. + */ + fractionGroupSeparator: string; + + /** + * The grouping size of the fraction part. + */ + fractionGroupSize: number; + } + + interface BigNumberConfig { + + /** + * The maximum number of decimal places of the results of operations involving division, + * i.e. division, square root and base conversion operations, and power operations with negative exponents. + */ + DECIMAL_PLACES: number; + + /** + * The rounding mode used in the above operations and the default rounding mode of round, `toExponential`, `toFixed`, `toFormat` and `toPrecision`. + */ + ROUNDING_MODE: RoundingMode; + + /** + * The exponent value(s) at which `toString` returns exponential notation. + * + * If a single number is assigned, the value is the exponent magnitude. + * + * If an array of two numbers is assigned then the first number is the negative exponent value at and beneath which exponential notation is used, + * and the second number is the positive exponent value at and above which the same. + */ + EXPONENTIAL_AT: number | number[]; + + /** + * The exponent value(s) beyond which overflow to `Infinity` and underflow to zero occurs. + * + * If a single number is assigned, it is the maximum exponent magnitude: + * values wth a positive exponent of greater magnitude become `Infinity` + * and those with a negative exponent of greater magnitude become zero. + * + * If an array of two numbers is assigned then the first number is the negative exponent limit and the second number is the positive exponent limit. + */ + RANGE: number | number[]; + + /** + * The value that determines whether BigNumber Errors are thrown. + * + * If `ERRORS` is false, no errors will be thrown. + */ + ERRORS: boolean | 0 | 1; + + /** + * The value that determines whether cryptographically-secure pseudo-random number generation is used. + * + * If `CRYPTO` is set to `true` then the `random` method will generate random digits using `crypto.getRandomValues` in browsers that support it, + * or `crypto.randomBytes` if using a version of Node.js that supports it. + * + * If neither function is supported by the host environment then attempting to set `CRYPTO` to `true` will fail, and if `ERRORS` is `true` an exception will be thrown. + * + * If `CRYPTO` is `false` then the source of randomness used will be `Math.random` (which is assumed to generate at least `30` bits of randomness). + */ + CRYPTO: boolean | 0 | 1; + + /** + * The modulo mode used when calculating the modulus: `a mod n`. + * + * The quotient, `q = a / n`, is calculated according to the `ROUNDING_MODE` that corresponds to the chosen `MODULO_MODE`. + * + * The remainder, `r`, is calculated as: `r = a - n * q`. + */ + MODULO_MODE: RoundingMode; + + /** + * The maximum number of significant digits of the result of the power operation (unless a modulus is specified). + * + * If set to `0`, the number of signifcant digits will not be limited. + */ + POW_PRECISION: number; + + /** + * The `FORMAT` object configures the format of the string returned by the toFormat method. + */ + FORMAT: Partial + } + + type NumberLike = number | string | BigNumber; + + interface BigNumberStatic { + + /** + * Returns a new instance of a BigNumber object. + */ + (value: NumberLike, base?: number): BigNumber; + + /** + * Returns a new instance of a BigNumber object. + */ + new (value: NumberLike, base?: number): BigNumber; + + /** + * Returns a new independent BigNumber constructor with configuration as described by obj, or with the default configuration if obj is null or undefined. + */ + another(obj?: Partial): BigNumberStatic; + + /** + * Configures the settings for this particular BigNumber constructor. + * + */ + config(obj?: Partial): BigNumberConfig; + + /** + * Configures the settings for this particular BigNumber constructor. + */ + config( + DECIMAL_PLACES?: number, + ROUNDING_MODE?: RoundingMode, + EXPONENTIAL_AT?: number | number[], + RANGE?: number | number[], + ERRORS?: boolean | 0 | 1, + CRYPTO?: boolean | 0 | 1, + MODULO_MODE?: RoundingMode, + POW_PRECISION?: number + ): BigNumberConfig; + + /** + * Configures the settings for this particular BigNumber constructor. + */ + set(obj?: Partial): BigNumberConfig; + + /** + * Configures the settings for this particular BigNumber constructor. + */ + set( + DECIMAL_PLACES?: number, + ROUNDING_MODE?: RoundingMode, + EXPONENTIAL_AT?: number | number[], + RANGE?: number | number[], + ERRORS?: boolean | 0 | 1, + CRYPTO?: boolean | 0 | 1, + MODULO_MODE?: RoundingMode, + POW_PRECISION?: number + ): BigNumberConfig; + + /** + * Returns a BigNumber whose value is the maximum of `args`. + */ + max(...args: NumberLike[]): BigNumber; + + /** + * Returns a BigNumber whose value is the maximum of `args`. + */ + max(args: NumberLike[]): BigNumber; + + /** + * Returns a BigNumber whose value is the minimum of `args`. + */ + min(...args: NumberLike[]): BigNumber; + + /** + * Returns a BigNumber whose value is the minimum of `args`. + */ + min(args: NumberLike[]): BigNumber; + + /** + * Returns a new BigNumber with a pseudo-random value equal to or greater than `0` and less than `1`. + * + * The return value will have `dp` decimal places (or less if trailing zeros are produced). + * If `dp` is omitted then the number of decimal places will default to the current `DECIMAL_PLACES` setting. + * + * Depending on the value of this BigNumber constructor's `CRYPTO` setting and the support for the `crypto` object in the host environment, + * the random digits of the return value are generated by either + * `Math.random` (fastest), + * `crypto.getRandomValues` (Web Cryptography API in recent browsers) + * or `crypto.randomBytes` (Node.js). + * + * If `CRYPTO` is `true`, i.e. one of the `crypto` methods is to be used, + * the value of a returned BigNumber should be cryptographically-secure and statistically indistinguishable from a random value. + */ + random(dp?: number): BigNumber; + + ROUND_UP: 0; + ROUND_DOWN: 1; + ROUND_CEIL: 2; + ROUND_FLOOR: 3; + ROUND_HALF_UP: 4; + ROUND_HALF_DOWN: 5; + ROUND_HALF_EVEN: 6; + ROUND_HALF_CEIL: 7; + ROUND_HALF_FLOOR: 8; + EUCLID: 9; + } + + interface BigNumber { + + /** + * Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this BigNumber. + */ + absoluteValue(): BigNumber; + + /** + * Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of this BigNumber. + */ + abs(): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber rounded to a whole number in the direction of positive Infinity. + */ + ceil(): BigNumber; + + /** + * Returns + * + * `1` if the value of this BigNumber is greater than the value of `n` + * + * `-1` if the value of this BigNumber is less than the value of `n` + * + * `0` if this BigNumber and `n` have the same value + * + * `null` if the value of either this BigNumber or `n` is `NaN` + */ + comparedTo(n: NumberLike, base?: number): 1 | -1 | 0 | null; + + /** + * Returns + * + * `1` if the value of this BigNumber is greater than the value of `n` + * + * `-1` if the value of this BigNumber is less than the value of `n` + * + * `0` if this BigNumber and `n` have the same value + * + * `null` if the value of either this BigNumber or `n` is `NaN` + */ + cmp(n: NumberLike, base?: number): 1 | -1 | 0 | null; + + /** + * Return the number of decimal places of the value of this BigNumber, or `null` if the value of this BigNumber is `±Infinity` or `NaN`. + */ + decimalPlaces(): number; + + /** + * Return the number of decimal places of the value of this BigNumber, or `null` if the value of this BigNumber is `±Infinity` or `NaN`. + */ + dp(): number; + + /** + * Returns a BigNumber whose value is the value of this BigNumber divided by `n`, rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. + */ + dividedBy(n: NumberLike, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber divided by `n`, rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. + */ + div(n: NumberLike, base?: number): BigNumber; + + /** + * Return a BigNumber whose value is the integer part of dividing the value of this BigNumber by `n`. + */ + dividedToIntegerBy(n: NumberLike, base?: number): BigNumber; + + /** + * Return a BigNumber whose value is the integer part of dividing the value of this BigNumber by `n`. + */ + divToInt(n: NumberLike, base?: number): BigNumber; + + /** + * Returns `true` if the value of this BigNumber equals the value of `n`, otherwise returns `false`. + * + * As with JavaScript, `NaN` does not equal `NaN`. + */ + equals(n: NumberLike, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber equals the value of `n`, otherwise returns `false`. + * + * As with JavaScript, `NaN` does not equal `NaN`. + */ + eq(n: NumberLike, base?: number): boolean; + + /** + * Returns a BigNumber whose value is the value of this BigNumber rounded to a whole number in the direction of negative `Infinity`. + */ + floor(): BigNumber; + + /** + * Returns `true` if the value of this BigNumber is greater than the value of `n`, otherwise returns `false`. + */ + greaterThan(n: NumberLike, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is greater than the value of `n`, otherwise returns `false`. + */ + gt(n: NumberLike, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is greater than or equal to the value of `n`, otherwise returns `false`. + */ + greaterThanOrEqualTo(n: NumberLike, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is greater than or equal to the value of `n`, otherwise returns `false`. + */ + gte(n: NumberLike, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is a finite number, otherwise returns `false`. + * + * The only possible non-finite values of a BigNumber are `NaN`, `Infinity` and `-Infinity`. + */ + isFinite(): boolean; + + /** + * Returns `true` if the value of this BigNumber is a whole number, otherwise returns `false`. + */ + isInteger(): boolean; + + /** + * Returns `true` if the value of this BigNumber is a whole number, otherwise returns `false`. + */ + isInt(): boolean; + + /** + * Returns `true` if the value of this BigNumber is NaN, otherwise returns `false`. + */ + isNaN(): boolean; + + /** + * Returns `true` if the value of this BigNumber is negative, otherwise returns `false`. + */ + isNegative(): boolean; + + /** + * Returns `true` if the value of this BigNumber is negative, otherwise returns `false`. + */ + isNeg(): boolean; + + /** + * Returns `true` if the value of this BigNumber is zero or minus zero, otherwise returns `false`. + */ + isZero(): boolean; + + /** + * Returns `true` if the value of this BigNumber is less than the value of `n`, otherwise returns `false`. + */ + lessThan(n: NumberLike, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is less than the value of `n`, otherwise returns `false`. + */ + lt(n: NumberLike, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is less than or equal to the value of `n`, otherwise returns + */ + lessThanOrEqualTo(n: NumberLike, base?: number): boolean; + + /** + * Returns `true` if the value of this BigNumber is less than or equal to the value of `n`, otherwise returns + */ + lte(n: NumberLike, base?: number): boolean; + + /** + * Returns a BigNumber whose value is the value of this BigNumber minus `n`. + */ + minus(n: NumberLike, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber minus `n`. + */ + sub(n: NumberLike, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber modulo `n`, i.e. the integer remainder of dividing this BigNumber by `n`. + * + * The value returned, and in particular its sign, is dependent on the value of the `MODULO_MODE` setting of this BigNumber constructor. + * If it is `1` (default value), the result will have the same sign as this BigNumber, + * and it will match that of Javascript's `%` operator (within the limits of double precision) and BigDecimal's `remainder` method. + */ + modulo(n: NumberLike, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber modulo `n`, i.e. the integer remainder of dividing this BigNumber by `n`. + * + * The value returned, and in particular its sign, is dependent on the value of the `MODULO_MODE` setting of this BigNumber constructor. + * If it is `1` (default value), the result will have the same sign as this BigNumber, + * and it will match that of Javascript's `%` operator (within the limits of double precision) and BigDecimal's `remainder` method. + */ + mod(n: NumberLike, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber negated, i.e. multiplied by `-1`. + */ + negated(): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber negated, i.e. multiplied by `-1`. + */ + neg(): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber plus `n`. + */ + plus(n: NumberLike, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber plus `n`. + */ + add(n: NumberLike, base?: number): BigNumber; + + /** + * Returns the number of significant digits of the value of this BigNumber. + * + * If `z` is `true` or `1` then any trailing zeros of the integer part of a number are counted as significant digits, otherwise they are not. + */ + precision(z?: boolean | 0 | 1): number; + + /** + * Returns the number of significant digits of the value of this BigNumber. + * + * If `z` is `true` or `1` then any trailing zeros of the integer part of a number are counted as significant digits, otherwise they are not. + */ + sd(z?: boolean | 0 | 1): number; + + /** + * Returns a BigNumber whose value is the value of this BigNumber rounded by rounding mode `rm` to a maximum of `dp` decimal places. + * + * If `dp` is omitted, or is `null` or `undefined`, the return value is `n` rounded to a whole number. + * + * If `rm` is omitted, or is `null` or `undefined`, `ROUNDING_MODE` is used. + */ + round(dp?: number, rm?: RoundingMode): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber shifted `n` places. + * + * The shift is of the decimal point, i.e. of powers of ten, and is to the left if `n` is negative or to the right if `n` is positive. + */ + shift(n: number): BigNumber; + + /** + * Returns a BigNumber whose value is the square root of the value of this BigNumber, rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. + * + * The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. + */ + squareRoot(): BigNumber; + + /** + * Returns a BigNumber whose value is the square root of the value of this BigNumber, rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. + * + * The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding. + */ + sqrt(): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber times `n`. + */ + times(n: NumberLike, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber times `n`. + */ + mul(n: NumberLike, base?: number): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber rounded to `sd` significant digits using rounding mode `rm`. + * + * If `sd` is omitted or is `null` or `undefined`, the return value will not be rounded. + * + * If `rm` is omitted or is `null` or `undefined`, ROUNDING_MODE will be used. + */ + toDigits(sd?: number, rm?: RoundingMode): BigNumber; + + /** + * Returns a string representing the value of this BigNumber in exponential notation rounded using rounding mode `rm` to `dp` decimal places, + * i.e with one digit before the decimal point and `dp` digits after it. + * + * If the value of this BigNumber in exponential notation has fewer than `dp` fraction digits, the return value will be appended with zeros accordingly. + * + * If `dp` is omitted, or is `null` or `undefined`, the number of digits after the decimal point defaults to the minimum number of digits necessary to represent the value exactly. + * + * If `rm` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. + */ + toExponential(dp?: number, rm?: RoundingMode): string; + + /** + * Returns a string representing the value of this BigNumber in normal (fixed-point) notation rounded to `dp` decimal places using rounding mode `rm`. + * + * If the value of this BigNumber in normal notation has fewer than `dp` fraction digits, the return value will be appended with zeros accordingly. + * + * Unlike `Number.prototype.toFixed`, which returns exponential notation if a number is greater or equal to `10e21`, this method will always return normal notation. + * + * If `dp` is omitted or is `null` or `undefined`, the return value will be unrounded and in normal notation. + * This is also unlike `Number.prototype.toFixed`, which returns the value to zero decimal places. + * It is useful when fixed-point notation is required and the current `EXPONENTIAL_AT` setting causes `toString` to return exponential notation. + * + * If `rm` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. + */ + toFixed(dp?: number, rm?: RoundingMode): string; + + /** + * Returns a string representing the value of this BigNumber in normal (fixed-point) notation rounded to `dp` decimal places using rounding mode `rm`, + * and formatted according to the properties of the `FORMAT` object. + * + * If `dp` is omitted or is `null` or `undefined`, then the return value is not rounded to a fixed number of decimal places. + * + * If `rm` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. + */ + toFormat(dp?: number, rm?: RoundingMode): string; + + /** + * Returns a string array representing the value of this BigNumber as a simple fraction with an integer numerator and an integer denominator. + * The denominator will be a positive non-zero value less than or equal to `max`. + * + * If a maximum denominator, `max`, is not specified, or is `null` or `undefined`, the denominator will be the lowest value necessary to represent the number exactly. + */ + toFraction(max?: NumberLike): [string, string]; + + /** + * As `valueOf`. + */ + toJSON(): string; + + /** + * Returns the value of this BigNumber as a JavaScript number primitive. + * + * Type coercion with, for example, the unary plus operator will also work, except that a BigNumber with the value minus zero will be converted to positive zero. + */ + toNumber(): number; + + /** + * Returns a BigNumber whose value is the value of this BigNumber raised to the power `n`, and optionally modulo a modulus `m`. + * + * If `n` is negative the result is rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. + */ + toPower(n: number, m?: NumberLike): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber raised to the power `n`, and optionally modulo a modulus `m`. + * + * If `n` is negative the result is rounded according to the current `DECIMAL_PLACES` and `ROUNDING_MODE` configuration. + */ + pow(n: number, m?: NumberLike): BigNumber; + + /** + * Returns a string representing the value of this BigNumber rounded to `sd` significant digits using rounding mode `rm`. + * + * If `sd` is less than the number of digits necessary to represent the integer part of the value in normal (fixed-point) notation, then exponential notation is used. + * + * If `sd` is omitted, or is `null` or `undefined`, then the return value is the same as `n.toString()`. + * + * If `rm` is omitted or is `null` or `undefined`, `ROUNDING_MODE` is used. + */ + toPrecision(sd?: number, rm?: RoundingMode): string; + + /** + * Returns a string representing the value of this BigNumber in the specified base, or base `10` if `base` is omitted or is `null` or `undefined`. + */ + toString(base?: number): string; + + /** + * Returns a BigNumber whose value is the value of this BigNumber truncated to a whole number. + */ + truncated(): BigNumber; + + /** + * Returns a BigNumber whose value is the value of this BigNumber truncated to a whole number. + */ + trunc(): BigNumber; + + /** + * As `toString`, but does not accept a base argument and includes the minus sign for negative zero. + */ + valueOf(): string; + + /** + * coefficient + * @description Array of base 1e14 numbers + */ + c: number[] | null; + + /** + * exponent + * @description Integer, -1000000000 to 1000000000 inclusive + */ + e: number | null; + + /** + * sign + */ + s: -1 | 1 | null; + + /** + * type identifier + */ + isBigNumber: true; + } +} \ No newline at end of file diff --git a/bignumber.js/tsconfig.json b/bignumber.js/tsconfig.json new file mode 100644 index 0000000000..485dace353 --- /dev/null +++ b/bignumber.js/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", + "bignumber.js-tests.ts" + ] +} \ No newline at end of file From 369edc17ce0e77e07645a70b22ca018872bbcbd9 Mon Sep 17 00:00:00 2001 From: Viktor Smirnov Date: Sat, 4 Mar 2017 14:12:51 +0300 Subject: [PATCH 282/797] bignumber.js / add tslint.json --- bignumber.js/tslint.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 bignumber.js/tslint.json diff --git a/bignumber.js/tslint.json b/bignumber.js/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/bignumber.js/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file From 5d4a849576a18a48d7ef008bbaa0f1cde49cf04f Mon Sep 17 00:00:00 2001 From: Hugues Stefanski Date: Sun, 5 Mar 2017 10:21:38 +0100 Subject: [PATCH 283/797] 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 b521e2441c34cb59d03b3d5b86484a9191aea294 Mon Sep 17 00:00:00 2001 From: Meno Abels Date: Sun, 5 Mar 2017 11:51:58 +0100 Subject: [PATCH 284/797] react-copy-to-clipboard: initial type definition --- react-copy-to-clipboard/index.d.ts | 29 +++++++++++++++++++ .../react-copy-to-clipboard-tests.tsx | 14 +++++++++ react-copy-to-clipboard/tsconfig.json | 24 +++++++++++++++ react-copy-to-clipboard/tslint.json | 1 + 4 files changed, 68 insertions(+) create mode 100644 react-copy-to-clipboard/index.d.ts create mode 100644 react-copy-to-clipboard/react-copy-to-clipboard-tests.tsx create mode 100644 react-copy-to-clipboard/tsconfig.json create mode 100644 react-copy-to-clipboard/tslint.json diff --git a/react-copy-to-clipboard/index.d.ts b/react-copy-to-clipboard/index.d.ts new file mode 100644 index 0000000000..a3dbdb9506 --- /dev/null +++ b/react-copy-to-clipboard/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for react-copy-to-clipboard 4.2 +// Project: https://github.com/nkbt/react-copy-to-clipboard +// Definitions by: Meno Abels +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import * as React from "react"; + +export as namespace CopyToClipboard; + +export = CopyToClipboard; + +declare namespace CopyToClipboard { + + export interface Options { + debug: boolean; + message: string; + } + + export interface Props { + text: string; + options?: Options; + } + +} + +declare class CopyToClipboard extends React.Component { +} + diff --git a/react-copy-to-clipboard/react-copy-to-clipboard-tests.tsx b/react-copy-to-clipboard/react-copy-to-clipboard-tests.tsx new file mode 100644 index 0000000000..a92ae38f8a --- /dev/null +++ b/react-copy-to-clipboard/react-copy-to-clipboard-tests.tsx @@ -0,0 +1,14 @@ + +import * as React from "react"; +import CopyToClipboard from "react-copy-to-clipboard"; + +export class Test extends React.Component { + render() { + return ( + this.setState({copied: true})}> + Copy to clipboard with span + + ); + } +} diff --git a/react-copy-to-clipboard/tsconfig.json b/react-copy-to-clipboard/tsconfig.json new file mode 100644 index 0000000000..b3d366ea83 --- /dev/null +++ b/react-copy-to-clipboard/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-copy-to-clipboard-tests.tsx" + ] +} diff --git a/react-copy-to-clipboard/tslint.json b/react-copy-to-clipboard/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/react-copy-to-clipboard/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 039dbf1bdbd302305b91763f848ebb76f79d78e7 Mon Sep 17 00:00:00 2001 From: Meno Abels Date: Sun, 5 Mar 2017 15:06:39 +0100 Subject: [PATCH 285/797] react-copy-to-clipboard: missing onCopy method --- react-copy-to-clipboard/index.d.ts | 1 + react-copy-to-clipboard/react-copy-to-clipboard-tests.tsx | 4 ++-- react-copy-to-clipboard/tsconfig.json | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/react-copy-to-clipboard/index.d.ts b/react-copy-to-clipboard/index.d.ts index a3dbdb9506..ffc6609b4d 100644 --- a/react-copy-to-clipboard/index.d.ts +++ b/react-copy-to-clipboard/index.d.ts @@ -19,6 +19,7 @@ declare namespace CopyToClipboard { export interface Props { text: string; + onCopy: (a: string) => void, options?: Options; } diff --git a/react-copy-to-clipboard/react-copy-to-clipboard-tests.tsx b/react-copy-to-clipboard/react-copy-to-clipboard-tests.tsx index a92ae38f8a..195e7a8ceb 100644 --- a/react-copy-to-clipboard/react-copy-to-clipboard-tests.tsx +++ b/react-copy-to-clipboard/react-copy-to-clipboard-tests.tsx @@ -1,12 +1,12 @@ import * as React from "react"; -import CopyToClipboard from "react-copy-to-clipboard"; +import * as CopyToClipboard from "react-copy-to-clipboard"; export class Test extends React.Component { render() { return ( this.setState({copied: true})}> + onCopy={() => {}}> Copy to clipboard with span ); diff --git a/react-copy-to-clipboard/tsconfig.json b/react-copy-to-clipboard/tsconfig.json index b3d366ea83..a4e09d1242 100644 --- a/react-copy-to-clipboard/tsconfig.json +++ b/react-copy-to-clipboard/tsconfig.json @@ -9,13 +9,13 @@ "noImplicitThis": true, "strictNullChecks": true, "baseUrl": "../", + "jsx": "react", "typeRoots": [ "../" ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true, - "jsx": "react" + "forceConsistentCasingInFileNames": true }, "files": [ "index.d.ts", From a3de0c4dfa908614dd8e9cd6e0399a79d3b8c9be Mon Sep 17 00:00:00 2001 From: Meno Abels Date: Sun, 5 Mar 2017 15:14:07 +0100 Subject: [PATCH 286/797] react-copy-to-clipboard: make onCopy optional --- react-copy-to-clipboard/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-copy-to-clipboard/index.d.ts b/react-copy-to-clipboard/index.d.ts index ffc6609b4d..1b0c9e942e 100644 --- a/react-copy-to-clipboard/index.d.ts +++ b/react-copy-to-clipboard/index.d.ts @@ -19,7 +19,7 @@ declare namespace CopyToClipboard { export interface Props { text: string; - onCopy: (a: string) => void, + onCopy?: (a: string) => void, options?: Options; } From e52501f54f1fdf41c2b78b603918009b693eaa33 Mon Sep 17 00:00:00 2001 From: Artur Pelczar Date: Sun, 5 Mar 2017 15:30:23 +0100 Subject: [PATCH 287/797] Added foreignKeyTarget parameters for bookshelf.js library. --- bookshelf/bookshelf-tests.ts | 47 ++++++++++++++++++++++++++++++++++++ bookshelf/index.d.ts | 6 ++--- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/bookshelf/bookshelf-tests.ts b/bookshelf/bookshelf-tests.ts index 5b743bef71..98fd0f4599 100644 --- a/bookshelf/bookshelf-tests.ts +++ b/bookshelf/bookshelf-tests.ts @@ -1330,3 +1330,50 @@ new User({name: 'John'}).fetchAll({require: true}) /* events.trigger(), see http://bookshelfjs.org/#Events-instance-trigger */ /* events.triggerThen(), see http://bookshelfjs.org/#Events-instance-triggerThen */ + + +/* model - foreignKey and foreignKeyTarget, see http://bookshelfjs.org/#Model-instance-hasOne */ + +{ + class Capital extends bookshelf.Model { + get tableName() { return 'capitals'; } + } + + class City extends bookshelf.Model { + get tableName() { return 'cities'; } + + country(): Country { + return this.belongsTo(Country, 'key1', 'key2'); + } + } + + class Language extends bookshelf.Model { + get tableName() { return 'languages'; } + + countries(): Bookshelf.Collection { + return this.belongsToMany(Country, 'languages_countries', 'lang_id', 'country_id'); + } + } + + class Country extends bookshelf.Model { + get tableName() { return 'countries'; } + capital(): Capital { + return this.hasOne(Capital, 'id', 'capital_id'); + } + + cities(): Bookshelf.Collection { + return this.hasMany(City, 'key2', 'key1'); + } + } + + // select * from `health_records` where `patient_id` = 1; + const capital = new Country({id: 1}).related('capital'); + capital.fetch().then(model => { + // ... + }); + + // alternatively, if you don't need the relation loaded on the patient's relations hash: + new Country({id: 1}).capital().fetch().then(model => { + // ... + }); +} \ No newline at end of file diff --git a/bookshelf/index.d.ts b/bookshelf/index.d.ts index 56472a3213..4aa6fd38b5 100644 --- a/bookshelf/index.d.ts +++ b/bookshelf/index.d.ts @@ -92,14 +92,14 @@ declare namespace Bookshelf { static where(properties: { [key: string]: any }): T; static where(key: string, operatorOrValue: string | number | boolean, valueIfOperator?: string | number | boolean): T; - belongsTo>(target: { new (...args: any[]): R }, foreignKey?: string): R; + belongsTo>(target: { new (...args: any[]): R }, foreignKey?: string, foreignKeyTarget?: string): R; belongsToMany>(target: { new (...args: any[]): R }, table?: string, foreignKey?: string, otherKey?: string): Collection; count(column?: string, options?: SyncOptions): BlueBird; destroy(options?: DestroyOptions): BlueBird; fetch(options?: FetchOptions): BlueBird; fetchAll(options?: FetchAllOptions): BlueBird>; - hasMany>(target: { new (...args: any[]): R }, foreignKey?: string): Collection; - hasOne>(target: { new (...args: any[]): R }, foreignKey?: string): R; + hasMany>(target: { new (...args: any[]): R }, foreignKey?: string, foreignKeyTarget?: string): Collection; + hasOne>(target: { new (...args: any[]): R }, foreignKey?: string, foreignKeyTarget?: string): R; load(relations: string | string[], options?: LoadOptions): BlueBird; morphMany>(target: { new (...args: any[]): R }, name?: string, columnNames?: string[], morphValue?: string): Collection; morphOne>(target: { new (...args: any[]): R }, name?: string, columnNames?: string[], morphValue?: string): R; From 5f56a7e5e1eabe1d55740f3961ca1fa4c7988d6b Mon Sep 17 00:00:00 2001 From: Jed Mao Date: Sun, 5 Mar 2017 08:48:17 -0600 Subject: [PATCH 288/797] Update vinyl-fs options --- vinyl-fs/index.d.ts | 56 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/vinyl-fs/index.d.ts b/vinyl-fs/index.d.ts index 4fa6101b69..52aa5cd506 100644 --- a/vinyl-fs/index.d.ts +++ b/vinyl-fs/index.d.ts @@ -27,32 +27,70 @@ interface SrcOptions extends globStream.Options { /** * Specifies the folder relative to the cwd * This is used to determine the file names when saving in .dest() - * Default is where the glob begins + * Default: where the glob begins */ base?: string; /** * Setting this to false will make file.contents a paused stream * If true it will buffer the file contents - * Defaults to true + * Default: true */ buffer?: boolean; /** - * Setting this to false will ignore the contents of the file and disable writing to disk to speed up operations - * Defaults to true + * The mode the directory should be created with. + * Default: the process mode + */ + dirMode?: number; + + /** + * Whether or not you want globs to match on dot files or not + * (e.g., `.gitignore`). + */ + dot?: boolean; + + /** + * Whether or not to recursively resolve symlinks to their targets. + * Setting to `false` to preserve them as symlinks and make `file.symlink` + * equal the original symlink's target path. + * Default: true + */ + followSymlinks?: boolean; + + /** + * Setting this to false will ignore the contents of the file and disable + * writing to disk to speed up operations + * Default: true */ read?: boolean; - /** Only find files that have been modified since the time specified */ + /** + * Whether or not the symlink should be relative or absolute. + * Default: false + */ + relative?: boolean; + + /** Only find files that have been modified since the time specified */ since?: Date|number; - /** Setting this to true will create a duplex stream, one that passes through items and emits globbed files. - * Defaults to false */ + /** + * Causes the BOM to be stripped on UTF-8 encoded files. Set to `false` + * if you need the BOM for some reason. + */ + stripBOM?: boolean; + + /** + * Setting this to true will create a duplex stream, one that passes + * through items and emits globbed files. + * Default: false + */ passthrough?: boolean; - /** Setting this to true will enable sourcemaps. - * Defaults to false */ + /** + * Setting this to true will enable sourcemaps. + * Default: false + */ sourcemaps?: boolean; } From 638891042fc8b67f9c60022dfe6f7911723eda25 Mon Sep 17 00:00:00 2001 From: Leonidas Arvanitis Date: Sun, 5 Mar 2017 21:26:44 +0200 Subject: [PATCH 289/797] Fix and update according to version 2.1.3 - Added missing methods and options - Removed non-existing options - Expanded comments with default values For this update I used both the site and the code of Toastr to find missing and undocumented (only public ofc.) members. --- toastr/index.d.ts | 381 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 269 insertions(+), 112 deletions(-) diff --git a/toastr/index.d.ts b/toastr/index.d.ts index 5cd8b30c82..767627c95d 100644 --- a/toastr/index.d.ts +++ b/toastr/index.d.ts @@ -8,214 +8,371 @@ interface ToastrOptions { /** - * Optionally override the animation easing to show or hide the toasts. Default is swing. swing and linear are built into jQuery. - */ + * Optionally override the animation easing to show or hide the toasts. + * swing and linear are built into jQuery. + * @default swing + */ showEasing?: string; /** - * Optionally override the animation easing to show or hide the toasts. Default is swing. swing and linear are built into jQuery. - */ + * Optionally override the animation easing to show or hide the toasts. + * swing and linear are built into jQuery. + * @default swing + */ hideEasing?: string; /** - * Use the jQuery show/hide method of your choice. These default to fadeIn/fadeOut. The methods fadeIn/fadeOut, slideDown/slideUp, and show/hide are built into jQuery. - */ + * Use the jQuery show method of your choice. + * The methods fadeIn/fadeOut, slideDown/slideUp, and show/hide are built into jQuery. + * @default fadeIn + */ showMethod?: string; /** - * Use the jQuery show/hide method of your choice. These default to fadeIn/fadeOut. The methods fadeIn/fadeOut, slideDown/slideUp, and show/hide are built into jQuery. - */ + * Use the jQuery hide method of your choice. + * The methods fadeIn/fadeOut, slideDown/slideUp, and show/hide are built into jQuery. + * @default fadeOut + */ hideMethod?: string; /** - * Should a close button be shown - */ + * Should a close button be shown? + * @default undefined + */ closeButton?: boolean; /** - * Html for the close button - */ + * CSS class the close button will be given. + * @default toast-close-button + */ + closeClass?: string; + /** + * Time in milliseconds the toast should take to hide, when the close button is clicked. + * Falls back to hide configuration. + * @default false + */ + closeDuration?: number; + /** + * The animation easing while hiding the toast, when the close button is clicked. + * Falls back to hide configuration. + * swing and linear are built into jQuery. + * @default false + */ + closeEasing?: string; + /** + * Use the jQuery show/hide method of your choice, when the close button is clicked. + * Falls back to hide configuration. + * The methods fadeIn/fadeOut, slideDown/slideUp, and show/hide are built into jQuery. + * @default false + */ + closeMethod?: string; + /** + * Set to false so that the toast hides event if hovered. + * @default true + */ + closeOnHover?: boolean; + /** + * Html for the close button. + */ closeHtml?: string; /** - * Should clicking on toast dismiss it? - */ + * onCloseClick function callback, fired when the close button is clicked. + * Closing cannot be prevented by ev.stopPropagation() etc. + * @default undefined + */ + onCloseClick?: (ev: JQueryMouseEventObject) => void; + /** + * Should clicking on toast dismiss it? + * @default true + */ tapToDismiss?: boolean; /** - * CSS class the toast element will be given - */ + * CSS class the toast element will be given. + * @default toast + */ toastClass?: string; /** - * Id toast container will be given - */ + * Id toast container will be given. + * @default toast-container + */ containerId?: string; /** - * Should debug details be outputted to the console - */ + * Should debug details be outputted to the console? + * @default false + */ debug?: boolean; /** - * Time in milliseconds the toast should take to show - */ + * Time in milliseconds the toast should take to show. + * @default 300 + */ showDuration?: number; /** - * onShown function callback - **/ + * onShown function callback. + * @default undefined + */ onShown?: () => void; /** - * Time in milliseconds the toast should take to hide - */ + * Time in milliseconds the toast should take to hide. + * @default 1000 + */ hideDuration?: number; /** - * onHidden function callback - **/ + * onHidden function callback. + * @default undefined + */ onHidden?: () => void; /** - * Time in milliseconds the toast should be displayed after mouse over - */ + * Time in milliseconds the toast should be displayed after leaving mouse over. + * Set timeOut and extendedTimeOut to 0 to make it sticky. + * @default 1000 + */ extendedTimeOut?: number; + /** + * If specified, you must provide all classes. + */ iconClasses?: { /** - * Icon to use on error toasts - */ + * Icon to use on error toasts. + * @default toast-error + */ error: string; /** - * Icon to use on info toasts - */ + * Icon to use on info toasts. + * @default toast-info + */ info: string; /** - * Icon to use on success toasts - */ + * Icon to use on success toasts. + * @default toast-success + */ success: string; /** - * Icon to use on warning toasts - */ + * Icon to use on warning toasts. + * @default toast-warning + */ warning: string; }; /** - * Icon to use for toast - */ + * Icon to use for toast. + * @default toast-info + */ iconClass?: string; /** - * Where toast should be displayed - */ + * Where toast should be displayed. + * The default stylesheet covers: + * toast-top-left, toast-top-center, toast-top-right, toast-top-full-width, + * toast-bottom-left, toast-bottom-center, toast-bottom-right, toast-bottom-full-width + * @default toast-top-right + */ positionClass?: string; /** - * Where toast should be displayed - background - */ - backgroundpositionClass?: string; - /** - * Time in milliseconds that the toast should be displayed - */ + * Time in milliseconds that the toast should be displayed. + * Set timeOut and extendedTimeOut to 0 to make it sticky. + * @default 5000 + */ timeOut?: number; /** - * CSS class the title element will be given - */ + * CSS class the title element will be given. + * @default toast-title + */ titleClass?: string; /** - * CSS class the message element will be given - */ + * CSS class the message element will be given. + * @default toast-message + */ messageClass?: string; /** - * Set newest toast to appear on top - **/ + * Set newest toast to appear on top. + * @default true + */ newestOnTop?: boolean; /** - * The element to put the toastr container - **/ + * The element to put the toastr container + * @default body + */ target?: string; /** - * Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to the previous toast based on their message content. - */ + * Rather than having identical toasts stack, set the preventDuplicates property to true. + * Duplicates are matched to the previous toast based on their message content. + * @default false + */ preventDuplicates?: boolean; /** - * Visually indicates how long before a toast expires. - */ + * Visually indicates how long before a toast expires. + * @default false + */ progressBar?: boolean; /** - * Function to execute on toast click - */ - onclick?: () => void; + * CSS class the progressbar element will be given. + * @default toast-progress + */ + progressClass?: string; /** - * Set if toastr should parse containing html - **/ - allowHtml?: boolean; + * Function to execute on toast click. Closing cannot be prevented by ev.stopPropagation() etc. + * @default undefined + */ + onclick?: (ev: JQueryMouseEventObject) => void; /** - * Set if toastr should escape html - **/ + * Should the title and message text be escaped? + * @default false + */ escapeHtml?: boolean; + /** + * Flip the toastr to be displayed properly for right-to-left languages. + * @default false + */ + rtl?: boolean; } interface ToastrDisplayMethod { /** - * Create a toast - * - * @param message Message to display in toast - */ + * Create a toast + * + * @param message Message to display in toast + */ (message: string): JQuery; /** - * Create a toast - * - * @param message Message to display in toast - * @param title Title to display on toast - */ + * Create a toast + * + * @param message Message to display in toast + * @param title Title to display on toast + */ (message: string, title: string): JQuery; /** - * Create a toast - * - * @param message Message to display in toast - * @param title Title to display on toast - * @param overrides Option values for toast - */ + * Create a toast + * + * @param message Message to display in toast + * @param title Title to display on toast + * @param overrides Option values for toast + */ (message: string, title: string, overrides: ToastrOptions): JQuery; } +type ToastrType = 'error'|'info'|'success'|'warning'; + +interface ToastMap { + /** + * The toast type. + */ + type: ToastrType; + /** + * The toast message. + */ + message: string; + /** + * The toast icon class. + */ + iconClass: string; + /** + * The toast title. + */ + title?: string; + /** + * Any override options specified when the toast was created. + */ + optionsOverride?: ToastrOptions; +} + +interface ToastrResponse { + /** + * The internal toast id. + */ + toastId: number; + /** + * The current state of the toast. + */ + state: 'visible'|'hidden'; + /** + * The datetime the toast was opened. + */ + startTime: Date; + /** + * The datetime the toast was closed, if the state is hidden. + */ + endTime?: Date; + /** + * The toastr options. + */ + options: ToastrOptions; + /** + * The event's toast details. + */ + map: ToastMap; +} + interface Toastr { /** - * Clear toasts - */ + * Clear toasts + */ clear: { /** - * Clear all toasts - */ + * Clear all toasts + */ (): void; /** - * Clear specific toast - * - * @param toast Toast to clear - */ + * Clear specific toast + * + * @param toast Toast to clear + */ (toast: JQuery): void; - /** - * Clear specific toast - * - * @param toast Toast to clear - * @param clearOptions force clearing a toast, ignoring focus - */ - (toast: JQuery, clearOptions: { force: boolean }): void; + /** + * Clear specific toast + * + * @param toast Toast to clear + * @param clearOptions force clearing a toast, ignoring focus + */ + (toast: JQuery, clearOptions: {force: boolean}): void; }; /** - * Removes all toasts (without animation) - */ + * Removes all toasts (without animation) + */ remove: { (): void; }; /** - * Create an error toast - */ + * Create an error toast + */ error: ToastrDisplayMethod; /** - * Create an info toast - */ + * Create an info toast + */ info: ToastrDisplayMethod; /** - * Create an options object - */ + * The toatsr options object + */ options: ToastrOptions; /** - * Create a success toast - */ + * Create a success toast + */ success: ToastrDisplayMethod; /** - * Create a warning toast - */ + * Create a warning toast + */ warning: ToastrDisplayMethod; /** - * Get toastr version - */ + * Get toastr version + */ version: string; + /** + * Get or create a container. + */ + getContainer: { + /** + * Get the container by options.containerId. + * + * @param options Option values for the container + */ + (options?: ToastrOptions): JQuery, + /** + * Get the container by options.containerId. + * If it doesn't exist, it will be created according to options. + * + * @param options Option values for the container + * @param create Use true to create a container, if it doesn't exist + */ + (options: ToastrOptions, create: boolean): JQuery, + }; + /** + * Register a callback to be called when a toast gets created or hidden. + * + * @param callback The function which will be passed the event details. + */ + subscribe: (callback: (response: ToastrResponse) => any) => void; [key: string]: any; } From 9fe2a2f8e85270077d94eaaa12affcaa6028efe6 Mon Sep 17 00:00:00 2001 From: Brian Donovan Date: Sun, 5 Mar 2017 13:17:55 -0800 Subject: [PATCH 290/797] Update type definitions for bablyon. The list of available plugins changed, with `estree` and `dynamicImport` being added and `asyncFunctions`, `exponentiationOperator`, and `trailingFunctionCommas` being removed. - [v6.16.0](https://github.com/babel/babylon/blob/v6.16.1/CHANGELOG.md#6160-2017-02-23): `estree` added - [v6.12.0](https://github.com/babel/babylon/blob/v6.16.1/CHANGELOG.md#v6120-2016-10-14): `dynamicImport` added - [v6.9.1](https://github.com/babel/babylon/blob/v6.16.1/CHANGELOG.md#691-2016-08-23): `asyncFunctions`, `exponentiationOperator`, `trailingFunctionCommas` removed --- babylon/index.d.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/babylon/index.d.ts b/babylon/index.d.ts index 45b929264d..4400a8f1a0 100644 --- a/babylon/index.d.ts +++ b/babylon/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for babylon v6.7 +// Type definitions for babylon v6.16.1 // Project: https://github.com/babel/babylon // Definitions by: Troy Gerwien // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -41,7 +41,17 @@ export interface BabylonOptions { plugins?: PluginName[]; } -export type PluginName = 'jsx' | 'flow' | 'asyncFunctions' | 'classConstructorCall' | 'doExpressions' - | 'trailingFunctionCommas' | 'objectRestSpread' | 'decorators' | 'classProperties' | 'exportExtensions' - | 'exponentiationOperator' | 'asyncGenerators' | 'functionBind' | 'functionSent' | '*'; - +export type PluginName = + 'estree' | + 'jsx' | + 'flow' | + 'classConstructorCall' | + 'doExpressions' | + 'objectRestSpread' | + 'decorators' | + 'classProperties' | + 'exportExtensions' | + 'asyncGenerators' | + 'functionBind' | + 'functionSent' | + 'dynamicImport'; From 5e762d799d6779106c33b899ed71839501b1443a Mon Sep 17 00:00:00 2001 From: Anton Kandybo Date: Mon, 6 Mar 2017 01:18:30 +0200 Subject: [PATCH 291/797] Add compression-webpack-plugin --- .../compression-webpack-plugin-tests.ts | 14 +++++++ compression-webpack-plugin/index.d.ts | 40 +++++++++++++++++++ compression-webpack-plugin/tsconfig.json | 20 ++++++++++ compression-webpack-plugin/tslint.json | 7 ++++ 4 files changed, 81 insertions(+) create mode 100644 compression-webpack-plugin/compression-webpack-plugin-tests.ts create mode 100644 compression-webpack-plugin/index.d.ts create mode 100644 compression-webpack-plugin/tsconfig.json create mode 100644 compression-webpack-plugin/tslint.json diff --git a/compression-webpack-plugin/compression-webpack-plugin-tests.ts b/compression-webpack-plugin/compression-webpack-plugin-tests.ts new file mode 100644 index 0000000000..4ee93c78b7 --- /dev/null +++ b/compression-webpack-plugin/compression-webpack-plugin-tests.ts @@ -0,0 +1,14 @@ +import { Configuration } from 'webpack' +import * as CompressionPlugin from 'compression-webpack-plugin' + +const c: Configuration = { + plugins: [ + new CompressionPlugin({ + asset: "[path].gz[query]", + algorithm: "gzip", + test: /\.js$|\.html$/, + threshold: 10240, + minRatio: 0.8 + }) + ] +}; diff --git a/compression-webpack-plugin/index.d.ts b/compression-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..cf65f55300 --- /dev/null +++ b/compression-webpack-plugin/index.d.ts @@ -0,0 +1,40 @@ +// Type definitions for compression-webpack-plugin 0.3.2 +// Project: https://github.com/webpack-contrib/compression-webpack-plugin +// Definitions by: Anton Kandybo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'webpack'; + +export = CompressionPlugin; + +declare class CompressionPlugin extends Plugin { + constructor(options?: CompressionPlugin.Options); +} + +declare namespace CompressionPlugin { + export interface Options { + asset?: string; + algorithm?: string; + test?: RegExp | RegExp[]; + regExp?: RegExp | RegExp[]; + threshold?: number; + minRatio?: number; + + // zopfli options + verbose?: boolean; + verbose_more?: boolean; + numiterations?: number; + blocksplitting?: boolean; + blocksplittinglast?: boolean; + blocksplittingmax?: number; + + // zlib options + level?: number; + flush?: number; + chunkSize?: number; + windowBits?: number; + memLevel?: number; + strategy?: number; + dictionary?: any; + } +} diff --git a/compression-webpack-plugin/tsconfig.json b/compression-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..f9c84d64f8 --- /dev/null +++ b/compression-webpack-plugin/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", + "compression-webpack-plugin-tests.ts" + ] +} diff --git a/compression-webpack-plugin/tslint.json b/compression-webpack-plugin/tslint.json new file mode 100644 index 0000000000..02312e1c7d --- /dev/null +++ b/compression-webpack-plugin/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "../tslint.json", + "rules": { + "dt-header": false + } + } + \ No newline at end of file From 972fc4d5606f96fc50b01bf2578f2cff786dd3a7 Mon Sep 17 00:00:00 2001 From: Anton Kandybo Date: Mon, 6 Mar 2017 01:26:47 +0200 Subject: [PATCH 292/797] Added es6 lib --- compression-webpack-plugin/tsconfig.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compression-webpack-plugin/tsconfig.json b/compression-webpack-plugin/tsconfig.json index f9c84d64f8..70383d3658 100644 --- a/compression-webpack-plugin/tsconfig.json +++ b/compression-webpack-plugin/tsconfig.json @@ -2,6 +2,9 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": [ + "es6" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, From 92be25fe09e45373607ca5c247622becc08a2751 Mon Sep 17 00:00:00 2001 From: Marcel Good Date: Sun, 5 Mar 2017 17:08:47 -0800 Subject: [PATCH 293/797] Update breeze-client type definitions --- breeze/index.d.ts | 104 ++++++++++++++++++++++++++-------------------- 1 file changed, 60 insertions(+), 44 deletions(-) diff --git a/breeze/index.d.ts b/breeze/index.d.ts index 8cc109d746..323e9a8f87 100644 --- a/breeze/index.d.ts +++ b/breeze/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Breeze 1.5.x +// Type definitions for Breeze 1.6.3 // Project: http://www.breezejs.com/ // Definitions by: Boris Yankov , IdeaBlade // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -12,7 +12,10 @@ // Updated Jan 20 2015 for Breeze 1.5.2 and merging changes from DefinitelyTyped // Updated Feb 28 2015 add any/all clause on Predicate // Updated Jun 27 2016 - Marcel Good (www.ideablade.com) -// Updated Jul 28 2016 - Serkan "coni2k" Holat +// Updated Jun 29 2016 - Marcel Good (www.ideablade.com) +// Updated Jul 15 2016 - Added methods to JsonResultsAdapter - Steve Schmitt +// Updated Sep 23 2016 - Added core methods +// Updated March 5 2017 - Eliminate promises.IPromise and replace with Promise declare namespace breeze.core { @@ -89,6 +92,19 @@ declare namespace breeze.core { export function stringStartsWith(str: string, prefix: string): boolean; export function stringEndsWith(str: string, suffix: string): boolean; export function formatString(format: string, ...args: any[]): string; + + /** Change text to title case with spaces, e.g. 'myPropertyName12' to 'My Property Name 12' */ + export function titleCase(str: string): string; + + /** Return the ES5 property descriptor for the property, which may be on a prototype of the object */ + export function getPropertyDescriptor(obj: any, propertyName: string): PropertyDescriptor + + /** safely perform toJSON logic on objects with cycles. Replacer function can map or exclude properties. */ + export function toJSONSafe(obj: any, replacer: (prop: string, val: any) => any): any + + /** Default value replacer for toJSONSafe. Replaces entityAspect and other internal properties with undefined. */ + export function toJSONSafeReplacer(prop: string, val: any): any + } declare namespace breeze { @@ -214,19 +230,23 @@ declare namespace breeze { export class DataServiceAdapter { checkForRecomposition(interfaceInitializedArgs: { interfaceName: string; isDefault: boolean }): void; initialize(): void; - fetchMetadata(metadataStore: MetadataStore, dataService: DataService): breeze.promises.IPromise; - executeQuery(mappingContext: { getUrl: () => string; query: EntityQuery; dataService: DataService }): breeze.promises.IPromise; - saveChanges(saveContext: { resourceName: string; dataService: DataService }, saveBundle: Object): breeze.promises.IPromise; + fetchMetadata(metadataStore: MetadataStore, dataService: DataService): Promise; + executeQuery(mappingContext: { getUrl: () => string; query: EntityQuery; dataService: DataService }): Promise; + saveChanges(saveContext: { resourceName: string; dataService: DataService }, saveBundle: Object): Promise; JsonResultsAdapter: JsonResultsAdapter; } export class JsonResultsAdapter { name: string; extractResults: (data: {}) => {}; + extractSaveResults: (data: {}) => any[]; + extractKeyMappings: (data: {}) => KeyMapping[]; visitNode: (node: {}, queryContext: QueryContext, nodeContext: NodeContext) => { entityType?: EntityType; nodeId?: any; nodeRefId?: any; ignore?: boolean; }; constructor(config: { name: string; extractResults?: (data: {}) => {}; + extractSaveResults?: (data: {}) => any[]; + extractKeyMappings?: (data: {}) => KeyMapping[]; visitNode: (node: {}, queryContext: QueryContext, nodeContext: NodeContext) => { entityType?: EntityType; nodeId?: any; nodeRefId?: any; ignore?: boolean; }; }); } @@ -241,6 +261,7 @@ declare namespace breeze { export interface NodeContext { nodeType: string; + propertyName: string; } export class DataTypeSymbol extends breeze.core.EnumSymbol { @@ -333,8 +354,8 @@ declare namespace breeze { isNavigationPropertyLoaded(navigationProperty: string): boolean; isNavigationPropertyLoaded(navigationProperty: NavigationProperty): boolean; - loadNavigationProperty(navigationProperty: string, callback?: Function, errorCallback?: Function): breeze.promises.IPromise; - loadNavigationProperty(navigationProperty: NavigationProperty, callback?: Function, errorCallback?: Function): breeze.promises.IPromise; + loadNavigationProperty(navigationProperty: string, callback?: Function, errorCallback?: Function): Promise; + loadNavigationProperty(navigationProperty: NavigationProperty, callback?: Function, errorCallback?: Function): Promise; rejectChanges(): void; @@ -423,16 +444,16 @@ declare namespace breeze { createEntity(typeName: string, config?: {}, entityState?: EntityStateSymbol, mergeStrategy?: MergeStrategySymbol): Entity; createEntity(entityType: EntityType, config?: {}, entityState?: EntityStateSymbol, mergeStrategy?: MergeStrategySymbol): Entity; detachEntity(entity: Entity): boolean; - executeQuery(query: string, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): breeze.promises.IPromise; - executeQuery(query: EntityQuery, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): breeze.promises.IPromise; + executeQuery(query: string, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Promise; + executeQuery(query: EntityQuery, callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Promise; executeQueryLocally(query: EntityQuery): Entity[]; exportEntities(entities?: Entity[], includeMetadata?: boolean): string; exportEntities(entities?: Entity[], options?: ExportEntitiesOptions): any; // string | Object - fetchEntityByKey(typeName: string, keyValue: any, checkLocalCacheFirst?: boolean): breeze.promises.IPromise; - fetchEntityByKey(typeName: string, keyValues: any[], checkLocalCacheFirst?: boolean): breeze.promises.IPromise; - fetchEntityByKey(entityKey: EntityKey): breeze.promises.IPromise; - fetchMetadata(callback?: (schema: any) => void, errorCallback?: breeze.core.ErrorCallback): breeze.promises.IPromise; + fetchEntityByKey(typeName: string, keyValue: any, checkLocalCacheFirst?: boolean): Promise; + fetchEntityByKey(typeName: string, keyValues: any[], checkLocalCacheFirst?: boolean): Promise; + fetchEntityByKey(entityKey: EntityKey): Promise; + fetchMetadata(callback?: (schema: any) => void, errorCallback?: breeze.core.ErrorCallback): Promise; generateTempKeyValue(entity: Entity): any; getChanges(): Entity[]; getChanges(entityTypeName: string): Entity[]; @@ -466,7 +487,7 @@ declare namespace breeze { importEntities(exportedData: Object, config?: { mergeStrategy?: MergeStrategySymbol; metadataVersionFn?: (any: any) => void }): { entities: Entity[]; tempKeyMapping: { [key: string]: EntityKey } }; rejectChanges(): Entity[]; - saveChanges(entities?: Entity[], saveOptions?: SaveOptions, callback?: SaveChangesSuccessCallback, errorCallback?: SaveChangesErrorCallback): breeze.promises.IPromise; + saveChanges(entities?: Entity[], saveOptions?: SaveOptions, callback?: SaveChangesSuccessCallback, errorCallback?: SaveChangesErrorCallback): Promise; setProperties(config: EntityManagerProperties): void; } @@ -554,7 +575,7 @@ declare namespace breeze { /** Create query from an expression tree */ constructor(tree: Object); - execute(callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): breeze.promises.IPromise; + execute(callback?: ExecuteQuerySuccessCallback, errorCallback?: ExecuteQueryErrorCallback): Promise; executeLocally(): Entity[]; expand(propertyPaths: string[]): EntityQuery; expand(propertyPaths: string): EntityQuery; @@ -591,6 +612,8 @@ declare namespace breeze { where(property: string, filterop: FilterQueryOpSymbol, property2: string, filterop2: FilterQueryOpSymbol, value: any): EntityQuery; // for any/all clauses where(property: string, filterop: string, property2: string, filterop2: string, value: any): EntityQuery; // for any/all clauses where(predicate: FilterQueryOpSymbol): EntityQuery; + where(anArray: IRecursiveArray): EntityQuery; + withParameters(params: Object): EntityQuery; toJSON(): string; @@ -721,13 +744,14 @@ declare namespace breeze { addDataService(dataService: DataService, shouldOverwrite?: boolean): void; addEntityType(structuralType: IStructuralType): void; exportMetadata(): string; - fetchMetadata(dataService: string, callback?: (data: any) => void, errorCallback?: breeze.core.ErrorCallback): breeze.promises.IPromise; - fetchMetadata(dataService: DataService, callback?: (data: any) => void, errorCallback?: breeze.core.ErrorCallback): breeze.promises.IPromise; + fetchMetadata(dataService: string, callback?: (data: any) => void, errorCallback?: breeze.core.ErrorCallback): Promise; + fetchMetadata(dataService: DataService, callback?: (data: any) => void, errorCallback?: breeze.core.ErrorCallback): Promise; getDataService(serviceName: string): DataService; getEntityType(entityTypeName: string, okIfNotFound?: boolean): IStructuralType; getEntityTypes(): IStructuralType[]; hasMetadataFor(serviceName: string): boolean; static importMetadata(exportedString: string): MetadataStore; + static normalizeTypeName(typeName: string): string; importMetadata(exportedString: string, allowMerge?: boolean): MetadataStore; isEmpty(): boolean; registerEntityTypeCtor(entityTypeName: string, entityCtor: Function, initializationFn?: (entity: Entity) => void, noTrackingFn?: (node: Object, entityType: EntityType) => Object): void; @@ -796,7 +820,7 @@ declare namespace breeze { export interface IRecursiveArray { [i: number]: T | IRecursiveArray; } - + export class Predicate { constructor(); constructor(property: string, operator: string, value: any); @@ -904,10 +928,16 @@ declare namespace breeze { export interface SaveResult { entities: Entity[]; - keyMappings: any; + keyMappings: KeyMapping[]; XHR: XMLHttpRequest; } + export interface KeyMapping { + entityTypeName: string; + tempValue: any; + realValue: any; + } + export class ValidationError { key: string; context: any; @@ -993,7 +1023,7 @@ declare namespace breeze { /** Creates a regular expression validator with a fixed expression. */ static makeRegExpValidator(validatorName: string, expression: RegExp, defaultMessage: string, context?: any): Validator; - /** Run this validator against the specified value. + /** Run this validator against the specified value. @param value {Object} Value to validate @param additionalContext {Object} Any additional contextual information that the Validator can make use of. @return {ValidationError|null} A ValidationError if validation fails, null otherwise */ @@ -1044,20 +1074,16 @@ declare namespace breeze.config { @return {an instance of the specified adapter} **/ export function getAdapterInstance(interfaceName: string, adapterName?: string): Object; - - export interface Adapter { - getRoutePrefix: Function - } /** - Initializes a single adapter implementation. Initialization means either newing a instance of the + Initializes a single adapter implementation. Initialization means either newing a instance of the specified interface and then calling "initialize" on it or simply calling "initialize" on the instance if it already exists. @param interfaceName {String} The name of the interface to which the adapter to initialize belongs. @param adapterName {String} - The name of a previously registered adapter to initialize. - @param isDefault=true {Boolean} - Whether to make this the default "adapter" for this interface. + @param isDefault=true {Boolean} - Whether to make this the default "adapter" for this interface. @return {an instance of the specified adapter} **/ - export function initializeAdapterInstance(interfaceName: string, adapterName: string, isDefault?: boolean): Adapter; + export function initializeAdapterInstance(interfaceName: string, adapterName: string, isDefault?: boolean): Object; export interface AdapterInstancesConfig { /** the name of a previously registered "ajax" adapter */ @@ -1080,15 +1106,15 @@ declare namespace breeze.config { export var objectRegistry: Object; /** Method use to register implementations of standard breeze interfaces. Calls to this method are usually - made as the last step within an adapter implementation. + made as the last step within an adapter implementation. @param interfaceName {String} - one of the following interface names "ajax", "dataService" or "modelLibrary" - @param adapterCtor {Function} - an ctor function that returns an instance of the specified interface. + @param adapterCtor {Function} - an ctor function that returns an instance of the specified interface. **/ export function registerAdapter(interfaceName: string, adapterCtor: Function): void; export function registerFunction(fn: Function, fnName: string): void; export function registerType(ctor: Function, typeName: string): void; //static setProperties(config: Object): void; //deprecated - /** + /** Set the promise implementation, if Q.js is not found. @param q - implementation of promise. @see http://wiki.commonjs.org/wiki/Promises/A */ @@ -1101,27 +1127,17 @@ declare namespace breeze.config { /** Promises interface used by Breeze. Usually implemented by Q (https://github.com/kriskowal/q) or angular.$q using breeze.config.setQ(impl) */ declare namespace breeze.promises { - export interface IPromise { - then(onFulfill: (value: T) => U, onReject?: (reason: any) => U): IPromise; - then(onFulfill: (value: T) => IPromise, onReject?: (reason: any) => U): IPromise; - then(onFulfill: (value: T) => U, onReject?: (reason: any) => IPromise): IPromise; - then(onFulfill: (value: T) => IPromise, onReject?: (reason: any) => IPromise): IPromise; - catch(onRejected: (reason: any) => U): IPromise; - catch(onRejected: (reason: any) => IPromise): IPromise; - finally(finallyCallback: () => any): IPromise; - } - export interface IDeferred { - promise: IPromise; + promise: Promise; resolve(value: T): void; reject(reason: any): void; } export interface IPromiseService { defer(): IDeferred; - reject(reason?: any): IPromise; - resolve(object: T): IPromise; - resolve(object: IPromise): IPromise; + reject(reason?: any): Promise; + resolve(object: T): Promise; + resolve(object: Promise): Promise; } } From da5139066741bd05d72d981936a696ddda51be4e Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 6 Mar 2017 14:35:08 +1100 Subject: [PATCH 294/797] tidy up some linting warnings --- fs-extra/fs-extra-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index 896d6411f7..26ad80ffb4 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -2,7 +2,7 @@ /// import fs = require('fs-extra'); -import * as Path from 'path' +import * as Path from 'path'; var src: string; var dest: string; @@ -22,7 +22,7 @@ fs.copy(src, dest, { clobber: true, preserveTimestamps: true, - filter: (src: string) => {return false} + filter: (src: string) => { return false; } }, errorCallback ); @@ -43,7 +43,7 @@ fs.copySync(src, dest, { clobber: true, preserveTimestamps: true, - filter: (src: string) => {return false} + filter: (src: string) => { return false; } } ); fs.copySync(src, dest, From 23de3bee82fd19f2178a7179b9f649feba771210 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 6 Mar 2017 14:35:29 +1100 Subject: [PATCH 295/797] walk and walkSync now live in different packages --- fs-extra/fs-extra-tests.ts | 32 -------------------------------- fs-extra/index.d.ts | 3 --- 2 files changed, 35 deletions(-) diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index 26ad80ffb4..f2056d3e06 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -102,35 +102,3 @@ fs.ensureSymlink(path, errorCallback); fs.ensureSymlinkSync(path); fs.emptyDir(path, errorCallback); fs.emptyDirSync(path); - -var items: string[]; -fs.walk("my-path") - .on('data', function (item) { - items.push(item.path); - }) - .on('end', function () { - console.dir(items); - }); - -const ignoreHiddenFiles = (item: string): boolean => { - const basename = Path.basename(item) - return basename === '.' || basename[0] !== '.' -} - -const sortPaths = (left: string, right: string) => left.localeCompare(right); - -const options = { - filter: ignoreHiddenFiles, - pathSorter: sortPaths -} - -fs.walk(path, options) - .on('readable', function (this: fs.PathEntryStream) { - let item: fs.PathEntry | undefined - while ((item = this.read())) { - items.push(item.path) - } - }) - .on('end', function () { - - }) diff --git a/fs-extra/index.d.ts b/fs-extra/index.d.ts index 2cc47724c8..e30426321e 100644 --- a/fs-extra/index.d.ts +++ b/fs-extra/index.d.ts @@ -120,9 +120,6 @@ export type PathEntryStream = { read(): PathEntry | null } -export function walk(path: string, options?: WalkOptions): WalkEventEmitter; -export function walkSync(path: string): ReadonlyArray; - export interface CopyFilterFunction { (src: string): boolean } From 64708242be98bb708fe877226d7970aa34219b2b Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 6 Mar 2017 14:38:18 +1100 Subject: [PATCH 296/797] tag the version for fs-extra --- fs-extra/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs-extra/index.d.ts b/fs-extra/index.d.ts index e30426321e..e17b47115f 100644 --- a/fs-extra/index.d.ts +++ b/fs-extra/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for fs-extra +// Type definitions for fs-extra v2.0.0 // Project: https://github.com/jprichardson/node-fs-extra // Definitions by: midknight41 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 416210d5bbfba701abb723c8c7855d9bcd56258e Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 6 Mar 2017 14:38:30 +1100 Subject: [PATCH 297/797] add myself as a reviewer --- fs-extra/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs-extra/index.d.ts b/fs-extra/index.d.ts index e17b47115f..57f4a6fb24 100644 --- a/fs-extra/index.d.ts +++ b/fs-extra/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for fs-extra v2.0.0 // Project: https://github.com/jprichardson/node-fs-extra -// Definitions by: midknight41 +// Definitions by: midknight41 , Brendan Forster // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Imported from: https://github.com/soywiz/typescript-node-definitions/fs-extra.d.ts From 4b40d74d0bf7ea8b9abd1553ca7d6a643e72b9e4 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 6 Mar 2017 15:30:29 +1100 Subject: [PATCH 298/797] sketching out the type declarations for klaw-sync --- klaw-sync/index.d.ts | 37 ++++++++++++++++++++++++++++++++++++ klaw-sync/klaw-sync-tests.ts | 20 +++++++++++++++++++ klaw-sync/tsconfig.json | 22 +++++++++++++++++++++ klaw-sync/tslint.json | 9 +++++++++ 4 files changed, 88 insertions(+) create mode 100644 klaw-sync/index.d.ts create mode 100644 klaw-sync/klaw-sync-tests.ts create mode 100644 klaw-sync/tsconfig.json create mode 100644 klaw-sync/tslint.json diff --git a/klaw-sync/index.d.ts b/klaw-sync/index.d.ts new file mode 100644 index 0000000000..09342094e0 --- /dev/null +++ b/klaw-sync/index.d.ts @@ -0,0 +1,37 @@ +// Type definitions for klaw-sync v1.1.2 +// Project: https://github.com/manidlou/node-klaw-sync +// Definitions by: Brendan Forster +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as fs from "fs" + +interface Item { + path: string + stats: fs.Stats +} + +interface Options { + /** + * any paths or `micromatch` patterns to ignore. + * + * For more information on micromatch patterns: https://github.com/jonschlinkert/micromatch#features + */ + ignore?: string | string[] + /** + * True to only return files (ignore directories). + * + * Defaults to false if not specified. + */ + nodir?: boolean + /** + * True to only return directories (ignore files). + * + * Defaults to false if not specified. + */ + nofile?: boolean +} + +export function klawSync(root: string, options?: Options): ReadonlyArray + diff --git a/klaw-sync/klaw-sync-tests.ts b/klaw-sync/klaw-sync-tests.ts new file mode 100644 index 0000000000..5c2b806108 --- /dev/null +++ b/klaw-sync/klaw-sync-tests.ts @@ -0,0 +1,20 @@ +import { klawSync, Item } from "klaw-sync" +import * as path from "path" + +const outputMessage = (result: Item) => { + console.log(`file: ${result.path} has size '${result.stats.size}'`) +} + +klawSync('/some/dir').forEach(outputMessage) + +const defaultOptions = { } + +klawSync('/some/dir', defaultOptions).forEach(outputMessage) + +const options = { + ignore: [ '.exe' ], + nodir: true, + nofile: false +} + +klawSync('/some/dir', options).forEach(outputMessage) diff --git a/klaw-sync/tsconfig.json b/klaw-sync/tsconfig.json new file mode 100644 index 0000000000..ca120a7ba3 --- /dev/null +++ b/klaw-sync/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", + "klaw-sync-tests.ts" + ] +} diff --git a/klaw-sync/tslint.json b/klaw-sync/tslint.json new file mode 100644 index 0000000000..7cf0e1c353 --- /dev/null +++ b/klaw-sync/tslint.json @@ -0,0 +1,9 @@ +{ + "extends": "../tslint.json", + "rules": { + "semicolon": [ + true, + "never" + ] + } +} From a413462a324b22d0bccb073ac9fd5de6b85e6a7e Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Mon, 6 Mar 2017 15:51:14 +1100 Subject: [PATCH 299/797] correct version to align with rules --- klaw-sync/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/klaw-sync/index.d.ts b/klaw-sync/index.d.ts index 09342094e0..d344879e1a 100644 --- a/klaw-sync/index.d.ts +++ b/klaw-sync/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for klaw-sync v1.1.2 +// Type definitions for klaw-sync 1.1 // Project: https://github.com/manidlou/node-klaw-sync // Definitions by: Brendan Forster // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From a17e430cf3ebcdb0d9cdcb832e418d2bb146c322 Mon Sep 17 00:00:00 2001 From: Juan Arroyave Date: Mon, 6 Mar 2017 10:45:14 +0100 Subject: [PATCH 300/797] added series and pararell method to be able to use gulp 4.0.x using typescript --- gulp/index.d.ts | 71 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/gulp/index.d.ts b/gulp/index.d.ts index 89b1a5dfa5..afc653feae 100644 --- a/gulp/index.d.ts +++ b/gulp/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Gulp v3.8.x +// Type definitions for Gulp v4.0.x // Project: http://gulpjs.com // Definitions by: Drew Noakes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,6 +11,8 @@ import Orchestrator = require("orchestrator"); import VinylFile = require("vinyl"); +declare type Strings = string|string[]; + declare namespace gulp { interface Gulp extends Orchestrator { /** @@ -24,6 +26,28 @@ declare namespace gulp { * */ task: Orchestrator.AddMethod; + /** + * Takes a number of task names or functions and returns a function of the composed tasks or functions + * When the returned function is executed, the tasks or functions will be executed in series, + * each waiting for the prior to finish. If an error occurs, execution will stop. + * @param A task name, a function or an array of either. + *
    + *
  • Take in a callback
  • + *
  • Return a stream or a promise
  • + *
+ */ + series: SeriesMethod; + /** + * Takes a number of task names or functions and returns a function of the composed tasks or functions + * When the returned function is executed, the tasks or functions will be executed in parallel, + * all being executed at the same time. If an error occurs, all execution will complete. + * @param A task name, a function or an array of either. + *
    + *
  • Take in a callback
  • + *
  • Return a stream or a promise
  • + *
+ */ + parallel: ParallelMethod; /** * Emits files matching provided glob or an array of globs. Returns a stream of Vinyl files that can be piped to plugins. * @param glob Glob or array of globs to read. @@ -105,6 +129,51 @@ declare namespace gulp { */ (glob: string|string[], opt?: SrcOptions): NodeJS.ReadWriteStream; } + interface SeriesMethod { + /** + * Takes a number of task names or functions and returns a function of the composed tasks or functions. + * When using task names, the task should already be registered. + * When the returned function is executed, the tasks or functions will be executed in series, + * each waiting for the prior to finish. If an error occurs, execution will stop. + * @param tasks, string, function or array of both. + */ + (...tasks: string[]): NodeJS.EventEmitter; + + (...tasks: Function[]): NodeJS.EventEmitter; + + (task: string|string[], ...fn: Function[]): NodeJS.EventEmitter; + + //TODO: TypeScript cannot express varargs followed by callback as a last argument... + (task1: Strings, task2: Strings, cb?: (error?: any) => any): Function; + (task1: Strings, task2: Strings, task3: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; + (task1: Strings, task2: Strings, task3: Strings, task4: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; + (task1: Strings, task2: Strings, task3: Strings, task4: Strings, task5: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; + (task1: Strings, task2: Strings, task3: Strings, task4: Strings, task5: Strings, task6: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; + + } + + interface ParallelMethod { + /** + * Takes a number of task names or functions and returns a function of the composed tasks or functions. + * When using task names, the task should already be registered. + * When the returned function is executed, the tasks or functions will be executed in parallel, + * all being executed at the same time. If an error occurs, all execution will complete. + * @param tasks, string, function or array of both. + */ + (...tasks: string[]): NodeJS.EventEmitter; + + (...tasks: Function[]): NodeJS.EventEmitter; + + (task: string|string[], ...fn: Function[]): NodeJS.EventEmitter; + + //TODO: TypeScript cannot express varargs followed by callback as a last argument... + (task1: Strings, task2: Strings, cb?: (error?: any) => any): Function; + (task1: Strings, task2: Strings, task3: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; + (task1: Strings, task2: Strings, task3: Strings, task4: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; + (task1: Strings, task2: Strings, task3: Strings, task4: Strings, task5: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; + (task1: Strings, task2: Strings, task3: Strings, task4: Strings, task5: Strings, task6: Strings, cb?: (error?: any) => any): NodeJS.EventEmitter; + + } /** * Options to pass to node-glob through glob-stream. From 96bb6e6020af00c6068307c979461d0992f91eb0 Mon Sep 17 00:00:00 2001 From: Juan Arroyave Date: Mon, 6 Mar 2017 10:51:35 +0100 Subject: [PATCH 301/797] added compatibility with gulp 4.0.x --- gulp/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulp/index.d.ts b/gulp/index.d.ts index afc653feae..9f3e7d96ba 100644 --- a/gulp/index.d.ts +++ b/gulp/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Gulp v4.0.x // Project: http://gulpjs.com -// Definitions by: Drew Noakes +// Definitions by: Drew Noakes , Juan Arroyave // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From f3840dd3df0da771a82f174958bc376e6ef02d99 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Mon, 6 Mar 2017 10:54:34 +0100 Subject: [PATCH 302/797] Underscore: A bunch of fixes, and added a lot of "or undefined" for strict nulls. --- underscore/index.d.ts | 115 +++++++++++++++++---------------- underscore/underscore-tests.ts | 2 +- 2 files changed, 61 insertions(+), 56 deletions(-) diff --git a/underscore/index.d.ts b/underscore/index.d.ts index 48452b9e2e..f0f6784de3 100644 --- a/underscore/index.d.ts +++ b/underscore/index.d.ts @@ -153,9 +153,19 @@ declare module _ { **/ map( list: _.List, - iterator: _.ListIterator | _.IterateePropertyShorthand | _.IterateeMatcherShorthand, + iterator: _.ListIterator, context?: any): TResult[]; + map( + list: _.List, + iterator: _.IterateePropertyShorthand, + context?: any): T[]; + + map( + list: _.List, + iterator: _.IterateeMatcherShorthand, + context?: any): boolean[]; + /** * @see _.map * @param object Maps the properties of this object. @@ -171,18 +181,7 @@ declare module _ { /** * @see _.map **/ - collect( - list: _.List, - iterator: _.ListIterator | _.IterateePropertyShorthand | _.IterateeMatcherShorthand, - context?: any): TResult[]; - - /** - * @see _.map - **/ - collect( - object: _.Dictionary, - iterator: _.ObjectIterator, - context?: any): TResult[]; + collect: typeof _.map; /** * Also known as inject and foldl, reduce boils down a list of values into a single value. @@ -196,7 +195,7 @@ declare module _ { * @return Reduced object result. **/ reduce( - list: _.Collection, + list: _.List, iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; @@ -211,11 +210,17 @@ declare module _ { * @see _.reduce **/ inject( - list: _.Collection, + list: _.List, iterator: _.MemoIterator, memo?: TResult, context?: any): TResult; + inject( + list: _.Dictionary, + iterator: _.MemoObjectIterator, + memo?: TResult, + context?: any): TResult; + /** * @see _.reduce **/ @@ -262,7 +267,7 @@ declare module _ { find( list: _.List, iterator: _.ListIterator, - context?: any): T; + context?: any): T | undefined; /** * @see _.find @@ -270,21 +275,21 @@ declare module _ { find( object: _.Dictionary, iterator: _.ObjectIterator, - context?: any): T; + context?: any): T | undefined; /** * @see _.find **/ find( object: _.List | _.Dictionary, - iterator: U): T; + iterator: U): T | undefined; /** * @see _.find **/ find( object: _.List | _.Dictionary, - iterator: string): T; + iterator: string): T | undefined; /** * @see _.find @@ -292,7 +297,7 @@ declare module _ { detect( list: _.List, iterator: _.ListIterator, - context?: any): T; + context?: any): T | undefined; /** * @see _.find @@ -300,21 +305,21 @@ declare module _ { detect( object: _.Dictionary, iterator: _.ObjectIterator, - context?: any): T; + context?: any): T | undefined; /** * @see _.find **/ detect( object: _.List | _.Dictionary, - iterator: U): T; + iterator: U): T | undefined; /** * @see _.find **/ detect( object: _.List | _.Dictionary, - iterator: string): T; + iterator: string): T | undefined; /** * Looks through each value in the list, returning an array of all the values that pass a truth @@ -372,7 +377,7 @@ declare module _ { **/ findWhere( list: _.List, - properties: U): T; + properties: U): T | undefined; /** * Returns the values in list without the elements that the truth test (iterator) passes. @@ -754,7 +759,7 @@ declare module _ { * @param array Retrieves the first element of this array. * @return Returns the first element of `array`. **/ - first(array: _.List): T; + first(array: _.List): T | undefined; /** * @see _.first @@ -767,7 +772,7 @@ declare module _ { /** * @see _.first **/ - head(array: _.List): T; + head(array: _.List): T | undefined; /** * @see _.first @@ -804,7 +809,7 @@ declare module _ { * @param array Retrieves the last element of this array. * @return Returns the last element of `array`. **/ - last(array: _.List): T; + last(array: _.List): T | undefined; /** * @see _.last @@ -3768,7 +3773,7 @@ declare module _ { * @param attrs Object with key values pair * @return Predicate function **/ - matches(attrs: T): _.ListIterator; + matches(attrs: T): _.ListIterator; /** * Returns a predicate function that will tell you if a passed in object contains all of the key/value properties present in attrs. @@ -3776,7 +3781,7 @@ declare module _ { * @param attrs Object with key values pair * @return Predicate function **/ - matcher(attrs: T): _.ListIterator; + matcher(attrs: T): _.ListIterator; /** * Returns a function that will itself return the key property of any passed-in object. @@ -4100,22 +4105,22 @@ declare module _ { * Wrapped type `any[]`. * @see _.each **/ - each(iterator: _.ListIterator, context?: any): T[]; + each(iterator: _.ListIterator, context?: any): _.List; /** * @see _.each **/ - each(iterator: _.ObjectIterator, context?: any): T[]; + each(iterator: _.ObjectIterator, context?: any): _.List; /** * @see _.each **/ - forEach(iterator: _.ListIterator, context?: any): T[]; + forEach(iterator: _.ListIterator, context?: any): _.List; /** * @see _.each **/ - forEach(iterator: _.ObjectIterator, context?: any): T[]; + forEach(iterator: _.ObjectIterator, context?: any): _.List; /** * Wrapped type `any[]`. @@ -4170,32 +4175,32 @@ declare module _ { * Wrapped type `any[]`. * @see _.find **/ - find(iterator: _.ListIterator | _.ObjectIterator, context?: any): T; + find(iterator: _.ListIterator | _.ObjectIterator, context?: any): T | undefined; /** * @see _.find **/ - find(interator: U): T; + find(interator: U): T | undefined; /** * @see _.find **/ - find(interator: string): T; + find(interator: string): T | undefined; /** * @see _.find **/ - detect(iterator: _.ListIterator | _.ObjectIterator, context?: any): T; + detect(iterator: _.ListIterator | _.ObjectIterator, context?: any): T | undefined; /** * @see _.find **/ - detect(interator?: U): T; + detect(interator?: U): T | undefined; /** * @see _.find **/ - detect(interator?: string): T; + detect(interator?: string): T | undefined; /** * Wrapped type `any[]`. @@ -4218,7 +4223,7 @@ declare module _ { * Wrapped type `any[]`. * @see _.findWhere **/ - findWhere(properties: U): T; + findWhere(properties: U): T | undefined; /** * Wrapped type `any[]`. @@ -4399,7 +4404,7 @@ declare module _ { * Wrapped type `any[]`. * @see _.first **/ - first(): T; + first(): T | undefined; /** * Wrapped type `any[]`. @@ -4410,7 +4415,7 @@ declare module _ { /** * @see _.first **/ - head(): T; + head(): T | undefined; /** * @see _.first @@ -4437,7 +4442,7 @@ declare module _ { * Wrapped type `any[]`. * @see _.last **/ - last(): T; + last(): T | undefined; /** * Wrapped type `any[]`. @@ -4690,7 +4695,7 @@ declare module _ { * Wrapped type `Function`. * @see _.negate **/ - negate(): boolean; + negate(): (...args: any[]) => boolean; /** * Wrapped type `Function[]`. @@ -4805,13 +4810,13 @@ declare module _ { * Wrapped type `any[]`. * @see _.matches **/ - matches(): _.ListIterator; + matches(): _.ListIterator; /** * Wrapped type `any[]`. * @see _.matcher **/ - matcher(): _.ListIterator; + matcher(): _.ListIterator; /** * Wrapped type `string`. @@ -5130,32 +5135,32 @@ declare module _ { * Wrapped type `any[]`. * @see _.find **/ - find(iterator: _.ListIterator | _.ObjectIterator, context?: any): _ChainSingle; + find(iterator: _.ListIterator | _.ObjectIterator, context?: any): _ChainSingle; /** * @see _.find **/ - find(interator: U): _ChainSingle; + find(interator: U): _ChainSingle; /** * @see _.find **/ - find(interator: string): _ChainSingle; + find(interator: string): _ChainSingle; /** * @see _.find **/ - detect(iterator: _.ListIterator | _.ObjectIterator, context?: any): _ChainSingle; + detect(iterator: _.ListIterator | _.ObjectIterator, context?: any): _ChainSingle; /** * @see _.find **/ - detect(interator: U): _ChainSingle; + detect(interator: U): _ChainSingle; /** * @see _.find **/ - detect(interator: string): _ChainSingle; + detect(interator: string): _ChainSingle; /** * Wrapped type `any[]`. @@ -5359,7 +5364,7 @@ declare module _ { * Wrapped type `any[]`. * @see _.first **/ - first(): _ChainSingle; + first(): _ChainSingle; /** * Wrapped type `any[]`. @@ -5765,13 +5770,13 @@ declare module _ { * Wrapped type `any[]`. * @see _.matches **/ - matches(): _Chain; + matches(): _Chain; /** * Wrapped type `any[]`. * @see _.matcher **/ - matcher(): _Chain; + matcher(): _Chain; /** * Wrapped type `string`. diff --git a/underscore/underscore-tests.ts b/underscore/underscore-tests.ts index d3a5729022..f5e8e984ef 100644 --- a/underscore/underscore-tests.ts +++ b/underscore/underscore-tests.ts @@ -212,7 +212,7 @@ interface Family { name: string; relation: string; } -var isUncleMoe = _.matches({ name: 'moe', relation: 'uncle' }); +var isUncleMoe = _.matches({ name: 'moe', relation: 'uncle' }); _.filter([{ name: 'larry', relation: 'father' }, { name: 'moe', relation: 'uncle' }], isUncleMoe); From d6bf165b66ae9fb11b8080eed64fba18207b7d54 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Mon, 6 Mar 2017 11:04:25 +0100 Subject: [PATCH 303/797] Underscore: Updated version number (I've done it before: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/11117) --- underscore/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/underscore/index.d.ts b/underscore/index.d.ts index f0f6784de3..856bf8e0fa 100644 --- a/underscore/index.d.ts +++ b/underscore/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Underscore 1.7.0 +// Type definitions for Underscore 1.8 // Project: http://underscorejs.org/ // Definitions by: Boris Yankov , Josh Baldwin , Christopher Currens // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 04d08d32e1d61e19c0f100e4c0fb9b157bb84407 Mon Sep 17 00:00:00 2001 From: Viktor Smirnov Date: Mon, 6 Mar 2017 14:47:13 +0300 Subject: [PATCH 304/797] bignumber.js - renamed namespace - replaced RoungdingMode enum with type - added ModuloMode type --- bignumber.js/bignumber.js-tests.ts | 2 +- bignumber.js/index.d.ts | 120 +++++++++++++---------------- 2 files changed, 55 insertions(+), 67 deletions(-) diff --git a/bignumber.js/bignumber.js-tests.ts b/bignumber.js/bignumber.js-tests.ts index 3818d79761..a375fc60cd 100644 --- a/bignumber.js/bignumber.js-tests.ts +++ b/bignumber.js/bignumber.js-tests.ts @@ -1,4 +1,4 @@ -var x = new BigNumber(9) +var x: BigNumber.BigNumber = new BigNumber(9) var y = new BigNumber(x) BigNumber(435.345) diff --git a/bignumber.js/index.d.ts b/bignumber.js/index.d.ts index 15314f30ec..d94be507c7 100644 --- a/bignumber.js/index.d.ts +++ b/bignumber.js/index.d.ts @@ -4,72 +4,12 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -declare var BigNumber: bignumber.BigNumberStatic; +declare var BigNumber: BigNumber.BigNumberStatic; export as namespace BigNumber; export = BigNumber; -declare namespace bignumber { - - const enum RoundingMode { - - /** - * Rounds away from zero - */ - ROUND_UP = 0, - - /** - * Rounds towards zero - */ - ROUND_DOWN = 1, - - /** - * Rounds towards `Infinity` - */ - ROUND_CEIL = 2, - - /** - * Rounds towards `-Infinity` - */ - ROUND_FLOOR = 3, - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds away from zero. - */ - ROUND_HALF_UP = 4, - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards zero. - */ - ROUND_HALF_DOWN = 5, - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards even neighbour. - */ - ROUND_HALF_EVEN = 6, - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards `Infinity`. - */ - ROUND_HALF_CEIL = 7, - - /** - * Rounds towards nearest neighbour. - * If equidistant, rounds towards `-Infinity`. - */ - ROUND_HALF_FLOOR = 8, - - /** - * The remainder is always positive. - * - * Euclidian division: `q = sign(n) * floor(a / abs(n))` - */ - EUCLID = 9, - } +declare namespace BigNumber { interface FormatConfig { @@ -164,7 +104,7 @@ declare namespace bignumber { * * The remainder, `r`, is calculated as: `r = a - n * q`. */ - MODULO_MODE: RoundingMode; + MODULO_MODE: ModuloMode; /** * The maximum number of significant digits of the result of the power operation (unless a modulus is specified). @@ -180,6 +120,8 @@ declare namespace bignumber { } type NumberLike = number | string | BigNumber; + type RoundingMode = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 + type ModuloMode = RoundingMode | 9 interface BigNumberStatic { @@ -214,7 +156,7 @@ declare namespace bignumber { RANGE?: number | number[], ERRORS?: boolean | 0 | 1, CRYPTO?: boolean | 0 | 1, - MODULO_MODE?: RoundingMode, + MODULO_MODE?: ModuloMode, POW_PRECISION?: number ): BigNumberConfig; @@ -233,7 +175,7 @@ declare namespace bignumber { RANGE?: number | number[], ERRORS?: boolean | 0 | 1, CRYPTO?: boolean | 0 | 1, - MODULO_MODE?: RoundingMode, + MODULO_MODE?: ModuloMode, POW_PRECISION?: number ): BigNumberConfig; @@ -274,15 +216,61 @@ declare namespace bignumber { */ random(dp?: number): BigNumber; + /** + * Rounds away from zero + */ ROUND_UP: 0; + + /** + * Rounds towards zero + */ ROUND_DOWN: 1; + + /** + * Rounds towards `Infinity` + */ ROUND_CEIL: 2; + + /** + * Rounds towards `-Infinity` + */ ROUND_FLOOR: 3; + + /** + * Rounds towards nearest neighbour. + * If equidistant, rounds away from zero. + */ ROUND_HALF_UP: 4; + + /** + * Rounds towards nearest neighbour. + * If equidistant, rounds towards zero. + */ ROUND_HALF_DOWN: 5; + + /** + * Rounds towards nearest neighbour. + * If equidistant, rounds towards even neighbour. + */ ROUND_HALF_EVEN: 6; + + /** + * Rounds towards nearest neighbour. + * If equidistant, rounds towards `Infinity`. + */ ROUND_HALF_CEIL: 7; + + /** + * Rounds towards nearest neighbour. + * If equidistant, rounds towards `-Infinity`. + */ ROUND_HALF_FLOOR: 8; + + /** + * The remainder is always positive. + * + * Euclidian division: `q = sign(n) * floor(a / abs(n))` + */ EUCLID: 9; } @@ -497,7 +485,7 @@ declare namespace bignumber { * Returns a BigNumber whose value is the value of this BigNumber plus `n`. */ plus(n: NumberLike, base?: number): BigNumber; - + /** * Returns a BigNumber whose value is the value of this BigNumber plus `n`. */ From eadbc0cd3badb6f402d66311b171e57d860f0b84 Mon Sep 17 00:00:00 2001 From: Erik Krogh Kristensen Date: Mon, 6 Mar 2017 15:32:29 +0100 Subject: [PATCH 305/797] async: Various fixes, mostly related to strict-nulls. Also some places where the error type was wrong. --- async/index.d.ts | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/async/index.d.ts b/async/index.d.ts index e3fbe7e512..7f71f3b9bc 100644 --- a/async/index.d.ts +++ b/async/index.d.ts @@ -6,17 +6,16 @@ interface Dictionary { [key: string]: T; } interface ErrorCallback { (err?: T): void; } -interface AsyncWaterfallCallback { (err: E, ...args: any[]): void; } -interface AsyncBooleanResultCallback { (err: E, truthValue: boolean): void; } -interface AsyncResultCallback { (err: E, result: T): void; } -interface AsyncResultArrayCallback { (err: E, results: T[]): void; } -interface AsyncResultObjectCallback { (err: E, results: Dictionary): void; } +interface AsyncBooleanResultCallback { (err?: E, truthValue?: boolean): void; } +interface AsyncResultCallback { (err?: E, result?: T): void; } +interface AsyncResultArrayCallback { (err?: E, results?: (T | undefined)[]): void; } +interface AsyncResultObjectCallback { (err: E | undefined, results: Dictionary): void; } -interface AsyncFunction { (callback: (err?: E, result?: T) => void): void; } +interface AsyncFunction { (callback: (err?: E, result?: T) => void): any; } interface AsyncIterator { (item: T, callback: ErrorCallback): void; } interface AsyncForEachOfIterator { (item: T, key: number|string, callback: ErrorCallback): void; } interface AsyncResultIterator { (item: T, callback: AsyncResultCallback): void; } -interface AsyncMemoIterator { (memo: R, item: T, callback: AsyncResultCallback): void; } +interface AsyncMemoIterator { (memo: R | undefined, item: T, callback: AsyncResultCallback): void; } interface AsyncBooleanIterator { (item: T, callback: AsyncBooleanResultCallback): void; } interface AsyncWorker { (task: T, callback: ErrorCallback): void; } @@ -76,7 +75,7 @@ interface AsyncPriorityQueue { interface AsyncCargo { length(): number; - payload: number; + payload?: number; push(task: any, callback? : Function): void; push(task: any[], callback? : Function): void; saturated(): void; @@ -186,25 +185,25 @@ interface Async { cargo(worker : (tasks: any[], callback : ErrorCallback) => void, payload? : number) : AsyncCargo; auto(tasks: any, concurrency?: number, callback?: AsyncResultCallback): void; autoInject(tasks: any, callback?: AsyncResultCallback): void; - retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: AsyncResultCallback): void; - retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: AsyncResultCallback): void; - retryable(opts: number | {times: number, interval: number}, task: AsyncFunction): AsyncFunction; - apply(fn: Function, ...arguments: any[]): AsyncFunction; + retry(opts: number, task: (callback : AsyncResultCallback, results: any) => void, callback: AsyncResultCallback): void; + retry(opts: { times: number, interval: number|((retryCount: number) => number) }, task: (callback: AsyncResultCallback, results : any) => void, callback: AsyncResultCallback): void; + retryable(opts: number | {times: number, interval: number}, task: AsyncFunction): AsyncFunction; + apply(fn: Function, ...arguments: any[]): AsyncFunction; nextTick(callback: Function, ...args: any[]): void; setImmediate: typeof async.nextTick; - reflect(fn: AsyncFunction) : (callback: (err: void, result: {error?: Error, value?: T}) => void) => void; - reflectAll(tasks: AsyncFunction[]): ((callback: (err: void, result: {error?: Error, value?: T}) => void) => void)[]; + reflect(fn: AsyncFunction) : (callback: (err: null, result: {error?: E, value?: T}) => void) => void; + reflectAll(tasks: AsyncFunction[]): ((callback: (err: undefined, result: {error?: E, value?: T}) => void) => void)[]; - timeout(fn: AsyncFunction, milliseconds: number, info?: any): AsyncFunction; - timeout(fn: AsyncResultIterator, milliseconds: number, info?: any): AsyncResultIterator; + timeout(fn: AsyncFunction, milliseconds: number, info?: any): AsyncFunction; + timeout(fn: AsyncResultIterator, milliseconds: number, info?: any): AsyncResultIterator; times (n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; timesSeries(n: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; timesLimit(n: number, limit: number, iterator: AsyncResultIterator, callback: AsyncResultArrayCallback): void; transform(arr: T[], iteratee: (acc: R[], item: T, key: string, callback: (error?: E) => void) => void): void; - transform(arr: T[], acc: R[], iteratee: (acc: R[], item: T, key: string, callback: (error?: E) => void) => void): void; + transform(arr: T[], acc: R[], iteratee: (acc: R[] | null, item: T | undefined[], key?: string, callback?: (error?: E) => void) => void): void; transform(arr: {[key: string] : T}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void): void; transform(arr: {[key: string] : T}, acc: {[key: string] : R}, iteratee: (acc: {[key: string] : R}, item: T, key: string, callback: (error?: E) => void) => void): void; @@ -226,4 +225,3 @@ declare var async: Async; declare module "async" { export = async; } - From 6de6f869adbcde12728196f273a448c49492fec1 Mon Sep 17 00:00:00 2001 From: Marc Woolfson Date: Mon, 6 Mar 2017 15:55:03 +0000 Subject: [PATCH 306/797] 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 09a2b06ef71c0a5375d1650c5f5f4e559b6057da Mon Sep 17 00:00:00 2001 From: Joe Tuttle Date: Mon, 6 Mar 2017 11:02:34 -0500 Subject: [PATCH 307/797] Node: Fixes for TLSSocket --- node/index.d.ts | 12 ++++++------ node/v6/index.d.ts | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/node/index.d.ts b/node/index.d.ts index d23cc981e4..91591d0cfe 100644 --- a/node/index.d.ts +++ b/node/index.d.ts @@ -2873,7 +2873,7 @@ declare module "tls" { version: string; } - export class TLSSocket extends stream.Duplex { + export class TLSSocket extends net.Socket { /** * Construct a new tls.TLSSocket object from an existing TCP socket. */ @@ -3000,7 +3000,7 @@ declare module "tls" { /** * The numeric representation of the local port. */ - localPort: string; + localPort: number; /** * The string representation of the remote IP address. * For example, '74.125.127.100' or '2001:4860:a005::68'. @@ -3212,10 +3212,10 @@ declare module "tls" { context: any; } - export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) => void): Server; - export function connect(options: ConnectionOptions, secureConnectionListener?: () => void): ClearTextStream; - export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): ClearTextStream; - export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): ClearTextStream; + export function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; + export function connect(options: ConnectionOptions, secureConnectionListener?: () => void): TLSSocket; + export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; export function createSecureContext(details: SecureContextOptions): SecureContext; } diff --git a/node/v6/index.d.ts b/node/v6/index.d.ts index 826bd1108b..c523026875 100644 --- a/node/v6/index.d.ts +++ b/node/v6/index.d.ts @@ -2829,7 +2829,7 @@ declare module "tls" { version: string; } - export class TLSSocket extends stream.Duplex { + export class TLSSocket extends net.Socket { /** * Construct a new tls.TLSSocket object from an existing TCP socket. */ @@ -2956,7 +2956,7 @@ declare module "tls" { /** * The numeric representation of the local port. */ - localPort: string; + localPort: number; /** * The string representation of the remote IP address. * For example, '74.125.127.100' or '2001:4860:a005::68'. @@ -3168,10 +3168,10 @@ declare module "tls" { context: any; } - export function createServer(options: TlsOptions, secureConnectionListener?: (cleartextStream: ClearTextStream) => void): Server; - export function connect(options: ConnectionOptions, secureConnectionListener?: () => void): ClearTextStream; - export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): ClearTextStream; - export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): ClearTextStream; + export function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; + export function connect(options: ConnectionOptions, secureConnectionListener?: () => void): TLSSocket; + export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; export function createSecureContext(details: SecureContextOptions): SecureContext; } From c282bbb81bf1534f64cef012b06ea706419b4403 Mon Sep 17 00:00:00 2001 From: Marcus Longmuir Date: Mon, 6 Mar 2017 17:52:38 +0000 Subject: [PATCH 308/797] Add google-protobuf --- google-protobuf/google-protobuf-tests.ts | 139 +++++ google-protobuf/index.d.ts | 675 +++++++++++++++++++++++ google-protobuf/tsconfig.json | 22 + google-protobuf/tslint.json | 3 + 4 files changed, 839 insertions(+) create mode 100644 google-protobuf/google-protobuf-tests.ts create mode 100644 google-protobuf/index.d.ts create mode 100644 google-protobuf/tsconfig.json create mode 100644 google-protobuf/tslint.json diff --git a/google-protobuf/google-protobuf-tests.ts b/google-protobuf/google-protobuf-tests.ts new file mode 100644 index 0000000000..796969b2b3 --- /dev/null +++ b/google-protobuf/google-protobuf-tests.ts @@ -0,0 +1,139 @@ +import * as jspb from "google-protobuf"; + +/* This is a typescript version of a simple generated class from a proto file that is shown below. In order to make + this ES5 JS file into TypeScript there have been quite a few modifications, but the same calls are made to the library + classes. + + // FILE: simple.proto + syntax = "proto3"; + + package examplecom; + + message MySimple { + string my_string = 1; + bool my_bool = 2; + repeated string some_labels = 3; + } +*/ + +class MySimple extends jspb.Message { + constructor(opt_data?: any) { + super(); // This isn't actually called in the JS version of this file, but it's required by TS + jspb.Message.initialize(this, opt_data, 0, -1, MySimple.repeatedFields_, null); + }; + + static repeatedFields_ = [3]; + + toObject(opt_includeInstance: boolean) { + return MySimple.toObject(opt_includeInstance, this); + }; + + static toObject(includeInstance: boolean, msg: MySimple) { + const obj = { + myString: jspb.Message.getFieldWithDefault(msg, 1, ""), + myBool: jspb.Message.getFieldWithDefault(msg, 2, false), + someLabelsList: jspb.Message.getField(msg, 3), + }; + + if (includeInstance) { + // This is commented out because it's not valid in TS, but it's a simple append to an object + // obj['$jspbMessageInstance'] = msg; + } + return obj; + }; + + static deserializeBinary(bytes: Uint8Array) { + const reader = new jspb.BinaryReader(bytes); + const msg = new MySimple(); + return MySimple.deserializeBinaryFromReader(msg, reader); + }; + + static deserializeBinaryFromReader(msg: MySimple, reader: jspb.BinaryReader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + const field = reader.getFieldNumber(); + switch (field) { + case 1: + const value1 = (reader.readString()); + msg.setMyString(value1); + break; + case 2: + const value2 = (reader.readBool()); + msg.setMyBool(value2); + break; + case 3: + const value3 = (reader.readString()); + msg.addSomeLabels(value3); + break; + default: + reader.skipField(); + break; + } + } + return msg; + }; + + serializeBinary(): Uint8Array { + const writer = new jspb.BinaryWriter(); + MySimple.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); + }; + + static serializeBinaryToWriter(message: MySimple, writer: jspb.BinaryWriter) { + let f1 = message.getMyString(); + if (f1.length > 0) { + writer.writeString( + 1, + f1, + ); + } + const f2 = message.getMyBool(); + if (f2) { + writer.writeBool( + 2, + f2, + ); + } + const f3 = message.getSomeLabelsList(); + if (f3.length > 0) { + writer.writeRepeatedString( + 3, + f3, + ); + } + } + + getMyString(): string { + return jspb.Message.getFieldWithDefault(this, 1, ""); + } + + setMyString(value: string) { + jspb.Message.setField(this, 1, value); + } + + getMyBool(): boolean { + return jspb.Message.getFieldWithDefault(this, 2, false); + } + + setMyBool(value: boolean) { + jspb.Message.setField(this, 2, value); + } + + getSomeLabelsList(): string[] { + return jspb.Message.getField(this, 3); + } + + setSomeLabelsList(value: string[]) { + jspb.Message.setField(this, 3, value || []); + } + + addSomeLabels(value: string, opt_index?: number) { + jspb.Message.addToRepeatedField(this, 3, value, opt_index); + } + + clearSomeLabelsList() { + this.setSomeLabelsList([]); + } +} diff --git a/google-protobuf/index.d.ts b/google-protobuf/index.d.ts new file mode 100644 index 0000000000..20f67adfbc --- /dev/null +++ b/google-protobuf/index.d.ts @@ -0,0 +1,675 @@ +// Type definitions for google-protobuf 3.2 +// Project: https://github.com/google/google-protobuf +// Definitions by: Marcus Longmuir +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type ByteSource = ArrayBuffer|Uint8Array|number[]|string; +type ScalarFieldType = boolean|number|string; +type RepeatedFieldType = ScalarFieldType[] | Uint8Array[]; +type AnyFieldType = ScalarFieldType | RepeatedFieldType | Uint8Array; +type FieldValue = (string|number|boolean|Uint8Array|any/*This should be Array, but that isn't allowed*/|undefined) + +export class Message { + getJsPbMessageId(): (string | undefined); + static initialize(msg: Message, + data: Message.MessageArray, + messageId: (string | number), + suggestedPivot: number, + repeatedFields: number[], + oneofFields?: number[][] | null): void; + static toObjectList(field: T[], + toObjectFn: (includeInstance: boolean, + data: T) => object, + includeInstance?: boolean): object[]; + static toObjectExtension(msg: Message, + obj: object, + extensions: {[key: number]: ExtensionFieldInfo}, + getExtensionFn: (fieldInfo: ExtensionFieldInfo) => Message, + includeInstance?: boolean): void; + serializeBinaryExtensions(proto: Message, + writer: BinaryWriter, + extensions: {[key: number]: ExtensionFieldBinaryInfo}, + getExtensionFn: (fieldInfo: ExtensionFieldInfo) => T): void + readBinaryExtension(proto: Message, + reader: BinaryReader, + extensions: {[key: number]: ExtensionFieldBinaryInfo}, + setExtensionFn: (fieldInfo: ExtensionFieldInfo, + val: T) => void): void + static getField(msg: Message, + fieldNumber: number): FieldValue|null; + static getOptionalFloatingPointField(msg: Message, + fieldNumber: number): (number | undefined); + static getRepeatedFloatingPointField(msg: Message, + fieldNumber: number): number[]; + static bytesAsB64(bytes: Uint8Array): string; + static bytesAsU8(str: string): Uint8Array; + static bytesListAsB64(bytesList: Uint8Array[]): string[]; + static bytesListAsU8(strList: string[]): Uint8Array[]; + static getFieldWithDefault(msg: Message, + fieldNumber: number, + defaultValue: T): T; + static getMapField(msg: Message, + fieldNumber: number, + noLazyCreate: boolean, + valueCtor: typeof Message): Map; + static setField(msg: Message, + fieldNumber: number, + value: FieldValue): void; + static addToRepeatedField(msg: Message, + fieldNumber: number, + value: any, + index?: number): void; + static setOneofField(msg: Message, + fieldNumber: number, + oneof: number[], + value: FieldValue): void; + static computeOneofCase(msg: Message, + oneof: number[]): number; + static getWrapperField(msg: Message, + ctor: typeof Message, + fieldNumber: number, + required?: number): Message; + static getRepeatedWrapperField(msg: Message, + ctor: typeof Message, + fieldNumber: number): Message[]; + static setWrapperField(msg: Message, + fieldNumber: number, + value?: (Message|Map)): void; + static setOneofWrapperField(msg: Message, + fieldNumber: number, + oneof: number[], + value: any): void; + static setRepeatedWrapperField(msg: Message, + fieldNumber: number, + value: any): void; + static addToRepeatedWrapperField(msg: Message, + fieldNumber: number, + value: any, + ctor: typeof Message, + index: number): any; + static toMap(field: any[], + mapKeyGetterFn: (field: any) => string, + toObjectFn?: Message.StaticToObject, + includeInstance?: boolean): void; + toArray(): Message.MessageArray; + toString(): string; + getExtension(fieldInfo: ExtensionFieldInfo): T; + setExtension(fieldInfo: ExtensionFieldInfo, + value: T): void; + static difference(m1: T, + m2: T): T; + static equals(m1: Message, + m2: Message): boolean; + static compareExtensions(extension1: object, + extension2: object): boolean; + static compareFields(field1: any, + field2: any): boolean; + cloneMessage(): Message; + clone(): Message; + static clone(msg: T): T; + static cloneMessage(msg: T): T; + static copyInto(fromMessage: Message, + toMessage: Message): void; + static registerMessageType(id: number, + constructor: typeof Message): void; +} + +export namespace Message { + export type MessageArray = any[]; // This type needs to reference itself + interface StaticToObject { + (includeInstance: boolean, + msg: Message): object; + } +} + +export class ExtensionFieldInfo { + fieldIndex: number; + fieldName: number; + ctor: typeof Message; + toObjectFn: Message.StaticToObject; + isRepeated: number; + constructor(fieldIndex: number, + fieldName: {[key: string]: number}, + ctor: typeof Message, + toObjectFn: Message.StaticToObject, + isRepeated: number); + isMessageType(): boolean; +} + +export class ExtensionFieldBinaryInfo { + fieldInfo: ExtensionFieldInfo; + binaryReaderFn: BinaryRead; + binaryWriterFn: BinaryWrite; + opt_binaryMessageSerializeFn: (msg: Message, + writer: BinaryWriter) => void; + opt_binaryMessageDeserializeFn: (msg: Message, + reader: BinaryReader) => Message; + opt_isPacked: boolean; + constructor(fieldInfo: ExtensionFieldInfo, + binaryReaderFn: BinaryRead, + binaryWriterFn: BinaryWrite, + opt_binaryMessageSerializeFn: (msg: Message, + writer: BinaryWriter) => void, + opt_binaryMessageDeserializeFn: (msg: Message, + reader: BinaryReader) => Message, + opt_isPacked: boolean); +} + +export class Map { + constructor(arr: Array<[K, V]>, + valueCtor?: {new(init: any): V}); + toArray(): Array<[K, V]>; + toObject(includeInstance: boolean, + valueToObject: (includeInstance: boolean) => any): Array<[K, V]>; + static fromObject(entries: Array<[K, V]>, + valueCtor: any, + valueFromObject: any): Map; + getLength(): number; + clear(): void; + del(key: K): boolean; + getEntryList(): Array<[K, V]>; + entries(): Map.Iterator<[K, V]>; + keys(): Map.Iterator; + forEach(callback: (entry: V, + key: K) => void, + thisArg?: object): void; + set(key: K, + value: V): void; + get(key: K): (V | undefined); + has(key: K): boolean; +} + +export namespace Map { + // This is implemented by jspb.Map.ArrayIteratorIterable_, but that class shouldn't be exported + interface Iterator { + next(): IteratorResult; + } + type IteratorResult = { + done: boolean, + value: T, + } +} + +interface BinaryReadReader { + (msg: any, + binaryReader: BinaryReader): void; +} + +interface BinaryRead { + (msg: any, + reader: BinaryReadReader): void; +} + +interface BinaryWriteCallback { + (value: any, + binaryWriter: BinaryWriter): void; +} + +interface BinaryWrite { + (fieldNumber: number, + value: any, + writerCallback: BinaryWriteCallback): void; +} + +export class BinaryReader { + constructor(bytes?: ByteSource, + start?: number, + length?: number); + static alloc(bytes?: ByteSource, + start?: number, + length?: number): BinaryReader; + alloc(bytes?: ByteSource, + start?: number, + length?: number): BinaryReader; + free(): void; + getFieldCursor(): number; + getCursor(): number; + getBuffer(): Uint8Array; + getFieldNumber(): number; + getWireType(): BinaryConstants.WireType; + isEndGroup(): boolean; + getError(): boolean; + setBlock(bytes?: ByteSource, + start?: number, + length?: number): void; + reset(): void; + advance(count: number): void; + nextField(): boolean; + unskipHeader(): void; + skipMatchingFields(): void; + skipVarintField(): void; + skipDelimitedField(): void; + skipFixed32Field(): void; + skipFixed64Field(): void; + skipGroup(): void; + skipField(): void; + registerReadCallback(callbackName: string, + callback: (binaryReader: BinaryReader) => any): void; + runReadCallback(callbackName: string): any; + readAny(fieldType: BinaryConstants.FieldType): AnyFieldType; + readMessage: BinaryRead; + readGroup(field: number, + message: Message, + reader: BinaryReadReader): void; + getFieldDecoder(): BinaryDecoder; + readInt32(): number; + readInt32String(): string; + readInt64(): number; + readInt64String(): string; + readUint32(): number; + readUint32String(): string; + readUint64(): number; + readUint64String(): string; + readSint32(): number; + readSint64(): number; + readSint64String(): string; + readFixed32(): number; + readFixed64(): number; + readFixed64String(): string; + readSfixed32(): number; + readSfixed32String(): string; + readSfixed64(): number; + readSfixed64String(): string; + readFloat(): number; + readDouble(): number; + readBool(): boolean; + readEnum(): number; + readString(): string; + readBytes(): Uint8Array; + readVarintHash64(): string; + readFixedHash64(): string; + readPackedInt32(): number[]; + readPackedInt32String(): string[]; + readPackedInt64(): number[]; + readPackedInt64String(): string[]; + readPackedUint32(): number[]; + readPackedUint32String(): string[]; + readPackedUint64(): number[]; + readPackedUint64String(): string[]; + readPackedSint32(): number[]; + readPackedSint64(): number[]; + readPackedSint64String(): string[]; + readPackedFixed32(): number[]; + readPackedFixed64(): number[]; + readPackedFixed64String(): string[]; + readPackedSfixed32(): number[]; + readPackedSfixed64(): number[]; + readPackedSfixed64String(): string[]; + readPackedFloat(): number[]; + readPackedDouble(): number[]; + readPackedBool(): boolean[]; + readPackedEnum(): number[]; + readPackedVarintHash64(): string[]; + readPackedFixedHash64(): string[]; +} + +export class BinaryWriter { + constructor(); + writeSerializedMessage(bytes: Uint8Array, + start: number, + end: number): void; + maybeWriteSerializedMessage(bytes?: Uint8Array, + start?: number, + end?: number): void; + reset(): void; + getResultBuffer(): Uint8Array; + getResultBase64String(): string; + beginSubMessage(field: number): void; + endSubMessage(field: number): void; + writeAny(fieldType: BinaryConstants.FieldType, + field: number, + value: AnyFieldType): void; + writeInt32(field: number, + value?: number): void; + writeInt32String(field: number, + value?: string): void; + writeInt64(field: number, + value?: number): void; + writeInt64String(field: number, + value?: string): void; + writeUint32(field: number, + value?: number): void; + writeUint32String(field: number, + value?: string): void; + writeUint64(field: number, + value?: number): void; + writeUint64String(field: number, + value?: string): void; + writeSint32(field: number, + value?: number): void; + writeSint64(field: number, + value?: number): void; + writeSint64String(field: number, + value?: string): void; + writeFixed32(field: number, + value?: number): void; + writeFixed64(field: number, + value?: number): void; + writeFixed64String(field: number, + value?: string): void; + writeSfixed32(field: number, + value?: number): void; + writeSfixed64(field: number, + value?: number): void; + writeSfixed64String(field: number, + value?: string): void; + writeFloat(field: number, + value?: number): void; + writeDouble(field: number, + value?: number): void; + writeBool(field: number, + value?: boolean): void; + writeEnum(field: number, + value?: number): void; + writeString(field: number, + value?: string): void; + writeBytes(field: number, + value?: ByteSource): void; + writeMessage: BinaryWrite; + writeGroup(field: number, + value: any, + writeCallback: BinaryWriteCallback): void; + writeFixedHash64(field: number, + value?: string): void; + writeVarintHash64(field: number, + value?: string): void; + writeRepeatedInt32(field: number, + value?: number[]): void; + writeRepeatedInt32String(field: number, + value?: string[]): void; + writeRepeatedInt64(field: number, + value?: number[]): void; + writeRepeatedInt64String(field: number, + value?: string[]): void; + writeRepeatedUint32(field: number, + value?: number[]): void; + writeRepeatedUint32String(field: number, + value?: string[]): void; + writeRepeatedUint64(field: number, + value?: number[]): void; + writeRepeatedUint64String(field: number, + value?: string[]): void; + writeRepeatedSint32(field: number, + value?: number[]): void; + writeRepeatedSint64(field: number, + value?: number[]): void; + writeRepeatedSint64String(field: number, + value?: string[]): void; + writeRepeatedFixed32(field: number, + value?: number[]): void; + writeRepeatedFixed64(field: number, + value?: number[]): void; + writeRepeatedFixed64String(field: number, + value?: string[]): void; + writeRepeatedSfixed32(field: number, + value?: number[]): void; + writeRepeatedSfixed64(field: number, + value?: number[]): void; + writeRepeatedSfixed64String(field: number, + value?: string[]): void; + writeRepeatedFloat(field: number, + value?: number[]): void; + writeRepeatedDouble(field: number, + value?: number[]): void; + writeRepeatedBool(field: number, + value?: boolean[]): void; + writeRepeatedEnum(field: number, + value?: number[]): void; + writeRepeatedString(field: number, + value?: string[]): void; + writeRepeatedBytes(field: number, + value?: ByteSource[]): void; + writeRepeatedMessage(field: number, + value: Message[], + writerCallback: BinaryWriteCallback): void; + writeRepeatedGroup(field: number, + value: Message[], + writerCallback: BinaryWriteCallback): void; + writeRepeatedFixedHash64(field: number, + value?: string[]): void; + writeRepeatedVarintHash64(field: number, + value?: string[]): void; + writePackedInt32(field: number, + value?: number[]): void; + writePackedInt32String(field: number, + value?: string[]): void; + writePackedInt64(field: number, + value?: number[]): void; + writePackedInt64String(field: number, + value?: string[]): void; + writePackedUint32(field: number, + value?: number[]): void; + writePackedUint32String(field: number, + value?: string[]): void; + writePackedUint64(field: number, + value?: number[]): void; + writePackedUint64String(field: number, + value?: string[]): void; + writePackedSint32(field: number, + value?: number[]): void; + writePackedSint64(field: number, + value?: number[]): void; + writePackedSint64String(field: number, + value?: string[]): void; + writePackedFixed32(field: number, + value?: number[]): void; + writePackedFixed64(field: number, + value?: number[]): void; + writePackedFixed64String(field: number, + value?: string[]): void; + writePackedSfixed32(field: number, + value?: number[]): void; + writePackedSfixed64(field: number, + value?: number[]): void; + writePackedSfixed64String(field: number, + value?: string[]): void; + writePackedFloat(field: number, + value?: number[]): void; + writePackedDouble(field: number, + value?: number[]): void; + writePackedBool(field: number, + value?: boolean[]): void; + writePackedEnum(field: number, + value?: number[]): void; + writePackedFixedHash64(field: number, + value?: string[]): void; + writePackedVarintHash64(field: number, + value?: string[]): void; +} + +export class BinaryEncoder { + constructor(); + length(): number; + end(): number[]; + writeSplitVarint64(lowBits: number, + highBits: number): void; + writeSplitFixed64(lowBits: number, + highBits: number): void; + writeUnsignedVarint32(value: number): void; + writeSignedVarint32(value: number): void; + writeUnsignedVarint64(value: number): void; + writeSignedVarint64(value: number): void; + writeZigzagVarint32(value: number): void; + writeZigzagVarint64(value: number): void; + writeZigzagVarint64String(value: string): void; + writeUint8(value: number): void; + writeUint16(value: number): void; + writeUint32(value: number): void; + writeUint64(value: number): void; + writeInt8(value: number): void; + writeInt16(value: number): void; + writeInt32(value: number): void; + writeInt64(value: number): void; + writeInt64String(value: string): void; + writeFloat(value: number): void; + writeDouble(value: number): void; + writeBool(value: boolean): void; + writeEnum(value: number): void; + writeBytes(bytes: Uint8Array): void; + writeVarintHash64(hash: string): void; + writeFixedHash64(hash: string): void; + writeString(value: string): number; +} + +export class BinaryDecoder { + constructor(bytes?: ByteSource, + start?: number, + length?: number) + static alloc(bytes?: ByteSource, + start?: number, + length?: number): BinaryDecoder; + free(): void; + clone(): BinaryDecoder; + clear(): void; + getBuffer(): Uint8Array; + setBlock(data: ByteSource, + start?: number, + length?: number): void; + getEnd(): number; + setEnd(end: number): void; + reset(): void; + getCursor(): number; + setCursor(cursor: number): void; + advance(count: number): void; + atEnd(): boolean; + pastEnd(): boolean; + getError(): boolean; + skipVarint(): void; + unskipVarint(value: number): void; + readUnsignedVarint32(): number; + readSignedVarint32(): number; + readUnsignedVarint32String(): number; + readSignedVarint32String(): number; + readZigzagVarint32(): number; + readUnsignedVarint64(): number; + readUnsignedVarint64String(): number; + readSignedVarint64(): number; + readSignedVarint64String(): number; + readZigzagVarint64(): number; + readZigzagVarint64String(): number; + readUint8(): number; + readUint16(): number; + readUint32(): number; + readUint64(): number; + readUint64String(): string; + readInt8(): number; + readInt16(): number; + readInt32(): number; + readInt64(): number; + readInt64String(): string; + readFloat(): number; + readDouble(): number; + readBool(): boolean; + readEnum(): number; + readString(length: number): string; + readStringWithLength(): string; + readBytes(length: number): Uint8Array; + readVarintHash64(): string; + readFixedHash64(): string; +} + +export class BinaryIterator { + constructor(decoder?: BinaryDecoder, + next?: () => number|boolean|string|null, + elements?: Array) + static alloc(decoder?: BinaryDecoder, + next?: () => number|boolean|string|null, + elements?: Array): BinaryIterator; + free(): void; + clear(): void; + get(): (ScalarFieldType | null); + atEnd(): boolean; + next(): (ScalarFieldType | null); +} + +export namespace BinaryConstants { + export enum FieldType { + INVALID = -1, + DOUBLE = 1, + FLOAT = 2, + INT64 = 3, + UINT64 = 4, + INT32 = 5, + FIXED64 = 6, + FIXED32 = 7, + BOOL = 8, + STRING = 9, + GROUP = 10, + MESSAGE = 11, + BYTES = 12, + UINT32 = 13, + ENUM = 14, + SFIXED32 = 15, + SFIXED64 = 16, + SINT32 = 17, + SINT64 = 18, + FHASH64 = 30, + VHASH64 = 31, + } + + export enum WireType { + INVALID = -1, + VARINT = 0, + FIXED64 = 1, + DELIMITED = 2, + START_GROUP = 3, + END_GROUP = 4, + FIXED32 = 5, + } + + const FieldTypeToWireType: (fieldType: FieldType) => WireType; + + const INVALID_FIELD_NUMBER: number; + const FLOAT32_EPS: number; + const FLOAT32_MIN: number; + const FLOAT32_MAX: number; + const FLOAT64_EPS: number; + const FLOAT64_MIN: number; + const FLOAT64_MAX: number; + const TWO_TO_20: number; + const TWO_TO_23: number; + const TWO_TO_31: number; + const TWO_TO_32: number; + const TWO_TO_52: number; + const TWO_TO_63: number; + const TWO_TO_64: number; + const ZERO_HASH: string; +} + +export namespace arith { + export class UInt64 { + lo: number; + hi: number; + constructor(lo: number, + hi: number); + cmp(other: UInt64): number; + rightShift(): UInt64; + leftShift(): UInt64; + msb(): boolean; + lsb(): boolean; + zero(): boolean; + add(other: UInt64): UInt64; + sub(other: UInt64): UInt64; + static mul32x32(a: number, + b: number): UInt64; + mul(a: number): UInt64; + div(divisor: number): [UInt64, UInt64]; + toString(): string; + static fromString(str: string): UInt64; + clone(): UInt64; + } + + export class Int64 { + lo: number; + hi: number; + constructor(lo: number, + hi: number); + add(other: Int64): Int64; + sub(other: Int64): Int64; + clone(): Int64; + toString(): string; + static fromString(str: string): Int64; + } +} + +// jspb.utils package excluded as it likely shouldn't be called by user code diff --git a/google-protobuf/tsconfig.json b/google-protobuf/tsconfig.json new file mode 100644 index 0000000000..269fec20d9 --- /dev/null +++ b/google-protobuf/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", + "google-protobuf-tests.ts" + ] +} \ No newline at end of file diff --git a/google-protobuf/tslint.json b/google-protobuf/tslint.json new file mode 100644 index 0000000000..fdc7cdc370 --- /dev/null +++ b/google-protobuf/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} \ No newline at end of file From 94631123e4346bac49ee1087337c85f249f3d807 Mon Sep 17 00:00:00 2001 From: Marcus Longmuir Date: Mon, 6 Mar 2017 19:24:47 +0000 Subject: [PATCH 309/797] Removed object --- google-protobuf/index.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/google-protobuf/index.d.ts b/google-protobuf/index.d.ts index 20f67adfbc..f40780ed8a 100644 --- a/google-protobuf/index.d.ts +++ b/google-protobuf/index.d.ts @@ -19,10 +19,10 @@ export class Message { oneofFields?: number[][] | null): void; static toObjectList(field: T[], toObjectFn: (includeInstance: boolean, - data: T) => object, - includeInstance?: boolean): object[]; + data: T) => {}, + includeInstance?: boolean): {}[]; static toObjectExtension(msg: Message, - obj: object, + obj: {}, extensions: {[key: number]: ExtensionFieldInfo}, getExtensionFn: (fieldInfo: ExtensionFieldInfo) => Message, includeInstance?: boolean): void; @@ -100,8 +100,8 @@ export class Message { m2: T): T; static equals(m1: Message, m2: Message): boolean; - static compareExtensions(extension1: object, - extension2: object): boolean; + static compareExtensions(extension1: {}, + extension2: {}): boolean; static compareFields(field1: any, field2: any): boolean; cloneMessage(): Message; @@ -118,7 +118,7 @@ export namespace Message { export type MessageArray = any[]; // This type needs to reference itself interface StaticToObject { (includeInstance: boolean, - msg: Message): object; + msg: Message): {}; } } @@ -172,7 +172,7 @@ export class Map { keys(): Map.Iterator; forEach(callback: (entry: V, key: K) => void, - thisArg?: object): void; + thisArg?: {}): void; set(key: K, value: V): void; get(key: K): (V | undefined); @@ -672,4 +672,4 @@ export namespace arith { } } -// jspb.utils package excluded as it likely shouldn't be called by user code +// jspb.utils package excluded as it likely shouldn't be called by user code \ No newline at end of file From b2d34c4a37f83933c8ada8cf404e19a5416895cb Mon Sep 17 00:00:00 2001 From: Liam Mann Date: Mon, 6 Mar 2017 20:09:34 +0000 Subject: [PATCH 310/797] Added support for setFlavor() - #13302 --- showdown/index.d.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/showdown/index.d.ts b/showdown/index.d.ts index e73405bfec..70b8d2abca 100644 --- a/showdown/index.d.ts +++ b/showdown/index.d.ts @@ -255,6 +255,14 @@ declare namespace Showdown { * @param extensions */ removeExtension(extensions: ShowdownExtension[] | ShowdownExtension): void; + + /** + * Setting a "local" flavor affects all instances of showdown + * + * @param flavor name + */ + setFlavor(name: string): void; + } interface ConverterStatic { @@ -353,4 +361,11 @@ declare namespace Showdown { * Reset extensions. */ function resetExtensions(): void; + + /** + * Setting a "global" flavor affects all instances of showdown + * + * @param name + */ + function setFlavor(name: string): void; } From 66bd4290746e62eea9af862b46c22756c61e853a Mon Sep 17 00:00:00 2001 From: Steve Purol Date: Mon, 6 Mar 2017 14:11:17 -0500 Subject: [PATCH 311/797] recompose: withHandlers may take a factory function --- recompose/index.d.ts | 5 +++-- recompose/recompose-tests.tsx | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/recompose/index.d.ts b/recompose/index.d.ts index 3ff504fab3..6cef47160e 100644 --- a/recompose/index.d.ts +++ b/recompose/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Recompose v0.20.3 +// Type definitions for Recompose v0.22.0 // Project: https://github.com/acdlite/recompose // Definitions by: Iskander Sierra // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -50,8 +50,9 @@ declare module 'recompose' { type HandleCreators = { [handlerName: string]: mapper; }; + type HandleCreatorsFactory = (initialProps: TOutter) => HandleCreators; export function withHandlers( - handlerCreators: HandleCreators + handlerCreators: HandleCreators | HandleCreatorsFactory ): ComponentEnhancer; // defaultProps: https://github.com/acdlite/recompose/blob/master/docs/API.md#defaultprops diff --git a/recompose/recompose-tests.tsx b/recompose/recompose-tests.tsx index c4c66b3e2c..01bd1d28f5 100644 --- a/recompose/recompose-tests.tsx +++ b/recompose/recompose-tests.tsx @@ -73,6 +73,12 @@ function testWithHandlers() { onSubmit: (props: OutterProps) => (e: any) => {}, }); const enhanced: React.ComponentClass = enhancer(innerComponent); + + const enhancer2 = withHandlers((props: OutterProps) => ({ + onChange: (props: OutterProps) => (e: any) => {}, + onSubmit: (props: OutterProps) => (e: any) => {}, + })); + const enhanced2: React.ComponentClass = enhancer2(innerComponent); } function testDefaultProps() { From 53fd6a1051a5b6a74f9c5e1335e7286e30adb960 Mon Sep 17 00:00:00 2001 From: sqwk Date: Mon, 6 Mar 2017 23:19:10 +0100 Subject: [PATCH 312/797] Update Lowdb Test --- lowdb/index.d.ts | 1073 +++++++++++++++++++++--------------------- lowdb/lowdb-tests.ts | 5 +- 2 files changed, 547 insertions(+), 531 deletions(-) diff --git a/lowdb/index.d.ts b/lowdb/index.d.ts index ddd20e89ed..2beda1e2ba 100644 --- a/lowdb/index.d.ts +++ b/lowdb/index.d.ts @@ -1,536 +1,553 @@ -declare module 'lowdb' { - interface PromiseLike { - - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; - } - - interface StringRepresentable { - toString(): string; - } - - interface List { - [index: number]: T; - length: number; - } - - interface Dictionary { - [index: string]: T; - } - - interface DictionaryIterator { - (value: T, key?: string, collection?: Dictionary): TResult; - } - - interface ListIterator { - (value: T, index: number, collection: List): TResult; - } - - interface StringIterator { - (char: string, index?: number, string?: string): TResult; - } - - interface MixinOptions { - chain?: boolean; - } - - interface LoDashWrapper { - - /** - * @see _.has - */ - has(path: StringRepresentable | StringRepresentable[]): LoDashWrapper; - - /** - * @see _.hasIn - */ - hasIn(path: StringRepresentable | StringRepresentable[]): LoDashWrapper; - - /** - * @see _.assign - */ - assign( - source: TSource - ): LoDashWrapper; - - /** - * @see _.assign - */ - assign( - source1: TSource1, - source2: TSource2 - ): LoDashWrapper; - - /** - * @see _.assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3 - ): LoDashWrapper; - - /** - * @see _.assign - */ - assign( - source1: TSource1, - source2: TSource2, - source3: TSource3, - source4: TSource4 - ): LoDashWrapper; - - /** - * @see _.assign - */ - assign(): LoDashWrapper; - - /** - * @see _.assign - */ - assign(...otherArgs: any[]): LoDashWrapper; - - /** - * @see _.cloneDeep - */ - cloneDeep(): LoDashWrapper; - - /** - * @see _.cloneDeep - */ - cloneDeep(): LoDashWrapper; - - /** - * @see _.cloneDeep - */ - cloneDeepWith(customizer: (value: any) => any): LoDashWrapper[]; - - /** - * @see _.cloneDeep - */ - cloneDeepWith(customizer: (value: any) => any): LoDashWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: S1, - ...sources: {}[] - ): LoDashWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: S1, - source2: S2, - ...sources: {}[] - ): LoDashWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: S1, - source2: S2, - source3: S3, - ...sources: {}[] - ): LoDashWrapper; - - /** - * @see _.defaults - */ - defaults( - source1: S1, - source2: S2, - source3: S3, - source4: S4, - ...sources: {}[] - ): LoDashWrapper; - - /** - * @see _.defaults - */ - defaults(): LoDashWrapper; - - /** - * @see _.defaults - */ - defaults(...sources: {}[]): LoDashWrapper; - - /** - * @see _.get - */ - get(object: Object, - path: string | number | boolean | Array, - defaultValue?: TResult - ): LoDashWrapper; - - /** - * @see _.get - */ - get(path: string | number | boolean | Array, - defaultValue?: TResult - ): LoDashWrapper; - - - /** - * @see _.mixin - */ - mixin( - source: Dictionary, - options?: MixinOptions - ): LoDashWrapper; - - /** - * @see _.mixin - */ - mixin( - options?: MixinOptions - ): LoDashWrapper; - - /** - * @see _.set - */ - set( - path: StringRepresentable | StringRepresentable[], - value: any - ): LoDashWrapper; - - /** - * @see _.set - */ - set( - path: StringRepresentable | StringRepresentable[], - value: V - ): LoDashWrapper; - - /** - * @see _.find - */ - find( - predicate?: ListIterator, - thisArg?: any - ): LoDashWrapper; - - /** - * @see _.find - */ - find( - predicate?: string, - thisArg?: any - ): LoDashWrapper; - - /** - * @see _.find - */ - find( - predicate?: TObject - ): LoDashWrapper; - - /** - * @see _.find - */ - filter( - predicate?: TObject - ): LoDashWrapper; - - /** - * @see _.filter - */ - filter( - predicate?: ListIterator, - thisArg?: any - ): LoDashWrapper; - - /** - * @see _.filter - */ - filter( - predicate: string, - thisArg?: any - ): LoDashWrapper; - - /** - * @see _.filter - */ - filter( - predicate: ListIterator | DictionaryIterator, - thisArg?: any - ): LoDashWrapper; - - /** - * @see _.filter - */ - filter( - predicate?: StringIterator, - thisArg?: any - ): LoDashWrapper; - - /** - * @see _.filter - */ - filter(predicate: W): LoDashWrapper; - /** - * @see _.map - */ - map( - iteratee?: ListIterator, - thisArg?: any - ): LoDashWrapper; - - /** - * @see _.map - */ - map( - iteratee?: string - ): LoDashWrapper; - - /** - * @see _.map - */ - map( - iteratee?: TObject - ): LoDashWrapper; - /** - * @see _.map - */ - map( - iteratee?: ListIterator | DictionaryIterator, - thisArg?: any - ): LoDashWrapper; - - /** - * @see _.range - */ - range( - end?: number, - step?: number - ): LoDashWrapper; - - /** - * @see _.rangeRight - */ - rangeRight( - end?: number, - step?: number - ): LoDashWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: ListIterator, - thisArg?: any - ): LoDashWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: string, - thisArg?: any - ): LoDashWrapper; - - /** - * @see _.remove - */ - remove( - predicate?: W - ): LoDashWrapper; - - /** - * @see _.sortBy - */ - sortBy( - iteratee?: ListIterator - ): LoDashWrapper; - - /** - * @see _.sortBy - */ - sortBy(iteratee: string): LoDashWrapper; - - /** - * @see _.sortBy - */ - sortBy(whereValue: W): LoDashWrapper; - - /** - * @see _.sortBy - */ - sortBy(): LoDashWrapper; - - /** - * @see _.sortBy - */ - sortBy(...iteratees: (ListIterator | Object | string)[]): LoDashWrapper; - - /** - * @see _.sortBy - */ - sortBy(iteratees: (ListIterator | string | Object)[]): LoDashWrapper; - - /** - * @see _.slice - */ - slice( - start?: number, - end?: number - ): LoDashWrapper; - - /** - * @see _.size - */ - size(): LoDashWrapper; - - /** - * @see _.take - */ - take(n?: number): LoDashWrapper; - - /** - * @see _.times - */ - times( - iteratee: (num: number) => TResult - ): LoDashWrapper; - - /** - * @see _.times - */ - times(): LoDashWrapper; - - /** - * @see _.uniqueId - */ - uniqueId(): LoDashWrapper; - - value(): T; - - pop(): T; - push(...items: T[]): LoDashWrapper; - shift(): T; - sort(compareFn?: (a: T, b: T) => number): LoDashWrapper; - splice(start: number): LoDashWrapper; - splice(start: number, deleteCount: number, ...items: any[]): LoDashWrapper; - unshift(...items: T[]): LoDashWrapper; - } - - interface Storage { - /** - * Reads the database. - * - * @param source The source location. - * @param deserialize The deserialize function to apply. - * @return Returns a promise with the deserialized db object. - */ - read?(source: string, deserialize: any): PromiseLike - /** - * Reads the database. - * - * @param source The source location. - * @param deserialize The deserialize function to apply. - * @return Returns the deserialized db object. - */ - read?(source: string, deserialize: any): Object - /** - * Writes to the database. - * - * @param destination The destination location. - * @param obj The object to write. - * @param serialize The serialize function to apply. - */ - write?(destination: string, obj: any, serialize: any): void - /** - * Writes to the database. - * - * @param destination The destination location. - * @param obj The object to write. - * @param serialize The serialize function to apply. - */ - write?(destination: string, obj: any, serialize: any): PromiseLike - } - - interface Format { - /** - * Writes to the database. - * - * @param obj The object to serialize. - * @return Returns the serialized object string. - */ - serialize(obj: Object): string - /** - * Writes to the database. - * - * @param data The object to deserialize. - * @return Returns the deserialized object. - */ - deserialize(data: string): Object - } - - interface Options { - /** - * The custom "storage" object. - */ - storage?: Storage - /** - * The custom "format" object. - */ - format?: Format - /** - * The flag to automatically persist changes. - */ - writeOnChange?: boolean - } - - export interface Low extends LoDashWrapper, Format { - /** - * Access current database state. - * Returns Returns the database state. - */ - getState(): Object - /** - * Drop or reset database state. - * @param newState New state of the database - */ - setState(newState: Object): void - /** - * Persist database. - * @param source The source location. - */ - write(source: string): void - /** - * Persist database. - * @param source The source location. - */ - write(source: string): PromiseLike - /** - * Read database. - * @param source The source location. - */ - read(source?: string): Object - /** - * Read database. - * @param source The source location. - */ - read(source?: string): PromiseLike +declare namespace lowdb { + + interface PromiseLike { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; + then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; + } + + interface StringRepresentable { + toString(): string; + } + + interface List { + [index: number]: T; + length: number; + } + + interface Dictionary { + [index: string]: T; + } + + interface DictionaryIterator { + (value: T, key?: string, collection?: Dictionary): TResult; + } + + interface ListIterator { + (value: T, index: number, collection: List): TResult; + } + + interface StringIterator { + (char: string, index?: number, string?: string): TResult; + } + + interface MixinOptions { + chain?: boolean; + } + + class LoDashWrapper { + + /** + * @see _.has + */ + has(path: StringRepresentable | StringRepresentable[]): LoDashWrapper; + + /** + * @see _.hasIn + */ + hasIn(path: StringRepresentable | StringRepresentable[]): LoDashWrapper; + + /** + * @see _.assign + */ + assign( + source: TSource + ): LoDashWrapper; + + /** + * @see _.assign + */ + assign( + source1: TSource1, + source2: TSource2 + ): LoDashWrapper; + + /** + * @see _.assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashWrapper; + + /** + * @see _.assign + */ + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashWrapper; + + /** + * @see _.assign + */ + assign(): LoDashWrapper; + + /** + * @see _.assign + */ + assign(...otherArgs: any[]): LoDashWrapper; + + /** + * @see _.cloneDeep + */ + cloneDeep(): LoDashWrapper; + + /** + * @see _.cloneDeep + */ + cloneDeep(): LoDashWrapper; + + /** + * @see _.cloneDeep + */ + cloneDeepWith(customizer: (value: any) => any): LoDashWrapper[]; + + /** + * @see _.cloneDeep + */ + cloneDeepWith(customizer: (value: any) => any): LoDashWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: S1, + ...sources: {}[] + ): LoDashWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: S1, + source2: S2, + ...sources: {}[] + ): LoDashWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: S1, + source2: S2, + source3: S3, + ...sources: {}[] + ): LoDashWrapper; + + /** + * @see _.defaults + */ + defaults( + source1: S1, + source2: S2, + source3: S3, + source4: S4, + ...sources: {}[] + ): LoDashWrapper; + + /** + * @see _.defaults + */ + defaults(): LoDashWrapper; + + /** + * @see _.defaults + */ + defaults(...sources: {}[]): LoDashWrapper; + + /** + * @see _.get + */ + get(object: Object, + path: string | number | boolean | Array, + defaultValue?: TResult + ): LoDashWrapper; + + /** + * @see _.get + */ + get(path: string | number | boolean | Array, + defaultValue?: TResult + ): LoDashWrapper; + + + /** + * @see _.mixin + */ + mixin( + source: Dictionary, + options?: MixinOptions + ): LoDashWrapper; + + /** + * @see _.mixin + */ + mixin( + options?: MixinOptions + ): LoDashWrapper; + + /** + * @see _.set + */ + set( + path: StringRepresentable | StringRepresentable[], + value: any + ): LoDashWrapper; + + /** + * @see _.set + */ + set( + path: StringRepresentable | StringRepresentable[], + value: V + ): LoDashWrapper; + + /** + * @see _.find + */ + find( + predicate?: ListIterator, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.find + */ + find( + predicate?: string, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.find + */ + find( + predicate?: TObject + ): LoDashWrapper; + + /** + * @see _.find + */ + filter( + predicate?: TObject + ): LoDashWrapper; + + /** + * @see _.filter + */ + filter( + predicate?: ListIterator, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.filter + */ + filter( + predicate: string, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.filter + */ + filter( + predicate: ListIterator | DictionaryIterator, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.filter + */ + filter( + predicate?: StringIterator, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.filter + */ + filter(predicate: W): LoDashWrapper; + /** + * @see _.map + */ + map( + iteratee?: ListIterator, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.map + */ + map( + iteratee?: string + ): LoDashWrapper; + + /** + * @see _.map + */ + map( + iteratee?: TObject + ): LoDashWrapper; + /** + * @see _.map + */ + map( + iteratee?: ListIterator | DictionaryIterator, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.range + */ + range( + end?: number, + step?: number + ): LoDashWrapper; + + /** + * @see _.rangeRight + */ + rangeRight( + end?: number, + step?: number + ): LoDashWrapper; + + /** + * @see _.remove + */ + remove( + predicate?: ListIterator, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.remove + */ + remove( + predicate?: string, + thisArg?: any + ): LoDashWrapper; + + /** + * @see _.remove + */ + remove( + predicate?: W + ): LoDashWrapper; + + /** + * @see _.sortBy + */ + sortBy( + iteratee?: ListIterator + ): LoDashWrapper; + + /** + * @see _.sortBy + */ + sortBy(iteratee: string): LoDashWrapper; + + /** + * @see _.sortBy + */ + sortBy(whereValue: W): LoDashWrapper; + + /** + * @see _.sortBy + */ + sortBy(): LoDashWrapper; + + /** + * @see _.sortBy + */ + sortBy(...iteratees: (ListIterator | Object | string)[]): LoDashWrapper; + + /** + * @see _.sortBy + */ + sortBy(iteratees: (ListIterator | string | Object)[]): LoDashWrapper; + + /** + * @see _.slice + */ + slice( + start?: number, + end?: number + ): LoDashWrapper; + + /** + * @see _.size + */ + size(): LoDashWrapper; + + /** + * @see _.take + */ + take(n?: number): LoDashWrapper; + + /** + * @see _.times + */ + times( + iteratee: (num: number) => TResult + ): LoDashWrapper; + + /** + * @see _.times + */ + times(): LoDashWrapper; + + /** + * @see _.uniqueId + */ + uniqueId(): LoDashWrapper; + + value(): T; + + pop(): T; + push(...items: T[]): LoDashWrapper; + shift(): T; + sort(compareFn?: (a: T, b: T) => number): LoDashWrapper; + splice(start: number): LoDashWrapper; + splice(start: number, deleteCount: number, ...items: any[]): LoDashWrapper; + unshift(...items: T[]): LoDashWrapper; + } + + export interface Storage { + + /** + * Reads the database. + * + * @param source The source location. + * @param deserialize The deserialize function to apply. + * @return Returns a promise with the deserialized db object. + */ + read?(source: string, deserialize: any): PromiseLike + + /** + * Reads the database. + * + * @param source The source location. + * @param deserialize The deserialize function to apply. + * @return Returns the deserialized db object. + */ + read?(source: string, deserialize: any): Object + + /** + * Writes to the database. + * + * @param destination The destination location. + * @param obj The object to write. + * @param serialize The serialize function to apply. + */ + write?(destination: string, obj: any, serialize: any): void + + /** + * Writes to the database. + * + * @param destination The destination location. + * @param obj The object to write. + * @param serialize The serialize function to apply. + */ + write?(destination: string, obj: any, serialize: any): PromiseLike + } + + export interface Format { + + /** + * Writes to the database. + * + * @param obj The object to serialize. + * @return Returns the serialized object string. + */ + serialize(obj: Object): string + + /** + * Writes to the database. + * + * @param data The object to deserialize. + * @return Returns the deserialized object. + */ + deserialize(data: string): Object + } + + export interface Options { + + /** + * The custom "storage" object. + */ + storage?: Storage + + /** + * The custom "format" object. + */ + format?: Format + + /** + * The flag to automatically persist changes. + */ + writeOnChange?: boolean + + } + + export class Low extends LoDashWrapper { + + constructor(filePath: string, options?: Options); + + /** + * Access current database state. + * Returns Returns the database state. + */ + getState(): Object + + /** + * Drop or reset database state. + * @param newState New state of the database + */ + setState(newState: Object): void + + /** + * Persist database. + * @param source The source location. + */ + write(source: string): void + + /** + * Persist database. + * @param source The source location. + */ + write(source: string): PromiseLike + + /** + * Read database. + * @param source The source location. + */ + read(source?: string): Object + + /** + * Read database. + * @param source The source location. + */ + read(source?: string): PromiseLike + } // declare class lowdb { // new (source?: string, opts?: Options): Low; // (source?: string, opts?: Options) : Low; // } - -// declare module "lowdb" { -// export = lowdb; -// } - } +declare module "lowdb" { + export = lowdb.Low; +} \ No newline at end of file diff --git a/lowdb/lowdb-tests.ts b/lowdb/lowdb-tests.ts index d656c63b62..612288e8dd 100644 --- a/lowdb/lowdb-tests.ts +++ b/lowdb/lowdb-tests.ts @@ -1,9 +1,8 @@ import Lowdb = require('lowdb'); -Lowdb -let db = new Lowdb(); +const db = new Lowdb('db.json'); -db.defaults({ 'someObject': {}, 'anotherObject': {} }).value(); +db.defaults({ someObject: {}, anotherObject: {} }).value(); db.get('someObject').set('foo' , 'bar').value(); db.get('anotherObject').set('foo' , 'bar').value(); From 8bfb64811e76ee7217a78ae355ae6e6d8c6802fb Mon Sep 17 00:00:00 2001 From: sqwk Date: Mon, 6 Mar 2017 23:40:18 +0100 Subject: [PATCH 313/797] Update Lowdb Test --- lowdb/index.d.ts | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/lowdb/index.d.ts b/lowdb/index.d.ts index 2beda1e2ba..4118372647 100644 --- a/lowdb/index.d.ts +++ b/lowdb/index.d.ts @@ -1,3 +1,8 @@ +// Type definitions for Lowdb 0.15 +// Project: https://github.com/typicode/lowdb +// Definitions by: typicode, +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + declare namespace lowdb { interface PromiseLike { @@ -167,7 +172,7 @@ declare namespace lowdb { /** * @see _.get */ - get(object: Object, + get(object: any, path: string | number | boolean | Array, defaultValue?: TResult ): LoDashWrapper; @@ -184,7 +189,7 @@ declare namespace lowdb { * @see _.mixin */ mixin( - source: Dictionary, + source: Dictionary<() => void>, options?: MixinOptions ): LoDashWrapper; @@ -370,12 +375,12 @@ declare namespace lowdb { /** * @see _.sortBy */ - sortBy(...iteratees: (ListIterator | Object | string)[]): LoDashWrapper; + sortBy(...iteratees: (ListIterator | any | string)[]): LoDashWrapper; /** * @see _.sortBy */ - sortBy(iteratees: (ListIterator | string | Object)[]): LoDashWrapper; + sortBy(iteratees: (ListIterator | string | any)[]): LoDashWrapper; /** * @see _.slice @@ -441,7 +446,7 @@ declare namespace lowdb { * @param deserialize The deserialize function to apply. * @return Returns the deserialized db object. */ - read?(source: string, deserialize: any): Object + read?(source: string, deserialize: any): {} /** * Writes to the database. @@ -470,7 +475,7 @@ declare namespace lowdb { * @param obj The object to serialize. * @return Returns the serialized object string. */ - serialize(obj: Object): string + serialize(obj: any): string /** * Writes to the database. @@ -478,7 +483,7 @@ declare namespace lowdb { * @param data The object to deserialize. * @return Returns the deserialized object. */ - deserialize(data: string): Object + deserialize(data: string): any } export interface Options { @@ -508,13 +513,13 @@ declare namespace lowdb { * Access current database state. * Returns Returns the database state. */ - getState(): Object + getState(): any /** * Drop or reset database state. * @param newState New state of the database */ - setState(newState: Object): void + setState(newState: any): void /** * Persist database. @@ -532,13 +537,13 @@ declare namespace lowdb { * Read database. * @param source The source location. */ - read(source?: string): Object + read(source?: string): any /** * Read database. * @param source The source location. */ - read(source?: string): PromiseLike + read(source?: string): PromiseLike } From 393a3b4b8f777b405adaffcc7917b482e576aa7e Mon Sep 17 00:00:00 2001 From: Dasa Paddock Date: Mon, 6 Mar 2017 16:42:06 -0800 Subject: [PATCH 314/797] Update for ArcGIS API for JavaScript version 4.3 --- arcgis-js-api/index.d.ts | 1961 +++++++++++++++++++++++++++++++++++--- 1 file changed, 1814 insertions(+), 147 deletions(-) diff --git a/arcgis-js-api/index.d.ts b/arcgis-js-api/index.d.ts index 87df41a8d8..293c5190e9 100644 --- a/arcgis-js-api/index.d.ts +++ b/arcgis-js-api/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript 4.2 +// Type definitions for ArcGIS API for JavaScript 4.3 // Project: http://js.arcgis.com // Definitions by: Esri // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -32,14 +32,19 @@ declare namespace JSX { declare namespace __esri { export class Accessor { + constructor(obj?: any); + destroyed: boolean; initialized: boolean; declaredClass: string; destroy(): void; + get(propertyName: string): T; get(propertyName: string): any; set(propertyName: string, value: T): this; set(props: HashMap): this; + watch(path: string | string[], callback: WatchCallback, sync?: boolean): WatchHandle; + protected notifyChange(propertyName: string): void; protected _get(propertyName: string): any; protected _get(propertyName: string): T; @@ -69,18 +74,521 @@ declare namespace __esri { remove(): void; } + export interface EachAlwaysResult { + promise: IPromise; + value: any; + error: any; + } + export interface PausableWatchHandle { remove(): void; pause(): void; resume(): void; } + export interface FeatureEditResult { + objectId: number; + error: any; + } + export interface AttributeParamValue { attributeName: string; parameterName: string; value: string; } + export interface DataWorkspace { + id: string; + name: string; + } + + export interface GroupMembership { + id: number; + name: string; + } + + export interface HoldType { + description: string; + id: number; + name: string; + } + + export interface JobPriority { + description: string; + name: string; + value: number; + } + + export interface JobQuery { + id: number; + name: string; + } + + export interface JobStatus { + caption: string; + description: string; + id: number; + name: string; + } + + export interface JobQueryContainer { + containers: JobQueryContainer[]; + id: number; + name: string; + queries: JobQuery[]; + } + + export interface JobQueryDetails { + aliases: string[]; + fields: string[]; + id: number; + name: string; + orderBy: string; + tables: string[]; + where: string; + } + + export interface Privilege { + description: string; + id: number; + name: string; + } + + export interface UserDetails { + lastName: string; + address: string; + faxNumber: string; + firstName: string; + fullName: string; + groups: GroupMembership[]; + email: string; + phoneNumber: string; + privileges: Privilege[]; + roomNumber: string; + userName: string; + userQueries: JobQueryContainer[]; + zipCode: string; + } + + export interface VersionInfo { + access: string; + name: string; + parent: string; + } + + export interface WorkflowManagerServiceInfo { + jobPriorities: JobPriority[]; + activityTypes: ActivityType[]; + currentVersion: number; + dataWorkspaces: DataWorkspace[]; + holdTypes: HoldType[]; + configProperties: any; + jobStatuses: JobStatus[]; + jobTypes: JobType[]; + notificationTypes: NotificationType[]; + privileges: Privilege[]; + publicQueries: JobQueryContainer[]; + } + + export interface JobType { + category: string; + description: string; + id: string; + name: string; + state: string; + } + + export interface JobTypeDetails { + defaultParentVersionName: string; + autoExecuteCreatedJobs: boolean; + category: string; + defaultAssignedTo: string; + defaultAssignedType: string; + defaultDataWorkspaceId: string; + defaultDescription: string; + defaultDueDate: string; + defaultJobDuration: number; + canDataWorkspaceChange: boolean; + defaultPriority: string; + defaultStartDate: Date; + description: string; + id: string; + jobNamingScheme: string; + jobVersionNamingScheme: string; + mxdNamingScheme: string; + name: string; + state: string; + } + + export interface TableRelationship { + cardinality: string; + linkField: string; + tableAlias: string; + tableName: string; + } + + export interface JobCreationParameters { + loi: Geometry; + assignedTo: string; + autoCommitWorkflow: boolean; + autoExecute: boolean; + dataWorkspaceId: string; + description: string; + dueDate: Date; + jobTypeId: number; + assignedType: string; + name: string; + numJobs: string; + ownedBy: string; + parentJobId: number; + parentVersion: string; + priority: number; + startDate: Date; + user: string; + } + + export interface JobQueryParameters { + aliases: string; + fields: string; + orderBy: string; + tables: string; + where: string; + user: string; + } + + export interface JobUpdateParameters { + ownedBy: string; + assignedTo: string; + dataWorkspaceId: string; + description: string; + dueDate: Date; + loi: Geometry; + jobId: number; + name: string; + assignedType: string; + parentJobId: number; + parentVersion: string; + percent: number; + priority: number; + startDate: Date; + status: number; + versionName: string; + user: string; + } + + export interface AuxRecordDescription { + properties: any; + recordId: number; + tableName: string; + } + + export interface ActivityType { + desription: string; + id: number; + message: string; + name: string; + } + + export interface AuxRecordContainer { + records: AuxRecord; + relationshipType: string; + tableAlias: string; + tableName: string; + } + + export interface JobTaskJobInfo { + name: string; + assignedTo: string; + childJobIds: number[]; + createdBy: string; + createdDate: Date; + dataWorkspaceId: string; + description: string; + dueDate: Date; + endDate: Date; + id: number; + jobTypeId: number; + loi: Geometry; + assignedType: string; + ownedBy: string; + parentJobId: number; + parentVersion: string; + pendingDays: number; + percentageComplete: number; + priority: number; + stage: string; + startDate: Date; + status: number; + versionExists: boolean; + versionInfo: JobVersionInfo; + versionName: string; + } + + export interface QueryResult { + fields: QueryFieldInfo[]; + rows: string[]; + } + + export interface AuxRecord { + displayProperty: any; + id: number; + recordvalues: AuxRecordValue; + } + + export interface AuxRecordValue { + filter: string; + alias: string; + data: any; + dataType: string; + displayOrder: number; + displayType: string; + domain: string; + canUpdate: boolean; + length: number; + name: string; + required: boolean; + tableListClass: string; + tableListDisplayField: string; + tableListStoreField: string; + userVisible: boolean; + } + + export interface FieldValue { + description: string; + value: any; + } + + export interface JobVersionInfo { + dataWorkspaceId: string; + name: string; + parent: string; + created: boolean; + owner: string; + } + + export interface QueryFieldInfo { + alias: string; + length: string; + name: string; + type: string; + } + + export interface JobAttachment { + filename: string; + folder: string; + id: number; + storageType: string; + } + + export interface JobDependency { + depJobId: number; + depOnType: string; + depOnValue: string; + heldOnValue: number; + holdOnType: string; + id: number; + jobID: string; + } + + export interface ChangeRule { + description: string; + evaluators: any[]; + id: number; + name: string; + notifier: any; + summarize: boolean; + } + + export interface DataSetEvaluator { + dataSetConfigurations: DatasetConfiguration[]; + name: string; + type: string; + } + + export interface AOIEvaluator { + aoi: Polygon; + inverse: boolean; + name: string; + relation: string; + type: string; + useJobAOI: boolean; + } + + export interface DatasetConfiguration { + changeCondition: number; + changeFields: string; + dataset: string; + dataWorkspaceId: string; + name: string; + whereConditions: WhereCondition[]; + } + + export interface EmailNotifier { + attachJobAttachments: boolean; + message: string; + name: string; + senderEmail: string; + senderName: string; + subject: string; + subscribers: string[]; + type: string; + } + + export interface WhereCondition { + compareValue: any; + field: string; + operator: string; + } + + export interface NotificationType { + attachJobAttachments: boolean; + id: number; + message: string; + senderEmail: string; + senderName: string; + subject: string; + subscribers: string[]; + type: string; + } + + export interface ChangeRuleMatch { + changeTime: Date; + changeType: string; + dataset: string; + dataWorkspaceId: string; + id: string; + jobID: string; + ruleID: string; + } + + export interface ReportDataGroup { + aggregateLabel: string; + aggregateValue: string; + row: string[]; + value: string; + } + + export interface ReportData { + columns: string[]; + description: string; + groups: ReportDataGroup[]; + title: string; + } + + export interface Report { + description: string; + hierarchy: string; + id: number; + name: string; + title: string; + } + + export interface ExecuteInfo { + conflicts: WorkflowConflicts; + errorCode: number; + errorDescription: string; + executionResult: string; + hasConflicts: boolean; + hasReturnCode: boolean; + jobID: number; + returnCode: number; + stepID: number; + threwError: boolean; + } + + export interface Step { + hasBeenExecuted: boolean; + assignedTo: string; + async: boolean; + autoRun: boolean; + canSkip: boolean; + canSpawnConcurrency: boolean; + commonId: number; + defaultPercentComplete: number; + assignedType: string; + hasBeenStarted: boolean; + id: number; + name: string; + selfCheck: boolean; + statusId: number; + stepPercentComplete: number; + notificationType: string; + stepType: StepType; + } + + export interface StepType { + program: string; + arguments: string; + executionType: string; + id: number; + name: string; + description: string; + stepDescriptionLink: string; + stepDescriptionType: string; + stepIndicatorType: string; + supportedPlatform: string; + visible: boolean; + } + + export interface WorkflowDisplayDetails { + annotations: WorkflowAnnotationDisplayDetails[]; + paths: WorkflowPathDisplayDetails[]; + steps: WorkflowStepDisplayDetails[]; + } + + export interface WorkflowOption { + returnCode: number; + steps: WorkflowStepInfo[]; + } + + export interface WorkflowStepInfo { + id: number; + name: string; + } + + export interface WorkflowAnnotationDisplayDetails { + centerX: number; + centerY: number; + fillColor: any; + height: number; + label: string; + labelColor: any; + OutlineColor: any; + width: number; + } + + export interface WorkflowConflicts { + jobID: number; + options: WorkflowOption[]; + spawnsConcurrency: boolean; + stepId: number; + } + + export interface WorkflowPathDisplayDetails { + destStepId: number; + sourceStepID: number; + label: string; + labelColor: any; + labelX: number; + labelY: number; + lineColor: any; + pathObject: any; + } + + export interface WorkflowStepDisplayDetails { + labelColor: any; + centerX: number; + fillColor: any; + height: number; + label: string; + centerY: number; + OutlineColor: any; + shape: string; + stepId: number; + stepType: string; + width: number; + } + export interface ExternalRenderer { setup(): void; render(): void; @@ -139,26 +647,6 @@ declare namespace __esri { suggestionTemplate: string; } - export interface SearchViewModelLocatorSource { - categories: string[]; - countryCode: string; - localSearchOptions: any; - locationToAddressDistance: number; - searchTemplate: string; - locator: Locator; - singleLineFieldName: string; - } - - export interface SearchViewModelFeatureLayerSource { - displayField: string; - exactMatch: boolean; - featureLayer: FeatureLayer; - searchFields: string[]; - searchQueryParams: any; - suggestQueryParams: any; - suggestionTemplate: string; - } - export type GetHeader = (headerName: string) => string; export type WatchCallback = (newValue: any, oldValue: any, propertyName: string, target: Accessor) => void; @@ -282,11 +770,33 @@ declare namespace __esri { offset?: number; } + export interface FeatureLayerApplyEditsEdits { + addFeatures?: Graphic[]; + updateFeatures?: Graphic[]; + deleteFeatures?: Graphic[] | any[]; + } + + export interface FeatureLayerCapabilities { + operations: FeatureLayerCapabilitiesOperations; + } + + export interface FeatureLayerCapabilitiesOperations { + supportsAdd: boolean; + supportsDelete: boolean; + supportsUpdate: boolean; + supportsEditing: boolean; + supportsQuery: boolean; + } + export interface FeatureLayerElevationInfo { mode: string; offset?: number; } + export interface FeatureLayerGetFieldDomainOptions { + feature: Graphic; + } + export interface GraphicsLayerElevationInfo { mode: string; offset?: number; @@ -306,6 +816,21 @@ declare namespace __esri { offset?: number; } + export interface StreamLayerFilter { + geometry: Extent; + where: string; + } + + export interface StreamLayerPurgeOptions { + displayCount: number; + age: number; + } + + export interface StreamLayerUpdateFilterFilterChanges { + geometry: Extent; + where: string; + } + export interface VectorTileLayerCurrentStyleInfo { serviceUrl: string; styleUrl: string; @@ -382,6 +907,14 @@ declare namespace __esri { label: string; } + export interface PointCloudRendererPointSizeAlgorithm { + type: string; + useRealWorldSymbolSizes: boolean; + size: number; + scaleFactor: number; + minSize: number; + } + export interface PointCloudClassBreaksRendererColorClassBreakInfos { minValue: number; maxValue: number; @@ -422,8 +955,8 @@ declare namespace __esri { } export interface Symbol3DStyleOrigin { - styleName: string; - styleUrl: string; + styleName?: string; + styleUrl?: string; name: string; } @@ -508,6 +1041,294 @@ declare namespace __esri { tolerance: number; } + export interface ConfigurationTaskGetDataWorkspaceDetailsParams { + dataWorkspaceId: string; + user: string; + } + + export interface ConfigurationTaskGetUserJobQueryDetailsParams { + queryId: number; + user: string; + } + + export interface JobTaskAddEmbeddedAttachmentParams { + jobId: number; + form: any; + user: string; + } + + export interface JobTaskAddLinkedAttachmentParams { + jobId: number; + attachmentType: number; + path: string; + user: string; + } + + export interface JobTaskAddLinkedRecordParams { + jobId: number; + tableName: string; + user: string; + } + + export interface JobTaskAssignJobsParams { + jobIds: number[]; + assignedType: string; + assignedTo: string; + user: string; + } + + export interface JobTaskCloseJobsParams { + jobIds: number[]; + user: string; + } + + export interface JobTaskCreateDependencyParams { + jobId: number; + heldOnType: string; + heldOnValue: number; + depJobId: number; + depOnType: string; + depOnValue: number; + user: string; + } + + export interface JobTaskCreateHoldParams { + jobId: number; + holdTypeId: number; + comments: string; + user: string; + } + + export interface JobTaskCreateJobVersionParams { + jobId: number; + name: string; + parent: string; + user: string; + } + + export interface JobTaskDeleteAttachmentParams { + jobId: number; + attachmentId: number; + user: string; + } + + export interface JobTaskDeleteDependencyParams { + jobId: number; + dependencyId: number; + user: string; + } + + export interface JobTaskDeleteJobsParams { + jobIds: number[]; + deleteHistory?: boolean; + user: string; + } + + export interface JobTaskDeleteLinkedRecordParams { + jobId: number; + tableName: string; + recordId: number; + user: string; + } + + export interface JobTaskGetAttachmentContentUrlParams { + jobId: number; + attachmentId: number; + } + + export interface JobTaskListFieldValuesParams { + jobId: number; + tableName: string; + field: string; + user: string; + } + + export interface JobTaskListMultiLevelFieldValuesParams { + field: string; + previousSelectedValues: string[]; + user: string; + } + + export interface JobTaskLogActionParams { + jobId: number; + activityTypeId: number; + comments: string; + user: string; + } + + export interface JobTaskQueryJobsParams { + queryId: number; + user: string; + } + + export interface JobTaskQueryMultiLevelSelectedValuesParams { + field: string; + user: string; + } + + export interface JobTaskReleaseHoldParams { + jobId: number; + holdId: number; + } + + export interface JobTaskReopenClosedJobsParams { + jobIds: number[]; + user: string; + } + + export interface JobTaskSearchJobsParams { + text: string; + user: string; + } + + export interface JobTaskUnassignJobsParams { + jobIds: number[]; + user: string; + } + + export interface JobTaskUpdateNotesParams { + jobId: number; + notes: string; + user: string; + } + + export interface JobTaskUpdateRecordParams { + jobId: number; + record: AuxRecordDescription; + user: string; + } + + export interface NotificationTaskAddChangeRuleParams { + rule: ChangeRule; + user: string; + } + + export interface NotificationTaskDeleteChangeRuleParams { + ruleId: string; + user: string; + } + + export interface NotificationTaskNotifySessionParams { + sessionid: string; + deleteAfter: boolean; + user: string; + } + + export interface NotificationTaskQueryChangeRulesParams { + name: string; + description: string; + searchType: string; + user: string; + } + + export interface NotificationTaskRunSpatialNotificationOnHistoryParams { + dataWorkspaceId: string; + from: Date; + to: Date; + logMatches: boolean; + send: boolean; + user: string; + } + + export interface NotificationTaskSendNotificationParams { + jobId: number; + notificationType: string; + user: string; + } + + export interface NotificationTaskSubscribeToNotificationParams { + notificationTypeId: number; + email: string; + user: string; + } + + export interface NotificationTaskUnsubscribeFromNotificationParams { + notificationTypeId: number; + email: string; + user: string; + } + + export interface ReportTaskGenerateReportParams { + reportId: number; + user: string; + } + + export interface ReportTaskGetReportContentUrlParams { + reportId: number; + user: number; + } + + export interface ReportTaskGetReportDataParams { + reportId: number; + user: string; + } + + export interface TokenTaskParseTokensParams { + jobId: any; + stringToParse: string; + user: string; + } + + export interface WorkflowTaskCanRunStepParams { + jobId: number; + stepId: number; + user: string; + } + + export interface WorkflowTaskExecuteStepsParams { + jobId: number; + stepIds: number[]; + auto: boolean; + user: string; + } + + export interface WorkflowTaskGetStepDescriptionParams { + jobId: number; + stepId: number; + } + + export interface WorkflowTaskGetStepFileUrlParams { + jobId: number; + stepId: number; + } + + export interface WorkflowTaskGetStepParams { + jobId: number; + stepId: number; + } + + export interface WorkflowTaskMarkStepsAsDoneParams { + jobId: number; + stepIds: number[]; + user: string; + } + + export interface WorkflowTaskMoveToNextStepParams { + jobId: number; + stepId: number; + returnCode: number; + user: string; + } + + export interface WorkflowTaskRecreateWorkflowParams { + jobId: number; + user: string; + } + + export interface WorkflowTaskResolveConflictParams { + jobId: number; + stepId: number; + optionReturnCode: number; + optionStepIds: number[]; + user: string; + } + + export interface WorkflowTaskSetCurrentStepParams { + jobId: number; + stepId: number; + user: string; + } + export interface MapViewConstraints { lods?: LOD[]; minScale?: number; @@ -804,6 +1625,17 @@ declare namespace __esri { urlPrefix: string; } + export interface configWorkers { + loaderConfig: configWorkersLoaderConfig; + } + + export interface configWorkersLoaderConfig { + has: any; + paths: any; + map: any; + packages: any[]; + } + export interface requestEsriRequestOptions { callbackParamName?: string; query?: any; @@ -827,6 +1659,7 @@ declare namespace __esri { cast?: Function; readOnly?: boolean; aliasOf?: string; + value?: any; } export interface colorCreateContinuousRendererParams { @@ -895,21 +1728,22 @@ declare namespace __esri { title: string; } - export interface sizeCreateVisualVariableParams { + export interface sizeCreateVisualVariablesParams { layer: FeatureLayer | SceneLayer; field: string; normalizationField?: string; basemap?: string | Basemap; sizeScheme?: any | any | any; - legendOptions?: sizeCreateVisualVariableParamsLegendOptions; + legendOptions?: sizeCreateVisualVariablesParamsLegendOptions; statistics?: any; minValue?: number; maxValue?: number; view?: SceneView; worldScale?: boolean; + axis?: boolean; } - export interface sizeCreateVisualVariableParamsLegendOptions { + export interface sizeCreateVisualVariablesParamsLegendOptions { title: string; } @@ -972,6 +1806,7 @@ declare namespace __esri { } export interface univariateColorSizeCreateVisualVariablesParamsSizeOptions { + axis?: boolean; sizeScheme?: any | any | any; legendOptions?: univariateColorSizeCreateVisualVariablesParamsSizeOptionsLegendOptions; } @@ -1433,6 +2268,7 @@ declare namespace __esri { expand(factor: number): Extent; intersection(extent: Extent): Extent; intersects(geometry: Geometry): boolean; + normalize(): Extent[]; offset(dx: number, dy: number, dz: number): Extent; union(extent: Extent): Extent; } @@ -1519,6 +2355,7 @@ declare namespace __esri { copy(other: Point): void; distance(other: Point): number; equals(point: Point): boolean; + normalize(): Point; } interface PointConstructor { @@ -1556,6 +2393,9 @@ declare namespace __esri { interface PolygonConstructor { new(properties?: PolygonProperties): Polygon; + + fromExtent(extent: Extent): Polygon; + fromJSON(json: any): Polygon; } @@ -1873,6 +2713,7 @@ declare namespace __esri { } interface FeatureLayer extends Layer, PortalLayer, ScaleRangeLayer { + capabilities: FeatureLayerCapabilities; copyright: string; definitionExpression: string; elevationInfo: FeatureLayerElevationInfo; @@ -1898,7 +2739,9 @@ declare namespace __esri { url: string; version: number; + applyEdits(edits: FeatureLayerApplyEditsEdits): IPromise; createQuery(): Query; + getFieldDomain(fieldName: string, options?: FeatureLayerGetFieldDomainOptions): Domain; queryExtent(params?: Query): IPromise; queryFeatureCount(params?: Query): IPromise; queryFeatures(params?: Query): IPromise; @@ -1914,6 +2757,7 @@ declare namespace __esri { export const FeatureLayer: FeatureLayerConstructor; interface FeatureLayerProperties extends LayerProperties, PortalLayerProperties, ScaleRangeLayerProperties { + capabilities?: FeatureLayerCapabilities; copyright?: string; definitionExpression?: string; elevationInfo?: FeatureLayerElevationInfo; @@ -1940,6 +2784,26 @@ declare namespace __esri { version?: number; } + interface GeoRSSLayer extends Layer { + lineSymbol: SimpleLineSymbol; + pointSymbol: PictureMarkerSymbol; + polygonSymbol: SimpleFillSymbol; + url: string; + } + + interface GeoRSSLayerConstructor { + new(properties?: GeoRSSLayerProperties): GeoRSSLayer; + } + + export const GeoRSSLayer: GeoRSSLayerConstructor; + + interface GeoRSSLayerProperties extends LayerProperties { + lineSymbol?: SimpleLineSymbolProperties; + pointSymbol?: PictureMarkerSymbolProperties; + polygonSymbol?: SimpleFillSymbolProperties; + url?: string; + } + interface GraphicsLayer extends Layer, ScaleRangeLayer { elevationInfo: GraphicsLayerElevationInfo; graphics: Collection; @@ -2061,6 +2925,7 @@ declare namespace __esri { } interface SceneLayer extends Layer, SceneService, PortalLayer { + definitionExpression: string; elevationInfo: SceneLayerElevationInfo; fields: Field[]; geometryType: string; @@ -2072,6 +2937,7 @@ declare namespace __esri { popupTemplate: PopupTemplate; renderer: Renderer; + createQuery(): Query; getFieldUsageInfo(fieldName: string): any; queryExtent(params?: Query): IPromise; queryFeatureCount(params?: Query): IPromise; @@ -2088,6 +2954,7 @@ declare namespace __esri { export const SceneLayer: SceneLayerConstructor; interface SceneLayerProperties extends LayerProperties, SceneServiceProperties, PortalLayerProperties { + definitionExpression?: string; elevationInfo?: SceneLayerElevationInfo; fields?: FieldProperties[]; geometryType?: string; @@ -2101,9 +2968,12 @@ declare namespace __esri { } interface StreamLayer extends FeatureLayer { + filter: StreamLayerFilter; geometryDefinition: Extent; maximumTrackPoints: number; - purgeOptions: any; + purgeOptions: StreamLayerPurgeOptions; + + updateFilter(filterChanges: StreamLayerUpdateFilterFilterChanges): IPromise; } interface StreamLayerConstructor { @@ -2115,9 +2985,10 @@ declare namespace __esri { export const StreamLayer: StreamLayerConstructor; interface StreamLayerProperties extends FeatureLayerProperties { + filter?: StreamLayerFilter; geometryDefinition?: ExtentProperties; maximumTrackPoints?: number; - purgeOptions?: any; + purgeOptions?: StreamLayerPurgeOptions; } interface UnknownLayer extends Layer { @@ -2199,13 +3070,20 @@ declare namespace __esri { } interface CodedValueDomainConstructor { - new(properties?: any): CodedValueDomain; + new(properties?: CodedValueDomainProperties): CodedValueDomain; + getName(code: string | number): string; + + fromJSON(json: any): CodedValueDomain; } export const CodedValueDomain: CodedValueDomainConstructor; + interface CodedValueDomainProperties extends DomainProperties { + codedValues?: CodedValueDomainCodedValues[]; + } + interface DimensionalDefinition { dimensionName: string; isSlice: boolean; @@ -2221,20 +3099,25 @@ declare namespace __esri { export const DimensionalDefinition: DimensionalDefinitionConstructor; - interface Domain { + interface Domain extends Accessor, JSONSupport { name: string; type: string; - - toJSON(): any; } interface DomainConstructor { - new(): Domain; + new(properties?: DomainProperties): Domain; + + fromJSON(json: any): Domain; } export const Domain: DomainConstructor; - interface Field extends JSONSupport { + interface DomainProperties { + name?: string; + type?: string; + } + + interface Field extends Accessor, JSONSupport { alias: string; domain: Domain; editable: boolean; @@ -2254,7 +3137,7 @@ declare namespace __esri { interface FieldProperties { alias?: string; - domain?: Domain; + domain?: DomainProperties; editable?: boolean; length?: number; name?: string; @@ -2262,7 +3145,7 @@ declare namespace __esri { type?: string; } - interface ImageParameters { + interface ImageParameters extends Accessor { dpi: number; extent: Extent; format: string; @@ -2278,20 +3161,39 @@ declare namespace __esri { } interface ImageParametersConstructor { - new(properties?: any): ImageParameters; + new(properties?: ImageParametersProperties): ImageParameters; } export const ImageParameters: ImageParametersConstructor; + interface ImageParametersProperties { + dpi?: number; + extent?: ExtentProperties; + format?: string; + height?: number; + imageSpatialReference?: SpatialReferenceProperties; + layerDefinitions?: string[]; + layerIds?: number[]; + layerOption?: string; + transparent?: boolean; + width?: number; + } + interface InheritedDomain extends Domain { } interface InheritedDomainConstructor { - new(): InheritedDomain; + new(properties?: InheritedDomainProperties): InheritedDomain; + + fromJSON(json: any): InheritedDomain; } export const InheritedDomain: InheritedDomainConstructor; + interface InheritedDomainProperties extends DomainProperties { + + } + interface LabelClass extends Accessor, JSONSupport { labelExpression: string; labelExpressionInfo: LabelClassLabelExpressionInfo; @@ -2301,6 +3203,8 @@ declare namespace __esri { symbol: TextSymbol | LabelSymbol3D; useCodedValues: boolean; where: string; + + clone(): LabelClass; } interface LabelClassConstructor { @@ -2372,7 +3276,7 @@ declare namespace __esri { width?: number; } - interface MosaicRule extends JSONSupport { + interface MosaicRule extends Accessor, JSONSupport { ascending: boolean; lockRasterIds: number[]; method: string; @@ -2406,7 +3310,7 @@ declare namespace __esri { where?: string; } - interface PixelBlock { + interface PixelBlock extends Accessor { height: number; mask: number[]; pixels: number[][]; @@ -2421,23 +3325,39 @@ declare namespace __esri { } interface PixelBlockConstructor { - new(properties?: any): PixelBlock; + new(properties?: PixelBlockProperties): PixelBlock; } export const PixelBlock: PixelBlockConstructor; + interface PixelBlockProperties { + height?: number; + mask?: number[]; + pixels?: number[][]; + pixelType?: string; + statistics?: PixelBlockStatistics[]; + width?: number; + } + interface RangeDomain extends Domain { maxValue: number; minValue: number; } interface RangeDomainConstructor { - new(): RangeDomain; + new(properties?: RangeDomainProperties): RangeDomain; + + fromJSON(json: any): RangeDomain; } export const RangeDomain: RangeDomainConstructor; - interface RasterFunction extends JSONSupport { + interface RangeDomainProperties extends DomainProperties { + maxValue?: number; + minValue?: number; + } + + interface RasterFunction extends Accessor, JSONSupport { functionArguments: any; functionName: string; outputPixelType: string; @@ -2875,6 +3795,7 @@ declare namespace __esri { role: string; roleId: string; thumbnailUrl: string; + units: string; userContentUrl: string; username: string; @@ -2907,6 +3828,7 @@ declare namespace __esri { role?: string; roleId?: string; thumbnailUrl?: string; + units?: string; userContentUrl?: string; username?: string; } @@ -3005,7 +3927,7 @@ declare namespace __esri { valueExpression: string; valueExpressionTitle: string; - addUniqueValueInfo(valueOrInfo: string | any, symbol: Symbol): void; + addUniqueValueInfo(valueOrInfo: string | any, symbol?: Symbol): void; clone(): UniqueValueRenderer; getUniqueValueInfo(graphic: Graphic): any; removeUniqueValueInfo(value: string): void; @@ -3034,6 +3956,7 @@ declare namespace __esri { } interface PointCloudRenderer extends Accessor, JSONSupport { + pointSizeAlgorithm: PointCloudRendererPointSizeAlgorithm; pointsPerInch: number; } @@ -3046,6 +3969,7 @@ declare namespace __esri { export const PointCloudRenderer: PointCloudRendererConstructor; interface PointCloudRendererProperties { + pointSizeAlgorithm?: PointCloudRendererPointSizeAlgorithm; pointsPerInch?: number; } @@ -3133,6 +4057,30 @@ declare namespace __esri { type?: string; } + interface Action extends Accessor { + className: string; + id: string; + image: string; + title: string; + visible: boolean; + + clone(): Action; + } + + interface ActionConstructor { + new(properties?: ActionProperties): Action; + } + + export const Action: ActionConstructor; + + interface ActionProperties { + className?: string; + id?: string; + image?: string; + title?: string; + visible?: boolean; + } + interface ExtrudeSymbol3DLayer extends Symbol3DLayer { size: number; @@ -3817,8 +4765,6 @@ declare namespace __esri { } interface QueryTask extends Task { - gdbVersion: string; - execute(params: Query, requestOptions?: any): IPromise; executeForCount(params: Query, requestOptions?: any): IPromise; executeForExtent(params: Query, requestOptions?: any): IPromise; @@ -3833,7 +4779,7 @@ declare namespace __esri { export const QueryTask: QueryTaskConstructor; interface QueryTaskProperties extends TaskProperties { - gdbVersion?: string; + } interface PrintTask extends Task { @@ -4276,6 +5222,7 @@ declare namespace __esri { foundFieldName: string; layerId: number; layerName: string; + value: void; } interface FindResultConstructor { @@ -4292,6 +5239,7 @@ declare namespace __esri { foundFieldName?: string; layerId?: number; layerName?: string; + value?: void; } interface GeneralizeParameters extends Accessor { @@ -5042,6 +5990,173 @@ declare namespace __esri { trimExtendTo?: PolylineProperties; } + interface ConfigurationTask extends Task { + url: string; + + getAllGroups(requestOptions?: any): IPromise; + getAllUsers(requestOptions?: any): IPromise; + getDataWorkspaceDetails(params: ConfigurationTaskGetDataWorkspaceDetailsParams, requestOptions?: any): IPromise; + getGroup(groupId: number, requestOptions?: any): IPromise; + getJobTypeDetails(jobTypeId: number, requestOptions?: any): IPromise; + getPublicJobQueryDetails(queryId: number, requestOptions?: any): IPromise; + getServiceInfo(requestOptions?: any): IPromise; + getTableRelationshipsDetails(requestOptions?: any): IPromise; + getUser(user: string, requestOptions?: any): IPromise; + getUserJobQueryDetails(params: ConfigurationTaskGetUserJobQueryDetailsParams, requestOptions?: any): IPromise; + getVisibleJobTypes(user: string, requestOptions?: any): IPromise; + } + + interface ConfigurationTaskConstructor { + new(properties?: ConfigurationTaskProperties): ConfigurationTask; + } + + export const ConfigurationTask: ConfigurationTaskConstructor; + + interface ConfigurationTaskProperties extends TaskProperties { + url?: string; + } + + interface JobTask extends Task { + url: string; + + addEmbeddedAttachment(params: JobTaskAddEmbeddedAttachmentParams, requestOptions?: any): IPromise; + addLinkedAttachment(params: JobTaskAddLinkedAttachmentParams, requestOptions?: any): IPromise; + addLinkedRecord(params: JobTaskAddLinkedRecordParams, requestOptions?: any): IPromise; + assignJobs(params: JobTaskAssignJobsParams, requestOptions?: any): IPromise; + closeJobs(params: JobTaskCloseJobsParams, requestOptions?: any): IPromise; + createDependency(params: JobTaskCreateDependencyParams, requestOptions?: any): IPromise; + createHold(params: JobTaskCreateHoldParams, requestOptions?: any): IPromise; + createJobs(params: JobCreationParameters, requestOptions?: any): IPromise; + createJobVersion(params: JobTaskCreateJobVersionParams, requestOptions?: any): IPromise; + deleteAttachment(params: JobTaskDeleteAttachmentParams, requestOptions?: any): IPromise; + deleteDependency(params: JobTaskDeleteDependencyParams, requestOptions?: any): IPromise; + deleteJobs(params: JobTaskDeleteJobsParams, requestOptions?: any): IPromise; + deleteLinkedRecord(params: JobTaskDeleteLinkedRecordParams, requestOptions?: any): IPromise; + getActivityLog(jobId: number, requestOptions?: any): IPromise; + getAttachmentContentUrl(params: JobTaskGetAttachmentContentUrlParams): string; + getAttachments(jobId: number, requestOptions?: any): IPromise; + getDependencies(jobId: number, requestOptions?: any): IPromise; + getExtendedProperties(jobId: number, requestOptions?: any): IPromise; + getHolds(jobId: number, requestOptions?: any): IPromise; + getJob(jobId: number, requestOptions?: any): IPromise; + getJobIds(requestOptions?: any): IPromise; + getNotes(jobId: number, requestOptions?: any): IPromise; + listFieldValues(params: JobTaskListFieldValuesParams, requestOptions?: any): IPromise; + listMultiLevelFieldValues(params: JobTaskListMultiLevelFieldValuesParams, requestOptions?: any): IPromise; + logAction(params: JobTaskLogActionParams, requestOptions?: any): IPromise; + queryJobs(params: JobTaskQueryJobsParams, requestOptions?: any): IPromise; + queryJobsAdHoc(params: JobQueryParameters, requestOptions?: any): IPromise; + queryMultiLevelSelectedValues(params: JobTaskQueryMultiLevelSelectedValuesParams, requestOptions?: any): IPromise; + releaseHold(params: JobTaskReleaseHoldParams, requestOptions?: any): IPromise; + reopenClosedJobs(params: JobTaskReopenClosedJobsParams, requestOptions?: any): IPromise; + searchJobs(params: JobTaskSearchJobsParams, requestOptions?: any): IPromise; + unassignJobs(params: JobTaskUnassignJobsParams, requestOptions?: any): IPromise; + updateJob(params: JobUpdateParameters, requestOptions?: any): IPromise; + updateNotes(params: JobTaskUpdateNotesParams, requestOptions?: any): IPromise; + updateRecord(params: JobTaskUpdateRecordParams, requestOptions?: any): IPromise; + } + + interface JobTaskConstructor { + new(properties?: JobTaskProperties): JobTask; + } + + export const JobTask: JobTaskConstructor; + + interface JobTaskProperties extends TaskProperties { + url?: string; + } + + interface NotificationTask extends Task { + url: string; + + addChangeRule(params: NotificationTaskAddChangeRuleParams, requestOptions?: any): IPromise; + deleteChangeRule(params: NotificationTaskDeleteChangeRuleParams, requestOptions?: any): IPromise; + getAllChangeRules(requestOptions?: any): IPromise; + getChangeRule(ruleId: string, requestOptions?: any): IPromise; + getChangeRuleMatch(matchId: string, requestOptions?: any): IPromise; + getDatabaseTime(dataWorkspaceId: string, requestOptions?: any): IPromise; + getSessionMatches(sessionId: string, requestOptions?: any): IPromise; + notifySession(params: NotificationTaskNotifySessionParams, requestOptions?: any): IPromise; + queryChangeRules(params: NotificationTaskQueryChangeRulesParams, requestOptions?: any): IPromise; + runSpatialNotificationOnHistory(params: NotificationTaskRunSpatialNotificationOnHistoryParams, requestOptions?: any): IPromise; + sendNotification(params: NotificationTaskSendNotificationParams, requestOptions?: any): IPromise; + subscribeToNotification(params: NotificationTaskSubscribeToNotificationParams, requestOptions?: any): IPromise; + unsubscribeFromNotification(params: NotificationTaskUnsubscribeFromNotificationParams, requestOptions?: any): IPromise; + } + + interface NotificationTaskConstructor { + new(properties?: NotificationTaskProperties): NotificationTask; + } + + export const NotificationTask: NotificationTaskConstructor; + + interface NotificationTaskProperties extends TaskProperties { + url?: string; + } + + interface ReportTask extends Task { + url: string; + + generateReport(params: ReportTaskGenerateReportParams, requestOptions?: any): IPromise; + getAllReports(requestOptions?: any): IPromise; + getReportContentUrl(params: ReportTaskGetReportContentUrlParams): string; + getReportData(params: ReportTaskGetReportDataParams, requestOptions?: any): IPromise; + getReportStylesheet(reportId: number, requestOptions?: any): IPromise; + } + + interface ReportTaskConstructor { + new(properties?: ReportTaskProperties): ReportTask; + } + + export const ReportTask: ReportTaskConstructor; + + interface ReportTaskProperties extends TaskProperties { + url?: string; + } + + interface TokenTask extends Task { + parseTokens(params: TokenTaskParseTokensParams, requestOptions?: any): IPromise; + } + + interface TokenTaskConstructor { + new(properties?: TokenTaskProperties): TokenTask; + } + + export const TokenTask: TokenTaskConstructor; + + interface TokenTaskProperties extends TaskProperties { + + } + + interface WorkflowTask extends Task { + url: string; + + canRunStep(params: WorkflowTaskCanRunStepParams, requestOptions?: any): IPromise; + executeSteps(params: WorkflowTaskExecuteStepsParams, requestOptions?: any): IPromise; + getAllSteps(jobId: number, requestOptions?: any): IPromise; + getCurrentSteps(jobId: number, requestOptions?: any): IPromise; + getStep(params: WorkflowTaskGetStepParams, requestOptions?: any): IPromise; + getStepDescription(params: WorkflowTaskGetStepDescriptionParams, requestOptions?: any): IPromise; + getStepFileUrl(params: WorkflowTaskGetStepFileUrlParams): string; + getWorkflowDisplayDetails(jobId: number, requestOptions?: any): IPromise; + getWorkflowImageUrl(jobId: number): string; + markStepsAsDone(params: WorkflowTaskMarkStepsAsDoneParams, requestOptions?: any): IPromise; + moveToNextStep(params: WorkflowTaskMoveToNextStepParams, requestOptions?: any): IPromise; + recreateWorkflow(params: WorkflowTaskRecreateWorkflowParams, requestOptions?: any): IPromise; + resolveConflict(params: WorkflowTaskResolveConflictParams, requestOptions?: any): IPromise; + setCurrentStep(params: WorkflowTaskSetCurrentStepParams, requestOptions?: any): IPromise; + } + + interface WorkflowTaskConstructor { + new(properties?: WorkflowTaskProperties): WorkflowTask; + } + + export const WorkflowTask: WorkflowTaskConstructor; + + interface WorkflowTaskProperties extends TaskProperties { + url?: string; + } + interface MapView extends View { center: Point; constraints: MapViewConstraints; @@ -5053,6 +6168,7 @@ declare namespace __esri { zoom: number; goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | any, options?: MapViewGoToOptions): IPromise; + hasEventListener(type: string): boolean; hitTest(screenPoint: MapViewHitTestScreenPoint): IPromise; on(type: string | string[], modifiersOrHandler: string[] | Function, handler?: Function): any; toMap(screenPoint: ScreenPoint, mapPoint?: Point): Point; @@ -5090,6 +6206,7 @@ declare namespace __esri { zoom: number; goTo(target: number[] | Geometry | Geometry[] | Graphic | Graphic[] | Viewpoint | Camera | any, options?: SceneViewGoToOptions): IPromise; + hasEventListener(type: string): boolean; hitTest(screenPoint: SceneViewHitTestScreenPoint): IPromise; on(type: string | string[], modifiersOrHandler: string[] | Function, handler?: Function): any; toMap(screenPoint: ScreenPoint, mapPoint?: Point): Point; @@ -5116,7 +6233,7 @@ declare namespace __esri { zoom?: number; } - interface View extends Accessor, corePromise, Evented, BreakpointsOwner, DOMContainer { + interface View extends Accessor, corePromise, BreakpointsOwner, DOMContainer { allLayerViews: Collection; animation: ViewAnimation; graphics: Collection; @@ -5238,16 +6355,33 @@ declare namespace __esri { pixelData?: ImageryLayerViewPixelData; } + interface SceneLayerView extends LayerView { + queryExtent(params?: Query): IPromise; + queryFeatureCount(params?: Query): IPromise; + queryFeatures(params?: Query): IPromise; + queryObjectIds(params?: Query): IPromise; + } + + interface SceneLayerViewConstructor { + new(properties?: SceneLayerViewProperties): SceneLayerView; + } + + export const SceneLayerView: SceneLayerViewConstructor; + + interface SceneLayerViewProperties extends LayerViewProperties { + + } + interface UI extends Accessor { container: any; height: number; padding: any; - view: SceneView | MapView; + view: MapView | SceneView; width: number; - add(component: any | any[], position?: string | any): void; + add(component: Widget | any | string | any | any, position?: string | any): void; empty(position?: string): void; - move(component: any | any[], position?: string): void; + move(component: Widget | any | string | any | any, position?: string): void; remove(component: any | any[]): void; } @@ -5261,7 +6395,7 @@ declare namespace __esri { container?: any; height?: number; padding?: any | number; - view?: SceneView | MapView; + view?: MapView | SceneView; width?: number; } @@ -5406,9 +6540,11 @@ declare namespace __esri { visibleLayers?: SlideVisibleLayers; } - interface Attribution extends Accessor { - view: SceneView | MapView; + interface Attribution extends Widget { + view: MapView | SceneView; viewModel: AttributionViewModel; + + render(): any; } interface AttributionConstructor { @@ -5417,18 +6553,41 @@ declare namespace __esri { export const Attribution: AttributionConstructor; - interface AttributionProperties { - view?: SceneView | MapView; + interface AttributionProperties extends WidgetProperties { + view?: MapView | SceneView; viewModel?: AttributionViewModel; } - interface BasemapToggle extends Accessor, Evented { + interface BasemapGallery extends Widget { + activeBasemap: Basemap; + source: LocalBasemapsSource | PortalBasemapsSource; + view: MapView | SceneView; + viewModel: BasemapGalleryViewModel; + + render(): any; + } + + interface BasemapGalleryConstructor { + new(properties?: BasemapGalleryProperties): BasemapGallery; + } + + export const BasemapGallery: BasemapGalleryConstructor; + + interface BasemapGalleryProperties extends WidgetProperties { + activeBasemap?: BasemapProperties; + source?: LocalBasemapsSource | PortalBasemapsSource; + view?: MapView | SceneView; + viewModel?: BasemapGalleryViewModelProperties; + } + + interface BasemapToggle extends Widget { activeBasemap: Basemap; nextBasemap: Basemap; titleVisible: boolean; - view: SceneView | MapView; + view: MapView | SceneView; viewModel: BasemapToggleViewModel; + render(): any; toggle(): void; } @@ -5438,15 +6597,15 @@ declare namespace __esri { export const BasemapToggle: BasemapToggleConstructor; - interface BasemapToggleProperties { + interface BasemapToggleProperties extends WidgetProperties { activeBasemap?: BasemapProperties; nextBasemap?: Basemap | string; titleVisible?: boolean; - view?: SceneView | MapView; + view?: MapView | SceneView; viewModel?: BasemapToggleViewModelProperties; } - interface ColorSlider extends Accessor { + interface ColorSlider extends Accessor, Widgette { handlesVisible: boolean; histogram: any; histogramVisible: boolean; @@ -5469,7 +6628,7 @@ declare namespace __esri { export const ColorSlider: ColorSliderConstructor; - interface ColorSliderProperties { + interface ColorSliderProperties extends WidgetteProperties { handlesVisible?: boolean; histogram?: any; histogramVisible?: boolean; @@ -5486,10 +6645,11 @@ declare namespace __esri { visualVariable?: any; } - interface Compass extends Accessor { - view: SceneView | MapView; + interface Compass extends Widget { + view: MapView | SceneView; viewModel: CompassViewModel; + render(): any; reset(): void; } @@ -5499,17 +6659,51 @@ declare namespace __esri { export const Compass: CompassConstructor; - interface CompassProperties { - view?: SceneView | MapView; + interface CompassProperties extends WidgetProperties { + view?: MapView | SceneView; viewModel?: CompassViewModelProperties; } - interface Home extends Accessor, Evented { + interface Expand extends Widget { + collapseTooltip: string; + content: any; + expanded: boolean; + expandIconClass: string; + expandTooltip: string; + iconNumber: string; + view: MapView | SceneView; + viewModel: ExpandViewModel; + + collapse(): void; + expand(): void; + render(): any; + toggle(): void; + } + + interface ExpandConstructor { + new(properties?: ExpandProperties): Expand; + } + + export const Expand: ExpandConstructor; + + interface ExpandProperties extends WidgetProperties { + collapseTooltip?: string; + content?: any | any | string | Widget; + expanded?: boolean; + expandIconClass?: string; + expandTooltip?: string; + iconNumber?: string; + view?: MapView | SceneView; + viewModel?: ExpandViewModelProperties; + } + + interface Home extends Widget { view: MapView | SceneView; viewModel: HomeViewModel; viewpoint: Viewpoint; go(): void; + render(): any; } interface HomeConstructor { @@ -5518,7 +6712,7 @@ declare namespace __esri { export const Home: HomeConstructor; - interface HomeProperties { + interface HomeProperties extends WidgetProperties { view?: MapView | SceneView; viewModel?: HomeViewModelProperties; viewpoint?: ViewpointProperties; @@ -5526,10 +6720,12 @@ declare namespace __esri { interface LayerList extends Widget { createActionsFunction: Function; - view: SceneView | MapView; + operationalItems: Collection; + view: MapView | SceneView; viewModel: LayerListViewModel; render(): any; + triggerAction(action: Action, item: ListItem): void; } interface LayerListConstructor { @@ -5540,13 +6736,14 @@ declare namespace __esri { interface LayerListProperties extends WidgetProperties { createActionsFunction?: Function; - view?: SceneView | MapView; + operationalItems?: Collection; + view?: MapView | SceneView; viewModel?: LayerListViewModelProperties; } - interface Legend extends Accessor { + interface Legend extends Accessor, Widgette { layerInfos: LegendLayerInfos[]; - view: SceneView | MapView; + view: MapView | SceneView; } interface LegendConstructor { @@ -5555,12 +6752,12 @@ declare namespace __esri { export const Legend: LegendConstructor; - interface LegendProperties { + interface LegendProperties extends WidgetteProperties { layerInfos?: LegendLayerInfos[]; - view?: SceneView | MapView; + view?: MapView | SceneView; } - interface Locate extends Accessor, Evented { + interface Locate extends Widget { geolocationOptions: any; goToLocationEnabled: boolean; graphic: Graphic; @@ -5568,6 +6765,7 @@ declare namespace __esri { viewModel: LocateViewModel; locate(): IPromise; + render(): any; } interface LocateConstructor { @@ -5576,7 +6774,7 @@ declare namespace __esri { export const Locate: LocateConstructor; - interface LocateProperties { + interface LocateProperties extends WidgetProperties { geolocationOptions?: any; goToLocationEnabled?: boolean; graphic?: GraphicProperties; @@ -5584,11 +6782,12 @@ declare namespace __esri { viewModel?: LocateViewModelProperties; } - interface NavigationToggle extends Accessor { + interface NavigationToggle extends Widget { layout: string; view: SceneView; viewModel: NavigationToggleViewModel; + render(): any; toggle(): void; } @@ -5598,13 +6797,13 @@ declare namespace __esri { export const NavigationToggle: NavigationToggleConstructor; - interface NavigationToggleProperties { + interface NavigationToggleProperties extends WidgetProperties { layout?: string; view?: SceneViewProperties; viewModel?: NavigationToggleViewModelProperties; } - interface Popup extends Accessor, Evented { + interface Popup extends Accessor, Widgette, Evented { actions: Collection; content: string; currentDockPosition: string; @@ -5636,7 +6835,7 @@ declare namespace __esri { export const Popup: PopupConstructor; - interface PopupProperties { + interface PopupProperties extends WidgetteProperties { actions?: Collection; content?: string | any; currentDockPosition?: string; @@ -5674,12 +6873,34 @@ declare namespace __esri { viewModel?: PrintViewModelProperties; } - interface Search extends Accessor, Evented { + interface ScaleBar extends Widget { + style: string; + unit: string; + view: MapView; + viewModel: ScaleBarViewModel; + + render(): any; + } + + interface ScaleBarConstructor { + new(properties?: ScaleBarProperties): ScaleBar; + } + + export const ScaleBar: ScaleBarConstructor; + + interface ScaleBarProperties extends WidgetProperties { + style?: string; + unit?: string; + view?: MapViewProperties; + viewModel?: ScaleBarViewModelProperties; + } + + interface Search extends Widget { activeSource: FeatureLayer | Locator; activeSourceIndex: number; allPlaceholder: string; autoSelect: boolean; - defaultSource: any; + defaultSource: any | any; maxResults: number; maxSuggestions: number; minSuggestCharacters: number; @@ -5690,6 +6911,7 @@ declare namespace __esri { resultGraphicEnabled: boolean; results: any[]; searchAllEnabled: boolean; + searching: boolean; searchTerm: string; selectedResult: any; sources: SearchSources; @@ -5699,6 +6921,7 @@ declare namespace __esri { viewModel: SearchViewModel; clear(): void; + render(): any; search(searchTerm?: string | Geometry | any | number[][]): IPromise; suggest(value?: string): IPromise; } @@ -5709,12 +6932,12 @@ declare namespace __esri { export const Search: SearchConstructor; - interface SearchProperties { + interface SearchProperties extends WidgetProperties { activeSource?: FeatureLayer | Locator; activeSourceIndex?: number; allPlaceholder?: string; autoSelect?: boolean; - defaultSource?: any; + defaultSource?: any | any; maxResults?: number; maxSuggestions?: number; minSuggestCharacters?: number; @@ -5725,6 +6948,7 @@ declare namespace __esri { resultGraphicEnabled?: boolean; results?: any[]; searchAllEnabled?: boolean; + searching?: boolean; searchTerm?: string; selectedResult?: any; sources?: SearchSources; @@ -5734,7 +6958,7 @@ declare namespace __esri { viewModel?: SearchViewModelProperties; } - interface SizeSlider extends Accessor { + interface SizeSlider extends Accessor, Widgette { handlesVisible: boolean; histogram: any; histogramVisible: boolean; @@ -5757,7 +6981,7 @@ declare namespace __esri { export const SizeSlider: SizeSliderConstructor; - interface SizeSliderProperties { + interface SizeSliderProperties extends WidgetteProperties { handlesVisible?: boolean; histogram?: any; histogramVisible?: boolean; @@ -5774,7 +6998,7 @@ declare namespace __esri { visualVariable?: any; } - interface Track extends Accessor { + interface Track extends Widget { geolocationOptions: any; goToLocationEnabled: boolean; graphic: Graphic; @@ -5782,6 +7006,7 @@ declare namespace __esri { view: MapView | SceneView; viewModel: TrackViewModel; + render(): any; start(): void; stop(): void; } @@ -5792,7 +7017,7 @@ declare namespace __esri { export const Track: TrackConstructor; - interface TrackProperties { + interface TrackProperties extends WidgetProperties { geolocationOptions?: any; goToLocationEnabled?: boolean; graphic?: GraphicProperties; @@ -5801,7 +7026,7 @@ declare namespace __esri { viewModel?: TrackViewModelProperties; } - interface UnivariateColorSizeSlider extends Accessor { + interface UnivariateColorSizeSlider extends Accessor, Widgette { handlesVisible: boolean; histogram: any; histogramVisible: boolean; @@ -5824,7 +7049,7 @@ declare namespace __esri { export const UnivariateColorSizeSlider: UnivariateColorSizeSliderConstructor; - interface UnivariateColorSizeSliderProperties { + interface UnivariateColorSizeSliderProperties extends WidgetteProperties { handlesVisible?: boolean; histogram?: any; histogramVisible?: boolean; @@ -5847,7 +7072,9 @@ declare namespace __esri { id: string; destroy(): void; + own(handles: any[]): void; postInitialize(): void; + renderNow(): void; scheduleRender(): void; startup(): void; } @@ -5859,15 +7086,16 @@ declare namespace __esri { export const Widget: WidgetConstructor; interface WidgetProperties { - container?: string; + container?: string | any; destroyed?: boolean; id?: string; } - interface Zoom extends Accessor { - view: SceneView | MapView; + interface Zoom extends Widget { + view: MapView | SceneView; viewModel: ZoomViewModel; + render(): any; zoomIn(): void; zoomOut(): void; } @@ -5878,8 +7106,8 @@ declare namespace __esri { export const Zoom: ZoomConstructor; - interface ZoomProperties { - view?: SceneView | MapView; + interface ZoomProperties extends WidgetProperties { + view?: MapView | SceneView; viewModel?: ZoomViewModelProperties; } @@ -5887,7 +7115,7 @@ declare namespace __esri { attributionText: string; itemDelimiter: string; state: string; - view: SceneView | MapView; + view: MapView | SceneView; } interface AttributionViewModelConstructor { @@ -5896,11 +7124,35 @@ declare namespace __esri { export const AttributionViewModel: AttributionViewModelConstructor; + interface BasemapGalleryViewModel extends Accessor { + activeBasemap: Basemap; + items: Collection; + source: LocalBasemapsSource | PortalBasemapsSource; + state: string; + view: MapView | SceneView; + + basemapEquals(basemap1: Basemap, basemap2: Basemap): boolean; + } + + interface BasemapGalleryViewModelConstructor { + new(properties?: BasemapGalleryViewModelProperties): BasemapGalleryViewModel; + } + + export const BasemapGalleryViewModel: BasemapGalleryViewModelConstructor; + + interface BasemapGalleryViewModelProperties { + activeBasemap?: BasemapProperties; + items?: Collection; + source?: LocalBasemapsSource | PortalBasemapsSource; + state?: string; + view?: MapView | SceneView; + } + interface BasemapToggleViewModel extends Accessor, Evented { activeBasemap: Basemap; nextBasemap: Basemap; state: string; - view: SceneView | MapView; + view: MapView | SceneView; toggle(): void; } @@ -5915,12 +7167,13 @@ declare namespace __esri { activeBasemap?: BasemapProperties; nextBasemap?: Basemap | string; state?: string; - view?: SceneView | MapView; + view?: MapView | SceneView; } interface CompassViewModel extends Accessor { + orientation: any; state: string; - view: SceneView | MapView; + view: MapView | SceneView; reset(): void; } @@ -5932,8 +7185,27 @@ declare namespace __esri { export const CompassViewModel: CompassViewModelConstructor; interface CompassViewModelProperties { + orientation?: any; state?: string; - view?: SceneView | MapView; + view?: MapView | SceneView; + } + + interface ExpandViewModel extends Accessor { + expanded: boolean; + state: string; + view: MapView | SceneView; + } + + interface ExpandViewModelConstructor { + new(properties?: ExpandViewModelProperties): ExpandViewModel; + } + + export const ExpandViewModel: ExpandViewModelConstructor; + + interface ExpandViewModelProperties { + expanded?: boolean; + state?: string; + view?: MapView | SceneView; } interface HomeViewModel extends Accessor, Evented { @@ -5960,9 +7232,9 @@ declare namespace __esri { createActionsFunction: Function; operationalItems: Collection; state: string; - view: SceneView | MapView; + view: MapView | SceneView; - triggerAction(actionIndex: number): void; + triggerAction(action: Action, item: ListItem): void; } interface LayerListViewModelConstructor { @@ -5975,9 +7247,32 @@ declare namespace __esri { createActionsFunction?: Function; operationalItems?: Collection; state?: string; - view?: SceneView | MapView; + view?: MapView | SceneView; } + interface ListItem { + actionsOpen: boolean; + actionsSections: Collection; + children: Collection; + error: Error; + layer: Layer; + open: boolean; + title: string; + updating: boolean; + view: MapView | SceneView; + visibilityMode: string; + visible: boolean; + visibleAtCurrentScale: boolean; + + clone(): ListItem; + } + + interface ListItemConstructor { + new(): ListItem; + } + + export const ListItem: ListItemConstructor; + interface LocateViewModel extends Accessor, Evented, GeolocationPositioning { state: string; @@ -6075,6 +7370,20 @@ declare namespace __esri { view?: MapView | SceneView; } + interface ScaleBarViewModel extends Accessor { + view: MapView; + } + + interface ScaleBarViewModelConstructor { + new(properties?: ScaleBarViewModelProperties): ScaleBarViewModel; + } + + export const ScaleBarViewModel: ScaleBarViewModelConstructor; + + interface ScaleBarViewModelProperties { + view?: MapViewProperties; + } + interface SearchViewModel extends Accessor, Evented { activeSource: FeatureLayer | Locator; activeSourceIndex: number; @@ -6163,7 +7472,7 @@ declare namespace __esri { canZoomIn: boolean; canZoomOut: boolean; state: string; - view: SceneView | MapView; + view: MapView | SceneView; zoomIn(): void; zoomOut(): void; @@ -6179,7 +7488,7 @@ declare namespace __esri { canZoomIn?: boolean; canZoomOut?: boolean; state?: string; - view?: SceneView | MapView; + view?: MapView | SceneView; } interface JSONSupport { @@ -6301,6 +7610,8 @@ declare namespace __esri { dpi: number; gdbVersion: string; imageFormat: string; + imageMaxHeight: number; + imageMaxWidth: number; imageTransparency: boolean; sublayers: Collection; @@ -6320,6 +7631,8 @@ declare namespace __esri { dpi?: number; gdbVersion?: string; imageFormat?: string; + imageMaxHeight?: number; + imageMaxWidth?: number; imageTransparency?: boolean; sublayers?: Collection; } @@ -6547,6 +7860,24 @@ declare namespace __esri { width?: number; } + interface Widgette { + container: string | any; + visible: boolean; + + destroy(): void; + } + + interface WidgetteConstructor { + new(): Widgette; + } + + export const Widgette: WidgetteConstructor; + + interface WidgetteProperties { + container?: string | any; + visible?: boolean; + } + interface GeolocationPositioning { geolocationOptions: any; goToLocationEnabled: boolean; @@ -6569,8 +7900,10 @@ declare namespace __esri { interface config { geometryServiceUrl: string; + geoRSSServiceUrl: string; portalUrl: string; request: configRequest; + workers: configWorkers; } export const config: config; @@ -6596,13 +7929,19 @@ declare namespace __esri { export const lang: lang; interface promiseUtils { - eachAlways(promises: IPromise[]): IPromise[]; - reject(error?: any): IPromise; - resolve(value?: any): IPromise; + eachAlways(promises: IPromise[] | any): IPromise | any; + reject(error?: any): IPromise; + resolve(value?: T): IPromise; } export const promiseUtils: promiseUtils; + interface requireUtils { + when(moduleRequire: any, moduleNames: string[] | string): IPromise; + } + + export const requireUtils: requireUtils; + interface urlUtils { addProxyRule(rule: urlUtilsAddProxyRuleRule): number; getProxyRule(url: string): any; @@ -6636,7 +7975,7 @@ declare namespace __esri { interface decorators { aliasOf(propertyName: string): Function; cast(propertyName: string): Function; - cast(classFunction: Function): void; + cast(classFunction: Function): Function; declared(baseClass: T, ...mixinClasses: any[]): T; property(propertyMetadata?: decoratorsPropertyPropertyMetadata): Function; subclass(declaredClass?: string): Function; @@ -6739,6 +8078,12 @@ declare namespace __esri { export const jsonUtils: jsonUtils; + interface normalizeUtils { + normalizeCentralMeridian(geometries: Geometry[], geometryService?: GeometryService): IPromise; + } + + export const normalizeUtils: normalizeUtils; + interface webMercatorUtils { canProject(source: SpatialReference | any, target: SpatialReference | any): boolean; geographicToWebMercator(geometry: Geometry): Geometry; @@ -6765,7 +8110,7 @@ declare namespace __esri { interface size { createContinuousRenderer(params: sizeCreateContinuousRendererParams): IPromise; - createVisualVariable(params: sizeCreateVisualVariableParams): IPromise; + createVisualVariables(params: sizeCreateVisualVariablesParams): IPromise; } export const size: size; @@ -6787,13 +8132,17 @@ declare namespace __esri { histogram(params: histogramHistogramParams): IPromise; } - export const histogram: histogram; + const __histogramMapped: histogram; + export const histogram: typeof __histogramMapped.histogram; + interface summaryStatistics { summaryStatistics(params: summaryStatisticsSummaryStatisticsParams): IPromise; } - export const summaryStatistics: summaryStatistics; + const __summaryStatisticsMapped: summaryStatistics; + export const summaryStatistics: typeof __summaryStatisticsMapped.summaryStatistics; + interface symbologyColor { cloneScheme(scheme: any): any; @@ -6824,16 +8173,6 @@ declare namespace __esri { export const supportJsonUtils: supportJsonUtils; - interface Action { - className: string; - id: string; - image: string; - title: string; - visible: boolean; - } - - export const Action: Action; - interface symbolsSupportJsonUtils { fromJSON(json: any): Symbol; } @@ -6861,20 +8200,30 @@ declare namespace __esri { export const widget: widget; - interface ListItem { - actionsOpen: boolean; - actionsSections: Collection; - children: Collection; + interface BasemapGalleryItem { + basemap: Basemap; error: Error; - open: boolean; - title: string; - updating: boolean; - visibilityMode: string; - visible: boolean; - visibleAtCurrentScale: boolean; + state: string; + view: MapView | SceneView; } - export const ListItem: ListItem; + export const BasemapGalleryItem: BasemapGalleryItem; + + interface LocalBasemapsSource { + basemaps: Collection; + state: string; + } + + export const LocalBasemapsSource: LocalBasemapsSource; + + interface PortalBasemapsSource { + basemaps: Collection; + filterFunction: Function; + portal: Portal; + state: string; + } + + export const PortalBasemapsSource: PortalBasemapsSource; } declare module "esri" { @@ -6888,10 +8237,116 @@ declare module "esri" { export import WatchHandle = __esri.WatchHandle; + export import EachAlwaysResult = __esri.EachAlwaysResult; + export import PausableWatchHandle = __esri.PausableWatchHandle; + export import FeatureEditResult = __esri.FeatureEditResult; + export import AttributeParamValue = __esri.AttributeParamValue; + export import DataWorkspace = __esri.DataWorkspace; + + export import GroupMembership = __esri.GroupMembership; + + export import HoldType = __esri.HoldType; + + export import JobPriority = __esri.JobPriority; + + export import JobQuery = __esri.JobQuery; + + export import JobStatus = __esri.JobStatus; + + export import JobQueryContainer = __esri.JobQueryContainer; + + export import JobQueryDetails = __esri.JobQueryDetails; + + export import Privilege = __esri.Privilege; + + export import UserDetails = __esri.UserDetails; + + export import VersionInfo = __esri.VersionInfo; + + export import WorkflowManagerServiceInfo = __esri.WorkflowManagerServiceInfo; + + export import JobType = __esri.JobType; + + export import JobTypeDetails = __esri.JobTypeDetails; + + export import TableRelationship = __esri.TableRelationship; + + export import JobCreationParameters = __esri.JobCreationParameters; + + export import JobQueryParameters = __esri.JobQueryParameters; + + export import JobUpdateParameters = __esri.JobUpdateParameters; + + export import AuxRecordDescription = __esri.AuxRecordDescription; + + export import ActivityType = __esri.ActivityType; + + export import AuxRecordContainer = __esri.AuxRecordContainer; + + export import JobTaskJobInfo = __esri.JobTaskJobInfo; + + export import QueryResult = __esri.QueryResult; + + export import AuxRecord = __esri.AuxRecord; + + export import AuxRecordValue = __esri.AuxRecordValue; + + export import FieldValue = __esri.FieldValue; + + export import JobVersionInfo = __esri.JobVersionInfo; + + export import QueryFieldInfo = __esri.QueryFieldInfo; + + export import JobAttachment = __esri.JobAttachment; + + export import JobDependency = __esri.JobDependency; + + export import ChangeRule = __esri.ChangeRule; + + export import DataSetEvaluator = __esri.DataSetEvaluator; + + export import AOIEvaluator = __esri.AOIEvaluator; + + export import DatasetConfiguration = __esri.DatasetConfiguration; + + export import EmailNotifier = __esri.EmailNotifier; + + export import WhereCondition = __esri.WhereCondition; + + export import NotificationType = __esri.NotificationType; + + export import ChangeRuleMatch = __esri.ChangeRuleMatch; + + export import ReportDataGroup = __esri.ReportDataGroup; + + export import ReportData = __esri.ReportData; + + export import Report = __esri.Report; + + export import ExecuteInfo = __esri.ExecuteInfo; + + export import Step = __esri.Step; + + export import StepType = __esri.StepType; + + export import WorkflowDisplayDetails = __esri.WorkflowDisplayDetails; + + export import WorkflowOption = __esri.WorkflowOption; + + export import WorkflowStepInfo = __esri.WorkflowStepInfo; + + export import WorkflowAnnotationDisplayDetails = __esri.WorkflowAnnotationDisplayDetails; + + export import WorkflowConflicts = __esri.WorkflowConflicts; + + export import WorkflowPathDisplayDetails = __esri.WorkflowPathDisplayDetails; + + export import WorkflowStepDisplayDetails = __esri.WorkflowStepDisplayDetails; + export import ExternalRenderer = __esri.ExternalRenderer; export import RenderContext = __esri.RenderContext; @@ -6906,10 +8361,6 @@ declare module "esri" { export import FeatureLayerSource = __esri.FeatureLayerSource; - export import SearchViewModelLocatorSource = __esri.SearchViewModelLocatorSource; - - export import SearchViewModelFeatureLayerSource = __esri.SearchViewModelFeatureLayerSource; - export import GetHeader = __esri.GetHeader; export import WatchCallback = __esri.WatchCallback; @@ -6966,8 +8417,16 @@ declare module "esri" { export import CSVLayerElevationInfo = __esri.CSVLayerElevationInfo; + export import FeatureLayerApplyEditsEdits = __esri.FeatureLayerApplyEditsEdits; + + export import FeatureLayerCapabilities = __esri.FeatureLayerCapabilities; + + export import FeatureLayerCapabilitiesOperations = __esri.FeatureLayerCapabilitiesOperations; + export import FeatureLayerElevationInfo = __esri.FeatureLayerElevationInfo; + export import FeatureLayerGetFieldDomainOptions = __esri.FeatureLayerGetFieldDomainOptions; + export import GraphicsLayerElevationInfo = __esri.GraphicsLayerElevationInfo; export import LayerFromArcGISServerUrlParams = __esri.LayerFromArcGISServerUrlParams; @@ -6976,6 +8435,12 @@ declare module "esri" { export import SceneLayerElevationInfo = __esri.SceneLayerElevationInfo; + export import StreamLayerFilter = __esri.StreamLayerFilter; + + export import StreamLayerPurgeOptions = __esri.StreamLayerPurgeOptions; + + export import StreamLayerUpdateFilterFilterChanges = __esri.StreamLayerUpdateFilterFilterChanges; + export import VectorTileLayerCurrentStyleInfo = __esri.VectorTileLayerCurrentStyleInfo; export import CodedValueDomainCodedValues = __esri.CodedValueDomainCodedValues; @@ -7004,6 +8469,8 @@ declare module "esri" { export import UniqueValueRendererUniqueValueInfos = __esri.UniqueValueRendererUniqueValueInfos; + export import PointCloudRendererPointSizeAlgorithm = __esri.PointCloudRendererPointSizeAlgorithm; + export import PointCloudClassBreaksRendererColorClassBreakInfos = __esri.PointCloudClassBreaksRendererColorClassBreakInfos; export import PointCloudStretchRendererStops = __esri.PointCloudStretchRendererStops; @@ -7042,6 +8509,102 @@ declare module "esri" { export import QueryQuantizationParameters = __esri.QueryQuantizationParameters; + export import ConfigurationTaskGetDataWorkspaceDetailsParams = __esri.ConfigurationTaskGetDataWorkspaceDetailsParams; + + export import ConfigurationTaskGetUserJobQueryDetailsParams = __esri.ConfigurationTaskGetUserJobQueryDetailsParams; + + export import JobTaskAddEmbeddedAttachmentParams = __esri.JobTaskAddEmbeddedAttachmentParams; + + export import JobTaskAddLinkedAttachmentParams = __esri.JobTaskAddLinkedAttachmentParams; + + export import JobTaskAddLinkedRecordParams = __esri.JobTaskAddLinkedRecordParams; + + export import JobTaskAssignJobsParams = __esri.JobTaskAssignJobsParams; + + export import JobTaskCloseJobsParams = __esri.JobTaskCloseJobsParams; + + export import JobTaskCreateDependencyParams = __esri.JobTaskCreateDependencyParams; + + export import JobTaskCreateHoldParams = __esri.JobTaskCreateHoldParams; + + export import JobTaskCreateJobVersionParams = __esri.JobTaskCreateJobVersionParams; + + export import JobTaskDeleteAttachmentParams = __esri.JobTaskDeleteAttachmentParams; + + export import JobTaskDeleteDependencyParams = __esri.JobTaskDeleteDependencyParams; + + export import JobTaskDeleteJobsParams = __esri.JobTaskDeleteJobsParams; + + export import JobTaskDeleteLinkedRecordParams = __esri.JobTaskDeleteLinkedRecordParams; + + export import JobTaskGetAttachmentContentUrlParams = __esri.JobTaskGetAttachmentContentUrlParams; + + export import JobTaskListFieldValuesParams = __esri.JobTaskListFieldValuesParams; + + export import JobTaskListMultiLevelFieldValuesParams = __esri.JobTaskListMultiLevelFieldValuesParams; + + export import JobTaskLogActionParams = __esri.JobTaskLogActionParams; + + export import JobTaskQueryJobsParams = __esri.JobTaskQueryJobsParams; + + export import JobTaskQueryMultiLevelSelectedValuesParams = __esri.JobTaskQueryMultiLevelSelectedValuesParams; + + export import JobTaskReleaseHoldParams = __esri.JobTaskReleaseHoldParams; + + export import JobTaskReopenClosedJobsParams = __esri.JobTaskReopenClosedJobsParams; + + export import JobTaskSearchJobsParams = __esri.JobTaskSearchJobsParams; + + export import JobTaskUnassignJobsParams = __esri.JobTaskUnassignJobsParams; + + export import JobTaskUpdateNotesParams = __esri.JobTaskUpdateNotesParams; + + export import JobTaskUpdateRecordParams = __esri.JobTaskUpdateRecordParams; + + export import NotificationTaskAddChangeRuleParams = __esri.NotificationTaskAddChangeRuleParams; + + export import NotificationTaskDeleteChangeRuleParams = __esri.NotificationTaskDeleteChangeRuleParams; + + export import NotificationTaskNotifySessionParams = __esri.NotificationTaskNotifySessionParams; + + export import NotificationTaskQueryChangeRulesParams = __esri.NotificationTaskQueryChangeRulesParams; + + export import NotificationTaskRunSpatialNotificationOnHistoryParams = __esri.NotificationTaskRunSpatialNotificationOnHistoryParams; + + export import NotificationTaskSendNotificationParams = __esri.NotificationTaskSendNotificationParams; + + export import NotificationTaskSubscribeToNotificationParams = __esri.NotificationTaskSubscribeToNotificationParams; + + export import NotificationTaskUnsubscribeFromNotificationParams = __esri.NotificationTaskUnsubscribeFromNotificationParams; + + export import ReportTaskGenerateReportParams = __esri.ReportTaskGenerateReportParams; + + export import ReportTaskGetReportContentUrlParams = __esri.ReportTaskGetReportContentUrlParams; + + export import ReportTaskGetReportDataParams = __esri.ReportTaskGetReportDataParams; + + export import TokenTaskParseTokensParams = __esri.TokenTaskParseTokensParams; + + export import WorkflowTaskCanRunStepParams = __esri.WorkflowTaskCanRunStepParams; + + export import WorkflowTaskExecuteStepsParams = __esri.WorkflowTaskExecuteStepsParams; + + export import WorkflowTaskGetStepDescriptionParams = __esri.WorkflowTaskGetStepDescriptionParams; + + export import WorkflowTaskGetStepFileUrlParams = __esri.WorkflowTaskGetStepFileUrlParams; + + export import WorkflowTaskGetStepParams = __esri.WorkflowTaskGetStepParams; + + export import WorkflowTaskMarkStepsAsDoneParams = __esri.WorkflowTaskMarkStepsAsDoneParams; + + export import WorkflowTaskMoveToNextStepParams = __esri.WorkflowTaskMoveToNextStepParams; + + export import WorkflowTaskRecreateWorkflowParams = __esri.WorkflowTaskRecreateWorkflowParams; + + export import WorkflowTaskResolveConflictParams = __esri.WorkflowTaskResolveConflictParams; + + export import WorkflowTaskSetCurrentStepParams = __esri.WorkflowTaskSetCurrentStepParams; + export import MapViewConstraints = __esri.MapViewConstraints; export import MapViewGoToOptions = __esri.MapViewGoToOptions; @@ -7124,6 +8687,10 @@ declare module "esri" { export import configRequestProxyRules = __esri.configRequestProxyRules; + export import configWorkers = __esri.configWorkers; + + export import configWorkersLoaderConfig = __esri.configWorkersLoaderConfig; + export import requestEsriRequestOptions = __esri.requestEsriRequestOptions; export import urlUtilsAddProxyRuleRule = __esri.urlUtilsAddProxyRuleRule; @@ -7144,9 +8711,9 @@ declare module "esri" { export import sizeCreateContinuousRendererParamsLegendOptions = __esri.sizeCreateContinuousRendererParamsLegendOptions; - export import sizeCreateVisualVariableParams = __esri.sizeCreateVisualVariableParams; + export import sizeCreateVisualVariablesParams = __esri.sizeCreateVisualVariablesParams; - export import sizeCreateVisualVariableParamsLegendOptions = __esri.sizeCreateVisualVariableParamsLegendOptions; + export import sizeCreateVisualVariablesParamsLegendOptions = __esri.sizeCreateVisualVariablesParamsLegendOptions; export import univariateColorSizeCreateContinuousRendererParams = __esri.univariateColorSizeCreateContinuousRendererParams; @@ -7351,6 +8918,11 @@ declare module "esri/layers/FeatureLayer" { export = FeatureLayer; } +declare module "esri/layers/GeoRSSLayer" { + import GeoRSSLayer = __esri.GeoRSSLayer; + export = GeoRSSLayer; +} + declare module "esri/layers/GraphicsLayer" { import GraphicsLayer = __esri.GraphicsLayer; export = GraphicsLayer; @@ -7571,6 +9143,11 @@ declare module "esri/renderers/PointCloudUniqueValueRenderer" { export = PointCloudUniqueValueRenderer; } +declare module "esri/support/Action" { + import Action = __esri.Action; + export = Action; +} + declare module "esri/symbols/ExtrudeSymbol3DLayer" { import ExtrudeSymbol3DLayer = __esri.ExtrudeSymbol3DLayer; export = ExtrudeSymbol3DLayer; @@ -7961,6 +9538,36 @@ declare module "esri/tasks/support/TrimExtendParameters" { export = TrimExtendParameters; } +declare module "esri/tasks/workflow/ConfigurationTask" { + import ConfigurationTask = __esri.ConfigurationTask; + export = ConfigurationTask; +} + +declare module "esri/tasks/workflow/JobTask" { + import JobTask = __esri.JobTask; + export = JobTask; +} + +declare module "esri/tasks/workflow/NotificationTask" { + import NotificationTask = __esri.NotificationTask; + export = NotificationTask; +} + +declare module "esri/tasks/workflow/ReportTask" { + import ReportTask = __esri.ReportTask; + export = ReportTask; +} + +declare module "esri/tasks/workflow/TokenTask" { + import TokenTask = __esri.TokenTask; + export = TokenTask; +} + +declare module "esri/tasks/workflow/WorkflowTask" { + import WorkflowTask = __esri.WorkflowTask; + export = WorkflowTask; +} + declare module "esri/views/MapView" { import MapView = __esri.MapView; export = MapView; @@ -8001,6 +9608,11 @@ declare module "esri/views/layers/ImageryLayerView" { export = ImageryLayerView; } +declare module "esri/views/layers/SceneLayerView" { + import SceneLayerView = __esri.SceneLayerView; + export = SceneLayerView; +} + declare module "esri/views/ui/UI" { import UI = __esri.UI; export = UI; @@ -8046,6 +9658,11 @@ declare module "esri/widgets/Attribution" { export = Attribution; } +declare module "esri/widgets/BasemapGallery" { + import BasemapGallery = __esri.BasemapGallery; + export = BasemapGallery; +} + declare module "esri/widgets/BasemapToggle" { import BasemapToggle = __esri.BasemapToggle; export = BasemapToggle; @@ -8061,6 +9678,11 @@ declare module "esri/widgets/Compass" { export = Compass; } +declare module "esri/widgets/Expand" { + import Expand = __esri.Expand; + export = Expand; +} + declare module "esri/widgets/Home" { import Home = __esri.Home; export = Home; @@ -8096,6 +9718,11 @@ declare module "esri/widgets/Print" { export = Print; } +declare module "esri/widgets/ScaleBar" { + import ScaleBar = __esri.ScaleBar; + export = ScaleBar; +} + declare module "esri/widgets/Search" { import Search = __esri.Search; export = Search; @@ -8131,6 +9758,11 @@ declare module "esri/widgets/Attribution/AttributionViewModel" { export = AttributionViewModel; } +declare module "esri/widgets/BasemapGallery/BasemapGalleryViewModel" { + import BasemapGalleryViewModel = __esri.BasemapGalleryViewModel; + export = BasemapGalleryViewModel; +} + declare module "esri/widgets/BasemapToggle/BasemapToggleViewModel" { import BasemapToggleViewModel = __esri.BasemapToggleViewModel; export = BasemapToggleViewModel; @@ -8141,6 +9773,11 @@ declare module "esri/widgets/Compass/CompassViewModel" { export = CompassViewModel; } +declare module "esri/widgets/Expand/ExpandViewModel" { + import ExpandViewModel = __esri.ExpandViewModel; + export = ExpandViewModel; +} + declare module "esri/widgets/Home/HomeViewModel" { import HomeViewModel = __esri.HomeViewModel; export = HomeViewModel; @@ -8151,6 +9788,11 @@ declare module "esri/widgets/LayerList/LayerListViewModel" { export = LayerListViewModel; } +declare module "esri/widgets/LayerList/ListItem" { + import ListItem = __esri.ListItem; + export = ListItem; +} + declare module "esri/widgets/Locate/LocateViewModel" { import LocateViewModel = __esri.LocateViewModel; export = LocateViewModel; @@ -8171,6 +9813,11 @@ declare module "esri/widgets/Popup/PopupViewModel" { export = PopupViewModel; } +declare module "esri/widgets/ScaleBar/ScaleBarViewModel" { + import ScaleBarViewModel = __esri.ScaleBarViewModel; + export = ScaleBarViewModel; +} + declare module "esri/widgets/Search/SearchViewModel" { import SearchViewModel = __esri.SearchViewModel; export = SearchViewModel; @@ -8266,6 +9913,11 @@ declare module "esri/views/DOMContainer" { export = DOMContainer; } +declare module "esri/widgets/Widgette" { + import Widgette = __esri.Widgette; + export = Widgette; +} + declare module "esri/widgets/support/GeolocationPositioning" { import GeolocationPositioning = __esri.GeolocationPositioning; export = GeolocationPositioning; @@ -8296,6 +9948,11 @@ declare module "esri/core/promiseUtils" { export = promiseUtils; } +declare module "esri/core/requireUtils" { + import requireUtils = __esri.requireUtils; + export = requireUtils; +} + declare module "esri/core/urlUtils" { import urlUtils = __esri.urlUtils; export = urlUtils; @@ -8331,6 +9988,11 @@ declare module "esri/geometry/support/jsonUtils" { export = jsonUtils; } +declare module "esri/geometry/support/normalizeUtils" { + import normalizeUtils = __esri.normalizeUtils; + export = normalizeUtils; +} + declare module "esri/geometry/support/webMercatorUtils" { import webMercatorUtils = __esri.webMercatorUtils; export = webMercatorUtils; @@ -8391,11 +10053,6 @@ declare module "esri/renderers/support/jsonUtils" { export = supportJsonUtils; } -declare module "esri/support/Action" { - import Action = __esri.Action; - export = Action; -} - declare module "esri/symbols/support/jsonUtils" { import symbolsSupportJsonUtils = __esri.symbolsSupportJsonUtils; export = symbolsSupportJsonUtils; @@ -8411,7 +10068,17 @@ declare module "esri/widgets/support/widget" { export = widget; } -declare module "esri/widgets/LayerList/ListItem" { - import ListItem = __esri.ListItem; - export = ListItem; +declare module "esri/widgets/BasemapGallery/BasemapGalleryItem" { + import BasemapGalleryItem = __esri.BasemapGalleryItem; + export = BasemapGalleryItem; } + +declare module "esri/widgets/BasemapGallery/support/LocalBasemapsSource" { + import LocalBasemapsSource = __esri.LocalBasemapsSource; + export = LocalBasemapsSource; +} + +declare module "esri/widgets/BasemapGallery/support/PortalBasemapsSource" { + import PortalBasemapsSource = __esri.PortalBasemapsSource; + export = PortalBasemapsSource; +} \ No newline at end of file From d581cd13ab2425f27373d4e220932ce9b26bd315 Mon Sep 17 00:00:00 2001 From: Belinda Teh Date: Mon, 6 Mar 2017 16:43:00 -0800 Subject: [PATCH 315/797] Update qs definitions to include 'sort' in its stringify options --- qs/index.d.ts | 4 +++- qs/qs-tests.ts | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/qs/index.d.ts b/qs/index.d.ts index c23c02f871..400cc7a1e4 100644 --- a/qs/index.d.ts +++ b/qs/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for qs 6.2.0 // Project: https://github.com/hapijs/qs -// Definitions by: Roman Korneev , Leon Yu +// Definitions by: Roman Korneev , Leon Yu , +// Belinda Teh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export = QueryString; @@ -16,6 +17,7 @@ declare namespace QueryString { filter?: Array | ((prefix: string, value: any) => any); arrayFormat?: 'indices' | 'brackets' | 'repeat'; indices?: boolean; + sort?: (a: any, b: any) => number; } interface IParseOptions { diff --git a/qs/qs-tests.ts b/qs/qs-tests.ts index bcff0a0762..f3d361476e 100644 --- a/qs/qs-tests.ts +++ b/qs/qs-tests.ts @@ -249,3 +249,8 @@ qs.parse('a=b&c=d', { delimiter: '&' }); var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); assert.deepEqual(obj, { a: 'ã“ã‚“ã«ã¡ã¯ï¼' }); } + +() => { + var sorted = qs.stringify({ a: 1, c: 3, b: 2 }, { sort: (a, b) => a.localeCompare(b) }) + assert.equal(sorted, 'a=1&b=2&c=3') +} From 01e6251cd20e73a71f73207272be11d4bf2e9eff Mon Sep 17 00:00:00 2001 From: Belinda Teh Date: Mon, 6 Mar 2017 16:51:48 -0800 Subject: [PATCH 316/797] Update qs tests to 4 space indent --- qs/qs-tests.ts | 256 ++++++++++++++++++++++++------------------------- 1 file changed, 128 insertions(+), 128 deletions(-) diff --git a/qs/qs-tests.ts b/qs/qs-tests.ts index f3d361476e..10a911c2dc 100644 --- a/qs/qs-tests.ts +++ b/qs/qs-tests.ts @@ -8,82 +8,82 @@ qs.parse('a=b'); qs.parse('a=b&c=d', { delimiter: '&' }); () => { - var obj = qs.parse('a=c'); - assert.deepEqual(obj, { a: 'c' }); + var obj = qs.parse('a=c'); + assert.deepEqual(obj, { a: 'c' }); - var str = qs.stringify(obj); - assert.equal(str, 'a=c'); + var str = qs.stringify(obj); + assert.equal(str, 'a=c'); } () => { - var plainObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true }); - assert.deepEqual(plainObject, { a: { hasOwnProperty: 'b' } }); + var plainObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true }); + assert.deepEqual(plainObject, { a: { hasOwnProperty: 'b' } }); } () => { - var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); - assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } }); + var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }); + assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } }); } () => { - assert.deepEqual(qs.parse('a%5Bb%5D=c'), { - a: { b: 'c' } - }); + assert.deepEqual(qs.parse('a%5Bb%5D=c'), { + a: { b: 'c' } + }); } () => { - assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), { - foo: { - bar: { - baz: 'foobarbaz' - } - } - }); -} - -() => { - var expected = { - a: { - b: { - c: { - d: { - e: { - f: { - '[g][h][i]': 'j' - } + assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), { + foo: { + bar: { + baz: 'foobarbaz' } - } } - } - } - }; - var string = 'a[b][c][d][e][f][g][h][i]=j'; - assert.deepEqual(qs.parse(string), expected); + }); } () => { - var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); - assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }); + var expected = { + a: { + b: { + c: { + d: { + e: { + f: { + '[g][h][i]': 'j' + } + } + } + } + } + } + }; + var string = 'a[b][c][d][e][f][g][h][i]=j'; + assert.deepEqual(qs.parse(string), expected); } () => { - var limited = qs.parse('a=b&c=d', { parameterLimit: 1 }); - assert.deepEqual(limited, { a: 'b' }); + var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 }); + assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }); } () => { - var delimited = qs.parse('a=b;c=d', { delimiter: ';' }); - assert.deepEqual(delimited, { a: 'b', c: 'd' }); + var limited = qs.parse('a=b&c=d', { parameterLimit: 1 }); + assert.deepEqual(limited, { a: 'b' }); } () => { - var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); - assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' }); + var delimited = qs.parse('a=b;c=d', { delimiter: ';' }); + assert.deepEqual(delimited, { a: 'b', c: 'd' }); } () => { - var withDots = qs.parse('a.b=c', { allowDots: true }); - assert.deepEqual(withDots, { a: { b: 'c' } }); + var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ }); + assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' }); +} + +() => { + var withDots = qs.parse('a.b=c', { allowDots: true }); + assert.deepEqual(withDots, { a: { b: 'c' } }); } () => { @@ -92,165 +92,165 @@ qs.parse('a=b&c=d', { delimiter: '&' }); } () => { - var withIndexes = qs.parse('a[1]=c&a[0]=b'); - assert.deepEqual(withIndexes, { a: ['b', 'c'] }); + var withIndexes = qs.parse('a[1]=c&a[0]=b'); + assert.deepEqual(withIndexes, { a: ['b', 'c'] }); } () => { - var noSparse = qs.parse('a[1]=b&a[15]=c'); - assert.deepEqual(noSparse, { a: ['b', 'c'] }); + var noSparse = qs.parse('a[1]=b&a[15]=c'); + assert.deepEqual(noSparse, { a: ['b', 'c'] }); } () => { - var withEmptyString = qs.parse('a[]=&a[]=b'); - assert.deepEqual(withEmptyString, { a: ['', 'b'] }); + var withEmptyString = qs.parse('a[]=&a[]=b'); + assert.deepEqual(withEmptyString, { a: ['', 'b'] }); - var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c'); - assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); + var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c'); + assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] }); } () => { - var withMaxIndex = qs.parse('a[100]=b'); - assert.deepEqual(withMaxIndex, { a: { '100': 'b' } }); + var withMaxIndex = qs.parse('a[100]=b'); + assert.deepEqual(withMaxIndex, { a: { '100': 'b' } }); } () => { - var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 }); - assert.deepEqual(withArrayLimit, { a: { '1': 'b' } }); + var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 }); + assert.deepEqual(withArrayLimit, { a: { '1': 'b' } }); } () => { - var noParsingArrays = qs.parse('a[]=b', { parseArrays: false }); - assert.deepEqual(noParsingArrays, { a: { '0': 'b' } }); + var noParsingArrays = qs.parse('a[]=b', { parseArrays: false }); + assert.deepEqual(noParsingArrays, { a: { '0': 'b' } }); } () => { - var mixedNotation = qs.parse('a[0]=b&a[b]=c'); - assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } }); + var mixedNotation = qs.parse('a[0]=b&a[b]=c'); + assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } }); } () => { - var arraysOfObjects = qs.parse('a[][b]=c'); - assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); + var arraysOfObjects = qs.parse('a[][b]=c'); + assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] }); } () => { - assert.equal(qs.stringify({ a: 'b' }), 'a=b'); - assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); + assert.equal(qs.stringify({ a: 'b' }), 'a=b'); + assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c'); } () => { - var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); - assert.equal(unencoded, 'a[b]=c'); + var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); + assert.equal(unencoded, 'a[b]=c'); } () => { - var encoded = qs.stringify({ a: { b: 'c' } }, { - encoder: function (str) { - // Passed in values `a`, `b`, `c` - return // Return encoded string - } - }) + var encoded = qs.stringify({ a: { b: 'c' } }, { + encoder: function (str) { + // Passed in values `a`, `b`, `c` + return // Return encoded string + } + }) } () => { - var decoded = qs.parse('x=z', { - decoder: function (str) { - // Passed in values `x`, `z` - return // Return decoded string - } - }) + var decoded = qs.parse('x=z', { + decoder: function (str) { + // Passed in values `x`, `z` + return // Return decoded string + } + }) } () => { - qs.stringify({ a: ['b', 'c', 'd'] }); - // 'a[0]=b&a[1]=c&a[2]=d' + qs.stringify({ a: ['b', 'c', 'd'] }); + // 'a[0]=b&a[1]=c&a[2]=d' } () => { - qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); - // 'a=b&a=c&a=d' + qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }); + // 'a=b&a=c&a=d' } () => { - qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) - // 'a[0]=b&a[1]=c' - qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) - // 'a[]=b&a[]=c' - qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) - // 'a=b&a=c' + qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }) + // 'a[0]=b&a[1]=c' + qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }) + // 'a[]=b&a[]=c' + qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }) + // 'a=b&a=c' } () => { - assert.equal(qs.stringify({ a: '' }), 'a='); + assert.equal(qs.stringify({ a: '' }), 'a='); } () => { - assert.equal(qs.stringify({ a: null, b: undefined }), 'a='); + assert.equal(qs.stringify({ a: null, b: undefined }), 'a='); } () => { - assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); + assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d'); } () => { - qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: function (prefix, value) { - if (prefix == 'b') { - // Return an `undefined` value to omit a property. - return; - } - if (prefix == 'e[f]') { - return value.getTime(); - } - if (prefix == 'e[g][0]') { - return value * 2; - } - return value; - } }); - // 'a=b&c=d&e[f]=123&e[g][0]=4' - qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }); - // 'a=b&e=f' - qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); + qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: function (prefix, value) { + if (prefix == 'b') { + // Return an `undefined` value to omit a property. + return; + } + if (prefix == 'e[f]') { + return value.getTime(); + } + if (prefix == 'e[g][0]') { + return value * 2; + } + return value; + } }); + // 'a=b&c=d&e[f]=123&e[g][0]=4' + qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] }); + // 'a=b&e=f' + qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] }); } () => { - var withNull = qs.stringify({ a: null, b: '' }); - assert.equal(withNull, 'a=&b='); + var withNull = qs.stringify({ a: null, b: '' }); + assert.equal(withNull, 'a=&b='); } () => { - var equalsInsensitive = qs.parse('a&b='); - assert.deepEqual(equalsInsensitive, { a: '', b: '' }); + var equalsInsensitive = qs.parse('a&b='); + assert.deepEqual(equalsInsensitive, { a: '', b: '' }); } () => { - var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); - assert.equal(strictNull, 'a&b='); + var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true }); + assert.equal(strictNull, 'a&b='); } () => { - var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true }); - assert.deepEqual(parsedStrictNull, { a: null, b: '' }); + var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true }); + assert.deepEqual(parsedStrictNull, { a: null, b: '' }); } () => { - var nullsSkipped = qs.stringify({ a: 'b', c: null }, { skipNulls: true }); - assert.equal(nullsSkipped, 'a=b'); + var nullsSkipped = qs.stringify({ a: 'b', c: null }, { skipNulls: true }); + assert.equal(nullsSkipped, 'a=b'); } () => { - var encoder = () => {}; - var shiftJISEncoded = qs.stringify({ a: 'ã“ã‚“ã«ã¡ã¯ï¼' }, { encoder: encoder }); - assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I'); + var encoder = () => {}; + var shiftJISEncoded = qs.stringify({ a: 'ã“ã‚“ã«ã¡ã¯ï¼' }, { encoder: encoder }); + assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I'); } () => { - var decoder = () => {}; - var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); - assert.deepEqual(obj, { a: 'ã“ã‚“ã«ã¡ã¯ï¼' }); + var decoder = () => {}; + var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); + assert.deepEqual(obj, { a: 'ã“ã‚“ã«ã¡ã¯ï¼' }); } () => { - var sorted = qs.stringify({ a: 1, c: 3, b: 2 }, { sort: (a, b) => a.localeCompare(b) }) - assert.equal(sorted, 'a=1&b=2&c=3') + var sorted = qs.stringify({ a: 1, c: 3, b: 2 }, { sort: (a, b) => a.localeCompare(b) }) + assert.equal(sorted, 'a=1&b=2&c=3') } From c87f276f9a6ec3e1c8061ddec297e2d6da21cc61 Mon Sep 17 00:00:00 2001 From: Belinda Teh Date: Mon, 6 Mar 2017 16:52:57 -0800 Subject: [PATCH 317/797] Update qs tests to 4 space indent --- qs/qs-tests.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qs/qs-tests.ts b/qs/qs-tests.ts index 10a911c2dc..f3e5ca3230 100644 --- a/qs/qs-tests.ts +++ b/qs/qs-tests.ts @@ -147,8 +147,8 @@ qs.parse('a=b&c=d', { delimiter: '&' }); () => { var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) { - // Passed in values `a`, `b`, `c` - return // Return encoded string + // Passed in values `a`, `b`, `c` + return // Return encoded string } }) } @@ -156,8 +156,8 @@ qs.parse('a=b&c=d', { delimiter: '&' }); () => { var decoded = qs.parse('x=z', { decoder: function (str) { - // Passed in values `x`, `z` - return // Return decoded string + // Passed in values `x`, `z` + return // Return decoded string } }) } From 796b98ffef8e9b13b7a40aaee2ab4c6ea04cc7e4 Mon Sep 17 00:00:00 2001 From: Chad Killingsworth Date: Mon, 6 Mar 2017 15:28:27 -0600 Subject: [PATCH 318/797] 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 f3b78d096de05c25a6084a44d54321ffd48b8bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Tue, 7 Mar 2017 08:17:48 +0100 Subject: [PATCH 319/797] update typings --- body-parser/body-parser-tests.ts | 12 ++++++------ body-parser/index.d.ts | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/body-parser/body-parser-tests.ts b/body-parser/body-parser-tests.ts index ffac86e592..fa18cad13b 100644 --- a/body-parser/body-parser-tests.ts +++ b/body-parser/body-parser-tests.ts @@ -8,15 +8,15 @@ import { const app = express(); -express.use(json()); -express.use(raw()); -express.use(text()); -express.use(urlencoded()); +app.use(json()); +app.use(raw()); +app.use(text()); +app.use(urlencoded()); // send any data, it should be parsed and printed -express.all('/', (req, res, next) => { +app.all('/', (req, res, next) => { console.log(req.body); res.json(req.body); }); -express.listen(8080); +app.listen(8080); diff --git a/body-parser/index.d.ts b/body-parser/index.d.ts index 3a1ebaaba8..a11205f6f3 100644 --- a/body-parser/index.d.ts +++ b/body-parser/index.d.ts @@ -41,7 +41,7 @@ declare namespace bodyParser { export function text(options?: OptionsText): RequestHandler; - export function urlencoded(options: OptionsUrlencoded): RequestHandler; + export function urlencoded(options?: OptionsUrlencoded): RequestHandler; } export = bodyParser; From 02e581761193557c093fa7de9b76c4afb45bbb95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Tue, 7 Mar 2017 08:27:13 +0100 Subject: [PATCH 320/797] newline --- body-parser/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/body-parser/index.d.ts b/body-parser/index.d.ts index 5fd2096c27..c1d2949293 100644 --- a/body-parser/index.d.ts +++ b/body-parser/index.d.ts @@ -45,4 +45,4 @@ declare namespace bodyParser { } -export = bodyParser; \ No newline at end of file +export = bodyParser; From a8c42d9ef87d1432ff230cc4c58077fb0512627f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Tue, 7 Mar 2017 08:29:47 +0100 Subject: [PATCH 321/797] added Grevik Babakhani --- body-parser/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/body-parser/index.d.ts b/body-parser/index.d.ts index c1d2949293..c0ce775bb0 100644 --- a/body-parser/index.d.ts +++ b/body-parser/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for body-parser 1.16 // Project: https://github.com/expressjs/body-parser -// Definitions by: Santi Albo , Vilic Vane , Jonathan Häberle , Tomasz Åaziuk +// Definitions by: Santi Albo , Vilic Vane , Jonathan Häberle , Gevik Babakhani , Tomasz Åaziuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 543f1d5ab83c0bfb28e280224362e3cd1774bb97 Mon Sep 17 00:00:00 2001 From: David Hahn Date: Tue, 7 Mar 2017 09:24:13 +0100 Subject: [PATCH 322/797] Added typings for prosemirror-model 0.18.0 --- prosemirror-model/index.d.ts | 266 +++++++++++++++++++ prosemirror-model/prosemirror-model-tests.ts | 3 + prosemirror-model/tsconfig.json | 23 ++ 3 files changed, 292 insertions(+) create mode 100644 prosemirror-model/index.d.ts create mode 100644 prosemirror-model/prosemirror-model-tests.ts create mode 100644 prosemirror-model/tsconfig.json diff --git a/prosemirror-model/index.d.ts b/prosemirror-model/index.d.ts new file mode 100644 index 0000000000..a82525b89a --- /dev/null +++ b/prosemirror-model/index.d.ts @@ -0,0 +1,266 @@ +// Type definitions for prosemirror-model 0.18.0 +// Project: https://github.com/ProseMirror/prosemirror-model +// Definitions by: David Hahn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type OrderedMap = T; + +declare module "prosemirror-model" { + export class ContentMatch { + matchNode(node: ProsemirrorNode): ContentMatch + matchType(type: NodeType, attrs?: Object, marks?: Mark[]): ContentMatch + matchFragment(fragment: Fragment, from?: number, to?: number): ContentMatch | boolean + matchToEnd(fragment: Fragment, start?: number, end?: number): boolean + validEnd(): boolean + fillBefore(after: Fragment, toEnd: boolean, startIndex?: number): Fragment + allowsMark(markType: MarkType): boolean + findWrapping(target: NodeType, targetAttrs?: Object, targetMarks?: Mark[]): { type: NodeType, attrs: Object }[] + findWrappingFor(node: ProsemirrorNode): { type: NodeType, attrs: Object }[] + + } + export class Fragment { + append(other: Fragment): Fragment + cut(from: number, to?: number): Fragment + replaceChild(index: number, node: ProsemirrorNode): Fragment + eq(other: Fragment): boolean + firstChild?: ProsemirrorNode; + lastChild?: ProsemirrorNode; + childCount: number; + child(index: number): ProsemirrorNode + offsetAt(index: number): number + maybeChild(index: number): ProsemirrorNode + forEach(f: (node: ProsemirrorNode, offset: number, index: number) => void): void + findDiffStart(other: Fragment): number + findDiffEnd(other: ProsemirrorNode): { a: number, b: number } | void + toString(): string + toJSON(): Object | void + static fromJSON(schema: Schema, value?: Object): Fragment + static fromArray(array: ProsemirrorNode[]): Fragment + static from(nodes?: Fragment | ProsemirrorNode | ProsemirrorNode[]): Fragment + static empty: Fragment; + + } + export interface ParseRule { + tag?: string; + style?: string; + context?: string; + node?: string; + mark?: string; + priority?: number; + ignore?: boolean; + skip?: boolean; + attrs?: Object; + getAttrs?(p: Node | string): boolean | Object + contentElement?: string; + getContent?(p: Node): Fragment + preserveWhitespace?: boolean; + + } + export class DOMParser { + constructor(schema: Schema, rules: ParseRule[]) + schema: Schema; + rules: ParseRule[]; + parse(dom: Node, options?: { preserveWhitespace?: boolean, findPositions?: { node: Node, offset: number }[], from?: number, to?: number, topNode?: ProsemirrorNode, topStart?: number, context?: ResolvedPos }): ProsemirrorNode + parseSlice(dom: Node, options?: Object): Slice + static schemaRules(schema: Schema): ParseRule[] + static fromSchema(schema: Schema): DOMParser + + } + export class Mark { + type: MarkType; + attrs: Object; + addToSet(set: Mark[]): Mark[] + removeFromSet(set: Mark[]): Mark[] + isInSet(set: Mark[]): boolean + eq(other: Mark): boolean + toJSON(): Object + static fromJSON(schema: Schema, json: Object): Mark + static sameSet(a: Mark[], b: Mark[]): boolean + static setFrom(marks?: Mark | Mark[]): Mark[] + static none: Mark[]; + + } + export class ProsemirrorNode { + type: NodeType; + attrs: Object; + content: Fragment; + marks: Mark[]; + text?: string; + nodeSize: number; + childCount: number; + child(index: number): ProsemirrorNode + maybeChild(index: number): ProsemirrorNode + forEach(f: (node: ProsemirrorNode, offset: number, index: number) => void): void + nodesBetween(from: number |  void, to: number |  void, f: (node: ProsemirrorNode, pos: number, parent: ProsemirrorNode, index: number) => void): void + descendants(f: (node: ProsemirrorNode, pos: number, parent: ProsemirrorNode) => void): void + textContent: string; + textBetween(from: number, to: number, blockSeparator?: string, leafText?: string): string + firstChild?: ProsemirrorNode; + lastChild?: ProsemirrorNode; + eq(other: ProsemirrorNode): boolean + sameMarkup(other: ProsemirrorNode): boolean + hasMarkup(type: NodeType, attrs?: Object, marks?: Mark[]): boolean + copy(content?: Fragment): ProsemirrorNode + mark(marks: Mark[]): ProsemirrorNode + cut(from: number, to?: number): ProsemirrorNode + slice(from: number, to?: number): Slice + replace(from: number, to: number, slice: Slice): ProsemirrorNode + nodeAt(pos: number): ProsemirrorNode + childAfter(pos: number): { node?: ProsemirrorNode, index: number, offset: number } + childBefore(pos: number): { node?: ProsemirrorNode, index: number, offset: number } + resolve(pos: number): ResolvedPos + rangeHasMark(from: number |  void, to: number |  void, type: MarkType): boolean + isBlock: boolean; + isTextblock: boolean; + isInline: boolean; + isText: boolean; + isLeaf: boolean; + isAtom: boolean; + toString(): string + contentMatchAt(index: number): ContentMatch + canReplace(from: number, to: number, replacement?: Fragment, start?: number, end?: number): boolean + canReplaceWith(from: number, to: number, type: NodeType, attrs?: Mark[]): boolean + canAppend(other: ProsemirrorNode): boolean + check(): void + toJSON(): Object + static fromJSON(schema: Schema, json: Object): ProsemirrorNode + + } + export class ReplaceError extends Error { + + } + export class Slice { + constructor(content: Fragment, openLeft: number, openRight: number) + content: Fragment; + openLeft: number; + openRight: number; + size: number; + toJSON(): Object | void + static fromJSON(schema: Schema, json?: Object): Slice + static maxOpen(fragment: Fragment): Slice + static empty: Slice; + + } + export class ResolvedPos { + pos: number; + depth: number; + parentOffset: number; + parent: ProsemirrorNode; + node(depth?: number): ProsemirrorNode + index(depth?: number): number + indexAfter(depth?: number): number + start(depth?: number): number + end(depth?: number): number + before(depth?: number): number + after(depth?: number): number + textOffset: number; + nodeAfter?: ProsemirrorNode; + nodeBefore?: ProsemirrorNode; + marks(after?: boolean): Mark[] + sharedDepth(pos: number): number + blockRange(other?: ResolvedPos, pred?: (p: ProsemirrorNode) => boolean): NodeRange + sameParent(other: ResolvedPos): boolean + + } + export class NodeRange { + $from: ResolvedPos; + $to: ResolvedPos; + depth: number; + start: number; + end: number; + parent: ProsemirrorNode; + startIndex: number; + endIndex: number; + + } + export class NodeType { + name: string; + schema: Schema; + spec: NodeSpec; + isBlock: boolean; + isText: boolean; + isInline: boolean; + isTextblock: boolean; + isLeaf: boolean; + isAtom: boolean; + create(attrs?: Object, content?: Fragment | ProsemirrorNode | ProsemirrorNode[], marks?: Mark[]): ProsemirrorNode + createChecked(attrs?: Object, content?: Fragment | ProsemirrorNode | ProsemirrorNode[], marks?: Mark[]): ProsemirrorNode + createAndFill(attrs?: Object, content?: Fragment | ProsemirrorNode | ProsemirrorNode[], marks?: Mark[]): ProsemirrorNode + validContent(content: Fragment, attrs?: Object): boolean + + } + export class MarkType { + name: string; + schema: Schema; + spec: MarkSpec; + create(attrs?: Object): Mark + removeFromSet(set: Mark[]): Mark[] + isInSet(set: Mark[]): Mark + excludes: MarkType; + + } + export interface SchemaSpec { + nodes: Object | OrderedMap; + marks?: Object | OrderedMap; + topNode?: string; + + } + export interface NodeSpec { + content?: string; + group?: string; + inline?: boolean; + atom?: boolean; + attrs?: Object; + selectable?: boolean; + draggable?: boolean; + code?: boolean; + defining?: boolean; + toDOM?(p: ProsemirrorNode): DOMOutputSpec + parseDOM?: ParseRule[]; + + } + export interface MarkSpec { + attrs?: Object; + inclusiveRight?: boolean; + excludes?: string; + group?: string; + toDOM?(mark: Mark): DOMOutputSpec + parseDOM?: ParseRule[]; + + } + export interface AttributeSpec { + default?: any; + compute?(): any + + } + export class Schema { + constructor(spec: SchemaSpec) + spec: SchemaSpec; + nodes: Object; + marks: Object; + cached: Object; + topNodeType: NodeType; + node(type: string | NodeType, attrs?: Object, content?: Fragment | ProsemirrorNode | ProsemirrorNode[], marks?: Mark[]): ProsemirrorNode + text(text: string, marks?: Mark[]): ProsemirrorNode + mark(type: string | MarkType, attrs?: Object): Mark + nodeFromJSON(json: Object): ProsemirrorNode + markFromJSON(json: Object): Mark + + } + export interface DOMOutputSpec { + + } + export class DOMSerializer { + constructor(nodes: Object, marks: Object) + nodes: Object; + marks: Object; + serializeFragment(fragment: Fragment, options?: Object): DocumentFragment + serializeNode(node: ProsemirrorNode, options?: Object): Node + static renderSpec(doc: Document, structure: DOMOutputSpec): { dom: Node, contentDOM?: Node } + static fromSchema(schema: Schema): DOMSerializer + static nodesFromSchema(schema: Schema): Object + static marksFromSchema(schema: Schema): Object + + } + +} \ No newline at end of file diff --git a/prosemirror-model/prosemirror-model-tests.ts b/prosemirror-model/prosemirror-model-tests.ts new file mode 100644 index 0000000000..1850a259e9 --- /dev/null +++ b/prosemirror-model/prosemirror-model-tests.ts @@ -0,0 +1,3 @@ +import * as model from 'prosemirror-model'; + +let fragment = new model.Fragment(); diff --git a/prosemirror-model/tsconfig.json b/prosemirror-model/tsconfig.json new file mode 100644 index 0000000000..ecd6628430 --- /dev/null +++ b/prosemirror-model/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "prosemirror-model-tests.ts" + ] +} \ No newline at end of file From a95cb5efd3164a60199855585bdcea5ba6f42178 Mon Sep 17 00:00:00 2001 From: David Hahn Date: Tue, 7 Mar 2017 09:46:45 +0100 Subject: [PATCH 323/797] Added typings for prosemirror-transform 0.18.0 --- prosemirror-transform/index.d.ts | 120 ++++++++++++++++++ .../prosemirror-transform-tests.ts | 3 + prosemirror-transform/tsconfig.json | 23 ++++ 3 files changed, 146 insertions(+) create mode 100644 prosemirror-transform/index.d.ts create mode 100644 prosemirror-transform/prosemirror-transform-tests.ts create mode 100644 prosemirror-transform/tsconfig.json diff --git a/prosemirror-transform/index.d.ts b/prosemirror-transform/index.d.ts new file mode 100644 index 0000000000..2082648a79 --- /dev/null +++ b/prosemirror-transform/index.d.ts @@ -0,0 +1,120 @@ +// Type definitions for prosemirror-transform 0.18.0 +// Project: https://github.com/ProseMirror/prosemirror-transform +// Definitions by: David Hahn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +import { ProsemirrorNode } from 'prosemirror-model' +import { Mark } from 'prosemirror-model' +import { MarkType } from 'prosemirror-model' +import { Slice } from 'prosemirror-model' +import { Fragment } from 'prosemirror-model' +import { NodeRange } from 'prosemirror-model' +import { NodeType } from 'prosemirror-model' +import { Schema } from 'prosemirror-model' + +declare module "prosemirror-transform" { + export interface Mappable { + map(pos: number, assoc?: number): number + mapResult(pos: number, assoc?: number): MapResult + + } + export class MapResult { + pos: number; + deleted: boolean; + + } + export class StepMap { + constructor(ranges: number[]) + mapResult(pos: number, assoc?: number): MapResult + map(pos: number, assoc?: number): number + forEach(f: (oldStart: number, oldEnd: number, newStart: number, newEnd: number) => void): void + invert(): StepMap + + } + export class Mapping { + constructor(maps?: StepMap[]) + maps: StepMap[]; + from: number; + to: number; + slice(from?: number, to?: number): Mapping + appendMap(map: StepMap, mirrors?: number): void + appendMapping(mapping: Mapping): void + appendMappingInverted(mapping: Mapping): void + map(pos: number, assoc?: number): number + mapResult(pos: number, assoc?: number): MapResult + + } + export class Transform { + constructor(doc: ProsemirrorNode) + addMark(from: number, to: number, mark: Mark): Transform + removeMark(from: number, to: number, mark?: Mark | MarkType): Transform + clearMarkup(from: number, to: number): Transform + replaceRange(from: number, to: number, slice: Slice): Transform + replaceRangeWith(from: number, to: number, node: ProsemirrorNode): Transform + deleteRange(from: number, to: number): Transform + delete(from: number, to: number): Transform + replace(from: number, to?: number, slice?: Slice): Transform + replaceWith(from: number, to: number, content: Fragment | ProsemirrorNode | ProsemirrorNode[]): Transform + insert(pos: number, content: Fragment | ProsemirrorNode | ProsemirrorNode[]): Transform + lift(range: NodeRange, target: number): Transform + wrap(range: NodeRange, wrappers: { type: NodeType, attrs?: Object }[]): Transform + setBlockType(from: number, to: number |  void, type: NodeType, attrs?: Object): Transform + setNodeType(pos: number, type?: NodeType, attrs?: Object, marks?: Mark[]): Transform + split(pos: number, depth?: number, typesAfter?: { type: NodeType, attrs?: Object }[]): Transform + join(pos: number, depth?: number, p1?: boolean): Transform + doc: ProsemirrorNode; + steps: Step[]; + docs: ProsemirrorNode[]; + mapping: Mapping; + before: ProsemirrorNode; + step(step: Step): Transform + maybeStep(step: Step): StepResult + docChanged: boolean; + + } + export class AddMarkStep extends Step { + constructor(from: number, to: number, mark: Mark) + + } + export class RemoveMarkStep extends Step { + constructor(from: number, to: number, mark: Mark) + + } + export function replaceStep(doc: ProsemirrorNode, from: number, to?: number, slice?: Slice): Step + export class ReplaceStep extends Step { + constructor(from: number, to: number, slice: Slice, structure?: boolean) + + } + export class ReplaceAroundStep extends Step { + constructor(from: number, to: number, gapFrom: number, gapTo: number, slice: Slice, insert: number, structure?: boolean) + + } + export class Step { + apply(doc: ProsemirrorNode): StepResult + getMap(): StepMap + invert(doc: ProsemirrorNode): Step + map(mapping: Mappable): Step + merge(other: Step): Step + offset(n: number): Step + toJSON(): Object + static fromJSON(schema: Schema, json: Object): Step + static jsonID(id: string, stepClass: Step): void + + } + export class StepResult { + doc?: ProsemirrorNode; + failed?: string; + static ok(doc: ProsemirrorNode): StepResult + static fail(message: string): StepResult + static fromReplace(doc: ProsemirrorNode, from: number, to: number, slice: Slice): StepResult + + } + export function liftTarget(range: NodeRange): number + export function findWrapping(range: NodeRange, nodeType: NodeType, attrs?: Object): { type: NodeType, attrs?: Object }[] + export function canSplit(doc: ProsemirrorNode, pos: number, depth?: { type: NodeType, attrs?: Object }[]): boolean + export function canJoin(doc: ProsemirrorNode, pos: number): boolean + export function joinPoint(doc: ProsemirrorNode, pos: number, dir?: number): number + export function insertPoint(doc: ProsemirrorNode, pos: number, nodeType: NodeType, attrs?: Object): number + +} \ No newline at end of file diff --git a/prosemirror-transform/prosemirror-transform-tests.ts b/prosemirror-transform/prosemirror-transform-tests.ts new file mode 100644 index 0000000000..3db8edbb8d --- /dev/null +++ b/prosemirror-transform/prosemirror-transform-tests.ts @@ -0,0 +1,3 @@ +import * as transform from 'prosemirror-transform'; + +let stepmap = new transform.StepMap([]); diff --git a/prosemirror-transform/tsconfig.json b/prosemirror-transform/tsconfig.json new file mode 100644 index 0000000000..2526e2d213 --- /dev/null +++ b/prosemirror-transform/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "prosemirror-transform-tests.ts" + ] +} \ No newline at end of file From 957ea9e7e10a0533d793fad9099126ddd98c141f Mon Sep 17 00:00:00 2001 From: David Hahn Date: Tue, 7 Mar 2017 09:54:26 +0100 Subject: [PATCH 324/797] Added typings for prosemirror-state 0.18.0 --- prosemirror-state/index.d.ts | 109 +++++++++++++++++++ prosemirror-state/prosemirror-state-tests.ts | 4 + prosemirror-state/tsconfig.json | 23 ++++ 3 files changed, 136 insertions(+) create mode 100644 prosemirror-state/index.d.ts create mode 100644 prosemirror-state/prosemirror-state-tests.ts create mode 100644 prosemirror-state/tsconfig.json diff --git a/prosemirror-state/index.d.ts b/prosemirror-state/index.d.ts new file mode 100644 index 0000000000..8a6328b554 --- /dev/null +++ b/prosemirror-state/index.d.ts @@ -0,0 +1,109 @@ +// Type definitions for prosemirror-state 0.18.0 +// Project: https://github.com/ProseMirror/prosemirror-state +// Definitions by: David Hahn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { EditorProps } from 'prosemirror-view' +import { EditorView } from 'prosemirror-view' +import { ResolvedPos } from 'prosemirror-model' +import { ProsemirrorNode } from 'prosemirror-model' +import { Mappable } from 'prosemirror-transform' +import { Mark } from 'prosemirror-model' +import { Schema } from 'prosemirror-model' +import { Transform } from 'prosemirror-transform' +import { Slice } from 'prosemirror-model' +import { MarkType } from 'prosemirror-model' + +declare module "prosemirror-state" { + export type PluginSpec = { props?: EditorProps, state?: StateField, key?: PluginKey, view?(p: EditorView): { update?(view: EditorView, prevState: EditorState): void, destroy?(): void }, filterTransaction?(p1: Transaction, p2: EditorState): boolean, appendTransaction?(transactions: Transaction[], oldState: EditorState, newState: EditorState): Transaction }; + export class Plugin { + constructor(spec: PluginSpec) + props: EditorProps; + spec: Object; + getState(state: EditorState): any + + } + export interface StateField { + init(config: Object, instance: EditorState): T + apply(tr: Transaction, value: T, oldState: EditorState, newState: EditorState): T + toJSON?(value: T): any + fromJSON?(config: Object, value: any, state: EditorState): T + + } + export class PluginKey { + constructor(name?: string) + get(state: EditorState): Plugin + getState(state: EditorState): any + + } + export class Selection { + from: number; + to: number; + $from: ResolvedPos; + $to: ResolvedPos; + empty: boolean; + eq(other: Selection): boolean + map(doc: ProsemirrorNode, mapping: Mappable): Selection + toJSON(): Object + static findFrom($pos: ResolvedPos, dir: number, textOnly?: boolean): Selection + static near($pos: ResolvedPos, bias?: number, textOnly?: boolean): Selection + static atStart(doc: ProsemirrorNode, textOnly?: boolean): Selection + static atEnd(doc: ProsemirrorNode, textOnly?: boolean): Selection + static between($anchor: ResolvedPos, $head: ResolvedPos, bias?: number): Selection + static fromJSON(doc: ProsemirrorNode, json: Object): Selection + + } + export class TextSelection extends Selection { + constructor($anchor: ResolvedPos, $head?: ResolvedPos) + anchor: number; + head: number; + $anchor: ResolvedPos; + $head: ResolvedPos; + static create(doc: ProsemirrorNode, anchor: number, head?: number): TextSelection + + } + export class NodeSelection extends Selection { + constructor($from: ResolvedPos) + node: ProsemirrorNode; + static create(doc: ProsemirrorNode, from: number, p1?: number): TextSelection + static isSelectable(node: ProsemirrorNode): boolean + + } + export class EditorState { + doc: ProsemirrorNode; + selection: Selection; + storedMarks?: Mark[]; + schema: Schema; + plugins: Plugin[]; + apply(tr: Transaction): EditorState + applyTransaction(tr: Transaction): { state: EditorState, transactions: Transaction[] } + tr: Transaction; + reconfigure(config: Object): EditorState + toJSON(pluginFields?: Object): Object + static create(config: Object): EditorState + static fromJSON(config: Object, json: Object, pluginFields?: Object): EditorState + + } + export class Transaction extends Transform { + time: number; + storedMarks?: Mark[]; + selection: Selection; + setSelection(selection: Selection): Transaction + selectionSet: boolean; + setStoredMarks(marks?: Mark[]): Transaction + storedMarksSet: boolean; + setTime(time: number): Transaction + replaceSelection(slice: Slice): Transaction + replaceSelectionWith(node: ProsemirrorNode, inheritMarks?: boolean): Transaction + deleteSelection(): Transaction + insertText(text: string, from?: number, to?: number): Transaction + setMeta(key: string | Plugin | PluginKey, value: any): Transaction + getMeta(key: string | Plugin | PluginKey): any + isGeneric: boolean; + scrollIntoView(): Transaction + addStoredMark(mark: Mark): Transaction + removeStoredMark(mark: Mark | MarkType): Transaction + + } + +} \ No newline at end of file diff --git a/prosemirror-state/prosemirror-state-tests.ts b/prosemirror-state/prosemirror-state-tests.ts new file mode 100644 index 0000000000..9daf2b56c5 --- /dev/null +++ b/prosemirror-state/prosemirror-state-tests.ts @@ -0,0 +1,4 @@ +import * as state from 'prosemirror-state'; + +let spec: state.PluginSpec = {}; +let plugin = new state.Plugin(spec); diff --git a/prosemirror-state/tsconfig.json b/prosemirror-state/tsconfig.json new file mode 100644 index 0000000000..2c704a320a --- /dev/null +++ b/prosemirror-state/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "prosemirror-state-tests.ts" + ] +} \ No newline at end of file From d6a6386ddedee2c0940e2e7612386064487868ba Mon Sep 17 00:00:00 2001 From: David Hahn Date: Tue, 7 Mar 2017 09:54:37 +0100 Subject: [PATCH 325/797] Added typings for prosemirror-view 0.18.0 --- prosemirror-view/index.d.ts | 100 +++++++++++++++++++++ prosemirror-view/prosemirror-view-tests.ts | 3 + prosemirror-view/tsconfig.json | 23 +++++ 3 files changed, 126 insertions(+) create mode 100644 prosemirror-view/index.d.ts create mode 100644 prosemirror-view/prosemirror-view-tests.ts create mode 100644 prosemirror-view/tsconfig.json diff --git a/prosemirror-view/index.d.ts b/prosemirror-view/index.d.ts new file mode 100644 index 0000000000..86a533b595 --- /dev/null +++ b/prosemirror-view/index.d.ts @@ -0,0 +1,100 @@ +// Type definitions for prosemirror-view 0.18.0 +// Project: https://github.com/ProseMirror/prosemirror-view +// Definitions by: David Hahn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +import { ProsemirrorNode } from 'prosemirror-model' +import { Mapping } from 'prosemirror-transform' +import { EditorState } from 'prosemirror-state' +import { Transaction } from 'prosemirror-state' +import { DOMParser } from 'prosemirror-model' +import { Slice } from 'prosemirror-model' +import { DOMSerializer } from 'prosemirror-model' + +declare module "prosemirror-view" { + export class Decoration { + spec: Object; + static widget(pos: number, dom: Node, spec?: { associative?: string, stopEvent?(event: Event): boolean, key?: string }): Decoration + static inline(from: number, to: number, attrs: DecorationAttrs, spec?: { inclusiveLeft?: boolean, inclusiveRight?: boolean }): Decoration + static node(from: number, to: number, attrs: DecorationAttrs, spec?: Object): Decoration + + } + export interface DecorationAttrs { + class?: string; + style?: string; + nodeName?: string; + + } + export class DecorationSet { + find(start?: number, end?: number): Decoration[] + map(mapping: Mapping, doc: ProsemirrorNode, options?: { onRemove?(decorationSpec: Object): void }): DecorationSet + add(doc: ProsemirrorNode, decorations: Decoration[]): DecorationSet + remove(decorations: Decoration[]): DecorationSet + static create(doc: ProsemirrorNode, decorations: Decoration[]): DecorationSet + static empty: DecorationSet; + + } + export class EditorView { + constructor(place: Node | ((p: Node) => void) | { mount: Node } |  void, props: EditorProps) + state: EditorState; + dom: Element; + props: EditorProps; + update(props: EditorProps): void + setProps(props: EditorProps): void + updateState(state: EditorState): void + hasFocus(): boolean + someProp(propName: string, f: (prop: any) => any): any + focus(): void + root: Document | DocumentFragment; + posAtCoords(coords: { left: number, top: number }): { pos: number, inside: number } | void + coordsAtPos(pos: number): { left: number, right: number, top: number, bottom: number } + endOfTextblock(dir: "up" | "down" | "left" | "right" | "forward" | "backward", state?: EditorState): boolean + destroy(): void + dispatch(tr: Transaction): void + + } + export interface EditorProps { + state: EditorState; + dispatchTransaction?(tr: Transaction): void + handleDOMEvents?: Object; + handleKeyDown?(view: EditorView, event: KeyboardEvent): boolean + handleKeyPress?(view: EditorView, event: KeyboardEvent): boolean + handleTextInput?(view: EditorView, from: number, to: number, text: string): boolean + handleClickOn?(view: EditorView, pos: number, node: ProsemirrorNode, nodePos: number, event: MouseEvent, direct: boolean): boolean + handleClick?(view: EditorView, pos: number, event: MouseEvent): boolean + handleDoubleClickOn?(view: EditorView, pos: number, node: ProsemirrorNode, nodePos: number, event: MouseEvent, direct: boolean): boolean + handleDoubleClick?(view: EditorView, pos: number, event: MouseEvent): boolean + handleTripleClickOn?(view: EditorView, pos: number, node: ProsemirrorNode, nodePos: number, event: MouseEvent, direct: boolean): boolean + handleTripleClick?(view: EditorView, pos: number, event: MouseEvent): boolean + handleContextMenu?(view: EditorView, pos: number, event: MouseEvent): boolean + onFocus?(view: EditorView, event: Event): void + onBlur?(view: EditorView, event: Event): void + domParser?: DOMParser; + clipboardParser?: DOMParser; + transformPasted?(p: Slice): Slice + transformPastedHTML?(p: string): string + transformPastedText?(p: string): string + nodeViews?: Object; + clipboardSerializer?: DOMSerializer; + decorations?(p: EditorState): DecorationSet + editable?(p: EditorState): boolean + attributes?: Object | ((p: EditorState) => Object | void); + scrollThreshold?: number; + scrollMargin?: number; + + } + export interface NodeView { + dom?: Node; + contentDOM?: Node; + update?(node: ProsemirrorNode, decorations: Decoration[]): boolean + selectNode?(): void + deselectNode?(): void + setSelection?(anchor: number, head: number, root: Document): void + stopEvent?(event: Event): boolean + ignoreMutation?(p: MutationRecord): boolean + destroy?(): void + + } + +} \ No newline at end of file diff --git a/prosemirror-view/prosemirror-view-tests.ts b/prosemirror-view/prosemirror-view-tests.ts new file mode 100644 index 0000000000..113da070ea --- /dev/null +++ b/prosemirror-view/prosemirror-view-tests.ts @@ -0,0 +1,3 @@ +import * as view from 'prosemirror-view'; + +let decoration = new view.Decoration(); diff --git a/prosemirror-view/tsconfig.json b/prosemirror-view/tsconfig.json new file mode 100644 index 0000000000..25af93cd0b --- /dev/null +++ b/prosemirror-view/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "prosemirror-view-tests.ts" + ] +} \ No newline at end of file From d05eb7c4fcef10f4b786351ac40951a770b9e69c Mon Sep 17 00:00:00 2001 From: David Hahn Date: Tue, 7 Mar 2017 10:06:44 +0100 Subject: [PATCH 326/797] Added typings for prosemirror-collab 0.18.0 --- prosemirror-collab/index.d.ts | 17 ++++++++++++++ .../prosemirror-collab-tests.ts | 5 ++++ prosemirror-collab/tsconfig.json | 23 +++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 prosemirror-collab/index.d.ts create mode 100644 prosemirror-collab/prosemirror-collab-tests.ts create mode 100644 prosemirror-collab/tsconfig.json diff --git a/prosemirror-collab/index.d.ts b/prosemirror-collab/index.d.ts new file mode 100644 index 0000000000..c10dc62199 --- /dev/null +++ b/prosemirror-collab/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for prosemirror-collab 0.18.0 +// Project: https://github.com/ProseMirror/prosemirror-collab +// Definitions by: David Hahn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'prosemirror-state' +import { EditorState } from 'prosemirror-state' +import { Step } from 'prosemirror-transform' +import { Transaction } from 'prosemirror-state' + +declare module "prosemirror-collab" { + export function collab(config?: { version?: number, clientID?: number }): Plugin + export function receiveTransaction(state: EditorState, steps: Step[], clientIDs: number[]): Transaction + export function sendableSteps(state: EditorState): { version: number, steps: Step[], clientID: number, origins: Transaction[] } | void + export function getVersion(state: EditorState): number + +} \ No newline at end of file diff --git a/prosemirror-collab/prosemirror-collab-tests.ts b/prosemirror-collab/prosemirror-collab-tests.ts new file mode 100644 index 0000000000..43071590d6 --- /dev/null +++ b/prosemirror-collab/prosemirror-collab-tests.ts @@ -0,0 +1,5 @@ +import * as collab from 'prosemirror-collab'; +import {EditorState} from 'prosemirror-state'; + +let state = new EditorState(); +let version = collab.getVersion(state); diff --git a/prosemirror-collab/tsconfig.json b/prosemirror-collab/tsconfig.json new file mode 100644 index 0000000000..f3d733cd97 --- /dev/null +++ b/prosemirror-collab/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "prosemirror-collab-tests.ts" + ] +} \ No newline at end of file From e19736d7fe980db3ddf649d7fb5a78a028c81d0f Mon Sep 17 00:00:00 2001 From: bappleyard Date: Tue, 7 Mar 2017 09:09:09 +0000 Subject: [PATCH 327/797] #15029 include declaration for DOMImplementation --- xmldom/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 xmldom/index.d.ts diff --git a/xmldom/index.d.ts b/xmldom/index.d.ts old mode 100644 new mode 100755 index dfbe34599c..8c252389cc --- a/xmldom/index.d.ts +++ b/xmldom/index.d.ts @@ -7,6 +7,11 @@ declare namespace xmldom { var DOMParser: DOMParserStatic; var XMLSerializer: XMLSerializerStatic; + var DOMImplementation: DOMImplementationStatic; + + interface DOMImplementationStatic { + new(): DOMImplementation; + } interface DOMParserStatic { new (): DOMParser; From 7ea0ddc89b81ddda638499eb6a0319cef8df064e Mon Sep 17 00:00:00 2001 From: David Hahn Date: Tue, 7 Mar 2017 10:18:07 +0100 Subject: [PATCH 328/797] Added typings for prosemirror-commands 0.18.0 --- prosemirror-commands/index.d.ts | 35 +++++++++++++++++++ .../prosemirror-commands-tests.ts | 5 +++ prosemirror-commands/tsconfig.json | 23 ++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 prosemirror-commands/index.d.ts create mode 100644 prosemirror-commands/prosemirror-commands-tests.ts create mode 100644 prosemirror-commands/tsconfig.json diff --git a/prosemirror-commands/index.d.ts b/prosemirror-commands/index.d.ts new file mode 100644 index 0000000000..0b399dccc7 --- /dev/null +++ b/prosemirror-commands/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for prosemirror-commands 0.18.0 +// Project: https://github.com/ProseMirror/prosemirror-commands +// Definitions by: David Hahn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +import { EditorState } from 'prosemirror-state' +import { Transaction } from 'prosemirror-state' +import { EditorView } from 'prosemirror-view' +import { NodeType } from 'prosemirror-model' +import { MarkType } from 'prosemirror-model' +import { ProsemirrorNode } from 'prosemirror-model' + +declare module "prosemirror-commands" { + export function deleteSelection(state: EditorState, dispatch?: (tr: Transaction) => void): boolean + export function joinBackward(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean + export function joinForward(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean + export function joinUp(state: EditorState, dispatch?: (tr: Transaction) => void): boolean + export function joinDown(state: EditorState, dispatch?: (tr: Transaction) => void): boolean + export function lift(state: EditorState, dispatch?: (tr: Transaction) => void): boolean + export function newlineInCode(state: EditorState, dispatch?: (tr: Transaction) => void): boolean + export function exitCode(state: EditorState, dispatch?: (tr: Transaction) => void): boolean + export function createParagraphNear(state: EditorState, dispatch?: (tr: Transaction) => void): boolean + export function liftEmptyBlock(state: EditorState, dispatch?: (tr: Transaction) => void): boolean + export function splitBlock(state: EditorState, dispatch?: (tr: Transaction) => void): boolean + export function splitBlockKeepMarks(state: EditorState, dispatch?: (tr: Transaction) => void): boolean + export function selectParentNode(state: EditorState, dispatch?: (tr: Transaction) => void): boolean + export function wrapIn(nodeType: NodeType, attrs?: Object): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean + export function setBlockType(nodeType: NodeType, attrs?: Object): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean + export function toggleMark(markType: MarkType, attrs?: Object): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean + export function autoJoin(command: (state: EditorState, fn?: (tr: Transaction) => void) => boolean, isJoinable: ((before: ProsemirrorNode, after: ProsemirrorNode) => boolean) | string[]): (state: EditorState, fn?: (tr: Transaction) => void) => boolean + export function chainCommands(...commands: ((p1: EditorState, fn?: (tr: Transaction) => void) => boolean)[]): (p1: EditorState, fn?: (tr: Transaction) => void) => boolean + export let baseKeymap: Object; + +} \ No newline at end of file diff --git a/prosemirror-commands/prosemirror-commands-tests.ts b/prosemirror-commands/prosemirror-commands-tests.ts new file mode 100644 index 0000000000..f013a51d79 --- /dev/null +++ b/prosemirror-commands/prosemirror-commands-tests.ts @@ -0,0 +1,5 @@ +import * as commands from 'prosemirror-commands'; +import {EditorState} from 'prosemirror-state'; + +let state = new EditorState(); +commands.deleteSelection(state); diff --git a/prosemirror-commands/tsconfig.json b/prosemirror-commands/tsconfig.json new file mode 100644 index 0000000000..ff55c68fa5 --- /dev/null +++ b/prosemirror-commands/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "prosemirror-commands-tests.ts" + ] +} \ No newline at end of file From 3a68ea27696fa39b6bb07baceed6a236d37d42bd Mon Sep 17 00:00:00 2001 From: David Hahn Date: Tue, 7 Mar 2017 10:18:17 +0100 Subject: [PATCH 329/797] Added typings for prosemirror-history 0.18.0 --- prosemirror-history/index.d.ts | 17 ++++++++++++++ .../prosemirror-history-tests.ts | 5 ++++ prosemirror-history/tsconfig.json | 23 +++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 prosemirror-history/index.d.ts create mode 100644 prosemirror-history/prosemirror-history-tests.ts create mode 100644 prosemirror-history/tsconfig.json diff --git a/prosemirror-history/index.d.ts b/prosemirror-history/index.d.ts new file mode 100644 index 0000000000..e1855fd8d2 --- /dev/null +++ b/prosemirror-history/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for prosemirror-history 0.18.0 +// Project: https://github.com/ProseMirror/prosemirror-history +// Definitions by: David Hahn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'prosemirror-state' +import { EditorState } from 'prosemirror-state' +import { Transaction } from 'prosemirror-state' + +declare module "prosemirror-history" { + export function history(config?: { depth?: number, newGroupDelay: number, preserveItems?: boolean }): Plugin + export function undo(state: EditorState, dispatch?: (tr: Transaction) => void): boolean + export function redo(state: EditorState, dispatch?: (tr: Transaction) => void): boolean + export function undoDepth(state: EditorState): number + export function redoDepth(state: EditorState): number + +} \ No newline at end of file diff --git a/prosemirror-history/prosemirror-history-tests.ts b/prosemirror-history/prosemirror-history-tests.ts new file mode 100644 index 0000000000..3beccd390b --- /dev/null +++ b/prosemirror-history/prosemirror-history-tests.ts @@ -0,0 +1,5 @@ +import * as history from 'prosemirror-history'; +import {EditorState} from 'prosemirror-state'; + +let state = new EditorState(); +history.undo(state); diff --git a/prosemirror-history/tsconfig.json b/prosemirror-history/tsconfig.json new file mode 100644 index 0000000000..d9410dcf2e --- /dev/null +++ b/prosemirror-history/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "prosemirror-history-tests.ts" + ] +} \ No newline at end of file From 96aac2f425b10b2a9f7440ffb8a6e9e1ca00f5a0 Mon Sep 17 00:00:00 2001 From: David Hahn Date: Tue, 7 Mar 2017 10:18:35 +0100 Subject: [PATCH 330/797] Added typings for prosemirror-inputrules 0.18.0 --- prosemirror-inputrules/index.d.ts | 35 +++++++++++++++++++ .../prosemirror-inputrules-tests.ts | 5 +++ prosemirror-inputrules/tsconfig.json | 23 ++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 prosemirror-inputrules/index.d.ts create mode 100644 prosemirror-inputrules/prosemirror-inputrules-tests.ts create mode 100644 prosemirror-inputrules/tsconfig.json diff --git a/prosemirror-inputrules/index.d.ts b/prosemirror-inputrules/index.d.ts new file mode 100644 index 0000000000..0b14c55070 --- /dev/null +++ b/prosemirror-inputrules/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for prosemirror-inputrules 0.18.0 +// Project: https://github.com/ProseMirror/prosemirror-inputrules +// Definitions by: David Hahn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +import { EditorState } from 'prosemirror-state' +import { Transaction } from 'prosemirror-state' +import { Plugin } from 'prosemirror-state' +import { NodeType } from 'prosemirror-model' +import { ProsemirrorNode } from 'prosemirror-model' + +declare module "prosemirror-inputrules" { + export class InputRule { + constructor(match: RegExp, handler: string | ((state: EditorState, match: string[], start: number, end: number) => Transaction)) + + } + export function inputRules(config: { rules: InputRule[] }): Plugin + export let emDash: InputRule; + export let ellipsis: InputRule; + export let openDoubleQuote: InputRule; + export let closeDoubleQuote: InputRule; + export let openSingleQuote: InputRule; + export let closeSingleQuote: InputRule; + export let smartQuotes: InputRule[]; + export let allInputRules: InputRule[]; + export function wrappingInputRule(regexp: RegExp, nodeType: NodeType, getAttrs?: Object | ((p: string[]) => Object | void), joinPredicate?: (p1: string[], p2: ProsemirrorNode) => boolean): InputRule + export function textblockTypeInputRule(regexp: RegExp, nodeType: NodeType, getAttrs?: Object | ((p: string[]) => Object | void)): InputRule + export function blockQuoteRule(nodeType: NodeType): InputRule + export function orderedListRule(nodeType: NodeType): InputRule + export function bulletListRule(nodeType: NodeType): InputRule + export function codeBlockRule(nodeType: NodeType): InputRule + export function headingRule(nodeType: NodeType, maxLevel: number): InputRule + +} \ No newline at end of file diff --git a/prosemirror-inputrules/prosemirror-inputrules-tests.ts b/prosemirror-inputrules/prosemirror-inputrules-tests.ts new file mode 100644 index 0000000000..85317eaa4c --- /dev/null +++ b/prosemirror-inputrules/prosemirror-inputrules-tests.ts @@ -0,0 +1,5 @@ +import * as inputrules from 'prosemirror-inputrules'; +import { NodeType } from 'prosemirror-model' + +let nodeType = new NodeType(); +let rule = inputrules.blockQuoteRule(nodeType); diff --git a/prosemirror-inputrules/tsconfig.json b/prosemirror-inputrules/tsconfig.json new file mode 100644 index 0000000000..6c1ea1cab4 --- /dev/null +++ b/prosemirror-inputrules/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "prosemirror-inputrules-tests.ts" + ] +} \ No newline at end of file From 8cb7c8d36e7b23b21a77ffeca12599e94954cc68 Mon Sep 17 00:00:00 2001 From: David Hahn Date: Tue, 7 Mar 2017 10:18:45 +0100 Subject: [PATCH 331/797] Added typings for prosemirror-keymap 0.18.0 --- prosemirror-keymap/index.d.ts | 13 +++++++++++ .../prosemirror-keymap-tests.ts | 3 +++ prosemirror-keymap/tsconfig.json | 23 +++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 prosemirror-keymap/index.d.ts create mode 100644 prosemirror-keymap/prosemirror-keymap-tests.ts create mode 100644 prosemirror-keymap/tsconfig.json diff --git a/prosemirror-keymap/index.d.ts b/prosemirror-keymap/index.d.ts new file mode 100644 index 0000000000..91d2cbd3d9 --- /dev/null +++ b/prosemirror-keymap/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for prosemirror-keymap 0.18.0 +// Project: https://github.com/ProseMirror/prosemirror-keymap +// Definitions by: David Hahn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'prosemirror-state' +import { EditorView } from 'prosemirror-view' + +declare module "prosemirror-keymap" { + export function keymap(bindings: Object): Plugin + export function keydownHandler(bindings: Object): (view: EditorView, event: Event) => boolean + +} \ No newline at end of file diff --git a/prosemirror-keymap/prosemirror-keymap-tests.ts b/prosemirror-keymap/prosemirror-keymap-tests.ts new file mode 100644 index 0000000000..47e5f75633 --- /dev/null +++ b/prosemirror-keymap/prosemirror-keymap-tests.ts @@ -0,0 +1,3 @@ +import * as keymap from 'prosemirror-keymap'; + +keymap.keymap({}); diff --git a/prosemirror-keymap/tsconfig.json b/prosemirror-keymap/tsconfig.json new file mode 100644 index 0000000000..b96daa75b6 --- /dev/null +++ b/prosemirror-keymap/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "prosemirror-keymap-tests.ts" + ] +} \ No newline at end of file From 7c0405c03c7218e48d1df23ae159d7885b514294 Mon Sep 17 00:00:00 2001 From: David Hahn Date: Tue, 7 Mar 2017 10:25:43 +0100 Subject: [PATCH 332/797] Added typings for prosemirror-menu 0.18.0 --- prosemirror-menu/index.d.ts | 68 ++++++++++++++++++++++ prosemirror-menu/prosemirror-menu-tests.ts | 3 + prosemirror-menu/tsconfig.json | 23 ++++++++ 3 files changed, 94 insertions(+) create mode 100644 prosemirror-menu/index.d.ts create mode 100644 prosemirror-menu/prosemirror-menu-tests.ts create mode 100644 prosemirror-menu/tsconfig.json diff --git a/prosemirror-menu/index.d.ts b/prosemirror-menu/index.d.ts new file mode 100644 index 0000000000..6ba1979a42 --- /dev/null +++ b/prosemirror-menu/index.d.ts @@ -0,0 +1,68 @@ +// Type definitions for prosemirror-menu 0.18.0 +// Project: https://github.com/ProseMirror/prosemirror-menu +// Definitions by: David Hahn +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +import { ProsemirrorNode } from 'prosemirror-model' +import { EditorView } from 'prosemirror-view' +import { EditorState } from 'prosemirror-state' +import { Transaction } from 'prosemirror-state' +import { NodeType } from 'prosemirror-model' +import { EditorProps } from 'prosemirror-view' + +declare module "prosemirror-menu" { + export interface MenuElement { + render(pm: any): Node + + } + export class MenuItem { + constructor(spec: MenuItemSpec) + spec: MenuItemSpec; + render(view: EditorView): Node + + } + export interface MenuItemSpec { + run(p1: EditorState, fn: (p: Transaction) => void, p2: EditorView): void + select?(p: EditorState): boolean + onDeselect?: string; + active?(p: EditorState): boolean + render?(p: EditorView): Node + icon?: Object; + label?: string; + title?: string; + class: string; + css: string; + execEvent: string; + + } + export class Dropdown { + constructor(content: MenuElement[], options?: Object) + render(view: EditorView): Node + + } + export class DropdownSubmenu { + constructor(content: MenuElement[], options?: Object) + render(view: EditorView): Node + + } + export function renderGrouped(view: EditorView, content: MenuElement | MenuElement[][]): DocumentFragment + export let icons: Object; + export let joinUpItem: MenuItem; + export let liftItem: MenuItem; + export let selectParentNodeItem: MenuItem; + export function undoItem(p: Object): MenuItem + export function redoItem(p: Object): MenuItem + export function wrapItem(nodeType: NodeType, options: Object): MenuItem + export function blockTypeItem(nodeType: NodeType, options: Object): MenuItem + export class MenuBarEditorView { + wrapper: Node; + editor: EditorView; + props: EditorProps; + update(props: EditorProps): void + updateState(state: EditorState): void + destroy(): void + + } + +} \ No newline at end of file diff --git a/prosemirror-menu/prosemirror-menu-tests.ts b/prosemirror-menu/prosemirror-menu-tests.ts new file mode 100644 index 0000000000..3cd253c94d --- /dev/null +++ b/prosemirror-menu/prosemirror-menu-tests.ts @@ -0,0 +1,3 @@ +import * as menu from 'prosemirror-menu'; + +let editorView = new menu.MenuBarEditorView(); \ No newline at end of file diff --git a/prosemirror-menu/tsconfig.json b/prosemirror-menu/tsconfig.json new file mode 100644 index 0000000000..567612296f --- /dev/null +++ b/prosemirror-menu/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "prosemirror-menu-tests.ts" + ] +} \ No newline at end of file From 0485feb424e282cdb700eea4cc4a3f5c777c7d51 Mon Sep 17 00:00:00 2001 From: David Hahn Date: Tue, 7 Mar 2017 11:19:39 +0100 Subject: [PATCH 333/797] Removed patch version from prosemirror packages --- prosemirror-collab/index.d.ts | 2 +- prosemirror-commands/index.d.ts | 2 +- prosemirror-history/index.d.ts | 2 +- prosemirror-inputrules/index.d.ts | 2 +- prosemirror-keymap/index.d.ts | 2 +- prosemirror-menu/index.d.ts | 2 +- prosemirror-model/index.d.ts | 2 +- prosemirror-state/index.d.ts | 2 +- prosemirror-transform/index.d.ts | 2 +- prosemirror-view/index.d.ts | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/prosemirror-collab/index.d.ts b/prosemirror-collab/index.d.ts index c10dc62199..a04c72ecf8 100644 --- a/prosemirror-collab/index.d.ts +++ b/prosemirror-collab/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for prosemirror-collab 0.18.0 +// Type definitions for prosemirror-collab 0.18 // Project: https://github.com/ProseMirror/prosemirror-collab // Definitions by: David Hahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/prosemirror-commands/index.d.ts b/prosemirror-commands/index.d.ts index 0b399dccc7..662f43a045 100644 --- a/prosemirror-commands/index.d.ts +++ b/prosemirror-commands/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for prosemirror-commands 0.18.0 +// Type definitions for prosemirror-commands 0.18 // Project: https://github.com/ProseMirror/prosemirror-commands // Definitions by: David Hahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/prosemirror-history/index.d.ts b/prosemirror-history/index.d.ts index e1855fd8d2..4eee0f42dc 100644 --- a/prosemirror-history/index.d.ts +++ b/prosemirror-history/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for prosemirror-history 0.18.0 +// Type definitions for prosemirror-history 0.18 // Project: https://github.com/ProseMirror/prosemirror-history // Definitions by: David Hahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/prosemirror-inputrules/index.d.ts b/prosemirror-inputrules/index.d.ts index 0b14c55070..252ba59b2b 100644 --- a/prosemirror-inputrules/index.d.ts +++ b/prosemirror-inputrules/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for prosemirror-inputrules 0.18.0 +// Type definitions for prosemirror-inputrules 0.18 // Project: https://github.com/ProseMirror/prosemirror-inputrules // Definitions by: David Hahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/prosemirror-keymap/index.d.ts b/prosemirror-keymap/index.d.ts index 91d2cbd3d9..8ae14961c5 100644 --- a/prosemirror-keymap/index.d.ts +++ b/prosemirror-keymap/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for prosemirror-keymap 0.18.0 +// Type definitions for prosemirror-keymap 0.18 // Project: https://github.com/ProseMirror/prosemirror-keymap // Definitions by: David Hahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/prosemirror-menu/index.d.ts b/prosemirror-menu/index.d.ts index 6ba1979a42..4d78e8ce62 100644 --- a/prosemirror-menu/index.d.ts +++ b/prosemirror-menu/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for prosemirror-menu 0.18.0 +// Type definitions for prosemirror-menu 0.18 // Project: https://github.com/ProseMirror/prosemirror-menu // Definitions by: David Hahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/prosemirror-model/index.d.ts b/prosemirror-model/index.d.ts index a82525b89a..ff281cb2f9 100644 --- a/prosemirror-model/index.d.ts +++ b/prosemirror-model/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for prosemirror-model 0.18.0 +// Type definitions for prosemirror-model 0.18 // Project: https://github.com/ProseMirror/prosemirror-model // Definitions by: David Hahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/prosemirror-state/index.d.ts b/prosemirror-state/index.d.ts index 8a6328b554..8a71756edb 100644 --- a/prosemirror-state/index.d.ts +++ b/prosemirror-state/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for prosemirror-state 0.18.0 +// Type definitions for prosemirror-state 0.18 // Project: https://github.com/ProseMirror/prosemirror-state // Definitions by: David Hahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/prosemirror-transform/index.d.ts b/prosemirror-transform/index.d.ts index 2082648a79..26c912ccd7 100644 --- a/prosemirror-transform/index.d.ts +++ b/prosemirror-transform/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for prosemirror-transform 0.18.0 +// Type definitions for prosemirror-transform 0.18 // Project: https://github.com/ProseMirror/prosemirror-transform // Definitions by: David Hahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/prosemirror-view/index.d.ts b/prosemirror-view/index.d.ts index 86a533b595..7e0fc118e0 100644 --- a/prosemirror-view/index.d.ts +++ b/prosemirror-view/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for prosemirror-view 0.18.0 +// Type definitions for prosemirror-view 0.18 // Project: https://github.com/ProseMirror/prosemirror-view // Definitions by: David Hahn // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 023117be187ae595c015dc6be82f580dd5d9754e Mon Sep 17 00:00:00 2001 From: Jay Anslow Date: Tue, 7 Mar 2017 10:49:59 +0000 Subject: [PATCH 334/797] 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 335/797] 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 411026b03bdab780eeb883f512f93ea1e1f14b35 Mon Sep 17 00:00:00 2001 From: Raphael Thiebault Date: Tue, 7 Mar 2017 11:39:03 +0000 Subject: [PATCH 336/797] Sequelize : Fix missing test for s.fn() on FindOptions --- sequelize/sequelize-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sequelize/sequelize-tests.ts b/sequelize/sequelize-tests.ts index 9a54ea6d64..b482b1f08b 100644 --- a/sequelize/sequelize-tests.ts +++ b/sequelize/sequelize-tests.ts @@ -905,6 +905,7 @@ User.findAll( { attributes: [[s.fn('count', Sequelize.col('*')), 'count']] }); User.findAll( { attributes: [[s.fn('count', Sequelize.col('*')), 'count']], group: ['sex'] }); User.findAll( { attributes: [s.cast(s.fn('count', Sequelize.col('*')), 'INTEGER')] }); User.findAll( { attributes: [[s.cast(s.fn('count', Sequelize.col('*')), 'INTEGER'), 'count']] }); +User.findAll( { where : s.fn('count', [0, 10]) } ); User.findById( 'a string' ); @@ -925,6 +926,7 @@ User.findOne( { where : { name : 'worker' }, include : [User] } ); User.findOne( { where : { name : 'Boris' }, include : [User, { model : User, as : 'Photos' }] } ); User.findOne( { where : { username : 'someone' }, include : [User] } ); User.findOne( { where : { username : 'barfooz' }, raw : true } ); +User.findOne( { where : s.fn('count', []) } ); /* NOTE https://github.com/DefinitelyTyped/DefinitelyTyped/pull/5590 User.findOne( { updatedAt : { ne : null } } ); */ From 1eae9816b73550e147d9fecf529152fed50aa8db Mon Sep 17 00:00:00 2001 From: Birk Skyum Date: Tue, 7 Mar 2017 12:47:22 +0100 Subject: [PATCH 337/797] Update Meteor type definitions v1.4 --- meteor/README.md | 4 +- meteor/index.d.ts | 2894 ++++++++++++++++++++++++++++------------ meteor/meteor-tests.ts | 85 +- 3 files changed, 2133 insertions(+), 850 deletions(-) diff --git a/meteor/README.md b/meteor/README.md index 7c8aa5cb1d..a4880bed54 100644 --- a/meteor/README.md +++ b/meteor/README.md @@ -1,4 +1,4 @@ -# Meteor Type Definitions [DEPRECATED] +# Meteor Type Definitions ## Deprecated @@ -9,7 +9,7 @@ The canonical TypeScript definitions for Meteor can now be found using the NPM [ ## Description -These are the definitions for version 1.3 of Meteor. These definitions were generated from the from the same [Meteor data.js file] (https://github.com/meteor/meteor/blob/devel/docs/client/data.js) that is used to generate the official [Meteor docs] (http://docs.meteor.com/). The code that generates these definitions can be found [here](https://github.com/meteor-typescript/meteor-typescript-libs/). +These are the definitions for version 1.4 of Meteor. These definitions were generated from the from the same [Meteor data.js file] (https://github.com/meteor/meteor/blob/devel/docs/client/data.js) that is used to generate the official [Meteor docs] (http://docs.meteor.com/). The code that generates these definitions can be found [here](https://github.com/meteor-typescript/meteor-typescript-libs/). ## Upcoming Meteor `typescript` package diff --git a/meteor/index.d.ts b/meteor/index.d.ts index 7a2f85f72b..3acd3e4fef 100644 --- a/meteor/index.d.ts +++ b/meteor/index.d.ts @@ -1,915 +1,2143 @@ -// Type definitions for Meteor 1.3 +// Type definitions for Meteor 1.4 // Project: http://www.meteor.com/ -// Definitions by: Dave Allen -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Definitions by: +// Alex Borodach +// Dave Allen +// Olivier Refalo +// Daniel Neveux +// Birk Skyum -/** - * These are the common (for client and server) modules and interfaces that can't be automatically generated from the Meteor data.js file - */ +interface URLS { + resetPassword: (token: string) => string; + verifyEmail: (token: string) => string; + enrollAccount: (token: string) => string; +} +declare module Accounts { + var urls: URLS; + + function user(): Meteor.User; + + function userId(): string; + + function createUser(options: { + username?: string; + email?: string; + password?: string; + profile?: Object; + }, callback?: Function): string; + + function config(options: { + sendVerificationEmail?: boolean; + forbidClientAccountCreation?: boolean; + restrictCreationByEmailDomain?: string | Function; + loginExpirationInDays?: number; + oauthSecretKey?: string; + }): void; + + function onLogin(func: Function): { + stop: () => void + }; + + function onLoginFailure(func: Function): { + stop: () => void + }; + + function loginServicesConfigured(): boolean; + + function onPageLoadLogin(func: Function): void; +} + +declare module "meteor/accounts-base" { + interface URLS { + resetPassword: (token: string) => string; + verifyEmail: (token: string) => string; + enrollAccount: (token: string) => string; + } + + module Accounts { + var urls: URLS; + + function user(): Meteor.User; + + function userId(): string; + + function createUser(options: { + username?: string; + email?: string; + password?: string; + profile?: Object; + }, callback?: Function): string; + + function config(options: { + sendVerificationEmail?: boolean; + forbidClientAccountCreation?: boolean; + restrictCreationByEmailDomain?: string | Function; + loginExpirationInDays?: number; + oauthSecretKey?: string; + }): void; + + function onLogin(func: Function): { + stop: () => void + }; + + function onLoginFailure(func: Function): { + stop: () => void + }; + + function loginServicesConfigured(): boolean; + + function onPageLoadLogin(func: Function): void; + } +} + +declare module Accounts { + function changePassword(oldPassword: string, newPassword: string, callback?: Function): void; + + function forgotPassword(options: { + email?: string; + }, callback?: Function): void; + + function resetPassword(token: string, newPassword: string, callback?: Function): void; + + function verifyEmail(token: string, callback?: Function): void; + + function onEmailVerificationLink(callback: Function): void; + + function onEnrollmentLink(callback: Function): void; + + function onResetPasswordLink(callback: Function): void; + + function loggingIn(): boolean; + + function logout(callback?: Function): void; + + function logoutOtherClients(callback?: Function): void; + + var ui: { + config(options: { + requestPermissions?: Object; + requestOfflineToken?: Object; + forceApprovalPrompt?: Object; + passwordSignupFields?: string; + }): void; + }; +} + +declare module "meteor/accounts-base" { + module Accounts { + function changePassword(oldPassword: string, newPassword: string, callback?: Function): void; + + function forgotPassword(options: { + email?: string; + }, callback?: Function): void; + + function resetPassword(token: string, newPassword: string, callback?: Function): void; + + function verifyEmail(token: string, callback?: Function): void; + + function onEmailVerificationLink(callback: Function): void; + + function onEnrollmentLink(callback: Function): void; + + function onResetPasswordLink(callback: Function): void; + + function loggingIn(): boolean; + + function logout(callback?: Function): void; + + function logoutOtherClients(callback?: Function): void; + + var ui: { + config(options: { + requestPermissions?: Object; + requestOfflineToken?: Object; + forceApprovalPrompt?: Object; + passwordSignupFields?: string; + }): void; + }; + } +} + +interface EmailFields { + from?: () => string; + subject?: (user: Meteor.User) => string; + text?: (user: Meteor.User, url: string) => string; + html?: (user: Meteor.User, url: string) => string; +} + +interface Header { + [id: string]: string; +} + +interface EmailTemplates { + from: string; + siteName: string; + headers?: Header; + resetPassword: EmailFields; + enrollAccount: EmailFields; + verifyEmail: EmailFields; +} + +declare module Accounts { + var emailTemplates: EmailTemplates; + + function addEmail(userId: string, newEmail: string, verified?: boolean): void; + + function removeEmail(userId: string, email: string): void; + + function onCreateUser(func: Function): void; + + function findUserByEmail(email: string): Object; + + function findUserByUsername(username: string): Object; + + function sendEnrollmentEmail(userId: string, email?: string): void; + + function sendResetPasswordEmail(userId: string, email?: string): void; + + function sendVerificationEmail(userId: string, email?: string): void; + + function setUsername(userId: string, newUsername: string): void; + + function setPassword(userId: string, newPassword: string, options?: { + logout?: Object; + }): void; + + function validateNewUser(func: Function): boolean; + + function validateLoginAttempt(func: Function): { + stop: () => void + }; + + interface IValidateLoginAttemptCbOpts { + type: string; + allowed: boolean; + error: Meteor.Error; + user: Meteor.User; + connection: Meteor.Connection; + methodName: string; + methodArguments: any[]; + } +} + +declare module "meteor/accounts-base" { + interface EmailFields { + from?: () => string; + subject?: (user: Meteor.User) => string; + text?: (user: Meteor.User, url: string) => string; + html?: (user: Meteor.User, url: string) => string; + } + + interface Header { + [id: string]: string; + } + + interface EmailTemplates { + from: string; + siteName: string; + headers?: Header; + resetPassword: EmailFields; + enrollAccount: EmailFields; + verifyEmail: EmailFields; + } + + module Accounts { + var emailTemplates: EmailTemplates; + + function addEmail(userId: string, newEmail: string, verified?: boolean): void; + + function removeEmail(userId: string, email: string): void; + + function onCreateUser(func: Function): void; + + function findUserByEmail(email: string): Object; + + function findUserByUsername(username: string): Object; + + function sendEnrollmentEmail(userId: string, email?: string): void; + + function sendResetPasswordEmail(userId: string, email?: string): void; + + function sendVerificationEmail(userId: string, email?: string): void; + + function setUsername(userId: string, newUsername: string): void; + + function setPassword(userId: string, newPassword: string, options?: { + logout?: Object; + }): void; + + function validateNewUser(func: Function): boolean; + + function validateLoginAttempt(func: Function): { + stop: () => void + }; + + interface IValidateLoginAttemptCbOpts { + type: string; + allowed: boolean; + error: Meteor.Error; + user: Meteor.User; + connection: Meteor.Connection; + methodName: string; + methodArguments: any[]; + } + } +} + +declare module Blaze { + var View: ViewStatic; + + interface ViewStatic { + new(name?: string, renderFunction?: Function): View; + } + + interface View { + name: string; + parentView: View; + isCreated: boolean; + isRendered: boolean; + isDestroyed: boolean; + renderCount: number; + autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; + onViewCreated(func: Function): void; + onViewReady(func: Function): void; + onViewDestroyed(func: Function): void; + firstNode(): Node; + lastNode(): Node; + template: Template; + templateInstance(): TemplateInstance; + } + var currentView: View; + + function isTemplate(value: any): boolean; + + interface HelpersMap { + [key: string]: Function; + } + + interface EventsMap { + [key: string]: Function; + } + + var Template: TemplateStatic; + + interface TemplateStatic { + new(viewName?: string, renderFunction?: Function): Template; + + registerHelper(name: string, func: Function): void; + instance(): TemplateInstance; + currentData(): any; + parentData(numLevels: number): any; + } + + interface Template { + viewName: string; + renderFunction: Function; + constructView(): View; + head: Template; + find(selector: string): HTMLElement; + findAll(selector: string): HTMLElement[]; + $: any; + onCreated(cb: Function): void; + onRendered(cb: Function): void; + onDestroyed(cb: Function): void; + created: Function; + rendered: Function; + destroyed: Function; + helpers(helpersMap: HelpersMap): void; + events(eventsMap: EventsMap): void; + } + + var TemplateInstance: TemplateInstanceStatic; + + interface TemplateInstanceStatic { + new(view: View): TemplateInstance; + } + + interface TemplateInstance { + $(selector: string): any; + autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; + data: Object; + find(selector: string): HTMLElement; + findAll(selector: string): HTMLElement[]; + firstNode: Object; + lastNode: Object; + subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; + subscriptionsReady(): boolean; + view: Object; + } + + function Each(argFunc: Function, contentFunc: Function, elseFunc?: Function): View; + + function Unless(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): View; + + function If(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): View; + + function Let(bindings: Function, contentFunc: Function): View; + + function With(data: Object | Function, contentFunc: Function): View; + + function getData(elementOrView?: HTMLElement | View): Object; + + function getView(element?: HTMLElement): View; + + function remove(renderedView: View): void; + + function render(templateOrView: Template | View, parentNode: Node, nextNode?: Node, parentView?: View): View; + + function renderWithData(templateOrView: Template | View, data: Object | Function, parentNode: Node, nextNode?: Node, parentView?: View): View; + + function toHTML(templateOrView: Template | View): string; + + function toHTMLWithData(templateOrView: Template | View, data: Object | Function): string; +} + +declare module "meteor/blaze" { + module Blaze { + var View: ViewStatic; + + interface ViewStatic { + new(name?: string, renderFunction?: Function): View; + } + + interface View { + name: string; + parentView: View; + isCreated: boolean; + isRendered: boolean; + isDestroyed: boolean; + renderCount: number; + autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; + onViewCreated(func: Function): void; + onViewReady(func: Function): void; + onViewDestroyed(func: Function): void; + firstNode(): Node; + lastNode(): Node; + template: Template; + templateInstance(): TemplateInstance; + } + var currentView: View; + + function isTemplate(value: any): boolean; + + interface HelpersMap { + [key: string]: Function; + } + + interface EventsMap { + [key: string]: Function; + } + + var Template: TemplateStatic; + + interface TemplateStatic { + new(viewName?: string, renderFunction?: Function): Template; + + registerHelper(name: string, func: Function): void; + instance(): TemplateInstance; + currentData(): any; + parentData(numLevels: number): any; + } + + interface Template { + viewName: string; + renderFunction: Function; + constructView(): View; + head: Template; + find(selector: string): HTMLElement; + findAll(selector: string): HTMLElement[]; + $: any; + onCreated(cb: Function): void; + onRendered(cb: Function): void; + onDestroyed(cb: Function): void; + created: Function; + rendered: Function; + destroyed: Function; + helpers(helpersMap: HelpersMap): void; + events(eventsMap: EventsMap): void; + } + + var TemplateInstance: TemplateInstanceStatic; + + interface TemplateInstanceStatic { + new(view: View): TemplateInstance; + } + + interface TemplateInstance { + $(selector: string): any; + autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; + data: Object; + find(selector: string): HTMLElement; + findAll(selector: string): HTMLElement[]; + firstNode: Object; + lastNode: Object; + subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; + subscriptionsReady(): boolean; + view: Object; + } + + function Each(argFunc: Function, contentFunc: Function, elseFunc?: Function): View; + + function Unless(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): View; + + function If(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): View; + + function Let(bindings: Function, contentFunc: Function): View; + + function With(data: Object | Function, contentFunc: Function): View; + + function getData(elementOrView?: HTMLElement | View): Object; + + function getView(element?: HTMLElement): View; + + function remove(renderedView: View): void; + + function render(templateOrView: Template | View, parentNode: Node, nextNode?: Node, parentView?: View): View; + + function renderWithData(templateOrView: Template | View, data: Object | Function, parentNode: Node, nextNode?: Node, parentView?: View): View; + + function toHTML(templateOrView: Template | View): string; + + function toHTMLWithData(templateOrView: Template | View, data: Object | Function): string; + } +} + +declare module BrowserPolicy { + var framing: { + disallow(): void; + restrictToOrigin(origin: string): void; + allowAll(): void; + }; + + var content: { + allowEval(): void; + allowInlineStyles(): void; + allowInlineScripts(): void; + allowSameOriginForAll(): void; + allowDataUrlForAll(): void; + allowOriginForAll(origin: string): void; + allowImageOrigin(origin: string): void; + allowMediaOrigin(origin: string): void; + allowFontOrigin(origin: string): void; + allowStyleOrigin(origin: string): void; + allowScriptOrigin(origin: string): void; + allowFrameOrigin(origin: string): void; + allowContentTypeSniffing(): void; + allowAllContentOrigin(): void; + allowAllContentDataUrl(): void; + allowAllContentSameOrigin(): void; + + disallowAll(): void; + disallowInlineStyles(): void; + disallowEval(): void; + disallowInlineScripts(): void; + disallowFont(): void; + disallowObject(): void; + disallowAllContent(): void; + }; +} + +declare module "meteor/browser-policy-common" { + module BrowserPolicy { + var framing: { + disallow(): void; + restrictToOrigin(origin: string): void; + allowAll(): void; + }; + + var content: { + allowEval(): void; + allowInlineStyles(): void; + allowInlineScripts(): void; + allowSameOriginForAll(): void; + allowDataUrlForAll(): void; + allowOriginForAll(origin: string): void; + allowImageOrigin(origin: string): void; + allowMediaOrigin(origin: string): void; + allowFontOrigin(origin: string): void; + allowStyleOrigin(origin: string): void; + allowScriptOrigin(origin: string): void; + allowFrameOrigin(origin: string): void; + allowContentTypeSniffing(): void; + allowAllContentOrigin(): void; + allowAllContentDataUrl(): void; + allowAllContentSameOrigin(): void; + + disallowAll(): void; + disallowInlineStyles(): void; + disallowEval(): void; + disallowInlineScripts(): void; + disallowFont(): void; + disallowObject(): void; + disallowAllContent(): void; + }; + } +} + +declare module Match { + var Any: any; + var String: any; + var Integer: any; + var Boolean: any; + var undefined: any; + var Object: any; + + function Optional(pattern: any): boolean; + + function ObjectIncluding(dico: any): boolean; + + function OneOf(...patterns: any[]): any; + + function Where(condition: any): any; + + function test(value: any, pattern: any): boolean; +} + +declare function check(value: any, pattern: any): void; + +declare module "meteor/check" { + module Match { + var Any: any; + var String: any; + var Integer: any; + var Boolean: any; + var undefined: any; + var Object: any; + + function Optional(pattern: any): boolean; + + function ObjectIncluding(dico: any): boolean; + + function OneOf(...patterns: any[]): any; + + function Where(condition: any): any; + + function test(value: any, pattern: any): boolean; + } + + function check(value: any, pattern: any): void; +} + +declare module DDPRateLimiter { + interface Matcher { + type?: string | ((type: string) => boolean); + name?: string | ((name: string) => boolean); + userId?: string | ((userId: string) => boolean); + connectionId?: string | ((connectionId: string) => boolean); + clientAddress?: string | ((clientAddress: string) => boolean); + } + + function addRule(matcher: Matcher, numRequests: number, timeInterval: number): string; + + function removeRule(ruleId: string): boolean; +} + +declare module "meteor/ddp-rate-limiter" { + module DDPRateLimiter { + interface Matcher { + type?: string | ((type: string) => boolean); + name?: string | ((name: string) => boolean); + userId?: string | ((userId: string) => boolean); + connectionId?: string | ((connectionId: string) => boolean); + clientAddress?: string | ((clientAddress: string) => boolean); + } + + function addRule(matcher: Matcher, numRequests: number, timeInterval: number): string; + + function removeRule(ruleId: string): boolean; + } +} + +declare module DDP { + interface DDPStatic { + subscribe(name: string, ...rest: any[]): Meteor.SubscriptionHandle; + call(method: string, ...parameters: any[]): void; + apply(method: string, ...parameters: any[]): void; + methods(IMeteorMethodsDictionary: any): any; + status(): DDPStatus; + reconnect(): void; + disconnect(): void; + onReconnect(): void; + } + + function _allSubscriptionsReady(): boolean; + + type Status = 'connected' | 'connecting' | 'failed' | 'waiting' | 'offline'; + + interface DDPStatus { + connected: boolean; + status: Status; + retryCount: number; + retryTime?: number; + reason?: string; + } + + function connect(url: string): DDPStatic; +} + +declare module DDPCommon { + interface MethodInvocation { + new(options: {}): MethodInvocation; + + unblock(): void; + + setUserId(userId: number): void; + } +} + +declare module "meteor/ddp" { + module DDP { + interface DDPStatic { + subscribe(name: string, ...rest: any[]): Meteor.SubscriptionHandle; + call(method: string, ...parameters: any[]): void; + apply(method: string, ...parameters: any[]): void; + methods(IMeteorMethodsDictionary: any): any; + status(): DDPStatus; + reconnect(): void; + disconnect(): void; + onReconnect(): void; + } + + function _allSubscriptionsReady(): boolean; + + type Status = 'connected' | 'connecting' | 'failed' | 'waiting' | 'offline'; + + interface DDPStatus { + connected: boolean; + status: Status; + retryCount: number; + retryTime?: number; + reason?: string; + } + + function connect(url: string): DDPStatic; + } + + module DDPCommon { + interface MethodInvocation { + new(options: {}): MethodInvocation; + + unblock(): void; + + setUserId(userId: number): void; + } + } +} + +interface EJSONableCustomType { + clone(): EJSONableCustomType; + equals(other: Object): boolean; + toJSONValue(): JSONable; + typeName(): string; +} interface EJSONable { - [key: string]: number | string | boolean | Object | number[] | string[] | Object[] | Date | Uint8Array | EJSON.CustomType; + [key: string]: number | string | boolean | Object | number[] | string[] | Object[] | Date | Uint8Array | EJSONableCustomType; } interface JSONable { - [key: string]: number | string | boolean | Object | number[] | string[] | Object[]; + [key: string]: number | string | boolean | Object | number[] | string[] | Object[]; } interface EJSON extends EJSONable {} -declare namespace Match { - var Any: any; - var String: any; - var Integer: any; - var Boolean: any; - var undefined: any; - //function null(); // not allowed in TypeScript - var Object: any; - function Optional(pattern: any):boolean; - function ObjectIncluding(dico: any):boolean; - function OneOf(...patterns: any[]): any; - function Where(condition: any): any; +declare module EJSON { + function addType(name: string, factory: (val: JSONable) => EJSONableCustomType): void; + + function clone < T > (val: T): T; + + function equals(a: EJSON, b: EJSON, options?: { + keyOrderSensitive?: boolean; + }): boolean; + + function fromJSONValue(val: JSONable): any; + + function isBinary(x: Object): boolean; + var newBinary: any; + + function parse(str: string): EJSON; + + function stringify(val: EJSON, options?: { + indent?: boolean | number | string; + canonical?: boolean; + }): string; + + function toJSONValue(val: EJSON): JSONable; } -declare namespace Meteor { - interface UserEmail { - address:string; - verified:boolean; - } +declare module "meteor/ejson" { + interface EJSONableCustomType { + clone(): EJSONableCustomType; + equals(other: Object): boolean; + toJSONValue(): JSONable; + typeName(): string; + } + interface EJSONable { + [key: string]: number | string | boolean | Object | number[] | string[] | Object[] | Date | Uint8Array | EJSONableCustomType; + } + interface JSONable { + [key: string]: number | string | boolean | Object | number[] | string[] | Object[]; + } + interface EJSON extends EJSONable {} - interface User { - _id?:string; - username?:string; - emails?:Meteor.UserEmail[]; - createdAt?: number; - profile?: any; - services?: any; - } + module EJSON { + function addType(name: string, factory: (val: JSONable) => EJSONableCustomType): void; - enum StatusEnum { - connected, - connecting, - failed, - waiting, - offline - } + function clone < T > (val: T): T; - interface LiveQueryHandle { - stop(): void; - } + function equals(a: EJSON, b: EJSON, options?: { + keyOrderSensitive?: boolean; + }): boolean; + + function fromJSONValue(val: JSONable): any; + + function isBinary(x: Object): boolean; + var newBinary: any; + + function parse(str: string): EJSON; + + function stringify(val: EJSON, options?: { + indent?: boolean | number | string; + canonical?: boolean; + }): string; + + function toJSONValue(val: EJSON): JSONable; + } } -declare namespace DDP { - interface DDPStatic { - subscribe(name: string, ...rest: any[]): Meteor.SubscriptionHandle; - call(method: string, ...parameters: any[]):void; - apply(method: string, ...parameters: any[]):void; - methods(IMeteorMethodsDictionary: any): any; - status():DDPStatus; - reconnect(): void; - disconnect(): void; - onReconnect(): void; - } - - interface DDPStatus { - connected: boolean; - status: Meteor.StatusEnum; - retryCount: number; - //To turn this into an interval until the next reconnection, use retryTime - (new Date()).getTime() - retryTime?: number; - reason?: string; - } -} - -declare namespace Mongo { - interface Selector { - [key: string]:any; - } - interface Selector extends Object {} - interface Modifier {} - interface SortSpecifier {} - interface FieldSpecifier { - [id: string]: Number; - } -} - -declare namespace HTTP { - - interface HTTPRequest { - content?:string; - data?:any; - query?:string; - params?:{[id:string]:string}; - auth?:string; - headers?:{[id:string]:string}; - timeout?:number; - followRedirects?:boolean; - } - - interface HTTPResponse { - statusCode?:number; - headers?:{[id:string]: string}; - content?:string; - data?:any; - } - - function call(method: string, url: string, options?: HTTP.HTTPRequest, asyncCallback?:Function):HTTP.HTTPResponse; - function del(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; - function get(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; - function post(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; - function put(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; -} - -declare namespace Random { - function id(numberOfChars?: number): string; - function secret(numberOfChars?: number): string; - function fraction():number; - function hexString(numberOfDigits:number):string; // @param numberOfDigits, @returns a random hex string of the given length - function choice(array:any[]):string; // @param array, @return a random element in array - function choice(str:string):string; // @param str, @return a random char in str -} - -declare namespace Accounts { - function loginServicesConfigured(): boolean; - - function onPageLoadLogin(func: Function): void; -} -/** - * These are the client modules and interfaces that can't be automatically generated from the Meteor data.js file - */ - -declare namespace Meteor { - /** Start definitions for Template **/ - export interface Event { - type:string; - target:HTMLElement; - currentTarget:HTMLElement; - which: number; - stopPropagation():void; - stopImmediatePropagation():void; - preventDefault():void; - isPropagationStopped():boolean; - isImmediatePropagationStopped():boolean; - isDefaultPrevented():boolean; - } - - interface EventHandlerFunction extends Function { - (event?:Meteor.Event, templateInstance?: Blaze.TemplateInstance):void; - } - - interface EventMap { - [id:string]:Meteor.EventHandlerFunction; - } - /** End definitions for Template **/ - - interface LoginWithExternalServiceOptions { - requestPermissions?: string[]; - requestOfflineToken?: boolean; - loginUrlParameters?: {[param: string]: any} - loginHint?: string; - loginStyle?: string; - redirectUrl?: "popup" | "redirect"; - profile?: any; - email?: string; - } - - function loginWithMeteorDeveloperAccount(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - function loginWithFacebook(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - function loginWithGithub(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - function loginWithGoogle(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - function loginWithMeetup(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - function loginWithTwitter(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - function loginWithWeibo(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - function _sleepForMs(milliseconds: number): void; - - interface SubscriptionHandle { - stop(): void; - ready(): boolean; - } -} - -declare namespace Blaze { - interface View { - name: string; - parentView: Blaze.View; - isCreated: boolean; - isRendered: boolean; - isDestroyed: boolean; - renderCount: number; - autorun(runFunc: Function): void; - onViewCreated(func: Function): void; - onViewReady(func: Function): void; - onViewDestroyed(func: Function): void; - firstNode(): Node; - lastNode(): Node; - template: Blaze.Template; - templateInstance(): any; - } - interface Template { - viewName: string; - renderFunction: Function; - constructView(): Blaze.View; - } -} - -declare namespace BrowserPolicy { - - interface framing { - disallow():void; - restrictToOrigin(origin:string):void; - allowAll():void; - } - interface content { - allowEval():void; - allowInlineStyles():void; - allowInlineScripts():void; - allowSameOriginForAll():void; - allowDataUrlForAll():void; - allowOriginForAll(origin:string):void; - allowImageOrigin(origin:string):void; - allowFrameOrigin(origin:string):void; - allowContentTypeSniffing():void; - allowAllContentOrigin():void; - allowAllContentDataUrl():void; - allowAllContentSameOrigin():void; - - disallowAll():void; - disallowInlineStyles():void; - disallowEval():void; - disallowInlineScripts():void; - disallowFont():void; - disallowObject():void; - disallowAllContent():void; - //TODO: add the basic content types - // allowOrigin(origin) - // allowDataUrl() - // allowSameOrigin() - // disallow() - } -} - - -/** - * These are the server modules and interfaces that can't be automatically generated from the Meteor data.js file - */ - -declare namespace Meteor { - interface EmailFields { - from?: () => string; - subject?: (user: Meteor.User) => string; - text?: (user: Meteor.User, url: string) => string; - html?: (user: Meteor.User, url: string) => string; - } - - interface EmailTemplates { - from?: string; - siteName?: string; - headers?: { [id: string]: string }; // TODO: should define IHeaders interface - resetPassword?: Meteor.EmailFields; - enrollAccount?: Meteor.EmailFields; - verifyEmail?: Meteor.EmailFields; - } - - interface Connection { - id: string; - close: Function; - onClose: Function; - clientAddress: string; - httpHeaders: Object; - } - - interface IValidateLoginAttemptCbOpts { - type: string; - allowed: boolean; - error: Error; - user: Meteor.User; - connection: Meteor.Connection; - methodName: string; - methodArguments: any[]; - } -} - -declare namespace Mongo { - interface AllowDenyOptions { - insert?: (userId: string, doc: any) => boolean; - update?: (userId: string, doc: any, fieldNames: string[], modifier: any) => boolean; - remove?: (userId: string, doc: any) => boolean; - fetch?: string[]; - transform?: Function; - } -} - -declare namespace Accounts { - interface IValidateLoginAttemptCbOpts { - type?: string; - allowed?: boolean; - error?: Meteor.Error; - user?: Meteor.User; - connection?: Meteor.Connection; - methodName?: string; - methodArguments?: any[]; - } +declare module Email { + function send(options: { + from?: string; + to?: string | string[]; + cc?: string | string[]; + bcc?: string | string[]; + replyTo?: string | string[]; + subject?: string; + text?: string; + html?: string; + headers?: Object; + attachments?: Object[]; + mailComposer?: MailComposer; + }): void; } interface MailComposerOptions { - escapeSMTP: boolean; - encoding: string; - charset: string; - keepBcc: boolean; - forceEmbeddedImages: boolean; + escapeSMTP: boolean; + encoding: string; + charset: string; + keepBcc: boolean; + forceEmbeddedImages: boolean; } declare var MailComposer: MailComposerStatic; interface MailComposerStatic { - new(options: MailComposerOptions): MailComposer; + new(options: MailComposerOptions): MailComposer; } interface MailComposer { - addHeader(name: string, value: string): void; - setMessageOption(from: string, to: string, body: string, html: string): void; - streamMessage(): void; - pipe(stream: any /** fs.WriteStream **/): void; -} -/** - * These are the modules and interfaces for packages that can't be automatically generated from the Meteor data.js file - */ - -interface ILengthAble { - length: number; + addHeader(name: string, value: string): void; + setMessageOption(from: string, to: string, body: string, html: string): void; + streamMessage(): void; + pipe(stream: any /** fs.WriteStream **/ ): void; } -interface ITinytestAssertions { - ok(doc: Object): void; - expect_fail(): void; - fail(doc: Object): void; - runId(): string; - equal(actual: T, expected: T, message?: string, not?: boolean): void; - notEqual(actual: T, expected: T, message?: string): void; - instanceOf(obj : Object, klass: Function, message?: string): void; - notInstanceOf(obj : Object, klass: Function, message?: string): void; - matches(actual : any, regexp: RegExp, message?: string): void; - notMatches(actual : any, regexp: RegExp, message?: string): void; - throws(f: Function, expected?: string|RegExp): void; - isTrue(v: boolean, msg?: string): void; - isFalse(v: boolean, msg?: string): void; - isNull(v: any, msg?: string): void; - isNotNull(v: any, msg?: string): void; - isUndefined(v: any, msg?: string): void; - isNotUndefined(v: any, msg?: string): void; - isNan(v: any, msg?: string): void; - isNotNan(v: any, msg?: string): void; - include(s: Array|Object|string, value: any, msg?: string, not?: boolean): void; +declare module "meteor/email" { + module Email { + function send(options: { + from?: string; + to?: string | string[]; + cc?: string | string[]; + bcc?: string | string[]; + replyTo?: string | string[]; + subject?: string; + text?: string; + html?: string; + headers?: Object; + attachments?: Object[]; + mailComposer?: MailComposer; + }): void; + } - notInclude(s: Array|Object|string, value: any, msg?: string, not?: boolean): void; - length(obj: ILengthAble, expected_length: number, msg?: string): void; - _stringEqual(actual: string, expected: string, msg?: string): void; + interface MailComposerOptions { + escapeSMTP: boolean; + encoding: string; + charset: string; + keepBcc: boolean; + forceEmbeddedImages: boolean; + } + + var MailComposer: MailComposerStatic; + interface MailComposerStatic { + new(options: MailComposerOptions): MailComposer; + } + interface MailComposer { + addHeader(name: string, value: string): void; + setMessageOption(from: string, to: string, body: string, html: string): void; + streamMessage(): void; + pipe(stream: any /** fs.WriteStream **/ ): void; + } } -declare namespace Tinytest { - function add(description : string , func : (test : ITinytestAssertions) => void) : void; - function addAsync(description : string , func : (test : ITinytestAssertions) => void) : void; +declare module HTTP { + interface HTTPRequest { + content?: string; + data?: any; + query?: string; + params?: { + [id: string]: string + }; + auth?: string; + headers?: { + [id: string]: string + }; + timeout?: number; + followRedirects?: boolean; + } + + interface HTTPResponse { + statusCode?: number; + headers?: { + [id: string]: string + }; + content?: string; + data?: any; + } + + function call(method: string, url: string, options?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function del(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function get(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function post(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function put(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function call(method: string, url: string, options?: { + content?: string; + data?: Object; + query?: string; + params?: Object; + auth?: string; + headers?: Object; + timeout?: number; + followRedirects?: boolean; + npmRequestOptions?: Object; + beforeSend?: Function; + }, asyncCallback?: Function): HTTP.HTTPResponse; } -// Kept in for backwards compatibility -declare namespace Meteor { - interface Tinytest { - add(description : string , func : (test : ITinytestAssertions) => void) : void; - addAsync(description : string , func : (test : ITinytestAssertions) => void) : void; - } +declare module "meteor/http" { + module HTTP { + interface HTTPRequest { + content?: string; + data?: any; + query?: string; + params?: { + [id: string]: string + }; + auth?: string; + headers?: { + [id: string]: string + }; + timeout?: number; + followRedirects?: boolean; + } + + interface HTTPResponse { + statusCode?: number; + headers?: { + [id: string]: string + }; + content?: string; + data?: any; + } + + function call(method: string, url: string, options?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function del(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function get(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function post(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function put(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function call(method: string, url: string, options?: { + content?: string; + data?: Object; + query?: string; + params?: Object; + auth?: string; + headers?: Object; + timeout?: number; + followRedirects?: boolean; + npmRequestOptions?: Object; + beforeSend?: Function; + }, asyncCallback?: Function): HTTP.HTTPResponse; + } } -declare namespace Accounts { - function addEmail(userId: string, newEmail: string, verified?: boolean): void; - function changePassword(oldPassword: string, newPassword: string, callback?: Function): void; - function createUser(options: { - username?: string; - email?: string; - password?: string; - profile?: Object; - }, callback?: Function): string; - var emailTemplates: Meteor.EmailTemplates; - function findUserByEmail(email: string): Object; - function findUserByUsername(username: string): Object; - function forgotPassword(options: { - email?: string; - }, callback?: Function): void; - function onEmailVerificationLink(callback: Function): void; - function onEnrollmentLink(callback: Function): void; - function onResetPasswordLink(callback: Function): void; - function removeEmail(userId: string, email: string): void; - function resetPassword(token: string, newPassword: string, callback?: Function): void; - function sendEnrollmentEmail(userId: string, email?: string): void; - function sendResetPasswordEmail(userId: string, email?: string): void; - function sendVerificationEmail(userId: string, email?: string): void; - function setPassword(userId: string, newPassword: string, options?: { - logout?: Object; - }): void; - function setUsername(userId: string, newUsername: string): void; - var ui: { - config(options: { - requestPermissions?: Object; - requestOfflineToken?: Object; - forceApprovalPrompt?: Object; - passwordSignupFields?: string; - }): void; - }; - function verifyEmail(token: string, callback?: Function): void; - function config(options: { - sendVerificationEmail?: boolean; - forbidClientAccountCreation?: boolean; - restrictCreationByEmailDomain?: string | Function; - loginExpirationInDays?: number; - oauthSecretKey?: string; - }): void; - function onLogin(func: Function): { stop: () => void }; - function onLoginFailure(func: Function): { stop: () => void }; - function user(): Meteor.User; - function userId(): string; - function loggingIn(): boolean; - function logout(callback?: Function): void; - function logoutOtherClients(callback?: Function): void; - function onCreateUser(func: Function): void; - function validateLoginAttempt(cb: (params: Accounts.IValidateLoginAttemptCbOpts) => boolean): { stop: () => void }; - function validateNewUser(func: Function): boolean; - function _hashPassword(password: string): { digest: string; algorithm: string; }; +declare module Meteor { + /** Global props **/ + var isClient: boolean; + var isCordova: boolean; + var isServer: boolean; + var isProduction: boolean; + var release: string; + /** Global props **/ + + /** Settings **/ + interface Settings { + public: { + [id: string]: any + }, [id: string]: any + } + var settings: Settings; + /** Settings **/ + + /** User **/ + interface UserEmail { + address: string; + verified: boolean; + } + interface User { + _id?: string; + username?: string; + emails?: UserEmail[]; + createdAt?: number; + profile?: any; + services?: any; + } + + function user(): User; + + function userId(): string; + var users: Mongo.Collection < User > ; + /** User **/ + + /** Error **/ + var Error: ErrorStatic; + interface ErrorStatic { + new(error: string | number, reason?: string, details?: string): Error; + } + interface Error { + error: string | number; + reason?: string; + details?: string; + } + /** Error **/ + + /** Method **/ + function methods(methods: Object): void; + + function call(name: string, ...args: any[]): any; + + function apply(name: string, args: EJSONable[], options?: { + wait?: boolean; + onResultReceived?: Function; + }, asyncCallback?: Function): any; + /** Method **/ + + /** Url **/ + function absoluteUrl(path?: string, options?: { + secure?: boolean; + replaceLocalhost?: boolean; + rootUrl?: string; + }): string; + /** Url **/ + + /** Timeout **/ + function setInterval(func: Function, delay: number): number; + + function setTimeout(func: Function, delay: number): number; + + function clearInterval(id: number): void; + + function clearTimeout(id: number): void; + + function defer(func: Function): void; + /** Timeout **/ + + /** utils **/ + function startup(func: Function): void; + + function wrapAsync(func: Function, context?: Object): any; + + function bindEnvironment(func: Function): any; + /** utils **/ + + /** Pub/Sub **/ + interface SubscriptionHandle { + stop(): void; + ready(): boolean; + } + interface LiveQueryHandle { + stop(): void; + } + /** Pub/Sub **/ } -declare namespace App { - function accessRule(pattern: string, options?: { - type?: string; - launchExternal?: boolean; - }): void; - function configurePlugin(id: string, config: Object): void; - function icons(icons: Object): void; - function info(options: { - id?: string; - version?: string; - name?: string; - description?: string; - author?: string; - email?: string; - website?: string; - }): void; - function launchScreens(launchScreens: Object): void; - function setPreference(name: string, value: string, platform?: string): void; +declare module "meteor/meteor" { + module Meteor { + /** Global props **/ + var isClient: boolean; + var isCordova: boolean; + var isServer: boolean; + var isProduction: boolean; + var release: string; + /** Global props **/ + + /** Settings **/ + interface Settings { + public: { + [id: string]: any + }, [id: string]: any + } + var settings: Settings; + /** Settings **/ + + /** User **/ + interface UserEmail { + address: string; + verified: boolean; + } + interface User { + _id?: string; + username?: string; + emails?: UserEmail[]; + createdAt?: number; + profile?: any; + services?: any; + } + + function user(): User; + + function userId(): string; + var users: Mongo.Collection < User > ; + /** User **/ + + /** Error **/ + var Error: ErrorStatic; + interface ErrorStatic { + new(error: string | number, reason?: string, details?: string): Error; + } + interface Error { + error: string | number; + reason?: string; + details?: string; + } + /** Error **/ + + /** Method **/ + function methods(methods: Object): void; + + function call(name: string, ...args: any[]): any; + + function apply(name: string, args: EJSONable[], options?: { + wait?: boolean; + onResultReceived?: Function; + }, asyncCallback?: Function): any; + /** Method **/ + + /** Url **/ + function absoluteUrl(path?: string, options?: { + secure?: boolean; + replaceLocalhost?: boolean; + rootUrl?: string; + }): string; + /** Url **/ + + /** Timeout **/ + function setInterval(func: Function, delay: number): number; + + function setTimeout(func: Function, delay: number): number; + + function clearInterval(id: number): void; + + function clearTimeout(id: number): void; + + function defer(func: Function): void; + /** Timeout **/ + + /** utils **/ + function startup(func: Function): void; + + function wrapAsync(func: Function, context?: Object): any; + + function bindEnvironment(func: Function): any; + /** utils **/ + + /** Pub/Sub **/ + interface SubscriptionHandle { + stop(): void; + ready(): boolean; + } + interface LiveQueryHandle { + stop(): void; + } + /** Pub/Sub **/ + } } -declare namespace Assets { - function getBinary(assetPath: string, asyncCallback?: Function): EJSON; - function getText(assetPath: string, asyncCallback?: Function): string; +declare module Meteor { + /** Login **/ + interface LoginWithExternalServiceOptions { + requestPermissions?: string[]; + requestOfflineToken?: Boolean; + forceApprovalPrompt?: Boolean; + loginUrlParameters?: Object; + redirectUrl?: string; + loginHint?: string; + loginStyle?: string; + } + + function loginWithMeteorDeveloperAccount(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithFacebook(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithGithub(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithGoogle(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithMeetup(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithTwitter(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithWeibo(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loggingIn(): boolean; + + function loginWith < ExternalService > (options?: { + requestPermissions?: string[]; + requestOfflineToken?: boolean; + loginUrlParameters?: Object; + userEmail?: string; + loginStyle?: string; + redirectUrl?: string; + }, callback?: Function): void; + + function loginWithPassword(user: Object | string, password: string, callback?: Function): void; + + function loginWithToken(token: string, callback?: Function): void; + + function logout(callback?: Function): void; + + function logoutOtherClients(callback?: Function): void; + /** Login **/ + + /** Event **/ + interface Event { + type: string; + target: HTMLElement; + currentTarget: HTMLElement; + which: number; + stopPropagation(): void; + stopImmediatePropagation(): void; + preventDefault(): void; + isPropagationStopped(): boolean; + isImmediatePropagationStopped(): boolean; + isDefaultPrevented(): boolean; + } + interface EventHandlerFunction extends Function { + (event?: Meteor.Event, templateInstance?: Blaze.TemplateInstance): void; + } + interface EventMap { + [id: string]: Meteor.EventHandlerFunction; + } + /** Event **/ + + /** Connection **/ + function reconnect(): void; + + function disconnect(): void; + /** Connection **/ + + /** Status **/ + function status(): DDP.DDPStatus; + /** Status **/ + + /** Pub/Sub **/ + function subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; + /** Pub/Sub **/ } -declare namespace Blaze { - function Each(argFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View; - function If(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View; - function Let(bindings: Function, contentFunc: Function): Blaze.View; - var Template: TemplateStatic; - interface TemplateStatic { - new(viewName?: string, renderFunction?: Function): Template; - // It should be [templateName: string]: TemplateInstance but this is not possible -- user will need to cast to TemplateInstance - [templateName: string]: any | Template; // added "any" to make it work - head: Template; - find(selector:string):Blaze.Template; - findAll(selector:string):Blaze.Template[]; - $:any; - } - interface Template { - } +declare module "meteor/meteor" { + module Meteor { + /** Login **/ + interface LoginWithExternalServiceOptions { + requestPermissions?: string[]; + requestOfflineToken?: Boolean; + forceApprovalPrompt?: Boolean; + loginUrlParameters?: Object; + redirectUrl?: string; + loginHint?: string; + loginStyle?: string; + } - var TemplateInstance: TemplateInstanceStatic; - interface TemplateInstanceStatic { - new(view: Blaze.View): TemplateInstance; - } - interface TemplateInstance { - $(selector: string): any; - autorun(runFunc: Function): Object; - data: Object; - find(selector?: string): Blaze.TemplateInstance; - findAll(selector: string): Blaze.TemplateInstance[]; - firstNode: Object; - lastNode: Object; - subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; - subscriptionsReady(): boolean; - view: Object; - } + function loginWithMeteorDeveloperAccount(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - function Unless(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): Blaze.View; - var View: ViewStatic; - interface ViewStatic { - new(name?: string, renderFunction?: Function): View; - } - interface View { - } + function loginWithFacebook(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - function With(data: Object | Function, contentFunc: Function): Blaze.View; - var currentView: Blaze.View; - function getData(elementOrView?: HTMLElement | Blaze.View): Object; - function getView(element?: HTMLElement): Blaze.View; - function isTemplate(value: any): boolean; - function remove(renderedView: Blaze.View): void; - function render(templateOrView: Template | Blaze.View, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; - function renderWithData(templateOrView: Template | Blaze.View, data: Object | Function, parentNode: Node, nextNode?: Node, parentView?: Blaze.View): Blaze.View; - function toHTML(templateOrView: Template | Blaze.View): string; - function toHTMLWithData(templateOrView: Template | Blaze.View, data: Object | Function): string; + function loginWithGithub(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithGoogle(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithMeetup(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithTwitter(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithWeibo(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loggingIn(): boolean; + + function loginWith < ExternalService > (options?: { + requestPermissions?: string[]; + requestOfflineToken?: boolean; + loginUrlParameters?: Object; + userEmail?: string; + loginStyle?: string; + redirectUrl?: string; + }, callback?: Function): void; + + function loginWithPassword(user: Object | string, password: string, callback?: Function): void; + + function loginWithToken(token: string, callback?: Function): void; + + function logout(callback?: Function): void; + + function logoutOtherClients(callback?: Function): void; + /** Login **/ + + /** Event **/ + interface Event { + type: string; + target: HTMLElement; + currentTarget: HTMLElement; + which: number; + stopPropagation(): void; + stopImmediatePropagation(): void; + preventDefault(): void; + isPropagationStopped(): boolean; + isImmediatePropagationStopped(): boolean; + isDefaultPrevented(): boolean; + } + interface EventHandlerFunction extends Function { + (event?: Meteor.Event, templateInstance?: Blaze.TemplateInstance): void; + } + interface EventMap { + [id: string]: Meteor.EventHandlerFunction; + } + /** Event **/ + + /** Connection **/ + function reconnect(): void; + + function disconnect(): void; + /** Connection **/ + + /** Status **/ + function status(): DDP.DDPStatus; + /** Status **/ + + /** Pub/Sub **/ + function subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; + /** Pub/Sub **/ + } } -declare namespace Cordova { - function depends(dependencies:{[id:string]:string}): void; +declare module Meteor { + /** Connection **/ + interface Connection { + id: string; + close: Function; + onClose: Function; + clientAddress: string; + httpHeaders: Object; + } + + function onConnection(callback: Function): void; + /** Connection **/ + + function publish(name: string, func: Function): void; + + function _debug(...args: any[]): void; } -declare namespace DDP { - function connect(url: string): DDP.DDPStatic; +interface Subscription { + added(collection: string, id: string, fields: Object): void; + changed(collection: string, id: string, fields: Object): void; + connection: Meteor.Connection; + error(error: Error): void; + onStop(func: Function): void; + ready(): void; + removed(collection: string, id: string): void; + stop(): void; + userId: string; } -declare namespace DDPCommon { - function MethodInvocation(options: { - }): any; +declare module "meteor/meteor" { + module Meteor { + /** Connection **/ + interface Connection { + id: string; + close: Function; + onClose: Function; + clientAddress: string; + httpHeaders: Object; + } + + function onConnection(callback: Function): void; + /** Connection **/ + + function publish(name: string, func: Function): void; + + function _debug(...args: any[]): void; + } + + interface Subscription { + added(collection: string, id: string, fields: Object): void; + changed(collection: string, id: string, fields: Object): void; + connection: Meteor.Connection; + error(error: Error): void; + onStop(func: Function): void; + ready(): void; + removed(collection: string, id: string): void; + stop(): void; + userId: string; + } } -declare namespace EJSON { - var CustomType: CustomTypeStatic; - interface CustomTypeStatic { - new(): CustomType; - } - interface CustomType { - clone(): EJSON.CustomType; - equals(other: Object): boolean; - toJSONValue(): JSONable; - typeName(): string; - } +declare module Mongo { + interface Selector { + [key: string]: any; + } + interface Selector extends Object {} + interface Modifier {} + interface SortSpecifier {} + interface FieldSpecifier { + [id: string]: Number; + } - function addType(name: string, factory: (val: JSONable) => EJSON.CustomType): void; - function clone(val:T): T; - function equals(a: EJSON, b: EJSON, options?: { - keyOrderSensitive?: boolean; - }): boolean; - function fromJSONValue(val: JSONable): any; - function isBinary(x: Object): boolean; - var newBinary: any; - function parse(str: string): EJSON; - function stringify(val: EJSON, options?: { - indent?: boolean | number | string; - canonical?: boolean; - }): string; - function toJSONValue(val: EJSON): JSONable; + var Collection: CollectionStatic; + interface CollectionStatic { + new < T > (name: string, options?: { + connection?: Object; + idGeneration?: string; + transform?: Function; + }): Collection < T > ; + } + interface Collection < T > { + allow(options: { + insert?: (userId: string, doc: T) => boolean; + update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: T) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + deny(options: { + insert?: (userId: string, doc: T) => boolean; + update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: T) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + find(selector?: Selector | ObjectID | string, options?: { + sort?: SortSpecifier; + skip?: number; + limit?: number; + fields?: FieldSpecifier; + reactive?: boolean; + transform?: Function; + }): Cursor < T > ; + findOne(selector?: Selector | ObjectID | string, options?: { + sort?: SortSpecifier; + skip?: number; + fields?: FieldSpecifier; + reactive?: boolean; + transform?: Function; + }): T; + insert(doc: T, callback?: Function): string; + rawCollection(): any; + rawDatabase(): any; + remove(selector: Selector | ObjectID | string, callback?: Function): number; + update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + multi?: boolean; + upsert?: boolean; + }, callback?: Function): number; + upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + multi?: boolean; + }, callback?: Function): { + numberAffected?: number;insertedId?: string; + }; + _ensureIndex(keys: { + [key: string]: number | string + } | string, options?: { + [key: string]: any + }): void; + _dropIndex(keys: { + [key: string]: number | string + } | string): void; + } + + var Cursor: CursorStatic; + interface CursorStatic { + new < T > (): Cursor < T > ; + } + interface ObserveCallbacks { + added?(document: Object) : void; + addedAt?(document: Object, atIndex: number, before: Object) : void; + changed?(newDocument: Object, oldDocument: Object) : void; + changedAt?(newDocument: Object, oldDocument: Object, indexAt: number) : void; + removed?(oldDocument: Object) : void; + removedAt?(oldDocument: Object, atIndex: number) : void; + movedTo?(document: Object, fromIndex: number, toIndex: number, before: Object) : void; + } + interface ObserveChangesCallbacks { + added?(id: string, fields: Object) : void; + addedBefore?(id: string, fields: Object, before: Object) : void; + changed?(id: string, fields: Object) : void; + movedBefore?(id: string, before: Object) : void; + removed?(id: string) : void; + } + interface Cursor < T > { + count(applySkipLimit?: boolean): number; + fetch(): Array < T > ; + forEach(callback: < T > (doc: T, index: number, cursor: Cursor < T > ) => void, thisArg?: any): void; + map < U > (callback: (doc: T, index: number, cursor: Cursor < T > ) => U, thisArg?: any): Array < U > ; + observe(callbacks: ObserveCallbacks): Meteor.LiveQueryHandle; + observeChanges(callbacks: ObserveChangesCallbacks): Meteor.LiveQueryHandle; + } + + var ObjectID: ObjectIDStatic; + interface ObjectIDStatic { + new(hexString?: string): ObjectID; + } + interface ObjectID {} } -declare namespace Match { - function test(value: any, pattern: any): boolean; +declare module "meteor/mongo" { + module Mongo { + interface Selector { + [key: string]: any; + } + interface Selector extends Object {} + interface Modifier {} + interface SortSpecifier {} + interface FieldSpecifier { + [id: string]: Number; + } + + var Collection: CollectionStatic; + interface CollectionStatic { + new < T > (name: string, options?: { + connection?: Object; + idGeneration?: string; + transform?: Function; + }): Collection < T > ; + } + interface Collection < T > { + allow(options: { + insert?: (userId: string, doc: T) => boolean; + update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: T) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + deny(options: { + insert?: (userId: string, doc: T) => boolean; + update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: T) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + find(selector?: Selector | ObjectID | string, options?: { + sort?: SortSpecifier; + skip?: number; + limit?: number; + fields?: FieldSpecifier; + reactive?: boolean; + transform?: Function; + }): Cursor < T > ; + findOne(selector?: Selector | ObjectID | string, options?: { + sort?: SortSpecifier; + skip?: number; + fields?: FieldSpecifier; + reactive?: boolean; + transform?: Function; + }): T; + insert(doc: T, callback?: Function): string; + rawCollection(): any; + rawDatabase(): any; + remove(selector: Selector | ObjectID | string, callback?: Function): number; + update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + multi?: boolean; + upsert?: boolean; + }, callback?: Function): number; + upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + multi?: boolean; + }, callback?: Function): { + numberAffected?: number;insertedId?: string; + }; + _ensureIndex(keys: { + [key: string]: number | string + } | string, options?: { + [key: string]: any + }): void; + _dropIndex(keys: { + [key: string]: number | string + } | string): void; + } + + var Cursor: CursorStatic; + interface CursorStatic { + new < T > (): Cursor < T > ; + } + interface ObserveCallbacks { + added?(document: Object) : void; + addedAt?(document: Object, atIndex: number, before: Object) : void; + changed?(newDocument: Object, oldDocument: Object) : void; + changedAt?(newDocument: Object, oldDocument: Object, indexAt: number) : void; + removed?(oldDocument: Object) : void; + removedAt?(oldDocument: Object, atIndex: number) : void; + movedTo?(document: Object, fromIndex: number, toIndex: number, before: Object) : void; + } + interface ObserveChangesCallbacks { + added?(id: string, fields: Object) : void; + addedBefore?(id: string, fields: Object, before: Object) : void; + changed?(id: string, fields: Object) : void; + movedBefore?(id: string, before: Object) : void; + removed?(id: string) : void; + } + interface Cursor < T > { + count(applySkipLimit?: boolean): number; + fetch(): Array < T > ; + forEach(callback: < T > (doc: T, index: number, cursor: Cursor < T > ) => void, thisArg?: any): void; + map < U > (callback: (doc: T, index: number, cursor: Cursor < T > ) => U, thisArg?: any): Array < U > ; + observe(callbacks: ObserveCallbacks): Meteor.LiveQueryHandle; + observeChanges(callbacks: ObserveChangesCallbacks): Meteor.LiveQueryHandle; + } + + var ObjectID: ObjectIDStatic; + interface ObjectIDStatic { + new(hexString?: string): ObjectID; + } + interface ObjectID {} + } } -declare namespace Meteor { - var Error: ErrorStatic; - interface ErrorStatic { - new(error: string | number, reason?: string, details?: string): Error; - } - interface Error { - error: string | number; - reason?: string; - details?: string; - } - function absoluteUrl(path?: string, options?: { - secure?: boolean; - replaceLocalhost?: boolean; - rootUrl?: string; - }): string; - function apply(name: string, args: EJSONable[], options?: { - wait?: boolean; - onResultReceived?: Function; - }, asyncCallback?: Function): any; - function call(name: string, ...args: any[]): any; - function clearInterval(id: number): void; - function clearTimeout(id: number): void; - function disconnect(): void; - var isClient: boolean; - var isCordova: boolean; - var isDevelopment: boolean; - var isProduction: boolean; - var isServer: boolean; - var isTest: boolean; - function loggingIn(): boolean; - function loginWith(options?: { - requestPermissions?: string[]; - requestOfflineToken?: boolean; - loginUrlParameters?: Object; - loginHint?: string; - loginStyle?: string; - redirectUrl?: string; - }, callback?: Function): void; - function loginWithPassword(user: Object | string, password: string, callback?: Function): void; - function logout(callback?: Function): void; - function logoutOtherClients(callback?: Function): void; - function methods(methods: Object): void; - function onConnection(callback: Function): void; - function publish(name: string, func: Function): void; - function reconnect(): void; - var release: string; - function setInterval(func: Function, delay: number): number; - 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(): DDP.DDPStatus; - function subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; - function user(): Meteor.User; - function userId(): string; - var users: Mongo.Collection; - function wrapAsync(func: Function, context?: Object): any; +declare module Mongo { + interface AllowDenyOptions { + insert?: (userId: string, doc: any) => boolean; + update?: (userId: string, doc: any, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: any) => boolean; + fetch?: string[]; + transform?: Function; + } } -declare namespace Mongo { - var Collection: CollectionStatic; - interface CollectionStatic { - new(name: string, options?: { - connection?: Object; - idGeneration?: string; - transform?: Function; - }): Collection; - } - interface Collection { - allow(options: { - insert?: (userId: string, doc: T) => boolean; - update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; - remove?: (userId: string, doc: T) => boolean; - fetch?: string[]; - transform?: Function; - }): boolean; - deny(options: { - insert?: (userId: string, doc: T) => boolean; - update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; - remove?: (userId: string, doc: T) => boolean; - fetch?: string[]; - transform?: Function; - }): boolean; - find(selector?: Mongo.Selector | Mongo.ObjectID | string, options?: { - sort?: Mongo.SortSpecifier; - skip?: number; - limit?: number; - fields?: Mongo.FieldSpecifier; - reactive?: boolean; - transform?: Function; - disableOplog?: boolean; - pollingIntervalMs?: number; - pollingThrottleMs?: number; - }): Mongo.Cursor; - findOne(selector?: Mongo.Selector | Mongo.ObjectID | string, options?: { - sort?: Mongo.SortSpecifier; - skip?: number; - fields?: Mongo.FieldSpecifier; - reactive?: boolean; - transform?: Function; - }): T; - insert(doc: T, callback?: Function): string; - rawCollection(): any; - rawDatabase(): any; - remove(selector: Mongo.Selector | Mongo.ObjectID | string, callback?: Function): number; - update(selector: Mongo.Selector | Mongo.ObjectID | string, modifier: Mongo.Modifier, options?: { - multi?: boolean; - upsert?: boolean; - }, callback?: Function): number; - upsert(selector: Mongo.Selector | Mongo.ObjectID | string, modifier: Mongo.Modifier, options?: { - multi?: boolean; - }, callback?: Function): {numberAffected?: number; insertedId?: string;}; - _ensureIndex(indexName: string, options?: {[key: string]: any}): void; - } - - var Cursor: CursorStatic; - interface CursorStatic { - new(): Cursor; - } - interface Cursor { - count(): number; - fetch(): Array; - forEach(callback: (doc: T, index: number, cursor: Mongo.Cursor) => void, thisArg?: any): void; - map(callback: (doc: T, index: number, cursor: Mongo.Cursor) => U, thisArg?: any): Array; - observe(callbacks: Object): Meteor.LiveQueryHandle; - observeChanges(callbacks: Object): Meteor.LiveQueryHandle; - } - - var ObjectID: ObjectIDStatic; - interface ObjectIDStatic { - new(hexString?: string): ObjectID; - } - interface ObjectID { - valueOf(): string; - getTimestamp(): Date; - } - +declare module "meteor/mongo" { + module Mongo { + interface AllowDenyOptions { + insert?: (userId: string, doc: any) => boolean; + update?: (userId: string, doc: any, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: any) => boolean; + fetch?: string[]; + transform?: Function; + } + } } -declare namespace Npm { - function depends(dependencies:{[id:string]:string}): void; - function require(name: string): any; +declare module Random { + function id(numberOfChars?: number): string; + + function secret(numberOfChars?: number): string; + + function fraction(): number; + // @param numberOfDigits, @returns a random hex string of the given length + function hexString(numberOfDigits: number): string; + // @param array, @return a random element in array + function choice(array: any[]): string; + // @param str, @return a random char in str + function choice(str: string): string; } -declare namespace Package { - function describe(options: { - summary?: string; - version?: string; - name?: string; - git?: string; - documentation?: string; - debugOnly?: boolean; - prodOnly?: boolean; - testOnly?: boolean; - }): void; - function onTest(func: Function): void; - function onUse(func: Function): void; - function registerBuildPlugin(options?: { - name?: string; - use?: string | string[]; - sources?: string[]; - npmDependencies?: Object; - }): void; -} +declare module "meteor/random" { + module Random { + function id(numberOfChars?: number): string; -declare namespace Tracker { - function Computation(): void; - interface Computation { - firstRun: boolean; - invalidate(): void; - invalidated: boolean; - onInvalidate(callback: Function): void; - onStop(callback: Function): void; - stop(): void; - stopped: boolean; - } + function secret(numberOfChars?: number): string; - var Dependency: DependencyStatic; - interface DependencyStatic { - new(): Dependency; - } - interface Dependency { - changed(): void; - depend(fromComputation?: Tracker.Computation): boolean; - hasDependents(): boolean; - } - - var active: boolean; - function afterFlush(callback: Function): void; - function autorun(runFunc: (computation: Tracker.Computation) => void, options?: { - onError?: Function; - }): Tracker.Computation; - var currentComputation: Tracker.Computation; - function flush(): void; - function nonreactive(func: Function): void; - function onInvalidate(callback: Function): void; -} - -declare namespace Session { - function equals(key: string, value: string | number | boolean | any /** Null **/ | any /** Undefined **/): boolean; - function get(key: string): any; - function set(key: string, value: EJSONable | any /** Undefined **/): void; - function setDefault(key: string, value: EJSONable | any /** Undefined **/): void; -} - -declare namespace HTTP { - function call(method: string, url: string, options?: { - content?: string; - data?: Object; - query?: string; - params?: Object; - auth?: string; - headers?: Object; - timeout?: number; - followRedirects?: boolean; - npmRequestOptions?: Object; - beforeSend?: Function; - }, asyncCallback?: Function): HTTP.HTTPResponse; - function del(url: string, callOptions?: Object, asyncCallback?: Function): HTTP.HTTPResponse; - function get(url: string, callOptions?: Object, asyncCallback?: Function): HTTP.HTTPResponse; - function patch(url: string, callOptions?: Object, asyncCallback?: Function): HTTP.HTTPResponse; - function post(url: string, callOptions?: Object, asyncCallback?: Function): HTTP.HTTPResponse; - function put(url: string, callOptions?: Object, asyncCallback?: Function): HTTP.HTTPResponse; -} - -declare namespace Email { - function send(options: { - from?: string; - to?: string | string[]; - cc?: string | string[]; - bcc?: string | string[]; - replyTo?: string | string[]; - subject?: string; - text?: string; - html?: string; - headers?: Object; - attachments?: Object[]; - mailComposer?: MailComposer; - }): void; -} - -declare var CompileStep: CompileStepStatic; -interface CompileStepStatic { - new(): CompileStep; -} -interface CompileStep { - addAsset(options: { - }, path: string, data: any /** Buffer **/ | string): any; - addHtml(options: { - section?: string; - data?: string; - }): any; - addJavaScript(options: { - path?: string; - data?: string; - sourcePath?: string; - }): any; - addStylesheet(options: { - }, path: string, data: string, sourceMap: string): any; - arch: any; - declaredExports: any; - error(options: { - }, message: string, sourcePath?: string, line?: number, func?: string): any; - fileOptions: any; - fullInputPath: any; - inputPath: any; - inputSize: any; - packageName: any; - pathForSourceMap: any; - read(n?: number): any; - rootOutputPath: any; -} - -declare var PackageAPI: PackageAPIStatic; -interface PackageAPIStatic { - new(): PackageAPI; -} -interface PackageAPI { - addAssets(filenames: string | string[], architecture: string | string[]): void; - addFiles(filenames: string | string[], architecture?: string | string[], options?: { - bare?: boolean; - }): void; - export(exportedObjects: string | string[], architecture?: string | string[], exportOptions?: Object, testOnly?: boolean): void; - imply(packageNames: string | string[], architecture?: string | string[]): void; - use(packageNames: string | string[], architecture?: string | string[], options?: { - weak?: boolean; - unordered?: boolean; - }): void; - versionsFrom(meteorRelease: string | string[]): void; + function fraction(): number; + // @param numberOfDigits, @returns a random hex string of the given length + function hexString(numberOfDigits: number): string; + // @param array, @return a random element in array + function choice(array: any[]): string; + // @param str, @return a random char in str + function choice(str: string): string; + } } declare var ReactiveVar: ReactiveVarStatic; interface ReactiveVarStatic { - new(initialValue: T, equalsFunc?: Function): ReactiveVar; + new < T > (initialValue: T, equalsFunc?: Function): ReactiveVar < T > ; } -interface ReactiveVar { - get(): T; - set(newValue: T): void; +interface ReactiveVar < T > { + get(): T; + set(newValue: T): void; } -declare var Subscription: SubscriptionStatic; -interface SubscriptionStatic { - new(): Subscription; +declare module "meteor/reactive-var" { + var ReactiveVar: ReactiveVarStatic; + interface ReactiveVarStatic { + new < T > (initialValue: T, equalsFunc?: Function): ReactiveVar < T > ; + } + interface ReactiveVar < T > { + get(): T; + set(newValue: T): void; + } } -interface Subscription { - added(collection: string, id: string, fields: Object): void; - changed(collection: string, id: string, fields: Object): void; - connection: Meteor.Connection; - error(error: Error): void; - onStop(func: Function): void; - ready(): void; - removed(collection: string, id: string): void; - stop(): void; - userId: string; + +declare module Session { + function equals(key: string, value: string | number | boolean | any): boolean; + + function get(key: string): any; + + function set(key: string, value: EJSONable | any): void; + + function setDefault(key: string, value: EJSONable | any): void; +} + +declare module "meteor/session" { + module Session { + function equals(key: string, value: string | number | boolean | any): boolean; + + function get(key: string): any; + + function set(key: string, value: EJSONable | any): void; + + function setDefault(key: string, value: EJSONable | any): void; + } } declare var Template: TemplateStatic; -interface TemplateStatic { - new(): Template; - // It should be [templateName: string]: TemplateInstance but this is not possible -- user will need to cast to TemplateInstance - [templateName: string]: any | Template; // added "any" to make it work - head: Template; - find(selector:string):Blaze.Template; - findAll(selector:string):Blaze.Template[]; - $:any; - body: Template; - currentData(): {}; - deregisterHelper(name: string): void; - instance(): Blaze.TemplateInstance; - parentData(numLevels?: number): {}; - registerHelper(name: string, helperFunction: Function): void; +interface TemplateStatic extends Blaze.TemplateStatic { + new(viewName?: string, renderFunction?: Function): Blaze.Template; + body: Blaze.Template; + [index: string]: any | Blaze.Template; } -interface Template { - created: Function; - destroyed: Function; - events(eventMap: Meteor.EventMap): void; - helpers(helpers:{[id:string]: any}): void; - onCreated: Function; - onDestroyed: Function; - onRendered: Function; - rendered: Function; + +declare module "meteor/templating" { + var Template: TemplateStatic; + interface TemplateStatic extends Blaze.TemplateStatic { + new(viewName?: string, renderFunction?: Function): Blaze.Template; + body: Blaze.Template; + [index: string]: any | Blaze.Template; + } +} + +interface ILengthAble { + length: number; +} + +interface ITinytestAssertions { + ok(doc: Object): void; + expect_fail(): void; + fail(doc: Object): void; + runId(): string; + equal < T > (actual: T, expected: T, message?: string, not?: boolean): void; + notEqual < T > (actual: T, expected: T, message?: string): void; + instanceOf(obj: Object, klass: Function, message?: string): void; + notInstanceOf(obj: Object, klass: Function, message?: string): void; + matches(actual: any, regexp: RegExp, message?: string): void; + notMatches(actual: any, regexp: RegExp, message?: string): void; + throws(f: Function, expected?: string | RegExp): void; + isTrue(v: boolean, msg?: string): void; + isFalse(v: boolean, msg?: string): void; + isNull(v: any, msg?: string): void; + isNotNull(v: any, msg?: string): void; + isUndefined(v: any, msg?: string): void; + isNotUndefined(v: any, msg?: string): void; + isNan(v: any, msg?: string): void; + isNotNan(v: any, msg?: string): void; + include < T > (s: Array < T > | Object | string, value: any, msg?: string, not?: boolean): void; + + notInclude < T > (s: Array < T > | Object | string, value: any, msg?: string, not?: boolean): void; + length(obj: ILengthAble, expected_length: number, msg?: string): void; + _stringEqual(actual: string, expected: string, msg?: string): void; +} + +declare module Tinytest { + function add(description: string, func: (test: ITinytestAssertions) => void): void; + + function addAsync(description: string, func: (test: ITinytestAssertions) => void): void; +} + +declare module "meteor/tiny-test" { + interface ILengthAble { + length: number; + } + + interface ITinytestAssertions { + ok(doc: Object): void; + expect_fail(): void; + fail(doc: Object): void; + runId(): string; + equal < T > (actual: T, expected: T, message?: string, not?: boolean): void; + notEqual < T > (actual: T, expected: T, message?: string): void; + instanceOf(obj: Object, klass: Function, message?: string): void; + notInstanceOf(obj: Object, klass: Function, message?: string): void; + matches(actual: any, regexp: RegExp, message?: string): void; + notMatches(actual: any, regexp: RegExp, message?: string): void; + throws(f: Function, expected?: string | RegExp): void; + isTrue(v: boolean, msg?: string): void; + isFalse(v: boolean, msg?: string): void; + isNull(v: any, msg?: string): void; + isNotNull(v: any, msg?: string): void; + isUndefined(v: any, msg?: string): void; + isNotUndefined(v: any, msg?: string): void; + isNan(v: any, msg?: string): void; + isNotNan(v: any, msg?: string): void; + include < T > (s: Array < T > | Object | string, value: any, msg?: string, not?: boolean): void; + + notInclude < T > (s: Array < T > | Object | string, value: any, msg?: string, not?: boolean): void; + length(obj: ILengthAble, expected_length: number, msg?: string): void; + _stringEqual(actual: string, expected: string, msg?: string): void; + } + + module Tinytest { + function add(description: string, func: (test: ITinytestAssertions) => void): void; + + function addAsync(description: string, func: (test: ITinytestAssertions) => void): void; + } +} + +declare module App { + function accessRule(pattern: string, options?: { + type?: string; + launchExternal?: boolean; + }): void; + + function configurePlugin(id: string, config: Object): void; + + function icons(icons: Object): void; + + function info(options: { + id?: string; + version?: string; + name?: string; + description?: string; + author?: string; + email?: string; + website?: string; + }): void; + + function launchScreens(launchScreens: Object): void; + + function setPreference(name: string, value: string, platform?: string): void; } -declare function check(value: any, pattern: any): void; declare function execFileAsync(command: string, args?: any[], options?: { - cwd?: Object; - env?: Object; - stdio?: any[] | string; - destination?: any; - waitForClose?: string; + cwd?: Object; + env?: Object; + stdio?: any[] | string; + destination?: any; + waitForClose?: string; }): any; declare function execFileSync(command: string, args?: any[], options?: { - cwd?: Object; - env?: Object; - stdio?: any[] | string; - destination?: any; - waitForClose?: string; + cwd?: Object; + env?: Object; + stdio?: any[] | string; + destination?: any; + waitForClose?: string; }): String; -declare function getExtension(): String; + +declare module Assets { + function getBinary(assetPath: string, asyncCallback?: Function): EJSON; + + function getText(assetPath: string, asyncCallback?: Function): string; + + function absoluteFilePath(assetPath: string): string; +} + +declare module Cordova { + function depends(dependencies: { + [id: string]: string + }): void; +} + +declare module Npm { + function depends(dependencies: { + [id: string]: string + }): void; + + function require(name: string): any; +} + +declare namespace Package { + function describe(options: { + summary?: string; + version?: string; + name?: string; + git?: string; + documentation?: string; + debugOnly?: boolean; + prodOnly?: boolean; + testOnly?: boolean; + }): void; + + function onTest(func: (api: PackageAPI) => void): void; + + function onUse(func: (api: PackageAPI) => void): void; + + function registerBuildPlugin(options?: { + name?: string; + use?: string | string[]; + sources?: string[]; + npmDependencies?: Object; + }): void; +} + +interface PackageAPI { + new(): PackageAPI; + addAssets(filenames: string | string[], architecture: string | string[]): void; + addFiles(filenames: string | string[], architecture?: string | string[], options?: { + bare?: boolean; + }): void; + export (exportedObjects: string | string[], architecture?: string | string[], exportOptions?: Object, testOnly?: boolean): void; + imply(packageNames: string | string[], architecture?: string | string[]): void; + use(packageNames: string | string[], architecture?: string | string[], options?: { + weak?: boolean; + unordered?: boolean; + }): void; + versionsFrom(meteorRelease: string | string[]): void; +} + +declare var console: Console; + +declare module "meteor/tools" { + module App { + function accessRule(pattern: string, options?: { + type?: string; + launchExternal?: boolean; + }): void; + + function configurePlugin(id: string, config: Object): void; + + function icons(icons: Object): void; + + function info(options: { + id?: string; + version?: string; + name?: string; + description?: string; + author?: string; + email?: string; + website?: string; + }): void; + + function launchScreens(launchScreens: Object): void; + + function setPreference(name: string, value: string, platform?: string): void; + } + + function execFileAsync(command: string, args?: any[], options?: { + cwd?: Object; + env?: Object; + stdio?: any[] | string; + destination?: any; + waitForClose?: string; + }): any; + + function execFileSync(command: string, args?: any[], options?: { + cwd?: Object; + env?: Object; + stdio?: any[] | string; + destination?: any; + waitForClose?: string; + }): String; + + module Assets { + function getBinary(assetPath: string, asyncCallback?: Function): EJSON; + + function getText(assetPath: string, asyncCallback?: Function): string; + + function absoluteFilePath(assetPath: string): string; + } + + module Cordova { + function depends(dependencies: { + [id: string]: string + }): void; + } + + module Npm { + function depends(dependencies: { + [id: string]: string + }): void; + + function require(name: string): any; + } + + namespace Package { + function describe(options: { + summary?: string; + version?: string; + name?: string; + git?: string; + documentation?: string; + debugOnly?: boolean; + prodOnly?: boolean; + testOnly?: boolean; + }): void; + + function onTest(func: (api: PackageAPI) => void): void; + + function onUse(func: (api: PackageAPI) => void): void; + + function registerBuildPlugin(options?: { + name?: string; + use?: string | string[]; + sources?: string[]; + npmDependencies?: Object; + }): void; + } + + interface PackageAPI { + new(): PackageAPI; + addAssets(filenames: string | string[], architecture: string | string[]): void; + addFiles(filenames: string | string[], architecture?: string | string[], options?: { + bare?: boolean; + }): void; + export (exportedObjects: string | string[], architecture?: string | string[], exportOptions?: Object, testOnly?: boolean): void; + imply(packageNames: string | string[], architecture?: string | string[]): void; + use(packageNames: string | string[], architecture?: string | string[], options?: { + weak?: boolean; + unordered?: boolean; + }): void; + versionsFrom(meteorRelease: string | string[]): void; + } + + var console: Console; +} + +declare module Tracker { + function Computation(): void; + interface Computation { + firstRun: boolean; + invalidate(): void; + invalidated: boolean; + onInvalidate(callback: Function): void; + onStop(callback: Function): void; + stop(): void; + stopped: boolean; + } + var currentComputation: Computation; + + var Dependency: DependencyStatic; + interface DependencyStatic { + new(): Dependency; + } + interface Dependency { + changed(): void; + depend(fromComputation?: Computation): boolean; + hasDependents(): boolean; + } + + var active: boolean; + + function afterFlush(callback: Function): void; + + function autorun(runFunc: (computation: Computation) => void, options?: { + onError?: Function; + }): Computation; + + function flush(): void; + + function nonreactive(func: Function): void; + + function onInvalidate(callback: Function): void; +} + +declare module "meteor/tracker" { + module Tracker { + function Computation(): void; + interface Computation { + firstRun: boolean; + invalidate(): void; + invalidated: boolean; + onInvalidate(callback: Function): void; + onStop(callback: Function): void; + stop(): void; + stopped: boolean; + } + var currentComputation: Computation; + + var Dependency: DependencyStatic; + interface DependencyStatic { + new(): Dependency; + } + interface Dependency { + changed(): void; + depend(fromComputation?: Computation): boolean; + hasDependents(): boolean; + } + + var active: boolean; + + function afterFlush(callback: Function): void; + + function autorun(runFunc: (computation: Computation) => void, options?: { + onError?: Function; + }): Computation; + + function flush(): void; + + function nonreactive(func: Function): void; + + function onInvalidate(callback: Function): void; + } +} + +declare module Match { + function Maybe(pattern: any): boolean; +} + +declare module "meteor/check" { + module Match { + function Maybe(pattern: any): boolean; + } +} + +declare module Meteor { + /** Global props **/ + var isDevelopment: boolean; + var isTest: boolean; + /** Global props **/ +} + +declare module "meteor/meteor" { + module Meteor { + /** Global props **/ + var isDevelopment: boolean; + var isTest: boolean; + /** Global props **/ + } +} + +declare module Accounts { + function onLogout(func: Function): void; +} + +declare module "meteor/accounts-base" { + module Accounts { + function onLogout(func: Function): void; + } +} + +declare module Accounts { + function onLogout(func: (user: Meteor.User, connection: Meteor.Connection) => void): void; +} + +declare module "meteor/accounts-base" { + module Accounts { + function onLogout(func: (user: Meteor.User, connection: Meteor.Connection) => void): void; + } +} diff --git a/meteor/meteor-tests.ts b/meteor/meteor-tests.ts index b700e4d616..4b59d9cc7a 100644 --- a/meteor/meteor-tests.ts +++ b/meteor/meteor-tests.ts @@ -6,6 +6,19 @@ /*********************************** Begin setup for tests ******************************/ +import {Mongo} from "meteor/mongo"; +import {Meteor} from "meteor/meteor"; +import {check, Match} from "meteor/check"; +import {Tracker} from "meteor/tracker"; +import {Template} from "meteor/templating"; +import {Blaze} from "meteor/blaze"; +import {Session} from "meteor/session"; +import {HTTP} from "meteor/http"; +import {ReactiveVar} from "meteor/reactive-var"; +import {Accounts} from "meteor/accounts-base"; +import {BrowserPolicy} from "meteor/browser-policy-common"; +import {DDPRateLimiter} from "meteor/ddp-rate-limiter"; + var Rooms = new Mongo.Collection('rooms'); var Messages = new Mongo.Collection('messages'); interface MonkeyDAO { @@ -60,10 +73,8 @@ Meteor.publish("counts-by-room", function (roomId: string) { var handle = Messages.find({roomId: roomId}).observeChanges({ added: function (id: any) { count++; -// if (!initializing) - -// Todo: Not sure how to define in typescript -// self.changed("counts", roomId, {count: count}); + // if (!initializing) + // this.changed("counts", roomId, {count: count}); }, removed: function (id: any) { count--; @@ -89,6 +100,9 @@ Tracker.autorun(function () { Meteor.subscribe("counts-by-room", Session.get("roomId")); }); +// Checking status +let status: DDP.Status = 'connected'; + console.log("Current room has " + Counts.find(Session.get("roomId")).count + " messages."); @@ -339,6 +353,8 @@ var handle = query.observeChanges({ } }); +let cursor: Mongo.Cursor; + // After five seconds, stop keeping the count. setTimeout(function () {handle.stop();}, 5000); @@ -452,20 +468,21 @@ Template['adminDashboard'].helpers({ return Session.get("foo"); } }); + Template['newTemplate'].helpers({ helperName: function () { } }); -Template['newTemplate'].created = function () { +Template['newTemplate'].created = function() { }; -Template['newTemplate'].rendered = function () { +Template['newTemplate'].rendered = function() { }; -Template['newTemplate'].destroyed = function () { +Template['newTemplate'].destroyed = function() { }; @@ -603,8 +620,9 @@ Meteor.call('sendEmail', 'Hello from Meteor!', 'This is a test of Email.send.'); -var testTemplate = new Blaze.Template(); -var testView = new Blaze.View(); +var testTemplate = new Blaze.Template('foo'); +var testView = new Blaze.View('foo'); +Blaze.Template.instance(); declare var el: HTMLElement; Blaze.render(testTemplate, el); @@ -632,15 +650,14 @@ Accounts.onPageLoadLogin(function() { }); // Covers this PR: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/8065 -var loginOpts: Meteor.LoginWithExternalServiceOptions = { +var loginOpts = { requestPermissions: ["a", "b"], requestOfflineToken: true, loginUrlParameters: {asdf: 1, qwer: "1234"}, loginHint: "Help me", loginStyle: "Bold and powerful", redirectUrl: "popup", - profile: "asdfasdf", - email: "asdf@ASDf.com" + profile: "asdfasdf" }; Meteor.loginWithMeteorDeveloperAccount(loginOpts, function(error: Meteor.Error) {}); @@ -648,16 +665,16 @@ Accounts.emailTemplates.siteName = "AwesomeSite"; Accounts.emailTemplates.from = "AwesomeSite Admin "; Accounts.emailTemplates.headers = { asdf: 'asdf', qwer: 'qwer' }; -Accounts.emailTemplates.enrollAccount.subject = function (user: Meteor.User) { +Accounts.emailTemplates.enrollAccount.subject = function(user: Meteor.User) { return "Welcome to Awesome Town, " + user.profile.name; }; -Accounts.emailTemplates.enrollAccount.html = function (user: Meteor.User, url: string) { +Accounts.emailTemplates.enrollAccount.html = function(user: Meteor.User, url: string) { return "

Some html here

"; }; Accounts.emailTemplates.enrollAccount.from = function() { return "asdf@asdf.com"; }; -Accounts.emailTemplates.enrollAccount.text = function (user: Meteor.User, url: string) { +Accounts.emailTemplates.enrollAccount.text = function(user: Meteor.User, url: string) { return "You have been selected to participate in building a better future!" + " To activate your account, simply click the link below:\n\n" + url; @@ -674,3 +691,41 @@ var handle = Accounts.validateLoginAttempt(function(attemptInfoObject: Accounts. return true; }); handle.stop(); + + +// Covers https://github.com/meteor-typings/meteor/issues/8 +const publicSetting = Meteor.settings.public['somePublicSetting']; +const deeperPublicSetting = Meteor.settings.public['somePublicSetting']['deeperSetting']; +const privateSetting = Meteor.settings['somePrivateSetting']; +const deeperPrivateSetting = Meteor.settings['somePrivateSettings']['deeperSetting']; + + +// Covers https://github.com/meteor-typings/meteor/issues/9 +const username = ( Template.instance().find('#username')).value; + + +// Covers https://github.com/meteor-typings/meteor/issues/3 +BrowserPolicy.framing.disallow(); +BrowserPolicy.content.allowEval(); + + +// Covers https://github.com/meteor-typings/meteor/issues/18 +if (Meteor.isDevelopment) { + Rooms._dropIndex({field: 1}); +} + + +// Covers https://github.com/meteor-typings/meteor/issues/20 +Rooms.find().count(true); + + +// Covers https://github.com/meteor-typings/meteor/issues/21 +if (Meteor.isTest) { + // do something +} + +DDPRateLimiter.addRule({ userId: 'foo' }, 5, 1000); + +DDPRateLimiter.addRule((userId: string) => userId =='foo', 5, 1000); + +Template.instance().autorun(() => {}).stop(); From 233a6f58655709b1f03ea5b6f86d8b44cf65b60d Mon Sep 17 00:00:00 2001 From: Birk Skyum Date: Tue, 7 Mar 2017 12:48:12 +0100 Subject: [PATCH 338/797] Remove old deprecation warning --- meteor/README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/meteor/README.md b/meteor/README.md index a4880bed54..f560dd005e 100644 --- a/meteor/README.md +++ b/meteor/README.md @@ -1,12 +1,5 @@ # Meteor Type Definitions -## Deprecated - -These definitions for Meteor are now deprecated. They should still work for versions of Meteor up to 1.2.1. - -The canonical TypeScript definitions for Meteor can now be found using the NPM [Typings definition manager](https://www.npmjs.com/package/typings). If you prefer to view the definitions directly, or contribute to them, they can be found here: . - - ## Description These are the definitions for version 1.4 of Meteor. These definitions were generated from the from the same [Meteor data.js file] (https://github.com/meteor/meteor/blob/devel/docs/client/data.js) that is used to generate the official [Meteor docs] (http://docs.meteor.com/). The code that generates these definitions can be found [here](https://github.com/meteor-typescript/meteor-typescript-libs/). From 09e7ae01c29d3bce827ca7f87970563bded7ae1d Mon Sep 17 00:00:00 2001 From: Wei Zhu Date: Tue, 7 Mar 2017 20:08:35 +0800 Subject: [PATCH 339/797] Add antd to not needed packages --- antd/antd-tests.tsx | 483 ---------- antd/index.d.ts | 2083 ---------------------------------------- antd/tsconfig.json | 24 - notNeededPackages.json | 8 +- 4 files changed, 7 insertions(+), 2591 deletions(-) delete mode 100644 antd/antd-tests.tsx delete mode 100644 antd/index.d.ts delete mode 100644 antd/tsconfig.json diff --git a/antd/antd-tests.tsx b/antd/antd-tests.tsx deleted file mode 100644 index 1319455e91..0000000000 --- a/antd/antd-tests.tsx +++ /dev/null @@ -1,483 +0,0 @@ -/// - -/*import { - Affix, - Button, - Alert, - Badge, - Breadcrumb, - Calendar, - Carousel, - Cascader, - Checkbox, - Collapse, - DatePicker, - Dropdown, - Icon, - Form, - Input, - InputNumber, - Row, - Col, - Menu, - message, - Modal, - notification, - Pagination, - Popconfirm, - Popover, - Progress, - QueueAnim, - Radio, - Select, - Slider, - Spin, - Steps, - Switch, - Table, - Tabs, - Tag, - TimePicker, - Timeline, - Tooltip, - Transfer, - Tree, - TreeSelect, - Upload, - - - -} from 'antd';*/ - -import * as React from 'react' -import Affix from 'antd/lib/Affix' -import Button from 'antd/lib/Button' -import Alert from 'antd/lib/Alert' -import Badge from 'antd/lib/Badge' -import Breadcrumb from 'antd/lib/Breadcrumb' -import Calendar from 'antd/lib/Calendar' -import Carousel from 'antd/lib/Carousel' -import Cascader from 'antd/lib/Cascader' -import Checkbox from 'antd/lib/Checkbox' -import Collapse from 'antd/lib/Collapse' -import DatePicker from 'antd/lib/DatePicker' -import Dropdown from 'antd/lib/Dropdown' -import Icon from 'antd/lib/Icon' -import Form from 'antd/lib/Form' -import Input from 'antd/lib/Input' -import InputNumber from 'antd/lib/InputNumber' -import Row from 'antd/lib/Row' -import Col from 'antd/lib/Col' -import Menu from 'antd/lib/Menu' -import message from 'antd/lib/message' -import Modal from 'antd/lib/Modal' -import notification from 'antd/lib/notification' -import Pagination from 'antd/lib/Pagination' -import Popconfirm from 'antd/lib/Popconfirm' -import Popover from 'antd/lib/Popover' -import Progress from 'antd/lib/Progress' -import QueueAnim from 'antd/lib/QueueAnim' -import Radio from 'antd/lib/Radio' -import Select from 'antd/lib/Select' -import Slider from 'antd/lib/Slider' -import Spin from 'antd/lib/Spin' -import Steps from 'antd/lib/Steps' -import Switch from 'antd/lib/Switch' -import Table from 'antd/lib/Table' -import Tabs from 'antd/lib/Tabs' -import Tag from 'antd/lib/Tag' -import TimePicker from 'antd/lib/TimePicker' -import Timeline from 'antd/lib/Timeline' -import Tooltip from 'antd/lib/Tooltip' -import Transfer from 'antd/lib/Transfer' -import Tree from 'antd/lib/Tree' -import TreeSelect from 'antd/lib/TreeSelect' -import Upload from 'antd/lib/Upload' - -const ButtonGroup = Button.Group; -const CheckboxGroup = Checkbox.Group; -const Panel = Collapse.Panel; -const RangePicker = DatePicker.RangePicker; -const MonthPicker = DatePicker.MonthPicker; -const DropdownButton = Dropdown.Button; -const SubMenu = Menu.SubMenu; -const MenuItemGroup = Menu.ItemGroup; -const ProgressCircle = Progress.Circle; -const ProgressLine = Progress.Line; -const RadioGroup = Radio.Group; -const Option = Select.Option; -const OptGroup = Select.OptGroup; -const Step = Steps.Step; -const FormItem = Form.Item; -const TabPane = Tabs.TabPane; -const TreeNode = Tree.TreeNode; -const TreeSelectTreeNode = TreeSelect.TreeNode; - -const onChange = () => { } - -const options = [{ - value: 'zhejiang', - label: '浙江', - children: [{ - value: 'hangzhou', - label: 'æ­å·ž', - children: [{ - value: 'xihu', - label: '西湖', - }], - }], -}, { - value: 'jiangsu', - label: '江è‹', - children: [{ - value: 'nanjing', - label: 'å—京', - children: [{ - value: 'zhonghuamen', - label: '中åŽé—¨', - }], - }], - }]; - -const columns = [{ - title: 'å§“å', - dataIndex: 'name', - key: 'name', - render(text: any) { - return {text}; - } -}, { - title: '年龄', - dataIndex: 'age', - key: 'age', - }, { - title: 'ä½å€', - dataIndex: 'address', - key: 'address', - }, { - title: 'æ“作', - key: 'operation', - render(text: any, record: any) { - return ( - - æ“作一{record.name} - - æ“作二 - - - 更多 - - - ); - } - }]; -const data = [{ - key: '1', - name: '胡彦斌', - age: 32, - address: '西湖区湖底公园1å·' -}, { - key: '2', - name: '胡彦祖', - age: 42, - address: '西湖区湖底公园1å·' - }, { - key: '3', - name: 'æŽå¤§å˜´', - age: 32, - address: '西湖区湖底公园1å·' - }]; - -// tests -class AccountForm extends React.Component{ - render() { - const { getFieldProps } = this.props.form; - return ( - - - - - - - - - - - - - ); - } -} - -var Account = Form.create()(AccountForm); - -// app -class App extends React.Component{ - render() { - message.success('success') - message.config({ top: 100 }) - message.destroy() - message.info('info', 1000) - message.error('error', 3500) - - Modal.info({ title: 'hello' }); - Modal.success({ cancelText: 'No' }) - notification.success({ - message: 'hello', - description: 'test' - }) - const props = { - name: 'file', - action: '/upload.do', - onChange(info: any) { - if (info.file.status !== 'uploading') { - console.log(info.file, info.fileList); - } - if (info.file.status === 'done') { - message.success(`${info.file.name} 上传æˆåŠŸã€‚`); - } else if (info.file.status === 'error') { - message.error(`${info.file.name} 上传失败。`); - } - } - }; - return
- Affix - - - test - - - - - - - - - - - - 首页 - 应用中心 - 应用列表 - æŸåº”用 - - - - - -

1

-

2

-

3

-

4

-
- - - - - - -

test1

-
- -

test2

-
- -

test3

-
-
- - - - Hello Dp
}> - - 触å‘链接 - - - dpb

} type="primary"> - æŸåŠŸèƒ½æŒ‰é’® -
- - - - - - - 导航一 - - - 导航 - å­èœå•}> - - 选项1 - 选项2 - - - 选项3 - 选项4 - - - - - - - - - - , - - - remove - - Overlay} title="title"> - - - - - - - - - - - - - - - - - - -
demo1
-
demo2
-
demo3
-
demo4
-
- - - A - B - C - D - - - - - - - - - - - - - - - - - - - - , - - - - 选项å¡ä¸€å†…容 - 选项å¡äºŒå†…容 - 选项å¡ä¸‰å†…容 - - - 标签一 - 标签二 - { } }>标签三 - 标签四(链接) - - - - - - 创建æœåŠ¡çŽ°åœº 2015-09-01 - åˆæ­¥æŽ’除网络异常 2015-09-01 - 技术测试异常 2015-09-01 - ç½‘ç»œå¼‚å¸¸æ­£åœ¨ä¿®å¤ 2015-09-01 - - - - - 鼠标移上æ¥å°±ä¼šå‡ºçްæç¤º - - - - - - - - - - - - - - - sss} key="0-0-1-0" /> - - - - - - - - - - - - - - - - - - - sss} key="random3" /> - - - - - - } -} diff --git a/antd/index.d.ts b/antd/index.d.ts deleted file mode 100644 index f262eda45f..0000000000 --- a/antd/index.d.ts +++ /dev/null @@ -1,2083 +0,0 @@ -// Type definitions for Antd v0.12.10 -// Project: http://ant.design -// Definitions by: bang88 , Bruce Mitchener -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -/// - -declare namespace Antd { - // Affix - interface AffixProps { - /** - * 达到指定åç§»é‡åŽè§¦å‘ - */ - offset?: number - } - /** - * # Affix - * 将页é¢å…ƒç´ é’‰åœ¨å¯è§†èŒƒå›´ã€‚ - * ## 何时使用 - * å½“å†…å®¹åŒºåŸŸæ¯”è¾ƒé•¿ï¼Œéœ€è¦æ»šåЍ页颿—¶ï¼Œè¿™éƒ¨åˆ†å†…容对应的æ“作或者导航需è¦åœ¨æ»šåŠ¨èŒƒå›´å†…å§‹ç»ˆå±•çŽ°ã€‚å¸¸ç”¨äºŽä¾§è¾¹èœå•和按钮组åˆã€‚ - * 页é¢å¯è§†èŒƒå›´è¿‡å°æ—¶ï¼Œæ…Žç”¨æ­¤åŠŸèƒ½ä»¥å…鮿Œ¡é¡µé¢å†…容。 - */ - export class Affix extends React.Component { - render(): JSX.Element - } - - - // Alert - interface AlertProps { - /** - * å¿…é€‰å‚æ•°ï¼ŒæŒ‡å®šè­¦å‘Šæç¤ºçš„æ ·å¼ï¼Œæœ‰å››ç§é€‰æ‹©`success`ã€`info`ã€`warn`ã€`error` - */ - type: string, - /**å¯é€‰å‚æ•°ï¼Œé»˜è®¤ä¸æ˜¾ç¤ºå…³é—­æŒ‰é’® */ - closable?: boolean, - /**å¯é€‰å‚数,自定义关闭按钮 */ - closeText?: React.ReactNode, - /**å¿…é€‰å‚æ•°ï¼Œè­¦å‘Šæç¤ºå†…å®¹ */ - message: React.ReactNode, - /**å¯é€‰å‚数,警告æç¤ºçš„è¾…åŠ©æ€§æ–‡å­—ä»‹ç» */ - description?: React.ReactNode, - /**å¯é€‰å‚数,关闭时触å‘的回调函数 */ - onClose?: Function, - /**å¯é€‰å‚æ•°ï¼Œæ˜¯å¦æ˜¾ç¤ºè¾…助图标 */ - showIcon?: boolean - } - - - /** - * # Alert - * 警告æç¤ºï¼Œå±•现需è¦å…³æ³¨çš„ä¿¡æ¯ã€‚ - - * ## 何时使用 - - * - 当æŸä¸ªé¡µé¢éœ€è¦å‘ç”¨æˆ·æ˜¾ç¤ºè­¦å‘Šçš„ä¿¡æ¯æ—¶ã€‚ - * - éžæµ®å±‚çš„é™æ€å±•现形å¼ï¼Œå§‹ç»ˆå±•现,ä¸ä¼šè‡ªåŠ¨æ¶ˆå¤±ï¼Œç”¨æˆ·å¯ä»¥ç‚¹å‡»å…³é—­ã€‚ - * */ - export class Alert extends React.Component { - render(): JSX.Element - } - - - // Badge - /** - * #Badge - * - * 图标å³ä¸Šè§’的圆形徽标数字。 - - * ## 何时使用 - - * 一般出现在通知图标或头åƒçš„å³ä¸Šè§’,用于显示需è¦å¤„ç†çš„æ¶ˆæ¯æ¡æ•°ï¼Œé€šè¿‡é†’目视觉形å¼å¸å¼•用户处ç†ã€‚ - * - */ - export class Badge extends React.Component { - render(): JSX.Element - } - interface BadgeProps { - /** 展示的数字,大于 overflowCount 时显示为 `${overflowCount}+`,为 0 æ—¶éšè—*/ - count: number, - /** 展示å°é¡¶çš„æ•°å­—值*/ - overflowCount?: number, - /** ä¸å±•ç¤ºæ•°å­—ï¼Œåªæœ‰ä¸€ä¸ªå°çº¢ç‚¹*/ - dot?: boolean - } - - - // Button - interface ButtonProps { - /** 设置按钮类型,å¯é€‰å€¼ä¸º `primary` `ghost` 或者ä¸è®¾ */ - type?: ButtonType | string, - /** 设置按钮形状,å¯é€‰å€¼ä¸º `circle` `circle-outline` 或者ä¸è®¾*/ - shape?: string, - /** 设置按钮大å°ï¼Œå¯é€‰å€¼ä¸º `small` `large` 或者ä¸è®¾*/ - size?: string, - /** 设置 `button` 原生的 `type` 值,å¯é€‰å€¼è¯·å‚考 HTML标准*/ - htmlType?: string, - /** `click` 事件的 handler*/ - onClick?: Function, - /** 设置按钮载入状æ€*/ - loading?: boolean, - /** æ ·å¼å*/ - className?: string, - } - - - enum ButtonType { - primary, - ghost, - dashed - } - - interface ButtonGroupProps { - /** 设置按钮大å°ï¼Œå¯é€‰å€¼ä¸º `small` `large` 或者ä¸è®¾*/ - size?: string - - } - - /** - å¯ä»¥å°†å¤šä¸ª `Button` 放入 `Button.Group` 的容器中。 - - 通过设置 `size` 为 `large` `small` 分别把按钮组åˆè®¾ä¸ºå¤§ã€å°å°ºå¯¸ã€‚è‹¥ä¸è®¾ç½® `size`,则尺寸为中。*/ - class ButtonGroup extends React.Component { - render(): JSX.Element - } - - /** - * #Button - æŒ‰é’®ç”¨äºŽå¼€å§‹ä¸€ä¸ªå³æ—¶æ“作。 - - ## 何时使用 - - 标记了一个(或å°è£…一组)æ“作命令,å“应用户点击行为,触å‘相应的业务逻辑。*/ - export class Button extends React.Component { - static Group: typeof ButtonGroup - render(): JSX.Element - } - - - - // Breadcrumb - - interface BreadcrumbItemProps { - /** 链接,如ä¸ä¼ åˆ™ä¸å¯ç‚¹å‡» */ - href?: string - } - export class BreadcrumbItem extends React.Component { - render(): JSX.Element - } - - interface BreadcrumbProps { - /** router çš„è·¯ç”±æ ˆä¿¡æ¯ */ - routes?: Array, - /** è·¯ç”±çš„å‚æ•°*/ - params?: Object, - /** 分隔符自定义*/ - separator?: string | React.ReactNode - } - /** - * #Breadcrumb - 显示当å‰é¡µé¢åœ¨ç³»ç»Ÿå±‚级结构中的ä½ç½®ï¼Œå¹¶èƒ½å‘上返回。 - - ## 何时使用 - - - 当系统拥有超过两级以上的层级结构时; - - 当需è¦å‘ŠçŸ¥ç”¨æˆ·â€œä½ åœ¨å“ªé‡Œâ€æ—¶ï¼› - - 当需è¦å‘上导航的功能时。*/ - export class Breadcrumb extends React.Component { - static Item: typeof BreadcrumbItem - render(): JSX.Element - } - - - // Calendar - interface CalendarProps { - /** 自定义渲染月å•元格*/ - monthCellRender?: Function, - /** 自定义渲染日期å•元格*/ - dateCellRender?: Function, - /** 是å¦å…¨å±æ˜¾ç¤º*/ - fullscreen?: boolean, - /** 国际化é…ç½®*/ - locale?: Object, - prefixCls?: string, - className?: string, - style?: Object, - /** æ—¥æœŸé¢æ¿å˜åŒ–回调*/ - onPanelChange?: Function, - /** 展示日期*/ - value?: Date, - /** 默认展示日期*/ - defaultValue?: Date, - /** åˆå§‹æ¨¡å¼ï¼Œ`month/year`*/ - mode?: string - } - /** - * #Calendar - 按照日历形å¼å±•示数æ®çš„容器。 - - ## 何时使用 - - å½“æ•°æ®æ˜¯æ—¥æœŸæˆ–按照日期划分时,例如日程ã€è¯¾è¡¨ã€ä»·æ ¼æ—¥åŽ†ç­‰ï¼Œå†œåŽ†ç­‰ã€‚ç›®å‰æ”¯æŒå¹´/月切æ¢ã€‚ - */ - export class Calendar extends React.Component { - render(): JSX.Element - } - - - // Carousel - interface CarouselProps { - /** 动画效果函数,å¯å– scrollx, fade*/ - effect?: string, - /** æ˜¯å¦æ˜¾ç¤ºé¢æ¿æŒ‡ç¤ºç‚¹*/ - dots?: boolean, - /** 垂直显示*/ - vertical?: boolean, - /** 是å¦è‡ªåŠ¨åˆ‡æ¢*/ - autoplay?: boolean, - /** 动画效果*/ - easing?: string, - /** 切æ¢é¢æ¿çš„回调*/ - beforeChange?: Function, - /** 切æ¢é¢æ¿çš„回调*/ - afterChange?: Function - } - /** - * #Carousel - 旋转木马,一组轮播的区域。 - - ## 何时使用 - - - 当有一组平级的内容。 - - 当内容空间ä¸è¶³æ—¶ï¼Œå¯ä»¥ç”¨èµ°é©¬ç¯çš„å½¢å¼è¿›è¡Œæ”¶çº³ï¼Œè¿›è¡Œè½®æ’­å±•现。 - - 常用于一组图片或å¡ç‰‡è½®æ’­ã€‚ - */ - export class Carousel extends React.Component { - render(): JSX.Element - } - - - - // Cascader - interface CascaderProps { - /** å¯é€‰é¡¹æ•°æ®æº*/ - options: Object, - /** 默认的选中项*/ - defaultValue?: Array, - /** 指定选中项*/ - value?: Array, - /** 选择完æˆåŽçš„回调*/ - onChange?: Function, - /** 选择åŽå±•示的渲染函数*/ - displayRender?: Function, - /** 自定义样å¼*/ - style?: Object, - /** 自定义类å*/ - className?: string, - /** 自定义浮层类å*/ - popupClassName?: string, - /** 浮层预设ä½ç½®ï¼š`bottomLeft` `bottomRight` `topLeft` `topRight` */ - popupPlacement?: string, - /** 输入框å ä½æ–‡æœ¬*/ - placeholder?: string, - /** 输入框大å°ï¼Œå¯é€‰ `large` `default` `small` */ - size?: string, - /** ç¦ç”¨*/ - disabled?: boolean, - /** æ˜¯å¦æ”¯æŒæ¸…除*/ - allowClear?: boolean - - } - /** - * #Cascader - 级è”选择框。 - - - ## 何时使用 - - - 需è¦ä»Žä¸€ç»„相关è”的数æ®é›†åˆè¿›è¡Œé€‰æ‹©ï¼Œä¾‹å¦‚çœå¸‚区,公å¸å±‚级,事物分类等。 - - 从一个较大的数æ®é›†åˆä¸­è¿›è¡Œé€‰æ‹©æ—¶ï¼Œç”¨å¤šçº§åˆ†ç±»è¿›è¡Œåˆ†éš”,方便选择。 - - 比起 Select 组件,å¯ä»¥åœ¨åŒä¸€ä¸ªæµ®å±‚中完æˆé€‰æ‹©ï¼Œæœ‰è¾ƒå¥½çš„体验。*/ - export class Cascader extends React.Component { - render(): JSX.Element - } - - - - - // Checkbox - interface CheckboxProps { - /** æŒ‡å®šå½“å‰æ˜¯å¦é€‰ä¸­*/ - checked?: boolean, - /** åˆå§‹æ˜¯å¦é€‰ä¸­*/ - defaultChecked?: boolean, - /** å˜åŒ–时回调函数*/ - onChange?: Function - } - - interface CheckboxGroupProps { - /** 默认选中的选项*/ - defaultValue?: Array, - /** 指定选中的选项*/ - value?: Array, - /** 指定å¯é€‰é¡¹*/ - options?: Array, - /** å˜åŒ–时回调函数*/ - onChange?: Function - } - /** Checkbox 组*/ - class CheckboxGroup extends React.Component { - render(): JSX.Element - } - /** - * #Checkbox - 多选框。 - - ## 何时使用 - - - 在一组å¯é€‰é¡¹ä¸­è¿›è¡Œå¤šé¡¹é€‰æ‹©æ—¶ï¼› - - å•独使用å¯ä»¥è¡¨ç¤ºä¸¤ç§çжæ€ä¹‹é—´çš„切æ¢ï¼Œå’Œ `switch` ç±»ä¼¼ã€‚åŒºåˆ«åœ¨äºŽåˆ‡æ¢ `switch` 会直接触å‘çŠ¶æ€æ”¹å˜ï¼Œè€Œ `checkbox` ä¸€èˆ¬ç”¨äºŽçŠ¶æ€æ ‡è®°ï¼Œéœ€è¦å’Œæäº¤æ“作é…åˆã€‚ - */ - export class Checkbox extends React.Component { - static Group: typeof CheckboxGroup - render(): JSX.Element - } - - - - // Collapse - - interface CollapseProps { - /** 当剿¿€æ´» tab 颿¿çš„ key*/ - activeKey?: Array | string, - /** åˆå§‹åŒ–选䏭颿¿çš„key */ - defaultActiveKey?: Array, - /** 切æ¢é¢æ¿çš„回调*/ - onChange?: Function - - } - class CollapsePanel extends React.Component<{ - /** 对应 activeKey */ - key: string, - /** 颿¿å¤´å†…容*/ - header: React.ReactNode | string - }, {}> { - render(): JSX.Element - } - /** - * #Collapse - å¯ä»¥æŠ˜å /展开的内容区域。 - - ## 何时使用 - - - 坹夿‚区域进行分组和éšè—ï¼Œä¿æŒé¡µé¢çš„æ•´æ´ã€‚ - - `手风ç´` 是一ç§ç‰¹æ®Šçš„æŠ˜å é¢æ¿ï¼Œåªå…许å•个内容区域展开。*/ - export class Collapse extends React.Component { - static Panel: typeof CollapsePanel - render(): JSX.Element - } - - - - // DatePicker - interface DatePickerProps { - - value?: string | Date, - defaultValue?: string | Date, - /** 展示的日期格å¼ï¼Œé…ç½®å‚考 [GregorianCalendarFormat](https://github.com/yiminghe/gregorian-calendar-format)*/ - format?: string, - /** ä¸å¯é€‰æ‹©çš„æ—¥æœŸ*/ - disabledDate?: Function, - /** æ—¶é—´å‘生å˜åŒ–的回调,å‘生在用户选择时间时*/ - onChange?: Function, - /** ç¦ç”¨*/ - disabled?: boolean, - style?: Object, - /** 格外的弹出日历样å¼*/ - popupStyle?: Object, - /** 输入框大å°ï¼Œ`large` 高度为 32px,`small` 为 22px,默认是 28px*/ - size?: string, - /** 国际化é…ç½®*/ - locale?: Object, - /** 增加时间选择功能*/ - showTime?: boolean, - /** 点击确定按钮的回调*/ - onOk?: Function, - /** 定义浮层的容器,默认为 body 上新建 div*/ - getCalendarContainer?: Function - - } - interface RangePickProps extends DatePickerProps { - - } - class RangePicker extends React.Component { - render(): JSX.Element - } - class MonthPicker extends React.Component { - render(): JSX.Element - } - /** - * #DatePicker - 输入或选择日期的控件。 - - ## 何时使用 - - 当用户需è¦è¾“入一个日期,å¯ä»¥ç‚¹å‡»æ ‡å‡†è¾“å…¥æ¡†ï¼Œå¼¹å‡ºæ—¥æœŸé¢æ¿è¿›è¡Œé€‰æ‹©ã€‚*/ - export class DatePicker extends React.Component, {}> { - static RangePicker: typeof RangePicker - static MonthPicker: typeof MonthPicker - render(): JSX.Element - } - - - - - // Dropdown - - interface DropdownProps { - /** 触å‘下拉的行为 ['click'] or ['hover']*/ - trigger?: Array, - /** èœå•节点*/ - overlay: React.ReactNode - - } - - class DropdownButton extends React.Component<{ - /** 按钮类型*/ - type?: string, - /** 点击左侧按钮的回调*/ - onClick?: Function, - /** 触å‘下拉的行为*/ - trigger?: string, - /** èœå•节点*/ - overlay: React.ReactNode - }, {}> { - render(): JSX.Element - } - /** - * #Dropdown - å‘下弹出的列表。 - - ## 何时使用 - - 当页é¢ä¸Šçš„æ“ä½œå‘½ä»¤è¿‡å¤šæ—¶ï¼Œç”¨æ­¤ç»„ä»¶å¯ä»¥æ”¶çº³æ“作元素。点击或移入触点,会出现一个下拉èœå•。å¯åœ¨åˆ—表中进行选择,并执行相应的命令。 - */ - export class Dropdown extends React.Component { - static Button: typeof DropdownButton - render(): JSX.Element - } - - - - // Form - - interface FormItemProps { - prefixCls?: string, - /** label 标签的文本*/ - label?: React.ReactNode, - /** label 标签布局,通 `` 组件,设置 `span` `offset` 值,如 `{span: 3, offset: 12}`*/ - labelCol?: Object, - /** æç¤ºä¿¡æ¯ï¼Œå¦‚ä¸è®¾ç½®ï¼Œåˆ™ä¼šæ ¹æ®æ ¡éªŒè§„åˆ™è‡ªåŠ¨ç”Ÿæˆ */ - help?: React.ReactNode | boolean, - /** é¢å¤–çš„æç¤ºä¿¡æ¯ï¼Œå’Œ help 类似,当需è¦é”™è¯¯ä¿¡æ¯å’Œæç¤ºæ–‡æ¡ˆåŒæ—¶å‡ºçŽ°æ—¶ï¼Œå¯ä»¥ä½¿ç”¨è¿™ä¸ªã€‚*/ - extra?: string, - /** 是å¦å¿…填,如ä¸è®¾ç½®ï¼Œåˆ™ä¼šæ ¹æ®æ ¡éªŒè§„åˆ™è‡ªåŠ¨ç”Ÿæˆ */ - validateStatus?: string, - /** é…åˆ validateStatus 属性使用,是å¦å±•示校验状æ€å›¾æ ‡ */ - hasFeedback?: boolean, - /** 需è¦ä¸ºè¾“å…¥æŽ§ä»¶è®¾ç½®å¸ƒå±€æ ·å¼æ—¶ï¼Œä½¿ç”¨è¯¥å±žæ€§ï¼Œç”¨æ³•åŒ labelCol*/ - wrapperCol?: Object, - className?: string, - required?: boolean, - id?: string - } - /** - 表å•一定会包å«è¡¨å•域,表å•域å¯ä»¥æ˜¯è¾“入控件,标准表å•域,标签,下拉èœå•,文本域等。 - - 这里我们分别å°è£…了表å•域 `` 和输入控件 ``。*/ - export class FormItem extends React.Component { - render(): JSX.Element - } - interface FormComponentProps { - form: CreateFormOptions - } - export class FormComponent extends React.Component { - render(): JSX.Element - } - - // function create - type CreateFormOptions = { - /** 获å–一组输入控件的值,如ä¸ä¼ å…¥å‚数,则获å–全部组件的值*/ - getFieldsValue(): (fieldNames?: Array) => any - /** 获å–一个输入控件的值*/ - getFieldValue(): (fieldName: string) => any - /** 设置一组输入控件的值*/ - setFieldsValue(): (obj: Object) => void - /** 设置一组输入控件的值*/ - setFields(): (obj: Object) => void - /** 校验并获å–一组输入域的值与 Error*/ - validateFields(): (fieldNames?: Array, options?: Object, callback?: (erros: any, values: any) => void) => any - /** 与 `validateFields` 相似,但校验完åŽï¼Œå¦‚果校验ä¸é€šè¿‡çš„èœå•域ä¸åœ¨å¯è§èŒƒå›´å†…,则自动滚动进å¯è§èŒƒå›´ */ - validateFieldsAndScroll(): (fieldNames?: Array, options?: Object, callback?: (erros: any, values: any) => void) => any - /** èŽ·å–æŸä¸ªè¾“入控件的 Error */ - getFieldError(): (name: string) => Object - /** 判断一个输入控件是å¦åœ¨æ ¡éªŒçжæ€*/ - isFieldValidating(): (name: string) => Object - /**é‡ç½®ä¸€ç»„输入控件的值与状æ€ï¼Œå¦‚ä¸ä¼ å…¥å‚数,则é‡ç½®æ‰€æœ‰ç»„ä»¶*/ - resetFields(): (names?: Array) => void - - getFieldsValue(): (id: string, options: { - /** å­èŠ‚ç‚¹çš„å€¼çš„å±žæ€§ï¼Œå¦‚ Checkbox 的是 'checked'*/ - valuePropName?: string, - /** å­èŠ‚ç‚¹çš„åˆå§‹å€¼ï¼Œç±»åž‹ã€å¯é€‰å€¼å‡ç”±å­èŠ‚ç‚¹å†³å®š*/ - initialValue?: any, - /** 收集å­èŠ‚ç‚¹çš„å€¼çš„æ—¶æœº*/ - trigger?: string, - /** 校验å­èŠ‚ç‚¹å€¼çš„æ—¶æœº*/ - validateTrigger?: string, - /** 校验规则,å‚è§ [async-validator](https://github.com/yiminghe/async-validator) */ - rules?: Array, - /** 必填输入控件唯一标志*/ - id?: string - }) => Array - - - } - - interface ComponentDecorator { - (component: T): T; - } - interface FormProps { - prefixCls?: string, - /** 水平排列布局*/ - horizontal?: boolean, - /** 行内排列布局*/ - inline?: boolean, - /** ç» `Form.create()` 包装过的组件会自带 `this.props.form` 属性,直接传给 Form å³å¯*/ - form?: Object, - /** æ•°æ®éªŒè¯æˆåŠŸåŽå›žè°ƒäº‹ä»¶*/ - onSubmit?: (e: React.FormEvent
) => void, - } - /** - * #Form - å…·æœ‰æ•°æ®æ”¶é›†ã€æ ¡éªŒå’Œæäº¤åŠŸèƒ½çš„è¡¨å•,包å«å¤é€‰æ¡†ã€å•选框ã€è¾“入框ã€ä¸‹æ‹‰é€‰æ‹©æ¡†ç­‰å…ƒç´ ã€‚ - - ## è¡¨å• - - 我们为 `form` æä¾›äº†ä»¥ä¸‹ä¸¤ç§æŽ’列方å¼ï¼š - - - 水平排列:å¯ä»¥å®žçް `label` æ ‡ç­¾å’Œè¡¨å•æŽ§ä»¶çš„æ°´å¹³æŽ’åˆ—; - - 行内排列:使其表现为 `inline-block` 级别的控件。 - */ - export class Form extends React.Component { - static Item: typeof FormItem - static create(options?: { - /** - * 当 `Form.Item` å­èŠ‚ç‚¹çš„å€¼å‘ç”Ÿæ”¹å˜æ—¶è§¦å‘,å¯ä»¥æŠŠå¯¹åº”的值转存到 Redux store - */ - onFieldsChange?: (props: Object, fields: Array) => void, - /** 把 props 转为对应的值,å¯ç”¨äºŽæŠŠ Redux store 中的值读出 */ - mapPropsToFields?: (props: Object) => void - }): ComponentDecorator - render(): JSX.Element - } - - - - - - // Icon - interface IconProps { - /** 图标类型*/ - type: string - } - /** - * #Icon - 有å«ä¹‰çš„矢é‡å›¾å½¢ï¼Œæ¯ä¸€ä¸ªå›¾æ ‡æ‰“倒一个敌人。 - - ## 图标的命å规范 - - 我们为æ¯ä¸ªå›¾æ ‡èµ‹äºˆäº†è¯­ä¹‰åŒ–的命å,命å规则如下: - - - 实心和æçº¿å›¾æ ‡ä¿æŒåŒå,用 `-o` æ¥åŒºåˆ†ï¼Œæ¯”如 `question-circle`(实心) å’Œ `question-circle-o`(æçº¿)ï¼› - - - 命å顺åºï¼š`[iconå]-[形状å¯é€‰]-[æçº¿ä¸Žå¦]-[æ–¹å‘å¯é€‰]`。 - - ## 如何使用 - - 使用 `` 标签声明组件,指定图标对应的 type 属性,示例代ç å¦‚下: - - ```html - - ``` - - 最终会渲染为: - - ```html - - ```*/ - export class Icon extends React.Component { - render(): JSX.Element - } - - - - - // Input - interface InputProps { - /** ã€å¿…须】声明 input 类型,åŒåŽŸç”Ÿ input 标签的 type 属性*/ - type?: string, - id: string | number, - /** 控件大å°ï¼Œé»˜è®¤å€¼ä¸º default 。注:标准表å•内的输入框大å°é™åˆ¶ä¸º large。 {'large','default','small'}*/ - size?: string, - /** 是å¦ç¦ç”¨çжæ€ï¼Œé»˜è®¤ä¸º false*/ - disabled?: boolean, - value?: any, - /** 设置åˆå§‹é»˜è®¤å€¼*/ - defaultValue?: any, - className?: string, - /** 带标签的 input,设置å‰ç½®æ ‡ç­¾*/ - addonBefore?: React.ReactNode, - /** 带标签的 input,设置åŽç½®æ ‡ç­¾*/ - addonAfter?: React.ReactNode, - prefixCls?: string, - placeholder?: string - } - export class Input extends React.Component { - render(): JSX.Element - } - - - - - // InputNumber - interface InputNumberProps { - /** 最å°å€¼*/ - min: number, - /** 最大值*/ - max: number, - /** 当å‰å€¼*/ - value?: number, - /** æ¯æ¬¡æ”¹å˜æ­¥æ•°*/ - step?: number, - /** åˆå§‹å€¼*/ - defaultValue?: number, - /** å˜åŒ–回调*/ - onChange?: Function, - /** ç¦ç”¨*/ - disabled?: boolean, - /** 输入框大å°*/ - size?: string - - } - /** - * #InputNumber - 通过鼠标或键盘,输入范围内的数值。 - - ## 何时使用 - - 当需è¦èŽ·å–æ ‡å‡†æ•°å€¼æ—¶ã€‚*/ - export class InputNumber extends React.Component { - render(): JSX.Element - } - - - // Layout - // Row - interface RowProps { - type?: string, - align?: string, - justify?: string, - className?: string - } - export class Row extends React.Component { - render(): JSX.Element - } - - // Col - interface ColProps { - span?: string, - order?: string, - offset?: string, - push?: string, - pull?: string, - className?: string - } - /** - 在多数业务情况下,Ant Design需è¦åœ¨è®¾è®¡åŒºåŸŸå†…解决大é‡ä¿¡æ¯æ”¶çº³çš„问题,因此在12栅格系统的基础上,我们将整个设计建议区域按照24等分的原则进行划分。 - - 划分之åŽçš„ä¿¡æ¯åŒºå—我们称之为“盒å­â€ã€‚å»ºè®®æ¨ªå‘æŽ’åˆ—çš„ç›’å­æ•°é‡æœ€å¤šå››ä¸ªï¼Œæœ€å°‘一个。“盒å­â€åœ¨æ•´ä¸ªå±å¹•ä¸Šå æ¯”è§ä¸Šå›¾ã€‚设计部分基于盒å­çš„å•ä½å®šåˆ¶ç›’å­å†…部的排版规则,以ä¿è¯è§†è§‰å±‚é¢çš„舒适感。 - - ## 概述 - - 布局的栅格化系统,我们是基于行(row)和列(col)æ¥å®šä¹‰ä¿¡æ¯åŒºå—的外部框架,以ä¿è¯é¡µé¢çš„æ¯ä¸ªåŒºåŸŸèƒ½å¤Ÿç¨³å¥åœ°æŽ’布起æ¥ã€‚下é¢ç®€å•介ç»ä¸€ä¸‹å®ƒçš„工作原ç†ï¼š - - * 通过`row`在水平方å‘建立一组`column`(简写col) - * 你的内容应当放置于`col`å†…ï¼Œå¹¶ä¸”ï¼Œåªæœ‰`col`å¯ä»¥ä½œä¸º`row`的直接元素 - * 栅格系统中的列是指1到24的值æ¥è¡¨ç¤ºå…¶è·¨è¶Šçš„范围。例如,三个等宽的列å¯ä»¥ä½¿ç”¨`.col-8`æ¥åˆ›å»º - * 如果一个`row`中的`col`总和超过24,那么多余的`col`会作为一个整体å¦èµ·ä¸€è¡ŒæŽ’列 - - ## Flex 布局 - - æˆ‘ä»¬çš„æ …æ ¼åŒ–ç³»ç»Ÿæ”¯æŒ Flex 布局,å…许å­å…ƒç´ åœ¨çˆ¶èŠ‚ç‚¹å†…çš„æ°´å¹³å¯¹é½æ–¹å¼ - å±…å·¦ã€å±…中ã€å±…å³ã€ç­‰å®½æŽ’列ã€åˆ†æ•£æŽ’列。å­å…ƒç´ ä¸Žå­å…ƒç´ ä¹‹é—´ï¼Œæ”¯æŒé¡¶éƒ¨å¯¹é½ã€åž‚直居中对é½ã€åº•部对é½çš„æ–¹å¼ã€‚åŒæ—¶ï¼Œæ”¯æŒä½¿ç”¨ order æ¥å®šä¹‰å…ƒç´ çš„æŽ’列顺åºã€‚ - - Flex 布局是基于 24 æ …æ ¼æ¥å®šä¹‰æ¯ä¸€ä¸ªâ€œç›’å­â€çš„å®½åº¦ï¼Œä½†æŽ’ç‰ˆåˆ™ä¸æ‹˜æ³¥äºŽæ …格。*/ - export class Col extends React.Component { - render(): JSX.Element - } - - - - - // Menu - interface MenuItemProps { - /** - * (是å¦ç¦ç”¨) - * - * @type {boolean} - */ - disabled?: boolean, - key: string - } - export class MenuItem extends React.Component { - render(): JSX.Element - } - - interface MenuSubMenuProps { - /** - * (å­èœå•项值) - * - * @type {(string | React.ReactNode)} - */ - title: string | React.ReactNode, - /** - * (å­èœå•çš„èœå•项) - * - * @type {(MenuItem | MenuSubMenu)} - */ - children?: JSX.Element[] - } - export class MenuSubMenu extends React.Component { - render(): JSX.Element - } - - interface MenuItemGroupProps { - /** - * (分组标题) - * - * @type {(string | React.ReactNode)} - */ - title: string | React.ReactNode, - /** - * (分组的èœå•项) - * - * @type {MenuItem} - */ - children?: JSX.Element[] - } - export class MenuItemGroup extends React.Component { - render(): JSX.Element - } - - - // enum - enum MenuTheme { - light, - dark - } - enum MenuMode { - vertical, - horizontal, - inline - } - interface MenuProps { - /** 主题颜色*/ - theme?: MenuTheme | string, - /** èœå•类型 enum: `vertical` `horizontal` `inline`*/ - mode?: MenuMode | string, - /** 当å‰é€‰ä¸­çš„èœå•项 key 数组*/ - selectedKeys?: Array, - /** åˆå§‹é€‰ä¸­çš„èœå•项 key 数组*/ - defaultSelectedKeys?: Array, - /** 当å‰å±•开的èœå•项 key 数组*/ - openKeys?: Array, - /** åˆå§‹å±•开的èœå•项 key 数组*/ - defaultOpenKeys?: Array, - /** - * 被选中时调用 - * - * @type {(item: any, key: string, selectedKeys: Array) => void} - */ - onSelect?: (item: any, key: string, selectedKeys: Array) => void, - /** å–æ¶ˆé€‰ä¸­æ—¶è°ƒç”¨*/ - onDeselect?: (item: any, key: string, selectedKeys: Array) => void, - /** 点击 menuitem 调用此函数*/ - onClick?: (item: any, key: string) => void, - /** 根节点样å¼*/ - style?: Object - } - /** - # Menu - 为页é¢å’ŒåŠŸèƒ½æä¾›å¯¼èˆªçš„èœå•列表。 - - ## 何时使用 - - 导航èœå•是一个网站的çµé­‚,用户ä¾èµ–导航在å„个页é¢ä¸­è¿›è¡Œè·³è½¬ã€‚一般分为顶部导航和侧边导航,顶部导航æä¾›å…¨å±€æ€§çš„类目和功能,侧边导航æä¾›å¤šçº§ç»“æž„æ¥æ”¶çº³å’ŒæŽ’列网站架构。 - - 更多布局和导航的范例å¯ä»¥å‚考:[常用布局](/spec/layout)。*/ - export class Menu extends React.Component { - static Item: typeof MenuItem - static SubMenu: typeof MenuSubMenu - static ItemGroup: typeof MenuItemGroup - static Divider: typeof React.Component - render(): JSX.Element - } - - - - // Message - type MessageFunc = ( - /** æç¤ºå†…容*/ - content: string, - /** 自动关闭的延时*/ - duration?: number - ) => void - /** - * #Message - 全局展示æ“作å馈信æ¯ã€‚ - - ## 何时使用 - - - 坿供æˆåŠŸã€è­¦å‘Šå’Œé”™è¯¯ç­‰å馈信æ¯ã€‚ - - 顶部居中显示并自动消失,是一ç§ä¸æ‰“断用户æ“作的轻é‡çº§æç¤ºæ–¹å¼ã€‚*/ - export const message: { - - success: MessageFunc - error: MessageFunc - info: MessageFunc - loading: MessageFunc - config: (options: { - /** - * 消æ¯è·ç¦»é¡¶éƒ¨çš„ä½ç½® - * - * @type {number} - */ - top: number - }) => void - destroy: () => void - } - - // Modal - type ModalFunc = (options: { - visible?: boolean, - title?: React.ReactNode | string, - onOk?: Function, - onCancel?: Function, - width?: string | number, - iconClassName?: string, - okText?: string, - cancelText?: string - }) => void - - interface ModalProps { - /** å¯¹è¯æ¡†æ˜¯å¦å¯è§*/ - visible?: boolean, - /** 确定按钮 loading*/ - confirmLoading?: boolean, - /** 标题*/ - title?: React.ReactNode | string, - /** æ˜¯å¦æ˜¾ç¤ºå³ä¸Šè§’的关闭按钮*/ - closable?: boolean, - /** 点击确定回调*/ - onOk?: Function, - /** 点击é®ç½©å±‚或å³ä¸Šè§’剿ˆ–å–æ¶ˆæŒ‰é’®çš„回调*/ - onCancel?: Function, - /** 宽度*/ - width?: string | number, - /** 底部内容*/ - footer?: React.ReactNode | string, - /** 确认按钮文字*/ - okText?: string, - /** å–æ¶ˆæŒ‰é’®æ–‡å­—*/ - cancelText?: string, - /** 点击蒙层是å¦å…许关闭*/ - maskClosable?: boolean - } - - /** - # Modal - 模æ€å¯¹è¯æ¡†ã€‚ - - ## 何时使用 - - 需è¦ç”¨æˆ·å¤„ç†äº‹åŠ¡ï¼Œåˆä¸å¸Œæœ›è·³è½¬é¡µé¢ä»¥è‡´æ‰“断工作æµç¨‹æ—¶ï¼Œå¯ä»¥ä½¿ç”¨ `Modal` 在当å‰é¡µé¢æ­£ä¸­æ‰“开一个浮层,承载相应的æ“作。 - - å¦å¤–当需è¦ä¸€ä¸ªç®€æ´çš„确认框询问用户时,å¯ä»¥ä½¿ç”¨ç²¾å¿ƒå°è£…好的 `ant.Modal.confirm()` 等方法。*/ - export class Modal extends React.Component { - static info: ModalFunc - static success: ModalFunc - static error: ModalFunc - static confirm: ModalFunc - render(): JSX.Element - } - - - - - // Notification - type NotificationFunc = ( - config: { - /** 通知æé†’标题,必选 */ - message: React.ReactNode | string, - /** 通知æé†’内容,必选*/ - description: React.ReactNode | string, - /** 自定义关闭按钮*/ - btn?: React.ReactNode | string, - /** 当å‰é€šçŸ¥å”¯ä¸€æ ‡å¿—*/ - key?: string, - /** 点击默认关闭按钮时触å‘的回调函数*/ - onClose?: Function, - /** 默认 4.5 ç§’åŽè‡ªåŠ¨å…³é—­ï¼Œé…置为 null 则ä¸è‡ªåЍ关闭*/ - duration?: number - }) => void - /** - * #notification - 全局展示通知æé†’ä¿¡æ¯ã€‚ - - ## 何时使用 - - 在系统å³ä¸Šè§’显示通知æé†’ä¿¡æ¯ã€‚ç»å¸¸ç”¨äºŽä»¥ä¸‹æƒ…况: - - - è¾ƒä¸ºå¤æ‚的通知内容。 - - 带有交互的通知,给出用户下一步的行动点。 - - 系统主动推é€ã€‚*/ - export const notification: { - success: NotificationFunc - error: NotificationFunc - info: NotificationFunc - warn: NotificationFunc - close: (key: string) => void - destroy: () => void - config: (options: { - /** 消æ¯è·ç¦»é¡¶éƒ¨çš„ä½ç½®*/ - top: number - }) => void - - } - - - - - // Pagination - interface PaginationProps { - /** 当å‰é¡µæ•°*/ - current?: number, - /** 默认的当å‰é¡µæ•°*/ - defaultCurrent?: number, - /** æ•°æ®æ€»æ•°*/ - total: number, - /** åˆå§‹çš„æ¯é¡µæ¡æ•°*/ - defaultPageSize?: number, - /** æ¯é¡µæ¡æ•°*/ - pageSize?: number, - /** é¡µç æ”¹å˜çš„å›žè°ƒï¼Œå‚æ•°æ˜¯æ”¹å˜åŽçš„页ç */ - onChange?: Function, - /** 是å¦å¯ä»¥æ”¹å˜ pageSize */ - showSizeChanger?: boolean, - /** 指定æ¯é¡µå¯ä»¥æ˜¾ç¤ºå¤šå°‘æ¡*/ - pageSizeOptions?: Array - /** pageSize å˜åŒ–的回调 */ - onShowSizeChange?: Function, - /** 是å¦å¯ä»¥å¿«é€Ÿè·³è½¬è‡³æŸé¡µ*/ - showQuickJumper?: boolean, - /** 当为「smallã€æ—¶ï¼Œæ˜¯å°å°ºå¯¸åˆ†é¡µ */ - size?: string, - /** 当添加该属性时,显示为简å•分页*/ - simple?: Object, - /** ç”¨äºŽæ˜¾ç¤ºæ€»å…±æœ‰å¤šå°‘æ¡æ•°æ®*/ - showTotal?: Function - } - /** - * #Pagination - 采用分页的形å¼åˆ†éš”é•¿åˆ—è¡¨ï¼Œæ¯æ¬¡åªåŠ è½½ä¸€ä¸ªé¡µé¢ã€‚ - - ## 何时使用 - - - 当加载/渲染所有数æ®å°†èŠ±è´¹å¾ˆå¤šæ—¶é—´æ—¶ï¼› - - å¯åˆ‡æ¢é¡µç æµè§ˆæ•°æ®ã€‚*/ - export class Pagination extends React.Component { - render(): JSX.Element - } - - - - - // Popconfirm - enum Placement { - top, left, right, bottom - } - interface PopconfirmProps { - /** - * 气泡框ä½ç½®ï¼Œå¯é€‰ `top/left/right/bottom` - * - * @type {(Placement | string)} - */ - placement?: Placement | string, - /** 确认框的æè¿°*/ - title?: string, - /** 点击确认的回调*/ - onConfirm?: Function, - onCancel?: Function, - /** 显示éšè—的回调*/ - onVisibleChange?: (visible: boolean) => void, - /** 确认按钮文字*/ - okText?: string, - /** å–æ¶ˆæŒ‰é’®æ–‡å­—*/ - cancelText?: string - } - /** - * #Popconfirm - 点击元素,弹出气泡å¼çš„确认框。 - - ## 何时使用 - - 目标元素的æ“作需è¦ç”¨æˆ·è¿›ä¸€æ­¥çš„确认时,在目标元素附近弹出浮层æç¤ºï¼Œè¯¢é—®ç”¨æˆ·ã€‚ - - å’Œ `confirm` 弹出的全å±å±…中模æ€å¯¹è¯æ¡†ç›¸æ¯”ï¼Œäº¤äº’å½¢å¼æ›´è½»é‡ã€‚ - */ - export class Popconfirm extends React.Component { - render(): JSX.Element - } - - - - - // Popover - enum Trigger { - hover, focus, click - } - enum PopoverPlacement { - top, - left, right, bottom, - topLeft, topRight, bottomLeft, bottomRight, - leftTop, leftBottom, rightTop, rightBottom - } - interface PopoverProps { - /** 触å‘行为,å¯é€‰ `hover/focus/click` */ - trigger?: Trigger | string, - /** 气泡框ä½ç½®ï¼Œå¯é€‰ `top/left/right/bottom` `topLeft/topRight/bottomLeft/bottomRight` `leftTop/leftBottom/rightTop/rightBottom`*/ - placement?: PopoverPlacement | string, - /** å¡ç‰‡æ ‡é¢˜*/ - title?: React.ReactNode | string, - /** å¡ç‰‡å†…容*/ - overlay?: React.ReactNode | string, - prefixCls?: string, - /** 用于手动控制浮层显éš*/ - visible?: boolean, - /** 显示éšè—改å˜çš„回调*/ - onVisibleChange?: Function - } - /** - * #Popover - 点击/鼠标移入元素,弹出气泡å¼çš„å¡ç‰‡æµ®å±‚。 - - ## 何时使用 - - 当目标元素有进一步的æè¿°å’Œç›¸å…³æ“作时,å¯ä»¥æ”¶çº³åˆ°å¡ç‰‡ä¸­ï¼Œæ ¹æ®ç”¨æˆ·çš„æ“ä½œè¡Œä¸ºè¿›è¡Œå±•çŽ°ã€‚ - - å’Œ `Tooltip` 的区别是,用户å¯ä»¥å¯¹æµ®å±‚上的元素进行æ“作,因此它å¯ä»¥æ‰¿è½½æ›´å¤æ‚的内容,比如链接或按钮等。 - */ - export class Popover extends React.Component { - render(): JSX.Element - } - - - - - // Progress - enum ProgressStatus { - normal, - exception, - active - } - - interface LineProps { - /** 百分比*/ - percent: number, - /** 内容的模æ¿å‡½æ•°*/ - format?: (percent: any) => void, - /** 状æ€ï¼Œå¯é€‰ï¼šnormalã€exceptionã€active*/ - status?: ProgressStatus | string, - /** 进度æ¡çº¿çš„宽度,å•使˜¯px*/ - strokeWidth?: number, - /** æ˜¯å¦æ˜¾ç¤ºè¿›åº¦æ•°å€¼å’Œçжæ€å›¾æ ‡*/ - showInfo?: boolean - } - export class Line extends React.Component { - render(): JSX.Element - } - - interface CircleProps { - /** 百分比*/ - percent: number, - /** 内容的模æ¿å‡½æ•°*/ - format?: (percent: any) => void, - /** 状æ€ï¼Œå¯é€‰ï¼šnormalã€exception*/ - status?: ProgressStatus | string, - /** 进度æ¡çº¿çš„宽度,å•使˜¯è¿›åº¦æ¡ç”»å¸ƒå®½åº¦çš„百分比*/ - strokeWidth?: number, - /** 必填,进度æ¡ç”»å¸ƒå®½åº¦ï¼Œå•ä½px。这里没有æä¾›height属性设置,Line型高度就是strokeWidth,Circle型高度等于width*/ - width?: number - } - export class Circle extends React.Component { - render(): JSX.Element - } - /** - * #Progress - 展示æ“作的当å‰è¿›åº¦ã€‚ - - ## 何时使用 - - 在æ“作需è¦è¾ƒé•¿æ—¶é—´æ‰èƒ½å®Œæˆæ—¶ï¼Œä¸ºç”¨æˆ·æ˜¾ç¤ºè¯¥æ“作的当å‰è¿›åº¦å’Œçжæ€ã€‚ - - * 当一个æ“作会打断当å‰ç•Œé¢ï¼Œæˆ–者需è¦åœ¨åŽå°è¿è¡Œï¼Œä¸”耗时å¯èƒ½è¶…过2ç§’æ—¶ï¼› - * å½“éœ€è¦æ˜¾ç¤ºä¸€ä¸ªæ“作完æˆçš„百分比时。*/ - export const Progress: { - Line: typeof Line, - Circle: typeof Circle - } - - - // QueueAnim - interface QueueAnimProps { - /** åŠ¨ç”»å†…ç½®å‚æ•° `left` `right` `top` `bottom` `scale` `scaleBig` `scaleX` `scaleY`*/ - type?: string | Array, - /** é…ç½®åŠ¨ç”»å‚æ•° 如 `{opacity:[1, 0],translateY:[0, -30]}` 具体å‚考 [velocity](http://julian.com/research/velocity) 的写法*/ - animConfig?: Object | Array, - /** 整个动画的延时,以毫秒为å•ä½*/ - delay?: number | Array, - /** æ¯ä¸ªåŠ¨ç”»çš„æ—¶é—´,以毫秒为å•ä½*/ - duration?: number | Array, - /** æ¯ä¸ªåŠ¨ç”»çš„é—´éš”æ—¶é—´,以毫秒为å•ä½*/ - interval?: number | Array, - /** 出场时是å¦å€’放,从最åŽä¸€ä¸ª dom 开始往上播放 */ - leaveReverse?: boolean, - /** 动画的缓动函数,[查看详细](http://julian.com/research/velocity/#easing)*/ - ease?: string | Array, - /** 进出场动画进行中的类å*/ - animatingClassName?: Array, - /** QueueAnim 替æ¢çš„æ ‡ç­¾å*/ - component?: string - } - /** - * #QueueAnim - 通过简å•çš„é…置对一组元素添加串行的进场动画效果。 - - ## 何时使用 - - - 从内容A到内容B的转å˜è¿‡ç¨‹æ—¶èƒ½æœ‰æ•ˆçš„å¸å¼•用户注æ„力,çªå‡ºè§†è§‰ä¸­å¿ƒï¼Œæé«˜æ•´ä½“视觉效果。 - - - å°çš„ä¿¡æ¯å…ƒç´ æŽ’布或å—状较多的情况下,根æ®ä¸€å®šçš„è·¯å¾„å±‚æ¬¡ä¾æ¬¡è¿›åœºï¼ŒåŒºåˆ†ç»´åº¦å±‚级,æ¥å‡¸æ˜¾é‡çº§ï¼Œä½¿é¡µé¢è½¬åœºæ›´åŠ æµç•…和舒适,æé«˜æ•´ä½“视觉效果和产å“的质感。 - - - 特别适åˆé¦–页和需è¦è§†è§‰å±•示效果的宣传页,以åŠå•页应用的切æ¢é¡µé¢åŠ¨æ•ˆã€‚ - */ - export class QueueAnim extends React.Component { - render(): JSX.Element - } - - - - - // Radio - enum RadioGroupSize { - large, - default, - small - } - interface RadioGroupProps { - /** 选项å˜åŒ–时的回调函数*/ - onChange?: (e: Event) => void, - /** 用于设置当å‰é€‰ä¸­çš„值*/ - value?: string, - /** 默认选中的值*/ - defaultValue?: string, - /** 大å°ï¼Œåªå¯¹æŒ‰é’®æ ·å¼ç”Ÿæ•ˆ*/ - size?: RadioGroupSize | string - } - export class RadioGroup extends React.Component { - render(): JSX.Element - } - - - interface RadioProps { - /** æŒ‡å®šå½“å‰æ˜¯å¦é€‰ä¸­*/ - checked?: boolean, - /** åˆå§‹æ˜¯å¦é€‰ä¸­*/ - defaultChecked?: boolean, - /** æ ¹æ® value 进行比较,判断是å¦é€‰ä¸­ */ - value?: any - } - /** - * #Radio - å•选框。 - - ## 何时使用 - - - 用于在多个备选项中选中å•个状æ€ã€‚ - - å’Œ Select 的区别是,Radio 所有选项默认å¯è§ï¼Œæ–¹ä¾¿ç”¨æˆ·åœ¨æ¯”较中选择,因此选项ä¸å®œè¿‡å¤šã€‚ - */ - export class Radio extends React.Component { - static Group: typeof RadioGroup - static Button: typeof Button - render(): JSX.Element - } - - - - // Select - interface SelectOptionProps { - /** 是å¦ç¦ç”¨*/ - disabled?: boolean, - /** 如果 react 需è¦ä½ è®¾ç½®æ­¤é¡¹ï¼Œæ­¤é¡¹å€¼ä¸Ž value 的值相åŒï¼Œç„¶åŽå¯ä»¥çœç•¥ value 设置*/ - key?: string, - /** é»˜è®¤æ ¹æ®æ­¤å±žæ€§å€¼è¿›è¡Œç­›é€‰*/ - value: string - } - export class SelectOption extends React.Component { - render(): JSX.Element - } - - interface SelectOptGroupProps { - /** 组å*/ - label: string | React.ReactNode, - key?: string - } - export class SelectOptGroup extends React.Component { - render(): JSX.Element - } - - interface SelectProps { - /** 指定当å‰é€‰ä¸­çš„æ¡ç›®*/ - value?: string | Array, - /** 指定默认选中的æ¡ç›®*/ - defaultValue?: string | Array, - /** 支æŒå¤šé€‰*/ - multiple?: boolean, - /** æ”¯æŒæ¸…除, å•é€‰æ¨¡å¼æœ‰æ•ˆ*/ - allowClear?: boolean, - /** æ˜¯å¦æ ¹æ®è¾“入项进行筛选,å¯ä¸ºä¸€ä¸ªå‡½æ•°ï¼Œè¿”å›žæ»¡è¶³è¦æ±‚çš„ option å³å¯*/ - filterOption?: boolean | Function, - /** å¯ä»¥æŠŠéšæ„输入的æ¡ç›®ä½œä¸º tag,输入项ä¸éœ€è¦ä¸Žä¸‹æ‹‰é€‰é¡¹åŒ¹é…*/ - tags?: boolean, - /** è¢«é€‰ä¸­æ—¶è°ƒç”¨ï¼Œå‚æ•°ä¸ºé€‰ä¸­é¡¹çš„ value 值 */ - onSelect?: (value: any, option: any) => void, - /** å–æ¶ˆé€‰ä¸­æ—¶è°ƒç”¨ï¼Œå‚数为选中项的 option value 值,仅在 multiple 或 tags 模å¼ä¸‹ç”Ÿæ•ˆ*/ - onDeselect?: (value: any, option: any) => void, - /** 选中option,或inputçš„valueå˜åŒ–(combobox 模å¼ä¸‹)时,调用此函数*/ - onChange?: (value: any, label: any) => void, - /** 文本框值å˜åŒ–时回调*/ - onSearch?: (value: string) => void, - /** 选择框默认文字*/ - placeholder?: string, - /** æœç´¢æ¡†é»˜è®¤æ–‡å­—*/ - searchPlaceholder?: string, - /** 当下拉列表为空时显示的内容*/ - notFoundContent?: string, - /** 下拉èœå•和选择器åŒå®½*/ - dropdownMatchSelectWidth?: boolean, - /** æœç´¢æ—¶è¿‡æ»¤å¯¹åº”çš„ option 属性,如设置为 children 表示对内嵌内容进行æœç´¢*/ - optionFilterProp?: string, - /** 输入框自动æç¤ºæ¨¡å¼*/ - combobox?: SVGSymbolElement, - /** 选择框大å°ï¼Œå¯é€‰ `large` `small` */ - size?: string, - /** 在下拉中显示æœç´¢æ¡†*/ - showSearch?: boolean, - /** 是å¦ç¦ç”¨*/ - disabled?: boolean, - style?: Object - } - /** - * #Select - 类似 Select2 的选择器。 - - ## 何时使用 - - 弹出一个下拉èœå•给用户选择æ“作,用于代替原生的选择器,或者需è¦ä¸€ä¸ªæ›´ä¼˜é›…的多选器时。*/ - export class Select extends React.Component { - static Option: typeof SelectOption - static OptGroup: typeof SelectOptGroup - render(): JSX.Element - } - - - - // Slider - interface SliderProps { - /** 最å°å€¼*/ - min?: number, - /** 最大值*/ - max?: number, - /** 步长,å–值必须大于 0,并且å¯è¢« (max - min) 整除。当 `marks` ä¸ä¸ºç©ºå¯¹è±¡æ—¶ï¼Œå¯ä»¥è®¾ç½® `step` 为 `null`,此时 Slider çš„å¯é€‰å€¼ä»…有 marks 标出æ¥çš„部分。*/ - step?: number, - /** 分段标记,key 的类型必须为 `Number` 且å–值在闭区间 [min, max] 内*/ - marks?: { key: number, value: any }, - /** 设置当å‰å–值。当 `range` 为 `false` 时,使用 `Number`,å¦åˆ™ç”¨ `[Number, Number]`*/ - value?: number | Array, - /** 设置当å‰å–值。当 `range` 为 `false` 时,使用 `Number`,å¦åˆ™ç”¨ `[Number, Number]`*/ - defaultValue?: number | Array, - /** `marks` ä¸ä¸ºç©ºå¯¹è±¡æ—¶æœ‰æ•ˆï¼Œå€¼ä¸º true 时表示值为包å«å…³ç³»ï¼Œfalse 表示并列*/ - included?: boolean, - /** 值为 `true` 时,滑å—为ç¦ç”¨çжæ€*/ - disabled?: boolean, - /** 当 `range` 为 `true` 时,该属性å¯ä»¥è®¾ç½®æ˜¯å¦å…许两个滑å—交æ¢ä½ç½®ã€‚*/ - allowCross?: boolean, - /** 当 Slider 的值å‘ç”Ÿæ”¹å˜æ—¶ï¼Œä¼šè§¦å‘ onChange 事件,并把改å˜åŽçš„å€¼ä½œä¸ºå‚æ•°ä¼ å…¥ã€‚*/ - onChange?: Function, - /** 与 `onmouseup` è§¦å‘æ—¶æœºä¸€è‡´ï¼ŒæŠŠå½“å‰å€¼ä½œä¸ºå‚数传入。*/ - onAfterChange?: Function, - /** Slider 会把当å‰å€¼ä¼ ç»™ `tipFormatter`,并在 Tooltip 中显示 `tipFormatter` 的返回值,若为 null,则éšè— Tooltip。*/ - tipFormatter?: Function | any, - range?: boolean - } - /** - * #Slider - 滑动型输入器,展示当å‰å€¼å’Œå¯é€‰èŒƒå›´ã€‚ - - ## 何时使用 - - 当用户需è¦åœ¨æ•°å€¼åŒºé—´/自定义区间内进行选择时,å¯ä¸ºè¿žç»­æˆ–离散值。*/ - export class Slider extends React.Component { - render(): JSX.Element - } - - - - - // Spin - interface SpinProps { - /** spin组件中点的大å°ï¼Œå¯é€‰å€¼ä¸º small default large*/ - size?: string, - /** 用于内嵌其他组件的模å¼ï¼Œå¯ä»¥å…³é—­ loading 效果*/ - spining?: boolean - } - /** - * #Spin - 用于页é¢å’ŒåŒºå—的加载中状æ€ã€‚ - - ## 何时使用 - - 页é¢å±€éƒ¨å¤„äºŽç­‰å¾…å¼‚æ­¥æ•°æ®æˆ–正在渲染过程时,åˆé€‚的加载动效会有效缓解用户的焦虑。 - */ - export class Spin extends React.Component { - render(): JSX.Element - } - - - - - // Steps - enum StepStatus { - wait, process, finish - } - interface StepProps { - /** å¯é€‰å‚数,指定状æ€ã€‚当ä¸é…置该属性时,会使用父Steps元素的currentæ¥è‡ªåŠ¨æŒ‡å®šçŠ¶æ€ã€‚*/ - status?: StepStatus | string, - /** å¿…è¦å‚数,标题。*/ - title: string | React.ReactNode, - /** å¯é€‰å‚数,步骤的详情æè¿°ã€‚*/ - description?: string | React.ReactNode, - /** å¯é€‰å‚数,步骤的Iconã€‚å¦‚æžœä¸æŒ‡å®šï¼Œåˆ™ä½¿ç”¨é»˜è®¤çš„æ ·å¼ã€‚*/ - icon?: string | React.ReactNode - } - export class Step extends React.Component { - render(): JSX.Element - } - - interface StepsProps { - /** å¯é€‰å‚数,指定当å‰å¤„ç†æ­£åœ¨æ‰§è¡Œçжæ€çš„æ­¥éª¤ï¼Œä»Ž0开始记数。在å­Step元素中,å¯ä»¥é€šè¿‡status属性覆盖状æ€ã€‚*/ - current?: number, - /** å¯é€‰å‚数,指定大å°ï¼ˆç›®å‰åªæ”¯æŒæ™®é€šå’Œè¿·ä½ ä¸¤ç§å¤§å°ï¼‰ã€‚ small, default */ - size?: string, - /** å¯é€‰å‚æ•°ï¼ŒæŒ‡å®šæ­¥éª¤æ¡æ–¹å‘ï¼ˆç›®å‰æ”¯æŒæ°´å¹³å’Œç«–ç›´ä¸¤ç§æ–¹å‘,默认水平方å‘)。*/ - direction?: string, - /** å¯é€‰å‚数,指定步骤的详细æè¿°æ–‡å­—的最大宽度。*/ - maxDescriptionWidth?: number - - } - /** - * #Steps - 引导用户按照æµç¨‹å®Œæˆä»»åŠ¡çš„å¯¼èˆªæ¡ã€‚ - - ## 何时使用 - - å½“ä»»åŠ¡å¤æ‚或者存在先åŽå…³ç³»æ—¶ï¼Œå°†å…¶åˆ†è§£æˆä¸€ç³»åˆ—步骤,从而简化任务。*/ - export class Steps extends React.Component { - static Step: typeof Step - render(): JSX.Element - } - - - - // Switch - interface SwitchProps { - /** æŒ‡å®šå½“å‰æ˜¯å¦é€‰ä¸­*/ - checked?: boolean, - /** åˆå§‹æ˜¯å¦é€‰ä¸­*/ - defaultChecked?: boolean, - /** å˜åŒ–时回调函数*/ - onChange?: (checked: boolean) => void, - /** 选中时的内容*/ - checkedChildren?: React.ReactNode, - /** éžé€‰ä¸­æ—¶çš„内容*/ - unCheckedChildren?: React.ReactNode, - /** 开关大å°*/ - size?: string - } - /** - * #Switch - 开关选择器。 - - ## 何时使用 - - - 需è¦è¡¨ç¤ºå¼€å…³çжæ€/两ç§çжæ€ä¹‹é—´çš„åˆ‡æ¢æ—¶ï¼› - - å’Œ `checkbox `çš„åŒºåˆ«æ˜¯ï¼Œåˆ‡æ¢ `switch` 会直接触å‘çŠ¶æ€æ”¹å˜ï¼Œè€Œ `checkbox` ä¸€èˆ¬ç”¨äºŽçŠ¶æ€æ ‡è®°ï¼Œéœ€è¦å’Œæäº¤æ“作é…åˆã€‚ - */ - export class Switch extends React.Component { - render(): JSX.Element - } - - - - - // Table - enum RowSelectionType { - checkbox, - radio - } - type SelectedRowKeys = Array - interface RowSelection { - type?: RowSelectionType | string, - selectedRowKeys?: SelectedRowKeys, - onChange?: (selectedRowKeys: SelectedRowKeys, selectedRows: any) => void, - getCheckboxProps?: (record: any) => void, - onSelect?: (record: any, selected: any, selectedRows: any) => void, - onSelectAll?: (rselectedecord: any, selectedRows: any, changeRows: any) => void - } - interface Columns { - /** React 需è¦çš„ key,建议设置*/ - key?: string, - /** 列头显示文字*/ - title?: string | React.ReactNode, - /** 列数æ®åœ¨æ•°æ®é¡¹ä¸­å¯¹åº”çš„ key*/ - dataIndex?: string, - /** 生æˆå¤æ‚æ•°æ®çš„æ¸²æŸ“å‡½æ•°ï¼Œå‚æ•°åˆ†åˆ«ä¸ºå½“å‰åˆ—的值,当å‰åˆ—æ•°æ®ï¼Œåˆ—索引,@return里é¢å¯ä»¥è®¾ç½®è¡¨æ ¼[行/列åˆå¹¶](#demo-colspan-rowspan)*/ - render?: (text?: any, record?: any, index?: number) => React.ReactNode, - /** 表头的筛选èœå•项*/ - filters?: Array, - /** 本地模å¼ä¸‹ï¼Œç¡®å®šç­›é€‰çš„è¿è¡Œå‡½æ•°*/ - onFilter?: Function, - /** 是å¦å¤šé€‰*/ - filterMultiple?: boolean, - /** 排åºå‡½æ•°ï¼Œæœ¬åœ°æŽ’åºä½¿ç”¨ä¸€ä¸ªå‡½æ•°ï¼Œéœ€è¦æœåŠ¡ç«¯æŽ’åºå¯è®¾ä¸º true */ - sorter?: boolean | Function, - /** 表头列åˆå¹¶,设置为 0 æ—¶ï¼Œä¸æ¸²æŸ“*/ - colSpan?: number, - /** 列宽度*/ - width?: string | number, - /** 列的 className*/ - className?: string - } - interface TableProps { - /** 列表项是å¦å¯é€‰æ‹©*/ - rowSelection?: RowSelection, - /** 分页器*/ - pagination?: Object, - /** 正常或迷你类型 : `default` or `small` */ - size?: string, - /** æ•°æ®æ•°ç»„*/ - dataSource: Array, - /** 表格列的é…ç½®æè¿°*/ - columns: Columns, - /** 表格行 key çš„å–值*/ - rowKey?: (record: any, index: number) => string, - /** é¢å¤–的展开行*/ - expandedRowRender?: Function, - /** 默认展开的行*/ - defaultExpandedRowKeys?: Array, - /** åˆ†é¡µã€æŽ’åºã€ç­›é€‰å˜åŒ–时触å‘*/ - onChange?: (pagination: Object, filters: any, sorter: any) => void, - /** 页颿˜¯å¦åŠ è½½ä¸­*/ - loading?: boolean, - /** 默认文案设置,目å‰åŒ…括排åºã€è¿‡æ»¤ã€ç©ºæ•°æ®æ–‡æ¡ˆ: `{ filterConfirm: '确定', filterReset: 'é‡ç½®', emptyText: '暂无数æ®' }` */ - locale?: Object, - /** å±•ç¤ºæ ‘å½¢æ•°æ®æ—¶ï¼Œæ¯å±‚缩进的宽度,以 px 为å•ä½*/ - indentSize?: number, - /** 处ç†è¡Œç‚¹å‡»äº‹ä»¶*/ - onRowClick?: (record: any, index: number) => void, - /** 是å¦å›ºå®šè¡¨å¤´*/ - useFixedHeader?: boolean, - /** 是å¦å±•示外边框和列边框*/ - bordered?: boolean, - /** æ˜¯å¦æ˜¾ç¤ºè¡¨å¤´*/ - showHeader?: boolean, - /** 表格底部自定义渲染函数*/ - footer?: (currentPageData: Object) => void - - } - /** - * #Table - 展示行列数æ®ã€‚ - - ## 何时使用 - - - 当有大é‡ç»“构化的数æ®éœ€è¦å±•现时; - - 当需è¦å¯¹æ•°æ®è¿›è¡ŒæŽ’åºã€æœç´¢ã€åˆ†é¡µã€è‡ªå®šä¹‰æ“ä½œç­‰å¤æ‚行为时。*/ - export class Table extends React.Component { - render(): JSX.Element - } - - - - // Tabs - interface TabPaneProps { - /** 选项å¡å¤´æ˜¾ç¤ºæ–‡å­—*/ - tab: React.ReactNode | string - } - export class TabPane extends React.Component { - render(): JSX.Element - } - - enum TabsType { - line, card, 'editable-card' - } - enum TabsPosition { - top, - right, - bottom, - left - } - interface TabsProps { - /** 当剿¿€æ´» tab 颿¿çš„ key */ - activeKey?: string, - /** åˆå§‹åŒ–选䏭颿¿çš„ key,如果没有设置 activeKey*/ - defaultActiveKey?: string, - /** 切æ¢é¢æ¿çš„回调*/ - onChange?: Function, - /** tab 被点击的回调 */ - onTabClick?: Function, - /** tab bar 上é¢å¤–的元素 */ - tabBarExtraContent?: React.ReactNode, - /** 页签的基本样å¼ï¼Œå¯é€‰ `line`ã€`card` `editable-card` 类型*/ - type?: TabsType | string, - /** 页签ä½ç½®ï¼Œå¯é€‰å€¼æœ‰ `top` `right` `bottom` `left`*/ - tabPosition?: TabsPosition | string, - /** 新增和删除页签的回调,在 `type="editable-card"` 时有效*/ - onEdit?: (targetKey: string, action: any) => void - } - /** - * #Tabs - 选项å¡åˆ‡æ¢ç»„件。 - - ## 何时使用 - - æä¾›å¹³çº§çš„区域将大å—å†…å®¹è¿›è¡Œæ”¶çº³å’Œå±•çŽ°ï¼Œä¿æŒç•Œé¢æ•´æ´ã€‚ - - Ant Design 便¬¡æä¾›äº†ä¸‰çº§é€‰é¡¹å¡ï¼Œåˆ†åˆ«ç”¨äºŽä¸åŒçš„场景。 - - - å¡ç‰‡å¼çš„页签,æä¾›å¯å…³é—­çš„æ ·å¼ï¼Œå¸¸ç”¨äºŽå®¹å™¨é¡¶éƒ¨ã€‚ - - 标准线æ¡å¼é¡µç­¾ï¼Œç”¨äºŽå®¹å™¨å†…部的主功能切æ¢ï¼Œè¿™æ˜¯æœ€å¸¸ç”¨çš„ Tabs。 - - [RadioButton](/components/radio/#demo-radiobutton) å¯ä½œä¸ºæ›´æ¬¡çº§çš„页签æ¥ä½¿ç”¨ã€‚*/ - export class Tabs extends React.Component { - static TabPane: typeof TabPane - render(): JSX.Element - } - - - - - // Tag - interface TagProps { - /** 标签是å¦å¯ä»¥å…³é—­*/ - closable?: boolean, - /** 关闭时的回调*/ - onClose?: Function, - /** 动画关闭åŽçš„回调*/ - afterClose?: Function, - /** 标签的色彩*/ - color?: string - } - /** - * #Tag - è¿›è¡Œæ ‡è®°å’Œåˆ†ç±»çš„å°æ ‡ç­¾ã€‚ - - ## 何时使用 - - - 用于标记事物的属性和维度。 - - 进行分类。*/ - export class Tag extends React.Component { - render(): JSX.Element - } - - - - - - - // TimePicker - interface TimePickerProps { - /** 默认时间*/ - value?: string | Date, - /** åˆå§‹é»˜è®¤æ—¶é—´*/ - defaultValue?: string | Date, - /** å±•ç¤ºçš„æ—¶é—´æ ¼å¼ : "HH:mm:ss"ã€"HH:mm"ã€"mm:ss" */ - format?: string, - /** æ—¶é—´å‘生å˜åŒ–的回调*/ - onChange?: (Date: Date) => void, - /** ç¦ç”¨å…¨éƒ¨æ“作*/ - disabled?: boolean, - /** 没有值的时候显示的内容*/ - placeholder?: string, - /** 国际化é…ç½®*/ - locale?: Object, - /** éšè—ç¦æ­¢é€‰æ‹©çš„选项*/ - hideDisabledOptions?: boolean, - /** ç¦æ­¢é€‰æ‹©éƒ¨åˆ†å°æ—¶é€‰é¡¹*/ - disabledHours?: Function, - /** ç¦æ­¢é€‰æ‹©éƒ¨åˆ†åˆ†é’Ÿé€‰é¡¹*/ - disabledMinutes?: Function, - /** ç¦æ­¢é€‰æ‹©éƒ¨åˆ†ç§’选项*/ - disabledSeconds?: Function - - } - /** - * #TimePicker - 输入或选择时间的控件。 - - 何时使用 - -------- - - 当用户需è¦è¾“入一个时间,å¯ä»¥ç‚¹å‡»æ ‡å‡†è¾“å…¥æ¡†ï¼Œå¼¹å‡ºæ—¶é—´é¢æ¿è¿›è¡Œé€‰æ‹©ã€‚ - */ - export class TimePicker extends React.Component { - render(): JSX.Element - } - - - - - // Timeline - interface TimeLineItemProps { - /** 指定圆圈颜色。*/ - color?: string - } - export class TimeLineItem extends React.Component { - render(): JSX.Element - } - - interface TimelineProps { - /** 指定最åŽä¸€ä¸ªå¹½çµèŠ‚ç‚¹æ˜¯å¦å­˜åœ¨æˆ–内容*/ - pending?: boolean | React.ReactNode - } - /** - * #Timeline - 垂直展示的时间æµä¿¡æ¯ã€‚ - - ## 何时使用 - - - 当有一系列信æ¯éœ€è¦ä»Žä¸Šè‡³ä¸‹æŒ‰æ—¶é—´æŽ’列时; - - éœ€è¦æœ‰ä¸€æ¡æ—¶é—´è½´è¿›è¡Œè§†è§‰ä¸Šçš„ä¸²è”æ—¶ï¼›*/ - export class Timeline extends React.Component { - static Item: typeof TimeLineItem - render(): JSX.Element - } - - - - // Tooltip - - interface TooltipProps { - /** 气泡框ä½ç½®ï¼Œå¯é€‰ `top` `left` `right` `bottom` `topLeft` `topRight` `bottomLeft` `bottomRight` `leftTop` `leftBottom` `rightTop` `rightBottom`*/ - placement?: PopoverPlacement | string, - /** æç¤ºæ–‡å­—*/ - title?: string | React.ReactNode - } - /** - * #Tooltip - 简å•的文字æç¤ºæ°”泡框。 - - ## 何时使用 - - 鼠标移入则显示æç¤ºï¼Œç§»å‡ºæ¶ˆå¤±ï¼Œæ°”æ³¡æµ®å±‚ä¸æ‰¿è½½å¤æ‚文本和æ“作。 - - å¯ç”¨æ¥ä»£æ›¿ç³»ç»Ÿé»˜è®¤çš„ `title` æç¤ºï¼Œæä¾›ä¸€ä¸ª`按钮/文字/æ“作`的文案解释。*/ - export class Tooltip extends React.Component { - render(): JSX.Element - } - - - - - - // Transfer - interface TransferProps { - /** æ•°æ®æº*/ - dataSource: Array, - /** æ¯è¡Œæ•°æ®æ¸²æŸ“函数*/ - render?: (record: Object) => any, - /** 显示在å³ä¾§æ¡†æ•°æ®çš„key集åˆ*/ - targetKeys: Array, - /** å˜åŒ–时回调函数*/ - onChange?: (targetKeys: any, direction: string, moveKeys: any) => void, - /** 两个穿梭框的自定义样å¼*/ - listStyle?: Object, - /** 自定义类*/ - className?: string, - /** 标题集åˆ,顺åºä»Žå·¦è‡³å³*/ - titles?: Array, - /** æ“作文案集åˆ,顺åºä»Žä¸Šè‡³ä¸‹*/ - operations?: Array, - /** æ˜¯å¦æ˜¾ç¤ºæœç´¢æ¡†*/ - showSearch?: boolean, - /** æœç´¢æ¡†çš„默认值*/ - searchPlaceholder?: string, - /** 当列表为空时显示的内容*/ - notFoundContent?: React.ReactNode | string - /** 底部渲染函数*/ - footer?: (props: any) => any - } - /** - * #Transfer - åŒæ ç©¿æ¢­é€‰æ‹©æ¡†ã€‚ - - ## 何时使用 - - 用直观的方å¼åœ¨ä¸¤æ ä¸­ç§»åŠ¨å…ƒç´ ï¼Œå®Œæˆé€‰æ‹©è¡Œä¸ºã€‚ - */ - export class Transfer extends React.Component { - render(): JSX.Element - } - - - - - - // Tree - interface TreeNodeProps { - disabled?: boolean, - disableCheckbox?: boolean, - title?: string | React.ReactNode, - key?: string, - isLeaf?: boolean - } - export class TreeNode extends React.Component { - render(): JSX.Element - } - - interface TreeProps { - showLine?: boolean, - className?: string, - /** æ˜¯å¦æ”¯æŒå¤šé€‰*/ - multiple?: boolean, - /** æ˜¯å¦æ”¯æŒé€‰ä¸­*/ - checkable?: boolean, - /** 默认展开所有树节点*/ - defaultExpandAll?: boolean, - /** 默认展开指定的树节点*/ - defaultExpandedKeys?: Array, - /** ï¼ˆå—æŽ§ï¼‰å±•å¼€æŒ‡å®šçš„æ ‘èŠ‚ç‚¹*/ - expandedKeys?: Array, - /** ï¼ˆå—æŽ§ï¼‰é€‰ä¸­å¤é€‰æ¡†çš„æ ‘节点*/ - checkedKeys?: Array, - /** 默认选中å¤é€‰æ¡†çš„æ ‘节点*/ - defaultCheckedKeys?: Array, - /** ï¼ˆå—æŽ§ï¼‰è®¾ç½®é€‰ä¸­çš„æ ‘èŠ‚ç‚¹*/ - selectedKeys?: Array, - /** 默认选中的树节点*/ - defaultSelectedKeys?: Array, - /** 展开/æ”¶èµ·èŠ‚ç‚¹æ—¶è§¦å‘ */ - onExpand?: (node: any, expanded: any, expandedKeys: any) => void, - /** 点击å¤é€‰æ¡†è§¦å‘*/ - onCheck?: (checkedKeys: any, e: { checked: boolean, checkedNodes: any, node: any, event: Event }) => void, - /** 点击树节点触å‘*/ - onSelect?: (selectedKeys: any, e: { selected: boolean, selectedNodes: any, node: any, event: Event }) => void, - /** filter some treeNodes as you need. it should return true */ - filterTreeNode?: (node: any) => boolean, - /** 异步加载数æ®*/ - loadData?: (node: any) => void, - /** å“应å³é”®ç‚¹å‡»*/ - onRightClick?: (options: { event: Event, node: any }) => void, - /** è®¾ç½®èŠ‚ç‚¹å¯æ‹–拽(IE>8)*/ - draggable?: boolean, - /** 开始拖拽时调用*/ - onDragStart?: (options: { event: Event, node: any }) => void, - /** dragenter è§¦å‘æ—¶è°ƒç”¨*/ - onDragEnter?: (options: { event: Event, node: any, expandedKeys: any }) => void, - /** dragover è§¦å‘æ—¶è°ƒç”¨ */ - onDragOver?: (options: { event: Event, node: any }) => void, - /** dragleave è§¦å‘æ—¶è°ƒç”¨*/ - onDragLeave?: (options: { event: Event, node: any }) => void, - /** drop è§¦å‘æ—¶è°ƒç”¨*/ - onDrop?: (options: { event: Event, node: any, dragNode: any, dragNodesKeys: any }) => void, - } - /** - * #Tree - * 文件夹ã€ç»„织架构ã€ç”Ÿç‰©åˆ†ç±»ã€å›½å®¶åœ°åŒºç­‰ç­‰ï¼Œä¸–间万物的大多数结构都是树形结构。使用`树控件`å¯ä»¥å®Œæ•´å±•现其中的层级关系,并具有展开收起选择等交互功能。 - */ - export class Tree extends React.Component { - static TreeNode: typeof TreeNode - render(): JSX.Element - } - - - - - - // TreeSelect - interface TreeSelectTreeNodeProps { - disabled?: boolean, - /** 此项必须设置(其值在整个树范围内唯一)*/ - key: string, - /** é»˜è®¤æ ¹æ®æ­¤å±žæ€§å€¼è¿›è¡Œç­›é€‰*/ - value?: string, - /** 树节点显示的内容*/ - title?: React.ReactNode | string, - /** æ˜¯å¦æ˜¯å¶å­èŠ‚ç‚¹*/ - isLeaf?: boolean - } - export class TreeSelectTreeNode extends React.Component { - render(): JSX.Element - } - - type TreeData = Array<{ value: any, label: string, children: TreeData }> - interface TreeSelectProps { - style?: Object, - /** 指定当å‰é€‰ä¸­çš„æ¡ç›®*/ - value?: string | Array, - /** 指定默认选中的æ¡ç›®*/ - defaultValue?: string | Array, - /** 支æŒå¤šé€‰*/ - multiple?: boolean, - /** å¯ä»¥æŠŠéšæ„输入的æ¡ç›®ä½œä¸º tag,输入项ä¸éœ€è¦ä¸Žä¸‹æ‹‰é€‰é¡¹åŒ¹é…*/ - tags?: boolean, - /** è¢«é€‰ä¸­æ—¶è°ƒç”¨ï¼Œå‚æ•°ä¸ºé€‰ä¸­é¡¹çš„ value 值*/ - onSelect?: (value: any) => void, - /** 选中option,或inputçš„valueå˜åŒ–(combobox 模å¼ä¸‹)时,调用此函数*/ - onChange?: (value: any, label: any) => void, - /** 显示清除按钮*/ - allowClear?: boolean, - /** 文本框值å˜åŒ–时回调*/ - onSearch?: (value: any) => void, - /** 选择框默认文字*/ - placeholder?: string, - /** æœç´¢æ¡†é»˜è®¤æ–‡å­—*/ - searchPlaceholder?: string, - /** 下拉èœå•的样å¼*/ - dropdownStyle?: Object, - /** 下拉èœå•和选择器åŒå®½*/ - dropdownMatchSelectWidth?: boolean, - /** 输入框自动æç¤ºæ¨¡å¼*/ - combobox?: boolean, - /** 选择框大å°ï¼Œå¯é€‰ `large` `small`*/ - size?: string, - /** 在下拉中显示æœç´¢æ¡†*/ - showSearch?: boolean, - /** 是å¦ç¦ç”¨*/ - disabled?: boolean, - /** 默认展开所有树节点*/ - treeDefaultExpandAll?: boolean, - /** 显示checkbox*/ - treeCheckable?: boolean, - /** æ˜¯å¦æ ¹æ®è¾“入项进行筛选,返回值true*/ - filterTreeNode?: (treeNode: any) => boolean, - /** 输入项过滤对应的 treeNode 属性*/ - treeNodeFilterProp?: string, - /** 作为显示的prop设置*/ - treeNodeLabelProp?: string, - /** treeNodesæ•°æ®ï¼Œå¦‚果设置则ä¸éœ€è¦æ‰‹åŠ¨æž„é€ TreeNode节点(如果value在整个树范围内ä¸å”¯ä¸€ï¼Œéœ€è¦è®¾ç½®`key`其值为整个树范围内的唯一id*/ - treeData?: TreeData, - /** 异步加载数æ®*/ - loadData?: (node: any) => void - } - /** - * #TreeSelect - 树型选择控件。 - - ## 何时使用 - - 类似 Select 的选择控件,å¯é€‰æ‹©çš„æ•°æ®ç»“构是一个树形结构时,å¯ä»¥ä½¿ç”¨ TreeSelect,例如公å¸å±‚级ã€å­¦ç§‘系统ã€åˆ†ç±»ç›®å½•等等。 - */ - export class TreeSelect extends React.Component { - static TreeNode: typeof TreeSelectTreeNode - render(): JSX.Element - } - - - - - - - // Upload - interface UploadProps { - /** å¯é€‰å‚æ•°, 上传的文件 */ - name?: string, - /** å¿…é€‰å‚æ•°, ä¸Šä¼ çš„åœ°å€ */ - action: string, - /** å¯é€‰å‚æ•°, ä¸Šä¼ æ‰€éœ€å‚æ•° */ - data?: Object, - /** å¯é€‰å‚æ•°, 设置上传的请求头部,IE10 以上有效*/ - headers?: Object, - /** å¯é€‰å‚æ•°, 是å¦å±•示 uploadList, é»˜è®¤å¼€å¯ */ - showUploadList?: boolean, - /** å¯é€‰å‚æ•°, æ˜¯å¦æ”¯æŒå¤šé€‰æ–‡ä»¶ï¼Œ`ie10+` 支æŒã€‚å¼€å¯åŽæŒ‰ä½ ctrl å¯é€‰æ‹©å¤šä¸ªæ–‡ä»¶ã€‚*/ - multiple?: boolean, - /** å¯é€‰å‚æ•°, 接å—上传的文件类型, è¯¦è§ input accept Attribute */ - accept?: string, - /** å¯é€‰å‚æ•°, 上传文件之å‰çš„é’©å­ï¼Œå‚数为上传的文件,若返回 `false` 或者 Promise åˆ™åœæ­¢ä¸Šä¼ ã€‚**注æ„ï¼šè¯¥æ–¹æ³•ä¸æ”¯æŒè€ IE**。*/ - beforeUpload?: Function, - /** å¯é€‰å‚æ•°, ä¸Šä¼ æ–‡ä»¶æ”¹å˜æ—¶çš„状æ€ï¼Œè¯¦è§ onChange */ - onChange?: (info: Object) => void, - /** 上传列表的内建样å¼ï¼Œæ”¯æŒä¸¤ç§åŸºæœ¬æ ·å¼ `text` or `picture` */ - listType?: string, - /** 自定义类å*/ - className?: string - - } - /** - * #Upload - 文件选择上传和拖拽上传控件。 - - ## 何时使用 - - 上传是将信æ¯ï¼ˆç½‘é¡µã€æ–‡å­—ã€å›¾ç‰‡ã€è§†é¢‘等)通过网页或者上传工具å‘布到远程æœåŠ¡å™¨ä¸Šçš„è¿‡ç¨‹ã€‚ - - - 当需è¦ä¸Šä¼ ä¸€ä¸ªæˆ–一些文件时。 - - 当需è¦å±•现上传的进度时。 - - 当需è¦ä½¿ç”¨æ‹–拽交互时。*/ - export class Upload extends React.Component { - render(): JSX.Element - } - - - - - - -} - - -// export all antd -declare module 'antd' { - export = Antd -} -// single export point -declare module 'antd/lib/Affix' { - export default Antd.Affix -} -declare module 'antd/lib/Button' { - export default Antd.Button -} -declare module 'antd/lib/Alert' { - export default Antd.Alert -} -declare module 'antd/lib/Badge' { - export default Antd.Badge -} -declare module 'antd/lib/Breadcrumb' { - export default Antd.Breadcrumb -} -declare module 'antd/lib/Calendar' { - export default Antd.Calendar -} -declare module 'antd/lib/Carousel' { - export default Antd.Carousel -} -declare module 'antd/lib/Cascader' { - export default Antd.Cascader -} -declare module 'antd/lib/Checkbox' { - export default Antd.Checkbox -} -declare module 'antd/lib/Collapse' { - export default Antd.Collapse -} -declare module 'antd/lib/DatePicker' { - export default Antd.DatePicker -} -declare module 'antd/lib/Dropdown' { - export default Antd.Dropdown -} -declare module 'antd/lib/Icon' { - export default Antd.Icon -} -declare module 'antd/lib/Form' { - export default Antd.Form -} -declare module 'antd/lib/Input' { - export default Antd.Input -} -declare module 'antd/lib/InputNumber' { - export default Antd.InputNumber -} -declare module 'antd/lib/Row' { - export default Antd.Row -} -declare module 'antd/lib/Col' { - export default Antd.Col -} -declare module 'antd/lib/Menu' { - export default Antd.Menu -} -declare module 'antd/lib/message' { - export default Antd.message -} -declare module 'antd/lib/Modal' { - export default Antd.Modal -} -declare module 'antd/lib/notification' { - export default Antd.notification -} -declare module 'antd/lib/Pagination' { - export default Antd.Pagination -} -declare module 'antd/lib/Popconfirm' { - export default Antd.Popconfirm -} -declare module 'antd/lib/Popover' { - export default Antd.Popover -} -declare module 'antd/lib/Progress' { - export default Antd.Progress -} -declare module 'antd/lib/QueueAnim' { - export default Antd.QueueAnim -} -declare module 'antd/lib/Radio' { - export default Antd.Radio -} -declare module 'antd/lib/Select' { - export default Antd.Select -} -declare module 'antd/lib/Slider' { - export default Antd.Slider -} -declare module 'antd/lib/Spin' { - export default Antd.Spin -} -declare module 'antd/lib/Steps' { - export default Antd.Steps -} -declare module 'antd/lib/Switch' { - export default Antd.Switch -} -declare module 'antd/lib/Table' { - export default Antd.Table -} -declare module 'antd/lib/Tabs' { - export default Antd.Tabs -} -declare module 'antd/lib/Tag' { - export default Antd.Tag -} -declare module 'antd/lib/TimePicker' { - export default Antd.TimePicker -} -declare module 'antd/lib/Timeline' { - export default Antd.Timeline -} -declare module 'antd/lib/Tooltip' { - export default Antd.Tooltip -} -declare module 'antd/lib/Transfer' { - export default Antd.Transfer -} -declare module 'antd/lib/Tree' { - export default Antd.Tree -} -declare module 'antd/lib/TreeSelect' { - export default Antd.TreeSelect -} -declare module 'antd/lib/Upload' { - export default Antd.Upload -} diff --git a/antd/tsconfig.json b/antd/tsconfig.json deleted file mode 100644 index 6b7785ac6c..0000000000 --- a/antd/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "jsx": "react", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "antd-tests.tsx" - ] -} \ No newline at end of file diff --git a/notNeededPackages.json b/notNeededPackages.json index a7db12a6bf..27b2764051 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -311,6 +311,12 @@ "typingsPackageName": "raven-js", "sourceRepoURL": "https://github.com/getsentry/raven-js", "asOfVersion": "3.10.0" + }, + { + "libraryName": "antd", + "typingsPackageName": "antd", + "sourceRepoURL": "https://github.com/ant-design/ant-design", + "asOfVersion": "1.0.0" } ] -} \ No newline at end of file +} From a0d7b386b975299312f876fdf875b7772a0b9ec8 Mon Sep 17 00:00:00 2001 From: Birk Skyum Date: Tue, 7 Mar 2017 13:12:50 +0100 Subject: [PATCH 340/797] Change indentation to 4 spaces --- meteor/index.d.ts | 2986 ++++++++++++++++++++-------------------- meteor/meteor-tests.ts | 568 ++++---- 2 files changed, 1779 insertions(+), 1775 deletions(-) diff --git a/meteor/index.d.ts b/meteor/index.d.ts index 3acd3e4fef..701f7999ec 100644 --- a/meteor/index.d.ts +++ b/meteor/index.d.ts @@ -8,54 +8,12 @@ // Birk Skyum interface URLS { - resetPassword: (token: string) => string; - verifyEmail: (token: string) => string; - enrollAccount: (token: string) => string; -} - -declare module Accounts { - var urls: URLS; - - function user(): Meteor.User; - - function userId(): string; - - function createUser(options: { - username?: string; - email?: string; - password?: string; - profile?: Object; - }, callback?: Function): string; - - function config(options: { - sendVerificationEmail?: boolean; - forbidClientAccountCreation?: boolean; - restrictCreationByEmailDomain?: string | Function; - loginExpirationInDays?: number; - oauthSecretKey?: string; - }): void; - - function onLogin(func: Function): { - stop: () => void - }; - - function onLoginFailure(func: Function): { - stop: () => void - }; - - function loginServicesConfigured(): boolean; - - function onPageLoadLogin(func: Function): void; -} - -declare module "meteor/accounts-base" { - interface URLS { resetPassword: (token: string) => string; verifyEmail: (token: string) => string; enrollAccount: (token: string) => string; - } +} - module Accounts { +declare module Accounts { var urls: URLS; function user(): Meteor.User; @@ -63,73 +21,81 @@ declare module "meteor/accounts-base" { function userId(): string; function createUser(options: { - username?: string; - email?: string; - password?: string; - profile?: Object; + username?: string; + email?: string; + password?: string; + profile?: Object; }, callback?: Function): string; function config(options: { - sendVerificationEmail?: boolean; - forbidClientAccountCreation?: boolean; - restrictCreationByEmailDomain?: string | Function; - loginExpirationInDays?: number; - oauthSecretKey?: string; + sendVerificationEmail?: boolean; + forbidClientAccountCreation?: boolean; + restrictCreationByEmailDomain?: string | Function; + loginExpirationInDays?: number; + oauthSecretKey?: string; }): void; function onLogin(func: Function): { - stop: () => void + stop: () => void }; function onLoginFailure(func: Function): { - stop: () => void + stop: () => void }; function loginServicesConfigured(): boolean; function onPageLoadLogin(func: Function): void; - } -} - -declare module Accounts { - function changePassword(oldPassword: string, newPassword: string, callback?: Function): void; - - function forgotPassword(options: { - email?: string; - }, callback?: Function): void; - - function resetPassword(token: string, newPassword: string, callback?: Function): void; - - function verifyEmail(token: string, callback?: Function): void; - - function onEmailVerificationLink(callback: Function): void; - - function onEnrollmentLink(callback: Function): void; - - function onResetPasswordLink(callback: Function): void; - - function loggingIn(): boolean; - - function logout(callback?: Function): void; - - function logoutOtherClients(callback?: Function): void; - - var ui: { - config(options: { - requestPermissions?: Object; - requestOfflineToken?: Object; - forceApprovalPrompt?: Object; - passwordSignupFields?: string; - }): void; - }; } declare module "meteor/accounts-base" { - module Accounts { + interface URLS { + resetPassword: (token: string) => string; + verifyEmail: (token: string) => string; + enrollAccount: (token: string) => string; + } + + module Accounts { + var urls: URLS; + + function user(): Meteor.User; + + function userId(): string; + + function createUser(options: { + username?: string; + email?: string; + password?: string; + profile?: Object; + }, callback?: Function): string; + + function config(options: { + sendVerificationEmail?: boolean; + forbidClientAccountCreation?: boolean; + restrictCreationByEmailDomain?: string | Function; + loginExpirationInDays?: number; + oauthSecretKey?: string; + }): void; + + function onLogin(func: Function): { + stop: () => void + }; + + function onLoginFailure(func: Function): { + stop: () => void + }; + + function loginServicesConfigured(): boolean; + + function onPageLoadLogin(func: Function): void; + } +} + +declare module Accounts { function changePassword(oldPassword: string, newPassword: string, callback?: Function): void; function forgotPassword(options: { - email?: string; + email?: string; }, callback?: Function): void; function resetPassword(token: string, newPassword: string, callback?: Function): void; @@ -149,100 +115,71 @@ declare module "meteor/accounts-base" { function logoutOtherClients(callback?: Function): void; var ui: { - config(options: { - requestPermissions?: Object; - requestOfflineToken?: Object; - forceApprovalPrompt?: Object; - passwordSignupFields?: string; - }): void; + config(options: { + requestPermissions?: Object; + requestOfflineToken?: Object; + forceApprovalPrompt?: Object; + passwordSignupFields?: string; + }): void; }; - } -} - -interface EmailFields { - from?: () => string; - subject?: (user: Meteor.User) => string; - text?: (user: Meteor.User, url: string) => string; - html?: (user: Meteor.User, url: string) => string; -} - -interface Header { - [id: string]: string; -} - -interface EmailTemplates { - from: string; - siteName: string; - headers?: Header; - resetPassword: EmailFields; - enrollAccount: EmailFields; - verifyEmail: EmailFields; -} - -declare module Accounts { - var emailTemplates: EmailTemplates; - - function addEmail(userId: string, newEmail: string, verified?: boolean): void; - - function removeEmail(userId: string, email: string): void; - - function onCreateUser(func: Function): void; - - function findUserByEmail(email: string): Object; - - function findUserByUsername(username: string): Object; - - function sendEnrollmentEmail(userId: string, email?: string): void; - - function sendResetPasswordEmail(userId: string, email?: string): void; - - function sendVerificationEmail(userId: string, email?: string): void; - - function setUsername(userId: string, newUsername: string): void; - - function setPassword(userId: string, newPassword: string, options?: { - logout?: Object; - }): void; - - function validateNewUser(func: Function): boolean; - - function validateLoginAttempt(func: Function): { - stop: () => void - }; - - interface IValidateLoginAttemptCbOpts { - type: string; - allowed: boolean; - error: Meteor.Error; - user: Meteor.User; - connection: Meteor.Connection; - methodName: string; - methodArguments: any[]; - } } declare module "meteor/accounts-base" { - interface EmailFields { + module Accounts { + function changePassword(oldPassword: string, newPassword: string, callback?: Function): void; + + function forgotPassword(options: { + email?: string; + }, callback?: Function): void; + + function resetPassword(token: string, newPassword: string, callback?: Function): void; + + function verifyEmail(token: string, callback?: Function): void; + + function onEmailVerificationLink(callback: Function): void; + + function onEnrollmentLink(callback: Function): void; + + function onResetPasswordLink(callback: Function): void; + + function loggingIn(): boolean; + + function logout(callback?: Function): void; + + function logoutOtherClients(callback?: Function): void; + + var ui: { + config(options: { + requestPermissions?: Object; + requestOfflineToken?: Object; + forceApprovalPrompt?: Object; + passwordSignupFields?: string; + }): void; + }; + } +} + +interface EmailFields { from?: () => string; subject?: (user: Meteor.User) => string; text?: (user: Meteor.User, url: string) => string; html?: (user: Meteor.User, url: string) => string; - } +} - interface Header { +interface Header { [id: string]: string; - } +} - interface EmailTemplates { +interface EmailTemplates { from: string; siteName: string; headers?: Header; resetPassword: EmailFields; enrollAccount: EmailFields; verifyEmail: EmailFields; - } +} - module Accounts { +declare module Accounts { var emailTemplates: EmailTemplates; function addEmail(userId: string, newEmail: string, verified?: boolean): void; @@ -264,217 +201,171 @@ declare module "meteor/accounts-base" { function setUsername(userId: string, newUsername: string): void; function setPassword(userId: string, newPassword: string, options?: { - logout?: Object; + logout?: Object; }): void; function validateNewUser(func: Function): boolean; function validateLoginAttempt(func: Function): { - stop: () => void + stop: () => void }; interface IValidateLoginAttemptCbOpts { - type: string; - allowed: boolean; - error: Meteor.Error; - user: Meteor.User; - connection: Meteor.Connection; - methodName: string; - methodArguments: any[]; + type: string; + allowed: boolean; + error: Meteor.Error; + user: Meteor.User; + connection: Meteor.Connection; + methodName: string; + methodArguments: any[]; + } +} + +declare module "meteor/accounts-base" { + interface EmailFields { + from?: () => string; + subject?: (user: Meteor.User) => string; + text?: (user: Meteor.User, url: string) => string; + html?: (user: Meteor.User, url: string) => string; + } + + interface Header { + [id: string]: string; + } + + interface EmailTemplates { + from: string; + siteName: string; + headers?: Header; + resetPassword: EmailFields; + enrollAccount: EmailFields; + verifyEmail: EmailFields; + } + + module Accounts { + var emailTemplates: EmailTemplates; + + function addEmail(userId: string, newEmail: string, verified?: boolean): void; + + function removeEmail(userId: string, email: string): void; + + function onCreateUser(func: Function): void; + + function findUserByEmail(email: string): Object; + + function findUserByUsername(username: string): Object; + + function sendEnrollmentEmail(userId: string, email?: string): void; + + function sendResetPasswordEmail(userId: string, email?: string): void; + + function sendVerificationEmail(userId: string, email?: string): void; + + function setUsername(userId: string, newUsername: string): void; + + function setPassword(userId: string, newPassword: string, options?: { + logout?: Object; + }): void; + + function validateNewUser(func: Function): boolean; + + function validateLoginAttempt(func: Function): { + stop: () => void + }; + + interface IValidateLoginAttemptCbOpts { + type: string; + allowed: boolean; + error: Meteor.Error; + user: Meteor.User; + connection: Meteor.Connection; + methodName: string; + methodArguments: any[]; + } } - } } declare module Blaze { - var View: ViewStatic; - - interface ViewStatic { - new(name?: string, renderFunction?: Function): View; - } - - interface View { - name: string; - parentView: View; - isCreated: boolean; - isRendered: boolean; - isDestroyed: boolean; - renderCount: number; - autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; - onViewCreated(func: Function): void; - onViewReady(func: Function): void; - onViewDestroyed(func: Function): void; - firstNode(): Node; - lastNode(): Node; - template: Template; - templateInstance(): TemplateInstance; - } - var currentView: View; - - function isTemplate(value: any): boolean; - - interface HelpersMap { - [key: string]: Function; - } - - interface EventsMap { - [key: string]: Function; - } - - var Template: TemplateStatic; - - interface TemplateStatic { - new(viewName?: string, renderFunction?: Function): Template; - - registerHelper(name: string, func: Function): void; - instance(): TemplateInstance; - currentData(): any; - parentData(numLevels: number): any; - } - - interface Template { - viewName: string; - renderFunction: Function; - constructView(): View; - head: Template; - find(selector: string): HTMLElement; - findAll(selector: string): HTMLElement[]; - $: any; - onCreated(cb: Function): void; - onRendered(cb: Function): void; - onDestroyed(cb: Function): void; - created: Function; - rendered: Function; - destroyed: Function; - helpers(helpersMap: HelpersMap): void; - events(eventsMap: EventsMap): void; - } - - var TemplateInstance: TemplateInstanceStatic; - - interface TemplateInstanceStatic { - new(view: View): TemplateInstance; - } - - interface TemplateInstance { - $(selector: string): any; - autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; - data: Object; - find(selector: string): HTMLElement; - findAll(selector: string): HTMLElement[]; - firstNode: Object; - lastNode: Object; - subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; - subscriptionsReady(): boolean; - view: Object; - } - - function Each(argFunc: Function, contentFunc: Function, elseFunc?: Function): View; - - function Unless(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): View; - - function If(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): View; - - function Let(bindings: Function, contentFunc: Function): View; - - function With(data: Object | Function, contentFunc: Function): View; - - function getData(elementOrView?: HTMLElement | View): Object; - - function getView(element?: HTMLElement): View; - - function remove(renderedView: View): void; - - function render(templateOrView: Template | View, parentNode: Node, nextNode?: Node, parentView?: View): View; - - function renderWithData(templateOrView: Template | View, data: Object | Function, parentNode: Node, nextNode?: Node, parentView?: View): View; - - function toHTML(templateOrView: Template | View): string; - - function toHTMLWithData(templateOrView: Template | View, data: Object | Function): string; -} - -declare module "meteor/blaze" { - module Blaze { var View: ViewStatic; interface ViewStatic { - new(name?: string, renderFunction?: Function): View; + new (name?: string, renderFunction?: Function): View; } interface View { - name: string; - parentView: View; - isCreated: boolean; - isRendered: boolean; - isDestroyed: boolean; - renderCount: number; - autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; - onViewCreated(func: Function): void; - onViewReady(func: Function): void; - onViewDestroyed(func: Function): void; - firstNode(): Node; - lastNode(): Node; - template: Template; - templateInstance(): TemplateInstance; + name: string; + parentView: View; + isCreated: boolean; + isRendered: boolean; + isDestroyed: boolean; + renderCount: number; + autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; + onViewCreated(func: Function): void; + onViewReady(func: Function): void; + onViewDestroyed(func: Function): void; + firstNode(): Node; + lastNode(): Node; + template: Template; + templateInstance(): TemplateInstance; } var currentView: View; function isTemplate(value: any): boolean; interface HelpersMap { - [key: string]: Function; + [key: string]: Function; } interface EventsMap { - [key: string]: Function; + [key: string]: Function; } var Template: TemplateStatic; interface TemplateStatic { - new(viewName?: string, renderFunction?: Function): Template; + new (viewName?: string, renderFunction?: Function): Template; - registerHelper(name: string, func: Function): void; - instance(): TemplateInstance; - currentData(): any; - parentData(numLevels: number): any; + registerHelper(name: string, func: Function): void; + instance(): TemplateInstance; + currentData(): any; + parentData(numLevels: number): any; } interface Template { - viewName: string; - renderFunction: Function; - constructView(): View; - head: Template; - find(selector: string): HTMLElement; - findAll(selector: string): HTMLElement[]; - $: any; - onCreated(cb: Function): void; - onRendered(cb: Function): void; - onDestroyed(cb: Function): void; - created: Function; - rendered: Function; - destroyed: Function; - helpers(helpersMap: HelpersMap): void; - events(eventsMap: EventsMap): void; + viewName: string; + renderFunction: Function; + constructView(): View; + head: Template; + find(selector: string): HTMLElement; + findAll(selector: string): HTMLElement[]; + $: any; + onCreated(cb: Function): void; + onRendered(cb: Function): void; + onDestroyed(cb: Function): void; + created: Function; + rendered: Function; + destroyed: Function; + helpers(helpersMap: HelpersMap): void; + events(eventsMap: EventsMap): void; } var TemplateInstance: TemplateInstanceStatic; interface TemplateInstanceStatic { - new(view: View): TemplateInstance; + new (view: View): TemplateInstance; } interface TemplateInstance { - $(selector: string): any; - autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; - data: Object; - find(selector: string): HTMLElement; - findAll(selector: string): HTMLElement[]; - firstNode: Object; - lastNode: Object; - subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; - subscriptionsReady(): boolean; - view: Object; + $(selector: string): any; + autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; + data: Object; + find(selector: string): HTMLElement; + findAll(selector: string): HTMLElement[]; + firstNode: Object; + lastNode: Object; + subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; + subscriptionsReady(): boolean; + view: Object; } function Each(argFunc: Function, contentFunc: Function, elseFunc?: Function): View; @@ -500,104 +391,191 @@ declare module "meteor/blaze" { function toHTML(templateOrView: Template | View): string; function toHTMLWithData(templateOrView: Template | View, data: Object | Function): string; - } +} + +declare module "meteor/blaze" { + module Blaze { + var View: ViewStatic; + + interface ViewStatic { + new (name?: string, renderFunction?: Function): View; + } + + interface View { + name: string; + parentView: View; + isCreated: boolean; + isRendered: boolean; + isDestroyed: boolean; + renderCount: number; + autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; + onViewCreated(func: Function): void; + onViewReady(func: Function): void; + onViewDestroyed(func: Function): void; + firstNode(): Node; + lastNode(): Node; + template: Template; + templateInstance(): TemplateInstance; + } + var currentView: View; + + function isTemplate(value: any): boolean; + + interface HelpersMap { + [key: string]: Function; + } + + interface EventsMap { + [key: string]: Function; + } + + var Template: TemplateStatic; + + interface TemplateStatic { + new (viewName?: string, renderFunction?: Function): Template; + + registerHelper(name: string, func: Function): void; + instance(): TemplateInstance; + currentData(): any; + parentData(numLevels: number): any; + } + + interface Template { + viewName: string; + renderFunction: Function; + constructView(): View; + head: Template; + find(selector: string): HTMLElement; + findAll(selector: string): HTMLElement[]; + $: any; + onCreated(cb: Function): void; + onRendered(cb: Function): void; + onDestroyed(cb: Function): void; + created: Function; + rendered: Function; + destroyed: Function; + helpers(helpersMap: HelpersMap): void; + events(eventsMap: EventsMap): void; + } + + var TemplateInstance: TemplateInstanceStatic; + + interface TemplateInstanceStatic { + new (view: View): TemplateInstance; + } + + interface TemplateInstance { + $(selector: string): any; + autorun(runFunc: (computation: Tracker.Computation) => void): Tracker.Computation; + data: Object; + find(selector: string): HTMLElement; + findAll(selector: string): HTMLElement[]; + firstNode: Object; + lastNode: Object; + subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; + subscriptionsReady(): boolean; + view: Object; + } + + function Each(argFunc: Function, contentFunc: Function, elseFunc?: Function): View; + + function Unless(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): View; + + function If(conditionFunc: Function, contentFunc: Function, elseFunc?: Function): View; + + function Let(bindings: Function, contentFunc: Function): View; + + function With(data: Object | Function, contentFunc: Function): View; + + function getData(elementOrView?: HTMLElement | View): Object; + + function getView(element?: HTMLElement): View; + + function remove(renderedView: View): void; + + function render(templateOrView: Template | View, parentNode: Node, nextNode?: Node, parentView?: View): View; + + function renderWithData(templateOrView: Template | View, data: Object | Function, parentNode: Node, nextNode?: Node, parentView?: View): View; + + function toHTML(templateOrView: Template | View): string; + + function toHTMLWithData(templateOrView: Template | View, data: Object | Function): string; + } } declare module BrowserPolicy { - var framing: { - disallow(): void; - restrictToOrigin(origin: string): void; - allowAll(): void; - }; - - var content: { - allowEval(): void; - allowInlineStyles(): void; - allowInlineScripts(): void; - allowSameOriginForAll(): void; - allowDataUrlForAll(): void; - allowOriginForAll(origin: string): void; - allowImageOrigin(origin: string): void; - allowMediaOrigin(origin: string): void; - allowFontOrigin(origin: string): void; - allowStyleOrigin(origin: string): void; - allowScriptOrigin(origin: string): void; - allowFrameOrigin(origin: string): void; - allowContentTypeSniffing(): void; - allowAllContentOrigin(): void; - allowAllContentDataUrl(): void; - allowAllContentSameOrigin(): void; - - disallowAll(): void; - disallowInlineStyles(): void; - disallowEval(): void; - disallowInlineScripts(): void; - disallowFont(): void; - disallowObject(): void; - disallowAllContent(): void; - }; -} - -declare module "meteor/browser-policy-common" { - module BrowserPolicy { var framing: { - disallow(): void; - restrictToOrigin(origin: string): void; - allowAll(): void; + disallow(): void; + restrictToOrigin(origin: string): void; + allowAll(): void; }; var content: { - allowEval(): void; - allowInlineStyles(): void; - allowInlineScripts(): void; - allowSameOriginForAll(): void; - allowDataUrlForAll(): void; - allowOriginForAll(origin: string): void; - allowImageOrigin(origin: string): void; - allowMediaOrigin(origin: string): void; - allowFontOrigin(origin: string): void; - allowStyleOrigin(origin: string): void; - allowScriptOrigin(origin: string): void; - allowFrameOrigin(origin: string): void; - allowContentTypeSniffing(): void; - allowAllContentOrigin(): void; - allowAllContentDataUrl(): void; - allowAllContentSameOrigin(): void; + allowEval(): void; + allowInlineStyles(): void; + allowInlineScripts(): void; + allowSameOriginForAll(): void; + allowDataUrlForAll(): void; + allowOriginForAll(origin: string): void; + allowImageOrigin(origin: string): void; + allowMediaOrigin(origin: string): void; + allowFontOrigin(origin: string): void; + allowStyleOrigin(origin: string): void; + allowScriptOrigin(origin: string): void; + allowFrameOrigin(origin: string): void; + allowContentTypeSniffing(): void; + allowAllContentOrigin(): void; + allowAllContentDataUrl(): void; + allowAllContentSameOrigin(): void; - disallowAll(): void; - disallowInlineStyles(): void; - disallowEval(): void; - disallowInlineScripts(): void; - disallowFont(): void; - disallowObject(): void; - disallowAllContent(): void; + disallowAll(): void; + disallowInlineStyles(): void; + disallowEval(): void; + disallowInlineScripts(): void; + disallowFont(): void; + disallowObject(): void; + disallowAllContent(): void; }; - } +} + +declare module "meteor/browser-policy-common" { + module BrowserPolicy { + var framing: { + disallow(): void; + restrictToOrigin(origin: string): void; + allowAll(): void; + }; + + var content: { + allowEval(): void; + allowInlineStyles(): void; + allowInlineScripts(): void; + allowSameOriginForAll(): void; + allowDataUrlForAll(): void; + allowOriginForAll(origin: string): void; + allowImageOrigin(origin: string): void; + allowMediaOrigin(origin: string): void; + allowFontOrigin(origin: string): void; + allowStyleOrigin(origin: string): void; + allowScriptOrigin(origin: string): void; + allowFrameOrigin(origin: string): void; + allowContentTypeSniffing(): void; + allowAllContentOrigin(): void; + allowAllContentDataUrl(): void; + allowAllContentSameOrigin(): void; + + disallowAll(): void; + disallowInlineStyles(): void; + disallowEval(): void; + disallowInlineScripts(): void; + disallowFont(): void; + disallowObject(): void; + disallowAllContent(): void; + }; + } } declare module Match { - var Any: any; - var String: any; - var Integer: any; - var Boolean: any; - var undefined: any; - var Object: any; - - function Optional(pattern: any): boolean; - - function ObjectIncluding(dico: any): boolean; - - function OneOf(...patterns: any[]): any; - - function Where(condition: any): any; - - function test(value: any, pattern: any): boolean; -} - -declare function check(value: any, pattern: any): void; - -declare module "meteor/check" { - module Match { var Any: any; var String: any; var Integer: any; @@ -614,89 +592,73 @@ declare module "meteor/check" { function Where(condition: any): any; function test(value: any, pattern: any): boolean; - } +} - function check(value: any, pattern: any): void; +declare function check(value: any, pattern: any): void; + +declare module "meteor/check" { + module Match { + var Any: any; + var String: any; + var Integer: any; + var Boolean: any; + var undefined: any; + var Object: any; + + function Optional(pattern: any): boolean; + + function ObjectIncluding(dico: any): boolean; + + function OneOf(...patterns: any[]): any; + + function Where(condition: any): any; + + function test(value: any, pattern: any): boolean; + } + + function check(value: any, pattern: any): void; } declare module DDPRateLimiter { - interface Matcher { - type?: string | ((type: string) => boolean); - name?: string | ((name: string) => boolean); - userId?: string | ((userId: string) => boolean); - connectionId?: string | ((connectionId: string) => boolean); - clientAddress?: string | ((clientAddress: string) => boolean); - } - - function addRule(matcher: Matcher, numRequests: number, timeInterval: number): string; - - function removeRule(ruleId: string): boolean; -} - -declare module "meteor/ddp-rate-limiter" { - module DDPRateLimiter { interface Matcher { - type?: string | ((type: string) => boolean); - name?: string | ((name: string) => boolean); - userId?: string | ((userId: string) => boolean); - connectionId?: string | ((connectionId: string) => boolean); - clientAddress?: string | ((clientAddress: string) => boolean); + type?: string | ((type: string) => boolean); + name?: string | ((name: string) => boolean); + userId?: string | ((userId: string) => boolean); + connectionId?: string | ((connectionId: string) => boolean); + clientAddress?: string | ((clientAddress: string) => boolean); } function addRule(matcher: Matcher, numRequests: number, timeInterval: number): string; function removeRule(ruleId: string): boolean; - } +} + +declare module "meteor/ddp-rate-limiter" { + module DDPRateLimiter { + interface Matcher { + type?: string | ((type: string) => boolean); + name?: string | ((name: string) => boolean); + userId?: string | ((userId: string) => boolean); + connectionId?: string | ((connectionId: string) => boolean); + clientAddress?: string | ((clientAddress: string) => boolean); + } + + function addRule(matcher: Matcher, numRequests: number, timeInterval: number): string; + + function removeRule(ruleId: string): boolean; + } } declare module DDP { - interface DDPStatic { - subscribe(name: string, ...rest: any[]): Meteor.SubscriptionHandle; - call(method: string, ...parameters: any[]): void; - apply(method: string, ...parameters: any[]): void; - methods(IMeteorMethodsDictionary: any): any; - status(): DDPStatus; - reconnect(): void; - disconnect(): void; - onReconnect(): void; - } - - function _allSubscriptionsReady(): boolean; - - type Status = 'connected' | 'connecting' | 'failed' | 'waiting' | 'offline'; - - interface DDPStatus { - connected: boolean; - status: Status; - retryCount: number; - retryTime?: number; - reason?: string; - } - - function connect(url: string): DDPStatic; -} - -declare module DDPCommon { - interface MethodInvocation { - new(options: {}): MethodInvocation; - - unblock(): void; - - setUserId(userId: number): void; - } -} - -declare module "meteor/ddp" { - module DDP { interface DDPStatic { - subscribe(name: string, ...rest: any[]): Meteor.SubscriptionHandle; - call(method: string, ...parameters: any[]): void; - apply(method: string, ...parameters: any[]): void; - methods(IMeteorMethodsDictionary: any): any; - status(): DDPStatus; - reconnect(): void; - disconnect(): void; - onReconnect(): void; + subscribe(name: string, ...rest: any[]): Meteor.SubscriptionHandle; + call(method: string, ...parameters: any[]): void; + apply(method: string, ...parameters: any[]): void; + methods(IMeteorMethodsDictionary: any): any; + status(): DDPStatus; + reconnect(): void; + disconnect(): void; + onReconnect(): void; } function _allSubscriptionsReady(): boolean; @@ -704,87 +666,86 @@ declare module "meteor/ddp" { type Status = 'connected' | 'connecting' | 'failed' | 'waiting' | 'offline'; interface DDPStatus { - connected: boolean; - status: Status; - retryCount: number; - retryTime?: number; - reason?: string; + connected: boolean; + status: Status; + retryCount: number; + retryTime?: number; + reason?: string; } function connect(url: string): DDPStatic; - } +} - module DDPCommon { +declare module DDPCommon { interface MethodInvocation { - new(options: {}): MethodInvocation; + new (options: {}): MethodInvocation; - unblock(): void; + unblock(): void; - setUserId(userId: number): void; + setUserId(userId: number): void; + } +} + +declare module "meteor/ddp" { + module DDP { + interface DDPStatic { + subscribe(name: string, ...rest: any[]): Meteor.SubscriptionHandle; + call(method: string, ...parameters: any[]): void; + apply(method: string, ...parameters: any[]): void; + methods(IMeteorMethodsDictionary: any): any; + status(): DDPStatus; + reconnect(): void; + disconnect(): void; + onReconnect(): void; + } + + function _allSubscriptionsReady(): boolean; + + type Status = 'connected' | 'connecting' | 'failed' | 'waiting' | 'offline'; + + interface DDPStatus { + connected: boolean; + status: Status; + retryCount: number; + retryTime?: number; + reason?: string; + } + + function connect(url: string): DDPStatic; + } + + module DDPCommon { + interface MethodInvocation { + new (options: {}): MethodInvocation; + + unblock(): void; + + setUserId(userId: number): void; + } } - } } interface EJSONableCustomType { - clone(): EJSONableCustomType; - equals(other: Object): boolean; - toJSONValue(): JSONable; - typeName(): string; -} -interface EJSONable { - [key: string]: number | string | boolean | Object | number[] | string[] | Object[] | Date | Uint8Array | EJSONableCustomType; -} -interface JSONable { - [key: string]: number | string | boolean | Object | number[] | string[] | Object[]; -} -interface EJSON extends EJSONable {} - -declare module EJSON { - function addType(name: string, factory: (val: JSONable) => EJSONableCustomType): void; - - function clone < T > (val: T): T; - - function equals(a: EJSON, b: EJSON, options?: { - keyOrderSensitive?: boolean; - }): boolean; - - function fromJSONValue(val: JSONable): any; - - function isBinary(x: Object): boolean; - var newBinary: any; - - function parse(str: string): EJSON; - - function stringify(val: EJSON, options?: { - indent?: boolean | number | string; - canonical?: boolean; - }): string; - - function toJSONValue(val: EJSON): JSONable; -} - -declare module "meteor/ejson" { - interface EJSONableCustomType { clone(): EJSONableCustomType; equals(other: Object): boolean; toJSONValue(): JSONable; typeName(): string; - } - interface EJSONable { +} +interface EJSONable { [key: string]: number | string | boolean | Object | number[] | string[] | Object[] | Date | Uint8Array | EJSONableCustomType; - } - interface JSONable { +} +interface JSONable { [key: string]: number | string | boolean | Object | number[] | string[] | Object[]; - } - interface EJSON extends EJSONable {} +} +interface EJSON extends EJSONable { } - module EJSON { +declare module EJSON { function addType(name: string, factory: (val: JSONable) => EJSONableCustomType): void; - function clone < T > (val: T): T; + function clone(val: T): T; function equals(a: EJSON, b: EJSON, options?: { - keyOrderSensitive?: boolean; + keyOrderSensitive?: boolean; }): boolean; function fromJSONValue(val: JSONable): any; @@ -795,159 +756,148 @@ declare module "meteor/ejson" { function parse(str: string): EJSON; function stringify(val: EJSON, options?: { - indent?: boolean | number | string; - canonical?: boolean; + indent?: boolean | number | string; + canonical?: boolean; }): string; function toJSONValue(val: EJSON): JSONable; - } +} + +declare module "meteor/ejson" { + interface EJSONableCustomType { + clone(): EJSONableCustomType; + equals(other: Object): boolean; + toJSONValue(): JSONable; + typeName(): string; + } + interface EJSONable { + [key: string]: number | string | boolean | Object | number[] | string[] | Object[] | Date | Uint8Array | EJSONableCustomType; + } + interface JSONable { + [key: string]: number | string | boolean | Object | number[] | string[] | Object[]; + } + interface EJSON extends EJSONable { } + + module EJSON { + function addType(name: string, factory: (val: JSONable) => EJSONableCustomType): void; + + function clone(val: T): T; + + function equals(a: EJSON, b: EJSON, options?: { + keyOrderSensitive?: boolean; + }): boolean; + + function fromJSONValue(val: JSONable): any; + + function isBinary(x: Object): boolean; + var newBinary: any; + + function parse(str: string): EJSON; + + function stringify(val: EJSON, options?: { + indent?: boolean | number | string; + canonical?: boolean; + }): string; + + function toJSONValue(val: EJSON): JSONable; + } } declare module Email { - function send(options: { - from?: string; - to?: string | string[]; - cc?: string | string[]; - bcc?: string | string[]; - replyTo?: string | string[]; - subject?: string; - text?: string; - html?: string; - headers?: Object; - attachments?: Object[]; - mailComposer?: MailComposer; - }): void; + function send(options: { + from?: string; + to?: string | string[]; + cc?: string | string[]; + bcc?: string | string[]; + replyTo?: string | string[]; + subject?: string; + text?: string; + html?: string; + headers?: Object; + attachments?: Object[]; + mailComposer?: MailComposer; + }): void; } interface MailComposerOptions { - escapeSMTP: boolean; - encoding: string; - charset: string; - keepBcc: boolean; - forceEmbeddedImages: boolean; -} - -declare var MailComposer: MailComposerStatic; -interface MailComposerStatic { - new(options: MailComposerOptions): MailComposer; -} -interface MailComposer { - addHeader(name: string, value: string): void; - setMessageOption(from: string, to: string, body: string, html: string): void; - streamMessage(): void; - pipe(stream: any /** fs.WriteStream **/ ): void; -} - -declare module "meteor/email" { - module Email { - function send(options: { - from?: string; - to?: string | string[]; - cc?: string | string[]; - bcc?: string | string[]; - replyTo?: string | string[]; - subject?: string; - text?: string; - html?: string; - headers?: Object; - attachments?: Object[]; - mailComposer?: MailComposer; - }): void; - } - - interface MailComposerOptions { escapeSMTP: boolean; encoding: string; charset: string; keepBcc: boolean; forceEmbeddedImages: boolean; - } +} - var MailComposer: MailComposerStatic; - interface MailComposerStatic { - new(options: MailComposerOptions): MailComposer; - } - interface MailComposer { +declare var MailComposer: MailComposerStatic; +interface MailComposerStatic { + new (options: MailComposerOptions): MailComposer; +} +interface MailComposer { addHeader(name: string, value: string): void; setMessageOption(from: string, to: string, body: string, html: string): void; streamMessage(): void; - pipe(stream: any /** fs.WriteStream **/ ): void; - } + pipe(stream: any /** fs.WriteStream **/): void; +} + +declare module "meteor/email" { + module Email { + function send(options: { + from?: string; + to?: string | string[]; + cc?: string | string[]; + bcc?: string | string[]; + replyTo?: string | string[]; + subject?: string; + text?: string; + html?: string; + headers?: Object; + attachments?: Object[]; + mailComposer?: MailComposer; + }): void; + } + + interface MailComposerOptions { + escapeSMTP: boolean; + encoding: string; + charset: string; + keepBcc: boolean; + forceEmbeddedImages: boolean; + } + + var MailComposer: MailComposerStatic; + interface MailComposerStatic { + new (options: MailComposerOptions): MailComposer; + } + interface MailComposer { + addHeader(name: string, value: string): void; + setMessageOption(from: string, to: string, body: string, html: string): void; + streamMessage(): void; + pipe(stream: any /** fs.WriteStream **/): void; + } } declare module HTTP { - interface HTTPRequest { - content?: string; - data?: any; - query?: string; - params?: { - [id: string]: string - }; - auth?: string; - headers?: { - [id: string]: string - }; - timeout?: number; - followRedirects?: boolean; - } - - interface HTTPResponse { - statusCode?: number; - headers?: { - [id: string]: string - }; - content?: string; - data?: any; - } - - function call(method: string, url: string, options?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; - - function del(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; - - function get(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; - - function post(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; - - function put(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; - - function call(method: string, url: string, options?: { - content?: string; - data?: Object; - query?: string; - params?: Object; - auth?: string; - headers?: Object; - timeout?: number; - followRedirects?: boolean; - npmRequestOptions?: Object; - beforeSend?: Function; - }, asyncCallback?: Function): HTTP.HTTPResponse; -} - -declare module "meteor/http" { - module HTTP { interface HTTPRequest { - content?: string; - data?: any; - query?: string; - params?: { - [id: string]: string - }; - auth?: string; - headers?: { - [id: string]: string - }; - timeout?: number; - followRedirects?: boolean; + content?: string; + data?: any; + query?: string; + params?: { + [id: string]: string + }; + auth?: string; + headers?: { + [id: string]: string + }; + timeout?: number; + followRedirects?: boolean; } interface HTTPResponse { - statusCode?: number; - headers?: { - [id: string]: string - }; - content?: string; - data?: any; + statusCode?: number; + headers?: { + [id: string]: string + }; + content?: string; + data?: any; } function call(method: string, url: string, options?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; @@ -961,122 +911,71 @@ declare module "meteor/http" { function put(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; function call(method: string, url: string, options?: { - content?: string; - data?: Object; - query?: string; - params?: Object; - auth?: string; - headers?: Object; - timeout?: number; - followRedirects?: boolean; - npmRequestOptions?: Object; - beforeSend?: Function; + content?: string; + data?: Object; + query?: string; + params?: Object; + auth?: string; + headers?: Object; + timeout?: number; + followRedirects?: boolean; + npmRequestOptions?: Object; + beforeSend?: Function; }, asyncCallback?: Function): HTTP.HTTPResponse; - } +} + +declare module "meteor/http" { + module HTTP { + interface HTTPRequest { + content?: string; + data?: any; + query?: string; + params?: { + [id: string]: string + }; + auth?: string; + headers?: { + [id: string]: string + }; + timeout?: number; + followRedirects?: boolean; + } + + interface HTTPResponse { + statusCode?: number; + headers?: { + [id: string]: string + }; + content?: string; + data?: any; + } + + function call(method: string, url: string, options?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function del(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function get(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function post(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function put(url: string, callOptions?: HTTP.HTTPRequest, asyncCallback?: Function): HTTP.HTTPResponse; + + function call(method: string, url: string, options?: { + content?: string; + data?: Object; + query?: string; + params?: Object; + auth?: string; + headers?: Object; + timeout?: number; + followRedirects?: boolean; + npmRequestOptions?: Object; + beforeSend?: Function; + }, asyncCallback?: Function): HTTP.HTTPResponse; + } } declare module Meteor { - /** Global props **/ - var isClient: boolean; - var isCordova: boolean; - var isServer: boolean; - var isProduction: boolean; - var release: string; - /** Global props **/ - - /** Settings **/ - interface Settings { - public: { - [id: string]: any - }, [id: string]: any - } - var settings: Settings; - /** Settings **/ - - /** User **/ - interface UserEmail { - address: string; - verified: boolean; - } - interface User { - _id?: string; - username?: string; - emails?: UserEmail[]; - createdAt?: number; - profile?: any; - services?: any; - } - - function user(): User; - - function userId(): string; - var users: Mongo.Collection < User > ; - /** User **/ - - /** Error **/ - var Error: ErrorStatic; - interface ErrorStatic { - new(error: string | number, reason?: string, details?: string): Error; - } - interface Error { - error: string | number; - reason?: string; - details?: string; - } - /** Error **/ - - /** Method **/ - function methods(methods: Object): void; - - function call(name: string, ...args: any[]): any; - - function apply(name: string, args: EJSONable[], options?: { - wait?: boolean; - onResultReceived?: Function; - }, asyncCallback?: Function): any; - /** Method **/ - - /** Url **/ - function absoluteUrl(path?: string, options?: { - secure?: boolean; - replaceLocalhost?: boolean; - rootUrl?: string; - }): string; - /** Url **/ - - /** Timeout **/ - function setInterval(func: Function, delay: number): number; - - function setTimeout(func: Function, delay: number): number; - - function clearInterval(id: number): void; - - function clearTimeout(id: number): void; - - function defer(func: Function): void; - /** Timeout **/ - - /** utils **/ - function startup(func: Function): void; - - function wrapAsync(func: Function, context?: Object): any; - - function bindEnvironment(func: Function): any; - /** utils **/ - - /** Pub/Sub **/ - interface SubscriptionHandle { - stop(): void; - ready(): boolean; - } - interface LiveQueryHandle { - stop(): void; - } - /** Pub/Sub **/ -} - -declare module "meteor/meteor" { - module Meteor { /** Global props **/ var isClient: boolean; var isCordova: boolean; @@ -1087,42 +986,42 @@ declare module "meteor/meteor" { /** Settings **/ interface Settings { - public: { - [id: string]: any - }, [id: string]: any + public: { + [id: string]: any + }, [id: string]: any } var settings: Settings; /** Settings **/ /** User **/ interface UserEmail { - address: string; - verified: boolean; + address: string; + verified: boolean; } interface User { - _id?: string; - username?: string; - emails?: UserEmail[]; - createdAt?: number; - profile?: any; - services?: any; + _id?: string; + username?: string; + emails?: UserEmail[]; + createdAt?: number; + profile?: any; + services?: any; } function user(): User; function userId(): string; - var users: Mongo.Collection < User > ; + var users: Mongo.Collection; /** User **/ /** Error **/ var Error: ErrorStatic; interface ErrorStatic { - new(error: string | number, reason?: string, details?: string): Error; + new (error: string | number, reason?: string, details?: string): Error; } interface Error { - error: string | number; - reason?: string; - details?: string; + error: string | number; + reason?: string; + details?: string; } /** Error **/ @@ -1132,16 +1031,16 @@ declare module "meteor/meteor" { function call(name: string, ...args: any[]): any; function apply(name: string, args: EJSONable[], options?: { - wait?: boolean; - onResultReceived?: Function; + wait?: boolean; + onResultReceived?: Function; }, asyncCallback?: Function): any; /** Method **/ /** Url **/ function absoluteUrl(path?: string, options?: { - secure?: boolean; - replaceLocalhost?: boolean; - rootUrl?: string; + secure?: boolean; + replaceLocalhost?: boolean; + rootUrl?: string; }): string; /** Url **/ @@ -1167,109 +1066,127 @@ declare module "meteor/meteor" { /** Pub/Sub **/ interface SubscriptionHandle { - stop(): void; - ready(): boolean; + stop(): void; + ready(): boolean; } interface LiveQueryHandle { - stop(): void; + stop(): void; } /** Pub/Sub **/ - } -} - -declare module Meteor { - /** Login **/ - interface LoginWithExternalServiceOptions { - requestPermissions?: string[]; - requestOfflineToken?: Boolean; - forceApprovalPrompt?: Boolean; - loginUrlParameters?: Object; - redirectUrl?: string; - loginHint?: string; - loginStyle?: string; - } - - function loginWithMeteorDeveloperAccount(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - - function loginWithFacebook(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - - function loginWithGithub(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - - function loginWithGoogle(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - - function loginWithMeetup(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - - function loginWithTwitter(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - - function loginWithWeibo(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; - - function loggingIn(): boolean; - - function loginWith < ExternalService > (options?: { - requestPermissions?: string[]; - requestOfflineToken?: boolean; - loginUrlParameters?: Object; - userEmail?: string; - loginStyle?: string; - redirectUrl?: string; - }, callback?: Function): void; - - function loginWithPassword(user: Object | string, password: string, callback?: Function): void; - - function loginWithToken(token: string, callback?: Function): void; - - function logout(callback?: Function): void; - - function logoutOtherClients(callback?: Function): void; - /** Login **/ - - /** Event **/ - interface Event { - type: string; - target: HTMLElement; - currentTarget: HTMLElement; - which: number; - stopPropagation(): void; - stopImmediatePropagation(): void; - preventDefault(): void; - isPropagationStopped(): boolean; - isImmediatePropagationStopped(): boolean; - isDefaultPrevented(): boolean; - } - interface EventHandlerFunction extends Function { - (event?: Meteor.Event, templateInstance?: Blaze.TemplateInstance): void; - } - interface EventMap { - [id: string]: Meteor.EventHandlerFunction; - } - /** Event **/ - - /** Connection **/ - function reconnect(): void; - - function disconnect(): void; - /** Connection **/ - - /** Status **/ - function status(): DDP.DDPStatus; - /** Status **/ - - /** Pub/Sub **/ - function subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; - /** Pub/Sub **/ } declare module "meteor/meteor" { - module Meteor { + module Meteor { + /** Global props **/ + var isClient: boolean; + var isCordova: boolean; + var isServer: boolean; + var isProduction: boolean; + var release: string; + /** Global props **/ + + /** Settings **/ + interface Settings { + public: { + [id: string]: any + }, [id: string]: any + } + var settings: Settings; + /** Settings **/ + + /** User **/ + interface UserEmail { + address: string; + verified: boolean; + } + interface User { + _id?: string; + username?: string; + emails?: UserEmail[]; + createdAt?: number; + profile?: any; + services?: any; + } + + function user(): User; + + function userId(): string; + var users: Mongo.Collection; + /** User **/ + + /** Error **/ + var Error: ErrorStatic; + interface ErrorStatic { + new (error: string | number, reason?: string, details?: string): Error; + } + interface Error { + error: string | number; + reason?: string; + details?: string; + } + /** Error **/ + + /** Method **/ + function methods(methods: Object): void; + + function call(name: string, ...args: any[]): any; + + function apply(name: string, args: EJSONable[], options?: { + wait?: boolean; + onResultReceived?: Function; + }, asyncCallback?: Function): any; + /** Method **/ + + /** Url **/ + function absoluteUrl(path?: string, options?: { + secure?: boolean; + replaceLocalhost?: boolean; + rootUrl?: string; + }): string; + /** Url **/ + + /** Timeout **/ + function setInterval(func: Function, delay: number): number; + + function setTimeout(func: Function, delay: number): number; + + function clearInterval(id: number): void; + + function clearTimeout(id: number): void; + + function defer(func: Function): void; + /** Timeout **/ + + /** utils **/ + function startup(func: Function): void; + + function wrapAsync(func: Function, context?: Object): any; + + function bindEnvironment(func: Function): any; + /** utils **/ + + /** Pub/Sub **/ + interface SubscriptionHandle { + stop(): void; + ready(): boolean; + } + interface LiveQueryHandle { + stop(): void; + } + /** Pub/Sub **/ + } +} + +declare module Meteor { /** Login **/ interface LoginWithExternalServiceOptions { - requestPermissions?: string[]; - requestOfflineToken?: Boolean; - forceApprovalPrompt?: Boolean; - loginUrlParameters?: Object; - redirectUrl?: string; - loginHint?: string; - loginStyle?: string; + requestPermissions?: string[]; + requestOfflineToken?: Boolean; + forceApprovalPrompt?: Boolean; + loginUrlParameters?: Object; + redirectUrl?: string; + loginHint?: string; + loginStyle?: string; } function loginWithMeteorDeveloperAccount(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; @@ -1288,13 +1205,13 @@ declare module "meteor/meteor" { function loggingIn(): boolean; - function loginWith < ExternalService > (options?: { - requestPermissions?: string[]; - requestOfflineToken?: boolean; - loginUrlParameters?: Object; - userEmail?: string; - loginStyle?: string; - redirectUrl?: string; + function loginWith(options?: { + requestPermissions?: string[]; + requestOfflineToken?: boolean; + loginUrlParameters?: Object; + userEmail?: string; + loginStyle?: string; + redirectUrl?: string; }, callback?: Function): void; function loginWithPassword(user: Object | string, password: string, callback?: Function): void; @@ -1308,22 +1225,22 @@ declare module "meteor/meteor" { /** Event **/ interface Event { - type: string; - target: HTMLElement; - currentTarget: HTMLElement; - which: number; - stopPropagation(): void; - stopImmediatePropagation(): void; - preventDefault(): void; - isPropagationStopped(): boolean; - isImmediatePropagationStopped(): boolean; - isDefaultPrevented(): boolean; + type: string; + target: HTMLElement; + currentTarget: HTMLElement; + which: number; + stopPropagation(): void; + stopImmediatePropagation(): void; + preventDefault(): void; + isPropagationStopped(): boolean; + isImmediatePropagationStopped(): boolean; + isDefaultPrevented(): boolean; } interface EventHandlerFunction extends Function { - (event?: Meteor.Event, templateInstance?: Blaze.TemplateInstance): void; + (event?: Meteor.Event, templateInstance?: Blaze.TemplateInstance): void; } interface EventMap { - [id: string]: Meteor.EventHandlerFunction; + [id: string]: Meteor.EventHandlerFunction; } /** Event **/ @@ -1340,48 +1257,100 @@ declare module "meteor/meteor" { /** Pub/Sub **/ function subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; /** Pub/Sub **/ - } -} - -declare module Meteor { - /** Connection **/ - interface Connection { - id: string; - close: Function; - onClose: Function; - clientAddress: string; - httpHeaders: Object; - } - - function onConnection(callback: Function): void; - /** Connection **/ - - function publish(name: string, func: Function): void; - - function _debug(...args: any[]): void; -} - -interface Subscription { - added(collection: string, id: string, fields: Object): void; - changed(collection: string, id: string, fields: Object): void; - connection: Meteor.Connection; - error(error: Error): void; - onStop(func: Function): void; - ready(): void; - removed(collection: string, id: string): void; - stop(): void; - userId: string; } declare module "meteor/meteor" { - module Meteor { + module Meteor { + /** Login **/ + interface LoginWithExternalServiceOptions { + requestPermissions?: string[]; + requestOfflineToken?: Boolean; + forceApprovalPrompt?: Boolean; + loginUrlParameters?: Object; + redirectUrl?: string; + loginHint?: string; + loginStyle?: string; + } + + function loginWithMeteorDeveloperAccount(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithFacebook(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithGithub(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithGoogle(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithMeetup(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithTwitter(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loginWithWeibo(options?: Meteor.LoginWithExternalServiceOptions, callback?: Function): void; + + function loggingIn(): boolean; + + function loginWith(options?: { + requestPermissions?: string[]; + requestOfflineToken?: boolean; + loginUrlParameters?: Object; + userEmail?: string; + loginStyle?: string; + redirectUrl?: string; + }, callback?: Function): void; + + function loginWithPassword(user: Object | string, password: string, callback?: Function): void; + + function loginWithToken(token: string, callback?: Function): void; + + function logout(callback?: Function): void; + + function logoutOtherClients(callback?: Function): void; + /** Login **/ + + /** Event **/ + interface Event { + type: string; + target: HTMLElement; + currentTarget: HTMLElement; + which: number; + stopPropagation(): void; + stopImmediatePropagation(): void; + preventDefault(): void; + isPropagationStopped(): boolean; + isImmediatePropagationStopped(): boolean; + isDefaultPrevented(): boolean; + } + interface EventHandlerFunction extends Function { + (event?: Meteor.Event, templateInstance?: Blaze.TemplateInstance): void; + } + interface EventMap { + [id: string]: Meteor.EventHandlerFunction; + } + /** Event **/ + + /** Connection **/ + function reconnect(): void; + + function disconnect(): void; + /** Connection **/ + + /** Status **/ + function status(): DDP.DDPStatus; + /** Status **/ + + /** Pub/Sub **/ + function subscribe(name: string, ...args: any[]): Meteor.SubscriptionHandle; + /** Pub/Sub **/ + } +} + +declare module Meteor { /** Connection **/ interface Connection { - id: string; - close: Function; - onClose: Function; - clientAddress: string; - httpHeaders: Object; + id: string; + close: Function; + onClose: Function; + clientAddress: string; + httpHeaders: Object; } function onConnection(callback: Function): void; @@ -1390,9 +1359,9 @@ declare module "meteor/meteor" { function publish(name: string, func: Function): void; function _debug(...args: any[]): void; - } +} - interface Subscription { +interface Subscription { added(collection: string, id: string, fields: Object): void; changed(collection: string, id: string, fields: Object): void; connection: Meteor.Connection; @@ -1402,265 +1371,281 @@ declare module "meteor/meteor" { removed(collection: string, id: string): void; stop(): void; userId: string; - } +} + +declare module "meteor/meteor" { + module Meteor { + /** Connection **/ + interface Connection { + id: string; + close: Function; + onClose: Function; + clientAddress: string; + httpHeaders: Object; + } + + function onConnection(callback: Function): void; + /** Connection **/ + + function publish(name: string, func: Function): void; + + function _debug(...args: any[]): void; + } + + interface Subscription { + added(collection: string, id: string, fields: Object): void; + changed(collection: string, id: string, fields: Object): void; + connection: Meteor.Connection; + error(error: Error): void; + onStop(func: Function): void; + ready(): void; + removed(collection: string, id: string): void; + stop(): void; + userId: string; + } } declare module Mongo { - interface Selector { - [key: string]: any; - } - interface Selector extends Object {} - interface Modifier {} - interface SortSpecifier {} - interface FieldSpecifier { - [id: string]: Number; - } - - var Collection: CollectionStatic; - interface CollectionStatic { - new < T > (name: string, options?: { - connection?: Object; - idGeneration?: string; - transform?: Function; - }): Collection < T > ; - } - interface Collection < T > { - allow(options: { - insert?: (userId: string, doc: T) => boolean; - update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; - remove?: (userId: string, doc: T) => boolean; - fetch?: string[]; - transform?: Function; - }): boolean; - deny(options: { - insert?: (userId: string, doc: T) => boolean; - update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; - remove?: (userId: string, doc: T) => boolean; - fetch?: string[]; - transform?: Function; - }): boolean; - find(selector?: Selector | ObjectID | string, options?: { - sort?: SortSpecifier; - skip?: number; - limit?: number; - fields?: FieldSpecifier; - reactive?: boolean; - transform?: Function; - }): Cursor < T > ; - findOne(selector?: Selector | ObjectID | string, options?: { - sort?: SortSpecifier; - skip?: number; - fields?: FieldSpecifier; - reactive?: boolean; - transform?: Function; - }): T; - insert(doc: T, callback?: Function): string; - rawCollection(): any; - rawDatabase(): any; - remove(selector: Selector | ObjectID | string, callback?: Function): number; - update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { - multi?: boolean; - upsert?: boolean; - }, callback?: Function): number; - upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { - multi?: boolean; - }, callback?: Function): { - numberAffected?: number;insertedId?: string; - }; - _ensureIndex(keys: { - [key: string]: number | string - } | string, options?: { - [key: string]: any - }): void; - _dropIndex(keys: { - [key: string]: number | string - } | string): void; - } - - var Cursor: CursorStatic; - interface CursorStatic { - new < T > (): Cursor < T > ; - } - interface ObserveCallbacks { - added?(document: Object) : void; - addedAt?(document: Object, atIndex: number, before: Object) : void; - changed?(newDocument: Object, oldDocument: Object) : void; - changedAt?(newDocument: Object, oldDocument: Object, indexAt: number) : void; - removed?(oldDocument: Object) : void; - removedAt?(oldDocument: Object, atIndex: number) : void; - movedTo?(document: Object, fromIndex: number, toIndex: number, before: Object) : void; - } - interface ObserveChangesCallbacks { - added?(id: string, fields: Object) : void; - addedBefore?(id: string, fields: Object, before: Object) : void; - changed?(id: string, fields: Object) : void; - movedBefore?(id: string, before: Object) : void; - removed?(id: string) : void; - } - interface Cursor < T > { - count(applySkipLimit?: boolean): number; - fetch(): Array < T > ; - forEach(callback: < T > (doc: T, index: number, cursor: Cursor < T > ) => void, thisArg?: any): void; - map < U > (callback: (doc: T, index: number, cursor: Cursor < T > ) => U, thisArg?: any): Array < U > ; - observe(callbacks: ObserveCallbacks): Meteor.LiveQueryHandle; - observeChanges(callbacks: ObserveChangesCallbacks): Meteor.LiveQueryHandle; - } - - var ObjectID: ObjectIDStatic; - interface ObjectIDStatic { - new(hexString?: string): ObjectID; - } - interface ObjectID {} -} - -declare module "meteor/mongo" { - module Mongo { interface Selector { - [key: string]: any; + [key: string]: any; } - interface Selector extends Object {} - interface Modifier {} - interface SortSpecifier {} + interface Selector extends Object { } + interface Modifier { } + interface SortSpecifier { } interface FieldSpecifier { - [id: string]: Number; + [id: string]: Number; } var Collection: CollectionStatic; interface CollectionStatic { - new < T > (name: string, options?: { - connection?: Object; - idGeneration?: string; - transform?: Function; - }): Collection < T > ; + new (name: string, options?: { + connection?: Object; + idGeneration?: string; + transform?: Function; + }): Collection; } - interface Collection < T > { - allow(options: { - insert?: (userId: string, doc: T) => boolean; - update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; - remove?: (userId: string, doc: T) => boolean; - fetch?: string[]; - transform?: Function; - }): boolean; - deny(options: { - insert?: (userId: string, doc: T) => boolean; - update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; - remove?: (userId: string, doc: T) => boolean; - fetch?: string[]; - transform?: Function; - }): boolean; - find(selector?: Selector | ObjectID | string, options?: { - sort?: SortSpecifier; - skip?: number; - limit?: number; - fields?: FieldSpecifier; - reactive?: boolean; - transform?: Function; - }): Cursor < T > ; - findOne(selector?: Selector | ObjectID | string, options?: { - sort?: SortSpecifier; - skip?: number; - fields?: FieldSpecifier; - reactive?: boolean; - transform?: Function; - }): T; - insert(doc: T, callback?: Function): string; - rawCollection(): any; - rawDatabase(): any; - remove(selector: Selector | ObjectID | string, callback?: Function): number; - update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { - multi?: boolean; - upsert?: boolean; - }, callback?: Function): number; - upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { - multi?: boolean; - }, callback?: Function): { - numberAffected?: number;insertedId?: string; - }; - _ensureIndex(keys: { - [key: string]: number | string - } | string, options?: { - [key: string]: any - }): void; - _dropIndex(keys: { - [key: string]: number | string - } | string): void; + interface Collection { + allow(options: { + insert?: (userId: string, doc: T) => boolean; + update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: T) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + deny(options: { + insert?: (userId: string, doc: T) => boolean; + update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: T) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + find(selector?: Selector | ObjectID | string, options?: { + sort?: SortSpecifier; + skip?: number; + limit?: number; + fields?: FieldSpecifier; + reactive?: boolean; + transform?: Function; + }): Cursor; + findOne(selector?: Selector | ObjectID | string, options?: { + sort?: SortSpecifier; + skip?: number; + fields?: FieldSpecifier; + reactive?: boolean; + transform?: Function; + }): T; + insert(doc: T, callback?: Function): string; + rawCollection(): any; + rawDatabase(): any; + remove(selector: Selector | ObjectID | string, callback?: Function): number; + update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + multi?: boolean; + upsert?: boolean; + }, callback?: Function): number; + upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + multi?: boolean; + }, callback?: Function): { + numberAffected?: number; insertedId?: string; + }; + _ensureIndex(keys: { + [key: string]: number | string + } | string, options?: { + [key: string]: any + }): void; + _dropIndex(keys: { + [key: string]: number | string + } | string): void; } var Cursor: CursorStatic; interface CursorStatic { - new < T > (): Cursor < T > ; + new (): Cursor; } interface ObserveCallbacks { - added?(document: Object) : void; - addedAt?(document: Object, atIndex: number, before: Object) : void; - changed?(newDocument: Object, oldDocument: Object) : void; - changedAt?(newDocument: Object, oldDocument: Object, indexAt: number) : void; - removed?(oldDocument: Object) : void; - removedAt?(oldDocument: Object, atIndex: number) : void; - movedTo?(document: Object, fromIndex: number, toIndex: number, before: Object) : void; + added?(document: Object): void; + addedAt?(document: Object, atIndex: number, before: Object): void; + changed?(newDocument: Object, oldDocument: Object): void; + changedAt?(newDocument: Object, oldDocument: Object, indexAt: number): void; + removed?(oldDocument: Object): void; + removedAt?(oldDocument: Object, atIndex: number): void; + movedTo?(document: Object, fromIndex: number, toIndex: number, before: Object): void; } interface ObserveChangesCallbacks { - added?(id: string, fields: Object) : void; - addedBefore?(id: string, fields: Object, before: Object) : void; - changed?(id: string, fields: Object) : void; - movedBefore?(id: string, before: Object) : void; - removed?(id: string) : void; + added?(id: string, fields: Object): void; + addedBefore?(id: string, fields: Object, before: Object): void; + changed?(id: string, fields: Object): void; + movedBefore?(id: string, before: Object): void; + removed?(id: string): void; } - interface Cursor < T > { - count(applySkipLimit?: boolean): number; - fetch(): Array < T > ; - forEach(callback: < T > (doc: T, index: number, cursor: Cursor < T > ) => void, thisArg?: any): void; - map < U > (callback: (doc: T, index: number, cursor: Cursor < T > ) => U, thisArg?: any): Array < U > ; - observe(callbacks: ObserveCallbacks): Meteor.LiveQueryHandle; - observeChanges(callbacks: ObserveChangesCallbacks): Meteor.LiveQueryHandle; + interface Cursor { + count(applySkipLimit?: boolean): number; + fetch(): Array; + forEach(callback: < T > (doc: T, index: number, cursor: Cursor) => void, thisArg?: any): void; + map(callback: (doc: T, index: number, cursor: Cursor) => U, thisArg?: any): Array; + observe(callbacks: ObserveCallbacks): Meteor.LiveQueryHandle; + observeChanges(callbacks: ObserveChangesCallbacks): Meteor.LiveQueryHandle; } var ObjectID: ObjectIDStatic; interface ObjectIDStatic { - new(hexString?: string): ObjectID; + new (hexString?: string): ObjectID; } - interface ObjectID {} - } -} - -declare module Mongo { - interface AllowDenyOptions { - insert?: (userId: string, doc: any) => boolean; - update?: (userId: string, doc: any, fieldNames: string[], modifier: any) => boolean; - remove?: (userId: string, doc: any) => boolean; - fetch?: string[]; - transform?: Function; - } + interface ObjectID { } } declare module "meteor/mongo" { - module Mongo { + module Mongo { + interface Selector { + [key: string]: any; + } + interface Selector extends Object { } + interface Modifier { } + interface SortSpecifier { } + interface FieldSpecifier { + [id: string]: Number; + } + + var Collection: CollectionStatic; + interface CollectionStatic { + new (name: string, options?: { + connection?: Object; + idGeneration?: string; + transform?: Function; + }): Collection; + } + interface Collection { + allow(options: { + insert?: (userId: string, doc: T) => boolean; + update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: T) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + deny(options: { + insert?: (userId: string, doc: T) => boolean; + update?: (userId: string, doc: T, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: T) => boolean; + fetch?: string[]; + transform?: Function; + }): boolean; + find(selector?: Selector | ObjectID | string, options?: { + sort?: SortSpecifier; + skip?: number; + limit?: number; + fields?: FieldSpecifier; + reactive?: boolean; + transform?: Function; + }): Cursor; + findOne(selector?: Selector | ObjectID | string, options?: { + sort?: SortSpecifier; + skip?: number; + fields?: FieldSpecifier; + reactive?: boolean; + transform?: Function; + }): T; + insert(doc: T, callback?: Function): string; + rawCollection(): any; + rawDatabase(): any; + remove(selector: Selector | ObjectID | string, callback?: Function): number; + update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + multi?: boolean; + upsert?: boolean; + }, callback?: Function): number; + upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + multi?: boolean; + }, callback?: Function): { + numberAffected?: number; insertedId?: string; + }; + _ensureIndex(keys: { + [key: string]: number | string + } | string, options?: { + [key: string]: any + }): void; + _dropIndex(keys: { + [key: string]: number | string + } | string): void; + } + + var Cursor: CursorStatic; + interface CursorStatic { + new (): Cursor; + } + interface ObserveCallbacks { + added?(document: Object): void; + addedAt?(document: Object, atIndex: number, before: Object): void; + changed?(newDocument: Object, oldDocument: Object): void; + changedAt?(newDocument: Object, oldDocument: Object, indexAt: number): void; + removed?(oldDocument: Object): void; + removedAt?(oldDocument: Object, atIndex: number): void; + movedTo?(document: Object, fromIndex: number, toIndex: number, before: Object): void; + } + interface ObserveChangesCallbacks { + added?(id: string, fields: Object): void; + addedBefore?(id: string, fields: Object, before: Object): void; + changed?(id: string, fields: Object): void; + movedBefore?(id: string, before: Object): void; + removed?(id: string): void; + } + interface Cursor { + count(applySkipLimit?: boolean): number; + fetch(): Array; + forEach(callback: < T > (doc: T, index: number, cursor: Cursor) => void, thisArg?: any): void; + map(callback: (doc: T, index: number, cursor: Cursor) => U, thisArg?: any): Array; + observe(callbacks: ObserveCallbacks): Meteor.LiveQueryHandle; + observeChanges(callbacks: ObserveChangesCallbacks): Meteor.LiveQueryHandle; + } + + var ObjectID: ObjectIDStatic; + interface ObjectIDStatic { + new (hexString?: string): ObjectID; + } + interface ObjectID { } + } +} + +declare module Mongo { interface AllowDenyOptions { - insert?: (userId: string, doc: any) => boolean; - update?: (userId: string, doc: any, fieldNames: string[], modifier: any) => boolean; - remove?: (userId: string, doc: any) => boolean; - fetch?: string[]; - transform?: Function; + insert?: (userId: string, doc: any) => boolean; + update?: (userId: string, doc: any, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: any) => boolean; + fetch?: string[]; + transform?: Function; + } +} + +declare module "meteor/mongo" { + module Mongo { + interface AllowDenyOptions { + insert?: (userId: string, doc: any) => boolean; + update?: (userId: string, doc: any, fieldNames: string[], modifier: any) => boolean; + remove?: (userId: string, doc: any) => boolean; + fetch?: string[]; + transform?: Function; + } } - } } declare module Random { - function id(numberOfChars?: number): string; - - function secret(numberOfChars?: number): string; - - function fraction(): number; - // @param numberOfDigits, @returns a random hex string of the given length - function hexString(numberOfDigits: number): string; - // @param array, @return a random element in array - function choice(array: any[]): string; - // @param str, @return a random char in str - function choice(str: string): string; -} - -declare module "meteor/random" { - module Random { function id(numberOfChars?: number): string; function secret(numberOfChars?: number): string; @@ -1672,41 +1657,45 @@ declare module "meteor/random" { function choice(array: any[]): string; // @param str, @return a random char in str function choice(str: string): string; - } +} + +declare module "meteor/random" { + module Random { + function id(numberOfChars?: number): string; + + function secret(numberOfChars?: number): string; + + function fraction(): number; + // @param numberOfDigits, @returns a random hex string of the given length + function hexString(numberOfDigits: number): string; + // @param array, @return a random element in array + function choice(array: any[]): string; + // @param str, @return a random char in str + function choice(str: string): string; + } } declare var ReactiveVar: ReactiveVarStatic; interface ReactiveVarStatic { - new < T > (initialValue: T, equalsFunc?: Function): ReactiveVar < T > ; + new (initialValue: T, equalsFunc?: Function): ReactiveVar; } -interface ReactiveVar < T > { - get(): T; - set(newValue: T): void; +interface ReactiveVar { + get(): T; + set(newValue: T): void; } declare module "meteor/reactive-var" { - var ReactiveVar: ReactiveVarStatic; - interface ReactiveVarStatic { - new < T > (initialValue: T, equalsFunc?: Function): ReactiveVar < T > ; - } - interface ReactiveVar < T > { - get(): T; - set(newValue: T): void; - } + var ReactiveVar: ReactiveVarStatic; + interface ReactiveVarStatic { + new (initialValue: T, equalsFunc?: Function): ReactiveVar; + } + interface ReactiveVar { + get(): T; + set(newValue: T): void; + } } declare module Session { - function equals(key: string, value: string | number | boolean | any): boolean; - - function get(key: string): any; - - function set(key: string, value: EJSONable | any): void; - - function setDefault(key: string, value: EJSONable | any): void; -} - -declare module "meteor/session" { - module Session { function equals(key: string, value: string | number | boolean | any): boolean; function get(key: string): any; @@ -1714,74 +1703,47 @@ declare module "meteor/session" { function set(key: string, value: EJSONable | any): void; function setDefault(key: string, value: EJSONable | any): void; - } +} + +declare module "meteor/session" { + module Session { + function equals(key: string, value: string | number | boolean | any): boolean; + + function get(key: string): any; + + function set(key: string, value: EJSONable | any): void; + + function setDefault(key: string, value: EJSONable | any): void; + } } declare var Template: TemplateStatic; interface TemplateStatic extends Blaze.TemplateStatic { - new(viewName?: string, renderFunction?: Function): Blaze.Template; - body: Blaze.Template; - [index: string]: any | Blaze.Template; + new (viewName?: string, renderFunction?: Function): Blaze.Template; + body: Blaze.Template; + [index: string]: any | Blaze.Template; } declare module "meteor/templating" { - var Template: TemplateStatic; - interface TemplateStatic extends Blaze.TemplateStatic { - new(viewName?: string, renderFunction?: Function): Blaze.Template; - body: Blaze.Template; - [index: string]: any | Blaze.Template; - } + var Template: TemplateStatic; + interface TemplateStatic extends Blaze.TemplateStatic { + new (viewName?: string, renderFunction?: Function): Blaze.Template; + body: Blaze.Template; + [index: string]: any | Blaze.Template; + } } interface ILengthAble { - length: number; + length: number; } interface ITinytestAssertions { - ok(doc: Object): void; - expect_fail(): void; - fail(doc: Object): void; - runId(): string; - equal < T > (actual: T, expected: T, message?: string, not?: boolean): void; - notEqual < T > (actual: T, expected: T, message?: string): void; - instanceOf(obj: Object, klass: Function, message?: string): void; - notInstanceOf(obj: Object, klass: Function, message?: string): void; - matches(actual: any, regexp: RegExp, message?: string): void; - notMatches(actual: any, regexp: RegExp, message?: string): void; - throws(f: Function, expected?: string | RegExp): void; - isTrue(v: boolean, msg?: string): void; - isFalse(v: boolean, msg?: string): void; - isNull(v: any, msg?: string): void; - isNotNull(v: any, msg?: string): void; - isUndefined(v: any, msg?: string): void; - isNotUndefined(v: any, msg?: string): void; - isNan(v: any, msg?: string): void; - isNotNan(v: any, msg?: string): void; - include < T > (s: Array < T > | Object | string, value: any, msg?: string, not?: boolean): void; - - notInclude < T > (s: Array < T > | Object | string, value: any, msg?: string, not?: boolean): void; - length(obj: ILengthAble, expected_length: number, msg?: string): void; - _stringEqual(actual: string, expected: string, msg?: string): void; -} - -declare module Tinytest { - function add(description: string, func: (test: ITinytestAssertions) => void): void; - - function addAsync(description: string, func: (test: ITinytestAssertions) => void): void; -} - -declare module "meteor/tiny-test" { - interface ILengthAble { - length: number; - } - - interface ITinytestAssertions { ok(doc: Object): void; expect_fail(): void; fail(doc: Object): void; runId(): string; - equal < T > (actual: T, expected: T, message?: string, not?: boolean): void; - notEqual < T > (actual: T, expected: T, message?: string): void; + equal(actual: T, expected: T, message?: string, not?: boolean): void; + notEqual(actual: T, expected: T, message?: string): void; instanceOf(obj: Object, klass: Function, message?: string): void; notInstanceOf(obj: Object, klass: Function, message?: string): void; matches(actual: any, regexp: RegExp, message?: string): void; @@ -1795,128 +1757,62 @@ declare module "meteor/tiny-test" { isNotUndefined(v: any, msg?: string): void; isNan(v: any, msg?: string): void; isNotNan(v: any, msg?: string): void; - include < T > (s: Array < T > | Object | string, value: any, msg?: string, not?: boolean): void; + include(s: Array | Object | string, value: any, msg?: string, not?: boolean): void; - notInclude < T > (s: Array < T > | Object | string, value: any, msg?: string, not?: boolean): void; + notInclude(s: Array | Object | string, value: any, msg?: string, not?: boolean): void; length(obj: ILengthAble, expected_length: number, msg?: string): void; _stringEqual(actual: string, expected: string, msg?: string): void; - } +} - module Tinytest { +declare module Tinytest { function add(description: string, func: (test: ITinytestAssertions) => void): void; function addAsync(description: string, func: (test: ITinytestAssertions) => void): void; - } +} + +declare module "meteor/tiny-test" { + interface ILengthAble { + length: number; + } + + interface ITinytestAssertions { + ok(doc: Object): void; + expect_fail(): void; + fail(doc: Object): void; + runId(): string; + equal(actual: T, expected: T, message?: string, not?: boolean): void; + notEqual(actual: T, expected: T, message?: string): void; + instanceOf(obj: Object, klass: Function, message?: string): void; + notInstanceOf(obj: Object, klass: Function, message?: string): void; + matches(actual: any, regexp: RegExp, message?: string): void; + notMatches(actual: any, regexp: RegExp, message?: string): void; + throws(f: Function, expected?: string | RegExp): void; + isTrue(v: boolean, msg?: string): void; + isFalse(v: boolean, msg?: string): void; + isNull(v: any, msg?: string): void; + isNotNull(v: any, msg?: string): void; + isUndefined(v: any, msg?: string): void; + isNotUndefined(v: any, msg?: string): void; + isNan(v: any, msg?: string): void; + isNotNan(v: any, msg?: string): void; + include(s: Array | Object | string, value: any, msg?: string, not?: boolean): void; + + notInclude(s: Array | Object | string, value: any, msg?: string, not?: boolean): void; + length(obj: ILengthAble, expected_length: number, msg?: string): void; + _stringEqual(actual: string, expected: string, msg?: string): void; + } + + module Tinytest { + function add(description: string, func: (test: ITinytestAssertions) => void): void; + + function addAsync(description: string, func: (test: ITinytestAssertions) => void): void; + } } declare module App { - function accessRule(pattern: string, options?: { - type?: string; - launchExternal?: boolean; - }): void; - - function configurePlugin(id: string, config: Object): void; - - function icons(icons: Object): void; - - function info(options: { - id?: string; - version?: string; - name?: string; - description?: string; - author?: string; - email?: string; - website?: string; - }): void; - - function launchScreens(launchScreens: Object): void; - - function setPreference(name: string, value: string, platform?: string): void; -} - -declare function execFileAsync(command: string, args?: any[], options?: { - cwd?: Object; - env?: Object; - stdio?: any[] | string; - destination?: any; - waitForClose?: string; -}): any; -declare function execFileSync(command: string, args?: any[], options?: { - cwd?: Object; - env?: Object; - stdio?: any[] | string; - destination?: any; - waitForClose?: string; -}): String; - -declare module Assets { - function getBinary(assetPath: string, asyncCallback?: Function): EJSON; - - function getText(assetPath: string, asyncCallback?: Function): string; - - function absoluteFilePath(assetPath: string): string; -} - -declare module Cordova { - function depends(dependencies: { - [id: string]: string - }): void; -} - -declare module Npm { - function depends(dependencies: { - [id: string]: string - }): void; - - function require(name: string): any; -} - -declare namespace Package { - function describe(options: { - summary?: string; - version?: string; - name?: string; - git?: string; - documentation?: string; - debugOnly?: boolean; - prodOnly?: boolean; - testOnly?: boolean; - }): void; - - function onTest(func: (api: PackageAPI) => void): void; - - function onUse(func: (api: PackageAPI) => void): void; - - function registerBuildPlugin(options?: { - name?: string; - use?: string | string[]; - sources?: string[]; - npmDependencies?: Object; - }): void; -} - -interface PackageAPI { - new(): PackageAPI; - addAssets(filenames: string | string[], architecture: string | string[]): void; - addFiles(filenames: string | string[], architecture?: string | string[], options?: { - bare?: boolean; - }): void; - export (exportedObjects: string | string[], architecture?: string | string[], exportOptions?: Object, testOnly?: boolean): void; - imply(packageNames: string | string[], architecture?: string | string[]): void; - use(packageNames: string | string[], architecture?: string | string[], options?: { - weak?: boolean; - unordered?: boolean; - }): void; - versionsFrom(meteorRelease: string | string[]): void; -} - -declare var console: Console; - -declare module "meteor/tools" { - module App { function accessRule(pattern: string, options?: { - type?: string; - launchExternal?: boolean; + type?: string; + launchExternal?: boolean; }): void; function configurePlugin(id: string, config: Object): void; @@ -1924,68 +1820,67 @@ declare module "meteor/tools" { function icons(icons: Object): void; function info(options: { - id?: string; - version?: string; - name?: string; - description?: string; - author?: string; - email?: string; - website?: string; + id?: string; + version?: string; + name?: string; + description?: string; + author?: string; + email?: string; + website?: string; }): void; function launchScreens(launchScreens: Object): void; function setPreference(name: string, value: string, platform?: string): void; - } +} - function execFileAsync(command: string, args?: any[], options?: { +declare function execFileAsync(command: string, args?: any[], options?: { cwd?: Object; env?: Object; stdio?: any[] | string; destination?: any; waitForClose?: string; - }): any; - - function execFileSync(command: string, args?: any[], options?: { +}): any; +declare function execFileSync(command: string, args?: any[], options?: { cwd?: Object; env?: Object; stdio?: any[] | string; destination?: any; waitForClose?: string; - }): String; +}): String; - module Assets { +declare module Assets { function getBinary(assetPath: string, asyncCallback?: Function): EJSON; function getText(assetPath: string, asyncCallback?: Function): string; function absoluteFilePath(assetPath: string): string; - } +} - module Cordova { +declare module Cordova { function depends(dependencies: { - [id: string]: string + [id: string]: string }): void; - } +} - module Npm { +declare module Npm { function depends(dependencies: { - [id: string]: string + [id: string]: string }): void; function require(name: string): any; - } +} - namespace Package { +declare namespace Package { function describe(options: { - summary?: string; - version?: string; - name?: string; - git?: string; - documentation?: string; - debugOnly?: boolean; - prodOnly?: boolean; - testOnly?: boolean; + summary?: string; + version?: string; + name?: string; + git?: string; + documentation?: string; + debugOnly?: boolean; + prodOnly?: boolean; + testOnly?: boolean; }): void; function onTest(func: (api: PackageAPI) => void): void; @@ -1993,91 +1888,157 @@ declare module "meteor/tools" { function onUse(func: (api: PackageAPI) => void): void; function registerBuildPlugin(options?: { - name?: string; - use?: string | string[]; - sources?: string[]; - npmDependencies?: Object; + name?: string; + use?: string | string[]; + sources?: string[]; + npmDependencies?: Object; }): void; - } +} - interface PackageAPI { - new(): PackageAPI; +interface PackageAPI { + new (): PackageAPI; addAssets(filenames: string | string[], architecture: string | string[]): void; addFiles(filenames: string | string[], architecture?: string | string[], options?: { - bare?: boolean; + bare?: boolean; }): void; - export (exportedObjects: string | string[], architecture?: string | string[], exportOptions?: Object, testOnly?: boolean): void; + export(exportedObjects: string | string[], architecture?: string | string[], exportOptions?: Object, testOnly?: boolean): void; imply(packageNames: string | string[], architecture?: string | string[]): void; use(packageNames: string | string[], architecture?: string | string[], options?: { - weak?: boolean; - unordered?: boolean; + weak?: boolean; + unordered?: boolean; }): void; versionsFrom(meteorRelease: string | string[]): void; - } +} - var console: Console; +declare var console: Console; + +declare module "meteor/tools" { + module App { + function accessRule(pattern: string, options?: { + type?: string; + launchExternal?: boolean; + }): void; + + function configurePlugin(id: string, config: Object): void; + + function icons(icons: Object): void; + + function info(options: { + id?: string; + version?: string; + name?: string; + description?: string; + author?: string; + email?: string; + website?: string; + }): void; + + function launchScreens(launchScreens: Object): void; + + function setPreference(name: string, value: string, platform?: string): void; + } + + function execFileAsync(command: string, args?: any[], options?: { + cwd?: Object; + env?: Object; + stdio?: any[] | string; + destination?: any; + waitForClose?: string; + }): any; + + function execFileSync(command: string, args?: any[], options?: { + cwd?: Object; + env?: Object; + stdio?: any[] | string; + destination?: any; + waitForClose?: string; + }): String; + + module Assets { + function getBinary(assetPath: string, asyncCallback?: Function): EJSON; + + function getText(assetPath: string, asyncCallback?: Function): string; + + function absoluteFilePath(assetPath: string): string; + } + + module Cordova { + function depends(dependencies: { + [id: string]: string + }): void; + } + + module Npm { + function depends(dependencies: { + [id: string]: string + }): void; + + function require(name: string): any; + } + + namespace Package { + function describe(options: { + summary?: string; + version?: string; + name?: string; + git?: string; + documentation?: string; + debugOnly?: boolean; + prodOnly?: boolean; + testOnly?: boolean; + }): void; + + function onTest(func: (api: PackageAPI) => void): void; + + function onUse(func: (api: PackageAPI) => void): void; + + function registerBuildPlugin(options?: { + name?: string; + use?: string | string[]; + sources?: string[]; + npmDependencies?: Object; + }): void; + } + + interface PackageAPI { + new (): PackageAPI; + addAssets(filenames: string | string[], architecture: string | string[]): void; + addFiles(filenames: string | string[], architecture?: string | string[], options?: { + bare?: boolean; + }): void; + export(exportedObjects: string | string[], architecture?: string | string[], exportOptions?: Object, testOnly?: boolean): void; + imply(packageNames: string | string[], architecture?: string | string[]): void; + use(packageNames: string | string[], architecture?: string | string[], options?: { + weak?: boolean; + unordered?: boolean; + }): void; + versionsFrom(meteorRelease: string | string[]): void; + } + + var console: Console; } declare module Tracker { - function Computation(): void; - interface Computation { - firstRun: boolean; - invalidate(): void; - invalidated: boolean; - onInvalidate(callback: Function): void; - onStop(callback: Function): void; - stop(): void; - stopped: boolean; - } - var currentComputation: Computation; - - var Dependency: DependencyStatic; - interface DependencyStatic { - new(): Dependency; - } - interface Dependency { - changed(): void; - depend(fromComputation?: Computation): boolean; - hasDependents(): boolean; - } - - var active: boolean; - - function afterFlush(callback: Function): void; - - function autorun(runFunc: (computation: Computation) => void, options?: { - onError?: Function; - }): Computation; - - function flush(): void; - - function nonreactive(func: Function): void; - - function onInvalidate(callback: Function): void; -} - -declare module "meteor/tracker" { - module Tracker { function Computation(): void; interface Computation { - firstRun: boolean; - invalidate(): void; - invalidated: boolean; - onInvalidate(callback: Function): void; - onStop(callback: Function): void; - stop(): void; - stopped: boolean; + firstRun: boolean; + invalidate(): void; + invalidated: boolean; + onInvalidate(callback: Function): void; + onStop(callback: Function): void; + stop(): void; + stopped: boolean; } var currentComputation: Computation; var Dependency: DependencyStatic; interface DependencyStatic { - new(): Dependency; + new (): Dependency; } interface Dependency { - changed(): void; - depend(fromComputation?: Computation): boolean; - hasDependents(): boolean; + changed(): void; + depend(fromComputation?: Computation): boolean; + hasDependents(): boolean; } var active: boolean; @@ -2085,7 +2046,7 @@ declare module "meteor/tracker" { function afterFlush(callback: Function): void; function autorun(runFunc: (computation: Computation) => void, options?: { - onError?: Function; + onError?: Function; }): Computation; function flush(): void; @@ -2093,51 +2054,90 @@ declare module "meteor/tracker" { function nonreactive(func: Function): void; function onInvalidate(callback: Function): void; - } +} + +declare module "meteor/tracker" { + module Tracker { + function Computation(): void; + interface Computation { + firstRun: boolean; + invalidate(): void; + invalidated: boolean; + onInvalidate(callback: Function): void; + onStop(callback: Function): void; + stop(): void; + stopped: boolean; + } + var currentComputation: Computation; + + var Dependency: DependencyStatic; + interface DependencyStatic { + new (): Dependency; + } + interface Dependency { + changed(): void; + depend(fromComputation?: Computation): boolean; + hasDependents(): boolean; + } + + var active: boolean; + + function afterFlush(callback: Function): void; + + function autorun(runFunc: (computation: Computation) => void, options?: { + onError?: Function; + }): Computation; + + function flush(): void; + + function nonreactive(func: Function): void; + + function onInvalidate(callback: Function): void; + } } declare module Match { - function Maybe(pattern: any): boolean; + function Maybe(pattern: any): boolean; } declare module "meteor/check" { - module Match { - function Maybe(pattern: any): boolean; - } + module Match { + function Maybe(pattern: any): boolean; + } } declare module Meteor { - /** Global props **/ - var isDevelopment: boolean; - var isTest: boolean; - /** Global props **/ -} - -declare module "meteor/meteor" { - module Meteor { /** Global props **/ var isDevelopment: boolean; var isTest: boolean; /** Global props **/ - } +} + +declare module "meteor/meteor" { + module Meteor { + /** Global props **/ + var isDevelopment: boolean; + var isTest: boolean; + /** Global props **/ + } } declare module Accounts { - function onLogout(func: Function): void; -} - -declare module "meteor/accounts-base" { - module Accounts { function onLogout(func: Function): void; - } -} - -declare module Accounts { - function onLogout(func: (user: Meteor.User, connection: Meteor.Connection) => void): void; } declare module "meteor/accounts-base" { - module Accounts { + module Accounts { + function onLogout(func: Function): void; + } +} + +declare module Accounts { function onLogout(func: (user: Meteor.User, connection: Meteor.Connection) => void): void; - } +} + +declare module "meteor/accounts-base" { + module Accounts { + function onLogout(func: (user: Meteor.User, connection: Meteor.Connection) => void): void; + } } diff --git a/meteor/meteor-tests.ts b/meteor/meteor-tests.ts index 4b59d9cc7a..c269105eb3 100644 --- a/meteor/meteor-tests.ts +++ b/meteor/meteor-tests.ts @@ -6,24 +6,24 @@ /*********************************** Begin setup for tests ******************************/ -import {Mongo} from "meteor/mongo"; -import {Meteor} from "meteor/meteor"; -import {check, Match} from "meteor/check"; -import {Tracker} from "meteor/tracker"; -import {Template} from "meteor/templating"; -import {Blaze} from "meteor/blaze"; -import {Session} from "meteor/session"; -import {HTTP} from "meteor/http"; -import {ReactiveVar} from "meteor/reactive-var"; -import {Accounts} from "meteor/accounts-base"; -import {BrowserPolicy} from "meteor/browser-policy-common"; -import {DDPRateLimiter} from "meteor/ddp-rate-limiter"; +import { Mongo } from "meteor/mongo"; +import { Meteor } from "meteor/meteor"; +import { check, Match } from "meteor/check"; +import { Tracker } from "meteor/tracker"; +import { Template } from "meteor/templating"; +import { Blaze } from "meteor/blaze"; +import { Session } from "meteor/session"; +import { HTTP } from "meteor/http"; +import { ReactiveVar } from "meteor/reactive-var"; +import { Accounts } from "meteor/accounts-base"; +import { BrowserPolicy } from "meteor/browser-policy-common"; +import { DDPRateLimiter } from "meteor/ddp-rate-limiter"; var Rooms = new Mongo.Collection('rooms'); var Messages = new Mongo.Collection('messages'); interface MonkeyDAO { - _id: string; - name: string; + _id: string; + name: string; } var Monkeys = new Mongo.Collection('monkeys'); //var x = new Mongo.Collection('x'); @@ -36,68 +36,68 @@ var Monkeys = new Mongo.Collection('monkeys'); * Tests Meteor.isServer, Meteor.startup, Collection.insert(), Collection.find() */ if (Meteor.isServer) { - Meteor.startup(function () { - if (Rooms.find().count() === 0) { - Rooms.insert({name: "Initial room"}); - } - }); + Meteor.startup(function () { + if (Rooms.find().count() === 0) { + Rooms.insert({ name: "Initial room" }); + } + }); } /** * From Publish and Subscribe, Meteor.publish section **/ Meteor.publish("rooms", function () { - return Rooms.find({}, {fields: {secretInfo: 0}}); + return Rooms.find({}, { fields: { secretInfo: 0 } }); }); Meteor.publish("adminSecretInfo", function () { - return Rooms.find({admin: this.userId}, {fields: {secretInfo: 1}}); + return Rooms.find({ admin: this.userId }, { fields: { secretInfo: 1 } }); }); Meteor.publish("roomAndMessages", function (roomId: string) { - check(roomId, String); - return [ - Rooms.find({_id: roomId}, {fields: {secretInfo: 0}}), - Messages.find({roomId: roomId}) - ]; + check(roomId, String); + return [ + Rooms.find({ _id: roomId }, { fields: { secretInfo: 0 } }), + Messages.find({ roomId: roomId }) + ]; }); /** * Also from Publish and Subscribe, Meteor.publish section */ Meteor.publish("counts-by-room", function (roomId: string) { - var self = this; - check(roomId, String); - var count = 0; - var initializing = true; - var handle = Messages.find({roomId: roomId}).observeChanges({ - added: function (id: any) { - count++; - // if (!initializing) - // this.changed("counts", roomId, {count: count}); - }, - removed: function (id: any) { - count--; -// Todo: Not sure how to define in typescript -// self.changed("counts", roomId, {count: count}); - } - }); + var self = this; + check(roomId, String); + var count = 0; + var initializing = true; + var handle = Messages.find({ roomId: roomId }).observeChanges({ + added: function (id: any) { + count++; + // if (!initializing) + // this.changed("counts", roomId, {count: count}); + }, + removed: function (id: any) { + count--; + // Todo: Not sure how to define in typescript + // self.changed("counts", roomId, {count: count}); + } + }); - initializing = false; + initializing = false; -// Todo: Not sure how to define in typescript -// self.added("counts", roomId, {count: count}); - self.ready(); + // Todo: Not sure how to define in typescript + // self.added("counts", roomId, {count: count}); + self.ready(); - self.onStop(function () { - handle.stop(); - }); + self.onStop(function () { + handle.stop(); + }); }); var Counts = new Mongo.Collection("counts"); Tracker.autorun(function () { - Meteor.subscribe("counts-by-room", Session.get("roomId")); + Meteor.subscribe("counts-by-room", Session.get("roomId")); }); // Checking status @@ -116,47 +116,47 @@ Meteor.subscribe("allplayers"); * Also from Meteor.subscribe section */ Tracker.autorun(function () { - Meteor.subscribe("chat", {room: Session.get("current-room")}); - Meteor.subscribe("privateMessages"); + Meteor.subscribe("chat", { room: Session.get("current-room") }); + Meteor.subscribe("privateMessages"); }); /** * From Methods, Meteor.methods section */ Meteor.methods({ - foo: function (arg1: string, arg2: number[]) { - check(arg1, String); - check(arg2, [Number]); + foo: function (arg1: string, arg2: number[]) { + check(arg1, String); + check(arg2, [Number]); - var you_want_to_throw_an_error = true; - if (you_want_to_throw_an_error) - throw new Meteor.Error("404", "Can't find my pants"); - return "some return value"; - }, + var you_want_to_throw_an_error = true; + if (you_want_to_throw_an_error) + throw new Meteor.Error("404", "Can't find my pants"); + return "some return value"; + }, - bar: function () { - // .. do other stuff .. - return "baz"; - } + bar: function () { + // .. do other stuff .. + return "baz"; + } }); /** * From Methods, Meteor.Error section */ function meteorErrorTestFunction1() { - throw new Meteor.Error("logged-out", - "The user must be logged in to post a comment."); + throw new Meteor.Error("logged-out", + "The user must be logged in to post a comment."); } function meteorErrorTestFunction2() { - throw new Meteor.Error(403, - "The user must be logged in to post a comment."); + throw new Meteor.Error(403, + "The user must be logged in to post a comment."); } Meteor.call("methodName", function (error: Meteor.Error) { - if (error.error === "logged-out") { - Session.set("errorMessage", "Please log in to post a comment."); - } + if (error.error === "logged-out") { + Session.set("errorMessage", "Please log in to post a comment."); + } }); var error = new Meteor.Error("logged-out", "The user must be logged in to post a comment."); console.log(error.error === "logged-out"); @@ -166,7 +166,7 @@ console.log(error.details !== ""); /** * From Methods, Meteor.call section */ -Meteor.call('foo', 1, 2, function (error:any, result:any) {} ); +Meteor.call('foo', 1, 2, function (error: any, result: any) { }); var result = Meteor.call('foo', 1, 2); /** @@ -175,22 +175,22 @@ var result = Meteor.call('foo', 1, 2); // DA: I added the "var" keyword in there interface ChatroomsDAO { - _id?: string; + _id?: string; } interface MessagesDAO { - _id?: string; + _id?: string; } var Chatrooms = new Mongo.Collection("chatrooms"); Messages = new Mongo.Collection("messages"); -var myMessages:any[] = Messages.find({userId: Session.get('myUserId')}).fetch(); +var myMessages: any[] = Messages.find({ userId: Session.get('myUserId') }).fetch(); -Messages.insert({text: "Hello, world!"}); +Messages.insert({ text: "Hello, world!" }); -Messages.update(myMessages[0]._id, {$set: {important: true}}); +Messages.update(myMessages[0]._id, { $set: { important: true } }); var Posts = new Mongo.Collection("posts"); -Posts.insert({title: "Hello world", body: "First post"}); +Posts.insert({ title: "Hello world", body: "First post" }); // Couldn't find assert() in the meteor docs //assert(Posts.find().count() === 1); @@ -206,30 +206,30 @@ Posts.insert({title: "Hello world", body: "First post"}); **/ class Animal { - private sound:string; - constructor(doc:any) { + private sound: string; + constructor(doc: any) { } makeNoise() { - console.log(this.sound) + console.log(this.sound) } } interface AnimalDAO { - _id?: string; - name: string; - sound: string; - makeNoise?: () => void; + _id?: string; + name: string; + sound: string; + makeNoise?: () => void; } // Define a Collection that uses Animal as its document var Animals = new Mongo.Collection("Animals", { - transform: function (doc:any): Animal { return new Animal(doc); } + transform: function (doc: any): Animal { return new Animal(doc); } }); // Create an Animal and call its makeNoise method -Animals.insert({name: "raptor", sound: "roar"}); -Animals.findOne({name: "raptor"}).makeNoise(); // prints "roar" +Animals.insert({ name: "raptor", sound: "roar" }); +Animals.findOne({ name: "raptor" }).makeNoise(); // prints "roar" /** * From Collections, Collection.insert section @@ -238,9 +238,9 @@ Animals.findOne({name: "raptor"}).makeNoise(); // prints "roar" var Lists = new Mongo.Collection('Lists'); var Items = new Mongo.Collection('Lists'); -var groceriesId = Lists.insert({name: "Groceries"}); -Items.insert({list: groceriesId, name: "Watercress"}); -Items.insert({list: groceriesId, name: "Persimmons"}); +var groceriesId = Lists.insert({ name: "Groceries" }); +Items.insert({ list: groceriesId, name: "Watercress" }); +Items.insert({ list: groceriesId, name: "Persimmons" }); /** * From Collections, collection.update section @@ -248,39 +248,39 @@ Items.insert({list: groceriesId, name: "Persimmons"}); var Players = new Mongo.Collection('Players'); Template['adminDashboard'].events({ - 'click .givePoints': function () { - Players.update(Session.get("currentPlayer"), {$inc: {score: 5}}); - } + 'click .givePoints': function () { + Players.update(Session.get("currentPlayer"), { $inc: { score: 5 } }); + } }); /** * Also from Collections, collection.update section */ Meteor.methods({ - declareWinners: function () { - Players.update({score: {$gt: 10}}, - {$addToSet: {badges: "Winner"}}, - {multi: true}); - } + declareWinners: function () { + Players.update({ score: { $gt: 10 } }, + { $addToSet: { badges: "Winner" } }, + { multi: true }); + } }); /** * From Collections, collection.remove section */ Template['chat'].events({ - 'click .remove': function () { - Messages.remove(this._id); - } + 'click .remove': function () { + Messages.remove(this._id); + } }); // DA: I added this next line var Logs = new Mongo.Collection('logs'); Meteor.startup(function () { - if (Meteor.isServer) { - Logs.remove({}); - Players.remove({karma: {$lt: -2}}); - } + if (Meteor.isServer) { + Logs.remove({}); + Players.remove({ karma: { $lt: -2 } }); + } }); /*** @@ -288,50 +288,50 @@ Meteor.startup(function () { */ interface iPost { - _id: string; - owner: string; - userId: string; - locked: boolean; + _id: string; + owner: string; + userId: string; + locked: boolean; } Posts = new Mongo.Collection("posts"); Posts.allow({ - insert: function (userId:string, doc: iPost) { - // the user must be logged in, and the document must be owned by the user - return (userId && doc.owner === userId); - }, - update: function (userId:string, doc: iPost, fields:string[], modifier:any) { - // can only change your own documents - return doc.owner === userId; - }, - remove: function (userId:string, doc: iPost) { - // can only remove your own documents - return doc.owner === userId; - }, - fetch: ['owner'] + insert: function (userId: string, doc: iPost) { + // the user must be logged in, and the document must be owned by the user + return (userId && doc.owner === userId); + }, + update: function (userId: string, doc: iPost, fields: string[], modifier: any) { + // can only change your own documents + return doc.owner === userId; + }, + remove: function (userId: string, doc: iPost) { + // can only remove your own documents + return doc.owner === userId; + }, + fetch: ['owner'] }); Posts.deny({ - update: function (userId:string, doc: iPost, fields:string[], modifier:any) { - // can't change owners - return doc.userId !== userId; - }, - remove: function (userId:string, doc: iPost) { - // can't remove locked documents - return doc.locked; - }, - fetch: ['locked'] // no need to fetch 'owner' + update: function (userId: string, doc: iPost, fields: string[], modifier: any) { + // can't change owners + return doc.userId !== userId; + }, + remove: function (userId: string, doc: iPost) { + // can't remove locked documents + return doc.locked; + }, + fetch: ['locked'] // no need to fetch 'owner' }); /** * From Collections, cursor.forEach section */ -var topPosts = Posts.find({}, {sort: {score: -1}, limit: 5}); +var topPosts = Posts.find({}, { sort: { score: -1 }, limit: 5 }); var count = 0; -topPosts.forEach(function (post:{title:string}) { - console.log("Title of post " + count + ": " + post.title); - count += 1; +topPosts.forEach(function (post: { title: string }) { + console.log("Title of post " + count + ": " + post.title); + count += 1; }); /** @@ -341,28 +341,28 @@ topPosts.forEach(function (post:{title:string}) { var Users = new Mongo.Collection('users'); var count1 = 0; -var query = Users.find({admin: true, onlineNow: true}); +var query = Users.find({ admin: true, onlineNow: true }); var handle = query.observeChanges({ - added: function (id:string, user:{name:string}) { - count1++; - console.log(user.name + " brings the total to " + count1 + " admins."); - }, - removed: function () { - count1--; - console.log("Lost one. We're now down to " + count1 + " admins."); - } + added: function (id: string, user: { name: string }) { + count1++; + console.log(user.name + " brings the total to " + count1 + " admins."); + }, + removed: function () { + count1--; + console.log("Lost one. We're now down to " + count1 + " admins."); + } }); let cursor: Mongo.Cursor; // After five seconds, stop keeping the count. -setTimeout(function () {handle.stop();}, 5000); +setTimeout(function () { handle.stop(); }, 5000); /** * From Sessions, Session.set section */ Tracker.autorun(function () { - Meteor.subscribe("chat-history", {room: Session.get("currentRoomId")}); + Meteor.subscribe("chat-history", { room: Session.get("currentRoomId") }); }); // Causes the function passed to Tracker.autorun to be re-run, so @@ -391,59 +391,59 @@ Session.equals("key", value); * From Accounts, Meteor.users section */ Meteor.publish("userData", function () { - return Meteor.users.find({_id: this.userId}, - {fields: {'other': 1, 'things': 1}}); + return Meteor.users.find({ _id: this.userId }, + { fields: { 'other': 1, 'things': 1 } }); }); -Meteor.users.deny({update: function () { return true; }}); +Meteor.users.deny({ update: function () { return true; } }); /** * From Accounts, Meteor.loginWithExternalService section */ Meteor.loginWithGithub({ - requestPermissions: ['user', 'public_repo'] + requestPermissions: ['user', 'public_repo'] }, function (err: Meteor.Error) { - if (err) - Session.set('errorMessage', err.reason || 'Unknown error'); + if (err) + Session.set('errorMessage', err.reason || 'Unknown error'); }); /** * From Accounts, Accounts.ui.config section */ Accounts.ui.config({ - requestPermissions: { - facebook: ['user_likes'], - github: ['user', 'repo'] - }, - requestOfflineToken: { - google: true - }, - passwordSignupFields: 'USERNAME_AND_OPTIONAL_EMAIL' + requestPermissions: { + facebook: ['user_likes'], + github: ['user', 'repo'] + }, + requestOfflineToken: { + google: true + }, + passwordSignupFields: 'USERNAME_AND_OPTIONAL_EMAIL' }); /** * From Accounts, Accounts.validateNewUser section */ -Accounts.validateNewUser(function (user:{username:string}) { - if (user.username && user.username.length >= 3) - return true; - throw new Meteor.Error("403", "Username must have at least 3 characters"); +Accounts.validateNewUser(function (user: { username: string }) { + if (user.username && user.username.length >= 3) + return true; + throw new Meteor.Error("403", "Username must have at least 3 characters"); }); // Validate username, without a specific error message. -Accounts.validateNewUser(function (user:{username:string}) { - return user.username !== "root"; +Accounts.validateNewUser(function (user: { username: string }) { + return user.username !== "root"; }); /** * From Accounts, Accounts.onCreateUser section */ -Accounts.onCreateUser(function(options:{profile:any}, user:{profile:any, dexterity:number}) { - var d6 = function () { return Math.floor(Math.random() * 6) + 1; }; - user.dexterity = d6() + d6() + d6(); - // We still want the default hook's 'profile' behavior. - if (options.profile) - user.profile = options.profile; - return user; +Accounts.onCreateUser(function (options: { profile: any }, user: { profile: any, dexterity: number }) { + var d6 = function () { return Math.floor(Math.random() * 6) + 1; }; + user.dexterity = d6() + d6() + d6(); + // We still want the default hook's 'profile' behavior. + if (options.profile) + user.profile = options.profile; + return user; }); /** @@ -451,48 +451,48 @@ Accounts.onCreateUser(function(options:{profile:any}, user:{profile:any, dexteri */ Accounts.emailTemplates.siteName = "AwesomeSite"; Accounts.emailTemplates.from = "AwesomeSite Admin "; -Accounts.emailTemplates.enrollAccount.subject = function (user:{ profile:{name: string} }) { - return "Welcome to Awesome Town, " + user.profile.name; +Accounts.emailTemplates.enrollAccount.subject = function (user: { profile: { name: string } }) { + return "Welcome to Awesome Town, " + user.profile.name; }; -Accounts.emailTemplates.enrollAccount.text = function (user:any, url:string) { - return "You have been selected to participate in building a better future!" - + " To activate your account, simply click the link below:\n\n" - + url; +Accounts.emailTemplates.enrollAccount.text = function (user: any, url: string) { + return "You have been selected to participate in building a better future!" + + " To activate your account, simply click the link below:\n\n" + + url; }; /** * From Templates, Template.myTemplate.helpers section */ Template['adminDashboard'].helpers({ - foo: function () { - return Session.get("foo"); - } + foo: function () { + return Session.get("foo"); + } }); Template['newTemplate'].helpers({ - helperName: function () { - } + helperName: function () { + } }); -Template['newTemplate'].created = function() { +Template['newTemplate'].created = function () { }; -Template['newTemplate'].rendered = function() { +Template['newTemplate'].rendered = function () { }; -Template['newTemplate'].destroyed = function() { +Template['newTemplate'].destroyed = function () { }; Template['newTemplate'].events({ - 'click .something': function (event: Meteor.Event, template: Blaze.TemplateInstance) { - } + 'click .something': function (event: Meteor.Event, template: Blaze.TemplateInstance) { + } }); -Template.registerHelper('testHelper', function() { - return 'tester'; +Template.registerHelper('testHelper', function () { + return 'tester'; }); var instance = Template.instance(); @@ -505,23 +505,25 @@ var body = Template.body; */ var Chats = new Mongo.Collection('chats'); -Meteor.publish("chats-in-room", function (roomId:string) { - // Make sure roomId is a string, not an arbitrary mongo selector object. - check(roomId, String); - return Chats.find({room: roomId}); +Meteor.publish("chats-in-room", function (roomId: string) { + // Make sure roomId is a string, not an arbitrary mongo selector object. + check(roomId, String); + return Chats.find({ room: roomId }); }); -Meteor.methods({addChat: function (roomId:string, message:{text:string, timestamp:Date, tags:string}) { - check(roomId, String); - check(message, { - text: String, - timestamp: Date, - // Optional, but if present must be an array of strings. - tags: Match.Optional('Test String') - }); +Meteor.methods({ + addChat: function (roomId: string, message: { text: string, timestamp: Date, tags: string }) { + check(roomId, String); + check(message, { + text: String, + timestamp: Date, + // Optional, but if present must be an array of strings. + tags: Match.Optional('Test String') + }); - // ... do something with the message ... -}}); + // ... do something with the message ... + } +}); /** * From Match patterns section @@ -538,27 +540,27 @@ check(undefined, Match.Optional('test')); // OK * From Deps, Tracker.autorun section */ Tracker.autorun(function () { - var oldest = Monkeys.findOne('age = 20'); + var oldest = Monkeys.findOne('age = 20'); - if (oldest) - Session.set("oldest", oldest.name); + if (oldest) + Session.set("oldest", oldest.name); }); Tracker.autorun(function (c) { - if (! Session.equals("shouldAlert", true)) - return; + if (!Session.equals("shouldAlert", true)) + return; - c.stop(); - alert("Oh no!"); + c.stop(); + alert("Oh no!"); }); /** * From Deps, Deps.Computation */ if (Tracker.active) { - Tracker.onInvalidate(function () { - console.log('invalidated'); - }); + Tracker.onInvalidate(function () { + console.log('invalidated'); + }); } /** @@ -568,50 +570,52 @@ var weather = "sunny"; var weatherDep = new Tracker.Dependency; var getWeather = function () { - weatherDep.depend(); - return weather; + weatherDep.depend(); + return weather; }; -var setWeather = function (w:string) { - weather = w; - // (could add logic here to only call changed() - // if the new value is different from the old) - weatherDep.changed(); +var setWeather = function (w: string) { + weather = w; + // (could add logic here to only call changed() + // if the new value is different from the old) + weatherDep.changed(); }; /** * From HTTP, HTTP.call section */ -Meteor.methods({checkTwitter: function (userId:string) { - check(userId, String); - this.unblock(); - var result = HTTP.call("GET", "http://api.twitter.com/xyz", - {params: {user: userId}}); - if (result.statusCode === 200) - return true - return false; -}}); +Meteor.methods({ + checkTwitter: function (userId: string) { + check(userId, String); + this.unblock(); + var result = HTTP.call("GET", "http://api.twitter.com/xyz", + { params: { user: userId } }); + if (result.statusCode === 200) + return true + return false; + } +}); HTTP.call("POST", "http://api.twitter.com/xyz", - {data: {some: "json", stuff: 1}}, - function (error: Meteor.Error, result:any) { - if (result.statusCode === 200) { - Session.set("twizzled", true); - } + { data: { some: "json", stuff: 1 } }, + function (error: Meteor.Error, result: any) { + if (result.statusCode === 200) { + Session.set("twizzled", true); + } }); /** * From Email, Email.send section */ Meteor.methods({ - sendEmail: function (to:string, from:string, subject:string, text:string) { - check([to, from, subject, text], [String]); + sendEmail: function (to: string, from: string, subject: string, text: string) { + check([to, from, subject, text], [String]); - // Let other method calls from the same client start running, - // without waiting for the email sending to complete. - this.unblock(); - } + // Let other method calls from the same client start running, + // without waiting for the email sending to complete. + this.unblock(); + } }); // In your client code: asynchronously send an email @@ -626,69 +630,69 @@ Blaze.Template.instance(); declare var el: HTMLElement; Blaze.render(testTemplate, el); -Blaze.renderWithData(testTemplate, {testData: 123}, el); +Blaze.renderWithData(testTemplate, { testData: 123 }, el); Blaze.remove(testView); Blaze.getData(el); Blaze.getData(testView); Blaze.toHTML(testTemplate); Blaze.toHTML(testView); -Blaze.toHTMLWithData(testTemplate, {test: 1}); -Blaze.toHTMLWithData(testTemplate, function() {}); -Blaze.toHTMLWithData(testView, {test: 1}); -Blaze.toHTMLWithData(testView, function() {}); +Blaze.toHTMLWithData(testTemplate, { test: 1 }); +Blaze.toHTMLWithData(testTemplate, function () { }); +Blaze.toHTMLWithData(testView, { test: 1 }); +Blaze.toHTMLWithData(testView, function () { }); var reactiveVar1 = new ReactiveVar('test value'); -var reactiveVar2 = new ReactiveVar('test value', function(oldVal:any) { return true; }); +var reactiveVar2 = new ReactiveVar('test value', function (oldVal: any) { return true; }); var varValue: string = reactiveVar1.get(); reactiveVar1.set('new value'); // Covers this PR: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/8233 var isConfigured: boolean = Accounts.loginServicesConfigured(); -Accounts.onPageLoadLogin(function() { - // do something +Accounts.onPageLoadLogin(function () { + // do something }); // Covers this PR: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/8065 -var loginOpts = { - requestPermissions: ["a", "b"], - requestOfflineToken: true, - loginUrlParameters: {asdf: 1, qwer: "1234"}, - loginHint: "Help me", - loginStyle: "Bold and powerful", - redirectUrl: "popup", - profile: "asdfasdf" +var loginOpts = { + requestPermissions: ["a", "b"], + requestOfflineToken: true, + loginUrlParameters: { asdf: 1, qwer: "1234" }, + loginHint: "Help me", + loginStyle: "Bold and powerful", + redirectUrl: "popup", + profile: "asdfasdf" }; -Meteor.loginWithMeteorDeveloperAccount(loginOpts, function(error: Meteor.Error) {}); +Meteor.loginWithMeteorDeveloperAccount(loginOpts, function (error: Meteor.Error) { }); Accounts.emailTemplates.siteName = "AwesomeSite"; Accounts.emailTemplates.from = "AwesomeSite Admin "; Accounts.emailTemplates.headers = { asdf: 'asdf', qwer: 'qwer' }; -Accounts.emailTemplates.enrollAccount.subject = function(user: Meteor.User) { - return "Welcome to Awesome Town, " + user.profile.name; +Accounts.emailTemplates.enrollAccount.subject = function (user: Meteor.User) { + return "Welcome to Awesome Town, " + user.profile.name; }; -Accounts.emailTemplates.enrollAccount.html = function(user: Meteor.User, url: string) { - return "

Some html here

"; +Accounts.emailTemplates.enrollAccount.html = function (user: Meteor.User, url: string) { + return "

Some html here

"; }; -Accounts.emailTemplates.enrollAccount.from = function() { - return "asdf@asdf.com"; +Accounts.emailTemplates.enrollAccount.from = function () { + return "asdf@asdf.com"; }; -Accounts.emailTemplates.enrollAccount.text = function(user: Meteor.User, url: string) { - return "You have been selected to participate in building a better future!" +Accounts.emailTemplates.enrollAccount.text = function (user: Meteor.User, url: string) { + return "You have been selected to participate in building a better future!" + " To activate your account, simply click the link below:\n\n" + url; }; -var handle = Accounts.validateLoginAttempt(function(attemptInfoObject: Accounts.IValidateLoginAttemptCbOpts) { - var type: string = attemptInfoObject.type; - var allowed: boolean = attemptInfoObject.allowed; - var error: Meteor.Error = attemptInfoObject.error; - var user: Meteor.User = attemptInfoObject.user; - var connection: Meteor.Connection = attemptInfoObject.connection; - var methodName: string = attemptInfoObject.methodName; - var methodArguments: any[] = attemptInfoObject.methodArguments; - return true; +var handle = Accounts.validateLoginAttempt(function (attemptInfoObject: Accounts.IValidateLoginAttemptCbOpts) { + var type: string = attemptInfoObject.type; + var allowed: boolean = attemptInfoObject.allowed; + var error: Meteor.Error = attemptInfoObject.error; + var user: Meteor.User = attemptInfoObject.user; + var connection: Meteor.Connection = attemptInfoObject.connection; + var methodName: string = attemptInfoObject.methodName; + var methodArguments: any[] = attemptInfoObject.methodArguments; + return true; }); handle.stop(); @@ -701,7 +705,7 @@ const deeperPrivateSetting = Meteor.settings['somePrivateSettings']['deeperSetti // Covers https://github.com/meteor-typings/meteor/issues/9 -const username = ( Template.instance().find('#username')).value; +const username = (Template.instance().find('#username')).value; // Covers https://github.com/meteor-typings/meteor/issues/3 @@ -711,7 +715,7 @@ BrowserPolicy.content.allowEval(); // Covers https://github.com/meteor-typings/meteor/issues/18 if (Meteor.isDevelopment) { - Rooms._dropIndex({field: 1}); + Rooms._dropIndex({ field: 1 }); } @@ -721,11 +725,11 @@ Rooms.find().count(true); // Covers https://github.com/meteor-typings/meteor/issues/21 if (Meteor.isTest) { - // do something + // do something } DDPRateLimiter.addRule({ userId: 'foo' }, 5, 1000); -DDPRateLimiter.addRule((userId: string) => userId =='foo', 5, 1000); +DDPRateLimiter.addRule((userId: string) => userId == 'foo', 5, 1000); -Template.instance().autorun(() => {}).stop(); +Template.instance().autorun(() => { }).stop(); From 9d4c31f2ba34a2ca6552fff01b3274385880ad1c Mon Sep 17 00:00:00 2001 From: Birk Skyum Date: Tue, 7 Mar 2017 13:29:27 +0100 Subject: [PATCH 341/797] Format header such that it passes npm test --- meteor/index.d.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/meteor/index.d.ts b/meteor/index.d.ts index 701f7999ec..585c2ab43a 100644 --- a/meteor/index.d.ts +++ b/meteor/index.d.ts @@ -1,11 +1,7 @@ // Type definitions for Meteor 1.4 // Project: http://www.meteor.com/ -// Definitions by: -// Alex Borodach -// Dave Allen -// Olivier Refalo -// Daniel Neveux -// Birk Skyum +// Definitions by: Alex Borodach , Dave Allen , Olivier Refalo , Daniel Neveux , Birk Skyum +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface URLS { resetPassword: (token: string) => string; From 236c32c7620c8d691b89ba74cf3dbdc7bd606103 Mon Sep 17 00:00:00 2001 From: Liam Mann Date: Tue, 7 Mar 2017 12:32:28 +0000 Subject: [PATCH 342/797] Updated comment for local Converter instance --- showdown/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/showdown/index.d.ts b/showdown/index.d.ts index 70b8d2abca..6ffaeaa1d1 100644 --- a/showdown/index.d.ts +++ b/showdown/index.d.ts @@ -257,7 +257,7 @@ declare namespace Showdown { removeExtension(extensions: ShowdownExtension[] | ShowdownExtension): void; /** - * Setting a "local" flavor affects all instances of showdown + * Set a "local" flavor for THIS Converter instance * * @param flavor name */ From 1c0b95a2e8d2aaecbe9d1e1f87dad098dab414e2 Mon Sep 17 00:00:00 2001 From: Brunner Date: Tue, 7 Mar 2017 13:45:33 +0100 Subject: [PATCH 343/797] add vanilla-tilt typings --- vanilla-tilt/index.d.ts | 112 +++++++++++++++++++++++++++++ vanilla-tilt/tsconfig.json | 23 ++++++ vanilla-tilt/tslint.json | 1 + vanilla-tilt/vanilla-tilt-tests.ts | 29 ++++++++ 4 files changed, 165 insertions(+) create mode 100644 vanilla-tilt/index.d.ts create mode 100644 vanilla-tilt/tsconfig.json create mode 100644 vanilla-tilt/tslint.json create mode 100644 vanilla-tilt/vanilla-tilt-tests.ts diff --git a/vanilla-tilt/index.d.ts b/vanilla-tilt/index.d.ts new file mode 100644 index 0000000000..828ca47513 --- /dev/null +++ b/vanilla-tilt/index.d.ts @@ -0,0 +1,112 @@ +// Type definitions for vanilla-tilt 1.3 +// Project: https://github.com/micku7zu/vanilla-tilt.js +// Definitions by: Livio Brunner +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * A smooth 3D tilt javascript library forked from Tilt.js (jQuery version). + */ +export declare namespace VanillaTilt { + /** + * Options which configures the tilting + */ + interface TiltOptions { + /** + * Reverse the tilt direction + */ + reverse?: boolean; + /** + * Max tilt rotation (degrees) + */ + max?: number; + /** + * Transform perspective, the lower the more extreme the tilt gets. + */ + perspective?: number; + /** + * 2 = 200%, 1.5 = 150%, etc.. + */ + scale?: number; + /** + * Speed of the enter/exit transition + */ + speed?: number; + /** + * Set a transition on enter/exit. + */ + transition?: boolean; + /** + * What axis should be disabled. Can be X or Y. + */ + axis?: null | "x" | "y"; + /** + * If the tilt effect has to be reset on exit. + */ + reset?: boolean; + /** + * Easing on enter/exit. + */ + easing?: string; + } + + export interface TiltValues { + /** + * The current tilt on the X axis + */ + tiltX: number; + /** + * The current tilt on the Y axis + */ + tiltY: number; + /** + * The current percentage on the X axis + */ + percentageX: number; + /** + * The current percentage on the Y axis + */ + percentageY: number; + } + + export interface HTMLVanillaTiltElement extends HTMLElement { + vanillaTilt: VanillaTilt + } +} + +/** + * A smooth 3D tilt javascript library forked from Tilt.js (jQuery version). + */ +export declare class VanillaTilt { + /** + * Creates a new instance of a VanillaTilt element. + * @param element The element, which should be a VanillaTilt element + * @param settings Settings which configures the element + */ + constructor(element: HTMLElement, settings?: VanillaTilt.TiltOptions); + /** + * Initializes one or multiple elements + * @param elements The element, which should tilt + * @param settings Settings, which configures the elements + */ + static init(elements: HTMLElement | HTMLElement[], settings?: VanillaTilt.TiltOptions): void; + /** + * Resets the styling + */ + reset(): void; + /** + * Get values of instance + */ + getValues(): VanillaTilt.TiltValues; + /** + * Destroys the instance and removes the listeners. + */ + destroy(): void; + /** + * Start listening to events + */ + addEventListeners(): void; + /** + * Stop listening to events + */ + removeEventListener(): void; +} diff --git a/vanilla-tilt/tsconfig.json b/vanilla-tilt/tsconfig.json new file mode 100644 index 0000000000..f95783a19d --- /dev/null +++ b/vanilla-tilt/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "vanilla-tilt-tests.ts" + ] +} diff --git a/vanilla-tilt/tslint.json b/vanilla-tilt/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/vanilla-tilt/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/vanilla-tilt/vanilla-tilt-tests.ts b/vanilla-tilt/vanilla-tilt-tests.ts new file mode 100644 index 0000000000..80691885c4 --- /dev/null +++ b/vanilla-tilt/vanilla-tilt-tests.ts @@ -0,0 +1,29 @@ +import { VanillaTilt } from './index.d'; + +let element: VanillaTilt = new VanillaTilt(document.createElement('a'), { + axis: 'y', + easing: 'cubic-besizer(0.9, 0.9, 0.9)', + max: 2, + perspective: 100, + reset: true, + reverse: true, + scale: 2, + speed: 200 +}); + +VanillaTilt.init(document.createElement('a'), { + axis: 'x' +}); + +element.removeEventListener(); + +VanillaTilt.init([document.createElement('a')], { + axis: null +}); + + +let values: VanillaTilt.TiltValues = element.getValues(); +values.percentageX; +values.percentageY; +values.tiltX; +values.tiltY; From b83cfcea0771383a1bdcfd15efe429042ee5835e Mon Sep 17 00:00:00 2001 From: Keith Dahlby Date: Tue, 7 Mar 2017 00:55:53 -0600 Subject: [PATCH 344/797] 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 345/797] 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 346/797] 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 347/797] 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 bd50abd4f87ae51d56e751c7dc7e95bbfc3ab088 Mon Sep 17 00:00:00 2001 From: Chris Moran Date: Tue, 7 Mar 2017 11:09:16 -0500 Subject: [PATCH 348/797] Add constructors to types I added previously. This removes a warning when trying to use these classes while compiling typescript --- jointjs/index.d.ts | 51 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/jointjs/index.d.ts b/jointjs/index.d.ts index c8ef9ae302..8ecb05f3ba 100644 --- a/jointjs/index.d.ts +++ b/jointjs/index.d.ts @@ -511,6 +511,7 @@ declare namespace joint { polyline?: ShapeAttrs; } class Polyline extends Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class Image extends Generic { constructor(attributes?: GenericAttributes, options?: Object); @@ -539,28 +540,40 @@ declare namespace joint { namespace chess { class KingWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class KingBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class QueenWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class QueenBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class RookWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class RookBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class BishopWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class BishopBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class KnightWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class KnightBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class PawnWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class PawnBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } } @@ -582,23 +595,28 @@ declare namespace joint { removeInPort(port: string, opt?: any): this; } class Coupled extends Model { + constructor(attributes?: ModelAttributes, options?: Object); } class Atomic extends Model { + constructor(attributes?: ModelAttributes, options?: Object); } class Link extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } } namespace erd { class Entity extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); + constructor(attributes?: GenericAttributes, options?: Object); } class WeakEntity extends Entity { + constructor(attributes?: GenericAttributes, options?: Object); } class Relationship extends dia.Element { constructor(attributes?: GenericAttributes, options?: Object); } class IdentifyingRelationship extends Relationship { + constructor(attributes?: GenericAttributes, options?: Object); } interface AttributeAttrs extends dia.TextAttrs { ellipse?: ShapeAttrs; @@ -607,12 +625,16 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Multivalued extends Attribute { + constructor(attributes?: GenericAttributes, options?: Object); } class Derived extends Attribute { + constructor(attributes?: GenericAttributes, options?: Object); } class Key extends Attribute { + constructor(attributes?: GenericAttributes, options?: Object); } class Normal extends Attribute { + constructor(attributes?: GenericAttributes, options?: Object); } interface ISAAttrs extends dia.Element { polygon?: ShapeAttrs; @@ -621,19 +643,23 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Line extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); cardinality(value: string | number): void; } } namespace fsa { class State extends basic.Circle { + constructor(attributes?: GenericAttributes, options?: Object); } class StartState extends dia.Element { constructor(attributes?: GenericAttributes, options?: Object); } class EndState extends dia.Element { + constructor(attributes?: GenericAttributes, options?: Object); } class Arrow extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } } @@ -655,14 +681,19 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class IO extends Gate { + constructor(attributes?: GenericAttributes, options?: Object); } class Input extends IO { + constructor(attributes?: GenericAttributes, options?: Object); } class Output extends IO { + constructor(attributes?: GenericAttributes, options?: Object); } class Gate11 extends Gate { + constructor(attributes?: GenericAttributes, options?: Object); } class Gate21 extends Gate { + constructor(attributes?: GenericAttributes, options?: Object); } interface Image { 'xlink:href'?: string; @@ -720,11 +751,13 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Arrow extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } } namespace pn { class Place extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class PlaceView extends dia.ElementView { renderTokens(): void; @@ -733,6 +766,7 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Link extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } } @@ -750,36 +784,49 @@ declare namespace joint { class ClassView extends dia.ElementView { } class Abstract extends Class { + constructor(attributes?: ClassAttributes, options?: Object); } class AbstractView extends ClassView { + constructor(attributes?: ClassAttributes, options?: Object); } class Interface extends Class { + constructor(attributes?: ClassAttributes, options?: Object); } class InterfaceView extends ClassView { + constructor(attributes?: ClassAttributes, options?: Object); } class Generalization extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } class Implementation extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } class Aggregation extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } class Composition extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } class Association extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } interface StateAttributes extends GenericAttributes { events?: string[]; } class State extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); updateName(): void; updateEvents(): void; updatePath(): void; } class StartState extends basic.Circle { + constructor(attributes?: GenericAttributes, options?: Object); } class EndState extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class Transition extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } } } @@ -833,7 +880,7 @@ declare namespace joint { setLinkVertices?: (link: dia.Link, vertices: Position[]) => void; } - class DirectedGraph { + export class DirectedGraph { static layout(graph: dia.Graph | dia.Cell[], options?: LayoutOptions): dia.BBox; } } From 93cdf199a536ef8032eaee9d6161c4ff653576ac Mon Sep 17 00:00:00 2001 From: Chris Moran Date: Tue, 7 Mar 2017 11:15:52 -0500 Subject: [PATCH 349/797] Add namespace prefix to LinkAttributes --- jointjs/index.d.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/jointjs/index.d.ts b/jointjs/index.d.ts index 8ecb05f3ba..e8c9e8b53e 100644 --- a/jointjs/index.d.ts +++ b/jointjs/index.d.ts @@ -601,7 +601,7 @@ declare namespace joint { constructor(attributes?: ModelAttributes, options?: Object); } class Link extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } } @@ -643,7 +643,7 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Line extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); cardinality(value: string | number): void; } } @@ -659,7 +659,7 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Arrow extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } } @@ -751,7 +751,7 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Arrow extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } } @@ -766,7 +766,7 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Link extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } } @@ -796,19 +796,19 @@ declare namespace joint { constructor(attributes?: ClassAttributes, options?: Object); } class Generalization extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } class Implementation extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } class Aggregation extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } class Composition extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } class Association extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } interface StateAttributes extends GenericAttributes { events?: string[]; @@ -826,7 +826,7 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Transition extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } } } From c1ea67d097dabbadbbbdbdaa750b911ce82250bc Mon Sep 17 00:00:00 2001 From: Alan Thai Date: Tue, 7 Mar 2017 12:27:45 -0500 Subject: [PATCH 350/797] @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 351/797] 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 { From b063e3b75fb5d1a0f059ed4b4a4454d541c81a3f Mon Sep 17 00:00:00 2001 From: Knuddels-TobyB Date: Tue, 7 Mar 2017 20:23:17 +0100 Subject: [PATCH 352/797] initial commit of knuddels-userapps-api --- knuddels-userapps-api/index.d.ts | 2683 +++++++++++++++++ .../knuddels-userapps-api-tests.ts | 122 + knuddels-userapps-api/tsconfig.json | 17 + knuddels-userapps-api/tslint.json | 137 + 4 files changed, 2959 insertions(+) create mode 100644 knuddels-userapps-api/index.d.ts create mode 100644 knuddels-userapps-api/knuddels-userapps-api-tests.ts create mode 100644 knuddels-userapps-api/tsconfig.json create mode 100644 knuddels-userapps-api/tslint.json diff --git a/knuddels-userapps-api/index.d.ts b/knuddels-userapps-api/index.d.ts new file mode 100644 index 0000000000..82bafc0056 --- /dev/null +++ b/knuddels-userapps-api/index.d.ts @@ -0,0 +1,2683 @@ +// JSON definition +interface Json { + [x: string]: string | number | boolean | Date | Json | JsonArray; +} +interface JsonArray extends Array { } + +// serializable objects (for persistence) +interface KnuddelsJson { + [x: string]: string | number | boolean | Date | KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable; +} +interface KnuddelsJsonArray extends Array { } +type KnuddelsSerializable = string | number | boolean | User | BotUser; + +// "data" that may be send between apps and between server and client +type KnuddelsEvent = string | Json | KnuddelsEventArray; +interface KnuddelsEventArray extends Array { } + +/** + * App ist die abstrakte Klasse einer konkreten App, die ein Entwickler schreiben kann. + * Im eigenen Javascript-Code muss eine Variable mit dem Namen App vorhanden sein, damit eine App lauffähig ist. + */ +declare interface App { + /** + * Dieses Methode wird aufgerufen, sobald ein Nutzer versucht den Channel zu betreten. + * Die App kann nun entscheiden, ob der Nutzer den Channel betreten darf. + * + * Hinweis: Um ein responsives User Interface für den Nutzer, der den Channel betreten möchte zu garantieren, muss die App innerhalb von einer Sekunde auf diese Anfrage reagieren, damit ihre Antwort in das Ergebnis einfliesst. + * + * Mit bestimmten Smileyfeatures ist es derzeit trotzdem möglich, den Channel zu betreten. + * Diese Nutzer können nicht ausgesperrt werden: + *
    + *
  • Channelbesitzer
  • + *
  • Channelmoderatoren und HZAs
  • + *
  • Admins (sofern notwendig)
  • + *
  • Sysadmins
  • + *
  • User Apps Team (Mitarbeiter von Knuddels)
  • + *
+ * + * Ist der Channel mit einem Passwort geschützt und der Nutzer, der versucht den Channel zu betreten kennt das Passwort, + * so kann er nicht aus dem Channel ausgeschlossen werden. + */ + mayJoinChannel?(user: User): ChannelJoinPermission; + /** + * Diese Methode wird jedes Mal aufgerufen, sobald ein Nutzer versucht eine öffentliche Nachricht zu senden. + * Die App kann nun entscheiden, ob die Nachricht veröffentlicht werden darf. + * + * Laufen mehrere Apps im selben Channel, so wird die Nachricht veröffentlicht, sofern alle Apps es erlauben. + * + * Dauert das Fragen aller Apps nach Erlaubnis länger als 10 Sekunden, so wird die Antwort genutzt, die bis dahin + * gegeben wurde. + */ + mayShowPublicMessage?(publicMessage: PublicMessage): boolean; + /** + * Diese Methode wird jedes Mal aufgerufen, sobald ein Nutzer versucht eine öffentliche Handlung auszuführen. + * Die App kann nun entscheiden, ob die Handlung ausgeführt werden darf. + * + * Laufen mehrere Apps im selben Channel, so wird die Handlung ausgeführt, sofern alle Apps es erlauben. + * + * Dauert das Fragen aller Apps nach Erlaubnis länger als 10 Sekunden, so wird die Antwort genutzt, die bis dahin + * gegeben wurde. + */ + mayShowPublicActionMessage?(publicActionMessage: PublicActionMessage): boolean; + /** + * Diese Methode wird aufgerufen, sobald die App startet. + * Dies ist der beste Zeipunkt um Werte zu initialisieren und aus der Persistenz zu lesen. + */ + onAppStart?(): void; + /** + * Diese Methode wird aufgerufen, wenn ein User Knuddel an den BotUser gesendet hat. + * Es ist die Aufgabe der App in dieser Methode zu entscheiden, ob sie die Knuddel annimmt oder ablehnt. + * Wird diese Methode von der App nicht implementiert, so werden Knuddel automatisch akzeptiert. + * Ist diese Methode implementiert und es treten Fehler (Exceptions, Timeout,...) auf oder der Entwickler entscheidet nicht, + * was mit den Knuddel geschehen soll, so werden diese vom App-System automatisch an den Absender zurück geschickt. + *
+ * Wichtig: Zum Zeitpunkt des Aufrufs dieser Methode wurden die Knuddel noch nicht an den BotUser übertragen. + */ + onBeforeKnuddelReceived?(knuddelTransfer: KnuddelTransfer): void; + /** + * Diese Methode wird aufgerufen, sobald ein BotUser Knuddel von einem User erhalten hat. + */ + onKnuddelReceived?(sender: User, receiver: BotUser, knuddelAmount: KnuddelAmount, transferReason: string): void; + /** + * Diese Methode wird aufgerufen, wenn die App sich darauf vorbereiten soll heruntergefahren zu werden. + * Als Parameter wird die geschätzte Zeit übergeben, die die App noch hat, bis sie heruntergefahren wird + * und der Aufruf App/onShutdown:event folgt. + * + * App/onPrepareShutdown:event kann dazu benutzt werden das Nutzererlebnis zu verbessern, + * sofern eine App heruntergefahren werden muss (bsp. für Updates). + * Eine Spiele-App könnte z.B. entscheiden, dass sie keine weiteren Spiele eröffnet und den Spielern offener Spiele + * die Information anzeigt, wie lange das Spiel noch läuft, bevor es unentschieden endet. + * + *

Achtung: Die Methode kann im Lebenszyklus einer App mehrfach aufgerufen werden. + */ + onPrepareShutdown?(secondsTillShutdown: number): void; + /** + * Diese Methode wird aufgerufen, wenn ein BotUser privat angeschrieben wird. + */ + onPrivateMessage?(privateMessage: PrivateMessage): void; + /** + * Diese Methode wird aufgerufen, wenn im Channel der App + * eine öffentliche Nachricht geschrieben wird. + * Für Nachrichten von BotUsern wird diese Methode nicht aufgerufen. + */ + onPublicMessage?(publicMessage: PublicMessage): void; + /** + * Diese Methode wird aufgerufen, wenn im Channel der App + * eine Event-Nachricht veröffentlicht wird. + * Für Nachrichten von BotUsern wird diese Methode nicht aufgerufen. + */ + onPublicEventMessage?(publicEventMessage: PublicEventMessage): void; + /** + * Diese Methode wird aufgerufen, wenn im Channel der App + * eine öffentliche Handlung durchgeführt wird. + * Für Handlungen von BotUsern wird diese Methode nicht aufgerufen. + */ + onPublicActionMessage?(publicActionMessage: PublicActionMessage): void; + /** + * Diese Methode wird aufgerufen, wenn eine App beendet wird. + * Sobald diese Methode aufgerufen wird, steht nur noch ein begrenzter Teil der API zur Verfügung. + * Die App sollte den kompletten Zustand in der Persistenz speichern, sodass der Zustand + * beim nächsten App/onAppStart:event wiederhergestellt werden kann. + * + * Während des Shutdowns können asynchrone each-Methoden, wie UserPersistenceNumbers/each:method + * und UserAccess/eachAccessibleUser:method nicht zuverlässig genutzt werden. + */ + onShutdown?(): void; + /** + * Diese Methode wird aufgerufen, wenn ein User im Channel der App + * über die Systemfunktionen (/dice, /diceo) würfelt. + * Die App kann auf das Ergebnis zugreifen und die Daten für die Auswertung und Entscheidungen nutzen. + */ + onUserDiced?(diceEvent: DiceEvent): void; + /** + * Diese Methode wird aufgerufen, wenn ein User den Channel der App betritt. + */ + onUserJoined?(user: User): void; + /** + * Diese Methode wird aufgerufen, wenn ein User den Channel der App verlässt. + */ + onUserLeft?(user: User): void; + /** + * Diese Methode wird aufgerufen, wenn aus einer anderen App ein Event mit sendAppEvent versendet wurde. + */ + onAppEventReceived?(appInstance: AppInstance, type: string, data: KnuddelsEvent): void; + /** + * Diese Methode wird aufgerufen, wenn aus dem HTML User Interface ein Event mit + * sendEvent() gesendet wurde. + */ + onEventReceived?(user: User, type: string, data: KnuddelsEvent, appContentSession: AppContentSession): void; + /** + * Diese Methode wird aufgerufen, wenn ein User Knuddel in seinen KnuddelAccount + * eingezahlt hat. + */ + onAccountReceivedKnuddel?(sender: User, receiver: BotUser, knuddelAmount: KnuddelAmount, transferReason: string, knuddelAccount: KnuddelAccount): void; + /** + * Diese Methode wird aufgerufen, wenn sich die Anzahl der Knuddel auf einem KnuddelAccount eines User + * geändert hat. + */ + onAccountChangedKnuddelAmount?(user: User, knuddelAccount: KnuddelAccount, oldKnuddelAmount: KnuddelAmount, newKnuddelAmount: KnuddelAmount): void; + /** + * Ermöglicht das Registrieren eigener Chatbefehle. + * In einem Channel kann nur eine App laufen, die einen bestimmten Chatbefehl nutzt. + * Versucht eine zweite App einen Chatbefehl zu registrieren, den eine andere + * App bereits nutzt, so wird ein Fehler geloggt und die App startet nicht bzw. fährt herunter. + * + * Die Struktur eines registrierten Chatbefehls ist: + * commandName: function (user, params, command) {} + * + * + *
    + *
  • commandName ist der Name der Funktion, wie sie aufgerufen wird (beispielsweise /commandname)
  • + *
  • user ist der Nutzer, der die Funktion aufgerufen hat
  • + *
  • params sind die Parameter, die der Nutzer hinter dem Befehl eingegeben hat (beispielsweise /commandname params)
  • + *
  • command ist der Name des Befehl selbst (beispielsweise commandName)
  • + *
+ */ + chatCommands?: { [commandName:string]: (user:User, params:string, command:string) => void }; +} + +/** + * Ermöglicht Zugriff auf Informationen zu Apps und Events zwischeneinander. + * + * Die Instanz von AppAccess erhält man über den KnuddelsServer + * mit KnuddelsServer.getAppAccess() + */ +declare class AppAccess { + /** + * Liefert die Instanz der eigenen App. + */ + public getOwnInstance(): AppInstance; + /** + * Liefert die Instanzen aller anderen Apps, die gerade in diesem Channel laufen. + * @since AppServer 82904 + */ + public getAllRunningAppsInChannel(includeSelf?: boolean): AppInstance[]; + /** + * Liefert die Instanzen aller anderen Apps, die gerade in diesem Channel laufen. + * @since AppServer 82904 + */ + public getRunningAppInChannel(appId: string): (AppInstance|null); +} + +/** + * Repräsentiert den visuellen Inhalt einer Applikation, der Usern angezeigt werden soll. + */ +declare class AppContent { + /** + * Liefert den AppViewMode. + */ + public getAppViewMode(): AppViewMode; + /** + * Liefert das HTMLFile, das beim Anlegen des AppContents + * genutzt wurde. + */ + public getHTMLFile(): HTMLFile; + /** + * Liefert die Breite des AppContent. + */ + public getWidth(): number; + /** + * Liefert die Höhe des AppContent. + */ + public getHeight(): number; + /** + * Liefert die LoadConfiguration, mit der die Optik beim Laden des HTML User Interface beeinflusst werden kann. + */ + public getLoadConfiguration(): LoadConfiguration; + /** + * Liefert einen AppContent, der das HTMLFile als Overlay oben rechts im Channel anzeigt. + */ + public static overlayContent(htmlFile: HTMLFile, width: number, height: number): AppContent; + /** + * Liefert einen AppContent, der das HTMLFile als Overlay (200x350) oben rechts im Channel anzeigt. + */ + public static overlayContent(htmlFile: HTMLFile): AppContent; + /** + * Liefert einen AppContent, der das HTMLFile im Applet/HTML-Chat + * als Popup (300x400) und auf Android als Fullscreen-View anzeigt. + */ + public static popupContent(htmlFile: HTMLFile): AppContent; + /** + * Liefert einen AppContent, der das HTMLFile im Applet/HTML-Chat + * als Popup und auf Android als Fullscreen-View anzeigt. + */ + public static popupContent(htmlFile: HTMLFile, width: number, height: number): AppContent; + /** + * Sendet Daten an alle Nutzer, die diesen AppContent geöffnet haben. + */ + public sendEvent(type: string, data?: KnuddelsEvent): void; + /** + * Liefert eine Liste aller User, die diesen AppContent + * geöffnet haben. + */ + public getUsers(): User[]; + /** + * Liefert eine Liste aller AppContentSessions, die dieses AppContent, + * die User gerade geöffnet haben. + */ + public getSessions(): AppContentSession[]; + /** + * Ersetzt den AppContent, bei allen Usern, die diesen AppContent + * geöffnet haben durch den neuen AppContent. + * + *

Hinweis: Es können nur AppContent mit demselben AppViewMode + * zum Ersetzen genutzt werden. + */ + public replaceWithAppContent(newAppContent: AppContent): void; + /** + * Entfernt diesen AppContent, bei allen Usern, die diesen AppContent + * geöffnet haben. + */ + public remove(): void; + /** + * Fügt einen Listener hinzu, der aufgerufen wird, wenn jemand den AppContent schließt. + */ + public addCloseListener(callback: { user: User; appContent: AppContent; }): void; +} + +/** + * Repräsentiert den visuellen Inhalt einer App, der einem User angezeigt wird. + */ +declare class AppContentSession { + /** + * Sendet Daten an den verbundenen Client. + */ + public sendEvent(type: string, data?: KnuddelsEvent): void; + /** + * Liefert den AppViewMode. + */ + public getAppViewMode(): AppViewMode; + /** + * Entfernt die AppContentSession beim verbundenen User. + */ + public remove(): void; + /** + * Liefert den User. + */ + public getUser(): User; + /** + * Liefert den verbundenen AppContent. + */ + public getAppContent(): AppContent; +} + +/** + * Die Instanz von AppInfo zur laufenden App erhält man über die AppInstance + * mit appInstance.getAppInfo() + */ +declare class AppInfo { + /** + * Liefert die AppUid. + * Diese ist für jede Sub-Channel Instanz der App unterschiedlich. + * Wenn RootAppUid == AppUid dann ist dies die Root-App-Instanz. + */ + public getAppUid(): number; + /** + * Liefert die RootAppUid. + * Diese ist für jede Sub-Channel Instanz der App gleich. + * Wenn RootAppUid == AppUid dann ist dies die Root-App-Instanz. + * + * Sie wird für den Link für Auszahlungen aus einem Knuddel-Account benötigt: /knuddelaccount payout:<RootAppUid>:<BETRAG> + */ + public getRootAppUid(): number; + /** + * Liefert den in der Konfiguration eingestellten Namen der App. + */ + public getAppName(): string; + /** + * Liefert die Version der App, die in der Konfiguration eingestellt wurde. + */ + public getAppVersion(): string; + /** + * Liefert die eindeutige Id der App. + * Die appId setzt sich zusammen aus + *
    + *
  • id des Entwicklungsservers
  • + *
  • FTP-Nutzername
  • + *
  • Ordnername der App -> appKey
  • + *
+ */ + public getAppId(): string; + /** + * Liefert den eindeutigen Key der App. + * Der appKey ist der Ordnername, in dem die App liegt. + */ + public getAppKey(): string; + /** + * Liefert den Entwickler der App, falls die serverId knuddelsDE oder knuddelsDEV ist, ansonsten null. + */ + public getAppDeveloper(): User; + /** + * Liefert die Liste der AppManager für diese App. Die Channelbesitzer zählen automatisch auch als AppManager. + */ + public getAppManagers(): User[]; + /** + * Liefert den Steuersatz, der bei Auszahlung bereits genutzer Knuddel von einem + * KnuddelAccount an einen User + * anfällt. Die anfallenden Steuern werden bei Auszahlung vom BotUser + * abgezogen. + */ + public getTaxRate(): number; + /** + * Liefert den KnuddelAmount, der an Steuern anfallen würde, + * wenn alle User jetzt all ihre Knuddel aus ihrem + * KnuddelAccount abheben würden. + */ + public getTotalTaxKnuddelAmount(): KnuddelAmount; + /** + * Liefert den KnuddelAmount, der jetzt noch vom + * BotUser an KnuddelAccounts + * übertragen werden kann, so dass für alle Knuddel noch die Steuern bezahlt werden können. + */ + public getMaxPayoutKnuddelAmount(): KnuddelAmount; +} + +/** + * Repräsentiert die Instanz einer App. + * + * Die eigene Instanz von AppInstance erhält man über das AppAccess-Objekt + * mit appAccess.getOwnInstance() + */ +declare class AppInstance { + /** + * Liefert die AppInfo. + */ + public getAppInfo(): AppInfo; + /** + * Sendet ein App-Event an diese App-Instanz. + */ + public sendAppEvent(type: string, data: KnuddelsEvent): void; + /** + * Informiert, ob die aktuelle AppInstanz eine Root-Instanz ist. + */ + public isRootInstance(): boolean; + /** + * Liefert die Root-Instanz der aktuellen App-Instanz. + */ + public getRootInstance(): RootAppInstance; + /** + * Liefert alle App-Instanzen dieser App in diesem Channel und Subchannels. + * Mit includeSelf = false kann man die eigene Instanz ausschließen. + */ + public getAllInstances(includeSelf?: boolean): AppInstance[]; + /** + * Liefert den Startzeitpunkt dieser AppInstance. + */ + public getStartDate(): Date; + /** + * Liefert die Namen der ChatCommands, die diese AppInstnce derzeit registriert hat. + */ + public getRegisteredChatCommandNames(): (string[]|null); + /** + * Liefert den Namen des Channels in dem diese AppInstance läuft. + */ + public getChannelName(): string; +} + +/** + * Jede App besitzt eine AppPersistence in der global für diese App + * Informationen gespeichert werden können. An die Instanz der AppPersistence gelangt man durch den Aufruf + * KnuddelsServer.getPersistence();. + */ +declare class AppPersistence extends Persistence { +} + +/** + * Eine Instanz eines AppProfileEntry repräsentiert einen von einer App erzeugen Profileintrag in Profilen von Usern. + */ +declare class AppProfileEntry { + /** + * Liefert den key für den die Topliste, die den Profileintrag erzeugt angelegt wurde. + */ + public getKey(): string; + /** + * Liefert den getDisplayType + */ + public getDisplayType(): ToplistDisplayType; + /** + * Liefert das Toplist-Objekt. + */ + public getToplist(): Toplist; +} + +/** + * Mit einer Instanz von AppProfileEntryAccess kann eine App + * AppProfileEntry-Objekte (Profileinträge) erzeugen und verwalten. + * + * Die Instanz für die AppProfileEntryAccess erhält man über das KnuddelsServer-Objekt + * mit KnuddelsServer.getAppProfileEntryAccess() + * + *

Achtung: Derzeit darf eine App bis zu fünf AppProfileEntries haben. + *

Achtung: Profileinträge werden nur dann angezeigt, wenn der Channel sichtbar ist. + */ +declare class AppProfileEntryAccess { + /** + * Liefert die Liste aller AppProfileEntry-Objekte, die diese App erzeugt hat. + */ + public getAllProfileEntries(): AppProfileEntry[]; + /** + * Liefert den AppProfileEntry für den übergebenen userPersistenceNumberKey. + */ + public getAppProfileEntry(userPersistenceNumberKey: string): AppProfileEntry; + /** + * Erzeugt oder aktualisiert ein AppProfileEntry anhand der übergebenen Toplist + * und dem ToplistDisplayType und liefert den AppProfileEntry im Anschluss zurück. + * + * Profileinträge, die erzeugt werden, sind nur sichtbar, solange die App läuft und werden im Profil ausgeblendet, sofern die App aus ist. + */ + public createOrUpdateEntry(toplist: Toplist, toplistDisplayType: ToplistDisplayType): AppProfileEntry; + /** + * Löscht den übergebenen AppProfileEntry. + */ + public removeEntry(appProfileEntry: AppProfileEntry): void; +} + +/** + * Liefert Informationen über einen AppServer. + * + * Die Instanz von AppServerInfo erhält man über den KnuddelsServer + * mit KnuddelsServer.getAppServerInfo() + */ +declare class AppServerInfo extends ServerInfo { +} + +/** + * null + */ +declare class AppViewMode { + /** + * + */ + public static readonly Overlay: AppViewMode; + /** + * Zum Öffnen eines Popups durch das HTML User Interface + */ + public static readonly Popup: AppViewMode; +} + +/** + * Ein BotUser repräsentiert einen Nutzer, der für die App als Nutzer im Channel interagieren kann. + * + * Die Instanz für den Standard-BotUser erhält man über das KnuddelsServer-Objekt + * mit KnuddelsServer.getDefaultBotUser() + */ +declare class BotUser extends User { + /** + * Sendet eine öffentliche Nachricht in den Channel. + */ + public sendPublicMessage(message: string): void; + /** + * Sendet eine öffentliche Handlung in den Channel. + * Dies funktioniert so, als ob der BotUser /me TEXT im Chat eingeben würde. + */ + public sendPublicActionMessage(actionMessage: string): void; + /** + * Sendet eine private Nachricht an bestimmte Nutzer. + */ + public sendPrivateMessage(message: string, users?: User[]): void; + /** + * Sendet eine persistente Nachricht an einen bestimmten Nutzer. + */ + public sendPostMessage(topic: string, text: string, receivingUser?: User): void; + /** + * Transferiert eine bestimmte Anzahl Knuddel an einen Zielnutzer oder KnuddelAccount.

+ * Wichtiger Hinweis: Sollte die App versuchen mehr Knuddel zu transferieren, + * als sie besitzt, so wird der onError-Callback aufgerufen und die App transferiert so viele Knuddel, wie möglich. + * Zudem werden die Schulden für den Channelbesitzer gemerkt. Sobald sich der Channelbesitzer einloggt, erhält er einen Hinweis über offene Schulden + * und sollte diese direkt begleichen. + * Hat ein Channelbesitzer eine gewisse Menge Schulden angesammelt, so schalten wir alle Apps in diesem Channel ab. + *
Es können nur Knuddel transferiert werden zu Nutzern mit UserType.Human. + */ + public transferKnuddel(receivingUserOrAccount: (User|KnuddelAccount), knuddelAmount: KnuddelAmount, parameters?: { displayReasonText?: string; transferDisplayType?: KnuddelTransferDisplayType; onSuccess?: () => void; onError?: (message: string) => void; }): void; +} + +/** + * Ein Channel ist ein Raum in dem die App läuft. + * + * Die Instanz für den Channel erhält man über das KnuddelsServer-Objekt + * mit KnuddelsServer.getChannel() + */ +declare class Channel { + /** + * Gibt Zugriff auf das ChannelConfiguration-Objekt des Channels. + */ + public getChannelConfiguration(): ChannelConfiguration; + /** + * Gibt Zugriff auf das ChannelRestrictions-Objekt des Channels. + */ + public getChannelRestrictions(): ChannelRestrictions; + /** + * Gibt Zugriff auf das ChannelDesign-Objekt des Channels. + * @since AppServer 87470, ChatServer 87470 + */ + public getChannelDesign(): ChannelDesign; + /** + * Gibt Zugriff auf Nutzer, die gerade im Channel online sind. + */ + public getOnlineUsers(...userType: UserType[]): User[]; + /** + * Liefert die Information, ob in diesem Channel Videos gestreamt werden können. + */ + public isVideoChannel(): boolean; + /** + * Liefert die VideoChannelData des Channels. + */ + public getVideoChannelData(): VideoChannelData; + /** + * Liefert den Namen des Channels. + */ + public getChannelName(): string; + /** + * Liefert den Namen des Root-Channels (nur relevant, falls die App Tochterchannel haben kann). + */ + public getRootChannelName(): string; + /** + * Liefert den ChannelTalkMode, in dem sich der Channel gerade befindet. + */ + public getTalkMode(): ChannelTalkMode; + /** + * Liefert alle User, die bestimmte ChannelTalkPermissions haben. + */ + public getAllUsersWithTalkPermission(...channelTalkPermission: ChannelTalkPermission[]): User[]; + /** + * Liefert die Information, ob der Channel sichtbar (true) oder unsichtbar (false) ist. + * @since AppServer 82202 + */ + public isVisible(): boolean; +} + +/** + * Eine ChannelConfiguration erlaubt Zugriff auf verschiedene Details + * der Konfiguration des Channels, in dem die App läuft. + * + * Die Instanz für die ChannelConfiguration erhält man über das Channel-Objekt + * mit channel.getChannelConfiguration() + */ +declare class ChannelConfiguration { + /** + * Liefert das ChannelRights-Objekt des Channels. + */ + public getChannelRights(): ChannelRights; + /** + * Liefert das ChannelInformation-Objekt des Channels. + */ + public getChannelInformation(): ChannelInformation; +} + +/** + * Ermöglicht Zugriff auf Designeinstellungen des Channels. + * @since AppServer 87470, ChatServer 87470 + */ +declare class ChannelDesign { + /** + * Liefert die eingestellte Standard-Schriftgröße des Channels. + * @since AppServer 87470, ChatServer 87470 + */ + public getDefaultFontSize(): number; + /** + * Liefert die eingestellte Standard-Schriftfarbe des Channels. + * @since AppServer 87470, ChatServer 87470 + */ + public getDefaultFontColor(): Color; + /** + * Liefert die eingestellte Hintergrundfarbe des Channels. + * @since AppServer 87470, ChatServer 87470 + */ + public getBackgroundColor(): Color; +} + +/** + * Ermöglicht Zugriff auf textuelle Channelinformationen und persistente Änderungen. + */ +declare class ChannelInformation { + /** + * Liefert das eingestellte Thema des Channels. + */ + public getTopic(): string; + /** + * Aktualisiert das Thema das Channels. + */ + public setTopic(topic: string, showMessage: boolean): void; +} + +/** + * Eine Instanz der Klasse ChannelJoinPermission wird als Rückgabewert + * der Methode App.mayJoinChannel(user) benötigt. + * + * Hiermit wird bestimmt, ob der anfragende Nutzer den Channel betreten darf. + * + * Erlauben mit ChannelJoinPermission.accepted() + * Verbieten mit ChannelJoinPermission.denied(denyReason) + */ +declare class ChannelJoinPermission { + /** + * Erzeugt ein ChannelJoinPermission-Objekt, das den Zugriff in den Channel erlaubt. + */ + public static accepted(): ChannelJoinPermission; + /** + * Erzeugt ein ChannelJoinPermission-Objekt, das den Zugriff in den Channel verbietet. + */ + public static denied(denyReason: string): ChannelJoinPermission; +} + +/** + * Eine Instanz von ChannelRestrictions ermöglicht es, aktuelle Informationen über Nutzungsbeschränkungen im Channel zu erhalten. + * + * Die Instanz für die ChannelRestrictions erhält man über das Channel-Objekt + * mit channel.getChannelRestrictions() + */ +declare class ChannelRestrictions { + /** + * Liefert alle User die im Channel derzeit für das Schreiben öffentlicher Nachrichten gesperrt sind. + */ + public getMutedUsers(): User[]; + /** + * Liefert alle User die im Channel derzeit für das Nutzen + * von Farben, Textformatierung und Smileys in öffentlichen Nachrichten gesperrt sind. + */ + public getColorMutedUsers(): User[]; + /** + * Liefert alle User die für das Betreten des Channel derzeit gesperrt sind. + */ + public getLockedUsers(): User[]; +} + +/** + * Die Instanz für die ChannelRights erhält man über das ChannelConfiguration-Objekt + * mit channelConfiguration.getChannelRights() + */ +declare class ChannelRights { + /** + * Liefert die Liste aller Channelbesitzer. In öffentlichen Channels sind dies alle hauptzuständigen betreuenden Mitglieder. (HZA/HZE) + */ + public getChannelOwners(): User[]; + /** + * Liefert die Liste aller Channel-Moderatoren. + */ + public getChannelModerators(): User[]; + /** + * Liefert die Liste aller Event-Moderatoren. + */ + public getEventModerators(): User[]; +} + +/** + * ChannelTalkMode repräsentiert das den Gesprächsmodus im Channel. + * + * Die Instanz für die ChannelTalkMode erhält man über das Channel-Objekt + * mit channel.getTalkMode() + */ +declare class ChannelTalkMode { + /** + * Jeder darf gerade im Channel schreiben. + */ + public static readonly Everyone: ChannelTalkMode; + /** + * Nur Personen, die besondere Rederechte haben dürfen gerade im Channel schreiben. + */ + public static readonly OnlyWithTalkPermission: ChannelTalkMode; + /** + * Nur Personen, die besondere Rederechte haben dürfen gerade im Channel schreiben. + * Die Nachrichten aller anderen Nutzer werden gefiltert und ggf. von den Moderatoren zugelassen. + */ + public static readonly FilteredByModerators: ChannelTalkMode; +} + +/** + * ChannelTalkPermission repräsentiert das Rederecht eines User + * im Channel. + */ +declare class ChannelTalkPermission { + /** + * Der User ist gerade nicht im Channel, + * daher ist die ChannelTalkPermission nicht bekannnt. + */ + public static readonly NotInChannel: ChannelTalkPermission; + /** + * Der User hat keine speziellen Rederechte. + * Beim ChannelTalkMode Default können diese User + * Nachrichten verfassen: + */ + public static readonly Default: ChannelTalkPermission; + /** + * Der User kann eine öffentliche Nachricht verfassen. Danach wechselt die + * ChannelTalkPermission automatisch auf Default. + */ + public static readonly TalkOnce: ChannelTalkPermission; + /** + * Der User kann permanent öffentliche Nachrichten verfassen. + */ + public static readonly TalkPermanent: ChannelTalkPermission; + /** + * Der User ist VIP und kann öffentliche Nachrichten verfassen, + * die farbig und groß dargestellt werden. + */ + public static readonly VIP: ChannelTalkPermission; + /** + * Der User ist VIP und kann öffentliche Nachrichten verfassen, + * die farbig und groß dargestellt werden. Moderatoren haben zudem weitere Möglichkeiten, die in der + * Anleitung zum Moderationssystem + * nachgelesen werden können. + */ + public static readonly Moderator: ChannelTalkPermission; +} + +/** + * Liefert Informationen über einen ChatServer. + * + * Die Instanz von ChatServerInfo erhält man über den KnuddelsServer + * mit KnuddelsServer.getChatServerInfo() + */ +declare class ChatServerInfo extends ServerInfo { + /** + * Liefert die Information, ob dieser Chat-Server ein Test-System ist. + */ + public isTestSystem(): boolean; +} + +/** + * Klasse, die es ermöglicht den Client innerhalb des HTML User Interface zu steuern und Daten an den Server zu senden. + */ +declare class Client { + /** + * Schließt das HTML User Interface. + */ + public static close(): void; + /** + * Sendet ein Event zum Server, das mit dem AppHook onEventReceived in der App + * abgefangen werden kann. + */ + public static sendEvent(type: string, data: KnuddelsEvent): void; + /** + * Sagt dem Chatserver, dass dieser Befehl für den Nutzer, der das HTML User Interface sieht, ausgeführt werden soll. + * Ist der Befehl auf einer Whitelist vom Server, so wird er sofort ausgeführt. Im anderen Falle sieht der Nutzer einen + * Link zum Bestätigen, mit dem er die Aktion starten kann. + * + * Derzeit sind diese Befehle auf der Whitelist: w, info, wc, top, h, dice, d, diceo, w2, serverpp, knuddelaccount, + * /tf-insert, /tf-inserts, /tf-insertb, /tf-insertsb, /tf-override, /tf-overrides, /tf-overrideb, /tf-overridesb, /autotype + */ + public static executeSlashCommand(command: string): void; + /** + * Bindet eine Javascript-Datei ein und sorgt dafür, dass immer die aktuellste Version vom Server geladen wird. + */ + public static includeJS(...files: string[]): void; + /** + * Registriert sich für ein bestimmtes Event, das vom Server mittels User/sendEvent:method oder vom Client via Client/dispatchEvent:method verschickt wurde. + */ + public static addEventListener(type: string, callback: (event: {type: string, data: KnuddelsEvent}) => void): void; + /** + * Sendet ein bestimmtes Event, so dass alle mit Client/addEventListener:method registrierten Listener aufgerufen werden. + */ + public static dispatchEvent(event: Client.Event): void; + /** + * Entfernt alle Event-Listener für einen bestimmten Event-Typ. + */ + public static removeEventListener(type: string): void; + /** + * Bindet eine CSS-Datei ein und sorgt dafür, dass immer die aktuellste Version vom Server geladen wird. + */ + public static includeCSS(...files: string[]): void; + /** + * Spielt einen Sound ab. Der angegebene Dateiname kann hierbei entweder absolut oder relativ zur angezeigten HTML-Datei sein. + * Bisher können nur Dateien mit Wave-Format zuverlässig abgespielt werden. + */ + public static playSound(fileName: string): void; + /** + * Lädt einen Sound herunter, damit die Datei später ohne Wartezeit abgespielt werden kann. + * (Android only) + * Der angegebene Dateiname kann hierbei entweder absolut oder relativ zur angezeigten HTML-Datei sein. + */ + public static prefetchSound(fileName: string): void; + /** + * Gibt einen Sound wieder frei, der in nächster Zeit vom Client nicht mehr gebraucht wird. + * (Android only) + * Der angegebene Dateiname kann hierbei entweder absolut oder relativ zur angezeigten HTML-Datei sein. + */ + public static freeSound(fileName: string): void; + /** + * Liefert den HostFrame des aktuellen Inhalts. + */ + public static getHostFrame(): Client.HostFrame; + /** + * Liefert den Nicknamen des Users, der gerade dieses HTML User Interface angezeigt bekommt. + */ + public static getNick(): string; + /** + * Liefert den aktuellen ClientType des Nutzers, der gerade dieses HTML User Interface angezeigt bekommt. + */ + public static getClientType(): ClientType; + /** + * Liefert die Id, die beim Laden von Skripten und Stylesheets an die URL angehängt wird, um sicherzustellen, dass eine neue Version + * der Datei vom Server geholt wird, statt die Datei aus dem Cache zu laden. + * + * Diese Id kann beim Einbinden eigener Ressourcen zum selben Zweck genutzt werden. + */ + public static getCacheInvalidationId(): string; + /** + * Beinhaltet die JSON-Daten, die beim Erstellen des HTMLFile übergeben wurden. + */ + public static pageData: Json; +} + +/** + * Klasse, mit der clientseitige Farbobjekte erstellt werden können. + */ +declare module Client { + export class Color { + /** + * Erzeugt ein Color-Objekt mit RGB-Werten. + */ + public static fromRGB(red: number, green: number, blue: number): Color; + /** + * Erzeugt ein Color-Objekt aus einem HexString. + */ + public static fromHexString(colorString: string): Color; + /** + * Liefert den Rot-Anteil der Farbe als Zahl zwischen 0 und 255. + */ + public getRed(): number; + /** + * Liefert den Grün-Anteil der Farbe als Zahl zwischen 0 und 255. + */ + public getGreen(): number; + /** + * Liefert den Blau-Anteil der Farbe als Zahl zwischen 0 und 255. + */ + public getBlue(): number; + /** + * Liefert die Farbe als in CSS nutzbaren HexString. + */ + public asHexString(): string; + } +} + +/** + * Klasse, die es ermöglicht ein Event via Client/dispatchEvent:method zu versenden. + */ +declare module Client { + export class Event { + /** + * Erzeugt ein Event. + */ + public constructor(type: string, data: KnuddelsEvent); + } +} + +/** + * Klasse, die es ermöglicht den Inhalte zu steuern, die im Bereich liegen, der das HTML User Interface hostet. + */ +declare module Client { + export class HostFrame { + /** + * Setzt den Titel der Seite im gezoomten Modus (nur Android). + */ + public setTitle(newTitle: string): void; + /** + * Ändert die sichtbare Hintergrundfarbe des Hostframes animiert. (Android-only) + */ + public setBackgroundColor(newColor: Color, durationMillis?: number): void; + /** + * Setzt die Icons, die als Fenster-Icon angezeigt werden sollen. (Applet-only, nur mit AppViewMode.Popup) + * Die Bilder müssen von groß nach klein sortiert sein. Die größeren Bilder werden (je nach System) automatisch dann eingesetzt, + * wenn größere Bilder benötigt werden (z.B. in der Task-Leiste, oder beim Alt+Tab Fenster-Wechsel). + * @since Applet: 9.0bwj, AppServer: 84904 + */ + public setIcons(...path: string[]): void; + /** + * Setzt, ob das Fenster resizable ist. (Applet-only, nur mit AppViewMode.Popup) + */ + public setResizable(resizable: boolean): void; + /** + * Bringt das Fenster der App (App-Popup bzw. Chat-Fenster) in den Vordergrund. (Applet-only) + * @since Applet: 9.0bwj, AppServer: 84904 + */ + public focus(): void; + /** + * Ändert die Größe des App-Fensters (AppViewMode.Popup) bzw. App-Overlays (AppViewMode.Overlay). + * @since Applet: 9.0bwj, AppServer: 84516 + */ + public setSize(width: number, height: number): void; + } +} + +/** + * ClientType repräsentiert die Art der Chat-Verbindung des Users. + * + * Eine Instanz von ClientType erhält man über das User-Objekt + * mit user.getClientType() + */ +declare class ClientType { + /** + * Der User ist mit dem Java Applet im Chat. + */ + public static readonly Applet: ClientType; + /** + * Der User ist mit dem Browser im Chat (Mini-Chat, HTML-Chat). + */ + public static readonly Browser: ClientType; + /** + * Der User ist mit der Android-App im Chat. + */ + public static readonly Android: ClientType; + /** + * Der User ist mit der iOS-App im Chat. + */ + public static readonly IOS: ClientType; + /** + * Der User ist nicht im Chat. + */ + public static readonly Offline: ClientType; +} + +/** + * Klasse, mit der serverseitige Farbobjekte erstellt werden können. + */ +declare class Color { + /** + * Erzeugt ein serverseitiges Color-Objekt mit RGB-Werten. + * Als Alpha-Wert wird automatisch 255 genutzt. + */ + public static fromRGB(red: number, green: number, blue: number): Color; + /** + * Erzeugt ein serverseitiges Color-Objekt mit RGBA-Werten. + */ + public static fromRGBA(red: number, green: number, blue: number, alpha: number): Color; + /** + * Liefert den Alpha-Wert der Farbe als Zahl zwischen 0 und 255. + */ + public getAlpha(): number; + /** + * Liefert den Blau-Anteil der Farbe als Zahl zwischen 0 und 255. + */ + public getBlue(): number; + /** + * Liefert den Grün-Anteil der Farbe als Zahl zwischen 0 und 255. + */ + public getGreen(): number; + /** + * Liefert den Rot-Anteil der Farbe als Zahl zwischen 0 und 255. + */ + public getRed(): number; + /** + * Liefert die Farbe als KCode zurück. + */ + public toKCode(): string; + /** + * Liefert die numerische Repräsentation der Farbe zurück. + */ + public asNumber(): number; + /** + * Erzeugt ein serverseitiges Color-Objekt aus der numerischen Repräsentation einer Farbe. + */ + public static fromNumber(value: number): Color; +} + +/** + * Eine Instanz von Dice repräsentiert die Anzahl an Würfeln von einerm bestimmten Typ. + */ +declare class Dice { + /** + * Erzeugt ein Dice-Objekt mit der übergebenen Anzahl Würfel und Augenzahl. + */ + public constructor(count: number /* optional */, value: number); + /** + * Liefert die Anzahl der Würfel. + */ + public getAmount(): number; + /** + * Liefert die Anzahl der Seiten der Würfel. + */ + public getNumberOfSides(): number; +} + +/** + * Eine Instanz von DiceConfiguration repräsentiert eindeutig eine Konfiguration zum würfeln. + * Wurde gewürfelt, so können die Konfigurationen verglichen werden, um zu prüfen, ob exakt die Würfel + * gewürfelt wurden, die gewürfelt werden sollten. + */ +declare class DiceConfiguration { + /** + * Informiert, ob es sich um einen offenen Würfelwurf handelt. + * Offene Würfelwürfe sind speziell. Falls die Augenzahl des Würfels die Maximalsumme zeigt, + * so wird noch einmal gewürfelt und die neue Zahl dazu addiert, solange bis der Würfel + * nicht mehr die Maximalsumme zeigt. + * + * Beispiel: /diceo 1w4 -> 4 -> 4 -> 3 = 11 + */ + public isUsingOpenThrow(): boolean; + /** + * Informiert darüber, ob die Würfel privat geworfen worden sind. + * Würfelwürfe zählen als privat, wenn am Ende des Würfelbefehls ein Ausrufezeichen steht. + * Beispiel: /dice 10w2! + */ + public isUsingPrivateThrow(): boolean; + /** + * Liefert ein Array mit Würfeln, mit denen gewürfelt wurde. + */ + public getDices(): Dice[]; + /** + * Vergleicht, ob zwei Konfigurationen inhaltlich identisch sind + */ + public equals(diceConfiguration: DiceConfiguration): boolean; + /** + * Liefert den Befehl, der im Chat eingegeben werden kann, um einen Wurf auszuführen, + * der zur DiceConfiguration passt. + * @since AppServer 82248 + */ + public getChatCommand(): string; +} + +/** + * Eine Instanz einer DiceConfigurationFactory kann zur Unterstützung genutzt werden, um eine + * DiceConfiguration zu erzeugen. + */ +declare class DiceConfigurationFactory { + /** + * Fügt der Konfiguration einen Würfel hinzu. + */ + public addDice(dice: Dice): void; + /** + * Liefert die Anzahl der Würfel, die zur Konfiguration gehören. + */ + public computeCurrentDiceCount(): number; + /** + * Setzt die Information, ob ein offener Wurf oder ein normaler Wurf stattfinden soll. + * Offene Würfelwürfe sind speziell. Falls die Augenzahl des Würfels die Maximalsumme zeigt, + * so wird noch einmal gewürfelt und die neue Zahl dazu addiert, solange bis der Würfel + * nicht mehr die Maximalsumme zeigt. + * + * Beispiel: /diceo 1w4 -> 4 -> 4 -> 3 = 11 + */ + public setUseOpenThrow(shouldUseOpenThrow: boolean): void; + /** + * Setzt die Information, ob der Würfelwurf privat stattfinden soll. + */ + public setShouldUsePrivateThrow(shouldUsePrivateThrow: boolean): void; + /** + * Liefert die erzeugte Würfelkonfiguration. + */ + public getDiceConfiguration(): DiceConfiguration; + /** + * Erzeugt eine Würfelkonfiguration. + */ + public static fromString(diceConfigurationString: string): DiceConfiguration; +} + +/** + * Wird in der App die Methode onUserDiced überschrieben, so erhält diese bei jedem Würfelwurf ein DiceEvent. + * Ein DiceEvent ermöglicht einem detaillierte Informationen rund um diesen Würfelwurf in Erfahrung zu bringen. + */ +declare class DiceEvent { + /** + * Liefert den Nutzer, der gewürfelt hat. + */ + public getUser(): User; + /** + * Liefert das DiceResult des Würfelwurfs. + */ + public getDiceResult(): DiceResult; +} + +/** + * Ein DiceResult beinhaltet konkrete Informationen über einen Würfelwurf. + */ +declare class DiceResult { + /** + * Liefert die Konfiguration mit der gewürfelt wurde. + */ + public getDiceConfiguration(): DiceConfiguration; + /** + * Liefert ein Array mit Details zu den einzelnen Ergebnissen pro Würfeltyp. + */ + public getSingleDiceResults(): SingleDiceResult[]; + /** + * Liefert die Summe der Augenzahlen aller Würfel + */ + public totalSum(): number; +} + +/** + * Die Instanz einer Domain beinhaltet alle relevanten Informationen zur Domain. + */ +declare class Domain { + /** + * Liefert ein den Domain-Namen der aktuellen Domain. + */ + public getDomainName(): string; +} + +/** + * Die Instanz von ExternalServerAccess erhält man über die KnuddelsServer.getExternalServerAccess(). + * Damit der Zugriff auf einen externern Server funktioniert, muss auf dem Server eine Datei knuddelsAccess.txt abgelegt werden, die die FTP-User-ID des Entwicklers enthält. + */ +declare class ExternalServerAccess { + /** + * Liefert eine Liste aller zugreifbaren Domains + */ + public getAllAccessibleDomains(): Domain[]; + /** + * Prüft den Zugriff auf eine bestimmte URL. Wird je Kombination von "Protokoll + Host + Port" geprüft.
+ * Beispiel: http://www.example.de:8080 + */ + public canAccessURL(urlString: string): boolean; + /** + * Macht einen GET-Request auf die übergebene URL und liefert den Inhalt zurück. + * Diese Methode ist eine Convenience-Methode für externalServerAccess.callURL(). + */ + public getURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; }): void; + /** + * Macht einen POST-Request auf die übergebene URL und liefert den Inhalt zurück. + * Diese Methode ist eine Convenience-Methode für externalServerAccess.callURL(). + */ + public postURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; data?: Json; }): void; + /** + * Macht einen GET-Request auf die übergebene URL. Im Gegensatz zum GET-Request wird der Inhalt der Webseite wird nicht ausgelesen. + * Aus diesem Grund ist diese Methode schneller. + * Diese Methode ist eine Convenience-Methode für externalServerAccess.callURL(). + */ + public touchURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; }): void; + /** + * Macht einen Request auf die übergebene URL. + */ + public callURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; method?: ("GET" | "POST"); data?: Json; }): void; +} + +/** + * Die Instanz von ExternalServerResponse erhält in den onSuccess- und onFailure-Callbacks der Methoden von + * ExternalServerAccess. Es enthält alle notwendigen Daten zum Verarbeiten. + */ +declare class ExternalServerResponse { + /** + * Liefert die abgefragte URL. + */ + public getURLString(): string; + /** + * Liefert den HTTP-Statuscode der Seite. + */ + public getResponseCode(): number; + /** + * Liefert ein Objekt, das die Headerdaten der Antwort enthält. + */ + public getHeaderFields(): { [key: string]: string[] }; +} + +/** + * Gender repräsentiert das Geschlecht eines User. + */ +declare class Gender { + /** + * Das Geschlecht ist männlich. + */ + public static readonly Male: Gender; + /** + * Das Geschlecht ist weiblich. + */ + public static readonly Female: Gender; + /** + * Das Geschlecht ist nicht bekannt. + */ + public static readonly Unknown: Gender; +} + +/** + * Repräsentiert eine HTML-Datei, die auf dem Server im Ordner /www liegt. + */ +declare class HTMLFile { + /** + * + */ + public constructor(assetPath: string, pageData?: Json); + /** + * Liefert den Pfad, der beim Anlegen der HTMLFile-Instanz genutzt wurde. + */ + public getAssetPath(): string; + /** + * Liefert die pageData, die beim Anlegen der HTMLFile-Instanz genutzt wurden. + */ + public getPageData(): Json; +} + +/** + * Eine Instanz von KnuddelAccount ermöglicht den Zugriff auf die freigegebenen Knuddel + * eines bestimmten User. Knuddel können abgezogen und addiert werden. + */ +declare class KnuddelAccount { + /** + * Liefert den KnuddelAmount eines Users, + * über den die App gerade frei verfügen kann. + */ + public getKnuddelAmount(): KnuddelAmount; + /** + * Liefert den KnuddelAmount aus dem KnuddelAccount, + * der bereits von der App genutzt wurde. + * Beim Auszahlen dieser Knuddel aus dem KnuddelAccount an den + * User fallen Steuern an. + */ + public getKnuddelAmountUsed(): KnuddelAmount; + /** + * Liefert den KnuddelAmount aus dem KnuddelAccount, + * der noch nicht von der App genutzt wurde. + * Beim Auszahlen dieser Knuddel aus dem KnuddelAccount an den + * User fallen keine Steuern an. + */ + public getKnuddelAmountUnused(): KnuddelAmount; + /** + * Liefert die Summe aller Transfers, die die App an diesen KnuddelAccount bzw. User überwiesen hat. + */ + public getTotalKnuddelAmountAppToUser(): KnuddelAmount; + /** + * Liefert die Summe aller Transfers, die die App von diesem KnuddelAccount bzw. User abgebucht/erhalten hat. + */ + public getTotalKnuddelAmountUserToApp(): KnuddelAmount; + /** + * Liefert die Information, ob in diesem Moment genug Knuddel verfügbar sind. + */ + public hasEnough(knuddelAmount: KnuddelAmount): boolean; + /** + * Liefert den Nutzer, dem der KnuddelAccount gehört. + */ + public getUser(): User; + /** + * Versucht eine bestimmte Menge Knuddel zu verwenden. Dies ist nur möglich, wenn der User auf seinem KnuddelAccount + * genug Knuddel besitzt und online im Channel ist. + * Vom KnuddelAccount des Besitzer des Channel können Knuddel auch abgebucht werden, wenn dieser nicht im Channel online ist. + * + * Ist das Event App.onBeforeKnuddelReceived implementiert, so wird diese direkt nach dem use aufgerufen, + * um zu entscheiden, ob die Knuddel angenommen werden sollen. + * + *

Hinweis: Knuddel an einen Nutzer senden kannst du mit der Methode BotUser/transferKnuddel:method. + */ + public use(knuddelAmount: KnuddelAmount, displayReasonText: string, parameters?: { transferReason?: string; onError?: (message: string) => void; onSuccess?: () => void; }): void; +} + +/** + * Eine Instanz von KnuddelAmount repräsentiert eine bestimmte Anzahl von Knuddel. + */ +declare class KnuddelAmount { + /** + * Erzeugt eine Instanz von KnuddelAmount mit der Anzahl Knuddel. + */ + public constructor(knuddel: number); + /** + * Erzeugt eine Instanz von KnuddelAmount mit einer bestimmten Cent-Anzahl. + */ + public static fromCents(knuddel: number): KnuddelAmount; + /** + * Erzeugt eine Instanz von KnuddelAmount mit einer bestimmten Knuddel-Anzahl. + */ + public static fromKnuddel(knuddel: number): KnuddelAmount; + /** + * Liefert die Anzahl der Knuddel in KnuddelCent zurück. + */ + public getKnuddelCents(): number; + /** + * Gibt den Wert der Knuddel als Zahl zurück. + */ + public asNumber(): number; + /** + * Liefert eine negierte Kopie des KnuddelAmount zurück. + */ + public negate(): KnuddelAmount; + /** + * Liefert die Information, ob der Knuddelwert unter 0 ist. + */ + public isNegative(): boolean; +} + +/** + * Repräsentiert einen KnuddelPot. + * Ein KnuddelPot kann nur durch Factory-Methoden des KnuddelsServer erzeugt werden: + * KnuddelsServer/createKnuddelPot:method. + * + * Wird die App heruntergefahren, so werden alle KnuddelPots, die nicht gesealt sind automatisch refunded. + */ +declare class KnuddelPot { + /** + * Liefert die id des KnuddelPot. + */ + public getId(): number; + /** + * Liefert den Status des KnuddelPot. + */ + public getState(): KnuddelPotState; + /** + * Liefert den beim Kreieren des KnuddelPots festgelegten KnuddelAmount, den jeder Teilnehmer zahlen muss. + */ + public getKnuddelAmountPerParticipant(): KnuddelAmount; + /** + * Liefert den KnuddelAmount, der bisher insgesamt in den KnuddelPot eingezahlt wurde. + */ + public getKnuddelAmountTotal(): KnuddelAmount; + /** + * Liefert die Liste der Teilnehmer, die bisher in den KnuddelPot eingezahlt haben. + */ + public getParticipants(): User[]; + /** + * Liefert den höchsten Multiplikator, der gültig ist. + */ + public getMaxFeeMultiplier(): number; + /** + * Setzt den BotUser, der den Anteil der Einzahlungen nach dem Spiel erhält + * und den Anteil, vom Gesamtpot, den er erhalten soll. + */ + public setFee(feeUser: BotUser, feeMultiplier: number): void; + /** + * Liefert den mit KnuddelPot/setFee:method gesetzten BotUser an den die Gebühr ausbezahlt wird. + */ + public getFeeUser(): User; + /** + * Liefert den mit KnuddelPot/setFee:method gesetzten Multiplikator der Gebühr. + */ + public getFeeMultiplier(): number; + /** + * Versiegelt den KnuddelPot, sodass keine weiteren Einzahlungen vorgenommen + * werden können und Gewinne ausgeschüttet werden können. + */ + public seal(): void; + /** + * Bezahlt alle Einsätze an die Teilnehmer zurück und informiert mit dem übergeben Text über den Grund. + */ + public refund(reason?: string): void; + /** + * Fügt einen Gewinner in die Liste der Gewinner hinzu. + * Der zweite Parameter ist die Gewichtung mit der ausgezahlt werden soll. + * Wird der Parameter weggelassen, so ist er automatisch 1. + */ + public addWinner(user: User, weight?: number): void; + /** + * Zahlt den KnuddelPot an die mit addWinner gesetzten Gewinner aus. + */ + public payout(text?: string): void; +} + +/** + * Repräsentiert den Status eines KnuddelPot. + */ +declare class KnuddelPotState { + /** + * Der KnuddelPot ist geöffnet und kann neue Teilnehmer annehmen. + */ + public static readonly Open: KnuddelPotState; + /** + * Der KnuddelPot ist versiegelt und kann keine neuen Teilnehmer annehmen. + */ + public static readonly Sealed: KnuddelPotState; + /** + * Der KnuddelPot ist beendet und die Knuddel bereits ausgezahlt. + */ + public static readonly Closed: KnuddelPotState; +} + +/** + * Ein KnuddelTransfer ist ein Container-Objekt für die Daten, die bei einer Knuddel-Transaktion von einem User + * an eine App anfallen. + * + * Implementiert man den App-Hook onBeforeKnuddelReceived, so kann man dort entscheiden, ob man den KnuddelTransfer + * annimmt oder ablehnt. + */ +declare class KnuddelTransfer { + /** + * Liefert den User, der den KnuddelTransfer ausgelöst hat. + */ + public getSender(): User; + /** + * Liefert den BotUser, der die Knuddel des KnuddelTransfer erhält, + * wenn dieser mit accept() angenommen wurde. + */ + public getReceiver(): BotUser; + /** + * Liefert die Anzahl der Knuddel, die mit diesem Transfer überwiesen werden. + */ + public getKnuddelAmount(): KnuddelAmount; + /** + * Liefert den Grund für den Transfer, der bei der Überweisung angegeben wurde mit + * /appknuddel BOTNICK:KNUDDEL:GRUND. + */ + public getTransferReason(): string; + /** + * Lehnt die Knuddel aus dem KnuddelTransfer ab und sendet sie zurück an den Absender. + * Als Grund sieht der Absender den übergebenen reason. + * + * Diese Methode wirft eine Exception, wenn sie auf einen bereits verarbeiteten Transfer aufgerufen wird. + * Sie kann nur erfolgreich aus dem AppHook onBeforeKnuddelReceived aufgerufen werden. + * + * In der Methode onBeforeKnuddelReceived kann genau ein Aufruf einer dieser drei Methoden gemacht werden: + * KnuddelTransfer/accept:method, + * KnuddelTransfer/addToPot:method, + * KnuddelTransfer/reject:method + */ + public reject(reason: string): void; + /** + * Nimmt die Knuddel aus dem KnuddelTransfer an und übergibt sie an den BotUser, + * der mit getReceiver() abgefragt werden kann. + * + * Diese Methode wirft eine Exception, wenn sie auf einen bereits verarbeiteten Transfer aufgerufen wird. + * Sie kann nur erfolgreich aus dem AppHook onBeforeKnuddelReceived aufgerufen werden. + * In der Methode onBeforeKnuddelReceived kann genau ein Aufruf einer dieser drei Methoden gemacht werden: + * + * KnuddelTransfer/accept:method, + * KnuddelTransfer/addToPot:method, + * KnuddelTransfer/reject:method + */ + public accept(): void; + /** + * Liefert die Information, ob ein bestimmter KnuddelTransfer zu einem KnuddelPot hinzugefügt werden kann. + */ + public canAddToPot(pot: KnuddelPot): boolean; + /** + * Nimmt die Knuddel aus dem KnuddelTransfer an und übergibt sie an den übergebenen KnuddelPot. + * + * Diese Methode funktioniert analog zu KnuddelTransfer/accept:method, nur dass die Knuddel im KnuddelPot statt beim BotUser landen. + * + * Diese Methode wirft eine Exception, wenn sie auf einen bereits verarbeiteten Transfer aufgerufen wird. + * Sie kann nur erfolgreich aus dem AppHook onBeforeKnuddelReceived aufgerufen werden. + * + * In der Methode onBeforeKnuddelReceived kann genau ein Aufruf einer dieser drei Methoden gemacht werden: + * KnuddelTransfer/accept:method, + * KnuddelTransfer/addToPot:method, + * KnuddelTransfer/reject:method + */ + public addToPot(knuddelPot: KnuddelPot): void; + /** + * Liefert die Information, ob der KnuddelTransfer bereits verarbeitet wurde. + * Falls die Methode false zurückliefert muss noch entschieden werden, ob der + * KnuddelTransfer angenommen oder abgelehnt wird. + */ + public isProcessed(): boolean; +} + +/** + * KnuddelTransferDisplayType repräsentiert die Art der Darstellung einer Knuddel-Überweisung. + */ +declare class KnuddelTransferDisplayType { + /** + * Nachricht wird öffentlich angezeigt. + */ + public static readonly Public: KnuddelTransferDisplayType; + /** + * Nachricht wird privat angezeigt. + */ + public static readonly Private: KnuddelTransferDisplayType; + /** + * Nachricht wird als /m zugestellt. + */ + public static readonly Post: KnuddelTransferDisplayType; +} + +/** + * KnuddelsServer ist die 'Einstiegsklasse'. Mit den statischen Methoden des KnuddelsServer erhält man Zugriff auf viele + * Objekte und Klassen, die im Verlauf der App-Entwicklung benötigt werden. + */ +declare class KnuddelsServer { + /** + * Liefert den BotUser, der standardmäßig zur App gehört. + */ + public static getDefaultBotUser(): BotUser; + /** + * Liefert die AppPersistence, mit der sich Zahlen, Strings und Javascript-Objekte langfristig und über die Session einer App hinaus gespeichert werden können. + */ + public static getPersistence(): AppPersistence; + /** + * Liefert den Channel in dem die App läuft. + */ + public static getChannel(): Channel; + /** + * Liefert das UserAccess-Objekt, über das + * User zugreifbar werden. + */ + public static getUserAccess(): UserAccess; + /** + * Liefert ein ExternalServerAccess-Objekt, mit dem + * andere Server angesteuert werden können. + */ + public getExternalServerAccess(): ExternalServerAccess; + /** + * Aktualisiert die Liste der genutzten Hooks. Werden zur Laufzeit chatCommands oder App-Hooks (wie mayJoinChannel) dynamisch erzeugt oder gelöscht, so muss danach refreshHooks() + * aufgerufen werden, damit diese Änderung wirksam wird. + */ + public static refreshHooks(): void; + /** + * Liefert den Standard-Logger für diese App. Alles, was geloggt wird, wird vom Nutzer "App-Logs" als private Nachricht zugestellt. + */ + public static getDefaultLogger(): Logger; + /** + * Liefert den Pfad eines Bildes zur Integration in der eigenen App. + * Alle Bilder, die im Ordner /www in der App abgelegt werden können hier referenziert werden. + */ + public static getFullImagePath(imageName: string): string; + /** + * Liefert den Pfad eines Systembildes zur Integration in der eigenen App. + * Alle Bilder, die unter http://apps4.knuddels.biz/kimg/ + * erreichbar sind können hier referenziert werden. + */ + public static getFullSystemImagePath(imageName: string): string; + /** + * Liefert die Informationen über den ChatServer auf dem die App läuft. + */ + public static getChatServerInfo(): ChatServerInfo; + /** + * Liefert die Informationen über den AppServer auf dem die App läuft. + */ + public static getAppServerInfo(): AppServerInfo; + /** + * Liefert das AppAccess-Object. + */ + public static getAppAccess(): AppAccess; + /** + * Erzeugt einen KnuddelPot. + * + * Ist ein KnuddelPot 30 Minuten nach dem Erzeugen noch nicht gesealt, + * so wird vom Server automatisch ein KnuddelPot/refund:method ausgelöst. + */ + public static createKnuddelPot(knuddelAmount: KnuddelAmount, params?: { payoutTimeoutMinutes?: number; shouldSealPot?: (pot: KnuddelPot) => boolean; onPotSealed?: (pot: KnuddelPot) => void; }): KnuddelPot; + /** + * Liefert den KnuddelPot mit der angegeben id. + */ + public static getKnuddelPot(id: number): (KnuddelPot|null); + /** + * Liefert alle für die App noch verwaltbaren KnuddelPot-Objekte. + */ + public static getAllKnuddelPots(): KnuddelPot[]; + /** + * Liefert das ToplistAccess-Objekt, über das + * Toplisten erzeugt und verwaltet werden können. + */ + public static getToplistAccess(): ToplistAccess; + /** + * Liefert das AppProfileEntryAccess-Objekt, über das + * App-Profileinträge erzeugt und verwaltet werden können. + */ + public static getAppProfileEntryAccess(): AppProfileEntryAccess; +} + +/** + * Mit einer Instanz einer LoadConfiguration kann gestaltet werden, wie der Inhalt des HTML User Interface aussieht, bevor es fertig geladen ist. + */ +declare class LoadConfiguration { + /** + * Setzt die Farbe des Hintergrundes vom Loading-View, der angezeigt wird, während das HTML User Interface lädt. (standardmäßig weiß) + */ + public setBackgroundColor(color: Color): void; + /** + * Setzt das Hintergrundbild vom Loading-View, das angezeigt wird, während das HTML User Interface lädt. (standardmäßig nicht gesetzt) + */ + public setBackgroundImage(imageUrl: string): void; + /** + * Setzt den Text des Ladehinweiseses im Loading-View, der angezeigt wird, während das HTML User Interface lädt. (standardmäßig "Lädt...") + * Hinweis: Wird mit setLoadingIndicatorImage ein Loaading-Indicator-Bild gesetzt, so wird der mit setText gesetzte Texte ignoriert. + */ + public setText(text: string): void; + /** + * Setzt ein Loading-Indicator-Bild im Loading-View, das angezeigt wird, während das HTML User Interface lädt. (standardmäßig nicht gesetzt) + * Hinweis: Wird mit setLoadingIndicatorImage ein Loaading-Indicator-Bild gesetzt, so wird der mit setText gesetzte Texte ignoriert. + */ + public setLoadingIndicatorImage(imageUrl: string): void; + /** + * Setzt die Farbe des Textes im Loading-View, der angezeigt wird, während das HTML User Interface lädt. (standardmäßig schwarz) + */ + public setForegroundColor(color: Color): void; + /** + * Aktiviert/Deaktiviert die Nutzung vom Loading-View. (standardmäßig aktiviert) + * Es kann sinnvoll sein, den Loading-View zu deaktivieren, wenn man selbst einen komplett eigenen Loading-View in seine App einbauen möchte. + */ + public setEnabled(enabled: boolean): void; +} + +/** + * Eine Instanz eines Logger ermöglicht das Loggen von Inhalten. + * + * Diese erhält man über das KnuddelsServer-Objekt + * mit KnuddelsServer.getDefaultLogger() + * + * Die Log-Einträge werden je nach Einstellungen im /apps-Fenster an den Besitzer des Channels, + * die App-Manager und den App-Entwickler zugestellt. + */ +declare class Logger { + /** + * Logge einen Text mit Level DEBUG. Dieser wird im Chat allen dafür registrierten AppManagern per /p vom App-Logs-User zugestellt. Siehe: /apps, Tab: Logs. + * + * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. + */ + public debug(...msg: any[]): void; + /** + * Logge einen Text mit Level INFO. Dieser wird im Chat allen dafür registrierten AppManagern per /p vom App-Logs-User zugestellt. Siehe: /apps, Tab: Logs. + * + * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. + */ + public info(...msg: any[]): void; + /** + * Logge einen Text mit Level WARN. Dieser wird im Chat allen dafür registrierten AppManagern per /p vom App-Logs-User zugestellt, sowie im /apps Fenster im Log angezeigt. Siehe: /apps, Tab: Logs. + * + * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. + */ + public warn(...msg: any[]): void; + /** + * Logge einen Text mit Level ERROR. Dieser wird im Chat allen dafür registrierten AppManagern per /p vom App-Logs-User zugestellt, sowie im /apps Fenster im Log angezeigt. Siehe: /apps, Tab: Logs. + * + * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. + */ + public error(...msg: any[]): void; + /** + * Logge einen Text mit Level FATAL. Dieser wird im Chat allen dafür registrierten AppManagern per /p vom App-Logs-User zugestellt, sowie im /apps Fenster im Log angezeigt. Siehe: /apps, Tab: Logs. + * + * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. + */ + public fatal(...msg: any[]): void; +} + +/** + * Message ist eine abstrakte Klasse und repräsentiert eine Nachricht im Chat. + */ +declare class Message { + /** + * Liefert den User, der die Nachricht verfasst hat. + */ + public getAuthor(): User; + /** + * Liefert den Inhalt der Nachricht. + */ + public getText(): string; + /** + * Liefert den genauen Zeitpunkt, zu dem die Nachricht erstellt wurde. + */ + public getCreationDate(): Date; +} + +/** + * Repräsentiert die Instanz der konkreten App, auf die dieser Code Zugriff hat. + * + * Die Instanz von OwnAppInstance erhält man über das AppAccess-Objekt + * mit appAccess.getOwnInstance() + */ +declare class OwnAppInstance { + /** + * Gibt Zugriff auf Nutzer, die gerade im Channel dieser AppInstance online sind. + * @since AppServer 82560 + */ + public getOnlineUsers(otherAppInstance: AppInstance, ...userType: UserType[]): User[]; +} + +/** + * Eine Instanz von Persistence ermöglicht die persistente Speicherung von Zahlen, Zeichenketten und JSON-Objekten. + * Es gibt die zwei Arten AppPersistence und UserPersistence + * + * Jeder eigene Datentyp hat seinen eigenen Namensraum. + * So kann derselbe key für eine Zahl, Zeichenkette und auch JSON-Objekt genutzt werden. + * + *

Hinweis: Mit der Persistence gespeicherte Informationen überleben + * sogar die Deinstallation und Neuinstallation der App. + */ +declare class Persistence { + /** + * Informiert darüber, ob unter dem key ein String abgespeichert ist. + */ + public hasString(key: string): boolean; + /** + * Setzt die Zeichenkette value für den key. + * Falls bereits eine Zeichenkette für den key existiert, so wird diese überschrieben. + */ + public setString(key: string, value: string): void; + /** + * Liefert die Zeichenkette, die für den key gespeichert ist. + * Falls für key keine Zeichenkette gespeichert ist, so gibt die Methode + * den defaultValue zurück. + */ + public getString(key: string, defaultValue?: string): string; + /** + * Löscht die Zeichenkette, die unter key gespeichert ist. + */ + public deleteString(key: string): void; + /** + * Informiert darüber, ob unter dem key eine Zahl abgespeichert ist. + */ + public hasNumber(key: string): boolean; + /** + * Setzt die Zahl value für den key. + * Falls bereits eine Zahl für den key existiert, so wird diese überschrieben. + */ + public setNumber(key: string, value: number): void; + /** + * Addiert den übergebenen value auf die unter dem Key key vorhandenen Wert drauf. + * Value kann auch negativ sein um eine Subtraktion durchzuführen. + * Falls keine Zahl für den key existiert, so wird der value für key gespeichert. + */ + public addNumber(key: string, value: number): number; + /** + * Liefert die Zahl, die für den key gespeichert ist. + * Falls für key keine Zahl gespeichert ist, so gibt die Methode + * den defaultValue zurück. + */ + public getNumber(key: string, defaultValue?: number): number; + /** + * Löscht die Zahl, die unter key gespeichert ist. + */ + public deleteNumber(key: string): void; + /** + * Informiert darüber, ob unter dem key ein Objekt abgespeichert ist. + */ + public hasObject(key: string): boolean; + /** + * Setzt das Objekt value für den key. + * Falls bereits ein Objekt für den key existiert, so wird dieses überschrieben. + * Das als JSON serialisierte Objekt darf maximal 100kb groß sein. + */ + public setObject(key: string, object: (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable)): void; + /** + * Liefert das Objekt, das für den key gespeichert ist. + * Falls für key kein Objekt gespeichert ist, so gibt die Methode + * den defaultValue zurück. + */ + public getObject(key: string, defaultValue?: (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable)): (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable); + /** + * Löscht das Objekt, das unter key gespeichert ist. + */ + public deleteObject(key: string): void; +} + +/** + * Eine Instanz von PrivateMessage repräsentiert eine private Nachricht im Chat. + * Die App erhält sämtliche private Nachrichten, die an einen ihrer BotUser + * geschickt werden. + * + *

Hinweis: Eine App hat keinen Zugriff auf private Nachrichten, + * die Nutzer untereinander schreiben, ohne dass ein BotUser als Empfänger involviert ist. + */ +declare class PrivateMessage extends Message { + /** + * Liefert die Liste der Empfänger der Nachricht. + */ + public getReceivingUsers(): User[]; + /** + * Sendet eine private Nachricht an alle Beteiligten des Gespräches. + */ + public sendReply(text: string): void; +} + +/** + * Eine Instanz von PublicActionMessage repräsentiert eine öffentliche Handlung im Chat. + * Die App erhält die öffentlichen Handlungen. + */ +declare class PublicActionMessage extends Message { +} + +/** + * Eine Instanz von PublicEventMessage repräsentiert ein öffentliches Event im Chat. + * Die App erhält die öffentlichen Events. + */ +declare class PublicEventMessage extends Message { +} + +/** + * Eine Instanz von PublicMessage repräsentiert eine öffentliche Nachricht im Chat. + * Die App erhält die öffentlichen Nachrichten, die geschrieben werden. + */ +declare class PublicMessage extends Message { +} + +/** + * Eine Quest ist eine konkrete Aufgabe, die ein User in der App zu erledigen hat. + * + * Im Blog findest du Informationen darüber, wie man eine Quest für seine App erhält: + * https://blog.developer.knuddels.de/2015/10/29/how-to-get-a-quest/ + */ +declare class Quest { + /** + * Löst ein Quest-Event aus. + * @since AppServer 82290, ChatServer 82290 + */ + public setSolved(count?: number): void; + /** + * Liefert den Key der Quest. + * @since AppServer 82290, ChatServer 82290 + */ + public getQuestKey(): string; +} + +/** + * Ein QuestAccess-Objekt ermöglicht den Zugriff auf die Quests, die ein Nutzer des Chats, für die laufende App hat. + * + * Im Blog findest du Informationen darüber, wie man eine Quest für seine App erhält: + * https://blog.knuddels.de/2015/10/29/how-to-get-a-quest/ + */ +declare class QuestAccess { + /** + * Liefert die Quests + * für diesen Nutzer in dieser App. + * @since AppServer 82290, ChatServer 82290 + */ + public getQuests(): Quest[]; + /** + * Liefert die Information, ob eine bestimmte Quest offen ist. + * @since AppServer 82290, ChatServer 82290 + */ + public hasQuest(questKey: string): boolean; + /** + * Liefert eine bestimmte Quest, falls vorhanden. + * @since AppServer 82290, ChatServer 82290 + */ + public getQuest(questKey: string): (Quest|null); + /** + * Liefert den User, der zu diesem QuestAccess-Objekt gehört. + * @since AppServer 82290, ChatServer 82290 + */ + public getUser(): User; +} + +/** + * RandomOperations bietet eine Sammlung verschiedener Zufallsoperationen, die man für Glücksspiele und Ähnliches nutzen kann. + */ +declare class RandomOperations { + /** + * Liefert eine Zufallszahl zwischen minValue (inklusiv) und maxValue (exklusiv). + */ + public static nextInt(minValue: number /* optional */, maxValue: number): number; + /** + * Liefert ein Array mit Zufallszahlen zwischen minValue (inklusiv) und n (exklusiv). + */ + public static nextInts(minValue: number /* optional */, maxValue: number, count: number, onlyDifferentNumbers: boolean): number[]; + /** + * Liefert true in truePropability/1 Fällen + */ + public static flipTrue(truePropability: number): boolean; + /** + * Liefert ein zufälliges Objekt aus einem Array. + * Falls das Array leer ist, wird null zurückgeliefert. + */ + public static getRandomObject(objects: T[]): T; + /** + * Mischt das Array der übergebenen Objekte und liefert es zurück. + */ + public static shuffleObjects(objects: T[]): T[]; + /** + * Liefert einen zufälligen String zurück. + * @since AppServer 92699 + */ + public static getRandomString(length: number, allowedCharacters?: string): string; +} + +/** + * Repräsentiert die Root-Instanz einer App, die im Hauptchannel läuft. + * + * Die Instanz für die RootAppInstance erhält man über das AppInstance-Objekt + * mit appInstance.getRootInstance() + */ +declare class RootAppInstance extends AppInstance { + /** + * Aktualisiert diese App im Channel (und ggf. vorhandenen Tochterchanneln) auf die neueste Version. + */ + public updateApp(message: string /* optional */, logMessage?: string): void; + /** + * Stoppt diese App. + */ + public stopApp(message: string /* optional */, logMessage?: string): void; +} + +/** + * Liefert Informationen über einen Server. + */ +declare class ServerInfo { + /** + * Liefert die interne ServerId des Servers. + */ + public getServerId(): string; + /** + * Liefert die Code-Revision des Servers. + */ + public getRevision(): number; +} + +/** + * Ein SingleDiceResult enthält das Ergebnis aller Würfel desselben Typs. + * Würfelt man beispielsweise mit der Konfiguration "1w2 + 10w5" so gibt es im DiceResult + * zwei SingleDiceResult-Objekte. Eines für "1w2" und eines für "10w5". + */ +declare class SingleDiceResult { + /** + * Liefert den Würfel zurück, durch den dieses SingleDiceResult erzeugt wurde. + */ + public getDice(): Dice; + /** + * Liefert die Ziffern, die gewürfelt wurden. + */ + public valuesRolled(): number[]; + /** + * Liefert die Summe der Augenzahlen des SingleDiceResult. + */ + public sum(): number; +} + +/** + * Diese Dokumentation beschreibt, welche Erweiterungen am serverseitigen String-Objekt vorgenommen wurden. + */ +declare interface String { + /** + * Die Methode liefert den String zurück, auf dem sie aufgerufen wurde mit KCode escaped. + */ + escapeKCode(): string; + /** + * Entfernt jeglichen KCode aus dem String und gibt ihn zurück. + */ + stripKCode(): string; + /** + * Diese Methode liefert die Information, ob der String auf dem die Methode aufgerufen wurde + * mit einem bestimmten Prefix beginnt. + */ + startsWith(prefix: string): boolean; + /** + * Diese Methode liefert die Information, ob der String auf dem die Methode aufgerufen wurde + * mit einem bestimmten Suffix endet. + */ + endsWith(suffix: string): boolean; + /** + * Liefert die Breite des Strings in der Schriftart Arial mit der gegeben Schriftgröße und Information, ob Text fett dargestellt werden soll. + */ + getPixelWidth(fontSize: number, isBold: boolean): number; + /** + * Liefert einen String, der in der Schriftart Arial mit der gegeben Schriftgröße und Information, ob Text fett dargestellt werden soll + * maximal maxPixelWidth breit ist. Wird der Text dafür gekürzt, so wird an das Ende abbreviationMarker angehangen. + * Falls abbreviationMarker nicht übergeben wurde, so ist es automatisch '...'. + */ + limitString(fontSize: number, isBold: boolean, maxPixelWidth: number, abbreviationMarker?: string): string; + /** + * Liefert die Information, ob ein bestimmter String in diesem String vorhanden ist. + */ + contains(needle: string): boolean; + /** + * Liefert die Levenshtein-Distanz zum übergebenen String. + * Levenshtein-Distanz: Minimale Anzahl von Einfüge-, Lösch- und Ersetz-Operationen, um die erste Zeichenkette in die zweite umzuwandeln. + * @since AppServer 82271 + */ + minimalConversionCost(otherString: string): number; + /** + * Liefert die Information, ob der String nur aus Zeichen besteht, die in einem Nicknamen + * vorkommen dürfen. + * @since AppServer 82271 + */ + hasOnlyNicknameCharacters(): boolean; + /** + * Liefert die Information, ob der String nur aus Zeichen besteht, die Nummern sind. + * @since AppServer 82271 + */ + hasOnlyDigits(): boolean; + /** + * Liefert die Information, ob der String nur aus Zeichen besteht, die alphanumerisch + Whitespaces sind. + * @since AppServer 82271 + */ + hasOnlyAlphanumericalAndWhitespaceCharacters(): boolean; + /** + * Liefert die Information, ob der String leer oder null ist. + * @since AppServer 92695 + */ + isEmpty(): boolean; + /** + * Liefert den String in CamelCase. + * @since AppServer 92695 + */ + toCamelCase(): string; + /** + * Liefert den String mit dem ersten Buchstaben als Großbuchstaben. + * @since AppServer 92695 + */ + capitalize(): string; + /** + * Erstellt eine Kopie des String, in dem alle Vorkommnisse des String search in replacement + * ersetzt werden und liefert diesen zurück. + */ + replaceAll(search: string, replacement: string): string; + /** + * Erstellt eine Kopie des String, in dem alle Vorkommnisse des regulären Ausdrucks regexp in replacement + * ersetzt werden und liefert diesen zurück. + */ + replaceAll(regexp: RegExp, replacement: string): string; + /** + * Prüft primitiv, ob der String laut Knuddels-Filterregeln ok ist. + * @since ChatServer 82262, AppServer 82262 + */ + isOk(): boolean; +} + +/** + * Eine Instanz einer Toplist repräsentiert eine eigene Topliste für einen bestimmten userPersistenceNumberKey. + */ +declare class Toplist { + /** + * Liefert den userPersistenceNumberKey mit dem die Topliste erzeugt wurde. + */ + public getUserPersistenceNumberKey(): string; + /** + * Liefert den Anzeigenamen der Topliste. + */ + public getDisplayName(): string; + /** + * Liefert den Befehl, der im Chat eingegeben werden kann, um diese Topliste zu öffnen. + * Wird ein User oder eine userId übergeben, so öffnet sich die Topliste mit diesem Nutzer im Fokus. + */ + public getChatCommand(user_or_userId?: (User|number)): string; + /** + * Liefert den Anzeigenamen für den übergebenen User oder eine userId. + */ + public getLabel(user_or_userId: (User|number)): string; + /** + * Legt einen Change-Listener an, der jedes mal aufgerufen wird, wenn ein User + * einen neuen Anzeigenamen erhält. + */ + public addLabelChangeListener(listener: (labelChangeEvent: ToplistLabelChangeEvent) => void): void; + /** + * Löscht einen LabelChangeListener, der mit Toplist/addLabelChangeListener:method erzeugt wurde. + */ + public removeLabelChangeListener(listener: (labelChangeEvent: ToplistLabelChangeEvent) => void): void; + /** + * Legt einen Change-Listener an, der jedes mal aufgerufen wird, wenn ein sich der Rang User eines Nutzers ändert. + */ + public addRankChangeListener(listener: (rankChangeEvent: ToplistRankChangeEvent) => void): void; + /** + * Löscht einen RankChangeListener, der mit Toplist/addRankChangeListener:method erzeugt wurde. + */ + public removeRankChangeListener(listener: (rankChangeEvent: ToplistRankChangeEvent) => void): void; +} + +/** + * Mit einer Instanz von ToplistAccess kann eine App + * Toplist erzeugen und verwalten. + * + * Die Instanz für die ToplistAccess erhält man über das KnuddelsServer-Objekt + * mit KnuddelsServer.getToplistAccess() + */ +declare class ToplistAccess { + /** + * Liefert die Liste aller Toplisten, die diese App erzeugt hat. + */ + public getAllToplists(): Toplist[]; + /** + * Liefert die Toplist mit dem Persistenz-Key zurück. + */ + public getToplist(userPersistenceNumberKey: string): Toplist; + /** + * Löscht die übergebene Toplist oder die Toplist mit dem Persistenz-Key. + */ + public removeToplist(toplist: Toplist): void; + /** + * Erzeugt oder aktualisiert die Toplist für den übergebenen userPersistenceNumberKey. + */ + public createOrUpdateToplist(userPersistenceNumberKey: string, displayName: string, parameters?: { labelMapping?: { [minValue: string]: string }; ascending?: boolean; }): Toplist; +} + +/** + * ToplistDisplayType repräsentiert den Anzeigetyp eines Toplisteneintrags im Profil vonUsern. + */ +declare class ToplistDisplayType { + /** + * Nur Anzeigename anzeigen. + */ + public static readonly Label: ToplistDisplayType; + /** + * Gespeicherten Wert anzeigen. + */ + public static readonly Value: ToplistDisplayType; + /** + * Anzeigename und Rang anzeigen. + */ + public static readonly LabelAndRank: ToplistDisplayType; + /** + * Wert und Rang anzeigen. + */ + public static readonly ValueAndRank: ToplistDisplayType; +} + +/** + * ToplistLabelChangeEvents erhalten EventListener die bei einer + * Toplist mit der Methode Toplist/addLabelChangeListener:method + * erzeugt wurden, nachdem sich der Anzeigename für einen User geändert hat. + * + * Das ToplistLabelChangeEvent enthält alle wichtigen Daten, um auf die Änderung zu reagieren + * und dem User beispielsweise für den Aufstieg zu gratulieren. + */ +declare class ToplistLabelChangeEvent { + /** + * Liefert die zugehörige Toplist. + */ + public getToplist(): Toplist; + /** + * Liefert den vorherigen Anzeigenamen. Hatte der User vorher keinen + * Anzeigenamen, so ist dieser Wert null. + */ + public getOldLabel(): string; + /** + * Liefert den neuen Anzeigenamen. Hatte der User nun keinen + * Anzeigenamen mehr, so ist dieser Wert null. + */ + public getNewLabel(): string; + /** + * Liefert den User für den das Event ausgelöst wurde. + */ + public getUser(): User; + /** + * Liefert den Wert, der vor der Änderung gespeichert war. + */ + public getOldValue(): number; + /** + * Liefert den neuen Wert. + */ + public getNewValue(): number; +} + +/** + * ToplistRankChangeEvents erhalten EventListener die bei einer + * Toplist mit der Methode Toplist/addRankChangeListener:method + * erzeugt wurden, nachdem sich der Rang für einen User geändert hat. + * + * Das ToplistRankChangeEvent enthält alle wichtigen Daten, um auf die Änderung zu reagieren + * und den überholten Usern eine Nachricht zu senden. + */ +declare class ToplistRankChangeEvent { + /** + * Liefert die zugehörige Toplist. + */ + public getToplist(): Toplist; + /** + * Liefert den Toplisten-Rang, den der User vor der Änderung hatte. + */ + public getOldRank(): number; + /** + * Liefert den neuen Toplisten-Rang, des Users. + */ + public getNewRank(): number; + /** + * Liefert den User für den das Event ausgelöst wurde. + */ + public getUser(): User; + /** + * Liefert die User, die bei dieser Änderung überholt worden sind. + *

Achtung: Wenn mehr als 10 User + * überholt wurden, so liefert die Methode die besten 10 überholten User. + */ + public getUsersOvertook(): User[]; + /** + * Liefert den Wert, der vor der Änderung gespeichert war. + */ + public getOldValue(): number; + /** + * Liefert den neuen Wert. + */ + public getNewValue(): number; +} + +/** + * Ein User ist ein Nutzer des Chats, in dem die App läuft. + */ +declare class User { + /** + * Liefert die eindeutige Nutzerkennung des Nutzers. + */ + public getUserId(): number; + /** + * Liefert den Nicknamen des Nutzers. + */ + public getNick(): string; + /** + * Liefert das Alter des Nutzers. Bei Nutzern, die bereits sehr lange in der Plattform sind kann es vorkommen, dass kein Alter angegeben wurde. In diesem Fall ist das Alter 0. + */ + public getAge(): number; + /** + * Liefert das Geschlecht des Nutzers. + */ + public getGender(): Gender; + /** + * Liefert den Zeitpunkt der Registrierung des Nutzers. + */ + public getRegDate(): Date; + /** + * Liefert den UserStatus des Nutzers. + */ + public getUserStatus(): UserStatus; + /** + * Liefert den UserType des Nutzers. + */ + public getUserType(): UserType; + /** + * Liefert den aktuellen ClientType des Nutzers oder Offline wenn er nicht im Chat online ist. + */ + public getClientType(): ClientType; + /** + * Prüft ob der Client des Users den übergebenen AppViewMode (für User/sendAppContent:method) anzeigen kann. + */ + public canShowAppViewMode(mode: AppViewMode): boolean; + /** + * Prüft ob der Client des User's den übergebenen AppContent anzeigen kann. + */ + public canSendAppContent(appContent: AppContent): boolean; + /** + * Prüft, ob der User in dem angegebenen Team ist. + * Dies funktioniert derzeit nur für Teams, die eine eigene /fa haben. + * + * Achtung: Bei Nutzern, die neu in ein Team kommen, funktioniert die Abfrage erst dann korrekt, + * wenn er sich neu in den Channel eingeloggt hat. + */ + public isInTeam(teamName: string, subTeamName?: string): boolean; + /** + * Liefert ein UserPersistence-Objekt für diesen Nutzer. Mit diesem Objekt kann eine App sich Dinge über diesen speziellen Nutzer merken. + */ + public getPersistence(): UserPersistence; + /** + * Shortcut-Funktion um mit dem DefaultBotUser eine private Nachricht zu versenden. + */ + public sendPrivateMessage(message: string): void; + /** + * Shortcut-Funktion um mit dem DefaultBotUser eine /m zu versenden. + */ + public sendPostMessage(topic: string, text: string): void; + /** + * Liefert die Information, ob dieser Nutzer Channelbesitzer im Channel der App ist. + */ + public isChannelOwner(): boolean; + /** + * Liefert die Information, ob der Channel der App + * ein Lieblingschannel des Nutzers ist. + */ + public isLikingChannel(): boolean; + /** + * Liefert die Information, ob der Nutzer im harten Kern des Channels der App ist. + * @since AppServer 92701, ChatServer 92701 + */ + public isChannelCoreUser(): boolean; + /** + * Liefert die Information, ob dieser Nutzer ein AppManager für diese App ist. Die Channelbesitzer zählen automatisch auch als AppManager. + */ + public isAppManager(): boolean; + /** + * Liefert Information, ob dieser Nutzer derzeit für das Schreiben öffentlicher Nachrichten im Channel gesperrt ist. + */ + public isMuted(): boolean; + /** + * Liefert Information, ob dieser Nutzer beim Schreiben öffentlicher Nachrichten im Channel + * derzeit für die Verwendung von Textformatierungen, Farben und Smileys gesperrt ist. + */ + public isColorMuted(): boolean; + /** + * Liefert Information, ob dieser Nutzer derzeit für das Betreten des Channel gesperrt ist. + */ + public isLocked(): boolean; + /** + * Liefert Information, ob dieser Nutzer Channelmoderator im Channel der App ist. + */ + public isChannelModerator(): boolean; + /** + * Liefert Information, ob dieser Nutzer Eventmoderator im Channel der App ist. + */ + public isEventModerator(): boolean; + /** + * Liefert Information, ob dieser Nutzers der Entwickler der App ist. + */ + public isAppDeveloper(): boolean; + /** + * Liefert einen Link zum Profil des Nutzers, den man im Chat anzeigen kann. + */ + public getProfileLink(displayText?: string): string; + /** + * Liefert die Information, ob der Nutzer online im Channel der App ist. + */ + public isOnlineInChannel(): boolean; + /** + * Liefert die Anzahl der Knuddel, die der Nutzer besitzt. + */ + public getKnuddelAmount(): KnuddelAmount; + /** + * Liefert die Information, ob der Nutzer irgendwo im Chat online ist. + */ + public isOnline(): boolean; + /** + * Liefert die Readme des Nutzers, die er mit /readme TEXT in sein Profil gesetzt hat. + */ + public getReadme(): string; + /** + * Liefert die vom Nutzer verbrachte Zeit im gesamten Chatsystem In Minuten. + * Hinweis: Die Minutenzahl wird derzeit immer nur zu dem Zeitpunkt aktualisiert, + * wenn der Nutzer offline geht. + */ + public getOnlineMinutes(): number; + /** + * Liefert die Information, ob der Nutzer sich mittels /away-Funktion kurz abgemeldet hat. + */ + public isAway(): boolean; + /** + * Liefert die Information, ob der Nutzer ein Profilfoto hat. + */ + public hasProfilePhoto(): boolean; + /** + * (Er)setzt den übergebenen AppContent beim Nutzer. + */ + public sendAppContent(appContent: AppContent): AppContentSession; + /** + * Liefert alle AppContentSession, die der User + * aktuell geöffnet hat. + */ + public getAppContentSessions(): AppContentSession[]; + /** + * Liefert die AppContentSession, die der User + * mit einem bestimmten AppViewMode aktuell geöffnet hat. + */ + public getAppContentSession(appViewMode: AppViewMode): AppContentSession; + /** + * Vergleicht den übergebenen Nutzer und liefert true, falls der übergebene Nutzer + * identisch ist mit dem aktuellen Nutzer. + */ + public equals(user: User): boolean; + /** + * Liefert die URL zum Profilfoto des Nutzers. Die übergebene Breite und Höhe + * liefern dem Server einen Anhaltswert, um das bestmögliche Foto zu finden, + * sind aber keine Garantie, dass das Foto diese Ausmaße haben wird. + */ + public getProfilePhoto(width: number, height: number): string; + /** + * Liefert das QuestAccess-Objekt + * für diesen Nutzer in dieser App. + * @since AppServer 82290, ChatServer 82290 + */ + public getQuestAccess(): QuestAccess; + /** + * Liefert die Information, ob der Nutzer gerade sein Video streamt. + */ + public isStreamingVideo(): boolean; + /** + * Liefert den KnuddelAccount des Nutzers. + */ + public getKnuddelAccount(): KnuddelAccount; + /** + * Liefert die ChannelTalkPermission für diesen Nutzer in diesem + * Channel. + */ + public getChannelTalkPermission(): ChannelTalkPermission; + /** + * Liefert die Information, ob der User ein verifiziertes Profilbild hat. + */ + public isProfilePhotoVerified(): boolean; + /** + * Liefert die Information, ob das Alter des Users verifiziert ist. + */ + public isAgeVerified(): boolean; + /** + * Setzt dem Nutzer ein Icon in die Nickliste, das auf der rechten Seite seines Nicks angezeigt wird. + * Der Eintrag wird automatisch entfernt, sobald der Nutzer den Channel verlässt, + * kann aber auch mit User/removeNicklistIcon:method + * entfernt werden. + */ + public addNicklistIcon(imagePath: string, imageWidth: number): void; + /** + * Entfernt dem Nutzer ein über die API gesetztes Icon in die Nickliste. + */ + public removeNicklistIcon(imagePath: string): void; + /** + * Startet einen Würfelwurf für den Nutzer, falls er online im Channel ist und er nicht gemuted ist. + * @since AppServer 89159, ChatServer 89159 + */ + public triggerDice(diceConfiguration: DiceConfiguration): void; +} + +/** + * Mit einer Instanz von UserAccess kann eine App + * auf User zugreifen, die bereits einmal im Channel waren, + * als die App lief. Für alle nicht zugreifbaren User kann man via UserAccess den korrekt geschriebenen Nicknamen erhalten. + * + * Die Instanz für die UserAccess erhält man über das KnuddelsServer-Objekt + * mit KnuddelsServer.getUserAccess() + */ +declare class UserAccess { + /** + * Liefert die userId des Nutzers mit dem übergebenen Nicknamen. + */ + public getUserId(nick: string): number; + /** + * Informiert darüber, ob ein Nutzer mit dem übergebenen Nicknamen existiert. + */ + public exists(nick: string): boolean; + /** + * Informiert darüber, ob der Nutzer mit der übergebenen userId geladen werden darf. Neben dem AppDeveloper können nur Nutzer geladen werden, die sich einmal im Channel befanden, als die App + * lief. + */ + public mayAccess(userId: number): boolean; + /** + * Liefert den Nutzer mit der übergebenen userId. Neben dem AppDeveloper können nur Nutzer geladen werden, die sich einmal im Channel befanden, als die App lief. Es wird empfohlen vor der + * Abfrage von getUserById(userId) mit UserAccess/mayAccess:method abzufragen, ob dies funktionieren wird. + */ + public getUserById(userId: number): User; + /** + * Liefert den Nicknamen des Nutzers mit der übergebenen userId in der korrekten Schreibweise. + */ + public getNick(userId: number): string; + /** + * Loopt über alle zugreifbaren User sortiert nach Registrierzeitpunkt und + * führt für jeden User das übergebene Callback aus. + */ + public eachAccessibleUser(callback: (user: User, index: number, accessibleUserCount: number, key?: string) => boolean, parameters?: { onStart?: (accessibleUserCount: number, key?: string) => void; onEnd?: (accessibleUserCount: number, key?: string) => void; }): void; +} + +/** + * Für jeden User kann eine UserPersistence angefordert werden, um sich + * für einen bestimmten Nutzer Dinge persistent zu merken. + */ +declare class UserPersistence extends Persistence { + /** + * Löscht alle Zahlenwerte, die in dieser UserPersistence gespeichert sind. + * @since AppServer 88569 + */ + public deleteAllNumbers(): number; + /** + * Löscht alle Objekte, die in dieser UserPersistence gespeichert sind. + * @since AppServer 88569 + */ + public deleteAllObjects(): number; + /** + * Löscht alle Zeichenketten, die in dieser UserPersistence gespeichert sind. + * @since AppServer 88569 + */ + public deleteAllStrings(): number; + /** + * Löscht alle Daten, die in dieser UserPersistence gespeichert sind. + * @since AppServer 88569 + */ + public deleteAll(): number; +} + +/** + * Diese Klasse repräsentiert einen Eintrag der Persistenz. + */ +declare class UserPersistenceNumberEntry { + /** + * Liefert den Nutzer. + */ + public getUser(): User; + /** + * Liefert den Wert. + */ + public getValue(): number; + /** + * Liefert den Rang des Elements in der Persistenz. + */ + public getRank(): number; + /** + * Liefert die Position des Elements in der Persistenz. + */ + public getPosition(): number; +} + +/** + * Mit dieser Klasse ist es möglich nicht User-spezifische Abfragen auf die UserPersistence auszuführen. + */ +declare class UserPersistenceNumbers { + /** + * Liefert die Summe aller via UserPersistence gespeicherten Zahlen für den übergebenen key. + */ + public static getSum(key: string): number; + /** + * Löscht alle gespeicherten Zahlen-Werte für den übergebenen key. + */ + public static deleteAll(key: string): number; + /** + * Liefert die Anzahl aller unterschiedlichen Nutzer, die Werte für einen bestimmten key gespeichert haben. + * Hierbei kann optional der Wertebereich über die parameters eingegrenzt werden. + */ + public static getCount(key: string, parameters?: { minimumValue?: number; maximumValue?: number; }): number; + /** + * Ändert einen bestimmten key bei allen UserPersistence. + */ + public static updateKey(oldKeyName: string, newKeyName: string): number; + /** + * Ändert alle Werte für einen bestimmten key, die vorher einen bestimmten anderen Wert hatten in der UserPersistence. + *
Hinweis: Da diese Methode ein Batch-Update ist werden keine Change-Listener (ToplistRankChangeEvent, ToplistLabelChangeEvent) ausgelöst. + */ + public static updateValue(key: string, oldValue: number, newValue: number): number; + /** + * Addiert einen Wert für Einträge mit einem bestimmten key in der UserPersistence. + *
Hinweis: Da diese Methode ein Batch-Update ist werden keine Change-Listener (ToplistRankChangeEvent, ToplistLabelChangeEvent) ausgelöst. + */ + public static addNumber(key: string, value: number, parameters?: { minimumValue?: number; maximumValue?: number; targetUsers?: User[]; }): number; + /** + * Liefert ein Array mit UserPersistenceNumberEntry-Objekten für einen bestimmten key. + * Hierdurch kann beispielsweise eine blätterbare Topliste abgebildet werden. + */ + public static getSortedEntries(key: string, parameters?: { ascending?: boolean; count?: number; page?: number; minimumValue?: number; maximumValue?: number; }): UserPersistenceNumberEntry[]; + /** + * Liefert ein Array mit UserPersistenceNumberEntry-Objekten für einen bestimmten key. Hierbei werden die nähesten Elemente gewählt, + * die am übergebenen User/UserId liegen. + * + * Beispiel: Der Nutzer ist in der Liste auf Position 20, dann werden die Resultate von 14-24 bei einem Count von 10 ausgegeben. + * Beispiel: Der Nutzer ist in der Liste auf Position 3, dann werden die Resultate von 1-10 bei einem Count von 10 ausgegeben. + */ + public static getSortedEntriesAdjacent(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; count?: number; }): UserPersistenceNumberEntry[]; + /** + * Liefert die absolute Position des Nutzers in der Liste. Die Position ist im Gegensatz zum Rang immer eindeutig. + * + * Bei gleichem Wert hat der Nutzer die höhere Position, der zuerst einen Eintrag in der Persistenz hatte. + * + * Mit der Methode UserPersistenceNumbers/getRank:method kann man den Rang des Nutzers herausfinden. Dieser ist identisch, wenn + * unterschiedliche Nutzer denselben Wert haben. + */ + public static getPosition(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; minimumValue?: number; }): number; + /** + * Liefert den Rang des Nutzers. Der Rang ist nicht eindeutig. Bei gleicher Punktzahl haben Nutzer denselben Rang. + * Mit der Methode UserPersistenceNumbers/getPosition:method kann man die Position eindeutige Position, statt des Ranges herausfinden. + */ + public static getRank(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; minimumValue?: number; }): number; + /** + * Ruft eine Funktion für alle Nutzer auf, die einen bestimmten key in der UserPersistence gesetzt haben. + * Hierbei greifen die übergebenen Filter. + */ + public static each(key: string, callback: { user: User; value: number; index: number; totalCount: number; key: string; }, parameters?: { ascending?: boolean; minimumValue?: number; maximumValue?: number; maximumCount?: number; onStart?: (totalCount: number, key: string) => void; onEnd?: (totalCount: number, key: string) => void; }): void; + /** + * Liefert alle keys, die für User in der Persistence + * gespeichert wurden. + * @since AppServer 82483 + */ + public static getAllKeys(filterKey?: string): string[]; +} + +/** + * Mit dieser Klasse ist es möglich nicht User-spezifische Abfragen auf die UserPersistence auszuführen. + */ +declare class UserPersistenceObjects { + /** + * Löscht alle gespeicherten Objekte für den übergebenen key. + * @since AppServer 82478 + */ + public static deleteAll(key: string): number; + /** + * Liefert alle keys, die für User in der Persistence + * gespeichert wurden. + * @since AppServer 82483 + */ + public static getAllKeys(filterKey?: string): string[]; +} + +/** + * Mit dieser Klasse ist es möglich nicht User-spezifische Abfragen auf die UserPersistence auszuführen. + */ +declare class UserPersistenceStrings { + /** + * Liefert die Information, ob für einen bestimmten key und value bei einem beliebigen Nutzer eine Paarung existiert. + * @since AppServer 88571 + */ + public static exists(key: string, value: string, ignoreCase?: boolean): boolean; + /** + * Löscht alle gespeicherten Strings für den übergebenen key. + * @since AppServer 82478 + */ + public static deleteAll(key: string): number; + /** + * Liefert alle keys, die für User in der Persistence + * gespeichert wurden. + * @since AppServer 82483 + */ + public static getAllKeys(filterKey?: string): string[]; +} + +/** + * Repräsentiert den Status eines User. + */ +declare class UserStatus { + /** + * Liefert den numerischen Wert das UserStatus. + */ + public getNumericStatus(): number; + /** + * Liefert die Information ob der aktuelle UserStatus mindestens so hoch ist, wie der übergebene UserStatus. + */ + public isAtLeast(otherUserStatus: UserStatus): boolean; + /** + * + */ + public static readonly Newbie: UserStatus; + /** + * + */ + public static readonly Family: UserStatus; + /** + * + */ + public static readonly Stammi: UserStatus; + /** + * + */ + public static readonly HonoryMember: UserStatus; + /** + * + */ + public static readonly Admin: UserStatus; + /** + * + */ + public static readonly SystemBot: UserStatus; + /** + * + */ + public static readonly Sysadmin: UserStatus; +} + +/** + * Repräsentiert den Typ eines User. + */ +declare class UserType { + /** + * Bot der App. + */ + public static readonly AppBot: UserType; + /** + * Bot des Knuddels-Chatsystems. + */ + public static readonly SystemBot: UserType; + /** + * Menschlicher User. + */ + public static readonly Human: UserType; +} + +/** + * VideoChannelData hält Informationen zu laufenden Video-Streams im Channel bereit. + */ +declare class VideoChannelData { + /** + * Liefert alle User die im Channel derzeit ihr Video streamen. + */ + public getStreamingVideoUsers(): User[]; +} + diff --git a/knuddels-userapps-api/knuddels-userapps-api-tests.ts b/knuddels-userapps-api/knuddels-userapps-api-tests.ts new file mode 100644 index 0000000000..3caa0b7e1d --- /dev/null +++ b/knuddels-userapps-api/knuddels-userapps-api-tests.ts @@ -0,0 +1,122 @@ +/// + +class Server implements App { + + private usersPlaying: {[nick: string]: number} = {}; + private isShuttingDown: boolean = false; + + private htmlFile: HTMLFile = new HTMLFile('start.html'); + private appContent: AppContent = AppContent.overlayContent(this.htmlFile, 243, 266); + + onAppStart() { + KnuddelsServer.getChannel().getOnlineUsers(UserType.Human).forEach((user) => { + this.onUserJoined(user) + }); + }; + + onUserJoined(user: User) { + const botNick = KnuddelsServer.getDefaultBotUser().getNick().escapeKCode(); + user.sendPrivateMessage('Lust auf ne Runde Ziegenphobie? Mit nur _°BB>_h1 Knuddel|/appknuddel ' + botNick + '<°°°_ bist du dabei!'); + }; + + onUserLeft(user: User) { + if (this.usersPlaying[user.getNick()] == 1) { + KnuddelsServer.getDefaultBotUser().transferKnuddel(user, new KnuddelAmount(1), 'Du hast den Channel verlassen.'); + + delete this.usersPlaying[user.getNick()]; + } + }; + + onPrepareShutdown() { + if (!this.isShuttingDown) { + this.isShuttingDown = true; + + for (let key in this.usersPlaying) { + const userId = KnuddelsServer.getUserAccess().getUserId(key); + const user = KnuddelsServer.getUserAccess().getUserById(userId); + + KnuddelsServer.getDefaultBotUser().transferKnuddel(user, new KnuddelAmount(1), 'Die App fährt gleich herunter.'); + user.getAppContentSessions().forEach((session: AppContentSession) => { + session.remove(); + }); + + delete this.usersPlaying[key]; + } + } + } + + onBeforeKnuddelReceived(knuddelTransfer: KnuddelTransfer) { + const sender = knuddelTransfer.getSender(); + + if (!sender.canSendAppContent(this.appContent)) { + knuddelTransfer.reject('Sorry, mit diesem Gerät kannst du gerade nicht spielen.'); + } + else if (sender.isChannelOwner() && knuddelTransfer.getKnuddelAmount().asNumber() != 1) { + knuddelTransfer.accept(); + } + else if (this.isShuttingDown) { + knuddelTransfer.reject('Du App nimmt gerade keine neuen Spieler an.'); + } + else if (this.usersPlaying[sender.getNick()]) { + knuddelTransfer.reject('Du spielst bereits.'); + } + else if (knuddelTransfer.getKnuddelAmount().asNumber() != 1) { + const botNick = KnuddelsServer.getDefaultBotUser().getNick().escapeKCode(); + knuddelTransfer.reject('Du musst genau _°BB>_h1 Knuddel senden|/appknuddel ' + botNick + '<°°°_...'); + } + else { + knuddelTransfer.accept(); + } + }; + + onKnuddelReceived(user: User, receiver: User, knuddelAmount: KnuddelAmount) { + if (knuddelAmount.asNumber() == 1) { + this.usersPlaying[user.getNick()] = 1; + user.sendAppContent(this.appContent); + } + else { + user.sendPrivateMessage('Vielen Dank für die Einzahlung.'); + } + }; + + onEventReceived(user: User, key: string, data: string) { + if (key == 'selectedEntry' && this.usersPlaying[user.getNick()] == 1) { + this.usersPlaying[user.getNick()] = 2; + + setTimeout(() => { + + let doorNumber = parseInt(data[data.length - 1], 10); + + let winningDoorNumber = RandomOperations.nextInt(0, 2) + 1; + + let hasWon = winningDoorNumber == doorNumber; + + let text = hasWon ? 'Richtig getippt' : 'Knapp daneben'; + + user.getAppContentSession(AppViewMode.Overlay).getAppContent().sendEvent('openDoor', { + 'door': doorNumber, + 'winningDoor': winningDoorNumber, + 'text': text, + }); + + if (hasWon) { + KnuddelsServer.getDefaultBotUser().transferKnuddel(user, new KnuddelAmount(2), 'Richtig getippt...'); + } + + setTimeout(() => { + const botNick = KnuddelsServer.getDefaultBotUser().getNick().escapeKCode(); + user.sendPrivateMessage('Na, Lust auf _°BB>_hnoch eine Runde|/appknuddel ' + botNick + '<°°°_?'); + user.getAppContentSessions().forEach((session: AppContentSession) => { + session.remove(); + }); + delete this.usersPlaying[user.getNick()]; + }, 4000); + }, 1500); + } + }; + +} + +declare let App: Server;// tell the compiler that "App" will be available + +App = new Server(); diff --git a/knuddels-userapps-api/tsconfig.json b/knuddels-userapps-api/tsconfig.json new file mode 100644 index 0000000000..b75af9824f --- /dev/null +++ b/knuddels-userapps-api/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "module": "commonjs", + "noImplicitAny": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "knuddels-userapps-api-tests.ts" + ] +} \ No newline at end of file diff --git a/knuddels-userapps-api/tslint.json b/knuddels-userapps-api/tslint.json new file mode 100644 index 0000000000..657260c2ce --- /dev/null +++ b/knuddels-userapps-api/tslint.json @@ -0,0 +1,137 @@ +{ + "extends": ["tslint-react"], + "rules": { + "align": [ + true, + "statements" + ], + "array-type": [ + true, + "array" + ], + "ban": false, + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": true, + "eofline": true, + "forin": true, + "indent": [ + true, + "tabs" + ], + "interface-name": [ + false, + "always-prefix" + ], + "jsdoc-format": true, + "jsx-alignment": true, + "jsx-ban-props": true, + "jsx-curly-spacing": "never", + "jsx-no-multiline-js": true, + "jsx-no-string-ref": true, + "jsx-self-close": true, + "jsx-wrap-multiline": true, + "label-position": true, + "max-line-length": [true, 100], + "member-access": false, + "member-ordering": [ + true, + "static-before-instance", + "variables-before-functions" + ], + "no-any": false, + "no-arg": true, + "no-bitwise": false, + "no-conditional-assignment": false, + "no-consecutive-blank-lines": true, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-debugger": true, + "no-duplicate-variable": true, + "no-empty": false, + "no-eval": true, + "no-inferrable-types": true, + "no-internal-module": true, + "no-null-keyword": false, + "no-require-imports": false, + "no-shadowed-variable": false, + "no-string-literal": true, + "no-switch-case-fall-through": false, + "no-trailing-whitespace": true, + "no-unused-expression": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "no-var-requires": false, + "object-literal-key-quotes": [true, "consistent"], + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "ordered-imports": false, + "quotemark": [ + true, + "single", + "jsx-double", + "avoid-escape" + ], + "radix": true, + "semicolon": [true, "always"], + "switch-default": true, + "trailing-comma": false, + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef": [ + true, + "call-signature", + "arrow-call-signature", + "property-declaration" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ], + "variable-name": [ + true, + "check-format", + "allow-pascal-case", + "ban-keywords" + ], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ] + } +} \ No newline at end of file From 07d08800292e7e3ebd19c987117cf0cdf885bf5a Mon Sep 17 00:00:00 2001 From: Knuddels-TobyB Date: Tue, 7 Mar 2017 20:36:45 +0100 Subject: [PATCH 353/797] updated tsconfig to match requested configuration --- knuddels-userapps-api/tsconfig.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/knuddels-userapps-api/tsconfig.json b/knuddels-userapps-api/tsconfig.json index b75af9824f..21fec51518 100644 --- a/knuddels-userapps-api/tsconfig.json +++ b/knuddels-userapps-api/tsconfig.json @@ -1,7 +1,13 @@ { "compilerOptions": { "module": "commonjs", + "lib": [ + "es6", + "dom" + ], "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" From d9f8239a6e8b9825f6cdd33dc9c6eb96adf46d2e Mon Sep 17 00:00:00 2001 From: Knuddels-TobyB Date: Tue, 7 Mar 2017 20:48:50 +0100 Subject: [PATCH 354/797] added needed headers --- knuddels-userapps-api/index.d.ts | 1042 +++++++++++++++--------------- 1 file changed, 522 insertions(+), 520 deletions(-) diff --git a/knuddels-userapps-api/index.d.ts b/knuddels-userapps-api/index.d.ts index 82bafc0056..b6bebe1c0b 100644 --- a/knuddels-userapps-api/index.d.ts +++ b/knuddels-userapps-api/index.d.ts @@ -1,20 +1,22 @@ +// Type definitions for Knuddels UserApps API +// Project: https://developer.knuddels.de +// Definitions by: Knuddels GmbH & Co. KG +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + // JSON definition interface Json { [x: string]: string | number | boolean | Date | Json | JsonArray; } interface JsonArray extends Array { } - // serializable objects (for persistence) +type KnuddelsSerializable = string | number | boolean | User | BotUser; interface KnuddelsJson { [x: string]: string | number | boolean | Date | KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable; } interface KnuddelsJsonArray extends Array { } -type KnuddelsSerializable = string | number | boolean | User | BotUser; - // "data" that may be send between apps and between server and client type KnuddelsEvent = string | Json | KnuddelsEventArray; interface KnuddelsEventArray extends Array { } - /** * App ist die abstrakte Klasse einer konkreten App, die ein Entwickler schreiben kann. * Im eigenen Javascript-Code muss eine Variable mit dem Namen App vorhanden sein, damit eine App lauffähig ist. @@ -23,9 +25,9 @@ declare interface App { /** * Dieses Methode wird aufgerufen, sobald ein Nutzer versucht den Channel zu betreten. * Die App kann nun entscheiden, ob der Nutzer den Channel betreten darf. - * + * * Hinweis: Um ein responsives User Interface für den Nutzer, der den Channel betreten möchte zu garantieren, muss die App innerhalb von einer Sekunde auf diese Anfrage reagieren, damit ihre Antwort in das Ergebnis einfliesst. - * + * * Mit bestimmten Smileyfeatures ist es derzeit trotzdem möglich, den Channel zu betreten. * Diese Nutzer können nicht ausgesperrt werden: *
    @@ -35,36 +37,36 @@ declare interface App { *
  • Sysadmins
  • *
  • User Apps Team (Mitarbeiter von Knuddels)
  • *
- * + * * Ist der Channel mit einem Passwort geschützt und der Nutzer, der versucht den Channel zu betreten kennt das Passwort, * so kann er nicht aus dem Channel ausgeschlossen werden. */ - mayJoinChannel?(user: User): ChannelJoinPermission; + mayJoinChannel?(user: User): ChannelJoinPermission; /** * Diese Methode wird jedes Mal aufgerufen, sobald ein Nutzer versucht eine öffentliche Nachricht zu senden. * Die App kann nun entscheiden, ob die Nachricht veröffentlicht werden darf. - * + * * Laufen mehrere Apps im selben Channel, so wird die Nachricht veröffentlicht, sofern alle Apps es erlauben. - * + * * Dauert das Fragen aller Apps nach Erlaubnis länger als 10 Sekunden, so wird die Antwort genutzt, die bis dahin * gegeben wurde. */ - mayShowPublicMessage?(publicMessage: PublicMessage): boolean; + mayShowPublicMessage?(publicMessage: PublicMessage): boolean; /** * Diese Methode wird jedes Mal aufgerufen, sobald ein Nutzer versucht eine öffentliche Handlung auszuführen. * Die App kann nun entscheiden, ob die Handlung ausgeführt werden darf. - * + * * Laufen mehrere Apps im selben Channel, so wird die Handlung ausgeführt, sofern alle Apps es erlauben. - * + * * Dauert das Fragen aller Apps nach Erlaubnis länger als 10 Sekunden, so wird die Antwort genutzt, die bis dahin * gegeben wurde. */ - mayShowPublicActionMessage?(publicActionMessage: PublicActionMessage): boolean; + mayShowPublicActionMessage?(publicActionMessage: PublicActionMessage): boolean; /** * Diese Methode wird aufgerufen, sobald die App startet. * Dies ist der beste Zeipunkt um Werte zu initialisieren und aus der Persistenz zu lesen. */ - onAppStart?(): void; + onAppStart?(): void; /** * Diese Methode wird aufgerufen, wenn ein User Knuddel an den BotUser gesendet hat. * Es ist die Aufgabe der App in dieser Methode zu entscheiden, ob sie die Knuddel annimmt oder ablehnt. @@ -74,99 +76,99 @@ declare interface App { *
* Wichtig: Zum Zeitpunkt des Aufrufs dieser Methode wurden die Knuddel noch nicht an den BotUser übertragen. */ - onBeforeKnuddelReceived?(knuddelTransfer: KnuddelTransfer): void; + onBeforeKnuddelReceived?(knuddelTransfer: KnuddelTransfer): void; /** * Diese Methode wird aufgerufen, sobald ein BotUser Knuddel von einem User erhalten hat. */ - onKnuddelReceived?(sender: User, receiver: BotUser, knuddelAmount: KnuddelAmount, transferReason: string): void; + onKnuddelReceived?(sender: User, receiver: BotUser, knuddelAmount: KnuddelAmount, transferReason: string): void; /** * Diese Methode wird aufgerufen, wenn die App sich darauf vorbereiten soll heruntergefahren zu werden. * Als Parameter wird die geschätzte Zeit übergeben, die die App noch hat, bis sie heruntergefahren wird * und der Aufruf App/onShutdown:event folgt. - * + * * App/onPrepareShutdown:event kann dazu benutzt werden das Nutzererlebnis zu verbessern, * sofern eine App heruntergefahren werden muss (bsp. für Updates). * Eine Spiele-App könnte z.B. entscheiden, dass sie keine weiteren Spiele eröffnet und den Spielern offener Spiele * die Information anzeigt, wie lange das Spiel noch läuft, bevor es unentschieden endet. - * + * *

Achtung: Die Methode kann im Lebenszyklus einer App mehrfach aufgerufen werden. */ - onPrepareShutdown?(secondsTillShutdown: number): void; + onPrepareShutdown?(secondsTillShutdown: number): void; /** * Diese Methode wird aufgerufen, wenn ein BotUser privat angeschrieben wird. */ - onPrivateMessage?(privateMessage: PrivateMessage): void; + onPrivateMessage?(privateMessage: PrivateMessage): void; /** * Diese Methode wird aufgerufen, wenn im Channel der App * eine öffentliche Nachricht geschrieben wird. * Für Nachrichten von BotUsern wird diese Methode nicht aufgerufen. */ - onPublicMessage?(publicMessage: PublicMessage): void; + onPublicMessage?(publicMessage: PublicMessage): void; /** * Diese Methode wird aufgerufen, wenn im Channel der App * eine Event-Nachricht veröffentlicht wird. * Für Nachrichten von BotUsern wird diese Methode nicht aufgerufen. */ - onPublicEventMessage?(publicEventMessage: PublicEventMessage): void; + onPublicEventMessage?(publicEventMessage: PublicEventMessage): void; /** * Diese Methode wird aufgerufen, wenn im Channel der App * eine öffentliche Handlung durchgeführt wird. * Für Handlungen von BotUsern wird diese Methode nicht aufgerufen. */ - onPublicActionMessage?(publicActionMessage: PublicActionMessage): void; + onPublicActionMessage?(publicActionMessage: PublicActionMessage): void; /** * Diese Methode wird aufgerufen, wenn eine App beendet wird. * Sobald diese Methode aufgerufen wird, steht nur noch ein begrenzter Teil der API zur Verfügung. * Die App sollte den kompletten Zustand in der Persistenz speichern, sodass der Zustand * beim nächsten App/onAppStart:event wiederhergestellt werden kann. - * + * * Während des Shutdowns können asynchrone each-Methoden, wie UserPersistenceNumbers/each:method * und UserAccess/eachAccessibleUser:method nicht zuverlässig genutzt werden. */ - onShutdown?(): void; + onShutdown?(): void; /** * Diese Methode wird aufgerufen, wenn ein User im Channel der App * über die Systemfunktionen (/dice, /diceo) würfelt. * Die App kann auf das Ergebnis zugreifen und die Daten für die Auswertung und Entscheidungen nutzen. */ - onUserDiced?(diceEvent: DiceEvent): void; + onUserDiced?(diceEvent: DiceEvent): void; /** * Diese Methode wird aufgerufen, wenn ein User den Channel der App betritt. */ - onUserJoined?(user: User): void; + onUserJoined?(user: User): void; /** * Diese Methode wird aufgerufen, wenn ein User den Channel der App verlässt. */ - onUserLeft?(user: User): void; + onUserLeft?(user: User): void; /** * Diese Methode wird aufgerufen, wenn aus einer anderen App ein Event mit sendAppEvent versendet wurde. */ - onAppEventReceived?(appInstance: AppInstance, type: string, data: KnuddelsEvent): void; + onAppEventReceived?(appInstance: AppInstance, type: string, data: KnuddelsEvent): void; /** * Diese Methode wird aufgerufen, wenn aus dem HTML User Interface ein Event mit * sendEvent() gesendet wurde. */ - onEventReceived?(user: User, type: string, data: KnuddelsEvent, appContentSession: AppContentSession): void; + onEventReceived?(user: User, type: string, data: KnuddelsEvent, appContentSession: AppContentSession): void; /** * Diese Methode wird aufgerufen, wenn ein User Knuddel in seinen KnuddelAccount * eingezahlt hat. */ - onAccountReceivedKnuddel?(sender: User, receiver: BotUser, knuddelAmount: KnuddelAmount, transferReason: string, knuddelAccount: KnuddelAccount): void; + onAccountReceivedKnuddel?(sender: User, receiver: BotUser, knuddelAmount: KnuddelAmount, transferReason: string, knuddelAccount: KnuddelAccount): void; /** * Diese Methode wird aufgerufen, wenn sich die Anzahl der Knuddel auf einem KnuddelAccount eines User * geändert hat. */ - onAccountChangedKnuddelAmount?(user: User, knuddelAccount: KnuddelAccount, oldKnuddelAmount: KnuddelAmount, newKnuddelAmount: KnuddelAmount): void; + onAccountChangedKnuddelAmount?(user: User, knuddelAccount: KnuddelAccount, oldKnuddelAmount: KnuddelAmount, newKnuddelAmount: KnuddelAmount): void; /** * Ermöglicht das Registrieren eigener Chatbefehle. * In einem Channel kann nur eine App laufen, die einen bestimmten Chatbefehl nutzt. * Versucht eine zweite App einen Chatbefehl zu registrieren, den eine andere * App bereits nutzt, so wird ein Fehler geloggt und die App startet nicht bzw. fährt herunter. - * + * * Die Struktur eines registrierten Chatbefehls ist: * commandName: function (user, params, command) {} - * - * + * + * *
    *
  • commandName ist der Name der Funktion, wie sie aufgerufen wird (beispielsweise /commandname)
  • *
  • user ist der Nutzer, der die Funktion aufgerufen hat
  • @@ -174,12 +176,12 @@ declare interface App { *
  • command ist der Name des Befehl selbst (beispielsweise commandName)
  • *
*/ - chatCommands?: { [commandName:string]: (user:User, params:string, command:string) => void }; + chatCommands?: { [commandName:string]: (user:User, params:string, command:string) => void }; } /** * Ermöglicht Zugriff auf Informationen zu Apps und Events zwischeneinander. - * + * * Die Instanz von AppAccess erhält man über den KnuddelsServer * mit KnuddelsServer.getAppAccess() */ @@ -187,17 +189,17 @@ declare class AppAccess { /** * Liefert die Instanz der eigenen App. */ - public getOwnInstance(): AppInstance; + public getOwnInstance(): AppInstance; /** * Liefert die Instanzen aller anderen Apps, die gerade in diesem Channel laufen. * @since AppServer 82904 */ - public getAllRunningAppsInChannel(includeSelf?: boolean): AppInstance[]; + public getAllRunningAppsInChannel(includeSelf?: boolean): AppInstance[]; /** * Liefert die Instanzen aller anderen Apps, die gerade in diesem Channel laufen. * @since AppServer 82904 */ - public getRunningAppInChannel(appId: string): (AppInstance|null); + public getRunningAppInChannel(appId: string): (AppInstance|null); } /** @@ -207,73 +209,73 @@ declare class AppContent { /** * Liefert den AppViewMode. */ - public getAppViewMode(): AppViewMode; + public getAppViewMode(): AppViewMode; /** * Liefert das HTMLFile, das beim Anlegen des AppContents * genutzt wurde. */ - public getHTMLFile(): HTMLFile; + public getHTMLFile(): HTMLFile; /** * Liefert die Breite des AppContent. */ - public getWidth(): number; + public getWidth(): number; /** * Liefert die Höhe des AppContent. */ - public getHeight(): number; + public getHeight(): number; /** * Liefert die LoadConfiguration, mit der die Optik beim Laden des HTML User Interface beeinflusst werden kann. */ - public getLoadConfiguration(): LoadConfiguration; + public getLoadConfiguration(): LoadConfiguration; /** * Liefert einen AppContent, der das HTMLFile als Overlay oben rechts im Channel anzeigt. */ - public static overlayContent(htmlFile: HTMLFile, width: number, height: number): AppContent; + public static overlayContent(htmlFile: HTMLFile, width: number, height: number): AppContent; /** * Liefert einen AppContent, der das HTMLFile als Overlay (200x350) oben rechts im Channel anzeigt. */ - public static overlayContent(htmlFile: HTMLFile): AppContent; + public static overlayContent(htmlFile: HTMLFile): AppContent; /** * Liefert einen AppContent, der das HTMLFile im Applet/HTML-Chat * als Popup (300x400) und auf Android als Fullscreen-View anzeigt. */ - public static popupContent(htmlFile: HTMLFile): AppContent; + public static popupContent(htmlFile: HTMLFile): AppContent; /** * Liefert einen AppContent, der das HTMLFile im Applet/HTML-Chat * als Popup und auf Android als Fullscreen-View anzeigt. */ - public static popupContent(htmlFile: HTMLFile, width: number, height: number): AppContent; + public static popupContent(htmlFile: HTMLFile, width: number, height: number): AppContent; /** * Sendet Daten an alle Nutzer, die diesen AppContent geöffnet haben. */ - public sendEvent(type: string, data?: KnuddelsEvent): void; + public sendEvent(type: string, data?: KnuddelsEvent): void; /** * Liefert eine Liste aller User, die diesen AppContent * geöffnet haben. */ - public getUsers(): User[]; + public getUsers(): User[]; /** * Liefert eine Liste aller AppContentSessions, die dieses AppContent, * die User gerade geöffnet haben. */ - public getSessions(): AppContentSession[]; + public getSessions(): AppContentSession[]; /** * Ersetzt den AppContent, bei allen Usern, die diesen AppContent * geöffnet haben durch den neuen AppContent. - * + * *

Hinweis: Es können nur AppContent mit demselben AppViewMode * zum Ersetzen genutzt werden. */ - public replaceWithAppContent(newAppContent: AppContent): void; + public replaceWithAppContent(newAppContent: AppContent): void; /** * Entfernt diesen AppContent, bei allen Usern, die diesen AppContent * geöffnet haben. */ - public remove(): void; + public remove(): void; /** * Fügt einen Listener hinzu, der aufgerufen wird, wenn jemand den AppContent schließt. */ - public addCloseListener(callback: { user: User; appContent: AppContent; }): void; + public addCloseListener(callback: { user: User; appContent: AppContent; }): void; } /** @@ -283,23 +285,23 @@ declare class AppContentSession { /** * Sendet Daten an den verbundenen Client. */ - public sendEvent(type: string, data?: KnuddelsEvent): void; + public sendEvent(type: string, data?: KnuddelsEvent): void; /** * Liefert den AppViewMode. */ - public getAppViewMode(): AppViewMode; + public getAppViewMode(): AppViewMode; /** * Entfernt die AppContentSession beim verbundenen User. */ - public remove(): void; + public remove(): void; /** * Liefert den User. */ - public getUser(): User; + public getUser(): User; /** * Liefert den verbundenen AppContent. */ - public getAppContent(): AppContent; + public getAppContent(): AppContent; } /** @@ -312,23 +314,23 @@ declare class AppInfo { * Diese ist für jede Sub-Channel Instanz der App unterschiedlich. * Wenn RootAppUid == AppUid dann ist dies die Root-App-Instanz. */ - public getAppUid(): number; + public getAppUid(): number; /** * Liefert die RootAppUid. * Diese ist für jede Sub-Channel Instanz der App gleich. * Wenn RootAppUid == AppUid dann ist dies die Root-App-Instanz. - * + * * Sie wird für den Link für Auszahlungen aus einem Knuddel-Account benötigt: /knuddelaccount payout:<RootAppUid>:<BETRAG> */ - public getRootAppUid(): number; + public getRootAppUid(): number; /** * Liefert den in der Konfiguration eingestellten Namen der App. */ - public getAppName(): string; + public getAppName(): string; /** * Liefert die Version der App, die in der Konfiguration eingestellt wurde. */ - public getAppVersion(): string; + public getAppVersion(): string; /** * Liefert die eindeutige Id der App. * Die appId setzt sich zusammen aus @@ -338,44 +340,44 @@ declare class AppInfo { *
  • Ordnername der App -> appKey
  • * */ - public getAppId(): string; + public getAppId(): string; /** * Liefert den eindeutigen Key der App. * Der appKey ist der Ordnername, in dem die App liegt. */ - public getAppKey(): string; + public getAppKey(): string; /** * Liefert den Entwickler der App, falls die serverId knuddelsDE oder knuddelsDEV ist, ansonsten null. */ - public getAppDeveloper(): User; + public getAppDeveloper(): User; /** * Liefert die Liste der AppManager für diese App. Die Channelbesitzer zählen automatisch auch als AppManager. */ - public getAppManagers(): User[]; + public getAppManagers(): User[]; /** - * Liefert den Steuersatz, der bei Auszahlung bereits genutzer Knuddel von einem + * Liefert den Steuersatz, der bei Auszahlung bereits genutzer Knuddel von einem * KnuddelAccount an einen User * anfällt. Die anfallenden Steuern werden bei Auszahlung vom BotUser * abgezogen. */ - public getTaxRate(): number; + public getTaxRate(): number; /** * Liefert den KnuddelAmount, der an Steuern anfallen würde, * wenn alle User jetzt all ihre Knuddel aus ihrem * KnuddelAccount abheben würden. */ - public getTotalTaxKnuddelAmount(): KnuddelAmount; + public getTotalTaxKnuddelAmount(): KnuddelAmount; /** * Liefert den KnuddelAmount, der jetzt noch vom * BotUser an KnuddelAccounts * übertragen werden kann, so dass für alle Knuddel noch die Steuern bezahlt werden können. */ - public getMaxPayoutKnuddelAmount(): KnuddelAmount; + public getMaxPayoutKnuddelAmount(): KnuddelAmount; } /** * Repräsentiert die Instanz einer App. - * + * * Die eigene Instanz von AppInstance erhält man über das AppAccess-Objekt * mit appAccess.getOwnInstance() */ @@ -383,36 +385,36 @@ declare class AppInstance { /** * Liefert die AppInfo. */ - public getAppInfo(): AppInfo; + public getAppInfo(): AppInfo; /** * Sendet ein App-Event an diese App-Instanz. */ - public sendAppEvent(type: string, data: KnuddelsEvent): void; + public sendAppEvent(type: string, data: KnuddelsEvent): void; /** * Informiert, ob die aktuelle AppInstanz eine Root-Instanz ist. */ - public isRootInstance(): boolean; + public isRootInstance(): boolean; /** * Liefert die Root-Instanz der aktuellen App-Instanz. */ - public getRootInstance(): RootAppInstance; + public getRootInstance(): RootAppInstance; /** * Liefert alle App-Instanzen dieser App in diesem Channel und Subchannels. * Mit includeSelf = false kann man die eigene Instanz ausschließen. */ - public getAllInstances(includeSelf?: boolean): AppInstance[]; + public getAllInstances(includeSelf?: boolean): AppInstance[]; /** * Liefert den Startzeitpunkt dieser AppInstance. */ - public getStartDate(): Date; + public getStartDate(): Date; /** * Liefert die Namen der ChatCommands, die diese AppInstnce derzeit registriert hat. */ - public getRegisteredChatCommandNames(): (string[]|null); + public getRegisteredChatCommandNames(): (string[]|null); /** * Liefert den Namen des Channels in dem diese AppInstance läuft. */ - public getChannelName(): string; + public getChannelName(): string; } /** @@ -430,24 +432,24 @@ declare class AppProfileEntry { /** * Liefert den key für den die Topliste, die den Profileintrag erzeugt angelegt wurde. */ - public getKey(): string; + public getKey(): string; /** * Liefert den getDisplayType */ - public getDisplayType(): ToplistDisplayType; + public getDisplayType(): ToplistDisplayType; /** * Liefert das Toplist-Objekt. */ - public getToplist(): Toplist; + public getToplist(): Toplist; } /** * Mit einer Instanz von AppProfileEntryAccess kann eine App * AppProfileEntry-Objekte (Profileinträge) erzeugen und verwalten. - * + * * Die Instanz für die AppProfileEntryAccess erhält man über das KnuddelsServer-Objekt * mit KnuddelsServer.getAppProfileEntryAccess() - * + * *

    Achtung: Derzeit darf eine App bis zu fünf AppProfileEntries haben. *

    Achtung: Profileinträge werden nur dann angezeigt, wenn der Channel sichtbar ist. */ @@ -455,27 +457,27 @@ declare class AppProfileEntryAccess { /** * Liefert die Liste aller AppProfileEntry-Objekte, die diese App erzeugt hat. */ - public getAllProfileEntries(): AppProfileEntry[]; + public getAllProfileEntries(): AppProfileEntry[]; /** * Liefert den AppProfileEntry für den übergebenen userPersistenceNumberKey. */ - public getAppProfileEntry(userPersistenceNumberKey: string): AppProfileEntry; + public getAppProfileEntry(userPersistenceNumberKey: string): AppProfileEntry; /** * Erzeugt oder aktualisiert ein AppProfileEntry anhand der übergebenen Toplist * und dem ToplistDisplayType und liefert den AppProfileEntry im Anschluss zurück. - * + * * Profileinträge, die erzeugt werden, sind nur sichtbar, solange die App läuft und werden im Profil ausgeblendet, sofern die App aus ist. */ - public createOrUpdateEntry(toplist: Toplist, toplistDisplayType: ToplistDisplayType): AppProfileEntry; + public createOrUpdateEntry(toplist: Toplist, toplistDisplayType: ToplistDisplayType): AppProfileEntry; /** * Löscht den übergebenen AppProfileEntry. */ - public removeEntry(appProfileEntry: AppProfileEntry): void; + public removeEntry(appProfileEntry: AppProfileEntry): void; } /** * Liefert Informationen über einen AppServer. - * + * * Die Instanz von AppServerInfo erhält man über den KnuddelsServer * mit KnuddelsServer.getAppServerInfo() */ @@ -487,18 +489,18 @@ declare class AppServerInfo extends ServerInfo { */ declare class AppViewMode { /** - * + * */ - public static readonly Overlay: AppViewMode; + public static readonly Overlay: AppViewMode; /** * Zum Öffnen eines Popups durch das HTML User Interface */ - public static readonly Popup: AppViewMode; + public static readonly Popup: AppViewMode; } /** * Ein BotUser repräsentiert einen Nutzer, der für die App als Nutzer im Channel interagieren kann. - * + * * Die Instanz für den Standard-BotUser erhält man über das KnuddelsServer-Objekt * mit KnuddelsServer.getDefaultBotUser() */ @@ -506,20 +508,20 @@ declare class BotUser extends User { /** * Sendet eine öffentliche Nachricht in den Channel. */ - public sendPublicMessage(message: string): void; + public sendPublicMessage(message: string): void; /** * Sendet eine öffentliche Handlung in den Channel. * Dies funktioniert so, als ob der BotUser /me TEXT im Chat eingeben würde. */ - public sendPublicActionMessage(actionMessage: string): void; + public sendPublicActionMessage(actionMessage: string): void; /** * Sendet eine private Nachricht an bestimmte Nutzer. */ - public sendPrivateMessage(message: string, users?: User[]): void; + public sendPrivateMessage(message: string, users?: User[]): void; /** * Sendet eine persistente Nachricht an einen bestimmten Nutzer. */ - public sendPostMessage(topic: string, text: string, receivingUser?: User): void; + public sendPostMessage(topic: string, text: string, receivingUser?: User): void; /** * Transferiert eine bestimmte Anzahl Knuddel an einen Zielnutzer oder KnuddelAccount.

    * Wichtiger Hinweis: Sollte die App versuchen mehr Knuddel zu transferieren, @@ -529,12 +531,12 @@ declare class BotUser extends User { * Hat ein Channelbesitzer eine gewisse Menge Schulden angesammelt, so schalten wir alle Apps in diesem Channel ab. *
    Es können nur Knuddel transferiert werden zu Nutzern mit UserType.Human. */ - public transferKnuddel(receivingUserOrAccount: (User|KnuddelAccount), knuddelAmount: KnuddelAmount, parameters?: { displayReasonText?: string; transferDisplayType?: KnuddelTransferDisplayType; onSuccess?: () => void; onError?: (message: string) => void; }): void; + public transferKnuddel(receivingUserOrAccount: (User|KnuddelAccount), knuddelAmount: KnuddelAmount, parameters?: { displayReasonText?: string; transferDisplayType?: KnuddelTransferDisplayType; onSuccess?: () => void; onError?: (message: string) => void; }): void; } /** * Ein Channel ist ein Raum in dem die App läuft. - * + * * Die Instanz für den Channel erhält man über das KnuddelsServer-Objekt * mit KnuddelsServer.getChannel() */ @@ -542,55 +544,55 @@ declare class Channel { /** * Gibt Zugriff auf das ChannelConfiguration-Objekt des Channels. */ - public getChannelConfiguration(): ChannelConfiguration; + public getChannelConfiguration(): ChannelConfiguration; /** * Gibt Zugriff auf das ChannelRestrictions-Objekt des Channels. */ - public getChannelRestrictions(): ChannelRestrictions; + public getChannelRestrictions(): ChannelRestrictions; /** * Gibt Zugriff auf das ChannelDesign-Objekt des Channels. * @since AppServer 87470, ChatServer 87470 */ - public getChannelDesign(): ChannelDesign; + public getChannelDesign(): ChannelDesign; /** * Gibt Zugriff auf Nutzer, die gerade im Channel online sind. */ - public getOnlineUsers(...userType: UserType[]): User[]; + public getOnlineUsers(...userType: UserType[]): User[]; /** * Liefert die Information, ob in diesem Channel Videos gestreamt werden können. */ - public isVideoChannel(): boolean; + public isVideoChannel(): boolean; /** * Liefert die VideoChannelData des Channels. */ - public getVideoChannelData(): VideoChannelData; + public getVideoChannelData(): VideoChannelData; /** * Liefert den Namen des Channels. */ - public getChannelName(): string; + public getChannelName(): string; /** * Liefert den Namen des Root-Channels (nur relevant, falls die App Tochterchannel haben kann). */ - public getRootChannelName(): string; + public getRootChannelName(): string; /** * Liefert den ChannelTalkMode, in dem sich der Channel gerade befindet. */ - public getTalkMode(): ChannelTalkMode; + public getTalkMode(): ChannelTalkMode; /** * Liefert alle User, die bestimmte ChannelTalkPermissions haben. */ - public getAllUsersWithTalkPermission(...channelTalkPermission: ChannelTalkPermission[]): User[]; + public getAllUsersWithTalkPermission(...channelTalkPermission: ChannelTalkPermission[]): User[]; /** * Liefert die Information, ob der Channel sichtbar (true) oder unsichtbar (false) ist. * @since AppServer 82202 */ - public isVisible(): boolean; + public isVisible(): boolean; } /** * Eine ChannelConfiguration erlaubt Zugriff auf verschiedene Details * der Konfiguration des Channels, in dem die App läuft. - * + * * Die Instanz für die ChannelConfiguration erhält man über das Channel-Objekt * mit channel.getChannelConfiguration() */ @@ -598,11 +600,11 @@ declare class ChannelConfiguration { /** * Liefert das ChannelRights-Objekt des Channels. */ - public getChannelRights(): ChannelRights; + public getChannelRights(): ChannelRights; /** * Liefert das ChannelInformation-Objekt des Channels. */ - public getChannelInformation(): ChannelInformation; + public getChannelInformation(): ChannelInformation; } /** @@ -614,17 +616,17 @@ declare class ChannelDesign { * Liefert die eingestellte Standard-Schriftgröße des Channels. * @since AppServer 87470, ChatServer 87470 */ - public getDefaultFontSize(): number; + public getDefaultFontSize(): number; /** * Liefert die eingestellte Standard-Schriftfarbe des Channels. * @since AppServer 87470, ChatServer 87470 */ - public getDefaultFontColor(): Color; + public getDefaultFontColor(): Color; /** * Liefert die eingestellte Hintergrundfarbe des Channels. * @since AppServer 87470, ChatServer 87470 */ - public getBackgroundColor(): Color; + public getBackgroundColor(): Color; } /** @@ -634,19 +636,19 @@ declare class ChannelInformation { /** * Liefert das eingestellte Thema des Channels. */ - public getTopic(): string; + public getTopic(): string; /** * Aktualisiert das Thema das Channels. */ - public setTopic(topic: string, showMessage: boolean): void; + public setTopic(topic: string, showMessage: boolean): void; } /** * Eine Instanz der Klasse ChannelJoinPermission wird als Rückgabewert * der Methode App.mayJoinChannel(user) benötigt. - * + * * Hiermit wird bestimmt, ob der anfragende Nutzer den Channel betreten darf. - * + * * Erlauben mit ChannelJoinPermission.accepted() * Verbieten mit ChannelJoinPermission.denied(denyReason) */ @@ -654,16 +656,16 @@ declare class ChannelJoinPermission { /** * Erzeugt ein ChannelJoinPermission-Objekt, das den Zugriff in den Channel erlaubt. */ - public static accepted(): ChannelJoinPermission; + public static accepted(): ChannelJoinPermission; /** * Erzeugt ein ChannelJoinPermission-Objekt, das den Zugriff in den Channel verbietet. */ - public static denied(denyReason: string): ChannelJoinPermission; + public static denied(denyReason: string): ChannelJoinPermission; } /** * Eine Instanz von ChannelRestrictions ermöglicht es, aktuelle Informationen über Nutzungsbeschränkungen im Channel zu erhalten. - * + * * Die Instanz für die ChannelRestrictions erhält man über das Channel-Objekt * mit channel.getChannelRestrictions() */ @@ -671,16 +673,16 @@ declare class ChannelRestrictions { /** * Liefert alle User die im Channel derzeit für das Schreiben öffentlicher Nachrichten gesperrt sind. */ - public getMutedUsers(): User[]; + public getMutedUsers(): User[]; /** * Liefert alle User die im Channel derzeit für das Nutzen * von Farben, Textformatierung und Smileys in öffentlichen Nachrichten gesperrt sind. */ - public getColorMutedUsers(): User[]; + public getColorMutedUsers(): User[]; /** * Liefert alle User die für das Betreten des Channel derzeit gesperrt sind. */ - public getLockedUsers(): User[]; + public getLockedUsers(): User[]; } /** @@ -691,20 +693,20 @@ declare class ChannelRights { /** * Liefert die Liste aller Channelbesitzer. In öffentlichen Channels sind dies alle hauptzuständigen betreuenden Mitglieder. (HZA/HZE) */ - public getChannelOwners(): User[]; + public getChannelOwners(): User[]; /** * Liefert die Liste aller Channel-Moderatoren. */ - public getChannelModerators(): User[]; + public getChannelModerators(): User[]; /** * Liefert die Liste aller Event-Moderatoren. */ - public getEventModerators(): User[]; + public getEventModerators(): User[]; } /** * ChannelTalkMode repräsentiert das den Gesprächsmodus im Channel. - * + * * Die Instanz für die ChannelTalkMode erhält man über das Channel-Objekt * mit channel.getTalkMode() */ @@ -712,16 +714,16 @@ declare class ChannelTalkMode { /** * Jeder darf gerade im Channel schreiben. */ - public static readonly Everyone: ChannelTalkMode; + public static readonly Everyone: ChannelTalkMode; /** * Nur Personen, die besondere Rederechte haben dürfen gerade im Channel schreiben. */ - public static readonly OnlyWithTalkPermission: ChannelTalkMode; + public static readonly OnlyWithTalkPermission: ChannelTalkMode; /** * Nur Personen, die besondere Rederechte haben dürfen gerade im Channel schreiben. * Die Nachrichten aller anderen Nutzer werden gefiltert und ggf. von den Moderatoren zugelassen. */ - public static readonly FilteredByModerators: ChannelTalkMode; + public static readonly FilteredByModerators: ChannelTalkMode; } /** @@ -733,39 +735,39 @@ declare class ChannelTalkPermission { * Der User ist gerade nicht im Channel, * daher ist die ChannelTalkPermission nicht bekannnt. */ - public static readonly NotInChannel: ChannelTalkPermission; + public static readonly NotInChannel: ChannelTalkPermission; /** * Der User hat keine speziellen Rederechte. * Beim ChannelTalkMode Default können diese User * Nachrichten verfassen: */ - public static readonly Default: ChannelTalkPermission; + public static readonly Default: ChannelTalkPermission; /** * Der User kann eine öffentliche Nachricht verfassen. Danach wechselt die * ChannelTalkPermission automatisch auf Default. */ - public static readonly TalkOnce: ChannelTalkPermission; + public static readonly TalkOnce: ChannelTalkPermission; /** * Der User kann permanent öffentliche Nachrichten verfassen. */ - public static readonly TalkPermanent: ChannelTalkPermission; + public static readonly TalkPermanent: ChannelTalkPermission; /** * Der User ist VIP und kann öffentliche Nachrichten verfassen, * die farbig und groß dargestellt werden. */ - public static readonly VIP: ChannelTalkPermission; + public static readonly VIP: ChannelTalkPermission; /** * Der User ist VIP und kann öffentliche Nachrichten verfassen, * die farbig und groß dargestellt werden. Moderatoren haben zudem weitere Möglichkeiten, die in der * Anleitung zum Moderationssystem * nachgelesen werden können. */ - public static readonly Moderator: ChannelTalkPermission; + public static readonly Moderator: ChannelTalkPermission; } /** * Liefert Informationen über einen ChatServer. - * + * * Die Instanz von ChatServerInfo erhält man über den KnuddelsServer * mit KnuddelsServer.getChatServerInfo() */ @@ -773,7 +775,7 @@ declare class ChatServerInfo extends ServerInfo { /** * Liefert die Information, ob dieser Chat-Server ein Test-System ist. */ - public isTestSystem(): boolean; + public isTestSystem(): boolean; } /** @@ -783,81 +785,81 @@ declare class Client { /** * Schließt das HTML User Interface. */ - public static close(): void; + public static close(): void; /** * Sendet ein Event zum Server, das mit dem AppHook onEventReceived in der App * abgefangen werden kann. */ - public static sendEvent(type: string, data: KnuddelsEvent): void; + public static sendEvent(type: string, data: KnuddelsEvent): void; /** * Sagt dem Chatserver, dass dieser Befehl für den Nutzer, der das HTML User Interface sieht, ausgeführt werden soll. * Ist der Befehl auf einer Whitelist vom Server, so wird er sofort ausgeführt. Im anderen Falle sieht der Nutzer einen * Link zum Bestätigen, mit dem er die Aktion starten kann. - * + * * Derzeit sind diese Befehle auf der Whitelist: w, info, wc, top, h, dice, d, diceo, w2, serverpp, knuddelaccount, * /tf-insert, /tf-inserts, /tf-insertb, /tf-insertsb, /tf-override, /tf-overrides, /tf-overrideb, /tf-overridesb, /autotype */ - public static executeSlashCommand(command: string): void; + public static executeSlashCommand(command: string): void; /** * Bindet eine Javascript-Datei ein und sorgt dafür, dass immer die aktuellste Version vom Server geladen wird. */ - public static includeJS(...files: string[]): void; + public static includeJS(...files: string[]): void; /** * Registriert sich für ein bestimmtes Event, das vom Server mittels User/sendEvent:method oder vom Client via Client/dispatchEvent:method verschickt wurde. */ - public static addEventListener(type: string, callback: (event: {type: string, data: KnuddelsEvent}) => void): void; + public static addEventListener(type: string, callback: (event: {type: string, data: KnuddelsEvent}) => void): void; /** * Sendet ein bestimmtes Event, so dass alle mit Client/addEventListener:method registrierten Listener aufgerufen werden. */ - public static dispatchEvent(event: Client.Event): void; + public static dispatchEvent(event: Client.Event): void; /** * Entfernt alle Event-Listener für einen bestimmten Event-Typ. */ - public static removeEventListener(type: string): void; + public static removeEventListener(type: string): void; /** * Bindet eine CSS-Datei ein und sorgt dafür, dass immer die aktuellste Version vom Server geladen wird. */ - public static includeCSS(...files: string[]): void; + public static includeCSS(...files: string[]): void; /** * Spielt einen Sound ab. Der angegebene Dateiname kann hierbei entweder absolut oder relativ zur angezeigten HTML-Datei sein. * Bisher können nur Dateien mit Wave-Format zuverlässig abgespielt werden. */ - public static playSound(fileName: string): void; + public static playSound(fileName: string): void; /** * Lädt einen Sound herunter, damit die Datei später ohne Wartezeit abgespielt werden kann. * (Android only) * Der angegebene Dateiname kann hierbei entweder absolut oder relativ zur angezeigten HTML-Datei sein. */ - public static prefetchSound(fileName: string): void; + public static prefetchSound(fileName: string): void; /** * Gibt einen Sound wieder frei, der in nächster Zeit vom Client nicht mehr gebraucht wird. * (Android only) * Der angegebene Dateiname kann hierbei entweder absolut oder relativ zur angezeigten HTML-Datei sein. */ - public static freeSound(fileName: string): void; + public static freeSound(fileName: string): void; /** * Liefert den HostFrame des aktuellen Inhalts. */ - public static getHostFrame(): Client.HostFrame; + public static getHostFrame(): Client.HostFrame; /** * Liefert den Nicknamen des Users, der gerade dieses HTML User Interface angezeigt bekommt. */ - public static getNick(): string; + public static getNick(): string; /** * Liefert den aktuellen ClientType des Nutzers, der gerade dieses HTML User Interface angezeigt bekommt. */ - public static getClientType(): ClientType; + public static getClientType(): ClientType; /** * Liefert die Id, die beim Laden von Skripten und Stylesheets an die URL angehängt wird, um sicherzustellen, dass eine neue Version * der Datei vom Server geholt wird, statt die Datei aus dem Cache zu laden. - * + * * Diese Id kann beim Einbinden eigener Ressourcen zum selben Zweck genutzt werden. */ - public static getCacheInvalidationId(): string; + public static getCacheInvalidationId(): string; /** * Beinhaltet die JSON-Daten, die beim Erstellen des HTMLFile übergeben wurden. */ - public static pageData: Json; + public static pageData: Json; } /** @@ -868,27 +870,27 @@ declare module Client { /** * Erzeugt ein Color-Objekt mit RGB-Werten. */ - public static fromRGB(red: number, green: number, blue: number): Color; + public static fromRGB(red: number, green: number, blue: number): Color; /** * Erzeugt ein Color-Objekt aus einem HexString. */ - public static fromHexString(colorString: string): Color; + public static fromHexString(colorString: string): Color; /** * Liefert den Rot-Anteil der Farbe als Zahl zwischen 0 und 255. */ - public getRed(): number; + public getRed(): number; /** * Liefert den Grün-Anteil der Farbe als Zahl zwischen 0 und 255. */ - public getGreen(): number; + public getGreen(): number; /** * Liefert den Blau-Anteil der Farbe als Zahl zwischen 0 und 255. */ - public getBlue(): number; + public getBlue(): number; /** * Liefert die Farbe als in CSS nutzbaren HexString. */ - public asHexString(): string; + public asHexString(): string; } } @@ -900,7 +902,7 @@ declare module Client { /** * Erzeugt ein Event. */ - public constructor(type: string, data: KnuddelsEvent); + public constructor(type: string, data: KnuddelsEvent); } } @@ -912,38 +914,38 @@ declare module Client { /** * Setzt den Titel der Seite im gezoomten Modus (nur Android). */ - public setTitle(newTitle: string): void; + public setTitle(newTitle: string): void; /** * Ändert die sichtbare Hintergrundfarbe des Hostframes animiert. (Android-only) */ - public setBackgroundColor(newColor: Color, durationMillis?: number): void; + public setBackgroundColor(newColor: Color, durationMillis?: number): void; /** * Setzt die Icons, die als Fenster-Icon angezeigt werden sollen. (Applet-only, nur mit AppViewMode.Popup) * Die Bilder müssen von groß nach klein sortiert sein. Die größeren Bilder werden (je nach System) automatisch dann eingesetzt, * wenn größere Bilder benötigt werden (z.B. in der Task-Leiste, oder beim Alt+Tab Fenster-Wechsel). * @since Applet: 9.0bwj, AppServer: 84904 */ - public setIcons(...path: string[]): void; + public setIcons(...path: string[]): void; /** * Setzt, ob das Fenster resizable ist. (Applet-only, nur mit AppViewMode.Popup) */ - public setResizable(resizable: boolean): void; + public setResizable(resizable: boolean): void; /** * Bringt das Fenster der App (App-Popup bzw. Chat-Fenster) in den Vordergrund. (Applet-only) * @since Applet: 9.0bwj, AppServer: 84904 */ - public focus(): void; + public focus(): void; /** * Ändert die Größe des App-Fensters (AppViewMode.Popup) bzw. App-Overlays (AppViewMode.Overlay). * @since Applet: 9.0bwj, AppServer: 84516 */ - public setSize(width: number, height: number): void; + public setSize(width: number, height: number): void; } } /** * ClientType repräsentiert die Art der Chat-Verbindung des Users. - * + * * Eine Instanz von ClientType erhält man über das User-Objekt * mit user.getClientType() */ @@ -951,23 +953,23 @@ declare class ClientType { /** * Der User ist mit dem Java Applet im Chat. */ - public static readonly Applet: ClientType; + public static readonly Applet: ClientType; /** * Der User ist mit dem Browser im Chat (Mini-Chat, HTML-Chat). */ - public static readonly Browser: ClientType; + public static readonly Browser: ClientType; /** * Der User ist mit der Android-App im Chat. */ - public static readonly Android: ClientType; + public static readonly Android: ClientType; /** * Der User ist mit der iOS-App im Chat. */ - public static readonly IOS: ClientType; + public static readonly IOS: ClientType; /** * Der User ist nicht im Chat. */ - public static readonly Offline: ClientType; + public static readonly Offline: ClientType; } /** @@ -978,39 +980,39 @@ declare class Color { * Erzeugt ein serverseitiges Color-Objekt mit RGB-Werten. * Als Alpha-Wert wird automatisch 255 genutzt. */ - public static fromRGB(red: number, green: number, blue: number): Color; + public static fromRGB(red: number, green: number, blue: number): Color; /** * Erzeugt ein serverseitiges Color-Objekt mit RGBA-Werten. */ - public static fromRGBA(red: number, green: number, blue: number, alpha: number): Color; + public static fromRGBA(red: number, green: number, blue: number, alpha: number): Color; /** * Liefert den Alpha-Wert der Farbe als Zahl zwischen 0 und 255. */ - public getAlpha(): number; + public getAlpha(): number; /** * Liefert den Blau-Anteil der Farbe als Zahl zwischen 0 und 255. */ - public getBlue(): number; + public getBlue(): number; /** * Liefert den Grün-Anteil der Farbe als Zahl zwischen 0 und 255. */ - public getGreen(): number; + public getGreen(): number; /** * Liefert den Rot-Anteil der Farbe als Zahl zwischen 0 und 255. */ - public getRed(): number; + public getRed(): number; /** * Liefert die Farbe als KCode zurück. */ - public toKCode(): string; + public toKCode(): string; /** * Liefert die numerische Repräsentation der Farbe zurück. */ - public asNumber(): number; + public asNumber(): number; /** * Erzeugt ein serverseitiges Color-Objekt aus der numerischen Repräsentation einer Farbe. */ - public static fromNumber(value: number): Color; + public static fromNumber(value: number): Color; } /** @@ -1020,15 +1022,15 @@ declare class Dice { /** * Erzeugt ein Dice-Objekt mit der übergebenen Anzahl Würfel und Augenzahl. */ - public constructor(count: number /* optional */, value: number); + public constructor(count: number /* optional */, value: number); /** * Liefert die Anzahl der Würfel. */ - public getAmount(): number; + public getAmount(): number; /** * Liefert die Anzahl der Seiten der Würfel. */ - public getNumberOfSides(): number; + public getNumberOfSides(): number; } /** @@ -1042,30 +1044,30 @@ declare class DiceConfiguration { * Offene Würfelwürfe sind speziell. Falls die Augenzahl des Würfels die Maximalsumme zeigt, * so wird noch einmal gewürfelt und die neue Zahl dazu addiert, solange bis der Würfel * nicht mehr die Maximalsumme zeigt. - * + * * Beispiel: /diceo 1w4 -> 4 -> 4 -> 3 = 11 */ - public isUsingOpenThrow(): boolean; + public isUsingOpenThrow(): boolean; /** * Informiert darüber, ob die Würfel privat geworfen worden sind. * Würfelwürfe zählen als privat, wenn am Ende des Würfelbefehls ein Ausrufezeichen steht. * Beispiel: /dice 10w2! */ - public isUsingPrivateThrow(): boolean; + public isUsingPrivateThrow(): boolean; /** * Liefert ein Array mit Würfeln, mit denen gewürfelt wurde. */ - public getDices(): Dice[]; + public getDices(): Dice[]; /** * Vergleicht, ob zwei Konfigurationen inhaltlich identisch sind */ - public equals(diceConfiguration: DiceConfiguration): boolean; + public equals(diceConfiguration: DiceConfiguration): boolean; /** * Liefert den Befehl, der im Chat eingegeben werden kann, um einen Wurf auszuführen, * der zur DiceConfiguration passt. * @since AppServer 82248 */ - public getChatCommand(): string; + public getChatCommand(): string; } /** @@ -1076,32 +1078,32 @@ declare class DiceConfigurationFactory { /** * Fügt der Konfiguration einen Würfel hinzu. */ - public addDice(dice: Dice): void; + public addDice(dice: Dice): void; /** * Liefert die Anzahl der Würfel, die zur Konfiguration gehören. */ - public computeCurrentDiceCount(): number; + public computeCurrentDiceCount(): number; /** * Setzt die Information, ob ein offener Wurf oder ein normaler Wurf stattfinden soll. * Offene Würfelwürfe sind speziell. Falls die Augenzahl des Würfels die Maximalsumme zeigt, * so wird noch einmal gewürfelt und die neue Zahl dazu addiert, solange bis der Würfel * nicht mehr die Maximalsumme zeigt. - * + * * Beispiel: /diceo 1w4 -> 4 -> 4 -> 3 = 11 */ - public setUseOpenThrow(shouldUseOpenThrow: boolean): void; + public setUseOpenThrow(shouldUseOpenThrow: boolean): void; /** * Setzt die Information, ob der Würfelwurf privat stattfinden soll. */ - public setShouldUsePrivateThrow(shouldUsePrivateThrow: boolean): void; + public setShouldUsePrivateThrow(shouldUsePrivateThrow: boolean): void; /** * Liefert die erzeugte Würfelkonfiguration. */ - public getDiceConfiguration(): DiceConfiguration; + public getDiceConfiguration(): DiceConfiguration; /** * Erzeugt eine Würfelkonfiguration. */ - public static fromString(diceConfigurationString: string): DiceConfiguration; + public static fromString(diceConfigurationString: string): DiceConfiguration; } /** @@ -1112,11 +1114,11 @@ declare class DiceEvent { /** * Liefert den Nutzer, der gewürfelt hat. */ - public getUser(): User; + public getUser(): User; /** * Liefert das DiceResult des Würfelwurfs. */ - public getDiceResult(): DiceResult; + public getDiceResult(): DiceResult; } /** @@ -1126,15 +1128,15 @@ declare class DiceResult { /** * Liefert die Konfiguration mit der gewürfelt wurde. */ - public getDiceConfiguration(): DiceConfiguration; + public getDiceConfiguration(): DiceConfiguration; /** * Liefert ein Array mit Details zu den einzelnen Ergebnissen pro Würfeltyp. */ - public getSingleDiceResults(): SingleDiceResult[]; + public getSingleDiceResults(): SingleDiceResult[]; /** * Liefert die Summe der Augenzahlen aller Würfel */ - public totalSum(): number; + public totalSum(): number; } /** @@ -1144,7 +1146,7 @@ declare class Domain { /** * Liefert ein den Domain-Namen der aktuellen Domain. */ - public getDomainName(): string; + public getDomainName(): string; } /** @@ -1155,51 +1157,51 @@ declare class ExternalServerAccess { /** * Liefert eine Liste aller zugreifbaren Domains */ - public getAllAccessibleDomains(): Domain[]; + public getAllAccessibleDomains(): Domain[]; /** * Prüft den Zugriff auf eine bestimmte URL. Wird je Kombination von "Protokoll + Host + Port" geprüft.
    * Beispiel: http://www.example.de:8080 */ - public canAccessURL(urlString: string): boolean; + public canAccessURL(urlString: string): boolean; /** * Macht einen GET-Request auf die übergebene URL und liefert den Inhalt zurück. * Diese Methode ist eine Convenience-Methode für externalServerAccess.callURL(). */ - public getURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; }): void; + public getURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; }): void; /** * Macht einen POST-Request auf die übergebene URL und liefert den Inhalt zurück. * Diese Methode ist eine Convenience-Methode für externalServerAccess.callURL(). */ - public postURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; data?: Json; }): void; + public postURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; data?: Json; }): void; /** * Macht einen GET-Request auf die übergebene URL. Im Gegensatz zum GET-Request wird der Inhalt der Webseite wird nicht ausgelesen. * Aus diesem Grund ist diese Methode schneller. * Diese Methode ist eine Convenience-Methode für externalServerAccess.callURL(). */ - public touchURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; }): void; + public touchURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; }): void; /** * Macht einen Request auf die übergebene URL. */ - public callURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; method?: ("GET" | "POST"); data?: Json; }): void; + public callURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; method?: ("GET" | "POST"); data?: Json; }): void; } /** - * Die Instanz von ExternalServerResponse erhält in den onSuccess- und onFailure-Callbacks der Methoden von + * Die Instanz von ExternalServerResponse erhält in den onSuccess- und onFailure-Callbacks der Methoden von * ExternalServerAccess. Es enthält alle notwendigen Daten zum Verarbeiten. */ declare class ExternalServerResponse { /** * Liefert die abgefragte URL. */ - public getURLString(): string; + public getURLString(): string; /** * Liefert den HTTP-Statuscode der Seite. */ - public getResponseCode(): number; + public getResponseCode(): number; /** * Liefert ein Objekt, das die Headerdaten der Antwort enthält. */ - public getHeaderFields(): { [key: string]: string[] }; + public getHeaderFields(): { [key: string]: string[] }; } /** @@ -1209,15 +1211,15 @@ declare class Gender { /** * Das Geschlecht ist männlich. */ - public static readonly Male: Gender; + public static readonly Male: Gender; /** * Das Geschlecht ist weiblich. */ - public static readonly Female: Gender; + public static readonly Female: Gender; /** * Das Geschlecht ist nicht bekannt. */ - public static readonly Unknown: Gender; + public static readonly Unknown: Gender; } /** @@ -1225,17 +1227,17 @@ declare class Gender { */ declare class HTMLFile { /** - * + * */ - public constructor(assetPath: string, pageData?: Json); + public constructor(assetPath: string, pageData?: Json); /** * Liefert den Pfad, der beim Anlegen der HTMLFile-Instanz genutzt wurde. */ - public getAssetPath(): string; + public getAssetPath(): string; /** * Liefert die pageData, die beim Anlegen der HTMLFile-Instanz genutzt wurden. */ - public getPageData(): Json; + public getPageData(): Json; } /** @@ -1247,48 +1249,48 @@ declare class KnuddelAccount { * Liefert den KnuddelAmount eines Users, * über den die App gerade frei verfügen kann. */ - public getKnuddelAmount(): KnuddelAmount; + public getKnuddelAmount(): KnuddelAmount; /** * Liefert den KnuddelAmount aus dem KnuddelAccount, * der bereits von der App genutzt wurde. * Beim Auszahlen dieser Knuddel aus dem KnuddelAccount an den * User fallen Steuern an. */ - public getKnuddelAmountUsed(): KnuddelAmount; + public getKnuddelAmountUsed(): KnuddelAmount; /** * Liefert den KnuddelAmount aus dem KnuddelAccount, * der noch nicht von der App genutzt wurde. * Beim Auszahlen dieser Knuddel aus dem KnuddelAccount an den * User fallen keine Steuern an. */ - public getKnuddelAmountUnused(): KnuddelAmount; + public getKnuddelAmountUnused(): KnuddelAmount; /** * Liefert die Summe aller Transfers, die die App an diesen KnuddelAccount bzw. User überwiesen hat. */ - public getTotalKnuddelAmountAppToUser(): KnuddelAmount; + public getTotalKnuddelAmountAppToUser(): KnuddelAmount; /** * Liefert die Summe aller Transfers, die die App von diesem KnuddelAccount bzw. User abgebucht/erhalten hat. */ - public getTotalKnuddelAmountUserToApp(): KnuddelAmount; + public getTotalKnuddelAmountUserToApp(): KnuddelAmount; /** * Liefert die Information, ob in diesem Moment genug Knuddel verfügbar sind. */ - public hasEnough(knuddelAmount: KnuddelAmount): boolean; + public hasEnough(knuddelAmount: KnuddelAmount): boolean; /** * Liefert den Nutzer, dem der KnuddelAccount gehört. */ - public getUser(): User; + public getUser(): User; /** * Versucht eine bestimmte Menge Knuddel zu verwenden. Dies ist nur möglich, wenn der User auf seinem KnuddelAccount * genug Knuddel besitzt und online im Channel ist. * Vom KnuddelAccount des Besitzer des Channel können Knuddel auch abgebucht werden, wenn dieser nicht im Channel online ist. - * + * * Ist das Event App.onBeforeKnuddelReceived implementiert, so wird diese direkt nach dem use aufgerufen, * um zu entscheiden, ob die Knuddel angenommen werden sollen. - * + * *

    Hinweis: Knuddel an einen Nutzer senden kannst du mit der Methode BotUser/transferKnuddel:method. */ - public use(knuddelAmount: KnuddelAmount, displayReasonText: string, parameters?: { transferReason?: string; onError?: (message: string) => void; onSuccess?: () => void; }): void; + public use(knuddelAmount: KnuddelAmount, displayReasonText: string, parameters?: { transferReason?: string; onError?: (message: string) => void; onSuccess?: () => void; }): void; } /** @@ -1298,97 +1300,97 @@ declare class KnuddelAmount { /** * Erzeugt eine Instanz von KnuddelAmount mit der Anzahl Knuddel. */ - public constructor(knuddel: number); + public constructor(knuddel: number); /** * Erzeugt eine Instanz von KnuddelAmount mit einer bestimmten Cent-Anzahl. */ - public static fromCents(knuddel: number): KnuddelAmount; + public static fromCents(knuddel: number): KnuddelAmount; /** * Erzeugt eine Instanz von KnuddelAmount mit einer bestimmten Knuddel-Anzahl. */ - public static fromKnuddel(knuddel: number): KnuddelAmount; + public static fromKnuddel(knuddel: number): KnuddelAmount; /** * Liefert die Anzahl der Knuddel in KnuddelCent zurück. */ - public getKnuddelCents(): number; + public getKnuddelCents(): number; /** * Gibt den Wert der Knuddel als Zahl zurück. */ - public asNumber(): number; + public asNumber(): number; /** * Liefert eine negierte Kopie des KnuddelAmount zurück. */ - public negate(): KnuddelAmount; + public negate(): KnuddelAmount; /** * Liefert die Information, ob der Knuddelwert unter 0 ist. */ - public isNegative(): boolean; + public isNegative(): boolean; } /** * Repräsentiert einen KnuddelPot. - * Ein KnuddelPot kann nur durch Factory-Methoden des KnuddelsServer erzeugt werden: + * Ein KnuddelPot kann nur durch Factory-Methoden des KnuddelsServer erzeugt werden: * KnuddelsServer/createKnuddelPot:method. - * + * * Wird die App heruntergefahren, so werden alle KnuddelPots, die nicht gesealt sind automatisch refunded. */ declare class KnuddelPot { /** * Liefert die id des KnuddelPot. */ - public getId(): number; + public getId(): number; /** * Liefert den Status des KnuddelPot. */ - public getState(): KnuddelPotState; + public getState(): KnuddelPotState; /** * Liefert den beim Kreieren des KnuddelPots festgelegten KnuddelAmount, den jeder Teilnehmer zahlen muss. */ - public getKnuddelAmountPerParticipant(): KnuddelAmount; + public getKnuddelAmountPerParticipant(): KnuddelAmount; /** * Liefert den KnuddelAmount, der bisher insgesamt in den KnuddelPot eingezahlt wurde. */ - public getKnuddelAmountTotal(): KnuddelAmount; + public getKnuddelAmountTotal(): KnuddelAmount; /** * Liefert die Liste der Teilnehmer, die bisher in den KnuddelPot eingezahlt haben. */ - public getParticipants(): User[]; + public getParticipants(): User[]; /** * Liefert den höchsten Multiplikator, der gültig ist. */ - public getMaxFeeMultiplier(): number; + public getMaxFeeMultiplier(): number; /** * Setzt den BotUser, der den Anteil der Einzahlungen nach dem Spiel erhält * und den Anteil, vom Gesamtpot, den er erhalten soll. */ - public setFee(feeUser: BotUser, feeMultiplier: number): void; + public setFee(feeUser: BotUser, feeMultiplier: number): void; /** * Liefert den mit KnuddelPot/setFee:method gesetzten BotUser an den die Gebühr ausbezahlt wird. */ - public getFeeUser(): User; + public getFeeUser(): User; /** * Liefert den mit KnuddelPot/setFee:method gesetzten Multiplikator der Gebühr. */ - public getFeeMultiplier(): number; + public getFeeMultiplier(): number; /** * Versiegelt den KnuddelPot, sodass keine weiteren Einzahlungen vorgenommen * werden können und Gewinne ausgeschüttet werden können. */ - public seal(): void; + public seal(): void; /** * Bezahlt alle Einsätze an die Teilnehmer zurück und informiert mit dem übergeben Text über den Grund. */ - public refund(reason?: string): void; + public refund(reason?: string): void; /** * Fügt einen Gewinner in die Liste der Gewinner hinzu. * Der zweite Parameter ist die Gewichtung mit der ausgezahlt werden soll. * Wird der Parameter weggelassen, so ist er automatisch 1. */ - public addWinner(user: User, weight?: number): void; + public addWinner(user: User, weight?: number): void; /** * Zahlt den KnuddelPot an die mit addWinner gesetzten Gewinner aus. */ - public payout(text?: string): void; + public payout(text?: string): void; } /** @@ -1398,21 +1400,21 @@ declare class KnuddelPotState { /** * Der KnuddelPot ist geöffnet und kann neue Teilnehmer annehmen. */ - public static readonly Open: KnuddelPotState; + public static readonly Open: KnuddelPotState; /** * Der KnuddelPot ist versiegelt und kann keine neuen Teilnehmer annehmen. */ - public static readonly Sealed: KnuddelPotState; + public static readonly Sealed: KnuddelPotState; /** * Der KnuddelPot ist beendet und die Knuddel bereits ausgezahlt. */ - public static readonly Closed: KnuddelPotState; + public static readonly Closed: KnuddelPotState; } /** * Ein KnuddelTransfer ist ein Container-Objekt für die Daten, die bei einer Knuddel-Transaktion von einem User * an eine App anfallen. - * + * * Implementiert man den App-Hook onBeforeKnuddelReceived, so kann man dort entscheiden, ob man den KnuddelTransfer * annimmt oder ablehnt. */ @@ -1420,71 +1422,71 @@ declare class KnuddelTransfer { /** * Liefert den User, der den KnuddelTransfer ausgelöst hat. */ - public getSender(): User; + public getSender(): User; /** * Liefert den BotUser, der die Knuddel des KnuddelTransfer erhält, * wenn dieser mit accept() angenommen wurde. */ - public getReceiver(): BotUser; + public getReceiver(): BotUser; /** * Liefert die Anzahl der Knuddel, die mit diesem Transfer überwiesen werden. */ - public getKnuddelAmount(): KnuddelAmount; + public getKnuddelAmount(): KnuddelAmount; /** * Liefert den Grund für den Transfer, der bei der Überweisung angegeben wurde mit * /appknuddel BOTNICK:KNUDDEL:GRUND. */ - public getTransferReason(): string; + public getTransferReason(): string; /** * Lehnt die Knuddel aus dem KnuddelTransfer ab und sendet sie zurück an den Absender. * Als Grund sieht der Absender den übergebenen reason. - * + * * Diese Methode wirft eine Exception, wenn sie auf einen bereits verarbeiteten Transfer aufgerufen wird. * Sie kann nur erfolgreich aus dem AppHook onBeforeKnuddelReceived aufgerufen werden. - * + * * In der Methode onBeforeKnuddelReceived kann genau ein Aufruf einer dieser drei Methoden gemacht werden: * KnuddelTransfer/accept:method, * KnuddelTransfer/addToPot:method, * KnuddelTransfer/reject:method */ - public reject(reason: string): void; + public reject(reason: string): void; /** * Nimmt die Knuddel aus dem KnuddelTransfer an und übergibt sie an den BotUser, * der mit getReceiver() abgefragt werden kann. - * + * * Diese Methode wirft eine Exception, wenn sie auf einen bereits verarbeiteten Transfer aufgerufen wird. * Sie kann nur erfolgreich aus dem AppHook onBeforeKnuddelReceived aufgerufen werden. * In der Methode onBeforeKnuddelReceived kann genau ein Aufruf einer dieser drei Methoden gemacht werden: - * + * * KnuddelTransfer/accept:method, * KnuddelTransfer/addToPot:method, * KnuddelTransfer/reject:method */ - public accept(): void; + public accept(): void; /** * Liefert die Information, ob ein bestimmter KnuddelTransfer zu einem KnuddelPot hinzugefügt werden kann. */ - public canAddToPot(pot: KnuddelPot): boolean; + public canAddToPot(pot: KnuddelPot): boolean; /** * Nimmt die Knuddel aus dem KnuddelTransfer an und übergibt sie an den übergebenen KnuddelPot. - * + * * Diese Methode funktioniert analog zu KnuddelTransfer/accept:method, nur dass die Knuddel im KnuddelPot statt beim BotUser landen. - * + * * Diese Methode wirft eine Exception, wenn sie auf einen bereits verarbeiteten Transfer aufgerufen wird. * Sie kann nur erfolgreich aus dem AppHook onBeforeKnuddelReceived aufgerufen werden. - * + * * In der Methode onBeforeKnuddelReceived kann genau ein Aufruf einer dieser drei Methoden gemacht werden: * KnuddelTransfer/accept:method, * KnuddelTransfer/addToPot:method, * KnuddelTransfer/reject:method */ - public addToPot(knuddelPot: KnuddelPot): void; + public addToPot(knuddelPot: KnuddelPot): void; /** * Liefert die Information, ob der KnuddelTransfer bereits verarbeitet wurde. * Falls die Methode false zurückliefert muss noch entschieden werden, ob der * KnuddelTransfer angenommen oder abgelehnt wird. */ - public isProcessed(): boolean; + public isProcessed(): boolean; } /** @@ -1494,15 +1496,15 @@ declare class KnuddelTransferDisplayType { /** * Nachricht wird öffentlich angezeigt. */ - public static readonly Public: KnuddelTransferDisplayType; + public static readonly Public: KnuddelTransferDisplayType; /** * Nachricht wird privat angezeigt. */ - public static readonly Private: KnuddelTransferDisplayType; + public static readonly Private: KnuddelTransferDisplayType; /** * Nachricht wird als /m zugestellt. */ - public static readonly Post: KnuddelTransferDisplayType; + public static readonly Post: KnuddelTransferDisplayType; } /** @@ -1513,82 +1515,82 @@ declare class KnuddelsServer { /** * Liefert den BotUser, der standardmäßig zur App gehört. */ - public static getDefaultBotUser(): BotUser; + public static getDefaultBotUser(): BotUser; /** * Liefert die AppPersistence, mit der sich Zahlen, Strings und Javascript-Objekte langfristig und über die Session einer App hinaus gespeichert werden können. */ - public static getPersistence(): AppPersistence; + public static getPersistence(): AppPersistence; /** * Liefert den Channel in dem die App läuft. */ - public static getChannel(): Channel; + public static getChannel(): Channel; /** * Liefert das UserAccess-Objekt, über das * User zugreifbar werden. */ - public static getUserAccess(): UserAccess; + public static getUserAccess(): UserAccess; /** * Liefert ein ExternalServerAccess-Objekt, mit dem * andere Server angesteuert werden können. */ - public getExternalServerAccess(): ExternalServerAccess; + public getExternalServerAccess(): ExternalServerAccess; /** * Aktualisiert die Liste der genutzten Hooks. Werden zur Laufzeit chatCommands oder App-Hooks (wie mayJoinChannel) dynamisch erzeugt oder gelöscht, so muss danach refreshHooks() * aufgerufen werden, damit diese Änderung wirksam wird. */ - public static refreshHooks(): void; + public static refreshHooks(): void; /** * Liefert den Standard-Logger für diese App. Alles, was geloggt wird, wird vom Nutzer "App-Logs" als private Nachricht zugestellt. */ - public static getDefaultLogger(): Logger; + public static getDefaultLogger(): Logger; /** * Liefert den Pfad eines Bildes zur Integration in der eigenen App. * Alle Bilder, die im Ordner /www in der App abgelegt werden können hier referenziert werden. */ - public static getFullImagePath(imageName: string): string; + public static getFullImagePath(imageName: string): string; /** * Liefert den Pfad eines Systembildes zur Integration in der eigenen App. * Alle Bilder, die unter http://apps4.knuddels.biz/kimg/ * erreichbar sind können hier referenziert werden. */ - public static getFullSystemImagePath(imageName: string): string; + public static getFullSystemImagePath(imageName: string): string; /** * Liefert die Informationen über den ChatServer auf dem die App läuft. */ - public static getChatServerInfo(): ChatServerInfo; + public static getChatServerInfo(): ChatServerInfo; /** * Liefert die Informationen über den AppServer auf dem die App läuft. */ - public static getAppServerInfo(): AppServerInfo; + public static getAppServerInfo(): AppServerInfo; /** * Liefert das AppAccess-Object. */ - public static getAppAccess(): AppAccess; + public static getAppAccess(): AppAccess; /** * Erzeugt einen KnuddelPot. - * + * * Ist ein KnuddelPot 30 Minuten nach dem Erzeugen noch nicht gesealt, * so wird vom Server automatisch ein KnuddelPot/refund:method ausgelöst. */ - public static createKnuddelPot(knuddelAmount: KnuddelAmount, params?: { payoutTimeoutMinutes?: number; shouldSealPot?: (pot: KnuddelPot) => boolean; onPotSealed?: (pot: KnuddelPot) => void; }): KnuddelPot; + public static createKnuddelPot(knuddelAmount: KnuddelAmount, params?: { payoutTimeoutMinutes?: number; shouldSealPot?: (pot: KnuddelPot) => boolean; onPotSealed?: (pot: KnuddelPot) => void; }): KnuddelPot; /** * Liefert den KnuddelPot mit der angegeben id. */ - public static getKnuddelPot(id: number): (KnuddelPot|null); + public static getKnuddelPot(id: number): (KnuddelPot|null); /** * Liefert alle für die App noch verwaltbaren KnuddelPot-Objekte. */ - public static getAllKnuddelPots(): KnuddelPot[]; + public static getAllKnuddelPots(): KnuddelPot[]; /** * Liefert das ToplistAccess-Objekt, über das * Toplisten erzeugt und verwaltet werden können. */ - public static getToplistAccess(): ToplistAccess; + public static getToplistAccess(): ToplistAccess; /** * Liefert das AppProfileEntryAccess-Objekt, über das * App-Profileinträge erzeugt und verwaltet werden können. */ - public static getAppProfileEntryAccess(): AppProfileEntryAccess; + public static getAppProfileEntryAccess(): AppProfileEntryAccess; } /** @@ -1598,72 +1600,72 @@ declare class LoadConfiguration { /** * Setzt die Farbe des Hintergrundes vom Loading-View, der angezeigt wird, während das HTML User Interface lädt. (standardmäßig weiß) */ - public setBackgroundColor(color: Color): void; + public setBackgroundColor(color: Color): void; /** * Setzt das Hintergrundbild vom Loading-View, das angezeigt wird, während das HTML User Interface lädt. (standardmäßig nicht gesetzt) */ - public setBackgroundImage(imageUrl: string): void; + public setBackgroundImage(imageUrl: string): void; /** * Setzt den Text des Ladehinweiseses im Loading-View, der angezeigt wird, während das HTML User Interface lädt. (standardmäßig "Lädt...") * Hinweis: Wird mit setLoadingIndicatorImage ein Loaading-Indicator-Bild gesetzt, so wird der mit setText gesetzte Texte ignoriert. */ - public setText(text: string): void; + public setText(text: string): void; /** * Setzt ein Loading-Indicator-Bild im Loading-View, das angezeigt wird, während das HTML User Interface lädt. (standardmäßig nicht gesetzt) * Hinweis: Wird mit setLoadingIndicatorImage ein Loaading-Indicator-Bild gesetzt, so wird der mit setText gesetzte Texte ignoriert. */ - public setLoadingIndicatorImage(imageUrl: string): void; + public setLoadingIndicatorImage(imageUrl: string): void; /** * Setzt die Farbe des Textes im Loading-View, der angezeigt wird, während das HTML User Interface lädt. (standardmäßig schwarz) */ - public setForegroundColor(color: Color): void; + public setForegroundColor(color: Color): void; /** * Aktiviert/Deaktiviert die Nutzung vom Loading-View. (standardmäßig aktiviert) * Es kann sinnvoll sein, den Loading-View zu deaktivieren, wenn man selbst einen komplett eigenen Loading-View in seine App einbauen möchte. */ - public setEnabled(enabled: boolean): void; + public setEnabled(enabled: boolean): void; } /** * Eine Instanz eines Logger ermöglicht das Loggen von Inhalten. - * + * * Diese erhält man über das KnuddelsServer-Objekt * mit KnuddelsServer.getDefaultLogger() - * + * * Die Log-Einträge werden je nach Einstellungen im /apps-Fenster an den Besitzer des Channels, * die App-Manager und den App-Entwickler zugestellt. */ declare class Logger { /** * Logge einen Text mit Level DEBUG. Dieser wird im Chat allen dafür registrierten AppManagern per /p vom App-Logs-User zugestellt. Siehe: /apps, Tab: Logs. - * + * * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. */ - public debug(...msg: any[]): void; + public debug(...msg: any[]): void; /** * Logge einen Text mit Level INFO. Dieser wird im Chat allen dafür registrierten AppManagern per /p vom App-Logs-User zugestellt. Siehe: /apps, Tab: Logs. - * + * * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. */ - public info(...msg: any[]): void; + public info(...msg: any[]): void; /** * Logge einen Text mit Level WARN. Dieser wird im Chat allen dafür registrierten AppManagern per /p vom App-Logs-User zugestellt, sowie im /apps Fenster im Log angezeigt. Siehe: /apps, Tab: Logs. - * + * * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. */ - public warn(...msg: any[]): void; + public warn(...msg: any[]): void; /** * Logge einen Text mit Level ERROR. Dieser wird im Chat allen dafür registrierten AppManagern per /p vom App-Logs-User zugestellt, sowie im /apps Fenster im Log angezeigt. Siehe: /apps, Tab: Logs. - * + * * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. */ - public error(...msg: any[]): void; + public error(...msg: any[]): void; /** * Logge einen Text mit Level FATAL. Dieser wird im Chat allen dafür registrierten AppManagern per /p vom App-Logs-User zugestellt, sowie im /apps Fenster im Log angezeigt. Siehe: /apps, Tab: Logs. - * + * * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. */ - public fatal(...msg: any[]): void; + public fatal(...msg: any[]): void; } /** @@ -1673,20 +1675,20 @@ declare class Message { /** * Liefert den User, der die Nachricht verfasst hat. */ - public getAuthor(): User; + public getAuthor(): User; /** * Liefert den Inhalt der Nachricht. */ - public getText(): string; + public getText(): string; /** * Liefert den genauen Zeitpunkt, zu dem die Nachricht erstellt wurde. */ - public getCreationDate(): Date; + public getCreationDate(): Date; } /** * Repräsentiert die Instanz der konkreten App, auf die dieser Code Zugriff hat. - * + * * Die Instanz von OwnAppInstance erhält man über das AppAccess-Objekt * mit appAccess.getOwnInstance() */ @@ -1695,16 +1697,16 @@ declare class OwnAppInstance { * Gibt Zugriff auf Nutzer, die gerade im Channel dieser AppInstance online sind. * @since AppServer 82560 */ - public getOnlineUsers(otherAppInstance: AppInstance, ...userType: UserType[]): User[]; + public getOnlineUsers(otherAppInstance: AppInstance, ...userType: UserType[]): User[]; } /** * Eine Instanz von Persistence ermöglicht die persistente Speicherung von Zahlen, Zeichenketten und JSON-Objekten. * Es gibt die zwei Arten AppPersistence und UserPersistence - * + * * Jeder eigene Datentyp hat seinen eigenen Namensraum. * So kann derselbe key für eine Zahl, Zeichenkette und auch JSON-Objekt genutzt werden. - * + * *

    Hinweis: Mit der Persistence gespeicherte Informationen überleben * sogar die Deinstallation und Neuinstallation der App. */ @@ -1712,74 +1714,74 @@ declare class Persistence { /** * Informiert darüber, ob unter dem key ein String abgespeichert ist. */ - public hasString(key: string): boolean; + public hasString(key: string): boolean; /** * Setzt die Zeichenkette value für den key. * Falls bereits eine Zeichenkette für den key existiert, so wird diese überschrieben. */ - public setString(key: string, value: string): void; + public setString(key: string, value: string): void; /** * Liefert die Zeichenkette, die für den key gespeichert ist. * Falls für key keine Zeichenkette gespeichert ist, so gibt die Methode * den defaultValue zurück. */ - public getString(key: string, defaultValue?: string): string; + public getString(key: string, defaultValue?: string): string; /** * Löscht die Zeichenkette, die unter key gespeichert ist. */ - public deleteString(key: string): void; + public deleteString(key: string): void; /** * Informiert darüber, ob unter dem key eine Zahl abgespeichert ist. */ - public hasNumber(key: string): boolean; + public hasNumber(key: string): boolean; /** * Setzt die Zahl value für den key. * Falls bereits eine Zahl für den key existiert, so wird diese überschrieben. */ - public setNumber(key: string, value: number): void; + public setNumber(key: string, value: number): void; /** * Addiert den übergebenen value auf die unter dem Key key vorhandenen Wert drauf. * Value kann auch negativ sein um eine Subtraktion durchzuführen. * Falls keine Zahl für den key existiert, so wird der value für key gespeichert. */ - public addNumber(key: string, value: number): number; + public addNumber(key: string, value: number): number; /** * Liefert die Zahl, die für den key gespeichert ist. * Falls für key keine Zahl gespeichert ist, so gibt die Methode * den defaultValue zurück. */ - public getNumber(key: string, defaultValue?: number): number; + public getNumber(key: string, defaultValue?: number): number; /** * Löscht die Zahl, die unter key gespeichert ist. */ - public deleteNumber(key: string): void; + public deleteNumber(key: string): void; /** * Informiert darüber, ob unter dem key ein Objekt abgespeichert ist. */ - public hasObject(key: string): boolean; + public hasObject(key: string): boolean; /** * Setzt das Objekt value für den key. * Falls bereits ein Objekt für den key existiert, so wird dieses überschrieben. * Das als JSON serialisierte Objekt darf maximal 100kb groß sein. */ - public setObject(key: string, object: (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable)): void; + public setObject(key: string, object: (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable)): void; /** * Liefert das Objekt, das für den key gespeichert ist. * Falls für key kein Objekt gespeichert ist, so gibt die Methode * den defaultValue zurück. */ - public getObject(key: string, defaultValue?: (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable)): (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable); + public getObject(key: string, defaultValue?: (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable)): (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable); /** * Löscht das Objekt, das unter key gespeichert ist. */ - public deleteObject(key: string): void; + public deleteObject(key: string): void; } /** * Eine Instanz von PrivateMessage repräsentiert eine private Nachricht im Chat. * Die App erhält sämtliche private Nachrichten, die an einen ihrer BotUser * geschickt werden. - * + * *

    Hinweis: Eine App hat keinen Zugriff auf private Nachrichten, * die Nutzer untereinander schreiben, ohne dass ein BotUser als Empfänger involviert ist. */ @@ -1787,11 +1789,11 @@ declare class PrivateMessage extends Message { /** * Liefert die Liste der Empfänger der Nachricht. */ - public getReceivingUsers(): User[]; + public getReceivingUsers(): User[]; /** * Sendet eine private Nachricht an alle Beteiligten des Gespräches. */ - public sendReply(text: string): void; + public sendReply(text: string): void; } /** @@ -1817,7 +1819,7 @@ declare class PublicMessage extends Message { /** * Eine Quest ist eine konkrete Aufgabe, die ein User in der App zu erledigen hat. - * + * * Im Blog findest du Informationen darüber, wie man eine Quest für seine App erhält: * https://blog.developer.knuddels.de/2015/10/29/how-to-get-a-quest/ */ @@ -1826,17 +1828,17 @@ declare class Quest { * Löst ein Quest-Event aus. * @since AppServer 82290, ChatServer 82290 */ - public setSolved(count?: number): void; + public setSolved(count?: number): void; /** * Liefert den Key der Quest. * @since AppServer 82290, ChatServer 82290 */ - public getQuestKey(): string; + public getQuestKey(): string; } /** * Ein QuestAccess-Objekt ermöglicht den Zugriff auf die Quests, die ein Nutzer des Chats, für die laufende App hat. - * + * * Im Blog findest du Informationen darüber, wie man eine Quest für seine App erhält: * https://blog.knuddels.de/2015/10/29/how-to-get-a-quest/ */ @@ -1846,22 +1848,22 @@ declare class QuestAccess { * für diesen Nutzer in dieser App. * @since AppServer 82290, ChatServer 82290 */ - public getQuests(): Quest[]; + public getQuests(): Quest[]; /** * Liefert die Information, ob eine bestimmte Quest offen ist. * @since AppServer 82290, ChatServer 82290 */ - public hasQuest(questKey: string): boolean; + public hasQuest(questKey: string): boolean; /** * Liefert eine bestimmte Quest, falls vorhanden. * @since AppServer 82290, ChatServer 82290 */ - public getQuest(questKey: string): (Quest|null); + public getQuest(questKey: string): (Quest|null); /** * Liefert den User, der zu diesem QuestAccess-Objekt gehört. * @since AppServer 82290, ChatServer 82290 */ - public getUser(): User; + public getUser(): User; } /** @@ -1871,34 +1873,34 @@ declare class RandomOperations { /** * Liefert eine Zufallszahl zwischen minValue (inklusiv) und maxValue (exklusiv). */ - public static nextInt(minValue: number /* optional */, maxValue: number): number; + public static nextInt(minValue: number /* optional */, maxValue: number): number; /** * Liefert ein Array mit Zufallszahlen zwischen minValue (inklusiv) und n (exklusiv). */ - public static nextInts(minValue: number /* optional */, maxValue: number, count: number, onlyDifferentNumbers: boolean): number[]; + public static nextInts(minValue: number /* optional */, maxValue: number, count: number, onlyDifferentNumbers: boolean): number[]; /** * Liefert true in truePropability/1 Fällen */ - public static flipTrue(truePropability: number): boolean; + public static flipTrue(truePropability: number): boolean; /** * Liefert ein zufälliges Objekt aus einem Array. * Falls das Array leer ist, wird null zurückgeliefert. */ - public static getRandomObject(objects: T[]): T; + public static getRandomObject(objects: T[]): T; /** * Mischt das Array der übergebenen Objekte und liefert es zurück. */ - public static shuffleObjects(objects: T[]): T[]; + public static shuffleObjects(objects: T[]): T[]; /** * Liefert einen zufälligen String zurück. * @since AppServer 92699 */ - public static getRandomString(length: number, allowedCharacters?: string): string; + public static getRandomString(length: number, allowedCharacters?: string): string; } /** * Repräsentiert die Root-Instanz einer App, die im Hauptchannel läuft. - * + * * Die Instanz für die RootAppInstance erhält man über das AppInstance-Objekt * mit appInstance.getRootInstance() */ @@ -1906,11 +1908,11 @@ declare class RootAppInstance extends AppInstance { /** * Aktualisiert diese App im Channel (und ggf. vorhandenen Tochterchanneln) auf die neueste Version. */ - public updateApp(message: string /* optional */, logMessage?: string): void; + public updateApp(message: string /* optional */, logMessage?: string): void; /** * Stoppt diese App. */ - public stopApp(message: string /* optional */, logMessage?: string): void; + public stopApp(message: string /* optional */, logMessage?: string): void; } /** @@ -1920,11 +1922,11 @@ declare class ServerInfo { /** * Liefert die interne ServerId des Servers. */ - public getServerId(): string; + public getServerId(): string; /** * Liefert die Code-Revision des Servers. */ - public getRevision(): number; + public getRevision(): number; } /** @@ -1936,15 +1938,15 @@ declare class SingleDiceResult { /** * Liefert den Würfel zurück, durch den dieses SingleDiceResult erzeugt wurde. */ - public getDice(): Dice; + public getDice(): Dice; /** * Liefert die Ziffern, die gewürfelt wurden. */ - public valuesRolled(): number[]; + public valuesRolled(): number[]; /** * Liefert die Summe der Augenzahlen des SingleDiceResult. */ - public sum(): number; + public sum(): number; } /** @@ -1954,87 +1956,87 @@ declare interface String { /** * Die Methode liefert den String zurück, auf dem sie aufgerufen wurde mit KCode escaped. */ - escapeKCode(): string; + escapeKCode(): string; /** * Entfernt jeglichen KCode aus dem String und gibt ihn zurück. */ - stripKCode(): string; + stripKCode(): string; /** * Diese Methode liefert die Information, ob der String auf dem die Methode aufgerufen wurde * mit einem bestimmten Prefix beginnt. */ - startsWith(prefix: string): boolean; + startsWith(prefix: string): boolean; /** * Diese Methode liefert die Information, ob der String auf dem die Methode aufgerufen wurde * mit einem bestimmten Suffix endet. */ - endsWith(suffix: string): boolean; + endsWith(suffix: string): boolean; /** * Liefert die Breite des Strings in der Schriftart Arial mit der gegeben Schriftgröße und Information, ob Text fett dargestellt werden soll. */ - getPixelWidth(fontSize: number, isBold: boolean): number; + getPixelWidth(fontSize: number, isBold: boolean): number; /** * Liefert einen String, der in der Schriftart Arial mit der gegeben Schriftgröße und Information, ob Text fett dargestellt werden soll * maximal maxPixelWidth breit ist. Wird der Text dafür gekürzt, so wird an das Ende abbreviationMarker angehangen. * Falls abbreviationMarker nicht übergeben wurde, so ist es automatisch '...'. */ - limitString(fontSize: number, isBold: boolean, maxPixelWidth: number, abbreviationMarker?: string): string; + limitString(fontSize: number, isBold: boolean, maxPixelWidth: number, abbreviationMarker?: string): string; /** * Liefert die Information, ob ein bestimmter String in diesem String vorhanden ist. */ - contains(needle: string): boolean; + contains(needle: string): boolean; /** * Liefert die Levenshtein-Distanz zum übergebenen String. * Levenshtein-Distanz: Minimale Anzahl von Einfüge-, Lösch- und Ersetz-Operationen, um die erste Zeichenkette in die zweite umzuwandeln. * @since AppServer 82271 */ - minimalConversionCost(otherString: string): number; + minimalConversionCost(otherString: string): number; /** * Liefert die Information, ob der String nur aus Zeichen besteht, die in einem Nicknamen * vorkommen dürfen. * @since AppServer 82271 */ - hasOnlyNicknameCharacters(): boolean; + hasOnlyNicknameCharacters(): boolean; /** * Liefert die Information, ob der String nur aus Zeichen besteht, die Nummern sind. * @since AppServer 82271 */ - hasOnlyDigits(): boolean; + hasOnlyDigits(): boolean; /** * Liefert die Information, ob der String nur aus Zeichen besteht, die alphanumerisch + Whitespaces sind. * @since AppServer 82271 */ - hasOnlyAlphanumericalAndWhitespaceCharacters(): boolean; + hasOnlyAlphanumericalAndWhitespaceCharacters(): boolean; /** * Liefert die Information, ob der String leer oder null ist. * @since AppServer 92695 */ - isEmpty(): boolean; + isEmpty(): boolean; /** * Liefert den String in CamelCase. * @since AppServer 92695 */ - toCamelCase(): string; + toCamelCase(): string; /** * Liefert den String mit dem ersten Buchstaben als Großbuchstaben. * @since AppServer 92695 */ - capitalize(): string; + capitalize(): string; /** * Erstellt eine Kopie des String, in dem alle Vorkommnisse des String search in replacement * ersetzt werden und liefert diesen zurück. */ - replaceAll(search: string, replacement: string): string; + replaceAll(search: string, replacement: string): string; /** * Erstellt eine Kopie des String, in dem alle Vorkommnisse des regulären Ausdrucks regexp in replacement * ersetzt werden und liefert diesen zurück. */ - replaceAll(regexp: RegExp, replacement: string): string; + replaceAll(regexp: RegExp, replacement: string): string; /** * Prüft primitiv, ob der String laut Knuddels-Filterregeln ok ist. * @since ChatServer 82262, AppServer 82262 */ - isOk(): boolean; + isOk(): boolean; } /** @@ -2044,43 +2046,43 @@ declare class Toplist { /** * Liefert den userPersistenceNumberKey mit dem die Topliste erzeugt wurde. */ - public getUserPersistenceNumberKey(): string; + public getUserPersistenceNumberKey(): string; /** * Liefert den Anzeigenamen der Topliste. */ - public getDisplayName(): string; + public getDisplayName(): string; /** * Liefert den Befehl, der im Chat eingegeben werden kann, um diese Topliste zu öffnen. * Wird ein User oder eine userId übergeben, so öffnet sich die Topliste mit diesem Nutzer im Fokus. */ - public getChatCommand(user_or_userId?: (User|number)): string; + public getChatCommand(user_or_userId?: (User|number)): string; /** * Liefert den Anzeigenamen für den übergebenen User oder eine userId. */ - public getLabel(user_or_userId: (User|number)): string; + public getLabel(user_or_userId: (User|number)): string; /** * Legt einen Change-Listener an, der jedes mal aufgerufen wird, wenn ein User * einen neuen Anzeigenamen erhält. */ - public addLabelChangeListener(listener: (labelChangeEvent: ToplistLabelChangeEvent) => void): void; + public addLabelChangeListener(listener: (labelChangeEvent: ToplistLabelChangeEvent) => void): void; /** * Löscht einen LabelChangeListener, der mit Toplist/addLabelChangeListener:method erzeugt wurde. */ - public removeLabelChangeListener(listener: (labelChangeEvent: ToplistLabelChangeEvent) => void): void; + public removeLabelChangeListener(listener: (labelChangeEvent: ToplistLabelChangeEvent) => void): void; /** * Legt einen Change-Listener an, der jedes mal aufgerufen wird, wenn ein sich der Rang User eines Nutzers ändert. */ - public addRankChangeListener(listener: (rankChangeEvent: ToplistRankChangeEvent) => void): void; + public addRankChangeListener(listener: (rankChangeEvent: ToplistRankChangeEvent) => void): void; /** * Löscht einen RankChangeListener, der mit Toplist/addRankChangeListener:method erzeugt wurde. */ - public removeRankChangeListener(listener: (rankChangeEvent: ToplistRankChangeEvent) => void): void; + public removeRankChangeListener(listener: (rankChangeEvent: ToplistRankChangeEvent) => void): void; } /** * Mit einer Instanz von ToplistAccess kann eine App * Toplist erzeugen und verwalten. - * + * * Die Instanz für die ToplistAccess erhält man über das KnuddelsServer-Objekt * mit KnuddelsServer.getToplistAccess() */ @@ -2088,19 +2090,19 @@ declare class ToplistAccess { /** * Liefert die Liste aller Toplisten, die diese App erzeugt hat. */ - public getAllToplists(): Toplist[]; + public getAllToplists(): Toplist[]; /** * Liefert die Toplist mit dem Persistenz-Key zurück. */ - public getToplist(userPersistenceNumberKey: string): Toplist; + public getToplist(userPersistenceNumberKey: string): Toplist; /** * Löscht die übergebene Toplist oder die Toplist mit dem Persistenz-Key. */ - public removeToplist(toplist: Toplist): void; + public removeToplist(toplist: Toplist): void; /** * Erzeugt oder aktualisiert die Toplist für den übergebenen userPersistenceNumberKey. */ - public createOrUpdateToplist(userPersistenceNumberKey: string, displayName: string, parameters?: { labelMapping?: { [minValue: string]: string }; ascending?: boolean; }): Toplist; + public createOrUpdateToplist(userPersistenceNumberKey: string, displayName: string, parameters?: { labelMapping?: { [minValue: string]: string }; ascending?: boolean; }): Toplist; } /** @@ -2110,26 +2112,26 @@ declare class ToplistDisplayType { /** * Nur Anzeigename anzeigen. */ - public static readonly Label: ToplistDisplayType; + public static readonly Label: ToplistDisplayType; /** * Gespeicherten Wert anzeigen. */ - public static readonly Value: ToplistDisplayType; + public static readonly Value: ToplistDisplayType; /** * Anzeigename und Rang anzeigen. */ - public static readonly LabelAndRank: ToplistDisplayType; + public static readonly LabelAndRank: ToplistDisplayType; /** * Wert und Rang anzeigen. */ - public static readonly ValueAndRank: ToplistDisplayType; + public static readonly ValueAndRank: ToplistDisplayType; } /** * ToplistLabelChangeEvents erhalten EventListener die bei einer * Toplist mit der Methode Toplist/addLabelChangeListener:method * erzeugt wurden, nachdem sich der Anzeigename für einen User geändert hat. - * + * * Das ToplistLabelChangeEvent enthält alle wichtigen Daten, um auf die Änderung zu reagieren * und dem User beispielsweise für den Aufstieg zu gratulieren. */ @@ -2137,36 +2139,36 @@ declare class ToplistLabelChangeEvent { /** * Liefert die zugehörige Toplist. */ - public getToplist(): Toplist; + public getToplist(): Toplist; /** * Liefert den vorherigen Anzeigenamen. Hatte der User vorher keinen * Anzeigenamen, so ist dieser Wert null. */ - public getOldLabel(): string; + public getOldLabel(): string; /** * Liefert den neuen Anzeigenamen. Hatte der User nun keinen * Anzeigenamen mehr, so ist dieser Wert null. */ - public getNewLabel(): string; + public getNewLabel(): string; /** * Liefert den User für den das Event ausgelöst wurde. */ - public getUser(): User; + public getUser(): User; /** * Liefert den Wert, der vor der Änderung gespeichert war. */ - public getOldValue(): number; + public getOldValue(): number; /** * Liefert den neuen Wert. */ - public getNewValue(): number; + public getNewValue(): number; } /** * ToplistRankChangeEvents erhalten EventListener die bei einer * Toplist mit der Methode Toplist/addRankChangeListener:method * erzeugt wurden, nachdem sich der Rang für einen User geändert hat. - * + * * Das ToplistRankChangeEvent enthält alle wichtigen Daten, um auf die Änderung zu reagieren * und den überholten Usern eine Nachricht zu senden. */ @@ -2174,33 +2176,33 @@ declare class ToplistRankChangeEvent { /** * Liefert die zugehörige Toplist. */ - public getToplist(): Toplist; + public getToplist(): Toplist; /** * Liefert den Toplisten-Rang, den der User vor der Änderung hatte. */ - public getOldRank(): number; + public getOldRank(): number; /** * Liefert den neuen Toplisten-Rang, des Users. */ - public getNewRank(): number; + public getNewRank(): number; /** * Liefert den User für den das Event ausgelöst wurde. */ - public getUser(): User; + public getUser(): User; /** * Liefert die User, die bei dieser Änderung überholt worden sind. *

    Achtung: Wenn mehr als 10 User * überholt wurden, so liefert die Methode die besten 10 überholten User. */ - public getUsersOvertook(): User[]; + public getUsersOvertook(): User[]; /** * Liefert den Wert, der vor der Änderung gespeichert war. */ - public getOldValue(): number; + public getOldValue(): number; /** * Liefert den neuen Wert. */ - public getNewValue(): number; + public getNewValue(): number; } /** @@ -2210,215 +2212,215 @@ declare class User { /** * Liefert die eindeutige Nutzerkennung des Nutzers. */ - public getUserId(): number; + public getUserId(): number; /** * Liefert den Nicknamen des Nutzers. */ - public getNick(): string; + public getNick(): string; /** * Liefert das Alter des Nutzers. Bei Nutzern, die bereits sehr lange in der Plattform sind kann es vorkommen, dass kein Alter angegeben wurde. In diesem Fall ist das Alter 0. */ - public getAge(): number; + public getAge(): number; /** * Liefert das Geschlecht des Nutzers. */ - public getGender(): Gender; + public getGender(): Gender; /** * Liefert den Zeitpunkt der Registrierung des Nutzers. */ - public getRegDate(): Date; + public getRegDate(): Date; /** * Liefert den UserStatus des Nutzers. */ - public getUserStatus(): UserStatus; + public getUserStatus(): UserStatus; /** * Liefert den UserType des Nutzers. */ - public getUserType(): UserType; + public getUserType(): UserType; /** * Liefert den aktuellen ClientType des Nutzers oder Offline wenn er nicht im Chat online ist. */ - public getClientType(): ClientType; + public getClientType(): ClientType; /** * Prüft ob der Client des Users den übergebenen AppViewMode (für User/sendAppContent:method) anzeigen kann. */ - public canShowAppViewMode(mode: AppViewMode): boolean; + public canShowAppViewMode(mode: AppViewMode): boolean; /** * Prüft ob der Client des User's den übergebenen AppContent anzeigen kann. */ - public canSendAppContent(appContent: AppContent): boolean; + public canSendAppContent(appContent: AppContent): boolean; /** * Prüft, ob der User in dem angegebenen Team ist. * Dies funktioniert derzeit nur für Teams, die eine eigene /fa haben. - * + * * Achtung: Bei Nutzern, die neu in ein Team kommen, funktioniert die Abfrage erst dann korrekt, * wenn er sich neu in den Channel eingeloggt hat. */ - public isInTeam(teamName: string, subTeamName?: string): boolean; + public isInTeam(teamName: string, subTeamName?: string): boolean; /** * Liefert ein UserPersistence-Objekt für diesen Nutzer. Mit diesem Objekt kann eine App sich Dinge über diesen speziellen Nutzer merken. */ - public getPersistence(): UserPersistence; + public getPersistence(): UserPersistence; /** * Shortcut-Funktion um mit dem DefaultBotUser eine private Nachricht zu versenden. */ - public sendPrivateMessage(message: string): void; + public sendPrivateMessage(message: string): void; /** * Shortcut-Funktion um mit dem DefaultBotUser eine /m zu versenden. */ - public sendPostMessage(topic: string, text: string): void; + public sendPostMessage(topic: string, text: string): void; /** * Liefert die Information, ob dieser Nutzer Channelbesitzer im Channel der App ist. */ - public isChannelOwner(): boolean; + public isChannelOwner(): boolean; /** * Liefert die Information, ob der Channel der App * ein Lieblingschannel des Nutzers ist. */ - public isLikingChannel(): boolean; + public isLikingChannel(): boolean; /** * Liefert die Information, ob der Nutzer im harten Kern des Channels der App ist. * @since AppServer 92701, ChatServer 92701 */ - public isChannelCoreUser(): boolean; + public isChannelCoreUser(): boolean; /** * Liefert die Information, ob dieser Nutzer ein AppManager für diese App ist. Die Channelbesitzer zählen automatisch auch als AppManager. */ - public isAppManager(): boolean; + public isAppManager(): boolean; /** * Liefert Information, ob dieser Nutzer derzeit für das Schreiben öffentlicher Nachrichten im Channel gesperrt ist. */ - public isMuted(): boolean; + public isMuted(): boolean; /** * Liefert Information, ob dieser Nutzer beim Schreiben öffentlicher Nachrichten im Channel * derzeit für die Verwendung von Textformatierungen, Farben und Smileys gesperrt ist. */ - public isColorMuted(): boolean; + public isColorMuted(): boolean; /** * Liefert Information, ob dieser Nutzer derzeit für das Betreten des Channel gesperrt ist. */ - public isLocked(): boolean; + public isLocked(): boolean; /** * Liefert Information, ob dieser Nutzer Channelmoderator im Channel der App ist. */ - public isChannelModerator(): boolean; + public isChannelModerator(): boolean; /** * Liefert Information, ob dieser Nutzer Eventmoderator im Channel der App ist. */ - public isEventModerator(): boolean; + public isEventModerator(): boolean; /** * Liefert Information, ob dieser Nutzers der Entwickler der App ist. */ - public isAppDeveloper(): boolean; + public isAppDeveloper(): boolean; /** * Liefert einen Link zum Profil des Nutzers, den man im Chat anzeigen kann. */ - public getProfileLink(displayText?: string): string; + public getProfileLink(displayText?: string): string; /** * Liefert die Information, ob der Nutzer online im Channel der App ist. */ - public isOnlineInChannel(): boolean; + public isOnlineInChannel(): boolean; /** * Liefert die Anzahl der Knuddel, die der Nutzer besitzt. */ - public getKnuddelAmount(): KnuddelAmount; + public getKnuddelAmount(): KnuddelAmount; /** * Liefert die Information, ob der Nutzer irgendwo im Chat online ist. */ - public isOnline(): boolean; + public isOnline(): boolean; /** * Liefert die Readme des Nutzers, die er mit /readme TEXT in sein Profil gesetzt hat. */ - public getReadme(): string; + public getReadme(): string; /** * Liefert die vom Nutzer verbrachte Zeit im gesamten Chatsystem In Minuten. * Hinweis: Die Minutenzahl wird derzeit immer nur zu dem Zeitpunkt aktualisiert, * wenn der Nutzer offline geht. */ - public getOnlineMinutes(): number; + public getOnlineMinutes(): number; /** * Liefert die Information, ob der Nutzer sich mittels /away-Funktion kurz abgemeldet hat. */ - public isAway(): boolean; + public isAway(): boolean; /** * Liefert die Information, ob der Nutzer ein Profilfoto hat. */ - public hasProfilePhoto(): boolean; + public hasProfilePhoto(): boolean; /** * (Er)setzt den übergebenen AppContent beim Nutzer. */ - public sendAppContent(appContent: AppContent): AppContentSession; + public sendAppContent(appContent: AppContent): AppContentSession; /** * Liefert alle AppContentSession, die der User * aktuell geöffnet hat. */ - public getAppContentSessions(): AppContentSession[]; + public getAppContentSessions(): AppContentSession[]; /** * Liefert die AppContentSession, die der User * mit einem bestimmten AppViewMode aktuell geöffnet hat. */ - public getAppContentSession(appViewMode: AppViewMode): AppContentSession; + public getAppContentSession(appViewMode: AppViewMode): AppContentSession; /** * Vergleicht den übergebenen Nutzer und liefert true, falls der übergebene Nutzer * identisch ist mit dem aktuellen Nutzer. */ - public equals(user: User): boolean; + public equals(user: User): boolean; /** * Liefert die URL zum Profilfoto des Nutzers. Die übergebene Breite und Höhe * liefern dem Server einen Anhaltswert, um das bestmögliche Foto zu finden, * sind aber keine Garantie, dass das Foto diese Ausmaße haben wird. */ - public getProfilePhoto(width: number, height: number): string; + public getProfilePhoto(width: number, height: number): string; /** * Liefert das QuestAccess-Objekt * für diesen Nutzer in dieser App. * @since AppServer 82290, ChatServer 82290 */ - public getQuestAccess(): QuestAccess; + public getQuestAccess(): QuestAccess; /** * Liefert die Information, ob der Nutzer gerade sein Video streamt. */ - public isStreamingVideo(): boolean; + public isStreamingVideo(): boolean; /** * Liefert den KnuddelAccount des Nutzers. */ - public getKnuddelAccount(): KnuddelAccount; + public getKnuddelAccount(): KnuddelAccount; /** * Liefert die ChannelTalkPermission für diesen Nutzer in diesem * Channel. */ - public getChannelTalkPermission(): ChannelTalkPermission; + public getChannelTalkPermission(): ChannelTalkPermission; /** * Liefert die Information, ob der User ein verifiziertes Profilbild hat. */ - public isProfilePhotoVerified(): boolean; + public isProfilePhotoVerified(): boolean; /** * Liefert die Information, ob das Alter des Users verifiziert ist. */ - public isAgeVerified(): boolean; + public isAgeVerified(): boolean; /** * Setzt dem Nutzer ein Icon in die Nickliste, das auf der rechten Seite seines Nicks angezeigt wird. * Der Eintrag wird automatisch entfernt, sobald der Nutzer den Channel verlässt, * kann aber auch mit User/removeNicklistIcon:method * entfernt werden. */ - public addNicklistIcon(imagePath: string, imageWidth: number): void; + public addNicklistIcon(imagePath: string, imageWidth: number): void; /** * Entfernt dem Nutzer ein über die API gesetztes Icon in die Nickliste. */ - public removeNicklistIcon(imagePath: string): void; + public removeNicklistIcon(imagePath: string): void; /** * Startet einen Würfelwurf für den Nutzer, falls er online im Channel ist und er nicht gemuted ist. * @since AppServer 89159, ChatServer 89159 */ - public triggerDice(diceConfiguration: DiceConfiguration): void; + public triggerDice(diceConfiguration: DiceConfiguration): void; } /** * Mit einer Instanz von UserAccess kann eine App * auf User zugreifen, die bereits einmal im Channel waren, * als die App lief. Für alle nicht zugreifbaren User kann man via UserAccess den korrekt geschriebenen Nicknamen erhalten. - * + * * Die Instanz für die UserAccess erhält man über das KnuddelsServer-Objekt * mit KnuddelsServer.getUserAccess() */ @@ -2426,30 +2428,30 @@ declare class UserAccess { /** * Liefert die userId des Nutzers mit dem übergebenen Nicknamen. */ - public getUserId(nick: string): number; + public getUserId(nick: string): number; /** * Informiert darüber, ob ein Nutzer mit dem übergebenen Nicknamen existiert. */ - public exists(nick: string): boolean; + public exists(nick: string): boolean; /** * Informiert darüber, ob der Nutzer mit der übergebenen userId geladen werden darf. Neben dem AppDeveloper können nur Nutzer geladen werden, die sich einmal im Channel befanden, als die App * lief. */ - public mayAccess(userId: number): boolean; + public mayAccess(userId: number): boolean; /** * Liefert den Nutzer mit der übergebenen userId. Neben dem AppDeveloper können nur Nutzer geladen werden, die sich einmal im Channel befanden, als die App lief. Es wird empfohlen vor der * Abfrage von getUserById(userId) mit UserAccess/mayAccess:method abzufragen, ob dies funktionieren wird. */ - public getUserById(userId: number): User; + public getUserById(userId: number): User; /** * Liefert den Nicknamen des Nutzers mit der übergebenen userId in der korrekten Schreibweise. */ - public getNick(userId: number): string; + public getNick(userId: number): string; /** * Loopt über alle zugreifbaren User sortiert nach Registrierzeitpunkt und * führt für jeden User das übergebene Callback aus. */ - public eachAccessibleUser(callback: (user: User, index: number, accessibleUserCount: number, key?: string) => boolean, parameters?: { onStart?: (accessibleUserCount: number, key?: string) => void; onEnd?: (accessibleUserCount: number, key?: string) => void; }): void; + public eachAccessibleUser(callback: (user: User, index: number, accessibleUserCount: number, key?: string) => boolean, parameters?: { onStart?: (accessibleUserCount: number, key?: string) => void; onEnd?: (accessibleUserCount: number, key?: string) => void; }): void; } /** @@ -2461,22 +2463,22 @@ declare class UserPersistence extends Persistence { * Löscht alle Zahlenwerte, die in dieser UserPersistence gespeichert sind. * @since AppServer 88569 */ - public deleteAllNumbers(): number; + public deleteAllNumbers(): number; /** * Löscht alle Objekte, die in dieser UserPersistence gespeichert sind. * @since AppServer 88569 */ - public deleteAllObjects(): number; + public deleteAllObjects(): number; /** * Löscht alle Zeichenketten, die in dieser UserPersistence gespeichert sind. * @since AppServer 88569 */ - public deleteAllStrings(): number; + public deleteAllStrings(): number; /** * Löscht alle Daten, die in dieser UserPersistence gespeichert sind. * @since AppServer 88569 */ - public deleteAll(): number; + public deleteAll(): number; } /** @@ -2486,19 +2488,19 @@ declare class UserPersistenceNumberEntry { /** * Liefert den Nutzer. */ - public getUser(): User; + public getUser(): User; /** * Liefert den Wert. */ - public getValue(): number; + public getValue(): number; /** * Liefert den Rang des Elements in der Persistenz. */ - public getRank(): number; + public getRank(): number; /** * Liefert die Position des Elements in der Persistenz. */ - public getPosition(): number; + public getPosition(): number; } /** @@ -2508,68 +2510,68 @@ declare class UserPersistenceNumbers { /** * Liefert die Summe aller via UserPersistence gespeicherten Zahlen für den übergebenen key. */ - public static getSum(key: string): number; + public static getSum(key: string): number; /** * Löscht alle gespeicherten Zahlen-Werte für den übergebenen key. */ - public static deleteAll(key: string): number; + public static deleteAll(key: string): number; /** * Liefert die Anzahl aller unterschiedlichen Nutzer, die Werte für einen bestimmten key gespeichert haben. * Hierbei kann optional der Wertebereich über die parameters eingegrenzt werden. */ - public static getCount(key: string, parameters?: { minimumValue?: number; maximumValue?: number; }): number; + public static getCount(key: string, parameters?: { minimumValue?: number; maximumValue?: number; }): number; /** * Ändert einen bestimmten key bei allen UserPersistence. */ - public static updateKey(oldKeyName: string, newKeyName: string): number; + public static updateKey(oldKeyName: string, newKeyName: string): number; /** * Ändert alle Werte für einen bestimmten key, die vorher einen bestimmten anderen Wert hatten in der UserPersistence. *
    Hinweis: Da diese Methode ein Batch-Update ist werden keine Change-Listener (ToplistRankChangeEvent, ToplistLabelChangeEvent) ausgelöst. */ - public static updateValue(key: string, oldValue: number, newValue: number): number; + public static updateValue(key: string, oldValue: number, newValue: number): number; /** * Addiert einen Wert für Einträge mit einem bestimmten key in der UserPersistence. *
    Hinweis: Da diese Methode ein Batch-Update ist werden keine Change-Listener (ToplistRankChangeEvent, ToplistLabelChangeEvent) ausgelöst. */ - public static addNumber(key: string, value: number, parameters?: { minimumValue?: number; maximumValue?: number; targetUsers?: User[]; }): number; + public static addNumber(key: string, value: number, parameters?: { minimumValue?: number; maximumValue?: number; targetUsers?: User[]; }): number; /** * Liefert ein Array mit UserPersistenceNumberEntry-Objekten für einen bestimmten key. * Hierdurch kann beispielsweise eine blätterbare Topliste abgebildet werden. */ - public static getSortedEntries(key: string, parameters?: { ascending?: boolean; count?: number; page?: number; minimumValue?: number; maximumValue?: number; }): UserPersistenceNumberEntry[]; + public static getSortedEntries(key: string, parameters?: { ascending?: boolean; count?: number; page?: number; minimumValue?: number; maximumValue?: number; }): UserPersistenceNumberEntry[]; /** * Liefert ein Array mit UserPersistenceNumberEntry-Objekten für einen bestimmten key. Hierbei werden die nähesten Elemente gewählt, - * die am übergebenen User/UserId liegen. - * + * die am übergebenen User/UserId liegen. + * * Beispiel: Der Nutzer ist in der Liste auf Position 20, dann werden die Resultate von 14-24 bei einem Count von 10 ausgegeben. * Beispiel: Der Nutzer ist in der Liste auf Position 3, dann werden die Resultate von 1-10 bei einem Count von 10 ausgegeben. */ - public static getSortedEntriesAdjacent(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; count?: number; }): UserPersistenceNumberEntry[]; + public static getSortedEntriesAdjacent(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; count?: number; }): UserPersistenceNumberEntry[]; /** * Liefert die absolute Position des Nutzers in der Liste. Die Position ist im Gegensatz zum Rang immer eindeutig. - * + * * Bei gleichem Wert hat der Nutzer die höhere Position, der zuerst einen Eintrag in der Persistenz hatte. - * + * * Mit der Methode UserPersistenceNumbers/getRank:method kann man den Rang des Nutzers herausfinden. Dieser ist identisch, wenn * unterschiedliche Nutzer denselben Wert haben. */ - public static getPosition(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; minimumValue?: number; }): number; + public static getPosition(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; minimumValue?: number; }): number; /** * Liefert den Rang des Nutzers. Der Rang ist nicht eindeutig. Bei gleicher Punktzahl haben Nutzer denselben Rang. * Mit der Methode UserPersistenceNumbers/getPosition:method kann man die Position eindeutige Position, statt des Ranges herausfinden. */ - public static getRank(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; minimumValue?: number; }): number; + public static getRank(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; minimumValue?: number; }): number; /** * Ruft eine Funktion für alle Nutzer auf, die einen bestimmten key in der UserPersistence gesetzt haben. * Hierbei greifen die übergebenen Filter. */ - public static each(key: string, callback: { user: User; value: number; index: number; totalCount: number; key: string; }, parameters?: { ascending?: boolean; minimumValue?: number; maximumValue?: number; maximumCount?: number; onStart?: (totalCount: number, key: string) => void; onEnd?: (totalCount: number, key: string) => void; }): void; + public static each(key: string, callback: { user: User; value: number; index: number; totalCount: number; key: string; }, parameters?: { ascending?: boolean; minimumValue?: number; maximumValue?: number; maximumCount?: number; onStart?: (totalCount: number, key: string) => void; onEnd?: (totalCount: number, key: string) => void; }): void; /** * Liefert alle keys, die für User in der Persistence * gespeichert wurden. * @since AppServer 82483 */ - public static getAllKeys(filterKey?: string): string[]; + public static getAllKeys(filterKey?: string): string[]; } /** @@ -2580,13 +2582,13 @@ declare class UserPersistenceObjects { * Löscht alle gespeicherten Objekte für den übergebenen key. * @since AppServer 82478 */ - public static deleteAll(key: string): number; + public static deleteAll(key: string): number; /** * Liefert alle keys, die für User in der Persistence * gespeichert wurden. * @since AppServer 82483 */ - public static getAllKeys(filterKey?: string): string[]; + public static getAllKeys(filterKey?: string): string[]; } /** @@ -2597,18 +2599,18 @@ declare class UserPersistenceStrings { * Liefert die Information, ob für einen bestimmten key und value bei einem beliebigen Nutzer eine Paarung existiert. * @since AppServer 88571 */ - public static exists(key: string, value: string, ignoreCase?: boolean): boolean; + public static exists(key: string, value: string, ignoreCase?: boolean): boolean; /** * Löscht alle gespeicherten Strings für den übergebenen key. * @since AppServer 82478 */ - public static deleteAll(key: string): number; + public static deleteAll(key: string): number; /** * Liefert alle keys, die für User in der Persistence * gespeichert wurden. * @since AppServer 82483 */ - public static getAllKeys(filterKey?: string): string[]; + public static getAllKeys(filterKey?: string): string[]; } /** @@ -2618,39 +2620,39 @@ declare class UserStatus { /** * Liefert den numerischen Wert das UserStatus. */ - public getNumericStatus(): number; + public getNumericStatus(): number; /** * Liefert die Information ob der aktuelle UserStatus mindestens so hoch ist, wie der übergebene UserStatus. */ - public isAtLeast(otherUserStatus: UserStatus): boolean; + public isAtLeast(otherUserStatus: UserStatus): boolean; /** - * + * */ - public static readonly Newbie: UserStatus; + public static readonly Newbie: UserStatus; /** - * + * */ - public static readonly Family: UserStatus; + public static readonly Family: UserStatus; /** - * + * */ - public static readonly Stammi: UserStatus; + public static readonly Stammi: UserStatus; /** - * + * */ - public static readonly HonoryMember: UserStatus; + public static readonly HonoryMember: UserStatus; /** - * + * */ - public static readonly Admin: UserStatus; + public static readonly Admin: UserStatus; /** - * + * */ - public static readonly SystemBot: UserStatus; + public static readonly SystemBot: UserStatus; /** - * + * */ - public static readonly Sysadmin: UserStatus; + public static readonly Sysadmin: UserStatus; } /** @@ -2660,15 +2662,15 @@ declare class UserType { /** * Bot der App. */ - public static readonly AppBot: UserType; + public static readonly AppBot: UserType; /** * Bot des Knuddels-Chatsystems. */ - public static readonly SystemBot: UserType; + public static readonly SystemBot: UserType; /** * Menschlicher User. */ - public static readonly Human: UserType; + public static readonly Human: UserType; } /** @@ -2678,6 +2680,6 @@ declare class VideoChannelData { /** * Liefert alle User die im Channel derzeit ihr Video streamen. */ - public getStreamingVideoUsers(): User[]; + public getStreamingVideoUsers(): User[]; } From e404dbcae650791c5908e6c151d1e4b348214a48 Mon Sep 17 00:00:00 2001 From: Knuddels-TobyB Date: Tue, 7 Mar 2017 20:57:02 +0100 Subject: [PATCH 355/797] updated tslint.json to match requirements --- knuddels-userapps-api/tslint.json | 136 +----------------------------- 1 file changed, 1 insertion(+), 135 deletions(-) diff --git a/knuddels-userapps-api/tslint.json b/knuddels-userapps-api/tslint.json index 657260c2ce..785a601162 100644 --- a/knuddels-userapps-api/tslint.json +++ b/knuddels-userapps-api/tslint.json @@ -1,137 +1,3 @@ { - "extends": ["tslint-react"], - "rules": { - "align": [ - true, - "statements" - ], - "array-type": [ - true, - "array" - ], - "ban": false, - "class-name": true, - "comment-format": [ - true, - "check-space" - ], - "curly": true, - "eofline": true, - "forin": true, - "indent": [ - true, - "tabs" - ], - "interface-name": [ - false, - "always-prefix" - ], - "jsdoc-format": true, - "jsx-alignment": true, - "jsx-ban-props": true, - "jsx-curly-spacing": "never", - "jsx-no-multiline-js": true, - "jsx-no-string-ref": true, - "jsx-self-close": true, - "jsx-wrap-multiline": true, - "label-position": true, - "max-line-length": [true, 100], - "member-access": false, - "member-ordering": [ - true, - "static-before-instance", - "variables-before-functions" - ], - "no-any": false, - "no-arg": true, - "no-bitwise": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": true, - "no-console": [ - true, - "debug", - "info", - "time", - "timeEnd", - "trace" - ], - "no-construct": true, - "no-debugger": true, - "no-duplicate-variable": true, - "no-empty": false, - "no-eval": true, - "no-inferrable-types": true, - "no-internal-module": true, - "no-null-keyword": false, - "no-require-imports": false, - "no-shadowed-variable": false, - "no-string-literal": true, - "no-switch-case-fall-through": false, - "no-trailing-whitespace": true, - "no-unused-expression": true, - "no-use-before-declare": true, - "no-var-keyword": true, - "no-var-requires": false, - "object-literal-key-quotes": [true, "consistent"], - "object-literal-sort-keys": false, - "one-line": [ - true, - "check-open-brace", - "check-catch", - "check-else", - "check-whitespace" - ], - "ordered-imports": false, - "quotemark": [ - true, - "single", - "jsx-double", - "avoid-escape" - ], - "radix": true, - "semicolon": [true, "always"], - "switch-default": true, - "trailing-comma": false, - "triple-equals": [ - true, - "allow-null-check" - ], - "typedef": [ - true, - "call-signature", - "arrow-call-signature", - "property-declaration" - ], - "typedef-whitespace": [ - true, - { - "call-signature": "nospace", - "index-signature": "nospace", - "parameter": "nospace", - "property-declaration": "nospace", - "variable-declaration": "nospace" - }, - { - "call-signature": "onespace", - "index-signature": "onespace", - "parameter": "onespace", - "property-declaration": "onespace", - "variable-declaration": "onespace" - } - ], - "variable-name": [ - true, - "check-format", - "allow-pascal-case", - "ban-keywords" - ], - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-separator", - "check-type" - ] - } + "extends": "../tslint.json" } \ No newline at end of file From a720eb9a69b83879027f23e53a0746e9aa42c8fd Mon Sep 17 00:00:00 2001 From: Knuddels-TobyB Date: Tue, 7 Mar 2017 21:19:34 +0100 Subject: [PATCH 356/797] fixed linting issues --- knuddels-userapps-api/index.d.ts | 821 +++++++++--------- .../knuddels-userapps-api-tests.ts | 89 +- 2 files changed, 466 insertions(+), 444 deletions(-) diff --git a/knuddels-userapps-api/index.d.ts b/knuddels-userapps-api/index.d.ts index b6bebe1c0b..b388301f68 100644 --- a/knuddels-userapps-api/index.d.ts +++ b/knuddels-userapps-api/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Knuddels UserApps API +// Type definitions for Knuddels UserApps API 1.0 // Project: https://developer.knuddels.de // Definitions by: Knuddels GmbH & Co. KG // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -26,7 +26,9 @@ declare interface App { * Dieses Methode wird aufgerufen, sobald ein Nutzer versucht den Channel zu betreten. * Die App kann nun entscheiden, ob der Nutzer den Channel betreten darf. * - * Hinweis: Um ein responsives User Interface für den Nutzer, der den Channel betreten möchte zu garantieren, muss die App innerhalb von einer Sekunde auf diese Anfrage reagieren, damit ihre Antwort in das Ergebnis einfliesst. + * Hinweis: Um ein responsives User Interface für den Nutzer, + * der den Channel betreten möchte zu garantieren, muss die App innerhalb von einer Sekunde auf diese Anfrage reagieren, + * damit ihre Antwort in das Ergebnis einfliesst. * * Mit bestimmten Smileyfeatures ist es derzeit trotzdem möglich, den Channel zu betreten. * Diese Nutzer können nicht ausgesperrt werden: @@ -176,7 +178,7 @@ declare interface App { *
  • command ist der Name des Befehl selbst (beispielsweise commandName)
  • * */ - chatCommands?: { [commandName:string]: (user:User, params:string, command:string) => void }; + chatCommands?: { [commandName: string]: (user: User, params: string, command: string) => void }; } /** @@ -189,17 +191,17 @@ declare class AppAccess { /** * Liefert die Instanz der eigenen App. */ - public getOwnInstance(): AppInstance; + getOwnInstance(): AppInstance; /** * Liefert die Instanzen aller anderen Apps, die gerade in diesem Channel laufen. * @since AppServer 82904 */ - public getAllRunningAppsInChannel(includeSelf?: boolean): AppInstance[]; + getAllRunningAppsInChannel(includeSelf?: boolean): AppInstance[]; /** * Liefert die Instanzen aller anderen Apps, die gerade in diesem Channel laufen. * @since AppServer 82904 */ - public getRunningAppInChannel(appId: string): (AppInstance|null); + getRunningAppInChannel(appId: string): (AppInstance|null); } /** @@ -209,56 +211,56 @@ declare class AppContent { /** * Liefert den AppViewMode. */ - public getAppViewMode(): AppViewMode; + getAppViewMode(): AppViewMode; /** * Liefert das HTMLFile, das beim Anlegen des AppContents * genutzt wurde. */ - public getHTMLFile(): HTMLFile; + getHTMLFile(): HTMLFile; /** * Liefert die Breite des AppContent. */ - public getWidth(): number; + getWidth(): number; /** * Liefert die Höhe des AppContent. */ - public getHeight(): number; + getHeight(): number; /** * Liefert die LoadConfiguration, mit der die Optik beim Laden des HTML User Interface beeinflusst werden kann. */ - public getLoadConfiguration(): LoadConfiguration; + getLoadConfiguration(): LoadConfiguration; /** * Liefert einen AppContent, der das HTMLFile als Overlay oben rechts im Channel anzeigt. */ - public static overlayContent(htmlFile: HTMLFile, width: number, height: number): AppContent; + static overlayContent(htmlFile: HTMLFile, width: number, height: number): AppContent; /** * Liefert einen AppContent, der das HTMLFile als Overlay (200x350) oben rechts im Channel anzeigt. */ - public static overlayContent(htmlFile: HTMLFile): AppContent; + static overlayContent(htmlFile: HTMLFile): AppContent; /** * Liefert einen AppContent, der das HTMLFile im Applet/HTML-Chat * als Popup (300x400) und auf Android als Fullscreen-View anzeigt. */ - public static popupContent(htmlFile: HTMLFile): AppContent; + static popupContent(htmlFile: HTMLFile): AppContent; /** * Liefert einen AppContent, der das HTMLFile im Applet/HTML-Chat * als Popup und auf Android als Fullscreen-View anzeigt. */ - public static popupContent(htmlFile: HTMLFile, width: number, height: number): AppContent; + static popupContent(htmlFile: HTMLFile, width: number, height: number): AppContent; /** * Sendet Daten an alle Nutzer, die diesen AppContent geöffnet haben. */ - public sendEvent(type: string, data?: KnuddelsEvent): void; + sendEvent(type: string, data?: KnuddelsEvent): void; /** * Liefert eine Liste aller User, die diesen AppContent * geöffnet haben. */ - public getUsers(): User[]; + getUsers(): User[]; /** * Liefert eine Liste aller AppContentSessions, die dieses AppContent, * die User gerade geöffnet haben. */ - public getSessions(): AppContentSession[]; + getSessions(): AppContentSession[]; /** * Ersetzt den AppContent, bei allen Usern, die diesen AppContent * geöffnet haben durch den neuen AppContent. @@ -266,16 +268,16 @@ declare class AppContent { *

    Hinweis: Es können nur AppContent mit demselben AppViewMode * zum Ersetzen genutzt werden. */ - public replaceWithAppContent(newAppContent: AppContent): void; + replaceWithAppContent(newAppContent: AppContent): void; /** * Entfernt diesen AppContent, bei allen Usern, die diesen AppContent * geöffnet haben. */ - public remove(): void; + remove(): void; /** * Fügt einen Listener hinzu, der aufgerufen wird, wenn jemand den AppContent schließt. */ - public addCloseListener(callback: { user: User; appContent: AppContent; }): void; + addCloseListener(callback: { user: User; appContent: AppContent; }): void; } /** @@ -285,23 +287,23 @@ declare class AppContentSession { /** * Sendet Daten an den verbundenen Client. */ - public sendEvent(type: string, data?: KnuddelsEvent): void; + sendEvent(type: string, data?: KnuddelsEvent): void; /** * Liefert den AppViewMode. */ - public getAppViewMode(): AppViewMode; + getAppViewMode(): AppViewMode; /** * Entfernt die AppContentSession beim verbundenen User. */ - public remove(): void; + remove(): void; /** * Liefert den User. */ - public getUser(): User; + getUser(): User; /** * Liefert den verbundenen AppContent. */ - public getAppContent(): AppContent; + getAppContent(): AppContent; } /** @@ -314,7 +316,7 @@ declare class AppInfo { * Diese ist für jede Sub-Channel Instanz der App unterschiedlich. * Wenn RootAppUid == AppUid dann ist dies die Root-App-Instanz. */ - public getAppUid(): number; + getAppUid(): number; /** * Liefert die RootAppUid. * Diese ist für jede Sub-Channel Instanz der App gleich. @@ -322,15 +324,15 @@ declare class AppInfo { * * Sie wird für den Link für Auszahlungen aus einem Knuddel-Account benötigt: /knuddelaccount payout:<RootAppUid>:<BETRAG> */ - public getRootAppUid(): number; + getRootAppUid(): number; /** * Liefert den in der Konfiguration eingestellten Namen der App. */ - public getAppName(): string; + getAppName(): string; /** * Liefert die Version der App, die in der Konfiguration eingestellt wurde. */ - public getAppVersion(): string; + getAppVersion(): string; /** * Liefert die eindeutige Id der App. * Die appId setzt sich zusammen aus @@ -340,39 +342,39 @@ declare class AppInfo { *
  • Ordnername der App -> appKey
  • * */ - public getAppId(): string; + getAppId(): string; /** * Liefert den eindeutigen Key der App. * Der appKey ist der Ordnername, in dem die App liegt. */ - public getAppKey(): string; + getAppKey(): string; /** * Liefert den Entwickler der App, falls die serverId knuddelsDE oder knuddelsDEV ist, ansonsten null. */ - public getAppDeveloper(): User; + getAppDeveloper(): User; /** * Liefert die Liste der AppManager für diese App. Die Channelbesitzer zählen automatisch auch als AppManager. */ - public getAppManagers(): User[]; + getAppManagers(): User[]; /** * Liefert den Steuersatz, der bei Auszahlung bereits genutzer Knuddel von einem * KnuddelAccount an einen User * anfällt. Die anfallenden Steuern werden bei Auszahlung vom BotUser * abgezogen. */ - public getTaxRate(): number; + getTaxRate(): number; /** * Liefert den KnuddelAmount, der an Steuern anfallen würde, * wenn alle User jetzt all ihre Knuddel aus ihrem * KnuddelAccount abheben würden. */ - public getTotalTaxKnuddelAmount(): KnuddelAmount; + getTotalTaxKnuddelAmount(): KnuddelAmount; /** * Liefert den KnuddelAmount, der jetzt noch vom * BotUser an KnuddelAccounts * übertragen werden kann, so dass für alle Knuddel noch die Steuern bezahlt werden können. */ - public getMaxPayoutKnuddelAmount(): KnuddelAmount; + getMaxPayoutKnuddelAmount(): KnuddelAmount; } /** @@ -385,36 +387,36 @@ declare class AppInstance { /** * Liefert die AppInfo. */ - public getAppInfo(): AppInfo; + getAppInfo(): AppInfo; /** * Sendet ein App-Event an diese App-Instanz. */ - public sendAppEvent(type: string, data: KnuddelsEvent): void; + sendAppEvent(type: string, data: KnuddelsEvent): void; /** * Informiert, ob die aktuelle AppInstanz eine Root-Instanz ist. */ - public isRootInstance(): boolean; + isRootInstance(): boolean; /** * Liefert die Root-Instanz der aktuellen App-Instanz. */ - public getRootInstance(): RootAppInstance; + getRootInstance(): RootAppInstance; /** * Liefert alle App-Instanzen dieser App in diesem Channel und Subchannels. * Mit includeSelf = false kann man die eigene Instanz ausschließen. */ - public getAllInstances(includeSelf?: boolean): AppInstance[]; + getAllInstances(includeSelf?: boolean): AppInstance[]; /** * Liefert den Startzeitpunkt dieser AppInstance. */ - public getStartDate(): Date; + getStartDate(): Date; /** * Liefert die Namen der ChatCommands, die diese AppInstnce derzeit registriert hat. */ - public getRegisteredChatCommandNames(): (string[]|null); + getRegisteredChatCommandNames(): (string[]|null); /** * Liefert den Namen des Channels in dem diese AppInstance läuft. */ - public getChannelName(): string; + getChannelName(): string; } /** @@ -432,15 +434,15 @@ declare class AppProfileEntry { /** * Liefert den key für den die Topliste, die den Profileintrag erzeugt angelegt wurde. */ - public getKey(): string; + getKey(): string; /** * Liefert den getDisplayType */ - public getDisplayType(): ToplistDisplayType; + getDisplayType(): ToplistDisplayType; /** * Liefert das Toplist-Objekt. */ - public getToplist(): Toplist; + getToplist(): Toplist; } /** @@ -457,22 +459,22 @@ declare class AppProfileEntryAccess { /** * Liefert die Liste aller AppProfileEntry-Objekte, die diese App erzeugt hat. */ - public getAllProfileEntries(): AppProfileEntry[]; + getAllProfileEntries(): AppProfileEntry[]; /** * Liefert den AppProfileEntry für den übergebenen userPersistenceNumberKey. */ - public getAppProfileEntry(userPersistenceNumberKey: string): AppProfileEntry; + getAppProfileEntry(userPersistenceNumberKey: string): AppProfileEntry; /** * Erzeugt oder aktualisiert ein AppProfileEntry anhand der übergebenen Toplist * und dem ToplistDisplayType und liefert den AppProfileEntry im Anschluss zurück. * * Profileinträge, die erzeugt werden, sind nur sichtbar, solange die App läuft und werden im Profil ausgeblendet, sofern die App aus ist. */ - public createOrUpdateEntry(toplist: Toplist, toplistDisplayType: ToplistDisplayType): AppProfileEntry; + createOrUpdateEntry(toplist: Toplist, toplistDisplayType: ToplistDisplayType): AppProfileEntry; /** * Löscht den übergebenen AppProfileEntry. */ - public removeEntry(appProfileEntry: AppProfileEntry): void; + removeEntry(appProfileEntry: AppProfileEntry): void; } /** @@ -491,11 +493,11 @@ declare class AppViewMode { /** * */ - public static readonly Overlay: AppViewMode; + static readonly Overlay: AppViewMode; /** * Zum Öffnen eines Popups durch das HTML User Interface */ - public static readonly Popup: AppViewMode; + static readonly Popup: AppViewMode; } /** @@ -508,20 +510,20 @@ declare class BotUser extends User { /** * Sendet eine öffentliche Nachricht in den Channel. */ - public sendPublicMessage(message: string): void; + sendPublicMessage(message: string): void; /** * Sendet eine öffentliche Handlung in den Channel. * Dies funktioniert so, als ob der BotUser /me TEXT im Chat eingeben würde. */ - public sendPublicActionMessage(actionMessage: string): void; + sendPublicActionMessage(actionMessage: string): void; /** * Sendet eine private Nachricht an bestimmte Nutzer. */ - public sendPrivateMessage(message: string, users?: User[]): void; + sendPrivateMessage(message: string, users?: User[]): void; /** * Sendet eine persistente Nachricht an einen bestimmten Nutzer. */ - public sendPostMessage(topic: string, text: string, receivingUser?: User): void; + sendPostMessage(topic: string, text: string, receivingUser?: User): void; /** * Transferiert eine bestimmte Anzahl Knuddel an einen Zielnutzer oder KnuddelAccount.

    * Wichtiger Hinweis: Sollte die App versuchen mehr Knuddel zu transferieren, @@ -531,7 +533,9 @@ declare class BotUser extends User { * Hat ein Channelbesitzer eine gewisse Menge Schulden angesammelt, so schalten wir alle Apps in diesem Channel ab. *
    Es können nur Knuddel transferiert werden zu Nutzern mit UserType.Human. */ - public transferKnuddel(receivingUserOrAccount: (User|KnuddelAccount), knuddelAmount: KnuddelAmount, parameters?: { displayReasonText?: string; transferDisplayType?: KnuddelTransferDisplayType; onSuccess?: () => void; onError?: (message: string) => void; }): void; + transferKnuddel(receivingUserOrAccount: (User|KnuddelAccount), knuddelAmount: KnuddelAmount, + parameters?: { displayReasonText?: string; transferDisplayType?: KnuddelTransferDisplayType; + onSuccess?: () => void; onError?: (message: string) => void; }): void; } /** @@ -544,49 +548,49 @@ declare class Channel { /** * Gibt Zugriff auf das ChannelConfiguration-Objekt des Channels. */ - public getChannelConfiguration(): ChannelConfiguration; + getChannelConfiguration(): ChannelConfiguration; /** * Gibt Zugriff auf das ChannelRestrictions-Objekt des Channels. */ - public getChannelRestrictions(): ChannelRestrictions; + getChannelRestrictions(): ChannelRestrictions; /** * Gibt Zugriff auf das ChannelDesign-Objekt des Channels. * @since AppServer 87470, ChatServer 87470 */ - public getChannelDesign(): ChannelDesign; + getChannelDesign(): ChannelDesign; /** * Gibt Zugriff auf Nutzer, die gerade im Channel online sind. */ - public getOnlineUsers(...userType: UserType[]): User[]; + getOnlineUsers(...userType: UserType[]): User[]; /** * Liefert die Information, ob in diesem Channel Videos gestreamt werden können. */ - public isVideoChannel(): boolean; + isVideoChannel(): boolean; /** * Liefert die VideoChannelData des Channels. */ - public getVideoChannelData(): VideoChannelData; + getVideoChannelData(): VideoChannelData; /** * Liefert den Namen des Channels. */ - public getChannelName(): string; + getChannelName(): string; /** * Liefert den Namen des Root-Channels (nur relevant, falls die App Tochterchannel haben kann). */ - public getRootChannelName(): string; + getRootChannelName(): string; /** * Liefert den ChannelTalkMode, in dem sich der Channel gerade befindet. */ - public getTalkMode(): ChannelTalkMode; + getTalkMode(): ChannelTalkMode; /** * Liefert alle User, die bestimmte ChannelTalkPermissions haben. */ - public getAllUsersWithTalkPermission(...channelTalkPermission: ChannelTalkPermission[]): User[]; + getAllUsersWithTalkPermission(...channelTalkPermission: ChannelTalkPermission[]): User[]; /** * Liefert die Information, ob der Channel sichtbar (true) oder unsichtbar (false) ist. * @since AppServer 82202 */ - public isVisible(): boolean; + isVisible(): boolean; } /** @@ -600,11 +604,11 @@ declare class ChannelConfiguration { /** * Liefert das ChannelRights-Objekt des Channels. */ - public getChannelRights(): ChannelRights; + getChannelRights(): ChannelRights; /** * Liefert das ChannelInformation-Objekt des Channels. */ - public getChannelInformation(): ChannelInformation; + getChannelInformation(): ChannelInformation; } /** @@ -616,17 +620,17 @@ declare class ChannelDesign { * Liefert die eingestellte Standard-Schriftgröße des Channels. * @since AppServer 87470, ChatServer 87470 */ - public getDefaultFontSize(): number; + getDefaultFontSize(): number; /** * Liefert die eingestellte Standard-Schriftfarbe des Channels. * @since AppServer 87470, ChatServer 87470 */ - public getDefaultFontColor(): Color; + getDefaultFontColor(): Color; /** * Liefert die eingestellte Hintergrundfarbe des Channels. * @since AppServer 87470, ChatServer 87470 */ - public getBackgroundColor(): Color; + getBackgroundColor(): Color; } /** @@ -636,11 +640,11 @@ declare class ChannelInformation { /** * Liefert das eingestellte Thema des Channels. */ - public getTopic(): string; + getTopic(): string; /** * Aktualisiert das Thema das Channels. */ - public setTopic(topic: string, showMessage: boolean): void; + setTopic(topic: string, showMessage: boolean): void; } /** @@ -656,11 +660,11 @@ declare class ChannelJoinPermission { /** * Erzeugt ein ChannelJoinPermission-Objekt, das den Zugriff in den Channel erlaubt. */ - public static accepted(): ChannelJoinPermission; + static accepted(): ChannelJoinPermission; /** * Erzeugt ein ChannelJoinPermission-Objekt, das den Zugriff in den Channel verbietet. */ - public static denied(denyReason: string): ChannelJoinPermission; + static denied(denyReason: string): ChannelJoinPermission; } /** @@ -673,16 +677,16 @@ declare class ChannelRestrictions { /** * Liefert alle User die im Channel derzeit für das Schreiben öffentlicher Nachrichten gesperrt sind. */ - public getMutedUsers(): User[]; + getMutedUsers(): User[]; /** * Liefert alle User die im Channel derzeit für das Nutzen * von Farben, Textformatierung und Smileys in öffentlichen Nachrichten gesperrt sind. */ - public getColorMutedUsers(): User[]; + getColorMutedUsers(): User[]; /** * Liefert alle User die für das Betreten des Channel derzeit gesperrt sind. */ - public getLockedUsers(): User[]; + getLockedUsers(): User[]; } /** @@ -693,15 +697,15 @@ declare class ChannelRights { /** * Liefert die Liste aller Channelbesitzer. In öffentlichen Channels sind dies alle hauptzuständigen betreuenden Mitglieder. (HZA/HZE) */ - public getChannelOwners(): User[]; + getChannelOwners(): User[]; /** * Liefert die Liste aller Channel-Moderatoren. */ - public getChannelModerators(): User[]; + getChannelModerators(): User[]; /** * Liefert die Liste aller Event-Moderatoren. */ - public getEventModerators(): User[]; + getEventModerators(): User[]; } /** @@ -714,16 +718,16 @@ declare class ChannelTalkMode { /** * Jeder darf gerade im Channel schreiben. */ - public static readonly Everyone: ChannelTalkMode; + static readonly Everyone: ChannelTalkMode; /** * Nur Personen, die besondere Rederechte haben dürfen gerade im Channel schreiben. */ - public static readonly OnlyWithTalkPermission: ChannelTalkMode; + static readonly OnlyWithTalkPermission: ChannelTalkMode; /** * Nur Personen, die besondere Rederechte haben dürfen gerade im Channel schreiben. * Die Nachrichten aller anderen Nutzer werden gefiltert und ggf. von den Moderatoren zugelassen. */ - public static readonly FilteredByModerators: ChannelTalkMode; + static readonly FilteredByModerators: ChannelTalkMode; } /** @@ -735,34 +739,34 @@ declare class ChannelTalkPermission { * Der User ist gerade nicht im Channel, * daher ist die ChannelTalkPermission nicht bekannnt. */ - public static readonly NotInChannel: ChannelTalkPermission; + static readonly NotInChannel: ChannelTalkPermission; /** * Der User hat keine speziellen Rederechte. * Beim ChannelTalkMode Default können diese User * Nachrichten verfassen: */ - public static readonly Default: ChannelTalkPermission; + static readonly Default: ChannelTalkPermission; /** * Der User kann eine öffentliche Nachricht verfassen. Danach wechselt die * ChannelTalkPermission automatisch auf Default. */ - public static readonly TalkOnce: ChannelTalkPermission; + static readonly TalkOnce: ChannelTalkPermission; /** * Der User kann permanent öffentliche Nachrichten verfassen. */ - public static readonly TalkPermanent: ChannelTalkPermission; + static readonly TalkPermanent: ChannelTalkPermission; /** * Der User ist VIP und kann öffentliche Nachrichten verfassen, * die farbig und groß dargestellt werden. */ - public static readonly VIP: ChannelTalkPermission; + static readonly VIP: ChannelTalkPermission; /** * Der User ist VIP und kann öffentliche Nachrichten verfassen, * die farbig und groß dargestellt werden. Moderatoren haben zudem weitere Möglichkeiten, die in der * Anleitung zum Moderationssystem * nachgelesen werden können. */ - public static readonly Moderator: ChannelTalkPermission; + static readonly Moderator: ChannelTalkPermission; } /** @@ -775,7 +779,7 @@ declare class ChatServerInfo extends ServerInfo { /** * Liefert die Information, ob dieser Chat-Server ein Test-System ist. */ - public isTestSystem(): boolean; + isTestSystem(): boolean; } /** @@ -785,12 +789,12 @@ declare class Client { /** * Schließt das HTML User Interface. */ - public static close(): void; + static close(): void; /** * Sendet ein Event zum Server, das mit dem AppHook onEventReceived in der App * abgefangen werden kann. */ - public static sendEvent(type: string, data: KnuddelsEvent): void; + static sendEvent(type: string, data: KnuddelsEvent): void; /** * Sagt dem Chatserver, dass dieser Befehl für den Nutzer, der das HTML User Interface sieht, ausgeführt werden soll. * Ist der Befehl auf einer Whitelist vom Server, so wird er sofort ausgeführt. Im anderen Falle sieht der Nutzer einen @@ -799,67 +803,67 @@ declare class Client { * Derzeit sind diese Befehle auf der Whitelist: w, info, wc, top, h, dice, d, diceo, w2, serverpp, knuddelaccount, * /tf-insert, /tf-inserts, /tf-insertb, /tf-insertsb, /tf-override, /tf-overrides, /tf-overrideb, /tf-overridesb, /autotype */ - public static executeSlashCommand(command: string): void; + static executeSlashCommand(command: string): void; /** * Bindet eine Javascript-Datei ein und sorgt dafür, dass immer die aktuellste Version vom Server geladen wird. */ - public static includeJS(...files: string[]): void; + static includeJS(...files: string[]): void; /** * Registriert sich für ein bestimmtes Event, das vom Server mittels User/sendEvent:method oder vom Client via Client/dispatchEvent:method verschickt wurde. */ - public static addEventListener(type: string, callback: (event: {type: string, data: KnuddelsEvent}) => void): void; + static addEventListener(type: string, callback: (event: {type: string, data: KnuddelsEvent}) => void): void; /** * Sendet ein bestimmtes Event, so dass alle mit Client/addEventListener:method registrierten Listener aufgerufen werden. */ - public static dispatchEvent(event: Client.Event): void; + static dispatchEvent(event: Client.Event): void; /** * Entfernt alle Event-Listener für einen bestimmten Event-Typ. */ - public static removeEventListener(type: string): void; + static removeEventListener(type: string): void; /** * Bindet eine CSS-Datei ein und sorgt dafür, dass immer die aktuellste Version vom Server geladen wird. */ - public static includeCSS(...files: string[]): void; + static includeCSS(...files: string[]): void; /** * Spielt einen Sound ab. Der angegebene Dateiname kann hierbei entweder absolut oder relativ zur angezeigten HTML-Datei sein. * Bisher können nur Dateien mit Wave-Format zuverlässig abgespielt werden. */ - public static playSound(fileName: string): void; + static playSound(fileName: string): void; /** * Lädt einen Sound herunter, damit die Datei später ohne Wartezeit abgespielt werden kann. * (Android only) * Der angegebene Dateiname kann hierbei entweder absolut oder relativ zur angezeigten HTML-Datei sein. */ - public static prefetchSound(fileName: string): void; + static prefetchSound(fileName: string): void; /** * Gibt einen Sound wieder frei, der in nächster Zeit vom Client nicht mehr gebraucht wird. * (Android only) * Der angegebene Dateiname kann hierbei entweder absolut oder relativ zur angezeigten HTML-Datei sein. */ - public static freeSound(fileName: string): void; + static freeSound(fileName: string): void; /** * Liefert den HostFrame des aktuellen Inhalts. */ - public static getHostFrame(): Client.HostFrame; + static getHostFrame(): Client.HostFrame; /** * Liefert den Nicknamen des Users, der gerade dieses HTML User Interface angezeigt bekommt. */ - public static getNick(): string; + static getNick(): string; /** * Liefert den aktuellen ClientType des Nutzers, der gerade dieses HTML User Interface angezeigt bekommt. */ - public static getClientType(): ClientType; + static getClientType(): ClientType; /** * Liefert die Id, die beim Laden von Skripten und Stylesheets an die URL angehängt wird, um sicherzustellen, dass eine neue Version * der Datei vom Server geholt wird, statt die Datei aus dem Cache zu laden. * * Diese Id kann beim Einbinden eigener Ressourcen zum selben Zweck genutzt werden. */ - public static getCacheInvalidationId(): string; + static getCacheInvalidationId(): string; /** * Beinhaltet die JSON-Daten, die beim Erstellen des HTMLFile übergeben wurden. */ - public static pageData: Json; + static pageData: Json; } /** @@ -870,27 +874,27 @@ declare module Client { /** * Erzeugt ein Color-Objekt mit RGB-Werten. */ - public static fromRGB(red: number, green: number, blue: number): Color; + static fromRGB(red: number, green: number, blue: number): Color; /** * Erzeugt ein Color-Objekt aus einem HexString. */ - public static fromHexString(colorString: string): Color; + static fromHexString(colorString: string): Color; /** * Liefert den Rot-Anteil der Farbe als Zahl zwischen 0 und 255. */ - public getRed(): number; + getRed(): number; /** * Liefert den Grün-Anteil der Farbe als Zahl zwischen 0 und 255. */ - public getGreen(): number; + getGreen(): number; /** * Liefert den Blau-Anteil der Farbe als Zahl zwischen 0 und 255. */ - public getBlue(): number; + getBlue(): number; /** * Liefert die Farbe als in CSS nutzbaren HexString. */ - public asHexString(): string; + asHexString(): string; } } @@ -902,7 +906,7 @@ declare module Client { /** * Erzeugt ein Event. */ - public constructor(type: string, data: KnuddelsEvent); + constructor(type: string, data: KnuddelsEvent); } } @@ -914,32 +918,32 @@ declare module Client { /** * Setzt den Titel der Seite im gezoomten Modus (nur Android). */ - public setTitle(newTitle: string): void; + setTitle(newTitle: string): void; /** * Ändert die sichtbare Hintergrundfarbe des Hostframes animiert. (Android-only) */ - public setBackgroundColor(newColor: Color, durationMillis?: number): void; + setBackgroundColor(newColor: Color, durationMillis?: number): void; /** * Setzt die Icons, die als Fenster-Icon angezeigt werden sollen. (Applet-only, nur mit AppViewMode.Popup) * Die Bilder müssen von groß nach klein sortiert sein. Die größeren Bilder werden (je nach System) automatisch dann eingesetzt, * wenn größere Bilder benötigt werden (z.B. in der Task-Leiste, oder beim Alt+Tab Fenster-Wechsel). * @since Applet: 9.0bwj, AppServer: 84904 */ - public setIcons(...path: string[]): void; + setIcons(...path: string[]): void; /** * Setzt, ob das Fenster resizable ist. (Applet-only, nur mit AppViewMode.Popup) */ - public setResizable(resizable: boolean): void; + setResizable(resizable: boolean): void; /** * Bringt das Fenster der App (App-Popup bzw. Chat-Fenster) in den Vordergrund. (Applet-only) * @since Applet: 9.0bwj, AppServer: 84904 */ - public focus(): void; + focus(): void; /** * Ändert die Größe des App-Fensters (AppViewMode.Popup) bzw. App-Overlays (AppViewMode.Overlay). * @since Applet: 9.0bwj, AppServer: 84516 */ - public setSize(width: number, height: number): void; + setSize(width: number, height: number): void; } } @@ -953,23 +957,23 @@ declare class ClientType { /** * Der User ist mit dem Java Applet im Chat. */ - public static readonly Applet: ClientType; + static readonly Applet: ClientType; /** * Der User ist mit dem Browser im Chat (Mini-Chat, HTML-Chat). */ - public static readonly Browser: ClientType; + static readonly Browser: ClientType; /** * Der User ist mit der Android-App im Chat. */ - public static readonly Android: ClientType; + static readonly Android: ClientType; /** * Der User ist mit der iOS-App im Chat. */ - public static readonly IOS: ClientType; + static readonly IOS: ClientType; /** * Der User ist nicht im Chat. */ - public static readonly Offline: ClientType; + static readonly Offline: ClientType; } /** @@ -980,39 +984,39 @@ declare class Color { * Erzeugt ein serverseitiges Color-Objekt mit RGB-Werten. * Als Alpha-Wert wird automatisch 255 genutzt. */ - public static fromRGB(red: number, green: number, blue: number): Color; + static fromRGB(red: number, green: number, blue: number): Color; /** * Erzeugt ein serverseitiges Color-Objekt mit RGBA-Werten. */ - public static fromRGBA(red: number, green: number, blue: number, alpha: number): Color; + static fromRGBA(red: number, green: number, blue: number, alpha: number): Color; /** * Liefert den Alpha-Wert der Farbe als Zahl zwischen 0 und 255. */ - public getAlpha(): number; + getAlpha(): number; /** * Liefert den Blau-Anteil der Farbe als Zahl zwischen 0 und 255. */ - public getBlue(): number; + getBlue(): number; /** * Liefert den Grün-Anteil der Farbe als Zahl zwischen 0 und 255. */ - public getGreen(): number; + getGreen(): number; /** * Liefert den Rot-Anteil der Farbe als Zahl zwischen 0 und 255. */ - public getRed(): number; + getRed(): number; /** * Liefert die Farbe als KCode zurück. */ - public toKCode(): string; + toKCode(): string; /** * Liefert die numerische Repräsentation der Farbe zurück. */ - public asNumber(): number; + asNumber(): number; /** * Erzeugt ein serverseitiges Color-Objekt aus der numerischen Repräsentation einer Farbe. */ - public static fromNumber(value: number): Color; + static fromNumber(value: number): Color; } /** @@ -1022,15 +1026,15 @@ declare class Dice { /** * Erzeugt ein Dice-Objekt mit der übergebenen Anzahl Würfel und Augenzahl. */ - public constructor(count: number /* optional */, value: number); + constructor(count: number /* optional */, value: number); /** * Liefert die Anzahl der Würfel. */ - public getAmount(): number; + getAmount(): number; /** * Liefert die Anzahl der Seiten der Würfel. */ - public getNumberOfSides(): number; + getNumberOfSides(): number; } /** @@ -1047,27 +1051,27 @@ declare class DiceConfiguration { * * Beispiel: /diceo 1w4 -> 4 -> 4 -> 3 = 11 */ - public isUsingOpenThrow(): boolean; + isUsingOpenThrow(): boolean; /** * Informiert darüber, ob die Würfel privat geworfen worden sind. * Würfelwürfe zählen als privat, wenn am Ende des Würfelbefehls ein Ausrufezeichen steht. * Beispiel: /dice 10w2! */ - public isUsingPrivateThrow(): boolean; + isUsingPrivateThrow(): boolean; /** * Liefert ein Array mit Würfeln, mit denen gewürfelt wurde. */ - public getDices(): Dice[]; + getDices(): Dice[]; /** * Vergleicht, ob zwei Konfigurationen inhaltlich identisch sind */ - public equals(diceConfiguration: DiceConfiguration): boolean; + equals(diceConfiguration: DiceConfiguration): boolean; /** * Liefert den Befehl, der im Chat eingegeben werden kann, um einen Wurf auszuführen, * der zur DiceConfiguration passt. * @since AppServer 82248 */ - public getChatCommand(): string; + getChatCommand(): string; } /** @@ -1078,11 +1082,11 @@ declare class DiceConfigurationFactory { /** * Fügt der Konfiguration einen Würfel hinzu. */ - public addDice(dice: Dice): void; + addDice(dice: Dice): void; /** * Liefert die Anzahl der Würfel, die zur Konfiguration gehören. */ - public computeCurrentDiceCount(): number; + computeCurrentDiceCount(): number; /** * Setzt die Information, ob ein offener Wurf oder ein normaler Wurf stattfinden soll. * Offene Würfelwürfe sind speziell. Falls die Augenzahl des Würfels die Maximalsumme zeigt, @@ -1091,19 +1095,19 @@ declare class DiceConfigurationFactory { * * Beispiel: /diceo 1w4 -> 4 -> 4 -> 3 = 11 */ - public setUseOpenThrow(shouldUseOpenThrow: boolean): void; + setUseOpenThrow(shouldUseOpenThrow: boolean): void; /** * Setzt die Information, ob der Würfelwurf privat stattfinden soll. */ - public setShouldUsePrivateThrow(shouldUsePrivateThrow: boolean): void; + setShouldUsePrivateThrow(shouldUsePrivateThrow: boolean): void; /** * Liefert die erzeugte Würfelkonfiguration. */ - public getDiceConfiguration(): DiceConfiguration; + getDiceConfiguration(): DiceConfiguration; /** * Erzeugt eine Würfelkonfiguration. */ - public static fromString(diceConfigurationString: string): DiceConfiguration; + static fromString(diceConfigurationString: string): DiceConfiguration; } /** @@ -1114,11 +1118,11 @@ declare class DiceEvent { /** * Liefert den Nutzer, der gewürfelt hat. */ - public getUser(): User; + getUser(): User; /** * Liefert das DiceResult des Würfelwurfs. */ - public getDiceResult(): DiceResult; + getDiceResult(): DiceResult; } /** @@ -1128,15 +1132,15 @@ declare class DiceResult { /** * Liefert die Konfiguration mit der gewürfelt wurde. */ - public getDiceConfiguration(): DiceConfiguration; + getDiceConfiguration(): DiceConfiguration; /** * Liefert ein Array mit Details zu den einzelnen Ergebnissen pro Würfeltyp. */ - public getSingleDiceResults(): SingleDiceResult[]; + getSingleDiceResults(): SingleDiceResult[]; /** * Liefert die Summe der Augenzahlen aller Würfel */ - public totalSum(): number; + totalSum(): number; } /** @@ -1146,7 +1150,7 @@ declare class Domain { /** * Liefert ein den Domain-Namen der aktuellen Domain. */ - public getDomainName(): string; + getDomainName(): string; } /** @@ -1157,32 +1161,36 @@ declare class ExternalServerAccess { /** * Liefert eine Liste aller zugreifbaren Domains */ - public getAllAccessibleDomains(): Domain[]; + getAllAccessibleDomains(): Domain[]; /** * Prüft den Zugriff auf eine bestimmte URL. Wird je Kombination von "Protokoll + Host + Port" geprüft.
    * Beispiel: http://www.example.de:8080 */ - public canAccessURL(urlString: string): boolean; + canAccessURL(urlString: string): boolean; /** * Macht einen GET-Request auf die übergebene URL und liefert den Inhalt zurück. * Diese Methode ist eine Convenience-Methode für externalServerAccess.callURL(). */ - public getURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; }): void; + getURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; + onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; }): void; /** * Macht einen POST-Request auf die übergebene URL und liefert den Inhalt zurück. * Diese Methode ist eine Convenience-Methode für externalServerAccess.callURL(). */ - public postURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; data?: Json; }): void; + postURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; + onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; data?: Json; }): void; /** * Macht einen GET-Request auf die übergebene URL. Im Gegensatz zum GET-Request wird der Inhalt der Webseite wird nicht ausgelesen. * Aus diesem Grund ist diese Methode schneller. * Diese Methode ist eine Convenience-Methode für externalServerAccess.callURL(). */ - public touchURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; }): void; + touchURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; + onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; }): void; /** * Macht einen Request auf die übergebene URL. */ - public callURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; method?: ("GET" | "POST"); data?: Json; }): void; + callURL(urlString: string, parameters?: { onSuccess?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; + onFailure?: (responseData: string, externalServerResponse: ExternalServerResponse) => void; method?: ("GET" | "POST"); data?: Json; }): void; } /** @@ -1193,15 +1201,15 @@ declare class ExternalServerResponse { /** * Liefert die abgefragte URL. */ - public getURLString(): string; + getURLString(): string; /** * Liefert den HTTP-Statuscode der Seite. */ - public getResponseCode(): number; + getResponseCode(): number; /** * Liefert ein Objekt, das die Headerdaten der Antwort enthält. */ - public getHeaderFields(): { [key: string]: string[] }; + getHeaderFields(): { [key: string]: string[] }; } /** @@ -1211,15 +1219,15 @@ declare class Gender { /** * Das Geschlecht ist männlich. */ - public static readonly Male: Gender; + static readonly Male: Gender; /** * Das Geschlecht ist weiblich. */ - public static readonly Female: Gender; + static readonly Female: Gender; /** * Das Geschlecht ist nicht bekannt. */ - public static readonly Unknown: Gender; + static readonly Unknown: Gender; } /** @@ -1229,15 +1237,15 @@ declare class HTMLFile { /** * */ - public constructor(assetPath: string, pageData?: Json); + constructor(assetPath: string, pageData?: Json); /** * Liefert den Pfad, der beim Anlegen der HTMLFile-Instanz genutzt wurde. */ - public getAssetPath(): string; + getAssetPath(): string; /** * Liefert die pageData, die beim Anlegen der HTMLFile-Instanz genutzt wurden. */ - public getPageData(): Json; + getPageData(): Json; } /** @@ -1249,37 +1257,37 @@ declare class KnuddelAccount { * Liefert den KnuddelAmount eines Users, * über den die App gerade frei verfügen kann. */ - public getKnuddelAmount(): KnuddelAmount; + getKnuddelAmount(): KnuddelAmount; /** * Liefert den KnuddelAmount aus dem KnuddelAccount, * der bereits von der App genutzt wurde. * Beim Auszahlen dieser Knuddel aus dem KnuddelAccount an den * User fallen Steuern an. */ - public getKnuddelAmountUsed(): KnuddelAmount; + getKnuddelAmountUsed(): KnuddelAmount; /** * Liefert den KnuddelAmount aus dem KnuddelAccount, * der noch nicht von der App genutzt wurde. * Beim Auszahlen dieser Knuddel aus dem KnuddelAccount an den * User fallen keine Steuern an. */ - public getKnuddelAmountUnused(): KnuddelAmount; + getKnuddelAmountUnused(): KnuddelAmount; /** * Liefert die Summe aller Transfers, die die App an diesen KnuddelAccount bzw. User überwiesen hat. */ - public getTotalKnuddelAmountAppToUser(): KnuddelAmount; + getTotalKnuddelAmountAppToUser(): KnuddelAmount; /** * Liefert die Summe aller Transfers, die die App von diesem KnuddelAccount bzw. User abgebucht/erhalten hat. */ - public getTotalKnuddelAmountUserToApp(): KnuddelAmount; + getTotalKnuddelAmountUserToApp(): KnuddelAmount; /** * Liefert die Information, ob in diesem Moment genug Knuddel verfügbar sind. */ - public hasEnough(knuddelAmount: KnuddelAmount): boolean; + hasEnough(knuddelAmount: KnuddelAmount): boolean; /** * Liefert den Nutzer, dem der KnuddelAccount gehört. */ - public getUser(): User; + getUser(): User; /** * Versucht eine bestimmte Menge Knuddel zu verwenden. Dies ist nur möglich, wenn der User auf seinem KnuddelAccount * genug Knuddel besitzt und online im Channel ist. @@ -1290,7 +1298,7 @@ declare class KnuddelAccount { * *

    Hinweis: Knuddel an einen Nutzer senden kannst du mit der Methode BotUser/transferKnuddel:method. */ - public use(knuddelAmount: KnuddelAmount, displayReasonText: string, parameters?: { transferReason?: string; onError?: (message: string) => void; onSuccess?: () => void; }): void; + use(knuddelAmount: KnuddelAmount, displayReasonText: string, parameters?: { transferReason?: string; onError?: (message: string) => void; onSuccess?: () => void; }): void; } /** @@ -1300,31 +1308,31 @@ declare class KnuddelAmount { /** * Erzeugt eine Instanz von KnuddelAmount mit der Anzahl Knuddel. */ - public constructor(knuddel: number); + constructor(knuddel: number); /** * Erzeugt eine Instanz von KnuddelAmount mit einer bestimmten Cent-Anzahl. */ - public static fromCents(knuddel: number): KnuddelAmount; + static fromCents(knuddel: number): KnuddelAmount; /** * Erzeugt eine Instanz von KnuddelAmount mit einer bestimmten Knuddel-Anzahl. */ - public static fromKnuddel(knuddel: number): KnuddelAmount; + static fromKnuddel(knuddel: number): KnuddelAmount; /** * Liefert die Anzahl der Knuddel in KnuddelCent zurück. */ - public getKnuddelCents(): number; + getKnuddelCents(): number; /** * Gibt den Wert der Knuddel als Zahl zurück. */ - public asNumber(): number; + asNumber(): number; /** * Liefert eine negierte Kopie des KnuddelAmount zurück. */ - public negate(): KnuddelAmount; + negate(): KnuddelAmount; /** * Liefert die Information, ob der Knuddelwert unter 0 ist. */ - public isNegative(): boolean; + isNegative(): boolean; } /** @@ -1338,59 +1346,59 @@ declare class KnuddelPot { /** * Liefert die id des KnuddelPot. */ - public getId(): number; + getId(): number; /** * Liefert den Status des KnuddelPot. */ - public getState(): KnuddelPotState; + getState(): KnuddelPotState; /** * Liefert den beim Kreieren des KnuddelPots festgelegten KnuddelAmount, den jeder Teilnehmer zahlen muss. */ - public getKnuddelAmountPerParticipant(): KnuddelAmount; + getKnuddelAmountPerParticipant(): KnuddelAmount; /** * Liefert den KnuddelAmount, der bisher insgesamt in den KnuddelPot eingezahlt wurde. */ - public getKnuddelAmountTotal(): KnuddelAmount; + getKnuddelAmountTotal(): KnuddelAmount; /** * Liefert die Liste der Teilnehmer, die bisher in den KnuddelPot eingezahlt haben. */ - public getParticipants(): User[]; + getParticipants(): User[]; /** * Liefert den höchsten Multiplikator, der gültig ist. */ - public getMaxFeeMultiplier(): number; + getMaxFeeMultiplier(): number; /** * Setzt den BotUser, der den Anteil der Einzahlungen nach dem Spiel erhält * und den Anteil, vom Gesamtpot, den er erhalten soll. */ - public setFee(feeUser: BotUser, feeMultiplier: number): void; + setFee(feeUser: BotUser, feeMultiplier: number): void; /** * Liefert den mit KnuddelPot/setFee:method gesetzten BotUser an den die Gebühr ausbezahlt wird. */ - public getFeeUser(): User; + getFeeUser(): User; /** * Liefert den mit KnuddelPot/setFee:method gesetzten Multiplikator der Gebühr. */ - public getFeeMultiplier(): number; + getFeeMultiplier(): number; /** * Versiegelt den KnuddelPot, sodass keine weiteren Einzahlungen vorgenommen * werden können und Gewinne ausgeschüttet werden können. */ - public seal(): void; + seal(): void; /** * Bezahlt alle Einsätze an die Teilnehmer zurück und informiert mit dem übergeben Text über den Grund. */ - public refund(reason?: string): void; + refund(reason?: string): void; /** * Fügt einen Gewinner in die Liste der Gewinner hinzu. * Der zweite Parameter ist die Gewichtung mit der ausgezahlt werden soll. * Wird der Parameter weggelassen, so ist er automatisch 1. */ - public addWinner(user: User, weight?: number): void; + addWinner(user: User, weight?: number): void; /** * Zahlt den KnuddelPot an die mit addWinner gesetzten Gewinner aus. */ - public payout(text?: string): void; + payout(text?: string): void; } /** @@ -1400,15 +1408,15 @@ declare class KnuddelPotState { /** * Der KnuddelPot ist geöffnet und kann neue Teilnehmer annehmen. */ - public static readonly Open: KnuddelPotState; + static readonly Open: KnuddelPotState; /** * Der KnuddelPot ist versiegelt und kann keine neuen Teilnehmer annehmen. */ - public static readonly Sealed: KnuddelPotState; + static readonly Sealed: KnuddelPotState; /** * Der KnuddelPot ist beendet und die Knuddel bereits ausgezahlt. */ - public static readonly Closed: KnuddelPotState; + static readonly Closed: KnuddelPotState; } /** @@ -1422,21 +1430,21 @@ declare class KnuddelTransfer { /** * Liefert den User, der den KnuddelTransfer ausgelöst hat. */ - public getSender(): User; + getSender(): User; /** * Liefert den BotUser, der die Knuddel des KnuddelTransfer erhält, * wenn dieser mit accept() angenommen wurde. */ - public getReceiver(): BotUser; + getReceiver(): BotUser; /** * Liefert die Anzahl der Knuddel, die mit diesem Transfer überwiesen werden. */ - public getKnuddelAmount(): KnuddelAmount; + getKnuddelAmount(): KnuddelAmount; /** * Liefert den Grund für den Transfer, der bei der Überweisung angegeben wurde mit * /appknuddel BOTNICK:KNUDDEL:GRUND. */ - public getTransferReason(): string; + getTransferReason(): string; /** * Lehnt die Knuddel aus dem KnuddelTransfer ab und sendet sie zurück an den Absender. * Als Grund sieht der Absender den übergebenen reason. @@ -1449,7 +1457,7 @@ declare class KnuddelTransfer { * KnuddelTransfer/addToPot:method, * KnuddelTransfer/reject:method */ - public reject(reason: string): void; + reject(reason: string): void; /** * Nimmt die Knuddel aus dem KnuddelTransfer an und übergibt sie an den BotUser, * der mit getReceiver() abgefragt werden kann. @@ -1462,11 +1470,11 @@ declare class KnuddelTransfer { * KnuddelTransfer/addToPot:method, * KnuddelTransfer/reject:method */ - public accept(): void; + accept(): void; /** * Liefert die Information, ob ein bestimmter KnuddelTransfer zu einem KnuddelPot hinzugefügt werden kann. */ - public canAddToPot(pot: KnuddelPot): boolean; + canAddToPot(pot: KnuddelPot): boolean; /** * Nimmt die Knuddel aus dem KnuddelTransfer an und übergibt sie an den übergebenen KnuddelPot. * @@ -1480,13 +1488,13 @@ declare class KnuddelTransfer { * KnuddelTransfer/addToPot:method, * KnuddelTransfer/reject:method */ - public addToPot(knuddelPot: KnuddelPot): void; + addToPot(knuddelPot: KnuddelPot): void; /** * Liefert die Information, ob der KnuddelTransfer bereits verarbeitet wurde. * Falls die Methode false zurückliefert muss noch entschieden werden, ob der * KnuddelTransfer angenommen oder abgelehnt wird. */ - public isProcessed(): boolean; + isProcessed(): boolean; } /** @@ -1496,15 +1504,15 @@ declare class KnuddelTransferDisplayType { /** * Nachricht wird öffentlich angezeigt. */ - public static readonly Public: KnuddelTransferDisplayType; + static readonly Public: KnuddelTransferDisplayType; /** * Nachricht wird privat angezeigt. */ - public static readonly Private: KnuddelTransferDisplayType; + static readonly Private: KnuddelTransferDisplayType; /** * Nachricht wird als /m zugestellt. */ - public static readonly Post: KnuddelTransferDisplayType; + static readonly Post: KnuddelTransferDisplayType; } /** @@ -1515,82 +1523,82 @@ declare class KnuddelsServer { /** * Liefert den BotUser, der standardmäßig zur App gehört. */ - public static getDefaultBotUser(): BotUser; + static getDefaultBotUser(): BotUser; /** * Liefert die AppPersistence, mit der sich Zahlen, Strings und Javascript-Objekte langfristig und über die Session einer App hinaus gespeichert werden können. */ - public static getPersistence(): AppPersistence; + static getPersistence(): AppPersistence; /** * Liefert den Channel in dem die App läuft. */ - public static getChannel(): Channel; + static getChannel(): Channel; /** * Liefert das UserAccess-Objekt, über das * User zugreifbar werden. */ - public static getUserAccess(): UserAccess; + static getUserAccess(): UserAccess; /** * Liefert ein ExternalServerAccess-Objekt, mit dem * andere Server angesteuert werden können. */ - public getExternalServerAccess(): ExternalServerAccess; + getExternalServerAccess(): ExternalServerAccess; /** * Aktualisiert die Liste der genutzten Hooks. Werden zur Laufzeit chatCommands oder App-Hooks (wie mayJoinChannel) dynamisch erzeugt oder gelöscht, so muss danach refreshHooks() * aufgerufen werden, damit diese Änderung wirksam wird. */ - public static refreshHooks(): void; + static refreshHooks(): void; /** * Liefert den Standard-Logger für diese App. Alles, was geloggt wird, wird vom Nutzer "App-Logs" als private Nachricht zugestellt. */ - public static getDefaultLogger(): Logger; + static getDefaultLogger(): Logger; /** * Liefert den Pfad eines Bildes zur Integration in der eigenen App. * Alle Bilder, die im Ordner /www in der App abgelegt werden können hier referenziert werden. */ - public static getFullImagePath(imageName: string): string; + static getFullImagePath(imageName: string): string; /** * Liefert den Pfad eines Systembildes zur Integration in der eigenen App. * Alle Bilder, die unter http://apps4.knuddels.biz/kimg/ * erreichbar sind können hier referenziert werden. */ - public static getFullSystemImagePath(imageName: string): string; + static getFullSystemImagePath(imageName: string): string; /** * Liefert die Informationen über den ChatServer auf dem die App läuft. */ - public static getChatServerInfo(): ChatServerInfo; + static getChatServerInfo(): ChatServerInfo; /** * Liefert die Informationen über den AppServer auf dem die App läuft. */ - public static getAppServerInfo(): AppServerInfo; + static getAppServerInfo(): AppServerInfo; /** * Liefert das AppAccess-Object. */ - public static getAppAccess(): AppAccess; + static getAppAccess(): AppAccess; /** * Erzeugt einen KnuddelPot. * * Ist ein KnuddelPot 30 Minuten nach dem Erzeugen noch nicht gesealt, * so wird vom Server automatisch ein KnuddelPot/refund:method ausgelöst. */ - public static createKnuddelPot(knuddelAmount: KnuddelAmount, params?: { payoutTimeoutMinutes?: number; shouldSealPot?: (pot: KnuddelPot) => boolean; onPotSealed?: (pot: KnuddelPot) => void; }): KnuddelPot; + static createKnuddelPot(knuddelAmount: KnuddelAmount, params?: { payoutTimeoutMinutes?: number; shouldSealPot?: (pot: KnuddelPot) => boolean; onPotSealed?: (pot: KnuddelPot) => void; }): KnuddelPot; /** * Liefert den KnuddelPot mit der angegeben id. */ - public static getKnuddelPot(id: number): (KnuddelPot|null); + static getKnuddelPot(id: number): (KnuddelPot|null); /** * Liefert alle für die App noch verwaltbaren KnuddelPot-Objekte. */ - public static getAllKnuddelPots(): KnuddelPot[]; + static getAllKnuddelPots(): KnuddelPot[]; /** * Liefert das ToplistAccess-Objekt, über das * Toplisten erzeugt und verwaltet werden können. */ - public static getToplistAccess(): ToplistAccess; + static getToplistAccess(): ToplistAccess; /** * Liefert das AppProfileEntryAccess-Objekt, über das * App-Profileinträge erzeugt und verwaltet werden können. */ - public static getAppProfileEntryAccess(): AppProfileEntryAccess; + static getAppProfileEntryAccess(): AppProfileEntryAccess; } /** @@ -1600,30 +1608,30 @@ declare class LoadConfiguration { /** * Setzt die Farbe des Hintergrundes vom Loading-View, der angezeigt wird, während das HTML User Interface lädt. (standardmäßig weiß) */ - public setBackgroundColor(color: Color): void; + setBackgroundColor(color: Color): void; /** * Setzt das Hintergrundbild vom Loading-View, das angezeigt wird, während das HTML User Interface lädt. (standardmäßig nicht gesetzt) */ - public setBackgroundImage(imageUrl: string): void; + setBackgroundImage(imageUrl: string): void; /** * Setzt den Text des Ladehinweiseses im Loading-View, der angezeigt wird, während das HTML User Interface lädt. (standardmäßig "Lädt...") * Hinweis: Wird mit setLoadingIndicatorImage ein Loaading-Indicator-Bild gesetzt, so wird der mit setText gesetzte Texte ignoriert. */ - public setText(text: string): void; + setText(text: string): void; /** * Setzt ein Loading-Indicator-Bild im Loading-View, das angezeigt wird, während das HTML User Interface lädt. (standardmäßig nicht gesetzt) * Hinweis: Wird mit setLoadingIndicatorImage ein Loaading-Indicator-Bild gesetzt, so wird der mit setText gesetzte Texte ignoriert. */ - public setLoadingIndicatorImage(imageUrl: string): void; + setLoadingIndicatorImage(imageUrl: string): void; /** * Setzt die Farbe des Textes im Loading-View, der angezeigt wird, während das HTML User Interface lädt. (standardmäßig schwarz) */ - public setForegroundColor(color: Color): void; + setForegroundColor(color: Color): void; /** * Aktiviert/Deaktiviert die Nutzung vom Loading-View. (standardmäßig aktiviert) * Es kann sinnvoll sein, den Loading-View zu deaktivieren, wenn man selbst einen komplett eigenen Loading-View in seine App einbauen möchte. */ - public setEnabled(enabled: boolean): void; + setEnabled(enabled: boolean): void; } /** @@ -1641,31 +1649,31 @@ declare class Logger { * * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. */ - public debug(...msg: any[]): void; + debug(...msg: any[]): void; /** * Logge einen Text mit Level INFO. Dieser wird im Chat allen dafür registrierten AppManagern per /p vom App-Logs-User zugestellt. Siehe: /apps, Tab: Logs. * * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. */ - public info(...msg: any[]): void; + info(...msg: any[]): void; /** * Logge einen Text mit Level WARN. Dieser wird im Chat allen dafür registrierten AppManagern per /p vom App-Logs-User zugestellt, sowie im /apps Fenster im Log angezeigt. Siehe: /apps, Tab: Logs. * * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. */ - public warn(...msg: any[]): void; + warn(...msg: any[]): void; /** * Logge einen Text mit Level ERROR. Dieser wird im Chat allen dafür registrierten AppManagern per /p vom App-Logs-User zugestellt, sowie im /apps Fenster im Log angezeigt. Siehe: /apps, Tab: Logs. * * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. */ - public error(...msg: any[]): void; + error(...msg: any[]): void; /** * Logge einen Text mit Level FATAL. Dieser wird im Chat allen dafür registrierten AppManagern per /p vom App-Logs-User zugestellt, sowie im /apps Fenster im Log angezeigt. Siehe: /apps, Tab: Logs. * * Die Methode erwartet beliebig viele Strings als Parameter. Diese werden vor dem Logging mit einem Leerzeichen gejoint. */ - public fatal(...msg: any[]): void; + fatal(...msg: any[]): void; } /** @@ -1675,15 +1683,15 @@ declare class Message { /** * Liefert den User, der die Nachricht verfasst hat. */ - public getAuthor(): User; + getAuthor(): User; /** * Liefert den Inhalt der Nachricht. */ - public getText(): string; + getText(): string; /** * Liefert den genauen Zeitpunkt, zu dem die Nachricht erstellt wurde. */ - public getCreationDate(): Date; + getCreationDate(): Date; } /** @@ -1697,7 +1705,7 @@ declare class OwnAppInstance { * Gibt Zugriff auf Nutzer, die gerade im Channel dieser AppInstance online sind. * @since AppServer 82560 */ - public getOnlineUsers(otherAppInstance: AppInstance, ...userType: UserType[]): User[]; + getOnlineUsers(otherAppInstance: AppInstance, ...userType: UserType[]): User[]; } /** @@ -1714,67 +1722,67 @@ declare class Persistence { /** * Informiert darüber, ob unter dem key ein String abgespeichert ist. */ - public hasString(key: string): boolean; + hasString(key: string): boolean; /** * Setzt die Zeichenkette value für den key. * Falls bereits eine Zeichenkette für den key existiert, so wird diese überschrieben. */ - public setString(key: string, value: string): void; + setString(key: string, value: string): void; /** * Liefert die Zeichenkette, die für den key gespeichert ist. * Falls für key keine Zeichenkette gespeichert ist, so gibt die Methode * den defaultValue zurück. */ - public getString(key: string, defaultValue?: string): string; + getString(key: string, defaultValue?: string): string; /** * Löscht die Zeichenkette, die unter key gespeichert ist. */ - public deleteString(key: string): void; + deleteString(key: string): void; /** * Informiert darüber, ob unter dem key eine Zahl abgespeichert ist. */ - public hasNumber(key: string): boolean; + hasNumber(key: string): boolean; /** * Setzt die Zahl value für den key. * Falls bereits eine Zahl für den key existiert, so wird diese überschrieben. */ - public setNumber(key: string, value: number): void; + setNumber(key: string, value: number): void; /** * Addiert den übergebenen value auf die unter dem Key key vorhandenen Wert drauf. * Value kann auch negativ sein um eine Subtraktion durchzuführen. * Falls keine Zahl für den key existiert, so wird der value für key gespeichert. */ - public addNumber(key: string, value: number): number; + addNumber(key: string, value: number): number; /** * Liefert die Zahl, die für den key gespeichert ist. * Falls für key keine Zahl gespeichert ist, so gibt die Methode * den defaultValue zurück. */ - public getNumber(key: string, defaultValue?: number): number; + getNumber(key: string, defaultValue?: number): number; /** * Löscht die Zahl, die unter key gespeichert ist. */ - public deleteNumber(key: string): void; + deleteNumber(key: string): void; /** * Informiert darüber, ob unter dem key ein Objekt abgespeichert ist. */ - public hasObject(key: string): boolean; + hasObject(key: string): boolean; /** * Setzt das Objekt value für den key. * Falls bereits ein Objekt für den key existiert, so wird dieses überschrieben. * Das als JSON serialisierte Objekt darf maximal 100kb groß sein. */ - public setObject(key: string, object: (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable)): void; + setObject(key: string, object: (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable)): void; /** * Liefert das Objekt, das für den key gespeichert ist. * Falls für key kein Objekt gespeichert ist, so gibt die Methode * den defaultValue zurück. */ - public getObject(key: string, defaultValue?: (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable)): (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable); + getObject(key: string, defaultValue?: (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable)): (KnuddelsJson | KnuddelsJsonArray | KnuddelsSerializable); /** * Löscht das Objekt, das unter key gespeichert ist. */ - public deleteObject(key: string): void; + deleteObject(key: string): void; } /** @@ -1789,11 +1797,11 @@ declare class PrivateMessage extends Message { /** * Liefert die Liste der Empfänger der Nachricht. */ - public getReceivingUsers(): User[]; + getReceivingUsers(): User[]; /** * Sendet eine private Nachricht an alle Beteiligten des Gespräches. */ - public sendReply(text: string): void; + sendReply(text: string): void; } /** @@ -1828,12 +1836,12 @@ declare class Quest { * Löst ein Quest-Event aus. * @since AppServer 82290, ChatServer 82290 */ - public setSolved(count?: number): void; + setSolved(count?: number): void; /** * Liefert den Key der Quest. * @since AppServer 82290, ChatServer 82290 */ - public getQuestKey(): string; + getQuestKey(): string; } /** @@ -1848,22 +1856,22 @@ declare class QuestAccess { * für diesen Nutzer in dieser App. * @since AppServer 82290, ChatServer 82290 */ - public getQuests(): Quest[]; + getQuests(): Quest[]; /** * Liefert die Information, ob eine bestimmte Quest offen ist. * @since AppServer 82290, ChatServer 82290 */ - public hasQuest(questKey: string): boolean; + hasQuest(questKey: string): boolean; /** * Liefert eine bestimmte Quest, falls vorhanden. * @since AppServer 82290, ChatServer 82290 */ - public getQuest(questKey: string): (Quest|null); + getQuest(questKey: string): (Quest|null); /** * Liefert den User, der zu diesem QuestAccess-Objekt gehört. * @since AppServer 82290, ChatServer 82290 */ - public getUser(): User; + getUser(): User; } /** @@ -1873,29 +1881,29 @@ declare class RandomOperations { /** * Liefert eine Zufallszahl zwischen minValue (inklusiv) und maxValue (exklusiv). */ - public static nextInt(minValue: number /* optional */, maxValue: number): number; + static nextInt(minValue: number /* optional */, maxValue: number): number; /** * Liefert ein Array mit Zufallszahlen zwischen minValue (inklusiv) und n (exklusiv). */ - public static nextInts(minValue: number /* optional */, maxValue: number, count: number, onlyDifferentNumbers: boolean): number[]; + static nextInts(minValue: number /* optional */, maxValue: number, count: number, onlyDifferentNumbers: boolean): number[]; /** * Liefert true in truePropability/1 Fällen */ - public static flipTrue(truePropability: number): boolean; + static flipTrue(truePropability: number): boolean; /** * Liefert ein zufälliges Objekt aus einem Array. * Falls das Array leer ist, wird null zurückgeliefert. */ - public static getRandomObject(objects: T[]): T; + static getRandomObject(objects: T[]): T; /** * Mischt das Array der übergebenen Objekte und liefert es zurück. */ - public static shuffleObjects(objects: T[]): T[]; + static shuffleObjects(objects: T[]): T[]; /** * Liefert einen zufälligen String zurück. * @since AppServer 92699 */ - public static getRandomString(length: number, allowedCharacters?: string): string; + static getRandomString(length: number, allowedCharacters?: string): string; } /** @@ -1908,11 +1916,11 @@ declare class RootAppInstance extends AppInstance { /** * Aktualisiert diese App im Channel (und ggf. vorhandenen Tochterchanneln) auf die neueste Version. */ - public updateApp(message: string /* optional */, logMessage?: string): void; + updateApp(message: string /* optional */, logMessage?: string): void; /** * Stoppt diese App. */ - public stopApp(message: string /* optional */, logMessage?: string): void; + stopApp(message: string /* optional */, logMessage?: string): void; } /** @@ -1922,11 +1930,11 @@ declare class ServerInfo { /** * Liefert die interne ServerId des Servers. */ - public getServerId(): string; + getServerId(): string; /** * Liefert die Code-Revision des Servers. */ - public getRevision(): number; + getRevision(): number; } /** @@ -1938,15 +1946,15 @@ declare class SingleDiceResult { /** * Liefert den Würfel zurück, durch den dieses SingleDiceResult erzeugt wurde. */ - public getDice(): Dice; + getDice(): Dice; /** * Liefert die Ziffern, die gewürfelt wurden. */ - public valuesRolled(): number[]; + valuesRolled(): number[]; /** * Liefert die Summe der Augenzahlen des SingleDiceResult. */ - public sum(): number; + sum(): number; } /** @@ -2026,12 +2034,7 @@ declare interface String { * Erstellt eine Kopie des String, in dem alle Vorkommnisse des String search in replacement * ersetzt werden und liefert diesen zurück. */ - replaceAll(search: string, replacement: string): string; - /** - * Erstellt eine Kopie des String, in dem alle Vorkommnisse des regulären Ausdrucks regexp in replacement - * ersetzt werden und liefert diesen zurück. - */ - replaceAll(regexp: RegExp, replacement: string): string; + replaceAll(search: string | RegExp, replacement: string): string; /** * Prüft primitiv, ob der String laut Knuddels-Filterregeln ok ist. * @since ChatServer 82262, AppServer 82262 @@ -2046,37 +2049,37 @@ declare class Toplist { /** * Liefert den userPersistenceNumberKey mit dem die Topliste erzeugt wurde. */ - public getUserPersistenceNumberKey(): string; + getUserPersistenceNumberKey(): string; /** * Liefert den Anzeigenamen der Topliste. */ - public getDisplayName(): string; + getDisplayName(): string; /** * Liefert den Befehl, der im Chat eingegeben werden kann, um diese Topliste zu öffnen. * Wird ein User oder eine userId übergeben, so öffnet sich die Topliste mit diesem Nutzer im Fokus. */ - public getChatCommand(user_or_userId?: (User|number)): string; + getChatCommand(user_or_userId?: (User|number)): string; /** * Liefert den Anzeigenamen für den übergebenen User oder eine userId. */ - public getLabel(user_or_userId: (User|number)): string; + getLabel(user_or_userId: (User|number)): string; /** * Legt einen Change-Listener an, der jedes mal aufgerufen wird, wenn ein User * einen neuen Anzeigenamen erhält. */ - public addLabelChangeListener(listener: (labelChangeEvent: ToplistLabelChangeEvent) => void): void; + addLabelChangeListener(listener: (labelChangeEvent: ToplistLabelChangeEvent) => void): void; /** * Löscht einen LabelChangeListener, der mit Toplist/addLabelChangeListener:method erzeugt wurde. */ - public removeLabelChangeListener(listener: (labelChangeEvent: ToplistLabelChangeEvent) => void): void; + removeLabelChangeListener(listener: (labelChangeEvent: ToplistLabelChangeEvent) => void): void; /** * Legt einen Change-Listener an, der jedes mal aufgerufen wird, wenn ein sich der Rang User eines Nutzers ändert. */ - public addRankChangeListener(listener: (rankChangeEvent: ToplistRankChangeEvent) => void): void; + addRankChangeListener(listener: (rankChangeEvent: ToplistRankChangeEvent) => void): void; /** * Löscht einen RankChangeListener, der mit Toplist/addRankChangeListener:method erzeugt wurde. */ - public removeRankChangeListener(listener: (rankChangeEvent: ToplistRankChangeEvent) => void): void; + removeRankChangeListener(listener: (rankChangeEvent: ToplistRankChangeEvent) => void): void; } /** @@ -2090,19 +2093,19 @@ declare class ToplistAccess { /** * Liefert die Liste aller Toplisten, die diese App erzeugt hat. */ - public getAllToplists(): Toplist[]; + getAllToplists(): Toplist[]; /** * Liefert die Toplist mit dem Persistenz-Key zurück. */ - public getToplist(userPersistenceNumberKey: string): Toplist; + getToplist(userPersistenceNumberKey: string): Toplist; /** * Löscht die übergebene Toplist oder die Toplist mit dem Persistenz-Key. */ - public removeToplist(toplist: Toplist): void; + removeToplist(toplist: Toplist): void; /** * Erzeugt oder aktualisiert die Toplist für den übergebenen userPersistenceNumberKey. */ - public createOrUpdateToplist(userPersistenceNumberKey: string, displayName: string, parameters?: { labelMapping?: { [minValue: string]: string }; ascending?: boolean; }): Toplist; + createOrUpdateToplist(userPersistenceNumberKey: string, displayName: string, parameters?: { labelMapping?: { [minValue: string]: string }; ascending?: boolean; }): Toplist; } /** @@ -2112,19 +2115,19 @@ declare class ToplistDisplayType { /** * Nur Anzeigename anzeigen. */ - public static readonly Label: ToplistDisplayType; + static readonly Label: ToplistDisplayType; /** * Gespeicherten Wert anzeigen. */ - public static readonly Value: ToplistDisplayType; + static readonly Value: ToplistDisplayType; /** * Anzeigename und Rang anzeigen. */ - public static readonly LabelAndRank: ToplistDisplayType; + static readonly LabelAndRank: ToplistDisplayType; /** * Wert und Rang anzeigen. */ - public static readonly ValueAndRank: ToplistDisplayType; + static readonly ValueAndRank: ToplistDisplayType; } /** @@ -2139,29 +2142,29 @@ declare class ToplistLabelChangeEvent { /** * Liefert die zugehörige Toplist. */ - public getToplist(): Toplist; + getToplist(): Toplist; /** * Liefert den vorherigen Anzeigenamen. Hatte der User vorher keinen * Anzeigenamen, so ist dieser Wert null. */ - public getOldLabel(): string; + getOldLabel(): string; /** * Liefert den neuen Anzeigenamen. Hatte der User nun keinen * Anzeigenamen mehr, so ist dieser Wert null. */ - public getNewLabel(): string; + getNewLabel(): string; /** * Liefert den User für den das Event ausgelöst wurde. */ - public getUser(): User; + getUser(): User; /** * Liefert den Wert, der vor der Änderung gespeichert war. */ - public getOldValue(): number; + getOldValue(): number; /** * Liefert den neuen Wert. */ - public getNewValue(): number; + getNewValue(): number; } /** @@ -2176,33 +2179,33 @@ declare class ToplistRankChangeEvent { /** * Liefert die zugehörige Toplist. */ - public getToplist(): Toplist; + getToplist(): Toplist; /** * Liefert den Toplisten-Rang, den der User vor der Änderung hatte. */ - public getOldRank(): number; + getOldRank(): number; /** * Liefert den neuen Toplisten-Rang, des Users. */ - public getNewRank(): number; + getNewRank(): number; /** * Liefert den User für den das Event ausgelöst wurde. */ - public getUser(): User; + getUser(): User; /** * Liefert die User, die bei dieser Änderung überholt worden sind. *

    Achtung: Wenn mehr als 10 User * überholt wurden, so liefert die Methode die besten 10 überholten User. */ - public getUsersOvertook(): User[]; + getUsersOvertook(): User[]; /** * Liefert den Wert, der vor der Änderung gespeichert war. */ - public getOldValue(): number; + getOldValue(): number; /** * Liefert den neuen Wert. */ - public getNewValue(): number; + getNewValue(): number; } /** @@ -2212,43 +2215,43 @@ declare class User { /** * Liefert die eindeutige Nutzerkennung des Nutzers. */ - public getUserId(): number; + getUserId(): number; /** * Liefert den Nicknamen des Nutzers. */ - public getNick(): string; + getNick(): string; /** * Liefert das Alter des Nutzers. Bei Nutzern, die bereits sehr lange in der Plattform sind kann es vorkommen, dass kein Alter angegeben wurde. In diesem Fall ist das Alter 0. */ - public getAge(): number; + getAge(): number; /** * Liefert das Geschlecht des Nutzers. */ - public getGender(): Gender; + getGender(): Gender; /** * Liefert den Zeitpunkt der Registrierung des Nutzers. */ - public getRegDate(): Date; + getRegDate(): Date; /** * Liefert den UserStatus des Nutzers. */ - public getUserStatus(): UserStatus; + getUserStatus(): UserStatus; /** * Liefert den UserType des Nutzers. */ - public getUserType(): UserType; + getUserType(): UserType; /** * Liefert den aktuellen ClientType des Nutzers oder Offline wenn er nicht im Chat online ist. */ - public getClientType(): ClientType; + getClientType(): ClientType; /** * Prüft ob der Client des Users den übergebenen AppViewMode (für User/sendAppContent:method) anzeigen kann. */ - public canShowAppViewMode(mode: AppViewMode): boolean; + canShowAppViewMode(mode: AppViewMode): boolean; /** * Prüft ob der Client des User's den übergebenen AppContent anzeigen kann. */ - public canSendAppContent(appContent: AppContent): boolean; + canSendAppContent(appContent: AppContent): boolean; /** * Prüft, ob der User in dem angegebenen Team ist. * Dies funktioniert derzeit nur für Teams, die eine eigene /fa haben. @@ -2256,164 +2259,164 @@ declare class User { * Achtung: Bei Nutzern, die neu in ein Team kommen, funktioniert die Abfrage erst dann korrekt, * wenn er sich neu in den Channel eingeloggt hat. */ - public isInTeam(teamName: string, subTeamName?: string): boolean; + isInTeam(teamName: string, subTeamName?: string): boolean; /** * Liefert ein UserPersistence-Objekt für diesen Nutzer. Mit diesem Objekt kann eine App sich Dinge über diesen speziellen Nutzer merken. */ - public getPersistence(): UserPersistence; + getPersistence(): UserPersistence; /** * Shortcut-Funktion um mit dem DefaultBotUser eine private Nachricht zu versenden. */ - public sendPrivateMessage(message: string): void; + sendPrivateMessage(message: string): void; /** * Shortcut-Funktion um mit dem DefaultBotUser eine /m zu versenden. */ - public sendPostMessage(topic: string, text: string): void; + sendPostMessage(topic: string, text: string): void; /** * Liefert die Information, ob dieser Nutzer Channelbesitzer im Channel der App ist. */ - public isChannelOwner(): boolean; + isChannelOwner(): boolean; /** * Liefert die Information, ob der Channel der App * ein Lieblingschannel des Nutzers ist. */ - public isLikingChannel(): boolean; + isLikingChannel(): boolean; /** * Liefert die Information, ob der Nutzer im harten Kern des Channels der App ist. * @since AppServer 92701, ChatServer 92701 */ - public isChannelCoreUser(): boolean; + isChannelCoreUser(): boolean; /** * Liefert die Information, ob dieser Nutzer ein AppManager für diese App ist. Die Channelbesitzer zählen automatisch auch als AppManager. */ - public isAppManager(): boolean; + isAppManager(): boolean; /** * Liefert Information, ob dieser Nutzer derzeit für das Schreiben öffentlicher Nachrichten im Channel gesperrt ist. */ - public isMuted(): boolean; + isMuted(): boolean; /** * Liefert Information, ob dieser Nutzer beim Schreiben öffentlicher Nachrichten im Channel * derzeit für die Verwendung von Textformatierungen, Farben und Smileys gesperrt ist. */ - public isColorMuted(): boolean; + isColorMuted(): boolean; /** * Liefert Information, ob dieser Nutzer derzeit für das Betreten des Channel gesperrt ist. */ - public isLocked(): boolean; + isLocked(): boolean; /** * Liefert Information, ob dieser Nutzer Channelmoderator im Channel der App ist. */ - public isChannelModerator(): boolean; + isChannelModerator(): boolean; /** * Liefert Information, ob dieser Nutzer Eventmoderator im Channel der App ist. */ - public isEventModerator(): boolean; + isEventModerator(): boolean; /** * Liefert Information, ob dieser Nutzers der Entwickler der App ist. */ - public isAppDeveloper(): boolean; + isAppDeveloper(): boolean; /** * Liefert einen Link zum Profil des Nutzers, den man im Chat anzeigen kann. */ - public getProfileLink(displayText?: string): string; + getProfileLink(displayText?: string): string; /** * Liefert die Information, ob der Nutzer online im Channel der App ist. */ - public isOnlineInChannel(): boolean; + isOnlineInChannel(): boolean; /** * Liefert die Anzahl der Knuddel, die der Nutzer besitzt. */ - public getKnuddelAmount(): KnuddelAmount; + getKnuddelAmount(): KnuddelAmount; /** * Liefert die Information, ob der Nutzer irgendwo im Chat online ist. */ - public isOnline(): boolean; + isOnline(): boolean; /** * Liefert die Readme des Nutzers, die er mit /readme TEXT in sein Profil gesetzt hat. */ - public getReadme(): string; + getReadme(): string; /** * Liefert die vom Nutzer verbrachte Zeit im gesamten Chatsystem In Minuten. * Hinweis: Die Minutenzahl wird derzeit immer nur zu dem Zeitpunkt aktualisiert, * wenn der Nutzer offline geht. */ - public getOnlineMinutes(): number; + getOnlineMinutes(): number; /** * Liefert die Information, ob der Nutzer sich mittels /away-Funktion kurz abgemeldet hat. */ - public isAway(): boolean; + isAway(): boolean; /** * Liefert die Information, ob der Nutzer ein Profilfoto hat. */ - public hasProfilePhoto(): boolean; + hasProfilePhoto(): boolean; /** * (Er)setzt den übergebenen AppContent beim Nutzer. */ - public sendAppContent(appContent: AppContent): AppContentSession; + sendAppContent(appContent: AppContent): AppContentSession; /** * Liefert alle AppContentSession, die der User * aktuell geöffnet hat. */ - public getAppContentSessions(): AppContentSession[]; + getAppContentSessions(): AppContentSession[]; /** * Liefert die AppContentSession, die der User * mit einem bestimmten AppViewMode aktuell geöffnet hat. */ - public getAppContentSession(appViewMode: AppViewMode): AppContentSession; + getAppContentSession(appViewMode: AppViewMode): AppContentSession; /** * Vergleicht den übergebenen Nutzer und liefert true, falls der übergebene Nutzer * identisch ist mit dem aktuellen Nutzer. */ - public equals(user: User): boolean; + equals(user: User): boolean; /** * Liefert die URL zum Profilfoto des Nutzers. Die übergebene Breite und Höhe * liefern dem Server einen Anhaltswert, um das bestmögliche Foto zu finden, * sind aber keine Garantie, dass das Foto diese Ausmaße haben wird. */ - public getProfilePhoto(width: number, height: number): string; + getProfilePhoto(width: number, height: number): string; /** * Liefert das QuestAccess-Objekt * für diesen Nutzer in dieser App. * @since AppServer 82290, ChatServer 82290 */ - public getQuestAccess(): QuestAccess; + getQuestAccess(): QuestAccess; /** * Liefert die Information, ob der Nutzer gerade sein Video streamt. */ - public isStreamingVideo(): boolean; + isStreamingVideo(): boolean; /** * Liefert den KnuddelAccount des Nutzers. */ - public getKnuddelAccount(): KnuddelAccount; + getKnuddelAccount(): KnuddelAccount; /** * Liefert die ChannelTalkPermission für diesen Nutzer in diesem * Channel. */ - public getChannelTalkPermission(): ChannelTalkPermission; + getChannelTalkPermission(): ChannelTalkPermission; /** * Liefert die Information, ob der User ein verifiziertes Profilbild hat. */ - public isProfilePhotoVerified(): boolean; + isProfilePhotoVerified(): boolean; /** * Liefert die Information, ob das Alter des Users verifiziert ist. */ - public isAgeVerified(): boolean; + isAgeVerified(): boolean; /** * Setzt dem Nutzer ein Icon in die Nickliste, das auf der rechten Seite seines Nicks angezeigt wird. * Der Eintrag wird automatisch entfernt, sobald der Nutzer den Channel verlässt, * kann aber auch mit User/removeNicklistIcon:method * entfernt werden. */ - public addNicklistIcon(imagePath: string, imageWidth: number): void; + addNicklistIcon(imagePath: string, imageWidth: number): void; /** * Entfernt dem Nutzer ein über die API gesetztes Icon in die Nickliste. */ - public removeNicklistIcon(imagePath: string): void; + removeNicklistIcon(imagePath: string): void; /** * Startet einen Würfelwurf für den Nutzer, falls er online im Channel ist und er nicht gemuted ist. * @since AppServer 89159, ChatServer 89159 */ - public triggerDice(diceConfiguration: DiceConfiguration): void; + triggerDice(diceConfiguration: DiceConfiguration): void; } /** @@ -2428,30 +2431,32 @@ declare class UserAccess { /** * Liefert die userId des Nutzers mit dem übergebenen Nicknamen. */ - public getUserId(nick: string): number; + getUserId(nick: string): number; /** * Informiert darüber, ob ein Nutzer mit dem übergebenen Nicknamen existiert. */ - public exists(nick: string): boolean; + exists(nick: string): boolean; /** * Informiert darüber, ob der Nutzer mit der übergebenen userId geladen werden darf. Neben dem AppDeveloper können nur Nutzer geladen werden, die sich einmal im Channel befanden, als die App * lief. */ - public mayAccess(userId: number): boolean; + mayAccess(userId: number): boolean; /** * Liefert den Nutzer mit der übergebenen userId. Neben dem AppDeveloper können nur Nutzer geladen werden, die sich einmal im Channel befanden, als die App lief. Es wird empfohlen vor der * Abfrage von getUserById(userId) mit UserAccess/mayAccess:method abzufragen, ob dies funktionieren wird. */ - public getUserById(userId: number): User; + getUserById(userId: number): User; /** * Liefert den Nicknamen des Nutzers mit der übergebenen userId in der korrekten Schreibweise. */ - public getNick(userId: number): string; + getNick(userId: number): string; /** * Loopt über alle zugreifbaren User sortiert nach Registrierzeitpunkt und * führt für jeden User das übergebene Callback aus. */ - public eachAccessibleUser(callback: (user: User, index: number, accessibleUserCount: number, key?: string) => boolean, parameters?: { onStart?: (accessibleUserCount: number, key?: string) => void; onEnd?: (accessibleUserCount: number, key?: string) => void; }): void; + eachAccessibleUser(callback: (user: User, index: number, accessibleUserCount: number, key?: string) => boolean, + parameters?: { onStart?: (accessibleUserCount: number, key?: string) => void; + onEnd?: (accessibleUserCount: number, key?: string) => void; }): void; } /** @@ -2463,22 +2468,22 @@ declare class UserPersistence extends Persistence { * Löscht alle Zahlenwerte, die in dieser UserPersistence gespeichert sind. * @since AppServer 88569 */ - public deleteAllNumbers(): number; + deleteAllNumbers(): number; /** * Löscht alle Objekte, die in dieser UserPersistence gespeichert sind. * @since AppServer 88569 */ - public deleteAllObjects(): number; + deleteAllObjects(): number; /** * Löscht alle Zeichenketten, die in dieser UserPersistence gespeichert sind. * @since AppServer 88569 */ - public deleteAllStrings(): number; + deleteAllStrings(): number; /** * Löscht alle Daten, die in dieser UserPersistence gespeichert sind. * @since AppServer 88569 */ - public deleteAll(): number; + deleteAll(): number; } /** @@ -2488,19 +2493,19 @@ declare class UserPersistenceNumberEntry { /** * Liefert den Nutzer. */ - public getUser(): User; + getUser(): User; /** * Liefert den Wert. */ - public getValue(): number; + getValue(): number; /** * Liefert den Rang des Elements in der Persistenz. */ - public getRank(): number; + getRank(): number; /** * Liefert die Position des Elements in der Persistenz. */ - public getPosition(): number; + getPosition(): number; } /** @@ -2510,35 +2515,35 @@ declare class UserPersistenceNumbers { /** * Liefert die Summe aller via UserPersistence gespeicherten Zahlen für den übergebenen key. */ - public static getSum(key: string): number; + static getSum(key: string): number; /** * Löscht alle gespeicherten Zahlen-Werte für den übergebenen key. */ - public static deleteAll(key: string): number; + static deleteAll(key: string): number; /** * Liefert die Anzahl aller unterschiedlichen Nutzer, die Werte für einen bestimmten key gespeichert haben. * Hierbei kann optional der Wertebereich über die parameters eingegrenzt werden. */ - public static getCount(key: string, parameters?: { minimumValue?: number; maximumValue?: number; }): number; + static getCount(key: string, parameters?: { minimumValue?: number; maximumValue?: number; }): number; /** * Ändert einen bestimmten key bei allen UserPersistence. */ - public static updateKey(oldKeyName: string, newKeyName: string): number; + static updateKey(oldKeyName: string, newKeyName: string): number; /** * Ändert alle Werte für einen bestimmten key, die vorher einen bestimmten anderen Wert hatten in der UserPersistence. *
    Hinweis: Da diese Methode ein Batch-Update ist werden keine Change-Listener (ToplistRankChangeEvent, ToplistLabelChangeEvent) ausgelöst. */ - public static updateValue(key: string, oldValue: number, newValue: number): number; + static updateValue(key: string, oldValue: number, newValue: number): number; /** * Addiert einen Wert für Einträge mit einem bestimmten key in der UserPersistence. *
    Hinweis: Da diese Methode ein Batch-Update ist werden keine Change-Listener (ToplistRankChangeEvent, ToplistLabelChangeEvent) ausgelöst. */ - public static addNumber(key: string, value: number, parameters?: { minimumValue?: number; maximumValue?: number; targetUsers?: User[]; }): number; + static addNumber(key: string, value: number, parameters?: { minimumValue?: number; maximumValue?: number; targetUsers?: User[]; }): number; /** * Liefert ein Array mit UserPersistenceNumberEntry-Objekten für einen bestimmten key. * Hierdurch kann beispielsweise eine blätterbare Topliste abgebildet werden. */ - public static getSortedEntries(key: string, parameters?: { ascending?: boolean; count?: number; page?: number; minimumValue?: number; maximumValue?: number; }): UserPersistenceNumberEntry[]; + static getSortedEntries(key: string, parameters?: { ascending?: boolean; count?: number; page?: number; minimumValue?: number; maximumValue?: number; }): UserPersistenceNumberEntry[]; /** * Liefert ein Array mit UserPersistenceNumberEntry-Objekten für einen bestimmten key. Hierbei werden die nähesten Elemente gewählt, * die am übergebenen User/UserId liegen. @@ -2546,7 +2551,7 @@ declare class UserPersistenceNumbers { * Beispiel: Der Nutzer ist in der Liste auf Position 20, dann werden die Resultate von 14-24 bei einem Count von 10 ausgegeben. * Beispiel: Der Nutzer ist in der Liste auf Position 3, dann werden die Resultate von 1-10 bei einem Count von 10 ausgegeben. */ - public static getSortedEntriesAdjacent(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; count?: number; }): UserPersistenceNumberEntry[]; + static getSortedEntriesAdjacent(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; count?: number; }): UserPersistenceNumberEntry[]; /** * Liefert die absolute Position des Nutzers in der Liste. Die Position ist im Gegensatz zum Rang immer eindeutig. * @@ -2555,23 +2560,25 @@ declare class UserPersistenceNumbers { * Mit der Methode UserPersistenceNumbers/getRank:method kann man den Rang des Nutzers herausfinden. Dieser ist identisch, wenn * unterschiedliche Nutzer denselben Wert haben. */ - public static getPosition(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; minimumValue?: number; }): number; + static getPosition(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; minimumValue?: number; }): number; /** * Liefert den Rang des Nutzers. Der Rang ist nicht eindeutig. Bei gleicher Punktzahl haben Nutzer denselben Rang. * Mit der Methode UserPersistenceNumbers/getPosition:method kann man die Position eindeutige Position, statt des Ranges herausfinden. */ - public static getRank(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; minimumValue?: number; }): number; + static getRank(key: string, user_or_userId: (User|number), parameters?: { ascending?: boolean; minimumValue?: number; }): number; /** * Ruft eine Funktion für alle Nutzer auf, die einen bestimmten key in der UserPersistence gesetzt haben. * Hierbei greifen die übergebenen Filter. */ - public static each(key: string, callback: { user: User; value: number; index: number; totalCount: number; key: string; }, parameters?: { ascending?: boolean; minimumValue?: number; maximumValue?: number; maximumCount?: number; onStart?: (totalCount: number, key: string) => void; onEnd?: (totalCount: number, key: string) => void; }): void; + static each(key: string, callback: { user: User; value: number; index: number; totalCount: number; key: string; }, + parameters?: { ascending?: boolean; minimumValue?: number; maximumValue?: number; maximumCount?: number; + onStart?: (totalCount: number, key: string) => void; onEnd?: (totalCount: number, key: string) => void; }): void; /** * Liefert alle keys, die für User in der Persistence * gespeichert wurden. * @since AppServer 82483 */ - public static getAllKeys(filterKey?: string): string[]; + static getAllKeys(filterKey?: string): string[]; } /** @@ -2582,13 +2589,13 @@ declare class UserPersistenceObjects { * Löscht alle gespeicherten Objekte für den übergebenen key. * @since AppServer 82478 */ - public static deleteAll(key: string): number; + static deleteAll(key: string): number; /** * Liefert alle keys, die für User in der Persistence * gespeichert wurden. * @since AppServer 82483 */ - public static getAllKeys(filterKey?: string): string[]; + static getAllKeys(filterKey?: string): string[]; } /** @@ -2599,18 +2606,18 @@ declare class UserPersistenceStrings { * Liefert die Information, ob für einen bestimmten key und value bei einem beliebigen Nutzer eine Paarung existiert. * @since AppServer 88571 */ - public static exists(key: string, value: string, ignoreCase?: boolean): boolean; + static exists(key: string, value: string, ignoreCase?: boolean): boolean; /** * Löscht alle gespeicherten Strings für den übergebenen key. * @since AppServer 82478 */ - public static deleteAll(key: string): number; + static deleteAll(key: string): number; /** * Liefert alle keys, die für User in der Persistence * gespeichert wurden. * @since AppServer 82483 */ - public static getAllKeys(filterKey?: string): string[]; + static getAllKeys(filterKey?: string): string[]; } /** @@ -2620,39 +2627,39 @@ declare class UserStatus { /** * Liefert den numerischen Wert das UserStatus. */ - public getNumericStatus(): number; + getNumericStatus(): number; /** * Liefert die Information ob der aktuelle UserStatus mindestens so hoch ist, wie der übergebene UserStatus. */ - public isAtLeast(otherUserStatus: UserStatus): boolean; + isAtLeast(otherUserStatus: UserStatus): boolean; /** * */ - public static readonly Newbie: UserStatus; + static readonly Newbie: UserStatus; /** * */ - public static readonly Family: UserStatus; + static readonly Family: UserStatus; /** * */ - public static readonly Stammi: UserStatus; + static readonly Stammi: UserStatus; /** * */ - public static readonly HonoryMember: UserStatus; + static readonly HonoryMember: UserStatus; /** * */ - public static readonly Admin: UserStatus; + static readonly Admin: UserStatus; /** * */ - public static readonly SystemBot: UserStatus; + static readonly SystemBot: UserStatus; /** * */ - public static readonly Sysadmin: UserStatus; + static readonly Sysadmin: UserStatus; } /** @@ -2662,15 +2669,15 @@ declare class UserType { /** * Bot der App. */ - public static readonly AppBot: UserType; + static readonly AppBot: UserType; /** * Bot des Knuddels-Chatsystems. */ - public static readonly SystemBot: UserType; + static readonly SystemBot: UserType; /** * Menschlicher User. */ - public static readonly Human: UserType; + static readonly Human: UserType; } /** @@ -2680,6 +2687,6 @@ declare class VideoChannelData { /** * Liefert alle User die im Channel derzeit ihr Video streamen. */ - public getStreamingVideoUsers(): User[]; + getStreamingVideoUsers(): User[]; } diff --git a/knuddels-userapps-api/knuddels-userapps-api-tests.ts b/knuddels-userapps-api/knuddels-userapps-api-tests.ts index 3caa0b7e1d..1faaa193e5 100644 --- a/knuddels-userapps-api/knuddels-userapps-api-tests.ts +++ b/knuddels-userapps-api/knuddels-userapps-api-tests.ts @@ -2,26 +2,31 @@ class Server implements App { - private usersPlaying: {[nick: string]: number} = {}; + private usersPlaying: { [nick: string]: number } = {}; private isShuttingDown: boolean = false; private htmlFile: HTMLFile = new HTMLFile('start.html'); private appContent: AppContent = AppContent.overlayContent(this.htmlFile, 243, 266); onAppStart() { - KnuddelsServer.getChannel().getOnlineUsers(UserType.Human).forEach((user) => { - this.onUserJoined(user) - }); + KnuddelsServer.getChannel() + .getOnlineUsers(UserType.Human) + .forEach((user) => { + this.onUserJoined(user) + }); }; onUserJoined(user: User) { - const botNick = KnuddelsServer.getDefaultBotUser().getNick().escapeKCode(); + const botNick = KnuddelsServer.getDefaultBotUser() + .getNick() + .escapeKCode(); user.sendPrivateMessage('Lust auf ne Runde Ziegenphobie? Mit nur _°BB>_h1 Knuddel|/appknuddel ' + botNick + '<°°°_ bist du dabei!'); }; onUserLeft(user: User) { if (this.usersPlaying[user.getNick()] == 1) { - KnuddelsServer.getDefaultBotUser().transferKnuddel(user, new KnuddelAmount(1), 'Du hast den Channel verlassen.'); + KnuddelsServer.getDefaultBotUser() + .transferKnuddel(user, new KnuddelAmount(1), 'Du hast den Channel verlassen.'); delete this.usersPlaying[user.getNick()]; } @@ -32,13 +37,17 @@ class Server implements App { this.isShuttingDown = true; for (let key in this.usersPlaying) { - const userId = KnuddelsServer.getUserAccess().getUserId(key); - const user = KnuddelsServer.getUserAccess().getUserById(userId); + const userId = KnuddelsServer.getUserAccess() + .getUserId(key); + const user = KnuddelsServer.getUserAccess() + .getUserById(userId); - KnuddelsServer.getDefaultBotUser().transferKnuddel(user, new KnuddelAmount(1), 'Die App fährt gleich herunter.'); - user.getAppContentSessions().forEach((session: AppContentSession) => { - session.remove(); - }); + KnuddelsServer.getDefaultBotUser() + .transferKnuddel(user, new KnuddelAmount(1), 'Die App fährt gleich herunter.'); + user.getAppContentSessions() + .forEach((session: AppContentSession) => { + session.remove(); + }); delete this.usersPlaying[key]; } @@ -50,21 +59,20 @@ class Server implements App { if (!sender.canSendAppContent(this.appContent)) { knuddelTransfer.reject('Sorry, mit diesem Gerät kannst du gerade nicht spielen.'); - } - else if (sender.isChannelOwner() && knuddelTransfer.getKnuddelAmount().asNumber() != 1) { + } else if (sender.isChannelOwner() && knuddelTransfer.getKnuddelAmount() + .asNumber() != 1) { knuddelTransfer.accept(); - } - else if (this.isShuttingDown) { + } else if (this.isShuttingDown) { knuddelTransfer.reject('Du App nimmt gerade keine neuen Spieler an.'); - } - else if (this.usersPlaying[sender.getNick()]) { + } else if (this.usersPlaying[sender.getNick()]) { knuddelTransfer.reject('Du spielst bereits.'); - } - else if (knuddelTransfer.getKnuddelAmount().asNumber() != 1) { - const botNick = KnuddelsServer.getDefaultBotUser().getNick().escapeKCode(); + } else if (knuddelTransfer.getKnuddelAmount() + .asNumber() != 1) { + const botNick = KnuddelsServer.getDefaultBotUser() + .getNick() + .escapeKCode(); knuddelTransfer.reject('Du musst genau _°BB>_h1 Knuddel senden|/appknuddel ' + botNick + '<°°°_...'); - } - else { + } else { knuddelTransfer.accept(); } }; @@ -73,8 +81,7 @@ class Server implements App { if (knuddelAmount.asNumber() == 1) { this.usersPlaying[user.getNick()] = 1; user.sendAppContent(this.appContent); - } - else { + } else { user.sendPrivateMessage('Vielen Dank für die Einzahlung.'); } }; @@ -91,24 +98,32 @@ class Server implements App { let hasWon = winningDoorNumber == doorNumber; - let text = hasWon ? 'Richtig getippt' : 'Knapp daneben'; + let text = hasWon + ? 'Richtig getippt' + : 'Knapp daneben'; - user.getAppContentSession(AppViewMode.Overlay).getAppContent().sendEvent('openDoor', { - 'door': doorNumber, - 'winningDoor': winningDoorNumber, - 'text': text, - }); + user.getAppContentSession(AppViewMode.Overlay) + .getAppContent() + .sendEvent('openDoor', { + 'door': doorNumber, + 'winningDoor': winningDoorNumber, + 'text': text, + }); if (hasWon) { - KnuddelsServer.getDefaultBotUser().transferKnuddel(user, new KnuddelAmount(2), 'Richtig getippt...'); + KnuddelsServer.getDefaultBotUser() + .transferKnuddel(user, new KnuddelAmount(2), 'Richtig getippt...'); } setTimeout(() => { - const botNick = KnuddelsServer.getDefaultBotUser().getNick().escapeKCode(); + const botNick = KnuddelsServer.getDefaultBotUser() + .getNick() + .escapeKCode(); user.sendPrivateMessage('Na, Lust auf _°BB>_hnoch eine Runde|/appknuddel ' + botNick + '<°°°_?'); - user.getAppContentSessions().forEach((session: AppContentSession) => { - session.remove(); - }); + user.getAppContentSessions() + .forEach((session: AppContentSession) => { + session.remove(); + }); delete this.usersPlaying[user.getNick()]; }, 4000); }, 1500); @@ -117,6 +132,6 @@ class Server implements App { } -declare let App: Server;// tell the compiler that "App" will be available +declare let App: Server; // tell the compiler that "App" will be available App = new Server(); From edf261726e3e17cbd7983632b5cf53e16284624b Mon Sep 17 00:00:00 2001 From: Adrian Chia Date: Tue, 7 Mar 2017 14:30:46 -0600 Subject: [PATCH 357/797] Update auth0-js to 8.2.0, update auth0-lock to use auth0 v8 --- auth0-js/auth0-js-tests.ts | 2 +- auth0-js/index.d.ts | 60 ++++++++++++++++++++++++++++++++-- auth0-lock/auth0-lock-tests.ts | 4 +-- auth0-lock/index.d.ts | 21 +++++++----- 4 files changed, 73 insertions(+), 14 deletions(-) diff --git a/auth0-js/auth0-js-tests.ts b/auth0-js/auth0-js-tests.ts index 4d3b08bed4..cbd791030b 100644 --- a/auth0-js/auth0-js-tests.ts +++ b/auth0-js/auth0-js-tests.ts @@ -64,7 +64,7 @@ webAuth.signupAndAuthorize({ webAuth.client.login({ - ealm: 'Username-Password-Authentication', //connection name or HRD domain + realm: 'Username-Password-Authentication', //connection name or HRD domain username: 'info@auth0.com', password: 'areallystrongpassword', audience: 'https://mystore.com/api/v2', diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts index cc408023bc..56e3db81e7 100644 --- a/auth0-js/index.d.ts +++ b/auth0-js/index.d.ts @@ -323,6 +323,13 @@ export class Redirect { export class Popup { constructor(client: any, options: any); + /** + * Returns a new instance of the popup handler + * + * @method buildPopupHandler + */ + buildPopupHandler(): any; + /** * Initializes the popup window and returns the instance to be used later in order to avoid being blocked by the browser. * @@ -396,6 +403,7 @@ interface AuthOptions { scope?: string; audience?: string; leeway?: number; + plugins?: any[]; _disableDeprecationWarnings?: boolean; _sendTelemetry?: boolean; _telemetryInfo?: any; @@ -409,8 +417,15 @@ interface PasswordlessAuthOptions { } interface Auth0Error { - error: any; - errorDescription: string; + error?: any; + errorDescription?: string; + code?: string; + description?: string; + name?: string; + policy?: string; + original?: any; + statusCode?: number; + statusText?: string; } interface Auth0DecodedHash { @@ -453,3 +468,44 @@ interface PasswordlessVerifyOptions { phoneNumber?: string; email?: string; } + +interface Auth0UserProfile { + name: string; + nickname: string; + picture: string; + user_id: string; + username?: string; + given_name?: string; + family_name?: string; + email?: string; + email_verified?: string; + clientID: string; + gender?: string; + locale?: string; + identities: Auth0Identity[]; + created_at: string; + updated_at: string; + sub: string; + user_metadata?: any; + app_metadata?: any; +} + +interface MicrosoftUserProfile extends Auth0UserProfile { + emails?: string[]; //optional depending on whether email addresses permission is granted +} + +interface Office365UserProfile extends Auth0UserProfile { + tenantid: string; + upn: string; +} + +interface AdfsUserProfile extends Auth0UserProfile { + issuer?: string; +} + +interface Auth0Identity { + connection: string; + isSocial: boolean; + provider: string; + user_id: string; +} diff --git a/auth0-lock/auth0-lock-tests.ts b/auth0-lock/auth0-lock-tests.ts index 8045386586..a241eb6d0c 100644 --- a/auth0-lock/auth0-lock-tests.ts +++ b/auth0-lock/auth0-lock-tests.ts @@ -1,4 +1,4 @@ -import 'auth0-js/v7'; +import * as auth0 from 'auth0-js'; import Auth0Lock from 'auth0-lock'; const CLIENT_ID = "YOUR_AUTH0_APP_CLIENTID"; @@ -38,7 +38,7 @@ lock.show(showOptions); // "on" event-driven example lock.on("authenticated", function(authResult : any) { - lock.getProfile(authResult.idToken, function(error, profile) { + lock.getProfile(authResult.idToken, function(error: auth0.Auth0Error, profile: auth0.Auth0UserProfile) { if (error) { // Handle error return; diff --git a/auth0-lock/index.d.ts b/auth0-lock/index.d.ts index 09c3f4fedd..27b534fb1e 100644 --- a/auth0-lock/index.d.ts +++ b/auth0-lock/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Brian Caruso // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// interface Auth0LockAdditionalSignUpFieldOption { value: string; @@ -11,13 +11,13 @@ interface Auth0LockAdditionalSignUpFieldOption { } type Auth0LockAdditionalSignUpFieldOptionsCallback = - (error: Auth0Error, options: Auth0LockAdditionalSignUpFieldOption[]) => void; + (error: auth0.Auth0Error, options: Auth0LockAdditionalSignUpFieldOption[]) => void; type Auth0LockAdditionalSignUpFieldOptionsFunction = (callback: Auth0LockAdditionalSignUpFieldOptionsCallback) => void; type Auth0LockAdditionalSignUpFieldPrefillCallback = - (error: Auth0Error, prefill: string) => void; + (error: auth0.Auth0Error, prefill: string) => void; type Auth0LockAdditionalSignUpFieldPrefillFunction = (callback: Auth0LockAdditionalSignUpFieldPrefillCallback) => void; @@ -32,8 +32,8 @@ interface Auth0LockAdditionalSignUpField { validator?: (input: string) => { valid: boolean; hint?: string }; } -type Auth0LockAvatarUrlCallback = (error: Auth0Error, url: string) => void; -type Auth0LockAvatarDisplayNameCallback = (error: Auth0Error, displayName: string) => void; +type Auth0LockAvatarUrlCallback = (error: auth0.Auth0Error, url: string) => void; +type Auth0LockAvatarDisplayNameCallback = (error: auth0.Auth0Error, displayName: string) => void; interface Auth0LockAvatarOptions { url: (email: string, callback: Auth0LockAvatarUrlCallback) => void; @@ -63,6 +63,7 @@ interface Auth0LockAuthOptions { redirectUrl?: string; responseType?: string; sso?: boolean; + audience?: string; } interface Auth0LockPopupOptions { @@ -101,6 +102,7 @@ interface Auth0LockConstructorOptions { socialButtonStyle?: "big" | "small"; theme?: Auth0LockThemeOptions; usernameStyle?: string; + oidcConformant?: boolean; } interface Auth0LockFlashMessageOptions { @@ -123,15 +125,16 @@ interface Auth0LockStatic { new (clientId: string, domain: string, options?: Auth0LockConstructorOptions): Auth0LockStatic; // deprecated - getProfile(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void): void; - getUserInfo(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void): void; - + getProfile(token: string, callback: (error: auth0.Auth0Error, profile: auth0.Auth0UserProfile) => void): void; + getUserInfo(token: string, callback: (error: auth0.Auth0Error, profile: auth0.Auth0UserProfile) => void): void; + // https://github.com/auth0/lock#resumeauthhash-callback + resumeAuth( hash: string, callback: (error: auth0.Auth0Error, authResult: any) => void): void; show(options?: Auth0LockShowOptions): void; hide(): void; logout(query: any): void; on(event: "show" | "hide", callback: () => void): void; - on(event: "unrecoverable_error" | "authorization_error", callback: (error: Auth0Error) => void): void; + on(event: "unrecoverable_error" | "authorization_error", callback: (error: auth0.Auth0Error) => void): void; on(event: "authenticated", callback: (authResult: any) => void): void; on(event: string, callback: (...args: any[]) => void): void; } From 8bc911a5c1b25220e6fd35367b58a32241515132 Mon Sep 17 00:00:00 2001 From: Adrian Chia Date: Tue, 7 Mar 2017 14:42:20 -0600 Subject: [PATCH 358/797] increase auth0-js, auth0-lock version number in header --- auth0-js/index.d.ts | 2 +- auth0-lock/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts index 56e3db81e7..f51e3979d3 100644 --- a/auth0-js/index.d.ts +++ b/auth0-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Auth0.js 8.1 +// Type definitions for Auth0.js 8.2 // Project: https://github.com/auth0/auth0.js // Definitions by: Adrian Chia // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/auth0-lock/index.d.ts b/auth0-lock/index.d.ts index 27b534fb1e..285ad25288 100644 --- a/auth0-lock/index.d.ts +++ b/auth0-lock/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for auth0-lock 10.9 +// Type definitions for auth0-lock 10.10 // Project: http://auth0.com // Definitions by: Brian Caruso // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From b77325fd0c234f1a571e95c2dd6cc3cfb4942a3a Mon Sep 17 00:00:00 2001 From: Chris Moran Date: Tue, 7 Mar 2017 16:57:46 -0500 Subject: [PATCH 359/797] Add some missing methods to Element class --- jointjs/index.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jointjs/index.d.ts b/jointjs/index.d.ts index e8c9e8b53e..95e2b2b7e3 100644 --- a/jointjs/index.d.ts +++ b/jointjs/index.d.ts @@ -156,6 +156,15 @@ declare namespace joint { findView(paper: Paper): ElementView; isElement(): boolean; scale(scaleX: number, scaleY: number, origin?: Point, options?: any): this; + addPort(port: any, opt?: any): this; + addPorts(ports: any[], opt?: any): this; + removePort(port: any, opt?: any): this; + hasPorts(): boolean; + hasPort(id: string): boolean; + getPorts(): any[]; + getPort(id: string): any; + getPortIndex(port: any): number; + portProp(portId: string, path: any, value?: any, opt?: any): joint.dia.Element; } interface CSSSelector { From fa4d3d8ac7318dafedd25cb948b2128ffc8e19a2 Mon Sep 17 00:00:00 2001 From: 3n-mb <3n-mb@users.noreply.github.com> Date: Tue, 7 Mar 2017 18:16:58 -0500 Subject: [PATCH 360/797] Update index.d.ts --- ws/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/ws/index.d.ts b/ws/index.d.ts index 172372d286..466dc92b1b 100644 --- a/ws/index.d.ts +++ b/ws/index.d.ts @@ -118,6 +118,7 @@ declare namespace WebSocket { disableHixie?: boolean; clientTracking?: boolean; perMessageDeflate?: boolean | IPerMessageDeflateOptions; + maxPayload?: number; } export class Server extends events.EventEmitter { From fec2c4d1219c5f504d8c7667956753a3025409b9 Mon Sep 17 00:00:00 2001 From: 3n-mb <3n-mb@users.noreply.github.com> Date: Tue, 7 Mar 2017 18:34:05 -0500 Subject: [PATCH 361/797] Fix for issue 14997 in DefinitelyTyped Making this via proposed change, not forked repo, like I did with PR #15044. That one fails ci. --- node/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/index.d.ts b/node/index.d.ts index d23cc981e4..12d9ce4274 100644 --- a/node/index.d.ts +++ b/node/index.d.ts @@ -1903,7 +1903,7 @@ declare module "net" { bufferSize: number; setEncoding(encoding?: string): this; write(data: any, encoding?: string, callback?: Function): void; - destroy(): void; + destroy(err?: any): void; pause(): this; resume(): this; setTimeout(timeout: number, callback?: Function): void; From de7a4e38a0514ed2e6164142c921dcd23bd6b2b4 Mon Sep 17 00:00:00 2001 From: 3n-mb <3n-mb@users.noreply.github.com> Date: Tue, 7 Mar 2017 18:41:03 -0500 Subject: [PATCH 362/797] Fix for issue 14967 in DefinitelyTyped This fixes (issue 14967 in DefinitelyTyped)[https://github.com/DefinitelyTyped/DefinitelyTyped/issues/14967] Making this via "Propose file change", not forked repo, like I did with PR #15043. That one fails ci, this one shouldn't. --- node/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/index.d.ts b/node/index.d.ts index d23cc981e4..52a081bf7b 100644 --- a/node/index.d.ts +++ b/node/index.d.ts @@ -1852,7 +1852,7 @@ declare module "dns" { export function resolve4(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; export function resolve6(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; export function resolveMx(domain: string, callback: (err: Error, addresses: MxRecord[]) => void): string[]; - export function resolveTxt(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; + export function resolveTxt(domain: string, callback: (err: Error, addresses: string[][]) => void): string[][]; export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) => void): string[]; From 3a043886eaa98b8b26356971564736d9d7180759 Mon Sep 17 00:00:00 2001 From: andy-ms Date: Tue, 7 Mar 2017 17:00:32 -0800 Subject: [PATCH 363/797] Fix broken tests --- combined-stream/tsconfig.json | 2 +- jimp/jimp-tests.ts | 98 ++++++++++--------- .../tedious-connection-pool-tests.ts | 10 +- webpack/index.d.ts | 6 +- 4 files changed, 58 insertions(+), 58 deletions(-) diff --git a/combined-stream/tsconfig.json b/combined-stream/tsconfig.json index 5ffd68770c..e1986a21be 100644 --- a/combined-stream/tsconfig.json +++ b/combined-stream/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "module": "commonjs", - "target": "es6", + "lib": ["es6"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/jimp/jimp-tests.ts b/jimp/jimp-tests.ts index 180ce27d7f..fd1ed1d2b7 100644 --- a/jimp/jimp-tests.ts +++ b/jimp/jimp-tests.ts @@ -1,7 +1,7 @@ import Jimp = require('jimp') // All code below is from node-jimp document -Jimp.read("lenna.png", function (err, data) { +Jimp.read("lenna.png", (err, data) => { if (err) throw err; data.resize(256, 256) // resize .quality(60) // set JPEG quality @@ -9,30 +9,30 @@ Jimp.read("lenna.png", function (err, data) { .write("lena-small-bw.jpg"); // save }); -Jimp.read("lenna.png").then(function (lenna) { +Jimp.read("lenna.png").then(lenna => { lenna.resize(256, 256) // resize .quality(60) // set JPEG quality .greyscale() // set greyscale .write("lena-small-bw.jpg"); // save -}).catch(function (err) { +}).catch(err => { console.error(err); }); -Jimp.read("./path/to/image.jpg", function (err, image) { +Jimp.read("./path/to/image.jpg", (err, image) => { // do stuff with the image (if no exception) }); -Jimp.read("./path/to/image.jpg").then(function (image) { +Jimp.read("./path/to/image.jpg").then(image => { // do stuff with the image -}).catch(function (err) { +}).catch(err => { // handle an exception }); -Jimp.read(new Buffer(''), function (err, image) { +Jimp.read(new Buffer(''), (err, image) => { // do stuff with the image (if no exception) }); -Jimp.read("http://www.example.com/path/to/lenna.jpg", function (err, image) { +Jimp.read("http://www.example.com/path/to/lenna.jpg", (err, image) => { // do stuff with the image (if no exception) }); @@ -51,51 +51,55 @@ var hex = 0xFFFFFFFF var r = 0 var n = 1 /* Resize */ -image.contain( w, h); // scale the image to the given width and height, some parts of the image may be letter boxed -image.cover( w, h); // scale the image to the given width and height, some parts of the image may be clipped -image.resize( w, h); // resize the image. Jimp.AUTO can be passed as one of the values. -image.scale(f ); // scale the image by the factor f -image.scaleToFit( w, h ); // scale the image to the largest size that fits inside the given width and height +image.contain(w, h); // scale the image to the given width and height, some parts of the image may be letter boxed +image.cover(w, h); // scale the image to the given width and height, some parts of the image may be clipped +image.resize(w, h); // resize the image. Jimp.AUTO can be passed as one of the values. +image.scale(f); // scale the image by the factor f +image.scaleToFit(w, h); // scale the image to the largest size that fits inside the given width and height // An optional resize mode can be passed with all resize methods. /* Crop */ image.autocrop(); // automatically crop same-color borders from image (if any) -image.crop( x, y, w, h ); // crop to the given region +image.crop(x, y, w, h); // crop to the given region /* Composing */ -image.blit( src, x, y ); +image.blit(src, x, y); // blit the image with another Jimp image at x, y, optionally cropped. -image.composite( src, x, y ); // composites another Jimp image over this image at x, y -image.mask( src, x, y ); // masks the image with another Jimp image at x, y using average pixel value +image.composite(src, x, y); // composites another Jimp image over this image at x, y +image.mask(src, x, y); // masks the image with another Jimp image at x, y using average pixel value /* Flip and rotate */ -image.flip( horz, vert ); // flip the image horizontally or vertically -image.mirror( horz, vert ); // an alias for flip -image.rotate( deg ); // rotate the image clockwise by a number of degrees. Optionally, a resize mode can be passed. If `false` is passed as the second parameter, the image width and height will not be resized. +image.flip(horz, vert); // flip the image horizontally or vertically +image.mirror(horz, vert); // an alias for flip +// rotate the image clockwise by a number of degrees. +// Optionally, a resize mode can be passed. +// If `false` is passed as the second parameter, +// the image width and height will not be resized. +image.rotate(deg); // JPEG images with EXIF orientation data will be automatically re-orientated as appropriate. /* Colour */ -image.brightness( val ); // adjust the brighness by a value -1 to +1 -image.contrast( val ); // adjust the contrast by a value -1 to +1 +image.brightness(val); // adjust the brighness by a value -1 to +1 +image.contrast(val); // adjust the contrast by a value -1 to +1 image.dither565(); // ordered dithering of the image and reduce color space to 16-bits (RGB565) image.greyscale(); // remove colour from the image image.invert(); // invert the image colours image.normalize(); // normalize the channels in an image /* Alpha channel */ -image.fade( f ); // an alternative to opacity, fades the image by a factor 0 - 1. 0 will haven no effect. 1 will turn the image -image.opacity( f ); // multiply the alpha channel by each pixel by the factor f, 0 - 1 +image.fade(f); // an alternative to opacity, fades the image by a factor 0 - 1. 0 will haven no effect. 1 will turn the image +image.opacity(f); // multiply the alpha channel by each pixel by the factor f, 0 - 1 image.opaque(); // set the alpha channel on every pixel to fully opaque -image.background( hex ); // set the default new pixel colour (e.g. 0xFFFFFFFF or 0x00000000) for by some operations (e.g. image.contain and +image.background(hex); // set the default new pixel colour (e.g. 0xFFFFFFFF or 0x00000000) for by some operations (e.g. image.contain and /* Blurs */ -image.gaussian( r ); // Gaussian blur the image by r pixels (VERY slow) -image.blur( r ); // fast blur the image by r pixels +image.gaussian(r); // Gaussian blur the image by r pixels (VERY slow) +image.blur(r); // fast blur the image by r pixels /* Effects */ -image.posterize( n ); // apply a posterization effect with n level +image.posterize(n); // apply a posterization effect with n level image.sepia(); // apply a sepia wash to the image image.clone(); // returns a clone of the image @@ -110,35 +114,35 @@ image.contain(250, 250, Jimp.HORIZONTAL_ALIGN_LEFT | Jimp.VERTICAL_ALIGN_TOP); var path = '' var str = '' var width = 0 -Jimp.loadFont( path ).then(function (font) { // load font from .fnt file +Jimp.loadFont(path).then(font => { // load font from .fnt file image.print(font, x, y, str); // print a message on an image image.print(font, x, y, str, width); // print a message on an image with text wrapped at width }); var cb = (err: Error, data: any) => {} -Jimp.loadFont( path, cb ); // using a callback pattern +Jimp.loadFont(path, cb); // using a callback pattern -Jimp.loadFont(Jimp.FONT_SANS_32_BLACK).then(function (font) { +Jimp.loadFont(Jimp.FONT_SANS_32_BLACK).then(font => { image.print(font, 10, 10, "Hello world!"); }); -image.write( path, cb ); // Node-style callback will be fired when write is successful +image.write(path, cb); // Node-style callback will be fired when write is successful var file = "new_name." + image.getExtension(); image.write(file) var mime = 'image/png' -image.getBuffer( mime, cb ); // Node-style callback will be fired with result -image.getBase64( mime, cb ); // Node-style callback will be fired with result -image.quality( n ); // set the quality of saved JPEG, 0 - 100 +image.getBuffer(mime, cb); // Node-style callback will be fired with result +image.getBase64(mime, cb); // Node-style callback will be fired with result +image.quality(n); // set the quality of saved JPEG, 0 - 100 var bool = true var number = 0 -image.rgba( bool ); // set whether PNGs are saved as RGBA (true, default) or RGB (false) -image.filterType( number ); // set the filter type for the saved PNG -image.deflateLevel( number ); // set the deflate level for the saved PNG -Jimp.deflateStrategy( number ); // set the deflate for the saved PNG (0-3) +image.rgba(bool); // set whether PNGs are saved as RGBA (true, default) or RGB (false) +image.filterType(number); // set the filter type for the saved PNG +image.deflateLevel(number); // set the deflate level for the saved PNG +Jimp.deflateStrategy(number); // set the deflate for the saved PNG (0-3) image.color([ { apply: 'hue', params: [ -90 ] }, @@ -146,11 +150,11 @@ image.color([ { apply: 'xor', params: [ '#06D' ] } ]); image.convolution([ - [-2,-1, 0], + [-2, -1, 0], [-1, 1, 1], [ 0, 1, 2] ]) -image.scan(0, 0, image.bitmap.width, image.bitmap.height, function (x, y, idx) { +image.scan(0, 0, image.bitmap.width, image.bitmap.height, function(x, y, idx) { // x, y is the position of this pixel on the image // idx is the position start position of this rgba tuple in the bitmap Buffer // this is the image @@ -172,11 +176,11 @@ var a = 0 Jimp.rgbaToInt(r, g, b, a); // e.g. converts 255, 255, 255, 255 to 0xFFFFFFFF Jimp.intToRGBA(hex); // e.g. converts 0xFFFFFFFF to {r: 255, g: 255, b: 255, a:255} -var image = new Jimp(256, 256, function (err, image) { +var image = new Jimp(256, 256, (err, image) => { // this image is 256 x 256, every pixel is set to 0x00000000 }); -var image = new Jimp(256, 256, 0xFF0000FF, function (err, image) { +var image = new Jimp(256, 256, 0xFF0000FF, (err, image) => { // this image is 256 x 256, every pixel is set to 0xFF0000FF }); @@ -202,13 +206,13 @@ if (distance < 0.15 || diff.percent < 0.15) { // not a match } -Jimp.read("lenna.png", function (err, image) { +Jimp.read("lenna.png", function(err, image) { this.greyscale().scale(0.5).write("lena-half-bw.png"); }); -Jimp.read("lenna.png", function (err, image) { - image.greyscale(function(err, image) { - image.scale(0.5, function (err, image) { +Jimp.read("lenna.png", (err, image) => { + image.greyscale((err, image) => { + image.scale(0.5, (err, image) => { image.write("lena-half-bw.png"); }); }); diff --git a/tedious-connection-pool/tedious-connection-pool-tests.ts b/tedious-connection-pool/tedious-connection-pool-tests.ts index bdf504274a..0a2ec38be6 100644 --- a/tedious-connection-pool/tedious-connection-pool-tests.ts +++ b/tedious-connection-pool/tedious-connection-pool-tests.ts @@ -1,11 +1,3 @@ -// Type definitions for tedious-connection-pool -// Project: https://github.com/pekim/tedious-connection-pool -// Definitions by: Cyprien Autexier -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - -"use strict"; - import ConnectionPool = require("tedious-connection-pool"); import tedious = require("tedious"); @@ -36,7 +28,7 @@ pool.once('error', (err: Error) => { pool.removeAllListeners(); -pool.acquire((err: Error, connection: ConnectionPool.PooledConnection) =>{ +pool.acquire((err: Error, connection: ConnectionPool.PooledConnection) => { console.log("hurray"); connection.beginTransaction((error: Error): void => {}, "some name"); connection.rollbackTransaction((error: Error): void => {}); diff --git a/webpack/index.d.ts b/webpack/index.d.ts index d21716a6e8..18ab5274ba 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -1,6 +1,10 @@ // Type definitions for webpack 2.2 // Project: https://github.com/webpack/webpack -// Definitions by: Qubo , Matt Lewis , Benjamin Lim , Boris Cherny , Tommy Troy Lin +// Definitions by: Qubo +// Matt Lewis +// Benjamin Lim +// Boris Cherny +// Tommy Troy Lin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// From 868ecf81e954522cf86cdd17691391f0df074bde Mon Sep 17 00:00:00 2001 From: Tom Wanzek Date: Tue, 7 Mar 2017 20:30:50 -0500 Subject: [PATCH 364/797] [d3-array] v1.1 * [Enhancement] Update signatures for `pairs` * [Feature] Add `cross` * Bump minor version --- d3-array/d3-array-tests.ts | 19 +++++++++++++++---- d3-array/index.d.ts | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/d3-array/d3-array-tests.ts b/d3-array/d3-array-tests.ts index 74b749bea3..225cec33ef 100644 --- a/d3-array/d3-array-tests.ts +++ b/d3-array/d3-array-tests.ts @@ -44,13 +44,13 @@ let num: number; let date: Date; let numOrUndefined: number | undefined; -let strOrUndefined: string | undefined; -let numericOrUndefined: NumCoercible | undefined; -let dateOrUndefined: Date | undefined; +let strOrUndefined: string |  undefined; +let numericOrUndefined: NumCoercible |  undefined; +let dateOrUndefined: Date |  undefined; let numOrUndefinedExtent: [number, number] | [undefined, undefined]; let strOrUndefinedExtent: [string, string] | [undefined, undefined]; let numericOrUndefinedExtent: [NumCoercible, NumCoercible] | [undefined, undefined]; -let dateMixedOrUndefined: [Date , Date] | [undefined, undefined]; +let dateMixedOrUndefined: [Date, Date] | [undefined, undefined]; let mixedOrUndefinedExtent: [d3Array.Primitive | NumCoercible, d3Array.Primitive | NumCoercible] | [undefined, undefined]; let dateOrUndefinedExtent: [Date, Date] | [undefined, undefined]; @@ -330,12 +330,23 @@ mergedArray = d3Array.merge(testArrays); // inferred type mergedArray = d3Array.merge(testArrays); // explicit type // mergedArray = d3Array.merge([[10, 40, 30], [15, 30]]); // fails, type mismatch +// cross() --------------------------------------------------------------------- + +let crossed: Array<[string, number]>; + +crossed = d3Array.cross(['x', 'y'], [1, 2]); + +let strArray: string[] = d3Array.cross([2, 3], [5, 6], (a, b) => (a + b) + 'px') + + // pairs() --------------------------------------------------------------------- let pairs: Array<[MixedObject, MixedObject]>; pairs = d3Array.pairs(mergedArray); +numbersArray = d3Array.pairs(mergedArray, (a, b) => b.num - a.num); + // permute() ------------------------------------------------------------------- // getting a permutation of array elements diff --git a/d3-array/index.d.ts b/d3-array/index.d.ts index 336eb2bc83..d938a8c032 100644 --- a/d3-array/index.d.ts +++ b/d3-array/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for D3JS d3-array module 1.0 +// Type definitions for D3JS d3-array module 1.1 // Project: https://github.com/d3/d3-array // Definitions by: Alex Ford , Boris Yankov , Tom Wanzek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 1.0.2 +// Last module patch version validated against: 1.1.0 // -------------------------------------------------------------------------- // Shared Types and Interfaces @@ -181,6 +181,26 @@ export function descending(a: Primitive | undefined, b: Primitive | undefined): // Transforming Arrays // -------------------------------------------------------------------------------------- +/** + * Returns the Cartesian product of the two arrays a and b. + * For each element i in the specified array a and each element j in the specified array b, in order, + * it creates a two-element array for each pair. + * + * @param a First input array. + * @param b Second input array. + */ +export function cross(a: S[], b: T[]): Array<[S, T]>; + +/** + * Returns the Cartesian product of the two arrays a and b. + * For each element i in the specified array a and each element j in the specified array b, in order, + * invokes the specified reducer function passing the element i and element j. + * + * @param a First input array. + * @param b Second input array. + * @param reducer A reducer function taking as input an element from "a" and "b" and returning a reduced value. + */ +export function cross(a: S[], b: T[], reducer: (a: S, b: T) => U): U[]; /** * Merges the specified arrays into a single array. @@ -190,8 +210,19 @@ export function merge(arrays: T[][]): T[]; /** * For each adjacent pair of elements in the specified array, returns a new array of tuples of elements i and i - 1. * Returns the empty array if the input array has fewer than two elements. + * + * @param array Array of input elements */ export function pairs(array: T[]): Array<[T, T]>; +/** + * For each adjacent pair of elements in the specified array, in order, invokes the specified reducer function passing the element i and element i - 1. + * Returns the resulting array of pair-wise reduced elements. + * Returns the empty array if the input array has fewer than two elements. + * + * @param array Array of input elements + * @param reducer A reducer function taking as input to adjecent elements of the input array and returning a reduced value. + */ +export function pairs(array: T[], reducer: (a: T, b: T) => U): U[]; /** * Given the specified array, return an array corresponding to the list of indices in 'keys'. From 082f42fd5b53ff5b72a3ca8cc85c177affff499f Mon Sep 17 00:00:00 2001 From: Tom Wanzek Date: Tue, 7 Mar 2017 20:54:48 -0500 Subject: [PATCH 365/797] [d3-format] v1.1 * [Enhancement] Add optional `numerals` property to `FormatLocaleDefinition` * [Enhancement] Replaced union type of `decimal` and `thousand` with `string` type in `FormatLocaleDefinition` to generalize * Bumped minor version number --- d3-format/d3-format-tests.ts | 19 ++++++++++++++----- d3-format/index.d.ts | 12 +++++++++--- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/d3-format/d3-format-tests.ts b/d3-format/d3-format-tests.ts index 3fd5742997..57a98e26c6 100644 --- a/d3-format/d3-format-tests.ts +++ b/d3-format/d3-format-tests.ts @@ -63,11 +63,6 @@ num = d3Format.precisionRound(0.0005, 3000); // Test Locale Definition // ---------------------------------------------------------------------- -let decimal: '.' | ',' = localeDef.decimal; -let thousands: '.' | ',' | '\u00a0' | "'" = localeDef.thousands; -let grouping: Array = localeDef.grouping; -let currency: [string, string] = localeDef.currency; - localeDef = { decimal: ',', thousands: '.', @@ -75,6 +70,20 @@ localeDef = { currency: ['EUR', ''] }; +localeDef = { + decimal: "\u066b", + thousands: "\u066c", + grouping: [3], + currency: ["", ""], + numerals : ["\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", "\u0668", "\u0669"] +} + +let decimal: string = localeDef.decimal; +let thousands: string = localeDef.thousands; +let grouping: Array = localeDef.grouping; +let currency: [string, string] = localeDef.currency; +let numerals: string[] | undefined = localeDef.numerals; + localeObj = d3Format.formatLocale(localeDef); localeObj = d3Format.formatDefaultLocale(localeDef); diff --git a/d3-format/index.d.ts b/d3-format/index.d.ts index 92197f6ab8..be6c2b9a99 100644 --- a/d3-format/index.d.ts +++ b/d3-format/index.d.ts @@ -1,8 +1,10 @@ -// Type definitions for D3JS d3-format module v1.0.2 +// Type definitions for D3JS d3-format module 1.1 // Project: https://github.com/d3/d3-format/ // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Last module patch version validated against: 1.1.0 + /** * Specification of locale to use when creating a new FormatLocaleObject */ @@ -10,12 +12,12 @@ export interface FormatLocaleDefinition { /** * The decimal point (e.g., ".") */ - decimal: '.' | ','; + decimal: string; /** * The group separator (e.g., ","). Note that the thousands property is a misnomer, as\ * the grouping definition allows groups other than thousands. */ - thousands: '.' | ',' | '\u00a0' | "'"; + thousands: string; /** * The array of group sizes (e.g., [3]), cycled as needed. */ @@ -24,6 +26,10 @@ export interface FormatLocaleDefinition { * The currency prefix and suffix (e.g., ["$", ""]) */ currency: [string, string]; + /** + * An array of ten strings to replace the numerals 0-9. + */ + numerals?: string[]; } /** From 6d972fe3a447d809acd0ec8e72f9a94189801ee4 Mon Sep 17 00:00:00 2001 From: Tom Wanzek Date: Tue, 7 Mar 2017 21:36:34 -0500 Subject: [PATCH 366/797] [d3-geo] v1.6 * [Feature] Add `geoContains` * [Chore] Update some JSDoc comments * [Chore] Linting * [Chore] Bump minor version --- d3-geo/d3-geo-tests.ts | 17 ++- d3-geo/index.d.ts | 241 +++++++++++++++++++++++++---------------- d3-geo/tslint.json | 6 + 3 files changed, 167 insertions(+), 97 deletions(-) create mode 100644 d3-geo/tslint.json diff --git a/d3-geo/d3-geo-tests.ts b/d3-geo/d3-geo-tests.ts index f1701c10c8..a29dce0e8b 100644 --- a/d3-geo/d3-geo-tests.ts +++ b/d3-geo/d3-geo-tests.ts @@ -130,6 +130,18 @@ centroid = d3Geo.geoCentroid(sampleExtendedFeature2); centroid = d3Geo.geoCentroid(sampleFeatureCollection); centroid = d3Geo.geoCentroid(sampleExtendedFeatureCollection); +// geoContains(...) ======================================================= + +let contained: boolean = d3Geo.geoContains(samplePolygon, [0, 0]); +contained = d3Geo.geoContains(sampleSphere, [0, 0]); +contained = d3Geo.geoContains(sampleGeometryCollection, [0, 0]); +contained = d3Geo.geoContains(sampleExtendedGeometryCollection, [0, 0]); +contained = d3Geo.geoContains(sampleFeature, [0, 0]); +contained = d3Geo.geoContains(sampleExtendedFeature1, [0, 0]); +contained = d3Geo.geoContains(sampleExtendedFeature2, [0, 0]); +contained = d3Geo.geoContains(sampleFeatureCollection, [0, 0]); +contained = d3Geo.geoContains(sampleExtendedFeatureCollection, [0, 0]); + // geoDistance(...) ======================================================= let distance: number = d3Geo.geoDistance([54, 2], [53, 1]); @@ -198,7 +210,7 @@ class Circulator { private p: number; private circleGenerator: d3Geo.GeoCircleGenerator; - public getCirclePolygon(center?: [number, number]): GeoJSON.Polygon { + getCirclePolygon(center?: [number, number]): GeoJSON.Polygon { if (center && center.length === 2 && typeof center[0] === 'number' && typeof center[1] === 'number') { return this.circleGenerator(center); } else { @@ -489,7 +501,8 @@ geoPathSVG = geoPathSVG.pointRadius(function (datum) { }); let geoPathSVGPointRadiusAccessor: number | ((this: SVGPathElement, d: d3Geo.ExtendedFeature, ...args: any[]) => number) = geoPathSVG.pointRadius(); -// let geoPathSVGPointRadiusAccessorWrong1: number | ((this: SVGCircleElement, d: d3Geo.ExtendedFeature, ...args: any[]) => number) = geoPathSVG.pointRadius(); // fails, mismatch in this context +// let geoPathSVGPointRadiusAccessorWrong1: number | ((this: SVGCircleElement, d: d3Geo.ExtendedFeature, ...args: any[]) => number) +// = geoPathSVG.pointRadius(); // fails, mismatch in this context // let geoPathSVGPointRadiusAccessorWrong2: number | ((this: SVGPathElement, d: d3Geo.GeoGeometryObjects, ...args: any[]) => number) = geoPathSVG.pointRadius(); // fails, mismatch in object datum type // Use geoPath Generator ================================================ diff --git a/d3-geo/index.d.ts b/d3-geo/index.d.ts index 02ce38ba93..dfc58a5f9e 100644 --- a/d3-geo/index.d.ts +++ b/d3-geo/index.d.ts @@ -1,10 +1,12 @@ -// Type definitions for D3JS d3-geo module v1.5.0 +// Type definitions for D3JS d3-geo module 1.6 // Project: https://github.com/d3/d3-geo/ // Definitions by: Hugues Stefanski , Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// +// Last module patch version validated against: 1.6.1 + // ---------------------------------------------------------------------- // Shared Interfaces and Types // ---------------------------------------------------------------------- @@ -59,7 +61,8 @@ export interface ExtendedFeatureCollection | ExtendedFeature | ExtendedFeatureCollection>; +export type GeoPermissibleObjects = GeoGeometryObjects | ExtendedGeometryCollection + | ExtendedFeature | ExtendedFeatureCollection>; // ---------------------------------------------------------------------- // Spherical Math @@ -67,94 +70,135 @@ export type GeoPermissibleObjects = GeoGeometryObjects | ExtendedGeometryCollect /** * Returns the spherical area of the specified feature in steradians. - * (See also path.area, which computes the projected planar area.) + * This is the spherical equivalent of path.area. * - * @param feature A geographic feature supported by d3-geo (An extension of GeoJSON feature). + * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ -export function geoArea(feature: ExtendedFeature): number; +export function geoArea(object: ExtendedFeature): number; /** * Returns the spherical area of the specified feature collection in steradians. - * (See also path.area, which computes the projected planar area.) + * This is the spherical equivalent of path.area. * - * @param feature A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). + * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). */ -export function geoArea(feature: ExtendedFeatureCollection>): number; +export function geoArea(object: ExtendedFeatureCollection>): number; /** * Returns the spherical area of the specified GeoJson Geometry Object or GeoSphere object in steradians. - * (See also path.area, which computes the projected planar area.) + * This is the spherical equivalent of path.area. * - * @param feature A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). + * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). */ -export function geoArea(feature: GeoGeometryObjects): number; +export function geoArea(object: GeoGeometryObjects): number; /** * Returns the spherical area of the specified geographic geometry collection in steradians. - * (See also path.area, which computes the projected planar area.) + * This is the spherical equivalent of path.area. * - * @param feature A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). + * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ -export function geoArea(feature: ExtendedGeometryCollection): number; +export function geoArea(object: ExtendedGeometryCollection): number; /** * Returns the spherical bounding box for the specified feature. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], * where left is the minimum longitude, bottom is the minimum latitude, right is maximum longitude, and top is the maximum latitude. All coordinates are given in degrees. * (Note that in projected planar coordinates, the minimum latitude is typically the maximum y-value, and the maximum latitude is typically the minimum y-value.) + * This is the spherical equivalent of path.bounds. * - * @param feature A geographic feature supported by d3-geo (An extension of GeoJSON feature). + * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ -export function geoBounds(feature: ExtendedFeature): [[number, number], [number, number]]; +export function geoBounds(object: ExtendedFeature): [[number, number], [number, number]]; /** * Returns the spherical bounding box for the specified feature collection. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], * where left is the minimum longitude, bottom is the minimum latitude, right is maximum longitude, and top is the maximum latitude. All coordinates are given in degrees. * (Note that in projected planar coordinates, the minimum latitude is typically the maximum y-value, and the maximum latitude is typically the minimum y-value.) + * This is the spherical equivalent of path.bounds. * - * @param feature A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). + * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). */ -export function geoBounds(feature: ExtendedFeatureCollection>): [[number, number], [number, number]]; +export function geoBounds(object: ExtendedFeatureCollection>): [[number, number], [number, number]]; /** * Returns the spherical bounding box for the specified GeoJson Geometry Object or GeoSphere object. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], * where left is the minimum longitude, bottom is the minimum latitude, right is maximum longitude, and top is the maximum latitude. All coordinates are given in degrees. * (Note that in projected planar coordinates, the minimum latitude is typically the maximum y-value, and the maximum latitude is typically the minimum y-value.) + * This is the spherical equivalent of path.bounds. * - * @param feature A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). + * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). */ -export function geoBounds(feature: GeoGeometryObjects): [[number, number], [number, number]]; +export function geoBounds(object: GeoGeometryObjects): [[number, number], [number, number]]; /** * Returns the spherical bounding box for the specified geometry collection. The bounding box is represented by a two-dimensional array: [[left, bottom], [right, top]], * where left is the minimum longitude, bottom is the minimum latitude, right is maximum longitude, and top is the maximum latitude. All coordinates are given in degrees. * (Note that in projected planar coordinates, the minimum latitude is typically the maximum y-value, and the maximum latitude is typically the minimum y-value.) + * This is the spherical equivalent of path.bounds. * - * @param feature A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). + * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ -export function geoBounds(feature: ExtendedGeometryCollection): [[number, number], [number, number]]; +export function geoBounds(object: ExtendedGeometryCollection): [[number, number], [number, number]]; /** * Returns the spherical centroid of the specified feature in steradians. - * (See also path.centroid, which computes the projected planar centroid.) + * This is the spherical equivalent of path.centroid. * - * @param feature A geographic feature supported by d3-geo (An extension of GeoJSON feature). + * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ -export function geoCentroid(feature: ExtendedFeature): [number, number]; +export function geoCentroid(object: ExtendedFeature): [number, number]; /** * Returns the spherical centroid of the specified feature collection in steradians. - * (See also path.centroid, which computes the projected planar centroid.) + * This is the spherical equivalent of path.centroid. * - * @param feature A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). + * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). */ -export function geoCentroid(feature: ExtendedFeatureCollection>): [number, number]; +export function geoCentroid(object: ExtendedFeatureCollection>): [number, number]; /** * Returns the spherical centroid of the specified GeoJson Geometry Object or GeoSphere object in steradians. - * (See also path.centroid, which computes the projected planar centroid.) + * This is the spherical equivalent of path.centroid. * - * @param feature A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). + * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). */ -export function geoCentroid(feature: GeoGeometryObjects): [number, number]; +export function geoCentroid(object: GeoGeometryObjects): [number, number]; /** * Returns the spherical centroid of the specified geographic geometry collection in steradians. - * (See also path.centroid, which computes the projected planar centroid.) + * This is the spherical equivalent of path.centroid. * - * @param feature A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). + * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ -export function geoCentroid(feature: ExtendedGeometryCollection): [number, number]; +export function geoCentroid(object: ExtendedGeometryCollection): [number, number]; + +/** + * Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point. + * The point must be specified as a two-element array [longitude, latitude] in degrees. For Point and MultiPoint geometries, an exact test is used; + * for a Sphere, true is always returned; for other geometries, an epsilon threshold is applied. + * + * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). + * @param point Point specified as a two-element array [longitude, latitude] in degrees. + */ +export function geoContains(object: ExtendedFeature, point: [number, number]): boolean; +/** + * Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point. + * The point must be specified as a two-element array [longitude, latitude] in degrees. For Point and MultiPoint geometries, an exact test is used; + * for a Sphere, true is always returned; for other geometries, an epsilon threshold is applied. + * + * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). + * @param point Point specified as a two-element array [longitude, latitude] in degrees. + */ +export function geoContains(object: ExtendedFeatureCollection>, point: [number, number]): boolean; +/** + * Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point. + * The point must be specified as a two-element array [longitude, latitude] in degrees. For Point and MultiPoint geometries, an exact test is used; + * for a Sphere, true is always returned; for other geometries, an epsilon threshold is applied. + * + * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). + * @param point Point specified as a two-element array [longitude, latitude] in degrees. + */ +export function geoContains(object: GeoGeometryObjects, point: [number, number]): boolean; +/** + * Returns true if and only if the specified GeoJSON object contains the specified point, or false if the object does not contain the point. + * The point must be specified as a two-element array [longitude, latitude] in degrees. For Point and MultiPoint geometries, an exact test is used; + * for a Sphere, true is always returned; for other geometries, an epsilon threshold is applied. + * + * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). + * @param point Point specified as a two-element array [longitude, latitude] in degrees. + */ +export function geoContains(object: ExtendedGeometryCollection, point: [number, number]): boolean; /** * Returns the great-arc distance in radians between the two points a and b. @@ -166,29 +210,33 @@ export function geoCentroid(feature: ExtendedGeometryCollection): number; +export function geoLength(object: ExtendedFeature): number; /** - * Returns the great-arc length of the specified feature collection in radians. + * Returns the great-arc length of the specified feature collection in radians. For polygons, returns the perimeter of the exterior ring plus that of any interior rings. + * This is the spherical equivalent of path.measure. * - * @param feature A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). + * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature). */ -export function geoLength(feature: ExtendedFeatureCollection>): number; +export function geoLength(object: ExtendedFeatureCollection>): number; /** - * Returns the great-arc length of the specified GeoJson Geometry Object or GeoSphere object in radians. + * Returns the great-arc length of the specified GeoJson Geometry Object or GeoSphere object in radians. For polygons, returns the perimeter of the exterior ring plus that of any interior rings. + * This is the spherical equivalent of path.measure. * -* @param feature A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). + * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). */ -export function geoLength(feature: GeoGeometryObjects): number; +export function geoLength(object: GeoGeometryObjects): number; /** - * Returns the great-arc length of the specified geographic geometry collection in radians. + * Returns the great-arc length of the specified geographic geometry collection in radians For polygons, returns the perimeter of the exterior ring plus that of any interior rings. + * This is the spherical equivalent of path.measure.. * - * @param feature A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). + * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). */ -export function geoLength(feature: ExtendedGeometryCollection): number; +export function geoLength(object: ExtendedGeometryCollection): number; /** * Returns an interpolator function given two points a and b. @@ -658,15 +706,15 @@ export interface GeoProjection extends GeoStreamWrapper { * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeature): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of the given extent. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param extent The extent, specified as an array [[xâ‚€, yâ‚€], [xâ‚, yâ‚]], where xâ‚€ is the left side of the bounding box, yâ‚€ is the top, xâ‚ is the right and yâ‚ is the bottom. - * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). - */ + /** + * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of the given extent. + * Returns the projection. + * + * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. + * + * @param extent The extent, specified as an array [[xâ‚€, yâ‚€], [xâ‚, yâ‚]], where xâ‚€ is the left side of the bounding box, yâ‚€ is the top, xâ‚ is the right and yâ‚ is the bottom. + * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). + */ fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeatureCollection>): this; /** * Sets the projection’s scale and translate to fit the specified geographic geometry object in the center of the given extent. @@ -678,15 +726,15 @@ export interface GeoProjection extends GeoStreamWrapper { * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). */ fitExtent(extent: [[number, number], [number, number]], object: GeoGeometryObjects): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic geometry collection in the center of the given extent. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param extent The extent, specified as an array [[xâ‚€, yâ‚€], [xâ‚, yâ‚]], where xâ‚€ is the left side of the bounding box, yâ‚€ is the top, xâ‚ is the right and yâ‚ is the bottom. - * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). - */ + /** + * Sets the projection’s scale and translate to fit the specified geographic geometry collection in the center of the given extent. + * Returns the projection. + * + * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. + * + * @param extent The extent, specified as an array [[xâ‚€, yâ‚€], [xâ‚, yâ‚]], where xâ‚€ is the left side of the bounding box, yâ‚€ is the top, xâ‚ is the right and yâ‚ is the bottom. + * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). + */ fitExtent(extent: [[number, number], [number, number]], object: ExtendedGeometryCollection): this; @@ -867,7 +915,8 @@ export interface GeoContext { /** * A Geo Path generator * - * The first generic corresponds to the "this"-context within which the geo path generator will be invoked. This could be e.g. the DOMElement bound to "this" when using selection.attr("d", ...) with the path generator. + * The first generic corresponds to the "this"-context within which the geo path generator will be invoked. + * This could be e.g. the DOMElement bound to "this" when using selection.attr("d", ...) with the path generator. * * The second generic corresponds to the type of the DatumObject which will be passed into the geo path generator for rendering. */ @@ -904,9 +953,9 @@ export interface GeoPath { /** * Returns the projected planar area (typically in square pixels) for the specified GeoJSON object. - * Point, MultiPoint, LineString and MultiLineString features have zero area. For Polygon and MultiPolygon features, + * Point, MultiPoint, LineString and MultiLineString geometries have zero area. For Polygon and MultiPolygon geometries, * 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. + * This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. This is the planar equivalent of d3.geoArea. * * @param object An object for which the area is to be calculated. */ @@ -919,7 +968,7 @@ export interface GeoPath { * * This is handy for, say, zooming in to a particular feature. (Note that in projected planar coordinates, * 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. + * This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. This is the planar equivalent of d3.geoBounds. * * @param object An object for which the bounds are to be calculated. */ @@ -929,17 +978,17 @@ export interface GeoPath { * Returns the projected planar centroid (typically in pixels) for the specified GeoJSON object. * This is handy for, say, labeling state or county boundaries, or displaying a symbol map. * 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. + * This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. This is the planar equivalent of d3.geoCentroid. * - * @param pbject An object for which the centroid is to be calculated. + * @param object An object for which the centroid is to be calculated. */ 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. + * Point and MultiPoint geometries have zero length. For Polygon and MultiPolygon geometries, this method computes the summed length of all rings. * - * This method observes any clipping performed by the projection. + * This method observes any clipping performed by the projection; see projection.clipAngle and projection.clipExtent. This is the planar equivalent of d3.geoLength. * * @param object An object for which the measure is to be calculated. */ @@ -1010,27 +1059,28 @@ export interface GeoPath { projection(projection: GeoStreamWrapper): this; /** - * Returns the current radius or radius accessor used to determine the radius for the display of Point and MultiPoint features. + * Returns the current radius or radius accessor used to determine the radius for the display of Point and MultiPoint geometries. * The default is a constant radius of 4.5. */ pointRadius(): ((this: This, object: DatumObject, ...args: any[]) => number) | number; /** - * Sets the radius used to display Point and MultiPoint features to the specified number and return the geo path generator. + * Sets the radius used to display Point and MultiPoint geometries to the specified number and return the geo path generator. * * @param value Fixed radius value. */ pointRadius(value: number): this; /** - * Sets the radius used to display Point and MultiPoint features to use the specified radius accessor function. + * Sets the radius used to display Point and MultiPoint geometries to use the specified radius accessor function. * * While the radius is commonly specified as a number constant, it may also be specified as a function which is computed per feature, * being passed the any arguments passed to the path generator. For example, if your GeoJSON data has additional properties, * you might access those properties inside the radius function to vary the point size; * alternatively, you could d3.symbol and a projection for greater flexibility. * - * @param value A value accessor function for the radius which is evaluated for each path to be rendered. The value accessor function is invoked within the "this" context in which the path generator is used. + * @param value A value accessor function for the radius which is evaluated for each path to be rendered. + * The value accessor function is invoked within the "this" context in which the path generator is used. * It is passed the object to be rendered, and any additional arguments which have been passed into the call to the render function of the path generator. */ pointRadius(value: (this: This, object: DatumObject, ...args: any[]) => number): this; @@ -1080,7 +1130,8 @@ export function geoPath(projection?: * * The default context is null, which implies that the path generator will return an SVG path string. * - * The first generic corresponds to the "this"-context within which the geo path generator will be invoked. This could be e.g. the DOMElement bound to "this" when using selection.attr("d", ...) with the path generator. + * The first generic corresponds to the "this"-context within which the geo path generator will be invoked. + * This could be e.g. the DOMElement bound to "this" when using selection.attr("d", ...) with the path generator. * * The second generic corresponds to the type of the DatumObject which will be passed into the geo path generator for rendering. * @@ -1349,15 +1400,15 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * @param object A geographic feature supported by d3-geo (An extension of GeoJSON feature). */ fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeature): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of the given extent. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param extent The extent, specified as an array [[xâ‚€, yâ‚€], [xâ‚, yâ‚]], where xâ‚€ is the left side of the bounding box, yâ‚€ is the top, xâ‚ is the right and yâ‚ is the bottom. - * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). - */ + /** + * Sets the projection’s scale and translate to fit the specified geographic feature collection in the center of the given extent. + * Returns the projection. + * + * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. + * + * @param extent The extent, specified as an array [[xâ‚€, yâ‚€], [xâ‚, yâ‚]], where xâ‚€ is the left side of the bounding box, yâ‚€ is the top, xâ‚ is the right and yâ‚ is the bottom. + * @param object A geographic feature collection supported by d3-geo (An extension of GeoJSON feature collection). + */ fitExtent(extent: [[number, number], [number, number]], object: ExtendedFeatureCollection>): this; /** * Sets the projection’s scale and translate to fit the specified geographic geometry object in the center of the given extent. @@ -1369,15 +1420,15 @@ export interface GeoIdentityTranform extends GeoStreamWrapper { * @param object A GeoJson Geometry Object or GeoSphere object supported by d3-geo (An extension of GeoJSON). */ fitExtent(extent: [[number, number], [number, number]], object: GeoGeometryObjects): this; - /** - * Sets the projection’s scale and translate to fit the specified geographic geometry collection in the center of the given extent. - * Returns the projection. - * - * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. - * - * @param extent The extent, specified as an array [[xâ‚€, yâ‚€], [xâ‚, yâ‚]], where xâ‚€ is the left side of the bounding box, yâ‚€ is the top, xâ‚ is the right and yâ‚ is the bottom. - * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). - */ + /** + * Sets the projection’s scale and translate to fit the specified geographic geometry collection in the center of the given extent. + * Returns the projection. + * + * Any clip extent is ignored when determining the new scale and translate. The precision used to compute the bounding box of the given object is computed at an effective scale of 150. + * + * @param extent The extent, specified as an array [[xâ‚€, yâ‚€], [xâ‚, yâ‚]], where xâ‚€ is the left side of the bounding box, yâ‚€ is the top, xâ‚ is the right and yâ‚ is the bottom. + * @param object A geographic geometry collection supported by d3-geo (An extension of GeoJSON geometry collection). + */ fitExtent(extent: [[number, number], [number, number]], object: ExtendedGeometryCollection): this; diff --git a/d3-geo/tslint.json b/d3-geo/tslint.json new file mode 100644 index 0000000000..68d10d72a6 --- /dev/null +++ b/d3-geo/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "unified-signatures": false + } +} From cff6915edf8267c7f083461e381d9db75ad93512 Mon Sep 17 00:00:00 2001 From: Tom Wanzek Date: Tue, 7 Mar 2017 21:38:45 -0500 Subject: [PATCH 367/797] [d3] v4.7 * [Chore] Bump minor version --- d3/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d3/index.d.ts b/d3/index.d.ts index d5fe886d63..525c4dbfd3 100644 --- a/d3/index.d.ts +++ b/d3/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for D3JS d3 standard bundle 4.6 +// Type definitions for D3JS d3 standard bundle 4.7 // Project: https://github.com/d3/d3 // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From ba9f5d22a2b4e5363ee402dec7776bc9dae2abd3 Mon Sep 17 00:00:00 2001 From: Tom Wanzek Date: Tue, 7 Mar 2017 21:53:29 -0500 Subject: [PATCH 368/797] [d3-geo] * Disable linting for maximum line length so that definition header comment line does not have to be broken up. --- d3-geo/tslint.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/d3-geo/tslint.json b/d3-geo/tslint.json index 68d10d72a6..6a00563639 100644 --- a/d3-geo/tslint.json +++ b/d3-geo/tslint.json @@ -1,6 +1,7 @@ { "extends": "../tslint.json", "rules": { - "unified-signatures": false + "unified-signatures": false, + "max-line-length": [false, 200] } } From dd7795e4dc0d12d29d152b31727af13478dfaaab Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Fri, 3 Feb 2017 19:28:13 -0500 Subject: [PATCH 369/797] Creates new folder for old selenium-webdriver v2 types --- selenium-webdriver/v2/chrome.d.ts | 418 ++ selenium-webdriver/v2/edge.d.ts | 129 + selenium-webdriver/v2/executors.d.ts | 15 + selenium-webdriver/v2/firefox.d.ts | 257 ++ selenium-webdriver/v2/http.d.ts | 156 + selenium-webdriver/v2/ie.d.ts | 211 ++ selenium-webdriver/v2/index.d.ts | 5053 +++++++++++++++++++++++++ selenium-webdriver/v2/opera.d.ts | 177 + selenium-webdriver/v2/remote.d.ts | 71 + selenium-webdriver/v2/safari.d.ts | 93 + selenium-webdriver/v2/test/chrome.ts | 61 + selenium-webdriver/v2/test/firefox.ts | 54 + selenium-webdriver/v2/test/index.ts | 1057 ++++++ selenium-webdriver/v2/testing.d.ts | 63 + selenium-webdriver/v2/tsconfig.json | 34 + 15 files changed, 7849 insertions(+) create mode 100644 selenium-webdriver/v2/chrome.d.ts create mode 100644 selenium-webdriver/v2/edge.d.ts create mode 100644 selenium-webdriver/v2/executors.d.ts create mode 100644 selenium-webdriver/v2/firefox.d.ts create mode 100644 selenium-webdriver/v2/http.d.ts create mode 100644 selenium-webdriver/v2/ie.d.ts create mode 100644 selenium-webdriver/v2/index.d.ts create mode 100644 selenium-webdriver/v2/opera.d.ts create mode 100644 selenium-webdriver/v2/remote.d.ts create mode 100644 selenium-webdriver/v2/safari.d.ts create mode 100644 selenium-webdriver/v2/test/chrome.ts create mode 100644 selenium-webdriver/v2/test/firefox.ts create mode 100644 selenium-webdriver/v2/test/index.ts create mode 100644 selenium-webdriver/v2/testing.d.ts create mode 100644 selenium-webdriver/v2/tsconfig.json diff --git a/selenium-webdriver/v2/chrome.d.ts b/selenium-webdriver/v2/chrome.d.ts new file mode 100644 index 0000000000..2ecff8d2f8 --- /dev/null +++ b/selenium-webdriver/v2/chrome.d.ts @@ -0,0 +1,418 @@ +import * as webdriver from './index'; +import * as remote from './remote'; + +declare namespace chrome { + /** + * Creates a new WebDriver client for Chrome. + * + * @extends {webdriver.WebDriver} + */ + class Driver extends webdriver.WebDriver { + /** + * @param {(webdriver.Capabilities|Options)=} opt_config The configuration + * options. + * @param {remote.DriverService=} opt_service The session to use; will use + * the {@link getDefaultService default service} by default. + * @param {webdriver.promise.ControlFlow=} opt_flow The control flow to use, or + * {@code null} to use the currently active flow. + * @constructor + */ + constructor(opt_config?: Options | webdriver.Capabilities, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow); + } + + interface IOptionsValues { + args: string[]; + binary?: string; + detach: boolean; + extensions: string[]; + localState?: any; + logFile?: string; + prefs?: any; + } + + interface IPerfLoggingPrefs { + enableNetwork: boolean; + enablePage: boolean; + enableTimeline: boolean; + tracingCategories: string; + bufferUsageReportingInterval: number; + } + + /** + * Class for managing ChromeDriver specific options. + */ + class Options { + /** + * @constructor + */ + constructor(); + + /** + * Extracts the ChromeDriver specific options from the given capabilities + * object. + * @param {!webdriver.Capabilities} capabilities The capabilities object. + * @return {!Options} The ChromeDriver options. + */ + static fromCapabilities(capabilities: webdriver.Capabilities): Options; + + + /** + * Add additional command line arguments to use when launching the Chrome + * browser. Each argument may be specified with or without the '--' prefix + * (e.g. '--foo' and 'foo'). Arguments with an associated value should be + * delimited by an '=': 'foo=bar'. + * @param {...(string|!Array.)} var_args The arguments to add. + * @return {!Options} A self reference. + */ + addArguments(...var_args: string[]): Options; + + + /** + * List of Chrome command line switches to exclude that ChromeDriver by default + * passes when starting Chrome. Do not prefix switches with '--'. + * + * @param {...(string|!Array)} var_args The switches to exclude. + * @return {!Options} A self reference. + */ + excludeSwitches(...var_args: string[]): Options; + + + /** + * Add additional extensions to install when launching Chrome. Each extension + * should be specified as the path to the packed CRX file, or a Buffer for an + * extension. + * @param {...(string|!Buffer|!Array.<(string|!Buffer)>)} var_args The + * extensions to add. + * @return {!Options} A self reference. + */ + addExtensions(...var_args: any[]): Options; + + + /** + * Sets the path to the Chrome binary to use. On Mac OS X, this path should + * reference the actual Chrome executable, not just the application binary + * (e.g. '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'). + * + * The binary path be absolute or relative to the chromedriver server + * executable, but it must exist on the machine that will launch Chrome. + * + * @param {string} path The path to the Chrome binary to use. + * @return {!Options} A self reference. + */ + setChromeBinaryPath(path: string): Options; + + + /** + * Sets whether to leave the started Chrome browser running if the controlling + * ChromeDriver service is killed before {@link webdriver.WebDriver#quit()} is + * called. + * @param {boolean} detach Whether to leave the browser running if the + * chromedriver service is killed before the session. + * @return {!Options} A self reference. + */ + detachDriver(detach: boolean): Options; + + + /** + * Sets the user preferences for Chrome's user profile. See the 'Preferences' + * file in Chrome's user data directory for examples. + * @param {!Object} prefs Dictionary of user preferences to use. + * @return {!Options} A self reference. + */ + setUserPreferences(prefs: any): Options; + + + /** + * Sets the logging preferences for the new session. + * @param {!webdriver.logging.Preferences} prefs The logging preferences. + * @return {!Options} A self reference. + */ + setLoggingPrefs(prefs: webdriver.logging.Preferences): Options; + + /** + * Sets the performance logging preferences. Options include: + * + * - `enableNetwork`: Whether or not to collect events from Network domain. + * - `enablePage`: Whether or not to collect events from Page domain. + * - `enableTimeline`: Whether or not to collect events from Timeline domain. + * Note: when tracing is enabled, Timeline domain is implicitly disabled, + * unless `enableTimeline` is explicitly set to true. + * - `tracingCategories`: A comma-separated string of Chrome tracing categories + * for which trace events should be collected. An unspecified or empty + * string disables tracing. + * - `bufferUsageReportingInterval`: The requested number of milliseconds + * between DevTools trace buffer usage events. For example, if 1000, then + * once per second, DevTools will report how full the trace buffer is. If a + * report indicates the buffer usage is 100%, a warning will be issued. + * + * @param {{enableNetwork: boolean, + * enablePage: boolean, + * enableTimeline: boolean, + * tracingCategories: string, + * bufferUsageReportingInterval: number}} prefs The performance + * logging preferences. + * @return {!Options} A self reference. + */ + setPerfLoggingPrefs(prefs: IPerfLoggingPrefs): Options; + + + /** + * Sets preferences for the 'Local State' file in Chrome's user data + * directory. + * @param {!Object} state Dictionary of local state preferences. + * @return {!Options} A self reference. + */ + setLocalState(state: any): Options; + + + /** + * Sets the name of the activity hosting a Chrome-based Android WebView. This + * option must be set to connect to an [Android WebView]( + * https://sites.google.com/a/chromium.org/chromedriver/getting-started/getting-started---android) + * + * @param {string} name The activity name. + * @return {!Options} A self reference. + */ + androidActivity(name: string): Options; + + + /** + * Sets the device serial number to connect to via ADB. If not specified, the + * ChromeDriver will select an unused device at random. An error will be + * returned if all devices already have active sessions. + * + * @param {string} serial The device serial number to connect to. + * @return {!Options} A self reference. + */ + androidDeviceSerial(serial: string): Options; + + + /** + * Configures the ChromeDriver to launch Chrome on Android via adb. This + * function is shorthand for + * {@link #androidPackage options.androidPackage('com.android.chrome')}. + * @return {!Options} A self reference. + */ + androidChrome(): Options; + + + /** + * Sets the package name of the Chrome or WebView app. + * + * @param {?string} pkg The package to connect to, or `null` to disable Android + * and switch back to using desktop Chrome. + * @return {!Options} A self reference. + */ + androidPackage(pkg: string): Options; + + + /** + * Sets the process name of the Activity hosting the WebView (as given by `ps`). + * If not specified, the process name is assumed to be the same as + * {@link #androidPackage}. + * + * @param {string} processName The main activity name. + * @return {!Options} A self reference. + */ + androidProcess(processName: string): Options; + + + /** + * Sets whether to connect to an already-running instead of the specified + * {@linkplain #androidProcess app} instead of launching the app with a clean + * data directory. + * + * @param {boolean} useRunning Whether to connect to a running instance. + * @return {!Options} A self reference. + */ + androidUseRunningApp(useRunning: boolean): Options; + + + /** + * Sets the path to Chrome's log file. This path should exist on the machine + * that will launch Chrome. + * @param {string} path Path to the log file to use. + * @return {!Options} A self reference. + */ + setChromeLogFile(path: string): Options; + + + /** + * Sets the directory to store Chrome minidumps in. This option is only + * supported when ChromeDriver is running on Linux. + * @param {string} path The directory path. + * @return {!Options} A self reference. + */ + setChromeMinidumpPath(path: string): Options; + + + /** + * Configures Chrome to emulate a mobile device. For more information, refer + * to the ChromeDriver project page on [mobile emulation][em]. Configuration + * options include: + * + * - `deviceName`: The name of a pre-configured [emulated device][devem] + * - `width`: screen width, in pixels + * - `height`: screen height, in pixels + * - `pixelRatio`: screen pixel ratio + * + * __Example 1: Using a Pre-configured Device__ + * + * let options = new chrome.Options().setMobileEmulation( + * {deviceName: 'Google Nexus 5'}); + * + * let driver = new chrome.Driver(options); + * + * __Example 2: Using Custom Screen Configuration__ + * + * let options = new chrome.Options().setMobileEmulation({ + * width: 360, + * height: 640, + * pixelRatio: 3.0 + * }); + * + * let driver = new chrome.Driver(options); + * + * + * [em]: https://sites.google.com/a/chromium.org/chromedriver/mobile-emulation + * [devem]: https://developer.chrome.com/devtools/docs/device-mode + * + * @param {?({deviceName: string}| + * {width: number, height: number, pixelRatio: number})} config The + * mobile emulation configuration, or `null` to disable emulation. + * @return {!Options} A self reference. + */ + setMobileEmulation(config: any): Options; + + /** + * Sets the proxy settings for the new session. + * @param {webdriver.ProxyConfig} proxy The proxy configuration to use. + * @return {!Options} A self reference. + */ + setProxy(proxy: webdriver.ProxyConfig): Options; + + + /** + * Converts this options instance to a {@link webdriver.Capabilities} object. + * @param {webdriver.Capabilities=} opt_capabilities The capabilities to merge + * these options into, if any. + * @return {!webdriver.Capabilities} The capabilities. + */ + toCapabilities(opt_capabilities?: webdriver.Capabilities): webdriver.Capabilities; + } + + /** + * Creates {@link remote.DriverService} instances that manage a ChromeDriver + * server. + */ + class ServiceBuilder { + /** + * @param {string=} opt_exe Path to the server executable to use. If omitted, + * the builder will attempt to locate the chromedriver on the current + * PATH. + * @throws {Error} If provided executable does not exist, or the chromedriver + * cannot be found on the PATH. + * @constructor + */ + constructor(opt_exe?: string); + + /** + * Sets the port to start the ChromeDriver on. + * @param {number} port The port to use, or 0 for any free port. + * @return {!ServiceBuilder} A self reference. + * @throws {Error} If the port is invalid. + */ + usingPort(port: number): ServiceBuilder; + + + /** + * Sets which port adb is listening to. _The ChromeDriver will connect to adb + * if an {@linkplain Options#androidPackage Android session} is requested, but + * adb **must** be started beforehand._ + * + * @param {number} port Which port adb is running on. + * @return {!ServiceBuilder} A self reference. + */ + setAdbPort(port: number): ServiceBuilder; + + + /** + * Sets the path of the log file the driver should log to. If a log file is + * not specified, the driver will log to stderr. + * @param {string} path Path of the log file to use. + * @return {!ServiceBuilder} A self reference. + */ + loggingTo(path: string): ServiceBuilder; + + + /** + * Enables verbose logging. + * @return {!ServiceBuilder} A self reference. + */ + enableVerboseLogging(): ServiceBuilder; + + + /** + * Sets the number of threads the driver should use to manage HTTP requests. + * By default, the driver will use 4 threads. + * @param {number} n The number of threads to use. + * @return {!ServiceBuilder} A self reference. + */ + setNumHttpThreads(n: number): ServiceBuilder; + + + /** + * Sets the base path for WebDriver REST commands (e.g. '/wd/hub'). + * By default, the driver will accept commands relative to '/'. + * @param {string} path The base path to use. + * @return {!ServiceBuilder} A self reference. + */ + setUrlBasePath(path: string): ServiceBuilder; + + + /** + * Defines the stdio configuration for the driver service. See + * {@code child_process.spawn} for more information. + * @param {(string|!Array.)} config The + * configuration to use. + * @return {!ServiceBuilder} A self reference. + */ + setStdio(config: string | Array): ServiceBuilder; + + + /** + * Defines the environment to start the server under. This settings will be + * inherited by every browser session started by the server. + * @param {!Object.} env The environment to use. + * @return {!ServiceBuilder} A self reference. + */ + withEnvironment(env: { [key: string]: string }): ServiceBuilder; + + + /** + * Creates a new DriverService using this instance's current configuration. + * @return {remote.DriverService} A new driver service using this instance's + * current configuration. + * @throws {Error} If the driver exectuable was not specified and a default + * could not be found on the current PATH. + */ + build(): remote.DriverService; + } + + /** + * Returns the default ChromeDriver service. If such a service has not been + * configured, one will be constructed using the default configuration for + * a ChromeDriver executable found on the system PATH. + * @return {!remote.DriverService} The default ChromeDriver service. + */ + function getDefaultService(): remote.DriverService; + + /** + * Sets the default service to use for new ChromeDriver instances. + * @param {!remote.DriverService} service The service to use. + * @throws {Error} If the default service is currently running. + */ + function setDefaultService(service: remote.DriverService): void; +} + +export = chrome; diff --git a/selenium-webdriver/v2/edge.d.ts b/selenium-webdriver/v2/edge.d.ts new file mode 100644 index 0000000000..fd59756c3d --- /dev/null +++ b/selenium-webdriver/v2/edge.d.ts @@ -0,0 +1,129 @@ +import * as webdriver from './index'; +import * as remote from './remote'; + +declare namespace edge { + + class Driver extends webdriver.WebDriver { + /** + * @param {(capabilities.Capabilities|Options)=} opt_config The configuration + * options. + * @param {remote.DriverService=} opt_service The session to use; will use + * the {@linkplain #getDefaultService default service} by default. + * @param {promise.ControlFlow=} opt_flow The control flow to use, or + * {@code null} to use the currently active flow. + */ + constructor(opt_config?: webdriver.Capabilities | Options, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow); + + /** + * This function is a no-op as file detectors are not supported by this + * implementation. + * @override + */ + setFileDetector(): void; + } + + /** + * Class for managing MicrosoftEdgeDriver specific options. + */ + class Options { + + /** + * Extracts the MicrosoftEdgeDriver specific options from the given + * capabilities object. + * @param {!capabilities.Capabilities} caps The capabilities object. + * @return {!Options} The MicrosoftEdgeDriver options. + */ + static fromCapabilities(cap: webdriver.Capabilities): Options; + + /** + * Sets the proxy settings for the new session. + * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. + * @return {!Options} A self reference. + */ + setProxy(proxy: webdriver.ProxyConfig): Options; + + /** + * Sets the page load strategy for Edge. + * Supported values are 'normal', 'eager', and 'none'; + * + * @param {string} pageLoadStrategy The page load strategy to use. + * @return {!Options} A self reference. + */ + setPageLoadStrategy(pageLoadStrategy: string): Options; + + /** + * Converts this options instance to a {@link capabilities.Capabilities} + * object. + * @param {capabilities.Capabilities=} opt_capabilities The capabilities to + * merge these options into, if any. + * @return {!capabilities.Capabilities} The capabilities. + */ + toCapabilities(opt_capabilities: webdriver.Capabilities): webdriver.Capabilities; + } + + /** + * Creates {@link remote.DriverService} instances that manage a + * MicrosoftEdgeDriver server in a child process. + */ + class ServiceBuilder { + /** + * @param {string=} opt_exe Path to the server executable to use. If omitted, + * the builder will attempt to locate the MicrosoftEdgeDriver on the current + * PATH. + * @throws {Error} If provided executable does not exist, or the + * MicrosoftEdgeDriver cannot be found on the PATH. + */ + constructor(opt_exe?: string); + + /** + * Defines the stdio configuration for the driver service. See + * {@code child_process.spawn} for more information. + * @param {(string|!Array.)} + * config The configuration to use. + * @return {!ServiceBuilder} A self reference. + */ + setStdio(config: string | Array): ServiceBuilder; + + /** + * Sets the port to start the MicrosoftEdgeDriver on. + * @param {number} port The port to use, or 0 for any free port. + * @return {!ServiceBuilder} A self reference. + * @throws {Error} If the port is invalid. + */ + usingPort(port: number): ServiceBuilder; + + /** + * Defines the environment to start the server under. This settings will be + * inherited by every browser session started by the server. + * @param {!Object.} env The environment to use. + * @return {!ServiceBuilder} A self reference. + */ + withEnvironment(env: Object): ServiceBuilder; + + /** + * Creates a new DriverService using this instance's current configuration. + * @return {!remote.DriverService} A new driver service using this instance's + * current configuration. + * @throws {Error} If the driver exectuable was not specified and a default + * could not be found on the current PATH. + */ + build(): remote.DriverService; + } + + /** + * Returns the default MicrosoftEdgeDriver service. If such a service has + * not been configured, one will be constructed using the default configuration + * for an MicrosoftEdgeDriver executable found on the system PATH. + * @return {!remote.DriverService} The default MicrosoftEdgeDriver service. + */ + function getDefaultService(): remote.DriverService; + + /** + * Sets the default service to use for new MicrosoftEdgeDriver instances. + * @param {!remote.DriverService} service The service to use. + * @throws {Error} If the default service is currently running. + */ + function setDefaultService(service: remote.DriverService): void; +} + +export = edge; diff --git a/selenium-webdriver/v2/executors.d.ts b/selenium-webdriver/v2/executors.d.ts new file mode 100644 index 0000000000..6cded31fec --- /dev/null +++ b/selenium-webdriver/v2/executors.d.ts @@ -0,0 +1,15 @@ +import * as webdriver from './index'; + +declare namespace executors { + /** + * Creates a command executor that uses WebDriver's JSON wire protocol. + * @param {(string|!promise.Promise)} url The server's URL, + * or a promise that will resolve to that URL. + * @param {?string=} opt_proxy (optional) The URL of the HTTP proxy for the + * client to use. + * @returns {!./lib/command.Executor} The new command executor. + */ + function createExecutor(url: string | webdriver.promise.Promise, opt_agent?: string, opt_proxy?: string): webdriver.Executor; +} + +export = executors; diff --git a/selenium-webdriver/v2/firefox.d.ts b/selenium-webdriver/v2/firefox.d.ts new file mode 100644 index 0000000000..25542f144f --- /dev/null +++ b/selenium-webdriver/v2/firefox.d.ts @@ -0,0 +1,257 @@ +import * as webdriver from './index'; +import * as remote from './remote'; + +declare namespace firefox { + /** + * Manages a Firefox subprocess configured for use with WebDriver. + */ + class Binary { + /** + * @param {string=} opt_exe Path to the Firefox binary to use. If not + * specified, will attempt to locate Firefox on the current system. + * @constructor + */ + constructor(opt_exe?: string); + + /** + * Add arguments to the command line used to start Firefox. + * @param {...(string|!Array.)} var_args Either the arguments to add as + * varargs, or the arguments as an array. + */ + addArguments(...var_args: string[]): void; + + + /** + * Launches Firefox and eturns a promise that will be fulfilled when the process + * terminates. + * @param {string} profile Path to the profile directory to use. + * @return {!promise.Promise.} A promise for the process result. + * @throws {Error} If this instance has already been started. + */ + launch(profile: string): webdriver.promise.Promise; + + + /** + * Kills the managed Firefox process. + * @return {!promise.Promise} A promise for when the process has terminated. + */ + kill(): webdriver.promise.Promise; + } + + /** + * Models a Firefox proifle directory for use with the FirefoxDriver. The + * {@code Proifle} directory uses an in-memory model until {@link #writeToDisk} + * is called. + */ + class Profile { + /** + * @param {string=} opt_dir Path to an existing Firefox profile directory to + * use a template for this profile. If not specified, a blank profile will + * be used. + * @constructor + */ + constructor(opt_dir?: string); + + /** + * Registers an extension to be included with this profile. + * @param {string} extension Path to the extension to include, as either an + * unpacked extension directory or the path to a xpi file. + */ + addExtension(extension: string): void; + + + /** + * Sets a desired preference for this profile. + * @param {string} key The preference key. + * @param {(string|number|boolean)} value The preference value. + * @throws {Error} If attempting to set a frozen preference. + */ + setPreference(key: string, value: string): void; + setPreference(key: string, value: number): void; + setPreference(key: string, value: boolean): void; + + + /** + * Returns the currently configured value of a profile preference. This does + * not include any defaults defined in the profile's template directory user.js + * file (if a template were specified on construction). + * @param {string} key The desired preference. + * @return {(string|number|boolean|undefined)} The current value of the + * requested preference. + */ + getPreference(key: string): any; + + + /** + * @return {number} The port this profile is currently configured to use, or + * 0 if the port will be selected at random when the profile is written + * to disk. + */ + getPort(): number; + + + /** + * Sets the port to use for the WebDriver extension loaded by this profile. + * @param {number} port The desired port, or 0 to use any free port. + */ + setPort(port: number): void; + + + /** + * @return {boolean} Whether the FirefoxDriver is configured to automatically + * accept untrusted SSL certificates. + */ + acceptUntrustedCerts(): boolean; + + + /** + * Sets whether the FirefoxDriver should automatically accept untrusted SSL + * certificates. + * @param {boolean} value . + */ + setAcceptUntrustedCerts(value: boolean): void; + + + /** + * Sets whether to assume untrusted certificates come from untrusted issuers. + * @param {boolean} value . + */ + setAssumeUntrustedCertIssuer(value: boolean): void; + + + /** + * @return {boolean} Whether to assume untrusted certs come from untrusted + * issuers. + */ + assumeUntrustedCertIssuer(): boolean; + + + /** + * Sets whether to use native events with this profile. + * @param {boolean} enabled . + */ + setNativeEventsEnabled(enabled: boolean): void; + + + /** + * Returns whether native events are enabled in this profile. + * @return {boolean} . + */ + nativeEventsEnabled(): boolean; + + + /** + * Writes this profile to disk. + * @param {boolean=} opt_excludeWebDriverExt Whether to exclude the WebDriver + * extension from the generated profile. Used to reduce the size of an + * {@link #encode() encoded profile} since the server will always install + * the extension itself. + * @return {!promise.Promise.} A promise for the path to the new + * profile directory. + */ + writeToDisk(opt_excludeWebDriverExt?: boolean): webdriver.promise.Promise; + + + /** + * Encodes this profile as a zipped, base64 encoded directory. + * @return {!promise.Promise.} A promise for the encoded profile. + */ + encode(): webdriver.promise.Promise; + } + + /** + * Configuration options for the FirefoxDriver. + */ + class Options { + /** + * Sets the profile to use. The profile may be specified as a + * {@link Profile} object or as the path to an existing Firefox profile to use + * as a template. + * + * @param {(string|!Profile)} profile The profile to use. + * @return {!Options} A self reference. + */ + setProfile(profile: string | any): Options; + + /** + * Sets the binary to use. The binary may be specified as the path to a Firefox + * executable, or as a {@link Binary} object. + * + * @param {(string|!Binary)} binary The binary to use. + * @return {!Options} A self reference. + */ + setBinary(binary: string | any): Options; + + /** + * Sets the logging preferences for the new session. + * @param {logging.Preferences} prefs The logging preferences. + * @return {!Options} A self reference. + */ + setLoggingPreferences(prefs: webdriver.logging.Preferences): Options; + + /** + * Sets the proxy to use. + * + * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. + * @return {!Options} A self reference. + */ + setProxy(proxy: webdriver.ProxyConfig): Options; + + /** + * Sets whether to use Mozilla's Marionette to drive the browser. + * + * @see https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver + */ + useMarionette(marionette: any): Options; + + /** + * Converts these options to a {@link capabilities.Capabilities} instance. + * + * @return {!capabilities.Capabilities} A new capabilities object. + */ + toCapabilities(): webdriver.Capabilities; + } + + /** + * @return {string} . + * @throws {Error} + */ + function findWires(): string; + + /** + * @param {(string|!Binary)} binary . + * @return {!remote.DriverService} . + */ + function createWiresService(binary: string | any): remote.DriverService; + + /** + * @param {(Profile|string)} profile The profile to prepare. + * @param {number} port The port the FirefoxDriver should listen on. + * @return {!Promise} a promise for the path to the profile directory. + */ + function prepareProfile(profile: string | any, port: number): any; + + /** + * A WebDriver client for Firefox. + */ + class Driver extends webdriver.WebDriver { + /** + * @param {(Options|capabilities.Capabilities|Object)=} opt_config The + * configuration options for this driver, specified as either an + * {@link Options} or {@link capabilities.Capabilities}, or as a raw hash + * object. + * @param {promise.ControlFlow=} opt_flow The flow to + * schedule commands through. Defaults to the active flow object. + */ + constructor(opt_config?: Options | webdriver.Capabilities | Object, opt_flow?: webdriver.promise.ControlFlow); + + /** + * This function is a no-op as file detectors are not supported by this + * implementation. + * @override + */ + setFileDetector(): void; + } +} + +export = firefox; diff --git a/selenium-webdriver/v2/http.d.ts b/selenium-webdriver/v2/http.d.ts new file mode 100644 index 0000000000..b4ade88430 --- /dev/null +++ b/selenium-webdriver/v2/http.d.ts @@ -0,0 +1,156 @@ +import * as webdriver from './index'; + +declare namespace http { + /** + * Converts a headers map to a HTTP header block string. + * @param {!Map} headers The map to convert. + * @return {string} The headers as a string. + */ + function headersToString(headers: any): string; + + /** + * Represents a HTTP request message. This class is a 'partial' request and only + * defines the path on the server to send a request to. It is each client's + * responsibility to build the full URL for the final request. + * @final + */ + class HttpRequest { + /** + * @param {string} method The HTTP method to use for the request. + * @param {string} path The path on the server to send the request to. + * @param {Object=} opt_data This request's non-serialized JSON payload data. + */ + constructor(method: string, path: string, opt_data?: Object); + + /** @override */ + toString(): string; + } + + /** + * Represents a HTTP response message. + * @final + */ + class HttpResponse { + /** + * @param {number} status The response code. + * @param {!Object} headers The response headers. All header names + * will be converted to lowercase strings for consistent lookups. + * @param {string} body The response body. + */ + constructor(status: number, headers: Object, body: string); + + /** @override */ + toString(): string; + } + + + function post(path: string): any; + function del(path: string): any; + function get(path: string): any; + function resource(method: string, path: string): any; + + /** + * A basic HTTP client used to send messages to a remote end. + */ + class HttpClient { + /** + * @param {string} serverUrl URL for the WebDriver server to send commands to. + * @param {http.Agent=} opt_agent The agent to use for each request. + * Defaults to `http.globalAgent`. + * @param {?string=} opt_proxy The proxy to use for the connection to the + * server. Default is to use no proxy. + */ + constructor(serverUrl: string, opt_agent?: any, opt_proxy?: string); + + /** + * Sends a request to the server. The client will automatically follow any + * redirects returned by the server, fulfilling the returned promise with the + * final response. + * + * @param {!HttpRequest} httpRequest The request to send. + * @return {!promise.Promise} A promise that will be fulfilled + * with the server's response. + */ + send(httpRequest: HttpRequest): webdriver.promise.Promise; + } + + /** + * Sends a single HTTP request. + * @param {!Object} options The request options. + * @param {function(!HttpResponse)} onOk The function to call if the + * request succeeds. + * @param {function(!Error)} onError The function to call if the request fails. + * @param {?string=} opt_data The data to send with the request. + * @param {?string=} opt_proxy The proxy server to use for the request. + */ + function sendRequest(options: Object, onOk: any, onError: any, opt_data?: string, opt_proxy?: string): any; + + /** + * A command executor that communicates with the server using HTTP + JSON. + * + * By default, each instance of this class will use the legacy wire protocol + * from [Selenium project][json]. The executor will automatically switch to the + * [W3C wire protocol][w3c] if the remote end returns a compliant response to + * a new session command. + * + * [json]: https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol + * [w3c]: https://w3c.github.io/webdriver/webdriver-spec.html + * + * @implements {cmd.Executor} + */ + class Executor { + /** + * @param {!HttpClient} client The client to use for sending requests to the + * server. + */ + constructor(client: HttpClient); + + /** + * Defines a new command for use with this executor. When a command is sent, + * the {@code path} will be preprocessed using the command's parameters; any + * path segments prefixed with ':' will be replaced by the parameter of the + * same name. For example, given '/person/:name' and the parameters + * '{name: 'Bob'}', the final command path will be '/person/Bob'. + * + * @param {string} name The command name. + * @param {string} method The HTTP method to use when sending this command. + * @param {string} path The path to send the command to, relative to + * the WebDriver server's command root and of the form + * '/path/:variable/segment'. + */ + defineCommand(name: string, method: string, path: string): void; + + /** @override */ + execute(command: any): any; + } + + /** + * @param {string} str . + * @return {?} . + */ + function tryParse(str: string): any; + + /** + * Callback used to parse {@link HttpResponse} objects from a + * {@link HttpClient}. + * @param {!HttpResponse} httpResponse The HTTP response to parse. + * @param {boolean} w3c Whether the response should be processed using the + * W3C wire protocol. + * @return {{value: ?}} The parsed response. + * @throws {WebDriverError} If the HTTP response is an error. + */ + function parseHttpResponse(httpResponse: HttpResponse, w3c: boolean): any; + + /** + * Builds a fully qualified path using the given set of command parameters. Each + * path segment prefixed with ':' will be replaced by the value of the + * corresponding parameter. All parameters spliced into the path will be + * removed from the parameter map. + * @param {string} path The original resource path. + * @param {!Object<*>} parameters The parameters object to splice into the path. + * @return {string} The modified path. + */ + function buildPath(path: string, parameters: Object): string; +} + +export = http; diff --git a/selenium-webdriver/v2/ie.d.ts b/selenium-webdriver/v2/ie.d.ts new file mode 100644 index 0000000000..5d9b51c64d --- /dev/null +++ b/selenium-webdriver/v2/ie.d.ts @@ -0,0 +1,211 @@ +import * as webdriver from './index'; + +declare namespace ie { + + /** + * A WebDriver client for Microsoft's Internet Explorer. + */ + class Driver extends webdriver.WebDriver { + /** + * @param {(capabilities.Capabilities|Options)=} opt_config The configuration + * options. + * @param {promise.ControlFlow=} opt_flow The control flow to use, + * or {@code null} to use the currently active flow. + */ + constructor(opt_config?: webdriver.Capabilities | Options, opt_flow?: webdriver.promise.ControlFlow); + + /** + * This function is a no-op as file detectors are not supported by this + * implementation. + * @override + */ + setFileDetector(): void; + } + + /** + * Class for managing IEDriver specific options. + */ + class Options { + constructor(); + + /** + * Extracts the IEDriver specific options from the given capabilities + * object. + * @param {!capabilities.Capabilities} caps The capabilities object. + * @return {!Options} The IEDriver options. + */ + static fromCapabilities(caps: webdriver.Capabilities): Options; + + /** + * Whether to disable the protected mode settings check when the session is + * created. Disbling this setting may lead to significant instability as the + * browser may become unresponsive/hang. Only 'best effort' support is provided + * when using this capability. + * + * For more information, refer to the IEDriver's + * [required system configuration](http://goo.gl/eH0Yi3). + * + * @param {boolean} ignoreSettings Whether to ignore protected mode settings. + * @return {!Options} A self reference. + */ + introduceFlakinessByIgnoringProtectedModeSettings(ignoreSettings: boolean): Options; + + /** + * Indicates whether to skip the check that the browser's zoom level is set to + * 100%. + * + * @param {boolean} ignore Whether to ignore the browser's zoom level settings. + * @return {!Options} A self reference. + */ + ignoreZoomSetting(ignore: boolean): Options; + + /** + * Sets the initial URL loaded when IE starts. This is intended to be used with + * {@link #ignoreProtectedModeSettings} to allow the user to initialize IE in + * the proper Protected Mode zone. Setting this option may cause browser + * instability or flaky and unresponsive code. Only 'best effort' support is + * provided when using this option. + * + * @param {string} url The initial browser URL. + * @return {!Options} A self reference. + */ + initialBrowserUrl(url: string): Options; + + /** + * Configures whether to enable persistent mouse hovering (true by default). + * Persistent hovering is achieved by continuously firing mouse over events at + * the last location the mouse cursor has been moved to. + * + * @param {boolean} enable Whether to enable persistent hovering. + * @return {!Options} A self reference. + */ + enablePersistentHover(enable: boolean): Options; + + /** + * Configures whether the driver should attempt to remove obsolete + * {@linkplain webdriver.WebElement WebElements} from its internal cache on + * page navigation (true by default). Disabling this option will cause the + * driver to run with a larger memory footprint. + * + * @param {boolean} enable Whether to enable element reference cleanup. + * @return {!Options} A self reference. + */ + enableElementCacheCleanup(enable: boolean): Options; + + /** + * Configures whether to require the IE window to have input focus before + * performing any user interactions (i.e. mouse or keyboard events). This + * option is disabled by default, but delivers much more accurate interaction + * events when enabled. + * + * @param {boolean} require Whether to require window focus. + * @return {!Options} A self reference. + */ + requireWindowFocus(require: boolean): Options; + + /** + * Configures the timeout, in milliseconds, that the driver will attempt to + * located and attach to a newly opened instance of Internet Explorer. The + * default is zero, which indicates waiting indefinitely. + * + * @param {number} timeout How long to wait for IE. + * @return {!Options} A self reference. + */ + browserAttachTimeout(timeout: number): Options; + + /** + * Configures whether to launch Internet Explorer using the CreateProcess API. + * If this option is not specified, IE is launched using IELaunchURL, if + * available. For IE 8 and above, this option requires the TabProcGrowth + * registry value to be set to 0. + * + * @param {boolean} force Whether to use the CreateProcess API. + * @return {!Options} A self reference. + */ + forceCreateProcessApi(force: boolean): Options; + + /** + * Specifies command-line switches to use when launching Internet Explorer. + * This is only valid when used with {@link #forceCreateProcessApi}. + * + * @param {...(string|!Array.)} var_args The arguments to add. + * @return {!Options} A self reference. + */ + addArguments(...var_args: Array): Options; + + /** + * Configures whether proxies should be configured on a per-process basis. If + * not set, setting a {@linkplain #setProxy proxy} will configure the system + * proxy. The default behavior is to use the system proxy. + * + * @param {boolean} enable Whether to enable per-process proxy settings. + * @return {!Options} A self reference. + */ + usePerProcessProxy(enable: boolean): Options; + + /** + * Configures whether to clear the cache, cookies, history, and saved form data + * before starting the browser. _Using this capability will clear session data + * for all running instances of Internet Explorer, including those started + * manually._ + * + * @param {boolean} cleanSession Whether to clear all session data on startup. + * @return {!Options} A self reference. + */ + ensureCleanSession(cleanSession: boolean): Options; + + /** + * Sets the path to the log file the driver should log to. + * @param {string} file The log file path. + * @return {!Options} A self reference. + */ + setLogFile(file: string): Options; + + /** + * Sets the IEDriverServer's logging {@linkplain Level level}. + * @param {Level} level The logging level. + * @return {!Options} A self reference. + */ + setLogLevel(level: webdriver.logging.Level): Options; + + /** + * Sets the IP address of the driver's host adapter. + * @param {string} host The IP address to use. + * @return {!Options} A self reference. + */ + setHost(host: string): Options; + + /** + * Sets the path of the temporary data directory to use. + * @param {string} path The log file path. + * @return {!Options} A self reference. + */ + setExtractPath(path: string): Options; + + /** + * Sets whether the driver should start in silent mode. + * @param {boolean} silent Whether to run in silent mode. + * @return {!Options} A self reference. + */ + silent(silent: boolean): Options; + + /** + * Sets the proxy settings for the new session. + * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. + * @return {!Options} A self reference. + */ + setProxy(proxy: webdriver.ProxyConfig): Options; + + /** + * Converts this options instance to a {@link capabilities.Capabilities} + * object. + * @param {capabilities.Capabilities=} opt_capabilities The capabilities to + * merge these options into, if any. + * @return {!capabilities.Capabilities} The capabilities. + */ + toCapabilities(opt_capabilities: webdriver.Capabilities): webdriver.Capabilities; + } + +} + +export = ie; diff --git a/selenium-webdriver/v2/index.d.ts b/selenium-webdriver/v2/index.d.ts new file mode 100644 index 0000000000..17fba9ceae --- /dev/null +++ b/selenium-webdriver/v2/index.d.ts @@ -0,0 +1,5053 @@ +// Type definitions for Selenium WebDriverJS 2.53.1 +// 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 + +import * as chrome from './chrome'; +import * as edge from './edge'; +import * as firefox from './firefox'; +import * as ie from './ie'; +import * as opera from './opera'; +import * as safari from './safari'; + +declare namespace webdriver { + + namespace error { + class IError extends Error { + constructor(opt_error?: string); + + code(): number; + } + + /** + * The base WebDriver error type. This error type is only used directly when a + * more appropriate category is not defined for the offending error. + */ + class WebDriverError extends IError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An attempt was made to select an element that cannot be selected. + */ + class ElementNotSelectableError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An element command could not be completed because the element is not visible + * on the page. + */ + class ElementNotVisibleError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * The arguments passed to a command are either invalid or malformed. + */ + class InvalidArgumentError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An illegal attempt was made to set a cookie under a different domain than + * the current page. + */ + class InvalidCookieDomainError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * The coordinates provided to an interactions operation are invalid. + */ + class InvalidElementCoordinatesError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An element command could not be completed because the element is in an + * invalid state, e.g. attempting to click an element that is no longer attached + * to the document. + */ + class InvalidElementStateError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * Argument was an invalid selector. + */ + class InvalidSelectorError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * Occurs when a command is directed to a session that does not exist. + */ + class NoSuchSessionError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An error occurred while executing JavaScript supplied by the user. + */ + class JavascriptError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * The target for mouse interaction is not in the browser’s viewport and cannot + * be brought into that viewport. + */ + class MoveTargetOutOfBoundsError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An attempt was made to operate on a modal dialog when one was not open. + */ + class NoSuchAlertError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An element could not be located on the page using the given search + * parameters. + */ + class NoSuchElementError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * A request to switch to a frame could not be satisfied because the frame + * could not be found. + */ + class NoSuchFrameError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * A request to switch to a window could not be satisfied because the window + * could not be found. + */ + class NoSuchWindowError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * A script did not complete before its timeout expired. + */ + class ScriptTimeoutError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * A new session could not be created. + */ + class SessionNotCreatedError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An element command failed because the referenced element is no longer + * attached to the DOM. + */ + class StaleElementReferenceError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An operation did not completErrorCodee before its timeout expired. + */ + class TimeoutError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * A request to set a cookie’s value could not be satisfied. + */ + class UnableToSetCookieError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * A screen capture operation was not possible. + */ + class UnableToCaptureScreenError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * A modal dialog was open, blocking this operation. + */ + class UnexpectedAlertOpenError extends WebDriverError { + /** + * @param {string=} opt_error the error message, if any. + * @param {string=} opt_text the text of the open dialog, if available. + */ + constructor(opt_error?: string, opt_text?: string); + + /** + * @return {(string|undefined)} The text displayed with the unhandled alert, + * if available. + */ + getAlertText(): string; + } + + /** + * A command could not be executed because the remote end is not aware of it. + */ + class UnknownCommandError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * The requested command matched a known URL but did not match an method for + * that URL. + */ + class UnknownMethodError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * Reports an unsupport operation. + */ + class UnsupportedOperationError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + } + + namespace logging { + + /** + * A hash describing log preferences. + * @typedef {Object.} + */ + class Preferences { + setLevel(type: string, level: Level | string | number): void; + toJSON(): { [key: string]: string }; + } + + interface IType { + /** Logs originating from the browser. */ + BROWSER: string; + /** Logs from a WebDriver client. */ + CLIENT: string; + /** Logs from a WebDriver implementation. */ + DRIVER: string; + /** Logs related to performance. */ + PERFORMANCE: string; + /** Logs from the remote server. */ + SERVER: string; + } + + /** + * Common log types. + * @enum {string} + */ + var Type: IType; + + /** + * Defines a message level that may be used to control logging output. + * + * @final + */ + class Level { + name_: string; + value_: number; + /** + * @param {string} name the level's name. + * @param {number} level the level's numeric value. + */ + constructor(name: string, level: number); + + /** @override */ + toString(): string; + + /** This logger's name. */ + name: string; + + /** The numeric log level. */ + value: number; + + /** + * Indicates no log messages should be recorded. + * @const + */ + static OFF: Level; + /** + * Log messages with a level of `1000` or higher. + * @const + */ + static SEVERE: Level; + /** + * Log messages with a level of `900` or higher. + * @const + */ + static WARNING: Level; + /** + * Log messages with a level of `800` or higher. + * @const + */ + static INFO: Level; + /** + * Log messages with a level of `700` or higher. + * @const + */ + static DEBUG: Level; + /** + * Log messages with a level of `500` or higher. + * @const + */ + static FINE: Level; + /** + * Log messages with a level of `400` or higher. + * @const + */ + static FINER: Level; + /** + * Log messages with a level of `300` or higher. + * @const + */ + static FINEST: Level; + /** + * Indicates all log messages should be recorded. + * @const + */ + static ALL: Level; + } + + /** + * Converts a level name or value to a {@link webdriver.logging.Level} value. + * If the name/value is not recognized, {@link webdriver.logging.Level.ALL} + * will be returned. + * @param {(number|string)} nameOrValue The log level name, or value, to + * convert . + * @return {!webdriver.logging.Level} The converted level. + */ + function getLevel(nameOrValue: string | number): Level; + + interface IEntryJSON { + level: string; + message: string; + timestamp: number; + type: string; + } + + /** + * A single log entry. + */ + class Entry { + /** + * @param {(!webdriver.logging.Level|string)} level The entry level. + * @param {string} message The log message. + * @param {number=} opt_timestamp The time this entry was generated, in + * milliseconds since 0:00:00, January 1, 1970 UTC. If omitted, the + * current time will be used. + * @param {string=} opt_type The log type, if known. + * @constructor + */ + constructor(level: Level | string | number, message: string, opt_timestamp?: number, opt_type?: string | IType); + + /** @type {!webdriver.logging.Level} */ + level: Level; + + /** @type {string} */ + message: string; + + /** @type {number} */ + timestamp: number; + + /** @type {string} */ + type: string; + + /** + * @return {{level: string, message: string, timestamp: number, + * type: string}} The JSON representation of this entry. + */ + toJSON(): IEntryJSON; + } + + /** + * An object used to log debugging messages. Loggers use a hierarchical, + * dot-separated naming scheme. For instance, 'foo' is considered the parent of + * the 'foo.bar' and an ancestor of 'foo.bar.baz'. + * + * Each logger may be assigned a {@linkplain #setLevel log level}, which + * controls which level of messages will be reported to the + * {@linkplain #addHandler handlers} attached to this instance. If a log level + * is not explicitly set on a logger, it will inherit its parent. + * + * This class should never be directly instantiated. Instead, users should + * obtain logger references using the {@linkplain ./logging.getLogger() + * getLogger()} function. + * + * @final + */ + class Logger { + /** + * @param {string} name the name of this logger. + * @param {Level=} opt_level the initial level for this logger. + */ + constructor(name: string, opt_level?: Level); + + /** @private {string} */ + name_: string; + /** @private {Level} */ + level_: Level; + /** @private {Logger} */ + parent_: Logger; + /** @private {Set} */ + handlers_: any; + + /** @return {string} the name of this logger. */ + getName(): string; + + /** + * @param {Level} level the new level for this logger, or `null` if the logger + * should inherit its level from its parent logger. + */ + setLevel(level: Level): void; + + /** @return {Level} the log level for this logger. */ + getLevel(): Level; + + /** + * @return {!Level} the effective level for this logger. + */ + getEffectiveLevel(): Level; + + /** + * @param {!Level} level the level to check. + * @return {boolean} whether messages recorded at the given level are loggable + * by this instance. + */ + isLoggable(level: Level): boolean; + + /** + * Adds a handler to this logger. The handler will be invoked for each message + * logged with this instance, or any of its descendants. + * + * @param {function(!Entry)} handler the handler to add. + */ + addHandler(handler: any): void; + + /** + * Removes a handler from this logger. + * + * @param {function(!Entry)} handler the handler to remove. + * @return {boolean} whether a handler was successfully removed. + */ + removeHandler(handler: any): void; + + /** + * Logs a message at the given level. The message may be defined as a string + * or as a function that will return the message. If a function is provided, + * it will only be invoked if this logger's + * {@linkplain #getEffectiveLevel() effective log level} includes the given + * `level`. + * + * @param {!Level} level the level at which to log the message. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + log(level: Level, loggable: string | Function): void; + + /** + * Logs a message at the {@link Level.SEVERE} log level. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + severe(loggable: string | Function): void; + + /** + * Logs a message at the {@link Level.WARNING} log level. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + warning(loggable: string | Function): void; + + /** + * Logs a message at the {@link Level.INFO} log level. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + info(loggable: string | Function): void; + + /** + * Logs a message at the {@link Level.DEBUG} log level. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + debug(loggable: string | Function): void; + + /** + * Logs a message at the {@link Level.FINE} log level. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + fine(loggable: string | Function): void; + + /** + * Logs a message at the {@link Level.FINER} log level. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + finer(loggable: string | Function): void; + + /** + * Logs a message at the {@link Level.FINEST} log level. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + finest(loggable: string | Function): void; + } + + /** + * Maintains a collection of loggers. + * + * @final + */ + class LogManager { + /** + * Retrieves a named logger, creating it in the process. This function will + * implicitly create the requested logger, and any of its parents, if they + * do not yet exist. + * + * @param {string} name the logger's name. + * @return {!Logger} the requested logger. + */ + getLogger(name: string): Logger; + + /** + * Creates a new logger. + * + * @param {string} name the logger's name. + * @param {!Logger} parent the logger's parent. + * @return {!Logger} the new logger. + * @private + */ + createLogger_(name: string, parent: Logger): Logger; + } + } + + namespace promise { + //region Functions + + /** + * Given an array of promises, will return a promise that will be fulfilled + * with the fulfillment values of the input array's values. If any of the + * input array's promises are rejected, the returned promise will be rejected + * with the same reason. + * + * @param {!Array<(T|!ManagedPromise)>} arr An array of + * promises to wait on. + * @return {!ManagedPromise>} A promise that is + * fulfilled with an array containing the fulfilled values of the + * input array, or rejected with the same reason as the first + * rejected value. + * @template T + */ + function all(arr: Array>): Promise; + + /** + * Invokes the appropriate callback function as soon as a promised + * {@code value} is resolved. This function is similar to + * {@link webdriver.promise.when}, except it does not return a new promise. + * @param {*} value The value to observe. + * @param {Function} callback The function to call when the value is + * resolved successfully. + * @param {Function=} opt_errback The function to call when the value is + * rejected. + */ + function asap(value: any, callback: Function, opt_errback?: Function): void; + + /** + * @return {!webdriver.promise.ControlFlow} The currently active control flow. + */ + function controlFlow(): ControlFlow; + + /** + * Creates a new control flow. The provided callback will be invoked as the + * first task within the new flow, with the flow as its sole argument. Returns + * a promise that resolves to the callback result. + * @param {function(!ControlFlow)} callback The entry point + * to the newly created flow. + * @return {!ManagedPromise} A promise that resolves to the callback + * result. + */ + function createFlow(callback: (flow: ControlFlow) => R): Promise; + + /** + * Determines whether a {@code value} should be treated as a promise. + * Any object whose 'then' property is a function will be considered a promise. + * + * @param {*} value The value to test. + * @return {boolean} Whether the value is a promise. + */ + function isPromise(value: any): boolean; + + /** + * Tests is a function is a generator. + * @param {!Function} fn The function to test. + * @return {boolean} Whether the function is a generator. + */ + function isGenerator(fn: Function): boolean; + + /** + * Creates a promise that will be resolved at a set time in the future. + * @param {number} ms The amount of time, in milliseconds, to wait before + * resolving the promise. + * @return {!ManagedPromise} The promise. + */ + function delayed(ms: number): Promise; + + /** + * Calls a function for each element in an array, and if the function returns + * true adds the element to a new array. + * + * If the return value of the filter function is a promise, this function + * will wait for it to be fulfilled before determining whether to insert the + * element into the new array. + * + * If the filter function throws or returns a rejected promise, the promise + * returned by this function will be rejected with the same reason. Only the + * first failure will be reported; all subsequent errors will be silently + * ignored. + * + * @param {!(Array|ManagedPromise>)} arr The + * array to iterator over, or a promise that will resolve to said array. + * @param {function(this: SELF, TYPE, number, !Array): ( + * boolean|ManagedPromise)} fn The function + * to call for each element in the array. + * @param {SELF=} opt_self The object to be used as the value of 'this' within + * {@code fn}. + * @template TYPE, SELF + */ + function filter(arr: Array | Promise>, fn: (element: T, type: any, index: number, array: T[]) => any, opt_self?: any): Promise; + + /** + * Creates a new deferred object. + * @return {!webdriver.promise.Deferred} The new deferred object. + */ + function defer(): Deferred; + + /** + * Creates a promise that has been resolved with the given value. + * @param {T=} opt_value The resolved value. + * @return {!ManagedPromise} The resolved promise. + * @template T + */ + function fulfilled(opt_value?: T): Promise; + + /** + * Calls a function for each element in an array and inserts the result into a + * new array, which is used as the fulfillment value of the promise returned + * by this function. + * + * If the return value of the mapping function is a promise, this function + * will wait for it to be fulfilled before inserting it into the new array. + * + * If the mapping function throws or returns a rejected promise, the + * promise returned by this function will be rejected with the same reason. + * Only the first failure will be reported; all subsequent errors will be + * silently ignored. + * + * @param {!(Array|ManagedPromise>)} arr The + * array to iterator over, or a promise that will resolve to said array. + * @param {function(this: SELF, TYPE, number, !Array): ?} fn The + * function to call for each element in the array. This function should + * expect three arguments (the element, the index, and the array itself. + * @param {SELF=} opt_self The object to be used as the value of 'this' within + * {@code fn}. + * @template TYPE, SELF + */ + function map(arr: Array | Promise>, fn: (self: any, type: any, index: number, array: T[]) => any, opt_self?: any): Promise + + /** + * Creates a promise that has been rejected with the given reason. + * @param {*=} opt_reason The rejection reason; may be any value, but is + * usually an Error or a string. + * @return {!ManagedPromise} The rejected promise. + * @template T + */ + function rejected(opt_reason?: any): Promise; + + /** + * Wraps a function that expects a node-style callback as its final + * argument. This callback expects two arguments: an error value (which will be + * null if the call succeeded), and the success value as the second argument. + * The callback will the resolve or reject the returned promise, based on its + * arguments. + * @param {!Function} fn The function to wrap. + * @param {...?} var_args The arguments to apply to the function, excluding the + * final callback. + * @return {!ManagedPromise} A promise that will be resolved with the + * result of the provided function's callback. + */ + function checkedNodeCall(fn: Function, ...var_args: any[]): Promise; + + /** + * Consumes a {@code GeneratorFunction}. Each time the generator yields a + * promise, this function will wait for it to be fulfilled before feeding the + * fulfilled value back into {@code next}. Likewise, if a yielded promise is + * rejected, the rejection error will be passed to {@code throw}. + * + * __Example 1:__ the Fibonacci Sequence. + * + * promise.consume(function* fibonacci() { + * var n1 = 1, n2 = 1; + * for (var i = 0; i < 4; ++i) { + * var tmp = yield n1 + n2; + * n1 = n2; + * n2 = tmp; + * } + * return n1 + n2; + * }).then(function(result) { + * console.log(result); // 13 + * }); + * + * __Example 2:__ a generator that throws. + * + * promise.consume(function* () { + * yield promise.delayed(250).then(function() { + * throw Error('boom'); + * }); + * }).catch(function(e) { + * console.log(e.toString()); // Error: boom + * }); + * + * @param {!Function} generatorFn The generator function to execute. + * @param {Object=} opt_self The object to use as 'this' when invoking the + * initial generator. + * @param {...*} var_args Any arguments to pass to the initial generator. + * @return {!ManagedPromise} A promise that will resolve to the + * generator's final result. + * @throws {TypeError} If the given function is not a generator. + */ + function consume(generatorFn: Function, opt_self?: any, ...var_args: any[]): Promise; + + /** + * Registers an observer on a promised {@code value}, returning a new promise + * that will be resolved when the value is. If {@code value} is not a promise, + * then the return promise will be immediately resolved. + * @param {*} value The value to observe. + * @param {Function=} opt_callback The function to call when the value is + * resolved successfully. + * @param {Function=} opt_errback The function to call when the value is + * rejected. + * @return {!ManagedPromise} A new promise. + */ + function when(value: T | Promise, opt_callback?: (value: T) => any, opt_errback?: (error: any) => any): Promise; + + /** + * Returns a promise that will be resolved with the input value in a + * fully-resolved state. If the value is an array, each element will be fully + * resolved. Likewise, if the value is an object, all keys will be fully + * resolved. In both cases, all nested arrays and objects will also be + * fully resolved. All fields are resolved in place; the returned promise will + * resolve on {@code value} and not a copy. + * + * Warning: This function makes no checks against objects that contain + * cyclical references: + * + * var value = {}; + * value['self'] = value; + * promise.fullyResolved(value); // Stack overflow. + * + * @param {*} value The value to fully resolve. + * @return {!ManagedPromise} A promise for a fully resolved version + * of the input value. + */ + function fullyResolved(value: any): Promise; + + /** + * Changes the default flow to use when no others are active. + * @param {!ControlFlow} flow The new default flow. + * @throws {Error} If the default flow is not currently active. + */ + function setDefaultFlow(flow: ControlFlow): void; + + //endregion + + /** + * Error used when the computation of a promise is cancelled. + */ + class CancellationError extends Error { + /** + * @param {string=} opt_msg The cancellation message. + */ + constructor(opt_msg?: string); + } + + interface IThenable { + /** + * Cancels the computation of this promise's value, rejecting the promise in + * the process. This method is a no-op if the promise has already been + * resolved. + * + * @param {(string|Error)=} opt_reason The reason this promise is being + * cancelled. This value will be wrapped in a {@link CancellationError}. + */ + cancel(opt_reason?: string | Error): void; + + /** @return {boolean} Whether this promise's value is still being computed. */ + isPending(): boolean; + + /** + * Registers listeners for when this instance is resolved. + * + * @param {?(function(T): (R|IThenable))=} opt_callback The + * function to call if this promise is successfully resolved. The function + * should expect a single argument: the promise's resolved value. + * @param {?(function(*): (R|IThenable))=} opt_errback + * The function to call if this promise is rejected. The function should + * expect a single argument: the rejection reason. + * @return {!ManagedPromise} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + then(opt_callback?: (value: T) => R | IThenable, opt_errback?: (error: any) => any): Promise; + + /** + * Registers a listener for when this promise is rejected. This is synonymous + * with the {@code catch} clause in a synchronous API: + * + * // Synchronous API: + * try { + * doSynchronousWork(); + * } catch (ex) { + * console.error(ex); + * } + * + * // Asynchronous promise API: + * doAsynchronousWork().catch(function(ex) { + * console.error(ex); + * }); + * + * @param {function(*): (R|IThenable)} errback The + * function to call if this promise is rejected. The function should + * expect a single argument: the rejection reason. + * @return {!ManagedPromise} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + catch(errback: Function): Promise; + } + + /** + * Thenable is a promise-like object with a {@code then} method which may be + * used to schedule callbacks on a promised value. + * + * @interface + * @template T + */ + class Thenable implements IThenable { + /** + * Cancels the computation of this promise's value, rejecting the promise in + * the process. This method is a no-op if the promise has already been + * resolved. + * + * @param {(string|Error)=} opt_reason The reason this promise is being + * cancelled. This value will be wrapped in a {@link CancellationError}. + */ + cancel(opt_reason?: string | Error): void; + + /** @return {boolean} Whether this promise's value is still being computed. */ + isPending(): boolean; + + /** + * Registers listeners for when this instance is resolved. + * + * @param {?(function(T): (R|IThenable))=} opt_callback The + * function to call if this promise is successfully resolved. The function + * should expect a single argument: the promise's resolved value. + * @param {?(function(*): (R|IThenable))=} opt_errback + * The function to call if this promise is rejected. The function should + * expect a single argument: the rejection reason. + * @return {!ManagedPromise} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + then(opt_callback?: (value: T) => R | IThenable, opt_errback?: (error: any) => R | IThenable): Promise; + + /** + * Registers a listener for when this promise is rejected. This is synonymous + * with the {@code catch} clause in a synchronous API: + * + * // Synchronous API: + * try { + * doSynchronousWork(); + * } catch (ex) { + * console.error(ex); + * } + * + * // Asynchronous promise API: + * doAsynchronousWork().catch(function(ex) { + * console.error(ex); + * }); + * + * @param {function(*): (R|IThenable)} errback The + * function to call if this promise is rejected. The function should + * expect a single argument: the rejection reason. + * @return {!ManagedPromise} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + catch(errback: Function): Promise; + + /** + * Registers a listener to invoke when this promise is resolved, regardless + * of whether the promise's value was successfully computed. This function + * is synonymous with the {@code finally} clause in a synchronous API: + * + * // Synchronous API: + * try { + * doSynchronousWork(); + * } finally { + * cleanUp(); + * } + * + * // Asynchronous promise API: + * doAsynchronousWork().finally(cleanUp); + * + * __Note:__ similar to the {@code finally} clause, if the registered + * callback returns a rejected promise or throws an error, it will silently + * replace the rejection error (if any) from this promise: + * + * try { + * throw Error('one'); + * } finally { + * throw Error('two'); // Hides Error: one + * } + * + * promise.rejected(Error('one')) + * .finally(function() { + * throw Error('two'); // Hides Error: one + * }); + * + * @param {function(): (R|IThenable)} callback The function to call when + * this promise is resolved. + * @return {!ManagedPromise} A promise that will be fulfilled + * with the callback result. + * @template R + */ + finally(callback: Function): Promise; + + /** + * Adds a property to a class prototype to allow runtime checks of whether + * instances of that class implement the Thenable interface. This function + * will also ensure the prototype's {@code then} function is exported from + * compiled code. + * @param {function(new: Thenable, ...?)} ctor The + * constructor whose prototype to modify. + */ + static addImplementation(ctor: Function): void; + + /** + * Checks if an object has been tagged for implementing the Thenable + * interface as defined by {@link Thenable.addImplementation}. + * @param {*} object The object to test. + * @return {boolean} Whether the object is an implementation of the Thenable + * interface. + */ + static isImplementation(object: any): boolean; + } + + interface IFulfilledCallback { + (value: T | IThenable | Thenable | void): void; + } + + interface IRejectedCallback { + (reason: any): void; + } + + /** + * Represents the eventual value of a completed operation. Each promise may be + * in one of three states: pending, fulfilled, or rejected. Each promise starts + * in the pending state and may make a single transition to either a + * fulfilled or rejected state, at which point the promise is considered + * resolved. + * + * @implements {promise.Thenable} + * @template T + * @see http://promises-aplus.github.io/promises-spec/ + */ + class Promise implements IThenable { + /** + * @param {function( + * function((T|IThenable|Thenable)=), + * function(*=))} resolver + * Function that is invoked immediately to begin computation of this + * promise's value. The function should accept a pair of callback + * functions, one for fulfilling the promise and another for rejecting it. + * @param {ControlFlow=} opt_flow The control flow + * this instance was created under. Defaults to the currently active flow. + */ + constructor(resolver: (resolve: IFulfilledCallback, reject: IRejectedCallback) => void, opt_flow?: ControlFlow); + + //region Methods + + /** + * Cancels the computation of this promise's value, rejecting the promise in the + * process. + * @param {*} reason The reason this promise is being cancelled. If not an + * {@code Error}, one will be created using the value's string + * representation. + */ + cancel(opt_reason?: string | Error): void; + + /** @return {boolean} Whether this promise's value is still being computed. */ + isPending(): boolean; + + /** + * Registers listeners for when this instance is resolved. This function most + * overridden by subtypes. + * + * @param opt_callback The function to call if this promise is + * successfully resolved. The function should expect a single argument: the + * promise's resolved value. + * @param opt_errback The function to call if this promise is + * rejected. The function should expect a single argument: the rejection + * reason. + * @return A new promise which will be resolved + * with the result of the invoked callback. + */ + then(opt_callback?: (value: T) => IThenable | R, opt_errback?: (error: any) => any): Promise; + + /** + * Registers a listener for when this promise is rejected. This is synonymous + * with the {@code catch} clause in a synchronous API: + *
    
    +       *   // Synchronous API:
    +       *   try {
    +       *     doSynchronousWork();
    +       *   } catch (ex) {
    +       *     console.error(ex);
    +       *   }
    +       *
    +       *   // Asynchronous promise API:
    +       *   doAsynchronousWork().thenCatch(function(ex) {
    +       *     console.error(ex);
    +       *   });
    +       * 
    + * + * @param {function(*): (R|webdriver.promise.Promise.)} errback The function + * to call if this promise is rejected. The function should expect a single + * argument: the rejection reason. + * @return {!webdriver.promise.Promise.} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + thenCatch(errback: (error: any) => any): Promise; + + /** + * Registers a listener for when this promise is rejected. This is synonymous + * with the {@code catch} clause in a synchronous API: + * + * // Synchronous API: + * try { + * doSynchronousWork(); + * } catch (ex) { + * console.error(ex); + * } + * + * // Asynchronous promise API: + * doAsynchronousWork().catch(function(ex) { + * console.error(ex); + * }); + * + * @param {function(*): (R|IThenable)} errback The + * function to call if this promise is rejected. The function should + * expect a single argument: the rejection reason. + * @return {!ManagedPromise} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + catch(errback: Function): Promise; + + + /** + * Registers a listener to invoke when this promise is resolved, regardless + * of whether the promise's value was successfully computed. This function + * is synonymous with the {@code finally} clause in a synchronous API: + *
    
    +       *   // Synchronous API:
    +       *   try {
    +       *     doSynchronousWork();
    +       *   } finally {
    +       *     cleanUp();
    +       *   }
    +       *
    +       *   // Asynchronous promise API:
    +       *   doAsynchronousWork().thenFinally(cleanUp);
    +       * 
    + * + * Note: similar to the {@code finally} clause, if the registered + * callback returns a rejected promise or throws an error, it will silently + * replace the rejection error (if any) from this promise: + *
    
    +       *   try {
    +       *     throw Error('one');
    +       *   } finally {
    +       *     throw Error('two');  // Hides Error: one
    +       *   }
    +       *
    +       *   webdriver.promise.rejected(Error('one'))
    +       *       .thenFinally(function() {
    +       *         throw Error('two');  // Hides Error: one
    +       *       });
    +       * 
    + * + * + * @param {function(): (R|webdriver.promise.Promise.)} callback The function + * to call when this promise is resolved. + * @return {!webdriver.promise.Promise.} A promise that will be fulfilled + * with the callback result. + * @template R + */ + thenFinally(callback: Function): Promise; + + //endregion + } + + /** + * Represents a value that will be resolved at some point in the future. This + * class represents the protected 'producer' half of a Promise - each Deferred + * has a {@code promise} property that may be returned to consumers for + * registering callbacks, reserving the ability to resolve the deferred to the + * producer. + * + *

    If this Deferred is rejected and there are no listeners registered before + * the next turn of the event loop, the rejection will be passed to the + * {@link webdriver.promise.ControlFlow} as an unhandled failure. + * + *

    If this Deferred is cancelled, the cancellation reason will be forward to + * the Deferred's canceller function (if provided). The canceller may return a + * truth-y value to override the reason provided for rejection. + * + * @extends {webdriver.promise.Promise} + */ + class Deferred extends Promise { + //region Constructors + + /** + * + * @param {webdriver.promise.ControlFlow=} opt_flow The control flow + * this instance was created under. This should only be provided during + * unit tests. + * @constructor + */ + constructor(opt_flow?: ControlFlow); + + //endregion + + static State_: { + BLOCKED: number; + PENDING: number; + REJECTED: number; + RESOLVED: number; + }; + + //region Properties + + /** + * The consumer promise for this instance. Provides protected access to the + * callback registering functions. + * @type {!webdriver.promise.Promise} + */ + promise: Promise; + + //endregion + + //region Methods + + /** + * Rejects this promise. If the error is itself a promise, this instance will + * be chained to it and be rejected with the error's resolved value. + * @param {*=} opt_error The rejection reason, typically either a + * {@code Error} or a {@code string}. + */ + reject(opt_error?: any): void; + errback(opt_error?: any): void; + + /** + * Resolves this promise with the given value. If the value is itself a + * promise and not a reference to this deferred, this instance will wait for + * it before resolving. + * @param {*=} opt_value The resolved value. + */ + fulfill(opt_value?: T): void; + + /** + * Removes all of the listeners previously registered on this deferred. + * @throws {Error} If this deferred has already been resolved. + */ + removeAll(): void; + + //endregion + } + + interface IControlFlowTimer { + clearInterval: (ms: number) => void; + clearTimeout: (ms: number) => void; + setInterval: (fn: Function, ms: number) => number; + setTimeout: (fn: Function, ms: number) => number; + } + + interface IEventType { + /** Emitted when all tasks have been successfully executed. */ + IDLE: string; + + /** Emitted when a ControlFlow has been reset. */ + RESET: string; + + /** Emitted whenever a new task has been scheduled. */ + SCHEDULE_TASK: string; + + /** + * Emitted whenever a control flow aborts due to an unhandled promise + * rejection. This event will be emitted along with the offending rejection + * reason. Upon emitting this event, the control flow will empty its task + * queue and revert to its initial state. + */ + UNCAUGHT_EXCEPTION: string; + } + + /** + * Handles the execution of scheduled tasks, each of which may be an + * asynchronous operation. The control flow will ensure tasks are executed in + * the ordered scheduled, starting each task only once those before it have + * completed. + * + * Each task scheduled within this flow may return a + * {@link webdriver.promise.Promise} to indicate it is an asynchronous + * operation. The ControlFlow will wait for such promises to be resolved before + * marking the task as completed. + * + * Tasks and each callback registered on a {@link webdriver.promise.Promise} + * will be run in their own ControlFlow frame. Any tasks scheduled within a + * frame will take priority over previously scheduled tasks. Furthermore, if any + * of the tasks in the frame fail, the remainder of the tasks in that frame will + * be discarded and the failure will be propagated to the user through the + * callback/task's promised result. + * + * Each time a ControlFlow empties its task queue, it will fire an + * {@link webdriver.promise.ControlFlow.EventType.IDLE IDLE} event. Conversely, + * whenever the flow terminates due to an unhandled error, it will remove all + * remaining tasks in its queue and fire an + * {@link webdriver.promise.ControlFlow.EventType.UNCAUGHT_EXCEPTION + * UNCAUGHT_EXCEPTION} event. If there are no listeners registered with the + * flow, the error will be rethrown to the global error handler. + * + * @extends {EventEmitter} + * @final + */ + class ControlFlow extends EventEmitter { + /** + * @constructor + */ + constructor(); + + /** + * Events that may be emitted by an {@link webdriver.promise.ControlFlow}. + * @enum {string} + */ + static EventType: IEventType; + + /** + * Returns a string representation of this control flow, which is its current + * {@link #getSchedule() schedule}, sans task stack traces. + * @return {string} The string representation of this contorl flow. + * @override + */ + toString(): string; + + /** + * Resets this instance, clearing its queue and removing all event listeners. + */ + reset(): void; + + /** + * Generates an annotated string describing the internal state of this control + * flow, including the currently executing as well as pending tasks. If + * {@code opt_includeStackTraces === true}, the string will include the + * stack trace from when each task was scheduled. + * @param {string=} opt_includeStackTraces Whether to include the stack traces + * from when each task was scheduled. Defaults to false. + * @return {string} String representation of this flow's internal state. + */ + getSchedule(opt_includeStackTraces?: boolean): string; + + /** + * Schedules a task for execution. If there is nothing currently in the + * queue, the task will be executed in the next turn of the event loop. If + * the task function is a generator, the task will be executed using + * {@link webdriver.promise.consume}. + * + * @param {function(): (T|promise.Promise)} fn The function to + * call to start the task. If the function returns a + * {@link webdriver.promise.Promise}, this instance will wait for it to be + * resolved before starting the next task. + * @param {string=} opt_description A description of the task. + * @return {!promise.Promise} A promise that will be resolved + * with the result of the action. + * @template T + */ + execute(fn: () => (T | Promise), opt_description?: string): Promise; + + /** + * Inserts a {@code setTimeout} into the command queue. This is equivalent to + * a thread sleep in a synchronous programming language. + * + * @param {number} ms The timeout delay, in milliseconds. + * @param {string=} opt_description A description to accompany the timeout. + * @return {!webdriver.promise.Promise} A promise that will be resolved with + * the result of the action. + */ + timeout(ms: number, opt_description?: string): Promise; + + /** + * Schedules a task that shall wait for a condition to hold. Each condition + * function may return any value, but it will always be evaluated as a boolean. + * + * Condition functions may schedule sub-tasks with this instance, however, + * their execution time will be factored into whether a wait has timed out. + * + * In the event a condition returns a Promise, the polling loop will wait for + * it to be resolved before evaluating whether the condition has been satisfied. + * The resolution time for a promise is factored into whether a wait has timed + * out. + * + * If the condition function throws, or returns a rejected promise, the + * wait task will fail. + * + * If the condition is defined as a promise, the flow will wait for it to + * settle. If the timeout expires before the promise settles, the promise + * returned by this function will be rejected. + * + * If this function is invoked with `timeout === 0`, or the timeout is omitted, + * the flow will wait indefinitely for the condition to be satisfied. + * + * @param {(!promise.Promise|function())} condition The condition to poll, + * or a promise to wait on. + * @param {number=} opt_timeout How long to wait, in milliseconds, for the + * condition to hold before timing out. If omitted, the flow will wait + * indefinitely. + * @param {string=} opt_message An optional error message to include if the + * wait times out; defaults to the empty string. + * @return {!promise.Promise} A promise that will be fulfilled + * when the condition has been satisified. The promise shall be rejected if + * the wait times out waiting for the condition. + * @throws {TypeError} If condition is not a function or promise or if timeout + * is not a number >= 0. + * @template T + */ + wait(condition: Promise | Function, opt_timeout?: number, opt_message?: string): Promise; + } + } + + namespace until { + /** + * Defines a condition to + */ + class Condition { + /** + * @param {string} message A descriptive error message. Should complete the + * sentence 'Waiting [...]' + * @param {function(!webdriver.WebDriver): OUT} fn The condition function to + * evaluate on each iteration of the wait loop. + * @constructor + */ + constructor(message: string, fn: (webdriver: WebDriver) => any); + + /** @return {string} A description of this condition. */ + description(): string; + + /** @type {function(!webdriver.WebDriver): OUT} */ + fn(webdriver: WebDriver): any; + } + + /** + * Creates a condition that will wait until the input driver is able to switch + * to the designated frame. The target frame may be specified as + * + * 1. a numeric index into + * [window.frames](https://developer.mozilla.org/en-US/docs/Web/API/Window.frames) + * for the currently selected frame. + * 2. a {@link ./webdriver.WebElement}, which must reference a FRAME or IFRAME + * element on the current page. + * 3. a locator which may be used to first locate a FRAME or IFRAME on the + * current page before attempting to switch to it. + * + * Upon successful resolution of this condition, the driver will be left + * focused on the new frame. + * + * @param {!(number|./webdriver.WebElement|By| + * function(!./webdriver.WebDriver): !./webdriver.WebElement)} frame + * The frame identifier. + * @return {!Condition} A new condition. + */ + function ableToSwitchToFrame(frame: number | WebElement | By | ((webdriver: WebDriver) => WebElement)): Condition; + + /** + * Creates a condition that waits for an alert to be opened. Upon success, the + * returned promise will be fulfilled with the handle for the opened alert. + * + * @return {!Condition} The new condition. + */ + function alertIsPresent(): Condition; + + /** + * Creates a condition that will wait for the given element to be disabled. + * + * @param {!webdriver.WebElement} element The element to test. + * @return {!until.Condition.} The new condition. + * @see webdriver.WebDriver#isEnabled + */ + function elementIsDisabled(element: WebElement): Condition; + + /** + * Creates a condition that will wait for the given element to be enabled. + * + * @param {!webdriver.WebElement} element The element to test. + * @return {!until.Condition.} The new condition. + * @see webdriver.WebDriver#isEnabled + */ + function elementIsEnabled(element: WebElement): Condition; + + /** + * Creates a condition that will wait for the given element to be deselected. + * + * @param {!webdriver.WebElement} element The element to test. + * @return {!until.Condition.} The new condition. + * @see webdriver.WebDriver#isSelected + */ + function elementIsNotSelected(element: WebElement): Condition; + + /** + * Creates a condition that will wait for the given element to be in the DOM, + * yet not visible to the user. + * + * @param {!webdriver.WebElement} element The element to test. + * @return {!until.Condition.} The new condition. + * @see webdriver.WebDriver#isDisplayed + */ + function elementIsNotVisible(element: WebElement): Condition; + + /** + * Creates a condition that will wait for the given element to be selected. + * @param {!webdriver.WebElement} element The element to test. + * @return {!until.Condition.} The new condition. + * @see webdriver.WebDriver#isSelected + */ + function elementIsSelected(element: WebElement): Condition; + + /** + * Creates a condition that will wait for the given element to become visible. + * + * @param {!webdriver.WebElement} element The element to test. + * @return {!until.Condition.} The new condition. + * @see webdriver.WebDriver#isDisplayed + */ + function elementIsVisible(element: WebElement): Condition; + + /** + * Creates a condition that will loop until an element is + * {@link ./webdriver.WebDriver#findElement found} with the given locator. + * + * @param {!(By|Function)} locator The locator to use. + * @return {!until.Condition.} The new condition. + */ + function elementLocated(locator: By | Function): Condition; + + /** + * Creates a condition that will wait for the given element's + * {@link webdriver.WebDriver#getText visible text} to contain the given + * substring. + * + * @param {!webdriver.WebElement} element The element to test. + * @param {string} substr The substring to search for. + * @return {!until.Condition.} The new condition. + * @see webdriver.WebDriver#getText + */ + function elementTextContains(element: WebElement, substr: string): Condition; + + /** + * Creates a condition that will wait for the given element's + * {@link webdriver.WebDriver#getText visible text} to match the given + * {@code text} exactly. + * + * @param {!webdriver.WebElement} element The element to test. + * @param {string} text The expected text. + * @return {!until.Condition.} The new condition. + * @see webdriver.WebDriver#getText + */ + function elementTextIs(element: WebElement, text: string): Condition; + + /** + * Creates a condition that will wait for the given element's + * {@link webdriver.WebDriver#getText visible text} to match a regular + * expression. + * + * @param {!webdriver.WebElement} element The element to test. + * @param {!RegExp} regex The regular expression to test against. + * @return {!until.Condition} The new condition. + * @see webdriver.WebDriver#getText + */ + function elementTextMatches(element: WebElement, regex: RegExp): Condition; + + /** + * Creates a condition that will loop until at least one element is + * {@link webdriver.WebDriver#findElement found} with the given locator. + * + * @param {!(webdriver.Locator|webdriver.By.Hash|Function)} locator The locator + * to use. + * @return {!until.Condition.>} The new + * condition. + */ + function elementsLocated(locator: By | Function): Condition; + + /** + * Creates a condition that will wait for the given element to become stale. An + * element is considered stale once it is removed from the DOM, or a new page + * has loaded. + * + * @param {!webdriver.WebElement} element The element that should become stale. + * @return {!until.Condition} The new condition. + */ + function stalenessOf(element: WebElement): Condition; + + /** + * Creates a condition that will wait for the current page's title to contain + * the given substring. + * + * @param {string} substr The substring that should be present in the page + * title. + * @return {!until.Condition.} The new condition. + */ + function titleContains(substr: string): Condition; + + /** + * Creates a condition that will wait for the current page's title to match the + * given value. + * + * @param {string} title The expected page title. + * @return {!until.Condition} The new condition. + */ + function titleIs(title: string): Condition; + + /** + * Creates a condition that will wait for the current page's title to match the + * given regular expression. + * + * @param {!RegExp} regex The regular expression to test against. + * @return {!until.Condition.} The new condition. + */ + function titleMatches(regex: RegExp): Condition; + } + + interface ILocation { + x: number; + y: number; + } + + interface ISize { + width: number; + height: number; + } + + interface IButton { + LEFT: string; + MIDDLE: string; + RIGHT: string; + } + + /** + * Representations of pressable keys that aren't text. These are stored in + * the Unicode PUA (Private Use Area) code points, 0xE000-0xF8FF. Refer to + * http://www.google.com.au/search?&q=unicode+pua&btnG=Search + * + * @enum {string} + */ + var Button: IButton; + + interface IKey { + NULL: string; + CANCEL: string; // ^break + HELP: string; + BACK_SPACE: string; + TAB: string; + CLEAR: string; + RETURN: string; + ENTER: string; + SHIFT: string; + CONTROL: string; + ALT: string; + PAUSE: string; + ESCAPE: string; + SPACE: string; + PAGE_UP: string; + PAGE_DOWN: string; + END: string; + HOME: string; + ARROW_LEFT: string; + LEFT: string; + ARROW_UP: string; + UP: string; + ARROW_RIGHT: string; + RIGHT: string; + ARROW_DOWN: string; + DOWN: string; + INSERT: string; + DELETE: string; + SEMICOLON: string; + EQUALS: string; + + NUMPAD0: string; // number pad keys + NUMPAD1: string; + NUMPAD2: string; + NUMPAD3: string; + NUMPAD4: string; + NUMPAD5: string; + NUMPAD6: string; + NUMPAD7: string; + NUMPAD8: string; + NUMPAD9: string; + MULTIPLY: string; + ADD: string; + SEPARATOR: string; + SUBTRACT: string; + DECIMAL: string; + DIVIDE: string; + + F1: string; // function keys + F2: string; + F3: string; + F4: string; + F5: string; + F6: string; + F7: string; + F8: string; + F9: string; + F10: string; + F11: string; + F12: string; + + COMMAND: string; // Apple command key + META: string; // alias for Windows key + + /** + * Simulate pressing many keys at once in a 'chord'. Takes a sequence of + * keys or strings, appends each of the values to a string, + * and adds the chord termination key ({@link webdriver.Key.NULL}) and returns + * the resulting string. + * + * Note: when the low-level webdriver key handlers see Keys.NULL, active + * modifier keys (CTRL/ALT/SHIFT/etc) release via a keyup event. + * + * @param {...string} var_args The key sequence to concatenate. + * @return {string} The null-terminated key sequence. + */ + chord: (...var_args: Array) => string; + } + + /** + * Representations of pressable keys that aren't text. These are stored in + * the Unicode PUA (Private Use Area) code points, 0xE000-0xF8FF. Refer to + * http://www.google.com.au/search?&q=unicode+pua&btnG=Search + * + * @enum {string} + */ + var Key: IKey; + + /** + * Class for defining sequences of complex user interactions. Each sequence + * will not be executed until {@link #perform} is called. + * + * Example: + * + * new ActionSequence(driver). + * keyDown(Key.SHIFT). + * click(element1). + * click(element2). + * dragAndDrop(element3, element4). + * keyUp(Key.SHIFT). + * perform(); + * + */ + class ActionSequence { + + //region Constructors + + /** + * @param {!webdriver.WebDriver} driver The driver instance to use. + * @constructor + */ + constructor(driver: WebDriver); + + //endregion + + //region Methods + + /** + * Executes this action sequence. + * @return {!webdriver.promise.Promise} A promise that will be resolved once + * this sequence has completed. + */ + perform(): webdriver.promise.Promise; + + /** + * Moves the mouse. The location to move to may be specified in terms of the + * mouse's current location, an offset relative to the top-left corner of an + * element, or an element (in which case the middle of the element is used). + * + * @param {(!./webdriver.WebElement|{x: number, y: number})} location The + * location to drag to, as either another WebElement or an offset in + * pixels. + * @param {{x: number, y: number}=} opt_offset If the target {@code location} + * is defined as a {@link ./webdriver.WebElement}, this parameter defines + * an offset within that element. The offset should be specified in pixels + * relative to the top-left corner of the element's bounding box. If + * omitted, the element's center will be used as the target offset. + * @return {!ActionSequence} A self reference. + */ + mouseMove(location: WebElement | ILocation, opt_offset?: ILocation): ActionSequence; + + /** + * Presses a mouse button. The mouse button will not be released until + * {@link #mouseUp} is called, regardless of whether that call is made in this + * sequence or another. The behavior for out-of-order events (e.g. mouseDown, + * click) is undefined. + * + * If an element is provided, the mouse will first be moved to the center + * of that element. This is equivalent to: + * + * sequence.mouseMove(element).mouseDown() + * + * Warning: this method currently only supports the left mouse button. See + * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047). + * + * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either + * the element to interact with or the button to click with. + * Defaults to {@link input.Button.LEFT} if neither an element nor + * button is specified. + * @param {input.Button=} opt_button The button to use. Defaults to + * {@link input.Button.LEFT}. Ignored if a button is provided as the + * first argument. + * @return {!ActionSequence} A self reference. + */ + mouseDown(opt_elementOrButton?: WebElement | string, opt_button?: string): ActionSequence; + + /** + * Releases a mouse button. Behavior is undefined for calling this function + * without a previous call to {@link #mouseDown}. + * + * If an element is provided, the mouse will first be moved to the center + * of that element. This is equivalent to: + * + * sequence.mouseMove(element).mouseUp() + * + * Warning: this method currently only supports the left mouse button. See + * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047). + * + * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either + * the element to interact with or the button to click with. + * Defaults to {@link input.Button.LEFT} if neither an element nor + * button is specified. + * @param {input.Button=} opt_button The button to use. Defaults to + * {@link input.Button.LEFT}. Ignored if a button is provided as the + * first argument. + * @return {!ActionSequence} A self reference. + */ + mouseUp(opt_elementOrButton?: WebElement | string, opt_button?: string): ActionSequence; + + /** + * Convenience function for performing a 'drag and drop' manuever. The target + * element may be moved to the location of another element, or by an offset (in + * pixels). + * + * @param {!./webdriver.WebElement} element The element to drag. + * @param {(!./webdriver.WebElement|{x: number, y: number})} location The + * location to drag to, either as another WebElement or an offset in + * pixels. + * @return {!ActionSequence} A self reference. + */ + dragAndDrop(element: WebElement, location: WebElement | ILocation): ActionSequence; + + /** + * Clicks a mouse button. + * + * If an element is provided, the mouse will first be moved to the center + * of that element. This is equivalent to: + * + * sequence.mouseMove(element).click() + * + * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either + * the element to interact with or the button to click with. + * Defaults to {@link input.Button.LEFT} if neither an element nor + * button is specified. + * @param {input.Button=} opt_button The button to use. Defaults to + * {@link input.Button.LEFT}. Ignored if a button is provided as the + * first argument. + * @return {!ActionSequence} A self reference. + */ + click(opt_elementOrButton?: WebElement | string, opt_button?: string): ActionSequence; + + /** + * Double-clicks a mouse button. + * + * If an element is provided, the mouse will first be moved to the center of + * that element. This is equivalent to: + * + * sequence.mouseMove(element).doubleClick() + * + * Warning: this method currently only supports the left mouse button. See + * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047). + * + * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either + * the element to interact with or the button to click with. + * Defaults to {@link input.Button.LEFT} if neither an element nor + * button is specified. + * @param {input.Button=} opt_button The button to use. Defaults to + * {@link input.Button.LEFT}. Ignored if a button is provided as the + * first argument. + * @return {!ActionSequence} A self reference. + */ + doubleClick(opt_elementOrButton?: WebElement | string, opt_button?: string): ActionSequence; + + /** + * Performs a modifier key press. The modifier key is not released + * until {@link #keyUp} or {@link #sendKeys} is called. The key press will be + * targetted at the currently focused element. + * @param {!webdriver.Key} key The modifier key to push. Must be one of + * {ALT, CONTROL, SHIFT, COMMAND, META}. + * @return {!webdriver.ActionSequence} A self reference. + * @throws {Error} If the key is not a valid modifier key. + */ + keyDown(key: string): ActionSequence; + + /** + * Performs a modifier key release. The release is targetted at the currently + * focused element. + * @param {!webdriver.Key} key The modifier key to release. Must be one of + * {ALT, CONTROL, SHIFT, COMMAND, META}. + * @return {!webdriver.ActionSequence} A self reference. + * @throws {Error} If the key is not a valid modifier key. + */ + keyUp(key: string): ActionSequence; + + /** + * Simulates typing multiple keys. Each modifier key encountered in the + * sequence will not be released until it is encountered again. All key events + * will be targeted at the currently focused element. + * + * @param {...(string|!input.Key|!Array<(string|!input.Key)>)} var_args + * The keys to type. + * @return {!ActionSequence} A self reference. + * @throws {Error} If the key is not a valid modifier key. + */ + sendKeys(...var_args: Array>): ActionSequence; + + //endregion + } + + + /** + * Class for defining sequences of user touch interactions. Each sequence + * will not be executed until {@link #perform} is called. + * + * Example: + * + * new webdriver.TouchSequence(driver). + * tapAndHold({x: 0, y: 0}). + * move({x: 3, y: 4}). + * release({x: 10, y: 10}). + * perform(); + */ + class TouchSequence { + /* + * @param {!webdriver.WebDriver} driver The driver instance to use. + * @constructor + */ + constructor(driver: WebDriver); + + + /** + * Executes this action sequence. + * @return {!webdriver.promise.Promise} A promise that will be resolved once + * this sequence has completed. + */ + perform(): webdriver.promise.Promise; + + + /** + * Taps an element. + * + * @param {!webdriver.WebElement} elem The element to tap. + * @return {!webdriver.TouchSequence} A self reference. + */ + tap(elem: WebElement): TouchSequence; + + + /** + * Double taps an element. + * + * @param {!webdriver.WebElement} elem The element to double tap. + * @return {!webdriver.TouchSequence} A self reference. + */ + doubleTap(elem: WebElement): TouchSequence; + + + /** + * Long press on an element. + * + * @param {!webdriver.WebElement} elem The element to long press. + * @return {!webdriver.TouchSequence} A self reference. + */ + longPress(elem: WebElement): TouchSequence; + + + /** + * Touch down at the given location. + * + * @param {{ x: number, y: number }} location The location to touch down at. + * @return {!webdriver.TouchSequence} A self reference. + */ + tapAndHold(location: ILocation): TouchSequence; + + + /** + * Move a held {@linkplain #tapAndHold touch} to the specified location. + * + * @param {{x: number, y: number}} location The location to move to. + * @return {!webdriver.TouchSequence} A self reference. + */ + move(location: ILocation): TouchSequence; + + + /** + * Release a held {@linkplain #tapAndHold touch} at the specified location. + * + * @param {{x: number, y: number}} location The location to release at. + * @return {!webdriver.TouchSequence} A self reference. + */ + release(location: ILocation): TouchSequence; + + + /** + * Scrolls the touch screen by the given offset. + * + * @param {{x: number, y: number}} offset The offset to scroll to. + * @return {!webdriver.TouchSequence} A self reference. + */ + scroll(offset: IOffset): TouchSequence; + + /** + * Scrolls the touch screen, starting on `elem` and moving by the specified + * offset. + * + * @param {!webdriver.WebElement} elem The element where scroll starts. + * @param {{x: number, y: number}} offset The offset to scroll to. + * @return {!webdriver.TouchSequence} A self reference. + */ + scrollFromElement(elem: WebElement, offset: IOffset): TouchSequence; + + /** + * Flick, starting anywhere on the screen, at speed xspeed and yspeed. + * + * @param {{xspeed: number, yspeed: number}} speed The speed to flick in each + direction, in pixels per second. + * @return {!webdriver.TouchSequence} A self reference. + */ + flick(speed: ISpeed): TouchSequence; + + /** + * Flick starting at elem and moving by x and y at specified speed. + * + * @param {!webdriver.WebElement} elem The element where flick starts. + * @param {{x: number, y: number}} offset The offset to flick to. + * @param {number} speed The speed to flick at in pixels per second. + * @return {!webdriver.TouchSequence} A self reference. + */ + flickElement(elem: WebElement, offset: IOffset, speed: number): TouchSequence; + } + + interface IOffset { + x: number; + y: number; + } + + interface ISpeed { + xspeed: number; + yspeed: number; + } + + /** + * Represents a modal dialog such as {@code alert}, {@code confirm}, or + * {@code prompt}. Provides functions to retrieve the message displayed with + * the alert, accept or dismiss the alert, and set the response text (in the + * case of {@code prompt}). + */ + class Alert { + /** + * @param {!WebDriver} driver The driver controlling the browser this alert + * is attached to. + * @param {string} text The message text displayed with this alert. + */ + constructor(driver: WebDriver, text: string); + + //region Methods + + /** + * Retrieves the message text displayed with this alert. For instance, if the + * alert were opened with alert('hello'), then this would return 'hello'. + * @return {!webdriver.promise.Promise} A promise that will be resolved to the + * text displayed with this alert. + */ + getText(): webdriver.promise.Promise; + + /** + * Sets the username and password in an alert prompting for credentials (such + * as a Basic HTTP Auth prompt). This method will implicitly + * {@linkplain #accept() submit} the dialog. + * + * @param {string} username The username to send. + * @param {string} password The password to send. + * @return {!promise.Promise} A promise that will be resolved when this + * command has completed. + */ + authenticateAs(username: string, password: string): webdriver.promise.Promise; + + /** + * Accepts this alert. + * @return {!webdriver.promise.Promise} A promise that will be resolved when + * this command has completed. + */ + accept(): webdriver.promise.Promise; + + /** + * Dismisses this alert. + * @return {!webdriver.promise.Promise} A promise that will be resolved when + * this command has completed. + */ + dismiss(): webdriver.promise.Promise; + + /** + * Sets the response text on this alert. This command will return an error if + * the underlying alert does not support response text (e.g. window.alert and + * window.confirm). + * @param {string} text The text to set. + * @return {!webdriver.promise.Promise} A promise that will be resolved when + * this command has completed. + */ + sendKeys(text: string): webdriver.promise.Promise; + + //endregion + + } + + /** + * AlertPromise is a promise that will be fulfilled with an Alert. This promise + * serves as a forward proxy on an Alert, allowing calls to be scheduled + * directly on this instance before the underlying Alert has been fulfilled. In + * other words, the following two statements are equivalent: + * + * driver.switchTo().alert().dismiss(); + * driver.switchTo().alert().then(function(alert) { + * return alert.dismiss(); + * }); + * + * @implements {promise.Thenable.} + * @final + */ + class AlertPromise extends Alert implements webdriver.promise.IThenable{ + /** + * @param {!WebDriver} driver The driver controlling the browser this + * alert is attached to. + * @param {!promise.Thenable} alert A thenable + * that will be fulfilled with the promised alert. + */ + constructor(driver: WebDriver, alert: webdriver.promise.Promise); + + //region Methods + + /** + * Cancels the computation of this promise's value, rejecting the promise in the + * process. + * @param {*} reason The reason this promise is being cancelled. If not an + * {@code Error}, one will be created using the value's string + * representation. + */ + cancel(opt_reason?: string | Error): void; + + /** @return {boolean} Whether this promise's value is still being computed. */ + isPending(): boolean; + + /** + * Registers listeners for when this instance is resolved. This function most + * overridden by subtypes. + * + * @param opt_callback The function to call if this promise is + * successfully resolved. The function should expect a single argument: the + * promise's resolved value. + * @param opt_errback The function to call if this promise is + * rejected. The function should expect a single argument: the rejection + * reason. + * @return A new promise which will be resolved + * with the result of the invoked callback. + */ + then(opt_callback?: Function, opt_errback?: Function): webdriver.promise.Promise; + + /** + * Registers a listener for when this promise is rejected. This is synonymous + * with the {@code catch} clause in a synchronous API: + *

    
    +     *   // Synchronous API:
    +     *   try {
    +     *     doSynchronousWork();
    +     *   } catch (ex) {
    +     *     console.error(ex);
    +     *   }
    +     *
    +     *   // Asynchronous promise API:
    +     *   doAsynchronousWork().thenCatch(function(ex) {
    +     *     console.error(ex);
    +     *   });
    +     * 
    + * + * @param {function(*): (R|webdriver.promise.Promise.)} errback The function + * to call if this promise is rejected. The function should expect a single + * argument: the rejection reason. + * @return {!webdriver.promise.Promise.} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + thenCatch(errback: (error: any) => any): webdriver.promise.Promise; + + /** + * Registers a listener for when this promise is rejected. This is synonymous + * with the {@code catch} clause in a synchronous API: + * + * // Synchronous API: + * try { + * doSynchronousWork(); + * } catch (ex) { + * console.error(ex); + * } + * + * // Asynchronous promise API: + * doAsynchronousWork().catch(function(ex) { + * console.error(ex); + * }); + * + * @param {function(*): (R|IThenable)} errback The + * function to call if this promise is rejected. The function should + * expect a single argument: the rejection reason. + * @return {!ManagedPromise} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + catch(errback: Function): webdriver.promise.Promise; + + + /** + * Registers a listener to invoke when this promise is resolved, regardless + * of whether the promise's value was successfully computed. This function + * is synonymous with the {@code finally} clause in a synchronous API: + *
    
    +     *   // Synchronous API:
    +     *   try {
    +     *     doSynchronousWork();
    +     *   } finally {
    +     *     cleanUp();
    +     *   }
    +     *
    +     *   // Asynchronous promise API:
    +     *   doAsynchronousWork().thenFinally(cleanUp);
    +     * 
    + * + * Note: similar to the {@code finally} clause, if the registered + * callback returns a rejected promise or throws an error, it will silently + * replace the rejection error (if any) from this promise: + *
    
    +     *   try {
    +     *     throw Error('one');
    +     *   } finally {
    +     *     throw Error('two');  // Hides Error: one
    +     *   }
    +     *
    +     *   webdriver.promise.rejected(Error('one'))
    +     *       .thenFinally(function() {
    +     *         throw Error('two');  // Hides Error: one
    +     *       });
    +     * 
    + * + * + * @param {function(): (R|webdriver.promise.Promise.)} callback The function + * to call when this promise is resolved. + * @return {!webdriver.promise.Promise.} A promise that will be fulfilled + * with the callback result. + * @template R + */ + thenFinally(callback: Function): webdriver.promise.Promise; + } + + /** @deprecated Use {@link error.UnexpectedAlertOpenError} instead. */ + class UnhandledAlertError extends webdriver.error.UnexpectedAlertOpenError { + } + + /** + * Recognized browser names. + * @enum {string} + */ + interface IBrowser { + ANDROID: string; + CHROME: string; + EDGE: string; + FIREFOX: string; + IE: string; + INTERNET_EXPLORER: string; + IPAD: string; + IPHONE: string; + OPERA: string; + PHANTOM_JS: string; + SAFARI: string; + HTMLUNIT: string; + } + + var Browser: IBrowser; + + interface ProxyConfig { + proxyType: string; + proxyAutoconfigUrl?: string; + ftpProxy?: string; + httpProxy?: string; + sslProxy?: string; + noProxy?: string; + } + + /** + * Creates new {@link webdriver.WebDriver WebDriver} instances. The environment + * variables listed below may be used to override a builder's configuration, + * allowing quick runtime changes. + * + * - {@code SELENIUM_BROWSER}: defines the target browser in the form + * {@code browser[:version][:platform]}. + * + * - {@code SELENIUM_REMOTE_URL}: defines the remote URL for all builder + * instances. This environment variable should be set to a fully qualified + * URL for a WebDriver server (e.g. http://localhost:4444/wd/hub). This + * option always takes precedence over {@code SELENIUM_SERVER_JAR}. + * + * - {@code SELENIUM_SERVER_JAR}: defines the path to the + * + * standalone Selenium server jar to use. The server will be started the + * first time a WebDriver instance and be killed when the process exits. + * + * Suppose you had mytest.js that created WebDriver with + * + * var driver = new webdriver.Builder() + * .forBrowser('chrome') + * .build(); + * + * This test could be made to use Firefox on the local machine by running with + * `SELENIUM_BROWSER=firefox node mytest.js`. Rather than change the code to + * target Google Chrome on a remote machine, you can simply set the + * `SELENIUM_BROWSER` and `SELENIUM_REMOTE_URL` environment variables: + * + * SELENIUM_BROWSER=chrome:36:LINUX \ + * SELENIUM_REMOTE_URL=http://www.example.com:4444/wd/hub \ + * node mytest.js + * + * You could also use a local copy of the standalone Selenium server: + * + * SELENIUM_BROWSER=chrome:36:LINUX \ + * SELENIUM_SERVER_JAR=/path/to/selenium-server-standalone.jar \ + * node mytest.js + */ + class Builder { + + //region Constructors + + /** + * @constructor + */ + constructor(); + + //endregion + + //region Methods + + /** + * Configures this builder to ignore any environment variable overrides and to + * only use the configuration specified through this instance's API. + * + * @return {!Builder} A self reference. + */ + disableEnvironmentOverrides(): Builder; + + /** + * Creates a new WebDriver client based on this builder's current + * configuration. + * + * While this method will immediately return a new WebDriver instance, any + * commands issued against it will be deferred until the associated browser + * has been fully initialized. Users may call {@link #buildAsync()} to obtain + * a promise that will not be fulfilled until the browser has been created + * (the difference is purely in style). + * + * @return {!webdriver.WebDriver} A new WebDriver instance. + * @throws {Error} If the current configuration is invalid. + * @see #buildAsync() + */ + build(): WebDriver; + + /** + * Creates a new WebDriver client based on this builder's current + * configuration. This method returns a promise that will not be fulfilled + * until the new browser session has been fully initialized. + * + * __Note:__ this method is purely a convenience wrapper around + * {@link #build()}. + * + * @return {!promise.Promise} A promise that will be + * fulfilled with the newly created WebDriver instance once the browser + * has been fully initialized. + * @see #build() + */ + buildAsync(): webdriver.promise.Promise; + + /** + * Configures the target browser for clients created by this instance. + * Any calls to {@link #withCapabilities} after this function will + * overwrite these settings. + * + *

    You may also define the target browser using the {@code SELENIUM_BROWSER} + * environment variable. If set, this environment variable should be of the + * form {@code browser[:[version][:platform]]}. + * + * @param {(string|webdriver.Browser)} name The name of the target browser; + * common defaults are available on the {@link webdriver.Browser} enum. + * @param {string=} opt_version A desired version; may be omitted if any + * version should be used. + * @param {string=} opt_platform The desired platform; may be omitted if any + * version may be used. + * @return {!Builder} A self reference. + */ + forBrowser(name: string, opt_version?: string, opt_platform?: string): Builder; + + /** + * Returns the base set of capabilities this instance is currently configured + * to use. + * @return {!webdriver.Capabilities} The current capabilities for this builder. + */ + getCapabilities(): Capabilities; + + /** + * @return {string} The URL of the WebDriver server this instance is configured + * to use. + */ + getServerUrl(): string; + + /** + * @return {?string} The URL of the proxy server to use for the WebDriver's + * HTTP connections, or `null` if not set. + */ + getWebDriverProxy(): string; + + /** + * Sets the default action to take with an unexpected alert before returning + * an error. + * @param {string} beahvior The desired behavior; should be 'accept', 'dismiss', + * or 'ignore'. Defaults to 'dismiss'. + * @return {!Builder} A self reference. + */ + setAlertBehavior(behavior: string): Builder; + + /** + * Sets Chrome-specific options for drivers created by this builder. Any + * logging or proxy settings defined on the given options will take precedence + * over those set through {@link #setLoggingPrefs} and {@link #setProxy}, + * respectively. + * + * @param {!chrome.Options} options The ChromeDriver options to use. + * @return {!Builder} A self reference. + */ + setChromeOptions(options: chrome.Options): Builder; + + /** + * Sets the control flow that created drivers should execute actions in. If + * the flow is never set, or is set to {@code null}, it will use the active + * flow at the time {@link #build()} is called. + * @param {webdriver.promise.ControlFlow} flow The control flow to use, or + * {@code null} to + * @return {!Builder} A self reference. + */ + setControlFlow(flow: webdriver.promise.ControlFlow): Builder; + + /** + * Set {@linkplain edge.Options options} specific to Microsoft's Edge browser + * for drivers created by this builder. Any proxy settings defined on the + * given options will take precedence over those set through + * {@link #setProxy}. + * + * @param {!edge.Options} options The MicrosoftEdgeDriver options to use. + * @return {!Builder} A self reference. + */ + setEdgeOptions(options: edge.Options): Builder; + + /** + * Sets whether native events should be used. + * @param {boolean} enabled Whether to enable native events. + * @return {!Builder} A self reference. + */ + setEnableNativeEvents(enabled: boolean): Builder; + + /** + * Sets Firefox-specific options for drivers created by this builder. Any + * logging or proxy settings defined on the given options will take precedence + * over those set through {@link #setLoggingPrefs} and {@link #setProxy}, + * respectively. + * + * @param {!firefox.Options} options The FirefoxDriver options to use. + * @return {!Builder} A self reference. + */ + setFirefoxOptions(options: firefox.Options): Builder; + + /** + * Set Internet Explorer specific {@linkplain ie.Options options} for drivers + * created by this builder. Any proxy settings defined on the given options + * will take precedence over those set through {@link #setProxy}. + * + * @param {!ie.Options} options The IEDriver options to use. + * @return {!Builder} A self reference. + */ + setIeOptions(options: ie.Options): Builder; + + /** + * Sets the logging preferences for the created session. Preferences may be + * changed by repeated calls, or by calling {@link #withCapabilities}. + * @param {!(webdriver.logging.Preferences|Object.)} prefs The + * desired logging preferences. + * @return {!Builder} A self reference. + */ + setLoggingPrefs(prefs: webdriver.logging.Preferences | Object): Builder; + + /** + * Sets Opera specific {@linkplain opera.Options options} for drivers created + * by this builder. Any logging or proxy settings defined on the given options + * will take precedence over those set through {@link #setLoggingPrefs} and + * {@link #setProxy}, respectively. + * + * @param {!opera.Options} options The OperaDriver options to use. + * @return {!Builder} A self reference. + */ + setOperaOptions(options: opera.Options): Builder; + + /** + * Sets the proxy configuration to use for WebDriver clients created by this + * builder. Any calls to {@link #withCapabilities} after this function will + * overwrite these settings. + * @param {!capabilities.ProxyConfig} config The configuration to use. + * @return {!Builder} A self reference. + */ + setProxy(config: webdriver.ProxyConfig): Builder; + + /** + * Sets Safari specific {@linkplain safari.Options options} for drivers + * created by this builder. Any logging settings defined on the given options + * will take precedence over those set through {@link #setLoggingPrefs}. + * + * @param {!safari.Options} options The Safari options to use. + * @return {!Builder} A self reference. + */ + setSafari(options: safari.Options): Builder; + + /** + * Sets how elements should be scrolled into view for interaction. + * @param {number} behavior The desired scroll behavior: either 0 to align with + * the top of the viewport or 1 to align with the bottom. + * @return {!Builder} A self reference. + */ + setScrollBehavior(behavior: number): Builder; + + /** + * Sets the URL of a remote WebDriver server to use. Once a remote URL has been + * specified, the builder direct all new clients to that server. If this method + * is never called, the Builder will attempt to create all clients locally. + * + *

    As an alternative to this method, you may also set the + * {@code SELENIUM_REMOTE_URL} environment variable. + * + * @param {string} url The URL of a remote server to use. + * @return {!Builder} A self reference. + */ + usingServer(url: string): Builder; + + /** + * Sets the URL of the proxy to use for the WebDriver's HTTP connections. + * If this method is never called, the Builder will create a connection + * without a proxy. + * + * @param {string} proxy The URL of a proxy to use. + * @return {!Builder} A self reference. + */ + usingWebDriverProxy(proxy: string): Builder; + + /** + * Sets the desired capabilities when requesting a new session. This will + * overwrite any previously set capabilities. + * @param {!(Object|webdriver.Capabilities)} capabilities The desired + * capabilities for a new session. + * @return {!Builder} A self reference. + */ + withCapabilities(capabilities: Object | Capabilities): Builder; + + //endregion + } + + /** + * Describes a mechanism for locating an element on the page. + * @final + */ + class By { + + /** + * @param {string} using the name of the location strategy to use. + * @param {string} value the value to search for. + */ + constructor(using: string, value: string); + + /** + * Locates elements that have a specific class name. + * + * @param {string} name The class name to search for. + * @return {!By} The new locator. + * @see http://www.w3.org/TR/2011/WD-html5-20110525/elements.html#classes + * @see http://www.w3.org/TR/CSS2/selector.html#class-html + */ + static className(name: string): By; + + /** + * Locates elements using a CSS selector. + * + * @param {string} selector The CSS selector to use. + * @return {!By} The new locator. + * @see http://www.w3.org/TR/CSS2/selector.html + */ + static css(selector: string): By; + + /** + * Locates eleemnts by the ID attribute. This locator uses the CSS selector + * `*[id='$ID']`, _not_ `document.getElementById`. + * + * @param {string} id The ID to search for. + * @return {!By} The new locator. + */ + static id(id: string): By; + + /** + * Locates link elements whose + * {@linkplain webdriver.WebElement#getText visible text} matches the given + * string. + * + * @param {string} text The link text to search for. + * @return {!By} The new locator. + */ + static linkText(text: string): By; + + /** + * Locates an elements by evaluating a + * {@linkplain webdriver.WebDriver#executeScript JavaScript expression}. + * The result of this expression must be an element or list of elements. + * + * @param {!(string|Function)} script The script to execute. + * @param {...*} var_args The arguments to pass to the script. + * @return {function(!./webdriver.WebDriver): !./promise.Promise} + * A new JavaScript-based locator function. + */ + static js(script: string | Function, ...var_args: Array): (webdriver: webdriver.WebDriver) => webdriver.promise.Promise; + + /** + * Locates elements whose `name` attribute has the given value. + * + * @param {string} name The name attribute to search for. + * @return {!By} The new locator. + */ + static name(name: string): By; + + /** + * Locates link elements whose + * {@linkplain webdriver.WebElement#getText visible text} contains the given + * substring. + * + * @param {string} text The substring to check for in a link's visible text. + * @return {!By} The new locator. + */ + static partialLinkText(text: string): By; + + /** + * Locates elements with a given tag name. + * + * @param {string} name The tag name to search for. + * @return {!By} The new locator. + * @deprecated Use {@link By.css() By.css(tagName)} instead. + */ + static tagName(name: string): By; + + /** + * Locates elements matching a XPath selector. Care should be taken when + * using an XPath selector with a {@link webdriver.WebElement} as WebDriver + * will respect the context in the specified in the selector. For example, + * given the selector `//div`, WebDriver will search from the document root + * regardless of whether the locator was used with a WebElement. + * + * @param {string} xpath The XPath selector to use. + * @return {!By} The new locator. + * @see http://www.w3.org/TR/xpath/ + */ + static xpath(xpath: string): By; + + /** @override */ + toString(): string; + } + + /** + * Short-hand expressions for the primary element locator strategies. + * For example the following two statements are equivalent: + * + * var e1 = driver.findElement(webdriver.By.id('foo')); + * var e2 = driver.findElement({id: 'foo'}); + * + * Care should be taken when using JavaScript minifiers (such as the + * Closure compiler), as locator hashes will always be parsed using + * the un-obfuscated properties listed. + * + * @typedef {( + * {className: string}| + * {css: string}| + * {id: string}| + * {js: string}| + * {linkText: string}| + * {name: string}| + * {partialLinkText: string}| + * {tagName: string}| + * {xpath: string})} + */ + type ByHash = { className: string } | + { css: string } | + { id: string } | + { js: string } | + { linkText: string } | + { name: string } | + { partialLinkText: string } | + { tagName: string } | + { xpath: string }; + + /** + * Common webdriver capability keys. + * @enum {string} + */ + interface ICapability { + + /** + * Indicates whether a driver should accept all SSL certs by default. This + * capability only applies when requesting a new session. To query whether + * a driver can handle insecure SSL certs, see + * {@link webdriver.Capability.SECURE_SSL}. + */ + ACCEPT_SSL_CERTS: string; + + + /** + * The browser name. Common browser names are defined in the + * {@link webdriver.Browser} enum. + */ + BROWSER_NAME: string; + + /** + * Defines how elements should be scrolled into the viewport for interaction. + * This capability will be set to zero (0) if elements are aligned with the + * top of the viewport, or one (1) if aligned with the bottom. The default + * behavior is to align with the top of the viewport. + */ + ELEMENT_SCROLL_BEHAVIOR: string; + + /** + * Whether the driver is capable of handling modal alerts (e.g. alert, + * confirm, prompt). To define how a driver should handle alerts, + * use {@link webdriver.Capability.UNEXPECTED_ALERT_BEHAVIOR}. + */ + HANDLES_ALERTS: string; + + /** + * Key for the logging driver logging preferences. + */ + LOGGING_PREFS: string; + + /** + * Whether this session generates native events when simulating user input. + */ + NATIVE_EVENTS: string; + + /** + * Describes the platform the browser is running on. Will be one of + * ANDROID, IOS, LINUX, MAC, UNIX, or WINDOWS. When requesting a + * session, ANY may be used to indicate no platform preference (this is + * semantically equivalent to omitting the platform capability). + */ + PLATFORM: string; + + /** + * Describes the proxy configuration to use for a new WebDriver session. + */ + PROXY: string; + + /** Whether the driver supports changing the brower's orientation. */ + ROTATABLE: string; + + /** + * Whether a driver is only capable of handling secure SSL certs. To request + * that a driver accept insecure SSL certs by default, use + * {@link webdriver.Capability.ACCEPT_SSL_CERTS}. + */ + SECURE_SSL: string; + + /** Whether the driver supports manipulating the app cache. */ + SUPPORTS_APPLICATION_CACHE: string; + + /** Whether the driver supports locating elements with CSS selectors. */ + SUPPORTS_CSS_SELECTORS: string; + + /** Whether the browser supports JavaScript. */ + SUPPORTS_JAVASCRIPT: string; + + /** Whether the driver supports controlling the browser's location info. */ + SUPPORTS_LOCATION_CONTEXT: string; + + /** Whether the driver supports taking screenshots. */ + TAKES_SCREENSHOT: string; + + /** + * Defines how the driver should handle unexpected alerts. The value should + * be one of 'accept', 'dismiss', or 'ignore. + */ + UNEXPECTED_ALERT_BEHAVIOR: string; + + /** Defines the browser version. */ + VERSION: string; + } + + var Capability: ICapability; + + class Capabilities { + //region Constructors + + /** + * @param {(webdriver.Capabilities|Object)=} opt_other Another set of + * capabilities to merge into this instance. + * @constructor + */ + constructor(opt_other?: Capabilities | Object); + + //endregion + + //region Methods + + /** @return {!Object} The JSON representation of this instance. */ + toJSON(): any; + + /** + * Merges another set of capabilities into this instance. Any duplicates in + * the provided set will override those already set on this instance. + * @param {!(webdriver.Capabilities|Object)} other The capabilities to + * merge into this instance. + * @return {!webdriver.Capabilities} A self reference. + */ + merge(other: Capabilities | Object): Capabilities; + + /** + * @param {string} key The capability to set. + * @param {*} value The capability value. Capability values must be JSON + * serializable. Pass {@code null} to unset the capability. + * @return {!webdriver.Capabilities} A self reference. + */ + set(key: string, value: any): Capabilities; + + /** + * Sets the logging preferences. Preferences may be specified as a + * {@link webdriver.logging.Preferences} instance, or a as a map of log-type to + * log-level. + * @param {!(webdriver.logging.Preferences|Object.)} prefs The + * logging preferences. + * @return {!webdriver.Capabilities} A self reference. + */ + setLoggingPrefs(prefs: webdriver.logging.Preferences | Object): Capabilities; + + /** + * Sets the proxy configuration for this instance. + * @param {webdriver.ProxyConfig} proxy The desired proxy configuration. + * @return {!webdriver.Capabilities} A self reference. + */ + setProxy(proxy: ProxyConfig): Capabilities; + + + /** + * Sets whether native events should be used. + * @param {boolean} enabled Whether to enable native events. + * @return {!webdriver.Capabilities} A self reference. + */ + setEnableNativeEvents(enabled: boolean): Capabilities; + + + /** + * Sets how elements should be scrolled into view for interaction. + * @param {number} behavior The desired scroll behavior: either 0 to align with + * the top of the viewport or 1 to align with the bottom. + * @return {!webdriver.Capabilities} A self reference. + */ + setScrollBehavior(behavior: number): Capabilities; + + /** + * Sets the default action to take with an unexpected alert before returning + * an error. + * @param {string} behavior The desired behavior; should be 'accept', 'dismiss', + * or 'ignore'. Defaults to 'dismiss'. + * @return {!webdriver.Capabilities} A self reference. + */ + setAlertBehavior(behavior: string): Capabilities; + + /** + * @param {string} key The capability to return. + * @return {*} The capability with the given key, or {@code null} if it has + * not been set. + */ + get(key: string): any; + + /** + * @param {string} key The capability to check. + * @return {boolean} Whether the specified capability is set. + */ + has(key: string): boolean; + + //endregion + + //region Static Methods + + /** + * @return {!webdriver.Capabilities} A basic set of capabilities for Android. + */ + static android(): Capabilities; + + /** + * @return {!webdriver.Capabilities} A basic set of capabilities for Chrome. + */ + static chrome(): Capabilities; + + /** + * @return {!Capabilities} A basic set of capabilities for Microsoft Edge. + */ + static edge(): Capabilities; + + /** + * @return {!webdriver.Capabilities} A basic set of capabilities for Firefox. + */ + static firefox(): Capabilities; + + /** + * @return {!webdriver.Capabilities} A basic set of capabilities for + * Internet Explorer. + */ + static ie(): Capabilities; + + /** + * @return {!webdriver.Capabilities} A basic set of capabilities for iPad. + */ + static ipad(): Capabilities; + + /** + * @return {!webdriver.Capabilities} A basic set of capabilities for iPhone. + */ + static iphone(): Capabilities; + + /** + * @return {!webdriver.Capabilities} A basic set of capabilities for Opera. + */ + static opera(): Capabilities; + + /** + * @return {!webdriver.Capabilities} A basic set of capabilities for + * PhantomJS. + */ + static phantomjs(): Capabilities; + + /** + * @return {!webdriver.Capabilities} A basic set of capabilities for Safari. + */ + static safari(): Capabilities; + + /** + * @return {!webdriver.Capabilities} A basic set of capabilities for HTMLUnit. + */ + static htmlunit(): Capabilities; + + /** + * @return {!webdriver.Capabilities} A basic set of capabilities for HTMLUnit + * with enabled Javascript. + */ + static htmlunitwithjs(): Capabilities; + + //endregion + } + + /** + * An enumeration of valid command string. + */ + interface ICommandName { + GET_SERVER_STATUS: string; + + NEW_SESSION: string; + GET_SESSIONS: string; + DESCRIBE_SESSION: string; + + CLOSE: string; + QUIT: string; + + GET_CURRENT_URL: string; + GET: string; + GO_BACK: string; + GO_FORWARD: string; + REFRESH: string; + + ADD_COOKIE: string; + GET_COOKIE: string; + GET_ALL_COOKIES: string; + DELETE_COOKIE: string; + DELETE_ALL_COOKIES: string; + + GET_ACTIVE_ELEMENT: string; + FIND_ELEMENT: string; + FIND_ELEMENTS: string; + FIND_CHILD_ELEMENT: string; + FIND_CHILD_ELEMENTS: string; + + CLEAR_ELEMENT: string; + CLICK_ELEMENT: string; + SEND_KEYS_TO_ELEMENT: string; + SUBMIT_ELEMENT: string; + + GET_CURRENT_WINDOW_HANDLE: string; + GET_WINDOW_HANDLES: string; + GET_WINDOW_POSITION: string; + SET_WINDOW_POSITION: string; + GET_WINDOW_SIZE: string; + SET_WINDOW_SIZE: string; + MAXIMIZE_WINDOW: string; + + SWITCH_TO_WINDOW: string; + SWITCH_TO_FRAME: string; + GET_PAGE_SOURCE: string; + GET_TITLE: string; + + EXECUTE_SCRIPT: string; + EXECUTE_ASYNC_SCRIPT: string; + + GET_ELEMENT_TEXT: string; + GET_ELEMENT_TAG_NAME: string; + IS_ELEMENT_SELECTED: string; + IS_ELEMENT_ENABLED: string; + IS_ELEMENT_DISPLAYED: string; + GET_ELEMENT_LOCATION: string; + GET_ELEMENT_LOCATION_IN_VIEW: string; + GET_ELEMENT_SIZE: string; + GET_ELEMENT_ATTRIBUTE: string; + GET_ELEMENT_VALUE_OF_CSS_PROPERTY: string; + ELEMENT_EQUALS: string; + + SCREENSHOT: string; + IMPLICITLY_WAIT: string; + SET_SCRIPT_TIMEOUT: string; + SET_TIMEOUT: string; + + ACCEPT_ALERT: string; + DISMISS_ALERT: string; + GET_ALERT_TEXT: string; + SET_ALERT_TEXT: string; + + EXECUTE_SQL: string; + GET_LOCATION: string; + SET_LOCATION: string; + GET_APP_CACHE: string; + GET_APP_CACHE_STATUS: string; + CLEAR_APP_CACHE: string; + IS_BROWSER_ONLINE: string; + SET_BROWSER_ONLINE: string; + + GET_LOCAL_STORAGE_ITEM: string; + GET_LOCAL_STORAGE_KEYS: string; + SET_LOCAL_STORAGE_ITEM: string; + REMOVE_LOCAL_STORAGE_ITEM: string; + CLEAR_LOCAL_STORAGE: string; + GET_LOCAL_STORAGE_SIZE: string; + + GET_SESSION_STORAGE_ITEM: string; + GET_SESSION_STORAGE_KEYS: string; + SET_SESSION_STORAGE_ITEM: string; + REMOVE_SESSION_STORAGE_ITEM: string; + CLEAR_SESSION_STORAGE: string; + GET_SESSION_STORAGE_SIZE: string; + + SET_SCREEN_ORIENTATION: string; + GET_SCREEN_ORIENTATION: string; + + // These belong to the Advanced user interactions - an element is + // optional for these commands. + CLICK: string; + DOUBLE_CLICK: string; + MOUSE_DOWN: string; + MOUSE_UP: string; + MOVE_TO: string; + SEND_KEYS_TO_ACTIVE_ELEMENT: string; + + // These belong to the Advanced Touch API + TOUCH_SINGLE_TAP: string; + TOUCH_DOWN: string; + TOUCH_UP: string; + TOUCH_MOVE: string; + TOUCH_SCROLL: string; + TOUCH_DOUBLE_TAP: string; + TOUCH_LONG_PRESS: string; + TOUCH_FLICK: string; + + GET_AVAILABLE_LOG_TYPES: string; + GET_LOG: string; + GET_SESSION_LOGS: string; + + UPLOAD_FILE: string; + } + + var CommandName: ICommandName; + + /** + * Describes a command to be executed by the WebDriverJS framework. + * @param {!webdriver.CommandName} name The name of this command. + * @constructor + */ + class Command { + //region Constructors + + /** + * @param {!webdriver.CommandName} name The name of this command. + * @constructor + */ + constructor(name: string); + + //endregion + + //region Methods + + /** + * @return {!webdriver.CommandName} This command's name. + */ + getName(): string; + + /** + * Sets a parameter to send with this command. + * @param {string} name The parameter name. + * @param {*} value The parameter value. + * @return {!webdriver.Command} A self reference. + */ + setParameter(name: string, value: any): Command; + + /** + * Sets the parameters for this command. + * @param {!Object.<*>} parameters The command parameters. + * @return {!webdriver.Command} A self reference. + */ + setParameters(parameters: any): Command; + + /** + * Returns a named command parameter. + * @param {string} key The parameter key to look up. + * @return {*} The parameter value, or undefined if it has not been set. + */ + getParameter(key: string): any; + + /** + * @return {!Object.<*>} The parameters to send with this command. + */ + getParameters(): any; + + //endregion + } + + /** + * Handles the execution of WebDriver {@link Command commands}. + * @interface + */ + class Executor { + /** + * Executes the given {@code command}. If there is an error executing the + * command, the provided callback will be invoked with the offending error. + * Otherwise, the callback will be invoked with a null Error and non-null + * response object. + * + * @param {!Command} command The command to execute. + * @return {!promise.Promise} A promise that will be fulfilled with + * the command result. + */ + execute(command: Command): webdriver.promise.Promise + } + + /** + * Wraps a promised {@link Executor}, ensuring no commands are executed until + * the wrapped executor has been fully resolved. + * @implements {Executor} + */ + class DeferredExecutor { + /** + * @param {!promise.Promise} delegate The promised delegate, which + * may be provided by any promise-like thenable object. + */ + constructor(delegate: webdriver.promise.Promise); + } + + /** + * Describes an event listener registered on an {@linkplain EventEmitter}. + */ + class Listener { + /** + * @param {!Function} fn The acutal listener function. + * @param {(Object|undefined)} scope The object in whose scope to invoke the + * listener. + * @param {boolean} oneshot Whether this listener should only be used once. + */ + constructor(fn: Function, scope: Object, oneshot: boolean); + } + + /** + * Object that can emit events for others to listen for. This is used instead + * of Closure's event system because it is much more light weight. The API is + * based on Node's EventEmitters. + */ + class EventEmitter { + //region Constructors + + /** + * @constructor + */ + constructor(); + + //endregion + + //region Methods + + /** + * Fires an event and calls all listeners. + * @param {string} type The type of event to emit. + * @param {...*} var_args Any arguments to pass to each listener. + */ + emit(type: string, ...var_args: any[]): void; + + /** + * Returns a mutable list of listeners for a specific type of event. + * @param {string} type The type of event to retrieve the listeners for. + * @return {!Set} The registered listeners for the given event + * type. + */ + listeners(type: string): any; + + /** + * Registers a listener. + * @param {string} type The type of event to listen for. + * @param {!Function} fn The function to invoke when the event is fired. + * @param {Object=} opt_self The object in whose scope to invoke the listener. + * @param {boolean=} opt_oneshot Whether the listener should b (e removed after + * the first event is fired. + * @return {!EventEmitter} A self reference. + * @private + */ + addListener(type: string, fn: Function, opt_scope?: any, opt_oneshot?: boolean): EventEmitter; + + + /** + * Registers a one-time listener which will be called only the first time an + * event is emitted, after which it will be removed. + * @param {string} type The type of event to listen for. + * @param {!Function} fn The function to invoke when the event is fired. + * @param {Object=} opt_scope The object in whose scope to invoke the listener. + * @return {!webdriver.EventEmitter} A self reference. + */ + once(type: string, fn: any, opt_scope?: any): EventEmitter; + + /** + * An alias for {@code #addListener()}. + * @param {string} type The type of event to listen for. + * @param {!Function} fn The function to invoke when the event is fired. + * @param {Object=} opt_scope The object in whose scope to invoke the listener. + * @return {!webdriver.EventEmitter} A self reference. + */ + on(type: string, fn: Function, opt_scope?: any): EventEmitter; + + /** + * Removes a previously registered event listener. + * @param {string} type The type of event to unregister. + * @param {!Function} listenerFn The handler function to remove. + * @return {!webdriver.EventEmitter} A self reference. + */ + removeListener(type: string, listenerFn: Function): EventEmitter; + + /** + * Removes all listeners for a specific type of event. If no event is + * specified, all listeners across all types will be removed. + * @param {string=} opt_type The type of event to remove listeners from. + * @return {!webdriver.EventEmitter} A self reference. + */ + removeAllListeners(opt_type?: string): EventEmitter; + + //endregion + } + + + /** + * Interface for navigating back and forth in the browser history. + */ + class Navigation { + //region Constructors + + /** + * Interface for navigating back and forth in the browser history. + * + * This class should never be instantiated directly. Insead, obtain an instance + * with + * + * webdriver.navigate() + * + * @see WebDriver#navigate() + */ + constructor(driver: WebDriver); + + //endregion + + //region Methods + + /** + * Schedules a command to navigate to a new URL. + * @param {string} url The URL to navigate to. + * @return {!webdriver.promise.Promise.} A promise that will be resolved + * when the URL has been loaded. + */ + to(url: string): webdriver.promise.Promise; + + /** + * Schedules a command to move backwards in the browser history. + * @return {!webdriver.promise.Promise.} A promise that will be resolved + * when the navigation event has completed. + */ + back(): webdriver.promise.Promise; + + /** + * Schedules a command to move forwards in the browser history. + * @return {!webdriver.promise.Promise.} A promise that will be resolved + * when the navigation event has completed. + */ + forward(): webdriver.promise.Promise; + + /** + * Schedules a command to refresh the current page. + * @return {!webdriver.promise.Promise.} A promise that will be resolved + * when the navigation event has completed. + */ + refresh(): webdriver.promise.Promise; + + //endregion + } + + interface IWebDriverOptionsCookie { + name: string; + value: string; + path?: string; + domain?: string; + secure?: boolean; + expiry?: number; + } + + /** + * Provides methods for managing browser and driver state. + */ + class Options { + //region Constructors + + /** + * @param {!webdriver.WebDriver} driver The parent driver. + * @constructor + */ + constructor(driver: webdriver.WebDriver); + + //endregion + + //region Methods + + /** + * Schedules a command to add a cookie. + * @param {string} name The cookie name. + * @param {string} value The cookie value. + * @param {string=} opt_path The cookie path. + * @param {string=} opt_domain The cookie domain. + * @param {boolean=} opt_isSecure Whether the cookie is secure. + * @param {(number|!Date)=} opt_expiry When the cookie expires. If specified + * as a number, should be in milliseconds since midnight, + * January 1, 1970 UTC. + * @return {!promise.Promise} A promise that will be resolved + * when the cookie has been added to the page. + */ + addCookie(name: string, value: string, opt_path?: string, opt_domain?: string, opt_isSecure?: boolean, opt_expiry?: number | Date): webdriver.promise.Promise; + + /** + * Schedules a command to delete all cookies visible to the current page. + * @return {!webdriver.promise.Promise} A promise that will be resolved when all + * cookies have been deleted. + */ + deleteAllCookies(): webdriver.promise.Promise; + + /** + * Schedules a command to delete the cookie with the given name. This command is + * a no-op if there is no cookie with the given name visible to the current + * page. + * @param {string} name The name of the cookie to delete. + * @return {!webdriver.promise.Promise} A promise that will be resolved when the + * cookie has been deleted. + */ + deleteCookie(name: string): webdriver.promise.Promise; + + /** + * Schedules a command to retrieve all cookies visible to the current page. + * Each cookie will be returned as a JSON object as described by the WebDriver + * wire protocol. + * @return {!webdriver.promise.Promise} A promise that will be resolved with the + * cookies visible to the current page. + * @see http://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object + */ + getCookies(): webdriver.promise.Promise; + + /** + * Schedules a command to retrieve the cookie with the given name. Returns null + * if there is no such cookie. The cookie will be returned as a JSON object as + * described by the WebDriver wire protocol. + * @param {string} name The name of the cookie to retrieve. + * @return {!webdriver.promise.Promise} A promise that will be resolved with the + * named cookie, or {@code null} if there is no such cookie. + * @see http://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object + */ + getCookie(name: string): webdriver.promise.Promise; + + /** + * @return {!webdriver.WebDriver.Logs} The interface for managing driver + * logs. + */ + logs(): webdriver.Logs; + + /** + * @return {!webdriver.WebDriver.Timeouts} The interface for managing driver + * timeouts. + */ + timeouts(): webdriver.Timeouts; + + /** + * @return {!webdriver.WebDriver.Window} The interface for managing the + * current window. + */ + window(): webdriver.Window; + + //endregion + } + + /** + * An interface for managing timeout behavior for WebDriver instances. + */ + class Timeouts { + //region Constructors + + /** + * @param {!webdriver.WebDriver} driver The parent driver. + * @constructor + */ + constructor(driver: webdriver.WebDriver); + + //endregion + + //region Methods + + /** + * Specifies the amount of time the driver should wait when searching for an + * element if it is not immediately present. + *

    + * When searching for a single element, the driver should poll the page + * until the element has been found, or this timeout expires before failing + * with a {@code bot.ErrorCode.NO_SUCH_ELEMENT} error. When searching + * for multiple elements, the driver should poll the page until at least one + * element has been found or this timeout has expired. + *

    + * Setting the wait timeout to 0 (its default value), disables implicit + * waiting. + *

    + * Increasing the implicit wait timeout should be used judiciously as it + * will have an adverse effect on test run time, especially when used with + * slower location strategies like XPath. + * + * @param {number} ms The amount of time to wait, in milliseconds. + * @return {!webdriver.promise.Promise} A promise that will be resolved when the + * implicit wait timeout has been set. + */ + implicitlyWait(ms: number): webdriver.promise.Promise; + + /** + * Sets the amount of time to wait, in milliseconds, for an asynchronous script + * to finish execution before returning an error. If the timeout is less than or + * equal to 0, the script will be allowed to run indefinitely. + * + * @param {number} ms The amount of time to wait, in milliseconds. + * @return {!webdriver.promise.Promise} A promise that will be resolved when the + * script timeout has been set. + */ + setScriptTimeout(ms: number): webdriver.promise.Promise; + + /** + * Sets the amount of time to wait for a page load to complete before returning + * an error. If the timeout is negative, page loads may be indefinite. + * @param {number} ms The amount of time to wait, in milliseconds. + * @return {!webdriver.promise.Promise} A promise that will be resolved when + * the timeout has been set. + */ + pageLoadTimeout(ms: number): webdriver.promise.Promise; + + //endregion + } + + /** + * An interface for managing the current window. + */ + class Window { + + //region Constructors + + /** + * @param {!webdriver.WebDriver} driver The parent driver. + * @constructor + */ + constructor(driver: webdriver.WebDriver); + + //endregion + + //region Methods + + /** + * Retrieves the window's current position, relative to the top left corner of + * the screen. + * @return {!webdriver.promise.Promise} A promise that will be resolved with the + * window's position in the form of a {x:number, y:number} object literal. + */ + getPosition(): webdriver.promise.Promise; + + /** + * Repositions the current window. + * @param {number} x The desired horizontal position, relative to the left side + * of the screen. + * @param {number} y The desired vertical position, relative to the top of the + * of the screen. + * @return {!webdriver.promise.Promise} A promise that will be resolved when the + * command has completed. + */ + setPosition(x: number, y: number): webdriver.promise.Promise; + + /** + * Retrieves the window's current size. + * @return {!webdriver.promise.Promise} A promise that will be resolved with the + * window's size in the form of a {width:number, height:number} object + * literal. + */ + getSize(): webdriver.promise.Promise; + + /** + * Resizes the current window. + * @param {number} width The desired window width. + * @param {number} height The desired window height. + * @return {!webdriver.promise.Promise} A promise that will be resolved when the + * command has completed. + */ + setSize(width: number, height: number): webdriver.promise.Promise; + + /** + * Maximizes the current window. + * @return {!webdriver.promise.Promise} A promise that will be resolved when the + * command has completed. + */ + maximize(): webdriver.promise.Promise; + + //endregion + } + + /** + * Interface for managing WebDriver log records. + */ + class Logs { + + //region Constructors + + /** + * @param {!webdriver.WebDriver} driver The parent driver. + * @constructor + */ + constructor(driver: webdriver.WebDriver); + + //endregion + + //region + + /** + * Fetches available log entries for the given type. + * + *

    Note that log buffers are reset after each call, meaning that + * available log entries correspond to those entries not yet returned for a + * given log type. In practice, this means that this call will return the + * available log entries since the last call, or from the start of the + * session. + * + * @param {!webdriver.logging.Type} type The desired log type. + * @return {!webdriver.promise.Promise.>} A + * promise that will resolve to a list of log entries for the specified + * type. + */ + get(type: string): webdriver.promise.Promise; + + /** + * Retrieves the log types available to this driver. + * @return {!webdriver.promise.Promise.>} A + * promise that will resolve to a list of available log types. + */ + getAvailableLogTypes(): webdriver.promise.Promise; + + //endregion + } + + /** + * An interface for changing the focus of the driver to another frame or window. + */ + class TargetLocator { + + //region Constructors + + /** + * @param {!webdriver.WebDriver} driver The parent driver. + * @constructor + */ + constructor(driver: webdriver.WebDriver); + + //endregion + + //region Methods + + /** + * Schedules a command retrieve the {@code document.activeElement} element on + * the current document, or {@code document.body} if activeElement is not + * available. + * @return {!webdriver.WebElement} The active element. + */ + activeElement(): WebElementPromise; + + /** + * Schedules a command to switch focus of all future commands to the first frame + * on the page. + * @return {!webdriver.promise.Promise} A promise that will be resolved when the + * driver has changed focus to the default content. + */ + defaultContent(): webdriver.promise.Promise; + + /** + * Schedules a command to switch the focus of all future commands to another + * frame on the page. The target frame may be specified as one of the + * following: + * + * - A number that specifies a (zero-based) index into [window.frames]( + * https://developer.mozilla.org/en-US/docs/Web/API/Window.frames). + * - A {@link WebElement} reference, which correspond to a `frame` or `iframe` + * DOM element. + * - The `null` value, to select the topmost frame on the page. Passing `null` + * is the same as calling {@link #defaultContent defaultContent()}. + * + * If the specified frame can not be found, the returned promise will be + * rejected with a {@linkplain error.NoSuchFrameError}. + * + * @param {(number|WebElement|null)} id The frame locator. + * @return {!promise.Promise} A promise that will be resolved + * when the driver has changed focus to the specified frame. + */ + frame(nameOrIndex: number | WebElement): webdriver.promise.Promise; + + /** + * Schedules a command to switch the focus of all future commands to another + * window. Windows may be specified by their {@code window.name} attribute or + * by its handle (as returned by {@link WebDriver#getWindowHandles}). + * + * If the specified window cannot be found, the returned promise will be + * rejected with a {@linkplain error.NoSuchWindowError}. + * + * @param {string} nameOrHandle The name or window handle of the window to + * switch focus to. + * @return {!promise.Promise} A promise that will be resolved + * when the driver has changed focus to the specified window. + */ + window(nameOrHandle: string): webdriver.promise.Promise; + + /** + * Schedules a command to change focus to the active modal dialog, such as + * those opened by `window.alert()`, `window.confirm()`, and + * `window.prompt()`. The returned promise will be rejected with a + * {@linkplain error.NoSuchAlertError} if there are no open alerts. + * + * @return {!AlertPromise} The open alert. + */ + alert(): AlertPromise; + + //endregion + } + + /** + * Used with {@link webdriver.WebElement#sendKeys WebElement#sendKeys} on file + * input elements ({@code }) to detect when the entered key + * sequence defines the path to a file. + * + * By default, {@linkplain webdriver.WebElement WebElement's} will enter all + * key sequences exactly as entered. You may set a + * {@linkplain webdriver.WebDriver#setFileDetector file detector} on the parent + * WebDriver instance to define custom behavior for handling file elements. Of + * particular note is the {@link selenium-webdriver/remote.FileDetector}, which + * should be used when running against a remote + * [Selenium Server](http://docs.seleniumhq.org/download/). + */ + class FileDetector { + /** @constructor */ + constructor(); + + /** + * Handles the file specified by the given path, preparing it for use with + * the current browser. If the path does not refer to a valid file, it will + * be returned unchanged, otherwisee a path suitable for use with the current + * browser will be returned. + * + * This default implementation is a no-op. Subtypes may override this + * function for custom tailored file handling. + * + * @param {!webdriver.WebDriver} driver The driver for the current browser. + * @param {string} path The path to process. + * @return {!webdriver.promise.Promise} A promise for the processed + * file path. + * @package + */ + handleFile(driver: webdriver.WebDriver, path: string): webdriver.promise.Promise; + } + + /** + * Creates a new WebDriver client, which provides control over a browser. + * + * Every WebDriver command returns a {@code webdriver.promise.Promise} that + * represents the result of that command. Callbacks may be registered on this + * object to manipulate the command result or catch an expected error. Any + * commands scheduled with a callback are considered sub-commands and will + * execute before the next command in the current frame. For example: + * + * var message = []; + * driver.call(message.push, message, 'a').then(function() { + * driver.call(message.push, message, 'b'); + * }); + * driver.call(message.push, message, 'c'); + * driver.call(function() { + * alert('message is abc? ' + (message.join('') == 'abc')); + * }); + * + */ + class WebDriver { + //region Constructors + + /** + * @param {!(Session|promise.Promise)} session Either a + * known session or a promise that will be resolved to a session. + * @param {!command.Executor} executor The executor to use when sending + * commands to the browser. + * @param {promise.ControlFlow=} opt_flow The flow to + * schedule commands through. Defaults to the active flow object. + */ + constructor(session: Session | webdriver.promise.Promise, executor: Executor, opt_flow?: webdriver.promise.ControlFlow); + + //endregion + + //region StaticMethods + + /** + * Creates a new WebDriver client for an existing session. + * @param {!command.Executor} executor Command executor to use when querying + * for session details. + * @param {string} sessionId ID of the session to attach to. + * @param {promise.ControlFlow=} opt_flow The control flow all + * driver commands should execute under. Defaults to the + * {@link promise.controlFlow() currently active} control flow. + * @return {!WebDriver} A new client for the specified session. + */ + static attachToSession(executor: Executor, sessionId: string, opt_flow?: webdriver.promise.ControlFlow): WebDriver; + + /** + * Creates a new WebDriver session. + * @param {!command.Executor} executor The executor to create the new session + * with. + * @param {!./capabilities.Capabilities} desiredCapabilities The desired + * capabilities for the new session. + * @param {promise.ControlFlow=} opt_flow The control flow all driver + * commands should execute under, including the initial session creation. + * Defaults to the {@link promise.controlFlow() currently active} + * control flow. + * @return {!WebDriver} The driver for the newly created session. + */ + static createSession(executor: Executor, desiredCapabilities: Capabilities, opt_flow?: webdriver.promise.ControlFlow): WebDriver; + + //endregion + + //region Methods + + /** + * @return {!webdriver.promise.ControlFlow} The control flow used by this + * instance. + */ + controlFlow(): webdriver.promise.ControlFlow; + + /** + * Schedules a {@link command.Command} to be executed by this driver's + * {@link command.Executor}. + * + * @param {!command.Command} command The command to schedule. + * @param {string} description A description of the command for debugging. + * @return {!promise.Promise} A promise that will be resolved + * with the command result. + * @template T + */ + schedule(command: Command, description: string): webdriver.promise.Promise; + + + /** + * Sets the {@linkplain input.FileDetector file detector} that should be + * used with this instance. + * @param {input.FileDetector} detector The detector to use or {@code null}. + */ + setFileDetector(detector: FileDetector): void; + + + /** + * @return {!webdriver.promise.Promise.} A promise for this + * client's session. + */ + getSession(): webdriver.promise.Promise; + + + /** + * @return {!webdriver.promise.Promise.} A promise + * that will resolve with the this instance's capabilities. + */ + getCapabilities(): webdriver.promise.Promise; + + + /** + * Schedules a command to quit the current session. After calling quit, this + * instance will be invalidated and may no longer be used to issue commands + * against the browser. + * @return {!webdriver.promise.Promise.} A promise that will be resolved + * when the command has completed. + */ + quit(): webdriver.promise.Promise; + + /** + * Creates a new action sequence using this driver. The sequence will not be + * scheduled for execution until {@link actions.ActionSequence#perform} is + * called. Example: + * + * driver.actions(). + * mouseDown(element1). + * mouseMove(element2). + * mouseUp(). + * perform(); + * + * @return {!actions.ActionSequence} A new action sequence for this instance. + */ + actions(): ActionSequence; + + + /** + * Creates a new touch sequence using this driver. The sequence will not be + * scheduled for execution until {@link actions.TouchSequence#perform} is + * called. Example: + * + * driver.touchActions(). + * tap(element1). + * doubleTap(element2). + * perform(); + * + * @return {!actions.TouchSequence} A new touch sequence for this instance. + */ + touchActions(): TouchSequence; + + + /** + * Schedules a command to execute JavaScript in the context of the currently + * selected frame or window. The script fragment will be executed as the body + * of an anonymous function. If the script is provided as a function object, + * that function will be converted to a string for injection into the target + * window. + * + * Any arguments provided in addition to the script will be included as script + * arguments and may be referenced using the {@code arguments} object. + * Arguments may be a boolean, number, string, or {@code webdriver.WebElement}. + * Arrays and objects may also be used as script arguments as long as each item + * adheres to the types previously mentioned. + * + * The script may refer to any variables accessible from the current window. + * Furthermore, the script will execute in the window's context, thus + * {@code document} may be used to refer to the current document. Any local + * variables will not be available once the script has finished executing, + * though global variables will persist. + * + * If the script has a return value (i.e. if the script contains a return + * statement), then the following steps will be taken for resolving this + * functions return value: + * + * - For a HTML element, the value will resolve to a + * {@link webdriver.WebElement} + * - Null and undefined return values will resolve to null + * - Booleans, numbers, and strings will resolve as is + * - Functions will resolve to their string representation + * - For arrays and objects, each member item will be converted according to + * the rules above + * + * @param {!(string|Function)} script The script to execute. + * @param {...*} var_args The arguments to pass to the script. + * @return {!webdriver.promise.Promise.} A promise that will resolve to the + * scripts return value. + * @template T + */ + executeScript(script: string | Function, ...var_args: any[]): webdriver.promise.Promise; + + /** + * Schedules a command to execute asynchronous JavaScript in the context of the + * currently selected frame or window. The script fragment will be executed as + * the body of an anonymous function. If the script is provided as a function + * object, that function will be converted to a string for injection into the + * target window. + * + * Any arguments provided in addition to the script will be included as script + * arguments and may be referenced using the {@code arguments} object. + * Arguments may be a boolean, number, string, or {@code webdriver.WebElement}. + * Arrays and objects may also be used as script arguments as long as each item + * adheres to the types previously mentioned. + * + * Unlike executing synchronous JavaScript with {@link #executeScript}, + * scripts executed with this function must explicitly signal they are finished + * by invoking the provided callback. This callback will always be injected + * into the executed function as the last argument, and thus may be referenced + * with {@code arguments[arguments.length - 1]}. The following steps will be + * taken for resolving this functions return value against the first argument + * to the script's callback function: + * + * - For a HTML element, the value will resolve to a + * {@link webdriver.WebElement} + * - Null and undefined return values will resolve to null + * - Booleans, numbers, and strings will resolve as is + * - Functions will resolve to their string representation + * - For arrays and objects, each member item will be converted according to + * the rules above + * + * __Example #1:__ Performing a sleep that is synchronized with the currently + * selected window: + * + * var start = new Date().getTime(); + * driver.executeAsyncScript( + * 'window.setTimeout(arguments[arguments.length - 1], 500);'). + * then(function() { + * console.log( + * 'Elapsed time: ' + (new Date().getTime() - start) + ' ms'); + * }); + * + * __Example #2:__ Synchronizing a test with an AJAX application: + * + * var button = driver.findElement(By.id('compose-button')); + * button.click(); + * driver.executeAsyncScript( + * 'var callback = arguments[arguments.length - 1];' + + * 'mailClient.getComposeWindowWidget().onload(callback);'); + * driver.switchTo().frame('composeWidget'); + * driver.findElement(By.id('to')).sendKeys('dog@example.com'); + * + * __Example #3:__ Injecting a XMLHttpRequest and waiting for the result. In + * this example, the inject script is specified with a function literal. When + * using this format, the function is converted to a string for injection, so it + * should not reference any symbols not defined in the scope of the page under + * test. + * + * driver.executeAsyncScript(function() { + * var callback = arguments[arguments.length - 1]; + * var xhr = new XMLHttpRequest(); + * xhr.open('GET', '/resource/data.json', true); + * xhr.onreadystatechange = function() { + * if (xhr.readyState == 4) { + * callback(xhr.responseText); + * } + * } + * xhr.send(''); + * }).then(function(str) { + * console.log(JSON.parse(str)['food']); + * }); + * + * @param {!(string|Function)} script The script to execute. + * @param {...*} var_args The arguments to pass to the script. + * @return {!webdriver.promise.Promise.} A promise that will resolve to the + * scripts return value. + * @template T + */ + executeAsyncScript(script: string | Function, ...var_args: any[]): webdriver.promise.Promise; + + /** + * Schedules a command to execute a custom function. + * @param {function(...): (T|webdriver.promise.Promise.)} fn The function to + * execute. + * @param {Object=} opt_scope The object in whose scope to execute the function. + * @param {...*} var_args Any arguments to pass to the function. + * @return {!webdriver.promise.Promise.} A promise that will be resolved' + * with the function's result. + * @template T + */ + call(fn: (...var_args: any[]) => (T | webdriver.promise.Promise), opt_scope?: any, ...var_args: any[]): webdriver.promise.Promise; + + /** + * Schedules a command to wait for a condition to hold. The condition may be + * specified by a {@link webdriver.until.Condition}, as a custom function, or + * as a {@link webdriver.promise.Promise}. + * + * For a {@link webdriver.until.Condition} or function, the wait will repeatedly + * evaluate the condition until it returns a truthy value. If any errors occur + * while evaluating the condition, they will be allowed to propagate. In the + * event a condition returns a {@link webdriver.promise.Promise promise}, the + * polling loop will wait for it to be resolved and use the resolved value for + * whether the condition has been satisified. Note the resolution time for + * a promise is factored into whether a wait has timed out. + * + * *Example:* waiting up to 10 seconds for an element to be present and visible + * on the page. + * + * var button = driver.wait(until.elementLocated(By.id('foo'), 10000); + * button.click(); + * + * This function may also be used to block the command flow on the resolution + * of a {@link webdriver.promise.Promise promise}. When given a promise, the + * command will simply wait for its resolution before completing. A timeout may + * be provided to fail the command if the promise does not resolve before the + * timeout expires. + * + * *Example:* Suppose you have a function, `startTestServer`, that returns a + * promise for when a server is ready for requests. You can block a `WebDriver` + * client on this promise with: + * + * var started = startTestServer(); + * driver.wait(started, 5 * 1000, 'Server should start within 5 seconds'); + * driver.get(getServerUrl()); + * + * @param {!(webdriver.promise.Promise| + * webdriver.until.Condition| + * function(!webdriver.WebDriver): T)} condition The condition to + * wait on, defined as a promise, condition object, or a function to + * evaluate as a condition. + * @param {number=} opt_timeout How long to wait for the condition to be true. + * @param {string=} opt_message An optional message to use if the wait times + * out. + * @return {!webdriver.promise.Promise} A promise that will be fulfilled + * with the first truthy value returned by the condition function, or + * rejected if the condition times out. + * @template T + */ + wait(condition: webdriver.promise.Promise | webdriver.until.Condition | ((driver: WebDriver) => T) | Function, timeout?: number, opt_message?: string): webdriver.promise.Promise; + + /** + * Schedules a command to make the driver sleep for the given amount of time. + * @param {number} ms The amount of time, in milliseconds, to sleep. + * @return {!webdriver.promise.Promise.} A promise that will be resolved + * when the sleep has finished. + */ + sleep(ms: number): webdriver.promise.Promise; + + /** + * Schedules a command to retrieve they current window handle. + * @return {!webdriver.promise.Promise.} A promise that will be + * resolved with the current window handle. + */ + getWindowHandle(): webdriver.promise.Promise; + + /** + * Schedules a command to retrieve the current list of available window handles. + * @return {!webdriver.promise.Promise.>} A promise that will + * be resolved with an array of window handles. + */ + getAllWindowHandles(): webdriver.promise.Promise; + + /** + * Schedules a command to retrieve the current page's source. The page source + * returned is a representation of the underlying DOM: do not expect it to be + * formatted or escaped in the same way as the response sent from the web + * server. + * @return {!webdriver.promise.Promise.} A promise that will be + * resolved with the current page source. + */ + getPageSource(): webdriver.promise.Promise; + + /** + * Schedules a command to close the current window. + * @return {!webdriver.promise.Promise.} A promise that will be resolved + * when this command has completed. + */ + close(): webdriver.promise.Promise; + + /** + * Schedules a command to navigate to the given URL. + * @param {string} url The fully qualified URL to open. + * @return {!webdriver.promise.Promise.} A promise that will be resolved + * when the document has finished loading. + */ + get(url: string): webdriver.promise.Promise; + + /** + * Schedules a command to retrieve the URL of the current page. + * @return {!webdriver.promise.Promise.} A promise that will be + * resolved with the current URL. + */ + getCurrentUrl(): webdriver.promise.Promise; + + /** + * Schedules a command to retrieve the current page's title. + * @return {!webdriver.promise.Promise.} A promise that will be + * resolved with the current page's title. + */ + getTitle(): webdriver.promise.Promise; + + /** + * Schedule a command to find an element on the page. If the element cannot be + * found, a {@link bot.ErrorCode.NO_SUCH_ELEMENT} result will be returned + * by the driver. Unlike other commands, this error cannot be suppressed. In + * other words, scheduling a command to find an element doubles as an assert + * that the element is present on the page. To test whether an element is + * present on the page, use {@link #isElementPresent} instead. + * + * The search criteria for an element may be defined using one of the + * factories in the {@link webdriver.By} namespace, or as a short-hand + * {@link webdriver.By.Hash} object. For example, the following two statements + * are equivalent: + * + * var e1 = driver.findElement(By.id('foo')); + * var e2 = driver.findElement({id:'foo'}); + * + * You may also provide a custom locator function, which takes as input this + * instance and returns a {@link WebElement}, or a promise that will resolve + * to a WebElement. If the returned promise resolves to an array of + * WebElements, WebDriver will use the first element. For example, to find the + * first visible link on a page, you could write: + * + * var link = driver.findElement(firstVisibleLink); + * + * function firstVisibleLink(driver) { + * var links = driver.findElements(By.tagName('a')); + * return promise.filter(links, function(link) { + * return link.isDisplayed(); + * }); + * } + * + * @param {!(by.By|Function)} locator The locator to use. + * @return {!WebElementPromise} A WebElement that can be used to issue + * commands against the located element. If the element is not found, the + * element will be invalidated and all scheduled commands aborted. + */ + findElement(locator: By | Function): WebElementPromise; + + /** + * Schedules a command to test if an element is present on the page. + * + * If given a DOM element, this function will check if it belongs to the + * document the driver is currently focused on. Otherwise, the function will + * test if at least one element can be found with the given search criteria. + * + * @param {!(by.By|Function)} locator The locator to use. + * @return {!promise.Promise} A promise that will resolve + * with whether the element is present on the page. + * @deprecated This method will be removed in Selenium 3.0 for consistency + * with the other Selenium language bindings. This method is equivalent + * to + * + * driver.findElements(locator).then(e => !!e.length); + */ + isElementPresent(locatorOrElement: By | Function): webdriver.promise.Promise; + + /** + * Schedule a command to search for multiple elements on the page. + * + * @param {!(by.By|Function)} locator The locator to use. + * @return {!promise.Promise.>} A + * promise that will resolve to an array of WebElements. + */ + findElements(locator: By | Function): webdriver.promise.Promise; + + /** + * Schedule a command to take a screenshot. The driver makes a best effort to + * return a screenshot of the following, in order of preference: + * + * 1. Entire page + * 2. Current window + * 3. Visible portion of the current frame + * 4. The entire display containing the browser + * + * @return {!promise.Promise} A promise that will be + * resolved to the screenshot as a base-64 encoded PNG. + */ + takeScreenshot(): webdriver.promise.Promise; + + /** + * @return {!webdriver.WebDriver.Options} The options interface for this + * instance. + */ + manage(): webdriver.Options; + + /** + * @return {!webdriver.WebDriver.Navigation} The navigation interface for this + * instance. + */ + navigate(): Navigation; + + /** + * @return {!webdriver.WebDriver.TargetLocator} The target locator interface for + * this instance. + */ + switchTo(): webdriver.TargetLocator; + + //endregion + } + + interface IWebElementId { + [ELEMENT: string]: string; + } + + /** + * Represents a DOM element. WebElements can be found by searching from the + * document root using a {@code webdriver.WebDriver} instance, or by searching + * under another {@code webdriver.WebElement}: + *

    
    +   *   driver.get('http://www.google.com');
    +   *   var searchForm = driver.findElement(By.tagName('form'));
    +   *   var searchBox = searchForm.findElement(By.name('q'));
    +   *   searchBox.sendKeys('webdriver');
    +   * 
    + * + * The WebElement is implemented as a promise for compatibility with the promise + * API. It will always resolve itself when its internal state has been fully + * resolved and commands may be issued against the element. This can be used to + * catch errors when an element cannot be located on the page: + *
    
    +   *   driver.findElement(By.id('not-there')).then(function(element) {
    +   *     alert('Found an element that was not expected to be there!');
    +   *   }, function(error) {
    +   *     alert('The element was not found, as expected');
    +   *   });
    +   * 
    + */ + interface IWebElement { + //region Methods + + /** + * Schedules a command to click on this element. + * @return {!webdriver.promise.Promise} A promise that will be resolved when + * the click command has completed. + */ + click(): webdriver.promise.Promise; + + /** + * Schedules a command to type a sequence on the DOM element represented by + * this instance. + * + * Modifier keys (SHIFT, CONTROL, ALT, META) are stateful; once a modifier is + * processed in the key sequence, that key state is toggled until one of the + * following occurs: + * + * - The modifier key is encountered again in the sequence. At this point the + * state of the key is toggled (along with the appropriate keyup/down + * events). + * - The {@link input.Key.NULL} key is encountered in the sequence. When + * this key is encountered, all modifier keys current in the down state are + * released (with accompanying keyup events). The NULL key can be used to + * simulate common keyboard shortcuts: + * + * element.sendKeys('text was', + * Key.CONTROL, 'a', Key.NULL, + * 'now text is'); + * // Alternatively: + * element.sendKeys('text was', + * Key.chord(Key.CONTROL, 'a'), + * 'now text is'); + * + * - The end of the key sequence is encountered. When there are no more keys + * to type, all depressed modifier keys are released (with accompanying + * keyup events). + * + * If this element is a file input ({@code }), the + * specified key sequence should specify the path to the file to attach to + * the element. This is analogous to the user clicking 'Browse...' and entering + * the path into the file select dialog. + * + * var form = driver.findElement(By.css('form')); + * var element = form.findElement(By.css('input[type=file]')); + * element.sendKeys('/path/to/file.txt'); + * form.submit(); + * + * For uploads to function correctly, the entered path must reference a file + * on the _browser's_ machine, not the local machine running this script. When + * running against a remote Selenium server, a {@link input.FileDetector} + * may be used to transparently copy files to the remote machine before + * attempting to upload them in the browser. + * + * __Note:__ On browsers where native keyboard events are not supported + * (e.g. Firefox on OS X), key events will be synthesized. Special + * punctuation keys will be synthesized according to a standard QWERTY en-us + * keyboard layout. + * + * @param {...(number|string|!IThenable<(number|string)>)} var_args The + * sequence of keys to type. Number keys may be referenced numerically or + * by string (1 or '1'). All arguments will be joined into a single + * sequence. + * @return {!webdriver.promise.Promise} A promise that will be resolved when all + * keys have been typed. + */ + sendKeys(...var_args: Array>): webdriver.promise.Promise; + + /** + * Schedules a command to query for the tag/node name of this element. + * @return {!webdriver.promise.Promise} A promise that will be resolved with the + * element's tag name. + */ + getTagName(): webdriver.promise.Promise; + + /** + * Schedules a command to query for the computed style of the element + * represented by this instance. If the element inherits the named style from + * its parent, the parent will be queried for its value. Where possible, color + * values will be converted to their hex representation (e.g. #00ff00 instead of + * rgb(0, 255, 0)). + *

    + * Warning: the value returned will be as the browser interprets it, so + * it may be tricky to form a proper assertion. + * + * @param {string} cssStyleProperty The name of the CSS style property to look + * up. + * @return {!webdriver.promise.Promise} A promise that will be resolved with the + * requested CSS value. + */ + getCssValue(cssStyleProperty: string): webdriver.promise.Promise; + + /** + * Schedules a command to query for the value of the given attribute of the + * element. Will return the current value even if it has been modified after the + * page has been loaded. More exactly, this method will return the value of the + * given attribute, unless that attribute is not present, in which case the + * value of the property with the same name is returned. If neither value is + * set, null is returned. The 'style' attribute is converted as best can be to a + * text representation with a trailing semi-colon. The following are deemed to + * be 'boolean' attributes and will be returned as thus: + * + *

    async, autofocus, autoplay, checked, compact, complete, controls, declare, + * defaultchecked, defaultselected, defer, disabled, draggable, ended, + * formnovalidate, hidden, indeterminate, iscontenteditable, ismap, itemscope, + * loop, multiple, muted, nohref, noresize, noshade, novalidate, nowrap, open, + * paused, pubdate, readonly, required, reversed, scoped, seamless, seeking, + * selected, spellcheck, truespeed, willvalidate + * + *

    Finally, the following commonly mis-capitalized attribute/property names + * are evaluated as expected: + *

      + *
    • 'class' + *
    • 'readonly' + *
    + * @param {string} attributeName The name of the attribute to query. + * @return {!webdriver.promise.Promise} A promise that will be resolved with the + * attribute's value. + */ + getAttribute(attributeName: string): webdriver.promise.Promise; + + /** + * Get the visible (i.e. not hidden by CSS) innerText of this element, including + * sub-elements, without any leading or trailing whitespace. + * @return {!webdriver.promise.Promise} A promise that will be resolved with the + * element's visible text. + */ + getText(): webdriver.promise.Promise; + + /** + * Schedules a command to compute the size of this element's bounding box, in + * pixels. + * @return {!webdriver.promise.Promise} A promise that will be resolved with the + * element's size as a {@code {width:number, height:number}} object. + */ + getSize(): webdriver.promise.Promise; + + /** + * Schedules a command to compute the location of this element in page space. + * @return {!webdriver.promise.Promise} A promise that will be resolved to the + * element's location as a {@code {x:number, y:number}} object. + */ + getLocation(): webdriver.promise.Promise; + + /** + * Schedules a command to query whether the DOM element represented by this + * instance is enabled, as dicted by the {@code disabled} attribute. + * @return {!webdriver.promise.Promise} A promise that will be resolved with + * whether this element is currently enabled. + */ + isEnabled(): webdriver.promise.Promise; + + /** + * Schedules a command to query whether this element is selected. + * @return {!webdriver.promise.Promise} A promise that will be resolved with + * whether this element is currently selected. + */ + isSelected(): webdriver.promise.Promise; + + /** + * Schedules a command to submit the form containing this element (or this + * element if it is a FORM element). This command is a no-op if the element is + * not contained in a form. + * @return {!webdriver.promise.Promise} A promise that will be resolved when + * the form has been submitted. + */ + submit(): webdriver.promise.Promise; + + /** + * Schedules a command to clear the {@code value} of this element. This command + * has no effect if the underlying DOM element is neither a text INPUT element + * nor a TEXTAREA element. + * @return {!webdriver.promise.Promise} A promise that will be resolved when + * the element has been cleared. + */ + clear(): webdriver.promise.Promise; + + /** + * Schedules a command to test whether this element is currently displayed. + * @return {!webdriver.promise.Promise} A promise that will be resolved with + * whether this element is currently visible on the page. + */ + isDisplayed(): webdriver.promise.Promise; + + /** + * Schedules a command to retrieve the outer HTML of this element. + * @return {!webdriver.promise.Promise} A promise that will be resolved with + * the element's outer HTML. + */ + getOuterHtml(): webdriver.promise.Promise; + + /** + * @return {!webdriver.promise.Promise.} A promise + * that resolves to this element's JSON representation as defined by the + * WebDriver wire protocol. + * @see http://code.google.com/p/selenium/wiki/JsonWireProtocol + */ + getId(): webdriver.promise.Promise; + + /** + * Schedules a command to retrieve the inner HTML of this element. + * @return {!webdriver.promise.Promise} A promise that will be resolved with the + * element's inner HTML. + */ + getInnerHtml(): webdriver.promise.Promise; + + //endregion + } + + interface IWebElementFinders { + /** + * Schedule a command to find a descendant of this element. If the element + * cannot be found, a {@code bot.ErrorCode.NO_SUCH_ELEMENT} result will + * be returned by the driver. Unlike other commands, this error cannot be + * suppressed. In other words, scheduling a command to find an element doubles + * as an assert that the element is present on the page. To test whether an + * element is present on the page, use {@code #isElementPresent} instead. + * + *

    The search criteria for an element may be defined using one of the + * factories in the {@link webdriver.By} namespace, or as a short-hand + * {@link webdriver.By.Hash} object. For example, the following two statements + * are equivalent: + *

    +     * var e1 = element.findElement(By.id('foo'));
    +     * var e2 = element.findElement({id:'foo'});
    +     * 
    + * + *

    You may also provide a custom locator function, which takes as input + * this WebDriver instance and returns a {@link webdriver.WebElement}, or a + * promise that will resolve to a WebElement. For example, to find the first + * visible link on a page, you could write: + *

    +     * var link = element.findElement(firstVisibleLink);
    +     *
    +     * function firstVisibleLink(element) {
    +     *   var links = element.findElements(By.tagName('a'));
    +     *   return webdriver.promise.filter(links, function(link) {
    +     *     return links.isDisplayed();
    +     *   }).then(function(visibleLinks) {
    +     *     return visibleLinks[0];
    +     *   });
    +     * }
    +     * 
    + * + * @param {!(webdriver.Locator|webdriver.By.Hash|Function)} locator The + * locator strategy to use when searching for the element. + * @return {!webdriver.WebElement} A WebElement that can be used to issue + * commands against the located element. If the element is not found, the + * element will be invalidated and all scheduled commands aborted. + */ + findElement(locator: By | Function): WebElementPromise; + + /** + * Schedules a command to test if there is at least one descendant of this + * element that matches the given search criteria. + * + * @param {!(webdriver.Locator|webdriver.By.Hash|Function)} locator The + * locator strategy to use when searching for the element. + * @return {!webdriver.promise.Promise.} A promise that will be + * resolved with whether an element could be located on the page. + */ + isElementPresent(locator: By | Function): webdriver.promise.Promise; + + /** + * Schedules a command to find all of the descendants of this element that + * match the given search criteria. + * + * @param {!(webdriver.Locator|webdriver.By.Hash|Function)} locator The + * locator strategy to use when searching for the elements. + * @return {!webdriver.promise.Promise.>} A + * promise that will resolve to an array of WebElements. + */ + findElements(locator: By | Function): webdriver.promise.Promise; + } + + /** + * Defines an object that can be asynchronously serialized to its WebDriver + * wire representation. + * + * @constructor + * @template T + */ + interface Serializable { + /** + * Returns either this instance's serialized represention, if immediately + * available, or a promise for its serialized representation. This function is + * conceptually equivalent to objects that have a {@code toJSON()} property, + * except the serialize() result may be a promise or an object containing a + * promise (which are not directly JSON friendly). + * + * @return {!(T|IThenable.)} This instance's serialized wire format. + */ + serialize(): T | webdriver.promise.IThenable; + } + + /** + * Represents a DOM element. WebElements can be found by searching from the + * document root using a {@link webdriver.WebDriver} instance, or by searching + * under another WebElement: + * + * driver.get('http://www.google.com'); + * var searchForm = driver.findElement(By.tagName('form')); + * var searchBox = searchForm.findElement(By.name('q')); + * searchBox.sendKeys('webdriver'); + * + * The WebElement is implemented as a promise for compatibility with the promise + * API. It will always resolve itself when its internal state has been fully + * resolved and commands may be issued against the element. This can be used to + * catch errors when an element cannot be located on the page: + * + * driver.findElement(By.id('not-there')).then(function(element) { + * alert('Found an element that was not expected to be there!'); + * }, function(error) { + * alert('The element was not found, as expected'); + * }); + * + * @extends {webdriver.Serializable.} + */ + class WebElement implements Serializable { + /** + * @param {!WebDriver} driver the parent WebDriver instance for this element. + * @param {(!IThenable|string)} id The server-assigned opaque ID for + * the underlying DOM element. + */ + constructor(driver: webdriver.WebDriver, id: webdriver.promise.Promise | string); + + /** + * @param {string} id The raw ID. + * @param {boolean=} opt_noLegacy Whether to exclude the legacy element key. + * @return {!Object} The element ID for use with WebDriver's wire protocol. + */ + static buildId(id: string, opt_noLegacy?: boolean): Object; + + /** + * Extracts the encoded WebElement ID from the object. + * + * @param {?} obj The object to extract the ID from. + * @return {string} the extracted ID. + * @throws {TypeError} if the object is not a valid encoded ID. + */ + static extractId(obj: IWebElementId): string; + + /** + * @param {?} obj the object to test. + * @return {boolean} whether the object is a valid encoded WebElement ID. + */ + static isId(obj: IWebElementId): boolean; + + /** + * Compares two WebElements for equality. + * + * @param {!WebElement} a A WebElement. + * @param {!WebElement} b A WebElement. + * @return {!promise.Promise} A promise that will be + * resolved to whether the two WebElements are equal. + */ + static equals(a: WebElement, b: WebElement): webdriver.promise.Promise; + + /** + * @return {!webdriver.WebDriver} The parent driver for this instance. + */ + getDriver(): webdriver.WebDriver; + + /** + * @return {!promise.Promise} A promise that resolves to + * the server-assigned opaque ID assigned to this element. + */ + getId(): webdriver.promise.Promise; + + /** + * @deprecated Use {@link #getId()} instead. + */ + getRawId(): any; + + /** + * Schedule a command to find a descendant of this element. If the element + * cannot be found, a {@link bot.ErrorCode.NO_SUCH_ELEMENT} result will + * be returned by the driver. Unlike other commands, this error cannot be + * suppressed. In other words, scheduling a command to find an element doubles + * as an assert that the element is present on the page. To test whether an + * element is present on the page, use {@link #isElementPresent} instead. + * + * The search criteria for an element may be defined using one of the + * factories in the {@link webdriver.By} namespace, or as a short-hand + * {@link webdriver.By.Hash} object. For example, the following two statements + * are equivalent: + * + * var e1 = element.findElement(By.id('foo')); + * var e2 = element.findElement({id:'foo'}); + * + * You may also provide a custom locator function, which takes as input + * this WebDriver instance and returns a {@link webdriver.WebElement}, or a + * promise that will resolve to a WebElement. For example, to find the first + * visible link on a page, you could write: + * + * var link = element.findElement(firstVisibleLink); + * + * function firstVisibleLink(element) { + * var links = element.findElements(By.tagName('a')); + * return webdriver.promise.filter(links, function(link) { + * return links.isDisplayed(); + * }).then(function(visibleLinks) { + * return visibleLinks[0]; + * }); + * } + * + * @param {!(by.By|Function)} locator The locator strategy to use when + * searching for the element. + * @return {!WebElementPromise} A WebElement that can be used to issue + * commands against the located element. If the element is not found, the + * element will be invalidated and all scheduled commands aborted. + */ + findElement(locator: By | Function): WebElementPromise; + + /** + * Schedules a command to test if there is at least one descendant of this + * element that matches the given search criteria. + * + * @param {!(by.By|Function)} locator The locator strategy to use when + * searching for the element. + * @return {!promise.Promise} A promise that will be + * resolved with whether an element could be located on the page. + * @deprecated This method will be removed in Selenium 3.0 for consistency + * with the other Selenium language bindings. This method is equivalent + * to + * + * element.findElements(locator).then(e => !!e.length); + */ + isElementPresent(locator: By | Function): webdriver.promise.Promise; + + /** + * Schedules a command to find all of the descendants of this element that + * match the given search criteria. + * + * @param {!(by.By|Function)} locator The locator strategy to use when + * searching for the element. + * @return {!promise.Promise>} A + * promise that will resolve to an array of WebElements. + */ + findElements(locator: By | Function): webdriver.promise.Promise; + + /** + * Schedules a command to click on this element. + * @return {!webdriver.promise.Promise.} A promise that will be resolved + * when the click command has completed. + */ + click(): webdriver.promise.Promise; + + /** + * Schedules a command to type a sequence on the DOM element represented by this + * promsieinstance. + * + * Modifier keys (SHIFT, CONTROL, ALT, META) are stateful; once a modifier is + * processed in the keysequence, that key state is toggled until one of the + * following occurs: + * + * - The modifier key is encountered again in the sequence. At this point the + * state of the key is toggled (along with the appropriate keyup/down events). + * - The {@link webdriver.Key.NULL} key is encountered in the sequence. When + * this key is encountered, all modifier keys current in the down state are + * released (with accompanying keyup events). The NULL key can be used to + * simulate common keyboard shortcuts: + * + * element.sendKeys('text was', + * webdriver.Key.CONTROL, 'a', webdriver.Key.NULL, + * 'now text is'); + * // Alternatively: + * element.sendKeys('text was', + * webdriver.Key.chord(webdriver.Key.CONTROL, 'a'), + * 'now text is'); + * + * - The end of the keysequence is encountered. When there are no more keys + * to type, all depressed modifier keys are released (with accompanying keyup + * events). + * + * If this element is a file input ({@code }), the + * specified key sequence should specify the path to the file to attach to + * the element. This is analgous to the user clicking 'Browse...' and entering + * the path into the file select dialog. + * + * var form = driver.findElement(By.css('form')); + * var element = form.findElement(By.css('input[type=file]')); + * element.sendKeys('/path/to/file.txt'); + * form.submit(); + * + * For uploads to function correctly, the entered path must reference a file + * on the _browser's_ machine, not the local machine running this script. When + * running against a remote Selenium server, a {@link webdriver.FileDetector} + * may be used to transparently copy files to the remote machine before + * attempting to upload them in the browser. + * + * __Note:__ On browsers where native keyboard events are not supported + * (e.g. Firefox on OS X), key events will be synthesized. Special + * punctionation keys will be synthesized according to a standard QWERTY en-us + * keyboard layout. + * + * @param {...(string|!webdriver.promise.Promise)} var_args The sequence + * of keys to type. All arguments will be joined into a single sequence. + * @return {!webdriver.promise.Promise.} A promise that will be resolved + * when all keys have been typed. + */ + sendKeys(...var_args: Array>): webdriver.promise.Promise; + + /** + * Schedules a command to query for the tag/node name of this element. + * @return {!webdriver.promise.Promise.} A promise that will be + * resolved with the element's tag name. + */ + getTagName(): webdriver.promise.Promise; + + /** + * Schedules a command to query for the computed style of the element + * represented by this instance. If the element inherits the named style from + * its parent, the parent will be queried for its value. Where possible, color + * values will be converted to their hex representation (e.g. #00ff00 instead of + * rgb(0, 255, 0)). + * + * _Warning:_ the value returned will be as the browser interprets it, so + * it may be tricky to form a proper assertion. + * + * @param {string} cssStyleProperty The name of the CSS style property to look + * up. + * @return {!promise.Promise} A promise that will be + * resolved with the requested CSS value. + */ + getCssValue(cssStyleProperty: string): webdriver.promise.Promise; + + /** + * Schedules a command to query for the value of the given attribute of the + * element. Will return the current value, even if it has been modified after + * the page has been loaded. More exactly, this method will return the value of + * the given attribute, unless that attribute is not present, in which case the + * value of the property with the same name is returned. If neither value is + * set, null is returned (for example, the 'value' property of a textarea + * element). The 'style' attribute is converted as best can be to a + * text representation with a trailing semi-colon. The following are deemed to + * be 'boolean' attributes and will return either 'true' or null: + * + * async, autofocus, autoplay, checked, compact, complete, controls, declare, + * defaultchecked, defaultselected, defer, disabled, draggable, ended, + * formnovalidate, hidden, indeterminate, iscontenteditable, ismap, itemscope, + * loop, multiple, muted, nohref, noresize, noshade, novalidate, nowrap, open, + * paused, pubdate, readonly, required, reversed, scoped, seamless, seeking, + * selected, spellcheck, truespeed, willvalidate + * + * Finally, the following commonly mis-capitalized attribute/property names + * are evaluated as expected: + * + * - 'class' + * - 'readonly' + * + * @param {string} attributeName The name of the attribute to query. + * @return {!webdriver.promise.Promise.} A promise that will be + * resolved with the attribute's value. The returned value will always be + * either a string or null. + */ + getAttribute(attributeName: string): webdriver.promise.Promise; + + /** + * Get the visible (i.e. not hidden by CSS) innerText of this element, including + * sub-elements, without any leading or trailing whitespace. + * @return {!webdriver.promise.Promise.} A promise that will be + * resolved with the element's visible text. + */ + getText(): webdriver.promise.Promise; + + /** + * Schedules a command to compute the size of this element's bounding box, in + * pixels. + * @return {!webdriver.promise.Promise.<{width: number, height: number}>} A + * promise that will be resolved with the element's size as a + * {@code {width:number, height:number}} object. + */ + getSize(): webdriver.promise.Promise; + + /** + * Schedules a command to compute the location of this element in page space. + * @return {!webdriver.promise.Promise.<{x: number, y: number}>} A promise that + * will be resolved to the element's location as a + * {@code {x:number, y:number}} object. + */ + getLocation(): webdriver.promise.Promise; + + /** + * Schedules a command to query whether the DOM element represented by this + * instance is enabled, as dicted by the {@code disabled} attribute. + * @return {!webdriver.promise.Promise.} A promise that will be + * resolved with whether this element is currently enabled. + */ + isEnabled(): webdriver.promise.Promise; + + /** + * Schedules a command to query whether this element is selected. + * @return {!webdriver.promise.Promise.} A promise that will be + * resolved with whether this element is currently selected. + */ + isSelected(): webdriver.promise.Promise; + + /** + * Schedules a command to submit the form containing this element (or this + * element if it is a FORM element). This command is a no-op if the element is + * not contained in a form. + * @return {!webdriver.promise.Promise.} A promise that will be resolved + * when the form has been submitted. + */ + submit(): webdriver.promise.Promise; + + /** + * Schedules a command to clear the `value` of this element. This command has + * no effect if the underlying DOM element is neither a text INPUT element + * nor a TEXTAREA element. + * @return {!promise.Promise} A promise that will be resolved + * when the element has been cleared. + */ + clear(): webdriver.promise.Promise; + + /** + * Schedules a command to test whether this element is currently displayed. + * @return {!webdriver.promise.Promise.} A promise that will be + * resolved with whether this element is currently visible on the page. + */ + isDisplayed(): webdriver.promise.Promise; + + /** + * Take a screenshot of the visible region encompassed by this element's + * bounding rectangle. + * + * @param {boolean=} opt_scroll Optional argument that indicates whether the + * element should be scrolled into view before taking a screenshot. + * Defaults to false. + * @return {!promise.Promise} A promise that will be + * resolved to the screenshot as a base-64 encoded PNG. + */ + takeScreenshot(opt_scroll?: boolean): webdriver.promise.Promise; + + /** + * Schedules a command to retrieve the outer HTML of this element. + * @return {!webdriver.promise.Promise.} A promise that will be + * resolved with the element's outer HTML. + */ + getOuterHtml(): webdriver.promise.Promise; + + /** + * Schedules a command to retrieve the inner HTML of this element. + * @return {!webdriver.promise.Promise} A promise that will be resolved with the + * element's inner HTML. + */ + getInnerHtml(): webdriver.promise.Promise; + + /** @override */ + serialize(): webdriver.promise.Promise; + } + + /** + * WebElementPromise is a promise that will be fulfilled with a WebElement. + * This serves as a forward proxy on WebElement, allowing calls to be + * scheduled without directly on this instance before the underlying + * WebElement has been fulfilled. In other words, the following two statements + * are equivalent: + *
    
    +   *     driver.findElement({id: 'my-button'}).click();
    +   *     driver.findElement({id: 'my-button'}).then(function(el) {
    +   *       return el.click();
    +   *     });
    +   * 
    + * + * @param {!webdriver.WebDriver} driver The parent WebDriver instance for this + * element. + * @param {!webdriver.promise.Promise.} el A promise + * that will resolve to the promised element. + * @constructor + * @extends {webdriver.WebElement} + * @implements {webdriver.promise.Thenable.} + * @final + */ + class WebElementPromise extends WebElement implements webdriver.promise.IThenable { + /** + * @param {!WebDriver} driver The parent WebDriver instance for this + * element. + * @param {!promise.Promise} el A promise + * that will resolve to the promised element. + */ + constructor(driver: webdriver.WebDriver, el: webdriver.promise.Promise); + + /** + * Cancels the computation of this promise's value, rejecting the promise in the + * process. This method is a no-op if the promise has alreayd been resolved. + * + * @param {string=} opt_reason The reason this promise is being cancelled. + */ + cancel(opt_reason?: string): void; + + + /** @return {boolean} Whether this promise's value is still being computed. */ + isPending(): boolean; + + + /** + * Registers listeners for when this instance is resolved. + * + * @param opt_callback The + * function to call if this promise is successfully resolved. The function + * should expect a single argument: the promise's resolved value. + * @param opt_errback The + * function to call if this promise is rejected. The function should expect + * a single argument: the rejection reason. + * @return A new promise which will be + * resolved with the result of the invoked callback. + */ + then(opt_callback?: (value: WebElement) => webdriver.promise.Promise, opt_errback?: (error: any) => any): webdriver.promise.Promise; + + /** + * Registers listeners for when this instance is resolved. + * + * @param opt_callback The + * function to call if this promise is successfully resolved. The function + * should expect a single argument: the promise's resolved value. + * @param opt_errback The + * function to call if this promise is rejected. The function should expect + * a single argument: the rejection reason. + * @return A new promise which will be + * resolved with the result of the invoked callback. + */ + then(opt_callback?: (value: WebElement) => R, opt_errback?: (error: any) => any): webdriver.promise.Promise; + + + /** + * Registers a listener for when this promise is rejected. This is synonymous + * with the {@code catch} clause in a synchronous API: + *
    
    +     *   // Synchronous API:
    +     *   try {
    +     *     doSynchronousWork();
    +     *   } catch (ex) {
    +     *     console.error(ex);
    +     *   }
    +     *
    +     *   // Asynchronous promise API:
    +     *   doAsynchronousWork().thenCatch(function(ex) {
    +     *     console.error(ex);
    +     *   });
    +     * 
    + * + * @param {function(*): (R|webdriver.promise.Promise.)} errback The function + * to call if this promise is rejected. The function should expect a single + * argument: the rejection reason. + * @return {!webdriver.promise.Promise.} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + thenCatch(errback: (error: any) => any): webdriver.promise.Promise; + + + /** + * Registers a listener to invoke when this promise is resolved, regardless + * of whether the promise's value was successfully computed. This function + * is synonymous with the {@code finally} clause in a synchronous API: + *
    
    +     *   // Synchronous API:
    +     *   try {
    +     *     doSynchronousWork();
    +     *   } finally {
    +     *     cleanUp();
    +     *   }
    +     *
    +     *   // Asynchronous promise API:
    +     *   doAsynchronousWork().thenFinally(cleanUp);
    +     * 
    + * + * Note: similar to the {@code finally} clause, if the registered + * callback returns a rejected promise or throws an error, it will silently + * replace the rejection error (if any) from this promise: + *
    
    +     *   try {
    +     *     throw Error('one');
    +     *   } finally {
    +     *     throw Error('two');  // Hides Error: one
    +     *   }
    +     *
    +     *   webdriver.promise.rejected(Error('one'))
    +     *       .thenFinally(function() {
    +     *         throw Error('two');  // Hides Error: one
    +     *       });
    +     * 
    + * + * + * @param {function(): (R|webdriver.promise.Promise.)} callback The function + * to call when this promise is resolved. + * @return {!webdriver.promise.Promise.} A promise that will be fulfilled + * with the callback result. + * @template R + */ + thenFinally(callback: () => any): webdriver.promise.Promise; + + /** + * Registers a listener for when this promise is rejected. This is synonymous + * with the {@code catch} clause in a synchronous API: + * + * // Synchronous API: + * try { + * doSynchronousWork(); + * } catch (ex) { + * console.error(ex); + * } + * + * // Asynchronous promise API: + * doAsynchronousWork().catch(function(ex) { + * console.error(ex); + * }); + * + * @param {function(*): (R|IThenable)} errback The + * function to call if this promise is rejected. The function should + * expect a single argument: the rejection reason. + * @return {!ManagedPromise} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + catch(errback: Function): webdriver.promise.Promise; + } + + /** + * Contains information about a WebDriver session. + */ + class Session { + + //region Constructors + + /** + * @param {string} id The session ID. + * @param {!(Object|webdriver.Capabilities)} capabilities The session + * capabilities. + * @constructor + */ + constructor(id: string, capabilities: Capabilities | Object); + + //endregion + + //region Methods + + /** + * @return {string} This session's ID. + */ + getId(): string; + + /** + * @return {!webdriver.Capabilities} This session's capabilities. + */ + getCapabilities(): webdriver.Capabilities; + + /** + * Retrieves the value of a specific capability. + * @param {string} key The capability to retrieve. + * @return {*} The capability value. + */ + getCapability(key: string): any; + + /** + * Returns the JSON representation of this object, which is just the string + * session ID. + * @return {string} The JSON representation of this Session. + */ + toJSON(): string; + + //endregion + } +} + +export = webdriver; diff --git a/selenium-webdriver/v2/opera.d.ts b/selenium-webdriver/v2/opera.d.ts new file mode 100644 index 0000000000..0d3aee1a13 --- /dev/null +++ b/selenium-webdriver/v2/opera.d.ts @@ -0,0 +1,177 @@ +import * as webdriver from './index'; +import * as remote from './remote'; + +declare namespace opera { + /** + * Creates {@link remote.DriverService} instances that manages an + * [OperaDriver](https://github.com/operasoftware/operachromiumdriver) + * server in a child process. + */ + class ServiceBuilder { + /** + * @param {string=} opt_exe Path to the server executable to use. If omitted, + * the builder will attempt to locate the operadriver on the current + * PATH. + * @throws {Error} If provided executable does not exist, or the operadriver + * cannot be found on the PATH. + */ + constructor(opt_exe?: string); + + /** + * Sets the port to start the OperaDriver on. + * @param {number} port The port to use, or 0 for any free port. + * @return {!ServiceBuilder} A self reference. + * @throws {Error} If the port is invalid. + */ + usingPort(port: number): ServiceBuilder; + + /** + * Sets the path of the log file the driver should log to. If a log file is + * not specified, the driver will log to stderr. + * @param {string} path Path of the log file to use. + * @return {!ServiceBuilder} A self reference. + */ + loggingTo(path: string): ServiceBuilder; + + /** + * Enables verbose logging. + * @return {!ServiceBuilder} A self reference. + */ + enableVerboseLogging(): ServiceBuilder; + + /** + * Silence sthe drivers output. + * @return {!ServiceBuilder} A self reference. + */ + silent(): ServiceBuilder; + + /** + * Defines the stdio configuration for the driver service. See + * {@code child_process.spawn} for more information. + * @param {(string|!Array)} + * config The configuration to use. + * @return {!ServiceBuilder} A self reference. + */ + setStdio(config: string | Array): ServiceBuilder; + + /** + * Defines the environment to start the server under. This settings will be + * inherited by every browser session started by the server. + * @param {!Object.} env The environment to use. + * @return {!ServiceBuilder} A self reference. + */ + withEnvironment(env: Object): ServiceBuilder; + + /** + * Creates a new DriverService using this instance's current configuration. + * @return {!remote.DriverService} A new driver service using this instance's + * current configuration. + * @throws {Error} If the driver exectuable was not specified and a default + * could not be found on the current PATH. + */ + build(): remote.DriverService; + } + + /** + * Sets the default service to use for new OperaDriver instances. + * @param {!remote.DriverService} service The service to use. + * @throws {Error} If the default service is currently running. + */ + function setDefaultService(service: remote.DriverService): any; + + /** + * Returns the default OperaDriver service. If such a service has not been + * configured, one will be constructed using the default configuration for + * a OperaDriver executable found on the system PATH. + * @return {!remote.DriverService} The default OperaDriver service. + */ + function getDefaultService(): remote.DriverService; + + /** + * Class for managing {@linkplain Driver OperaDriver} specific options. + */ + class Options { + /** + * Extracts the OperaDriver specific options from the given capabilities + * object. + * @param {!capabilities.Capabilities} caps The capabilities object. + * @return {!Options} The OperaDriver options. + */ + static fromCapabilities(caps: webdriver.Capabilities): Options; + + /** + * Add additional command line arguments to use when launching the Opera + * browser. Each argument may be specified with or without the '--' prefix + * (e.g. '--foo' and 'foo'). Arguments with an associated value should be + * delimited by an '=': 'foo=bar'. + * @param {...(string|!Array.)} var_args The arguments to add. + * @return {!Options} A self reference. + */ + addArguments(...var_args: Array): Options; + + /** + * Add additional extensions to install when launching Opera. Each extension + * should be specified as the path to the packed CRX file, or a Buffer for an + * extension. + * @param {...(string|!Buffer|!Array.<(string|!Buffer)>)} var_args The + * extensions to add. + * @return {!Options} A self reference. + */ + addExtensions(...var_args: Array): Options; + + /** + * Sets the path to the Opera binary to use. On Mac OS X, this path should + * reference the actual Opera executable, not just the application binary. The + * binary path be absolute or relative to the operadriver server executable, but + * it must exist on the machine that will launch Opera. + * + * @param {string} path The path to the Opera binary to use. + * @return {!Options} A self reference. + */ + setOperaBinaryPath(path: string): Options; + + /** + * Sets the logging preferences for the new session. + * @param {!./lib/logging.Preferences} prefs The logging preferences. + * @return {!Options} A self reference. + */ + setLoggingPrefs(prefs: webdriver.logging.Preferences): Options; + + /** + * Sets the proxy settings for the new session. + * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. + * @return {!Options} A self reference. + */ + setProxy(proxy: webdriver.ProxyConfig): Options; + + /** + * Converts this options instance to a {@link capabilities.Capabilities} + * object. + * @param {capabilities.Capabilities=} opt_capabilities The capabilities to + * merge these options into, if any. + * @return {!capabilities.Capabilities} The capabilities. + */ + toCapabilities(opt_capabilities?: webdriver.Capabilities): webdriver.Capabilities; + } + + class Driver extends webdriver.WebDriver { + /** + * @param {(capabilities.Capabilities|Options)=} opt_config The configuration + * options. + * @param {remote.DriverService=} opt_service The session to use; will use + * the {@link getDefaultService default service} by default. + * @param {promise.ControlFlow=} opt_flow The control flow to use, + * or {@code null} to use the currently active flow. + */ + constructor(opt_config?: webdriver.Capabilities | Options, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow); + + /** + * This function is a no-op as file detectors are not supported by this + * implementation. + * @override + */ + setFileDetector(): void; + } +} + +export = opera; diff --git a/selenium-webdriver/v2/remote.d.ts b/selenium-webdriver/v2/remote.d.ts new file mode 100644 index 0000000000..d3cadb746a --- /dev/null +++ b/selenium-webdriver/v2/remote.d.ts @@ -0,0 +1,71 @@ +import * as webdriver from './index'; + +declare namespace remote { + /** + * A record object that defines the configuration options for a DriverService + * instance. + * + * @record + */ + interface ServiceOptions { } + + /** + * Manages the life and death of a native executable WebDriver server. + * + * It is expected that the driver server implements the + * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol. + * Furthermore, the managed server should support multiple concurrent sessions, + * so that this class may be reused for multiple clients. + */ + class DriverService { + /** + * @param {string} executable Path to the executable to run. + * @param {!ServiceOptions} options Configuration options for the service. + */ + constructor(executable: string, options: ServiceOptions); + + /** + * @return {!promise.Promise} A promise that resolves to + * the server's address. + * @throws {Error} If the server has not been started. + */ + address(): webdriver.promise.Promise; + + /** + * Returns whether the underlying process is still running. This does not take + * into account whether the process is in the process of shutting down. + * @return {boolean} Whether the underlying service process is running. + */ + isRunning(): boolean; + + /** + * Starts the server if it is not already running. + * @param {number=} opt_timeoutMs How long to wait, in milliseconds, for the + * server to start accepting requests. Defaults to 30 seconds. + * @return {!promise.Promise} A promise that will resolve + * to the server's base URL when it has started accepting requests. If the + * timeout expires before the server has started, the promise will be + * rejected. + */ + start(opt_timeoutMs?: number): webdriver.promise.Promise; + + /** + * Stops the service if it is not currently running. This function will kill + * the server immediately. To synchronize with the active control flow, use + * {@link #stop()}. + * @return {!promise.Promise} A promise that will be resolved when + * the server has been stopped. + */ + kill(): webdriver.promise.Promise; + + /** + * Schedules a task in the current control flow to stop the server if it is + * currently running. + * @return {!promise.Promise} A promise that will be resolved when + * the server has been stopped. + */ + stop(): webdriver.promise.Promise; + } +} + +export = remote; diff --git a/selenium-webdriver/v2/safari.d.ts b/selenium-webdriver/v2/safari.d.ts new file mode 100644 index 0000000000..82fd835b20 --- /dev/null +++ b/selenium-webdriver/v2/safari.d.ts @@ -0,0 +1,93 @@ +import * as webdriver from './index'; + +declare namespace safari { + class Server { } + + /** + * @return {!Promise} A promise that will resolve with the path + * to Safari on the current system. + */ + function findSafariExecutable(): any; + + /** + * @param {string} serverUrl The URL to connect to. + * @return {!Promise} A promise for the path to a file that Safari can + * open on start-up to trigger a new connection to the WebSocket server. + */ + function createConnectFile(serverUrl: string): any; + + /** + * Deletes all session data files if so desired. + * @param {!Object} desiredCapabilities . + * @return {!Array} A list of promises for the deleted files. + */ + function cleanSession(desiredCapabilities: webdriver.Capabilities): any[]; + + /** @return {string} . */ + function getRandomString(): string; + + /** + * @implements {command.Executor} + */ + class CommandExecutor { + } + + /** + * Configuration options specific to the {@link Driver SafariDriver}. + */ + class Options { + /** + * Extracts the SafariDriver specific options from the given capabilities + * object. + * @param {!Capabilities} capabilities The capabilities object. + * @return {!Options} The ChromeDriver options. + */ + static fromCapabilities(capabilities: webdriver.Capabilities): Options; + + /** + * Sets whether to force Safari to start with a clean session. Enabling this + * option will cause all global browser data to be deleted. + * @param {boolean} clean Whether to make sure the session has no cookies, + * cache entries, local storage, or databases. + * @return {!Options} A self reference. + */ + setCleanSession(clean: boolean): Options; + + /** + * Sets the logging preferences for the new session. + * @param {!./lib/logging.Preferences} prefs The logging preferences. + * @return {!Options} A self reference. + */ + setLoggingPrefs(prefs: webdriver.logging.Preferences): Options; + + /** + * Converts this options instance to a {@link Capabilities} object. + * @param {Capabilities=} opt_capabilities The capabilities to + * merge these options into, if any. + * @return {!Capabilities} The capabilities. + */ + toCapabilities(opt_capabilities: webdriver.Capabilities): webdriver.Capabilities; + } + + /** + * A WebDriver client for Safari. This class should never be instantiated + * directly; instead, use the {@linkplain ./builder.Builder Builder}: + * + * var driver = new Builder() + * .forBrowser('safari') + * .build(); + * + */ + class Driver extends webdriver.WebDriver { + /** + * @param {(Options|Capabilities)=} opt_config The configuration + * options for the new session. + * @param {promise.ControlFlow=} opt_flow The control flow to create + * the driver under. + */ + constructor(opt_config?: Options | webdriver.Capabilities, opt_flow?: webdriver.promise.ControlFlow); + + } +} + +export = safari; diff --git a/selenium-webdriver/v2/test/chrome.ts b/selenium-webdriver/v2/test/chrome.ts new file mode 100644 index 0000000000..2fce6bf6ca --- /dev/null +++ b/selenium-webdriver/v2/test/chrome.ts @@ -0,0 +1,61 @@ +import * as chrome from 'selenium-webdriver/chrome'; +import * as remote from 'selenium-webdriver/remote'; +import * as webdriver from 'selenium-webdriver'; + +function TestChromeDriver() { + var driver: chrome.Driver = new chrome.Driver(); + driver = new chrome.Driver(webdriver.Capabilities.chrome()); + driver = new chrome.Driver(webdriver.Capabilities.chrome(), + new remote.DriverService('executable', new chrome.Options()), + new webdriver.promise.ControlFlow()); + + var baseDriver: webdriver.WebDriver = driver; +} + +function TestChromeOptions() { + var options: chrome.Options = new chrome.Options(); + options = chrome.Options.fromCapabilities(webdriver.Capabilities.chrome()); + + options = options.addArguments('a', 'b', 'c'); + options = options.addExtensions('a', 'b', 'c'); + options = options.excludeSwitches('a', 'b', 'c'); + options = options.detachDriver(true); + options = options.setChromeBinaryPath('path'); + options = options.setChromeLogFile('logfile'); + options = options.setLocalState('state'); + options = options.androidActivity('com.example.Activity'); + options = options.androidDeviceSerial('emulator-5554'); + options = options.androidChrome(); + options = options.androidPackage('com.android.chrome'); + options = options.androidProcess('com.android.chrome'); + options = options.androidUseRunningApp(true); + options = options.setLoggingPrefs(new webdriver.logging.Preferences()); + options = options.setPerfLoggingPrefs({ + enableNetwork: true, enablePage: true, enableTimeline: true, + tracingCategories: 'category', bufferUsageReportingInterval: 1000 }); + options = options.setProxy({ proxyType: 'proxyType' }); + options = options.setUserPreferences('preferences'); + var capabilities: webdriver.Capabilities = options.toCapabilities(); + capabilities = options.toCapabilities(webdriver.Capabilities.chrome()); +} + +function TestServiceBuilder() { + var builder: chrome.ServiceBuilder = new chrome.ServiceBuilder(); + builder = new chrome.ServiceBuilder('exe'); + + var anything: any = builder.build(); + builder = builder.usingPort(8080); + builder = builder.setAdbPort(5037); + builder = builder.loggingTo('path'); + builder = builder.enableVerboseLogging(); + builder = builder.setNumHttpThreads(5); + builder = builder.setUrlBasePath('path'); + builder = builder.setStdio('config'); + builder = builder.setStdio(['A', 'B']); + builder = builder.withEnvironment({ 'A': 'a', 'B': 'b' }); +} + +function TestChromeModule() { + var service: any = chrome.getDefaultService(); + chrome.setDefaultService(new remote.DriverService('executable', new chrome.Options())); +} diff --git a/selenium-webdriver/v2/test/firefox.ts b/selenium-webdriver/v2/test/firefox.ts new file mode 100644 index 0000000000..7ebe0aa856 --- /dev/null +++ b/selenium-webdriver/v2/test/firefox.ts @@ -0,0 +1,54 @@ +import * as firefox from 'selenium-webdriver/firefox'; +import * as remote from 'selenium-webdriver/remote'; +import * as webdriver from 'selenium-webdriver'; + +function TestBinary() { + var binary: firefox.Binary = new firefox.Binary(); + binary = new firefox.Binary('exe'); + + binary.addArguments('A', 'B', 'C'); + var promise: webdriver.promise.Promise = binary.kill(); + binary.launch('profile').then(function (result: any) { }); +} + +function TestFirefoxDriver() { + var driver: firefox.Driver = new firefox.Driver(); + driver = new firefox.Driver(webdriver.Capabilities.firefox()); + driver = new firefox.Driver(webdriver.Capabilities.firefox(), new webdriver.promise.ControlFlow()); + + var baseDriver: webdriver.WebDriver = driver; +} + +function TestFirefoxOptions() { + var options: firefox.Options = new firefox.Options(); + + options = options.setBinary('binary'); + options = options.setBinary(new firefox.Binary()); + options = options.setLoggingPreferences(new webdriver.logging.Preferences()); + options = options.setProfile('profile'); + options = options.setProfile(new firefox.Profile()); + options = options.setProxy({ proxyType: 'proxy' }); + var capabilities: webdriver.Capabilities = options.toCapabilities(); +} + +function TestFirefoxProfile() { + var profile: firefox.Profile = new firefox.Profile(); + profile = new firefox.Profile('dir'); + + var bool: boolean = profile.acceptUntrustedCerts(); + profile.addExtension('ext'); + bool = profile.assumeUntrustedCertIssuer(); + profile.encode().then(function (prof: string) { }); + var num: number = profile.getPort(); + var anything: any = profile.getPreference('key'); + bool = profile.nativeEventsEnabled(); + profile.setAcceptUntrustedCerts(true); + profile.setAssumeUntrustedCertIssuer(true); + profile.setNativeEventsEnabled(true); + profile.setPort(8080); + profile.setPreference('key', 'value'); + profile.setPreference('key', 5); + profile.setPreference('key', true); + var stringPromise: webdriver.promise.Promise = profile.writeToDisk(); + stringPromise = profile.writeToDisk(true); +} diff --git a/selenium-webdriver/v2/test/index.ts b/selenium-webdriver/v2/test/index.ts new file mode 100644 index 0000000000..ba2acb91ef --- /dev/null +++ b/selenium-webdriver/v2/test/index.ts @@ -0,0 +1,1057 @@ +import * as webdriver from 'selenium-webdriver'; +import * as chrome from 'selenium-webdriver/chrome'; +import * as firefox from 'selenium-webdriver/firefox'; +import * as remote from 'selenium-webdriver/remote'; +import * as executors from 'selenium-webdriver/executors'; +import * as testing from 'selenium-webdriver/testing'; + +function TestExecutors() { + var exec: webdriver.Executor = executors.createExecutor('url'); + var promise: webdriver.promise.Promise; + exec = executors.createExecutor(promise); +} + +function TestBuilder() { + var builder: webdriver.Builder = new webdriver.Builder(); + + var driver: webdriver.WebDriver = builder.build(); + builder = builder.forBrowser('name'); + builder = builder.forBrowser('name', 'version'); + builder = builder.forBrowser('name', 'version', 'platform'); + + var cap: webdriver.Capabilities = builder.getCapabilities(); + var str: string = builder.getServerUrl(); + + builder = builder.setAlertBehavior('behavior'); + builder = builder.setChromeOptions(new chrome.Options()); + builder = builder.setControlFlow(new webdriver.promise.ControlFlow()); + builder = builder.setEnableNativeEvents(true); + builder = builder.setFirefoxOptions(new firefox.Options()); + builder = builder.setLoggingPrefs(new webdriver.logging.Preferences()); + builder = builder.setLoggingPrefs({ 'key': 'value' }); + builder = builder.setProxy({ proxyType: 'type' }); + builder = builder.setScrollBehavior(1); + builder = builder.usingServer('http://someserver'); + builder = builder.withCapabilities(new webdriver.Capabilities()); + builder = builder.withCapabilities({ something: true }); +} + +function TestActionSequence() { + var driver: webdriver.WebDriver = new webdriver.Builder(). + withCapabilities(webdriver.Capabilities.chrome()). + build(); + + var sequence: webdriver.ActionSequence = new webdriver.ActionSequence(driver); + var element: webdriver.WebElement = new webdriver.WebElement(driver, 'elementId'); + var promise: webdriver.promise.Promise; + element = new webdriver.WebElement(driver, promise); + + // Click + sequence = sequence.click(); + sequence = sequence.click(webdriver.Button.LEFT); + sequence = sequence.click(element); + sequence = sequence.click(element, webdriver.Button.LEFT); + + // DoubleClick + sequence = sequence.doubleClick(); + sequence = sequence.doubleClick(webdriver.Button.LEFT); + sequence = sequence.doubleClick(element); + sequence = sequence.doubleClick(element, webdriver.Button.LEFT); + + // DragAndDrop + sequence = sequence.dragAndDrop(element, element); + sequence = sequence.dragAndDrop(element, { x: 1, y: 2 }); + + // KeyDown + sequence = sequence.keyDown(webdriver.Key.ADD); + + // KeyUp + sequence = sequence.keyUp(webdriver.Key.ADD); + + // MouseDown + sequence = sequence.mouseDown(); + sequence = sequence.mouseDown(webdriver.Button.LEFT); + sequence = sequence.mouseDown(element); + sequence = sequence.mouseDown(element, webdriver.Button.LEFT); + + // MouseMove + sequence = sequence.mouseMove(element); + sequence = sequence.mouseMove({ x: 1, y: 1 }); + sequence = sequence.mouseMove(element, { x: 1, y: 2 }); + + // MouseUp + sequence = sequence.mouseUp(); + sequence = sequence.mouseUp(webdriver.Button.LEFT); + sequence = sequence.mouseUp(element); + sequence = sequence.mouseUp(element, webdriver.Button.LEFT); + + // SendKeys + sequence = sequence.sendKeys('A', 'B', 'C'); + sequence = sequence.sendKeys('A', webdriver.Key.NULL); + + sequence.perform().then(function () { }); +} + +function TestTouchSequence() { + var driver: webdriver.WebDriver = new webdriver.Builder(). + withCapabilities(webdriver.Capabilities.chrome()). + build(); + var element: webdriver.WebElement = new webdriver.WebElement(driver, 'elementId'); + + var sequence: webdriver.TouchSequence = new webdriver.TouchSequence(driver); + + sequence = sequence.tap(element); + sequence = sequence.doubleTap(element); + sequence = sequence.longPress(element); + sequence = sequence.tapAndHold({ x: 100, y: 100 }); + sequence = sequence.move({ x: 100, y: 100 }); + sequence = sequence.release({ x: 100, y: 100 }); + sequence = sequence.scroll({ x: 100, y: 100 }); + sequence = sequence.scrollFromElement(element, { x: 100, y: 100 }); + sequence = sequence.flick({ xspeed: 100, yspeed: 100 }); + sequence = sequence.flickElement(element, { x: 100, y: 100 }, 100); + + sequence.perform().then(function () { }); +} + +function TestAlert() { + var driver: webdriver.WebDriver = new webdriver.Builder(). + withCapabilities(webdriver.Capabilities.chrome()). + build(); + + var alert: webdriver.Alert = driver.switchTo().alert(); + + alert.accept().then(function () { }); + alert.dismiss().then(function () { }); + alert.getText().then(function (text: string) { }); + alert.sendKeys('ABC').then(function () { }); +} + +function TestBrowser() { + var browser: string; + + browser = webdriver.Browser.ANDROID; + browser = webdriver.Browser.CHROME; + browser = webdriver.Browser.FIREFOX; + browser = webdriver.Browser.HTMLUNIT; + browser = webdriver.Browser.INTERNET_EXPLORER; + browser = webdriver.Browser.IPAD; + browser = webdriver.Browser.IPHONE; + browser = webdriver.Browser.OPERA; + browser = webdriver.Browser.PHANTOM_JS; + browser = webdriver.Browser.SAFARI; +} + +function TestButton() { + var button: string; + + button = webdriver.Button.LEFT; + button = webdriver.Button.MIDDLE; + button = webdriver.Button.RIGHT; +} + +function TestCapabilities() { + var capabilities: webdriver.Capabilities = new webdriver.Capabilities(); + capabilities = new webdriver.Capabilities(webdriver.Capabilities.chrome()); + var objCapabilities: any = {}; + objCapabilities[webdriver.Capability.BROWSER_NAME] = webdriver.Browser.PHANTOM_JS; + capabilities = new webdriver.Capabilities(objCapabilities); + + var anything: any = capabilities.get(webdriver.Capability.SECURE_SSL); + var check: boolean = capabilities.has(webdriver.Capability.SECURE_SSL); + capabilities = capabilities.merge(capabilities); + capabilities = capabilities.merge(objCapabilities); + capabilities = capabilities.set(webdriver.Capability.VERSION, { abc: 'def' }); + capabilities = capabilities.set(webdriver.Capability.VERSION, null); + capabilities = capabilities.setLoggingPrefs(new webdriver.logging.Preferences()); + capabilities = capabilities.setLoggingPrefs({ 'key': 'value' }); + capabilities = capabilities.setProxy({ proxyType: 'Type' }); + capabilities = capabilities.setEnableNativeEvents(true); + capabilities = capabilities.setScrollBehavior(1); + capabilities = capabilities.setAlertBehavior('accept'); + + anything = capabilities.toJSON(); + + capabilities = webdriver.Capabilities.android(); + capabilities = webdriver.Capabilities.chrome(); + capabilities = webdriver.Capabilities.firefox(); + capabilities = webdriver.Capabilities.htmlunit(); + capabilities = webdriver.Capabilities.htmlunitwithjs(); + capabilities = webdriver.Capabilities.ie(); + capabilities = webdriver.Capabilities.ipad(); + capabilities = webdriver.Capabilities.iphone(); + capabilities = webdriver.Capabilities.opera(); + capabilities = webdriver.Capabilities.phantomjs(); + capabilities = webdriver.Capabilities.safari(); +} + +function TestCapability() { + var capability: string; + + capability = webdriver.Capability.ACCEPT_SSL_CERTS; + capability = webdriver.Capability.BROWSER_NAME; + capability = webdriver.Capability.ELEMENT_SCROLL_BEHAVIOR; + capability = webdriver.Capability.HANDLES_ALERTS; + capability = webdriver.Capability.LOGGING_PREFS; + capability = webdriver.Capability.NATIVE_EVENTS; + capability = webdriver.Capability.PLATFORM; + capability = webdriver.Capability.PROXY; + capability = webdriver.Capability.ROTATABLE; + capability = webdriver.Capability.SECURE_SSL; + capability = webdriver.Capability.SUPPORTS_APPLICATION_CACHE; + capability = webdriver.Capability.SUPPORTS_CSS_SELECTORS; + capability = webdriver.Capability.SUPPORTS_JAVASCRIPT; + capability = webdriver.Capability.SUPPORTS_LOCATION_CONTEXT; + capability = webdriver.Capability.TAKES_SCREENSHOT; + capability = webdriver.Capability.UNEXPECTED_ALERT_BEHAVIOR; + capability = webdriver.Capability.VERSION; +} + +function TestCommand() { + var command: webdriver.Command = new webdriver.Command(webdriver.CommandName.ADD_COOKIE); + + var name: string = command.getName(); + var param: any = command.getParameter('param'); + + var params: any = command.getParameters(); + + command = command.setParameter('param', 123); + command = command.setParameters({ param: 123 }); +} + +function TestDeferredExecutor() { + var promise: webdriver.promise.Promise; + var executor: webdriver.DeferredExecutor = new webdriver.DeferredExecutor(promise); +} + +function TestCommandName() { + var command: string; + + command = webdriver.CommandName.ACCEPT_ALERT; + command = webdriver.CommandName.ADD_COOKIE; + command = webdriver.CommandName.CLEAR_APP_CACHE; + command = webdriver.CommandName.CLEAR_ELEMENT; + command = webdriver.CommandName.CLEAR_LOCAL_STORAGE; + command = webdriver.CommandName.CLEAR_SESSION_STORAGE; + command = webdriver.CommandName.CLICK; + command = webdriver.CommandName.CLICK_ELEMENT; + command = webdriver.CommandName.CLOSE; + command = webdriver.CommandName.DELETE_ALL_COOKIES; + command = webdriver.CommandName.DELETE_COOKIE; + command = webdriver.CommandName.DESCRIBE_SESSION; + command = webdriver.CommandName.DISMISS_ALERT; + command = webdriver.CommandName.DOUBLE_CLICK; + command = webdriver.CommandName.ELEMENT_EQUALS; + command = webdriver.CommandName.EXECUTE_ASYNC_SCRIPT; + command = webdriver.CommandName.EXECUTE_SCRIPT; + command = webdriver.CommandName.EXECUTE_SQL; + command = webdriver.CommandName.FIND_CHILD_ELEMENT; + command = webdriver.CommandName.FIND_CHILD_ELEMENTS; + command = webdriver.CommandName.FIND_ELEMENT; + command = webdriver.CommandName.FIND_ELEMENTS; + command = webdriver.CommandName.GET; + command = webdriver.CommandName.GET_ACTIVE_ELEMENT; + command = webdriver.CommandName.GET_ALERT_TEXT; + command = webdriver.CommandName.GET_ALL_COOKIES; + command = webdriver.CommandName.GET_APP_CACHE; + command = webdriver.CommandName.GET_APP_CACHE_STATUS; + command = webdriver.CommandName.GET_AVAILABLE_LOG_TYPES; + command = webdriver.CommandName.GET_COOKIE; + command = webdriver.CommandName.GET_CURRENT_URL; + command = webdriver.CommandName.GET_CURRENT_WINDOW_HANDLE; + command = webdriver.CommandName.GET_ELEMENT_ATTRIBUTE; + command = webdriver.CommandName.GET_ELEMENT_LOCATION; + command = webdriver.CommandName.GET_ELEMENT_LOCATION_IN_VIEW; + command = webdriver.CommandName.GET_ELEMENT_SIZE; + command = webdriver.CommandName.GET_ELEMENT_TAG_NAME; + command = webdriver.CommandName.GET_ELEMENT_TEXT; + command = webdriver.CommandName.GET_ELEMENT_VALUE_OF_CSS_PROPERTY; + command = webdriver.CommandName.GET_LOCAL_STORAGE_ITEM; + command = webdriver.CommandName.GET_LOCAL_STORAGE_KEYS; + command = webdriver.CommandName.GET_LOCAL_STORAGE_SIZE; + command = webdriver.CommandName.GET_LOCATION; + command = webdriver.CommandName.GET_LOG; + command = webdriver.CommandName.GET_PAGE_SOURCE; + command = webdriver.CommandName.GET_SCREEN_ORIENTATION; + command = webdriver.CommandName.GET_SERVER_STATUS; + command = webdriver.CommandName.GET_SESSION_LOGS; + command = webdriver.CommandName.GET_SESSION_STORAGE_ITEM; + command = webdriver.CommandName.GET_SESSION_STORAGE_KEYS; + command = webdriver.CommandName.GET_SESSION_STORAGE_SIZE; + command = webdriver.CommandName.GET_SESSIONS; + command = webdriver.CommandName.GET_TITLE; + command = webdriver.CommandName.GET_WINDOW_HANDLES; + command = webdriver.CommandName.GET_WINDOW_POSITION; + command = webdriver.CommandName.GET_WINDOW_SIZE; + command = webdriver.CommandName.GO_BACK; + command = webdriver.CommandName.GO_FORWARD; + command = webdriver.CommandName.IMPLICITLY_WAIT; + command = webdriver.CommandName.IS_BROWSER_ONLINE; + command = webdriver.CommandName.IS_ELEMENT_DISPLAYED; + command = webdriver.CommandName.IS_ELEMENT_ENABLED; + command = webdriver.CommandName.IS_ELEMENT_SELECTED; + command = webdriver.CommandName.MAXIMIZE_WINDOW; + command = webdriver.CommandName.MOUSE_DOWN; + command = webdriver.CommandName.MOUSE_UP; + command = webdriver.CommandName.MOVE_TO; + command = webdriver.CommandName.NEW_SESSION; + command = webdriver.CommandName.QUIT; + command = webdriver.CommandName.REFRESH; + command = webdriver.CommandName.REMOVE_LOCAL_STORAGE_ITEM; + command = webdriver.CommandName.REMOVE_SESSION_STORAGE_ITEM; + command = webdriver.CommandName.SCREENSHOT; + command = webdriver.CommandName.SEND_KEYS_TO_ACTIVE_ELEMENT; + command = webdriver.CommandName.SEND_KEYS_TO_ELEMENT; + command = webdriver.CommandName.SET_ALERT_TEXT; + command = webdriver.CommandName.SET_BROWSER_ONLINE; + command = webdriver.CommandName.SET_LOCAL_STORAGE_ITEM; + command = webdriver.CommandName.SET_LOCATION; + command = webdriver.CommandName.SET_SCREEN_ORIENTATION; + command = webdriver.CommandName.SET_SCRIPT_TIMEOUT; + command = webdriver.CommandName.SET_SESSION_STORAGE_ITEM; + command = webdriver.CommandName.SET_TIMEOUT; + command = webdriver.CommandName.SET_WINDOW_POSITION; + command = webdriver.CommandName.SET_WINDOW_SIZE; + command = webdriver.CommandName.SUBMIT_ELEMENT; + command = webdriver.CommandName.SWITCH_TO_FRAME; + command = webdriver.CommandName.SWITCH_TO_WINDOW; + command = webdriver.CommandName.TOUCH_DOUBLE_TAP; + command = webdriver.CommandName.TOUCH_DOWN; + command = webdriver.CommandName.TOUCH_FLICK; + command = webdriver.CommandName.TOUCH_LONG_PRESS; + command = webdriver.CommandName.TOUCH_MOVE; + command = webdriver.CommandName.TOUCH_SCROLL; + command = webdriver.CommandName.TOUCH_SINGLE_TAP; + command = webdriver.CommandName.TOUCH_UP; +} + +function TestEventEmitter() { + var emitter: webdriver.EventEmitter = new webdriver.EventEmitter(); + + var callback = function (a: number, b: number, c: number) { }; + + emitter = emitter.addListener('ABC', callback); + emitter = emitter.addListener('ABC', callback, this); + + emitter.emit('ABC', 1, 2, 3); + + var listeners = emitter.listeners('ABC'); + if (listeners[0].oneshot) { + listeners[0].fn.apply(listeners[0].scope); + } + var length: number = listeners.length; + var listenerInfo = listeners[0]; + if (listenerInfo.oneshot) { + listenerInfo.fn.apply(listenerInfo.scope, [1, 2, 3]); + } + + emitter = emitter.on('ABC', callback); + emitter = emitter.on('ABC', callback, this); + + emitter = emitter.once('ABC', callback); + emitter = emitter.once('ABC', callback, this); + + emitter = emitter.removeListener('ABC', callback); + + emitter.removeAllListeners('ABC'); + emitter.removeAllListeners(); +} + +function TestKey() { + var key: string; + + key = webdriver.Key.ADD; + key = webdriver.Key.ALT; + key = webdriver.Key.ARROW_DOWN; + key = webdriver.Key.ARROW_LEFT; + key = webdriver.Key.ARROW_RIGHT; + key = webdriver.Key.ARROW_UP; + key = webdriver.Key.BACK_SPACE; + key = webdriver.Key.CANCEL; + key = webdriver.Key.CLEAR; + key = webdriver.Key.COMMAND; + key = webdriver.Key.CONTROL; + key = webdriver.Key.DECIMAL; + key = webdriver.Key.DELETE; + key = webdriver.Key.DIVIDE; + key = webdriver.Key.DOWN; + key = webdriver.Key.END; + key = webdriver.Key.ENTER; + key = webdriver.Key.EQUALS; + key = webdriver.Key.ESCAPE; + key = webdriver.Key.F1; + key = webdriver.Key.F2; + key = webdriver.Key.F3; + key = webdriver.Key.F4; + key = webdriver.Key.F5; + key = webdriver.Key.F6; + key = webdriver.Key.F7; + key = webdriver.Key.F8; + key = webdriver.Key.F9; + key = webdriver.Key.F10; + key = webdriver.Key.F11; + key = webdriver.Key.F12; + key = webdriver.Key.HELP; + key = webdriver.Key.HOME; + key = webdriver.Key.INSERT; + key = webdriver.Key.LEFT; + key = webdriver.Key.META; + key = webdriver.Key.MULTIPLY; + key = webdriver.Key.NULL; + key = webdriver.Key.NUMPAD0; + key = webdriver.Key.NUMPAD1; + key = webdriver.Key.NUMPAD2; + key = webdriver.Key.NUMPAD3; + key = webdriver.Key.NUMPAD4; + key = webdriver.Key.NUMPAD5; + key = webdriver.Key.NUMPAD6; + key = webdriver.Key.NUMPAD7; + key = webdriver.Key.NUMPAD8; + key = webdriver.Key.NUMPAD9; + key = webdriver.Key.PAGE_DOWN; + key = webdriver.Key.PAGE_UP; + key = webdriver.Key.PAUSE; + key = webdriver.Key.RETURN; + key = webdriver.Key.RIGHT; + key = webdriver.Key.SEMICOLON; + key = webdriver.Key.SEPARATOR; + key = webdriver.Key.SHIFT; + key = webdriver.Key.SPACE; + key = webdriver.Key.SUBTRACT; + key = webdriver.Key.TAB; + key = webdriver.Key.UP; +} + +function TestBy() { + var driver: webdriver.WebDriver = new webdriver.Builder(). + withCapabilities(webdriver.Capabilities.chrome()). + build(); + + var locator: webdriver.By = new webdriver.By('class name', 'class'); + + var str: string = locator.toString(); + + locator = webdriver.By.className('class'); + locator = webdriver.By.css('css'); + locator = webdriver.By.id('id'); + locator = webdriver.By.linkText('link'); + locator = webdriver.By.name('name'); + locator = webdriver.By.partialLinkText('text'); + locator = webdriver.By.tagName('tag'); + locator = webdriver.By.xpath('xpath'); + + // Can import 'By' without import declarations + var By = webdriver.By; + + var locatorHash: webdriver.ByHash; + locatorHash = { className: 'class' }; + locatorHash = { css: 'css' }; + locatorHash = { id: 'id' }; + locatorHash = { linkText: 'link' }; + locatorHash = { name: 'name' }; + locatorHash = { partialLinkText: 'text' }; + locatorHash = { tagName: 'tag' }; + locatorHash = { xpath: 'xpath' }; + + webdriver.By.js('script', 1, 2, 3)(driver).then(function (abc: number) { }); +} + +function TestSession() { + var session: webdriver.Session = new webdriver.Session('ABC', webdriver.Capabilities.android()); + var capabilitiesObj: any = {}; + capabilitiesObj[webdriver.Capability.BROWSER_NAME] = webdriver.Browser.ANDROID; + capabilitiesObj[webdriver.Capability.PLATFORM] = 'ANDROID'; + session = new webdriver.Session('ABC', capabilitiesObj); + + var capabilities: webdriver.Capabilities = session.getCapabilities(); + var capability: any = session.getCapability(webdriver.Capability.BROWSER_NAME); + var id: string = session.getId(); + var data: string = session.toJSON(); +} + +function TestUnhandledAlertError() { + var someFunc = function (error: webdriver.UnhandledAlertError) { + var baseError: Error = error; + var str: string = error.getAlertText(); + str = error.toString(); + } +} + +function TestWebDriverFileDetector() { + var driver: webdriver.WebDriver = new webdriver.Builder(). + withCapabilities(webdriver.Capabilities.chrome()). + build(); + + var fileDetector: webdriver.FileDetector = new webdriver.FileDetector(); + + fileDetector.handleFile(driver, 'path/to/file').then(function (path: string) { }); +} + +function TestWebDriverLogs() { + var driver: webdriver.WebDriver = new webdriver.Builder(). + withCapabilities(webdriver.Capabilities.chrome()). + build(); + + var logs: webdriver.Logs = new webdriver.Logs(driver); + + logs.get(webdriver.logging.Type.BROWSER).then(function (entries: webdriver.logging.Entry[]) { });; + logs.getAvailableLogTypes().then(function (types: string[]) { }); +} + +function TestWebDriverNavigation() { + var driver: webdriver.WebDriver = new webdriver.Builder(). + withCapabilities(webdriver.Capabilities.chrome()). + build(); + + var navigation: webdriver.Navigation = new webdriver.Navigation(driver); + + navigation.back().then(function () { }); + navigation.forward().then(function () { }); + navigation.refresh().then(function () { }); + navigation.to('http://google.com').then(function () { }); +} + +function TestWebDriverOptions() { + var driver: webdriver.WebDriver = new webdriver.Builder(). + withCapabilities(webdriver.Capabilities.chrome()). + build(); + + var options: webdriver.Options = new webdriver.Options(driver); + var promise: webdriver.promise.Promise; + + // Add Cookie + promise = options.addCookie('name', 'value'); + promise = options.addCookie('name', 'value', 'path'); + promise = options.addCookie('name', 'value', 'path', 'domain'); + promise = options.addCookie('name', 'value', 'path', 'domain', true); + promise = options.addCookie('name', 'value', 'path', 'domain', true, 123); + promise = options.addCookie('name', 'value', 'path', 'domain', true, Date.now()); + + promise = options.deleteAllCookies(); + promise = options.deleteCookie('name'); + options.getCookie('name').then(function (cookies: webdriver.IWebDriverOptionsCookie) { }); + options.getCookies().then(function (cookies: webdriver.IWebDriverOptionsCookie[]) { }); + + var logs: webdriver.Logs = options.logs(); + var timeouts: webdriver.Timeouts = options.timeouts(); + var window: webdriver.Window = options.window(); +} + +function TestWebDriverTargetLocator() { + var driver: webdriver.WebDriver = new webdriver.Builder(). + withCapabilities(webdriver.Capabilities.chrome()). + build(); + + var locator: webdriver.TargetLocator = new webdriver.TargetLocator(driver); + var promise: webdriver.promise.Promise; + + var element: webdriver.WebElement = locator.activeElement(); + var alert: webdriver.Alert = locator.alert(); + promise = locator.defaultContent(); + promise = locator.frame(1); + promise = locator.window('nameOrHandle'); +} + +function TestWebDriverTimeouts() { + var driver: webdriver.WebDriver = new webdriver.Builder(). + withCapabilities(webdriver.Capabilities.chrome()). + build(); + + var timeouts: webdriver.Timeouts = new webdriver.Timeouts(driver); + var promise: webdriver.promise.Promise; + + promise = timeouts.implicitlyWait(123); + promise = timeouts.pageLoadTimeout(123); + promise = timeouts.setScriptTimeout(123); +} + +function TestWebDriverWindow() { + var driver: webdriver.WebDriver = new webdriver.Builder(). + withCapabilities(webdriver.Capabilities.chrome()). + build(); + + var window: webdriver.Window = new webdriver.Window(driver); + var locationPromise: webdriver.promise.Promise; + var sizePromise: webdriver.promise.Promise; + var voidPromise: webdriver.promise.Promise; + + locationPromise = window.getPosition(); + sizePromise = window.getSize(); + voidPromise = window.maximize(); + voidPromise = window.setPosition(12, 34); + voidPromise = window.setSize(12, 34); +} + +function TestWebDriver() { + var session: webdriver.Session = new webdriver.Session('ABC', webdriver.Capabilities.android()); + var sessionPromise: webdriver.promise.Promise; + var executor: webdriver.Executor = executors.createExecutor('http://someserver'); + var flow: webdriver.promise.ControlFlow = new webdriver.promise.ControlFlow(); + var driver: webdriver.WebDriver = new webdriver.WebDriver(session, executor); + driver = new webdriver.WebDriver(session, executor, flow); + driver = new webdriver.WebDriver(sessionPromise, executor); + driver = new webdriver.WebDriver(sessionPromise, executor, flow); + + var voidPromise: webdriver.promise.Promise; + var stringPromise: webdriver.promise.Promise; + var booleanPromise: webdriver.promise.Promise; + + var actions: webdriver.ActionSequence = driver.actions(); + var touchActions: webdriver.TouchSequence = driver.touchActions(); + + // call + stringPromise = driver.call(function () { return 'value'; }); + stringPromise = driver.call(function () { return stringPromise; }); + stringPromise = driver.call(function () { var d: any = this; return 'value'; }, driver); + stringPromise = driver.call(function (a: number) { return 'value'; }, driver, 1); + + voidPromise = driver.close(); + flow = driver.controlFlow(); + + // executeAsyncScript + stringPromise = driver.executeAsyncScript('function(){}'); + stringPromise = driver.executeAsyncScript('function(){}', 1, 2, 3); + stringPromise = driver.executeAsyncScript(function () { }); + stringPromise = driver.executeAsyncScript(function (a: number) { }, 1); + + // executeScript + stringPromise = driver.executeScript('function(){}'); + stringPromise = driver.executeScript('function(){}', 1, 2, 3); + stringPromise = driver.executeScript(function () { }); + stringPromise = driver.executeScript(function (a: number) { }, 1); + + // findElement + var element: webdriver.WebElement; + element = driver.findElement(webdriver.By.id('ABC')); + element = driver.findElement(webdriver.By.js('function(){}')); + + // findElements + driver.findElements(webdriver.By.className('ABC')).then(function (elements: webdriver.WebElement[]) { }); + driver.findElements(webdriver.By.js('function(){}')).then(function (elements: webdriver.WebElement[]) { }); + + voidPromise = driver.get('http://www.google.com'); + driver.getAllWindowHandles().then(function (handles: string[]) { }); + driver.getCapabilities().then(function (caps: webdriver.Capabilities) { }); + stringPromise = driver.getCurrentUrl(); + stringPromise = driver.getPageSource() + driver.getSession().then(function (session: webdriver.Session) { });; + stringPromise = driver.getTitle(); + stringPromise = driver.getWindowHandle(); + + booleanPromise = driver.isElementPresent(webdriver.By.className('ABC')); + booleanPromise = driver.isElementPresent(webdriver.By.js('function(){}')); + + var options: webdriver.Options = driver.manage(); + var navigation: webdriver.Navigation = driver.navigate(); + var locator: webdriver.TargetLocator = driver.switchTo(); + + var fileDetector: webdriver.FileDetector = new webdriver.FileDetector(); + driver.setFileDetector(fileDetector); + + voidPromise = driver.quit(); + voidPromise = driver.schedule(new webdriver.Command(webdriver.CommandName.CLICK), 'ABC'); + voidPromise = driver.sleep(123); + stringPromise = driver.takeScreenshot(); + + var booleanCondition: webdriver.until.Condition; + booleanPromise = driver.wait(booleanPromise); + booleanPromise = driver.wait(booleanCondition); + booleanPromise = driver.wait(function (driver: webdriver.WebDriver) { return true; }); + let conditionFunction: Function; + booleanPromise = driver.wait(conditionFunction); + booleanPromise = driver.wait(booleanPromise, 123); + booleanPromise = driver.wait(booleanPromise, 123, 'Message'); + + driver = webdriver.WebDriver.attachToSession(executor, 'ABC'); + driver = webdriver.WebDriver.createSession(executor, webdriver.Capabilities.android()); +} + +function TestSerializable() { + var serializable: webdriver.Serializable; + var serial: string | webdriver.promise.IThenable = serializable.serialize(); +} + +function TestWebElement() { + var driver: webdriver.WebDriver = new webdriver.Builder(). + withCapabilities(webdriver.Capabilities.chrome()). + build(); + + var promise: webdriver.promise.Promise; + var element: webdriver.WebElement; + + element = new webdriver.WebElement(driver, 'elementId'); + element = new webdriver.WebElement(driver, promise); + + var voidPromise: webdriver.promise.Promise; + var stringPromise: webdriver.promise.Promise; + var booleanPromise: webdriver.promise.Promise; + + voidPromise = element.clear(); + voidPromise = element.click(); + + element = element.findElement(webdriver.By.id('ABC')); + element.findElements(webdriver.By.className('ABC')).then(function (elements: webdriver.WebElement[]) { }); + booleanPromise = element.isElementPresent(webdriver.By.className('ABC')); + + stringPromise = element.getAttribute('class'); + stringPromise = element.getCssValue('display'); + driver = element.getDriver(); + stringPromise = element.getInnerHtml(); + element.getLocation().then(function (location: webdriver.ILocation) { }); + stringPromise = element.getOuterHtml(); + element.getSize().then(function (size: webdriver.ISize) { }); + stringPromise = element.getTagName(); + stringPromise = element.getText(); + booleanPromise = element.isDisplayed(); + booleanPromise = element.isEnabled(); + booleanPromise = element.isSelected(); + voidPromise = element.sendKeys('A', 'B', 'C'); + voidPromise = element.sendKeys(1, 2, 3); + voidPromise = element.sendKeys(webdriver.Key.BACK_SPACE); + voidPromise = element.sendKeys(stringPromise, stringPromise, stringPromise); + voidPromise = element.sendKeys('A', 1, webdriver.Key.BACK_SPACE, stringPromise); + voidPromise = element.submit(); + element.getId().then(function (id: string) { }); + element.getRawId().then(function (id: string) { }); + element.serialize().then(function (id: webdriver.IWebElementId) { }); + + booleanPromise = webdriver.WebElement.equals(element, new webdriver.WebElement(driver, 'elementId')); +} + +function TestWebElementPromise() { + var driver: webdriver.WebDriver = new webdriver.Builder(). + withCapabilities(webdriver.Capabilities.chrome()). + build(); + + var elementPromise: webdriver.WebElementPromise = driver.findElement(webdriver.By.id('id')); + + elementPromise.cancel(); + elementPromise.cancel('reason'); + + var bool: boolean = elementPromise.isPending(); + + elementPromise.then(); + elementPromise.then(function (element: webdriver.WebElement) { }); + elementPromise.then(function (element: webdriver.WebElement) { }, function (error: any) { }); + elementPromise.then(function (element: webdriver.WebElement) { return 'foo'; }, function (error: any) { }).then(function (result: string) { }); + + elementPromise.thenCatch(function (error: any) { }).then(function (value: any) { }); + + elementPromise.thenFinally(function () { }); +} + +function TestLogging() { + var preferences: webdriver.logging.Preferences = new webdriver.logging.Preferences(); + preferences.setLevel(webdriver.logging.Type.BROWSER, webdriver.logging.Level.ALL); + var prefs: any = preferences.toJSON(); + + var level: webdriver.logging.Level = webdriver.logging.getLevel('OFF'); + level = webdriver.logging.getLevel(1); + + level = webdriver.logging.Level.ALL; + level = webdriver.logging.Level.DEBUG; + level = webdriver.logging.Level.INFO; + level = webdriver.logging.Level.OFF; + level = webdriver.logging.Level.SEVERE; + level = webdriver.logging.Level.WARNING; + + var name: string = level.name; + var value: number = level.value; + + var type: string; + type = webdriver.logging.Type.BROWSER; + type = webdriver.logging.Type.CLIENT; + type = webdriver.logging.Type.DRIVER; + type = webdriver.logging.Type.PERFORMANCE; + type = webdriver.logging.Type.SERVER; +} + +function TestLoggingEntry() { + var entry: webdriver.logging.Entry; + + entry = new webdriver.logging.Entry(webdriver.logging.Level.ALL, 'ABC'); + entry = new webdriver.logging.Entry('ALL', 'ABC'); + entry = new webdriver.logging.Entry(webdriver.logging.Level.ALL, 'ABC', 123); + entry = new webdriver.logging.Entry('ALL', 'ABC', 123); + entry = new webdriver.logging.Entry(webdriver.logging.Level.ALL, 'ABC', 123, webdriver.logging.Type.BROWSER); + entry = new webdriver.logging.Entry('ALL', 'ABC', 123, webdriver.logging.Type.BROWSER); + + var entryObj: any = entry.toJSON(); + + var message: string = entry.message; + var timestamp: number = entry.timestamp; + var type: string = entry.type; +} + +function TestPromiseModule() { + var cancellationError: webdriver.promise.CancellationError = new webdriver.promise.CancellationError(); + cancellationError = new webdriver.promise.CancellationError('message'); + var str: string = cancellationError.message; + str = cancellationError.name; + + var stringPromise: webdriver.promise.Promise; + var numberPromise: webdriver.promise.Promise; + var booleanPromise: webdriver.promise.Promise; + var voidPromise: webdriver.promise.Promise; + + webdriver.promise.all([stringPromise]).then(function (values: string[]) { }); + + webdriver.promise.asap('abc', function (value: any) { return true; }); + webdriver.promise.asap('abc', function (value: any) { }, function (err: any) { return 'ABC'; }); + + stringPromise = webdriver.promise.checkedNodeCall(function (err: any, value: any) { return 'abc'; }); + + webdriver.promise.consume(function () { + return 5; + }).then(function (value: number) { }); + webdriver.promise.consume(function () { + return 5; + }, this).then(function (value: number) { }); + webdriver.promise.consume(function (a: number, b: number, c: number) { + return 5; + }, this, 1, 2, 3).then(function (value: number) { }); + + var numbersPromise: webdriver.promise.Promise = webdriver.promise.filter([1, 2, 3], function (element: number, type: any, index: number, arr: number[]) { + return true; + }); + numbersPromise = webdriver.promise.filter([1, 2, 3], function (element: number, type: any, index: number, arr: number[]) { + return true; + }, this); + numbersPromise = webdriver.promise.filter(numbersPromise, function (element: number, type: any, index: number, arr: number[]) { + return true; + }); + numbersPromise = webdriver.promise.filter(numbersPromise, function (element: number, type: any, index: number, arr: number[]) { + return true; + }, this); + + numbersPromise = webdriver.promise.map([1, 2, 3], function (el: number, type: any, index: number, arr: number[]) { + return true; + }); + numbersPromise = webdriver.promise.map([1, 2, 3], function (el: number, type: any, index: number, arr: number[]) { + return true; + }, this); + numbersPromise = webdriver.promise.map(numbersPromise, function (el: number, type: any, index: number, arr: number[]) { + return true; + }); + numbersPromise = webdriver.promise.map(numbersPromise, function (el: number, type: any, index: number, arr: number[]) { + return true; + }, this); + + var flow: webdriver.promise.ControlFlow = webdriver.promise.controlFlow(); + + stringPromise = webdriver.promise.createFlow(function (newFlow: webdriver.promise.ControlFlow) { return 'ABC' }); + + var deferred: webdriver.promise.Deferred; + deferred = webdriver.promise.defer(); + deferred = webdriver.promise.defer(); + + stringPromise = deferred.promise; + + deferred.fulfill('ABC'); + deferred.reject('error'); + + voidPromise = webdriver.promise.delayed(123); + + voidPromise = webdriver.promise.fulfilled(); + stringPromise = webdriver.promise.fulfilled('abc'); + + stringPromise = webdriver.promise.fullyResolved('abc'); + + var bool: boolean = webdriver.promise.isGenerator(function () { }); + var isPromise: boolean = webdriver.promise.isPromise('ABC'); + + stringPromise = webdriver.promise.rejected('{a: 123}'); + + webdriver.promise.setDefaultFlow(new webdriver.promise.ControlFlow()); + + numberPromise = webdriver.promise.when('abc', function (value: any) { return 123; }, function (err: Error) { return 123; }); +} + +function TestUntilModule() { + var driver: webdriver.WebDriver = new webdriver.Builder(). + withCapabilities(webdriver.Capabilities.chrome()). + build(); + + var conditionB: webdriver.until.Condition = new webdriver.until.Condition('message', function (driver: webdriver.WebDriver) { return true; }); + var conditionBBase: webdriver.until.Condition = conditionB; + var conditionWebElement: webdriver.until.Condition; + var conditionWebElements: webdriver.until.Condition; + + conditionB = webdriver.until.ableToSwitchToFrame(5); + var conditionAlert: webdriver.until.Condition = webdriver.until.alertIsPresent(); + var el: webdriver.WebElement = driver.findElement(webdriver.By.id('id')); + conditionB = webdriver.until.elementIsDisabled(el); + conditionB = webdriver.until.elementIsEnabled(el); + conditionB = webdriver.until.elementIsNotSelected(el); + conditionB = webdriver.until.elementIsNotVisible(el); + conditionB = webdriver.until.elementIsSelected(el); + conditionB = webdriver.until.elementIsVisible(el); + conditionB = webdriver.until.elementTextContains(el, 'text'); + conditionB = webdriver.until.elementTextIs(el, 'text'); + conditionB = webdriver.until.elementTextMatches(el, /text/); + conditionB = webdriver.until.stalenessOf(el); + conditionB = webdriver.until.titleContains('text'); + conditionB = webdriver.until.titleIs('text'); + conditionB = webdriver.until.titleMatches(/text/); + + conditionWebElement = webdriver.until.elementLocated(webdriver.By.id('id')); + conditionWebElements = webdriver.until.elementsLocated(webdriver.By.className('class')); +} + +function TestControlFlow() { + var flow: webdriver.promise.ControlFlow; + flow = new webdriver.promise.ControlFlow(); + + var emitter: webdriver.EventEmitter = flow; + + var eventType: string; + + eventType = webdriver.promise.ControlFlow.EventType.IDLE; + eventType = webdriver.promise.ControlFlow.EventType.RESET; + eventType = webdriver.promise.ControlFlow.EventType.SCHEDULE_TASK; + eventType = webdriver.promise.ControlFlow.EventType.UNCAUGHT_EXCEPTION; + + var stringPromise: webdriver.promise.Promise; + stringPromise = flow.execute(function () { return 'value'; }); + stringPromise = flow.execute(function () { return stringPromise; }); + stringPromise = flow.execute(function () { return stringPromise; }, 'Description'); + + var schedule: string; + schedule = flow.toString(); + schedule = flow.getSchedule(); + schedule = flow.getSchedule(true); + + flow.reset(); + + var voidPromise: webdriver.promise.Promise = flow.timeout(123); + voidPromise = flow.timeout(123, 'Description'); + + stringPromise = flow.wait(stringPromise); + + voidPromise = flow.wait(function () { return true; }); + voidPromise = flow.wait(function () { return true; }, 123); + voidPromise = flow.wait(function () { return stringPromise; }, 123, 'Timeout Message'); +} + +function TestDeferred() { + var deferred: webdriver.promise.Deferred; + + deferred = new webdriver.promise.Deferred(); + deferred = new webdriver.promise.Deferred(new webdriver.promise.ControlFlow()); + + var promise: webdriver.promise.Promise = deferred.promise; + + deferred.errback(new Error('Error')); + deferred.errback('Error'); + deferred.fulfill('abc'); + deferred.reject(new Error('Error')); + deferred.reject('Error'); + deferred.removeAll(); +} + +function TestPromiseClass() { + var controlFlow: webdriver.promise.ControlFlow; + var promise: webdriver.promise.Promise; + promise = new webdriver.promise.Promise(function ( + resolve: (value: string) => void, + reject: () => void) { }); + promise = new webdriver.promise.Promise(function ( + resolve: (value: webdriver.promise.Promise) => void, + reject: () => void) { }); + promise = new webdriver.promise.Promise(function ( + resolve: (value: string) => void, + reject: () => void) { }, controlFlow); + + promise.cancel('Abort'); + + var isPending: boolean = promise.isPending(); + + promise = promise.then(); + promise = promise.then(function (a: string) { return 'cde'; }); + promise = promise.then(function (a: string) { return 'cde'; }, function (e: any) { }); + promise = promise.then(function (a: string) { return 'cde'; }, function (e: any) { return 123; }); + + promise = promise.thenCatch(function (error: any) { }); + + promise.thenFinally(function () { }); +} + +function TestThenableClass() { + var thenable: webdriver.promise.Promise = new webdriver.promise.Promise((resolve, reject) => { + resolve('a'); + }); + + thenable.cancel('Abort'); + + var isPending: boolean = thenable.isPending(); + + thenable = thenable.then(function (a: string) { return 'cde'; }); + thenable = thenable.then(function (a: string) { return 'cde'; }, function (e: any) { }); + thenable = thenable.then(function (a: string) { return 'cde'; }, function (e: any) { return 123; }); + + thenable = thenable.thenCatch(function (error: any) { }); + + thenable.thenFinally(function () { }); +} + +function TestErrorCode() { + var errorCode: number; + + errorCode = new webdriver.error.ElementNotSelectableError().code(); + errorCode = new webdriver.error.ElementNotVisibleError().code(); + errorCode = new webdriver.error.InvalidArgumentError().code(); + errorCode = new webdriver.error.InvalidCookieDomainError().code(); + errorCode = new webdriver.error.InvalidElementCoordinatesError().code(); + errorCode = new webdriver.error.InvalidElementStateError().code(); + errorCode = new webdriver.error.InvalidSelectorError().code(); + errorCode = new webdriver.error.NoSuchSessionError().code(); + errorCode = new webdriver.error.JavascriptError().code(); + errorCode = new webdriver.error.MoveTargetOutOfBoundsError().code(); + errorCode = new webdriver.error.NoSuchAlertError().code(); + errorCode = new webdriver.error.NoSuchElementError().code(); + errorCode = new webdriver.error.NoSuchFrameError().code(); + errorCode = new webdriver.error.NoSuchWindowError().code(); + errorCode = new webdriver.error.ScriptTimeoutError().code(); + errorCode = new webdriver.error.SessionNotCreatedError().code(); + errorCode = new webdriver.error.StaleElementReferenceError().code(); + errorCode = new webdriver.error.TimeoutError().code(); + errorCode = new webdriver.error.UnableToSetCookieError().code(); + errorCode = new webdriver.error.UnableToCaptureScreenError().code(); + errorCode = new webdriver.error.UnexpectedAlertOpenError().code(); + errorCode = new webdriver.error.UnknownCommandError().code(); + errorCode = new webdriver.error.UnknownMethodError().code(); + errorCode = new webdriver.error.UnsupportedOperationError().code(); +} + +async function TestAsyncAwaitable() { + var thenable: webdriver.promise.Promise = new webdriver.promise.Promise((resolve, reject) => resolve('foo')); + var str: string = await thenable; +} + +function TestTestingModule() { + testing.before(function () { + }); + + testing.beforeEach(function () { + }); + + testing.describe('My test suite', function () { + testing.it('My test', function () { + }); + + testing.iit('My exclusive test.', function () { + }); + + }); + + testing.xdescribe('My disabled suite', function () { + testing.xit('My disabled test.', function () { + }); + }); + + testing.after(function () { + }); + + testing.afterEach(function () { + }); +} diff --git a/selenium-webdriver/v2/testing.d.ts b/selenium-webdriver/v2/testing.d.ts new file mode 100644 index 0000000000..e17c8e0f21 --- /dev/null +++ b/selenium-webdriver/v2/testing.d.ts @@ -0,0 +1,63 @@ +declare namespace testing { + /** + * Registers a new test suite. + * @param name The suite name. + * @param fn The suite function, or {@code undefined} to define a pending test suite. + */ + function describe(name: string, fn: Function): void; + + /** + * Defines a suppressed test suite. + * @param name The suite name. + * @param fn The suite function, or {@code undefined} to define a pending test suite. + */ + function xdescribe(name: string, fn: Function): void; + + /** + * Register a function to call after the current suite finishes. + * @param fn + */ + function after(fn: Function): void; + + /** + * Register a function to call after each test in a suite. + * @param fn + */ + function afterEach(fn: Function): void; + + /** + * Register a function to call before the current suite starts. + * @param fn + */ + function before(fn: Function): void; + + /** + * Register a function to call before each test in a suite. + * @param fn + */ + function beforeEach(fn: Function): void; + + /** + * Add a test to the current suite. + * @param name The test name. + * @param fn The test function, or {@code undefined} to define a pending test case. + */ + function it(name: string, fn: Function): void; + + /** + * An alias for {@link #it()} that flags the test as the only one that should + * be run within the current suite. + * @param name The test name. + * @param fn The test function, or {@code undefined} to define a pending test case. + */ + function iit(name: string, fn: Function): void; + + /** + * Adds a test to the current suite while suppressing it so it is not run. + * @param name The test name. + * @param fn The test function, or {@code undefined} to define a pending test case. + */ + function xit(name: string, fn: Function): void; +} + +export = testing; \ No newline at end of file diff --git a/selenium-webdriver/v2/tsconfig.json b/selenium-webdriver/v2/tsconfig.json new file mode 100644 index 0000000000..a16c018a47 --- /dev/null +++ b/selenium-webdriver/v2/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": false, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "chrome.d.ts", + "edge.d.ts", + "executors.d.ts", + "firefox.d.ts", + "http.d.ts", + "ie.d.ts", + "opera.d.ts", + "remote.d.ts", + "safari.d.ts", + "testing.d.ts", + "test/index.ts", + "test/chrome.ts", + "test/firefox.ts" + ] +} \ No newline at end of file From e761557592ae2482374a06306c0cf8b02eaf2913 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Fri, 3 Feb 2017 23:03:13 -0500 Subject: [PATCH 370/797] Removes deprecated methods and updates some signatures --- selenium-webdriver/executors.d.ts | 11 - selenium-webdriver/firefox.d.ts | 8 +- selenium-webdriver/http.d.ts | 7 +- selenium-webdriver/index.d.ts | 383 +++++------------------------- selenium-webdriver/test/index.ts | 92 ++----- 5 files changed, 88 insertions(+), 413 deletions(-) delete mode 100644 selenium-webdriver/executors.d.ts diff --git a/selenium-webdriver/executors.d.ts b/selenium-webdriver/executors.d.ts deleted file mode 100644 index c7bf15ef8d..0000000000 --- a/selenium-webdriver/executors.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import * as webdriver from './index'; - -/** - * Creates a command executor that uses WebDriver's JSON wire protocol. - * @param {(string|!promise.Promise)} url The server's URL, - * or a promise that will resolve to that URL. - * @param {?string=} opt_proxy (optional) The URL of the HTTP proxy for the - * client to use. - * @returns {!./lib/command.Executor} The new command executor. - */ -export function createExecutor(url: string | webdriver.promise.Promise, opt_agent?: string, opt_proxy?: string): webdriver.Executor; diff --git a/selenium-webdriver/firefox.d.ts b/selenium-webdriver/firefox.d.ts index 7678c404ce..76f4f3d147 100644 --- a/selenium-webdriver/firefox.d.ts +++ b/selenium-webdriver/firefox.d.ts @@ -197,11 +197,13 @@ export class Options { setProxy(proxy: webdriver.ProxyConfig): Options; /** - * Sets whether to use Mozilla's Marionette to drive the browser. + * Sets whether to use Mozilla's geckodriver to drive the browser. This option + * is enabled by default and required for Firefox 47+. * - * @see https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver + * @param {boolean} enable Whether to enable the geckodriver. + * @see https://github.com/mozilla/geckodriver */ - useMarionette(marionette: any): Options; + useGeckoDriver(enable: boolean): Options; /** * Converts these options to a {@link capabilities.Capabilities} instance. diff --git a/selenium-webdriver/http.d.ts b/selenium-webdriver/http.d.ts index a0a25a7955..abe54a518e 100644 --- a/selenium-webdriver/http.d.ts +++ b/selenium-webdriver/http.d.ts @@ -99,10 +99,11 @@ export function sendRequest(options: Object, onOk: any, onError: any, opt_data?: */ export class Executor { /** - * @param {!HttpClient} client The client to use for sending requests to the - * server. + * @param {!(HttpClient|IThenable)} client The client to use for sending + * requests to the server, or a promise-like object that will resolve to + * to the client. */ - constructor(client: HttpClient); + constructor(client: HttpClient | webdriver.promise.IThenable); /** * Defines a new command for use with this executor. When a command is sent, diff --git a/selenium-webdriver/index.d.ts b/selenium-webdriver/index.d.ts index 25b9b96017..446286c8fe 100644 --- a/selenium-webdriver/index.d.ts +++ b/selenium-webdriver/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Selenium WebDriverJS 2.53 +// Type definitions for Selenium WebDriverJS 3.0.1 // Project: https://github.com/SeleniumHQ/selenium/tree/master/javascript/node/selenium-webdriver -// Definitions by: Bill Armstrong , Yuki Kokubun , Craig Nishina +// Definitions by: Bill Armstrong , Yuki Kokubun , Craig Nishina , Simon Gellis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -14,8 +14,6 @@ import * as safari from './safari'; export namespace error { class IError extends Error { constructor(opt_error?: string); - - code(): number; } /** @@ -1037,32 +1035,6 @@ export namespace promise { */ then(opt_callback?: (value: T) => IThenable | R, opt_errback?: (error: any) => any): Promise; - /** - * Registers a listener for when this promise is rejected. This is synonymous - * with the {@code catch} clause in a synchronous API: - *
    
    -     *   // Synchronous API:
    -     *   try {
    -     *     doSynchronousWork();
    -     *   } catch (ex) {
    -     *     console.error(ex);
    -     *   }
    -     *
    -     *   // Asynchronous promise API:
    -     *   doAsynchronousWork().thenCatch(function(ex) {
    -     *     console.error(ex);
    -     *   });
    -     * 
    - * - * @param {function(*): (R|promise.Promise.)} errback The function - * to call if this promise is rejected. The function should expect a single - * argument: the rejection reason. - * @return {!promise.Promise.} A new promise which will be - * resolved with the result of the invoked callback. - * @template R - */ - thenCatch(errback: (error: any) => any): Promise; - /** * Registers a listener for when this promise is rejected. This is synonymous * with the {@code catch} clause in a synchronous API: @@ -1089,47 +1061,6 @@ export namespace promise { catch(errback: Function): Promise; - /** - * Registers a listener to invoke when this promise is resolved, regardless - * of whether the promise's value was successfully computed. This function - * is synonymous with the {@code finally} clause in a synchronous API: - *
    
    -     *   // Synchronous API:
    -     *   try {
    -     *     doSynchronousWork();
    -     *   } finally {
    -     *     cleanUp();
    -     *   }
    -     *
    -     *   // Asynchronous promise API:
    -     *   doAsynchronousWork().thenFinally(cleanUp);
    -     * 
    - * - * Note: similar to the {@code finally} clause, if the registered - * callback returns a rejected promise or throws an error, it will silently - * replace the rejection error (if any) from this promise: - *
    
    -     *   try {
    -     *     throw Error('one');
    -     *   } finally {
    -     *     throw Error('two');  // Hides Error: one
    -     *   }
    -     *
    -     *   promise.rejected(Error('one'))
    -     *       .thenFinally(function() {
    -     *         throw Error('two');  // Hides Error: one
    -     *       });
    -     * 
    - * - * - * @param {function(): (R|promise.Promise.)} callback The function - * to call when this promise is resolved. - * @return {!promise.Promise.} A promise that will be fulfilled - * with the callback result. - * @template R - */ - thenFinally(callback: Function): Promise; - // endregion } @@ -1144,13 +1075,8 @@ export namespace promise { * the next turn of the event loop, the rejection will be passed to the * {@link promise.ControlFlow} as an unhandled failure. * - *

    If this Deferred is cancelled, the cancellation reason will be forward to - * the Deferred's canceller function (if provided). The canceller may return a - * truth-y value to override the reason provided for rejection. - * - * @extends {promise.Promise} */ - class Deferred extends Promise { + class Deferred { // region Constructors /** @@ -2121,32 +2047,6 @@ export class AlertPromise extends Alert implements promise.IThenable { */ then(opt_callback?: Function, opt_errback?: Function): promise.Promise; - /** - * Registers a listener for when this promise is rejected. This is synonymous - * with the {@code catch} clause in a synchronous API: - *

    
    -   *   // Synchronous API:
    -   *   try {
    -   *     doSynchronousWork();
    -   *   } catch (ex) {
    -   *     console.error(ex);
    -   *   }
    -   *
    -   *   // Asynchronous promise API:
    -   *   doAsynchronousWork().thenCatch(function(ex) {
    -   *     console.error(ex);
    -   *   });
    -   * 
    - * - * @param {function(*): (R|promise.Promise.)} errback The function - * to call if this promise is rejected. The function should expect a single - * argument: the rejection reason. - * @return {!promise.Promise.} A new promise which will be - * resolved with the result of the invoked callback. - * @template R - */ - thenCatch(errback: (error: any) => any): promise.Promise; - /** * Registers a listener for when this promise is rejected. This is synonymous * with the {@code catch} clause in a synchronous API: @@ -2171,52 +2071,6 @@ export class AlertPromise extends Alert implements promise.IThenable { * @template R */ catch(errback: Function): promise.Promise; - - - /** - * Registers a listener to invoke when this promise is resolved, regardless - * of whether the promise's value was successfully computed. This function - * is synonymous with the {@code finally} clause in a synchronous API: - *
    
    -   *   // Synchronous API:
    -   *   try {
    -   *     doSynchronousWork();
    -   *   } finally {
    -   *     cleanUp();
    -   *   }
    -   *
    -   *   // Asynchronous promise API:
    -   *   doAsynchronousWork().thenFinally(cleanUp);
    -   * 
    - * - * Note: similar to the {@code finally} clause, if the registered - * callback returns a rejected promise or throws an error, it will silently - * replace the rejection error (if any) from this promise: - *
    
    -   *   try {
    -   *     throw Error('one');
    -   *   } finally {
    -   *     throw Error('two');  // Hides Error: one
    -   *   }
    -   *
    -   *   promise.rejected(Error('one'))
    -   *       .thenFinally(function() {
    -   *         throw Error('two');  // Hides Error: one
    -   *       });
    -   * 
    - * - * - * @param {function(): (R|promise.Promise.)} callback The function - * to call when this promise is resolved. - * @return {!promise.Promise.} A promise that will be fulfilled - * with the callback result. - * @template R - */ - thenFinally(callback: Function): promise.Promise; -} - -/** @deprecated Use {@link error.UnexpectedAlertOpenError} instead. */ -export class UnhandledAlertError extends error.UnexpectedAlertOpenError { } /** @@ -2495,6 +2349,15 @@ export class Builder { setScrollBehavior(behavior: number): Builder; /** + * Sets the http agent to use for each request. + * If this method is not called, the Builder will use http.globalAgent by default. + * + * @param {http.Agent} agent The agent to use for each request. + * @return {!Builder} A self reference. + */ + usingHttpAgent(agent: any): Builder; + + /** * Sets the URL of a remote WebDriver server to use. Once a remote URL has been * specified, the builder direct all new clients to that server. If this method * is never called, the Builder will attempt to create all clients locally. @@ -3122,19 +2985,6 @@ export class Executor { execute(command: Command): promise.Promise } -/** - * Wraps a promised {@link Executor}, ensuring no commands are executed until - * the wrapped executor has been fully resolved. - * @implements {Executor} - */ -export class DeferredExecutor { - /** - * @param {!promise.Promise} delegate The promised delegate, which - * may be provided by any promise-like thenable object. - */ - constructor(delegate: promise.Promise); -} - /** * Describes an event listener registered on an {@linkplain EventEmitter}. */ @@ -3287,12 +3137,53 @@ export class Navigation { } interface IWebDriverOptionsCookie { + + /** + * The name of the cookie. + */ name: string; + + /** + * The cookie value. + */ value: string; + + /** + * The cookie path. Defaults to "/" when adding a cookie. + */ path?: string; + + /** + * The domain the cookie is visible to. Defaults to the current browsing + * context's document's URL when adding a cookie. + */ domain?: string; + + /** + * Whether the cookie is a secure cookie. Defaults to false when adding a new + * cookie. + */ secure?: boolean; - expiry?: number; + + /** + * Whether the cookie is an HTTP only cookie. Defaults to false when adding a + * new cookie. + */ + httpOnly?: boolean; + + /** + * When the cookie expires. + * + * When {@linkplain Options#addCookie() adding a cookie}, this may be specified + * in _seconds_ since Unix epoch (January 1, 1970). The expiry will default to + * 20 years in the future if omitted. + * + * The expiry is always returned in seconds since epoch when + * {@linkplain Options#getCookies() retrieving cookies} from the browser. + * + * @type {(!Date|number|undefined)} + */ + expiry?: number | Date; } /** @@ -3313,18 +3204,14 @@ export class Options { /** * Schedules a command to add a cookie. - * @param {string} name The cookie name. - * @param {string} value The cookie value. - * @param {string=} opt_path The cookie path. - * @param {string=} opt_domain The cookie domain. - * @param {boolean=} opt_isSecure Whether the cookie is secure. - * @param {(number|!Date)=} opt_expiry When the cookie expires. If specified - * as a number, should be in milliseconds since midnight, - * January 1, 1970 UTC. + * @param {IWebDriverOptionsCookie} spec Defines the cookie to add. * @return {!promise.Promise} A promise that will be resolved * when the cookie has been added to the page. + * @throws {error.InvalidArgumentError} if any of the cookie parameters are + * invalid. + * @throws {TypeError} if `spec` is not a cookie object. */ - addCookie(name: string, value: string, opt_path?: string, opt_domain?: string, opt_isSecure?: boolean, opt_expiry?: number | Date): promise.Promise; + addCookie(spec: IWebDriverOptionsCookie): webdriver.promise.Promise; /** * Schedules a command to delete all cookies visible to the current page. @@ -4061,7 +3948,7 @@ export class WebDriver { * by the driver. Unlike other commands, this error cannot be suppressed. In * other words, scheduling a command to find an element doubles as an assert * that the element is present on the page. To test whether an element is - * present on the page, use {@link #isElementPresent} instead. + * present on the page, use {@link #findElements}. * * The search criteria for an element may be defined using one of the * factories in the {@link By} namespace, or as a short-hand @@ -4093,24 +3980,6 @@ export class WebDriver { */ findElement(locator: By | Function): WebElementPromise; - /** - * Schedules a command to test if an element is present on the page. - * - * If given a DOM element, this function will check if it belongs to the - * document the driver is currently focused on. Otherwise, the function will - * test if at least one element can be found with the given search criteria. - * - * @param {!(by.By|Function)} locator The locator to use. - * @return {!promise.Promise} A promise that will resolve - * with whether the element is present on the page. - * @deprecated This method will be removed in Selenium 3.0 for consistency - * with the other Selenium language bindings. This method is equivalent - * to - * - * driver.findElements(locator).then(e => !!e.length); - */ - isElementPresent(locatorOrElement: By | Function): promise.Promise; - /** * Schedule a command to search for multiple elements on the page. * @@ -4366,13 +4235,6 @@ interface IWebElement { */ isDisplayed(): promise.Promise; - /** - * Schedules a command to retrieve the outer HTML of this element. - * @return {!promise.Promise} A promise that will be resolved with - * the element's outer HTML. - */ - getOuterHtml(): promise.Promise; - /** * @return {!promise.Promise.} A promise * that resolves to this element's JSON representation as defined by the @@ -4381,13 +4243,6 @@ interface IWebElement { */ getId(): promise.Promise; - /** - * Schedules a command to retrieve the inner HTML of this element. - * @return {!promise.Promise} A promise that will be resolved with the - * element's inner HTML. - */ - getInnerHtml(): promise.Promise; - // endregion } @@ -4398,7 +4253,7 @@ interface IWebElementFinders { * be returned by the driver. Unlike other commands, this error cannot be * suppressed. In other words, scheduling a command to find an element doubles * as an assert that the element is present on the page. To test whether an - * element is present on the page, use {@code #isElementPresent} instead. + * element is present on the page, use {@code #findElements}. * *

    The search criteria for an element may be defined using one of the * factories in the {@link By} namespace, or as a short-hand @@ -4434,17 +4289,6 @@ interface IWebElementFinders { */ findElement(locator: By | Function): WebElementPromise; - /** - * Schedules a command to test if there is at least one descendant of this - * element that matches the given search criteria. - * - * @param {!(Locator|By.Hash|Function)} locator The - * locator strategy to use when searching for the element. - * @return {!promise.Promise.} A promise that will be - * resolved with whether an element could be located on the page. - */ - isElementPresent(locator: By | Function): promise.Promise; - /** * Schedules a command to find all of the descendants of this element that * match the given search criteria. @@ -4551,18 +4395,13 @@ export class WebElement implements Serializable { */ getId(): promise.Promise; - /** - * @deprecated Use {@link #getId()} instead. - */ - getRawId(): any; - /** * Schedule a command to find a descendant of this element. If the element * cannot be found, a {@link bot.ErrorCode.NO_SUCH_ELEMENT} result will * be returned by the driver. Unlike other commands, this error cannot be * suppressed. In other words, scheduling a command to find an element doubles * as an assert that the element is present on the page. To test whether an - * element is present on the page, use {@link #isElementPresent} instead. + * element is present on the page, use {@link #findElements}. * * The search criteria for an element may be defined using one of the * factories in the {@link By} namespace, or as a short-hand @@ -4596,22 +4435,6 @@ export class WebElement implements Serializable { */ findElement(locator: By | Function): WebElementPromise; - /** - * Schedules a command to test if there is at least one descendant of this - * element that matches the given search criteria. - * - * @param {!(by.By|Function)} locator The locator strategy to use when - * searching for the element. - * @return {!promise.Promise} A promise that will be - * resolved with whether an element could be located on the page. - * @deprecated This method will be removed in Selenium 3.0 for consistency - * with the other Selenium language bindings. This method is equivalent - * to - * - * element.findElements(locator).then(e => !!e.length); - */ - isElementPresent(locator: By | Function): promise.Promise; - /** * Schedules a command to find all of the descendants of this element that * match the given search criteria. @@ -4817,20 +4640,6 @@ export class WebElement implements Serializable { */ takeScreenshot(opt_scroll?: boolean): promise.Promise; - /** - * Schedules a command to retrieve the outer HTML of this element. - * @return {!promise.Promise.} A promise that will be - * resolved with the element's outer HTML. - */ - getOuterHtml(): promise.Promise; - - /** - * Schedules a command to retrieve the inner HTML of this element. - * @return {!promise.Promise} A promise that will be resolved with the - * element's inner HTML. - */ - getInnerHtml(): promise.Promise; - /** @override */ serialize(): promise.Promise; } @@ -4908,74 +4717,6 @@ export class WebElementPromise extends WebElement implements promise.IThenable(opt_callback?: (value: WebElement) => R, opt_errback?: (error: any) => any): promise.Promise; - /** - * Registers a listener for when this promise is rejected. This is synonymous - * with the {@code catch} clause in a synchronous API: - *

    
    -   *   // Synchronous API:
    -   *   try {
    -   *     doSynchronousWork();
    -   *   } catch (ex) {
    -   *     console.error(ex);
    -   *   }
    -   *
    -   *   // Asynchronous promise API:
    -   *   doAsynchronousWork().thenCatch(function(ex) {
    -   *     console.error(ex);
    -   *   });
    -   * 
    - * - * @param {function(*): (R|promise.Promise.)} errback The function - * to call if this promise is rejected. The function should expect a single - * argument: the rejection reason. - * @return {!promise.Promise.} A new promise which will be - * resolved with the result of the invoked callback. - * @template R - */ - thenCatch(errback: (error: any) => any): promise.Promise; - - - /** - * Registers a listener to invoke when this promise is resolved, regardless - * of whether the promise's value was successfully computed. This function - * is synonymous with the {@code finally} clause in a synchronous API: - *
    
    -   *   // Synchronous API:
    -   *   try {
    -   *     doSynchronousWork();
    -   *   } finally {
    -   *     cleanUp();
    -   *   }
    -   *
    -   *   // Asynchronous promise API:
    -   *   doAsynchronousWork().thenFinally(cleanUp);
    -   * 
    - * - * Note: similar to the {@code finally} clause, if the registered - * callback returns a rejected promise or throws an error, it will silently - * replace the rejection error (if any) from this promise: - *
    
    -   *   try {
    -   *     throw Error('one');
    -   *   } finally {
    -   *     throw Error('two');  // Hides Error: one
    -   *   }
    -   *
    -   *   promise.rejected(Error('one'))
    -   *       .thenFinally(function() {
    -   *         throw Error('two');  // Hides Error: one
    -   *       });
    -   * 
    - * - * - * @param {function(): (R|promise.Promise.)} callback The function - * to call when this promise is resolved. - * @return {!promise.Promise.} A promise that will be fulfilled - * with the callback result. - * @template R - */ - thenFinally(callback: () => any): promise.Promise; - /** * Registers a listener for when this promise is rejected. This is synonymous * with the {@code catch} clause in a synchronous API: diff --git a/selenium-webdriver/test/index.ts b/selenium-webdriver/test/index.ts index 5d32724b15..80f489d5ac 100644 --- a/selenium-webdriver/test/index.ts +++ b/selenium-webdriver/test/index.ts @@ -1,16 +1,10 @@ import * as webdriver from 'selenium-webdriver'; import * as chrome from 'selenium-webdriver/chrome'; import * as firefox from 'selenium-webdriver/firefox'; +import * as http from 'selenium-webdriver/http'; import * as remote from 'selenium-webdriver/remote'; -import * as executors from 'selenium-webdriver/executors'; import * as testing from 'selenium-webdriver/testing'; -function TestExecutors() { - var exec: webdriver.Executor = executors.createExecutor('url'); - var promise: webdriver.promise.Promise; - exec = executors.createExecutor(promise); -} - function TestBuilder() { var builder: webdriver.Builder = new webdriver.Builder(); @@ -219,11 +213,6 @@ function TestCommand() { command = command.setParameters({ param: 123 }); } -function TestDeferredExecutor() { - var promise: webdriver.promise.Promise; - var executor: webdriver.DeferredExecutor = new webdriver.DeferredExecutor(promise); -} - function TestCommandName() { var command: string; @@ -469,14 +458,6 @@ function TestSession() { var data: string = session.toJSON(); } -function TestUnhandledAlertError() { - var someFunc = (error: webdriver.UnhandledAlertError) => { - var baseError: Error = error; - var str: string = error.getAlertText(); - str = error.toString(); - }; -} - function TestWebDriverFileDetector() { var driver: webdriver.WebDriver = new webdriver.Builder(). withCapabilities(webdriver.Capabilities.chrome()). @@ -519,13 +500,21 @@ function TestWebDriverOptions() { var options: webdriver.Options = new webdriver.Options(driver); var promise: webdriver.promise.Promise; + var name: string = 'name'; + var value: string = 'value'; + var path: string = 'path'; + var domain: string = 'domain'; + var secure: boolean = true; + var httpOnly: boolean = true; + // Add Cookie - promise = options.addCookie('name', 'value'); - promise = options.addCookie('name', 'value', 'path'); - promise = options.addCookie('name', 'value', 'path', 'domain'); - promise = options.addCookie('name', 'value', 'path', 'domain', true); - promise = options.addCookie('name', 'value', 'path', 'domain', true, 123); - promise = options.addCookie('name', 'value', 'path', 'domain', true, Date.now()); + promise = options.addCookie({ name, value }); + promise = options.addCookie({ name, value, path }); + promise = options.addCookie({ name, value, path, domain }); + promise = options.addCookie({ name, value, path, domain, secure }); + promise = options.addCookie({ name, value, path, domain, secure, httpOnly }); + promise = options.addCookie({ name, value, path, domain, secure, httpOnly, expiry: 123 }); + promise = options.addCookie({ name, value, path, domain, secure, httpOnly, expiry: Date.now() }); promise = options.deleteAllCookies(); promise = options.deleteCookie('name'); @@ -585,7 +574,8 @@ function TestWebDriverWindow() { function TestWebDriver() { var session: webdriver.Session = new webdriver.Session('ABC', webdriver.Capabilities.android()); var sessionPromise: webdriver.promise.Promise; - var executor: webdriver.Executor = executors.createExecutor('http://someserver'); + var httpClient: http.HttpClient = new http.HttpClient('http://someserver'); + var executor: http.Executor = new http.Executor(httpClient); var flow: webdriver.promise.ControlFlow = new webdriver.promise.ControlFlow(); var driver: webdriver.WebDriver = new webdriver.WebDriver(session, executor); driver = new webdriver.WebDriver(session, executor, flow); @@ -638,9 +628,6 @@ function TestWebDriver() { stringPromise = driver.getTitle(); stringPromise = driver.getWindowHandle(); - booleanPromise = driver.isElementPresent(webdriver.By.className('ABC')); - booleanPromise = driver.isElementPresent(webdriver.By.js('function(){}')); - var options: webdriver.Options = driver.manage(); var navigation: webdriver.Navigation = driver.navigate(); var locator: webdriver.TargetLocator = driver.switchTo(); @@ -691,14 +678,11 @@ function TestWebElement() { element = element.findElement(webdriver.By.id('ABC')); element.findElements(webdriver.By.className('ABC')).then((elements: webdriver.WebElement[]) => {}); - booleanPromise = element.isElementPresent(webdriver.By.className('ABC')); stringPromise = element.getAttribute('class'); stringPromise = element.getCssValue('display'); driver = element.getDriver(); - stringPromise = element.getInnerHtml(); element.getLocation().then((location: webdriver.ILocation) => {}); - stringPromise = element.getOuterHtml(); element.getSize().then((size: webdriver.ISize) => {}); stringPromise = element.getTagName(); stringPromise = element.getText(); @@ -712,7 +696,6 @@ function TestWebElement() { voidPromise = element.sendKeys('A', 1, webdriver.Key.BACK_SPACE, stringPromise); voidPromise = element.submit(); element.getId().then((id: string) => {}); - element.getRawId().then((id: string) => {}); element.serialize().then((id: webdriver.IWebElementId) => {}); booleanPromise = webdriver.WebElement.equals(element, new webdriver.WebElement(driver, 'elementId')); @@ -734,10 +717,6 @@ function TestWebElementPromise() { elementPromise.then((element: webdriver.WebElement) => {}); elementPromise.then((element: webdriver.WebElement) => {}, (error: any) => {}); elementPromise.then((element: webdriver.WebElement) => 'foo', (error: any) => {}).then((result: string) => {}); - - elementPromise.thenCatch((error: any) => {}).then((value: any) => {}); - - elementPromise.thenFinally(() => {}); } function TestLogging() { @@ -963,10 +942,6 @@ function TestPromiseClass() { promise = promise.then((a: string) => 'cde'); promise = promise.then((a: string) => 'cde', (e: any) => {}); promise = promise.then((a: string) => 'cde', (e: any) => 123); - - promise = promise.thenCatch((error: any) => {}); - - promise.thenFinally(() => {}); } function TestThenableClass() { @@ -981,39 +956,6 @@ function TestThenableClass() { thenable = thenable.then((a: string) => 'cde'); thenable = thenable.then((a: string) => 'cde', (e: any) => {}); thenable = thenable.then((a: string) => 'cde', (e: any) => 123); - - thenable = thenable.thenCatch((error: any) => {}); - - thenable.thenFinally(() => {}); -} - -function TestErrorCode() { - var errorCode: number; - - errorCode = new webdriver.error.ElementNotSelectableError().code(); - errorCode = new webdriver.error.ElementNotVisibleError().code(); - errorCode = new webdriver.error.InvalidArgumentError().code(); - errorCode = new webdriver.error.InvalidCookieDomainError().code(); - errorCode = new webdriver.error.InvalidElementCoordinatesError().code(); - errorCode = new webdriver.error.InvalidElementStateError().code(); - errorCode = new webdriver.error.InvalidSelectorError().code(); - errorCode = new webdriver.error.NoSuchSessionError().code(); - errorCode = new webdriver.error.JavascriptError().code(); - errorCode = new webdriver.error.MoveTargetOutOfBoundsError().code(); - errorCode = new webdriver.error.NoSuchAlertError().code(); - errorCode = new webdriver.error.NoSuchElementError().code(); - errorCode = new webdriver.error.NoSuchFrameError().code(); - errorCode = new webdriver.error.NoSuchWindowError().code(); - errorCode = new webdriver.error.ScriptTimeoutError().code(); - errorCode = new webdriver.error.SessionNotCreatedError().code(); - errorCode = new webdriver.error.StaleElementReferenceError().code(); - errorCode = new webdriver.error.TimeoutError().code(); - errorCode = new webdriver.error.UnableToSetCookieError().code(); - errorCode = new webdriver.error.UnableToCaptureScreenError().code(); - errorCode = new webdriver.error.UnexpectedAlertOpenError().code(); - errorCode = new webdriver.error.UnknownCommandError().code(); - errorCode = new webdriver.error.UnknownMethodError().code(); - errorCode = new webdriver.error.UnsupportedOperationError().code(); } async function TestAsyncAwaitable() { From 9e86c1150e03602ab1041f98fa6ba97642b42768 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Sat, 4 Feb 2017 15:34:34 -0500 Subject: [PATCH 371/797] Moves until.Condition, adds WebElementCondition --- selenium-webdriver/index.d.ts | 186 +++++++++++++++++++++++-------- selenium-webdriver/test/index.ts | 33 +++--- 2 files changed, 156 insertions(+), 63 deletions(-) diff --git a/selenium-webdriver/index.d.ts b/selenium-webdriver/index.d.ts index 446286c8fe..92509a66ad 100644 --- a/selenium-webdriver/index.d.ts +++ b/selenium-webdriver/index.d.ts @@ -1295,28 +1295,36 @@ export namespace promise { } } -export namespace until { +/** + * Defines a condition for use with WebDriver's WebDriver#wait wait command. + */ +export class Condition { /** - * Defines a condition to + * @param {string} message A descriptive error message. Should complete the + * sentence 'Waiting [...]' + * @param {function(!WebDriver): OUT} fn The condition function to + * evaluate on each iteration of the wait loop. + * @constructor */ - class Condition { + constructor(message: string, fn: (webdriver: WebDriver) => any); + + /** @return {string} A description of this condition. */ + description(): string; + + /** @type {function(!WebDriver): OUT} */ + fn(webdriver: WebDriver): any; +} + +/** + * Defines a condition that will result in a {@link WebElement}. + * + * @extends {Condition)>} + */ +export class WebElementCondition extends Condition { } + +export namespace until { + /** - * @param {string} message A descriptive error message. Should complete the - * sentence 'Waiting [...]' - * @param {function(!WebDriver): OUT} fn The condition function to - * evaluate on each iteration of the wait loop. - * @constructor - */ - constructor(message: string, fn: (webdriver: WebDriver) => any); - - /** @return {string} A description of this condition. */ - description(): string; - - /** @type {function(!WebDriver): OUT} */ - fn(webdriver: WebDriver): any; - } - - /** * Creates a condition that will wait until the input driver is able to switch * to the designated frame. The target frame may be specified as * @@ -1350,64 +1358,64 @@ export namespace until { * Creates a condition that will wait for the given element to be disabled. * * @param {!WebElement} element The element to test. - * @return {!until.Condition.} The new condition. + * @return {!WebElementCondition} The new condition. * @see WebDriver#isEnabled */ - function elementIsDisabled(element: WebElement): Condition; + function elementIsDisabled(element: WebElement): WebElementCondition; /** * Creates a condition that will wait for the given element to be enabled. * * @param {!WebElement} element The element to test. - * @return {!until.Condition.} The new condition. + * @return {!WebElementCondition} The new condition. * @see WebDriver#isEnabled */ - function elementIsEnabled(element: WebElement): Condition; + function elementIsEnabled(element: WebElement): WebElementCondition; /** * Creates a condition that will wait for the given element to be deselected. * * @param {!WebElement} element The element to test. - * @return {!until.Condition.} The new condition. + * @return {!WebElementCondition} The new condition. * @see WebDriver#isSelected */ - function elementIsNotSelected(element: WebElement): Condition; + function elementIsNotSelected(element: WebElement): WebElementCondition; /** * Creates a condition that will wait for the given element to be in the DOM, * yet not visible to the user. * * @param {!WebElement} element The element to test. - * @return {!until.Condition.} The new condition. + * @return {!WebElementCondition} The new condition. * @see WebDriver#isDisplayed */ - function elementIsNotVisible(element: WebElement): Condition; + function elementIsNotVisible(element: WebElement): WebElementCondition; /** * Creates a condition that will wait for the given element to be selected. * @param {!WebElement} element The element to test. - * @return {!until.Condition.} The new condition. + * @return {!WebElementCondition} The new condition. * @see WebDriver#isSelected */ - function elementIsSelected(element: WebElement): Condition; + function elementIsSelected(element: WebElement): WebElementCondition; /** * Creates a condition that will wait for the given element to become visible. * * @param {!WebElement} element The element to test. - * @return {!until.Condition.} The new condition. + * @return {!WebElementCondition} The new condition. * @see WebDriver#isDisplayed */ - function elementIsVisible(element: WebElement): Condition; + function elementIsVisible(element: WebElement): WebElementCondition; /** * Creates a condition that will loop until an element is * {@link ./WebDriver#findElement found} with the given locator. * * @param {!(By|Function)} locator The locator to use. - * @return {!until.Condition.} The new condition. + * @return {!WebElementCondition} The new condition. */ - function elementLocated(locator: By | Function): Condition; + function elementLocated(locator: By | Function): WebElementCondition; /** * Creates a condition that will wait for the given element's @@ -1416,10 +1424,10 @@ export namespace until { * * @param {!WebElement} element The element to test. * @param {string} substr The substring to search for. - * @return {!until.Condition.} The new condition. + * @return {!WebElementCondition} The new condition. * @see WebDriver#getText */ - function elementTextContains(element: WebElement, substr: string): Condition; + function elementTextContains(element: WebElement, substr: string): WebElementCondition; /** * Creates a condition that will wait for the given element's @@ -1428,10 +1436,10 @@ export namespace until { * * @param {!WebElement} element The element to test. * @param {string} text The expected text. - * @return {!until.Condition.} The new condition. + * @return {!WebElementCondition} The new condition. * @see WebDriver#getText */ - function elementTextIs(element: WebElement, text: string): Condition; + function elementTextIs(element: WebElement, text: string): WebElementCondition; /** * Creates a condition that will wait for the given element's @@ -1440,10 +1448,10 @@ export namespace until { * * @param {!WebElement} element The element to test. * @param {!RegExp} regex The regular expression to test against. - * @return {!until.Condition} The new condition. + * @return {!WebElementCondition} The new condition. * @see WebDriver#getText */ - function elementTextMatches(element: WebElement, regex: RegExp): Condition; + function elementTextMatches(element: WebElement, regex: RegExp): WebElementCondition; /** * Creates a condition that will loop until at least one element is @@ -1451,7 +1459,7 @@ export namespace until { * * @param {!(Locator|By.Hash|Function)} locator The locator * to use. - * @return {!until.Condition.>} The new + * @return {!Condition.>} The new * condition. */ function elementsLocated(locator: By | Function): Condition; @@ -1462,7 +1470,7 @@ export namespace until { * has loaded. * * @param {!WebElement} element The element that should become stale. - * @return {!until.Condition} The new condition. + * @return {!Condition} The new condition. */ function stalenessOf(element: WebElement): Condition; @@ -1472,7 +1480,7 @@ export namespace until { * * @param {string} substr The substring that should be present in the page * title. - * @return {!until.Condition.} The new condition. + * @return {!Condition.} The new condition. */ function titleContains(substr: string): Condition; @@ -1481,7 +1489,7 @@ export namespace until { * given value. * * @param {string} title The expected page title. - * @return {!until.Condition} The new condition. + * @return {!Condition} The new condition. */ function titleIs(title: string): Condition; @@ -1490,9 +1498,37 @@ export namespace until { * given regular expression. * * @param {!RegExp} regex The regular expression to test against. - * @return {!until.Condition.} The new condition. + * @return {!Condition.} The new condition. */ function titleMatches(regex: RegExp): Condition; + + /** + * Creates a condition that will wait for the current page's url to contain + * the given substring. + * + * @param {string} substrUrl The substring that should be present in the current + * URL. + * @return {!Condition} The new condition. + */ + function urlContains(substrUrl: string): Condition; + + /** + * Creates a condition that will wait for the current page's url to match the + * given value. + * + * @param {string} url The expected page url. + * @return {!Condition} The new condition. + */ + function urlIs(url: string): Condition; + + /** + * Creates a condition that will wait for the current page's url to match the + * given regular expression. + * + * @param {!RegExp} regex The regular expression to test against. + * @return {!Condition} The new condition. + */ + function urlMatches(regex: RegExp): Condition; } interface ILocation { @@ -3835,10 +3871,10 @@ export class WebDriver { /** * Schedules a command to wait for a condition to hold. The condition may be - * specified by a {@link until.Condition}, as a custom function, or + * specified by a {@link Condition}, as a custom function, or * as a {@link promise.Promise}. * - * For a {@link until.Condition} or function, the wait will repeatedly + * For a {@link Condition} or function, the wait will repeatedly * evaluate the condition until it returns a truthy value. If any errors occur * while evaluating the condition, they will be allowed to propagate. In the * event a condition returns a {@link promise.Promise promise}, the @@ -3846,6 +3882,10 @@ export class WebDriver { * whether the condition has been satisified. Note the resolution time for * a promise is factored into whether a wait has timed out. * + * Note, if the provided condition is a {@link WebElementCondition}, then + * the wait will return a {@link WebElementPromise} that will resolve to the + * element that satisified the condition. + * * *Example:* waiting up to 10 seconds for an element to be present and visible * on the page. * @@ -3867,7 +3907,7 @@ export class WebDriver { * driver.get(getServerUrl()); * * @param {!(promise.Promise| - * until.Condition| + * Condition| * function(!WebDriver): T)} condition The condition to * wait on, defined as a promise, condition object, or a function to * evaluate as a condition. @@ -3879,7 +3919,57 @@ export class WebDriver { * rejected if the condition times out. * @template T */ - wait(condition: promise.Promise | until.Condition | ((driver: WebDriver) => T) | Function, timeout?: number, opt_message?: string): promise.Promise; + wait(condition: promise.Promise | Condition | ((driver: WebDriver) => T) | Function, opt_timeout?: number, opt_message?: string): promise.Promise; + + /** + * Schedules a command to wait for a condition to hold. The condition may be + * specified by a {@link webdriver.Condition}, as a custom function, or + * as a {@link webdriver.promise.Promise}. + * + * For a {@link webdriver.Condition} or function, the wait will repeatedly + * evaluate the condition until it returns a truthy value. If any errors occur + * while evaluating the condition, they will be allowed to propagate. In the + * event a condition returns a {@link webdriver.promise.Promise promise}, the + * polling loop will wait for it to be resolved and use the resolved value for + * whether the condition has been satisified. Note the resolution time for + * a promise is factored into whether a wait has timed out. + * + * Note, if the provided condition is a {@link WebElementCondition}, then + * the wait will return a {@link WebElementPromise} that will resolve to the + * element that satisified the condition. + * + * *Example:* waiting up to 10 seconds for an element to be present and visible + * on the page. + * + * var button = driver.wait(until.elementLocated(By.id('foo'), 10000); + * button.click(); + * + * This function may also be used to block the command flow on the resolution + * of a {@link webdriver.promise.Promise promise}. When given a promise, the + * command will simply wait for its resolution before completing. A timeout may + * be provided to fail the command if the promise does not resolve before the + * timeout expires. + * + * *Example:* Suppose you have a function, `startTestServer`, that returns a + * promise for when a server is ready for requests. You can block a `WebDriver` + * client on this promise with: + * + * var started = startTestServer(); + * driver.wait(started, 5 * 1000, 'Server should start within 5 seconds'); + * driver.get(getServerUrl()); + * + * @param {!WebElementCondition} condition The condition to + * wait on, defined as a promise, condition object, or a function to + * evaluate as a condition. + * @param {number=} opt_timeout How long to wait for the condition to be true. + * @param {string=} opt_message An optional message to use if the wait times + * out. + * @return {!WebElementPromise} A promise that will be fulfilled + * with the first truthy value returned by the condition function, or + * rejected if the condition times out. + * @template T + */ + wait(condition: WebElementCondition, opt_timeout?: number, opt_message?: string): WebElementPromise; /** * Schedules a command to make the driver sleep for the given amount of time. diff --git a/selenium-webdriver/test/index.ts b/selenium-webdriver/test/index.ts index 80f489d5ac..7081b692a4 100644 --- a/selenium-webdriver/test/index.ts +++ b/selenium-webdriver/test/index.ts @@ -640,7 +640,7 @@ function TestWebDriver() { voidPromise = driver.sleep(123); stringPromise = driver.takeScreenshot(); - var booleanCondition: webdriver.until.Condition; + var booleanCondition: webdriver.Condition; booleanPromise = driver.wait(booleanPromise); booleanPromise = driver.wait(booleanCondition); booleanPromise = driver.wait((driver: webdriver.WebDriver) => true); @@ -850,29 +850,32 @@ function TestUntilModule() { withCapabilities(webdriver.Capabilities.chrome()). build(); - var conditionB: webdriver.until.Condition = new webdriver.until.Condition('message', (driver: webdriver.WebDriver) => true); - var conditionBBase: webdriver.until.Condition = conditionB; - var conditionWebElement: webdriver.until.Condition; - var conditionWebElements: webdriver.until.Condition; + var conditionB: webdriver.Condition = new webdriver.Condition('message', function (driver: webdriver.WebDriver) { return true; }); + var conditionBBase: webdriver.Condition = conditionB; + var conditionWebElement: webdriver.WebElementCondition; + var conditionWebElements: webdriver.Condition; conditionB = webdriver.until.ableToSwitchToFrame(5); - var conditionAlert: webdriver.until.Condition = webdriver.until.alertIsPresent(); + var conditionAlert: webdriver.Condition = webdriver.until.alertIsPresent(); var el: webdriver.WebElement = driver.findElement(webdriver.By.id('id')); - conditionB = webdriver.until.elementIsDisabled(el); - conditionB = webdriver.until.elementIsEnabled(el); - conditionB = webdriver.until.elementIsNotSelected(el); - conditionB = webdriver.until.elementIsNotVisible(el); - conditionB = webdriver.until.elementIsSelected(el); - conditionB = webdriver.until.elementIsVisible(el); - conditionB = webdriver.until.elementTextContains(el, 'text'); - conditionB = webdriver.until.elementTextIs(el, 'text'); - conditionB = webdriver.until.elementTextMatches(el, /text/); conditionB = webdriver.until.stalenessOf(el); conditionB = webdriver.until.titleContains('text'); conditionB = webdriver.until.titleIs('text'); conditionB = webdriver.until.titleMatches(/text/); + conditionB = webdriver.until.urlContains('text'); + conditionB = webdriver.until.urlIs('text'); + conditionB = webdriver.until.urlMatches(/text/); + conditionWebElement = webdriver.until.elementIsDisabled(el); + conditionWebElement = webdriver.until.elementIsEnabled(el); + conditionWebElement = webdriver.until.elementIsNotSelected(el); + conditionWebElement = webdriver.until.elementIsNotVisible(el); + conditionWebElement = webdriver.until.elementIsSelected(el); + conditionWebElement = webdriver.until.elementIsVisible(el); conditionWebElement = webdriver.until.elementLocated(webdriver.By.id('id')); + conditionWebElement = webdriver.until.elementTextContains(el, 'text'); + conditionWebElement = webdriver.until.elementTextIs(el, 'text'); + conditionWebElement = webdriver.until.elementTextMatches(el, /text/); conditionWebElements = webdriver.until.elementsLocated(webdriver.By.className('class')); } From 0b7cb8549cbeab9eb1bc17644d2f67811d0d1292 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Sun, 5 Feb 2017 16:27:17 -0500 Subject: [PATCH 372/797] Updates all the drivers and builders --- selenium-webdriver/chrome.d.ts | 78 ++++------------ selenium-webdriver/edge.d.ts | 43 ++------- selenium-webdriver/firefox.d.ts | 55 +++++++++++- selenium-webdriver/ie.d.ts | 7 +- selenium-webdriver/index.d.ts | 139 ++++++++++++++++------------- selenium-webdriver/opera.d.ts | 5 +- selenium-webdriver/remote.d.ts | 92 +++++++++++++++++++ selenium-webdriver/safari.d.ts | 8 +- selenium-webdriver/test/chrome.ts | 12 +-- selenium-webdriver/test/firefox.ts | 26 +++++- selenium-webdriver/test/index.ts | 8 -- 11 files changed, 291 insertions(+), 182 deletions(-) diff --git a/selenium-webdriver/chrome.d.ts b/selenium-webdriver/chrome.d.ts index ce26566f02..2604b99e89 100644 --- a/selenium-webdriver/chrome.d.ts +++ b/selenium-webdriver/chrome.d.ts @@ -1,5 +1,6 @@ import * as webdriver from './index'; import * as remote from './remote'; +import * as http from './http'; /** * Creates a new WebDriver client for Chrome. @@ -8,15 +9,19 @@ import * as remote from './remote'; */ export class Driver extends webdriver.WebDriver { /** - * @param {(webdriver.Capabilities|Options)=} opt_config The configuration - * options. - * @param {remote.DriverService=} opt_service The session to use; will use - * the {@link getDefaultService default service} by default. - * @param {webdriver.promise.ControlFlow=} opt_flow The control flow to use, or - * {@code null} to use the currently active flow. - * @constructor + * Creates a new session with the ChromeDriver. + * + * @param {(Capabilities|Options)=} opt_config The configuration options. + * @param {(remote.DriverService|http.Executor)=} opt_serviceExecutor Either + * a DriverService to use for the remote end, or a preconfigured executor + * for an externally managed endpoint. If neither is provided, the + * {@linkplain ##getDefaultService default service} will be used by + * default. + * @param {promise.ControlFlow=} opt_flow The control flow to use, or `null` + * to use the currently active flow. + * @return {!Driver} A new driver instance. */ - constructor(opt_config?: Options | webdriver.Capabilities, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow); + static createSession(opt_config?: Options | webdriver.CreateSessionCapabilities, opt_service?: remote.DriverService | http.Executor, opt_flow?: webdriver.promise.ControlFlow): Driver; } interface IOptionsValues { @@ -304,7 +309,7 @@ export class Options { * Creates {@link remote.DriverService} instances that manage a ChromeDriver * server. */ -export class ServiceBuilder { +export class ServiceBuilder extends remote.DriverService.Builder { /** * @param {string=} opt_exe Path to the server executable to use. If omitted, * the builder will attempt to locate the chromedriver on the current @@ -315,15 +320,6 @@ export class ServiceBuilder { */ constructor(opt_exe?: string); - /** - * Sets the port to start the ChromeDriver on. - * @param {number} port The port to use, or 0 for any free port. - * @return {!ServiceBuilder} A self reference. - * @throws {Error} If the port is invalid. - */ - usingPort(port: number): ServiceBuilder; - - /** * Sets which port adb is listening to. _The ChromeDriver will connect to adb * if an {@linkplain Options#androidPackage Android session} is requested, but @@ -332,7 +328,7 @@ export class ServiceBuilder { * @param {number} port Which port adb is running on. * @return {!ServiceBuilder} A self reference. */ - setAdbPort(port: number): ServiceBuilder; + setAdbPort(port: number): this; /** @@ -341,14 +337,14 @@ export class ServiceBuilder { * @param {string} path Path of the log file to use. * @return {!ServiceBuilder} A self reference. */ - loggingTo(path: string): ServiceBuilder; + loggingTo(path: string): this; /** * Enables verbose logging. * @return {!ServiceBuilder} A self reference. */ - enableVerboseLogging(): ServiceBuilder; + enableVerboseLogging(): this; /** @@ -357,45 +353,7 @@ export class ServiceBuilder { * @param {number} n The number of threads to use. * @return {!ServiceBuilder} A self reference. */ - setNumHttpThreads(n: number): ServiceBuilder; - - - /** - * Sets the base path for WebDriver REST commands (e.g. '/wd/hub'). - * By default, the driver will accept commands relative to '/'. - * @param {string} path The base path to use. - * @return {!ServiceBuilder} A self reference. - */ - setUrlBasePath(path: string): ServiceBuilder; - - - /** - * Defines the stdio configuration for the driver service. See - * {@code child_process.spawn} for more information. - * @param {(string|!Array.)} config The - * configuration to use. - * @return {!ServiceBuilder} A self reference. - */ - setStdio(config: string | Array): ServiceBuilder; - - - /** - * Defines the environment to start the server under. This settings will be - * inherited by every browser session started by the server. - * @param {!Object.} env The environment to use. - * @return {!ServiceBuilder} A self reference. - */ - withEnvironment(env: { [key: string]: string }): ServiceBuilder; - - - /** - * Creates a new DriverService using this instance's current configuration. - * @return {remote.DriverService} A new driver service using this instance's - * current configuration. - * @throws {Error} If the driver exectuable was not specified and a default - * could not be found on the current PATH. - */ - build(): remote.DriverService; + setNumHttpThreads(n: number): this; } /** diff --git a/selenium-webdriver/edge.d.ts b/selenium-webdriver/edge.d.ts index b18a959700..fbbbe343c3 100644 --- a/selenium-webdriver/edge.d.ts +++ b/selenium-webdriver/edge.d.ts @@ -3,14 +3,17 @@ import * as remote from './remote'; export class Driver extends webdriver.WebDriver { /** + * Creates a new browser session for Microsoft's Edge browser. + * * @param {(capabilities.Capabilities|Options)=} opt_config The configuration * options. * @param {remote.DriverService=} opt_service The session to use; will use * the {@linkplain #getDefaultService default service} by default. * @param {promise.ControlFlow=} opt_flow The control flow to use, or * {@code null} to use the currently active flow. + * @return {!Driver} A new driver instance. */ - constructor(opt_config?: webdriver.Capabilities | Options, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow); + static createSession(opt_config?: webdriver.CreateSessionCapabilities, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow): Driver; /** * This function is a no-op as file detectors are not supported by this @@ -56,14 +59,14 @@ export class Options { * merge these options into, if any. * @return {!capabilities.Capabilities} The capabilities. */ - toCapabilities(opt_capabilities: webdriver.Capabilities): webdriver.Capabilities; + toCapabilities(opt_capabilities?: webdriver.Capabilities): webdriver.Capabilities; } /** * Creates {@link remote.DriverService} instances that manage a * MicrosoftEdgeDriver server in a child process. */ -export class ServiceBuilder { +export class ServiceBuilder extends remote.DriverService.Builder { /** * @param {string=} opt_exe Path to the server executable to use. If omitted, * the builder will attempt to locate the MicrosoftEdgeDriver on the current @@ -72,40 +75,6 @@ export class ServiceBuilder { * MicrosoftEdgeDriver cannot be found on the PATH. */ constructor(opt_exe?: string); - - /** - * Defines the stdio configuration for the driver service. See - * {@code child_process.spawn} for more information. - * @param {(string|!Array.)} - * config The configuration to use. - * @return {!ServiceBuilder} A self reference. - */ - setStdio(config: string | Array): ServiceBuilder; - - /** - * Sets the port to start the MicrosoftEdgeDriver on. - * @param {number} port The port to use, or 0 for any free port. - * @return {!ServiceBuilder} A self reference. - * @throws {Error} If the port is invalid. - */ - usingPort(port: number): ServiceBuilder; - - /** - * Defines the environment to start the server under. This settings will be - * inherited by every browser session started by the server. - * @param {!Object.} env The environment to use. - * @return {!ServiceBuilder} A self reference. - */ - withEnvironment(env: Object): ServiceBuilder; - - /** - * Creates a new DriverService using this instance's current configuration. - * @return {!remote.DriverService} A new driver service using this instance's - * current configuration. - * @throws {Error} If the driver exectuable was not specified and a default - * could not be found on the current PATH. - */ - build(): remote.DriverService; } /** diff --git a/selenium-webdriver/firefox.d.ts b/selenium-webdriver/firefox.d.ts index 76f4f3d147..35a05d004c 100644 --- a/selenium-webdriver/firefox.d.ts +++ b/selenium-webdriver/firefox.d.ts @@ -1,5 +1,6 @@ import * as webdriver from './index'; import * as remote from './remote'; +import * as http from './http'; /** * Manages a Firefox subprocess configured for use with WebDriver. @@ -237,14 +238,32 @@ export function prepareProfile(profile: string | any, port: number): any; */ export class Driver extends webdriver.WebDriver { /** + * Creates a new Firefox session. + * * @param {(Options|capabilities.Capabilities|Object)=} opt_config The * configuration options for this driver, specified as either an * {@link Options} or {@link capabilities.Capabilities}, or as a raw hash * object. + * @param {(http.Executor|remote.DriverService)=} opt_executor Either a + * pre-configured command executor to use for communicating with an + * externally managed remote end (which is assumed to already be running), + * or the `DriverService` to use to start the geckodriver in a child + * process. + * + * If an executor is provided, care should e taken not to use reuse it with + * other clients as its internal command mappings will be updated to support + * Firefox-specific commands. + * + * _This parameter may only be used with Mozilla's GeckoDriver._ + * * @param {promise.ControlFlow=} opt_flow The flow to * schedule commands through. Defaults to the active flow object. + * @throws {Error} If a custom command executor is provided and the driver is + * configured to use the legacy FirefoxDriver from the Selenium project. + * @return {!Driver} A new driver instance. */ - constructor(opt_config?: Options | webdriver.Capabilities | Object, opt_flow?: webdriver.promise.ControlFlow); + static createSession(opt_config?: Options | webdriver.CreateSessionCapabilities, opt_executor?: http.Executor | remote.DriverService, opt_flow?: webdriver.promise.ControlFlow): Driver; + /** * This function is a no-op as file detectors are not supported by this @@ -253,3 +272,37 @@ export class Driver extends webdriver.WebDriver { */ setFileDetector(): void; } + +/** + * Creates {@link selenium-webdriver/remote.DriverService} instances that manage + * a [geckodriver](https://github.com/mozilla/geckodriver) server in a child + * process. + */ +export class ServiceBuilder extends remote.DriverService.Builder { + /** + * @param {string=} opt_exe Path to the server executable to use. If omitted, + * the builder will attempt to locate the geckodriver on the system PATH. + */ + constructor(opt_exe?: string); + + /** + * Enables verbose logging. + * + * @param {boolean=} opt_trace Whether to enable trace-level logging. By + * default, only debug logging is enabled. + * @return {!ServiceBuilder} A self reference. + */ + enableVerboseLogging(opt_trace?: boolean): this; + + /** + * Sets the path to the executable Firefox binary that the geckodriver should + * use. If this method is not called, this builder will attempt to locate + * Firefox in the default installation location for the current platform. + * + * @param {(string|!Binary)} binary Path to the executable Firefox binary to use. + * @return {!ServiceBuilder} A self reference. + * @see Binary#locate() + */ + setFirefoxBinary(binary: string | Binary): this; +} + diff --git a/selenium-webdriver/ie.d.ts b/selenium-webdriver/ie.d.ts index 9e8cab2457..2cdb184c49 100644 --- a/selenium-webdriver/ie.d.ts +++ b/selenium-webdriver/ie.d.ts @@ -5,12 +5,15 @@ import * as webdriver from './index'; */ export class Driver extends webdriver.WebDriver { /** + * Creates a new session for Microsoft's Internet Explorer. + * * @param {(capabilities.Capabilities|Options)=} opt_config The configuration * options. * @param {promise.ControlFlow=} opt_flow The control flow to use, * or {@code null} to use the currently active flow. + * @return {!Driver} A new driver instance. */ - constructor(opt_config?: webdriver.Capabilities | Options, opt_flow?: webdriver.promise.ControlFlow); + static createSession(opt_config?: webdriver.CreateSessionCapabilities | Options, opt_flow?: webdriver.promise.ControlFlow): Driver; /** * This function is a no-op as file detectors are not supported by this @@ -201,5 +204,5 @@ export class Options { * merge these options into, if any. * @return {!capabilities.Capabilities} The capabilities. */ - toCapabilities(opt_capabilities: webdriver.Capabilities): webdriver.Capabilities; + toCapabilities(opt_capabilities?: webdriver.Capabilities): webdriver.Capabilities; } diff --git a/selenium-webdriver/index.d.ts b/selenium-webdriver/index.d.ts index 92509a66ad..c1955714b2 100644 --- a/selenium-webdriver/index.d.ts +++ b/selenium-webdriver/index.d.ts @@ -801,19 +801,6 @@ export namespace promise { } interface IThenable { - /** - * Cancels the computation of this promise's value, rejecting the promise in - * the process. This method is a no-op if the promise has already been - * resolved. - * - * @param {(string|Error)=} opt_reason The reason this promise is being - * cancelled. This value will be wrapped in a {@link CancellationError}. - */ - cancel(opt_reason?: string | Error): void; - - /** @return {boolean} Whether this promise's value is still being computed. */ - isPending(): boolean; - /** * Registers listeners for when this instance is resolved. * @@ -863,19 +850,6 @@ export namespace promise { * @template T */ class Thenable implements IThenable { - /** - * Cancels the computation of this promise's value, rejecting the promise in - * the process. This method is a no-op if the promise has already been - * resolved. - * - * @param {(string|Error)=} opt_reason The reason this promise is being - * cancelled. This value will be wrapped in a {@link CancellationError}. - */ - cancel(opt_reason?: string | Error): void; - - /** @return {boolean} Whether this promise's value is still being computed. */ - isPending(): boolean; - /** * Registers listeners for when this instance is resolved. * @@ -1017,9 +991,6 @@ export namespace promise { */ cancel(opt_reason?: string | Error): void; - /** @return {boolean} Whether this promise's value is still being computed. */ - isPending(): boolean; - /** * Registers listeners for when this instance is resolved. This function most * overridden by subtypes. @@ -2065,9 +2036,6 @@ export class AlertPromise extends Alert implements promise.IThenable { */ cancel(opt_reason?: string | Error): void; - /** @return {boolean} Whether this promise's value is still being computed. */ - isPending(): boolean; - /** * Registers listeners for when this instance is resolved. This function most * overridden by subtypes. @@ -2203,32 +2171,16 @@ export class Builder { * Creates a new WebDriver client based on this builder's current * configuration. * - * While this method will immediately return a new WebDriver instance, any - * commands issued against it will be deferred until the associated browser - * has been fully initialized. Users may call {@link #buildAsync()} to obtain - * a promise that will not be fulfilled until the browser has been created - * (the difference is purely in style). + * This method will return a {@linkplain ThenableWebDriver} instance, allowing + * users to issue commands directly without calling `then()`. The returned + * thenable wraps a promise that will resolve to a concrete + * {@linkplain webdriver.WebDriver WebDriver} instance. The promise will be + * rejected if the remote end fails to create a new session. * - * @return {!WebDriver} A new WebDriver instance. + * @return {!ThenableWebDriver} A new WebDriver instance. * @throws {Error} If the current configuration is invalid. - * @see #buildAsync() */ - build(): WebDriver; - - /** - * Creates a new WebDriver client based on this builder's current - * configuration. This method returns a promise that will not be fulfilled - * until the new browser session has been fully initialized. - * - * __Note:__ this method is purely a convenience wrapper around - * {@link #build()}. - * - * @return {!promise.Promise} A promise that will be - * fulfilled with the newly created WebDriver instance once the browser - * has been fully initialized. - * @see #build() - */ - buildAsync(): promise.Promise; + build(): ThenableWebDriver; /** * Configures the target browser for clients created by this instance. @@ -3593,6 +3545,11 @@ export class FileDetector { handleFile(driver: WebDriver, path: string): promise.Promise; } + type CreateSessionCapabilities = Capabilities | { + desired?: Capabilities, + required?: Capabilities + } + /** * Creates a new WebDriver client, which provides control over a browser. * @@ -3643,17 +3600,63 @@ export class WebDriver { /** * Creates a new WebDriver session. + * + * By default, the requested session `capabilities` are merely "desired" and + * the remote end will still create a new session even if it cannot satisfy + * all of the requested capabilities. You can query which capabilities a + * session actually has using the + * {@linkplain #getCapabilities() getCapabilities()} method on the returned + * WebDriver instance. + * + * To define _required capabilities_, provide the `capabilities` as an object + * literal with `required` and `desired` keys. The `desired` key may be + * omitted if all capabilities are required, and vice versa. If the server + * cannot create a session with all of the required capabilities, it will + * return an {@linkplain error.SessionNotCreatedError}. + * + * let required = new Capabilities().set('browserName', 'firefox'); + * let desired = new Capabilities().set('version', '45'); + * let driver = WebDriver.createSession(executor, {required, desired}); + * + * This function will always return a WebDriver instance. If there is an error + * creating the session, such as the aforementioned SessionNotCreatedError, + * the driver will have a rejected {@linkplain #getSession session} promise. + * It is recommended that this promise is left _unhandled_ so it will + * propagate through the {@linkplain promise.ControlFlow control flow} and + * cause subsequent commands to fail. + * + * let required = Capabilities.firefox(); + * let driver = WebDriver.createSession(executor, {required}); + * + * // If the createSession operation failed, then this command will also + * // also fail, propagating the creation failure. + * driver.get('http://www.google.com').catch(e => console.log(e)); + * * @param {!command.Executor} executor The executor to create the new session * with. - * @param {!./capabilities.Capabilities} desiredCapabilities The desired + * @param {(!Capabilities| + * {desired: (Capabilities|undefined), + * required: (Capabilities|undefined)})} capabilities The desired * capabilities for the new session. * @param {promise.ControlFlow=} opt_flow The control flow all driver * commands should execute under, including the initial session creation. * Defaults to the {@link promise.controlFlow() currently active} * control flow. + * @param {(function(new: WebDriver, + * !IThenable, + * !command.Executor, + * promise.ControlFlow=))=} opt_ctor + * A reference to the constructor of the specific type of WebDriver client + * to instantiate. Will create a vanilla {@linkplain WebDriver} instance + * if a constructor is not provided. + * @param {(function(this: void): ?)=} opt_onQuit A callback to invoke when + * the newly created session is terminated. This should be used to clean + * up any resources associated with the session. * @return {!WebDriver} The driver for the newly created session. */ - static createSession(executor: Executor, desiredCapabilities: Capabilities, opt_flow?: promise.ControlFlow): WebDriver; + // This method's arguments are untyped so that its overloads can have correct types. + // Typescript doesn't allow static methods to be overridden with incompatible signatures. + static createSession(...var_args: any[]): WebDriver; // endregion @@ -4114,6 +4117,24 @@ export class WebDriver { // endregion } + /** + * A thenable wrapper around a {@linkplain webdriver.IWebDriver IWebDriver} + * instance that allows commands to be issued directly instead of having to + * repeatedly call `then`: + * + * let driver = new Builder().build(); + * driver.then(d => d.get(url)); // You can do this... + * driver.get(url); // ...or this + * + * If the driver instance fails to resolve (e.g. the session cannot be created), + * every issued command will fail. + * + * @extends {webdriver.IWebDriver} + * @extends {promise.IThenable} + * @interface + */ + interface ThenableWebDriver extends WebDriver, webdriver.promise.IThenable { } + interface IWebElementId { [ELEMENT: string]: string; } @@ -4774,10 +4795,6 @@ export class WebElementPromise extends WebElement implements promise.IThenable; } + module DriverService { + /** + * Creates {@link DriverService} objects that manage a WebDriver server in a + * child process. + */ + export class Builder { + /** + * @param {string} exe Path to the executable to use. This executable must + * accept the `--port` flag for defining the port to start the server on. + * @throws {Error} If the provided executable path does not exist. + */ + constructor(exe: string); + + /** + * Define additional command line arguments to use when starting the server. + * + * @param {...CommandLineFlag} var_args The arguments to include. + * @return {!THIS} A self reference. + * @this {THIS} + * @template THIS + */ + addArguments(...var_args: string[]): this; + + + /** + * Sets the host name to access the server on. If specified, the + * {@linkplain #setLoopback() loopback} setting will be ignored. + * + * @param {string} hostname + * @return {!DriverService.Builder} A self reference. + */ + setHostname(hostname: string): this; + + /** + * Sets whether the service should be accessed at this host's loopback + * address. + * + * @param {boolean} loopback + * @return {!DriverService.Builder} A self reference. + */ + setLoopback(loopback: boolean): this; + + /** + * Sets the base path for WebDriver REST commands (e.g. "/wd/hub"). + * By default, the driver will accept commands relative to "/". + * + * @param {?string} basePath The base path to use, or `null` to use the + * default. + * @return {!DriverService.Builder} A self reference. + */ + setPath(basePath: string | null): this; + + + /** + * Sets the port to start the server on. + * + * @param {number} port The port to use, or 0 for any free port. + * @return {!DriverService.Builder} A self reference. + * @throws {Error} If an invalid port is specified. + */ + setPort(port: number): this; + + /** + * Defines the environment to start the server under. This setting will be + * inherited by every browser session started by the server. By default, the + * server will inherit the enviroment of the current process. + * + * @param {(Map|Object|null)} env The desired + * environment to use, or `null` if the server should inherit the + * current environment. + * @return {!DriverService.Builder} A self reference. + */ + setEnvironment(env: Map | {[name:string]: string} | null): this; + + /** + * IO configuration for the spawned server process. For more information, + * refer to the documentation of `child_process.spawn`. + * + * @param {StdIoOptions} config The desired IO configuration. + * @return {!DriverService.Builder} A self reference. + * @see https://nodejs.org/dist/latest-v4.x/docs/api/child_process.html#child_process_options_stdio + */ + setStdio(config: any): this; + + /** + * Creates a new DriverService using this instance's current configuration. + * + * @return {!DriverService} A new driver service. + */ + build(): DriverService; + } + } diff --git a/selenium-webdriver/safari.d.ts b/selenium-webdriver/safari.d.ts index 7a6f1701c4..bbeb887410 100644 --- a/selenium-webdriver/safari.d.ts +++ b/selenium-webdriver/safari.d.ts @@ -65,7 +65,7 @@ export class Options { * merge these options into, if any. * @return {!Capabilities} The capabilities. */ - toCapabilities(opt_capabilities: webdriver.Capabilities): webdriver.Capabilities; + toCapabilities(opt_capabilities?: webdriver.Capabilities): webdriver.Capabilities; } /** @@ -79,11 +79,13 @@ export class Options { */ export class Driver extends webdriver.WebDriver { /** + * Creates a new Safari session. + * * @param {(Options|Capabilities)=} opt_config The configuration * options for the new session. * @param {promise.ControlFlow=} opt_flow The control flow to create * the driver under. + * @return {!Driver} A new driver instance. */ - constructor(opt_config?: Options | webdriver.Capabilities, opt_flow?: webdriver.promise.ControlFlow); - + static createSession(opt_config?: Options | webdriver.Capabilities, opt_flow?: webdriver.promise.ControlFlow): Driver; } diff --git a/selenium-webdriver/test/chrome.ts b/selenium-webdriver/test/chrome.ts index de358656bc..b26c43c2d6 100644 --- a/selenium-webdriver/test/chrome.ts +++ b/selenium-webdriver/test/chrome.ts @@ -3,9 +3,9 @@ import * as remote from 'selenium-webdriver/remote'; import * as webdriver from 'selenium-webdriver'; function TestChromeDriver() { - var driver: chrome.Driver = new chrome.Driver(); - driver = new chrome.Driver(webdriver.Capabilities.chrome()); - driver = new chrome.Driver(webdriver.Capabilities.chrome(), + var driver: chrome.Driver = chrome.Driver.createSession(); + driver = chrome.Driver.createSession(webdriver.Capabilities.chrome()); + driver = chrome.Driver.createSession(webdriver.Capabilities.chrome(), new remote.DriverService('executable', new chrome.Options()), new webdriver.promise.ControlFlow()); @@ -44,15 +44,15 @@ function TestServiceBuilder() { builder = new chrome.ServiceBuilder('exe'); var anything: any = builder.build(); - builder = builder.usingPort(8080); + builder = builder.setPort(8080); builder = builder.setAdbPort(5037); builder = builder.loggingTo('path'); builder = builder.enableVerboseLogging(); builder = builder.setNumHttpThreads(5); - builder = builder.setUrlBasePath('path'); + builder = builder.setPath('path'); builder = builder.setStdio('config'); builder = builder.setStdio(['A', 'B']); - builder = builder.withEnvironment({ A: 'a', B: 'b' }); + builder = builder.setEnvironment({ 'A': 'a', 'B': 'b' }); } function TestChromeModule() { diff --git a/selenium-webdriver/test/firefox.ts b/selenium-webdriver/test/firefox.ts index 8b329c8e73..38a3c3634e 100644 --- a/selenium-webdriver/test/firefox.ts +++ b/selenium-webdriver/test/firefox.ts @@ -1,6 +1,7 @@ import * as firefox from 'selenium-webdriver/firefox'; import * as remote from 'selenium-webdriver/remote'; import * as webdriver from 'selenium-webdriver'; +import * as http from 'selenium-webdriver/http'; function TestBinary() { var binary: firefox.Binary = new firefox.Binary(); @@ -12,9 +13,11 @@ function TestBinary() { } function TestFirefoxDriver() { - var driver: firefox.Driver = new firefox.Driver(); - driver = new firefox.Driver(webdriver.Capabilities.firefox()); - driver = new firefox.Driver(webdriver.Capabilities.firefox(), new webdriver.promise.ControlFlow()); + var driver: firefox.Driver = firefox.Driver.createSession(); + driver = firefox.Driver.createSession(webdriver.Capabilities.firefox()); + driver = firefox.Driver.createSession(webdriver.Capabilities.firefox(), new http.Executor(new http.HttpClient('http://someurl'))); + driver = firefox.Driver.createSession(webdriver.Capabilities.firefox(), new remote.DriverService('/dev/null', {})); + driver = firefox.Driver.createSession(webdriver.Capabilities.firefox(), new remote.DriverService('/dev/null', {}), new webdriver.promise.ControlFlow()); var baseDriver: webdriver.WebDriver = driver; } @@ -52,3 +55,20 @@ function TestFirefoxProfile() { var stringPromise: webdriver.promise.Promise = profile.writeToDisk(); stringPromise = profile.writeToDisk(true); } + + +function TestServiceBuilder() { + var builder: firefox.ServiceBuilder = new firefox.ServiceBuilder(); + builder = new firefox.ServiceBuilder('exe'); + + var anything: any = builder.build(); + builder = builder.setPort(8080); + builder = builder.enableVerboseLogging(); + builder = builder.enableVerboseLogging(true); + builder = builder.setFirefoxBinary('exe'); + builder = builder.setFirefoxBinary(new firefox.Binary()); + builder = builder.setPath('path'); + builder = builder.setStdio('config'); + builder = builder.setStdio(['A', 'B']); + builder = builder.setEnvironment({ 'A': 'a', 'B': 'b' }); +} diff --git a/selenium-webdriver/test/index.ts b/selenium-webdriver/test/index.ts index 7081b692a4..01abec5fb4 100644 --- a/selenium-webdriver/test/index.ts +++ b/selenium-webdriver/test/index.ts @@ -711,8 +711,6 @@ function TestWebElementPromise() { elementPromise.cancel(); elementPromise.cancel('reason'); - var bool: boolean = elementPromise.isPending(); - elementPromise.then(); elementPromise.then((element: webdriver.WebElement) => {}); elementPromise.then((element: webdriver.WebElement) => {}, (error: any) => {}); @@ -939,8 +937,6 @@ function TestPromiseClass() { promise.cancel('Abort'); - var isPending: boolean = promise.isPending(); - promise = promise.then(); promise = promise.then((a: string) => 'cde'); promise = promise.then((a: string) => 'cde', (e: any) => {}); @@ -952,10 +948,6 @@ function TestThenableClass() { resolve('a'); }); - thenable.cancel('Abort'); - - var isPending: boolean = thenable.isPending(); - thenable = thenable.then((a: string) => 'cde'); thenable = thenable.then((a: string) => 'cde', (e: any) => {}); thenable = thenable.then((a: string) => 'cde', (e: any) => 123); From 35e54b9bdd47eddda3d9f7e26158ce9302e5f927 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Sun, 5 Feb 2017 16:51:41 -0500 Subject: [PATCH 373/797] Updates documentation and refines getCookie return type --- selenium-webdriver/index.d.ts | 19 ++++++++++++++++--- selenium-webdriver/test/index.ts | 6 ++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/selenium-webdriver/index.d.ts b/selenium-webdriver/index.d.ts index c1955714b2..47a5045219 100644 --- a/selenium-webdriver/index.d.ts +++ b/selenium-webdriver/index.d.ts @@ -655,7 +655,8 @@ export namespace promise { /** * Creates a promise that has been resolved with the given value. * @param {T=} opt_value The resolved value. - * @return {!ManagedPromise} The resolved promise. + * @return {!Promise} The resolved promise. + * @deprecated Use {@link Promise#resolve Promise.resolve(value)}. * @template T */ function fulfilled(opt_value?: T): Promise; @@ -688,8 +689,8 @@ export namespace promise { * Creates a promise that has been rejected with the given reason. * @param {*=} opt_reason The rejection reason; may be any value, but is * usually an Error or a string. - * @return {!ManagedPromise} The rejected promise. - * @template T + * @return {!Promise} The rejected promise. + * @deprecated Use {@link Promise#reject Promise.Promise(reason)}. */ function rejected(opt_reason?: any): Promise; @@ -3172,6 +3173,18 @@ interface IWebDriverOptionsCookie { * @type {(!Date|number|undefined)} */ expiry?: number | Date; + } + + interface IWebDriverCookie extends IWebDriverOptionsCookie { + /** + * When the cookie expires. + * + * The expiry is always returned in seconds since epoch when + * {@linkplain Options#getCookies() retrieving cookies} from the browser. + * + * @type {(!number|undefined)} + */ + expiry?: number } /** diff --git a/selenium-webdriver/test/index.ts b/selenium-webdriver/test/index.ts index 01abec5fb4..1bdd54a381 100644 --- a/selenium-webdriver/test/index.ts +++ b/selenium-webdriver/test/index.ts @@ -518,8 +518,10 @@ function TestWebDriverOptions() { promise = options.deleteAllCookies(); promise = options.deleteCookie('name'); - options.getCookie('name').then((cookies: webdriver.IWebDriverOptionsCookie) => {}); - options.getCookies().then((cookies: webdriver.IWebDriverOptionsCookie[]) => {}); + options.getCookie('name').then(function (cookie: webdriver.IWebDriverCookie) { + var expiry: number = cookie.expiry; + }); + options.getCookies().then(function (cookies: webdriver.IWebDriverCookie[]) { }); var logs: webdriver.Logs = options.logs(); var timeouts: webdriver.Timeouts = options.timeouts(); From 7850a5ee24030fb3961e12cc2a2ec40d9a0a40b8 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Sun, 5 Feb 2017 17:01:05 -0500 Subject: [PATCH 374/797] Adds SOCKS proxy fields --- selenium-webdriver/index.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/selenium-webdriver/index.d.ts b/selenium-webdriver/index.d.ts index 47a5045219..9d74e28b9e 100644 --- a/selenium-webdriver/index.d.ts +++ b/selenium-webdriver/index.d.ts @@ -2106,6 +2106,9 @@ interface ProxyConfig { httpProxy?: string; sslProxy?: string; noProxy?: string; + socksProxy?: string, + socksUsername?: string, + socksPassword?: string } /** From d3c78c666e0746790e674564b9a8b48850792591 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Sun, 5 Feb 2017 18:16:22 -0500 Subject: [PATCH 375/797] Fixes findElement(s), Promise, and WebElementCondition types --- selenium-webdriver/index.d.ts | 63 +++++++++++++++++++++++--------- selenium-webdriver/test/index.ts | 10 ++++- 2 files changed, 53 insertions(+), 20 deletions(-) diff --git a/selenium-webdriver/index.d.ts b/selenium-webdriver/index.d.ts index 9d74e28b9e..67d43c3e2e 100644 --- a/selenium-webdriver/index.d.ts +++ b/selenium-webdriver/index.d.ts @@ -981,6 +981,27 @@ export namespace promise { */ constructor(resolver: (resolve: IFulfilledCallback, reject: IRejectedCallback) => void, opt_flow?: ControlFlow); + //region Static Methods + + /** + * Creates a promise that is immediately resolved with the given value. + * + * @param {T=} opt_value The value to resolve. + * @return {!ManagedPromise} A promise resolved with the given value. + * @template T + */ + static resolve(opt_value?: T): Promise; + + /** + * Creates a promise that is immediately rejected with the given reason. + * + * @param {*=} opt_reason The rejection reason. + * @return {!ManagedPromise} A new rejected promise. + */ + static reject(opt_reason?: any): Promise; + + //endregion + // region Methods /** @@ -1292,7 +1313,11 @@ export class Condition { * * @extends {Condition)>} */ -export class WebElementCondition extends Condition { } +export class WebElementCondition extends Condition { + // add an unused private member so the compiler treats this + // class distinct from other Conditions + private _nominal: void; +} export namespace until { @@ -1316,7 +1341,7 @@ export namespace until { * The frame identifier. * @return {!Condition} A new condition. */ - function ableToSwitchToFrame(frame: number | WebElement | By | ((webdriver: WebDriver) => WebElement)): Condition; + function ableToSwitchToFrame(frame: number | WebElement | By | ((webdriver: WebDriver) => WebElement) | ByHash): Condition; /** * Creates a condition that waits for an alert to be opened. Upon success, the @@ -1387,7 +1412,7 @@ export namespace until { * @param {!(By|Function)} locator The locator to use. * @return {!WebElementCondition} The new condition. */ - function elementLocated(locator: By | Function): WebElementCondition; + function elementLocated(locator: Locator): WebElementCondition; /** * Creates a condition that will wait for the given element's @@ -1434,7 +1459,7 @@ export namespace until { * @return {!Condition.>} The new * condition. */ - function elementsLocated(locator: By | Function): Condition; + function elementsLocated(locator: Locator): Condition; /** * Creates a condition that will wait for the given element to become stale. An @@ -2522,6 +2547,8 @@ type ByHash = { className: string } | { tagName: string } | { xpath: string }; + type Locator = By | Function | ByHash; + /** * Common webdriver capability keys. * @enum {string} @@ -3925,20 +3952,18 @@ export class WebDriver { * driver.wait(started, 5 * 1000, 'Server should start within 5 seconds'); * driver.get(getServerUrl()); * - * @param {!(promise.Promise| - * Condition| - * function(!WebDriver): T)} condition The condition to + * @param {!WebElementCondition} condition The condition to * wait on, defined as a promise, condition object, or a function to * evaluate as a condition. * @param {number=} opt_timeout How long to wait for the condition to be true. * @param {string=} opt_message An optional message to use if the wait times * out. - * @return {!promise.Promise} A promise that will be fulfilled + * @return {!WebElementPromise} A promise that will be fulfilled * with the first truthy value returned by the condition function, or * rejected if the condition times out. * @template T */ - wait(condition: promise.Promise | Condition | ((driver: WebDriver) => T) | Function, opt_timeout?: number, opt_message?: string): promise.Promise; + wait(condition: webdriver.WebElementCondition, opt_timeout?: number, opt_message?: string): WebElementPromise; /** * Schedules a command to wait for a condition to hold. The condition may be @@ -3977,18 +4002,20 @@ export class WebDriver { * driver.wait(started, 5 * 1000, 'Server should start within 5 seconds'); * driver.get(getServerUrl()); * - * @param {!WebElementCondition} condition The condition to + * @param {!(promise.Promise| + * Condition| + * function(!WebDriver): T)} condition The condition to * wait on, defined as a promise, condition object, or a function to * evaluate as a condition. * @param {number=} opt_timeout How long to wait for the condition to be true. * @param {string=} opt_message An optional message to use if the wait times * out. - * @return {!WebElementPromise} A promise that will be fulfilled + * @return {!promise.Promise} A promise that will be fulfilled * with the first truthy value returned by the condition function, or * rejected if the condition times out. * @template T */ - wait(condition: WebElementCondition, opt_timeout?: number, opt_message?: string): WebElementPromise; + wait(condition: promise.Promise | Condition | ((driver: WebDriver) => T | Promise) | Function, opt_timeout?: number, opt_message?: string): promise.Promise; /** * Schedules a command to make the driver sleep for the given amount of time. @@ -4087,7 +4114,7 @@ export class WebDriver { * commands against the located element. If the element is not found, the * element will be invalidated and all scheduled commands aborted. */ - findElement(locator: By | Function): WebElementPromise; + findElement(locator: Locator): WebElementPromise; /** * Schedule a command to search for multiple elements on the page. @@ -4096,7 +4123,7 @@ export class WebDriver { * @return {!promise.Promise.>} A * promise that will resolve to an array of WebElements. */ - findElements(locator: By | Function): promise.Promise; + findElements(locator: Locator): promise.Promise; /** * Schedule a command to take a screenshot. The driver makes a best effort to @@ -4414,7 +4441,7 @@ interface IWebElementFinders { * commands against the located element. If the element is not found, the * element will be invalidated and all scheduled commands aborted. */ - findElement(locator: By | Function): WebElementPromise; + findElement(locator: Locator): WebElementPromise; /** * Schedules a command to find all of the descendants of this element that @@ -4425,7 +4452,7 @@ interface IWebElementFinders { * @return {!promise.Promise.>} A * promise that will resolve to an array of WebElements. */ - findElements(locator: By | Function): promise.Promise; + findElements(locator: Locator): promise.Promise; } /** @@ -4560,7 +4587,7 @@ export class WebElement implements Serializable { * commands against the located element. If the element is not found, the * element will be invalidated and all scheduled commands aborted. */ - findElement(locator: By | Function): WebElementPromise; + findElement(locator: Locator): WebElementPromise; /** * Schedules a command to find all of the descendants of this element that @@ -4571,7 +4598,7 @@ export class WebElement implements Serializable { * @return {!promise.Promise>} A * promise that will resolve to an array of WebElements. */ - findElements(locator: By | Function): promise.Promise; + findElements(locator: Locator): promise.Promise; /** * Schedules a command to click on this element. diff --git a/selenium-webdriver/test/index.ts b/selenium-webdriver/test/index.ts index 1bdd54a381..9879c42256 100644 --- a/selenium-webdriver/test/index.ts +++ b/selenium-webdriver/test/index.ts @@ -587,6 +587,7 @@ function TestWebDriver() { var voidPromise: webdriver.promise.Promise; var stringPromise: webdriver.promise.Promise; var booleanPromise: webdriver.promise.Promise; + var webElementPromise: webdriver.WebElementPromise; var actions: webdriver.ActionSequence = driver.actions(); var touchActions: webdriver.TouchSequence = driver.touchActions(); @@ -646,10 +647,14 @@ function TestWebDriver() { booleanPromise = driver.wait(booleanPromise); booleanPromise = driver.wait(booleanCondition); booleanPromise = driver.wait((driver: webdriver.WebDriver) => true); - let conditionFunction: Function; // tslint:disable-line:prefer-const + booleanPromise = driver.wait((driver: webdriver.WebDriver) => Promise.resolve(true)); + booleanPromise = driver.wait((driver: webdriver.WebDriver) => webdriver.promise.Promise.resolve(true)); booleanPromise = driver.wait(conditionFunction); booleanPromise = driver.wait(booleanPromise, 123); booleanPromise = driver.wait(booleanPromise, 123, 'Message'); + let webElementCondition: webdriver.WebElementCondition; + webElementPromise = driver.wait(webElementCondition); + voidPromise = driver.wait(webElementCondition).click(); driver = webdriver.WebDriver.attachToSession(executor, 'ABC'); driver = webdriver.WebDriver.createSession(executor, webdriver.Capabilities.android()); @@ -679,7 +684,8 @@ function TestWebElement() { voidPromise = element.click(); element = element.findElement(webdriver.By.id('ABC')); - element.findElements(webdriver.By.className('ABC')).then((elements: webdriver.WebElement[]) => {}); + element = element.findElement({id: 'ABC'}); + element.findElements({className: 'ABC'}).then((elements: webdriver.WebElement[]) => { }); stringPromise = element.getAttribute('class'); stringPromise = element.getCssValue('display'); From e67fcdffe4b623ca12c78d808ad907b872b30242 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Sun, 5 Feb 2017 18:36:42 -0500 Subject: [PATCH 376/797] Removes deleted file from tsconfig --- selenium-webdriver/tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/selenium-webdriver/tsconfig.json b/selenium-webdriver/tsconfig.json index 6d56d236be..223a4d8293 100644 --- a/selenium-webdriver/tsconfig.json +++ b/selenium-webdriver/tsconfig.json @@ -20,7 +20,6 @@ "index.d.ts", "chrome.d.ts", "edge.d.ts", - "executors.d.ts", "firefox.d.ts", "http.d.ts", "ie.d.ts", From ce712294ff1f2d306aab6b2519a29535cf8e9101 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Sun, 5 Feb 2017 19:20:27 -0500 Subject: [PATCH 377/797] Updates dependents to point to old version, fixes old tsconfig.json --- protractor-helpers/index.d.ts | 2 +- protractor-helpers/protractor-helpers-tests.ts | 1 + protractor-helpers/tsconfig.json | 3 +++ protractor-http-mock/index.d.ts | 2 +- protractor-http-mock/tsconfig.json | 3 +++ selenium-webdriver/index.d.ts | 2 +- selenium-webdriver/v2/index.d.ts | 2 ++ selenium-webdriver/v2/tsconfig.json | 8 ++++++-- 8 files changed, 18 insertions(+), 5 deletions(-) diff --git a/protractor-helpers/index.d.ts b/protractor-helpers/index.d.ts index 9821f5ba0c..ed6c02d885 100644 --- a/protractor-helpers/index.d.ts +++ b/protractor-helpers/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -/// +import * as webdriver from 'selenium-webdriver'; // ElementArrayFinder diff --git a/protractor-helpers/protractor-helpers-tests.ts b/protractor-helpers/protractor-helpers-tests.ts index 9b03e43005..02ec9d294b 100644 --- a/protractor-helpers/protractor-helpers-tests.ts +++ b/protractor-helpers/protractor-helpers-tests.ts @@ -1,6 +1,7 @@ /// import helpers = require('protractor-helpers'); +import * as webdriver from 'selenium-webdriver'; declare var $$: any, $: any, by: any, element: any; // ?? diff --git a/protractor-helpers/tsconfig.json b/protractor-helpers/tsconfig.json index c3fc74ec13..84c5b93cd5 100644 --- a/protractor-helpers/tsconfig.json +++ b/protractor-helpers/tsconfig.json @@ -9,6 +9,9 @@ "strictNullChecks": false, "baseUrl": "../", "types": [], + "paths": { + "selenium-webdriver": ["selenium-webdriver/v2"] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, diff --git a/protractor-http-mock/index.d.ts b/protractor-http-mock/index.d.ts index 5f9dbcd79a..110883a8d3 100644 --- a/protractor-http-mock/index.d.ts +++ b/protractor-http-mock/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Crevil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +import * as webdriver from 'selenium-webdriver'; declare namespace mock { interface ProtractorHttpMock { diff --git a/protractor-http-mock/tsconfig.json b/protractor-http-mock/tsconfig.json index 1280c748d3..486d3cff30 100644 --- a/protractor-http-mock/tsconfig.json +++ b/protractor-http-mock/tsconfig.json @@ -9,6 +9,9 @@ "strictNullChecks": false, "baseUrl": "../", "types": [], + "paths": { + "selenium-webdriver": ["selenium-webdriver/v2"] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, diff --git a/selenium-webdriver/index.d.ts b/selenium-webdriver/index.d.ts index 67d43c3e2e..12eaa03ada 100644 --- a/selenium-webdriver/index.d.ts +++ b/selenium-webdriver/index.d.ts @@ -2547,7 +2547,7 @@ type ByHash = { className: string } | { tagName: string } | { xpath: string }; - type Locator = By | Function | ByHash; + export type Locator = By | Function | ByHash; /** * Common webdriver capability keys. diff --git a/selenium-webdriver/v2/index.d.ts b/selenium-webdriver/v2/index.d.ts index 17fba9ceae..374d63f740 100644 --- a/selenium-webdriver/v2/index.d.ts +++ b/selenium-webdriver/v2/index.d.ts @@ -2668,6 +2668,8 @@ declare namespace webdriver { { tagName: string } | { xpath: string }; + export type Locator = By | Function | ByHash; + /** * Common webdriver capability keys. * @enum {string} diff --git a/selenium-webdriver/v2/tsconfig.json b/selenium-webdriver/v2/tsconfig.json index a16c018a47..ed49d9d2b8 100644 --- a/selenium-webdriver/v2/tsconfig.json +++ b/selenium-webdriver/v2/tsconfig.json @@ -7,10 +7,14 @@ "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, - "baseUrl": "../", + "baseUrl": "../../", "typeRoots": [ - "../" + "../../" ], + "paths": { + "selenium-webdriver": ["selenium-webdriver/v2"], + "selenium-webdriver/*": ["selenium-webdriver/v2/*"] + }, "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true From a2f8e1b17023bf2b50dc40607faa4bdc3e5f0780 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Sun, 5 Feb 2017 19:59:53 -0500 Subject: [PATCH 378/797] Fixes build for selenium-webdriver on typescript@2.0 --- selenium-webdriver/index.d.ts | 2 +- selenium-webdriver/tsconfig.json | 1 + selenium-webdriver/v2/tsconfig.json | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/selenium-webdriver/index.d.ts b/selenium-webdriver/index.d.ts index 12eaa03ada..6f31b751a9 100644 --- a/selenium-webdriver/index.d.ts +++ b/selenium-webdriver/index.d.ts @@ -4015,7 +4015,7 @@ export class WebDriver { * rejected if the condition times out. * @template T */ - wait(condition: promise.Promise | Condition | ((driver: WebDriver) => T | Promise) | Function, opt_timeout?: number, opt_message?: string): promise.Promise; + wait(condition: PromiseLike | Condition | ((driver: WebDriver) => T | PromiseLike) | Function, opt_timeout?: number, opt_message?: string): promise.Promise; /** * Schedules a command to make the driver sleep for the given amount of time. diff --git a/selenium-webdriver/tsconfig.json b/selenium-webdriver/tsconfig.json index 223a4d8293..af95a57736 100644 --- a/selenium-webdriver/tsconfig.json +++ b/selenium-webdriver/tsconfig.json @@ -5,6 +5,7 @@ "lib": [ "es6" ], + "target": "es6", "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, diff --git a/selenium-webdriver/v2/tsconfig.json b/selenium-webdriver/v2/tsconfig.json index ed49d9d2b8..e1c6dcdce1 100644 --- a/selenium-webdriver/v2/tsconfig.json +++ b/selenium-webdriver/v2/tsconfig.json @@ -4,6 +4,7 @@ "lib": [ "es6" ], + "target": "es6", "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, From b435044b607f720ad5c41fdc5095cf92a06b6387 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Sun, 5 Feb 2017 23:06:49 -0500 Subject: [PATCH 379/797] Revert selenium-webdriver changes to protractor-helpers This module was broken before the changes to selenium-webdriver, and updating it causes the selenium-webdriver branch build to fail. --- protractor-helpers/index.d.ts | 2 +- protractor-helpers/protractor-helpers-tests.ts | 1 - protractor-helpers/tsconfig.json | 3 --- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/protractor-helpers/index.d.ts b/protractor-helpers/index.d.ts index ed6c02d885..9821f5ba0c 100644 --- a/protractor-helpers/index.d.ts +++ b/protractor-helpers/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -import * as webdriver from 'selenium-webdriver'; +/// // ElementArrayFinder diff --git a/protractor-helpers/protractor-helpers-tests.ts b/protractor-helpers/protractor-helpers-tests.ts index 02ec9d294b..9b03e43005 100644 --- a/protractor-helpers/protractor-helpers-tests.ts +++ b/protractor-helpers/protractor-helpers-tests.ts @@ -1,7 +1,6 @@ /// import helpers = require('protractor-helpers'); -import * as webdriver from 'selenium-webdriver'; declare var $$: any, $: any, by: any, element: any; // ?? diff --git a/protractor-helpers/tsconfig.json b/protractor-helpers/tsconfig.json index 84c5b93cd5..c3fc74ec13 100644 --- a/protractor-helpers/tsconfig.json +++ b/protractor-helpers/tsconfig.json @@ -9,9 +9,6 @@ "strictNullChecks": false, "baseUrl": "../", "types": [], - "paths": { - "selenium-webdriver": ["selenium-webdriver/v2"] - }, "noEmit": true, "forceConsistentCasingInFileNames": true }, From 710bd64dc122d6b3f8cdf4fce0b0ab4e8a4b1c68 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Thu, 16 Feb 2017 23:05:00 -0500 Subject: [PATCH 380/797] Fixes names of http.Request and http.Response --- selenium-webdriver/http.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/selenium-webdriver/http.d.ts b/selenium-webdriver/http.d.ts index abe54a518e..4fc12afb19 100644 --- a/selenium-webdriver/http.d.ts +++ b/selenium-webdriver/http.d.ts @@ -13,7 +13,7 @@ export function headersToString(headers: any): string; * responsibility to build the full URL for the final request. * @final */ -export class HttpRequest { +export class Request { /** * @param {string} method The HTTP method to use for the request. * @param {string} path The path on the server to send the request to. @@ -29,7 +29,7 @@ export class HttpRequest { * Represents a HTTP response message. * @final */ -export class HttpResponse { +export class Response { /** * @param {number} status The response code. * @param {!Object} headers The response headers. All header names @@ -70,7 +70,7 @@ export class HttpClient { * @return {!promise.Promise} A promise that will be fulfilled * with the server's response. */ - send(httpRequest: HttpRequest): webdriver.promise.Promise; + send(httpRequest: Request): webdriver.promise.Promise; } /** @@ -139,7 +139,7 @@ export function tryParse(str: string): any; * @return {{value: ?}} The parsed response. * @throws {WebDriverError} If the HTTP response is an error. */ -export function parseHttpResponse(httpResponse: HttpResponse, w3c: boolean): any; +export function parseHttpResponse(httpResponse: Response, w3c: boolean): any; /** * Builds a fully qualified path using the given set of command parameters. Each From 77307349a85db01cde6594be570bfde7cb1c7d31 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Thu, 16 Feb 2017 23:17:59 -0500 Subject: [PATCH 381/797] Removes CreateSessionCapabilities from some createSession signatures --- selenium-webdriver/firefox.d.ts | 2 +- selenium-webdriver/ie.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/selenium-webdriver/firefox.d.ts b/selenium-webdriver/firefox.d.ts index 35a05d004c..47753558e8 100644 --- a/selenium-webdriver/firefox.d.ts +++ b/selenium-webdriver/firefox.d.ts @@ -262,7 +262,7 @@ export class Driver extends webdriver.WebDriver { * configured to use the legacy FirefoxDriver from the Selenium project. * @return {!Driver} A new driver instance. */ - static createSession(opt_config?: Options | webdriver.CreateSessionCapabilities, opt_executor?: http.Executor | remote.DriverService, opt_flow?: webdriver.promise.ControlFlow): Driver; + static createSession(opt_config?: Options | webdriver.Capabilities, opt_executor?: http.Executor | remote.DriverService, opt_flow?: webdriver.promise.ControlFlow): Driver; /** diff --git a/selenium-webdriver/ie.d.ts b/selenium-webdriver/ie.d.ts index 2cdb184c49..f30f50afb3 100644 --- a/selenium-webdriver/ie.d.ts +++ b/selenium-webdriver/ie.d.ts @@ -13,7 +13,7 @@ export class Driver extends webdriver.WebDriver { * or {@code null} to use the currently active flow. * @return {!Driver} A new driver instance. */ - static createSession(opt_config?: webdriver.CreateSessionCapabilities | Options, opt_flow?: webdriver.promise.ControlFlow): Driver; + static createSession(opt_config?: webdriver.Capabilities | Options, opt_flow?: webdriver.promise.ControlFlow): Driver; /** * This function is a no-op as file detectors are not supported by this From c4f324a18e607a4df9553fc43f3a7553e27f9d5c Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Wed, 22 Feb 2017 20:45:35 -0500 Subject: [PATCH 382/797] Removes cancel from promises --- selenium-webdriver/index.d.ts | 27 --------------------------- selenium-webdriver/test/index.ts | 5 ----- 2 files changed, 32 deletions(-) diff --git a/selenium-webdriver/index.d.ts b/selenium-webdriver/index.d.ts index 6f31b751a9..f5c1c9a96b 100644 --- a/selenium-webdriver/index.d.ts +++ b/selenium-webdriver/index.d.ts @@ -1004,15 +1004,6 @@ export namespace promise { // region Methods - /** - * Cancels the computation of this promise's value, rejecting the promise in the - * process. - * @param {*} reason The reason this promise is being cancelled. If not an - * {@code Error}, one will be created using the value's string - * representation. - */ - cancel(opt_reason?: string | Error): void; - /** * Registers listeners for when this instance is resolved. This function most * overridden by subtypes. @@ -2053,15 +2044,6 @@ export class AlertPromise extends Alert implements promise.IThenable { // region Methods - /** - * Cancels the computation of this promise's value, rejecting the promise in the - * process. - * @param {*} reason The reason this promise is being cancelled. If not an - * {@code Error}, one will be created using the value's string - * representation. - */ - cancel(opt_reason?: string | Error): void; - /** * Registers listeners for when this instance is resolved. This function most * overridden by subtypes. @@ -4829,15 +4811,6 @@ export class WebElementPromise extends WebElement implements promise.IThenable); - /** - * Cancels the computation of this promise's value, rejecting the promise in the - * process. This method is a no-op if the promise has alreayd been resolved. - * - * @param {string=} opt_reason The reason this promise is being cancelled. - */ - cancel(opt_reason?: string): void; - - /** * Registers listeners for when this instance is resolved. * diff --git a/selenium-webdriver/test/index.ts b/selenium-webdriver/test/index.ts index 9879c42256..929408cbe8 100644 --- a/selenium-webdriver/test/index.ts +++ b/selenium-webdriver/test/index.ts @@ -716,9 +716,6 @@ function TestWebElementPromise() { var elementPromise: webdriver.WebElementPromise = driver.findElement(webdriver.By.id('id')); - elementPromise.cancel(); - elementPromise.cancel('reason'); - elementPromise.then(); elementPromise.then((element: webdriver.WebElement) => {}); elementPromise.then((element: webdriver.WebElement) => {}, (error: any) => {}); @@ -943,8 +940,6 @@ function TestPromiseClass() { promise = new webdriver.promise.Promise((resolve: (value: webdriver.promise.Promise) => void, reject: () => void) => {}); promise = new webdriver.promise.Promise((resolve: (value: string) => void, reject: () => void) => {}, controlFlow); - promise.cancel('Abort'); - promise = promise.then(); promise = promise.then((a: string) => 'cde'); promise = promise.then((a: string) => 'cde', (e: any) => {}); From 2039893ccebe219364203516736f5affac737fd3 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Wed, 22 Feb 2017 20:55:39 -0500 Subject: [PATCH 383/797] Fixes doc comments and typing of Promise --- selenium-webdriver/index.d.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/selenium-webdriver/index.d.ts b/selenium-webdriver/index.d.ts index f5c1c9a96b..b2e3d4f8d8 100644 --- a/selenium-webdriver/index.d.ts +++ b/selenium-webdriver/index.d.ts @@ -1005,17 +1005,17 @@ export namespace promise { // region Methods /** - * Registers listeners for when this instance is resolved. This function most - * overridden by subtypes. + * Registers listeners for when this instance is resolved. * - * @param opt_callback The function to call if this promise is - * successfully resolved. The function should expect a single argument: the - * promise's resolved value. - * @param opt_errback The function to call if this promise is - * rejected. The function should expect a single argument: the rejection - * reason. - * @return A new promise which will be resolved - * with the result of the invoked callback. + * @param {?(function(T): (R|IThenable))=} opt_callback The + * function to call if this promise is successfully resolved. The function + * should expect a single argument: the promise's resolved value. + * @param {?(function(*): (R|IThenable))=} opt_errback + * The function to call if this promise is rejected. The function should + * expect a single argument: the rejection reason. + * @return {!Thenable} A new promise which will be resolved with the result + * of the invoked callback. + * @template R */ then(opt_callback?: (value: T) => IThenable | R, opt_errback?: (error: any) => any): Promise; @@ -1042,7 +1042,7 @@ export namespace promise { * resolved with the result of the invoked callback. * @template R */ - catch(errback: Function): Promise; + catch(errback: (err: any) => R | IThenable): Promise; // endregion From 4f3da17fba137ef842d101af350a9d18dac406fd Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Wed, 1 Mar 2017 00:24:06 -0500 Subject: [PATCH 384/797] Fixes miscellaneous errors --- selenium-webdriver/index.d.ts | 6 +++--- selenium-webdriver/test/index.ts | 1 - selenium-webdriver/tsconfig.json | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/selenium-webdriver/index.d.ts b/selenium-webdriver/index.d.ts index b2e3d4f8d8..3d52c8d3b1 100644 --- a/selenium-webdriver/index.d.ts +++ b/selenium-webdriver/index.d.ts @@ -3224,7 +3224,7 @@ export class Options { * invalid. * @throws {TypeError} if `spec` is not a cookie object. */ - addCookie(spec: IWebDriverOptionsCookie): webdriver.promise.Promise; + addCookie(spec: IWebDriverOptionsCookie): promise.Promise; /** * Schedules a command to delete all cookies visible to the current page. @@ -3945,7 +3945,7 @@ export class WebDriver { * rejected if the condition times out. * @template T */ - wait(condition: webdriver.WebElementCondition, opt_timeout?: number, opt_message?: string): WebElementPromise; + wait(condition: WebElementCondition, opt_timeout?: number, opt_message?: string): WebElementPromise; /** * Schedules a command to wait for a condition to hold. The condition may be @@ -4158,7 +4158,7 @@ export class WebDriver { * @extends {promise.IThenable} * @interface */ - interface ThenableWebDriver extends WebDriver, webdriver.promise.IThenable { } + interface ThenableWebDriver extends WebDriver, promise.IThenable { } interface IWebElementId { [ELEMENT: string]: string; diff --git a/selenium-webdriver/test/index.ts b/selenium-webdriver/test/index.ts index 929408cbe8..749c22d5a3 100644 --- a/selenium-webdriver/test/index.ts +++ b/selenium-webdriver/test/index.ts @@ -649,7 +649,6 @@ function TestWebDriver() { booleanPromise = driver.wait((driver: webdriver.WebDriver) => true); booleanPromise = driver.wait((driver: webdriver.WebDriver) => Promise.resolve(true)); booleanPromise = driver.wait((driver: webdriver.WebDriver) => webdriver.promise.Promise.resolve(true)); - booleanPromise = driver.wait(conditionFunction); booleanPromise = driver.wait(booleanPromise, 123); booleanPromise = driver.wait(booleanPromise, 123, 'Message'); let webElementCondition: webdriver.WebElementCondition; diff --git a/selenium-webdriver/tsconfig.json b/selenium-webdriver/tsconfig.json index af95a57736..a72458a455 100644 --- a/selenium-webdriver/tsconfig.json +++ b/selenium-webdriver/tsconfig.json @@ -5,7 +5,6 @@ "lib": [ "es6" ], - "target": "es6", "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, @@ -33,4 +32,4 @@ "test/firefox.ts", "test/remote.ts" ] -} \ No newline at end of file +} From 96c2f0f7c35818359fca545d6c8489bb8ec0ccdf Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Wed, 1 Mar 2017 01:01:23 -0500 Subject: [PATCH 385/797] Fixes linter/indentation errors --- selenium-webdriver/edge.d.ts | 2 +- selenium-webdriver/firefox.d.ts | 34 ++--- selenium-webdriver/ie.d.ts | 6 +- selenium-webdriver/index.d.ts | 39 +++--- selenium-webdriver/opera.d.ts | 2 +- selenium-webdriver/remote.d.ts | 186 +++++++++++++------------- selenium-webdriver/test/index.ts | 6 +- selenium-webdriver/tslint.json | 2 +- selenium-webdriver/v2/chrome.d.ts | 1 + selenium-webdriver/v2/edge.d.ts | 1 + selenium-webdriver/v2/executors.d.ts | 1 + selenium-webdriver/v2/firefox.d.ts | 1 + selenium-webdriver/v2/http.d.ts | 1 + selenium-webdriver/v2/ie.d.ts | 1 + selenium-webdriver/v2/index.d.ts | 1 + selenium-webdriver/v2/opera.d.ts | 1 + selenium-webdriver/v2/remote.d.ts | 1 + selenium-webdriver/v2/safari.d.ts | 1 + selenium-webdriver/v2/test/chrome.ts | 1 + selenium-webdriver/v2/test/firefox.ts | 1 + selenium-webdriver/v2/test/index.ts | 1 + selenium-webdriver/v2/testing.d.ts | 3 +- 22 files changed, 156 insertions(+), 137 deletions(-) diff --git a/selenium-webdriver/edge.d.ts b/selenium-webdriver/edge.d.ts index fbbbe343c3..3fb3408b1f 100644 --- a/selenium-webdriver/edge.d.ts +++ b/selenium-webdriver/edge.d.ts @@ -11,7 +11,7 @@ export class Driver extends webdriver.WebDriver { * the {@linkplain #getDefaultService default service} by default. * @param {promise.ControlFlow=} opt_flow The control flow to use, or * {@code null} to use the currently active flow. - * @return {!Driver} A new driver instance. + * @return {!Driver} A new driver instance. */ static createSession(opt_config?: webdriver.CreateSessionCapabilities, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow): Driver; diff --git a/selenium-webdriver/firefox.d.ts b/selenium-webdriver/firefox.d.ts index 47753558e8..6746c3c683 100644 --- a/selenium-webdriver/firefox.d.ts +++ b/selenium-webdriver/firefox.d.ts @@ -238,29 +238,29 @@ export function prepareProfile(profile: string | any, port: number): any; */ export class Driver extends webdriver.WebDriver { /** - * Creates a new Firefox session. - * + * Creates a new Firefox session. + * * @param {(Options|capabilities.Capabilities|Object)=} opt_config The * configuration options for this driver, specified as either an * {@link Options} or {@link capabilities.Capabilities}, or as a raw hash * object. - * @param {(http.Executor|remote.DriverService)=} opt_executor Either a - * pre-configured command executor to use for communicating with an - * externally managed remote end (which is assumed to already be running), - * or the `DriverService` to use to start the geckodriver in a child - * process. - * - * If an executor is provided, care should e taken not to use reuse it with - * other clients as its internal command mappings will be updated to support - * Firefox-specific commands. - * - * _This parameter may only be used with Mozilla's GeckoDriver._ - * + * @param {(http.Executor|remote.DriverService)=} opt_executor Either a + * pre-configured command executor to use for communicating with an + * externally managed remote end (which is assumed to already be running), + * or the `DriverService` to use to start the geckodriver in a child + * process. + * + * If an executor is provided, care should e taken not to use reuse it with + * other clients as its internal command mappings will be updated to support + * Firefox-specific commands. + * + * _This parameter may only be used with Mozilla's GeckoDriver._ + * * @param {promise.ControlFlow=} opt_flow The flow to * schedule commands through. Defaults to the active flow object. - * @throws {Error} If a custom command executor is provided and the driver is - * configured to use the legacy FirefoxDriver from the Selenium project. - * @return {!Driver} A new driver instance. + * @throws {Error} If a custom command executor is provided and the driver is + * configured to use the legacy FirefoxDriver from the Selenium project. + * @return {!Driver} A new driver instance. */ static createSession(opt_config?: Options | webdriver.Capabilities, opt_executor?: http.Executor | remote.DriverService, opt_flow?: webdriver.promise.ControlFlow): Driver; diff --git a/selenium-webdriver/ie.d.ts b/selenium-webdriver/ie.d.ts index f30f50afb3..bf3932450e 100644 --- a/selenium-webdriver/ie.d.ts +++ b/selenium-webdriver/ie.d.ts @@ -5,13 +5,13 @@ import * as webdriver from './index'; */ export class Driver extends webdriver.WebDriver { /** - * Creates a new session for Microsoft's Internet Explorer. - * + * Creates a new session for Microsoft's Internet Explorer. + * * @param {(capabilities.Capabilities|Options)=} opt_config The configuration * options. * @param {promise.ControlFlow=} opt_flow The control flow to use, * or {@code null} to use the currently active flow. - * @return {!Driver} A new driver instance. + * @return {!Driver} A new driver instance. */ static createSession(opt_config?: webdriver.Capabilities | Options, opt_flow?: webdriver.promise.ControlFlow): Driver; diff --git a/selenium-webdriver/index.d.ts b/selenium-webdriver/index.d.ts index 3d52c8d3b1..bfd583302e 100644 --- a/selenium-webdriver/index.d.ts +++ b/selenium-webdriver/index.d.ts @@ -1,6 +1,9 @@ -// Type definitions for Selenium WebDriverJS 3.0.1 +// Type definitions for Selenium WebDriverJS 3.0 // Project: https://github.com/SeleniumHQ/selenium/tree/master/javascript/node/selenium-webdriver -// Definitions by: Bill Armstrong , Yuki Kokubun , Craig Nishina , Simon Gellis +// Definitions by: Bill Armstrong , +// Yuki Kokubun , +// Craig Nishina , +// Simon Gellis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -1307,7 +1310,7 @@ export class Condition { export class WebElementCondition extends Condition { // add an unused private member so the compiler treats this // class distinct from other Conditions - private _nominal: void; + private _nominal: undefined; } export namespace until { @@ -2113,9 +2116,9 @@ interface ProxyConfig { httpProxy?: string; sslProxy?: string; noProxy?: string; - socksProxy?: string, - socksUsername?: string, - socksPassword?: string + socksProxy?: string, + socksUsername?: string, + socksPassword?: string } /** @@ -2348,15 +2351,15 @@ export class Builder { setScrollBehavior(behavior: number): Builder; /** - * Sets the http agent to use for each request. - * If this method is not called, the Builder will use http.globalAgent by default. - * - * @param {http.Agent} agent The agent to use for each request. - * @return {!Builder} A self reference. - */ - usingHttpAgent(agent: any): Builder; + * Sets the http agent to use for each request. + * If this method is not called, the Builder will use http.globalAgent by default. + * + * @param {http.Agent} agent The agent to use for each request. + * @return {!Builder} A self reference. + */ + usingHttpAgent(agent: any): Builder; - /** + /** * Sets the URL of a remote WebDriver server to use. Once a remote URL has been * specified, the builder direct all new clients to that server. If this method * is never called, the Builder will attempt to create all clients locally. @@ -3910,10 +3913,10 @@ export class WebDriver { * whether the condition has been satisified. Note the resolution time for * a promise is factored into whether a wait has timed out. * - * Note, if the provided condition is a {@link WebElementCondition}, then - * the wait will return a {@link WebElementPromise} that will resolve to the - * element that satisified the condition. - * + * Note, if the provided condition is a {@link WebElementCondition}, then + * the wait will return a {@link WebElementPromise} that will resolve to the + * element that satisified the condition. + * * *Example:* waiting up to 10 seconds for an element to be present and visible * on the page. * diff --git a/selenium-webdriver/opera.d.ts b/selenium-webdriver/opera.d.ts index 2fb57cf13e..b4d118f6a7 100644 --- a/selenium-webdriver/opera.d.ts +++ b/selenium-webdriver/opera.d.ts @@ -163,7 +163,7 @@ export class Driver extends webdriver.WebDriver { * the {@link getDefaultService default service} by default. * @param {promise.ControlFlow=} opt_flow The control flow to use, * or {@code null} to use the currently active flow. - * @return {!Driver} A new driver instance. + * @return {!Driver} A new driver instance. */ static createSession(opt_config?: webdriver.Capabilities | Options, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow): Driver; diff --git a/selenium-webdriver/remote.d.ts b/selenium-webdriver/remote.d.ts index 24a6840a60..15303a6d7f 100644 --- a/selenium-webdriver/remote.d.ts +++ b/selenium-webdriver/remote.d.ts @@ -66,6 +66,100 @@ export class DriverService { stop(): webdriver.promise.Promise; } +export module DriverService { + + /** + * Creates {@link DriverService} objects that manage a WebDriver server in a + * child process. + */ + export class Builder { + /** + * @param {string} exe Path to the executable to use. This executable must + * accept the `--port` flag for defining the port to start the server on. + * @throws {Error} If the provided executable path does not exist. + */ + constructor(exe: string); + + /** + * Define additional command line arguments to use when starting the server. + * + * @param {...CommandLineFlag} var_args The arguments to include. + * @return {!THIS} A self reference. + * @this {THIS} + * @template THIS + */ + addArguments(...var_args: string[]): this; + + + /** + * Sets the host name to access the server on. If specified, the + * {@linkplain #setLoopback() loopback} setting will be ignored. + * + * @param {string} hostname + * @return {!DriverService.Builder} A self reference. + */ + setHostname(hostname: string): this; + + /** + * Sets whether the service should be accessed at this host's loopback + * address. + * + * @param {boolean} loopback + * @return {!DriverService.Builder} A self reference. + */ + setLoopback(loopback: boolean): this; + + /** + * Sets the base path for WebDriver REST commands (e.g. "/wd/hub"). + * By default, the driver will accept commands relative to "/". + * + * @param {?string} basePath The base path to use, or `null` to use the + * default. + * @return {!DriverService.Builder} A self reference. + */ + setPath(basePath: string | null): this; + + + /** + * Sets the port to start the server on. + * + * @param {number} port The port to use, or 0 for any free port. + * @return {!DriverService.Builder} A self reference. + * @throws {Error} If an invalid port is specified. + */ + setPort(port: number): this; + + /** + * Defines the environment to start the server under. This setting will be + * inherited by every browser session started by the server. By default, the + * server will inherit the enviroment of the current process. + * + * @param {(Map|Object|null)} env The desired + * environment to use, or `null` if the server should inherit the + * current environment. + * @return {!DriverService.Builder} A self reference. + */ + setEnvironment(env: Map | {[name: string]: string} | null): this; + + /** + * IO configuration for the spawned server process. For more information, + * refer to the documentation of `child_process.spawn`. + * + * @param {StdIoOptions} config The desired IO configuration. + * @return {!DriverService.Builder} A self reference. + * @see https://nodejs.org/dist/latest-v4.x/docs/api/child_process.html#child_process_options_stdio + */ + setStdio(config: any): this; + + /** + * Creates a new DriverService using this instance's current configuration. + * + * @return {!DriverService} A new driver service. + */ + build(): DriverService; + } +} + /** * A {@link webdriver.FileDetector} that may be used when running * against a remote @@ -103,95 +197,3 @@ export class FileDetector extends webdriver.FileDetector { */ handleFile(driver: webdriver.WebDriver, file: string): webdriver.promise.Promise; } - module DriverService { - /** - * Creates {@link DriverService} objects that manage a WebDriver server in a - * child process. - */ - export class Builder { - /** - * @param {string} exe Path to the executable to use. This executable must - * accept the `--port` flag for defining the port to start the server on. - * @throws {Error} If the provided executable path does not exist. - */ - constructor(exe: string); - - /** - * Define additional command line arguments to use when starting the server. - * - * @param {...CommandLineFlag} var_args The arguments to include. - * @return {!THIS} A self reference. - * @this {THIS} - * @template THIS - */ - addArguments(...var_args: string[]): this; - - - /** - * Sets the host name to access the server on. If specified, the - * {@linkplain #setLoopback() loopback} setting will be ignored. - * - * @param {string} hostname - * @return {!DriverService.Builder} A self reference. - */ - setHostname(hostname: string): this; - - /** - * Sets whether the service should be accessed at this host's loopback - * address. - * - * @param {boolean} loopback - * @return {!DriverService.Builder} A self reference. - */ - setLoopback(loopback: boolean): this; - - /** - * Sets the base path for WebDriver REST commands (e.g. "/wd/hub"). - * By default, the driver will accept commands relative to "/". - * - * @param {?string} basePath The base path to use, or `null` to use the - * default. - * @return {!DriverService.Builder} A self reference. - */ - setPath(basePath: string | null): this; - - - /** - * Sets the port to start the server on. - * - * @param {number} port The port to use, or 0 for any free port. - * @return {!DriverService.Builder} A self reference. - * @throws {Error} If an invalid port is specified. - */ - setPort(port: number): this; - - /** - * Defines the environment to start the server under. This setting will be - * inherited by every browser session started by the server. By default, the - * server will inherit the enviroment of the current process. - * - * @param {(Map|Object|null)} env The desired - * environment to use, or `null` if the server should inherit the - * current environment. - * @return {!DriverService.Builder} A self reference. - */ - setEnvironment(env: Map | {[name:string]: string} | null): this; - - /** - * IO configuration for the spawned server process. For more information, - * refer to the documentation of `child_process.spawn`. - * - * @param {StdIoOptions} config The desired IO configuration. - * @return {!DriverService.Builder} A self reference. - * @see https://nodejs.org/dist/latest-v4.x/docs/api/child_process.html#child_process_options_stdio - */ - setStdio(config: any): this; - - /** - * Creates a new DriverService using this instance's current configuration. - * - * @return {!DriverService} A new driver service. - */ - build(): DriverService; - } - } diff --git a/selenium-webdriver/test/index.ts b/selenium-webdriver/test/index.ts index 749c22d5a3..2556e7e2a8 100644 --- a/selenium-webdriver/test/index.ts +++ b/selenium-webdriver/test/index.ts @@ -518,10 +518,10 @@ function TestWebDriverOptions() { promise = options.deleteAllCookies(); promise = options.deleteCookie('name'); - options.getCookie('name').then(function (cookie: webdriver.IWebDriverCookie) { + options.getCookie('name').then((cookie: webdriver.IWebDriverCookie) => { var expiry: number = cookie.expiry; }); - options.getCookies().then(function (cookies: webdriver.IWebDriverCookie[]) { }); + options.getCookies().then((cookies: webdriver.IWebDriverCookie[]) => { }); var logs: webdriver.Logs = options.logs(); var timeouts: webdriver.Timeouts = options.timeouts(); @@ -852,7 +852,7 @@ function TestUntilModule() { withCapabilities(webdriver.Capabilities.chrome()). build(); - var conditionB: webdriver.Condition = new webdriver.Condition('message', function (driver: webdriver.WebDriver) { return true; }); + var conditionB: webdriver.Condition = new webdriver.Condition('message', (driver: webdriver.WebDriver) => true); var conditionBBase: webdriver.Condition = conditionB; var conditionWebElement: webdriver.WebElementCondition; var conditionWebElements: webdriver.Condition; diff --git a/selenium-webdriver/tslint.json b/selenium-webdriver/tslint.json index eb0befd093..93fffac84e 100644 --- a/selenium-webdriver/tslint.json +++ b/selenium-webdriver/tslint.json @@ -3,7 +3,7 @@ "rules": { "callable-types": false, "forbidden-types": false, - "interface-name": false, + "interface-name": [false], "no-empty-interface": false, "unified-signatures": false } diff --git a/selenium-webdriver/v2/chrome.d.ts b/selenium-webdriver/v2/chrome.d.ts index 2ecff8d2f8..f22e83fa13 100644 --- a/selenium-webdriver/v2/chrome.d.ts +++ b/selenium-webdriver/v2/chrome.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; import * as remote from './remote'; diff --git a/selenium-webdriver/v2/edge.d.ts b/selenium-webdriver/v2/edge.d.ts index fd59756c3d..4120629e41 100644 --- a/selenium-webdriver/v2/edge.d.ts +++ b/selenium-webdriver/v2/edge.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; import * as remote from './remote'; diff --git a/selenium-webdriver/v2/executors.d.ts b/selenium-webdriver/v2/executors.d.ts index 6cded31fec..4e21eeadae 100644 --- a/selenium-webdriver/v2/executors.d.ts +++ b/selenium-webdriver/v2/executors.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; declare namespace executors { diff --git a/selenium-webdriver/v2/firefox.d.ts b/selenium-webdriver/v2/firefox.d.ts index 25542f144f..b84c9ec9f1 100644 --- a/selenium-webdriver/v2/firefox.d.ts +++ b/selenium-webdriver/v2/firefox.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; import * as remote from './remote'; diff --git a/selenium-webdriver/v2/http.d.ts b/selenium-webdriver/v2/http.d.ts index b4ade88430..7e2ce068c1 100644 --- a/selenium-webdriver/v2/http.d.ts +++ b/selenium-webdriver/v2/http.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; declare namespace http { diff --git a/selenium-webdriver/v2/ie.d.ts b/selenium-webdriver/v2/ie.d.ts index 5d9b51c64d..ec22531fc1 100644 --- a/selenium-webdriver/v2/ie.d.ts +++ b/selenium-webdriver/v2/ie.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; declare namespace ie { diff --git a/selenium-webdriver/v2/index.d.ts b/selenium-webdriver/v2/index.d.ts index 374d63f740..9637b696f9 100644 --- a/selenium-webdriver/v2/index.d.ts +++ b/selenium-webdriver/v2/index.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ // Type definitions for Selenium WebDriverJS 2.53.1 // Project: https://github.com/SeleniumHQ/selenium/tree/master/javascript/node/selenium-webdriver // Definitions by: Bill Armstrong , Yuki Kokubun , Craig Nishina diff --git a/selenium-webdriver/v2/opera.d.ts b/selenium-webdriver/v2/opera.d.ts index 0d3aee1a13..85e0788e4c 100644 --- a/selenium-webdriver/v2/opera.d.ts +++ b/selenium-webdriver/v2/opera.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; import * as remote from './remote'; diff --git a/selenium-webdriver/v2/remote.d.ts b/selenium-webdriver/v2/remote.d.ts index d3cadb746a..e9e8b2ad0d 100644 --- a/selenium-webdriver/v2/remote.d.ts +++ b/selenium-webdriver/v2/remote.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; declare namespace remote { diff --git a/selenium-webdriver/v2/safari.d.ts b/selenium-webdriver/v2/safari.d.ts index 82fd835b20..ac7569286a 100644 --- a/selenium-webdriver/v2/safari.d.ts +++ b/selenium-webdriver/v2/safari.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from './index'; declare namespace safari { diff --git a/selenium-webdriver/v2/test/chrome.ts b/selenium-webdriver/v2/test/chrome.ts index 2fce6bf6ca..6654a3685c 100644 --- a/selenium-webdriver/v2/test/chrome.ts +++ b/selenium-webdriver/v2/test/chrome.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as chrome from 'selenium-webdriver/chrome'; import * as remote from 'selenium-webdriver/remote'; import * as webdriver from 'selenium-webdriver'; diff --git a/selenium-webdriver/v2/test/firefox.ts b/selenium-webdriver/v2/test/firefox.ts index 7ebe0aa856..ce97c7ce68 100644 --- a/selenium-webdriver/v2/test/firefox.ts +++ b/selenium-webdriver/v2/test/firefox.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as firefox from 'selenium-webdriver/firefox'; import * as remote from 'selenium-webdriver/remote'; import * as webdriver from 'selenium-webdriver'; diff --git a/selenium-webdriver/v2/test/index.ts b/selenium-webdriver/v2/test/index.ts index ba2acb91ef..ed7606ce98 100644 --- a/selenium-webdriver/v2/test/index.ts +++ b/selenium-webdriver/v2/test/index.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ import * as webdriver from 'selenium-webdriver'; import * as chrome from 'selenium-webdriver/chrome'; import * as firefox from 'selenium-webdriver/firefox'; diff --git a/selenium-webdriver/v2/testing.d.ts b/selenium-webdriver/v2/testing.d.ts index e17c8e0f21..32c9259094 100644 --- a/selenium-webdriver/v2/testing.d.ts +++ b/selenium-webdriver/v2/testing.d.ts @@ -1,3 +1,4 @@ +/* tslint:disable */ declare namespace testing { /** * Registers a new test suite. @@ -60,4 +61,4 @@ declare namespace testing { function xit(name: string, fn: Function): void; } -export = testing; \ No newline at end of file +export = testing; From 7742000fb03fd23fb50d8ad97e2d3052103a9d3e Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Wed, 1 Mar 2017 01:09:29 -0500 Subject: [PATCH 386/797] Fixes header on v2 typedefs --- selenium-webdriver/v2/index.d.ts | 2 +- selenium-webdriver/v2/tslint.json | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 selenium-webdriver/v2/tslint.json diff --git a/selenium-webdriver/v2/index.d.ts b/selenium-webdriver/v2/index.d.ts index 9637b696f9..14b002a8be 100644 --- a/selenium-webdriver/v2/index.d.ts +++ b/selenium-webdriver/v2/index.d.ts @@ -1,8 +1,8 @@ -/* tslint:disable */ // Type definitions for Selenium WebDriverJS 2.53.1 // 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 +/* tslint:disable */ import * as chrome from './chrome'; import * as edge from './edge'; diff --git a/selenium-webdriver/v2/tslint.json b/selenium-webdriver/v2/tslint.json new file mode 100644 index 0000000000..ad51895c20 --- /dev/null +++ b/selenium-webdriver/v2/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "dt-header": false + } +} From fcce73b891bcfbd28d46a38feef60b18cf8dedca Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Tue, 7 Mar 2017 22:24:10 -0500 Subject: [PATCH 387/797] Updates v2 folder with latest changes from master --- selenium-webdriver/v2/chrome.d.ts | 818 ++- selenium-webdriver/v2/edge.d.ts | 237 +- selenium-webdriver/v2/executors.d.ts | 22 +- selenium-webdriver/v2/firefox.d.ts | 474 +- selenium-webdriver/v2/http.d.ts | 294 +- selenium-webdriver/v2/ie.d.ts | 402 +- selenium-webdriver/v2/index.d.ts | 9726 ++++++++++++------------- selenium-webdriver/v2/opera.d.ts | 310 +- selenium-webdriver/v2/remote.d.ts | 150 +- selenium-webdriver/v2/safari.d.ts | 164 +- selenium-webdriver/v2/test/chrome.ts | 2 +- selenium-webdriver/v2/test/firefox.ts | 4 +- selenium-webdriver/v2/test/index.ts | 203 +- selenium-webdriver/v2/test/remote.ts | 13 + selenium-webdriver/v2/testing.d.ts | 106 +- selenium-webdriver/v2/tsconfig.json | 5 +- 16 files changed, 6463 insertions(+), 6467 deletions(-) create mode 100644 selenium-webdriver/v2/test/remote.ts diff --git a/selenium-webdriver/v2/chrome.d.ts b/selenium-webdriver/v2/chrome.d.ts index f22e83fa13..eb7b9f13c1 100644 --- a/selenium-webdriver/v2/chrome.d.ts +++ b/selenium-webdriver/v2/chrome.d.ts @@ -2,418 +2,414 @@ import * as webdriver from './index'; import * as remote from './remote'; -declare namespace chrome { +/** + * Creates a new WebDriver client for Chrome. + * + * @extends {webdriver.WebDriver} + */ +export class Driver extends webdriver.WebDriver { /** - * Creates a new WebDriver client for Chrome. - * - * @extends {webdriver.WebDriver} + * @param {(webdriver.Capabilities|Options)=} opt_config The configuration + * options. + * @param {remote.DriverService=} opt_service The session to use; will use + * the {@link getDefaultService default service} by default. + * @param {webdriver.promise.ControlFlow=} opt_flow The control flow to use, or + * {@code null} to use the currently active flow. + * @constructor */ - class Driver extends webdriver.WebDriver { - /** - * @param {(webdriver.Capabilities|Options)=} opt_config The configuration - * options. - * @param {remote.DriverService=} opt_service The session to use; will use - * the {@link getDefaultService default service} by default. - * @param {webdriver.promise.ControlFlow=} opt_flow The control flow to use, or - * {@code null} to use the currently active flow. - * @constructor - */ - constructor(opt_config?: Options | webdriver.Capabilities, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow); - } - - interface IOptionsValues { - args: string[]; - binary?: string; - detach: boolean; - extensions: string[]; - localState?: any; - logFile?: string; - prefs?: any; - } - - interface IPerfLoggingPrefs { - enableNetwork: boolean; - enablePage: boolean; - enableTimeline: boolean; - tracingCategories: string; - bufferUsageReportingInterval: number; - } - - /** - * Class for managing ChromeDriver specific options. - */ - class Options { - /** - * @constructor - */ - constructor(); - - /** - * Extracts the ChromeDriver specific options from the given capabilities - * object. - * @param {!webdriver.Capabilities} capabilities The capabilities object. - * @return {!Options} The ChromeDriver options. - */ - static fromCapabilities(capabilities: webdriver.Capabilities): Options; - - - /** - * Add additional command line arguments to use when launching the Chrome - * browser. Each argument may be specified with or without the '--' prefix - * (e.g. '--foo' and 'foo'). Arguments with an associated value should be - * delimited by an '=': 'foo=bar'. - * @param {...(string|!Array.)} var_args The arguments to add. - * @return {!Options} A self reference. - */ - addArguments(...var_args: string[]): Options; - - - /** - * List of Chrome command line switches to exclude that ChromeDriver by default - * passes when starting Chrome. Do not prefix switches with '--'. - * - * @param {...(string|!Array)} var_args The switches to exclude. - * @return {!Options} A self reference. - */ - excludeSwitches(...var_args: string[]): Options; - - - /** - * Add additional extensions to install when launching Chrome. Each extension - * should be specified as the path to the packed CRX file, or a Buffer for an - * extension. - * @param {...(string|!Buffer|!Array.<(string|!Buffer)>)} var_args The - * extensions to add. - * @return {!Options} A self reference. - */ - addExtensions(...var_args: any[]): Options; - - - /** - * Sets the path to the Chrome binary to use. On Mac OS X, this path should - * reference the actual Chrome executable, not just the application binary - * (e.g. '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'). - * - * The binary path be absolute or relative to the chromedriver server - * executable, but it must exist on the machine that will launch Chrome. - * - * @param {string} path The path to the Chrome binary to use. - * @return {!Options} A self reference. - */ - setChromeBinaryPath(path: string): Options; - - - /** - * Sets whether to leave the started Chrome browser running if the controlling - * ChromeDriver service is killed before {@link webdriver.WebDriver#quit()} is - * called. - * @param {boolean} detach Whether to leave the browser running if the - * chromedriver service is killed before the session. - * @return {!Options} A self reference. - */ - detachDriver(detach: boolean): Options; - - - /** - * Sets the user preferences for Chrome's user profile. See the 'Preferences' - * file in Chrome's user data directory for examples. - * @param {!Object} prefs Dictionary of user preferences to use. - * @return {!Options} A self reference. - */ - setUserPreferences(prefs: any): Options; - - - /** - * Sets the logging preferences for the new session. - * @param {!webdriver.logging.Preferences} prefs The logging preferences. - * @return {!Options} A self reference. - */ - setLoggingPrefs(prefs: webdriver.logging.Preferences): Options; - - /** - * Sets the performance logging preferences. Options include: - * - * - `enableNetwork`: Whether or not to collect events from Network domain. - * - `enablePage`: Whether or not to collect events from Page domain. - * - `enableTimeline`: Whether or not to collect events from Timeline domain. - * Note: when tracing is enabled, Timeline domain is implicitly disabled, - * unless `enableTimeline` is explicitly set to true. - * - `tracingCategories`: A comma-separated string of Chrome tracing categories - * for which trace events should be collected. An unspecified or empty - * string disables tracing. - * - `bufferUsageReportingInterval`: The requested number of milliseconds - * between DevTools trace buffer usage events. For example, if 1000, then - * once per second, DevTools will report how full the trace buffer is. If a - * report indicates the buffer usage is 100%, a warning will be issued. - * - * @param {{enableNetwork: boolean, - * enablePage: boolean, - * enableTimeline: boolean, - * tracingCategories: string, - * bufferUsageReportingInterval: number}} prefs The performance - * logging preferences. - * @return {!Options} A self reference. - */ - setPerfLoggingPrefs(prefs: IPerfLoggingPrefs): Options; - - - /** - * Sets preferences for the 'Local State' file in Chrome's user data - * directory. - * @param {!Object} state Dictionary of local state preferences. - * @return {!Options} A self reference. - */ - setLocalState(state: any): Options; - - - /** - * Sets the name of the activity hosting a Chrome-based Android WebView. This - * option must be set to connect to an [Android WebView]( - * https://sites.google.com/a/chromium.org/chromedriver/getting-started/getting-started---android) - * - * @param {string} name The activity name. - * @return {!Options} A self reference. - */ - androidActivity(name: string): Options; - - - /** - * Sets the device serial number to connect to via ADB. If not specified, the - * ChromeDriver will select an unused device at random. An error will be - * returned if all devices already have active sessions. - * - * @param {string} serial The device serial number to connect to. - * @return {!Options} A self reference. - */ - androidDeviceSerial(serial: string): Options; - - - /** - * Configures the ChromeDriver to launch Chrome on Android via adb. This - * function is shorthand for - * {@link #androidPackage options.androidPackage('com.android.chrome')}. - * @return {!Options} A self reference. - */ - androidChrome(): Options; - - - /** - * Sets the package name of the Chrome or WebView app. - * - * @param {?string} pkg The package to connect to, or `null` to disable Android - * and switch back to using desktop Chrome. - * @return {!Options} A self reference. - */ - androidPackage(pkg: string): Options; - - - /** - * Sets the process name of the Activity hosting the WebView (as given by `ps`). - * If not specified, the process name is assumed to be the same as - * {@link #androidPackage}. - * - * @param {string} processName The main activity name. - * @return {!Options} A self reference. - */ - androidProcess(processName: string): Options; - - - /** - * Sets whether to connect to an already-running instead of the specified - * {@linkplain #androidProcess app} instead of launching the app with a clean - * data directory. - * - * @param {boolean} useRunning Whether to connect to a running instance. - * @return {!Options} A self reference. - */ - androidUseRunningApp(useRunning: boolean): Options; - - - /** - * Sets the path to Chrome's log file. This path should exist on the machine - * that will launch Chrome. - * @param {string} path Path to the log file to use. - * @return {!Options} A self reference. - */ - setChromeLogFile(path: string): Options; - - - /** - * Sets the directory to store Chrome minidumps in. This option is only - * supported when ChromeDriver is running on Linux. - * @param {string} path The directory path. - * @return {!Options} A self reference. - */ - setChromeMinidumpPath(path: string): Options; - - - /** - * Configures Chrome to emulate a mobile device. For more information, refer - * to the ChromeDriver project page on [mobile emulation][em]. Configuration - * options include: - * - * - `deviceName`: The name of a pre-configured [emulated device][devem] - * - `width`: screen width, in pixels - * - `height`: screen height, in pixels - * - `pixelRatio`: screen pixel ratio - * - * __Example 1: Using a Pre-configured Device__ - * - * let options = new chrome.Options().setMobileEmulation( - * {deviceName: 'Google Nexus 5'}); - * - * let driver = new chrome.Driver(options); - * - * __Example 2: Using Custom Screen Configuration__ - * - * let options = new chrome.Options().setMobileEmulation({ - * width: 360, - * height: 640, - * pixelRatio: 3.0 - * }); - * - * let driver = new chrome.Driver(options); - * - * - * [em]: https://sites.google.com/a/chromium.org/chromedriver/mobile-emulation - * [devem]: https://developer.chrome.com/devtools/docs/device-mode - * - * @param {?({deviceName: string}| - * {width: number, height: number, pixelRatio: number})} config The - * mobile emulation configuration, or `null` to disable emulation. - * @return {!Options} A self reference. - */ - setMobileEmulation(config: any): Options; - - /** - * Sets the proxy settings for the new session. - * @param {webdriver.ProxyConfig} proxy The proxy configuration to use. - * @return {!Options} A self reference. - */ - setProxy(proxy: webdriver.ProxyConfig): Options; - - - /** - * Converts this options instance to a {@link webdriver.Capabilities} object. - * @param {webdriver.Capabilities=} opt_capabilities The capabilities to merge - * these options into, if any. - * @return {!webdriver.Capabilities} The capabilities. - */ - toCapabilities(opt_capabilities?: webdriver.Capabilities): webdriver.Capabilities; - } - - /** - * Creates {@link remote.DriverService} instances that manage a ChromeDriver - * server. - */ - class ServiceBuilder { - /** - * @param {string=} opt_exe Path to the server executable to use. If omitted, - * the builder will attempt to locate the chromedriver on the current - * PATH. - * @throws {Error} If provided executable does not exist, or the chromedriver - * cannot be found on the PATH. - * @constructor - */ - constructor(opt_exe?: string); - - /** - * Sets the port to start the ChromeDriver on. - * @param {number} port The port to use, or 0 for any free port. - * @return {!ServiceBuilder} A self reference. - * @throws {Error} If the port is invalid. - */ - usingPort(port: number): ServiceBuilder; - - - /** - * Sets which port adb is listening to. _The ChromeDriver will connect to adb - * if an {@linkplain Options#androidPackage Android session} is requested, but - * adb **must** be started beforehand._ - * - * @param {number} port Which port adb is running on. - * @return {!ServiceBuilder} A self reference. - */ - setAdbPort(port: number): ServiceBuilder; - - - /** - * Sets the path of the log file the driver should log to. If a log file is - * not specified, the driver will log to stderr. - * @param {string} path Path of the log file to use. - * @return {!ServiceBuilder} A self reference. - */ - loggingTo(path: string): ServiceBuilder; - - - /** - * Enables verbose logging. - * @return {!ServiceBuilder} A self reference. - */ - enableVerboseLogging(): ServiceBuilder; - - - /** - * Sets the number of threads the driver should use to manage HTTP requests. - * By default, the driver will use 4 threads. - * @param {number} n The number of threads to use. - * @return {!ServiceBuilder} A self reference. - */ - setNumHttpThreads(n: number): ServiceBuilder; - - - /** - * Sets the base path for WebDriver REST commands (e.g. '/wd/hub'). - * By default, the driver will accept commands relative to '/'. - * @param {string} path The base path to use. - * @return {!ServiceBuilder} A self reference. - */ - setUrlBasePath(path: string): ServiceBuilder; - - - /** - * Defines the stdio configuration for the driver service. See - * {@code child_process.spawn} for more information. - * @param {(string|!Array.)} config The - * configuration to use. - * @return {!ServiceBuilder} A self reference. - */ - setStdio(config: string | Array): ServiceBuilder; - - - /** - * Defines the environment to start the server under. This settings will be - * inherited by every browser session started by the server. - * @param {!Object.} env The environment to use. - * @return {!ServiceBuilder} A self reference. - */ - withEnvironment(env: { [key: string]: string }): ServiceBuilder; - - - /** - * Creates a new DriverService using this instance's current configuration. - * @return {remote.DriverService} A new driver service using this instance's - * current configuration. - * @throws {Error} If the driver exectuable was not specified and a default - * could not be found on the current PATH. - */ - build(): remote.DriverService; - } - - /** - * Returns the default ChromeDriver service. If such a service has not been - * configured, one will be constructed using the default configuration for - * a ChromeDriver executable found on the system PATH. - * @return {!remote.DriverService} The default ChromeDriver service. - */ - function getDefaultService(): remote.DriverService; - - /** - * Sets the default service to use for new ChromeDriver instances. - * @param {!remote.DriverService} service The service to use. - * @throws {Error} If the default service is currently running. - */ - function setDefaultService(service: remote.DriverService): void; + constructor(opt_config?: Options | webdriver.Capabilities, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow); } -export = chrome; +interface IOptionsValues { + args: string[]; + binary?: string; + detach: boolean; + extensions: string[]; + localState?: any; + logFile?: string; + prefs?: any; +} + +interface IPerfLoggingPrefs { + enableNetwork: boolean; + enablePage: boolean; + enableTimeline: boolean; + tracingCategories: string; + bufferUsageReportingInterval: number; +} + +/** + * Class for managing ChromeDriver specific options. + */ +export class Options { + /** + * @constructor + */ + constructor(); + + /** + * Extracts the ChromeDriver specific options from the given capabilities + * object. + * @param {!webdriver.Capabilities} capabilities The capabilities object. + * @return {!Options} The ChromeDriver options. + */ + static fromCapabilities(capabilities: webdriver.Capabilities): Options; + + + /** + * Add additional command line arguments to use when launching the Chrome + * browser. Each argument may be specified with or without the '--' prefix + * (e.g. '--foo' and 'foo'). Arguments with an associated value should be + * delimited by an '=': 'foo=bar'. + * @param {...(string|!Array.)} var_args The arguments to add. + * @return {!Options} A self reference. + */ + addArguments(...var_args: string[]): Options; + + + /** + * List of Chrome command line switches to exclude that ChromeDriver by default + * passes when starting Chrome. Do not prefix switches with '--'. + * + * @param {...(string|!Array)} var_args The switches to exclude. + * @return {!Options} A self reference. + */ + excludeSwitches(...var_args: string[]): Options; + + + /** + * Add additional extensions to install when launching Chrome. Each extension + * should be specified as the path to the packed CRX file, or a Buffer for an + * extension. + * @param {...(string|!Buffer|!Array.<(string|!Buffer)>)} var_args The + * extensions to add. + * @return {!Options} A self reference. + */ + addExtensions(...var_args: any[]): Options; + + + /** + * Sets the path to the Chrome binary to use. On Mac OS X, this path should + * reference the actual Chrome executable, not just the application binary + * (e.g. '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'). + * + * The binary path be absolute or relative to the chromedriver server + * executable, but it must exist on the machine that will launch Chrome. + * + * @param {string} path The path to the Chrome binary to use. + * @return {!Options} A self reference. + */ + setChromeBinaryPath(path: string): Options; + + + /** + * Sets whether to leave the started Chrome browser running if the controlling + * ChromeDriver service is killed before {@link webdriver.WebDriver#quit()} is + * called. + * @param {boolean} detach Whether to leave the browser running if the + * chromedriver service is killed before the session. + * @return {!Options} A self reference. + */ + detachDriver(detach: boolean): Options; + + + /** + * Sets the user preferences for Chrome's user profile. See the 'Preferences' + * file in Chrome's user data directory for examples. + * @param {!Object} prefs Dictionary of user preferences to use. + * @return {!Options} A self reference. + */ + setUserPreferences(prefs: any): Options; + + + /** + * Sets the logging preferences for the new session. + * @param {!webdriver.logging.Preferences} prefs The logging preferences. + * @return {!Options} A self reference. + */ + setLoggingPrefs(prefs: webdriver.logging.Preferences): Options; + + /** + * Sets the performance logging preferences. Options include: + * + * - `enableNetwork`: Whether or not to collect events from Network domain. + * - `enablePage`: Whether or not to collect events from Page domain. + * - `enableTimeline`: Whether or not to collect events from Timeline domain. + * Note: when tracing is enabled, Timeline domain is implicitly disabled, + * unless `enableTimeline` is explicitly set to true. + * - `tracingCategories`: A comma-separated string of Chrome tracing categories + * for which trace events should be collected. An unspecified or empty + * string disables tracing. + * - `bufferUsageReportingInterval`: The requested number of milliseconds + * between DevTools trace buffer usage events. For example, if 1000, then + * once per second, DevTools will report how full the trace buffer is. If a + * report indicates the buffer usage is 100%, a warning will be issued. + * + * @param {{enableNetwork: boolean, + * enablePage: boolean, + * enableTimeline: boolean, + * tracingCategories: string, + * bufferUsageReportingInterval: number}} prefs The performance + * logging preferences. + * @return {!Options} A self reference. + */ + setPerfLoggingPrefs(prefs: IPerfLoggingPrefs): Options; + + + /** + * Sets preferences for the 'Local State' file in Chrome's user data + * directory. + * @param {!Object} state Dictionary of local state preferences. + * @return {!Options} A self reference. + */ + setLocalState(state: any): Options; + + + /** + * Sets the name of the activity hosting a Chrome-based Android WebView. This + * option must be set to connect to an [Android WebView]( + * https://sites.google.com/a/chromium.org/chromedriver/getting-started/getting-started---android) + * + * @param {string} name The activity name. + * @return {!Options} A self reference. + */ + androidActivity(name: string): Options; + + + /** + * Sets the device serial number to connect to via ADB. If not specified, the + * ChromeDriver will select an unused device at random. An error will be + * returned if all devices already have active sessions. + * + * @param {string} serial The device serial number to connect to. + * @return {!Options} A self reference. + */ + androidDeviceSerial(serial: string): Options; + + + /** + * Configures the ChromeDriver to launch Chrome on Android via adb. This + * function is shorthand for + * {@link #androidPackage options.androidPackage('com.android.chrome')}. + * @return {!Options} A self reference. + */ + androidChrome(): Options; + + + /** + * Sets the package name of the Chrome or WebView app. + * + * @param {?string} pkg The package to connect to, or `null` to disable Android + * and switch back to using desktop Chrome. + * @return {!Options} A self reference. + */ + androidPackage(pkg: string): Options; + + + /** + * Sets the process name of the Activity hosting the WebView (as given by `ps`). + * If not specified, the process name is assumed to be the same as + * {@link #androidPackage}. + * + * @param {string} processName The main activity name. + * @return {!Options} A self reference. + */ + androidProcess(processName: string): Options; + + + /** + * Sets whether to connect to an already-running instead of the specified + * {@linkplain #androidProcess app} instead of launching the app with a clean + * data directory. + * + * @param {boolean} useRunning Whether to connect to a running instance. + * @return {!Options} A self reference. + */ + androidUseRunningApp(useRunning: boolean): Options; + + + /** + * Sets the path to Chrome's log file. This path should exist on the machine + * that will launch Chrome. + * @param {string} path Path to the log file to use. + * @return {!Options} A self reference. + */ + setChromeLogFile(path: string): Options; + + + /** + * Sets the directory to store Chrome minidumps in. This option is only + * supported when ChromeDriver is running on Linux. + * @param {string} path The directory path. + * @return {!Options} A self reference. + */ + setChromeMinidumpPath(path: string): Options; + + + /** + * Configures Chrome to emulate a mobile device. For more information, refer + * to the ChromeDriver project page on [mobile emulation][em]. Configuration + * options include: + * + * - `deviceName`: The name of a pre-configured [emulated device][devem] + * - `width`: screen width, in pixels + * - `height`: screen height, in pixels + * - `pixelRatio`: screen pixel ratio + * + * __Example 1: Using a Pre-configured Device__ + * + * let options = new chrome.Options().setMobileEmulation( + * {deviceName: 'Google Nexus 5'}); + * + * let driver = new chrome.Driver(options); + * + * __Example 2: Using Custom Screen Configuration__ + * + * let options = new chrome.Options().setMobileEmulation({ + * width: 360, + * height: 640, + * pixelRatio: 3.0 + * }); + * + * let driver = new chrome.Driver(options); + * + * + * [em]: https://sites.google.com/a/chromium.org/chromedriver/mobile-emulation + * [devem]: https://developer.chrome.com/devtools/docs/device-mode + * + * @param {?({deviceName: string}| + * {width: number, height: number, pixelRatio: number})} config The + * mobile emulation configuration, or `null` to disable emulation. + * @return {!Options} A self reference. + */ + setMobileEmulation(config: any): Options; + + /** + * Sets the proxy settings for the new session. + * @param {webdriver.ProxyConfig} proxy The proxy configuration to use. + * @return {!Options} A self reference. + */ + setProxy(proxy: webdriver.ProxyConfig): Options; + + + /** + * Converts this options instance to a {@link webdriver.Capabilities} object. + * @param {webdriver.Capabilities=} opt_capabilities The capabilities to merge + * these options into, if any. + * @return {!webdriver.Capabilities} The capabilities. + */ + toCapabilities(opt_capabilities?: webdriver.Capabilities): webdriver.Capabilities; +} + +/** + * Creates {@link remote.DriverService} instances that manage a ChromeDriver + * server. + */ +export class ServiceBuilder { + /** + * @param {string=} opt_exe Path to the server executable to use. If omitted, + * the builder will attempt to locate the chromedriver on the current + * PATH. + * @throws {Error} If provided executable does not exist, or the chromedriver + * cannot be found on the PATH. + * @constructor + */ + constructor(opt_exe?: string); + + /** + * Sets the port to start the ChromeDriver on. + * @param {number} port The port to use, or 0 for any free port. + * @return {!ServiceBuilder} A self reference. + * @throws {Error} If the port is invalid. + */ + usingPort(port: number): ServiceBuilder; + + + /** + * Sets which port adb is listening to. _The ChromeDriver will connect to adb + * if an {@linkplain Options#androidPackage Android session} is requested, but + * adb **must** be started beforehand._ + * + * @param {number} port Which port adb is running on. + * @return {!ServiceBuilder} A self reference. + */ + setAdbPort(port: number): ServiceBuilder; + + + /** + * Sets the path of the log file the driver should log to. If a log file is + * not specified, the driver will log to stderr. + * @param {string} path Path of the log file to use. + * @return {!ServiceBuilder} A self reference. + */ + loggingTo(path: string): ServiceBuilder; + + + /** + * Enables verbose logging. + * @return {!ServiceBuilder} A self reference. + */ + enableVerboseLogging(): ServiceBuilder; + + + /** + * Sets the number of threads the driver should use to manage HTTP requests. + * By default, the driver will use 4 threads. + * @param {number} n The number of threads to use. + * @return {!ServiceBuilder} A self reference. + */ + setNumHttpThreads(n: number): ServiceBuilder; + + + /** + * Sets the base path for WebDriver REST commands (e.g. '/wd/hub'). + * By default, the driver will accept commands relative to '/'. + * @param {string} path The base path to use. + * @return {!ServiceBuilder} A self reference. + */ + setUrlBasePath(path: string): ServiceBuilder; + + + /** + * Defines the stdio configuration for the driver service. See + * {@code child_process.spawn} for more information. + * @param {(string|!Array.)} config The + * configuration to use. + * @return {!ServiceBuilder} A self reference. + */ + setStdio(config: string | Array): ServiceBuilder; + + + /** + * Defines the environment to start the server under. This settings will be + * inherited by every browser session started by the server. + * @param {!Object.} env The environment to use. + * @return {!ServiceBuilder} A self reference. + */ + withEnvironment(env: { [key: string]: string }): ServiceBuilder; + + + /** + * Creates a new DriverService using this instance's current configuration. + * @return {remote.DriverService} A new driver service using this instance's + * current configuration. + * @throws {Error} If the driver exectuable was not specified and a default + * could not be found on the current PATH. + */ + build(): remote.DriverService; +} + +/** + * Returns the default ChromeDriver service. If such a service has not been + * configured, one will be constructed using the default configuration for + * a ChromeDriver executable found on the system PATH. + * @return {!remote.DriverService} The default ChromeDriver service. + */ +export function getDefaultService(): remote.DriverService; + +/** + * Sets the default service to use for new ChromeDriver instances. + * @param {!remote.DriverService} service The service to use. + * @throws {Error} If the default service is currently running. + */ +export function setDefaultService(service: remote.DriverService): void; diff --git a/selenium-webdriver/v2/edge.d.ts b/selenium-webdriver/v2/edge.d.ts index 4120629e41..576dc01f94 100644 --- a/selenium-webdriver/v2/edge.d.ts +++ b/selenium-webdriver/v2/edge.d.ts @@ -2,129 +2,124 @@ import * as webdriver from './index'; import * as remote from './remote'; -declare namespace edge { - - class Driver extends webdriver.WebDriver { - /** - * @param {(capabilities.Capabilities|Options)=} opt_config The configuration - * options. - * @param {remote.DriverService=} opt_service The session to use; will use - * the {@linkplain #getDefaultService default service} by default. - * @param {promise.ControlFlow=} opt_flow The control flow to use, or - * {@code null} to use the currently active flow. - */ - constructor(opt_config?: webdriver.Capabilities | Options, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow); - - /** - * This function is a no-op as file detectors are not supported by this - * implementation. - * @override - */ - setFileDetector(): void; - } +export class Driver extends webdriver.WebDriver { + /** + * @param {(capabilities.Capabilities|Options)=} opt_config The configuration + * options. + * @param {remote.DriverService=} opt_service The session to use; will use + * the {@linkplain #getDefaultService default service} by default. + * @param {promise.ControlFlow=} opt_flow The control flow to use, or + * {@code null} to use the currently active flow. + */ + constructor(opt_config?: webdriver.Capabilities | Options, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow); /** - * Class for managing MicrosoftEdgeDriver specific options. + * This function is a no-op as file detectors are not supported by this + * implementation. + * @override */ - class Options { - - /** - * Extracts the MicrosoftEdgeDriver specific options from the given - * capabilities object. - * @param {!capabilities.Capabilities} caps The capabilities object. - * @return {!Options} The MicrosoftEdgeDriver options. - */ - static fromCapabilities(cap: webdriver.Capabilities): Options; - - /** - * Sets the proxy settings for the new session. - * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. - * @return {!Options} A self reference. - */ - setProxy(proxy: webdriver.ProxyConfig): Options; - - /** - * Sets the page load strategy for Edge. - * Supported values are 'normal', 'eager', and 'none'; - * - * @param {string} pageLoadStrategy The page load strategy to use. - * @return {!Options} A self reference. - */ - setPageLoadStrategy(pageLoadStrategy: string): Options; - - /** - * Converts this options instance to a {@link capabilities.Capabilities} - * object. - * @param {capabilities.Capabilities=} opt_capabilities The capabilities to - * merge these options into, if any. - * @return {!capabilities.Capabilities} The capabilities. - */ - toCapabilities(opt_capabilities: webdriver.Capabilities): webdriver.Capabilities; - } - - /** - * Creates {@link remote.DriverService} instances that manage a - * MicrosoftEdgeDriver server in a child process. - */ - class ServiceBuilder { - /** - * @param {string=} opt_exe Path to the server executable to use. If omitted, - * the builder will attempt to locate the MicrosoftEdgeDriver on the current - * PATH. - * @throws {Error} If provided executable does not exist, or the - * MicrosoftEdgeDriver cannot be found on the PATH. - */ - constructor(opt_exe?: string); - - /** - * Defines the stdio configuration for the driver service. See - * {@code child_process.spawn} for more information. - * @param {(string|!Array.)} - * config The configuration to use. - * @return {!ServiceBuilder} A self reference. - */ - setStdio(config: string | Array): ServiceBuilder; - - /** - * Sets the port to start the MicrosoftEdgeDriver on. - * @param {number} port The port to use, or 0 for any free port. - * @return {!ServiceBuilder} A self reference. - * @throws {Error} If the port is invalid. - */ - usingPort(port: number): ServiceBuilder; - - /** - * Defines the environment to start the server under. This settings will be - * inherited by every browser session started by the server. - * @param {!Object.} env The environment to use. - * @return {!ServiceBuilder} A self reference. - */ - withEnvironment(env: Object): ServiceBuilder; - - /** - * Creates a new DriverService using this instance's current configuration. - * @return {!remote.DriverService} A new driver service using this instance's - * current configuration. - * @throws {Error} If the driver exectuable was not specified and a default - * could not be found on the current PATH. - */ - build(): remote.DriverService; - } - - /** - * Returns the default MicrosoftEdgeDriver service. If such a service has - * not been configured, one will be constructed using the default configuration - * for an MicrosoftEdgeDriver executable found on the system PATH. - * @return {!remote.DriverService} The default MicrosoftEdgeDriver service. - */ - function getDefaultService(): remote.DriverService; - - /** - * Sets the default service to use for new MicrosoftEdgeDriver instances. - * @param {!remote.DriverService} service The service to use. - * @throws {Error} If the default service is currently running. - */ - function setDefaultService(service: remote.DriverService): void; + setFileDetector(): void; } -export = edge; +/** + * Class for managing MicrosoftEdgeDriver specific options. + */ +export class Options { + + /** + * Extracts the MicrosoftEdgeDriver specific options from the given + * capabilities object. + * @param {!capabilities.Capabilities} caps The capabilities object. + * @return {!Options} The MicrosoftEdgeDriver options. + */ + static fromCapabilities(cap: webdriver.Capabilities): Options; + + /** + * Sets the proxy settings for the new session. + * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. + * @return {!Options} A self reference. + */ + setProxy(proxy: webdriver.ProxyConfig): Options; + + /** + * Sets the page load strategy for Edge. + * Supported values are 'normal', 'eager', and 'none'; + * + * @param {string} pageLoadStrategy The page load strategy to use. + * @return {!Options} A self reference. + */ + setPageLoadStrategy(pageLoadStrategy: string): Options; + + /** + * Converts this options instance to a {@link capabilities.Capabilities} + * object. + * @param {capabilities.Capabilities=} opt_capabilities The capabilities to + * merge these options into, if any. + * @return {!capabilities.Capabilities} The capabilities. + */ + toCapabilities(opt_capabilities: webdriver.Capabilities): webdriver.Capabilities; +} + +/** + * Creates {@link remote.DriverService} instances that manage a + * MicrosoftEdgeDriver server in a child process. + */ +export class ServiceBuilder { + /** + * @param {string=} opt_exe Path to the server executable to use. If omitted, + * the builder will attempt to locate the MicrosoftEdgeDriver on the current + * PATH. + * @throws {Error} If provided executable does not exist, or the + * MicrosoftEdgeDriver cannot be found on the PATH. + */ + constructor(opt_exe?: string); + + /** + * Defines the stdio configuration for the driver service. See + * {@code child_process.spawn} for more information. + * @param {(string|!Array.)} + * config The configuration to use. + * @return {!ServiceBuilder} A self reference. + */ + setStdio(config: string | Array): ServiceBuilder; + + /** + * Sets the port to start the MicrosoftEdgeDriver on. + * @param {number} port The port to use, or 0 for any free port. + * @return {!ServiceBuilder} A self reference. + * @throws {Error} If the port is invalid. + */ + usingPort(port: number): ServiceBuilder; + + /** + * Defines the environment to start the server under. This settings will be + * inherited by every browser session started by the server. + * @param {!Object.} env The environment to use. + * @return {!ServiceBuilder} A self reference. + */ + withEnvironment(env: Object): ServiceBuilder; + + /** + * Creates a new DriverService using this instance's current configuration. + * @return {!remote.DriverService} A new driver service using this instance's + * current configuration. + * @throws {Error} If the driver exectuable was not specified and a default + * could not be found on the current PATH. + */ + build(): remote.DriverService; +} + +/** + * Returns the default MicrosoftEdgeDriver service. If such a service has + * not been configured, one will be constructed using the default configuration + * for an MicrosoftEdgeDriver executable found on the system PATH. + * @return {!remote.DriverService} The default MicrosoftEdgeDriver service. + */ +export function getDefaultService(): remote.DriverService; + +/** + * Sets the default service to use for new MicrosoftEdgeDriver instances. + * @param {!remote.DriverService} service The service to use. + * @throws {Error} If the default service is currently running. + */ +export function setDefaultService(service: remote.DriverService): void; diff --git a/selenium-webdriver/v2/executors.d.ts b/selenium-webdriver/v2/executors.d.ts index 4e21eeadae..ddb3e5b752 100644 --- a/selenium-webdriver/v2/executors.d.ts +++ b/selenium-webdriver/v2/executors.d.ts @@ -1,16 +1,12 @@ /* tslint:disable */ import * as webdriver from './index'; -declare namespace executors { - /** - * Creates a command executor that uses WebDriver's JSON wire protocol. - * @param {(string|!promise.Promise)} url The server's URL, - * or a promise that will resolve to that URL. - * @param {?string=} opt_proxy (optional) The URL of the HTTP proxy for the - * client to use. - * @returns {!./lib/command.Executor} The new command executor. - */ - function createExecutor(url: string | webdriver.promise.Promise, opt_agent?: string, opt_proxy?: string): webdriver.Executor; -} - -export = executors; +/** + * Creates a command executor that uses WebDriver's JSON wire protocol. + * @param {(string|!promise.Promise)} url The server's URL, + * or a promise that will resolve to that URL. + * @param {?string=} opt_proxy (optional) The URL of the HTTP proxy for the + * client to use. + * @returns {!./lib/command.Executor} The new command executor. + */ +export function createExecutor(url: string | webdriver.promise.Promise, opt_agent?: string, opt_proxy?: string): webdriver.Executor; diff --git a/selenium-webdriver/v2/firefox.d.ts b/selenium-webdriver/v2/firefox.d.ts index b84c9ec9f1..9865896ba7 100644 --- a/selenium-webdriver/v2/firefox.d.ts +++ b/selenium-webdriver/v2/firefox.d.ts @@ -2,257 +2,253 @@ import * as webdriver from './index'; import * as remote from './remote'; -declare namespace firefox { +/** + * Manages a Firefox subprocess configured for use with WebDriver. + */ +export class Binary { /** - * Manages a Firefox subprocess configured for use with WebDriver. + * @param {string=} opt_exe Path to the Firefox binary to use. If not + * specified, will attempt to locate Firefox on the current system. + * @constructor */ - class Binary { - /** - * @param {string=} opt_exe Path to the Firefox binary to use. If not - * specified, will attempt to locate Firefox on the current system. - * @constructor - */ - constructor(opt_exe?: string); - - /** - * Add arguments to the command line used to start Firefox. - * @param {...(string|!Array.)} var_args Either the arguments to add as - * varargs, or the arguments as an array. - */ - addArguments(...var_args: string[]): void; - - - /** - * Launches Firefox and eturns a promise that will be fulfilled when the process - * terminates. - * @param {string} profile Path to the profile directory to use. - * @return {!promise.Promise.} A promise for the process result. - * @throws {Error} If this instance has already been started. - */ - launch(profile: string): webdriver.promise.Promise; - - - /** - * Kills the managed Firefox process. - * @return {!promise.Promise} A promise for when the process has terminated. - */ - kill(): webdriver.promise.Promise; - } + constructor(opt_exe?: string); /** - * Models a Firefox proifle directory for use with the FirefoxDriver. The - * {@code Proifle} directory uses an in-memory model until {@link #writeToDisk} - * is called. + * Add arguments to the command line used to start Firefox. + * @param {...(string|!Array.)} var_args Either the arguments to add as + * varargs, or the arguments as an array. */ - class Profile { - /** - * @param {string=} opt_dir Path to an existing Firefox profile directory to - * use a template for this profile. If not specified, a blank profile will - * be used. - * @constructor - */ - constructor(opt_dir?: string); + addArguments(...var_args: string[]): void; - /** - * Registers an extension to be included with this profile. - * @param {string} extension Path to the extension to include, as either an - * unpacked extension directory or the path to a xpi file. - */ - addExtension(extension: string): void; - - - /** - * Sets a desired preference for this profile. - * @param {string} key The preference key. - * @param {(string|number|boolean)} value The preference value. - * @throws {Error} If attempting to set a frozen preference. - */ - setPreference(key: string, value: string): void; - setPreference(key: string, value: number): void; - setPreference(key: string, value: boolean): void; - - - /** - * Returns the currently configured value of a profile preference. This does - * not include any defaults defined in the profile's template directory user.js - * file (if a template were specified on construction). - * @param {string} key The desired preference. - * @return {(string|number|boolean|undefined)} The current value of the - * requested preference. - */ - getPreference(key: string): any; - - - /** - * @return {number} The port this profile is currently configured to use, or - * 0 if the port will be selected at random when the profile is written - * to disk. - */ - getPort(): number; - - - /** - * Sets the port to use for the WebDriver extension loaded by this profile. - * @param {number} port The desired port, or 0 to use any free port. - */ - setPort(port: number): void; - - - /** - * @return {boolean} Whether the FirefoxDriver is configured to automatically - * accept untrusted SSL certificates. - */ - acceptUntrustedCerts(): boolean; - - - /** - * Sets whether the FirefoxDriver should automatically accept untrusted SSL - * certificates. - * @param {boolean} value . - */ - setAcceptUntrustedCerts(value: boolean): void; - - - /** - * Sets whether to assume untrusted certificates come from untrusted issuers. - * @param {boolean} value . - */ - setAssumeUntrustedCertIssuer(value: boolean): void; - - - /** - * @return {boolean} Whether to assume untrusted certs come from untrusted - * issuers. - */ - assumeUntrustedCertIssuer(): boolean; - - - /** - * Sets whether to use native events with this profile. - * @param {boolean} enabled . - */ - setNativeEventsEnabled(enabled: boolean): void; - - - /** - * Returns whether native events are enabled in this profile. - * @return {boolean} . - */ - nativeEventsEnabled(): boolean; - - - /** - * Writes this profile to disk. - * @param {boolean=} opt_excludeWebDriverExt Whether to exclude the WebDriver - * extension from the generated profile. Used to reduce the size of an - * {@link #encode() encoded profile} since the server will always install - * the extension itself. - * @return {!promise.Promise.} A promise for the path to the new - * profile directory. - */ - writeToDisk(opt_excludeWebDriverExt?: boolean): webdriver.promise.Promise; - - - /** - * Encodes this profile as a zipped, base64 encoded directory. - * @return {!promise.Promise.} A promise for the encoded profile. - */ - encode(): webdriver.promise.Promise; - } /** - * Configuration options for the FirefoxDriver. + * Launches Firefox and eturns a promise that will be fulfilled when the process + * terminates. + * @param {string} profile Path to the profile directory to use. + * @return {!promise.Promise.} A promise for the process result. + * @throws {Error} If this instance has already been started. */ - class Options { - /** - * Sets the profile to use. The profile may be specified as a - * {@link Profile} object or as the path to an existing Firefox profile to use - * as a template. - * - * @param {(string|!Profile)} profile The profile to use. - * @return {!Options} A self reference. - */ - setProfile(profile: string | any): Options; + launch(profile: string): webdriver.promise.Promise; - /** - * Sets the binary to use. The binary may be specified as the path to a Firefox - * executable, or as a {@link Binary} object. - * - * @param {(string|!Binary)} binary The binary to use. - * @return {!Options} A self reference. - */ - setBinary(binary: string | any): Options; - - /** - * Sets the logging preferences for the new session. - * @param {logging.Preferences} prefs The logging preferences. - * @return {!Options} A self reference. - */ - setLoggingPreferences(prefs: webdriver.logging.Preferences): Options; - - /** - * Sets the proxy to use. - * - * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. - * @return {!Options} A self reference. - */ - setProxy(proxy: webdriver.ProxyConfig): Options; - - /** - * Sets whether to use Mozilla's Marionette to drive the browser. - * - * @see https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver - */ - useMarionette(marionette: any): Options; - - /** - * Converts these options to a {@link capabilities.Capabilities} instance. - * - * @return {!capabilities.Capabilities} A new capabilities object. - */ - toCapabilities(): webdriver.Capabilities; - } /** - * @return {string} . - * @throws {Error} + * Kills the managed Firefox process. + * @return {!promise.Promise} A promise for when the process has terminated. */ - function findWires(): string; - - /** - * @param {(string|!Binary)} binary . - * @return {!remote.DriverService} . - */ - function createWiresService(binary: string | any): remote.DriverService; - - /** - * @param {(Profile|string)} profile The profile to prepare. - * @param {number} port The port the FirefoxDriver should listen on. - * @return {!Promise} a promise for the path to the profile directory. - */ - function prepareProfile(profile: string | any, port: number): any; - - /** - * A WebDriver client for Firefox. - */ - class Driver extends webdriver.WebDriver { - /** - * @param {(Options|capabilities.Capabilities|Object)=} opt_config The - * configuration options for this driver, specified as either an - * {@link Options} or {@link capabilities.Capabilities}, or as a raw hash - * object. - * @param {promise.ControlFlow=} opt_flow The flow to - * schedule commands through. Defaults to the active flow object. - */ - constructor(opt_config?: Options | webdriver.Capabilities | Object, opt_flow?: webdriver.promise.ControlFlow); - - /** - * This function is a no-op as file detectors are not supported by this - * implementation. - * @override - */ - setFileDetector(): void; - } + kill(): webdriver.promise.Promise; } -export = firefox; +/** + * Models a Firefox proifle directory for use with the FirefoxDriver. The + * {@code Proifle} directory uses an in-memory model until {@link #writeToDisk} + * is called. + */ +export class Profile { + /** + * @param {string=} opt_dir Path to an existing Firefox profile directory to + * use a template for this profile. If not specified, a blank profile will + * be used. + * @constructor + */ + constructor(opt_dir?: string); + + /** + * Registers an extension to be included with this profile. + * @param {string} extension Path to the extension to include, as either an + * unpacked extension directory or the path to a xpi file. + */ + addExtension(extension: string): void; + + + /** + * Sets a desired preference for this profile. + * @param {string} key The preference key. + * @param {(string|number|boolean)} value The preference value. + * @throws {Error} If attempting to set a frozen preference. + */ + setPreference(key: string, value: string): void; + setPreference(key: string, value: number): void; + setPreference(key: string, value: boolean): void; + + + /** + * Returns the currently configured value of a profile preference. This does + * not include any defaults defined in the profile's template directory user.js + * file (if a template were specified on construction). + * @param {string} key The desired preference. + * @return {(string|number|boolean|undefined)} The current value of the + * requested preference. + */ + getPreference(key: string): any; + + + /** + * @return {number} The port this profile is currently configured to use, or + * 0 if the port will be selected at random when the profile is written + * to disk. + */ + getPort(): number; + + + /** + * Sets the port to use for the WebDriver extension loaded by this profile. + * @param {number} port The desired port, or 0 to use any free port. + */ + setPort(port: number): void; + + + /** + * @return {boolean} Whether the FirefoxDriver is configured to automatically + * accept untrusted SSL certificates. + */ + acceptUntrustedCerts(): boolean; + + + /** + * Sets whether the FirefoxDriver should automatically accept untrusted SSL + * certificates. + * @param {boolean} value . + */ + setAcceptUntrustedCerts(value: boolean): void; + + + /** + * Sets whether to assume untrusted certificates come from untrusted issuers. + * @param {boolean} value . + */ + setAssumeUntrustedCertIssuer(value: boolean): void; + + + /** + * @return {boolean} Whether to assume untrusted certs come from untrusted + * issuers. + */ + assumeUntrustedCertIssuer(): boolean; + + + /** + * Sets whether to use native events with this profile. + * @param {boolean} enabled . + */ + setNativeEventsEnabled(enabled: boolean): void; + + + /** + * Returns whether native events are enabled in this profile. + * @return {boolean} . + */ + nativeEventsEnabled(): boolean; + + + /** + * Writes this profile to disk. + * @param {boolean=} opt_excludeWebDriverExt Whether to exclude the WebDriver + * extension from the generated profile. Used to reduce the size of an + * {@link #encode() encoded profile} since the server will always install + * the extension itself. + * @return {!promise.Promise.} A promise for the path to the new + * profile directory. + */ + writeToDisk(opt_excludeWebDriverExt?: boolean): webdriver.promise.Promise; + + + /** + * Encodes this profile as a zipped, base64 encoded directory. + * @return {!promise.Promise.} A promise for the encoded profile. + */ + encode(): webdriver.promise.Promise; +} + +/** + * Configuration options for the FirefoxDriver. + */ +export class Options { + /** + * Sets the profile to use. The profile may be specified as a + * {@link Profile} object or as the path to an existing Firefox profile to use + * as a template. + * + * @param {(string|!Profile)} profile The profile to use. + * @return {!Options} A self reference. + */ + setProfile(profile: string | any): Options; + + /** + * Sets the binary to use. The binary may be specified as the path to a Firefox + * executable, or as a {@link Binary} object. + * + * @param {(string|!Binary)} binary The binary to use. + * @return {!Options} A self reference. + */ + setBinary(binary: string | any): Options; + + /** + * Sets the logging preferences for the new session. + * @param {logging.Preferences} prefs The logging preferences. + * @return {!Options} A self reference. + */ + setLoggingPreferences(prefs: webdriver.logging.Preferences): Options; + + /** + * Sets the proxy to use. + * + * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. + * @return {!Options} A self reference. + */ + setProxy(proxy: webdriver.ProxyConfig): Options; + + /** + * Sets whether to use Mozilla's Marionette to drive the browser. + * + * @see https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver + */ + useMarionette(marionette: any): Options; + + /** + * Converts these options to a {@link capabilities.Capabilities} instance. + * + * @return {!capabilities.Capabilities} A new capabilities object. + */ + toCapabilities(): webdriver.Capabilities; +} + +/** + * @return {string} . + * @throws {Error} + */ +export function findWires(): string; + +/** + * @param {(string|!Binary)} binary . + * @return {!remote.DriverService} . + */ +export function createWiresService(binary: string | any): remote.DriverService; + +/** + * @param {(Profile|string)} profile The profile to prepare. + * @param {number} port The port the FirefoxDriver should listen on. + * @return {!Promise} a promise for the path to the profile directory. + */ +export function prepareProfile(profile: string | any, port: number): any; + +/** + * A WebDriver client for Firefox. + */ +export class Driver extends webdriver.WebDriver { + /** + * @param {(Options|capabilities.Capabilities|Object)=} opt_config The + * configuration options for this driver, specified as either an + * {@link Options} or {@link capabilities.Capabilities}, or as a raw hash + * object. + * @param {promise.ControlFlow=} opt_flow The flow to + * schedule commands through. Defaults to the active flow object. + */ + constructor(opt_config?: Options | webdriver.Capabilities | Object, opt_flow?: webdriver.promise.ControlFlow); + + /** + * This function is a no-op as file detectors are not supported by this + * implementation. + * @override + */ + setFileDetector(): void; +} diff --git a/selenium-webdriver/v2/http.d.ts b/selenium-webdriver/v2/http.d.ts index 7e2ce068c1..bdb2797406 100644 --- a/selenium-webdriver/v2/http.d.ts +++ b/selenium-webdriver/v2/http.d.ts @@ -1,157 +1,153 @@ /* tslint:disable */ import * as webdriver from './index'; -declare namespace http { +/** + * Converts a headers map to a HTTP header block string. + * @param {!Map} headers The map to convert. + * @return {string} The headers as a string. + */ +export function headersToString(headers: any): string; + +/** + * Represents a HTTP request message. This class is a 'partial' request and only + * defines the path on the server to send a request to. It is each client's + * responsibility to build the full URL for the final request. + * @final + */ +export class HttpRequest { /** - * Converts a headers map to a HTTP header block string. - * @param {!Map} headers The map to convert. - * @return {string} The headers as a string. + * @param {string} method The HTTP method to use for the request. + * @param {string} path The path on the server to send the request to. + * @param {Object=} opt_data This request's non-serialized JSON payload data. */ - function headersToString(headers: any): string; + constructor(method: string, path: string, opt_data?: Object); - /** - * Represents a HTTP request message. This class is a 'partial' request and only - * defines the path on the server to send a request to. It is each client's - * responsibility to build the full URL for the final request. - * @final - */ - class HttpRequest { - /** - * @param {string} method The HTTP method to use for the request. - * @param {string} path The path on the server to send the request to. - * @param {Object=} opt_data This request's non-serialized JSON payload data. - */ - constructor(method: string, path: string, opt_data?: Object); - - /** @override */ - toString(): string; - } - - /** - * Represents a HTTP response message. - * @final - */ - class HttpResponse { - /** - * @param {number} status The response code. - * @param {!Object} headers The response headers. All header names - * will be converted to lowercase strings for consistent lookups. - * @param {string} body The response body. - */ - constructor(status: number, headers: Object, body: string); - - /** @override */ - toString(): string; - } - - - function post(path: string): any; - function del(path: string): any; - function get(path: string): any; - function resource(method: string, path: string): any; - - /** - * A basic HTTP client used to send messages to a remote end. - */ - class HttpClient { - /** - * @param {string} serverUrl URL for the WebDriver server to send commands to. - * @param {http.Agent=} opt_agent The agent to use for each request. - * Defaults to `http.globalAgent`. - * @param {?string=} opt_proxy The proxy to use for the connection to the - * server. Default is to use no proxy. - */ - constructor(serverUrl: string, opt_agent?: any, opt_proxy?: string); - - /** - * Sends a request to the server. The client will automatically follow any - * redirects returned by the server, fulfilling the returned promise with the - * final response. - * - * @param {!HttpRequest} httpRequest The request to send. - * @return {!promise.Promise} A promise that will be fulfilled - * with the server's response. - */ - send(httpRequest: HttpRequest): webdriver.promise.Promise; - } - - /** - * Sends a single HTTP request. - * @param {!Object} options The request options. - * @param {function(!HttpResponse)} onOk The function to call if the - * request succeeds. - * @param {function(!Error)} onError The function to call if the request fails. - * @param {?string=} opt_data The data to send with the request. - * @param {?string=} opt_proxy The proxy server to use for the request. - */ - function sendRequest(options: Object, onOk: any, onError: any, opt_data?: string, opt_proxy?: string): any; - - /** - * A command executor that communicates with the server using HTTP + JSON. - * - * By default, each instance of this class will use the legacy wire protocol - * from [Selenium project][json]. The executor will automatically switch to the - * [W3C wire protocol][w3c] if the remote end returns a compliant response to - * a new session command. - * - * [json]: https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol - * [w3c]: https://w3c.github.io/webdriver/webdriver-spec.html - * - * @implements {cmd.Executor} - */ - class Executor { - /** - * @param {!HttpClient} client The client to use for sending requests to the - * server. - */ - constructor(client: HttpClient); - - /** - * Defines a new command for use with this executor. When a command is sent, - * the {@code path} will be preprocessed using the command's parameters; any - * path segments prefixed with ':' will be replaced by the parameter of the - * same name. For example, given '/person/:name' and the parameters - * '{name: 'Bob'}', the final command path will be '/person/Bob'. - * - * @param {string} name The command name. - * @param {string} method The HTTP method to use when sending this command. - * @param {string} path The path to send the command to, relative to - * the WebDriver server's command root and of the form - * '/path/:variable/segment'. - */ - defineCommand(name: string, method: string, path: string): void; - - /** @override */ - execute(command: any): any; - } - - /** - * @param {string} str . - * @return {?} . - */ - function tryParse(str: string): any; - - /** - * Callback used to parse {@link HttpResponse} objects from a - * {@link HttpClient}. - * @param {!HttpResponse} httpResponse The HTTP response to parse. - * @param {boolean} w3c Whether the response should be processed using the - * W3C wire protocol. - * @return {{value: ?}} The parsed response. - * @throws {WebDriverError} If the HTTP response is an error. - */ - function parseHttpResponse(httpResponse: HttpResponse, w3c: boolean): any; - - /** - * Builds a fully qualified path using the given set of command parameters. Each - * path segment prefixed with ':' will be replaced by the value of the - * corresponding parameter. All parameters spliced into the path will be - * removed from the parameter map. - * @param {string} path The original resource path. - * @param {!Object<*>} parameters The parameters object to splice into the path. - * @return {string} The modified path. - */ - function buildPath(path: string, parameters: Object): string; + /** @override */ + toString(): string; } -export = http; +/** + * Represents a HTTP response message. + * @final + */ +export class HttpResponse { + /** + * @param {number} status The response code. + * @param {!Object} headers The response headers. All header names + * will be converted to lowercase strings for consistent lookups. + * @param {string} body The response body. + */ + constructor(status: number, headers: Object, body: string); + + /** @override */ + toString(): string; +} + + +export function post(path: string): any; +export function del(path: string): any; +export function get(path: string): any; +export function resource(method: string, path: string): any; + +/** + * A basic HTTP client used to send messages to a remote end. + */ +export class HttpClient { + /** + * @param {string} serverUrl URL for the WebDriver server to send commands to. + * @param {http.Agent=} opt_agent The agent to use for each request. + * Defaults to `http.globalAgent`. + * @param {?string=} opt_proxy The proxy to use for the connection to the + * server. Default is to use no proxy. + */ + constructor(serverUrl: string, opt_agent?: any, opt_proxy?: string); + + /** + * Sends a request to the server. The client will automatically follow any + * redirects returned by the server, fulfilling the returned promise with the + * final response. + * + * @param {!HttpRequest} httpRequest The request to send. + * @return {!promise.Promise} A promise that will be fulfilled + * with the server's response. + */ + send(httpRequest: HttpRequest): webdriver.promise.Promise; +} + +/** + * Sends a single HTTP request. + * @param {!Object} options The request options. + * @param {function(!HttpResponse)} onOk The function to call if the + * request succeeds. + * @param {function(!Error)} onError The function to call if the request fails. + * @param {?string=} opt_data The data to send with the request. + * @param {?string=} opt_proxy The proxy server to use for the request. + */ +export function sendRequest(options: Object, onOk: any, onError: any, opt_data?: string, opt_proxy?: string): any; + +/** + * A command executor that communicates with the server using HTTP + JSON. + * + * By default, each instance of this class will use the legacy wire protocol + * from [Selenium project][json]. The executor will automatically switch to the + * [W3C wire protocol][w3c] if the remote end returns a compliant response to + * a new session command. + * + * [json]: https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol + * [w3c]: https://w3c.github.io/webdriver/webdriver-spec.html + * + * @implements {cmd.Executor} + */ +export class Executor { + /** + * @param {!HttpClient} client The client to use for sending requests to the + * server. + */ + constructor(client: HttpClient); + + /** + * Defines a new command for use with this executor. When a command is sent, + * the {@code path} will be preprocessed using the command's parameters; any + * path segments prefixed with ':' will be replaced by the parameter of the + * same name. For example, given '/person/:name' and the parameters + * '{name: 'Bob'}', the final command path will be '/person/Bob'. + * + * @param {string} name The command name. + * @param {string} method The HTTP method to use when sending this command. + * @param {string} path The path to send the command to, relative to + * the WebDriver server's command root and of the form + * '/path/:variable/segment'. + */ + defineCommand(name: string, method: string, path: string): void; + + /** @override */ + execute(command: any): any; +} + +/** + * @param {string} str . + * @return {?} . + */ +export function tryParse(str: string): any; + +/** + * Callback used to parse {@link HttpResponse} objects from a + * {@link HttpClient}. + * @param {!HttpResponse} httpResponse The HTTP response to parse. + * @param {boolean} w3c Whether the response should be processed using the + * W3C wire protocol. + * @return {{value: ?}} The parsed response. + * @throws {WebDriverError} If the HTTP response is an error. + */ +export function parseHttpResponse(httpResponse: HttpResponse, w3c: boolean): any; + +/** + * Builds a fully qualified path using the given set of command parameters. Each + * path segment prefixed with ':' will be replaced by the value of the + * corresponding parameter. All parameters spliced into the path will be + * removed from the parameter map. + * @param {string} path The original resource path. + * @param {!Object<*>} parameters The parameters object to splice into the path. + * @return {string} The modified path. + */ +export function buildPath(path: string, parameters: Object): string; diff --git a/selenium-webdriver/v2/ie.d.ts b/selenium-webdriver/v2/ie.d.ts index ec22531fc1..a9ae4b2c4a 100644 --- a/selenium-webdriver/v2/ie.d.ts +++ b/selenium-webdriver/v2/ie.d.ts @@ -1,212 +1,206 @@ /* tslint:disable */ import * as webdriver from './index'; -declare namespace ie { +/** + * A WebDriver client for Microsoft's Internet Explorer. + */ +export class Driver extends webdriver.WebDriver { + /** + * @param {(capabilities.Capabilities|Options)=} opt_config The configuration + * options. + * @param {promise.ControlFlow=} opt_flow The control flow to use, + * or {@code null} to use the currently active flow. + */ + constructor(opt_config?: webdriver.Capabilities | Options, opt_flow?: webdriver.promise.ControlFlow); /** - * A WebDriver client for Microsoft's Internet Explorer. + * This function is a no-op as file detectors are not supported by this + * implementation. + * @override */ - class Driver extends webdriver.WebDriver { - /** - * @param {(capabilities.Capabilities|Options)=} opt_config The configuration - * options. - * @param {promise.ControlFlow=} opt_flow The control flow to use, - * or {@code null} to use the currently active flow. - */ - constructor(opt_config?: webdriver.Capabilities | Options, opt_flow?: webdriver.promise.ControlFlow); - - /** - * This function is a no-op as file detectors are not supported by this - * implementation. - * @override - */ - setFileDetector(): void; - } - - /** - * Class for managing IEDriver specific options. - */ - class Options { - constructor(); - - /** - * Extracts the IEDriver specific options from the given capabilities - * object. - * @param {!capabilities.Capabilities} caps The capabilities object. - * @return {!Options} The IEDriver options. - */ - static fromCapabilities(caps: webdriver.Capabilities): Options; - - /** - * Whether to disable the protected mode settings check when the session is - * created. Disbling this setting may lead to significant instability as the - * browser may become unresponsive/hang. Only 'best effort' support is provided - * when using this capability. - * - * For more information, refer to the IEDriver's - * [required system configuration](http://goo.gl/eH0Yi3). - * - * @param {boolean} ignoreSettings Whether to ignore protected mode settings. - * @return {!Options} A self reference. - */ - introduceFlakinessByIgnoringProtectedModeSettings(ignoreSettings: boolean): Options; - - /** - * Indicates whether to skip the check that the browser's zoom level is set to - * 100%. - * - * @param {boolean} ignore Whether to ignore the browser's zoom level settings. - * @return {!Options} A self reference. - */ - ignoreZoomSetting(ignore: boolean): Options; - - /** - * Sets the initial URL loaded when IE starts. This is intended to be used with - * {@link #ignoreProtectedModeSettings} to allow the user to initialize IE in - * the proper Protected Mode zone. Setting this option may cause browser - * instability or flaky and unresponsive code. Only 'best effort' support is - * provided when using this option. - * - * @param {string} url The initial browser URL. - * @return {!Options} A self reference. - */ - initialBrowserUrl(url: string): Options; - - /** - * Configures whether to enable persistent mouse hovering (true by default). - * Persistent hovering is achieved by continuously firing mouse over events at - * the last location the mouse cursor has been moved to. - * - * @param {boolean} enable Whether to enable persistent hovering. - * @return {!Options} A self reference. - */ - enablePersistentHover(enable: boolean): Options; - - /** - * Configures whether the driver should attempt to remove obsolete - * {@linkplain webdriver.WebElement WebElements} from its internal cache on - * page navigation (true by default). Disabling this option will cause the - * driver to run with a larger memory footprint. - * - * @param {boolean} enable Whether to enable element reference cleanup. - * @return {!Options} A self reference. - */ - enableElementCacheCleanup(enable: boolean): Options; - - /** - * Configures whether to require the IE window to have input focus before - * performing any user interactions (i.e. mouse or keyboard events). This - * option is disabled by default, but delivers much more accurate interaction - * events when enabled. - * - * @param {boolean} require Whether to require window focus. - * @return {!Options} A self reference. - */ - requireWindowFocus(require: boolean): Options; - - /** - * Configures the timeout, in milliseconds, that the driver will attempt to - * located and attach to a newly opened instance of Internet Explorer. The - * default is zero, which indicates waiting indefinitely. - * - * @param {number} timeout How long to wait for IE. - * @return {!Options} A self reference. - */ - browserAttachTimeout(timeout: number): Options; - - /** - * Configures whether to launch Internet Explorer using the CreateProcess API. - * If this option is not specified, IE is launched using IELaunchURL, if - * available. For IE 8 and above, this option requires the TabProcGrowth - * registry value to be set to 0. - * - * @param {boolean} force Whether to use the CreateProcess API. - * @return {!Options} A self reference. - */ - forceCreateProcessApi(force: boolean): Options; - - /** - * Specifies command-line switches to use when launching Internet Explorer. - * This is only valid when used with {@link #forceCreateProcessApi}. - * - * @param {...(string|!Array.)} var_args The arguments to add. - * @return {!Options} A self reference. - */ - addArguments(...var_args: Array): Options; - - /** - * Configures whether proxies should be configured on a per-process basis. If - * not set, setting a {@linkplain #setProxy proxy} will configure the system - * proxy. The default behavior is to use the system proxy. - * - * @param {boolean} enable Whether to enable per-process proxy settings. - * @return {!Options} A self reference. - */ - usePerProcessProxy(enable: boolean): Options; - - /** - * Configures whether to clear the cache, cookies, history, and saved form data - * before starting the browser. _Using this capability will clear session data - * for all running instances of Internet Explorer, including those started - * manually._ - * - * @param {boolean} cleanSession Whether to clear all session data on startup. - * @return {!Options} A self reference. - */ - ensureCleanSession(cleanSession: boolean): Options; - - /** - * Sets the path to the log file the driver should log to. - * @param {string} file The log file path. - * @return {!Options} A self reference. - */ - setLogFile(file: string): Options; - - /** - * Sets the IEDriverServer's logging {@linkplain Level level}. - * @param {Level} level The logging level. - * @return {!Options} A self reference. - */ - setLogLevel(level: webdriver.logging.Level): Options; - - /** - * Sets the IP address of the driver's host adapter. - * @param {string} host The IP address to use. - * @return {!Options} A self reference. - */ - setHost(host: string): Options; - - /** - * Sets the path of the temporary data directory to use. - * @param {string} path The log file path. - * @return {!Options} A self reference. - */ - setExtractPath(path: string): Options; - - /** - * Sets whether the driver should start in silent mode. - * @param {boolean} silent Whether to run in silent mode. - * @return {!Options} A self reference. - */ - silent(silent: boolean): Options; - - /** - * Sets the proxy settings for the new session. - * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. - * @return {!Options} A self reference. - */ - setProxy(proxy: webdriver.ProxyConfig): Options; - - /** - * Converts this options instance to a {@link capabilities.Capabilities} - * object. - * @param {capabilities.Capabilities=} opt_capabilities The capabilities to - * merge these options into, if any. - * @return {!capabilities.Capabilities} The capabilities. - */ - toCapabilities(opt_capabilities: webdriver.Capabilities): webdriver.Capabilities; - } - + setFileDetector(): void; } -export = ie; +/** + * Class for managing IEDriver specific options. + */ +export class Options { + constructor(); + + /** + * Extracts the IEDriver specific options from the given capabilities + * object. + * @param {!capabilities.Capabilities} caps The capabilities object. + * @return {!Options} The IEDriver options. + */ + static fromCapabilities(caps: webdriver.Capabilities): Options; + + /** + * Whether to disable the protected mode settings check when the session is + * created. Disbling this setting may lead to significant instability as the + * browser may become unresponsive/hang. Only 'best effort' support is provided + * when using this capability. + * + * For more information, refer to the IEDriver's + * [required system configuration](http://goo.gl/eH0Yi3). + * + * @param {boolean} ignoreSettings Whether to ignore protected mode settings. + * @return {!Options} A self reference. + */ + introduceFlakinessByIgnoringProtectedModeSettings(ignoreSettings: boolean): Options; + + /** + * Indicates whether to skip the check that the browser's zoom level is set to + * 100%. + * + * @param {boolean} ignore Whether to ignore the browser's zoom level settings. + * @return {!Options} A self reference. + */ + ignoreZoomSetting(ignore: boolean): Options; + + /** + * Sets the initial URL loaded when IE starts. This is intended to be used with + * {@link #ignoreProtectedModeSettings} to allow the user to initialize IE in + * the proper Protected Mode zone. Setting this option may cause browser + * instability or flaky and unresponsive code. Only 'best effort' support is + * provided when using this option. + * + * @param {string} url The initial browser URL. + * @return {!Options} A self reference. + */ + initialBrowserUrl(url: string): Options; + + /** + * Configures whether to enable persistent mouse hovering (true by default). + * Persistent hovering is achieved by continuously firing mouse over events at + * the last location the mouse cursor has been moved to. + * + * @param {boolean} enable Whether to enable persistent hovering. + * @return {!Options} A self reference. + */ + enablePersistentHover(enable: boolean): Options; + + /** + * Configures whether the driver should attempt to remove obsolete + * {@linkplain webdriver.WebElement WebElements} from its internal cache on + * page navigation (true by default). Disabling this option will cause the + * driver to run with a larger memory footprint. + * + * @param {boolean} enable Whether to enable element reference cleanup. + * @return {!Options} A self reference. + */ + enableElementCacheCleanup(enable: boolean): Options; + + /** + * Configures whether to require the IE window to have input focus before + * performing any user interactions (i.e. mouse or keyboard events). This + * option is disabled by default, but delivers much more accurate interaction + * events when enabled. + * + * @param {boolean} require Whether to require window focus. + * @return {!Options} A self reference. + */ + requireWindowFocus(require: boolean): Options; + + /** + * Configures the timeout, in milliseconds, that the driver will attempt to + * located and attach to a newly opened instance of Internet Explorer. The + * default is zero, which indicates waiting indefinitely. + * + * @param {number} timeout How long to wait for IE. + * @return {!Options} A self reference. + */ + browserAttachTimeout(timeout: number): Options; + + /** + * Configures whether to launch Internet Explorer using the CreateProcess API. + * If this option is not specified, IE is launched using IELaunchURL, if + * available. For IE 8 and above, this option requires the TabProcGrowth + * registry value to be set to 0. + * + * @param {boolean} force Whether to use the CreateProcess API. + * @return {!Options} A self reference. + */ + forceCreateProcessApi(force: boolean): Options; + + /** + * Specifies command-line switches to use when launching Internet Explorer. + * This is only valid when used with {@link #forceCreateProcessApi}. + * + * @param {...(string|!Array.)} var_args The arguments to add. + * @return {!Options} A self reference. + */ + addArguments(...var_args: string[]): Options; + + /** + * Configures whether proxies should be configured on a per-process basis. If + * not set, setting a {@linkplain #setProxy proxy} will configure the system + * proxy. The default behavior is to use the system proxy. + * + * @param {boolean} enable Whether to enable per-process proxy settings. + * @return {!Options} A self reference. + */ + usePerProcessProxy(enable: boolean): Options; + + /** + * Configures whether to clear the cache, cookies, history, and saved form data + * before starting the browser. _Using this capability will clear session data + * for all running instances of Internet Explorer, including those started + * manually._ + * + * @param {boolean} cleanSession Whether to clear all session data on startup. + * @return {!Options} A self reference. + */ + ensureCleanSession(cleanSession: boolean): Options; + + /** + * Sets the path to the log file the driver should log to. + * @param {string} file The log file path. + * @return {!Options} A self reference. + */ + setLogFile(file: string): Options; + + /** + * Sets the IEDriverServer's logging {@linkplain Level level}. + * @param {Level} level The logging level. + * @return {!Options} A self reference. + */ + setLogLevel(level: webdriver.logging.Level): Options; + + /** + * Sets the IP address of the driver's host adapter. + * @param {string} host The IP address to use. + * @return {!Options} A self reference. + */ + setHost(host: string): Options; + + /** + * Sets the path of the temporary data directory to use. + * @param {string} path The log file path. + * @return {!Options} A self reference. + */ + setExtractPath(path: string): Options; + + /** + * Sets whether the driver should start in silent mode. + * @param {boolean} silent Whether to run in silent mode. + * @return {!Options} A self reference. + */ + silent(silent: boolean): Options; + + /** + * Sets the proxy settings for the new session. + * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. + * @return {!Options} A self reference. + */ + setProxy(proxy: webdriver.ProxyConfig): Options; + + /** + * Converts this options instance to a {@link capabilities.Capabilities} + * object. + * @param {capabilities.Capabilities=} opt_capabilities The capabilities to + * merge these options into, if any. + * @return {!capabilities.Capabilities} The capabilities. + */ + toCapabilities(opt_capabilities: webdriver.Capabilities): webdriver.Capabilities; +} diff --git a/selenium-webdriver/v2/index.d.ts b/selenium-webdriver/v2/index.d.ts index 14b002a8be..25e9e0f606 100644 --- a/selenium-webdriver/v2/index.d.ts +++ b/selenium-webdriver/v2/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for Selenium WebDriverJS 2.53.1 +// Type definitions for Selenium WebDriverJS 2.53 // 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 /* tslint:disable */ import * as chrome from './chrome'; @@ -11,2090 +12,1004 @@ import * as ie from './ie'; import * as opera from './opera'; import * as safari from './safari'; -declare namespace webdriver { +export namespace error { + class IError extends Error { + constructor(opt_error?: string); - namespace error { - class IError extends Error { - constructor(opt_error?: string); - - code(): number; - } - - /** - * The base WebDriver error type. This error type is only used directly when a - * more appropriate category is not defined for the offending error. - */ - class WebDriverError extends IError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * An attempt was made to select an element that cannot be selected. - */ - class ElementNotSelectableError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * An element command could not be completed because the element is not visible - * on the page. - */ - class ElementNotVisibleError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * The arguments passed to a command are either invalid or malformed. - */ - class InvalidArgumentError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * An illegal attempt was made to set a cookie under a different domain than - * the current page. - */ - class InvalidCookieDomainError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * The coordinates provided to an interactions operation are invalid. - */ - class InvalidElementCoordinatesError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * An element command could not be completed because the element is in an - * invalid state, e.g. attempting to click an element that is no longer attached - * to the document. - */ - class InvalidElementStateError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * Argument was an invalid selector. - */ - class InvalidSelectorError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * Occurs when a command is directed to a session that does not exist. - */ - class NoSuchSessionError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * An error occurred while executing JavaScript supplied by the user. - */ - class JavascriptError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * The target for mouse interaction is not in the browser’s viewport and cannot - * be brought into that viewport. - */ - class MoveTargetOutOfBoundsError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * An attempt was made to operate on a modal dialog when one was not open. - */ - class NoSuchAlertError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * An element could not be located on the page using the given search - * parameters. - */ - class NoSuchElementError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * A request to switch to a frame could not be satisfied because the frame - * could not be found. - */ - class NoSuchFrameError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * A request to switch to a window could not be satisfied because the window - * could not be found. - */ - class NoSuchWindowError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * A script did not complete before its timeout expired. - */ - class ScriptTimeoutError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * A new session could not be created. - */ - class SessionNotCreatedError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * An element command failed because the referenced element is no longer - * attached to the DOM. - */ - class StaleElementReferenceError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * An operation did not completErrorCodee before its timeout expired. - */ - class TimeoutError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * A request to set a cookie’s value could not be satisfied. - */ - class UnableToSetCookieError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * A screen capture operation was not possible. - */ - class UnableToCaptureScreenError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * A modal dialog was open, blocking this operation. - */ - class UnexpectedAlertOpenError extends WebDriverError { - /** - * @param {string=} opt_error the error message, if any. - * @param {string=} opt_text the text of the open dialog, if available. - */ - constructor(opt_error?: string, opt_text?: string); - - /** - * @return {(string|undefined)} The text displayed with the unhandled alert, - * if available. - */ - getAlertText(): string; - } - - /** - * A command could not be executed because the remote end is not aware of it. - */ - class UnknownCommandError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * The requested command matched a known URL but did not match an method for - * that URL. - */ - class UnknownMethodError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - - /** - * Reports an unsupport operation. - */ - class UnsupportedOperationError extends WebDriverError { - /** @param {string=} opt_error the error message, if any. */ - constructor(opt_error?: string); - } - } - - namespace logging { - - /** - * A hash describing log preferences. - * @typedef {Object.} - */ - class Preferences { - setLevel(type: string, level: Level | string | number): void; - toJSON(): { [key: string]: string }; - } - - interface IType { - /** Logs originating from the browser. */ - BROWSER: string; - /** Logs from a WebDriver client. */ - CLIENT: string; - /** Logs from a WebDriver implementation. */ - DRIVER: string; - /** Logs related to performance. */ - PERFORMANCE: string; - /** Logs from the remote server. */ - SERVER: string; - } - - /** - * Common log types. - * @enum {string} - */ - var Type: IType; - - /** - * Defines a message level that may be used to control logging output. - * - * @final - */ - class Level { - name_: string; - value_: number; - /** - * @param {string} name the level's name. - * @param {number} level the level's numeric value. - */ - constructor(name: string, level: number); - - /** @override */ - toString(): string; - - /** This logger's name. */ - name: string; - - /** The numeric log level. */ - value: number; - - /** - * Indicates no log messages should be recorded. - * @const - */ - static OFF: Level; - /** - * Log messages with a level of `1000` or higher. - * @const - */ - static SEVERE: Level; - /** - * Log messages with a level of `900` or higher. - * @const - */ - static WARNING: Level; - /** - * Log messages with a level of `800` or higher. - * @const - */ - static INFO: Level; - /** - * Log messages with a level of `700` or higher. - * @const - */ - static DEBUG: Level; - /** - * Log messages with a level of `500` or higher. - * @const - */ - static FINE: Level; - /** - * Log messages with a level of `400` or higher. - * @const - */ - static FINER: Level; - /** - * Log messages with a level of `300` or higher. - * @const - */ - static FINEST: Level; - /** - * Indicates all log messages should be recorded. - * @const - */ - static ALL: Level; - } - - /** - * Converts a level name or value to a {@link webdriver.logging.Level} value. - * If the name/value is not recognized, {@link webdriver.logging.Level.ALL} - * will be returned. - * @param {(number|string)} nameOrValue The log level name, or value, to - * convert . - * @return {!webdriver.logging.Level} The converted level. - */ - function getLevel(nameOrValue: string | number): Level; - - interface IEntryJSON { - level: string; - message: string; - timestamp: number; - type: string; - } - - /** - * A single log entry. - */ - class Entry { - /** - * @param {(!webdriver.logging.Level|string)} level The entry level. - * @param {string} message The log message. - * @param {number=} opt_timestamp The time this entry was generated, in - * milliseconds since 0:00:00, January 1, 1970 UTC. If omitted, the - * current time will be used. - * @param {string=} opt_type The log type, if known. - * @constructor - */ - constructor(level: Level | string | number, message: string, opt_timestamp?: number, opt_type?: string | IType); - - /** @type {!webdriver.logging.Level} */ - level: Level; - - /** @type {string} */ - message: string; - - /** @type {number} */ - timestamp: number; - - /** @type {string} */ - type: string; - - /** - * @return {{level: string, message: string, timestamp: number, - * type: string}} The JSON representation of this entry. - */ - toJSON(): IEntryJSON; - } - - /** - * An object used to log debugging messages. Loggers use a hierarchical, - * dot-separated naming scheme. For instance, 'foo' is considered the parent of - * the 'foo.bar' and an ancestor of 'foo.bar.baz'. - * - * Each logger may be assigned a {@linkplain #setLevel log level}, which - * controls which level of messages will be reported to the - * {@linkplain #addHandler handlers} attached to this instance. If a log level - * is not explicitly set on a logger, it will inherit its parent. - * - * This class should never be directly instantiated. Instead, users should - * obtain logger references using the {@linkplain ./logging.getLogger() - * getLogger()} function. - * - * @final - */ - class Logger { - /** - * @param {string} name the name of this logger. - * @param {Level=} opt_level the initial level for this logger. - */ - constructor(name: string, opt_level?: Level); - - /** @private {string} */ - name_: string; - /** @private {Level} */ - level_: Level; - /** @private {Logger} */ - parent_: Logger; - /** @private {Set} */ - handlers_: any; - - /** @return {string} the name of this logger. */ - getName(): string; - - /** - * @param {Level} level the new level for this logger, or `null` if the logger - * should inherit its level from its parent logger. - */ - setLevel(level: Level): void; - - /** @return {Level} the log level for this logger. */ - getLevel(): Level; - - /** - * @return {!Level} the effective level for this logger. - */ - getEffectiveLevel(): Level; - - /** - * @param {!Level} level the level to check. - * @return {boolean} whether messages recorded at the given level are loggable - * by this instance. - */ - isLoggable(level: Level): boolean; - - /** - * Adds a handler to this logger. The handler will be invoked for each message - * logged with this instance, or any of its descendants. - * - * @param {function(!Entry)} handler the handler to add. - */ - addHandler(handler: any): void; - - /** - * Removes a handler from this logger. - * - * @param {function(!Entry)} handler the handler to remove. - * @return {boolean} whether a handler was successfully removed. - */ - removeHandler(handler: any): void; - - /** - * Logs a message at the given level. The message may be defined as a string - * or as a function that will return the message. If a function is provided, - * it will only be invoked if this logger's - * {@linkplain #getEffectiveLevel() effective log level} includes the given - * `level`. - * - * @param {!Level} level the level at which to log the message. - * @param {(string|function(): string)} loggable the message to log, or a - * function that will return the message. - */ - log(level: Level, loggable: string | Function): void; - - /** - * Logs a message at the {@link Level.SEVERE} log level. - * @param {(string|function(): string)} loggable the message to log, or a - * function that will return the message. - */ - severe(loggable: string | Function): void; - - /** - * Logs a message at the {@link Level.WARNING} log level. - * @param {(string|function(): string)} loggable the message to log, or a - * function that will return the message. - */ - warning(loggable: string | Function): void; - - /** - * Logs a message at the {@link Level.INFO} log level. - * @param {(string|function(): string)} loggable the message to log, or a - * function that will return the message. - */ - info(loggable: string | Function): void; - - /** - * Logs a message at the {@link Level.DEBUG} log level. - * @param {(string|function(): string)} loggable the message to log, or a - * function that will return the message. - */ - debug(loggable: string | Function): void; - - /** - * Logs a message at the {@link Level.FINE} log level. - * @param {(string|function(): string)} loggable the message to log, or a - * function that will return the message. - */ - fine(loggable: string | Function): void; - - /** - * Logs a message at the {@link Level.FINER} log level. - * @param {(string|function(): string)} loggable the message to log, or a - * function that will return the message. - */ - finer(loggable: string | Function): void; - - /** - * Logs a message at the {@link Level.FINEST} log level. - * @param {(string|function(): string)} loggable the message to log, or a - * function that will return the message. - */ - finest(loggable: string | Function): void; - } - - /** - * Maintains a collection of loggers. - * - * @final - */ - class LogManager { - /** - * Retrieves a named logger, creating it in the process. This function will - * implicitly create the requested logger, and any of its parents, if they - * do not yet exist. - * - * @param {string} name the logger's name. - * @return {!Logger} the requested logger. - */ - getLogger(name: string): Logger; - - /** - * Creates a new logger. - * - * @param {string} name the logger's name. - * @param {!Logger} parent the logger's parent. - * @return {!Logger} the new logger. - * @private - */ - createLogger_(name: string, parent: Logger): Logger; - } - } - - namespace promise { - //region Functions - - /** - * Given an array of promises, will return a promise that will be fulfilled - * with the fulfillment values of the input array's values. If any of the - * input array's promises are rejected, the returned promise will be rejected - * with the same reason. - * - * @param {!Array<(T|!ManagedPromise)>} arr An array of - * promises to wait on. - * @return {!ManagedPromise>} A promise that is - * fulfilled with an array containing the fulfilled values of the - * input array, or rejected with the same reason as the first - * rejected value. - * @template T - */ - function all(arr: Array>): Promise; - - /** - * Invokes the appropriate callback function as soon as a promised - * {@code value} is resolved. This function is similar to - * {@link webdriver.promise.when}, except it does not return a new promise. - * @param {*} value The value to observe. - * @param {Function} callback The function to call when the value is - * resolved successfully. - * @param {Function=} opt_errback The function to call when the value is - * rejected. - */ - function asap(value: any, callback: Function, opt_errback?: Function): void; - - /** - * @return {!webdriver.promise.ControlFlow} The currently active control flow. - */ - function controlFlow(): ControlFlow; - - /** - * Creates a new control flow. The provided callback will be invoked as the - * first task within the new flow, with the flow as its sole argument. Returns - * a promise that resolves to the callback result. - * @param {function(!ControlFlow)} callback The entry point - * to the newly created flow. - * @return {!ManagedPromise} A promise that resolves to the callback - * result. - */ - function createFlow(callback: (flow: ControlFlow) => R): Promise; - - /** - * Determines whether a {@code value} should be treated as a promise. - * Any object whose 'then' property is a function will be considered a promise. - * - * @param {*} value The value to test. - * @return {boolean} Whether the value is a promise. - */ - function isPromise(value: any): boolean; - - /** - * Tests is a function is a generator. - * @param {!Function} fn The function to test. - * @return {boolean} Whether the function is a generator. - */ - function isGenerator(fn: Function): boolean; - - /** - * Creates a promise that will be resolved at a set time in the future. - * @param {number} ms The amount of time, in milliseconds, to wait before - * resolving the promise. - * @return {!ManagedPromise} The promise. - */ - function delayed(ms: number): Promise; - - /** - * Calls a function for each element in an array, and if the function returns - * true adds the element to a new array. - * - * If the return value of the filter function is a promise, this function - * will wait for it to be fulfilled before determining whether to insert the - * element into the new array. - * - * If the filter function throws or returns a rejected promise, the promise - * returned by this function will be rejected with the same reason. Only the - * first failure will be reported; all subsequent errors will be silently - * ignored. - * - * @param {!(Array|ManagedPromise>)} arr The - * array to iterator over, or a promise that will resolve to said array. - * @param {function(this: SELF, TYPE, number, !Array): ( - * boolean|ManagedPromise)} fn The function - * to call for each element in the array. - * @param {SELF=} opt_self The object to be used as the value of 'this' within - * {@code fn}. - * @template TYPE, SELF - */ - function filter(arr: Array | Promise>, fn: (element: T, type: any, index: number, array: T[]) => any, opt_self?: any): Promise; - - /** - * Creates a new deferred object. - * @return {!webdriver.promise.Deferred} The new deferred object. - */ - function defer(): Deferred; - - /** - * Creates a promise that has been resolved with the given value. - * @param {T=} opt_value The resolved value. - * @return {!ManagedPromise} The resolved promise. - * @template T - */ - function fulfilled(opt_value?: T): Promise; - - /** - * Calls a function for each element in an array and inserts the result into a - * new array, which is used as the fulfillment value of the promise returned - * by this function. - * - * If the return value of the mapping function is a promise, this function - * will wait for it to be fulfilled before inserting it into the new array. - * - * If the mapping function throws or returns a rejected promise, the - * promise returned by this function will be rejected with the same reason. - * Only the first failure will be reported; all subsequent errors will be - * silently ignored. - * - * @param {!(Array|ManagedPromise>)} arr The - * array to iterator over, or a promise that will resolve to said array. - * @param {function(this: SELF, TYPE, number, !Array): ?} fn The - * function to call for each element in the array. This function should - * expect three arguments (the element, the index, and the array itself. - * @param {SELF=} opt_self The object to be used as the value of 'this' within - * {@code fn}. - * @template TYPE, SELF - */ - function map(arr: Array | Promise>, fn: (self: any, type: any, index: number, array: T[]) => any, opt_self?: any): Promise - - /** - * Creates a promise that has been rejected with the given reason. - * @param {*=} opt_reason The rejection reason; may be any value, but is - * usually an Error or a string. - * @return {!ManagedPromise} The rejected promise. - * @template T - */ - function rejected(opt_reason?: any): Promise; - - /** - * Wraps a function that expects a node-style callback as its final - * argument. This callback expects two arguments: an error value (which will be - * null if the call succeeded), and the success value as the second argument. - * The callback will the resolve or reject the returned promise, based on its - * arguments. - * @param {!Function} fn The function to wrap. - * @param {...?} var_args The arguments to apply to the function, excluding the - * final callback. - * @return {!ManagedPromise} A promise that will be resolved with the - * result of the provided function's callback. - */ - function checkedNodeCall(fn: Function, ...var_args: any[]): Promise; - - /** - * Consumes a {@code GeneratorFunction}. Each time the generator yields a - * promise, this function will wait for it to be fulfilled before feeding the - * fulfilled value back into {@code next}. Likewise, if a yielded promise is - * rejected, the rejection error will be passed to {@code throw}. - * - * __Example 1:__ the Fibonacci Sequence. - * - * promise.consume(function* fibonacci() { - * var n1 = 1, n2 = 1; - * for (var i = 0; i < 4; ++i) { - * var tmp = yield n1 + n2; - * n1 = n2; - * n2 = tmp; - * } - * return n1 + n2; - * }).then(function(result) { - * console.log(result); // 13 - * }); - * - * __Example 2:__ a generator that throws. - * - * promise.consume(function* () { - * yield promise.delayed(250).then(function() { - * throw Error('boom'); - * }); - * }).catch(function(e) { - * console.log(e.toString()); // Error: boom - * }); - * - * @param {!Function} generatorFn The generator function to execute. - * @param {Object=} opt_self The object to use as 'this' when invoking the - * initial generator. - * @param {...*} var_args Any arguments to pass to the initial generator. - * @return {!ManagedPromise} A promise that will resolve to the - * generator's final result. - * @throws {TypeError} If the given function is not a generator. - */ - function consume(generatorFn: Function, opt_self?: any, ...var_args: any[]): Promise; - - /** - * Registers an observer on a promised {@code value}, returning a new promise - * that will be resolved when the value is. If {@code value} is not a promise, - * then the return promise will be immediately resolved. - * @param {*} value The value to observe. - * @param {Function=} opt_callback The function to call when the value is - * resolved successfully. - * @param {Function=} opt_errback The function to call when the value is - * rejected. - * @return {!ManagedPromise} A new promise. - */ - function when(value: T | Promise, opt_callback?: (value: T) => any, opt_errback?: (error: any) => any): Promise; - - /** - * Returns a promise that will be resolved with the input value in a - * fully-resolved state. If the value is an array, each element will be fully - * resolved. Likewise, if the value is an object, all keys will be fully - * resolved. In both cases, all nested arrays and objects will also be - * fully resolved. All fields are resolved in place; the returned promise will - * resolve on {@code value} and not a copy. - * - * Warning: This function makes no checks against objects that contain - * cyclical references: - * - * var value = {}; - * value['self'] = value; - * promise.fullyResolved(value); // Stack overflow. - * - * @param {*} value The value to fully resolve. - * @return {!ManagedPromise} A promise for a fully resolved version - * of the input value. - */ - function fullyResolved(value: any): Promise; - - /** - * Changes the default flow to use when no others are active. - * @param {!ControlFlow} flow The new default flow. - * @throws {Error} If the default flow is not currently active. - */ - function setDefaultFlow(flow: ControlFlow): void; - - //endregion - - /** - * Error used when the computation of a promise is cancelled. - */ - class CancellationError extends Error { - /** - * @param {string=} opt_msg The cancellation message. - */ - constructor(opt_msg?: string); - } - - interface IThenable { - /** - * Cancels the computation of this promise's value, rejecting the promise in - * the process. This method is a no-op if the promise has already been - * resolved. - * - * @param {(string|Error)=} opt_reason The reason this promise is being - * cancelled. This value will be wrapped in a {@link CancellationError}. - */ - cancel(opt_reason?: string | Error): void; - - /** @return {boolean} Whether this promise's value is still being computed. */ - isPending(): boolean; - - /** - * Registers listeners for when this instance is resolved. - * - * @param {?(function(T): (R|IThenable))=} opt_callback The - * function to call if this promise is successfully resolved. The function - * should expect a single argument: the promise's resolved value. - * @param {?(function(*): (R|IThenable))=} opt_errback - * The function to call if this promise is rejected. The function should - * expect a single argument: the rejection reason. - * @return {!ManagedPromise} A new promise which will be - * resolved with the result of the invoked callback. - * @template R - */ - then(opt_callback?: (value: T) => R | IThenable, opt_errback?: (error: any) => any): Promise; - - /** - * Registers a listener for when this promise is rejected. This is synonymous - * with the {@code catch} clause in a synchronous API: - * - * // Synchronous API: - * try { - * doSynchronousWork(); - * } catch (ex) { - * console.error(ex); - * } - * - * // Asynchronous promise API: - * doAsynchronousWork().catch(function(ex) { - * console.error(ex); - * }); - * - * @param {function(*): (R|IThenable)} errback The - * function to call if this promise is rejected. The function should - * expect a single argument: the rejection reason. - * @return {!ManagedPromise} A new promise which will be - * resolved with the result of the invoked callback. - * @template R - */ - catch(errback: Function): Promise; - } - - /** - * Thenable is a promise-like object with a {@code then} method which may be - * used to schedule callbacks on a promised value. - * - * @interface - * @template T - */ - class Thenable implements IThenable { - /** - * Cancels the computation of this promise's value, rejecting the promise in - * the process. This method is a no-op if the promise has already been - * resolved. - * - * @param {(string|Error)=} opt_reason The reason this promise is being - * cancelled. This value will be wrapped in a {@link CancellationError}. - */ - cancel(opt_reason?: string | Error): void; - - /** @return {boolean} Whether this promise's value is still being computed. */ - isPending(): boolean; - - /** - * Registers listeners for when this instance is resolved. - * - * @param {?(function(T): (R|IThenable))=} opt_callback The - * function to call if this promise is successfully resolved. The function - * should expect a single argument: the promise's resolved value. - * @param {?(function(*): (R|IThenable))=} opt_errback - * The function to call if this promise is rejected. The function should - * expect a single argument: the rejection reason. - * @return {!ManagedPromise} A new promise which will be - * resolved with the result of the invoked callback. - * @template R - */ - then(opt_callback?: (value: T) => R | IThenable, opt_errback?: (error: any) => R | IThenable): Promise; - - /** - * Registers a listener for when this promise is rejected. This is synonymous - * with the {@code catch} clause in a synchronous API: - * - * // Synchronous API: - * try { - * doSynchronousWork(); - * } catch (ex) { - * console.error(ex); - * } - * - * // Asynchronous promise API: - * doAsynchronousWork().catch(function(ex) { - * console.error(ex); - * }); - * - * @param {function(*): (R|IThenable)} errback The - * function to call if this promise is rejected. The function should - * expect a single argument: the rejection reason. - * @return {!ManagedPromise} A new promise which will be - * resolved with the result of the invoked callback. - * @template R - */ - catch(errback: Function): Promise; - - /** - * Registers a listener to invoke when this promise is resolved, regardless - * of whether the promise's value was successfully computed. This function - * is synonymous with the {@code finally} clause in a synchronous API: - * - * // Synchronous API: - * try { - * doSynchronousWork(); - * } finally { - * cleanUp(); - * } - * - * // Asynchronous promise API: - * doAsynchronousWork().finally(cleanUp); - * - * __Note:__ similar to the {@code finally} clause, if the registered - * callback returns a rejected promise or throws an error, it will silently - * replace the rejection error (if any) from this promise: - * - * try { - * throw Error('one'); - * } finally { - * throw Error('two'); // Hides Error: one - * } - * - * promise.rejected(Error('one')) - * .finally(function() { - * throw Error('two'); // Hides Error: one - * }); - * - * @param {function(): (R|IThenable)} callback The function to call when - * this promise is resolved. - * @return {!ManagedPromise} A promise that will be fulfilled - * with the callback result. - * @template R - */ - finally(callback: Function): Promise; - - /** - * Adds a property to a class prototype to allow runtime checks of whether - * instances of that class implement the Thenable interface. This function - * will also ensure the prototype's {@code then} function is exported from - * compiled code. - * @param {function(new: Thenable, ...?)} ctor The - * constructor whose prototype to modify. - */ - static addImplementation(ctor: Function): void; - - /** - * Checks if an object has been tagged for implementing the Thenable - * interface as defined by {@link Thenable.addImplementation}. - * @param {*} object The object to test. - * @return {boolean} Whether the object is an implementation of the Thenable - * interface. - */ - static isImplementation(object: any): boolean; - } - - interface IFulfilledCallback { - (value: T | IThenable | Thenable | void): void; - } - - interface IRejectedCallback { - (reason: any): void; - } - - /** - * Represents the eventual value of a completed operation. Each promise may be - * in one of three states: pending, fulfilled, or rejected. Each promise starts - * in the pending state and may make a single transition to either a - * fulfilled or rejected state, at which point the promise is considered - * resolved. - * - * @implements {promise.Thenable} - * @template T - * @see http://promises-aplus.github.io/promises-spec/ - */ - class Promise implements IThenable { - /** - * @param {function( - * function((T|IThenable|Thenable)=), - * function(*=))} resolver - * Function that is invoked immediately to begin computation of this - * promise's value. The function should accept a pair of callback - * functions, one for fulfilling the promise and another for rejecting it. - * @param {ControlFlow=} opt_flow The control flow - * this instance was created under. Defaults to the currently active flow. - */ - constructor(resolver: (resolve: IFulfilledCallback, reject: IRejectedCallback) => void, opt_flow?: ControlFlow); - - //region Methods - - /** - * Cancels the computation of this promise's value, rejecting the promise in the - * process. - * @param {*} reason The reason this promise is being cancelled. If not an - * {@code Error}, one will be created using the value's string - * representation. - */ - cancel(opt_reason?: string | Error): void; - - /** @return {boolean} Whether this promise's value is still being computed. */ - isPending(): boolean; - - /** - * Registers listeners for when this instance is resolved. This function most - * overridden by subtypes. - * - * @param opt_callback The function to call if this promise is - * successfully resolved. The function should expect a single argument: the - * promise's resolved value. - * @param opt_errback The function to call if this promise is - * rejected. The function should expect a single argument: the rejection - * reason. - * @return A new promise which will be resolved - * with the result of the invoked callback. - */ - then(opt_callback?: (value: T) => IThenable | R, opt_errback?: (error: any) => any): Promise; - - /** - * Registers a listener for when this promise is rejected. This is synonymous - * with the {@code catch} clause in a synchronous API: - *
    
    -       *   // Synchronous API:
    -       *   try {
    -       *     doSynchronousWork();
    -       *   } catch (ex) {
    -       *     console.error(ex);
    -       *   }
    -       *
    -       *   // Asynchronous promise API:
    -       *   doAsynchronousWork().thenCatch(function(ex) {
    -       *     console.error(ex);
    -       *   });
    -       * 
    - * - * @param {function(*): (R|webdriver.promise.Promise.)} errback The function - * to call if this promise is rejected. The function should expect a single - * argument: the rejection reason. - * @return {!webdriver.promise.Promise.} A new promise which will be - * resolved with the result of the invoked callback. - * @template R - */ - thenCatch(errback: (error: any) => any): Promise; - - /** - * Registers a listener for when this promise is rejected. This is synonymous - * with the {@code catch} clause in a synchronous API: - * - * // Synchronous API: - * try { - * doSynchronousWork(); - * } catch (ex) { - * console.error(ex); - * } - * - * // Asynchronous promise API: - * doAsynchronousWork().catch(function(ex) { - * console.error(ex); - * }); - * - * @param {function(*): (R|IThenable)} errback The - * function to call if this promise is rejected. The function should - * expect a single argument: the rejection reason. - * @return {!ManagedPromise} A new promise which will be - * resolved with the result of the invoked callback. - * @template R - */ - catch(errback: Function): Promise; - - - /** - * Registers a listener to invoke when this promise is resolved, regardless - * of whether the promise's value was successfully computed. This function - * is synonymous with the {@code finally} clause in a synchronous API: - *
    
    -       *   // Synchronous API:
    -       *   try {
    -       *     doSynchronousWork();
    -       *   } finally {
    -       *     cleanUp();
    -       *   }
    -       *
    -       *   // Asynchronous promise API:
    -       *   doAsynchronousWork().thenFinally(cleanUp);
    -       * 
    - * - * Note: similar to the {@code finally} clause, if the registered - * callback returns a rejected promise or throws an error, it will silently - * replace the rejection error (if any) from this promise: - *
    
    -       *   try {
    -       *     throw Error('one');
    -       *   } finally {
    -       *     throw Error('two');  // Hides Error: one
    -       *   }
    -       *
    -       *   webdriver.promise.rejected(Error('one'))
    -       *       .thenFinally(function() {
    -       *         throw Error('two');  // Hides Error: one
    -       *       });
    -       * 
    - * - * - * @param {function(): (R|webdriver.promise.Promise.)} callback The function - * to call when this promise is resolved. - * @return {!webdriver.promise.Promise.} A promise that will be fulfilled - * with the callback result. - * @template R - */ - thenFinally(callback: Function): Promise; - - //endregion - } - - /** - * Represents a value that will be resolved at some point in the future. This - * class represents the protected 'producer' half of a Promise - each Deferred - * has a {@code promise} property that may be returned to consumers for - * registering callbacks, reserving the ability to resolve the deferred to the - * producer. - * - *

    If this Deferred is rejected and there are no listeners registered before - * the next turn of the event loop, the rejection will be passed to the - * {@link webdriver.promise.ControlFlow} as an unhandled failure. - * - *

    If this Deferred is cancelled, the cancellation reason will be forward to - * the Deferred's canceller function (if provided). The canceller may return a - * truth-y value to override the reason provided for rejection. - * - * @extends {webdriver.promise.Promise} - */ - class Deferred extends Promise { - //region Constructors - - /** - * - * @param {webdriver.promise.ControlFlow=} opt_flow The control flow - * this instance was created under. This should only be provided during - * unit tests. - * @constructor - */ - constructor(opt_flow?: ControlFlow); - - //endregion - - static State_: { - BLOCKED: number; - PENDING: number; - REJECTED: number; - RESOLVED: number; - }; - - //region Properties - - /** - * The consumer promise for this instance. Provides protected access to the - * callback registering functions. - * @type {!webdriver.promise.Promise} - */ - promise: Promise; - - //endregion - - //region Methods - - /** - * Rejects this promise. If the error is itself a promise, this instance will - * be chained to it and be rejected with the error's resolved value. - * @param {*=} opt_error The rejection reason, typically either a - * {@code Error} or a {@code string}. - */ - reject(opt_error?: any): void; - errback(opt_error?: any): void; - - /** - * Resolves this promise with the given value. If the value is itself a - * promise and not a reference to this deferred, this instance will wait for - * it before resolving. - * @param {*=} opt_value The resolved value. - */ - fulfill(opt_value?: T): void; - - /** - * Removes all of the listeners previously registered on this deferred. - * @throws {Error} If this deferred has already been resolved. - */ - removeAll(): void; - - //endregion - } - - interface IControlFlowTimer { - clearInterval: (ms: number) => void; - clearTimeout: (ms: number) => void; - setInterval: (fn: Function, ms: number) => number; - setTimeout: (fn: Function, ms: number) => number; - } - - interface IEventType { - /** Emitted when all tasks have been successfully executed. */ - IDLE: string; - - /** Emitted when a ControlFlow has been reset. */ - RESET: string; - - /** Emitted whenever a new task has been scheduled. */ - SCHEDULE_TASK: string; - - /** - * Emitted whenever a control flow aborts due to an unhandled promise - * rejection. This event will be emitted along with the offending rejection - * reason. Upon emitting this event, the control flow will empty its task - * queue and revert to its initial state. - */ - UNCAUGHT_EXCEPTION: string; - } - - /** - * Handles the execution of scheduled tasks, each of which may be an - * asynchronous operation. The control flow will ensure tasks are executed in - * the ordered scheduled, starting each task only once those before it have - * completed. - * - * Each task scheduled within this flow may return a - * {@link webdriver.promise.Promise} to indicate it is an asynchronous - * operation. The ControlFlow will wait for such promises to be resolved before - * marking the task as completed. - * - * Tasks and each callback registered on a {@link webdriver.promise.Promise} - * will be run in their own ControlFlow frame. Any tasks scheduled within a - * frame will take priority over previously scheduled tasks. Furthermore, if any - * of the tasks in the frame fail, the remainder of the tasks in that frame will - * be discarded and the failure will be propagated to the user through the - * callback/task's promised result. - * - * Each time a ControlFlow empties its task queue, it will fire an - * {@link webdriver.promise.ControlFlow.EventType.IDLE IDLE} event. Conversely, - * whenever the flow terminates due to an unhandled error, it will remove all - * remaining tasks in its queue and fire an - * {@link webdriver.promise.ControlFlow.EventType.UNCAUGHT_EXCEPTION - * UNCAUGHT_EXCEPTION} event. If there are no listeners registered with the - * flow, the error will be rethrown to the global error handler. - * - * @extends {EventEmitter} - * @final - */ - class ControlFlow extends EventEmitter { - /** - * @constructor - */ - constructor(); - - /** - * Events that may be emitted by an {@link webdriver.promise.ControlFlow}. - * @enum {string} - */ - static EventType: IEventType; - - /** - * Returns a string representation of this control flow, which is its current - * {@link #getSchedule() schedule}, sans task stack traces. - * @return {string} The string representation of this contorl flow. - * @override - */ - toString(): string; - - /** - * Resets this instance, clearing its queue and removing all event listeners. - */ - reset(): void; - - /** - * Generates an annotated string describing the internal state of this control - * flow, including the currently executing as well as pending tasks. If - * {@code opt_includeStackTraces === true}, the string will include the - * stack trace from when each task was scheduled. - * @param {string=} opt_includeStackTraces Whether to include the stack traces - * from when each task was scheduled. Defaults to false. - * @return {string} String representation of this flow's internal state. - */ - getSchedule(opt_includeStackTraces?: boolean): string; - - /** - * Schedules a task for execution. If there is nothing currently in the - * queue, the task will be executed in the next turn of the event loop. If - * the task function is a generator, the task will be executed using - * {@link webdriver.promise.consume}. - * - * @param {function(): (T|promise.Promise)} fn The function to - * call to start the task. If the function returns a - * {@link webdriver.promise.Promise}, this instance will wait for it to be - * resolved before starting the next task. - * @param {string=} opt_description A description of the task. - * @return {!promise.Promise} A promise that will be resolved - * with the result of the action. - * @template T - */ - execute(fn: () => (T | Promise), opt_description?: string): Promise; - - /** - * Inserts a {@code setTimeout} into the command queue. This is equivalent to - * a thread sleep in a synchronous programming language. - * - * @param {number} ms The timeout delay, in milliseconds. - * @param {string=} opt_description A description to accompany the timeout. - * @return {!webdriver.promise.Promise} A promise that will be resolved with - * the result of the action. - */ - timeout(ms: number, opt_description?: string): Promise; - - /** - * Schedules a task that shall wait for a condition to hold. Each condition - * function may return any value, but it will always be evaluated as a boolean. - * - * Condition functions may schedule sub-tasks with this instance, however, - * their execution time will be factored into whether a wait has timed out. - * - * In the event a condition returns a Promise, the polling loop will wait for - * it to be resolved before evaluating whether the condition has been satisfied. - * The resolution time for a promise is factored into whether a wait has timed - * out. - * - * If the condition function throws, or returns a rejected promise, the - * wait task will fail. - * - * If the condition is defined as a promise, the flow will wait for it to - * settle. If the timeout expires before the promise settles, the promise - * returned by this function will be rejected. - * - * If this function is invoked with `timeout === 0`, or the timeout is omitted, - * the flow will wait indefinitely for the condition to be satisfied. - * - * @param {(!promise.Promise|function())} condition The condition to poll, - * or a promise to wait on. - * @param {number=} opt_timeout How long to wait, in milliseconds, for the - * condition to hold before timing out. If omitted, the flow will wait - * indefinitely. - * @param {string=} opt_message An optional error message to include if the - * wait times out; defaults to the empty string. - * @return {!promise.Promise} A promise that will be fulfilled - * when the condition has been satisified. The promise shall be rejected if - * the wait times out waiting for the condition. - * @throws {TypeError} If condition is not a function or promise or if timeout - * is not a number >= 0. - * @template T - */ - wait(condition: Promise | Function, opt_timeout?: number, opt_message?: string): Promise; - } - } - - namespace until { - /** - * Defines a condition to - */ - class Condition { - /** - * @param {string} message A descriptive error message. Should complete the - * sentence 'Waiting [...]' - * @param {function(!webdriver.WebDriver): OUT} fn The condition function to - * evaluate on each iteration of the wait loop. - * @constructor - */ - constructor(message: string, fn: (webdriver: WebDriver) => any); - - /** @return {string} A description of this condition. */ - description(): string; - - /** @type {function(!webdriver.WebDriver): OUT} */ - fn(webdriver: WebDriver): any; - } - - /** - * Creates a condition that will wait until the input driver is able to switch - * to the designated frame. The target frame may be specified as - * - * 1. a numeric index into - * [window.frames](https://developer.mozilla.org/en-US/docs/Web/API/Window.frames) - * for the currently selected frame. - * 2. a {@link ./webdriver.WebElement}, which must reference a FRAME or IFRAME - * element on the current page. - * 3. a locator which may be used to first locate a FRAME or IFRAME on the - * current page before attempting to switch to it. - * - * Upon successful resolution of this condition, the driver will be left - * focused on the new frame. - * - * @param {!(number|./webdriver.WebElement|By| - * function(!./webdriver.WebDriver): !./webdriver.WebElement)} frame - * The frame identifier. - * @return {!Condition} A new condition. - */ - function ableToSwitchToFrame(frame: number | WebElement | By | ((webdriver: WebDriver) => WebElement)): Condition; - - /** - * Creates a condition that waits for an alert to be opened. Upon success, the - * returned promise will be fulfilled with the handle for the opened alert. - * - * @return {!Condition} The new condition. - */ - function alertIsPresent(): Condition; - - /** - * Creates a condition that will wait for the given element to be disabled. - * - * @param {!webdriver.WebElement} element The element to test. - * @return {!until.Condition.} The new condition. - * @see webdriver.WebDriver#isEnabled - */ - function elementIsDisabled(element: WebElement): Condition; - - /** - * Creates a condition that will wait for the given element to be enabled. - * - * @param {!webdriver.WebElement} element The element to test. - * @return {!until.Condition.} The new condition. - * @see webdriver.WebDriver#isEnabled - */ - function elementIsEnabled(element: WebElement): Condition; - - /** - * Creates a condition that will wait for the given element to be deselected. - * - * @param {!webdriver.WebElement} element The element to test. - * @return {!until.Condition.} The new condition. - * @see webdriver.WebDriver#isSelected - */ - function elementIsNotSelected(element: WebElement): Condition; - - /** - * Creates a condition that will wait for the given element to be in the DOM, - * yet not visible to the user. - * - * @param {!webdriver.WebElement} element The element to test. - * @return {!until.Condition.} The new condition. - * @see webdriver.WebDriver#isDisplayed - */ - function elementIsNotVisible(element: WebElement): Condition; - - /** - * Creates a condition that will wait for the given element to be selected. - * @param {!webdriver.WebElement} element The element to test. - * @return {!until.Condition.} The new condition. - * @see webdriver.WebDriver#isSelected - */ - function elementIsSelected(element: WebElement): Condition; - - /** - * Creates a condition that will wait for the given element to become visible. - * - * @param {!webdriver.WebElement} element The element to test. - * @return {!until.Condition.} The new condition. - * @see webdriver.WebDriver#isDisplayed - */ - function elementIsVisible(element: WebElement): Condition; - - /** - * Creates a condition that will loop until an element is - * {@link ./webdriver.WebDriver#findElement found} with the given locator. - * - * @param {!(By|Function)} locator The locator to use. - * @return {!until.Condition.} The new condition. - */ - function elementLocated(locator: By | Function): Condition; - - /** - * Creates a condition that will wait for the given element's - * {@link webdriver.WebDriver#getText visible text} to contain the given - * substring. - * - * @param {!webdriver.WebElement} element The element to test. - * @param {string} substr The substring to search for. - * @return {!until.Condition.} The new condition. - * @see webdriver.WebDriver#getText - */ - function elementTextContains(element: WebElement, substr: string): Condition; - - /** - * Creates a condition that will wait for the given element's - * {@link webdriver.WebDriver#getText visible text} to match the given - * {@code text} exactly. - * - * @param {!webdriver.WebElement} element The element to test. - * @param {string} text The expected text. - * @return {!until.Condition.} The new condition. - * @see webdriver.WebDriver#getText - */ - function elementTextIs(element: WebElement, text: string): Condition; - - /** - * Creates a condition that will wait for the given element's - * {@link webdriver.WebDriver#getText visible text} to match a regular - * expression. - * - * @param {!webdriver.WebElement} element The element to test. - * @param {!RegExp} regex The regular expression to test against. - * @return {!until.Condition} The new condition. - * @see webdriver.WebDriver#getText - */ - function elementTextMatches(element: WebElement, regex: RegExp): Condition; - - /** - * Creates a condition that will loop until at least one element is - * {@link webdriver.WebDriver#findElement found} with the given locator. - * - * @param {!(webdriver.Locator|webdriver.By.Hash|Function)} locator The locator - * to use. - * @return {!until.Condition.>} The new - * condition. - */ - function elementsLocated(locator: By | Function): Condition; - - /** - * Creates a condition that will wait for the given element to become stale. An - * element is considered stale once it is removed from the DOM, or a new page - * has loaded. - * - * @param {!webdriver.WebElement} element The element that should become stale. - * @return {!until.Condition} The new condition. - */ - function stalenessOf(element: WebElement): Condition; - - /** - * Creates a condition that will wait for the current page's title to contain - * the given substring. - * - * @param {string} substr The substring that should be present in the page - * title. - * @return {!until.Condition.} The new condition. - */ - function titleContains(substr: string): Condition; - - /** - * Creates a condition that will wait for the current page's title to match the - * given value. - * - * @param {string} title The expected page title. - * @return {!until.Condition} The new condition. - */ - function titleIs(title: string): Condition; - - /** - * Creates a condition that will wait for the current page's title to match the - * given regular expression. - * - * @param {!RegExp} regex The regular expression to test against. - * @return {!until.Condition.} The new condition. - */ - function titleMatches(regex: RegExp): Condition; - } - - interface ILocation { - x: number; - y: number; - } - - interface ISize { - width: number; - height: number; - } - - interface IButton { - LEFT: string; - MIDDLE: string; - RIGHT: string; + code(): number; } /** - * Representations of pressable keys that aren't text. These are stored in - * the Unicode PUA (Private Use Area) code points, 0xE000-0xF8FF. Refer to - * http://www.google.com.au/search?&q=unicode+pua&btnG=Search - * + * The base WebDriver error type. This error type is only used directly when a + * more appropriate category is not defined for the offending error. + */ + class WebDriverError extends IError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An attempt was made to select an element that cannot be selected. + */ + class ElementNotSelectableError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An element command could not be completed because the element is not visible + * on the page. + */ + class ElementNotVisibleError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * The arguments passed to a command are either invalid or malformed. + */ + class InvalidArgumentError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An illegal attempt was made to set a cookie under a different domain than + * the current page. + */ + class InvalidCookieDomainError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * The coordinates provided to an interactions operation are invalid. + */ + class InvalidElementCoordinatesError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An element command could not be completed because the element is in an + * invalid state, e.g. attempting to click an element that is no longer attached + * to the document. + */ + class InvalidElementStateError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * Argument was an invalid selector. + */ + class InvalidSelectorError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * Occurs when a command is directed to a session that does not exist. + */ + class NoSuchSessionError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An error occurred while executing JavaScript supplied by the user. + */ + class JavascriptError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * The target for mouse interaction is not in the browser’s viewport and cannot + * be brought into that viewport. + */ + class MoveTargetOutOfBoundsError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An attempt was made to operate on a modal dialog when one was not open. + */ + class NoSuchAlertError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An element could not be located on the page using the given search + * parameters. + */ + class NoSuchElementError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * A request to switch to a frame could not be satisfied because the frame + * could not be found. + */ + class NoSuchFrameError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * A request to switch to a window could not be satisfied because the window + * could not be found. + */ + class NoSuchWindowError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * A script did not complete before its timeout expired. + */ + class ScriptTimeoutError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * A new session could not be created. + */ + class SessionNotCreatedError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An element command failed because the referenced element is no longer + * attached to the DOM. + */ + class StaleElementReferenceError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * An operation did not completErrorCodee before its timeout expired. + */ + class TimeoutError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * A request to set a cookie’s value could not be satisfied. + */ + class UnableToSetCookieError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * A screen capture operation was not possible. + */ + class UnableToCaptureScreenError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * A modal dialog was open, blocking this operation. + */ + class UnexpectedAlertOpenError extends WebDriverError { + /** + * @param {string=} opt_error the error message, if any. + * @param {string=} opt_text the text of the open dialog, if available. + */ + constructor(opt_error?: string, opt_text?: string); + + /** + * @return {(string|undefined)} The text displayed with the unhandled alert, + * if available. + */ + getAlertText(): string; + } + + /** + * A command could not be executed because the remote end is not aware of it. + */ + class UnknownCommandError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * The requested command matched a known URL but did not match an method for + * that URL. + */ + class UnknownMethodError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } + + /** + * Reports an unsupport operation. + */ + class UnsupportedOperationError extends WebDriverError { + /** @param {string=} opt_error the error message, if any. */ + constructor(opt_error?: string); + } +} + +export namespace logging { + + /** + * A hash describing log preferences. + * @typedef {Object.} + */ + class Preferences { + setLevel(type: string, level: Level | string | number): void; + toJSON(): { [key: string]: string }; + } + + interface IType { + /** Logs originating from the browser. */ + BROWSER: string; + /** Logs from a WebDriver client. */ + CLIENT: string; + /** Logs from a WebDriver implementation. */ + DRIVER: string; + /** Logs related to performance. */ + PERFORMANCE: string; + /** Logs from the remote server. */ + SERVER: string; + } + + /** + * Common log types. * @enum {string} */ - var Button: IButton; - - interface IKey { - NULL: string; - CANCEL: string; // ^break - HELP: string; - BACK_SPACE: string; - TAB: string; - CLEAR: string; - RETURN: string; - ENTER: string; - SHIFT: string; - CONTROL: string; - ALT: string; - PAUSE: string; - ESCAPE: string; - SPACE: string; - PAGE_UP: string; - PAGE_DOWN: string; - END: string; - HOME: string; - ARROW_LEFT: string; - LEFT: string; - ARROW_UP: string; - UP: string; - ARROW_RIGHT: string; - RIGHT: string; - ARROW_DOWN: string; - DOWN: string; - INSERT: string; - DELETE: string; - SEMICOLON: string; - EQUALS: string; - - NUMPAD0: string; // number pad keys - NUMPAD1: string; - NUMPAD2: string; - NUMPAD3: string; - NUMPAD4: string; - NUMPAD5: string; - NUMPAD6: string; - NUMPAD7: string; - NUMPAD8: string; - NUMPAD9: string; - MULTIPLY: string; - ADD: string; - SEPARATOR: string; - SUBTRACT: string; - DECIMAL: string; - DIVIDE: string; - - F1: string; // function keys - F2: string; - F3: string; - F4: string; - F5: string; - F6: string; - F7: string; - F8: string; - F9: string; - F10: string; - F11: string; - F12: string; - - COMMAND: string; // Apple command key - META: string; // alias for Windows key - - /** - * Simulate pressing many keys at once in a 'chord'. Takes a sequence of - * keys or strings, appends each of the values to a string, - * and adds the chord termination key ({@link webdriver.Key.NULL}) and returns - * the resulting string. - * - * Note: when the low-level webdriver key handlers see Keys.NULL, active - * modifier keys (CTRL/ALT/SHIFT/etc) release via a keyup event. - * - * @param {...string} var_args The key sequence to concatenate. - * @return {string} The null-terminated key sequence. - */ - chord: (...var_args: Array) => string; - } + var Type: IType; /** - * Representations of pressable keys that aren't text. These are stored in - * the Unicode PUA (Private Use Area) code points, 0xE000-0xF8FF. Refer to - * http://www.google.com.au/search?&q=unicode+pua&btnG=Search + * Defines a message level that may be used to control logging output. * - * @enum {string} - */ - var Key: IKey; - - /** - * Class for defining sequences of complex user interactions. Each sequence - * will not be executed until {@link #perform} is called. - * - * Example: - * - * new ActionSequence(driver). - * keyDown(Key.SHIFT). - * click(element1). - * click(element2). - * dragAndDrop(element3, element4). - * keyUp(Key.SHIFT). - * perform(); - * - */ - class ActionSequence { - - //region Constructors - - /** - * @param {!webdriver.WebDriver} driver The driver instance to use. - * @constructor - */ - constructor(driver: WebDriver); - - //endregion - - //region Methods - - /** - * Executes this action sequence. - * @return {!webdriver.promise.Promise} A promise that will be resolved once - * this sequence has completed. - */ - perform(): webdriver.promise.Promise; - - /** - * Moves the mouse. The location to move to may be specified in terms of the - * mouse's current location, an offset relative to the top-left corner of an - * element, or an element (in which case the middle of the element is used). - * - * @param {(!./webdriver.WebElement|{x: number, y: number})} location The - * location to drag to, as either another WebElement or an offset in - * pixels. - * @param {{x: number, y: number}=} opt_offset If the target {@code location} - * is defined as a {@link ./webdriver.WebElement}, this parameter defines - * an offset within that element. The offset should be specified in pixels - * relative to the top-left corner of the element's bounding box. If - * omitted, the element's center will be used as the target offset. - * @return {!ActionSequence} A self reference. - */ - mouseMove(location: WebElement | ILocation, opt_offset?: ILocation): ActionSequence; - - /** - * Presses a mouse button. The mouse button will not be released until - * {@link #mouseUp} is called, regardless of whether that call is made in this - * sequence or another. The behavior for out-of-order events (e.g. mouseDown, - * click) is undefined. - * - * If an element is provided, the mouse will first be moved to the center - * of that element. This is equivalent to: - * - * sequence.mouseMove(element).mouseDown() - * - * Warning: this method currently only supports the left mouse button. See - * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047). - * - * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either - * the element to interact with or the button to click with. - * Defaults to {@link input.Button.LEFT} if neither an element nor - * button is specified. - * @param {input.Button=} opt_button The button to use. Defaults to - * {@link input.Button.LEFT}. Ignored if a button is provided as the - * first argument. - * @return {!ActionSequence} A self reference. - */ - mouseDown(opt_elementOrButton?: WebElement | string, opt_button?: string): ActionSequence; - - /** - * Releases a mouse button. Behavior is undefined for calling this function - * without a previous call to {@link #mouseDown}. - * - * If an element is provided, the mouse will first be moved to the center - * of that element. This is equivalent to: - * - * sequence.mouseMove(element).mouseUp() - * - * Warning: this method currently only supports the left mouse button. See - * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047). - * - * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either - * the element to interact with or the button to click with. - * Defaults to {@link input.Button.LEFT} if neither an element nor - * button is specified. - * @param {input.Button=} opt_button The button to use. Defaults to - * {@link input.Button.LEFT}. Ignored if a button is provided as the - * first argument. - * @return {!ActionSequence} A self reference. - */ - mouseUp(opt_elementOrButton?: WebElement | string, opt_button?: string): ActionSequence; - - /** - * Convenience function for performing a 'drag and drop' manuever. The target - * element may be moved to the location of another element, or by an offset (in - * pixels). - * - * @param {!./webdriver.WebElement} element The element to drag. - * @param {(!./webdriver.WebElement|{x: number, y: number})} location The - * location to drag to, either as another WebElement or an offset in - * pixels. - * @return {!ActionSequence} A self reference. - */ - dragAndDrop(element: WebElement, location: WebElement | ILocation): ActionSequence; - - /** - * Clicks a mouse button. - * - * If an element is provided, the mouse will first be moved to the center - * of that element. This is equivalent to: - * - * sequence.mouseMove(element).click() - * - * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either - * the element to interact with or the button to click with. - * Defaults to {@link input.Button.LEFT} if neither an element nor - * button is specified. - * @param {input.Button=} opt_button The button to use. Defaults to - * {@link input.Button.LEFT}. Ignored if a button is provided as the - * first argument. - * @return {!ActionSequence} A self reference. - */ - click(opt_elementOrButton?: WebElement | string, opt_button?: string): ActionSequence; - - /** - * Double-clicks a mouse button. - * - * If an element is provided, the mouse will first be moved to the center of - * that element. This is equivalent to: - * - * sequence.mouseMove(element).doubleClick() - * - * Warning: this method currently only supports the left mouse button. See - * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047). - * - * @param {(./webdriver.WebElement|input.Button)=} opt_elementOrButton Either - * the element to interact with or the button to click with. - * Defaults to {@link input.Button.LEFT} if neither an element nor - * button is specified. - * @param {input.Button=} opt_button The button to use. Defaults to - * {@link input.Button.LEFT}. Ignored if a button is provided as the - * first argument. - * @return {!ActionSequence} A self reference. - */ - doubleClick(opt_elementOrButton?: WebElement | string, opt_button?: string): ActionSequence; - - /** - * Performs a modifier key press. The modifier key is not released - * until {@link #keyUp} or {@link #sendKeys} is called. The key press will be - * targetted at the currently focused element. - * @param {!webdriver.Key} key The modifier key to push. Must be one of - * {ALT, CONTROL, SHIFT, COMMAND, META}. - * @return {!webdriver.ActionSequence} A self reference. - * @throws {Error} If the key is not a valid modifier key. - */ - keyDown(key: string): ActionSequence; - - /** - * Performs a modifier key release. The release is targetted at the currently - * focused element. - * @param {!webdriver.Key} key The modifier key to release. Must be one of - * {ALT, CONTROL, SHIFT, COMMAND, META}. - * @return {!webdriver.ActionSequence} A self reference. - * @throws {Error} If the key is not a valid modifier key. - */ - keyUp(key: string): ActionSequence; - - /** - * Simulates typing multiple keys. Each modifier key encountered in the - * sequence will not be released until it is encountered again. All key events - * will be targeted at the currently focused element. - * - * @param {...(string|!input.Key|!Array<(string|!input.Key)>)} var_args - * The keys to type. - * @return {!ActionSequence} A self reference. - * @throws {Error} If the key is not a valid modifier key. - */ - sendKeys(...var_args: Array>): ActionSequence; - - //endregion - } - - - /** - * Class for defining sequences of user touch interactions. Each sequence - * will not be executed until {@link #perform} is called. - * - * Example: - * - * new webdriver.TouchSequence(driver). - * tapAndHold({x: 0, y: 0}). - * move({x: 3, y: 4}). - * release({x: 10, y: 10}). - * perform(); - */ - class TouchSequence { - /* - * @param {!webdriver.WebDriver} driver The driver instance to use. - * @constructor - */ - constructor(driver: WebDriver); - - - /** - * Executes this action sequence. - * @return {!webdriver.promise.Promise} A promise that will be resolved once - * this sequence has completed. - */ - perform(): webdriver.promise.Promise; - - - /** - * Taps an element. - * - * @param {!webdriver.WebElement} elem The element to tap. - * @return {!webdriver.TouchSequence} A self reference. - */ - tap(elem: WebElement): TouchSequence; - - - /** - * Double taps an element. - * - * @param {!webdriver.WebElement} elem The element to double tap. - * @return {!webdriver.TouchSequence} A self reference. - */ - doubleTap(elem: WebElement): TouchSequence; - - - /** - * Long press on an element. - * - * @param {!webdriver.WebElement} elem The element to long press. - * @return {!webdriver.TouchSequence} A self reference. - */ - longPress(elem: WebElement): TouchSequence; - - - /** - * Touch down at the given location. - * - * @param {{ x: number, y: number }} location The location to touch down at. - * @return {!webdriver.TouchSequence} A self reference. - */ - tapAndHold(location: ILocation): TouchSequence; - - - /** - * Move a held {@linkplain #tapAndHold touch} to the specified location. - * - * @param {{x: number, y: number}} location The location to move to. - * @return {!webdriver.TouchSequence} A self reference. - */ - move(location: ILocation): TouchSequence; - - - /** - * Release a held {@linkplain #tapAndHold touch} at the specified location. - * - * @param {{x: number, y: number}} location The location to release at. - * @return {!webdriver.TouchSequence} A self reference. - */ - release(location: ILocation): TouchSequence; - - - /** - * Scrolls the touch screen by the given offset. - * - * @param {{x: number, y: number}} offset The offset to scroll to. - * @return {!webdriver.TouchSequence} A self reference. - */ - scroll(offset: IOffset): TouchSequence; - - /** - * Scrolls the touch screen, starting on `elem` and moving by the specified - * offset. - * - * @param {!webdriver.WebElement} elem The element where scroll starts. - * @param {{x: number, y: number}} offset The offset to scroll to. - * @return {!webdriver.TouchSequence} A self reference. - */ - scrollFromElement(elem: WebElement, offset: IOffset): TouchSequence; - - /** - * Flick, starting anywhere on the screen, at speed xspeed and yspeed. - * - * @param {{xspeed: number, yspeed: number}} speed The speed to flick in each - direction, in pixels per second. - * @return {!webdriver.TouchSequence} A self reference. - */ - flick(speed: ISpeed): TouchSequence; - - /** - * Flick starting at elem and moving by x and y at specified speed. - * - * @param {!webdriver.WebElement} elem The element where flick starts. - * @param {{x: number, y: number}} offset The offset to flick to. - * @param {number} speed The speed to flick at in pixels per second. - * @return {!webdriver.TouchSequence} A self reference. - */ - flickElement(elem: WebElement, offset: IOffset, speed: number): TouchSequence; - } - - interface IOffset { - x: number; - y: number; - } - - interface ISpeed { - xspeed: number; - yspeed: number; - } - - /** - * Represents a modal dialog such as {@code alert}, {@code confirm}, or - * {@code prompt}. Provides functions to retrieve the message displayed with - * the alert, accept or dismiss the alert, and set the response text (in the - * case of {@code prompt}). - */ - class Alert { - /** - * @param {!WebDriver} driver The driver controlling the browser this alert - * is attached to. - * @param {string} text The message text displayed with this alert. - */ - constructor(driver: WebDriver, text: string); - - //region Methods - - /** - * Retrieves the message text displayed with this alert. For instance, if the - * alert were opened with alert('hello'), then this would return 'hello'. - * @return {!webdriver.promise.Promise} A promise that will be resolved to the - * text displayed with this alert. - */ - getText(): webdriver.promise.Promise; - - /** - * Sets the username and password in an alert prompting for credentials (such - * as a Basic HTTP Auth prompt). This method will implicitly - * {@linkplain #accept() submit} the dialog. - * - * @param {string} username The username to send. - * @param {string} password The password to send. - * @return {!promise.Promise} A promise that will be resolved when this - * command has completed. - */ - authenticateAs(username: string, password: string): webdriver.promise.Promise; - - /** - * Accepts this alert. - * @return {!webdriver.promise.Promise} A promise that will be resolved when - * this command has completed. - */ - accept(): webdriver.promise.Promise; - - /** - * Dismisses this alert. - * @return {!webdriver.promise.Promise} A promise that will be resolved when - * this command has completed. - */ - dismiss(): webdriver.promise.Promise; - - /** - * Sets the response text on this alert. This command will return an error if - * the underlying alert does not support response text (e.g. window.alert and - * window.confirm). - * @param {string} text The text to set. - * @return {!webdriver.promise.Promise} A promise that will be resolved when - * this command has completed. - */ - sendKeys(text: string): webdriver.promise.Promise; - - //endregion - - } - - /** - * AlertPromise is a promise that will be fulfilled with an Alert. This promise - * serves as a forward proxy on an Alert, allowing calls to be scheduled - * directly on this instance before the underlying Alert has been fulfilled. In - * other words, the following two statements are equivalent: - * - * driver.switchTo().alert().dismiss(); - * driver.switchTo().alert().then(function(alert) { - * return alert.dismiss(); - * }); - * - * @implements {promise.Thenable.} * @final */ - class AlertPromise extends Alert implements webdriver.promise.IThenable{ + class Level { + name_: string; + value_: number; /** - * @param {!WebDriver} driver The driver controlling the browser this - * alert is attached to. - * @param {!promise.Thenable} alert A thenable - * that will be fulfilled with the promised alert. + * @param {string} name the level's name. + * @param {number} level the level's numeric value. */ - constructor(driver: WebDriver, alert: webdriver.promise.Promise); + constructor(name: string, level: number); - //region Methods + /** @override */ + toString(): string; + + /** This logger's name. */ + name: string; + + /** The numeric log level. */ + value: number; + + /** + * Indicates no log messages should be recorded. + * @const + */ + static OFF: Level; + /** + * Log messages with a level of `1000` or higher. + * @const + */ + static SEVERE: Level; + /** + * Log messages with a level of `900` or higher. + * @const + */ + static WARNING: Level; + /** + * Log messages with a level of `800` or higher. + * @const + */ + static INFO: Level; + /** + * Log messages with a level of `700` or higher. + * @const + */ + static DEBUG: Level; + /** + * Log messages with a level of `500` or higher. + * @const + */ + static FINE: Level; + /** + * Log messages with a level of `400` or higher. + * @const + */ + static FINER: Level; + /** + * Log messages with a level of `300` or higher. + * @const + */ + static FINEST: Level; + /** + * Indicates all log messages should be recorded. + * @const + */ + static ALL: Level; + } + + /** + * Converts a level name or value to a {@link logging.Level} value. + * If the name/value is not recognized, {@link logging.Level.ALL} + * will be returned. + * @param {(number|string)} nameOrValue The log level name, or value, to + * convert . + * @return {!logging.Level} The converted level. + */ + function getLevel(nameOrValue: string | number): Level; + + interface IEntryJSON { + level: string; + message: string; + timestamp: number; + type: string; + } + + /** + * A single log entry. + */ + class Entry { + /** + * @param {(!logging.Level|string)} level The entry level. + * @param {string} message The log message. + * @param {number=} opt_timestamp The time this entry was generated, in + * milliseconds since 0:00:00, January 1, 1970 UTC. If omitted, the + * current time will be used. + * @param {string=} opt_type The log type, if known. + * @constructor + */ + constructor(level: Level | string | number, message: string, opt_timestamp?: number, opt_type?: string | IType); + + /** @type {!logging.Level} */ + level: Level; + + /** @type {string} */ + message: string; + + /** @type {number} */ + timestamp: number; + + /** @type {string} */ + type: string; + + /** + * @return {{level: string, message: string, timestamp: number, + * type: string}} The JSON representation of this entry. + */ + toJSON(): IEntryJSON; + } + + /** + * An object used to log debugging messages. Loggers use a hierarchical, + * dot-separated naming scheme. For instance, 'foo' is considered the parent of + * the 'foo.bar' and an ancestor of 'foo.bar.baz'. + * + * Each logger may be assigned a {@linkplain #setLevel log level}, which + * controls which level of messages will be reported to the + * {@linkplain #addHandler handlers} attached to this instance. If a log level + * is not explicitly set on a logger, it will inherit its parent. + * + * This class should never be directly instantiated. Instead, users should + * obtain logger references using the {@linkplain ./logging.getLogger() + * getLogger()} function. + * + * @final + */ + class Logger { + /** + * @param {string} name the name of this logger. + * @param {Level=} opt_level the initial level for this logger. + */ + constructor(name: string, opt_level?: Level); + + /** @private {string} */ + name_: string; + /** @private {Level} */ + level_: Level; + /** @private {Logger} */ + parent_: Logger; + /** @private {Set} */ + handlers_: any; + + /** @return {string} the name of this logger. */ + getName(): string; + + /** + * @param {Level} level the new level for this logger, or `null` if the logger + * should inherit its level from its parent logger. + */ + setLevel(level: Level): void; + + /** @return {Level} the log level for this logger. */ + getLevel(): Level; + + /** + * @return {!Level} the effective level for this logger. + */ + getEffectiveLevel(): Level; + + /** + * @param {!Level} level the level to check. + * @return {boolean} whether messages recorded at the given level are loggable + * by this instance. + */ + isLoggable(level: Level): boolean; + + /** + * Adds a handler to this logger. The handler will be invoked for each message + * logged with this instance, or any of its descendants. + * + * @param {function(!Entry)} handler the handler to add. + */ + addHandler(handler: any): void; + + /** + * Removes a handler from this logger. + * + * @param {function(!Entry)} handler the handler to remove. + * @return {boolean} whether a handler was successfully removed. + */ + removeHandler(handler: any): void; + + /** + * Logs a message at the given level. The message may be defined as a string + * or as a function that will return the message. If a function is provided, + * it will only be invoked if this logger's + * {@linkplain #getEffectiveLevel() effective log level} includes the given + * `level`. + * + * @param {!Level} level the level at which to log the message. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + log(level: Level, loggable: string | Function): void; + + /** + * Logs a message at the {@link Level.SEVERE} log level. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + severe(loggable: string | Function): void; + + /** + * Logs a message at the {@link Level.WARNING} log level. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + warning(loggable: string | Function): void; + + /** + * Logs a message at the {@link Level.INFO} log level. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + info(loggable: string | Function): void; + + /** + * Logs a message at the {@link Level.DEBUG} log level. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + debug(loggable: string | Function): void; + + /** + * Logs a message at the {@link Level.FINE} log level. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + fine(loggable: string | Function): void; + + /** + * Logs a message at the {@link Level.FINER} log level. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + finer(loggable: string | Function): void; + + /** + * Logs a message at the {@link Level.FINEST} log level. + * @param {(string|function(): string)} loggable the message to log, or a + * function that will return the message. + */ + finest(loggable: string | Function): void; + } + + /** + * Maintains a collection of loggers. + * + * @final + */ + class LogManager { + /** + * Retrieves a named logger, creating it in the process. This function will + * implicitly create the requested logger, and any of its parents, if they + * do not yet exist. + * + * @param {string} name the logger's name. + * @return {!Logger} the requested logger. + */ + getLogger(name: string): Logger; + + /** + * Creates a new logger. + * + * @param {string} name the logger's name. + * @param {!Logger} parent the logger's parent. + * @return {!Logger} the new logger. + * @private + */ + createLogger_(name: string, parent: Logger): Logger; + } +} + +export namespace promise { + // region Functions + + /** + * Given an array of promises, will return a promise that will be fulfilled + * with the fulfillment values of the input array's values. If any of the + * input array's promises are rejected, the returned promise will be rejected + * with the same reason. + * + * @param {!Array<(T|!ManagedPromise)>} arr An array of + * promises to wait on. + * @return {!ManagedPromise} A promise that is + * fulfilled with an array containing the fulfilled values of the + * input array, or rejected with the same reason as the first + * rejected value. + * @template T + */ + function all(arr: Array>): Promise; + + /** + * Invokes the appropriate callback function as soon as a promised + * {@code value} is resolved. This function is similar to + * {@link promise.when}, except it does not return a new promise. + * @param {*} value The value to observe. + * @param {Function} callback The function to call when the value is + * resolved successfully. + * @param {Function=} opt_errback The function to call when the value is + * rejected. + */ + function asap(value: any, callback: Function, opt_errback?: Function): void; + + /** + * @return {!promise.ControlFlow} The currently active control flow. + */ + function controlFlow(): ControlFlow; + + /** + * Creates a new control flow. The provided callback will be invoked as the + * first task within the new flow, with the flow as its sole argument. Returns + * a promise that resolves to the callback result. + * @param {function(!ControlFlow)} callback The entry point + * to the newly created flow. + * @return {!ManagedPromise} A promise that resolves to the callback + * result. + */ + function createFlow(callback: (flow: ControlFlow) => R): Promise; + + /** + * Determines whether a {@code value} should be treated as a promise. + * Any object whose 'then' property is a function will be considered a promise. + * + * @param {*} value The value to test. + * @return {boolean} Whether the value is a promise. + */ + function isPromise(value: any): boolean; + + /** + * Tests is a function is a generator. + * @param {!Function} fn The function to test. + * @return {boolean} Whether the function is a generator. + */ + function isGenerator(fn: Function): boolean; + + /** + * Creates a promise that will be resolved at a set time in the future. + * @param {number} ms The amount of time, in milliseconds, to wait before + * resolving the promise. + * @return {!ManagedPromise} The promise. + */ + function delayed(ms: number): Promise; + + /** + * Calls a function for each element in an array, and if the function returns + * true adds the element to a new array. + * + * If the return value of the filter function is a promise, this function + * will wait for it to be fulfilled before determining whether to insert the + * element into the new array. + * + * If the filter function throws or returns a rejected promise, the promise + * returned by this function will be rejected with the same reason. Only the + * first failure will be reported; all subsequent errors will be silently + * ignored. + * + * @param {!(Array|ManagedPromise>)} arr The + * array to iterator over, or a promise that will resolve to said array. + * @param {function(this: SELF, TYPE, number, !Array): ( + * boolean|ManagedPromise)} fn The function + * to call for each element in the array. + * @param {SELF=} opt_self The object to be used as the value of 'this' within + * {@code fn}. + * @template TYPE, SELF + */ + function filter(arr: T[] | Promise, fn: (element: T, type: any, index: number, array: T[]) => any, opt_self?: any): Promise; + + /** + * Creates a new deferred object. + * @return {!promise.Deferred} The new deferred object. + */ + function defer(): Deferred; + + /** + * Creates a promise that has been resolved with the given value. + * @param {T=} opt_value The resolved value. + * @return {!ManagedPromise} The resolved promise. + * @template T + */ + function fulfilled(opt_value?: T): Promise; + + /** + * Calls a function for each element in an array and inserts the result into a + * new array, which is used as the fulfillment value of the promise returned + * by this function. + * + * If the return value of the mapping function is a promise, this function + * will wait for it to be fulfilled before inserting it into the new array. + * + * If the mapping function throws or returns a rejected promise, the + * promise returned by this function will be rejected with the same reason. + * Only the first failure will be reported; all subsequent errors will be + * silently ignored. + * + * @param {!(Array|ManagedPromise>)} arr The + * array to iterator over, or a promise that will resolve to said array. + * @param {function(this: SELF, TYPE, number, !Array): ?} fn The + * function to call for each element in the array. This function should + * expect three arguments (the element, the index, and the array itself. + * @param {SELF=} opt_self The object to be used as the value of 'this' within + * {@code fn}. + * @template TYPE, SELF + */ + function map(arr: T[] | Promise, fn: (self: any, type: any, index: number, array: T[]) => any, opt_self?: any): Promise; + + /** + * Creates a promise that has been rejected with the given reason. + * @param {*=} opt_reason The rejection reason; may be any value, but is + * usually an Error or a string. + * @return {!ManagedPromise} The rejected promise. + * @template T + */ + function rejected(opt_reason?: any): Promise; + + /** + * Wraps a function that expects a node-style callback as its final + * argument. This callback expects two arguments: an error value (which will be + * null if the call succeeded), and the success value as the second argument. + * The callback will the resolve or reject the returned promise, based on its + * arguments. + * @param {!Function} fn The function to wrap. + * @param {...?} var_args The arguments to apply to the function, excluding the + * final callback. + * @return {!ManagedPromise} A promise that will be resolved with the + * result of the provided function's callback. + */ + function checkedNodeCall(fn: Function, ...var_args: any[]): Promise; + + /** + * Consumes a {@code GeneratorFunction}. Each time the generator yields a + * promise, this function will wait for it to be fulfilled before feeding the + * fulfilled value back into {@code next}. Likewise, if a yielded promise is + * rejected, the rejection error will be passed to {@code throw}. + * + * __Example 1:__ the Fibonacci Sequence. + * + * promise.consume(function* fibonacci() { + * var n1 = 1, n2 = 1; + * for (var i = 0; i < 4; ++i) { + * var tmp = yield n1 + n2; + * n1 = n2; + * n2 = tmp; + * } + * return n1 + n2; + * }).then(function(result) { + * console.log(result); // 13 + * }); + * + * __Example 2:__ a generator that throws. + * + * promise.consume(function* () { + * yield promise.delayed(250).then(function() { + * throw Error('boom'); + * }); + * }).catch(function(e) { + * console.log(e.toString()); // Error: boom + * }); + * + * @param {!Function} generatorFn The generator function to execute. + * @param {Object=} opt_self The object to use as 'this' when invoking the + * initial generator. + * @param {...*} var_args Any arguments to pass to the initial generator. + * @return {!ManagedPromise} A promise that will resolve to the + * generator's final result. + * @throws {TypeError} If the given function is not a generator. + */ + function consume(generatorFn: Function, opt_self?: any, ...var_args: any[]): Promise; + + /** + * Registers an observer on a promised {@code value}, returning a new promise + * that will be resolved when the value is. If {@code value} is not a promise, + * then the return promise will be immediately resolved. + * @param {*} value The value to observe. + * @param {Function=} opt_callback The function to call when the value is + * resolved successfully. + * @param {Function=} opt_errback The function to call when the value is + * rejected. + * @return {!ManagedPromise} A new promise. + */ + function when(value: T | Promise, opt_callback?: (value: T) => any, opt_errback?: (error: any) => any): Promise; + + /** + * Returns a promise that will be resolved with the input value in a + * fully-resolved state. If the value is an array, each element will be fully + * resolved. Likewise, if the value is an object, all keys will be fully + * resolved. In both cases, all nested arrays and objects will also be + * fully resolved. All fields are resolved in place; the returned promise will + * resolve on {@code value} and not a copy. + * + * Warning: This function makes no checks against objects that contain + * cyclical references: + * + * var value = {}; + * value['self'] = value; + * promise.fullyResolved(value); // Stack overflow. + * + * @param {*} value The value to fully resolve. + * @return {!ManagedPromise} A promise for a fully resolved version + * of the input value. + */ + function fullyResolved(value: any): Promise; + + /** + * Changes the default flow to use when no others are active. + * @param {!ControlFlow} flow The new default flow. + * @throws {Error} If the default flow is not currently active. + */ + function setDefaultFlow(flow: ControlFlow): void; + + // endregion + + /** + * Error used when the computation of a promise is cancelled. + */ + class CancellationError extends Error { + /** + * @param {string=} opt_msg The cancellation message. + */ + constructor(opt_msg?: string); + } + + interface IThenable { + /** + * Cancels the computation of this promise's value, rejecting the promise in + * the process. This method is a no-op if the promise has already been + * resolved. + * + * @param {(string|Error)=} opt_reason The reason this promise is being + * cancelled. This value will be wrapped in a {@link CancellationError}. + */ + cancel(opt_reason?: string | Error): void; + + /** @return {boolean} Whether this promise's value is still being computed. */ + isPending(): boolean; + + /** + * Registers listeners for when this instance is resolved. + * + * @param {?(function(T): (R|IThenable))=} opt_callback The + * function to call if this promise is successfully resolved. The function + * should expect a single argument: the promise's resolved value. + * @param {?(function(*): (R|IThenable))=} opt_errback + * The function to call if this promise is rejected. The function should + * expect a single argument: the rejection reason. + * @return {!ManagedPromise} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + then(opt_callback?: (value: T) => R | IThenable, opt_errback?: (error: any) => any): Promise; + + /** + * Registers a listener for when this promise is rejected. This is synonymous + * with the {@code catch} clause in a synchronous API: + * + * // Synchronous API: + * try { + * doSynchronousWork(); + * } catch (ex) { + * console.error(ex); + * } + * + * // Asynchronous promise API: + * doAsynchronousWork().catch(function(ex) { + * console.error(ex); + * }); + * + * @param {function(*): (R|IThenable)} errback The + * function to call if this promise is rejected. The function should + * expect a single argument: the rejection reason. + * @return {!ManagedPromise} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + catch(errback: Function): Promise; + } + + /** + * Thenable is a promise-like object with a {@code then} method which may be + * used to schedule callbacks on a promised value. + * + * @interface + * @template T + */ + class Thenable implements IThenable { + /** + * Cancels the computation of this promise's value, rejecting the promise in + * the process. This method is a no-op if the promise has already been + * resolved. + * + * @param {(string|Error)=} opt_reason The reason this promise is being + * cancelled. This value will be wrapped in a {@link CancellationError}. + */ + cancel(opt_reason?: string | Error): void; + + /** @return {boolean} Whether this promise's value is still being computed. */ + isPending(): boolean; + + /** + * Registers listeners for when this instance is resolved. + * + * @param {?(function(T): (R|IThenable))=} opt_callback The + * function to call if this promise is successfully resolved. The function + * should expect a single argument: the promise's resolved value. + * @param {?(function(*): (R|IThenable))=} opt_errback + * The function to call if this promise is rejected. The function should + * expect a single argument: the rejection reason. + * @return {!ManagedPromise} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + then(opt_callback?: (value: T) => R | IThenable, opt_errback?: (error: any) => R | IThenable): Promise; + + /** + * Registers a listener for when this promise is rejected. This is synonymous + * with the {@code catch} clause in a synchronous API: + * + * // Synchronous API: + * try { + * doSynchronousWork(); + * } catch (ex) { + * console.error(ex); + * } + * + * // Asynchronous promise API: + * doAsynchronousWork().catch(function(ex) { + * console.error(ex); + * }); + * + * @param {function(*): (R|IThenable)} errback The + * function to call if this promise is rejected. The function should + * expect a single argument: the rejection reason. + * @return {!ManagedPromise} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + catch(errback: Function): Promise; + + /** + * Registers a listener to invoke when this promise is resolved, regardless + * of whether the promise's value was successfully computed. This function + * is synonymous with the {@code finally} clause in a synchronous API: + * + * // Synchronous API: + * try { + * doSynchronousWork(); + * } finally { + * cleanUp(); + * } + * + * // Asynchronous promise API: + * doAsynchronousWork().finally(cleanUp); + * + * __Note:__ similar to the {@code finally} clause, if the registered + * callback returns a rejected promise or throws an error, it will silently + * replace the rejection error (if any) from this promise: + * + * try { + * throw Error('one'); + * } finally { + * throw Error('two'); // Hides Error: one + * } + * + * promise.rejected(Error('one')) + * .finally(function() { + * throw Error('two'); // Hides Error: one + * }); + * + * @param {function(): (R|IThenable)} callback The function to call when + * this promise is resolved. + * @return {!ManagedPromise} A promise that will be fulfilled + * with the callback result. + * @template R + */ + finally(callback: Function): Promise; + + /** + * Adds a property to a class prototype to allow runtime checks of whether + * instances of that class implement the Thenable interface. This function + * will also ensure the prototype's {@code then} function is exported from + * compiled code. + * @param {function(new: Thenable, ...?)} ctor The + * constructor whose prototype to modify. + */ + static addImplementation(ctor: Function): void; + + /** + * Checks if an object has been tagged for implementing the Thenable + * interface as defined by {@link Thenable.addImplementation}. + * @param {*} object The object to test. + * @return {boolean} Whether the object is an implementation of the Thenable + * interface. + */ + static isImplementation(object: any): boolean; + } + + interface IFulfilledCallback { + (value: T | IThenable | Thenable | undefined): void; + } + + interface IRejectedCallback { + (reason: any): void; + } + + /** + * Represents the eventual value of a completed operation. Each promise may be + * in one of three states: pending, fulfilled, or rejected. Each promise starts + * in the pending state and may make a single transition to either a + * fulfilled or rejected state, at which point the promise is considered + * resolved. + * + * @implements {promise.Thenable} + * @template T + * @see http://promises-aplus.github.io/promises-spec/ + */ + class Promise implements IThenable { + /** + * @param {function( + * function((T|IThenable|Thenable)=), + * function(*=))} resolver + * Function that is invoked immediately to begin computation of this + * promise's value. The function should accept a pair of callback + * functions, one for fulfilling the promise and another for rejecting it. + * @param {ControlFlow=} opt_flow The control flow + * this instance was created under. Defaults to the currently active flow. + */ + constructor(resolver: (resolve: IFulfilledCallback, reject: IRejectedCallback) => void, opt_flow?: ControlFlow); + + // region Methods /** * Cancels the computation of this promise's value, rejecting the promise in the @@ -2121,7 +1036,7 @@ declare namespace webdriver { * @return A new promise which will be resolved * with the result of the invoked callback. */ - then(opt_callback?: Function, opt_errback?: Function): webdriver.promise.Promise; + then(opt_callback?: (value: T) => IThenable | R, opt_errback?: (error: any) => any): Promise; /** * Registers a listener for when this promise is rejected. This is synonymous @@ -2140,14 +1055,14 @@ declare namespace webdriver { * }); * * - * @param {function(*): (R|webdriver.promise.Promise.)} errback The function + * @param {function(*): (R|promise.Promise.)} errback The function * to call if this promise is rejected. The function should expect a single * argument: the rejection reason. - * @return {!webdriver.promise.Promise.} A new promise which will be + * @return {!promise.Promise.} A new promise which will be * resolved with the result of the invoked callback. * @template R */ - thenCatch(errback: (error: any) => any): webdriver.promise.Promise; + thenCatch(errback: (error: any) => any): Promise; /** * Registers a listener for when this promise is rejected. This is synonymous @@ -2172,7 +1087,7 @@ declare namespace webdriver { * resolved with the result of the invoked callback. * @template R */ - catch(errback: Function): webdriver.promise.Promise; + catch(errback: Function): Promise; /** @@ -2201,2856 +1116,3935 @@ declare namespace webdriver { * throw Error('two'); // Hides Error: one * } * - * webdriver.promise.rejected(Error('one')) + * promise.rejected(Error('one')) * .thenFinally(function() { * throw Error('two'); // Hides Error: one * }); * * * - * @param {function(): (R|webdriver.promise.Promise.)} callback The function + * @param {function(): (R|promise.Promise.)} callback The function * to call when this promise is resolved. - * @return {!webdriver.promise.Promise.} A promise that will be fulfilled + * @return {!promise.Promise.} A promise that will be fulfilled * with the callback result. * @template R */ - thenFinally(callback: Function): webdriver.promise.Promise; - } + thenFinally(callback: Function): Promise; - /** @deprecated Use {@link error.UnexpectedAlertOpenError} instead. */ - class UnhandledAlertError extends webdriver.error.UnexpectedAlertOpenError { + // endregion } /** - * Recognized browser names. - * @enum {string} + * Represents a value that will be resolved at some point in the future. This + * class represents the protected 'producer' half of a Promise - each Deferred + * has a {@code promise} property that may be returned to consumers for + * registering callbacks, reserving the ability to resolve the deferred to the + * producer. + * + *

    If this Deferred is rejected and there are no listeners registered before + * the next turn of the event loop, the rejection will be passed to the + * {@link promise.ControlFlow} as an unhandled failure. + * + *

    If this Deferred is cancelled, the cancellation reason will be forward to + * the Deferred's canceller function (if provided). The canceller may return a + * truth-y value to override the reason provided for rejection. + * + * @extends {promise.Promise} */ - interface IBrowser { - ANDROID: string; - CHROME: string; - EDGE: string; - FIREFOX: string; - IE: string; - INTERNET_EXPLORER: string; - IPAD: string; - IPHONE: string; - OPERA: string; - PHANTOM_JS: string; - SAFARI: string; - HTMLUNIT: string; + class Deferred extends Promise { + // region Constructors + + /** + * + * @param {promise.ControlFlow=} opt_flow The control flow + * this instance was created under. This should only be provided during + * unit tests. + * @constructor + */ + constructor(opt_flow?: ControlFlow); + + // endregion + + static State_: { + BLOCKED: number; + PENDING: number; + REJECTED: number; + RESOLVED: number; + }; + + // region Properties + + /** + * The consumer promise for this instance. Provides protected access to the + * callback registering functions. + * @type {!promise.Promise} + */ + promise: Promise; + + // endregion + + // region Methods + + /** + * Rejects this promise. If the error is itself a promise, this instance will + * be chained to it and be rejected with the error's resolved value. + * @param {*=} opt_error The rejection reason, typically either a + * {@code Error} or a {@code string}. + */ + reject(opt_error?: any): void; + errback(opt_error?: any): void; + + /** + * Resolves this promise with the given value. If the value is itself a + * promise and not a reference to this deferred, this instance will wait for + * it before resolving. + * @param {*=} opt_value The resolved value. + */ + fulfill(opt_value?: T): void; + + /** + * Removes all of the listeners previously registered on this deferred. + * @throws {Error} If this deferred has already been resolved. + */ + removeAll(): void; + + // endregion } - var Browser: IBrowser; + interface IControlFlowTimer { + clearInterval: (ms: number) => void; + clearTimeout: (ms: number) => void; + setInterval: (fn: Function, ms: number) => number; + setTimeout: (fn: Function, ms: number) => number; + } - interface ProxyConfig { - proxyType: string; - proxyAutoconfigUrl?: string; - ftpProxy?: string; - httpProxy?: string; - sslProxy?: string; - noProxy?: string; + interface IEventType { + /** Emitted when all tasks have been successfully executed. */ + IDLE: string; + + /** Emitted when a ControlFlow has been reset. */ + RESET: string; + + /** Emitted whenever a new task has been scheduled. */ + SCHEDULE_TASK: string; + + /** + * Emitted whenever a control flow aborts due to an unhandled promise + * rejection. This event will be emitted along with the offending rejection + * reason. Upon emitting this event, the control flow will empty its task + * queue and revert to its initial state. + */ + UNCAUGHT_EXCEPTION: string; } /** - * Creates new {@link webdriver.WebDriver WebDriver} instances. The environment - * variables listed below may be used to override a builder's configuration, - * allowing quick runtime changes. + * Handles the execution of scheduled tasks, each of which may be an + * asynchronous operation. The control flow will ensure tasks are executed in + * the ordered scheduled, starting each task only once those before it have + * completed. * - * - {@code SELENIUM_BROWSER}: defines the target browser in the form - * {@code browser[:version][:platform]}. + * Each task scheduled within this flow may return a + * {@link promise.Promise} to indicate it is an asynchronous + * operation. The ControlFlow will wait for such promises to be resolved before + * marking the task as completed. * - * - {@code SELENIUM_REMOTE_URL}: defines the remote URL for all builder - * instances. This environment variable should be set to a fully qualified - * URL for a WebDriver server (e.g. http://localhost:4444/wd/hub). This - * option always takes precedence over {@code SELENIUM_SERVER_JAR}. + * Tasks and each callback registered on a {@link promise.Promise} + * will be run in their own ControlFlow frame. Any tasks scheduled within a + * frame will take priority over previously scheduled tasks. Furthermore, if any + * of the tasks in the frame fail, the remainder of the tasks in that frame will + * be discarded and the failure will be propagated to the user through the + * callback/task's promised result. * - * - {@code SELENIUM_SERVER_JAR}: defines the path to the - * - * standalone Selenium server jar to use. The server will be started the - * first time a WebDriver instance and be killed when the process exits. + * Each time a ControlFlow empties its task queue, it will fire an + * {@link promise.ControlFlow.EventType.IDLE IDLE} event. Conversely, + * whenever the flow terminates due to an unhandled error, it will remove all + * remaining tasks in its queue and fire an + * {@link promise.ControlFlow.EventType.UNCAUGHT_EXCEPTION + * UNCAUGHT_EXCEPTION} event. If there are no listeners registered with the + * flow, the error will be rethrown to the global error handler. * - * Suppose you had mytest.js that created WebDriver with - * - * var driver = new webdriver.Builder() - * .forBrowser('chrome') - * .build(); - * - * This test could be made to use Firefox on the local machine by running with - * `SELENIUM_BROWSER=firefox node mytest.js`. Rather than change the code to - * target Google Chrome on a remote machine, you can simply set the - * `SELENIUM_BROWSER` and `SELENIUM_REMOTE_URL` environment variables: - * - * SELENIUM_BROWSER=chrome:36:LINUX \ - * SELENIUM_REMOTE_URL=http://www.example.com:4444/wd/hub \ - * node mytest.js - * - * You could also use a local copy of the standalone Selenium server: - * - * SELENIUM_BROWSER=chrome:36:LINUX \ - * SELENIUM_SERVER_JAR=/path/to/selenium-server-standalone.jar \ - * node mytest.js + * @extends {EventEmitter} + * @final */ - class Builder { - - //region Constructors - + class ControlFlow extends EventEmitter { /** * @constructor */ constructor(); - //endregion - - //region Methods + /** + * Events that may be emitted by an {@link promise.ControlFlow}. + * @enum {string} + */ + static EventType: IEventType; /** - * Configures this builder to ignore any environment variable overrides and to - * only use the configuration specified through this instance's API. - * - * @return {!Builder} A self reference. + * Returns a string representation of this control flow, which is its current + * {@link #getSchedule() schedule}, sans task stack traces. + * @return {string} The string representation of this contorl flow. + * @override */ - disableEnvironmentOverrides(): Builder; - - /** - * Creates a new WebDriver client based on this builder's current - * configuration. - * - * While this method will immediately return a new WebDriver instance, any - * commands issued against it will be deferred until the associated browser - * has been fully initialized. Users may call {@link #buildAsync()} to obtain - * a promise that will not be fulfilled until the browser has been created - * (the difference is purely in style). - * - * @return {!webdriver.WebDriver} A new WebDriver instance. - * @throws {Error} If the current configuration is invalid. - * @see #buildAsync() - */ - build(): WebDriver; - - /** - * Creates a new WebDriver client based on this builder's current - * configuration. This method returns a promise that will not be fulfilled - * until the new browser session has been fully initialized. - * - * __Note:__ this method is purely a convenience wrapper around - * {@link #build()}. - * - * @return {!promise.Promise} A promise that will be - * fulfilled with the newly created WebDriver instance once the browser - * has been fully initialized. - * @see #build() - */ - buildAsync(): webdriver.promise.Promise; - - /** - * Configures the target browser for clients created by this instance. - * Any calls to {@link #withCapabilities} after this function will - * overwrite these settings. - * - *

    You may also define the target browser using the {@code SELENIUM_BROWSER} - * environment variable. If set, this environment variable should be of the - * form {@code browser[:[version][:platform]]}. - * - * @param {(string|webdriver.Browser)} name The name of the target browser; - * common defaults are available on the {@link webdriver.Browser} enum. - * @param {string=} opt_version A desired version; may be omitted if any - * version should be used. - * @param {string=} opt_platform The desired platform; may be omitted if any - * version may be used. - * @return {!Builder} A self reference. - */ - forBrowser(name: string, opt_version?: string, opt_platform?: string): Builder; - - /** - * Returns the base set of capabilities this instance is currently configured - * to use. - * @return {!webdriver.Capabilities} The current capabilities for this builder. - */ - getCapabilities(): Capabilities; - - /** - * @return {string} The URL of the WebDriver server this instance is configured - * to use. - */ - getServerUrl(): string; - - /** - * @return {?string} The URL of the proxy server to use for the WebDriver's - * HTTP connections, or `null` if not set. - */ - getWebDriverProxy(): string; - - /** - * Sets the default action to take with an unexpected alert before returning - * an error. - * @param {string} beahvior The desired behavior; should be 'accept', 'dismiss', - * or 'ignore'. Defaults to 'dismiss'. - * @return {!Builder} A self reference. - */ - setAlertBehavior(behavior: string): Builder; - - /** - * Sets Chrome-specific options for drivers created by this builder. Any - * logging or proxy settings defined on the given options will take precedence - * over those set through {@link #setLoggingPrefs} and {@link #setProxy}, - * respectively. - * - * @param {!chrome.Options} options The ChromeDriver options to use. - * @return {!Builder} A self reference. - */ - setChromeOptions(options: chrome.Options): Builder; - - /** - * Sets the control flow that created drivers should execute actions in. If - * the flow is never set, or is set to {@code null}, it will use the active - * flow at the time {@link #build()} is called. - * @param {webdriver.promise.ControlFlow} flow The control flow to use, or - * {@code null} to - * @return {!Builder} A self reference. - */ - setControlFlow(flow: webdriver.promise.ControlFlow): Builder; - - /** - * Set {@linkplain edge.Options options} specific to Microsoft's Edge browser - * for drivers created by this builder. Any proxy settings defined on the - * given options will take precedence over those set through - * {@link #setProxy}. - * - * @param {!edge.Options} options The MicrosoftEdgeDriver options to use. - * @return {!Builder} A self reference. - */ - setEdgeOptions(options: edge.Options): Builder; - - /** - * Sets whether native events should be used. - * @param {boolean} enabled Whether to enable native events. - * @return {!Builder} A self reference. - */ - setEnableNativeEvents(enabled: boolean): Builder; - - /** - * Sets Firefox-specific options for drivers created by this builder. Any - * logging or proxy settings defined on the given options will take precedence - * over those set through {@link #setLoggingPrefs} and {@link #setProxy}, - * respectively. - * - * @param {!firefox.Options} options The FirefoxDriver options to use. - * @return {!Builder} A self reference. - */ - setFirefoxOptions(options: firefox.Options): Builder; - - /** - * Set Internet Explorer specific {@linkplain ie.Options options} for drivers - * created by this builder. Any proxy settings defined on the given options - * will take precedence over those set through {@link #setProxy}. - * - * @param {!ie.Options} options The IEDriver options to use. - * @return {!Builder} A self reference. - */ - setIeOptions(options: ie.Options): Builder; - - /** - * Sets the logging preferences for the created session. Preferences may be - * changed by repeated calls, or by calling {@link #withCapabilities}. - * @param {!(webdriver.logging.Preferences|Object.)} prefs The - * desired logging preferences. - * @return {!Builder} A self reference. - */ - setLoggingPrefs(prefs: webdriver.logging.Preferences | Object): Builder; - - /** - * Sets Opera specific {@linkplain opera.Options options} for drivers created - * by this builder. Any logging or proxy settings defined on the given options - * will take precedence over those set through {@link #setLoggingPrefs} and - * {@link #setProxy}, respectively. - * - * @param {!opera.Options} options The OperaDriver options to use. - * @return {!Builder} A self reference. - */ - setOperaOptions(options: opera.Options): Builder; - - /** - * Sets the proxy configuration to use for WebDriver clients created by this - * builder. Any calls to {@link #withCapabilities} after this function will - * overwrite these settings. - * @param {!capabilities.ProxyConfig} config The configuration to use. - * @return {!Builder} A self reference. - */ - setProxy(config: webdriver.ProxyConfig): Builder; - - /** - * Sets Safari specific {@linkplain safari.Options options} for drivers - * created by this builder. Any logging settings defined on the given options - * will take precedence over those set through {@link #setLoggingPrefs}. - * - * @param {!safari.Options} options The Safari options to use. - * @return {!Builder} A self reference. - */ - setSafari(options: safari.Options): Builder; - - /** - * Sets how elements should be scrolled into view for interaction. - * @param {number} behavior The desired scroll behavior: either 0 to align with - * the top of the viewport or 1 to align with the bottom. - * @return {!Builder} A self reference. - */ - setScrollBehavior(behavior: number): Builder; - - /** - * Sets the URL of a remote WebDriver server to use. Once a remote URL has been - * specified, the builder direct all new clients to that server. If this method - * is never called, the Builder will attempt to create all clients locally. - * - *

    As an alternative to this method, you may also set the - * {@code SELENIUM_REMOTE_URL} environment variable. - * - * @param {string} url The URL of a remote server to use. - * @return {!Builder} A self reference. - */ - usingServer(url: string): Builder; - - /** - * Sets the URL of the proxy to use for the WebDriver's HTTP connections. - * If this method is never called, the Builder will create a connection - * without a proxy. - * - * @param {string} proxy The URL of a proxy to use. - * @return {!Builder} A self reference. - */ - usingWebDriverProxy(proxy: string): Builder; - - /** - * Sets the desired capabilities when requesting a new session. This will - * overwrite any previously set capabilities. - * @param {!(Object|webdriver.Capabilities)} capabilities The desired - * capabilities for a new session. - * @return {!Builder} A self reference. - */ - withCapabilities(capabilities: Object | Capabilities): Builder; - - //endregion - } - - /** - * Describes a mechanism for locating an element on the page. - * @final - */ - class By { - - /** - * @param {string} using the name of the location strategy to use. - * @param {string} value the value to search for. - */ - constructor(using: string, value: string); - - /** - * Locates elements that have a specific class name. - * - * @param {string} name The class name to search for. - * @return {!By} The new locator. - * @see http://www.w3.org/TR/2011/WD-html5-20110525/elements.html#classes - * @see http://www.w3.org/TR/CSS2/selector.html#class-html - */ - static className(name: string): By; - - /** - * Locates elements using a CSS selector. - * - * @param {string} selector The CSS selector to use. - * @return {!By} The new locator. - * @see http://www.w3.org/TR/CSS2/selector.html - */ - static css(selector: string): By; - - /** - * Locates eleemnts by the ID attribute. This locator uses the CSS selector - * `*[id='$ID']`, _not_ `document.getElementById`. - * - * @param {string} id The ID to search for. - * @return {!By} The new locator. - */ - static id(id: string): By; - - /** - * Locates link elements whose - * {@linkplain webdriver.WebElement#getText visible text} matches the given - * string. - * - * @param {string} text The link text to search for. - * @return {!By} The new locator. - */ - static linkText(text: string): By; - - /** - * Locates an elements by evaluating a - * {@linkplain webdriver.WebDriver#executeScript JavaScript expression}. - * The result of this expression must be an element or list of elements. - * - * @param {!(string|Function)} script The script to execute. - * @param {...*} var_args The arguments to pass to the script. - * @return {function(!./webdriver.WebDriver): !./promise.Promise} - * A new JavaScript-based locator function. - */ - static js(script: string | Function, ...var_args: Array): (webdriver: webdriver.WebDriver) => webdriver.promise.Promise; - - /** - * Locates elements whose `name` attribute has the given value. - * - * @param {string} name The name attribute to search for. - * @return {!By} The new locator. - */ - static name(name: string): By; - - /** - * Locates link elements whose - * {@linkplain webdriver.WebElement#getText visible text} contains the given - * substring. - * - * @param {string} text The substring to check for in a link's visible text. - * @return {!By} The new locator. - */ - static partialLinkText(text: string): By; - - /** - * Locates elements with a given tag name. - * - * @param {string} name The tag name to search for. - * @return {!By} The new locator. - * @deprecated Use {@link By.css() By.css(tagName)} instead. - */ - static tagName(name: string): By; - - /** - * Locates elements matching a XPath selector. Care should be taken when - * using an XPath selector with a {@link webdriver.WebElement} as WebDriver - * will respect the context in the specified in the selector. For example, - * given the selector `//div`, WebDriver will search from the document root - * regardless of whether the locator was used with a WebElement. - * - * @param {string} xpath The XPath selector to use. - * @return {!By} The new locator. - * @see http://www.w3.org/TR/xpath/ - */ - static xpath(xpath: string): By; - - /** @override */ toString(): string; - } - - /** - * Short-hand expressions for the primary element locator strategies. - * For example the following two statements are equivalent: - * - * var e1 = driver.findElement(webdriver.By.id('foo')); - * var e2 = driver.findElement({id: 'foo'}); - * - * Care should be taken when using JavaScript minifiers (such as the - * Closure compiler), as locator hashes will always be parsed using - * the un-obfuscated properties listed. - * - * @typedef {( - * {className: string}| - * {css: string}| - * {id: string}| - * {js: string}| - * {linkText: string}| - * {name: string}| - * {partialLinkText: string}| - * {tagName: string}| - * {xpath: string})} - */ - type ByHash = { className: string } | - { css: string } | - { id: string } | - { js: string } | - { linkText: string } | - { name: string } | - { partialLinkText: string } | - { tagName: string } | - { xpath: string }; - - export type Locator = By | Function | ByHash; - - /** - * Common webdriver capability keys. - * @enum {string} - */ - interface ICapability { /** - * Indicates whether a driver should accept all SSL certs by default. This - * capability only applies when requesting a new session. To query whether - * a driver can handle insecure SSL certs, see - * {@link webdriver.Capability.SECURE_SSL}. + * Resets this instance, clearing its queue and removing all event listeners. */ - ACCEPT_SSL_CERTS: string; - + reset(): void; /** - * The browser name. Common browser names are defined in the - * {@link webdriver.Browser} enum. + * Generates an annotated string describing the internal state of this control + * flow, including the currently executing as well as pending tasks. If + * {@code opt_includeStackTraces === true}, the string will include the + * stack trace from when each task was scheduled. + * @param {string=} opt_includeStackTraces Whether to include the stack traces + * from when each task was scheduled. Defaults to false. + * @return {string} String representation of this flow's internal state. */ - BROWSER_NAME: string; + getSchedule(opt_includeStackTraces?: boolean): string; /** - * Defines how elements should be scrolled into the viewport for interaction. - * This capability will be set to zero (0) if elements are aligned with the - * top of the viewport, or one (1) if aligned with the bottom. The default - * behavior is to align with the top of the viewport. - */ - ELEMENT_SCROLL_BEHAVIOR: string; - - /** - * Whether the driver is capable of handling modal alerts (e.g. alert, - * confirm, prompt). To define how a driver should handle alerts, - * use {@link webdriver.Capability.UNEXPECTED_ALERT_BEHAVIOR}. - */ - HANDLES_ALERTS: string; - - /** - * Key for the logging driver logging preferences. - */ - LOGGING_PREFS: string; - - /** - * Whether this session generates native events when simulating user input. - */ - NATIVE_EVENTS: string; - - /** - * Describes the platform the browser is running on. Will be one of - * ANDROID, IOS, LINUX, MAC, UNIX, or WINDOWS. When requesting a - * session, ANY may be used to indicate no platform preference (this is - * semantically equivalent to omitting the platform capability). - */ - PLATFORM: string; - - /** - * Describes the proxy configuration to use for a new WebDriver session. - */ - PROXY: string; - - /** Whether the driver supports changing the brower's orientation. */ - ROTATABLE: string; - - /** - * Whether a driver is only capable of handling secure SSL certs. To request - * that a driver accept insecure SSL certs by default, use - * {@link webdriver.Capability.ACCEPT_SSL_CERTS}. - */ - SECURE_SSL: string; - - /** Whether the driver supports manipulating the app cache. */ - SUPPORTS_APPLICATION_CACHE: string; - - /** Whether the driver supports locating elements with CSS selectors. */ - SUPPORTS_CSS_SELECTORS: string; - - /** Whether the browser supports JavaScript. */ - SUPPORTS_JAVASCRIPT: string; - - /** Whether the driver supports controlling the browser's location info. */ - SUPPORTS_LOCATION_CONTEXT: string; - - /** Whether the driver supports taking screenshots. */ - TAKES_SCREENSHOT: string; - - /** - * Defines how the driver should handle unexpected alerts. The value should - * be one of 'accept', 'dismiss', or 'ignore. - */ - UNEXPECTED_ALERT_BEHAVIOR: string; - - /** Defines the browser version. */ - VERSION: string; - } - - var Capability: ICapability; - - class Capabilities { - //region Constructors - - /** - * @param {(webdriver.Capabilities|Object)=} opt_other Another set of - * capabilities to merge into this instance. - * @constructor - */ - constructor(opt_other?: Capabilities | Object); - - //endregion - - //region Methods - - /** @return {!Object} The JSON representation of this instance. */ - toJSON(): any; - - /** - * Merges another set of capabilities into this instance. Any duplicates in - * the provided set will override those already set on this instance. - * @param {!(webdriver.Capabilities|Object)} other The capabilities to - * merge into this instance. - * @return {!webdriver.Capabilities} A self reference. - */ - merge(other: Capabilities | Object): Capabilities; - - /** - * @param {string} key The capability to set. - * @param {*} value The capability value. Capability values must be JSON - * serializable. Pass {@code null} to unset the capability. - * @return {!webdriver.Capabilities} A self reference. - */ - set(key: string, value: any): Capabilities; - - /** - * Sets the logging preferences. Preferences may be specified as a - * {@link webdriver.logging.Preferences} instance, or a as a map of log-type to - * log-level. - * @param {!(webdriver.logging.Preferences|Object.)} prefs The - * logging preferences. - * @return {!webdriver.Capabilities} A self reference. - */ - setLoggingPrefs(prefs: webdriver.logging.Preferences | Object): Capabilities; - - /** - * Sets the proxy configuration for this instance. - * @param {webdriver.ProxyConfig} proxy The desired proxy configuration. - * @return {!webdriver.Capabilities} A self reference. - */ - setProxy(proxy: ProxyConfig): Capabilities; - - - /** - * Sets whether native events should be used. - * @param {boolean} enabled Whether to enable native events. - * @return {!webdriver.Capabilities} A self reference. - */ - setEnableNativeEvents(enabled: boolean): Capabilities; - - - /** - * Sets how elements should be scrolled into view for interaction. - * @param {number} behavior The desired scroll behavior: either 0 to align with - * the top of the viewport or 1 to align with the bottom. - * @return {!webdriver.Capabilities} A self reference. - */ - setScrollBehavior(behavior: number): Capabilities; - - /** - * Sets the default action to take with an unexpected alert before returning - * an error. - * @param {string} behavior The desired behavior; should be 'accept', 'dismiss', - * or 'ignore'. Defaults to 'dismiss'. - * @return {!webdriver.Capabilities} A self reference. - */ - setAlertBehavior(behavior: string): Capabilities; - - /** - * @param {string} key The capability to return. - * @return {*} The capability with the given key, or {@code null} if it has - * not been set. - */ - get(key: string): any; - - /** - * @param {string} key The capability to check. - * @return {boolean} Whether the specified capability is set. - */ - has(key: string): boolean; - - //endregion - - //region Static Methods - - /** - * @return {!webdriver.Capabilities} A basic set of capabilities for Android. - */ - static android(): Capabilities; - - /** - * @return {!webdriver.Capabilities} A basic set of capabilities for Chrome. - */ - static chrome(): Capabilities; - - /** - * @return {!Capabilities} A basic set of capabilities for Microsoft Edge. - */ - static edge(): Capabilities; - - /** - * @return {!webdriver.Capabilities} A basic set of capabilities for Firefox. - */ - static firefox(): Capabilities; - - /** - * @return {!webdriver.Capabilities} A basic set of capabilities for - * Internet Explorer. - */ - static ie(): Capabilities; - - /** - * @return {!webdriver.Capabilities} A basic set of capabilities for iPad. - */ - static ipad(): Capabilities; - - /** - * @return {!webdriver.Capabilities} A basic set of capabilities for iPhone. - */ - static iphone(): Capabilities; - - /** - * @return {!webdriver.Capabilities} A basic set of capabilities for Opera. - */ - static opera(): Capabilities; - - /** - * @return {!webdriver.Capabilities} A basic set of capabilities for - * PhantomJS. - */ - static phantomjs(): Capabilities; - - /** - * @return {!webdriver.Capabilities} A basic set of capabilities for Safari. - */ - static safari(): Capabilities; - - /** - * @return {!webdriver.Capabilities} A basic set of capabilities for HTMLUnit. - */ - static htmlunit(): Capabilities; - - /** - * @return {!webdriver.Capabilities} A basic set of capabilities for HTMLUnit - * with enabled Javascript. - */ - static htmlunitwithjs(): Capabilities; - - //endregion - } - - /** - * An enumeration of valid command string. - */ - interface ICommandName { - GET_SERVER_STATUS: string; - - NEW_SESSION: string; - GET_SESSIONS: string; - DESCRIBE_SESSION: string; - - CLOSE: string; - QUIT: string; - - GET_CURRENT_URL: string; - GET: string; - GO_BACK: string; - GO_FORWARD: string; - REFRESH: string; - - ADD_COOKIE: string; - GET_COOKIE: string; - GET_ALL_COOKIES: string; - DELETE_COOKIE: string; - DELETE_ALL_COOKIES: string; - - GET_ACTIVE_ELEMENT: string; - FIND_ELEMENT: string; - FIND_ELEMENTS: string; - FIND_CHILD_ELEMENT: string; - FIND_CHILD_ELEMENTS: string; - - CLEAR_ELEMENT: string; - CLICK_ELEMENT: string; - SEND_KEYS_TO_ELEMENT: string; - SUBMIT_ELEMENT: string; - - GET_CURRENT_WINDOW_HANDLE: string; - GET_WINDOW_HANDLES: string; - GET_WINDOW_POSITION: string; - SET_WINDOW_POSITION: string; - GET_WINDOW_SIZE: string; - SET_WINDOW_SIZE: string; - MAXIMIZE_WINDOW: string; - - SWITCH_TO_WINDOW: string; - SWITCH_TO_FRAME: string; - GET_PAGE_SOURCE: string; - GET_TITLE: string; - - EXECUTE_SCRIPT: string; - EXECUTE_ASYNC_SCRIPT: string; - - GET_ELEMENT_TEXT: string; - GET_ELEMENT_TAG_NAME: string; - IS_ELEMENT_SELECTED: string; - IS_ELEMENT_ENABLED: string; - IS_ELEMENT_DISPLAYED: string; - GET_ELEMENT_LOCATION: string; - GET_ELEMENT_LOCATION_IN_VIEW: string; - GET_ELEMENT_SIZE: string; - GET_ELEMENT_ATTRIBUTE: string; - GET_ELEMENT_VALUE_OF_CSS_PROPERTY: string; - ELEMENT_EQUALS: string; - - SCREENSHOT: string; - IMPLICITLY_WAIT: string; - SET_SCRIPT_TIMEOUT: string; - SET_TIMEOUT: string; - - ACCEPT_ALERT: string; - DISMISS_ALERT: string; - GET_ALERT_TEXT: string; - SET_ALERT_TEXT: string; - - EXECUTE_SQL: string; - GET_LOCATION: string; - SET_LOCATION: string; - GET_APP_CACHE: string; - GET_APP_CACHE_STATUS: string; - CLEAR_APP_CACHE: string; - IS_BROWSER_ONLINE: string; - SET_BROWSER_ONLINE: string; - - GET_LOCAL_STORAGE_ITEM: string; - GET_LOCAL_STORAGE_KEYS: string; - SET_LOCAL_STORAGE_ITEM: string; - REMOVE_LOCAL_STORAGE_ITEM: string; - CLEAR_LOCAL_STORAGE: string; - GET_LOCAL_STORAGE_SIZE: string; - - GET_SESSION_STORAGE_ITEM: string; - GET_SESSION_STORAGE_KEYS: string; - SET_SESSION_STORAGE_ITEM: string; - REMOVE_SESSION_STORAGE_ITEM: string; - CLEAR_SESSION_STORAGE: string; - GET_SESSION_STORAGE_SIZE: string; - - SET_SCREEN_ORIENTATION: string; - GET_SCREEN_ORIENTATION: string; - - // These belong to the Advanced user interactions - an element is - // optional for these commands. - CLICK: string; - DOUBLE_CLICK: string; - MOUSE_DOWN: string; - MOUSE_UP: string; - MOVE_TO: string; - SEND_KEYS_TO_ACTIVE_ELEMENT: string; - - // These belong to the Advanced Touch API - TOUCH_SINGLE_TAP: string; - TOUCH_DOWN: string; - TOUCH_UP: string; - TOUCH_MOVE: string; - TOUCH_SCROLL: string; - TOUCH_DOUBLE_TAP: string; - TOUCH_LONG_PRESS: string; - TOUCH_FLICK: string; - - GET_AVAILABLE_LOG_TYPES: string; - GET_LOG: string; - GET_SESSION_LOGS: string; - - UPLOAD_FILE: string; - } - - var CommandName: ICommandName; - - /** - * Describes a command to be executed by the WebDriverJS framework. - * @param {!webdriver.CommandName} name The name of this command. - * @constructor - */ - class Command { - //region Constructors - - /** - * @param {!webdriver.CommandName} name The name of this command. - * @constructor - */ - constructor(name: string); - - //endregion - - //region Methods - - /** - * @return {!webdriver.CommandName} This command's name. - */ - getName(): string; - - /** - * Sets a parameter to send with this command. - * @param {string} name The parameter name. - * @param {*} value The parameter value. - * @return {!webdriver.Command} A self reference. - */ - setParameter(name: string, value: any): Command; - - /** - * Sets the parameters for this command. - * @param {!Object.<*>} parameters The command parameters. - * @return {!webdriver.Command} A self reference. - */ - setParameters(parameters: any): Command; - - /** - * Returns a named command parameter. - * @param {string} key The parameter key to look up. - * @return {*} The parameter value, or undefined if it has not been set. - */ - getParameter(key: string): any; - - /** - * @return {!Object.<*>} The parameters to send with this command. - */ - getParameters(): any; - - //endregion - } - - /** - * Handles the execution of WebDriver {@link Command commands}. - * @interface - */ - class Executor { - /** - * Executes the given {@code command}. If there is an error executing the - * command, the provided callback will be invoked with the offending error. - * Otherwise, the callback will be invoked with a null Error and non-null - * response object. + * Schedules a task for execution. If there is nothing currently in the + * queue, the task will be executed in the next turn of the event loop. If + * the task function is a generator, the task will be executed using + * {@link promise.consume}. * - * @param {!Command} command The command to execute. - * @return {!promise.Promise} A promise that will be fulfilled with - * the command result. - */ - execute(command: Command): webdriver.promise.Promise - } - - /** - * Wraps a promised {@link Executor}, ensuring no commands are executed until - * the wrapped executor has been fully resolved. - * @implements {Executor} - */ - class DeferredExecutor { - /** - * @param {!promise.Promise} delegate The promised delegate, which - * may be provided by any promise-like thenable object. - */ - constructor(delegate: webdriver.promise.Promise); - } - - /** - * Describes an event listener registered on an {@linkplain EventEmitter}. - */ - class Listener { - /** - * @param {!Function} fn The acutal listener function. - * @param {(Object|undefined)} scope The object in whose scope to invoke the - * listener. - * @param {boolean} oneshot Whether this listener should only be used once. - */ - constructor(fn: Function, scope: Object, oneshot: boolean); - } - - /** - * Object that can emit events for others to listen for. This is used instead - * of Closure's event system because it is much more light weight. The API is - * based on Node's EventEmitters. - */ - class EventEmitter { - //region Constructors - - /** - * @constructor - */ - constructor(); - - //endregion - - //region Methods - - /** - * Fires an event and calls all listeners. - * @param {string} type The type of event to emit. - * @param {...*} var_args Any arguments to pass to each listener. - */ - emit(type: string, ...var_args: any[]): void; - - /** - * Returns a mutable list of listeners for a specific type of event. - * @param {string} type The type of event to retrieve the listeners for. - * @return {!Set} The registered listeners for the given event - * type. - */ - listeners(type: string): any; - - /** - * Registers a listener. - * @param {string} type The type of event to listen for. - * @param {!Function} fn The function to invoke when the event is fired. - * @param {Object=} opt_self The object in whose scope to invoke the listener. - * @param {boolean=} opt_oneshot Whether the listener should b (e removed after - * the first event is fired. - * @return {!EventEmitter} A self reference. - * @private - */ - addListener(type: string, fn: Function, opt_scope?: any, opt_oneshot?: boolean): EventEmitter; - - - /** - * Registers a one-time listener which will be called only the first time an - * event is emitted, after which it will be removed. - * @param {string} type The type of event to listen for. - * @param {!Function} fn The function to invoke when the event is fired. - * @param {Object=} opt_scope The object in whose scope to invoke the listener. - * @return {!webdriver.EventEmitter} A self reference. - */ - once(type: string, fn: any, opt_scope?: any): EventEmitter; - - /** - * An alias for {@code #addListener()}. - * @param {string} type The type of event to listen for. - * @param {!Function} fn The function to invoke when the event is fired. - * @param {Object=} opt_scope The object in whose scope to invoke the listener. - * @return {!webdriver.EventEmitter} A self reference. - */ - on(type: string, fn: Function, opt_scope?: any): EventEmitter; - - /** - * Removes a previously registered event listener. - * @param {string} type The type of event to unregister. - * @param {!Function} listenerFn The handler function to remove. - * @return {!webdriver.EventEmitter} A self reference. - */ - removeListener(type: string, listenerFn: Function): EventEmitter; - - /** - * Removes all listeners for a specific type of event. If no event is - * specified, all listeners across all types will be removed. - * @param {string=} opt_type The type of event to remove listeners from. - * @return {!webdriver.EventEmitter} A self reference. - */ - removeAllListeners(opt_type?: string): EventEmitter; - - //endregion - } - - - /** - * Interface for navigating back and forth in the browser history. - */ - class Navigation { - //region Constructors - - /** - * Interface for navigating back and forth in the browser history. - * - * This class should never be instantiated directly. Insead, obtain an instance - * with - * - * webdriver.navigate() - * - * @see WebDriver#navigate() - */ - constructor(driver: WebDriver); - - //endregion - - //region Methods - - /** - * Schedules a command to navigate to a new URL. - * @param {string} url The URL to navigate to. - * @return {!webdriver.promise.Promise.} A promise that will be resolved - * when the URL has been loaded. - */ - to(url: string): webdriver.promise.Promise; - - /** - * Schedules a command to move backwards in the browser history. - * @return {!webdriver.promise.Promise.} A promise that will be resolved - * when the navigation event has completed. - */ - back(): webdriver.promise.Promise; - - /** - * Schedules a command to move forwards in the browser history. - * @return {!webdriver.promise.Promise.} A promise that will be resolved - * when the navigation event has completed. - */ - forward(): webdriver.promise.Promise; - - /** - * Schedules a command to refresh the current page. - * @return {!webdriver.promise.Promise.} A promise that will be resolved - * when the navigation event has completed. - */ - refresh(): webdriver.promise.Promise; - - //endregion - } - - interface IWebDriverOptionsCookie { - name: string; - value: string; - path?: string; - domain?: string; - secure?: boolean; - expiry?: number; - } - - /** - * Provides methods for managing browser and driver state. - */ - class Options { - //region Constructors - - /** - * @param {!webdriver.WebDriver} driver The parent driver. - * @constructor - */ - constructor(driver: webdriver.WebDriver); - - //endregion - - //region Methods - - /** - * Schedules a command to add a cookie. - * @param {string} name The cookie name. - * @param {string} value The cookie value. - * @param {string=} opt_path The cookie path. - * @param {string=} opt_domain The cookie domain. - * @param {boolean=} opt_isSecure Whether the cookie is secure. - * @param {(number|!Date)=} opt_expiry When the cookie expires. If specified - * as a number, should be in milliseconds since midnight, - * January 1, 1970 UTC. - * @return {!promise.Promise} A promise that will be resolved - * when the cookie has been added to the page. - */ - addCookie(name: string, value: string, opt_path?: string, opt_domain?: string, opt_isSecure?: boolean, opt_expiry?: number | Date): webdriver.promise.Promise; - - /** - * Schedules a command to delete all cookies visible to the current page. - * @return {!webdriver.promise.Promise} A promise that will be resolved when all - * cookies have been deleted. - */ - deleteAllCookies(): webdriver.promise.Promise; - - /** - * Schedules a command to delete the cookie with the given name. This command is - * a no-op if there is no cookie with the given name visible to the current - * page. - * @param {string} name The name of the cookie to delete. - * @return {!webdriver.promise.Promise} A promise that will be resolved when the - * cookie has been deleted. - */ - deleteCookie(name: string): webdriver.promise.Promise; - - /** - * Schedules a command to retrieve all cookies visible to the current page. - * Each cookie will be returned as a JSON object as described by the WebDriver - * wire protocol. - * @return {!webdriver.promise.Promise} A promise that will be resolved with the - * cookies visible to the current page. - * @see http://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object - */ - getCookies(): webdriver.promise.Promise; - - /** - * Schedules a command to retrieve the cookie with the given name. Returns null - * if there is no such cookie. The cookie will be returned as a JSON object as - * described by the WebDriver wire protocol. - * @param {string} name The name of the cookie to retrieve. - * @return {!webdriver.promise.Promise} A promise that will be resolved with the - * named cookie, or {@code null} if there is no such cookie. - * @see http://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object - */ - getCookie(name: string): webdriver.promise.Promise; - - /** - * @return {!webdriver.WebDriver.Logs} The interface for managing driver - * logs. - */ - logs(): webdriver.Logs; - - /** - * @return {!webdriver.WebDriver.Timeouts} The interface for managing driver - * timeouts. - */ - timeouts(): webdriver.Timeouts; - - /** - * @return {!webdriver.WebDriver.Window} The interface for managing the - * current window. - */ - window(): webdriver.Window; - - //endregion - } - - /** - * An interface for managing timeout behavior for WebDriver instances. - */ - class Timeouts { - //region Constructors - - /** - * @param {!webdriver.WebDriver} driver The parent driver. - * @constructor - */ - constructor(driver: webdriver.WebDriver); - - //endregion - - //region Methods - - /** - * Specifies the amount of time the driver should wait when searching for an - * element if it is not immediately present. - *

    - * When searching for a single element, the driver should poll the page - * until the element has been found, or this timeout expires before failing - * with a {@code bot.ErrorCode.NO_SUCH_ELEMENT} error. When searching - * for multiple elements, the driver should poll the page until at least one - * element has been found or this timeout has expired. - *

    - * Setting the wait timeout to 0 (its default value), disables implicit - * waiting. - *

    - * Increasing the implicit wait timeout should be used judiciously as it - * will have an adverse effect on test run time, especially when used with - * slower location strategies like XPath. - * - * @param {number} ms The amount of time to wait, in milliseconds. - * @return {!webdriver.promise.Promise} A promise that will be resolved when the - * implicit wait timeout has been set. - */ - implicitlyWait(ms: number): webdriver.promise.Promise; - - /** - * Sets the amount of time to wait, in milliseconds, for an asynchronous script - * to finish execution before returning an error. If the timeout is less than or - * equal to 0, the script will be allowed to run indefinitely. - * - * @param {number} ms The amount of time to wait, in milliseconds. - * @return {!webdriver.promise.Promise} A promise that will be resolved when the - * script timeout has been set. - */ - setScriptTimeout(ms: number): webdriver.promise.Promise; - - /** - * Sets the amount of time to wait for a page load to complete before returning - * an error. If the timeout is negative, page loads may be indefinite. - * @param {number} ms The amount of time to wait, in milliseconds. - * @return {!webdriver.promise.Promise} A promise that will be resolved when - * the timeout has been set. - */ - pageLoadTimeout(ms: number): webdriver.promise.Promise; - - //endregion - } - - /** - * An interface for managing the current window. - */ - class Window { - - //region Constructors - - /** - * @param {!webdriver.WebDriver} driver The parent driver. - * @constructor - */ - constructor(driver: webdriver.WebDriver); - - //endregion - - //region Methods - - /** - * Retrieves the window's current position, relative to the top left corner of - * the screen. - * @return {!webdriver.promise.Promise} A promise that will be resolved with the - * window's position in the form of a {x:number, y:number} object literal. - */ - getPosition(): webdriver.promise.Promise; - - /** - * Repositions the current window. - * @param {number} x The desired horizontal position, relative to the left side - * of the screen. - * @param {number} y The desired vertical position, relative to the top of the - * of the screen. - * @return {!webdriver.promise.Promise} A promise that will be resolved when the - * command has completed. - */ - setPosition(x: number, y: number): webdriver.promise.Promise; - - /** - * Retrieves the window's current size. - * @return {!webdriver.promise.Promise} A promise that will be resolved with the - * window's size in the form of a {width:number, height:number} object - * literal. - */ - getSize(): webdriver.promise.Promise; - - /** - * Resizes the current window. - * @param {number} width The desired window width. - * @param {number} height The desired window height. - * @return {!webdriver.promise.Promise} A promise that will be resolved when the - * command has completed. - */ - setSize(width: number, height: number): webdriver.promise.Promise; - - /** - * Maximizes the current window. - * @return {!webdriver.promise.Promise} A promise that will be resolved when the - * command has completed. - */ - maximize(): webdriver.promise.Promise; - - //endregion - } - - /** - * Interface for managing WebDriver log records. - */ - class Logs { - - //region Constructors - - /** - * @param {!webdriver.WebDriver} driver The parent driver. - * @constructor - */ - constructor(driver: webdriver.WebDriver); - - //endregion - - //region - - /** - * Fetches available log entries for the given type. - * - *

    Note that log buffers are reset after each call, meaning that - * available log entries correspond to those entries not yet returned for a - * given log type. In practice, this means that this call will return the - * available log entries since the last call, or from the start of the - * session. - * - * @param {!webdriver.logging.Type} type The desired log type. - * @return {!webdriver.promise.Promise.>} A - * promise that will resolve to a list of log entries for the specified - * type. - */ - get(type: string): webdriver.promise.Promise; - - /** - * Retrieves the log types available to this driver. - * @return {!webdriver.promise.Promise.>} A - * promise that will resolve to a list of available log types. - */ - getAvailableLogTypes(): webdriver.promise.Promise; - - //endregion - } - - /** - * An interface for changing the focus of the driver to another frame or window. - */ - class TargetLocator { - - //region Constructors - - /** - * @param {!webdriver.WebDriver} driver The parent driver. - * @constructor - */ - constructor(driver: webdriver.WebDriver); - - //endregion - - //region Methods - - /** - * Schedules a command retrieve the {@code document.activeElement} element on - * the current document, or {@code document.body} if activeElement is not - * available. - * @return {!webdriver.WebElement} The active element. - */ - activeElement(): WebElementPromise; - - /** - * Schedules a command to switch focus of all future commands to the first frame - * on the page. - * @return {!webdriver.promise.Promise} A promise that will be resolved when the - * driver has changed focus to the default content. - */ - defaultContent(): webdriver.promise.Promise; - - /** - * Schedules a command to switch the focus of all future commands to another - * frame on the page. The target frame may be specified as one of the - * following: - * - * - A number that specifies a (zero-based) index into [window.frames]( - * https://developer.mozilla.org/en-US/docs/Web/API/Window.frames). - * - A {@link WebElement} reference, which correspond to a `frame` or `iframe` - * DOM element. - * - The `null` value, to select the topmost frame on the page. Passing `null` - * is the same as calling {@link #defaultContent defaultContent()}. - * - * If the specified frame can not be found, the returned promise will be - * rejected with a {@linkplain error.NoSuchFrameError}. - * - * @param {(number|WebElement|null)} id The frame locator. - * @return {!promise.Promise} A promise that will be resolved - * when the driver has changed focus to the specified frame. - */ - frame(nameOrIndex: number | WebElement): webdriver.promise.Promise; - - /** - * Schedules a command to switch the focus of all future commands to another - * window. Windows may be specified by their {@code window.name} attribute or - * by its handle (as returned by {@link WebDriver#getWindowHandles}). - * - * If the specified window cannot be found, the returned promise will be - * rejected with a {@linkplain error.NoSuchWindowError}. - * - * @param {string} nameOrHandle The name or window handle of the window to - * switch focus to. - * @return {!promise.Promise} A promise that will be resolved - * when the driver has changed focus to the specified window. - */ - window(nameOrHandle: string): webdriver.promise.Promise; - - /** - * Schedules a command to change focus to the active modal dialog, such as - * those opened by `window.alert()`, `window.confirm()`, and - * `window.prompt()`. The returned promise will be rejected with a - * {@linkplain error.NoSuchAlertError} if there are no open alerts. - * - * @return {!AlertPromise} The open alert. - */ - alert(): AlertPromise; - - //endregion - } - - /** - * Used with {@link webdriver.WebElement#sendKeys WebElement#sendKeys} on file - * input elements ({@code }) to detect when the entered key - * sequence defines the path to a file. - * - * By default, {@linkplain webdriver.WebElement WebElement's} will enter all - * key sequences exactly as entered. You may set a - * {@linkplain webdriver.WebDriver#setFileDetector file detector} on the parent - * WebDriver instance to define custom behavior for handling file elements. Of - * particular note is the {@link selenium-webdriver/remote.FileDetector}, which - * should be used when running against a remote - * [Selenium Server](http://docs.seleniumhq.org/download/). - */ - class FileDetector { - /** @constructor */ - constructor(); - - /** - * Handles the file specified by the given path, preparing it for use with - * the current browser. If the path does not refer to a valid file, it will - * be returned unchanged, otherwisee a path suitable for use with the current - * browser will be returned. - * - * This default implementation is a no-op. Subtypes may override this - * function for custom tailored file handling. - * - * @param {!webdriver.WebDriver} driver The driver for the current browser. - * @param {string} path The path to process. - * @return {!webdriver.promise.Promise} A promise for the processed - * file path. - * @package - */ - handleFile(driver: webdriver.WebDriver, path: string): webdriver.promise.Promise; - } - - /** - * Creates a new WebDriver client, which provides control over a browser. - * - * Every WebDriver command returns a {@code webdriver.promise.Promise} that - * represents the result of that command. Callbacks may be registered on this - * object to manipulate the command result or catch an expected error. Any - * commands scheduled with a callback are considered sub-commands and will - * execute before the next command in the current frame. For example: - * - * var message = []; - * driver.call(message.push, message, 'a').then(function() { - * driver.call(message.push, message, 'b'); - * }); - * driver.call(message.push, message, 'c'); - * driver.call(function() { - * alert('message is abc? ' + (message.join('') == 'abc')); - * }); - * - */ - class WebDriver { - //region Constructors - - /** - * @param {!(Session|promise.Promise)} session Either a - * known session or a promise that will be resolved to a session. - * @param {!command.Executor} executor The executor to use when sending - * commands to the browser. - * @param {promise.ControlFlow=} opt_flow The flow to - * schedule commands through. Defaults to the active flow object. - */ - constructor(session: Session | webdriver.promise.Promise, executor: Executor, opt_flow?: webdriver.promise.ControlFlow); - - //endregion - - //region StaticMethods - - /** - * Creates a new WebDriver client for an existing session. - * @param {!command.Executor} executor Command executor to use when querying - * for session details. - * @param {string} sessionId ID of the session to attach to. - * @param {promise.ControlFlow=} opt_flow The control flow all - * driver commands should execute under. Defaults to the - * {@link promise.controlFlow() currently active} control flow. - * @return {!WebDriver} A new client for the specified session. - */ - static attachToSession(executor: Executor, sessionId: string, opt_flow?: webdriver.promise.ControlFlow): WebDriver; - - /** - * Creates a new WebDriver session. - * @param {!command.Executor} executor The executor to create the new session - * with. - * @param {!./capabilities.Capabilities} desiredCapabilities The desired - * capabilities for the new session. - * @param {promise.ControlFlow=} opt_flow The control flow all driver - * commands should execute under, including the initial session creation. - * Defaults to the {@link promise.controlFlow() currently active} - * control flow. - * @return {!WebDriver} The driver for the newly created session. - */ - static createSession(executor: Executor, desiredCapabilities: Capabilities, opt_flow?: webdriver.promise.ControlFlow): WebDriver; - - //endregion - - //region Methods - - /** - * @return {!webdriver.promise.ControlFlow} The control flow used by this - * instance. - */ - controlFlow(): webdriver.promise.ControlFlow; - - /** - * Schedules a {@link command.Command} to be executed by this driver's - * {@link command.Executor}. - * - * @param {!command.Command} command The command to schedule. - * @param {string} description A description of the command for debugging. + * @param {function(): (T|promise.Promise)} fn The function to + * call to start the task. If the function returns a + * {@link promise.Promise}, this instance will wait for it to be + * resolved before starting the next task. + * @param {string=} opt_description A description of the task. * @return {!promise.Promise} A promise that will be resolved - * with the command result. + * with the result of the action. * @template T */ - schedule(command: Command, description: string): webdriver.promise.Promise; - + execute(fn: () => (T | Promise), opt_description?: string): Promise; /** - * Sets the {@linkplain input.FileDetector file detector} that should be - * used with this instance. - * @param {input.FileDetector} detector The detector to use or {@code null}. + * Inserts a {@code setTimeout} into the command queue. This is equivalent to + * a thread sleep in a synchronous programming language. + * + * @param {number} ms The timeout delay, in milliseconds. + * @param {string=} opt_description A description to accompany the timeout. + * @return {!promise.Promise} A promise that will be resolved with + * the result of the action. */ - setFileDetector(detector: FileDetector): void; - + timeout(ms: number, opt_description?: string): Promise; /** - * @return {!webdriver.promise.Promise.} A promise for this - * client's session. - */ - getSession(): webdriver.promise.Promise; - - - /** - * @return {!webdriver.promise.Promise.} A promise - * that will resolve with the this instance's capabilities. - */ - getCapabilities(): webdriver.promise.Promise; - - - /** - * Schedules a command to quit the current session. After calling quit, this - * instance will be invalidated and may no longer be used to issue commands - * against the browser. - * @return {!webdriver.promise.Promise.} A promise that will be resolved - * when the command has completed. - */ - quit(): webdriver.promise.Promise; - - /** - * Creates a new action sequence using this driver. The sequence will not be - * scheduled for execution until {@link actions.ActionSequence#perform} is - * called. Example: + * Schedules a task that shall wait for a condition to hold. Each condition + * function may return any value, but it will always be evaluated as a boolean. * - * driver.actions(). - * mouseDown(element1). - * mouseMove(element2). - * mouseUp(). - * perform(); + * Condition functions may schedule sub-tasks with this instance, however, + * their execution time will be factored into whether a wait has timed out. * - * @return {!actions.ActionSequence} A new action sequence for this instance. - */ - actions(): ActionSequence; - - - /** - * Creates a new touch sequence using this driver. The sequence will not be - * scheduled for execution until {@link actions.TouchSequence#perform} is - * called. Example: + * In the event a condition returns a Promise, the polling loop will wait for + * it to be resolved before evaluating whether the condition has been satisfied. + * The resolution time for a promise is factored into whether a wait has timed + * out. * - * driver.touchActions(). - * tap(element1). - * doubleTap(element2). - * perform(); + * If the condition function throws, or returns a rejected promise, the + * wait task will fail. * - * @return {!actions.TouchSequence} A new touch sequence for this instance. - */ - touchActions(): TouchSequence; - - - /** - * Schedules a command to execute JavaScript in the context of the currently - * selected frame or window. The script fragment will be executed as the body - * of an anonymous function. If the script is provided as a function object, - * that function will be converted to a string for injection into the target - * window. + * If the condition is defined as a promise, the flow will wait for it to + * settle. If the timeout expires before the promise settles, the promise + * returned by this function will be rejected. * - * Any arguments provided in addition to the script will be included as script - * arguments and may be referenced using the {@code arguments} object. - * Arguments may be a boolean, number, string, or {@code webdriver.WebElement}. - * Arrays and objects may also be used as script arguments as long as each item - * adheres to the types previously mentioned. + * If this function is invoked with `timeout === 0`, or the timeout is omitted, + * the flow will wait indefinitely for the condition to be satisfied. * - * The script may refer to any variables accessible from the current window. - * Furthermore, the script will execute in the window's context, thus - * {@code document} may be used to refer to the current document. Any local - * variables will not be available once the script has finished executing, - * though global variables will persist. - * - * If the script has a return value (i.e. if the script contains a return - * statement), then the following steps will be taken for resolving this - * functions return value: - * - * - For a HTML element, the value will resolve to a - * {@link webdriver.WebElement} - * - Null and undefined return values will resolve to null - * - Booleans, numbers, and strings will resolve as is - * - Functions will resolve to their string representation - * - For arrays and objects, each member item will be converted according to - * the rules above - * - * @param {!(string|Function)} script The script to execute. - * @param {...*} var_args The arguments to pass to the script. - * @return {!webdriver.promise.Promise.} A promise that will resolve to the - * scripts return value. + * @param {(!promise.Promise|function())} condition The condition to poll, + * or a promise to wait on. + * @param {number=} opt_timeout How long to wait, in milliseconds, for the + * condition to hold before timing out. If omitted, the flow will wait + * indefinitely. + * @param {string=} opt_message An optional error message to include if the + * wait times out; defaults to the empty string. + * @return {!promise.Promise} A promise that will be fulfilled + * when the condition has been satisified. The promise shall be rejected if + * the wait times out waiting for the condition. + * @throws {TypeError} If condition is not a function or promise or if timeout + * is not a number >= 0. * @template T */ - executeScript(script: string | Function, ...var_args: any[]): webdriver.promise.Promise; - - /** - * Schedules a command to execute asynchronous JavaScript in the context of the - * currently selected frame or window. The script fragment will be executed as - * the body of an anonymous function. If the script is provided as a function - * object, that function will be converted to a string for injection into the - * target window. - * - * Any arguments provided in addition to the script will be included as script - * arguments and may be referenced using the {@code arguments} object. - * Arguments may be a boolean, number, string, or {@code webdriver.WebElement}. - * Arrays and objects may also be used as script arguments as long as each item - * adheres to the types previously mentioned. - * - * Unlike executing synchronous JavaScript with {@link #executeScript}, - * scripts executed with this function must explicitly signal they are finished - * by invoking the provided callback. This callback will always be injected - * into the executed function as the last argument, and thus may be referenced - * with {@code arguments[arguments.length - 1]}. The following steps will be - * taken for resolving this functions return value against the first argument - * to the script's callback function: - * - * - For a HTML element, the value will resolve to a - * {@link webdriver.WebElement} - * - Null and undefined return values will resolve to null - * - Booleans, numbers, and strings will resolve as is - * - Functions will resolve to their string representation - * - For arrays and objects, each member item will be converted according to - * the rules above - * - * __Example #1:__ Performing a sleep that is synchronized with the currently - * selected window: - * - * var start = new Date().getTime(); - * driver.executeAsyncScript( - * 'window.setTimeout(arguments[arguments.length - 1], 500);'). - * then(function() { - * console.log( - * 'Elapsed time: ' + (new Date().getTime() - start) + ' ms'); - * }); - * - * __Example #2:__ Synchronizing a test with an AJAX application: - * - * var button = driver.findElement(By.id('compose-button')); - * button.click(); - * driver.executeAsyncScript( - * 'var callback = arguments[arguments.length - 1];' + - * 'mailClient.getComposeWindowWidget().onload(callback);'); - * driver.switchTo().frame('composeWidget'); - * driver.findElement(By.id('to')).sendKeys('dog@example.com'); - * - * __Example #3:__ Injecting a XMLHttpRequest and waiting for the result. In - * this example, the inject script is specified with a function literal. When - * using this format, the function is converted to a string for injection, so it - * should not reference any symbols not defined in the scope of the page under - * test. - * - * driver.executeAsyncScript(function() { - * var callback = arguments[arguments.length - 1]; - * var xhr = new XMLHttpRequest(); - * xhr.open('GET', '/resource/data.json', true); - * xhr.onreadystatechange = function() { - * if (xhr.readyState == 4) { - * callback(xhr.responseText); - * } - * } - * xhr.send(''); - * }).then(function(str) { - * console.log(JSON.parse(str)['food']); - * }); - * - * @param {!(string|Function)} script The script to execute. - * @param {...*} var_args The arguments to pass to the script. - * @return {!webdriver.promise.Promise.} A promise that will resolve to the - * scripts return value. - * @template T - */ - executeAsyncScript(script: string | Function, ...var_args: any[]): webdriver.promise.Promise; - - /** - * Schedules a command to execute a custom function. - * @param {function(...): (T|webdriver.promise.Promise.)} fn The function to - * execute. - * @param {Object=} opt_scope The object in whose scope to execute the function. - * @param {...*} var_args Any arguments to pass to the function. - * @return {!webdriver.promise.Promise.} A promise that will be resolved' - * with the function's result. - * @template T - */ - call(fn: (...var_args: any[]) => (T | webdriver.promise.Promise), opt_scope?: any, ...var_args: any[]): webdriver.promise.Promise; - - /** - * Schedules a command to wait for a condition to hold. The condition may be - * specified by a {@link webdriver.until.Condition}, as a custom function, or - * as a {@link webdriver.promise.Promise}. - * - * For a {@link webdriver.until.Condition} or function, the wait will repeatedly - * evaluate the condition until it returns a truthy value. If any errors occur - * while evaluating the condition, they will be allowed to propagate. In the - * event a condition returns a {@link webdriver.promise.Promise promise}, the - * polling loop will wait for it to be resolved and use the resolved value for - * whether the condition has been satisified. Note the resolution time for - * a promise is factored into whether a wait has timed out. - * - * *Example:* waiting up to 10 seconds for an element to be present and visible - * on the page. - * - * var button = driver.wait(until.elementLocated(By.id('foo'), 10000); - * button.click(); - * - * This function may also be used to block the command flow on the resolution - * of a {@link webdriver.promise.Promise promise}. When given a promise, the - * command will simply wait for its resolution before completing. A timeout may - * be provided to fail the command if the promise does not resolve before the - * timeout expires. - * - * *Example:* Suppose you have a function, `startTestServer`, that returns a - * promise for when a server is ready for requests. You can block a `WebDriver` - * client on this promise with: - * - * var started = startTestServer(); - * driver.wait(started, 5 * 1000, 'Server should start within 5 seconds'); - * driver.get(getServerUrl()); - * - * @param {!(webdriver.promise.Promise| - * webdriver.until.Condition| - * function(!webdriver.WebDriver): T)} condition The condition to - * wait on, defined as a promise, condition object, or a function to - * evaluate as a condition. - * @param {number=} opt_timeout How long to wait for the condition to be true. - * @param {string=} opt_message An optional message to use if the wait times - * out. - * @return {!webdriver.promise.Promise} A promise that will be fulfilled - * with the first truthy value returned by the condition function, or - * rejected if the condition times out. - * @template T - */ - wait(condition: webdriver.promise.Promise | webdriver.until.Condition | ((driver: WebDriver) => T) | Function, timeout?: number, opt_message?: string): webdriver.promise.Promise; - - /** - * Schedules a command to make the driver sleep for the given amount of time. - * @param {number} ms The amount of time, in milliseconds, to sleep. - * @return {!webdriver.promise.Promise.} A promise that will be resolved - * when the sleep has finished. - */ - sleep(ms: number): webdriver.promise.Promise; - - /** - * Schedules a command to retrieve they current window handle. - * @return {!webdriver.promise.Promise.} A promise that will be - * resolved with the current window handle. - */ - getWindowHandle(): webdriver.promise.Promise; - - /** - * Schedules a command to retrieve the current list of available window handles. - * @return {!webdriver.promise.Promise.>} A promise that will - * be resolved with an array of window handles. - */ - getAllWindowHandles(): webdriver.promise.Promise; - - /** - * Schedules a command to retrieve the current page's source. The page source - * returned is a representation of the underlying DOM: do not expect it to be - * formatted or escaped in the same way as the response sent from the web - * server. - * @return {!webdriver.promise.Promise.} A promise that will be - * resolved with the current page source. - */ - getPageSource(): webdriver.promise.Promise; - - /** - * Schedules a command to close the current window. - * @return {!webdriver.promise.Promise.} A promise that will be resolved - * when this command has completed. - */ - close(): webdriver.promise.Promise; - - /** - * Schedules a command to navigate to the given URL. - * @param {string} url The fully qualified URL to open. - * @return {!webdriver.promise.Promise.} A promise that will be resolved - * when the document has finished loading. - */ - get(url: string): webdriver.promise.Promise; - - /** - * Schedules a command to retrieve the URL of the current page. - * @return {!webdriver.promise.Promise.} A promise that will be - * resolved with the current URL. - */ - getCurrentUrl(): webdriver.promise.Promise; - - /** - * Schedules a command to retrieve the current page's title. - * @return {!webdriver.promise.Promise.} A promise that will be - * resolved with the current page's title. - */ - getTitle(): webdriver.promise.Promise; - - /** - * Schedule a command to find an element on the page. If the element cannot be - * found, a {@link bot.ErrorCode.NO_SUCH_ELEMENT} result will be returned - * by the driver. Unlike other commands, this error cannot be suppressed. In - * other words, scheduling a command to find an element doubles as an assert - * that the element is present on the page. To test whether an element is - * present on the page, use {@link #isElementPresent} instead. - * - * The search criteria for an element may be defined using one of the - * factories in the {@link webdriver.By} namespace, or as a short-hand - * {@link webdriver.By.Hash} object. For example, the following two statements - * are equivalent: - * - * var e1 = driver.findElement(By.id('foo')); - * var e2 = driver.findElement({id:'foo'}); - * - * You may also provide a custom locator function, which takes as input this - * instance and returns a {@link WebElement}, or a promise that will resolve - * to a WebElement. If the returned promise resolves to an array of - * WebElements, WebDriver will use the first element. For example, to find the - * first visible link on a page, you could write: - * - * var link = driver.findElement(firstVisibleLink); - * - * function firstVisibleLink(driver) { - * var links = driver.findElements(By.tagName('a')); - * return promise.filter(links, function(link) { - * return link.isDisplayed(); - * }); - * } - * - * @param {!(by.By|Function)} locator The locator to use. - * @return {!WebElementPromise} A WebElement that can be used to issue - * commands against the located element. If the element is not found, the - * element will be invalidated and all scheduled commands aborted. - */ - findElement(locator: By | Function): WebElementPromise; - - /** - * Schedules a command to test if an element is present on the page. - * - * If given a DOM element, this function will check if it belongs to the - * document the driver is currently focused on. Otherwise, the function will - * test if at least one element can be found with the given search criteria. - * - * @param {!(by.By|Function)} locator The locator to use. - * @return {!promise.Promise} A promise that will resolve - * with whether the element is present on the page. - * @deprecated This method will be removed in Selenium 3.0 for consistency - * with the other Selenium language bindings. This method is equivalent - * to - * - * driver.findElements(locator).then(e => !!e.length); - */ - isElementPresent(locatorOrElement: By | Function): webdriver.promise.Promise; - - /** - * Schedule a command to search for multiple elements on the page. - * - * @param {!(by.By|Function)} locator The locator to use. - * @return {!promise.Promise.>} A - * promise that will resolve to an array of WebElements. - */ - findElements(locator: By | Function): webdriver.promise.Promise; - - /** - * Schedule a command to take a screenshot. The driver makes a best effort to - * return a screenshot of the following, in order of preference: - * - * 1. Entire page - * 2. Current window - * 3. Visible portion of the current frame - * 4. The entire display containing the browser - * - * @return {!promise.Promise} A promise that will be - * resolved to the screenshot as a base-64 encoded PNG. - */ - takeScreenshot(): webdriver.promise.Promise; - - /** - * @return {!webdriver.WebDriver.Options} The options interface for this - * instance. - */ - manage(): webdriver.Options; - - /** - * @return {!webdriver.WebDriver.Navigation} The navigation interface for this - * instance. - */ - navigate(): Navigation; - - /** - * @return {!webdriver.WebDriver.TargetLocator} The target locator interface for - * this instance. - */ - switchTo(): webdriver.TargetLocator; - - //endregion - } - - interface IWebElementId { - [ELEMENT: string]: string; - } - - /** - * Represents a DOM element. WebElements can be found by searching from the - * document root using a {@code webdriver.WebDriver} instance, or by searching - * under another {@code webdriver.WebElement}: - *

    
    -   *   driver.get('http://www.google.com');
    -   *   var searchForm = driver.findElement(By.tagName('form'));
    -   *   var searchBox = searchForm.findElement(By.name('q'));
    -   *   searchBox.sendKeys('webdriver');
    -   * 
    - * - * The WebElement is implemented as a promise for compatibility with the promise - * API. It will always resolve itself when its internal state has been fully - * resolved and commands may be issued against the element. This can be used to - * catch errors when an element cannot be located on the page: - *
    
    -   *   driver.findElement(By.id('not-there')).then(function(element) {
    -   *     alert('Found an element that was not expected to be there!');
    -   *   }, function(error) {
    -   *     alert('The element was not found, as expected');
    -   *   });
    -   * 
    - */ - interface IWebElement { - //region Methods - - /** - * Schedules a command to click on this element. - * @return {!webdriver.promise.Promise} A promise that will be resolved when - * the click command has completed. - */ - click(): webdriver.promise.Promise; - - /** - * Schedules a command to type a sequence on the DOM element represented by - * this instance. - * - * Modifier keys (SHIFT, CONTROL, ALT, META) are stateful; once a modifier is - * processed in the key sequence, that key state is toggled until one of the - * following occurs: - * - * - The modifier key is encountered again in the sequence. At this point the - * state of the key is toggled (along with the appropriate keyup/down - * events). - * - The {@link input.Key.NULL} key is encountered in the sequence. When - * this key is encountered, all modifier keys current in the down state are - * released (with accompanying keyup events). The NULL key can be used to - * simulate common keyboard shortcuts: - * - * element.sendKeys('text was', - * Key.CONTROL, 'a', Key.NULL, - * 'now text is'); - * // Alternatively: - * element.sendKeys('text was', - * Key.chord(Key.CONTROL, 'a'), - * 'now text is'); - * - * - The end of the key sequence is encountered. When there are no more keys - * to type, all depressed modifier keys are released (with accompanying - * keyup events). - * - * If this element is a file input ({@code }), the - * specified key sequence should specify the path to the file to attach to - * the element. This is analogous to the user clicking 'Browse...' and entering - * the path into the file select dialog. - * - * var form = driver.findElement(By.css('form')); - * var element = form.findElement(By.css('input[type=file]')); - * element.sendKeys('/path/to/file.txt'); - * form.submit(); - * - * For uploads to function correctly, the entered path must reference a file - * on the _browser's_ machine, not the local machine running this script. When - * running against a remote Selenium server, a {@link input.FileDetector} - * may be used to transparently copy files to the remote machine before - * attempting to upload them in the browser. - * - * __Note:__ On browsers where native keyboard events are not supported - * (e.g. Firefox on OS X), key events will be synthesized. Special - * punctuation keys will be synthesized according to a standard QWERTY en-us - * keyboard layout. - * - * @param {...(number|string|!IThenable<(number|string)>)} var_args The - * sequence of keys to type. Number keys may be referenced numerically or - * by string (1 or '1'). All arguments will be joined into a single - * sequence. - * @return {!webdriver.promise.Promise} A promise that will be resolved when all - * keys have been typed. - */ - sendKeys(...var_args: Array>): webdriver.promise.Promise; - - /** - * Schedules a command to query for the tag/node name of this element. - * @return {!webdriver.promise.Promise} A promise that will be resolved with the - * element's tag name. - */ - getTagName(): webdriver.promise.Promise; - - /** - * Schedules a command to query for the computed style of the element - * represented by this instance. If the element inherits the named style from - * its parent, the parent will be queried for its value. Where possible, color - * values will be converted to their hex representation (e.g. #00ff00 instead of - * rgb(0, 255, 0)). - *

    - * Warning: the value returned will be as the browser interprets it, so - * it may be tricky to form a proper assertion. - * - * @param {string} cssStyleProperty The name of the CSS style property to look - * up. - * @return {!webdriver.promise.Promise} A promise that will be resolved with the - * requested CSS value. - */ - getCssValue(cssStyleProperty: string): webdriver.promise.Promise; - - /** - * Schedules a command to query for the value of the given attribute of the - * element. Will return the current value even if it has been modified after the - * page has been loaded. More exactly, this method will return the value of the - * given attribute, unless that attribute is not present, in which case the - * value of the property with the same name is returned. If neither value is - * set, null is returned. The 'style' attribute is converted as best can be to a - * text representation with a trailing semi-colon. The following are deemed to - * be 'boolean' attributes and will be returned as thus: - * - *

    async, autofocus, autoplay, checked, compact, complete, controls, declare, - * defaultchecked, defaultselected, defer, disabled, draggable, ended, - * formnovalidate, hidden, indeterminate, iscontenteditable, ismap, itemscope, - * loop, multiple, muted, nohref, noresize, noshade, novalidate, nowrap, open, - * paused, pubdate, readonly, required, reversed, scoped, seamless, seeking, - * selected, spellcheck, truespeed, willvalidate - * - *

    Finally, the following commonly mis-capitalized attribute/property names - * are evaluated as expected: - *

      - *
    • 'class' - *
    • 'readonly' - *
    - * @param {string} attributeName The name of the attribute to query. - * @return {!webdriver.promise.Promise} A promise that will be resolved with the - * attribute's value. - */ - getAttribute(attributeName: string): webdriver.promise.Promise; - - /** - * Get the visible (i.e. not hidden by CSS) innerText of this element, including - * sub-elements, without any leading or trailing whitespace. - * @return {!webdriver.promise.Promise} A promise that will be resolved with the - * element's visible text. - */ - getText(): webdriver.promise.Promise; - - /** - * Schedules a command to compute the size of this element's bounding box, in - * pixels. - * @return {!webdriver.promise.Promise} A promise that will be resolved with the - * element's size as a {@code {width:number, height:number}} object. - */ - getSize(): webdriver.promise.Promise; - - /** - * Schedules a command to compute the location of this element in page space. - * @return {!webdriver.promise.Promise} A promise that will be resolved to the - * element's location as a {@code {x:number, y:number}} object. - */ - getLocation(): webdriver.promise.Promise; - - /** - * Schedules a command to query whether the DOM element represented by this - * instance is enabled, as dicted by the {@code disabled} attribute. - * @return {!webdriver.promise.Promise} A promise that will be resolved with - * whether this element is currently enabled. - */ - isEnabled(): webdriver.promise.Promise; - - /** - * Schedules a command to query whether this element is selected. - * @return {!webdriver.promise.Promise} A promise that will be resolved with - * whether this element is currently selected. - */ - isSelected(): webdriver.promise.Promise; - - /** - * Schedules a command to submit the form containing this element (or this - * element if it is a FORM element). This command is a no-op if the element is - * not contained in a form. - * @return {!webdriver.promise.Promise} A promise that will be resolved when - * the form has been submitted. - */ - submit(): webdriver.promise.Promise; - - /** - * Schedules a command to clear the {@code value} of this element. This command - * has no effect if the underlying DOM element is neither a text INPUT element - * nor a TEXTAREA element. - * @return {!webdriver.promise.Promise} A promise that will be resolved when - * the element has been cleared. - */ - clear(): webdriver.promise.Promise; - - /** - * Schedules a command to test whether this element is currently displayed. - * @return {!webdriver.promise.Promise} A promise that will be resolved with - * whether this element is currently visible on the page. - */ - isDisplayed(): webdriver.promise.Promise; - - /** - * Schedules a command to retrieve the outer HTML of this element. - * @return {!webdriver.promise.Promise} A promise that will be resolved with - * the element's outer HTML. - */ - getOuterHtml(): webdriver.promise.Promise; - - /** - * @return {!webdriver.promise.Promise.} A promise - * that resolves to this element's JSON representation as defined by the - * WebDriver wire protocol. - * @see http://code.google.com/p/selenium/wiki/JsonWireProtocol - */ - getId(): webdriver.promise.Promise; - - /** - * Schedules a command to retrieve the inner HTML of this element. - * @return {!webdriver.promise.Promise} A promise that will be resolved with the - * element's inner HTML. - */ - getInnerHtml(): webdriver.promise.Promise; - - //endregion - } - - interface IWebElementFinders { - /** - * Schedule a command to find a descendant of this element. If the element - * cannot be found, a {@code bot.ErrorCode.NO_SUCH_ELEMENT} result will - * be returned by the driver. Unlike other commands, this error cannot be - * suppressed. In other words, scheduling a command to find an element doubles - * as an assert that the element is present on the page. To test whether an - * element is present on the page, use {@code #isElementPresent} instead. - * - *

    The search criteria for an element may be defined using one of the - * factories in the {@link webdriver.By} namespace, or as a short-hand - * {@link webdriver.By.Hash} object. For example, the following two statements - * are equivalent: - *

    -     * var e1 = element.findElement(By.id('foo'));
    -     * var e2 = element.findElement({id:'foo'});
    -     * 
    - * - *

    You may also provide a custom locator function, which takes as input - * this WebDriver instance and returns a {@link webdriver.WebElement}, or a - * promise that will resolve to a WebElement. For example, to find the first - * visible link on a page, you could write: - *

    -     * var link = element.findElement(firstVisibleLink);
    -     *
    -     * function firstVisibleLink(element) {
    -     *   var links = element.findElements(By.tagName('a'));
    -     *   return webdriver.promise.filter(links, function(link) {
    -     *     return links.isDisplayed();
    -     *   }).then(function(visibleLinks) {
    -     *     return visibleLinks[0];
    -     *   });
    -     * }
    -     * 
    - * - * @param {!(webdriver.Locator|webdriver.By.Hash|Function)} locator The - * locator strategy to use when searching for the element. - * @return {!webdriver.WebElement} A WebElement that can be used to issue - * commands against the located element. If the element is not found, the - * element will be invalidated and all scheduled commands aborted. - */ - findElement(locator: By | Function): WebElementPromise; - - /** - * Schedules a command to test if there is at least one descendant of this - * element that matches the given search criteria. - * - * @param {!(webdriver.Locator|webdriver.By.Hash|Function)} locator The - * locator strategy to use when searching for the element. - * @return {!webdriver.promise.Promise.} A promise that will be - * resolved with whether an element could be located on the page. - */ - isElementPresent(locator: By | Function): webdriver.promise.Promise; - - /** - * Schedules a command to find all of the descendants of this element that - * match the given search criteria. - * - * @param {!(webdriver.Locator|webdriver.By.Hash|Function)} locator The - * locator strategy to use when searching for the elements. - * @return {!webdriver.promise.Promise.>} A - * promise that will resolve to an array of WebElements. - */ - findElements(locator: By | Function): webdriver.promise.Promise; - } - - /** - * Defines an object that can be asynchronously serialized to its WebDriver - * wire representation. - * - * @constructor - * @template T - */ - interface Serializable { - /** - * Returns either this instance's serialized represention, if immediately - * available, or a promise for its serialized representation. This function is - * conceptually equivalent to objects that have a {@code toJSON()} property, - * except the serialize() result may be a promise or an object containing a - * promise (which are not directly JSON friendly). - * - * @return {!(T|IThenable.)} This instance's serialized wire format. - */ - serialize(): T | webdriver.promise.IThenable; - } - - /** - * Represents a DOM element. WebElements can be found by searching from the - * document root using a {@link webdriver.WebDriver} instance, or by searching - * under another WebElement: - * - * driver.get('http://www.google.com'); - * var searchForm = driver.findElement(By.tagName('form')); - * var searchBox = searchForm.findElement(By.name('q')); - * searchBox.sendKeys('webdriver'); - * - * The WebElement is implemented as a promise for compatibility with the promise - * API. It will always resolve itself when its internal state has been fully - * resolved and commands may be issued against the element. This can be used to - * catch errors when an element cannot be located on the page: - * - * driver.findElement(By.id('not-there')).then(function(element) { - * alert('Found an element that was not expected to be there!'); - * }, function(error) { - * alert('The element was not found, as expected'); - * }); - * - * @extends {webdriver.Serializable.} - */ - class WebElement implements Serializable { - /** - * @param {!WebDriver} driver the parent WebDriver instance for this element. - * @param {(!IThenable|string)} id The server-assigned opaque ID for - * the underlying DOM element. - */ - constructor(driver: webdriver.WebDriver, id: webdriver.promise.Promise | string); - - /** - * @param {string} id The raw ID. - * @param {boolean=} opt_noLegacy Whether to exclude the legacy element key. - * @return {!Object} The element ID for use with WebDriver's wire protocol. - */ - static buildId(id: string, opt_noLegacy?: boolean): Object; - - /** - * Extracts the encoded WebElement ID from the object. - * - * @param {?} obj The object to extract the ID from. - * @return {string} the extracted ID. - * @throws {TypeError} if the object is not a valid encoded ID. - */ - static extractId(obj: IWebElementId): string; - - /** - * @param {?} obj the object to test. - * @return {boolean} whether the object is a valid encoded WebElement ID. - */ - static isId(obj: IWebElementId): boolean; - - /** - * Compares two WebElements for equality. - * - * @param {!WebElement} a A WebElement. - * @param {!WebElement} b A WebElement. - * @return {!promise.Promise} A promise that will be - * resolved to whether the two WebElements are equal. - */ - static equals(a: WebElement, b: WebElement): webdriver.promise.Promise; - - /** - * @return {!webdriver.WebDriver} The parent driver for this instance. - */ - getDriver(): webdriver.WebDriver; - - /** - * @return {!promise.Promise} A promise that resolves to - * the server-assigned opaque ID assigned to this element. - */ - getId(): webdriver.promise.Promise; - - /** - * @deprecated Use {@link #getId()} instead. - */ - getRawId(): any; - - /** - * Schedule a command to find a descendant of this element. If the element - * cannot be found, a {@link bot.ErrorCode.NO_SUCH_ELEMENT} result will - * be returned by the driver. Unlike other commands, this error cannot be - * suppressed. In other words, scheduling a command to find an element doubles - * as an assert that the element is present on the page. To test whether an - * element is present on the page, use {@link #isElementPresent} instead. - * - * The search criteria for an element may be defined using one of the - * factories in the {@link webdriver.By} namespace, or as a short-hand - * {@link webdriver.By.Hash} object. For example, the following two statements - * are equivalent: - * - * var e1 = element.findElement(By.id('foo')); - * var e2 = element.findElement({id:'foo'}); - * - * You may also provide a custom locator function, which takes as input - * this WebDriver instance and returns a {@link webdriver.WebElement}, or a - * promise that will resolve to a WebElement. For example, to find the first - * visible link on a page, you could write: - * - * var link = element.findElement(firstVisibleLink); - * - * function firstVisibleLink(element) { - * var links = element.findElements(By.tagName('a')); - * return webdriver.promise.filter(links, function(link) { - * return links.isDisplayed(); - * }).then(function(visibleLinks) { - * return visibleLinks[0]; - * }); - * } - * - * @param {!(by.By|Function)} locator The locator strategy to use when - * searching for the element. - * @return {!WebElementPromise} A WebElement that can be used to issue - * commands against the located element. If the element is not found, the - * element will be invalidated and all scheduled commands aborted. - */ - findElement(locator: By | Function): WebElementPromise; - - /** - * Schedules a command to test if there is at least one descendant of this - * element that matches the given search criteria. - * - * @param {!(by.By|Function)} locator The locator strategy to use when - * searching for the element. - * @return {!promise.Promise} A promise that will be - * resolved with whether an element could be located on the page. - * @deprecated This method will be removed in Selenium 3.0 for consistency - * with the other Selenium language bindings. This method is equivalent - * to - * - * element.findElements(locator).then(e => !!e.length); - */ - isElementPresent(locator: By | Function): webdriver.promise.Promise; - - /** - * Schedules a command to find all of the descendants of this element that - * match the given search criteria. - * - * @param {!(by.By|Function)} locator The locator strategy to use when - * searching for the element. - * @return {!promise.Promise>} A - * promise that will resolve to an array of WebElements. - */ - findElements(locator: By | Function): webdriver.promise.Promise; - - /** - * Schedules a command to click on this element. - * @return {!webdriver.promise.Promise.} A promise that will be resolved - * when the click command has completed. - */ - click(): webdriver.promise.Promise; - - /** - * Schedules a command to type a sequence on the DOM element represented by this - * promsieinstance. - * - * Modifier keys (SHIFT, CONTROL, ALT, META) are stateful; once a modifier is - * processed in the keysequence, that key state is toggled until one of the - * following occurs: - * - * - The modifier key is encountered again in the sequence. At this point the - * state of the key is toggled (along with the appropriate keyup/down events). - * - The {@link webdriver.Key.NULL} key is encountered in the sequence. When - * this key is encountered, all modifier keys current in the down state are - * released (with accompanying keyup events). The NULL key can be used to - * simulate common keyboard shortcuts: - * - * element.sendKeys('text was', - * webdriver.Key.CONTROL, 'a', webdriver.Key.NULL, - * 'now text is'); - * // Alternatively: - * element.sendKeys('text was', - * webdriver.Key.chord(webdriver.Key.CONTROL, 'a'), - * 'now text is'); - * - * - The end of the keysequence is encountered. When there are no more keys - * to type, all depressed modifier keys are released (with accompanying keyup - * events). - * - * If this element is a file input ({@code }), the - * specified key sequence should specify the path to the file to attach to - * the element. This is analgous to the user clicking 'Browse...' and entering - * the path into the file select dialog. - * - * var form = driver.findElement(By.css('form')); - * var element = form.findElement(By.css('input[type=file]')); - * element.sendKeys('/path/to/file.txt'); - * form.submit(); - * - * For uploads to function correctly, the entered path must reference a file - * on the _browser's_ machine, not the local machine running this script. When - * running against a remote Selenium server, a {@link webdriver.FileDetector} - * may be used to transparently copy files to the remote machine before - * attempting to upload them in the browser. - * - * __Note:__ On browsers where native keyboard events are not supported - * (e.g. Firefox on OS X), key events will be synthesized. Special - * punctionation keys will be synthesized according to a standard QWERTY en-us - * keyboard layout. - * - * @param {...(string|!webdriver.promise.Promise)} var_args The sequence - * of keys to type. All arguments will be joined into a single sequence. - * @return {!webdriver.promise.Promise.} A promise that will be resolved - * when all keys have been typed. - */ - sendKeys(...var_args: Array>): webdriver.promise.Promise; - - /** - * Schedules a command to query for the tag/node name of this element. - * @return {!webdriver.promise.Promise.} A promise that will be - * resolved with the element's tag name. - */ - getTagName(): webdriver.promise.Promise; - - /** - * Schedules a command to query for the computed style of the element - * represented by this instance. If the element inherits the named style from - * its parent, the parent will be queried for its value. Where possible, color - * values will be converted to their hex representation (e.g. #00ff00 instead of - * rgb(0, 255, 0)). - * - * _Warning:_ the value returned will be as the browser interprets it, so - * it may be tricky to form a proper assertion. - * - * @param {string} cssStyleProperty The name of the CSS style property to look - * up. - * @return {!promise.Promise} A promise that will be - * resolved with the requested CSS value. - */ - getCssValue(cssStyleProperty: string): webdriver.promise.Promise; - - /** - * Schedules a command to query for the value of the given attribute of the - * element. Will return the current value, even if it has been modified after - * the page has been loaded. More exactly, this method will return the value of - * the given attribute, unless that attribute is not present, in which case the - * value of the property with the same name is returned. If neither value is - * set, null is returned (for example, the 'value' property of a textarea - * element). The 'style' attribute is converted as best can be to a - * text representation with a trailing semi-colon. The following are deemed to - * be 'boolean' attributes and will return either 'true' or null: - * - * async, autofocus, autoplay, checked, compact, complete, controls, declare, - * defaultchecked, defaultselected, defer, disabled, draggable, ended, - * formnovalidate, hidden, indeterminate, iscontenteditable, ismap, itemscope, - * loop, multiple, muted, nohref, noresize, noshade, novalidate, nowrap, open, - * paused, pubdate, readonly, required, reversed, scoped, seamless, seeking, - * selected, spellcheck, truespeed, willvalidate - * - * Finally, the following commonly mis-capitalized attribute/property names - * are evaluated as expected: - * - * - 'class' - * - 'readonly' - * - * @param {string} attributeName The name of the attribute to query. - * @return {!webdriver.promise.Promise.} A promise that will be - * resolved with the attribute's value. The returned value will always be - * either a string or null. - */ - getAttribute(attributeName: string): webdriver.promise.Promise; - - /** - * Get the visible (i.e. not hidden by CSS) innerText of this element, including - * sub-elements, without any leading or trailing whitespace. - * @return {!webdriver.promise.Promise.} A promise that will be - * resolved with the element's visible text. - */ - getText(): webdriver.promise.Promise; - - /** - * Schedules a command to compute the size of this element's bounding box, in - * pixels. - * @return {!webdriver.promise.Promise.<{width: number, height: number}>} A - * promise that will be resolved with the element's size as a - * {@code {width:number, height:number}} object. - */ - getSize(): webdriver.promise.Promise; - - /** - * Schedules a command to compute the location of this element in page space. - * @return {!webdriver.promise.Promise.<{x: number, y: number}>} A promise that - * will be resolved to the element's location as a - * {@code {x:number, y:number}} object. - */ - getLocation(): webdriver.promise.Promise; - - /** - * Schedules a command to query whether the DOM element represented by this - * instance is enabled, as dicted by the {@code disabled} attribute. - * @return {!webdriver.promise.Promise.} A promise that will be - * resolved with whether this element is currently enabled. - */ - isEnabled(): webdriver.promise.Promise; - - /** - * Schedules a command to query whether this element is selected. - * @return {!webdriver.promise.Promise.} A promise that will be - * resolved with whether this element is currently selected. - */ - isSelected(): webdriver.promise.Promise; - - /** - * Schedules a command to submit the form containing this element (or this - * element if it is a FORM element). This command is a no-op if the element is - * not contained in a form. - * @return {!webdriver.promise.Promise.} A promise that will be resolved - * when the form has been submitted. - */ - submit(): webdriver.promise.Promise; - - /** - * Schedules a command to clear the `value` of this element. This command has - * no effect if the underlying DOM element is neither a text INPUT element - * nor a TEXTAREA element. - * @return {!promise.Promise} A promise that will be resolved - * when the element has been cleared. - */ - clear(): webdriver.promise.Promise; - - /** - * Schedules a command to test whether this element is currently displayed. - * @return {!webdriver.promise.Promise.} A promise that will be - * resolved with whether this element is currently visible on the page. - */ - isDisplayed(): webdriver.promise.Promise; - - /** - * Take a screenshot of the visible region encompassed by this element's - * bounding rectangle. - * - * @param {boolean=} opt_scroll Optional argument that indicates whether the - * element should be scrolled into view before taking a screenshot. - * Defaults to false. - * @return {!promise.Promise} A promise that will be - * resolved to the screenshot as a base-64 encoded PNG. - */ - takeScreenshot(opt_scroll?: boolean): webdriver.promise.Promise; - - /** - * Schedules a command to retrieve the outer HTML of this element. - * @return {!webdriver.promise.Promise.} A promise that will be - * resolved with the element's outer HTML. - */ - getOuterHtml(): webdriver.promise.Promise; - - /** - * Schedules a command to retrieve the inner HTML of this element. - * @return {!webdriver.promise.Promise} A promise that will be resolved with the - * element's inner HTML. - */ - getInnerHtml(): webdriver.promise.Promise; - - /** @override */ - serialize(): webdriver.promise.Promise; - } - - /** - * WebElementPromise is a promise that will be fulfilled with a WebElement. - * This serves as a forward proxy on WebElement, allowing calls to be - * scheduled without directly on this instance before the underlying - * WebElement has been fulfilled. In other words, the following two statements - * are equivalent: - *
    
    -   *     driver.findElement({id: 'my-button'}).click();
    -   *     driver.findElement({id: 'my-button'}).then(function(el) {
    -   *       return el.click();
    -   *     });
    -   * 
    - * - * @param {!webdriver.WebDriver} driver The parent WebDriver instance for this - * element. - * @param {!webdriver.promise.Promise.} el A promise - * that will resolve to the promised element. - * @constructor - * @extends {webdriver.WebElement} - * @implements {webdriver.promise.Thenable.} - * @final - */ - class WebElementPromise extends WebElement implements webdriver.promise.IThenable { - /** - * @param {!WebDriver} driver The parent WebDriver instance for this - * element. - * @param {!promise.Promise} el A promise - * that will resolve to the promised element. - */ - constructor(driver: webdriver.WebDriver, el: webdriver.promise.Promise); - - /** - * Cancels the computation of this promise's value, rejecting the promise in the - * process. This method is a no-op if the promise has alreayd been resolved. - * - * @param {string=} opt_reason The reason this promise is being cancelled. - */ - cancel(opt_reason?: string): void; - - - /** @return {boolean} Whether this promise's value is still being computed. */ - isPending(): boolean; - - - /** - * Registers listeners for when this instance is resolved. - * - * @param opt_callback The - * function to call if this promise is successfully resolved. The function - * should expect a single argument: the promise's resolved value. - * @param opt_errback The - * function to call if this promise is rejected. The function should expect - * a single argument: the rejection reason. - * @return A new promise which will be - * resolved with the result of the invoked callback. - */ - then(opt_callback?: (value: WebElement) => webdriver.promise.Promise, opt_errback?: (error: any) => any): webdriver.promise.Promise; - - /** - * Registers listeners for when this instance is resolved. - * - * @param opt_callback The - * function to call if this promise is successfully resolved. The function - * should expect a single argument: the promise's resolved value. - * @param opt_errback The - * function to call if this promise is rejected. The function should expect - * a single argument: the rejection reason. - * @return A new promise which will be - * resolved with the result of the invoked callback. - */ - then(opt_callback?: (value: WebElement) => R, opt_errback?: (error: any) => any): webdriver.promise.Promise; - - - /** - * Registers a listener for when this promise is rejected. This is synonymous - * with the {@code catch} clause in a synchronous API: - *
    
    -     *   // Synchronous API:
    -     *   try {
    -     *     doSynchronousWork();
    -     *   } catch (ex) {
    -     *     console.error(ex);
    -     *   }
    -     *
    -     *   // Asynchronous promise API:
    -     *   doAsynchronousWork().thenCatch(function(ex) {
    -     *     console.error(ex);
    -     *   });
    -     * 
    - * - * @param {function(*): (R|webdriver.promise.Promise.)} errback The function - * to call if this promise is rejected. The function should expect a single - * argument: the rejection reason. - * @return {!webdriver.promise.Promise.} A new promise which will be - * resolved with the result of the invoked callback. - * @template R - */ - thenCatch(errback: (error: any) => any): webdriver.promise.Promise; - - - /** - * Registers a listener to invoke when this promise is resolved, regardless - * of whether the promise's value was successfully computed. This function - * is synonymous with the {@code finally} clause in a synchronous API: - *
    
    -     *   // Synchronous API:
    -     *   try {
    -     *     doSynchronousWork();
    -     *   } finally {
    -     *     cleanUp();
    -     *   }
    -     *
    -     *   // Asynchronous promise API:
    -     *   doAsynchronousWork().thenFinally(cleanUp);
    -     * 
    - * - * Note: similar to the {@code finally} clause, if the registered - * callback returns a rejected promise or throws an error, it will silently - * replace the rejection error (if any) from this promise: - *
    
    -     *   try {
    -     *     throw Error('one');
    -     *   } finally {
    -     *     throw Error('two');  // Hides Error: one
    -     *   }
    -     *
    -     *   webdriver.promise.rejected(Error('one'))
    -     *       .thenFinally(function() {
    -     *         throw Error('two');  // Hides Error: one
    -     *       });
    -     * 
    - * - * - * @param {function(): (R|webdriver.promise.Promise.)} callback The function - * to call when this promise is resolved. - * @return {!webdriver.promise.Promise.} A promise that will be fulfilled - * with the callback result. - * @template R - */ - thenFinally(callback: () => any): webdriver.promise.Promise; - - /** - * Registers a listener for when this promise is rejected. This is synonymous - * with the {@code catch} clause in a synchronous API: - * - * // Synchronous API: - * try { - * doSynchronousWork(); - * } catch (ex) { - * console.error(ex); - * } - * - * // Asynchronous promise API: - * doAsynchronousWork().catch(function(ex) { - * console.error(ex); - * }); - * - * @param {function(*): (R|IThenable)} errback The - * function to call if this promise is rejected. The function should - * expect a single argument: the rejection reason. - * @return {!ManagedPromise} A new promise which will be - * resolved with the result of the invoked callback. - * @template R - */ - catch(errback: Function): webdriver.promise.Promise; - } - - /** - * Contains information about a WebDriver session. - */ - class Session { - - //region Constructors - - /** - * @param {string} id The session ID. - * @param {!(Object|webdriver.Capabilities)} capabilities The session - * capabilities. - * @constructor - */ - constructor(id: string, capabilities: Capabilities | Object); - - //endregion - - //region Methods - - /** - * @return {string} This session's ID. - */ - getId(): string; - - /** - * @return {!webdriver.Capabilities} This session's capabilities. - */ - getCapabilities(): webdriver.Capabilities; - - /** - * Retrieves the value of a specific capability. - * @param {string} key The capability to retrieve. - * @return {*} The capability value. - */ - getCapability(key: string): any; - - /** - * Returns the JSON representation of this object, which is just the string - * session ID. - * @return {string} The JSON representation of this Session. - */ - toJSON(): string; - - //endregion + wait(condition: Promise | Function, opt_timeout?: number, opt_message?: string): Promise; } } -export = webdriver; +export namespace until { + /** + * Defines a condition to + */ + class Condition { + /** + * @param {string} message A descriptive error message. Should complete the + * sentence 'Waiting [...]' + * @param {function(!WebDriver): OUT} fn The condition function to + * evaluate on each iteration of the wait loop. + * @constructor + */ + constructor(message: string, fn: (webdriver: WebDriver) => any); + + /** @return {string} A description of this condition. */ + description(): string; + + /** @type {function(!WebDriver): OUT} */ + fn(webdriver: WebDriver): any; + } + + /** + * Creates a condition that will wait until the input driver is able to switch + * to the designated frame. The target frame may be specified as + * + * 1. a numeric index into + * [window.frames](https://developer.mozilla.org/en-US/docs/Web/API/Window.frames) + * for the currently selected frame. + * 2. a {@link ./WebElement}, which must reference a FRAME or IFRAME + * element on the current page. + * 3. a locator which may be used to first locate a FRAME or IFRAME on the + * current page before attempting to switch to it. + * + * Upon successful resolution of this condition, the driver will be left + * focused on the new frame. + * + * @param {!(number|./WebElement|By| + * function(!./WebDriver): !./WebElement)} frame + * The frame identifier. + * @return {!Condition} A new condition. + */ + function ableToSwitchToFrame(frame: number | WebElement | By | ((webdriver: WebDriver) => WebElement)): Condition; + + /** + * Creates a condition that waits for an alert to be opened. Upon success, the + * returned promise will be fulfilled with the handle for the opened alert. + * + * @return {!Condition} The new condition. + */ + function alertIsPresent(): Condition; + + /** + * Creates a condition that will wait for the given element to be disabled. + * + * @param {!WebElement} element The element to test. + * @return {!until.Condition.} The new condition. + * @see WebDriver#isEnabled + */ + function elementIsDisabled(element: WebElement): Condition; + + /** + * Creates a condition that will wait for the given element to be enabled. + * + * @param {!WebElement} element The element to test. + * @return {!until.Condition.} The new condition. + * @see WebDriver#isEnabled + */ + function elementIsEnabled(element: WebElement): Condition; + + /** + * Creates a condition that will wait for the given element to be deselected. + * + * @param {!WebElement} element The element to test. + * @return {!until.Condition.} The new condition. + * @see WebDriver#isSelected + */ + function elementIsNotSelected(element: WebElement): Condition; + + /** + * Creates a condition that will wait for the given element to be in the DOM, + * yet not visible to the user. + * + * @param {!WebElement} element The element to test. + * @return {!until.Condition.} The new condition. + * @see WebDriver#isDisplayed + */ + function elementIsNotVisible(element: WebElement): Condition; + + /** + * Creates a condition that will wait for the given element to be selected. + * @param {!WebElement} element The element to test. + * @return {!until.Condition.} The new condition. + * @see WebDriver#isSelected + */ + function elementIsSelected(element: WebElement): Condition; + + /** + * Creates a condition that will wait for the given element to become visible. + * + * @param {!WebElement} element The element to test. + * @return {!until.Condition.} The new condition. + * @see WebDriver#isDisplayed + */ + function elementIsVisible(element: WebElement): Condition; + + /** + * Creates a condition that will loop until an element is + * {@link ./WebDriver#findElement found} with the given locator. + * + * @param {!(By|Function)} locator The locator to use. + * @return {!until.Condition.} The new condition. + */ + function elementLocated(locator: By | Function): Condition; + + /** + * Creates a condition that will wait for the given element's + * {@link WebDriver#getText visible text} to contain the given + * substring. + * + * @param {!WebElement} element The element to test. + * @param {string} substr The substring to search for. + * @return {!until.Condition.} The new condition. + * @see WebDriver#getText + */ + function elementTextContains(element: WebElement, substr: string): Condition; + + /** + * Creates a condition that will wait for the given element's + * {@link WebDriver#getText visible text} to match the given + * {@code text} exactly. + * + * @param {!WebElement} element The element to test. + * @param {string} text The expected text. + * @return {!until.Condition.} The new condition. + * @see WebDriver#getText + */ + function elementTextIs(element: WebElement, text: string): Condition; + + /** + * Creates a condition that will wait for the given element's + * {@link WebDriver#getText visible text} to match a regular + * expression. + * + * @param {!WebElement} element The element to test. + * @param {!RegExp} regex The regular expression to test against. + * @return {!until.Condition} The new condition. + * @see WebDriver#getText + */ + function elementTextMatches(element: WebElement, regex: RegExp): Condition; + + /** + * Creates a condition that will loop until at least one element is + * {@link WebDriver#findElement found} with the given locator. + * + * @param {!(Locator|By.Hash|Function)} locator The locator + * to use. + * @return {!until.Condition.>} The new + * condition. + */ + function elementsLocated(locator: By | Function): Condition; + + /** + * Creates a condition that will wait for the given element to become stale. An + * element is considered stale once it is removed from the DOM, or a new page + * has loaded. + * + * @param {!WebElement} element The element that should become stale. + * @return {!until.Condition} The new condition. + */ + function stalenessOf(element: WebElement): Condition; + + /** + * Creates a condition that will wait for the current page's title to contain + * the given substring. + * + * @param {string} substr The substring that should be present in the page + * title. + * @return {!until.Condition.} The new condition. + */ + function titleContains(substr: string): Condition; + + /** + * Creates a condition that will wait for the current page's title to match the + * given value. + * + * @param {string} title The expected page title. + * @return {!until.Condition} The new condition. + */ + function titleIs(title: string): Condition; + + /** + * Creates a condition that will wait for the current page's title to match the + * given regular expression. + * + * @param {!RegExp} regex The regular expression to test against. + * @return {!until.Condition.} The new condition. + */ + function titleMatches(regex: RegExp): Condition; +} + +interface ILocation { + x: number; + y: number; +} + +interface ISize { + width: number; + height: number; +} + +interface IButton { + LEFT: string; + MIDDLE: string; + RIGHT: string; +} + +/** + * Representations of pressable keys that aren't text. These are stored in + * the Unicode PUA (Private Use Area) code points, 0xE000-0xF8FF. Refer to + * http://www.google.com.au/search?&q=unicode+pua&btnG=Search + * + * @enum {string} + */ +export var Button: IButton; + +interface IKey { + NULL: string; + CANCEL: string; // ^break + HELP: string; + BACK_SPACE: string; + TAB: string; + CLEAR: string; + RETURN: string; + ENTER: string; + SHIFT: string; + CONTROL: string; + ALT: string; + PAUSE: string; + ESCAPE: string; + SPACE: string; + PAGE_UP: string; + PAGE_DOWN: string; + END: string; + HOME: string; + ARROW_LEFT: string; + LEFT: string; + ARROW_UP: string; + UP: string; + ARROW_RIGHT: string; + RIGHT: string; + ARROW_DOWN: string; + DOWN: string; + INSERT: string; + DELETE: string; + SEMICOLON: string; + EQUALS: string; + + NUMPAD0: string; // number pad keys + NUMPAD1: string; + NUMPAD2: string; + NUMPAD3: string; + NUMPAD4: string; + NUMPAD5: string; + NUMPAD6: string; + NUMPAD7: string; + NUMPAD8: string; + NUMPAD9: string; + MULTIPLY: string; + ADD: string; + SEPARATOR: string; + SUBTRACT: string; + DECIMAL: string; + DIVIDE: string; + + F1: string; // function keys + F2: string; + F3: string; + F4: string; + F5: string; + F6: string; + F7: string; + F8: string; + F9: string; + F10: string; + F11: string; + F12: string; + + COMMAND: string; // Apple command key + META: string; // alias for Windows key + + /** + * Simulate pressing many keys at once in a 'chord'. Takes a sequence of + * keys or strings, appends each of the values to a string, + * and adds the chord termination key ({@link Key.NULL}) and returns + * the resulting string. + * + * Note: when the low-level webdriver key handlers see Keys.NULL, active + * modifier keys (CTRL/ALT/SHIFT/etc) release via a keyup event. + * + * @param {...string} var_args The key sequence to concatenate. + * @return {string} The null-terminated key sequence. + */ + chord: (...var_args: Array) => string; +} + +/** + * Representations of pressable keys that aren't text. These are stored in + * the Unicode PUA (Private Use Area) code points, 0xE000-0xF8FF. Refer to + * http://www.google.com.au/search?&q=unicode+pua&btnG=Search + * + * @enum {string} + */ +export var Key: IKey; + +/** + * Class for defining sequences of complex user interactions. Each sequence + * will not be executed until {@link #perform} is called. + * + * Example: + * + * new ActionSequence(driver). + * keyDown(Key.SHIFT). + * click(element1). + * click(element2). + * dragAndDrop(element3, element4). + * keyUp(Key.SHIFT). + * perform(); + * + */ +export class ActionSequence { + + // region Constructors + + /** + * @param {!WebDriver} driver The driver instance to use. + * @constructor + */ + constructor(driver: WebDriver); + + // endregion + + // region Methods + + /** + * Executes this action sequence. + * @return {!promise.Promise} A promise that will be resolved once + * this sequence has completed. + */ + perform(): promise.Promise; + + /** + * Moves the mouse. The location to move to may be specified in terms of the + * mouse's current location, an offset relative to the top-left corner of an + * element, or an element (in which case the middle of the element is used). + * + * @param {(!./WebElement|{x: number, y: number})} location The + * location to drag to, as either another WebElement or an offset in + * pixels. + * @param {{x: number, y: number}=} opt_offset If the target {@code location} + * is defined as a {@link ./WebElement}, this parameter defines + * an offset within that element. The offset should be specified in pixels + * relative to the top-left corner of the element's bounding box. If + * omitted, the element's center will be used as the target offset. + * @return {!ActionSequence} A self reference. + */ + mouseMove(location: WebElement | ILocation, opt_offset?: ILocation): ActionSequence; + + /** + * Presses a mouse button. The mouse button will not be released until + * {@link #mouseUp} is called, regardless of whether that call is made in this + * sequence or another. The behavior for out-of-order events (e.g. mouseDown, + * click) is undefined. + * + * If an element is provided, the mouse will first be moved to the center + * of that element. This is equivalent to: + * + * sequence.mouseMove(element).mouseDown() + * + * Warning: this method currently only supports the left mouse button. See + * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047). + * + * @param {(./WebElement|input.Button)=} opt_elementOrButton Either + * the element to interact with or the button to click with. + * Defaults to {@link input.Button.LEFT} if neither an element nor + * button is specified. + * @param {input.Button=} opt_button The button to use. Defaults to + * {@link input.Button.LEFT}. Ignored if a button is provided as the + * first argument. + * @return {!ActionSequence} A self reference. + */ + mouseDown(opt_elementOrButton?: WebElement | string, opt_button?: string): ActionSequence; + + /** + * Releases a mouse button. Behavior is undefined for calling this function + * without a previous call to {@link #mouseDown}. + * + * If an element is provided, the mouse will first be moved to the center + * of that element. This is equivalent to: + * + * sequence.mouseMove(element).mouseUp() + * + * Warning: this method currently only supports the left mouse button. See + * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047). + * + * @param {(./WebElement|input.Button)=} opt_elementOrButton Either + * the element to interact with or the button to click with. + * Defaults to {@link input.Button.LEFT} if neither an element nor + * button is specified. + * @param {input.Button=} opt_button The button to use. Defaults to + * {@link input.Button.LEFT}. Ignored if a button is provided as the + * first argument. + * @return {!ActionSequence} A self reference. + */ + mouseUp(opt_elementOrButton?: WebElement | string, opt_button?: string): ActionSequence; + + /** + * Convenience function for performing a 'drag and drop' manuever. The target + * element may be moved to the location of another element, or by an offset (in + * pixels). + * + * @param {!./WebElement} element The element to drag. + * @param {(!./WebElement|{x: number, y: number})} location The + * location to drag to, either as another WebElement or an offset in + * pixels. + * @return {!ActionSequence} A self reference. + */ + dragAndDrop(element: WebElement, location: WebElement | ILocation): ActionSequence; + + /** + * Clicks a mouse button. + * + * If an element is provided, the mouse will first be moved to the center + * of that element. This is equivalent to: + * + * sequence.mouseMove(element).click() + * + * @param {(./WebElement|input.Button)=} opt_elementOrButton Either + * the element to interact with or the button to click with. + * Defaults to {@link input.Button.LEFT} if neither an element nor + * button is specified. + * @param {input.Button=} opt_button The button to use. Defaults to + * {@link input.Button.LEFT}. Ignored if a button is provided as the + * first argument. + * @return {!ActionSequence} A self reference. + */ + click(opt_elementOrButton?: WebElement | string, opt_button?: string): ActionSequence; + + /** + * Double-clicks a mouse button. + * + * If an element is provided, the mouse will first be moved to the center of + * that element. This is equivalent to: + * + * sequence.mouseMove(element).doubleClick() + * + * Warning: this method currently only supports the left mouse button. See + * [issue 4047](http://code.google.com/p/selenium/issues/detail?id=4047). + * + * @param {(./WebElement|input.Button)=} opt_elementOrButton Either + * the element to interact with or the button to click with. + * Defaults to {@link input.Button.LEFT} if neither an element nor + * button is specified. + * @param {input.Button=} opt_button The button to use. Defaults to + * {@link input.Button.LEFT}. Ignored if a button is provided as the + * first argument. + * @return {!ActionSequence} A self reference. + */ + doubleClick(opt_elementOrButton?: WebElement | string, opt_button?: string): ActionSequence; + + /** + * Performs a modifier key press. The modifier key is not released + * until {@link #keyUp} or {@link #sendKeys} is called. The key press will be + * targetted at the currently focused element. + * @param {!Key} key The modifier key to push. Must be one of + * {ALT, CONTROL, SHIFT, COMMAND, META}. + * @return {!ActionSequence} A self reference. + * @throws {Error} If the key is not a valid modifier key. + */ + keyDown(key: string): ActionSequence; + + /** + * Performs a modifier key release. The release is targetted at the currently + * focused element. + * @param {!Key} key The modifier key to release. Must be one of + * {ALT, CONTROL, SHIFT, COMMAND, META}. + * @return {!ActionSequence} A self reference. + * @throws {Error} If the key is not a valid modifier key. + */ + keyUp(key: string): ActionSequence; + + /** + * Simulates typing multiple keys. Each modifier key encountered in the + * sequence will not be released until it is encountered again. All key events + * will be targeted at the currently focused element. + * + * @param {...(string|!input.Key|!Array<(string|!input.Key)>)} var_args + * The keys to type. + * @return {!ActionSequence} A self reference. + * @throws {Error} If the key is not a valid modifier key. + */ + sendKeys(...var_args: Array>): ActionSequence; + + // endregion +} + + +/** + * Class for defining sequences of user touch interactions. Each sequence + * will not be executed until {@link #perform} is called. + * + * Example: + * + * new TouchSequence(driver). + * tapAndHold({x: 0, y: 0}). + * move({x: 3, y: 4}). + * release({x: 10, y: 10}). + * perform(); + */ +export class TouchSequence { + /* + * @param {!WebDriver} driver The driver instance to use. + * @constructor + */ + constructor(driver: WebDriver); + + + /** + * Executes this action sequence. + * @return {!promise.Promise} A promise that will be resolved once + * this sequence has completed. + */ + perform(): promise.Promise; + + + /** + * Taps an element. + * + * @param {!WebElement} elem The element to tap. + * @return {!TouchSequence} A self reference. + */ + tap(elem: WebElement): TouchSequence; + + + /** + * Double taps an element. + * + * @param {!WebElement} elem The element to double tap. + * @return {!TouchSequence} A self reference. + */ + doubleTap(elem: WebElement): TouchSequence; + + + /** + * Long press on an element. + * + * @param {!WebElement} elem The element to long press. + * @return {!TouchSequence} A self reference. + */ + longPress(elem: WebElement): TouchSequence; + + + /** + * Touch down at the given location. + * + * @param {{ x: number, y: number }} location The location to touch down at. + * @return {!TouchSequence} A self reference. + */ + tapAndHold(location: ILocation): TouchSequence; + + + /** + * Move a held {@linkplain #tapAndHold touch} to the specified location. + * + * @param {{x: number, y: number}} location The location to move to. + * @return {!TouchSequence} A self reference. + */ + move(location: ILocation): TouchSequence; + + + /** + * Release a held {@linkplain #tapAndHold touch} at the specified location. + * + * @param {{x: number, y: number}} location The location to release at. + * @return {!TouchSequence} A self reference. + */ + release(location: ILocation): TouchSequence; + + + /** + * Scrolls the touch screen by the given offset. + * + * @param {{x: number, y: number}} offset The offset to scroll to. + * @return {!TouchSequence} A self reference. + */ + scroll(offset: IOffset): TouchSequence; + + /** + * Scrolls the touch screen, starting on `elem` and moving by the specified + * offset. + * + * @param {!WebElement} elem The element where scroll starts. + * @param {{x: number, y: number}} offset The offset to scroll to. + * @return {!TouchSequence} A self reference. + */ + scrollFromElement(elem: WebElement, offset: IOffset): TouchSequence; + + /** + * Flick, starting anywhere on the screen, at speed xspeed and yspeed. + * + * @param {{xspeed: number, yspeed: number}} speed The speed to flick in each + direction, in pixels per second. + * @return {!TouchSequence} A self reference. + */ + flick(speed: ISpeed): TouchSequence; + + /** + * Flick starting at elem and moving by x and y at specified speed. + * + * @param {!WebElement} elem The element where flick starts. + * @param {{x: number, y: number}} offset The offset to flick to. + * @param {number} speed The speed to flick at in pixels per second. + * @return {!TouchSequence} A self reference. + */ + flickElement(elem: WebElement, offset: IOffset, speed: number): TouchSequence; +} + +interface IOffset { + x: number; + y: number; +} + +interface ISpeed { + xspeed: number; + yspeed: number; +} + +/** + * Represents a modal dialog such as {@code alert}, {@code confirm}, or + * {@code prompt}. Provides functions to retrieve the message displayed with + * the alert, accept or dismiss the alert, and set the response text (in the + * case of {@code prompt}). + */ +export class Alert { + /** + * @param {!WebDriver} driver The driver controlling the browser this alert + * is attached to. + * @param {string} text The message text displayed with this alert. + */ + constructor(driver: WebDriver, text: string); + + // region Methods + + /** + * Retrieves the message text displayed with this alert. For instance, if the + * alert were opened with alert('hello'), then this would return 'hello'. + * @return {!promise.Promise} A promise that will be resolved to the + * text displayed with this alert. + */ + getText(): promise.Promise; + + /** + * Sets the username and password in an alert prompting for credentials (such + * as a Basic HTTP Auth prompt). This method will implicitly + * {@linkplain #accept() submit} the dialog. + * + * @param {string} username The username to send. + * @param {string} password The password to send. + * @return {!promise.Promise} A promise that will be resolved when this + * command has completed. + */ + authenticateAs(username: string, password: string): promise.Promise; + + /** + * Accepts this alert. + * @return {!promise.Promise} A promise that will be resolved when + * this command has completed. + */ + accept(): promise.Promise; + + /** + * Dismisses this alert. + * @return {!promise.Promise} A promise that will be resolved when + * this command has completed. + */ + dismiss(): promise.Promise; + + /** + * Sets the response text on this alert. This command will return an error if + * the underlying alert does not support response text (e.g. window.alert and + * window.confirm). + * @param {string} text The text to set. + * @return {!promise.Promise} A promise that will be resolved when + * this command has completed. + */ + sendKeys(text: string): promise.Promise; + + // endregion + +} + +/** + * AlertPromise is a promise that will be fulfilled with an Alert. This promise + * serves as a forward proxy on an Alert, allowing calls to be scheduled + * directly on this instance before the underlying Alert has been fulfilled. In + * other words, the following two statements are equivalent: + * + * driver.switchTo().alert().dismiss(); + * driver.switchTo().alert().then(function(alert) { + * return alert.dismiss(); + * }); + * + * @implements {promise.Thenable.} + * @final + */ +export class AlertPromise extends Alert implements promise.IThenable { + /** + * @param {!WebDriver} driver The driver controlling the browser this + * alert is attached to. + * @param {!promise.Thenable} alert A thenable + * that will be fulfilled with the promised alert. + */ + constructor(driver: WebDriver, alert: promise.Promise); + + // region Methods + + /** + * Cancels the computation of this promise's value, rejecting the promise in the + * process. + * @param {*} reason The reason this promise is being cancelled. If not an + * {@code Error}, one will be created using the value's string + * representation. + */ + cancel(opt_reason?: string | Error): void; + + /** @return {boolean} Whether this promise's value is still being computed. */ + isPending(): boolean; + + /** + * Registers listeners for when this instance is resolved. This function most + * overridden by subtypes. + * + * @param opt_callback The function to call if this promise is + * successfully resolved. The function should expect a single argument: the + * promise's resolved value. + * @param opt_errback The function to call if this promise is + * rejected. The function should expect a single argument: the rejection + * reason. + * @return A new promise which will be resolved + * with the result of the invoked callback. + */ + then(opt_callback?: Function, opt_errback?: Function): promise.Promise; + + /** + * Registers a listener for when this promise is rejected. This is synonymous + * with the {@code catch} clause in a synchronous API: + *
    
    +   *   // Synchronous API:
    +   *   try {
    +   *     doSynchronousWork();
    +   *   } catch (ex) {
    +   *     console.error(ex);
    +   *   }
    +   *
    +   *   // Asynchronous promise API:
    +   *   doAsynchronousWork().thenCatch(function(ex) {
    +   *     console.error(ex);
    +   *   });
    +   * 
    + * + * @param {function(*): (R|promise.Promise.)} errback The function + * to call if this promise is rejected. The function should expect a single + * argument: the rejection reason. + * @return {!promise.Promise.} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + thenCatch(errback: (error: any) => any): promise.Promise; + + /** + * Registers a listener for when this promise is rejected. This is synonymous + * with the {@code catch} clause in a synchronous API: + * + * // Synchronous API: + * try { + * doSynchronousWork(); + * } catch (ex) { + * console.error(ex); + * } + * + * // Asynchronous promise API: + * doAsynchronousWork().catch(function(ex) { + * console.error(ex); + * }); + * + * @param {function(*): (R|IThenable)} errback The + * function to call if this promise is rejected. The function should + * expect a single argument: the rejection reason. + * @return {!ManagedPromise} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + catch(errback: Function): promise.Promise; + + + /** + * Registers a listener to invoke when this promise is resolved, regardless + * of whether the promise's value was successfully computed. This function + * is synonymous with the {@code finally} clause in a synchronous API: + *
    
    +   *   // Synchronous API:
    +   *   try {
    +   *     doSynchronousWork();
    +   *   } finally {
    +   *     cleanUp();
    +   *   }
    +   *
    +   *   // Asynchronous promise API:
    +   *   doAsynchronousWork().thenFinally(cleanUp);
    +   * 
    + * + * Note: similar to the {@code finally} clause, if the registered + * callback returns a rejected promise or throws an error, it will silently + * replace the rejection error (if any) from this promise: + *
    
    +   *   try {
    +   *     throw Error('one');
    +   *   } finally {
    +   *     throw Error('two');  // Hides Error: one
    +   *   }
    +   *
    +   *   promise.rejected(Error('one'))
    +   *       .thenFinally(function() {
    +   *         throw Error('two');  // Hides Error: one
    +   *       });
    +   * 
    + * + * + * @param {function(): (R|promise.Promise.)} callback The function + * to call when this promise is resolved. + * @return {!promise.Promise.} A promise that will be fulfilled + * with the callback result. + * @template R + */ + thenFinally(callback: Function): promise.Promise; +} + +/** @deprecated Use {@link error.UnexpectedAlertOpenError} instead. */ +export class UnhandledAlertError extends error.UnexpectedAlertOpenError { +} + +/** + * Recognized browser names. + * @enum {string} + */ +interface IBrowser { + ANDROID: string; + CHROME: string; + EDGE: string; + FIREFOX: string; + IE: string; + INTERNET_EXPLORER: string; + IPAD: string; + IPHONE: string; + OPERA: string; + PHANTOM_JS: string; + SAFARI: string; + HTMLUNIT: string; +} + +export var Browser: IBrowser; + +interface ProxyConfig { + proxyType: string; + proxyAutoconfigUrl?: string; + ftpProxy?: string; + httpProxy?: string; + sslProxy?: string; + noProxy?: string; +} + +/** + * Creates new {@link WebDriver WebDriver} instances. The environment + * variables listed below may be used to override a builder's configuration, + * allowing quick runtime changes. + * + * - {@code SELENIUM_BROWSER}: defines the target browser in the form + * {@code browser[:version][:platform]}. + * + * - {@code SELENIUM_REMOTE_URL}: defines the remote URL for all builder + * instances. This environment variable should be set to a fully qualified + * URL for a WebDriver server (e.g. http://localhost:4444/wd/hub). This + * option always takes precedence over {@code SELENIUM_SERVER_JAR}. + * + * - {@code SELENIUM_SERVER_JAR}: defines the path to the + * + * standalone Selenium server jar to use. The server will be started the + * first time a WebDriver instance and be killed when the process exits. + * + * Suppose you had mytest.js that created WebDriver with + * + * var driver = new Builder() + * .forBrowser('chrome') + * .build(); + * + * This test could be made to use Firefox on the local machine by running with + * `SELENIUM_BROWSER=firefox node mytest.js`. Rather than change the code to + * target Google Chrome on a remote machine, you can simply set the + * `SELENIUM_BROWSER` and `SELENIUM_REMOTE_URL` environment variables: + * + * SELENIUM_BROWSER=chrome:36:LINUX \ + * SELENIUM_REMOTE_URL=http://www.example.com:4444/wd/hub \ + * node mytest.js + * + * You could also use a local copy of the standalone Selenium server: + * + * SELENIUM_BROWSER=chrome:36:LINUX \ + * SELENIUM_SERVER_JAR=/path/to/selenium-server-standalone.jar \ + * node mytest.js + */ +export class Builder { + + // region Constructors + + /** + * @constructor + */ + constructor(); + + // endregion + + // region Methods + + /** + * Configures this builder to ignore any environment variable overrides and to + * only use the configuration specified through this instance's API. + * + * @return {!Builder} A self reference. + */ + disableEnvironmentOverrides(): Builder; + + /** + * Creates a new WebDriver client based on this builder's current + * configuration. + * + * While this method will immediately return a new WebDriver instance, any + * commands issued against it will be deferred until the associated browser + * has been fully initialized. Users may call {@link #buildAsync()} to obtain + * a promise that will not be fulfilled until the browser has been created + * (the difference is purely in style). + * + * @return {!WebDriver} A new WebDriver instance. + * @throws {Error} If the current configuration is invalid. + * @see #buildAsync() + */ + build(): WebDriver; + + /** + * Creates a new WebDriver client based on this builder's current + * configuration. This method returns a promise that will not be fulfilled + * until the new browser session has been fully initialized. + * + * __Note:__ this method is purely a convenience wrapper around + * {@link #build()}. + * + * @return {!promise.Promise} A promise that will be + * fulfilled with the newly created WebDriver instance once the browser + * has been fully initialized. + * @see #build() + */ + buildAsync(): promise.Promise; + + /** + * Configures the target browser for clients created by this instance. + * Any calls to {@link #withCapabilities} after this function will + * overwrite these settings. + * + *

    You may also define the target browser using the {@code SELENIUM_BROWSER} + * environment variable. If set, this environment variable should be of the + * form {@code browser[:[version][:platform]]}. + * + * @param {(string|Browser)} name The name of the target browser; + * common defaults are available on the {@link Browser} enum. + * @param {string=} opt_version A desired version; may be omitted if any + * version should be used. + * @param {string=} opt_platform The desired platform; may be omitted if any + * version may be used. + * @return {!Builder} A self reference. + */ + forBrowser(name: string, opt_version?: string, opt_platform?: string): Builder; + + /** + * Returns the base set of capabilities this instance is currently configured + * to use. + * @return {!Capabilities} The current capabilities for this builder. + */ + getCapabilities(): Capabilities; + + /** + * @return {string} The URL of the WebDriver server this instance is configured + * to use. + */ + getServerUrl(): string; + + /** + * @return {?string} The URL of the proxy server to use for the WebDriver's + * HTTP connections, or `null` if not set. + */ + getWebDriverProxy(): string; + + /** + * Sets the default action to take with an unexpected alert before returning + * an error. + * @param {string} beahvior The desired behavior; should be 'accept', 'dismiss', + * or 'ignore'. Defaults to 'dismiss'. + * @return {!Builder} A self reference. + */ + setAlertBehavior(behavior: string): Builder; + + /** + * Sets Chrome-specific options for drivers created by this builder. Any + * logging or proxy settings defined on the given options will take precedence + * over those set through {@link #setLoggingPrefs} and {@link #setProxy}, + * respectively. + * + * @param {!chrome.Options} options The ChromeDriver options to use. + * @return {!Builder} A self reference. + */ + setChromeOptions(options: chrome.Options): Builder; + + /** + * Sets the control flow that created drivers should execute actions in. If + * the flow is never set, or is set to {@code null}, it will use the active + * flow at the time {@link #build()} is called. + * @param {promise.ControlFlow} flow The control flow to use, or + * {@code null} to + * @return {!Builder} A self reference. + */ + setControlFlow(flow: promise.ControlFlow): Builder; + + /** + * Set {@linkplain edge.Options options} specific to Microsoft's Edge browser + * for drivers created by this builder. Any proxy settings defined on the + * given options will take precedence over those set through + * {@link #setProxy}. + * + * @param {!edge.Options} options The MicrosoftEdgeDriver options to use. + * @return {!Builder} A self reference. + */ + setEdgeOptions(options: edge.Options): Builder; + + /** + * Sets whether native events should be used. + * @param {boolean} enabled Whether to enable native events. + * @return {!Builder} A self reference. + */ + setEnableNativeEvents(enabled: boolean): Builder; + + /** + * Sets Firefox-specific options for drivers created by this builder. Any + * logging or proxy settings defined on the given options will take precedence + * over those set through {@link #setLoggingPrefs} and {@link #setProxy}, + * respectively. + * + * @param {!firefox.Options} options The FirefoxDriver options to use. + * @return {!Builder} A self reference. + */ + setFirefoxOptions(options: firefox.Options): Builder; + + /** + * Set Internet Explorer specific {@linkplain ie.Options options} for drivers + * created by this builder. Any proxy settings defined on the given options + * will take precedence over those set through {@link #setProxy}. + * + * @param {!ie.Options} options The IEDriver options to use. + * @return {!Builder} A self reference. + */ + setIeOptions(options: ie.Options): Builder; + + /** + * Sets the logging preferences for the created session. Preferences may be + * changed by repeated calls, or by calling {@link #withCapabilities}. + * @param {!(logging.Preferences|Object.)} prefs The + * desired logging preferences. + * @return {!Builder} A self reference. + */ + setLoggingPrefs(prefs: logging.Preferences | Object): Builder; + + /** + * Sets Opera specific {@linkplain opera.Options options} for drivers created + * by this builder. Any logging or proxy settings defined on the given options + * will take precedence over those set through {@link #setLoggingPrefs} and + * {@link #setProxy}, respectively. + * + * @param {!opera.Options} options The OperaDriver options to use. + * @return {!Builder} A self reference. + */ + setOperaOptions(options: opera.Options): Builder; + + /** + * Sets the proxy configuration to use for WebDriver clients created by this + * builder. Any calls to {@link #withCapabilities} after this function will + * overwrite these settings. + * @param {!capabilities.ProxyConfig} config The configuration to use. + * @return {!Builder} A self reference. + */ + setProxy(config: ProxyConfig): Builder; + + /** + * Sets Safari specific {@linkplain safari.Options options} for drivers + * created by this builder. Any logging settings defined on the given options + * will take precedence over those set through {@link #setLoggingPrefs}. + * + * @param {!safari.Options} options The Safari options to use. + * @return {!Builder} A self reference. + */ + setSafari(options: safari.Options): Builder; + + /** + * Sets how elements should be scrolled into view for interaction. + * @param {number} behavior The desired scroll behavior: either 0 to align with + * the top of the viewport or 1 to align with the bottom. + * @return {!Builder} A self reference. + */ + setScrollBehavior(behavior: number): Builder; + + /** + * Sets the URL of a remote WebDriver server to use. Once a remote URL has been + * specified, the builder direct all new clients to that server. If this method + * is never called, the Builder will attempt to create all clients locally. + * + *

    As an alternative to this method, you may also set the + * {@code SELENIUM_REMOTE_URL} environment variable. + * + * @param {string} url The URL of a remote server to use. + * @return {!Builder} A self reference. + */ + usingServer(url: string): Builder; + + /** + * Sets the URL of the proxy to use for the WebDriver's HTTP connections. + * If this method is never called, the Builder will create a connection + * without a proxy. + * + * @param {string} proxy The URL of a proxy to use. + * @return {!Builder} A self reference. + */ + usingWebDriverProxy(proxy: string): Builder; + + /** + * Sets the desired capabilities when requesting a new session. This will + * overwrite any previously set capabilities. + * @param {!(Object|Capabilities)} capabilities The desired + * capabilities for a new session. + * @return {!Builder} A self reference. + */ + withCapabilities(capabilities: Object | Capabilities): Builder; + + // endregion +} + +/** + * Describes a mechanism for locating an element on the page. + * @final + */ +export class By { + + /** + * @param {string} using the name of the location strategy to use. + * @param {string} value the value to search for. + */ + constructor(using: string, value: string); + + /** + * Locates elements that have a specific class name. + * + * @param {string} name The class name to search for. + * @return {!By} The new locator. + * @see http://www.w3.org/TR/2011/WD-html5-20110525/elements.html#classes + * @see http://www.w3.org/TR/CSS2/selector.html#class-html + */ + static className(name: string): By; + + /** + * Locates elements using a CSS selector. + * + * @param {string} selector The CSS selector to use. + * @return {!By} The new locator. + * @see http://www.w3.org/TR/CSS2/selector.html + */ + static css(selector: string): By; + + /** + * Locates eleemnts by the ID attribute. This locator uses the CSS selector + * `*[id='$ID']`, _not_ `document.getElementById`. + * + * @param {string} id The ID to search for. + * @return {!By} The new locator. + */ + static id(id: string): By; + + /** + * Locates link elements whose + * {@linkplain WebElement#getText visible text} matches the given + * string. + * + * @param {string} text The link text to search for. + * @return {!By} The new locator. + */ + static linkText(text: string): By; + + /** + * Locates an elements by evaluating a + * {@linkplain WebDriver#executeScript JavaScript expression}. + * The result of this expression must be an element or list of elements. + * + * @param {!(string|Function)} script The script to execute. + * @param {...*} var_args The arguments to pass to the script. + * @return {function(!./WebDriver): !./promise.Promise} + * A new JavaScript-based locator function. + */ + static js(script: string | Function, ...var_args: any[]): (webdriver: WebDriver) => promise.Promise; + + /** + * Locates elements whose `name` attribute has the given value. + * + * @param {string} name The name attribute to search for. + * @return {!By} The new locator. + */ + static name(name: string): By; + + /** + * Locates link elements whose + * {@linkplain WebElement#getText visible text} contains the given + * substring. + * + * @param {string} text The substring to check for in a link's visible text. + * @return {!By} The new locator. + */ + static partialLinkText(text: string): By; + + /** + * Locates elements with a given tag name. + * + * @param {string} name The tag name to search for. + * @return {!By} The new locator. + * @deprecated Use {@link By.css() By.css(tagName)} instead. + */ + static tagName(name: string): By; + + /** + * Locates elements matching a XPath selector. Care should be taken when + * using an XPath selector with a {@link WebElement} as WebDriver + * will respect the context in the specified in the selector. For example, + * given the selector `//div`, WebDriver will search from the document root + * regardless of whether the locator was used with a WebElement. + * + * @param {string} xpath The XPath selector to use. + * @return {!By} The new locator. + * @see http://www.w3.org/TR/xpath/ + */ + static xpath(xpath: string): By; + + /** @override */ + toString(): string; +} + +/** + * Short-hand expressions for the primary element locator strategies. + * For example the following two statements are equivalent: + * + * var e1 = driver.findElement(By.id('foo')); + * var e2 = driver.findElement({id: 'foo'}); + * + * Care should be taken when using JavaScript minifiers (such as the + * Closure compiler), as locator hashes will always be parsed using + * the un-obfuscated properties listed. + * + * @typedef {( + * {className: string}| + * {css: string}| + * {id: string}| + * {js: string}| + * {linkText: string}| + * {name: string}| + * {partialLinkText: string}| + * {tagName: string}| + * {xpath: string})} + */ +type ByHash = { className: string } | + { css: string } | + { id: string } | + { js: string } | + { linkText: string } | + { name: string } | + { partialLinkText: string } | + { tagName: string } | + { xpath: string }; + +/** + * Common webdriver capability keys. + * @enum {string} + */ +interface ICapability { + + /** + * Indicates whether a driver should accept all SSL certs by default. This + * capability only applies when requesting a new session. To query whether + * a driver can handle insecure SSL certs, see + * {@link Capability.SECURE_SSL}. + */ + ACCEPT_SSL_CERTS: string; + + + /** + * The browser name. Common browser names are defined in the + * {@link Browser} enum. + */ + BROWSER_NAME: string; + + /** + * Defines how elements should be scrolled into the viewport for interaction. + * This capability will be set to zero (0) if elements are aligned with the + * top of the viewport, or one (1) if aligned with the bottom. The default + * behavior is to align with the top of the viewport. + */ + ELEMENT_SCROLL_BEHAVIOR: string; + + /** + * Whether the driver is capable of handling modal alerts (e.g. alert, + * confirm, prompt). To define how a driver should handle alerts, + * use {@link Capability.UNEXPECTED_ALERT_BEHAVIOR}. + */ + HANDLES_ALERTS: string; + + /** + * Key for the logging driver logging preferences. + */ + LOGGING_PREFS: string; + + /** + * Whether this session generates native events when simulating user input. + */ + NATIVE_EVENTS: string; + + /** + * Describes the platform the browser is running on. Will be one of + * ANDROID, IOS, LINUX, MAC, UNIX, or WINDOWS. When requesting a + * session, ANY may be used to indicate no platform preference (this is + * semantically equivalent to omitting the platform capability). + */ + PLATFORM: string; + + /** + * Describes the proxy configuration to use for a new WebDriver session. + */ + PROXY: string; + + /** Whether the driver supports changing the brower's orientation. */ + ROTATABLE: string; + + /** + * Whether a driver is only capable of handling secure SSL certs. To request + * that a driver accept insecure SSL certs by default, use + * {@link Capability.ACCEPT_SSL_CERTS}. + */ + SECURE_SSL: string; + + /** Whether the driver supports manipulating the app cache. */ + SUPPORTS_APPLICATION_CACHE: string; + + /** Whether the driver supports locating elements with CSS selectors. */ + SUPPORTS_CSS_SELECTORS: string; + + /** Whether the browser supports JavaScript. */ + SUPPORTS_JAVASCRIPT: string; + + /** Whether the driver supports controlling the browser's location info. */ + SUPPORTS_LOCATION_CONTEXT: string; + + /** Whether the driver supports taking screenshots. */ + TAKES_SCREENSHOT: string; + + /** + * Defines how the driver should handle unexpected alerts. The value should + * be one of 'accept', 'dismiss', or 'ignore. + */ + UNEXPECTED_ALERT_BEHAVIOR: string; + + /** Defines the browser version. */ + VERSION: string; +} + +export var Capability: ICapability; + +export class Capabilities { + // region Constructors + + /** + * @param {(Capabilities|Object)=} opt_other Another set of + * capabilities to merge into this instance. + * @constructor + */ + constructor(opt_other?: Capabilities | Object); + + // endregion + + // region Methods + + /** @return {!Object} The JSON representation of this instance. */ + toJSON(): any; + + /** + * Merges another set of capabilities into this instance. Any duplicates in + * the provided set will override those already set on this instance. + * @param {!(Capabilities|Object)} other The capabilities to + * merge into this instance. + * @return {!Capabilities} A self reference. + */ + merge(other: Capabilities | Object): Capabilities; + + /** + * @param {string} key The capability to set. + * @param {*} value The capability value. Capability values must be JSON + * serializable. Pass {@code null} to unset the capability. + * @return {!Capabilities} A self reference. + */ + set(key: string, value: any): Capabilities; + + /** + * Sets the logging preferences. Preferences may be specified as a + * {@link logging.Preferences} instance, or a as a map of log-type to + * log-level. + * @param {!(logging.Preferences|Object.)} prefs The + * logging preferences. + * @return {!Capabilities} A self reference. + */ + setLoggingPrefs(prefs: logging.Preferences | Object): Capabilities; + + /** + * Sets the proxy configuration for this instance. + * @param {ProxyConfig} proxy The desired proxy configuration. + * @return {!Capabilities} A self reference. + */ + setProxy(proxy: ProxyConfig): Capabilities; + + + /** + * Sets whether native events should be used. + * @param {boolean} enabled Whether to enable native events. + * @return {!Capabilities} A self reference. + */ + setEnableNativeEvents(enabled: boolean): Capabilities; + + + /** + * Sets how elements should be scrolled into view for interaction. + * @param {number} behavior The desired scroll behavior: either 0 to align with + * the top of the viewport or 1 to align with the bottom. + * @return {!Capabilities} A self reference. + */ + setScrollBehavior(behavior: number): Capabilities; + + /** + * Sets the default action to take with an unexpected alert before returning + * an error. + * @param {string} behavior The desired behavior; should be 'accept', 'dismiss', + * or 'ignore'. Defaults to 'dismiss'. + * @return {!Capabilities} A self reference. + */ + setAlertBehavior(behavior: string): Capabilities; + + /** + * @param {string} key The capability to return. + * @return {*} The capability with the given key, or {@code null} if it has + * not been set. + */ + get(key: string): any; + + /** + * @param {string} key The capability to check. + * @return {boolean} Whether the specified capability is set. + */ + has(key: string): boolean; + + // endregion + + // region Static Methods + + /** + * @return {!Capabilities} A basic set of capabilities for Android. + */ + static android(): Capabilities; + + /** + * @return {!Capabilities} A basic set of capabilities for Chrome. + */ + static chrome(): Capabilities; + + /** + * @return {!Capabilities} A basic set of capabilities for Microsoft Edge. + */ + static edge(): Capabilities; + + /** + * @return {!Capabilities} A basic set of capabilities for Firefox. + */ + static firefox(): Capabilities; + + /** + * @return {!Capabilities} A basic set of capabilities for + * Internet Explorer. + */ + static ie(): Capabilities; + + /** + * @return {!Capabilities} A basic set of capabilities for iPad. + */ + static ipad(): Capabilities; + + /** + * @return {!Capabilities} A basic set of capabilities for iPhone. + */ + static iphone(): Capabilities; + + /** + * @return {!Capabilities} A basic set of capabilities for Opera. + */ + static opera(): Capabilities; + + /** + * @return {!Capabilities} A basic set of capabilities for + * PhantomJS. + */ + static phantomjs(): Capabilities; + + /** + * @return {!Capabilities} A basic set of capabilities for Safari. + */ + static safari(): Capabilities; + + /** + * @return {!Capabilities} A basic set of capabilities for HTMLUnit. + */ + static htmlunit(): Capabilities; + + /** + * @return {!Capabilities} A basic set of capabilities for HTMLUnit + * with enabled Javascript. + */ + static htmlunitwithjs(): Capabilities; + + // endregion +} + +/** + * An enumeration of valid command string. + */ +interface ICommandName { + GET_SERVER_STATUS: string; + + NEW_SESSION: string; + GET_SESSIONS: string; + DESCRIBE_SESSION: string; + + CLOSE: string; + QUIT: string; + + GET_CURRENT_URL: string; + GET: string; + GO_BACK: string; + GO_FORWARD: string; + REFRESH: string; + + ADD_COOKIE: string; + GET_COOKIE: string; + GET_ALL_COOKIES: string; + DELETE_COOKIE: string; + DELETE_ALL_COOKIES: string; + + GET_ACTIVE_ELEMENT: string; + FIND_ELEMENT: string; + FIND_ELEMENTS: string; + FIND_CHILD_ELEMENT: string; + FIND_CHILD_ELEMENTS: string; + + CLEAR_ELEMENT: string; + CLICK_ELEMENT: string; + SEND_KEYS_TO_ELEMENT: string; + SUBMIT_ELEMENT: string; + + GET_CURRENT_WINDOW_HANDLE: string; + GET_WINDOW_HANDLES: string; + GET_WINDOW_POSITION: string; + SET_WINDOW_POSITION: string; + GET_WINDOW_SIZE: string; + SET_WINDOW_SIZE: string; + MAXIMIZE_WINDOW: string; + + SWITCH_TO_WINDOW: string; + SWITCH_TO_FRAME: string; + GET_PAGE_SOURCE: string; + GET_TITLE: string; + + EXECUTE_SCRIPT: string; + EXECUTE_ASYNC_SCRIPT: string; + + GET_ELEMENT_TEXT: string; + GET_ELEMENT_TAG_NAME: string; + IS_ELEMENT_SELECTED: string; + IS_ELEMENT_ENABLED: string; + IS_ELEMENT_DISPLAYED: string; + GET_ELEMENT_LOCATION: string; + GET_ELEMENT_LOCATION_IN_VIEW: string; + GET_ELEMENT_SIZE: string; + GET_ELEMENT_ATTRIBUTE: string; + GET_ELEMENT_VALUE_OF_CSS_PROPERTY: string; + ELEMENT_EQUALS: string; + + SCREENSHOT: string; + IMPLICITLY_WAIT: string; + SET_SCRIPT_TIMEOUT: string; + SET_TIMEOUT: string; + + ACCEPT_ALERT: string; + DISMISS_ALERT: string; + GET_ALERT_TEXT: string; + SET_ALERT_TEXT: string; + + EXECUTE_SQL: string; + GET_LOCATION: string; + SET_LOCATION: string; + GET_APP_CACHE: string; + GET_APP_CACHE_STATUS: string; + CLEAR_APP_CACHE: string; + IS_BROWSER_ONLINE: string; + SET_BROWSER_ONLINE: string; + + GET_LOCAL_STORAGE_ITEM: string; + GET_LOCAL_STORAGE_KEYS: string; + SET_LOCAL_STORAGE_ITEM: string; + REMOVE_LOCAL_STORAGE_ITEM: string; + CLEAR_LOCAL_STORAGE: string; + GET_LOCAL_STORAGE_SIZE: string; + + GET_SESSION_STORAGE_ITEM: string; + GET_SESSION_STORAGE_KEYS: string; + SET_SESSION_STORAGE_ITEM: string; + REMOVE_SESSION_STORAGE_ITEM: string; + CLEAR_SESSION_STORAGE: string; + GET_SESSION_STORAGE_SIZE: string; + + SET_SCREEN_ORIENTATION: string; + GET_SCREEN_ORIENTATION: string; + + // These belong to the Advanced user interactions - an element is + // optional for these commands. + CLICK: string; + DOUBLE_CLICK: string; + MOUSE_DOWN: string; + MOUSE_UP: string; + MOVE_TO: string; + SEND_KEYS_TO_ACTIVE_ELEMENT: string; + + // These belong to the Advanced Touch API + TOUCH_SINGLE_TAP: string; + TOUCH_DOWN: string; + TOUCH_UP: string; + TOUCH_MOVE: string; + TOUCH_SCROLL: string; + TOUCH_DOUBLE_TAP: string; + TOUCH_LONG_PRESS: string; + TOUCH_FLICK: string; + + GET_AVAILABLE_LOG_TYPES: string; + GET_LOG: string; + GET_SESSION_LOGS: string; + + UPLOAD_FILE: string; +} + +export var CommandName: ICommandName; + +/** + * Describes a command to be executed by the WebDriverJS framework. + * @param {!CommandName} name The name of this command. + * @constructor + */ +export class Command { + // region Constructors + + /** + * @param {!CommandName} name The name of this command. + * @constructor + */ + constructor(name: string); + + // endregion + + // region Methods + + /** + * @return {!CommandName} This command's name. + */ + getName(): string; + + /** + * Sets a parameter to send with this command. + * @param {string} name The parameter name. + * @param {*} value The parameter value. + * @return {!Command} A self reference. + */ + setParameter(name: string, value: any): Command; + + /** + * Sets the parameters for this command. + * @param {!Object.<*>} parameters The command parameters. + * @return {!Command} A self reference. + */ + setParameters(parameters: any): Command; + + /** + * Returns a named command parameter. + * @param {string} key The parameter key to look up. + * @return {*} The parameter value, or undefined if it has not been set. + */ + getParameter(key: string): any; + + /** + * @return {!Object.<*>} The parameters to send with this command. + */ + getParameters(): any; + + // endregion +} + +/** + * Handles the execution of WebDriver {@link Command commands}. + * @interface + */ +export class Executor { + /** + * Executes the given {@code command}. If there is an error executing the + * command, the provided callback will be invoked with the offending error. + * Otherwise, the callback will be invoked with a null Error and non-null + * response object. + * + * @param {!Command} command The command to execute. + * @return {!promise.Promise} A promise that will be fulfilled with + * the command result. + */ + execute(command: Command): promise.Promise +} + +/** + * Wraps a promised {@link Executor}, ensuring no commands are executed until + * the wrapped executor has been fully resolved. + * @implements {Executor} + */ +export class DeferredExecutor { + /** + * @param {!promise.Promise} delegate The promised delegate, which + * may be provided by any promise-like thenable object. + */ + constructor(delegate: promise.Promise); +} + +/** + * Describes an event listener registered on an {@linkplain EventEmitter}. + */ +export class Listener { + /** + * @param {!Function} fn The acutal listener function. + * @param {(Object|undefined)} scope The object in whose scope to invoke the + * listener. + * @param {boolean} oneshot Whether this listener should only be used once. + */ + constructor(fn: Function, scope: Object, oneshot: boolean); +} + +/** + * Object that can emit events for others to listen for. This is used instead + * of Closure's event system because it is much more light weight. The API is + * based on Node's EventEmitters. + */ +export class EventEmitter { + // region Constructors + + /** + * @constructor + */ + constructor(); + + // endregion + + // region Methods + + /** + * Fires an event and calls all listeners. + * @param {string} type The type of event to emit. + * @param {...*} var_args Any arguments to pass to each listener. + */ + emit(type: string, ...var_args: any[]): void; + + /** + * Returns a mutable list of listeners for a specific type of event. + * @param {string} type The type of event to retrieve the listeners for. + * @return {!Set} The registered listeners for the given event + * type. + */ + listeners(type: string): any; + + /** + * Registers a listener. + * @param {string} type The type of event to listen for. + * @param {!Function} fn The function to invoke when the event is fired. + * @param {Object=} opt_self The object in whose scope to invoke the listener. + * @param {boolean=} opt_oneshot Whether the listener should b (e removed after + * the first event is fired. + * @return {!EventEmitter} A self reference. + * @private + */ + addListener(type: string, fn: Function, opt_scope?: any, opt_oneshot?: boolean): EventEmitter; + + + /** + * Registers a one-time listener which will be called only the first time an + * event is emitted, after which it will be removed. + * @param {string} type The type of event to listen for. + * @param {!Function} fn The function to invoke when the event is fired. + * @param {Object=} opt_scope The object in whose scope to invoke the listener. + * @return {!EventEmitter} A self reference. + */ + once(type: string, fn: any, opt_scope?: any): EventEmitter; + + /** + * An alias for {@code #addListener()}. + * @param {string} type The type of event to listen for. + * @param {!Function} fn The function to invoke when the event is fired. + * @param {Object=} opt_scope The object in whose scope to invoke the listener. + * @return {!EventEmitter} A self reference. + */ + on(type: string, fn: Function, opt_scope?: any): EventEmitter; + + /** + * Removes a previously registered event listener. + * @param {string} type The type of event to unregister. + * @param {!Function} listenerFn The handler function to remove. + * @return {!EventEmitter} A self reference. + */ + removeListener(type: string, listenerFn: Function): EventEmitter; + + /** + * Removes all listeners for a specific type of event. If no event is + * specified, all listeners across all types will be removed. + * @param {string=} opt_type The type of event to remove listeners from. + * @return {!EventEmitter} A self reference. + */ + removeAllListeners(opt_type?: string): EventEmitter; + + // endregion +} + + +/** + * Interface for navigating back and forth in the browser history. + */ +export class Navigation { + // region Constructors + + /** + * Interface for navigating back and forth in the browser history. + * + * This class should never be instantiated directly. Insead, obtain an instance + * with + * + * navigate() + * + * @see WebDriver#navigate() + */ + constructor(driver: WebDriver); + + // endregion + + // region Methods + + /** + * Schedules a command to navigate to a new URL. + * @param {string} url The URL to navigate to. + * @return {!promise.Promise.} A promise that will be resolved + * when the URL has been loaded. + */ + to(url: string): promise.Promise; + + /** + * Schedules a command to move backwards in the browser history. + * @return {!promise.Promise.} A promise that will be resolved + * when the navigation event has completed. + */ + back(): promise.Promise; + + /** + * Schedules a command to move forwards in the browser history. + * @return {!promise.Promise.} A promise that will be resolved + * when the navigation event has completed. + */ + forward(): promise.Promise; + + /** + * Schedules a command to refresh the current page. + * @return {!promise.Promise.} A promise that will be resolved + * when the navigation event has completed. + */ + refresh(): promise.Promise; + + // endregion +} + +interface IWebDriverOptionsCookie { + name: string; + value: string; + path?: string; + domain?: string; + secure?: boolean; + expiry?: number; +} + +/** + * Provides methods for managing browser and driver state. + */ +export class Options { + // region Constructors + + /** + * @param {!WebDriver} driver The parent driver. + * @constructor + */ + constructor(driver: WebDriver); + + // endregion + + // region Methods + + /** + * Schedules a command to add a cookie. + * @param {string} name The cookie name. + * @param {string} value The cookie value. + * @param {string=} opt_path The cookie path. + * @param {string=} opt_domain The cookie domain. + * @param {boolean=} opt_isSecure Whether the cookie is secure. + * @param {(number|!Date)=} opt_expiry When the cookie expires. If specified + * as a number, should be in milliseconds since midnight, + * January 1, 1970 UTC. + * @return {!promise.Promise} A promise that will be resolved + * when the cookie has been added to the page. + */ + addCookie(name: string, value: string, opt_path?: string, opt_domain?: string, opt_isSecure?: boolean, opt_expiry?: number | Date): promise.Promise; + + /** + * Schedules a command to delete all cookies visible to the current page. + * @return {!promise.Promise} A promise that will be resolved when all + * cookies have been deleted. + */ + deleteAllCookies(): promise.Promise; + + /** + * Schedules a command to delete the cookie with the given name. This command is + * a no-op if there is no cookie with the given name visible to the current + * page. + * @param {string} name The name of the cookie to delete. + * @return {!promise.Promise} A promise that will be resolved when the + * cookie has been deleted. + */ + deleteCookie(name: string): promise.Promise; + + /** + * Schedules a command to retrieve all cookies visible to the current page. + * Each cookie will be returned as a JSON object as described by the WebDriver + * wire protocol. + * @return {!promise.Promise} A promise that will be resolved with the + * cookies visible to the current page. + * @see http://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object + */ + getCookies(): promise.Promise; + + /** + * Schedules a command to retrieve the cookie with the given name. Returns null + * if there is no such cookie. The cookie will be returned as a JSON object as + * described by the WebDriver wire protocol. + * @param {string} name The name of the cookie to retrieve. + * @return {!promise.Promise} A promise that will be resolved with the + * named cookie, or {@code null} if there is no such cookie. + * @see http://code.google.com/p/selenium/wiki/JsonWireProtocol#Cookie_JSON_Object + */ + getCookie(name: string): promise.Promise; + + /** + * @return {!Logs} The interface for managing driver + * logs. + */ + logs(): Logs; + + /** + * @return {!Timeouts} The interface for managing driver + * timeouts. + */ + timeouts(): Timeouts; + + /** + * @return {!Window} The interface for managing the + * current window. + */ + window(): Window; + + // endregion +} + +/** + * An interface for managing timeout behavior for WebDriver instances. + */ +export class Timeouts { + // region Constructors + + /** + * @param {!WebDriver} driver The parent driver. + * @constructor + */ + constructor(driver: WebDriver); + + // endregion + + // region Methods + + /** + * Specifies the amount of time the driver should wait when searching for an + * element if it is not immediately present. + *

    + * When searching for a single element, the driver should poll the page + * until the element has been found, or this timeout expires before failing + * with a {@code bot.ErrorCode.NO_SUCH_ELEMENT} error. When searching + * for multiple elements, the driver should poll the page until at least one + * element has been found or this timeout has expired. + *

    + * Setting the wait timeout to 0 (its default value), disables implicit + * waiting. + *

    + * Increasing the implicit wait timeout should be used judiciously as it + * will have an adverse effect on test run time, especially when used with + * slower location strategies like XPath. + * + * @param {number} ms The amount of time to wait, in milliseconds. + * @return {!promise.Promise} A promise that will be resolved when the + * implicit wait timeout has been set. + */ + implicitlyWait(ms: number): promise.Promise; + + /** + * Sets the amount of time to wait, in milliseconds, for an asynchronous script + * to finish execution before returning an error. If the timeout is less than or + * equal to 0, the script will be allowed to run indefinitely. + * + * @param {number} ms The amount of time to wait, in milliseconds. + * @return {!promise.Promise} A promise that will be resolved when the + * script timeout has been set. + */ + setScriptTimeout(ms: number): promise.Promise; + + /** + * Sets the amount of time to wait for a page load to complete before returning + * an error. If the timeout is negative, page loads may be indefinite. + * @param {number} ms The amount of time to wait, in milliseconds. + * @return {!promise.Promise} A promise that will be resolved when + * the timeout has been set. + */ + pageLoadTimeout(ms: number): promise.Promise; + + // endregion +} + +/** + * An interface for managing the current window. + */ +export class Window { + + // region Constructors + + /** + * @param {!WebDriver} driver The parent driver. + * @constructor + */ + constructor(driver: WebDriver); + + // endregion + + // region Methods + + /** + * Retrieves the window's current position, relative to the top left corner of + * the screen. + * @return {!promise.Promise} A promise that will be resolved with the + * window's position in the form of a {x:number, y:number} object literal. + */ + getPosition(): promise.Promise; + + /** + * Repositions the current window. + * @param {number} x The desired horizontal position, relative to the left side + * of the screen. + * @param {number} y The desired vertical position, relative to the top of the + * of the screen. + * @return {!promise.Promise} A promise that will be resolved when the + * command has completed. + */ + setPosition(x: number, y: number): promise.Promise; + + /** + * Retrieves the window's current size. + * @return {!promise.Promise} A promise that will be resolved with the + * window's size in the form of a {width:number, height:number} object + * literal. + */ + getSize(): promise.Promise; + + /** + * Resizes the current window. + * @param {number} width The desired window width. + * @param {number} height The desired window height. + * @return {!promise.Promise} A promise that will be resolved when the + * command has completed. + */ + setSize(width: number, height: number): promise.Promise; + + /** + * Maximizes the current window. + * @return {!promise.Promise} A promise that will be resolved when the + * command has completed. + */ + maximize(): promise.Promise; + + // endregion +} + +/** + * Interface for managing WebDriver log records. + */ +export class Logs { + + // region Constructors + + /** + * @param {!WebDriver} driver The parent driver. + * @constructor + */ + constructor(driver: WebDriver); + + // endregion + + // region + + /** + * Fetches available log entries for the given type. + * + *

    Note that log buffers are reset after each call, meaning that + * available log entries correspond to those entries not yet returned for a + * given log type. In practice, this means that this call will return the + * available log entries since the last call, or from the start of the + * session. + * + * @param {!logging.Type} type The desired log type. + * @return {!promise.Promise.>} A + * promise that will resolve to a list of log entries for the specified + * type. + */ + get(type: string): promise.Promise; + + /** + * Retrieves the log types available to this driver. + * @return {!promise.Promise.>} A + * promise that will resolve to a list of available log types. + */ + getAvailableLogTypes(): promise.Promise; + + // endregion +} + +/** + * An interface for changing the focus of the driver to another frame or window. + */ +export class TargetLocator { + + // region Constructors + + /** + * @param {!WebDriver} driver The parent driver. + * @constructor + */ + constructor(driver: WebDriver); + + // endregion + + // region Methods + + /** + * Schedules a command retrieve the {@code document.activeElement} element on + * the current document, or {@code document.body} if activeElement is not + * available. + * @return {!WebElement} The active element. + */ + activeElement(): WebElementPromise; + + /** + * Schedules a command to switch focus of all future commands to the first frame + * on the page. + * @return {!promise.Promise} A promise that will be resolved when the + * driver has changed focus to the default content. + */ + defaultContent(): promise.Promise; + + /** + * Schedules a command to switch the focus of all future commands to another + * frame on the page. The target frame may be specified as one of the + * following: + * + * - A number that specifies a (zero-based) index into [window.frames]( + * https://developer.mozilla.org/en-US/docs/Web/API/Window.frames). + * - A {@link WebElement} reference, which correspond to a `frame` or `iframe` + * DOM element. + * - The `null` value, to select the topmost frame on the page. Passing `null` + * is the same as calling {@link #defaultContent defaultContent()}. + * + * If the specified frame can not be found, the returned promise will be + * rejected with a {@linkplain error.NoSuchFrameError}. + * + * @param {(number|WebElement|null)} id The frame locator. + * @return {!promise.Promise} A promise that will be resolved + * when the driver has changed focus to the specified frame. + */ + frame(nameOrIndex: number | WebElement): promise.Promise; + + /** + * Schedules a command to switch the focus of all future commands to another + * window. Windows may be specified by their {@code window.name} attribute or + * by its handle (as returned by {@link WebDriver#getWindowHandles}). + * + * If the specified window cannot be found, the returned promise will be + * rejected with a {@linkplain error.NoSuchWindowError}. + * + * @param {string} nameOrHandle The name or window handle of the window to + * switch focus to. + * @return {!promise.Promise} A promise that will be resolved + * when the driver has changed focus to the specified window. + */ + window(nameOrHandle: string): promise.Promise; + + /** + * Schedules a command to change focus to the active modal dialog, such as + * those opened by `window.alert()`, `window.confirm()`, and + * `window.prompt()`. The returned promise will be rejected with a + * {@linkplain error.NoSuchAlertError} if there are no open alerts. + * + * @return {!AlertPromise} The open alert. + */ + alert(): AlertPromise; + + // endregion +} + +/** + * Used with {@link WebElement#sendKeys WebElement#sendKeys} on file + * input elements ({@code }) to detect when the entered key + * sequence defines the path to a file. + * + * By default, {@linkplain WebElement WebElement's} will enter all + * key sequences exactly as entered. You may set a + * {@linkplain WebDriver#setFileDetector file detector} on the parent + * WebDriver instance to define custom behavior for handling file elements. Of + * particular note is the {@link selenium-webdriver/remote.FileDetector}, which + * should be used when running against a remote + * [Selenium Server](http://docs.seleniumhq.org/download/). + */ +export class FileDetector { + /** @constructor */ + constructor(); + + /** + * Handles the file specified by the given path, preparing it for use with + * the current browser. If the path does not refer to a valid file, it will + * be returned unchanged, otherwisee a path suitable for use with the current + * browser will be returned. + * + * This default implementation is a no-op. Subtypes may override this + * function for custom tailored file handling. + * + * @param {!WebDriver} driver The driver for the current browser. + * @param {string} path The path to process. + * @return {!promise.Promise} A promise for the processed + * file path. + * @package + */ + handleFile(driver: WebDriver, path: string): promise.Promise; +} + +/** + * Creates a new WebDriver client, which provides control over a browser. + * + * Every WebDriver command returns a {@code promise.Promise} that + * represents the result of that command. Callbacks may be registered on this + * object to manipulate the command result or catch an expected error. Any + * commands scheduled with a callback are considered sub-commands and will + * execute before the next command in the current frame. For example: + * + * var message = []; + * driver.call(message.push, message, 'a').then(function() { + * driver.call(message.push, message, 'b'); + * }); + * driver.call(message.push, message, 'c'); + * driver.call(function() { + * alert('message is abc? ' + (message.join('') == 'abc')); + * }); + * + */ +export class WebDriver { + // region Constructors + + /** + * @param {!(Session|promise.Promise)} session Either a + * known session or a promise that will be resolved to a session. + * @param {!command.Executor} executor The executor to use when sending + * commands to the browser. + * @param {promise.ControlFlow=} opt_flow The flow to + * schedule commands through. Defaults to the active flow object. + */ + constructor(session: Session | promise.Promise, executor: Executor, opt_flow?: promise.ControlFlow); + + // endregion + + // region StaticMethods + + /** + * Creates a new WebDriver client for an existing session. + * @param {!command.Executor} executor Command executor to use when querying + * for session details. + * @param {string} sessionId ID of the session to attach to. + * @param {promise.ControlFlow=} opt_flow The control flow all + * driver commands should execute under. Defaults to the + * {@link promise.controlFlow() currently active} control flow. + * @return {!WebDriver} A new client for the specified session. + */ + static attachToSession(executor: Executor, sessionId: string, opt_flow?: promise.ControlFlow): WebDriver; + + /** + * Creates a new WebDriver session. + * @param {!command.Executor} executor The executor to create the new session + * with. + * @param {!./capabilities.Capabilities} desiredCapabilities The desired + * capabilities for the new session. + * @param {promise.ControlFlow=} opt_flow The control flow all driver + * commands should execute under, including the initial session creation. + * Defaults to the {@link promise.controlFlow() currently active} + * control flow. + * @return {!WebDriver} The driver for the newly created session. + */ + static createSession(executor: Executor, desiredCapabilities: Capabilities, opt_flow?: promise.ControlFlow): WebDriver; + + // endregion + + // region Methods + + /** + * @return {!promise.ControlFlow} The control flow used by this + * instance. + */ + controlFlow(): promise.ControlFlow; + + /** + * Schedules a {@link command.Command} to be executed by this driver's + * {@link command.Executor}. + * + * @param {!command.Command} command The command to schedule. + * @param {string} description A description of the command for debugging. + * @return {!promise.Promise} A promise that will be resolved + * with the command result. + * @template T + */ + schedule(command: Command, description: string): promise.Promise; + + + /** + * Sets the {@linkplain input.FileDetector file detector} that should be + * used with this instance. + * @param {input.FileDetector} detector The detector to use or {@code null}. + */ + setFileDetector(detector: FileDetector): void; + + + /** + * @return {!promise.Promise.} A promise for this + * client's session. + */ + getSession(): promise.Promise; + + + /** + * @return {!promise.Promise.} A promise + * that will resolve with the this instance's capabilities. + */ + getCapabilities(): promise.Promise; + + + /** + * Schedules a command to quit the current session. After calling quit, this + * instance will be invalidated and may no longer be used to issue commands + * against the browser. + * @return {!promise.Promise.} A promise that will be resolved + * when the command has completed. + */ + quit(): promise.Promise; + + /** + * Creates a new action sequence using this driver. The sequence will not be + * scheduled for execution until {@link actions.ActionSequence#perform} is + * called. Example: + * + * driver.actions(). + * mouseDown(element1). + * mouseMove(element2). + * mouseUp(). + * perform(); + * + * @return {!actions.ActionSequence} A new action sequence for this instance. + */ + actions(): ActionSequence; + + + /** + * Creates a new touch sequence using this driver. The sequence will not be + * scheduled for execution until {@link actions.TouchSequence#perform} is + * called. Example: + * + * driver.touchActions(). + * tap(element1). + * doubleTap(element2). + * perform(); + * + * @return {!actions.TouchSequence} A new touch sequence for this instance. + */ + touchActions(): TouchSequence; + + + /** + * Schedules a command to execute JavaScript in the context of the currently + * selected frame or window. The script fragment will be executed as the body + * of an anonymous function. If the script is provided as a function object, + * that function will be converted to a string for injection into the target + * window. + * + * Any arguments provided in addition to the script will be included as script + * arguments and may be referenced using the {@code arguments} object. + * Arguments may be a boolean, number, string, or {@code WebElement}. + * Arrays and objects may also be used as script arguments as long as each item + * adheres to the types previously mentioned. + * + * The script may refer to any variables accessible from the current window. + * Furthermore, the script will execute in the window's context, thus + * {@code document} may be used to refer to the current document. Any local + * variables will not be available once the script has finished executing, + * though global variables will persist. + * + * If the script has a return value (i.e. if the script contains a return + * statement), then the following steps will be taken for resolving this + * functions return value: + * + * - For a HTML element, the value will resolve to a + * {@link WebElement} + * - Null and undefined return values will resolve to null + * - Booleans, numbers, and strings will resolve as is + * - Functions will resolve to their string representation + * - For arrays and objects, each member item will be converted according to + * the rules above + * + * @param {!(string|Function)} script The script to execute. + * @param {...*} var_args The arguments to pass to the script. + * @return {!promise.Promise.} A promise that will resolve to the + * scripts return value. + * @template T + */ + executeScript(script: string | Function, ...var_args: any[]): promise.Promise; + + /** + * Schedules a command to execute asynchronous JavaScript in the context of the + * currently selected frame or window. The script fragment will be executed as + * the body of an anonymous function. If the script is provided as a function + * object, that function will be converted to a string for injection into the + * target window. + * + * Any arguments provided in addition to the script will be included as script + * arguments and may be referenced using the {@code arguments} object. + * Arguments may be a boolean, number, string, or {@code WebElement}. + * Arrays and objects may also be used as script arguments as long as each item + * adheres to the types previously mentioned. + * + * Unlike executing synchronous JavaScript with {@link #executeScript}, + * scripts executed with this function must explicitly signal they are finished + * by invoking the provided callback. This callback will always be injected + * into the executed function as the last argument, and thus may be referenced + * with {@code arguments[arguments.length - 1]}. The following steps will be + * taken for resolving this functions return value against the first argument + * to the script's callback function: + * + * - For a HTML element, the value will resolve to a + * {@link WebElement} + * - Null and undefined return values will resolve to null + * - Booleans, numbers, and strings will resolve as is + * - Functions will resolve to their string representation + * - For arrays and objects, each member item will be converted according to + * the rules above + * + * __Example #1:__ Performing a sleep that is synchronized with the currently + * selected window: + * + * var start = new Date().getTime(); + * driver.executeAsyncScript( + * 'window.setTimeout(arguments[arguments.length - 1], 500);'). + * then(function() { + * console.log( + * 'Elapsed time: ' + (new Date().getTime() - start) + ' ms'); + * }); + * + * __Example #2:__ Synchronizing a test with an AJAX application: + * + * var button = driver.findElement(By.id('compose-button')); + * button.click(); + * driver.executeAsyncScript( + * 'var callback = arguments[arguments.length - 1];' + + * 'mailClient.getComposeWindowWidget().onload(callback);'); + * driver.switchTo().frame('composeWidget'); + * driver.findElement(By.id('to')).sendKeys('dog@example.com'); + * + * __Example #3:__ Injecting a XMLHttpRequest and waiting for the result. In + * this example, the inject script is specified with a function literal. When + * using this format, the function is converted to a string for injection, so it + * should not reference any symbols not defined in the scope of the page under + * test. + * + * driver.executeAsyncScript(function() { + * var callback = arguments[arguments.length - 1]; + * var xhr = new XMLHttpRequest(); + * xhr.open('GET', '/resource/data.json', true); + * xhr.onreadystatechange = function() { + * if (xhr.readyState == 4) { + * callback(xhr.responseText); + * } + * } + * xhr.send(''); + * }).then(function(str) { + * console.log(JSON.parse(str)['food']); + * }); + * + * @param {!(string|Function)} script The script to execute. + * @param {...*} var_args The arguments to pass to the script. + * @return {!promise.Promise.} A promise that will resolve to the + * scripts return value. + * @template T + */ + executeAsyncScript(script: string | Function, ...var_args: any[]): promise.Promise; + + /** + * Schedules a command to execute a custom function. + * @param {function(...): (T|promise.Promise.)} fn The function to + * execute. + * @param {Object=} opt_scope The object in whose scope to execute the function. + * @param {...*} var_args Any arguments to pass to the function. + * @return {!promise.Promise.} A promise that will be resolved' + * with the function's result. + * @template T + */ + call(fn: (...var_args: any[]) => (T | promise.Promise), opt_scope?: any, ...var_args: any[]): promise.Promise; + + /** + * Schedules a command to wait for a condition to hold. The condition may be + * specified by a {@link until.Condition}, as a custom function, or + * as a {@link promise.Promise}. + * + * For a {@link until.Condition} or function, the wait will repeatedly + * evaluate the condition until it returns a truthy value. If any errors occur + * while evaluating the condition, they will be allowed to propagate. In the + * event a condition returns a {@link promise.Promise promise}, the + * polling loop will wait for it to be resolved and use the resolved value for + * whether the condition has been satisified. Note the resolution time for + * a promise is factored into whether a wait has timed out. + * + * *Example:* waiting up to 10 seconds for an element to be present and visible + * on the page. + * + * var button = driver.wait(until.elementLocated(By.id('foo'), 10000); + * button.click(); + * + * This function may also be used to block the command flow on the resolution + * of a {@link promise.Promise promise}. When given a promise, the + * command will simply wait for its resolution before completing. A timeout may + * be provided to fail the command if the promise does not resolve before the + * timeout expires. + * + * *Example:* Suppose you have a function, `startTestServer`, that returns a + * promise for when a server is ready for requests. You can block a `WebDriver` + * client on this promise with: + * + * var started = startTestServer(); + * driver.wait(started, 5 * 1000, 'Server should start within 5 seconds'); + * driver.get(getServerUrl()); + * + * @param {!(promise.Promise| + * until.Condition| + * function(!WebDriver): T)} condition The condition to + * wait on, defined as a promise, condition object, or a function to + * evaluate as a condition. + * @param {number=} opt_timeout How long to wait for the condition to be true. + * @param {string=} opt_message An optional message to use if the wait times + * out. + * @return {!promise.Promise} A promise that will be fulfilled + * with the first truthy value returned by the condition function, or + * rejected if the condition times out. + * @template T + */ + wait(condition: promise.Promise | until.Condition | ((driver: WebDriver) => T) | Function, timeout?: number, opt_message?: string): promise.Promise; + + /** + * Schedules a command to make the driver sleep for the given amount of time. + * @param {number} ms The amount of time, in milliseconds, to sleep. + * @return {!promise.Promise.} A promise that will be resolved + * when the sleep has finished. + */ + sleep(ms: number): promise.Promise; + + /** + * Schedules a command to retrieve they current window handle. + * @return {!promise.Promise.} A promise that will be + * resolved with the current window handle. + */ + getWindowHandle(): promise.Promise; + + /** + * Schedules a command to retrieve the current list of available window handles. + * @return {!promise.Promise.>} A promise that will + * be resolved with an array of window handles. + */ + getAllWindowHandles(): promise.Promise; + + /** + * Schedules a command to retrieve the current page's source. The page source + * returned is a representation of the underlying DOM: do not expect it to be + * formatted or escaped in the same way as the response sent from the web + * server. + * @return {!promise.Promise.} A promise that will be + * resolved with the current page source. + */ + getPageSource(): promise.Promise; + + /** + * Schedules a command to close the current window. + * @return {!promise.Promise.} A promise that will be resolved + * when this command has completed. + */ + close(): promise.Promise; + + /** + * Schedules a command to navigate to the given URL. + * @param {string} url The fully qualified URL to open. + * @return {!promise.Promise.} A promise that will be resolved + * when the document has finished loading. + */ + get(url: string): promise.Promise; + + /** + * Schedules a command to retrieve the URL of the current page. + * @return {!promise.Promise.} A promise that will be + * resolved with the current URL. + */ + getCurrentUrl(): promise.Promise; + + /** + * Schedules a command to retrieve the current page's title. + * @return {!promise.Promise.} A promise that will be + * resolved with the current page's title. + */ + getTitle(): promise.Promise; + + /** + * Schedule a command to find an element on the page. If the element cannot be + * found, a {@link bot.ErrorCode.NO_SUCH_ELEMENT} result will be returned + * by the driver. Unlike other commands, this error cannot be suppressed. In + * other words, scheduling a command to find an element doubles as an assert + * that the element is present on the page. To test whether an element is + * present on the page, use {@link #isElementPresent} instead. + * + * The search criteria for an element may be defined using one of the + * factories in the {@link By} namespace, or as a short-hand + * {@link By.Hash} object. For example, the following two statements + * are equivalent: + * + * var e1 = driver.findElement(By.id('foo')); + * var e2 = driver.findElement({id:'foo'}); + * + * You may also provide a custom locator function, which takes as input this + * instance and returns a {@link WebElement}, or a promise that will resolve + * to a WebElement. If the returned promise resolves to an array of + * WebElements, WebDriver will use the first element. For example, to find the + * first visible link on a page, you could write: + * + * var link = driver.findElement(firstVisibleLink); + * + * function firstVisibleLink(driver) { + * var links = driver.findElements(By.tagName('a')); + * return promise.filter(links, function(link) { + * return link.isDisplayed(); + * }); + * } + * + * @param {!(by.By|Function)} locator The locator to use. + * @return {!WebElementPromise} A WebElement that can be used to issue + * commands against the located element. If the element is not found, the + * element will be invalidated and all scheduled commands aborted. + */ + findElement(locator: By | Function): WebElementPromise; + + /** + * Schedules a command to test if an element is present on the page. + * + * If given a DOM element, this function will check if it belongs to the + * document the driver is currently focused on. Otherwise, the function will + * test if at least one element can be found with the given search criteria. + * + * @param {!(by.By|Function)} locator The locator to use. + * @return {!promise.Promise} A promise that will resolve + * with whether the element is present on the page. + * @deprecated This method will be removed in Selenium 3.0 for consistency + * with the other Selenium language bindings. This method is equivalent + * to + * + * driver.findElements(locator).then(e => !!e.length); + */ + isElementPresent(locatorOrElement: By | Function): promise.Promise; + + /** + * Schedule a command to search for multiple elements on the page. + * + * @param {!(by.By|Function)} locator The locator to use. + * @return {!promise.Promise.>} A + * promise that will resolve to an array of WebElements. + */ + findElements(locator: By | Function): promise.Promise; + + /** + * Schedule a command to take a screenshot. The driver makes a best effort to + * return a screenshot of the following, in order of preference: + * + * 1. Entire page + * 2. Current window + * 3. Visible portion of the current frame + * 4. The entire display containing the browser + * + * @return {!promise.Promise} A promise that will be + * resolved to the screenshot as a base-64 encoded PNG. + */ + takeScreenshot(): promise.Promise; + + /** + * @return {!Options} The options interface for this + * instance. + */ + manage(): Options; + + /** + * @return {!Navigation} The navigation interface for this + * instance. + */ + navigate(): Navigation; + + /** + * @return {!TargetLocator} The target locator interface for + * this instance. + */ + switchTo(): TargetLocator; + + // endregion +} + +interface IWebElementId { + [ELEMENT: string]: string; +} + +/** + * Represents a DOM element. WebElements can be found by searching from the + * document root using a {@code WebDriver} instance, or by searching + * under another {@code WebElement}: + *

    
    + *   driver.get('http://www.google.com');
    + *   var searchForm = driver.findElement(By.tagName('form'));
    + *   var searchBox = searchForm.findElement(By.name('q'));
    + *   searchBox.sendKeys('webdriver');
    + * 
    + * + * The WebElement is implemented as a promise for compatibility with the promise + * API. It will always resolve itself when its internal state has been fully + * resolved and commands may be issued against the element. This can be used to + * catch errors when an element cannot be located on the page: + *
    
    + *   driver.findElement(By.id('not-there')).then(function(element) {
    + *     alert('Found an element that was not expected to be there!');
    + *   }, function(error) {
    + *     alert('The element was not found, as expected');
    + *   });
    + * 
    + */ +interface IWebElement { + // region Methods + + /** + * Schedules a command to click on this element. + * @return {!promise.Promise} A promise that will be resolved when + * the click command has completed. + */ + click(): promise.Promise; + + /** + * Schedules a command to type a sequence on the DOM element represented by + * this instance. + * + * Modifier keys (SHIFT, CONTROL, ALT, META) are stateful; once a modifier is + * processed in the key sequence, that key state is toggled until one of the + * following occurs: + * + * - The modifier key is encountered again in the sequence. At this point the + * state of the key is toggled (along with the appropriate keyup/down + * events). + * - The {@link input.Key.NULL} key is encountered in the sequence. When + * this key is encountered, all modifier keys current in the down state are + * released (with accompanying keyup events). The NULL key can be used to + * simulate common keyboard shortcuts: + * + * element.sendKeys('text was', + * Key.CONTROL, 'a', Key.NULL, + * 'now text is'); + * // Alternatively: + * element.sendKeys('text was', + * Key.chord(Key.CONTROL, 'a'), + * 'now text is'); + * + * - The end of the key sequence is encountered. When there are no more keys + * to type, all depressed modifier keys are released (with accompanying + * keyup events). + * + * If this element is a file input ({@code }), the + * specified key sequence should specify the path to the file to attach to + * the element. This is analogous to the user clicking 'Browse...' and entering + * the path into the file select dialog. + * + * var form = driver.findElement(By.css('form')); + * var element = form.findElement(By.css('input[type=file]')); + * element.sendKeys('/path/to/file.txt'); + * form.submit(); + * + * For uploads to function correctly, the entered path must reference a file + * on the _browser's_ machine, not the local machine running this script. When + * running against a remote Selenium server, a {@link input.FileDetector} + * may be used to transparently copy files to the remote machine before + * attempting to upload them in the browser. + * + * __Note:__ On browsers where native keyboard events are not supported + * (e.g. Firefox on OS X), key events will be synthesized. Special + * punctuation keys will be synthesized according to a standard QWERTY en-us + * keyboard layout. + * + * @param {...(number|string|!IThenable<(number|string)>)} var_args The + * sequence of keys to type. Number keys may be referenced numerically or + * by string (1 or '1'). All arguments will be joined into a single + * sequence. + * @return {!promise.Promise} A promise that will be resolved when all + * keys have been typed. + */ + sendKeys(...var_args: Array>): promise.Promise; + + /** + * Schedules a command to query for the tag/node name of this element. + * @return {!promise.Promise} A promise that will be resolved with the + * element's tag name. + */ + getTagName(): promise.Promise; + + /** + * Schedules a command to query for the computed style of the element + * represented by this instance. If the element inherits the named style from + * its parent, the parent will be queried for its value. Where possible, color + * values will be converted to their hex representation (e.g. #00ff00 instead of + * rgb(0, 255, 0)). + *

    + * Warning: the value returned will be as the browser interprets it, so + * it may be tricky to form a proper assertion. + * + * @param {string} cssStyleProperty The name of the CSS style property to look + * up. + * @return {!promise.Promise} A promise that will be resolved with the + * requested CSS value. + */ + getCssValue(cssStyleProperty: string): promise.Promise; + + /** + * Schedules a command to query for the value of the given attribute of the + * element. Will return the current value even if it has been modified after the + * page has been loaded. More exactly, this method will return the value of the + * given attribute, unless that attribute is not present, in which case the + * value of the property with the same name is returned. If neither value is + * set, null is returned. The 'style' attribute is converted as best can be to a + * text representation with a trailing semi-colon. The following are deemed to + * be 'boolean' attributes and will be returned as thus: + * + *

    async, autofocus, autoplay, checked, compact, complete, controls, declare, + * defaultchecked, defaultselected, defer, disabled, draggable, ended, + * formnovalidate, hidden, indeterminate, iscontenteditable, ismap, itemscope, + * loop, multiple, muted, nohref, noresize, noshade, novalidate, nowrap, open, + * paused, pubdate, readonly, required, reversed, scoped, seamless, seeking, + * selected, spellcheck, truespeed, willvalidate + * + *

    Finally, the following commonly mis-capitalized attribute/property names + * are evaluated as expected: + *

      + *
    • 'class' + *
    • 'readonly' + *
    + * @param {string} attributeName The name of the attribute to query. + * @return {!promise.Promise} A promise that will be resolved with the + * attribute's value. + */ + getAttribute(attributeName: string): promise.Promise; + + /** + * Get the visible (i.e. not hidden by CSS) innerText of this element, including + * sub-elements, without any leading or trailing whitespace. + * @return {!promise.Promise} A promise that will be resolved with the + * element's visible text. + */ + getText(): promise.Promise; + + /** + * Schedules a command to compute the size of this element's bounding box, in + * pixels. + * @return {!promise.Promise} A promise that will be resolved with the + * element's size as a {@code {width:number, height:number}} object. + */ + getSize(): promise.Promise; + + /** + * Schedules a command to compute the location of this element in page space. + * @return {!promise.Promise} A promise that will be resolved to the + * element's location as a {@code {x:number, y:number}} object. + */ + getLocation(): promise.Promise; + + /** + * Schedules a command to query whether the DOM element represented by this + * instance is enabled, as dicted by the {@code disabled} attribute. + * @return {!promise.Promise} A promise that will be resolved with + * whether this element is currently enabled. + */ + isEnabled(): promise.Promise; + + /** + * Schedules a command to query whether this element is selected. + * @return {!promise.Promise} A promise that will be resolved with + * whether this element is currently selected. + */ + isSelected(): promise.Promise; + + /** + * Schedules a command to submit the form containing this element (or this + * element if it is a FORM element). This command is a no-op if the element is + * not contained in a form. + * @return {!promise.Promise} A promise that will be resolved when + * the form has been submitted. + */ + submit(): promise.Promise; + + /** + * Schedules a command to clear the {@code value} of this element. This command + * has no effect if the underlying DOM element is neither a text INPUT element + * nor a TEXTAREA element. + * @return {!promise.Promise} A promise that will be resolved when + * the element has been cleared. + */ + clear(): promise.Promise; + + /** + * Schedules a command to test whether this element is currently displayed. + * @return {!promise.Promise} A promise that will be resolved with + * whether this element is currently visible on the page. + */ + isDisplayed(): promise.Promise; + + /** + * Schedules a command to retrieve the outer HTML of this element. + * @return {!promise.Promise} A promise that will be resolved with + * the element's outer HTML. + */ + getOuterHtml(): promise.Promise; + + /** + * @return {!promise.Promise.} A promise + * that resolves to this element's JSON representation as defined by the + * WebDriver wire protocol. + * @see http://code.google.com/p/selenium/wiki/JsonWireProtocol + */ + getId(): promise.Promise; + + /** + * Schedules a command to retrieve the inner HTML of this element. + * @return {!promise.Promise} A promise that will be resolved with the + * element's inner HTML. + */ + getInnerHtml(): promise.Promise; + + // endregion +} + +interface IWebElementFinders { + /** + * Schedule a command to find a descendant of this element. If the element + * cannot be found, a {@code bot.ErrorCode.NO_SUCH_ELEMENT} result will + * be returned by the driver. Unlike other commands, this error cannot be + * suppressed. In other words, scheduling a command to find an element doubles + * as an assert that the element is present on the page. To test whether an + * element is present on the page, use {@code #isElementPresent} instead. + * + *

    The search criteria for an element may be defined using one of the + * factories in the {@link By} namespace, or as a short-hand + * {@link By.Hash} object. For example, the following two statements + * are equivalent: + *

    +   * var e1 = element.findElement(By.id('foo'));
    +   * var e2 = element.findElement({id:'foo'});
    +   * 
    + * + *

    You may also provide a custom locator function, which takes as input + * this WebDriver instance and returns a {@link WebElement}, or a + * promise that will resolve to a WebElement. For example, to find the first + * visible link on a page, you could write: + *

    +   * var link = element.findElement(firstVisibleLink);
    +   *
    +   * function firstVisibleLink(element) {
    +   *   var links = element.findElements(By.tagName('a'));
    +   *   return promise.filter(links, function(link) {
    +   *     return links.isDisplayed();
    +   *   }).then(function(visibleLinks) {
    +   *     return visibleLinks[0];
    +   *   });
    +   * }
    +   * 
    + * + * @param {!(Locator|By.Hash|Function)} locator The + * locator strategy to use when searching for the element. + * @return {!WebElement} A WebElement that can be used to issue + * commands against the located element. If the element is not found, the + * element will be invalidated and all scheduled commands aborted. + */ + findElement(locator: By | Function): WebElementPromise; + + /** + * Schedules a command to test if there is at least one descendant of this + * element that matches the given search criteria. + * + * @param {!(Locator|By.Hash|Function)} locator The + * locator strategy to use when searching for the element. + * @return {!promise.Promise.} A promise that will be + * resolved with whether an element could be located on the page. + */ + isElementPresent(locator: By | Function): promise.Promise; + + /** + * Schedules a command to find all of the descendants of this element that + * match the given search criteria. + * + * @param {!(Locator|By.Hash|Function)} locator The + * locator strategy to use when searching for the elements. + * @return {!promise.Promise.>} A + * promise that will resolve to an array of WebElements. + */ + findElements(locator: By | Function): promise.Promise; +} + +/** + * Defines an object that can be asynchronously serialized to its WebDriver + * wire representation. + * + * @constructor + * @template T + */ +interface Serializable { + /** + * Returns either this instance's serialized represention, if immediately + * available, or a promise for its serialized representation. This function is + * conceptually equivalent to objects that have a {@code toJSON()} property, + * except the serialize() result may be a promise or an object containing a + * promise (which are not directly JSON friendly). + * + * @return {!(T|IThenable.)} This instance's serialized wire format. + */ + serialize(): T | promise.IThenable; +} + +/** + * Represents a DOM element. WebElements can be found by searching from the + * document root using a {@link WebDriver} instance, or by searching + * under another WebElement: + * + * driver.get('http://www.google.com'); + * var searchForm = driver.findElement(By.tagName('form')); + * var searchBox = searchForm.findElement(By.name('q')); + * searchBox.sendKeys('webdriver'); + * + * The WebElement is implemented as a promise for compatibility with the promise + * API. It will always resolve itself when its internal state has been fully + * resolved and commands may be issued against the element. This can be used to + * catch errors when an element cannot be located on the page: + * + * driver.findElement(By.id('not-there')).then(function(element) { + * alert('Found an element that was not expected to be there!'); + * }, function(error) { + * alert('The element was not found, as expected'); + * }); + * + * @extends {Serializable.} + */ +export class WebElement implements Serializable { + /** + * @param {!WebDriver} driver the parent WebDriver instance for this element. + * @param {(!IThenable|string)} id The server-assigned opaque ID for + * the underlying DOM element. + */ + constructor(driver: WebDriver, id: promise.Promise | string); + + /** + * @param {string} id The raw ID. + * @param {boolean=} opt_noLegacy Whether to exclude the legacy element key. + * @return {!Object} The element ID for use with WebDriver's wire protocol. + */ + static buildId(id: string, opt_noLegacy?: boolean): Object; + + /** + * Extracts the encoded WebElement ID from the object. + * + * @param {?} obj The object to extract the ID from. + * @return {string} the extracted ID. + * @throws {TypeError} if the object is not a valid encoded ID. + */ + static extractId(obj: IWebElementId): string; + + /** + * @param {?} obj the object to test. + * @return {boolean} whether the object is a valid encoded WebElement ID. + */ + static isId(obj: IWebElementId): boolean; + + /** + * Compares two WebElements for equality. + * + * @param {!WebElement} a A WebElement. + * @param {!WebElement} b A WebElement. + * @return {!promise.Promise} A promise that will be + * resolved to whether the two WebElements are equal. + */ + static equals(a: WebElement, b: WebElement): promise.Promise; + + /** + * @return {!WebDriver} The parent driver for this instance. + */ + getDriver(): WebDriver; + + /** + * @return {!promise.Promise} A promise that resolves to + * the server-assigned opaque ID assigned to this element. + */ + getId(): promise.Promise; + + /** + * @deprecated Use {@link #getId()} instead. + */ + getRawId(): any; + + /** + * Schedule a command to find a descendant of this element. If the element + * cannot be found, a {@link bot.ErrorCode.NO_SUCH_ELEMENT} result will + * be returned by the driver. Unlike other commands, this error cannot be + * suppressed. In other words, scheduling a command to find an element doubles + * as an assert that the element is present on the page. To test whether an + * element is present on the page, use {@link #isElementPresent} instead. + * + * The search criteria for an element may be defined using one of the + * factories in the {@link By} namespace, or as a short-hand + * {@link By.Hash} object. For example, the following two statements + * are equivalent: + * + * var e1 = element.findElement(By.id('foo')); + * var e2 = element.findElement({id:'foo'}); + * + * You may also provide a custom locator function, which takes as input + * this WebDriver instance and returns a {@link WebElement}, or a + * promise that will resolve to a WebElement. For example, to find the first + * visible link on a page, you could write: + * + * var link = element.findElement(firstVisibleLink); + * + * function firstVisibleLink(element) { + * var links = element.findElements(By.tagName('a')); + * return promise.filter(links, function(link) { + * return links.isDisplayed(); + * }).then(function(visibleLinks) { + * return visibleLinks[0]; + * }); + * } + * + * @param {!(by.By|Function)} locator The locator strategy to use when + * searching for the element. + * @return {!WebElementPromise} A WebElement that can be used to issue + * commands against the located element. If the element is not found, the + * element will be invalidated and all scheduled commands aborted. + */ + findElement(locator: By | Function): WebElementPromise; + + /** + * Schedules a command to test if there is at least one descendant of this + * element that matches the given search criteria. + * + * @param {!(by.By|Function)} locator The locator strategy to use when + * searching for the element. + * @return {!promise.Promise} A promise that will be + * resolved with whether an element could be located on the page. + * @deprecated This method will be removed in Selenium 3.0 for consistency + * with the other Selenium language bindings. This method is equivalent + * to + * + * element.findElements(locator).then(e => !!e.length); + */ + isElementPresent(locator: By | Function): promise.Promise; + + /** + * Schedules a command to find all of the descendants of this element that + * match the given search criteria. + * + * @param {!(by.By|Function)} locator The locator strategy to use when + * searching for the element. + * @return {!promise.Promise>} A + * promise that will resolve to an array of WebElements. + */ + findElements(locator: By | Function): promise.Promise; + + /** + * Schedules a command to click on this element. + * @return {!promise.Promise.} A promise that will be resolved + * when the click command has completed. + */ + click(): promise.Promise; + + /** + * Schedules a command to type a sequence on the DOM element represented by this + * promsieinstance. + * + * Modifier keys (SHIFT, CONTROL, ALT, META) are stateful; once a modifier is + * processed in the keysequence, that key state is toggled until one of the + * following occurs: + * + * - The modifier key is encountered again in the sequence. At this point the + * state of the key is toggled (along with the appropriate keyup/down events). + * - The {@link Key.NULL} key is encountered in the sequence. When + * this key is encountered, all modifier keys current in the down state are + * released (with accompanying keyup events). The NULL key can be used to + * simulate common keyboard shortcuts: + * + * element.sendKeys('text was', + * Key.CONTROL, 'a', Key.NULL, + * 'now text is'); + * // Alternatively: + * element.sendKeys('text was', + * Key.chord(Key.CONTROL, 'a'), + * 'now text is'); + * + * - The end of the keysequence is encountered. When there are no more keys + * to type, all depressed modifier keys are released (with accompanying keyup + * events). + * + * If this element is a file input ({@code }), the + * specified key sequence should specify the path to the file to attach to + * the element. This is analgous to the user clicking 'Browse...' and entering + * the path into the file select dialog. + * + * var form = driver.findElement(By.css('form')); + * var element = form.findElement(By.css('input[type=file]')); + * element.sendKeys('/path/to/file.txt'); + * form.submit(); + * + * For uploads to function correctly, the entered path must reference a file + * on the _browser's_ machine, not the local machine running this script. When + * running against a remote Selenium server, a {@link FileDetector} + * may be used to transparently copy files to the remote machine before + * attempting to upload them in the browser. + * + * __Note:__ On browsers where native keyboard events are not supported + * (e.g. Firefox on OS X), key events will be synthesized. Special + * punctionation keys will be synthesized according to a standard QWERTY en-us + * keyboard layout. + * + * @param {...(string|!promise.Promise)} var_args The sequence + * of keys to type. All arguments will be joined into a single sequence. + * @return {!promise.Promise.} A promise that will be resolved + * when all keys have been typed. + */ + sendKeys(...var_args: Array>): promise.Promise; + + /** + * Schedules a command to query for the tag/node name of this element. + * @return {!promise.Promise.} A promise that will be + * resolved with the element's tag name. + */ + getTagName(): promise.Promise; + + /** + * Schedules a command to query for the computed style of the element + * represented by this instance. If the element inherits the named style from + * its parent, the parent will be queried for its value. Where possible, color + * values will be converted to their hex representation (e.g. #00ff00 instead of + * rgb(0, 255, 0)). + * + * _Warning:_ the value returned will be as the browser interprets it, so + * it may be tricky to form a proper assertion. + * + * @param {string} cssStyleProperty The name of the CSS style property to look + * up. + * @return {!promise.Promise} A promise that will be + * resolved with the requested CSS value. + */ + getCssValue(cssStyleProperty: string): promise.Promise; + + /** + * Schedules a command to query for the value of the given attribute of the + * element. Will return the current value, even if it has been modified after + * the page has been loaded. More exactly, this method will return the value of + * the given attribute, unless that attribute is not present, in which case the + * value of the property with the same name is returned. If neither value is + * set, null is returned (for example, the 'value' property of a textarea + * element). The 'style' attribute is converted as best can be to a + * text representation with a trailing semi-colon. The following are deemed to + * be 'boolean' attributes and will return either 'true' or null: + * + * async, autofocus, autoplay, checked, compact, complete, controls, declare, + * defaultchecked, defaultselected, defer, disabled, draggable, ended, + * formnovalidate, hidden, indeterminate, iscontenteditable, ismap, itemscope, + * loop, multiple, muted, nohref, noresize, noshade, novalidate, nowrap, open, + * paused, pubdate, readonly, required, reversed, scoped, seamless, seeking, + * selected, spellcheck, truespeed, willvalidate + * + * Finally, the following commonly mis-capitalized attribute/property names + * are evaluated as expected: + * + * - 'class' + * - 'readonly' + * + * @param {string} attributeName The name of the attribute to query. + * @return {!promise.Promise.} A promise that will be + * resolved with the attribute's value. The returned value will always be + * either a string or null. + */ + getAttribute(attributeName: string): promise.Promise; + + /** + * Get the visible (i.e. not hidden by CSS) innerText of this element, including + * sub-elements, without any leading or trailing whitespace. + * @return {!promise.Promise.} A promise that will be + * resolved with the element's visible text. + */ + getText(): promise.Promise; + + /** + * Schedules a command to compute the size of this element's bounding box, in + * pixels. + * @return {!promise.Promise.<{width: number, height: number}>} A + * promise that will be resolved with the element's size as a + * {@code {width:number, height:number}} object. + */ + getSize(): promise.Promise; + + /** + * Schedules a command to compute the location of this element in page space. + * @return {!promise.Promise.<{x: number, y: number}>} A promise that + * will be resolved to the element's location as a + * {@code {x:number, y:number}} object. + */ + getLocation(): promise.Promise; + + /** + * Schedules a command to query whether the DOM element represented by this + * instance is enabled, as dicted by the {@code disabled} attribute. + * @return {!promise.Promise.} A promise that will be + * resolved with whether this element is currently enabled. + */ + isEnabled(): promise.Promise; + + /** + * Schedules a command to query whether this element is selected. + * @return {!promise.Promise.} A promise that will be + * resolved with whether this element is currently selected. + */ + isSelected(): promise.Promise; + + /** + * Schedules a command to submit the form containing this element (or this + * element if it is a FORM element). This command is a no-op if the element is + * not contained in a form. + * @return {!promise.Promise.} A promise that will be resolved + * when the form has been submitted. + */ + submit(): promise.Promise; + + /** + * Schedules a command to clear the `value` of this element. This command has + * no effect if the underlying DOM element is neither a text INPUT element + * nor a TEXTAREA element. + * @return {!promise.Promise} A promise that will be resolved + * when the element has been cleared. + */ + clear(): promise.Promise; + + /** + * Schedules a command to test whether this element is currently displayed. + * @return {!promise.Promise.} A promise that will be + * resolved with whether this element is currently visible on the page. + */ + isDisplayed(): promise.Promise; + + /** + * Take a screenshot of the visible region encompassed by this element's + * bounding rectangle. + * + * @param {boolean=} opt_scroll Optional argument that indicates whether the + * element should be scrolled into view before taking a screenshot. + * Defaults to false. + * @return {!promise.Promise} A promise that will be + * resolved to the screenshot as a base-64 encoded PNG. + */ + takeScreenshot(opt_scroll?: boolean): promise.Promise; + + /** + * Schedules a command to retrieve the outer HTML of this element. + * @return {!promise.Promise.} A promise that will be + * resolved with the element's outer HTML. + */ + getOuterHtml(): promise.Promise; + + /** + * Schedules a command to retrieve the inner HTML of this element. + * @return {!promise.Promise} A promise that will be resolved with the + * element's inner HTML. + */ + getInnerHtml(): promise.Promise; + + /** @override */ + serialize(): promise.Promise; +} + +/** + * WebElementPromise is a promise that will be fulfilled with a WebElement. + * This serves as a forward proxy on WebElement, allowing calls to be + * scheduled without directly on this instance before the underlying + * WebElement has been fulfilled. In other words, the following two statements + * are equivalent: + *
    
    + *     driver.findElement({id: 'my-button'}).click();
    + *     driver.findElement({id: 'my-button'}).then(function(el) {
    + *       return el.click();
    + *     });
    + * 
    + * + * @param {!WebDriver} driver The parent WebDriver instance for this + * element. + * @param {!promise.Promise.} el A promise + * that will resolve to the promised element. + * @constructor + * @extends {WebElement} + * @implements {promise.Thenable.} + * @final + */ +export class WebElementPromise extends WebElement implements promise.IThenable { + /** + * @param {!WebDriver} driver The parent WebDriver instance for this + * element. + * @param {!promise.Promise} el A promise + * that will resolve to the promised element. + */ + constructor(driver: WebDriver, el: promise.Promise); + + /** + * Cancels the computation of this promise's value, rejecting the promise in the + * process. This method is a no-op if the promise has alreayd been resolved. + * + * @param {string=} opt_reason The reason this promise is being cancelled. + */ + cancel(opt_reason?: string): void; + + + /** @return {boolean} Whether this promise's value is still being computed. */ + isPending(): boolean; + + + /** + * Registers listeners for when this instance is resolved. + * + * @param opt_callback The + * function to call if this promise is successfully resolved. The function + * should expect a single argument: the promise's resolved value. + * @param opt_errback The + * function to call if this promise is rejected. The function should expect + * a single argument: the rejection reason. + * @return A new promise which will be + * resolved with the result of the invoked callback. + */ + then(opt_callback?: (value: WebElement) => promise.Promise, opt_errback?: (error: any) => any): promise.Promise; + + /** + * Registers listeners for when this instance is resolved. + * + * @param opt_callback The + * function to call if this promise is successfully resolved. The function + * should expect a single argument: the promise's resolved value. + * @param opt_errback The + * function to call if this promise is rejected. The function should expect + * a single argument: the rejection reason. + * @return A new promise which will be + * resolved with the result of the invoked callback. + */ + then(opt_callback?: (value: WebElement) => R, opt_errback?: (error: any) => any): promise.Promise; + + + /** + * Registers a listener for when this promise is rejected. This is synonymous + * with the {@code catch} clause in a synchronous API: + *
    
    +   *   // Synchronous API:
    +   *   try {
    +   *     doSynchronousWork();
    +   *   } catch (ex) {
    +   *     console.error(ex);
    +   *   }
    +   *
    +   *   // Asynchronous promise API:
    +   *   doAsynchronousWork().thenCatch(function(ex) {
    +   *     console.error(ex);
    +   *   });
    +   * 
    + * + * @param {function(*): (R|promise.Promise.)} errback The function + * to call if this promise is rejected. The function should expect a single + * argument: the rejection reason. + * @return {!promise.Promise.} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + thenCatch(errback: (error: any) => any): promise.Promise; + + + /** + * Registers a listener to invoke when this promise is resolved, regardless + * of whether the promise's value was successfully computed. This function + * is synonymous with the {@code finally} clause in a synchronous API: + *
    
    +   *   // Synchronous API:
    +   *   try {
    +   *     doSynchronousWork();
    +   *   } finally {
    +   *     cleanUp();
    +   *   }
    +   *
    +   *   // Asynchronous promise API:
    +   *   doAsynchronousWork().thenFinally(cleanUp);
    +   * 
    + * + * Note: similar to the {@code finally} clause, if the registered + * callback returns a rejected promise or throws an error, it will silently + * replace the rejection error (if any) from this promise: + *
    
    +   *   try {
    +   *     throw Error('one');
    +   *   } finally {
    +   *     throw Error('two');  // Hides Error: one
    +   *   }
    +   *
    +   *   promise.rejected(Error('one'))
    +   *       .thenFinally(function() {
    +   *         throw Error('two');  // Hides Error: one
    +   *       });
    +   * 
    + * + * + * @param {function(): (R|promise.Promise.)} callback The function + * to call when this promise is resolved. + * @return {!promise.Promise.} A promise that will be fulfilled + * with the callback result. + * @template R + */ + thenFinally(callback: () => any): promise.Promise; + + /** + * Registers a listener for when this promise is rejected. This is synonymous + * with the {@code catch} clause in a synchronous API: + * + * // Synchronous API: + * try { + * doSynchronousWork(); + * } catch (ex) { + * console.error(ex); + * } + * + * // Asynchronous promise API: + * doAsynchronousWork().catch(function(ex) { + * console.error(ex); + * }); + * + * @param {function(*): (R|IThenable)} errback The + * function to call if this promise is rejected. The function should + * expect a single argument: the rejection reason. + * @return {!ManagedPromise} A new promise which will be + * resolved with the result of the invoked callback. + * @template R + */ + catch(errback: Function): promise.Promise; +} + +/** + * Contains information about a WebDriver session. + */ +export class Session { + + // region Constructors + + /** + * @param {string} id The session ID. + * @param {!(Object|Capabilities)} capabilities The session + * capabilities. + * @constructor + */ + constructor(id: string, capabilities: Capabilities | Object); + + // endregion + + // region Methods + + /** + * @return {string} This session's ID. + */ + getId(): string; + + /** + * @return {!Capabilities} This session's capabilities. + */ + getCapabilities(): Capabilities; + + /** + * Retrieves the value of a specific capability. + * @param {string} key The capability to retrieve. + * @return {*} The capability value. + */ + getCapability(key: string): any; + + /** + * Returns the JSON representation of this object, which is just the string + * session ID. + * @return {string} The JSON representation of this Session. + */ + toJSON(): string; + + // endregion +} diff --git a/selenium-webdriver/v2/opera.d.ts b/selenium-webdriver/v2/opera.d.ts index 85e0788e4c..9976995e65 100644 --- a/selenium-webdriver/v2/opera.d.ts +++ b/selenium-webdriver/v2/opera.d.ts @@ -2,177 +2,173 @@ import * as webdriver from './index'; import * as remote from './remote'; -declare namespace opera { +/** + * Creates {@link remote.DriverService} instances that manages an + * [OperaDriver](https://github.com/operasoftware/operachromiumdriver) + * server in a child process. + */ +export class ServiceBuilder { /** - * Creates {@link remote.DriverService} instances that manages an - * [OperaDriver](https://github.com/operasoftware/operachromiumdriver) - * server in a child process. + * @param {string=} opt_exe Path to the server executable to use. If omitted, + * the builder will attempt to locate the operadriver on the current + * PATH. + * @throws {Error} If provided executable does not exist, or the operadriver + * cannot be found on the PATH. */ - class ServiceBuilder { - /** - * @param {string=} opt_exe Path to the server executable to use. If omitted, - * the builder will attempt to locate the operadriver on the current - * PATH. - * @throws {Error} If provided executable does not exist, or the operadriver - * cannot be found on the PATH. - */ - constructor(opt_exe?: string); - - /** - * Sets the port to start the OperaDriver on. - * @param {number} port The port to use, or 0 for any free port. - * @return {!ServiceBuilder} A self reference. - * @throws {Error} If the port is invalid. - */ - usingPort(port: number): ServiceBuilder; - - /** - * Sets the path of the log file the driver should log to. If a log file is - * not specified, the driver will log to stderr. - * @param {string} path Path of the log file to use. - * @return {!ServiceBuilder} A self reference. - */ - loggingTo(path: string): ServiceBuilder; - - /** - * Enables verbose logging. - * @return {!ServiceBuilder} A self reference. - */ - enableVerboseLogging(): ServiceBuilder; - - /** - * Silence sthe drivers output. - * @return {!ServiceBuilder} A self reference. - */ - silent(): ServiceBuilder; - - /** - * Defines the stdio configuration for the driver service. See - * {@code child_process.spawn} for more information. - * @param {(string|!Array)} - * config The configuration to use. - * @return {!ServiceBuilder} A self reference. - */ - setStdio(config: string | Array): ServiceBuilder; - - /** - * Defines the environment to start the server under. This settings will be - * inherited by every browser session started by the server. - * @param {!Object.} env The environment to use. - * @return {!ServiceBuilder} A self reference. - */ - withEnvironment(env: Object): ServiceBuilder; - - /** - * Creates a new DriverService using this instance's current configuration. - * @return {!remote.DriverService} A new driver service using this instance's - * current configuration. - * @throws {Error} If the driver exectuable was not specified and a default - * could not be found on the current PATH. - */ - build(): remote.DriverService; - } + constructor(opt_exe?: string); /** - * Sets the default service to use for new OperaDriver instances. - * @param {!remote.DriverService} service The service to use. - * @throws {Error} If the default service is currently running. + * Sets the port to start the OperaDriver on. + * @param {number} port The port to use, or 0 for any free port. + * @return {!ServiceBuilder} A self reference. + * @throws {Error} If the port is invalid. */ - function setDefaultService(service: remote.DriverService): any; + usingPort(port: number): ServiceBuilder; /** - * Returns the default OperaDriver service. If such a service has not been - * configured, one will be constructed using the default configuration for - * a OperaDriver executable found on the system PATH. - * @return {!remote.DriverService} The default OperaDriver service. + * Sets the path of the log file the driver should log to. If a log file is + * not specified, the driver will log to stderr. + * @param {string} path Path of the log file to use. + * @return {!ServiceBuilder} A self reference. */ - function getDefaultService(): remote.DriverService; + loggingTo(path: string): ServiceBuilder; /** - * Class for managing {@linkplain Driver OperaDriver} specific options. + * Enables verbose logging. + * @return {!ServiceBuilder} A self reference. */ - class Options { - /** - * Extracts the OperaDriver specific options from the given capabilities - * object. - * @param {!capabilities.Capabilities} caps The capabilities object. - * @return {!Options} The OperaDriver options. - */ - static fromCapabilities(caps: webdriver.Capabilities): Options; + enableVerboseLogging(): ServiceBuilder; - /** - * Add additional command line arguments to use when launching the Opera - * browser. Each argument may be specified with or without the '--' prefix - * (e.g. '--foo' and 'foo'). Arguments with an associated value should be - * delimited by an '=': 'foo=bar'. - * @param {...(string|!Array.)} var_args The arguments to add. - * @return {!Options} A self reference. - */ - addArguments(...var_args: Array): Options; + /** + * Silence sthe drivers output. + * @return {!ServiceBuilder} A self reference. + */ + silent(): ServiceBuilder; - /** - * Add additional extensions to install when launching Opera. Each extension - * should be specified as the path to the packed CRX file, or a Buffer for an - * extension. - * @param {...(string|!Buffer|!Array.<(string|!Buffer)>)} var_args The - * extensions to add. - * @return {!Options} A self reference. - */ - addExtensions(...var_args: Array): Options; + /** + * Defines the stdio configuration for the driver service. See + * {@code child_process.spawn} for more information. + * @param {(string|!Array)} + * config The configuration to use. + * @return {!ServiceBuilder} A self reference. + */ + setStdio(config: string | Array): ServiceBuilder; - /** - * Sets the path to the Opera binary to use. On Mac OS X, this path should - * reference the actual Opera executable, not just the application binary. The - * binary path be absolute or relative to the operadriver server executable, but - * it must exist on the machine that will launch Opera. - * - * @param {string} path The path to the Opera binary to use. - * @return {!Options} A self reference. - */ - setOperaBinaryPath(path: string): Options; + /** + * Defines the environment to start the server under. This settings will be + * inherited by every browser session started by the server. + * @param {!Object.} env The environment to use. + * @return {!ServiceBuilder} A self reference. + */ + withEnvironment(env: Object): ServiceBuilder; - /** - * Sets the logging preferences for the new session. - * @param {!./lib/logging.Preferences} prefs The logging preferences. - * @return {!Options} A self reference. - */ - setLoggingPrefs(prefs: webdriver.logging.Preferences): Options; - - /** - * Sets the proxy settings for the new session. - * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. - * @return {!Options} A self reference. - */ - setProxy(proxy: webdriver.ProxyConfig): Options; - - /** - * Converts this options instance to a {@link capabilities.Capabilities} - * object. - * @param {capabilities.Capabilities=} opt_capabilities The capabilities to - * merge these options into, if any. - * @return {!capabilities.Capabilities} The capabilities. - */ - toCapabilities(opt_capabilities?: webdriver.Capabilities): webdriver.Capabilities; - } - - class Driver extends webdriver.WebDriver { - /** - * @param {(capabilities.Capabilities|Options)=} opt_config The configuration - * options. - * @param {remote.DriverService=} opt_service The session to use; will use - * the {@link getDefaultService default service} by default. - * @param {promise.ControlFlow=} opt_flow The control flow to use, - * or {@code null} to use the currently active flow. - */ - constructor(opt_config?: webdriver.Capabilities | Options, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow); - - /** - * This function is a no-op as file detectors are not supported by this - * implementation. - * @override - */ - setFileDetector(): void; - } + /** + * Creates a new DriverService using this instance's current configuration. + * @return {!remote.DriverService} A new driver service using this instance's + * current configuration. + * @throws {Error} If the driver exectuable was not specified and a default + * could not be found on the current PATH. + */ + build(): remote.DriverService; } -export = opera; +/** + * Sets the default service to use for new OperaDriver instances. + * @param {!remote.DriverService} service The service to use. + * @throws {Error} If the default service is currently running. + */ +export function setDefaultService(service: remote.DriverService): any; + +/** + * Returns the default OperaDriver service. If such a service has not been + * configured, one will be constructed using the default configuration for + * a OperaDriver executable found on the system PATH. + * @return {!remote.DriverService} The default OperaDriver service. + */ +export function getDefaultService(): remote.DriverService; + +/** + * Class for managing {@linkplain Driver OperaDriver} specific options. + */ +export class Options { + /** + * Extracts the OperaDriver specific options from the given capabilities + * object. + * @param {!capabilities.Capabilities} caps The capabilities object. + * @return {!Options} The OperaDriver options. + */ + static fromCapabilities(caps: webdriver.Capabilities): Options; + + /** + * Add additional command line arguments to use when launching the Opera + * browser. Each argument may be specified with or without the '--' prefix + * (e.g. '--foo' and 'foo'). Arguments with an associated value should be + * delimited by an '=': 'foo=bar'. + * @param {...(string|!Array.)} var_args The arguments to add. + * @return {!Options} A self reference. + */ + addArguments(...var_args: string[]): Options; + + /** + * Add additional extensions to install when launching Opera. Each extension + * should be specified as the path to the packed CRX file, or a Buffer for an + * extension. + * @param {...(string|!Buffer|!Array.<(string|!Buffer)>)} var_args The + * extensions to add. + * @return {!Options} A self reference. + */ + addExtensions(...var_args: any[]): Options; + + /** + * Sets the path to the Opera binary to use. On Mac OS X, this path should + * reference the actual Opera executable, not just the application binary. The + * binary path be absolute or relative to the operadriver server executable, but + * it must exist on the machine that will launch Opera. + * + * @param {string} path The path to the Opera binary to use. + * @return {!Options} A self reference. + */ + setOperaBinaryPath(path: string): Options; + + /** + * Sets the logging preferences for the new session. + * @param {!./lib/logging.Preferences} prefs The logging preferences. + * @return {!Options} A self reference. + */ + setLoggingPrefs(prefs: webdriver.logging.Preferences): Options; + + /** + * Sets the proxy settings for the new session. + * @param {capabilities.ProxyConfig} proxy The proxy configuration to use. + * @return {!Options} A self reference. + */ + setProxy(proxy: webdriver.ProxyConfig): Options; + + /** + * Converts this options instance to a {@link capabilities.Capabilities} + * object. + * @param {capabilities.Capabilities=} opt_capabilities The capabilities to + * merge these options into, if any. + * @return {!capabilities.Capabilities} The capabilities. + */ + toCapabilities(opt_capabilities?: webdriver.Capabilities): webdriver.Capabilities; +} + +export class Driver extends webdriver.WebDriver { + /** + * @param {(capabilities.Capabilities|Options)=} opt_config The configuration + * options. + * @param {remote.DriverService=} opt_service The session to use; will use + * the {@link getDefaultService default service} by default. + * @param {promise.ControlFlow=} opt_flow The control flow to use, + * or {@code null} to use the currently active flow. + */ + constructor(opt_config?: webdriver.Capabilities | Options, opt_service?: remote.DriverService, opt_flow?: webdriver.promise.ControlFlow); + + /** + * This function is a no-op as file detectors are not supported by this + * implementation. + * @override + */ + setFileDetector(): void; +} diff --git a/selenium-webdriver/v2/remote.d.ts b/selenium-webdriver/v2/remote.d.ts index e9e8b2ad0d..de31a0fbe7 100644 --- a/selenium-webdriver/v2/remote.d.ts +++ b/selenium-webdriver/v2/remote.d.ts @@ -1,72 +1,106 @@ /* tslint:disable */ import * as webdriver from './index'; -declare namespace remote { +/** + * A record object that defines the configuration options for a DriverService + * instance. + * + * @record + */ +interface ServiceOptions { } + +/** + * Manages the life and death of a native executable WebDriver server. + * + * It is expected that the driver server implements the + * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol. + * Furthermore, the managed server should support multiple concurrent sessions, + * so that this class may be reused for multiple clients. + */ +export class DriverService { /** - * A record object that defines the configuration options for a DriverService - * instance. - * - * @record + * @param {string} executable Path to the executable to run. + * @param {!ServiceOptions} options Configuration options for the service. */ - interface ServiceOptions { } + constructor(executable: string, options: ServiceOptions); /** - * Manages the life and death of a native executable WebDriver server. - * - * It is expected that the driver server implements the - * https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol. - * Furthermore, the managed server should support multiple concurrent sessions, - * so that this class may be reused for multiple clients. + * @return {!promise.Promise} A promise that resolves to + * the server's address. + * @throws {Error} If the server has not been started. */ - class DriverService { - /** - * @param {string} executable Path to the executable to run. - * @param {!ServiceOptions} options Configuration options for the service. - */ - constructor(executable: string, options: ServiceOptions); + address(): webdriver.promise.Promise; - /** - * @return {!promise.Promise} A promise that resolves to - * the server's address. - * @throws {Error} If the server has not been started. - */ - address(): webdriver.promise.Promise; + /** + * Returns whether the underlying process is still running. This does not take + * into account whether the process is in the process of shutting down. + * @return {boolean} Whether the underlying service process is running. + */ + isRunning(): boolean; - /** - * Returns whether the underlying process is still running. This does not take - * into account whether the process is in the process of shutting down. - * @return {boolean} Whether the underlying service process is running. - */ - isRunning(): boolean; + /** + * Starts the server if it is not already running. + * @param {number=} opt_timeoutMs How long to wait, in milliseconds, for the + * server to start accepting requests. Defaults to 30 seconds. + * @return {!promise.Promise} A promise that will resolve + * to the server's base URL when it has started accepting requests. If the + * timeout expires before the server has started, the promise will be + * rejected. + */ + start(opt_timeoutMs?: number): webdriver.promise.Promise; - /** - * Starts the server if it is not already running. - * @param {number=} opt_timeoutMs How long to wait, in milliseconds, for the - * server to start accepting requests. Defaults to 30 seconds. - * @return {!promise.Promise} A promise that will resolve - * to the server's base URL when it has started accepting requests. If the - * timeout expires before the server has started, the promise will be - * rejected. - */ - start(opt_timeoutMs?: number): webdriver.promise.Promise; + /** + * Stops the service if it is not currently running. This function will kill + * the server immediately. To synchronize with the active control flow, use + * {@link #stop()}. + * @return {!promise.Promise} A promise that will be resolved when + * the server has been stopped. + */ + kill(): webdriver.promise.Promise; - /** - * Stops the service if it is not currently running. This function will kill - * the server immediately. To synchronize with the active control flow, use - * {@link #stop()}. - * @return {!promise.Promise} A promise that will be resolved when - * the server has been stopped. - */ - kill(): webdriver.promise.Promise; - - /** - * Schedules a task in the current control flow to stop the server if it is - * currently running. - * @return {!promise.Promise} A promise that will be resolved when - * the server has been stopped. - */ - stop(): webdriver.promise.Promise; - } + /** + * Schedules a task in the current control flow to stop the server if it is + * currently running. + * @return {!promise.Promise} A promise that will be resolved when + * the server has been stopped. + */ + stop(): webdriver.promise.Promise; } -export = remote; +/** + * 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/v2/safari.d.ts b/selenium-webdriver/v2/safari.d.ts index ac7569286a..0633f9f782 100644 --- a/selenium-webdriver/v2/safari.d.ts +++ b/selenium-webdriver/v2/safari.d.ts @@ -1,94 +1,90 @@ /* tslint:disable */ import * as webdriver from './index'; -declare namespace safari { - class Server { } +export class Server { } - /** - * @return {!Promise} A promise that will resolve with the path - * to Safari on the current system. - */ - function findSafariExecutable(): any; +/** + * @return {!Promise} A promise that will resolve with the path + * to Safari on the current system. + */ +export function findSafariExecutable(): any; - /** - * @param {string} serverUrl The URL to connect to. - * @return {!Promise} A promise for the path to a file that Safari can - * open on start-up to trigger a new connection to the WebSocket server. - */ - function createConnectFile(serverUrl: string): any; +/** + * @param {string} serverUrl The URL to connect to. + * @return {!Promise} A promise for the path to a file that Safari can + * open on start-up to trigger a new connection to the WebSocket server. + */ +export function createConnectFile(serverUrl: string): any; - /** - * Deletes all session data files if so desired. - * @param {!Object} desiredCapabilities . - * @return {!Array} A list of promises for the deleted files. - */ - function cleanSession(desiredCapabilities: webdriver.Capabilities): any[]; +/** + * Deletes all session data files if so desired. + * @param {!Object} desiredCapabilities . + * @return {!Array} A list of promises for the deleted files. + */ +export function cleanSession(desiredCapabilities: webdriver.Capabilities): any[]; - /** @return {string} . */ - function getRandomString(): string; +/** @return {string} . */ +export function getRandomString(): string; - /** - * @implements {command.Executor} - */ - class CommandExecutor { - } - - /** - * Configuration options specific to the {@link Driver SafariDriver}. - */ - class Options { - /** - * Extracts the SafariDriver specific options from the given capabilities - * object. - * @param {!Capabilities} capabilities The capabilities object. - * @return {!Options} The ChromeDriver options. - */ - static fromCapabilities(capabilities: webdriver.Capabilities): Options; - - /** - * Sets whether to force Safari to start with a clean session. Enabling this - * option will cause all global browser data to be deleted. - * @param {boolean} clean Whether to make sure the session has no cookies, - * cache entries, local storage, or databases. - * @return {!Options} A self reference. - */ - setCleanSession(clean: boolean): Options; - - /** - * Sets the logging preferences for the new session. - * @param {!./lib/logging.Preferences} prefs The logging preferences. - * @return {!Options} A self reference. - */ - setLoggingPrefs(prefs: webdriver.logging.Preferences): Options; - - /** - * Converts this options instance to a {@link Capabilities} object. - * @param {Capabilities=} opt_capabilities The capabilities to - * merge these options into, if any. - * @return {!Capabilities} The capabilities. - */ - toCapabilities(opt_capabilities: webdriver.Capabilities): webdriver.Capabilities; - } - - /** - * A WebDriver client for Safari. This class should never be instantiated - * directly; instead, use the {@linkplain ./builder.Builder Builder}: - * - * var driver = new Builder() - * .forBrowser('safari') - * .build(); - * - */ - class Driver extends webdriver.WebDriver { - /** - * @param {(Options|Capabilities)=} opt_config The configuration - * options for the new session. - * @param {promise.ControlFlow=} opt_flow The control flow to create - * the driver under. - */ - constructor(opt_config?: Options | webdriver.Capabilities, opt_flow?: webdriver.promise.ControlFlow); - - } +/** + * @implements {command.Executor} + */ +export class CommandExecutor { } -export = safari; +/** + * Configuration options specific to the {@link Driver SafariDriver}. + */ +export class Options { + /** + * Extracts the SafariDriver specific options from the given capabilities + * object. + * @param {!Capabilities} capabilities The capabilities object. + * @return {!Options} The ChromeDriver options. + */ + static fromCapabilities(capabilities: webdriver.Capabilities): Options; + + /** + * Sets whether to force Safari to start with a clean session. Enabling this + * option will cause all global browser data to be deleted. + * @param {boolean} clean Whether to make sure the session has no cookies, + * cache entries, local storage, or databases. + * @return {!Options} A self reference. + */ + setCleanSession(clean: boolean): Options; + + /** + * Sets the logging preferences for the new session. + * @param {!./lib/logging.Preferences} prefs The logging preferences. + * @return {!Options} A self reference. + */ + setLoggingPrefs(prefs: webdriver.logging.Preferences): Options; + + /** + * Converts this options instance to a {@link Capabilities} object. + * @param {Capabilities=} opt_capabilities The capabilities to + * merge these options into, if any. + * @return {!Capabilities} The capabilities. + */ + toCapabilities(opt_capabilities: webdriver.Capabilities): webdriver.Capabilities; +} + +/** + * A WebDriver client for Safari. This class should never be instantiated + * directly; instead, use the {@linkplain ./builder.Builder Builder}: + * + * var driver = new Builder() + * .forBrowser('safari') + * .build(); + * + */ +export class Driver extends webdriver.WebDriver { + /** + * @param {(Options|Capabilities)=} opt_config The configuration + * options for the new session. + * @param {promise.ControlFlow=} opt_flow The control flow to create + * the driver under. + */ + constructor(opt_config?: Options | webdriver.Capabilities, opt_flow?: webdriver.promise.ControlFlow); + +} diff --git a/selenium-webdriver/v2/test/chrome.ts b/selenium-webdriver/v2/test/chrome.ts index 6654a3685c..f9c896fbee 100644 --- a/selenium-webdriver/v2/test/chrome.ts +++ b/selenium-webdriver/v2/test/chrome.ts @@ -53,7 +53,7 @@ function TestServiceBuilder() { builder = builder.setUrlBasePath('path'); builder = builder.setStdio('config'); builder = builder.setStdio(['A', 'B']); - builder = builder.withEnvironment({ 'A': 'a', 'B': 'b' }); + builder = builder.withEnvironment({ A: 'a', B: 'b' }); } function TestChromeModule() { diff --git a/selenium-webdriver/v2/test/firefox.ts b/selenium-webdriver/v2/test/firefox.ts index ce97c7ce68..2f3aeb928c 100644 --- a/selenium-webdriver/v2/test/firefox.ts +++ b/selenium-webdriver/v2/test/firefox.ts @@ -9,7 +9,7 @@ function TestBinary() { binary.addArguments('A', 'B', 'C'); var promise: webdriver.promise.Promise = binary.kill(); - binary.launch('profile').then(function (result: any) { }); + binary.launch('profile').then((result: any) => {}); } function TestFirefoxDriver() { @@ -39,7 +39,7 @@ function TestFirefoxProfile() { var bool: boolean = profile.acceptUntrustedCerts(); profile.addExtension('ext'); bool = profile.assumeUntrustedCertIssuer(); - profile.encode().then(function (prof: string) { }); + profile.encode().then((prof: string) => {}); var num: number = profile.getPort(); var anything: any = profile.getPreference('key'); bool = profile.nativeEventsEnabled(); diff --git a/selenium-webdriver/v2/test/index.ts b/selenium-webdriver/v2/test/index.ts index ed7606ce98..ba783f86fc 100644 --- a/selenium-webdriver/v2/test/index.ts +++ b/selenium-webdriver/v2/test/index.ts @@ -29,7 +29,7 @@ function TestBuilder() { builder = builder.setEnableNativeEvents(true); builder = builder.setFirefoxOptions(new firefox.Options()); builder = builder.setLoggingPrefs(new webdriver.logging.Preferences()); - builder = builder.setLoggingPrefs({ 'key': 'value' }); + builder = builder.setLoggingPrefs({ key: 'value' }); builder = builder.setProxy({ proxyType: 'type' }); builder = builder.setScrollBehavior(1); builder = builder.usingServer('http://someserver'); @@ -90,7 +90,7 @@ function TestActionSequence() { sequence = sequence.sendKeys('A', 'B', 'C'); sequence = sequence.sendKeys('A', webdriver.Key.NULL); - sequence.perform().then(function () { }); + sequence.perform().then(() => {}); } function TestTouchSequence() { @@ -112,7 +112,7 @@ function TestTouchSequence() { sequence = sequence.flick({ xspeed: 100, yspeed: 100 }); sequence = sequence.flickElement(element, { x: 100, y: 100 }, 100); - sequence.perform().then(function () { }); + sequence.perform().then(() => {}); } function TestAlert() { @@ -122,10 +122,10 @@ function TestAlert() { var alert: webdriver.Alert = driver.switchTo().alert(); - alert.accept().then(function () { }); - alert.dismiss().then(function () { }); - alert.getText().then(function (text: string) { }); - alert.sendKeys('ABC').then(function () { }); + alert.accept().then(() => {}); + alert.dismiss().then(() => {}); + alert.getText().then((text: string) => {}); + alert.sendKeys('ABC').then(() => {}); } function TestBrowser() { @@ -165,7 +165,7 @@ function TestCapabilities() { capabilities = capabilities.set(webdriver.Capability.VERSION, { abc: 'def' }); capabilities = capabilities.set(webdriver.Capability.VERSION, null); capabilities = capabilities.setLoggingPrefs(new webdriver.logging.Preferences()); - capabilities = capabilities.setLoggingPrefs({ 'key': 'value' }); + capabilities = capabilities.setLoggingPrefs({ key: 'value' }); capabilities = capabilities.setProxy({ proxyType: 'Type' }); capabilities = capabilities.setEnableNativeEvents(true); capabilities = capabilities.setScrollBehavior(1); @@ -329,7 +329,7 @@ function TestCommandName() { function TestEventEmitter() { var emitter: webdriver.EventEmitter = new webdriver.EventEmitter(); - var callback = function (a: number, b: number, c: number) { }; + var callback = (a: number, b: number, c: number) => {}; emitter = emitter.addListener('ABC', callback); emitter = emitter.addListener('ABC', callback, this); @@ -454,7 +454,7 @@ function TestBy() { locatorHash = { tagName: 'tag' }; locatorHash = { xpath: 'xpath' }; - webdriver.By.js('script', 1, 2, 3)(driver).then(function (abc: number) { }); + webdriver.By.js('script', 1, 2, 3)(driver).then((abc: number) => {}); } function TestSession() { @@ -471,11 +471,11 @@ function TestSession() { } function TestUnhandledAlertError() { - var someFunc = function (error: webdriver.UnhandledAlertError) { + var someFunc = (error: webdriver.UnhandledAlertError) => { var baseError: Error = error; var str: string = error.getAlertText(); str = error.toString(); - } + }; } function TestWebDriverFileDetector() { @@ -485,7 +485,7 @@ function TestWebDriverFileDetector() { var fileDetector: webdriver.FileDetector = new webdriver.FileDetector(); - fileDetector.handleFile(driver, 'path/to/file').then(function (path: string) { }); + fileDetector.handleFile(driver, 'path/to/file').then((path: string) => {}); } function TestWebDriverLogs() { @@ -495,8 +495,8 @@ function TestWebDriverLogs() { var logs: webdriver.Logs = new webdriver.Logs(driver); - logs.get(webdriver.logging.Type.BROWSER).then(function (entries: webdriver.logging.Entry[]) { });; - logs.getAvailableLogTypes().then(function (types: string[]) { }); + logs.get(webdriver.logging.Type.BROWSER).then((entries: webdriver.logging.Entry[]) => {}); + logs.getAvailableLogTypes().then((types: string[]) => {}); } function TestWebDriverNavigation() { @@ -506,10 +506,10 @@ function TestWebDriverNavigation() { var navigation: webdriver.Navigation = new webdriver.Navigation(driver); - navigation.back().then(function () { }); - navigation.forward().then(function () { }); - navigation.refresh().then(function () { }); - navigation.to('http://google.com').then(function () { }); + navigation.back().then(() => {}); + navigation.forward().then(() => {}); + navigation.refresh().then(() => {}); + navigation.to('http://google.com').then(() => {}); } function TestWebDriverOptions() { @@ -530,8 +530,8 @@ function TestWebDriverOptions() { promise = options.deleteAllCookies(); promise = options.deleteCookie('name'); - options.getCookie('name').then(function (cookies: webdriver.IWebDriverOptionsCookie) { }); - options.getCookies().then(function (cookies: webdriver.IWebDriverOptionsCookie[]) { }); + options.getCookie('name').then((cookies: webdriver.IWebDriverOptionsCookie) => {}); + options.getCookies().then((cookies: webdriver.IWebDriverOptionsCookie[]) => {}); var logs: webdriver.Logs = options.logs(); var timeouts: webdriver.Timeouts = options.timeouts(); @@ -601,10 +601,10 @@ function TestWebDriver() { var touchActions: webdriver.TouchSequence = driver.touchActions(); // call - stringPromise = driver.call(function () { return 'value'; }); - stringPromise = driver.call(function () { return stringPromise; }); - stringPromise = driver.call(function () { var d: any = this; return 'value'; }, driver); - stringPromise = driver.call(function (a: number) { return 'value'; }, driver, 1); + stringPromise = driver.call(() => 'value'); + stringPromise = driver.call(() => stringPromise); + stringPromise = driver.call(() => { var d: any = this; return 'value'; }, driver); + stringPromise = driver.call((a: number) => 'value', driver, 1); voidPromise = driver.close(); flow = driver.controlFlow(); @@ -612,14 +612,14 @@ function TestWebDriver() { // executeAsyncScript stringPromise = driver.executeAsyncScript('function(){}'); stringPromise = driver.executeAsyncScript('function(){}', 1, 2, 3); - stringPromise = driver.executeAsyncScript(function () { }); - stringPromise = driver.executeAsyncScript(function (a: number) { }, 1); + stringPromise = driver.executeAsyncScript(() => {}); + stringPromise = driver.executeAsyncScript((a: number) => {}, 1); // executeScript stringPromise = driver.executeScript('function(){}'); stringPromise = driver.executeScript('function(){}', 1, 2, 3); - stringPromise = driver.executeScript(function () { }); - stringPromise = driver.executeScript(function (a: number) { }, 1); + stringPromise = driver.executeScript(() => {}); + stringPromise = driver.executeScript((a: number) => {}, 1); // findElement var element: webdriver.WebElement; @@ -627,15 +627,15 @@ function TestWebDriver() { element = driver.findElement(webdriver.By.js('function(){}')); // findElements - driver.findElements(webdriver.By.className('ABC')).then(function (elements: webdriver.WebElement[]) { }); - driver.findElements(webdriver.By.js('function(){}')).then(function (elements: webdriver.WebElement[]) { }); + driver.findElements(webdriver.By.className('ABC')).then((elements: webdriver.WebElement[]) => {}); + driver.findElements(webdriver.By.js('function(){}')).then((elements: webdriver.WebElement[]) => {}); voidPromise = driver.get('http://www.google.com'); - driver.getAllWindowHandles().then(function (handles: string[]) { }); - driver.getCapabilities().then(function (caps: webdriver.Capabilities) { }); + driver.getAllWindowHandles().then((handles: string[]) => {}); + driver.getCapabilities().then((caps: webdriver.Capabilities) => {}); stringPromise = driver.getCurrentUrl(); - stringPromise = driver.getPageSource() - driver.getSession().then(function (session: webdriver.Session) { });; + stringPromise = driver.getPageSource(); + driver.getSession().then((session: webdriver.Session) => {}); stringPromise = driver.getTitle(); stringPromise = driver.getWindowHandle(); @@ -657,8 +657,8 @@ function TestWebDriver() { var booleanCondition: webdriver.until.Condition; booleanPromise = driver.wait(booleanPromise); booleanPromise = driver.wait(booleanCondition); - booleanPromise = driver.wait(function (driver: webdriver.WebDriver) { return true; }); - let conditionFunction: Function; + booleanPromise = driver.wait((driver: webdriver.WebDriver) => true); + let conditionFunction: Function; // tslint:disable-line:prefer-const booleanPromise = driver.wait(conditionFunction); booleanPromise = driver.wait(booleanPromise, 123); booleanPromise = driver.wait(booleanPromise, 123, 'Message'); @@ -691,16 +691,16 @@ function TestWebElement() { voidPromise = element.click(); element = element.findElement(webdriver.By.id('ABC')); - element.findElements(webdriver.By.className('ABC')).then(function (elements: webdriver.WebElement[]) { }); + element.findElements(webdriver.By.className('ABC')).then((elements: webdriver.WebElement[]) => {}); booleanPromise = element.isElementPresent(webdriver.By.className('ABC')); stringPromise = element.getAttribute('class'); stringPromise = element.getCssValue('display'); driver = element.getDriver(); stringPromise = element.getInnerHtml(); - element.getLocation().then(function (location: webdriver.ILocation) { }); + element.getLocation().then((location: webdriver.ILocation) => {}); stringPromise = element.getOuterHtml(); - element.getSize().then(function (size: webdriver.ISize) { }); + element.getSize().then((size: webdriver.ISize) => {}); stringPromise = element.getTagName(); stringPromise = element.getText(); booleanPromise = element.isDisplayed(); @@ -712,9 +712,9 @@ function TestWebElement() { voidPromise = element.sendKeys(stringPromise, stringPromise, stringPromise); voidPromise = element.sendKeys('A', 1, webdriver.Key.BACK_SPACE, stringPromise); voidPromise = element.submit(); - element.getId().then(function (id: string) { }); - element.getRawId().then(function (id: string) { }); - element.serialize().then(function (id: webdriver.IWebElementId) { }); + element.getId().then((id: string) => {}); + element.getRawId().then((id: string) => {}); + element.serialize().then((id: webdriver.IWebElementId) => {}); booleanPromise = webdriver.WebElement.equals(element, new webdriver.WebElement(driver, 'elementId')); } @@ -732,13 +732,13 @@ function TestWebElementPromise() { var bool: boolean = elementPromise.isPending(); elementPromise.then(); - elementPromise.then(function (element: webdriver.WebElement) { }); - elementPromise.then(function (element: webdriver.WebElement) { }, function (error: any) { }); - elementPromise.then(function (element: webdriver.WebElement) { return 'foo'; }, function (error: any) { }).then(function (result: string) { }); + elementPromise.then((element: webdriver.WebElement) => {}); + elementPromise.then((element: webdriver.WebElement) => {}, (error: any) => {}); + elementPromise.then((element: webdriver.WebElement) => 'foo', (error: any) => {}).then((result: string) => {}); - elementPromise.thenCatch(function (error: any) { }).then(function (value: any) { }); + elementPromise.thenCatch((error: any) => {}).then((value: any) => {}); - elementPromise.thenFinally(function () { }); + elementPromise.thenFinally(() => {}); } function TestLogging() { @@ -795,52 +795,51 @@ function TestPromiseModule() { var booleanPromise: webdriver.promise.Promise; var voidPromise: webdriver.promise.Promise; - webdriver.promise.all([stringPromise]).then(function (values: string[]) { }); + webdriver.promise.all([stringPromise]).then((values: string[]) => {}); - webdriver.promise.asap('abc', function (value: any) { return true; }); - webdriver.promise.asap('abc', function (value: any) { }, function (err: any) { return 'ABC'; }); + webdriver.promise.asap('abc', (value: any) => true); + webdriver.promise.asap('abc', (value: any) => {}, (err: any) => 'ABC'); - stringPromise = webdriver.promise.checkedNodeCall(function (err: any, value: any) { return 'abc'; }); + stringPromise = webdriver.promise.checkedNodeCall((err: any, value: any) => 'abc'); - webdriver.promise.consume(function () { + webdriver.promise.consume(() => { return 5; - }).then(function (value: number) { }); - webdriver.promise.consume(function () { + }).then((value: number) => {}); + webdriver.promise.consume(() => { return 5; - }, this).then(function (value: number) { }); - webdriver.promise.consume(function (a: number, b: number, c: number) { - return 5; - }, this, 1, 2, 3).then(function (value: number) { }); + }, this).then((value: number) => {}); + webdriver.promise.consume((a: number, b: number, c: number) => 5, this, 1, 2, 3) + .then((value: number) => {}); - var numbersPromise: webdriver.promise.Promise = webdriver.promise.filter([1, 2, 3], function (element: number, type: any, index: number, arr: number[]) { + var numbersPromise: webdriver.promise.Promise = webdriver.promise.filter([1, 2, 3], (element: number, type: any, index: number, arr: number[]) => { return true; }); - numbersPromise = webdriver.promise.filter([1, 2, 3], function (element: number, type: any, index: number, arr: number[]) { + numbersPromise = webdriver.promise.filter([1, 2, 3], (element: number, type: any, index: number, arr: number[]) => { return true; }, this); - numbersPromise = webdriver.promise.filter(numbersPromise, function (element: number, type: any, index: number, arr: number[]) { + numbersPromise = webdriver.promise.filter(numbersPromise, (element: number, type: any, index: number, arr: number[]) => { return true; }); - numbersPromise = webdriver.promise.filter(numbersPromise, function (element: number, type: any, index: number, arr: number[]) { + numbersPromise = webdriver.promise.filter(numbersPromise, (element: number, type: any, index: number, arr: number[]) => { return true; }, this); - numbersPromise = webdriver.promise.map([1, 2, 3], function (el: number, type: any, index: number, arr: number[]) { + numbersPromise = webdriver.promise.map([1, 2, 3], (el: number, type: any, index: number, arr: number[]) => { return true; }); - numbersPromise = webdriver.promise.map([1, 2, 3], function (el: number, type: any, index: number, arr: number[]) { + numbersPromise = webdriver.promise.map([1, 2, 3], (el: number, type: any, index: number, arr: number[]) => { return true; }, this); - numbersPromise = webdriver.promise.map(numbersPromise, function (el: number, type: any, index: number, arr: number[]) { + numbersPromise = webdriver.promise.map(numbersPromise, (el: number, type: any, index: number, arr: number[]) => { return true; }); - numbersPromise = webdriver.promise.map(numbersPromise, function (el: number, type: any, index: number, arr: number[]) { + numbersPromise = webdriver.promise.map(numbersPromise, (el: number, type: any, index: number, arr: number[]) => { return true; }, this); var flow: webdriver.promise.ControlFlow = webdriver.promise.controlFlow(); - stringPromise = webdriver.promise.createFlow(function (newFlow: webdriver.promise.ControlFlow) { return 'ABC' }); + stringPromise = webdriver.promise.createFlow((newFlow: webdriver.promise.ControlFlow) => 'ABC'); var deferred: webdriver.promise.Deferred; deferred = webdriver.promise.defer(); @@ -858,14 +857,14 @@ function TestPromiseModule() { stringPromise = webdriver.promise.fullyResolved('abc'); - var bool: boolean = webdriver.promise.isGenerator(function () { }); + var bool: boolean = webdriver.promise.isGenerator(() => {}); var isPromise: boolean = webdriver.promise.isPromise('ABC'); stringPromise = webdriver.promise.rejected('{a: 123}'); webdriver.promise.setDefaultFlow(new webdriver.promise.ControlFlow()); - numberPromise = webdriver.promise.when('abc', function (value: any) { return 123; }, function (err: Error) { return 123; }); + numberPromise = webdriver.promise.when('abc', (value: any) => 123, (err: Error) => 123); } function TestUntilModule() { @@ -873,7 +872,7 @@ function TestUntilModule() { withCapabilities(webdriver.Capabilities.chrome()). build(); - var conditionB: webdriver.until.Condition = new webdriver.until.Condition('message', function (driver: webdriver.WebDriver) { return true; }); + var conditionB: webdriver.until.Condition = new webdriver.until.Condition('message', (driver: webdriver.WebDriver) => true); var conditionBBase: webdriver.until.Condition = conditionB; var conditionWebElement: webdriver.until.Condition; var conditionWebElements: webdriver.until.Condition; @@ -913,9 +912,9 @@ function TestControlFlow() { eventType = webdriver.promise.ControlFlow.EventType.UNCAUGHT_EXCEPTION; var stringPromise: webdriver.promise.Promise; - stringPromise = flow.execute(function () { return 'value'; }); - stringPromise = flow.execute(function () { return stringPromise; }); - stringPromise = flow.execute(function () { return stringPromise; }, 'Description'); + stringPromise = flow.execute(() => 'value'); + stringPromise = flow.execute(() => stringPromise); + stringPromise = flow.execute(() => stringPromise, 'Description'); var schedule: string; schedule = flow.toString(); @@ -929,9 +928,9 @@ function TestControlFlow() { stringPromise = flow.wait(stringPromise); - voidPromise = flow.wait(function () { return true; }); - voidPromise = flow.wait(function () { return true; }, 123); - voidPromise = flow.wait(function () { return stringPromise; }, 123, 'Timeout Message'); + voidPromise = flow.wait(() => true); + voidPromise = flow.wait(() => true, 123); + voidPromise = flow.wait(() => stringPromise, 123, 'Timeout Message'); } function TestDeferred() { @@ -953,28 +952,22 @@ function TestDeferred() { function TestPromiseClass() { var controlFlow: webdriver.promise.ControlFlow; var promise: webdriver.promise.Promise; - promise = new webdriver.promise.Promise(function ( - resolve: (value: string) => void, - reject: () => void) { }); - promise = new webdriver.promise.Promise(function ( - resolve: (value: webdriver.promise.Promise) => void, - reject: () => void) { }); - promise = new webdriver.promise.Promise(function ( - resolve: (value: string) => void, - reject: () => void) { }, controlFlow); + promise = new webdriver.promise.Promise((resolve: (value: string) => void, reject: () => void) => {}); + promise = new webdriver.promise.Promise((resolve: (value: webdriver.promise.Promise) => void, reject: () => void) => {}); + promise = new webdriver.promise.Promise((resolve: (value: string) => void, reject: () => void) => {}, controlFlow); promise.cancel('Abort'); var isPending: boolean = promise.isPending(); promise = promise.then(); - promise = promise.then(function (a: string) { return 'cde'; }); - promise = promise.then(function (a: string) { return 'cde'; }, function (e: any) { }); - promise = promise.then(function (a: string) { return 'cde'; }, function (e: any) { return 123; }); + promise = promise.then((a: string) => 'cde'); + promise = promise.then((a: string) => 'cde', (e: any) => {}); + promise = promise.then((a: string) => 'cde', (e: any) => 123); - promise = promise.thenCatch(function (error: any) { }); + promise = promise.thenCatch((error: any) => {}); - promise.thenFinally(function () { }); + promise.thenFinally(() => {}); } function TestThenableClass() { @@ -986,13 +979,13 @@ function TestThenableClass() { var isPending: boolean = thenable.isPending(); - thenable = thenable.then(function (a: string) { return 'cde'; }); - thenable = thenable.then(function (a: string) { return 'cde'; }, function (e: any) { }); - thenable = thenable.then(function (a: string) { return 'cde'; }, function (e: any) { return 123; }); + thenable = thenable.then((a: string) => 'cde'); + thenable = thenable.then((a: string) => 'cde', (e: any) => {}); + thenable = thenable.then((a: string) => 'cde', (e: any) => 123); - thenable = thenable.thenCatch(function (error: any) { }); + thenable = thenable.thenCatch((error: any) => {}); - thenable.thenFinally(function () { }); + thenable.thenFinally(() => {}); } function TestErrorCode() { @@ -1030,29 +1023,29 @@ async function TestAsyncAwaitable() { } function TestTestingModule() { - testing.before(function () { + testing.before(() => { }); - testing.beforeEach(function () { + testing.beforeEach(() => { }); - testing.describe('My test suite', function () { - testing.it('My test', function () { + testing.describe('My test suite', () => { + testing.it('My test', () => { }); - testing.iit('My exclusive test.', function () { + testing.iit('My exclusive test.', () => { }); }); - testing.xdescribe('My disabled suite', function () { - testing.xit('My disabled test.', function () { + testing.xdescribe('My disabled suite', () => { + testing.xit('My disabled test.', () => { }); }); - testing.after(function () { + testing.after(() => { }); - testing.afterEach(function () { + testing.afterEach(() => { }); } diff --git a/selenium-webdriver/v2/test/remote.ts b/selenium-webdriver/v2/test/remote.ts new file mode 100644 index 0000000000..08722d5b1f --- /dev/null +++ b/selenium-webdriver/v2/test/remote.ts @@ -0,0 +1,13 @@ +/* tslint:disable */ + +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/v2/testing.d.ts b/selenium-webdriver/v2/testing.d.ts index 32c9259094..ec8e7123d7 100644 --- a/selenium-webdriver/v2/testing.d.ts +++ b/selenium-webdriver/v2/testing.d.ts @@ -1,64 +1,60 @@ /* tslint:disable */ -declare namespace testing { - /** - * Registers a new test suite. - * @param name The suite name. - * @param fn The suite function, or {@code undefined} to define a pending test suite. - */ - function describe(name: string, fn: Function): void; +/** +* Registers a new test suite. +* @param name The suite name. +* @param fn The suite function, or {@code undefined} to define a pending test suite. +*/ +export function describe(name: string, fn: Function): void; - /** - * Defines a suppressed test suite. - * @param name The suite name. - * @param fn The suite function, or {@code undefined} to define a pending test suite. - */ - function xdescribe(name: string, fn: Function): void; +/** + * Defines a suppressed test suite. + * @param name The suite name. + * @param fn The suite function, or {@code undefined} to define a pending test suite. + */ +export function xdescribe(name: string, fn: Function): void; - /** - * Register a function to call after the current suite finishes. - * @param fn - */ - function after(fn: Function): void; +/** + * Register a function to call after the current suite finishes. + * @param fn + */ +export function after(fn: Function): void; - /** - * Register a function to call after each test in a suite. - * @param fn - */ - function afterEach(fn: Function): void; +/** + * Register a function to call after each test in a suite. + * @param fn + */ +export function afterEach(fn: Function): void; - /** - * Register a function to call before the current suite starts. - * @param fn - */ - function before(fn: Function): void; +/** + * Register a function to call before the current suite starts. + * @param fn + */ +export function before(fn: Function): void; - /** - * Register a function to call before each test in a suite. - * @param fn - */ - function beforeEach(fn: Function): void; +/** + * Register a function to call before each test in a suite. + * @param fn + */ +export function beforeEach(fn: Function): void; - /** - * Add a test to the current suite. - * @param name The test name. - * @param fn The test function, or {@code undefined} to define a pending test case. - */ - function it(name: string, fn: Function): void; +/** + * Add a test to the current suite. + * @param name The test name. + * @param fn The test function, or {@code undefined} to define a pending test case. + */ +export function it(name: string, fn: Function): void; - /** - * An alias for {@link #it()} that flags the test as the only one that should - * be run within the current suite. - * @param name The test name. - * @param fn The test function, or {@code undefined} to define a pending test case. - */ - function iit(name: string, fn: Function): void; +/** + * An alias for {@link #it()} that flags the test as the only one that should + * be run within the current suite. + * @param name The test name. + * @param fn The test function, or {@code undefined} to define a pending test case. + */ +export function iit(name: string, fn: Function): void; - /** - * Adds a test to the current suite while suppressing it so it is not run. - * @param name The test name. - * @param fn The test function, or {@code undefined} to define a pending test case. - */ - function xit(name: string, fn: Function): void; -} - -export = testing; +/** + * Adds a test to the current suite while suppressing it so it is not run. + * @param name The test name. + * @param fn The test function, or {@code undefined} to define a pending test case. + */ +export function xit(name: string, fn: Function): void; diff --git a/selenium-webdriver/v2/tsconfig.json b/selenium-webdriver/v2/tsconfig.json index e1c6dcdce1..2849e3669b 100644 --- a/selenium-webdriver/v2/tsconfig.json +++ b/selenium-webdriver/v2/tsconfig.json @@ -1,10 +1,10 @@ { "compilerOptions": { "module": "commonjs", + "target": "es6", "lib": [ "es6" ], - "target": "es6", "noImplicitAny": true, "noImplicitThis": false, "strictNullChecks": false, @@ -34,6 +34,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 cebf787454d64884e1ff2306d62148018eb401ac Mon Sep 17 00:00:00 2001 From: cwmoo740 Date: Tue, 7 Mar 2017 23:14:25 -0500 Subject: [PATCH 388/797] react-day-picker add tslint.json --- react-day-picker/tslint.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 react-day-picker/tslint.json diff --git a/react-day-picker/tslint.json b/react-day-picker/tslint.json new file mode 100644 index 0000000000..ec365f164b --- /dev/null +++ b/react-day-picker/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} From a45eb5ec85c5c5ba5183ccf82e75aa75c04e5969 Mon Sep 17 00:00:00 2001 From: cwmoo740 Date: Tue, 7 Mar 2017 23:22:30 -0500 Subject: [PATCH 389/797] react-day-picker add types react and reformat tsconfig.json --- react-day-picker/tsconfig.json | 46 ++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/react-day-picker/tsconfig.json b/react-day-picker/tsconfig.json index 943c51e1e6..4cf47535ad 100644 --- a/react-day-picker/tsconfig.json +++ b/react-day-picker/tsconfig.json @@ -1,24 +1,26 @@ { - "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" - ] + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "jsx": "react", + "typeRoots": [ + "../" + ], + "types": [ + "react" + ], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-day-picker-tests.tsx" + ] } From 60a8ba65e05048e097fdfa74b7fce9d9f19b92f7 Mon Sep 17 00:00:00 2001 From: cwmoo740 Date: Tue, 7 Mar 2017 23:23:02 -0500 Subject: [PATCH 390/797] react-day-picker redo types to external module syntax, fix missing fields --- react-day-picker/index.d.ts | 252 +++++++++++++++++++++--------------- 1 file changed, 148 insertions(+), 104 deletions(-) diff --git a/react-day-picker/index.d.ts b/react-day-picker/index.d.ts index 01c5492922..e50ff542b0 100644 --- a/react-day-picker/index.d.ts +++ b/react-day-picker/index.d.ts @@ -1,113 +1,157 @@ -// Type definitions for react-day-picker v1.2.0 +// Type definitions for react-day-picker 1.2 // Project: https://github.com/gpbl/react-day-picker // Definitions by: Giampaolo Bellavite , Jason Killian // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -/// +import * as React from 'react'; -declare module "react-day-picker" { - import DayPicker = ReactDayPicker.DayPicker; - export = DayPicker; +interface LocaleUtils { + formatDay(day: Date, locale: string): string; + formatMonthTitle(month: Date, locale: string): string; + formatWeekdayLong(weekday: number, locale: string): string; + formatWeekdayShort(weekday: number, locale: string): string; + getFirstDayOfWeek(locale: string): number; + getMonths(locale: string): [string, string, string, string, string, string, string, string, string, string, string, string]; } -declare var DayPicker: typeof ReactDayPicker.DayPicker; - -declare namespace ReactDayPicker { - interface LocaleUtils { - formatMonthTitle: (month: Date, locale: string) => string; - formatWeekdayShort: (weekday: number, locale: string) => string; - formatWeekdayLong: (weekday: number, locale: string) => string; - getFirstDayOfWeek: (locale: string) => number; - getMonths: (locale: string) => string[]; - } - - interface DayModifiers { - selected?: boolean; - disabled?: boolean; - [name: string]: boolean | undefined; - } - - interface Modifiers { - [name: string]: (date: Date) => boolean; - } - - interface CaptionElementProps extends React.Props { - date?: Date; - localeUtils?: LocaleUtils; - locale?: string; - onClick?: React.MouseEventHandler<{}>; - } - - interface NavbarElementProps extends React.Props { - className?: string; - previousMonth?: Date; - nextMonth?: Date; - showPreviousButton?: boolean; - showNextButton?: boolean; - onPreviousClick(): void; - onNextClick(): void; - dir?: string; - localeUtils?: LocaleUtils; - locale?: string; - - } - - interface WeekdayElementProps extends React.Props { - weekday?: number; - className?: string; - localeUtils?: LocaleUtils; - locale?: string; - } - - interface Props extends React.Props{ - modifiers?: Modifiers; - initialMonth?: Date; - numberOfMonths?: number; - renderDay?: (date: Date) => number | string | JSX.Element; - enableOutsideDays?: boolean; - firstDayOfWeek?:number; - canChangeMonth?: boolean; - disabledDays?: (date: Date) => boolean; - fixedWeeks?: boolean; - fromMonth?: Date; - reverseMonths?: boolean; - toMonth?: Date; - localeUtils?: LocaleUtils; - locale?: string; - captionElement?: React.ReactElement; - onDayClick?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; - onDayTouchTap?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; - onDayMouseEnter?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; - onDayMouseLeave?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; - onDayTouchEnd?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; - onDayTouchStart?: (e: React.SyntheticEvent<{}>, day: Date, modifiers: DayModifiers) => any; - navbarElement?: React.ReactElement; - weekdayElement?: React.ReactElement; - onMonthChange?: (month: Date) => any; - onCaptionClick?: (e: React.SyntheticEvent<{}>, month: Date) => any; - className?: string; - selectedDays?: (date: Date) => boolean; - style?: React.CSSProperties; - tabIndex?: number; - } - - class DayPicker extends React.Component { - showMonth(month: Date): void; - showPreviousMonth(): void; - showNextMonth(): void; - } - - namespace DayPicker { - var LocaleUtils: LocaleUtils; - namespace DateUtils { - function addMonths(d: Date, n: number): Date; - function clone(d: Date): Date; - function isSameDay(d1?: Date, d2?: Date): boolean; - function isPastDay(d: Date): boolean; - function isDayBetween(day: Date, startDate: Date, endDate: Date): boolean; - function addDayToRange(day: Date, range: { from?: Date, to?: Date }): { from?: Date, to?: Date }; - function isDayInRange(day: Date, range: { from?: Date, to?: Date }): boolean; - } - } +interface DateUtils { + addMonths(d: Date, n: number): Date; + clone(d: Date): Date; + isSameDay(d1: Date, d2: Date): Date; + isPastDay(d: Date): boolean; + isFutureDay(d: Date): boolean; + isDayBetween(day: Date, begin: Date, end: Date): boolean; + addDayToRange(day: Date, range: RangeModifier): RangeModifier; + isDayInRange(day: Date, range: RangeModifier): boolean; } + +interface CaptionElementProps { + date: Date; + localeUtils: LocaleUtils; + locale: string; + onClick: typeof Props.onCaptionClick; +} + +interface NavbarElementProps { + className: string; + previousMonth: Date; + nextMonth: Date; + showPreviousButton: boolean; + showNextButton: boolean; + onPreviousClick(): void; + onNextClick(): void; + dir: string; + localeUtils: LocaleUtils; + locale: string; +} + +interface WeekdayElementProps { + weekday: number; + className: string; + localeUtils: LocaleUtils; + locale: string; +} + +interface ClassNames { + container: string; + interactionDisabled: string; + navBar: string; + navButtonPrev: string; + navButtonNext: string; + + month: string; + caption: string; + weekdays: string; + weekdaysRow: string; + weekday: string; + body: string; + week: string; + day: string; + + today: string; + selected: string; + disabled: string; + outside: string; +} + +interface RangeModifier { + from: Date; + to: Date; +} +interface BeforeModifier { + before: Date; +} +interface AfterModifier { + after: Date; +} +interface FunctionModifier { + (date: Date): boolean; +} +type Modifier = RangeModifier | BeforeModifier | AfterModifier | FunctionModifier; + +interface Modifiers { + today: Modifier | Modifier[]; + outside: Modifier | Modifier[]; + [other: string]: Modifier | Modifier[] | undefined; +} + +interface Props { + canChangeMonth?: boolean; + captionElement?: React.SFC; + className?: string; + classNames?: ClassNames; + containerProps?: React.HTMLAttributes; + disabledDays?: Modifier | Modifier[]; + enableOutsideDays?: boolean; + firstDayOfWeek?: number; + fixedWeeks?: boolean; + fromMonth?: Date; + initialMonth?: Date; + labels?: { previousMonth: string; nextMonth: string; }; + locale?: string; + localeUtils?: LocaleUtils; + modifiers?: Modifiers; + month?: Date; + months?: [string, string, string, string, string, string, string, string, string, string, string, string]; + navbarElement?: React.SFC | React.ComponentClass; + numberOfMonths?: number; + onBlur?(e: React.FocusEvent): void; + onCaptionClick?(month: Date, e: React.MouseEvent): void; + onDayClick?(day: Date, modifiers: Modifiers, e: React.MouseEvent): void; + onDayKeyDown?(day: Date, modifiers: Modifiers, e: React.KeyboardEvent): void; + onDayMouseEnter?(day: Date, modifiers: Modifiers, e: React.MouseEvent): void; + onDayMouseLeave?(day: Date, modifiers: Modifiers, e: React.MouseEvent): void; + onDayTouchEnd?(day: Date, modifiers: Modifiers, e: React.TouchEvent): void; + onDayTouchStart?(day: Date, modifiers: Modifiers, e: React.TouchEvent): void; + onFocus?(e: React.FocusEvent): void; + onKeyDown?(e: React.KeyboardEvent): void; + onMonthChange?(month: Date): void; + pagedNavigation?: boolean; + renderDay?(date: Date, modifiers: Modifiers): React.ReactNode; + reverseMonths?: boolean; + selectedDays?: Modifier | Modifier[]; + toMonth?: Date; + weekdayElement?: React.SFC | React.ComponentClass; + weekdaysLong?: [string, string, string, string, string, string, string]; + weekdaysShort?: [string, string, string, string, string, string, string]; +} + + +class DayPicker extends React.Component { + showMonth(month: Date): void; + + showPreviousMonth(): void; + + showNextMonth(): void; + + showPreviousYear(): void; + + showNextYear(): void; + + static readonly VERSION: string; + static readonly LocaleUtils: LocaleUtils; + static readonly DateUtils: DateUtils; +} + +export = DayPicker; From 7d55759e192e42ff871ee148a95b8707fd79c3a6 Mon Sep 17 00:00:00 2001 From: cwmoo740 Date: Wed, 8 Mar 2017 00:35:03 -0500 Subject: [PATCH 391/797] react-day-picker merge types into namespace for export = syntax --- react-day-picker/index.d.ts | 270 ++++++++++++++++++------------------ 1 file changed, 135 insertions(+), 135 deletions(-) diff --git a/react-day-picker/index.d.ts b/react-day-picker/index.d.ts index e50ff542b0..3f166a0c84 100644 --- a/react-day-picker/index.d.ts +++ b/react-day-picker/index.d.ts @@ -6,139 +6,143 @@ import * as React from 'react'; -interface LocaleUtils { - formatDay(day: Date, locale: string): string; - formatMonthTitle(month: Date, locale: string): string; - formatWeekdayLong(weekday: number, locale: string): string; - formatWeekdayShort(weekday: number, locale: string): string; - getFirstDayOfWeek(locale: string): number; - getMonths(locale: string): [string, string, string, string, string, string, string, string, string, string, string, string]; +declare namespace DayPicker { + export interface LocaleUtils { + formatDay(day: Date, locale: string): string; + formatMonthTitle(month: Date, locale: string): string; + formatWeekdayLong(weekday: number, locale: string): string; + formatWeekdayShort(weekday: number, locale: string): string; + getFirstDayOfWeek(locale: string): number; + getMonths(locale: string): [string, string, string, string, string, string, string, string, string, string, string, string]; + } + + export interface DateUtils { + addMonths(d: Date, n: number): Date; + clone(d: Date): Date; + isSameDay(d1: Date, d2: Date): Date; + isPastDay(d: Date): boolean; + isFutureDay(d: Date): boolean; + isDayBetween(day: Date, begin: Date, end: Date): boolean; + addDayToRange(day: Date, range: RangeModifier): RangeModifier; + isDayInRange(day: Date, range: RangeModifier): boolean; + } + + export interface CaptionElementProps { + date?: Date; + localeUtils?: LocaleUtils; + locale?: string; + onClick?(month: Date, e: React.MouseEvent): void; + } + + export interface NavbarElementProps { + className?: string; + previousMonth?: Date; + nextMonth?: Date; + showPreviousButton?: boolean; + showNextButton?: boolean; + onPreviousClick?(): void; + onNextClick?(): void; + dir?: string; + localeUtils?: LocaleUtils; + locale?: string; + } + + export interface WeekdayElementProps { + weekday?: number; + className?: string; + localeUtils?: LocaleUtils; + locale?: string; + } + + export interface ClassNames { + container: string; + interactionDisabled: string; + navBar: string; + navButtonPrev: string; + navButtonNext: string; + + month: string; + caption: string; + weekdays: string; + weekdaysRow: string; + weekday: string; + body: string; + week: string; + day: string; + + today: string; + selected: string; + disabled: string; + outside: string; + } + + export interface RangeModifier { + from: Date; + to: Date; + } + export interface BeforeModifier { + before: Date; + } + export interface AfterModifier { + after: Date; + } + export interface FunctionModifier { + (date: Date): boolean; + } + export type Modifier = RangeModifier | BeforeModifier | AfterModifier | FunctionModifier; + + export interface Modifiers { + today: Modifier | Modifier[]; + outside: Modifier | Modifier[]; + [other: string]: Modifier | Modifier[] | undefined; + } + + export interface Props { + canChangeMonth?: boolean; + captionElement?: React.ReactElement; + className?: string; + classNames?: ClassNames; + containerProps?: React.HTMLAttributes; + disabledDays?: Modifier | Modifier[]; + enableOutsideDays?: boolean; + firstDayOfWeek?: number; + fixedWeeks?: boolean; + fromMonth?: Date; + initialMonth?: Date; + labels?: { previousMonth: string; nextMonth: string; }; + locale?: string; + localeUtils?: LocaleUtils; + modifiers?: Partial; + month?: Date; + months?: [string, string, string, string, string, string, string, string, string, string, string, string]; + navbarElement?: React.ReactElement; + numberOfMonths?: number; + onBlur?(e: React.FocusEvent): void; + onCaptionClick?(month: Date, e: React.MouseEvent): void; + onDayClick?(day: Date, modifiers: Modifiers, e: React.MouseEvent): void; + onDayKeyDown?(day: Date, modifiers: Modifiers, e: React.KeyboardEvent): void; + onDayMouseEnter?(day: Date, modifiers: Modifiers, e: React.MouseEvent): void; + onDayMouseLeave?(day: Date, modifiers: Modifiers, e: React.MouseEvent): void; + onDayTouchEnd?(day: Date, modifiers: Modifiers, e: React.TouchEvent): void; + onDayTouchStart?(day: Date, modifiers: Modifiers, e: React.TouchEvent): void; + onFocus?(e: React.FocusEvent): void; + onKeyDown?(e: React.KeyboardEvent): void; + onMonthChange?(month: Date): void; + pagedNavigation?: boolean; + renderDay?(date: Date, modifiers: Modifiers): React.ReactNode; + reverseMonths?: boolean; + selectedDays?: Modifier | Modifier[]; + toMonth?: Date; + weekdayElement?: React.ReactElement; + weekdaysLong?: [string, string, string, string, string, string, string]; + weekdaysShort?: [string, string, string, string, string, string, string]; + } + const VERSION: string; + const LocaleUtils: DayPicker.LocaleUtils; + const DateUtils: DayPicker.DateUtils; } -interface DateUtils { - addMonths(d: Date, n: number): Date; - clone(d: Date): Date; - isSameDay(d1: Date, d2: Date): Date; - isPastDay(d: Date): boolean; - isFutureDay(d: Date): boolean; - isDayBetween(day: Date, begin: Date, end: Date): boolean; - addDayToRange(day: Date, range: RangeModifier): RangeModifier; - isDayInRange(day: Date, range: RangeModifier): boolean; -} - -interface CaptionElementProps { - date: Date; - localeUtils: LocaleUtils; - locale: string; - onClick: typeof Props.onCaptionClick; -} - -interface NavbarElementProps { - className: string; - previousMonth: Date; - nextMonth: Date; - showPreviousButton: boolean; - showNextButton: boolean; - onPreviousClick(): void; - onNextClick(): void; - dir: string; - localeUtils: LocaleUtils; - locale: string; -} - -interface WeekdayElementProps { - weekday: number; - className: string; - localeUtils: LocaleUtils; - locale: string; -} - -interface ClassNames { - container: string; - interactionDisabled: string; - navBar: string; - navButtonPrev: string; - navButtonNext: string; - - month: string; - caption: string; - weekdays: string; - weekdaysRow: string; - weekday: string; - body: string; - week: string; - day: string; - - today: string; - selected: string; - disabled: string; - outside: string; -} - -interface RangeModifier { - from: Date; - to: Date; -} -interface BeforeModifier { - before: Date; -} -interface AfterModifier { - after: Date; -} -interface FunctionModifier { - (date: Date): boolean; -} -type Modifier = RangeModifier | BeforeModifier | AfterModifier | FunctionModifier; - -interface Modifiers { - today: Modifier | Modifier[]; - outside: Modifier | Modifier[]; - [other: string]: Modifier | Modifier[] | undefined; -} - -interface Props { - canChangeMonth?: boolean; - captionElement?: React.SFC; - className?: string; - classNames?: ClassNames; - containerProps?: React.HTMLAttributes; - disabledDays?: Modifier | Modifier[]; - enableOutsideDays?: boolean; - firstDayOfWeek?: number; - fixedWeeks?: boolean; - fromMonth?: Date; - initialMonth?: Date; - labels?: { previousMonth: string; nextMonth: string; }; - locale?: string; - localeUtils?: LocaleUtils; - modifiers?: Modifiers; - month?: Date; - months?: [string, string, string, string, string, string, string, string, string, string, string, string]; - navbarElement?: React.SFC | React.ComponentClass; - numberOfMonths?: number; - onBlur?(e: React.FocusEvent): void; - onCaptionClick?(month: Date, e: React.MouseEvent): void; - onDayClick?(day: Date, modifiers: Modifiers, e: React.MouseEvent): void; - onDayKeyDown?(day: Date, modifiers: Modifiers, e: React.KeyboardEvent): void; - onDayMouseEnter?(day: Date, modifiers: Modifiers, e: React.MouseEvent): void; - onDayMouseLeave?(day: Date, modifiers: Modifiers, e: React.MouseEvent): void; - onDayTouchEnd?(day: Date, modifiers: Modifiers, e: React.TouchEvent): void; - onDayTouchStart?(day: Date, modifiers: Modifiers, e: React.TouchEvent): void; - onFocus?(e: React.FocusEvent): void; - onKeyDown?(e: React.KeyboardEvent): void; - onMonthChange?(month: Date): void; - pagedNavigation?: boolean; - renderDay?(date: Date, modifiers: Modifiers): React.ReactNode; - reverseMonths?: boolean; - selectedDays?: Modifier | Modifier[]; - toMonth?: Date; - weekdayElement?: React.SFC | React.ComponentClass; - weekdaysLong?: [string, string, string, string, string, string, string]; - weekdaysShort?: [string, string, string, string, string, string, string]; -} - - -class DayPicker extends React.Component { +declare class DayPicker extends React.Component { showMonth(month: Date): void; showPreviousMonth(): void; @@ -148,10 +152,6 @@ class DayPicker extends React.Component { showPreviousYear(): void; showNextYear(): void; - - static readonly VERSION: string; - static readonly LocaleUtils: LocaleUtils; - static readonly DateUtils: DateUtils; } export = DayPicker; From 99e2521b64f732b59ab658a54673ffa083adbe1e Mon Sep 17 00:00:00 2001 From: cwmoo740 Date: Wed, 8 Mar 2017 00:35:31 -0500 Subject: [PATCH 392/797] react-day-picker typing tests passing --- react-day-picker/react-day-picker-tests.tsx | 30 +++++++++------------ 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/react-day-picker/react-day-picker-tests.tsx b/react-day-picker/react-day-picker-tests.tsx index e8a17b5087..deecb3e21a 100644 --- a/react-day-picker/react-day-picker-tests.tsx +++ b/react-day-picker/react-day-picker-tests.tsx @@ -1,37 +1,33 @@ import * as React from 'react'; -import * as DayPicker2 from "react-day-picker"; +import DayPicker = require('react-day-picker'); function isSunday(day: Date) { return day.getDay() === 0; } -// make sure global variable version works -function MyComponent2() { - return +function MyComponent() { + return ( + + ); } DayPicker.DateUtils.clone(new Date()); -DayPicker.DateUtils.isDayInRange(new Date(), {from: new Date()}); +DayPicker.DateUtils.isDayInRange(new Date(), { from: new Date(), to: new Date(2050) }); -// make sure imported version works -function MyComponent() { - return +interface MyCaptionProps extends DayPicker.CaptionElementProps { } -DayPicker2.DateUtils.clone(new Date()); -DayPicker2.DateUtils.isDayInRange(new Date(), { from: new Date() }); - -// test interface for captionElement prop -interface MyCaptionProps extends ReactDayPicker.CaptionElementProps { } class Caption extends React.Component { render() { const { date, locale, localeUtils, onClick } = this.props; - if (!date || !localeUtils || typeof locale === 'undefined') { - return null + if (!date || !localeUtils || !onClick || typeof locale === 'undefined') { + return null; } return ( -
    - { localeUtils.formatMonthTitle(date, locale) } +
    onClick(date, e) }> + { localeUtils.formatMonthTitle(date, locale) }
    ); } From 395d4c556b1937ba6820a6c7859b641356a09eb5 Mon Sep 17 00:00:00 2001 From: cwmoo740 Date: Wed, 8 Mar 2017 00:41:42 -0500 Subject: [PATCH 393/797] react-day-picker update version string --- react-day-picker/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-day-picker/index.d.ts b/react-day-picker/index.d.ts index 3f166a0c84..1e99e1f48b 100644 --- a/react-day-picker/index.d.ts +++ b/react-day-picker/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-day-picker 1.2 +// Type definitions for react-day-picker 5.1 // Project: https://github.com/gpbl/react-day-picker // Definitions by: Giampaolo Bellavite , Jason Killian // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 0d9e65647136162a16855b6a1ef6eae30f576a66 Mon Sep 17 00:00:00 2001 From: newraina Date: Wed, 8 Mar 2017 17:59:22 +0800 Subject: [PATCH 394/797] remove not acceptable overload --- fetch.io/index.d.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/fetch.io/index.d.ts b/fetch.io/index.d.ts index 94b3c430d4..c98b76aa4a 100644 --- a/fetch.io/index.d.ts +++ b/fetch.io/index.d.ts @@ -107,21 +107,15 @@ */ then(resolve: (value?: Response) => void, reject?: (reason?: any) => void): Promise - then(resolve: (value?: Response) => void, reject?: (reason?: any) => void): Promise - /** * Make Response to JSON */ json(strict?: boolean): Promise - json(strict?: boolean): Promise - /** * Make Response to string */ text(): Promise - - text(): Promise } class Fetch extends Request { From 8a958cbd7245ab23d4d550c228b9892c6d311652 Mon Sep 17 00:00:00 2001 From: newraina Date: Wed, 8 Mar 2017 18:02:45 +0800 Subject: [PATCH 395/797] change to ES6 default export --- fetch.io/index.d.ts | 2 +- fetch.io/tsconfig.json | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/fetch.io/index.d.ts b/fetch.io/index.d.ts index c98b76aa4a..3c4ff7d781 100644 --- a/fetch.io/index.d.ts +++ b/fetch.io/index.d.ts @@ -123,4 +123,4 @@ } } -export = FetchIo.Fetch; +export default FetchIo.Fetch; diff --git a/fetch.io/tsconfig.json b/fetch.io/tsconfig.json index 44013e849a..8b05d3ca33 100644 --- a/fetch.io/tsconfig.json +++ b/fetch.io/tsconfig.json @@ -8,7 +8,6 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "allowSyntheticDefaultImports": true, "baseUrl": "../", "typeRoots": [ "../" From cb23d157a671d0dc68006688c0ef7ea53dfe0357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20L=C3=B8nne?= Date: Wed, 8 Mar 2017 11:17:19 +0100 Subject: [PATCH 396/797] Corrects documentation in core-js Updates the documentation for Array.prototype.findIndex. findIndex returns -1 on failure, not undefined. --- core-js/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core-js/index.d.ts b/core-js/index.d.ts index 7dda59aab3..a0a10708d9 100644 --- a/core-js/index.d.ts +++ b/core-js/index.d.ts @@ -111,11 +111,11 @@ interface Array { find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; /** - * Returns the index of the first element in the array where predicate is true, and undefined + * Returns the index of the first element in the array where predicate is true, and -1 * otherwise. * @param predicate find calls predicate once for each element of the array, in ascending * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. + * immediately returns that element value. Otherwise, find returns -1. * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ @@ -827,7 +827,7 @@ interface PromiseConstructor { all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; all(values: Iterable>): Promise; - + /** * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved * or rejected. From acb5edf962060577cd4ff68bf2f42b1f8477a304 Mon Sep 17 00:00:00 2001 From: sqwk Date: Wed, 8 Mar 2017 11:48:25 +0100 Subject: [PATCH 397/797] fix: Make Chainable Work --- lowdb/index.d.ts | 130 +++++++++++++++++++++++------------------------ 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/lowdb/index.d.ts b/lowdb/index.d.ts index 4118372647..3ca15155e1 100644 --- a/lowdb/index.d.ts +++ b/lowdb/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: typicode, // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace lowdb { +declare namespace Lowdb { interface PromiseLike { /** @@ -45,24 +45,24 @@ declare namespace lowdb { chain?: boolean; } - class LoDashWrapper { + class LoDashWrapper> { /** * @see _.has */ - has(path: StringRepresentable | StringRepresentable[]): LoDashWrapper; + has(path: StringRepresentable | StringRepresentable[]): LowEntryClass; /** * @see _.hasIn */ - hasIn(path: StringRepresentable | StringRepresentable[]): LoDashWrapper; + hasIn(path: StringRepresentable | StringRepresentable[]): LowEntryClass; /** * @see _.assign */ assign( source: TSource - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.assign @@ -70,7 +70,7 @@ declare namespace lowdb { assign( source1: TSource1, source2: TSource2 - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.assign @@ -79,7 +79,7 @@ declare namespace lowdb { source1: TSource1, source2: TSource2, source3: TSource3 - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.assign @@ -89,37 +89,37 @@ declare namespace lowdb { source2: TSource2, source3: TSource3, source4: TSource4 - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.assign */ - assign(): LoDashWrapper; + assign(): LowEntryClass; /** * @see _.assign */ - assign(...otherArgs: any[]): LoDashWrapper; + assign(...otherArgs: any[]): LowEntryClass; /** * @see _.cloneDeep */ - cloneDeep(): LoDashWrapper; + cloneDeep(): LowEntryClass; /** * @see _.cloneDeep */ - cloneDeep(): LoDashWrapper; + cloneDeep(): LowEntryClass; /** * @see _.cloneDeep */ - cloneDeepWith(customizer: (value: any) => any): LoDashWrapper[]; + cloneDeepWith(customizer: (value: any) => any): LowEntryClass[]; /** * @see _.cloneDeep */ - cloneDeepWith(customizer: (value: any) => any): LoDashWrapper; + cloneDeepWith(customizer: (value: any) => any): LowEntryClass; /** * @see _.defaults @@ -127,7 +127,7 @@ declare namespace lowdb { defaults( source1: S1, ...sources: {}[] - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.defaults @@ -136,7 +136,7 @@ declare namespace lowdb { source1: S1, source2: S2, ...sources: {}[] - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.defaults @@ -146,7 +146,7 @@ declare namespace lowdb { source2: S2, source3: S3, ...sources: {}[] - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.defaults @@ -157,17 +157,17 @@ declare namespace lowdb { source3: S3, source4: S4, ...sources: {}[] - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.defaults */ - defaults(): LoDashWrapper; + defaults(): LowEntryClass; /** * @see _.defaults */ - defaults(...sources: {}[]): LoDashWrapper; + defaults(...sources: {}[]): LowEntryClass; /** * @see _.get @@ -175,14 +175,14 @@ declare namespace lowdb { get(object: any, path: string | number | boolean | Array, defaultValue?: TResult - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.get */ get(path: string | number | boolean | Array, defaultValue?: TResult - ): LoDashWrapper; + ): LowEntryClass; /** @@ -191,14 +191,14 @@ declare namespace lowdb { mixin( source: Dictionary<() => void>, options?: MixinOptions - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.mixin */ mixin( options?: MixinOptions - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.set @@ -206,7 +206,7 @@ declare namespace lowdb { set( path: StringRepresentable | StringRepresentable[], value: any - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.set @@ -214,7 +214,7 @@ declare namespace lowdb { set( path: StringRepresentable | StringRepresentable[], value: V - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.find @@ -222,7 +222,7 @@ declare namespace lowdb { find( predicate?: ListIterator, thisArg?: any - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.find @@ -230,21 +230,21 @@ declare namespace lowdb { find( predicate?: string, thisArg?: any - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.find */ find( predicate?: TObject - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.find */ filter( predicate?: TObject - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.filter @@ -252,7 +252,7 @@ declare namespace lowdb { filter( predicate?: ListIterator, thisArg?: any - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.filter @@ -260,7 +260,7 @@ declare namespace lowdb { filter( predicate: string, thisArg?: any - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.filter @@ -268,7 +268,7 @@ declare namespace lowdb { filter( predicate: ListIterator | DictionaryIterator, thisArg?: any - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.filter @@ -276,40 +276,40 @@ declare namespace lowdb { filter( predicate?: StringIterator, thisArg?: any - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.filter */ - filter(predicate: W): LoDashWrapper; + filter(predicate: W): LowEntryClass; /** * @see _.map */ map( iteratee?: ListIterator, thisArg?: any - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.map */ map( iteratee?: string - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.map */ map( iteratee?: TObject - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.map */ map( iteratee?: ListIterator | DictionaryIterator, thisArg?: any - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.range @@ -317,7 +317,7 @@ declare namespace lowdb { range( end?: number, step?: number - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.rangeRight @@ -325,7 +325,7 @@ declare namespace lowdb { rangeRight( end?: number, step?: number - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.remove @@ -333,7 +333,7 @@ declare namespace lowdb { remove( predicate?: ListIterator, thisArg?: any - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.remove @@ -341,46 +341,46 @@ declare namespace lowdb { remove( predicate?: string, thisArg?: any - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.remove */ remove( predicate?: W - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.sortBy */ sortBy( iteratee?: ListIterator - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.sortBy */ - sortBy(iteratee: string): LoDashWrapper; + sortBy(iteratee: string): LowEntryClass; /** * @see _.sortBy */ - sortBy(whereValue: W): LoDashWrapper; + sortBy(whereValue: W): LowEntryClass; /** * @see _.sortBy */ - sortBy(): LoDashWrapper; + sortBy(): LowEntryClass; /** * @see _.sortBy */ - sortBy(...iteratees: (ListIterator | any | string)[]): LoDashWrapper; + sortBy(...iteratees: (ListIterator | any | string)[]): LowEntryClass; /** * @see _.sortBy */ - sortBy(iteratees: (ListIterator | string | any)[]): LoDashWrapper; + sortBy(iteratees: (ListIterator | string | any)[]): LowEntryClass; /** * @see _.slice @@ -388,44 +388,44 @@ declare namespace lowdb { slice( start?: number, end?: number - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.size */ - size(): LoDashWrapper; + size(): LowEntryClass; /** * @see _.take */ - take(n?: number): LoDashWrapper; + take(n?: number): LowEntryClass; /** * @see _.times */ times( iteratee: (num: number) => TResult - ): LoDashWrapper; + ): LowEntryClass; /** * @see _.times */ - times(): LoDashWrapper; + times(): LowEntryClass; /** * @see _.uniqueId */ - uniqueId(): LoDashWrapper; + uniqueId(): LowEntryClass; value(): T; pop(): T; - push(...items: T[]): LoDashWrapper; + push(...items: T[]): LowEntryClass; shift(): T; - sort(compareFn?: (a: T, b: T) => number): LoDashWrapper; - splice(start: number): LoDashWrapper; - splice(start: number, deleteCount: number, ...items: any[]): LoDashWrapper; - unshift(...items: T[]): LoDashWrapper; + sort(compareFn?: (a: T, b: T) => number): LowEntryClass; + splice(start: number): LowEntryClass; + splice(start: number, deleteCount: number, ...items: any[]): LowEntryClass; + unshift(...items: T[]): LowEntryClass; } export interface Storage { @@ -505,7 +505,7 @@ declare namespace lowdb { } - export class Low extends LoDashWrapper { + export class Lowdb extends LoDashWrapper { constructor(filePath: string, options?: Options); @@ -525,13 +525,13 @@ declare namespace lowdb { * Persist database. * @param source The source location. */ - write(source: string): void + write(source?: string): void /** * Persist database. * @param source The source location. */ - write(source: string): PromiseLike + write(source?: string): PromiseLike /** * Read database. @@ -554,5 +554,5 @@ declare namespace lowdb { } declare module "lowdb" { - export = lowdb.Low; + export = Lowdb.Lowdb; } \ No newline at end of file From 162688615a8f5e9980b12633e4c19ff54aaefe84 Mon Sep 17 00:00:00 2001 From: sqwk Date: Wed, 8 Mar 2017 11:48:54 +0100 Subject: [PATCH 398/797] fix: Update Tests for v15.5 --- lowdb/lowdb-tests.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lowdb/lowdb-tests.ts b/lowdb/lowdb-tests.ts index 612288e8dd..b7e0f4f5f6 100644 --- a/lowdb/lowdb-tests.ts +++ b/lowdb/lowdb-tests.ts @@ -2,10 +2,15 @@ import Lowdb = require('lowdb'); const db = new Lowdb('db.json'); -db.defaults({ someObject: {}, anotherObject: {} }).value(); +db.defaults({ someObject: {}, anotherObject: {} }).write(); -db.get('someObject').set('foo' , 'bar').value(); -db.get('anotherObject').set('foo' , 'bar').value(); -db.set('singleValue', 'foo').value(); +db.get('someObject').set('foo' , 'bar').write(); +db.get('someObject.foo').value(); + +db.get('anotherObject').set('foo' , 'bar').write(); +db.get('anotherObject.foo').value(); + +db.set('singleValue', 'foo').write(); +db.get('singleValue').value(); console.log(db.getState()); From 72d10c7a67fd695161632a3f11b57055262b078d Mon Sep 17 00:00:00 2001 From: Alexander Dmitriev Date: Wed, 8 Mar 2017 14:50:01 +0100 Subject: [PATCH 399/797] Export registerLanguage --- react-syntax-highlighter/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/react-syntax-highlighter/index.d.ts b/react-syntax-highlighter/index.d.ts index 57d81c9d6d..94cf519204 100644 --- a/react-syntax-highlighter/index.d.ts +++ b/react-syntax-highlighter/index.d.ts @@ -12,6 +12,8 @@ declare module 'react-syntax-highlighter' { declare module 'react-syntax-highlighter/dist/light' { import * as React from 'react'; + export function registerLanguage(name: string, func: any): void; + interface SyntaxHighlighterProps { language?: string; style?: any; @@ -498,4 +500,4 @@ declare module 'react-syntax-highlighter/dist/styles/xt256' { declare module 'react-syntax-highlighter/dist/styles/zenburn' { const style: any; export default style; -} \ No newline at end of file +} From 06f9a3f39d16c688e168d1771f0bee3901603830 Mon Sep 17 00:00:00 2001 From: Alexander Dmitriev Date: Wed, 8 Mar 2017 14:57:24 +0100 Subject: [PATCH 400/797] Update typescript version number From 673f3c9b72d71b51476be7b072f5d621733c31f3 Mon Sep 17 00:00:00 2001 From: cwmoo740 Date: Wed, 8 Mar 2017 10:59:34 -0500 Subject: [PATCH 401/797] react-day-picker remove tsconfig.json types react and add reference comment in index.d.ts --- react-day-picker/index.d.ts | 2 ++ react-day-picker/tsconfig.json | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/react-day-picker/index.d.ts b/react-day-picker/index.d.ts index 1e99e1f48b..d1f71a911e 100644 --- a/react-day-picker/index.d.ts +++ b/react-day-picker/index.d.ts @@ -4,6 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 +/// + import * as React from 'react'; declare namespace DayPicker { diff --git a/react-day-picker/tsconfig.json b/react-day-picker/tsconfig.json index 4cf47535ad..823be84e03 100644 --- a/react-day-picker/tsconfig.json +++ b/react-day-picker/tsconfig.json @@ -13,9 +13,7 @@ "typeRoots": [ "../" ], - "types": [ - "react" - ], + "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, From d6472a73263a821cf19241bd4df444ec01c64668 Mon Sep 17 00:00:00 2001 From: cwmoo740 Date: Wed, 8 Mar 2017 11:12:26 -0500 Subject: [PATCH 402/797] react-day-picker remove reference type react because it is already imported --- react-day-picker/index.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/react-day-picker/index.d.ts b/react-day-picker/index.d.ts index d1f71a911e..1e99e1f48b 100644 --- a/react-day-picker/index.d.ts +++ b/react-day-picker/index.d.ts @@ -4,8 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -/// - import * as React from 'react'; declare namespace DayPicker { From ad1c05f5f12441ecc20495df12f65f7bb22e7c61 Mon Sep 17 00:00:00 2001 From: fullflavedave Date: Wed, 8 Mar 2017 08:27:20 -0800 Subject: [PATCH 403/797] Readded Accounts._hashPassword fix from merge #14718 that was just overwritten. --- meteor/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/meteor/index.d.ts b/meteor/index.d.ts index 585c2ab43a..b33973f943 100644 --- a/meteor/index.d.ts +++ b/meteor/index.d.ts @@ -206,6 +206,8 @@ declare module Accounts { stop: () => void }; + function _hashPassword(password: string): { digest: string; algorithm: string; }; + interface IValidateLoginAttemptCbOpts { type: string; allowed: boolean; @@ -269,6 +271,8 @@ declare module "meteor/accounts-base" { stop: () => void }; + function _hashPassword(password: string): { digest: string; algorithm: string; }; + interface IValidateLoginAttemptCbOpts { type: string; allowed: boolean; From 1a2531a8954491702a7680ed8049eba4bed0c7af Mon Sep 17 00:00:00 2001 From: fullflavedave Date: Wed, 8 Mar 2017 08:31:02 -0800 Subject: [PATCH 404/797] Fixed README. Readded Accounts._hashPassword fix from merge #14718 that was just overwritten. --- meteor/README.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/meteor/README.md b/meteor/README.md index 616033b354..f560dd005e 100644 --- a/meteor/README.md +++ b/meteor/README.md @@ -1,13 +1,4 @@ -# Meteor Type Definitions [DEPRECATED] - -## Deprecated - -These definitions for Meteor are now deprecated. They should still work for versions of Meteor up to 1.2.1. - -The canonical TypeScript definitions for Meteor can now be found using the NPM [Typings definition manager](https://www.npmjs.com/package/typings). If you prefer to view the definitions directly, or contribute to them, they can be found here: . - - -## Description +# Meteor Type Definitions ## Description From 548a7925ed894613942f649222f095eddcff2aee Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Wed, 8 Mar 2017 18:19:35 +0100 Subject: [PATCH 405/797] sync deprecated markers with auth0-js --- auth0-js/index.d.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts index f51e3979d3..a3ac8331ae 100644 --- a/auth0-js/index.d.ts +++ b/auth0-js/index.d.ts @@ -63,9 +63,7 @@ export class Authentication { * 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; @@ -75,7 +73,6 @@ export class Authentication { * @method getSSOData * @param {Boolean} withActiveDirectories * @param {Function} callback - * @deprecated `getSSOData` will be soon deprecated. */ getSSOData(withActiveDirectories: boolean, callback?: (error?: Auth0Error, authResult?: any) => any): void; @@ -94,7 +91,6 @@ export class Authentication { * @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; From d9edf84e9cc0a8d47b0dcd2c57883d25f07a33a0 Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Wed, 8 Mar 2017 18:20:31 +0100 Subject: [PATCH 406/797] callbacks return value to void (from any) --- auth0-js/index.d.ts | 88 ++++++++++++++++++++++----------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts index a3ac8331ae..35c47cc8a1 100644 --- a/auth0-js/index.d.ts +++ b/auth0-js/index.d.ts @@ -35,7 +35,7 @@ export class Authentication { * @param {Object} options: https://auth0.com/docs/api-auth/grant/password * @param {Function} callback */ - loginWithDefaultDirectory(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; + loginWithDefaultDirectory(options: any, callback: (error?: Auth0Error, authResult?: any) => void): void; /** * Makes a call to the `/ro` endpoint @@ -43,21 +43,21 @@ export class Authentication { * @param {Function} callback * @deprecated `loginWithResourceOwner` will be soon deprecated, user `login` instead. */ - loginWithResourceOwner(options: any, callback: (error?: Auth0Error, authResult?: any) => any): void; + loginWithResourceOwner(options: any, callback: (error?: Auth0Error, authResult?: any) => void): 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; + login(options: any, callback: (error?: Auth0Error, authResult?: any) => void): 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; + oauthToken(options: any, callback: (error?: Auth0Error, authResult?: any) => void): void; /** * Makes a call to the `/ssodata` endpoint @@ -65,7 +65,7 @@ export class Authentication { * @method getSSOData * @param {Function} callback */ - getSSOData(callback?: (error?: Auth0Error, authResult?: any) => any): void; + getSSOData(callback?: (error?: Auth0Error, authResult?: any) => void): void; /** * Makes a call to the `/ssodata` endpoint @@ -74,7 +74,7 @@ export class Authentication { * @param {Boolean} withActiveDirectories * @param {Function} callback */ - getSSOData(withActiveDirectories: boolean, callback?: (error?: Auth0Error, authResult?: any) => any): void; + getSSOData(withActiveDirectories: boolean, callback?: (error?: Auth0Error, authResult?: any) => void): void; /** * Makes a call to the `/userinfo` endpoint and returns the user profile @@ -83,7 +83,7 @@ export class Authentication { * @param {String} accessToken * @param {Function} callback */ - userInfo(token: string, callback: (error?: Auth0Error, user?: any) => any): void; + userInfo(token: string, callback: (error?: Auth0Error, user?: any) => void): void; /** * Makes a call to the `/delegation` endpoint @@ -92,7 +92,7 @@ export class Authentication { * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--delegation * @param {Function} callback */ - delegation(options: any, callback: (error?: Auth0Error, authResult?: Auth0DelegationToken) => any): any; + delegation(options: any, callback: (error?: Auth0Error, authResult?: Auth0DelegationToken) => void): any; /** * Fetches the user country based on the ip. @@ -100,7 +100,7 @@ export class Authentication { * @method getUserCountry * @param {Function} callback */ - getUserCountry(callback: (error?: Auth0Error, result?: any) => any): void; + getUserCountry(callback: (error?: Auth0Error, result?: any) => void): void; } export class PasswordlessAuthentication { @@ -166,7 +166,7 @@ export class Management { * @param {String} userId * @param {Function} callback */ - getUser(userId: string, callback: (error?: Auth0Error, user?: any) => any): void; + getUser(userId: string, callback: (error?: Auth0Error, user?: any) => void): void; /** * Updates the user metdata. It will patch the user metdata with the attributes sent. @@ -177,7 +177,7 @@ export class Management { * @param {Object} userMetadata * @param {Function} callback */ - patchUserMetadata(userId: string, userMetadata: any, callback: (error?: Auth0Error, user?: any) => any): void; + patchUserMetadata(userId: string, userMetadata: any, callback: (error?: Auth0Error, user?: any) => void): void; /** * Link two users. https://auth0.com/docs/api/management/v2#!/Users/post_identities @@ -187,7 +187,7 @@ export class Management { * @param {String} secondaryUserToken * @param {Function} callback */ - linkUser(userId: string, secondaryUserToken: string, callback: (error?: Auth0Error, user?: any) => any): void; + linkUser(userId: string, secondaryUserToken: string, callback: (error?: Auth0Error, user?: any) => void): void; } export class WebAuth { @@ -218,7 +218,7 @@ export class WebAuth { * @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; + parseHash(options: any, callback: (error?: Auth0Error, authResult?: any) => void): void; /** * Decodes the id_token and verifies the nonce. @@ -238,7 +238,7 @@ export class WebAuth { * @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; + renewAuth(options: any, callback: (error?: Auth0Error, authResult?: any) => void): void; /** * Initialices a change password transaction @@ -247,7 +247,7 @@ export class WebAuth { * @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; + changePassword(options: any, callback: (error?: Auth0Error, authResult?: any) => void): void; /** * Signs up a new user @@ -266,7 +266,7 @@ export class WebAuth { * @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; + signupAndAuthorize(options: any, callback: (error?: Auth0Error, authResult?: any) => void): void; /** * Redirects to the auth0 logout page @@ -276,7 +276,7 @@ export class WebAuth { */ logout(options: any): void; - passwordlessStart(options: PasswordlessStartOptions, callback: (error?: Auth0Error, data?: any) => any): void; + passwordlessStart(options: PasswordlessStartOptions, callback: (error?: Auth0Error, data?: any) => void): void; /** * Verifies the passwordless TOTP and redirects to finish the passwordless transaction @@ -380,7 +380,7 @@ export class Popup { * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup * @param {Function} callback */ - signupAndLogin(options: any, callback: any): void; + signupAndLogin(options: any, callback: any): void; } interface ManagementOptions { @@ -466,42 +466,42 @@ interface PasswordlessVerifyOptions { } interface Auth0UserProfile { - name: string; - nickname: string; - picture: string; - user_id: string; - username?: string; - given_name?: string; - family_name?: string; - email?: string; - email_verified?: string; - clientID: string; - gender?: string; - locale?: string; - identities: Auth0Identity[]; - created_at: string; - updated_at: string; - sub: string; - user_metadata?: any; - app_metadata?: any; + name: string; + nickname: string; + picture: string; + user_id: string; + username?: string; + given_name?: string; + family_name?: string; + email?: string; + email_verified?: string; + clientID: string; + gender?: string; + locale?: string; + identities: Auth0Identity[]; + created_at: string; + updated_at: string; + sub: string; + user_metadata?: any; + app_metadata?: any; } interface MicrosoftUserProfile extends Auth0UserProfile { - emails?: string[]; //optional depending on whether email addresses permission is granted + emails?: string[]; //optional depending on whether email addresses permission is granted } interface Office365UserProfile extends Auth0UserProfile { - tenantid: string; - upn: string; + tenantid: string; + upn: string; } interface AdfsUserProfile extends Auth0UserProfile { - issuer?: string; + issuer?: string; } interface Auth0Identity { - connection: string; - isSocial: boolean; - provider: string; - user_id: string; + connection: string; + isSocial: boolean; + provider: string; + user_id: string; } From d6a395cb587c61266680d048a510a77ae677d78c Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Wed, 8 Mar 2017 18:21:23 +0100 Subject: [PATCH 407/797] fixed invalid delegtion return value --- auth0-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts index 35c47cc8a1..28e5137840 100644 --- a/auth0-js/index.d.ts +++ b/auth0-js/index.d.ts @@ -437,7 +437,7 @@ interface Auth0DecodedHash { /** Represents the response from an API Token Delegation request. */ interface Auth0DelegationToken { /** The length of time in seconds the token is valid for. */ - ExpiresIn: number; + expiresIn: number; /** The JWT for delegated access. */ idToken: string; /** The type of token being returned. Possible values: "Bearer" */ From ae7eb8638ac707e18aa307c57d306bc28adbe324 Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Wed, 8 Mar 2017 18:34:29 +0100 Subject: [PATCH 408/797] added callback type for improved consistency --- auth0-js/index.d.ts | 62 +++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts index 28e5137840..9a84cc75f1 100644 --- a/auth0-js/index.d.ts +++ b/auth0-js/index.d.ts @@ -35,7 +35,7 @@ export class Authentication { * @param {Object} options: https://auth0.com/docs/api-auth/grant/password * @param {Function} callback */ - loginWithDefaultDirectory(options: any, callback: (error?: Auth0Error, authResult?: any) => void): void; + loginWithDefaultDirectory(options: any, callback: Auth0Callback): void; /** * Makes a call to the `/ro` endpoint @@ -43,21 +43,21 @@ export class Authentication { * @param {Function} callback * @deprecated `loginWithResourceOwner` will be soon deprecated, user `login` instead. */ - loginWithResourceOwner(options: any, callback: (error?: Auth0Error, authResult?: any) => void): void; + loginWithResourceOwner(options: any, callback: Auth0Callback): 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) => void): void; + login(options: any, callback: Auth0Callback): void; /** * Makes a call to the `oauth/token` endpoint * @param {any} options * @param {Function} callback */ - oauthToken(options: any, callback: (error?: Auth0Error, authResult?: any) => void): void; + oauthToken(options: any, callback: Auth0Callback): void; /** * Makes a call to the `/ssodata` endpoint @@ -65,7 +65,7 @@ export class Authentication { * @method getSSOData * @param {Function} callback */ - getSSOData(callback?: (error?: Auth0Error, authResult?: any) => void): void; + getSSOData(callback?: Auth0Callback): void; /** * Makes a call to the `/ssodata` endpoint @@ -74,7 +74,7 @@ export class Authentication { * @param {Boolean} withActiveDirectories * @param {Function} callback */ - getSSOData(withActiveDirectories: boolean, callback?: (error?: Auth0Error, authResult?: any) => void): void; + getSSOData(withActiveDirectories: boolean, callback?: Auth0Callback): void; /** * Makes a call to the `/userinfo` endpoint and returns the user profile @@ -83,7 +83,7 @@ export class Authentication { * @param {String} accessToken * @param {Function} callback */ - userInfo(token: string, callback: (error?: Auth0Error, user?: any) => void): void; + userInfo(token: string, callback: Auth0Callback): void; /** * Makes a call to the `/delegation` endpoint @@ -92,7 +92,7 @@ export class Authentication { * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--delegation * @param {Function} callback */ - delegation(options: any, callback: (error?: Auth0Error, authResult?: Auth0DelegationToken) => void): any; + delegation(options: any, callback: Auth0Callback): any; /** * Fetches the user country based on the ip. @@ -100,7 +100,7 @@ export class Authentication { * @method getUserCountry * @param {Function} callback */ - getUserCountry(callback: (error?: Auth0Error, result?: any) => void): void; + getUserCountry(callback: Auth0Callback): void; } export class PasswordlessAuthentication { @@ -122,7 +122,7 @@ export class PasswordlessAuthentication { * @param {Object} options: https://auth0.com/docs/api/authentication#passwordless * @param {Function} callback */ - start(options: PasswordlessStartOptions, callback: any): void; + start(options: PasswordlessStartOptions, callback: Auth0Callback): void; /** * Verifies the passwordless TOTP and returns an error if any. @@ -131,7 +131,7 @@ export class PasswordlessAuthentication { * @param {Object} options * @param {Function} callback */ - verify(options: any, callback: any): void; + verify(options: any, callback: Auth0Callback): void; } export class DBConnection { @@ -144,7 +144,7 @@ export class DBConnection { * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup * @param {Function} calback */ - signup(options: any, callback: any): void; + signup(options: any, callback: Auth0Callback): void; /** * Initializes the change password flow @@ -153,7 +153,7 @@ export class DBConnection { * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password * @param {Function} callback */ - changePassword(options: ChangePasswordOptions, callback: any): void; + changePassword(options: ChangePasswordOptions, callback: Auth0Callback): void; } export class Management { @@ -166,7 +166,7 @@ export class Management { * @param {String} userId * @param {Function} callback */ - getUser(userId: string, callback: (error?: Auth0Error, user?: any) => void): void; + getUser(userId: string, callback: Auth0Callback): void; /** * Updates the user metdata. It will patch the user metdata with the attributes sent. @@ -177,7 +177,7 @@ export class Management { * @param {Object} userMetadata * @param {Function} callback */ - patchUserMetadata(userId: string, userMetadata: any, callback: (error?: Auth0Error, user?: any) => void): void; + patchUserMetadata(userId: string, userMetadata: any, callback: Auth0Callback): void; /** * Link two users. https://auth0.com/docs/api/management/v2#!/Users/post_identities @@ -187,7 +187,7 @@ export class Management { * @param {String} secondaryUserToken * @param {Function} callback */ - linkUser(userId: string, secondaryUserToken: string, callback: (error?: Auth0Error, user?: any) => void): void; + linkUser(userId: string, secondaryUserToken: string, callback: Auth0Callback): void; } export class WebAuth { @@ -218,7 +218,7 @@ export class WebAuth { * @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) => void): void; + parseHash(options: any, callback: Auth0Callback): void; /** * Decodes the id_token and verifies the nonce. @@ -229,7 +229,7 @@ export class WebAuth { * @param {String} nonce * @param {Function} callback: function(err, {payload, transaction}) */ - validateToken(token: string, state: string, nonce: string, callback: any): void; + validateToken(token: string, state: string, nonce: string, callback: Auth0Callback): void; /** * Executes a silent authentication transaction under the hood in order to fetch a new token. @@ -238,7 +238,7 @@ export class WebAuth { * @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) => void): void; + renewAuth(options: any, callback: Auth0Callback): void; /** * Initialices a change password transaction @@ -247,7 +247,7 @@ export class WebAuth { * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password * @param {Function} callback */ - changePassword(options: any, callback: (error?: Auth0Error, authResult?: any) => void): void; + changePassword(options: any, callback: Auth0Callback): void; /** * Signs up a new user @@ -256,7 +256,7 @@ export class WebAuth { * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup * @param {Function} callback */ - signup(options: any, callback: any): void; + signup(options: any, callback: Auth0Callback): void; /** * Signs up a new user, automatically logs the user in after the signup and returns the user token. @@ -266,7 +266,7 @@ export class WebAuth { * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup * @param {Function} callback */ - signupAndAuthorize(options: any, callback: (error?: Auth0Error, authResult?: any) => void): void; + signupAndAuthorize(options: any, callback: Auth0Callback): void; /** * Redirects to the auth0 logout page @@ -276,7 +276,7 @@ export class WebAuth { */ logout(options: any): void; - passwordlessStart(options: PasswordlessStartOptions, callback: (error?: Auth0Error, data?: any) => void): void; + passwordlessStart(options: PasswordlessStartOptions, callback: Auth0Callback): void; /** * Verifies the passwordless TOTP and redirects to finish the passwordless transaction @@ -290,7 +290,7 @@ export class WebAuth { * @param {Object} options.verificationCode: the TOTP code * @param {Function} callback */ - passwordlessVerify(options: any, callback: any): void; + passwordlessVerify(options: any, callback: Auth0Callback): void; } export class Redirect { @@ -304,7 +304,7 @@ export class Redirect { * @param {Function} callback * @deprecated `webauth.popup.loginWithCredentials` will be soon deprecated, use `webauth.client.login` instead. */ - loginWithCredentials(options: any, callback: any): void; + loginWithCredentials(options: any, callback: Auth0Callback): void; /** * Signs up a new user and automatically logs the user in after the signup. @@ -313,7 +313,7 @@ export class Redirect { * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup * @param {Function} callback */ - signupAndLogin(options: any, callback: any): void; + signupAndLogin(options: any, callback: Auth0Callback): void; } export class Popup { @@ -347,7 +347,7 @@ export class Popup { * @param {Object} options: https://auth0.com/docs/api/authentication#!#get--authorize_db * @param {Function} callback */ - authorize(options: any, callback: any): void; + authorize(options: any, callback: Auth0Callback): void; /** * Initializes the legacy Lock login flow in a popup @@ -357,7 +357,7 @@ export class Popup { * @param {Function} callback * @deprecated `webauth.popup.loginWithCredentials` will be soon deprecated, use `webauth.client.login` instead. */ - loginWithCredentials(options: any, callback: any): void; + loginWithCredentials(options: any, callback: Auth0Callback): void; /** * Verifies the passwordless TOTP and returns the requested token @@ -371,7 +371,7 @@ export class Popup { * @param {Object} options.verificationCode: the TOTP code * @param {Function} callback */ - passwordlessVerify(options: any, callback: any): void; + passwordlessVerify(options: any, callback: Auth0Callback): void; /** * Signs up a new user and automatically logs the user in after the signup. @@ -380,9 +380,11 @@ export class Popup { * @param {Object} options: https://auth0.com/docs/api/authentication#!#post--dbconnections-signup * @param {Function} callback */ - signupAndLogin(options: any, callback: any): void; + signupAndLogin(options: any, callback: Auth0Callback): void; } +type Auth0Callback = (error: null | Auth0Error, result: T) => void; + interface ManagementOptions { domain: string; token: string; From 736f2e1c4f79694ad547d56620fc7b1c148728c1 Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Wed, 8 Mar 2017 18:54:47 +0100 Subject: [PATCH 409/797] made many types less general --- auth0-js/index.d.ts | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts index 9a84cc75f1..b4e2b5f599 100644 --- a/auth0-js/index.d.ts +++ b/auth0-js/index.d.ts @@ -83,7 +83,7 @@ export class Authentication { * @param {String} accessToken * @param {Function} callback */ - userInfo(token: string, callback: Auth0Callback): void; + userInfo(token: string, callback: Auth0Callback): void; /** * Makes a call to the `/delegation` endpoint @@ -100,7 +100,7 @@ export class Authentication { * @method getUserCountry * @param {Function} callback */ - getUserCountry(callback: Auth0Callback): void; + getUserCountry(callback: Auth0Callback<{ countryCode: string }>): void; } export class PasswordlessAuthentication { @@ -166,7 +166,7 @@ export class Management { * @param {String} userId * @param {Function} callback */ - getUser(userId: string, callback: Auth0Callback): void; + getUser(userId: string, callback: Auth0Callback): void; /** * Updates the user metdata. It will patch the user metdata with the attributes sent. @@ -177,7 +177,7 @@ export class Management { * @param {Object} userMetadata * @param {Function} callback */ - patchUserMetadata(userId: string, userMetadata: any, callback: Auth0Callback): void; + patchUserMetadata(userId: string, userMetadata: any, callback: Auth0Callback): void; /** * Link two users. https://auth0.com/docs/api/management/v2#!/Users/post_identities @@ -213,12 +213,13 @@ export class WebAuth { * * @method parseHash * @param {Object} options: + * @param {String} options._idTokenVerification [OPTIONAL] Default: true * @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: Auth0Callback): void; + parseHash(options: any, callback: Auth0Callback): void; /** * Decodes the id_token and verifies the nonce. @@ -276,6 +277,18 @@ export class WebAuth { */ logout(options: any): void; + /** + * Initialices a passwordless authentication transaction + * + * @method passwordlessStart + * @param {Object} options: https://auth0.com/docs/api/authentication#passwordless + * @param {Object} options.send: `link` or `code` + * @param {Object} options.phoneNumber: send should be code and email not set + * @param {Object} options.email: phoneNumber should be ignored + * @param {Object} options.connection + * @param {Object} options.authParams + * @param {Function} callback + */ passwordlessStart(options: PasswordlessStartOptions, callback: Auth0Callback): void; /** From ad56ca57ea195cb0e7f2ceea590f614dd90a20f7 Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Wed, 8 Mar 2017 18:56:13 +0100 Subject: [PATCH 410/797] removed internal method --- auth0-js/index.d.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts index b4e2b5f599..d1df4d52ae 100644 --- a/auth0-js/index.d.ts +++ b/auth0-js/index.d.ts @@ -347,12 +347,6 @@ export class Popup { */ 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 * From 3a6cc84ded1ab7906f2980e41129f7b8041802fb Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Wed, 8 Mar 2017 19:01:49 +0100 Subject: [PATCH 411/797] added a little more testing code --- auth0-js/auth0-js-tests.ts | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/auth0-js/auth0-js-tests.ts b/auth0-js/auth0-js-tests.ts index cbd791030b..cd7789c62d 100644 --- a/auth0-js/auth0-js-tests.ts +++ b/auth0-js/auth0-js-tests.ts @@ -61,8 +61,6 @@ webAuth.signupAndAuthorize({ }); - - webAuth.client.login({ realm: 'Username-Password-Authentication', //connection name or HRD domain username: 'info@auth0.com', @@ -73,6 +71,26 @@ webAuth.client.login({ // Auth tokens in the result or an error }); +webAuth.popup.buildPopupHandler(); +webAuth.popup.preload({}); +webAuth.popup.authorize({}, (err, data) => { + if (err) /* handle error */ return; + // do something with data +}); +webAuth.popup.loginWithCredentials({}, (err, data) => { + if (err) /* handle error */ return; + // do something with data +}); +webAuth.popup.passwordlessVerify({}, (err, data) => { + if (err) /* handle error */ return; + // do something with data +}); +webAuth.popup.signupAndLogin({}, (err, data) => { + if (err) /* handle error */ return; + // do something with data +}); + + let authentication = new auth0.Authentication({ domain: 'me.auth0.com', clientID: '...', @@ -101,7 +119,9 @@ authentication.delegation({ refresh_token: 'your_refresh_token', api_type: 'app' }, (err, data) => { - + if (!err) { + localStorage.setItem('token', data.idToken) + } }); authentication.loginWithDefaultDirectory({ @@ -146,6 +166,8 @@ let management = new auth0.Management({ management.getUser('asd', (err, user) => {}); -management.patchUserMetadata('asd', {role: 'admin'}, (err, user) => {}); +management.patchUserMetadata('asd', {role: 'admin'}, (err, user) => { + if (!err && user.email_verified) return; // do something +}); management.linkUser('asd', 'eqwe', (err, user) => {}); From 8328aea9c315f495b0a1b82dd97d649fba9a07a1 Mon Sep 17 00:00:00 2001 From: Christian Svensson Date: Wed, 8 Mar 2017 19:10:15 +0100 Subject: [PATCH 412/797] typings updated for auth0-js@8.3 --- auth0-js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts index d1df4d52ae..d8d1e6f392 100644 --- a/auth0-js/index.d.ts +++ b/auth0-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Auth0.js 8.2 +// Type definitions for Auth0.js 8.3 // Project: https://github.com/auth0/auth0.js // Definitions by: Adrian Chia // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 476377219255cabaf8ba512ccb4ac1cd5cb68907 Mon Sep 17 00:00:00 2001 From: Ben Swartz Date: Wed, 8 Mar 2017 11:18:34 -0800 Subject: [PATCH 413/797] Update Faker Definitions to V4.1.0 --- faker/faker-tests.ts | 22 +++ faker/index.d.ts | 36 +++- faker/v3/faker-tests.ts | 183 ++++++++++++++++++ faker/v3/index.d.ts | 416 ++++++++++++++++++++++++++++++++++++++++ faker/v3/tsconfig.json | 25 +++ 5 files changed, 680 insertions(+), 2 deletions(-) create mode 100644 faker/v3/faker-tests.ts create mode 100644 faker/v3/index.d.ts create mode 100644 faker/v3/tsconfig.json diff --git a/faker/faker-tests.ts b/faker/faker-tests.ts index 4dc2a3735f..5fb6a53746 100644 --- a/faker/faker-tests.ts +++ b/faker/faker-tests.ts @@ -52,6 +52,11 @@ resultStr = faker.company.bsAdjective(); resultStr = faker.company.bsBuzz(); resultStr = faker.company.bsNoun(); +resultStr = faker.database.column(); +resultStr = faker.database.type(); +resultStr = faker.database.collation(); +resultStr = faker.database.engine(); + resultDate = faker.date.past(); resultDate = faker.date.future(); resultDate = faker.date.between('foo', 'bar'); @@ -80,6 +85,8 @@ resultStr = faker.finance.transactionType(); resultStr = faker.finance.currencyCode(); resultStr = faker.finance.currencyName(); resultStr = faker.finance.currencySymbol(); +resultStr = faker.finance.bitcoinAddress(); +resultStr = faker.finance.bic(); resultStr = faker.hacker.abbreviation(); resultStr = faker.hacker.adjective(); @@ -110,6 +117,8 @@ resultStr = userCard.address.suite; resultStr = faker.internet.avatar(); resultStr = faker.internet.email(); resultStr = faker.internet.email('foo', 'bar', 'quux'); +resultStr = faker.internet.exampleEmail(); +resultStr = faker.internet.exampleEmail('foo', 'bar'); resultStr = faker.internet.protocol(); resultStr = faker.internet.url(); resultStr = faker.internet.domainName(); @@ -128,12 +137,18 @@ resultStr = faker.lorem.words(); resultStr = faker.lorem.words(0); resultStr = faker.lorem.sentence(); resultStr = faker.lorem.sentence(0, 0); +resultStr = faker.lorem.slug(); +resultStr = faker.lorem.slug(0); resultStr = faker.lorem.sentences(); resultStr = faker.lorem.sentences(0); resultStr = faker.lorem.paragraph(); resultStr = faker.lorem.paragraph(0); resultStr = faker.lorem.paragraphs(); resultStr = faker.lorem.paragraphs(0, ''); +resultStr = faker.lorem.text(); +resultStr = faker.lorem.text(0); +resultStr = faker.lorem.lines(); +resultStr = faker.lorem.lines(0); resultStr = faker.name.firstName(); resultStr = faker.name.firstName(0); @@ -169,6 +184,13 @@ resultStr = faker.random.objectElement(); resultStr = faker.random.objectElement({foo: 'bar', field: 'foo'}); resultStr = faker.random.uuid(); resultBool = faker.random.boolean(); +resultStr = faker.random.word(); +resultStr = faker.random.words(); +resultStr = faker.random.words(0); +resultStr = faker.random.image(); +resultStr = faker.random.locale(); +resultStr = faker.random.alphaNumeric(); +resultStr = faker.random.alphaNumeric(0); resultStr = faker.system.fileName( "foo", "bar" ); resultStr = faker.system.commonFileName( "foo", "bar" ); diff --git a/faker/index.d.ts b/faker/index.d.ts index 01e01b8b8b..8c6ea8ec6f 100644 --- a/faker/index.d.ts +++ b/faker/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for faker v3.1 +// Based off type definitions for faker v4.1.0 // Project: http://marak.com/faker.js/ -// Definitions by: Bas Pennings , Yuki Kokubun +// Definitions by: Ben Swartz , Bas Pennings , Yuki Kokubun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare var fakerStatic: Faker.FakerStatic; @@ -52,6 +52,13 @@ declare namespace Faker { bsNoun(): string; }; + database: { + column(): string; + type(): string; + collation(): string; + engine(): string; + }; + date: { past(years?: number, refDate?: string|Date): Date; future(years?: number, refDate?: string|Date): Date; @@ -72,6 +79,8 @@ declare namespace Faker { currencyCode(): string; currencyName(): string; currencySymbol(): string; + bitcoinAddress(): string; + bic(): string }; hacker: { @@ -116,11 +125,13 @@ declare namespace Faker { sports(width?: number, height?: number): string; technics(width?: number, height?: number): string; transport(width?: number, height?: number): string; + dataUri(width?: number, height?: number): string; }; internet: { avatar(): string; email(firstName?: string, lastName?: string, provider?: string): string; + exampleEmail(firstName?: string, lastName?: string): string; userName(firstName?: string, lastName?: string): string; protocol(): string; url(): string; @@ -128,6 +139,7 @@ declare namespace Faker { domainSuffix(): string; domainWord(): string; ip(): string; + ipv6(): string; userAgent(): string; color(baseRed255?: number, baseGreen255?: number, baseBlue255?: number): string; mac(): string; @@ -138,9 +150,12 @@ declare namespace Faker { word(): string; words(num?: number): string; sentence(wordCount?: number, range?: number): string; + slug(wordCount?: number): string; sentences(sentenceCount?: number): string; paragraph(sentenceCount?: number): string; paragraphs(paragraphCount?: number, separator?: string): string; + text(times?: number): string; + lines(lineCount?: number): string; }; name: { @@ -171,6 +186,11 @@ declare namespace Faker { objectElement(object?: { [key: string]: T }, field?: any): T; uuid(): string; boolean(): boolean; + word(): string; // TODO: have ability to return specific type of word? As in: noun, adjective, verb, etc + words(count?: number): string; + image(): string; + locale(): string; + alphaNumeric(count?: number): string; }; system: { @@ -275,6 +295,14 @@ declare module "faker" { export = fakerStatic; } +declare module "faker/locale/az" { + export = fakerStatic; +} + +declare module "faker/locale/cz" { + export = fakerStatic; +} + declare module "faker/locale/de" { export = fakerStatic; } @@ -351,6 +379,10 @@ declare module "faker/locale/ge" { export = fakerStatic; } +declare module "faker/locale/id_ID" { + export = fakerStatic; +} + declare module "faker/locale/it" { export = fakerStatic; } diff --git a/faker/v3/faker-tests.ts b/faker/v3/faker-tests.ts new file mode 100644 index 0000000000..4dc2a3735f --- /dev/null +++ b/faker/v3/faker-tests.ts @@ -0,0 +1,183 @@ + + +let resultStr: string; +let resultBool: boolean; +let resultNum: number; +let resultStrArr: string[]; +let resultDate: Date; + +import faker = require('faker'); +faker.locale = 'en'; + +resultStr = faker.address.zipCode(); +resultStr = faker.address.zipCode('###'); +resultStr = faker.address.city(); +resultStr = faker.address.city(0); +resultStr = faker.address.cityPrefix(); +resultStr = faker.address.citySuffix(); +resultStr = faker.address.streetName(); +resultStr = faker.address.streetAddress(); +resultStr = faker.address.streetAddress(false);; +resultStr = faker.address.streetSuffix(); +resultStr = faker.address.streetPrefix(); +resultStr = faker.address.secondaryAddress(); +resultStr = faker.address.county(); +resultStr = faker.address.country(); +resultStr = faker.address.countryCode(); +resultStr = faker.address.state(); +resultStr = faker.address.state(false); +resultStr = faker.address.stateAbbr(); +resultStr = faker.address.latitude(); +resultStr = faker.address.longitude(); + +resultStr = faker.commerce.color(); +resultStr = faker.commerce.department(); +resultStr = faker.commerce.productName(); +resultStr = faker.commerce.price(); +resultStr = faker.commerce.price(0, 0, 0, '#'); +resultStr = faker.commerce.productAdjective(); +resultStr = faker.commerce.productMaterial(); +resultStr = faker.commerce.product(); + +resultStrArr = faker.company.suffixes(); +resultStr = faker.company.companyName(); +resultStr = faker.company.companyName(0); +resultStr = faker.company.companySuffix(); +resultStr = faker.company.catchPhrase(); +resultStr = faker.company.bs(); +resultStr = faker.company.catchPhraseAdjective(); +resultStr = faker.company.catchPhraseDescriptor(); +resultStr = faker.company.catchPhraseNoun(); +resultStr = faker.company.bsAdjective(); +resultStr = faker.company.bsBuzz(); +resultStr = faker.company.bsNoun(); + +resultDate = faker.date.past(); +resultDate = faker.date.future(); +resultDate = faker.date.between('foo', 'bar'); +resultDate = faker.date.between(new Date(), new Date()); +resultDate = faker.date.recent(); +resultDate = faker.date.recent(100); +resultStr = faker.date.month(); +resultStr = faker.date.month({ + abbr: true, + context: true +}); +resultStr = faker.date.weekday(); +resultStr = faker.date.weekday({ + abbr: true, + context: true +}); + +resultStr = faker.finance.account(); +resultStr = faker.finance.account(0); +resultStr = faker.finance.accountName(); +resultStr = faker.finance.mask(); +resultStr = faker.finance.mask(0, false, false); +resultStr = faker.finance.amount(); +resultStr = faker.finance.amount(0, 0, 0, '#'); +resultStr = faker.finance.transactionType(); +resultStr = faker.finance.currencyCode(); +resultStr = faker.finance.currencyName(); +resultStr = faker.finance.currencySymbol(); + +resultStr = faker.hacker.abbreviation(); +resultStr = faker.hacker.adjective(); +resultStr = faker.hacker.noun(); +resultStr = faker.hacker.verb(); +resultStr = faker.hacker.ingverb(); +resultStr = faker.hacker.phrase(); + +resultStr = faker.helpers.randomize(); +resultNum = faker.helpers.randomize([1,2,3,4]); +resultStr = faker.helpers.randomize(['foo', 'bar', 'quux']); +resultStr = faker.helpers.slugify('foo bar quux'); +resultStr = faker.helpers.replaceSymbolWithNumber('foo# bar#'); +resultStr = faker.helpers.replaceSymbols('foo# bar? quux#'); +resultStrArr = faker.helpers.shuffle(['foo', 'bar', 'quux']); +resultStr = faker.helpers.mustache('{{foo}}{{bar}}', {foo: 'x', bar: 'y'}); + +const card = faker.helpers.createCard(); +resultStr = card.name; +resultStr = card.address.streetA; +const contextualCard = faker.helpers.contextualCard(); +resultStr = contextualCard.name; +resultStr = contextualCard.address.suite; +const userCard = faker.helpers.userCard(); +resultStr = userCard.name; +resultStr = userCard.address.suite; + +resultStr = faker.internet.avatar(); +resultStr = faker.internet.email(); +resultStr = faker.internet.email('foo', 'bar', 'quux'); +resultStr = faker.internet.protocol(); +resultStr = faker.internet.url(); +resultStr = faker.internet.domainName(); +resultStr = faker.internet.domainSuffix(); +resultStr = faker.internet.domainWord(); +resultStr = faker.internet.ip(); +resultStr = faker.internet.userAgent(); +resultStr = faker.internet.color(); +resultStr = faker.internet.color(0, 0, 0); +resultStr = faker.internet.mac(); +resultStr = faker.internet.password(); +resultStr = faker.internet.password(0, false, '#', 'foo'); + +resultStr = faker.lorem.word(); +resultStr = faker.lorem.words(); +resultStr = faker.lorem.words(0); +resultStr = faker.lorem.sentence(); +resultStr = faker.lorem.sentence(0, 0); +resultStr = faker.lorem.sentences(); +resultStr = faker.lorem.sentences(0); +resultStr = faker.lorem.paragraph(); +resultStr = faker.lorem.paragraph(0); +resultStr = faker.lorem.paragraphs(); +resultStr = faker.lorem.paragraphs(0, ''); + +resultStr = faker.name.firstName(); +resultStr = faker.name.firstName(0); +resultStr = faker.name.lastName(); +resultStr = faker.name.lastName(0); +resultStr = faker.name.findName(); +resultStr = faker.name.findName('', '', 0); +resultStr = faker.name.jobTitle(); +resultStr = faker.name.prefix(); +resultStr = faker.name.suffix(); +resultStr = faker.name.title(); +resultStr = faker.name.jobDescriptor(); +resultStr = faker.name.jobArea(); +resultStr = faker.name.jobType(); + +resultStr = faker.phone.phoneNumber(); +resultStr = faker.phone.phoneNumber('#'); +resultStr = faker.phone.phoneNumberFormat(); +// https://github.com/Marak/faker.js/blob/master/lib/phone_number.js#L9-L13 +resultStr = faker.phone.phoneNumberFormat(0); +resultStr = faker.phone.phoneFormats(); + +resultNum = faker.random.number(); +resultNum = faker.random.number(0); +resultNum = faker.random.number({ + min: 0, + max: 0, + precision: 0 +}); +resultStr = faker.random.arrayElement(); +resultStr = faker.random.arrayElement(['foo', 'bar', 'quux']) +resultStr = faker.random.objectElement(); +resultStr = faker.random.objectElement({foo: 'bar', field: 'foo'}); +resultStr = faker.random.uuid(); +resultBool = faker.random.boolean(); + +resultStr = faker.system.fileName( "foo", "bar" ); +resultStr = faker.system.commonFileName( "foo", "bar" ); +resultStr = faker.system.mimeType(); +resultStr = faker.system.commonFileType(); +resultStr = faker.system.commonFileExt(); +resultStr = faker.system.fileType(); +resultStr = faker.system.fileExt( "foo" ); +resultStr = faker.system.semver(); + +import fakerEn = require('faker/locale/en'); +resultStr = faker.name.firstName(); diff --git a/faker/v3/index.d.ts b/faker/v3/index.d.ts new file mode 100644 index 0000000000..01e01b8b8b --- /dev/null +++ b/faker/v3/index.d.ts @@ -0,0 +1,416 @@ +// Type definitions for faker v3.1 +// Project: http://marak.com/faker.js/ +// Definitions by: Bas Pennings , Yuki Kokubun +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare var fakerStatic: Faker.FakerStatic; + +declare namespace Faker { + interface FakerStatic { + locale: string; + + address: { + zipCode(format?: string): string; + city(format?: number): string; + cityPrefix(): string; + citySuffix(): string; + streetName(): string; + streetAddress(useFullAddress?: boolean): string; + streetSuffix(): string; + streetPrefix(): string; + secondaryAddress(): string; + county(): string; + country(): string; + countryCode(): string; + state(useAbbr?: boolean): string; + stateAbbr(): string; + latitude(): string; + longitude(): string; + }; + + commerce: { + color(): string; + department(): string; + productName(): string; + price(min?: number, max?: number, dec?: number, symbol?: string): string; + productAdjective(): string; + productMaterial(): string; + product(): string; + }; + + company: { + suffixes(): string[]; + companyName(format?: number): string; + companySuffix(): string; + catchPhrase(): string; + bs(): string; + catchPhraseAdjective(): string; + catchPhraseDescriptor(): string; + catchPhraseNoun(): string; + bsAdjective(): string; + bsBuzz(): string; + bsNoun(): string; + }; + + date: { + past(years?: number, refDate?: string|Date): Date; + future(years?: number, refDate?: string|Date): Date; + between(from: string|number|Date, to: string|Date): Date; + recent(days?: number): Date; + month(options?: { abbr?: boolean, context?: boolean }): string; + weekday(options?: { abbr?: boolean, context?: boolean }): string; + }; + + fake(str: string): string; + + finance: { + account(length?: number): string; + accountName(): string; + mask(length?: number, parens?: boolean, elipsis?: boolean): string; + amount(min?:number, max?: number, dec?: number, symbol?: string): string; + transactionType(): string; + currencyCode(): string; + currencyName(): string; + currencySymbol(): string; + }; + + hacker: { + abbreviation(): string; + adjective(): string; + noun(): string; + verb(): string; + ingverb(): string; + phrase(): string; + }; + + helpers: { + randomize(array: T[]): T; + randomize(): string; + slugify(string?: string): string; + replaceSymbolWithNumber(string?: string, symbol?: string): string; + replaceSymbols(string?: string): string; + shuffle(o: T[]): T[]; + shuffle(): string[]; + mustache(str: string, data: { [key: string]: string|((substring: string, ...args: any[]) => string) }): string; + createCard(): Faker.Card; + contextualCard(): Faker.ContextualCard; + userCard(): Faker.UserCard; + createTransaction(): Faker.Transaction; + }; + + + image: { + image(): string; + avatar(): string; + imageUrl(width?: number, height?: number, category?: string): string; + abstract(width?: number, height?: number): string; + animals(width?: number, height?: number): string; + business(width?: number, height?: number): string; + cats(width?: number, height?: number): string; + city(width?: number, height?: number): string; + food(width?: number, height?: number): string; + nightlife(width?: number, height?: number): string; + fashion(width?: number, height?: number): string; + people(width?: number, height?: number): string; + nature(width?: number, height?: number): string; + sports(width?: number, height?: number): string; + technics(width?: number, height?: number): string; + transport(width?: number, height?: number): string; + }; + + internet: { + avatar(): string; + email(firstName?: string, lastName?: string, provider?: string): string; + userName(firstName?: string, lastName?: string): string; + protocol(): string; + url(): string; + domainName(): string; + domainSuffix(): string; + domainWord(): string; + ip(): string; + userAgent(): string; + color(baseRed255?: number, baseGreen255?: number, baseBlue255?: number): string; + mac(): string; + password(len?: number, memorable?: boolean, pattern?: string|RegExp, prefix?: string): string; + }; + + lorem: { + word(): string; + words(num?: number): string; + sentence(wordCount?: number, range?: number): string; + sentences(sentenceCount?: number): string; + paragraph(sentenceCount?: number): string; + paragraphs(paragraphCount?: number, separator?: string): string; + }; + + name: { + firstName(gender?: number): string; + lastName(gender?: number): string; + findName(firstName?: string, lastName?: string, gender?: number): string; + jobTitle(): string; + prefix(): string; + suffix(): string; + title(): string; + jobDescriptor(): string; + jobArea(): string; + jobType(): string; + }; + + phone: { + phoneNumber(format?: string): string; + phoneNumberFormat(phoneFormatsArrayIndex?: number): string; + phoneFormats(): string; + }; + + random: { + number(max: number): number; + number(options?: { min?: number, max?: number, precision?: number }): number; + arrayElement(): string; + arrayElement(array: T[]): T; + objectElement(object?: { [key: string]: any }, field?: "key"): string; + objectElement(object?: { [key: string]: T }, field?: any): T; + uuid(): string; + boolean(): boolean; + }; + + system: { + fileName(ext: string, type: string): string; + commonFileName(ext: string, type: string): string; + mimeType(): string; + commonFileType(): string; + commonFileExt(): string; + fileType(): string; + fileExt(mimeType: string): string; + //directoryPath(): string; + //filePath(): string; + semver(): string; + }; + + seed(value: number): void; + } + + interface Card { + name: string; + username: string; + email: string; + address: FullAddress; + phone: string; + website: string; + company: Company; + posts: Post[]; + accountHistory: string[]; + } + + interface FullAddress { + streetA: string; + streetB: string; + streetC: string; + streetD: string; + city: string; + state: string; + county: string; + zipcode: string; + geo: Geo; + } + + interface Geo { + lat: string; + lng: string; + } + + interface Company { + name: string; + catchPhrase: string; + bs: string; + } + + interface Post { + words: string; + sentence: string; + sentences: string; + paragraph: string; + } + + interface ContextualCard { + name: string; + username: string; + email: string; + dob: Date; + phone: string; + address: Address; + website: string; + company: Company; + } + + interface Address { + street: string; + suite: string; + city: string; + state: string; + zipcode: string; + geo: Geo; + } + + interface UserCard { + name: string; + username: string; + email: string; + address: Address; + phone: string; + website: string; + company: Company; + } + + interface Transaction { + amount: string; + date: Date; + business: string; + name: string; + type: string; + account: string; + } +} + +declare module "faker" { + export = fakerStatic; +} + +declare module "faker/locale/de" { + export = fakerStatic; +} + +declare module "faker/locale/de_AT" { + export = fakerStatic; +} + +declare module "faker/locale/de_CH" { + export = fakerStatic; +} + +declare module "faker/locale/el_GR" { + export = fakerStatic; +} + +declare module "faker/locale/en" { + export = fakerStatic; +} + +declare module "faker/locale/en_AU" { + export = fakerStatic; +} + +declare module "faker/locale/en_BORK" { + export = fakerStatic; +} + +declare module "faker/locale/en_CA" { + export = fakerStatic; +} + +declare module "faker/locale/en_GB" { + export = fakerStatic; +} + +declare module "faker/locale/en_IE" { + export = fakerStatic; +} + +declare module "faker/locale/en_IND" { + export = fakerStatic; +} + +declare module "faker/locale/en_US" { + export = fakerStatic; +} + +declare module "faker/locale/en_au_ocker" { + export = fakerStatic; +} + +declare module "faker/locale/es" { + export = fakerStatic; +} + +declare module "faker/locale/es_MX" { + export = fakerStatic; +} + +declare module "faker/locale/fa" { + export = fakerStatic; +} + +declare module "faker/locale/fr" { + export = fakerStatic; +} + +declare module "faker/locale/fr_CA" { + export = fakerStatic; +} + +declare module "faker/locale/ge" { + export = fakerStatic; +} + +declare module "faker/locale/it" { + export = fakerStatic; +} + +declare module "faker/locale/ja" { + export = fakerStatic; +} + +declare module "faker/locale/ko" { + export = fakerStatic; +} + +declare module "faker/locale/nb_NO" { + export = fakerStatic; +} + +declare module "faker/locale/nep" { + export = fakerStatic; +} + +declare module "faker/locale/nl" { + export = fakerStatic; +} + +declare module "faker/locale/pl" { + export = fakerStatic; +} + +declare module "faker/locale/pt_BR" { + export = fakerStatic; +} + +declare module "faker/locale/ru" { + export = fakerStatic; +} + +declare module "faker/locale/sk" { + export = fakerStatic; +} + +declare module "faker/locale/sv" { + export = fakerStatic; +} + +declare module "faker/locale/tr" { + export = fakerStatic; +} + +declare module "faker/locale/uk" { + export = fakerStatic; +} + +declare module "faker/locale/vi" { + export = fakerStatic; +} + +declare module "faker/locale/zh_CN" { + export = fakerStatic; +} + +declare module "faker/locale/zh_TW" { + export = fakerStatic; +} diff --git a/faker/v3/tsconfig.json b/faker/v3/tsconfig.json new file mode 100644 index 0000000000..40af61eba9 --- /dev/null +++ b/faker/v3/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "paths": { + "faker": [ "faker/v3" ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "faker-tests.ts" + ] +} From eed88053b0ec98c27e50e77b4216053aa455d432 Mon Sep 17 00:00:00 2001 From: abeall Date: Wed, 8 Mar 2017 14:24:11 -0500 Subject: [PATCH 414/797] Added browser name values --- detect-browser/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detect-browser/index.d.ts b/detect-browser/index.d.ts index 0f845cd781..5ca68eabdf 100644 --- a/detect-browser/index.d.ts +++ b/detect-browser/index.d.ts @@ -6,7 +6,7 @@ /** * Browser name */ -export const name: string; +export const name: "edge" | "yandexbrowser" | "chrome" | "crios" | "firefox" | "opera" | "ie" | "bb10" | "android" | "ios" | "safari"; /** * Browser version From 023d4ef9370dc1a7ca348d75cb4b0e42c890dee5 Mon Sep 17 00:00:00 2001 From: abeall Date: Wed, 8 Mar 2017 14:26:53 -0500 Subject: [PATCH 415/797] Updated version --- detect-browser/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detect-browser/index.d.ts b/detect-browser/index.d.ts index 5ca68eabdf..57ed80c411 100644 --- a/detect-browser/index.d.ts +++ b/detect-browser/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for detect-browser v1.3.3 +// Type definitions for detect-browser v1.6.2 // Project: https://github.com/DamonOehlman/detect-browser // Definitions by: Rogier Schouten // Definitions: https://github.com/borisyankov/DefinitelyTyped From c105965b68d0639a6360c5a6bb3b7c98c79b2bee Mon Sep 17 00:00:00 2001 From: Ben Swartz Date: Wed, 8 Mar 2017 11:28:16 -0800 Subject: [PATCH 416/797] Change Header Comment --- faker/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faker/index.d.ts b/faker/index.d.ts index 8c6ea8ec6f..ccca40e51a 100644 --- a/faker/index.d.ts +++ b/faker/index.d.ts @@ -1,4 +1,4 @@ -// Based off type definitions for faker v4.1.0 +// Type definitions for faker v4.1.0 // Project: http://marak.com/faker.js/ // Definitions by: Ben Swartz , Bas Pennings , Yuki Kokubun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 5ed36ce5a8367dde3c2240ed8613ca332208e507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20=C5=81aziuk?= Date: Wed, 8 Mar 2017 21:33:44 +0100 Subject: [PATCH 417/797] max-lint-length --- body-parser/tslint.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/body-parser/tslint.json b/body-parser/tslint.json index ec365f164b..9311f348d9 100644 --- a/body-parser/tslint.json +++ b/body-parser/tslint.json @@ -1,3 +1,6 @@ { - "extends": "../tslint.json" + "extends": "../tslint.json", + "rules": { + "max-line-length": false + } } From 12606ecfd3a8fbd6f1ec65539387d2d7762ef6fa Mon Sep 17 00:00:00 2001 From: Tom Wanzek Date: Wed, 8 Mar 2017 16:17:26 -0500 Subject: [PATCH 418/797] [d3-array]: * Some added tests. --- d3-array/d3-array-tests.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/d3-array/d3-array-tests.ts b/d3-array/d3-array-tests.ts index 225cec33ef..3a6fe4ce35 100644 --- a/d3-array/d3-array-tests.ts +++ b/d3-array/d3-array-tests.ts @@ -334,9 +334,15 @@ mergedArray = d3Array.merge(testArrays); // explicit type let crossed: Array<[string, number]>; +crossed = d3Array.cross(['x', 'y'], [1, 2]); crossed = d3Array.cross(['x', 'y'], [1, 2]); -let strArray: string[] = d3Array.cross([2, 3], [5, 6], (a, b) => (a + b) + 'px') +let strArray: string[] = d3Array.cross([2, 3], [5, 6], (a, b) => (a + b) + 'px'); +strArray = d3Array.cross([2, 3], [5, 6], function(a, b) { + let aa: number = a; + let bb: number = b; + return (aa + bb) + 'px'; +}); // pairs() --------------------------------------------------------------------- @@ -345,7 +351,12 @@ let pairs: Array<[MixedObject, MixedObject]>; pairs = d3Array.pairs(mergedArray); -numbersArray = d3Array.pairs(mergedArray, (a, b) => b.num - a.num); +numbersArray = d3Array.pairs(mergedArray, (a, b) => b.num - a.num); +numbersArray = d3Array.pairs(mergedArray, function(a, b) { + let aa: MixedObject = a; + let bb: MixedObject = b; + return bb.num - aa.num; +}); // permute() ------------------------------------------------------------------- From fd064c94d55d2295dd0e01ed3e55742170d4c497 Mon Sep 17 00:00:00 2001 From: Benjamin Lim Date: Thu, 16 Feb 2017 10:09:13 +0800 Subject: [PATCH 419/797] fix: AggressiveMergingPlugin --- webpack/index.d.ts | 26 ++++++++++++++++++++++---- webpack/webpack-tests.ts | 31 ++++++++++++++++++++++++++++--- 2 files changed, 50 insertions(+), 7 deletions(-) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index 18ab5274ba..0eb787a9b0 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -783,10 +783,28 @@ declare namespace webpack { namespace optimize { class AggressiveMergingPlugin extends Plugin { - constructor(options?: { - minSize?: number; - maxSize?: number; - }); + constructor(options?: AggressiveMergingPlugin.Options); + } + + namespace AggressiveMergingPlugin { + interface Options { + /** + * When options.moveToParents is set, moving to an entry chunk is more expensive. + * Defaults to 10, which means moving to an entry chunk is ten times more expensive than moving to a + * normal chunk. + */ + entryChunkMultiplicator?: number; + /** + * A factor which defines the minimum required size reduction for chunk merging. + * Defaults to 1.5 which means that the total size needs to be reduced by 50% for chunk merging. + */ + minSizeReduce?: number; + /** + * When set, modules that are not in both merged chunks are moved to all parents of the chunk. + * Defaults to false. + */ + moveToParents?: boolean; + } } class CommonsChunkPlugin extends Plugin { diff --git a/webpack/webpack-tests.ts b/webpack/webpack-tests.ts index 8ab05c1de4..483e175f38 100644 --- a/webpack/webpack-tests.ts +++ b/webpack/webpack-tests.ts @@ -1,6 +1,33 @@ - import * as webpack from 'webpack'; +const { + optimize, +} = webpack; + +let plugins: webpack.Plugin[]; + +/** + * Plugins + */ + +/** + * optimize + */ + +const { + AggressiveMergingPlugin, +} = optimize; + +plugins = [ + new AggressiveMergingPlugin(), + new AggressiveMergingPlugin({}), + new AggressiveMergingPlugin({ + entryChunkMultiplicator: 10, + minSizeReduce: 1.5, + moveToParents: false, + }), +]; + let configuration: webpack.Configuration; let rule: webpack.Rule; let plugin: webpack.Plugin; @@ -236,7 +263,6 @@ declare const context: any; declare const request: any; declare const types: any; declare const banner: any; -const plugins: webpack.Plugin[] = []; plugin = new webpack.NormalModuleReplacementPlugin(resourceRegExp, newResource); plugin = new webpack.ContextReplacementPlugin( @@ -334,7 +360,6 @@ plugin = new CommonsChunkPlugin({ // minChunks: 3, // (3 children must share the module before it's separated) }); -plugin = new webpack.optimize.AggressiveMergingPlugin(options); plugin = new webpack.DefinePlugin(definitions); plugin = new webpack.DefinePlugin({ "VERSION": JSON.stringify("5fa3b9"), From b42d2fac4d7049d52ac8c9b0d56f2d9bace91674 Mon Sep 17 00:00:00 2001 From: Tom Wanzek Date: Wed, 8 Mar 2017 16:23:22 -0500 Subject: [PATCH 420/797] [d3-array] * linting related change to arrow. --- d3-array/d3-array-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/d3-array/d3-array-tests.ts b/d3-array/d3-array-tests.ts index 3a6fe4ce35..7dbe08bad0 100644 --- a/d3-array/d3-array-tests.ts +++ b/d3-array/d3-array-tests.ts @@ -338,7 +338,7 @@ crossed = d3Array.cross(['x', 'y'], [1, 2]); crossed = d3Array.cross(['x', 'y'], [1, 2]); let strArray: string[] = d3Array.cross([2, 3], [5, 6], (a, b) => (a + b) + 'px'); -strArray = d3Array.cross([2, 3], [5, 6], function(a, b) { +strArray = d3Array.cross([2, 3], [5, 6], (a, b) => { let aa: number = a; let bb: number = b; return (aa + bb) + 'px'; @@ -352,7 +352,7 @@ let pairs: Array<[MixedObject, MixedObject]>; pairs = d3Array.pairs(mergedArray); numbersArray = d3Array.pairs(mergedArray, (a, b) => b.num - a.num); -numbersArray = d3Array.pairs(mergedArray, function(a, b) { +numbersArray = d3Array.pairs(mergedArray, (a, b) => { let aa: MixedObject = a; let bb: MixedObject = b; return bb.num - aa.num; From 86e0a0389ba2639d5dc2a2c4b2807314e5e7b789 Mon Sep 17 00:00:00 2001 From: Mine Starks Date: Wed, 8 Mar 2017 13:40:49 -0800 Subject: [PATCH 421/797] stream-buffers fix linter error --- stream-buffers/stream-buffers-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stream-buffers/stream-buffers-tests.ts b/stream-buffers/stream-buffers-tests.ts index 2a1a1f35f8..7bccc43f15 100644 --- a/stream-buffers/stream-buffers-tests.ts +++ b/stream-buffers/stream-buffers-tests.ts @@ -39,7 +39,7 @@ var myReadableStreamBuffer = new streamBuffers.ReadableStreamBuffer({ myReadableStreamBuffer.put('A String', 'utf8'); myReadableStreamBuffer.put(buffer); -myReadableStreamBuffer.on('data', function(data) { +myReadableStreamBuffer.on('data', (data) => { // streams1.x style data // assert.isTrue(data instanceof Buffer); }); From 7275ca875933bc55aa8bef54fd296560ae0ecc7c Mon Sep 17 00:00:00 2001 From: Ben Swartz Date: Wed, 8 Mar 2017 13:52:41 -0800 Subject: [PATCH 422/797] set strictNullChecks to true, add new line at eof --- faker/tsconfig.json | 4 ++-- faker/v3/tsconfig.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/faker/tsconfig.json b/faker/tsconfig.json index c2ce14c941..0589e5dc54 100644 --- a/faker/tsconfig.json +++ b/faker/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" @@ -19,4 +19,4 @@ "index.d.ts", "faker-tests.ts" ] -} \ No newline at end of file +} diff --git a/faker/v3/tsconfig.json b/faker/v3/tsconfig.json index 40af61eba9..052493a9c7 100644 --- a/faker/v3/tsconfig.json +++ b/faker/v3/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" From da51ad71f4eca463bb4562f658f908a8981c4911 Mon Sep 17 00:00:00 2001 From: "Rodrigo F. Fernandes" Date: Wed, 8 Mar 2017 19:14:59 -0300 Subject: [PATCH 423/797] Removed access modifier from properties Since properties are public by default, there's no need to specify the access modifier. --- node-powershell/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node-powershell/index.d.ts b/node-powershell/index.d.ts index bdddd1a448..978d7e7c29 100644 --- a/node-powershell/index.d.ts +++ b/node-powershell/index.d.ts @@ -45,12 +45,12 @@ declare module 'node-powershell' { /** * An array containing the command history ever added to the shell instance. */ - public history: string[]; + history: string[]; /** * An object containing the sdtio (in,out,err) [stream.Readable] of the PowerShell Instance. */ - public streams: NodePowershell.ShellStream; + streams: NodePowershell.ShellStream; /** * Creates a new Shell instance. From 1b95ed269fbbcb34ec770a212147aed1e5c72f03 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Thu, 9 Mar 2017 01:21:15 +0000 Subject: [PATCH 424/797] Fixed magic quotes. --- openfin/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openfin/index.d.ts b/openfin/index.d.ts index f0803864ae..24f91ab9ca 100644 --- a/openfin/index.d.ts +++ b/openfin/index.d.ts @@ -63,7 +63,7 @@ declare namespace fin { */ close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Retrieves an array of wrapped fin.desktop.Windows for each of the application�s child windows. + * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. */ getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; /** @@ -99,7 +99,7 @@ declare namespace fin { */ removeEventListener(type: OpenFinApplicationEventType, previouslyRegisteredListener: (event: ApplicationBaseEvent | TrayIconClickedEvent | WindowEvent | WindowAlertRequestedEvent | WindowAuthRequested | WindowNavigationRejectedEvent | WindowEndLoadEvent) => any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Removes the application�s icon from the tray. + * Removes the application's icon from the tray. */ removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -1008,7 +1008,7 @@ declare namespace fin { bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Closes the window. - * @param {force} Close will be prevented from closing when force is false and �close-requested� has been subscribed to for application�s main window. + * @param {force} Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. */ close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -1028,7 +1028,7 @@ declare namespace fin { */ enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Flashes the window�s frame and taskbar icon until the window is activated. + * Flashes the window's frame and taskbar icon until the window is activated. */ flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -1125,7 +1125,7 @@ declare namespace fin { setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Shows the window if it is hidden. - * @param {force} Show will be prevented from closing when force is false and �show-requested� has been subscribed to for application�s main window. + * @param {force} Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. */ show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** From 9fc167714de333821347c5ebcb090f9f78457bf2 Mon Sep 17 00:00:00 2001 From: Chris Barker Date: Thu, 9 Mar 2017 01:45:36 +0000 Subject: [PATCH 425/797] Fixed magic quotes in v16 too. --- openfin/v16/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openfin/v16/index.d.ts b/openfin/v16/index.d.ts index 0b9f3e16ac..32e980120f 100644 --- a/openfin/v16/index.d.ts +++ b/openfin/v16/index.d.ts @@ -63,7 +63,7 @@ declare namespace fin { */ close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Retrieves an array of wrapped fin.desktop.Windows for each of the application�s child windows. + * Retrieves an array of wrapped fin.desktop.Windows for each of the application's child windows. */ getChildWindows(callback?: (children: OpenFinWindow[]) => void, errorCallback?: (reason: string) => void): void; /** @@ -95,7 +95,7 @@ declare namespace fin { */ removeEventListener(type: OpenFinApplicationEventType, previouslyRegisteredListener: (event: ApplicationBaseEvent | TrayIconClickedEvent | WindowEvent | WindowAlertRequestedEvent | WindowAuthRequested | WindowNavigationRejectedEvent | WindowEndLoadEvent) => any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Removes the application�s icon from the tray. + * Removes the application's icon from the tray. */ removeTrayIcon(callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -989,7 +989,7 @@ declare namespace fin { bringToFront(callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Closes the window. - * @param {force} Close will be prevented from closing when force is false and �close-requested� has been subscribed to for application�s main window. + * @param {force} Close will be prevented from closing when force is false and 'close-requested' has been subscribed to for application's main window. */ close(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -1009,7 +1009,7 @@ declare namespace fin { */ enableFrame(callback?: () => void, errorCallback?: (reason: string) => void): void; /** - * Flashes the window�s frame and taskbar icon until the window is activated. + * Flashes the window's frame and taskbar icon until the window is activated. */ flash(options?: any, callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -1106,7 +1106,7 @@ declare namespace fin { setZoomLevel(level: number, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Shows the window if it is hidden. - * @param {force} Show will be prevented from closing when force is false and �show-requested� has been subscribed to for application�s main window. + * @param {force} Show will be prevented from closing when force is false and 'show-requested' has been subscribed to for application's main window. */ show(force?: boolean, callback?: () => void, errorCallback?: (reason: string) => void): void; /** From d4864b74edfcd79afc9f120e8b7df33c4665bd50 Mon Sep 17 00:00:00 2001 From: Ricky Blankenaufulland Date: Thu, 9 Mar 2017 14:58:30 +0100 Subject: [PATCH 426/797] fixed how the GridStack object is obtained jQuery plugins return the jQuery object, to get the plugin, also in the case of GridStack 0.2.6 (latest) you use the data() method with the correct name --- gridstack/gridstack-tests.ts | 6 +++++- gridstack/index.d.ts | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gridstack/gridstack-tests.ts b/gridstack/gridstack-tests.ts index 96aa14b19f..02e6c1597f 100644 --- a/gridstack/gridstack-tests.ts +++ b/gridstack/gridstack-tests.ts @@ -10,7 +10,11 @@ var options = { float: true }; -var gridstack:GridStack = $(document).gridstack(options); +var element: JQuery = $(document).gridstack(options); +var gridstack: GridStack = $(document).data("gridstack"); +var gsFromElement: GridStack = element.data("gridstack"); + +if (gridstack !== gsFromElement) throw Error('These should match!'); gridstack.addWidget("test", 1, 2, 3, 4, true); gridstack.batchUpdate(); diff --git a/gridstack/index.d.ts b/gridstack/index.d.ts index 75056999e2..19e4bda280 100644 --- a/gridstack/index.d.ts +++ b/gridstack/index.d.ts @@ -4,7 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface JQuery { - gridstack (options: IGridstackOptions):GridStack + gridstack (options: IGridstackOptions): JQuery; + data(key: "gridstack"): GridStack; } interface GridStack { From bd35ad182875e11c8c70c97d1bc40726a62e08e1 Mon Sep 17 00:00:00 2001 From: Ricky Blankenaufulland Date: Thu, 9 Mar 2017 14:59:27 +0100 Subject: [PATCH 427/797] added ZoolWay to the authors --- gridstack/gridstack-tests.ts | 1 + gridstack/index.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/gridstack/gridstack-tests.ts b/gridstack/gridstack-tests.ts index 02e6c1597f..0546bab506 100644 --- a/gridstack/gridstack-tests.ts +++ b/gridstack/gridstack-tests.ts @@ -5,6 +5,7 @@ // Type definitions for Gridstack // Project: http://troolee.github.io/gridstack.js/ // Definitions by: Pascal Senn +// Definitions by: Ricky Blankenaufulland // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped var options = { diff --git a/gridstack/index.d.ts b/gridstack/index.d.ts index 19e4bda280..7f557f4af6 100644 --- a/gridstack/index.d.ts +++ b/gridstack/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Gridstack // Project: http://troolee.github.io/gridstack.js/ // Definitions by: Pascal Senn +// Definitions by: Ricky Blankenaufulland // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface JQuery { From d57893528cfc43ee257764d0d4986a996fa91ac7 Mon Sep 17 00:00:00 2001 From: cwmoo740 Date: Thu, 9 Mar 2017 13:07:57 -0500 Subject: [PATCH 428/797] add types for react-day-picker 5.2 --- react-day-picker/index.d.ts | 54 ++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/react-day-picker/index.d.ts b/react-day-picker/index.d.ts index 1e99e1f48b..be90f72d07 100644 --- a/react-day-picker/index.d.ts +++ b/react-day-picker/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-day-picker 5.1 +// Type definitions for react-day-picker 5.2 // Project: https://github.com/gpbl/react-day-picker // Definitions by: Giampaolo Bellavite , Jason Killian // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -28,30 +28,34 @@ declare namespace DayPicker { } export interface CaptionElementProps { - date?: Date; - localeUtils?: LocaleUtils; - locale?: string; - onClick?(month: Date, e: React.MouseEvent): void; + date: Date; + classNames: ClassNames, + localeUtils: LocaleUtils; + locale: string; + months: undefined; + onClick?: React.MouseEventHandler; } export interface NavbarElementProps { - className?: string; - previousMonth?: Date; - nextMonth?: Date; - showPreviousButton?: boolean; - showNextButton?: boolean; - onPreviousClick?(): void; - onNextClick?(): void; + className: string; + classNames: ClassNames; + previousMonth: Date; + nextMonth: Date; + showPreviousButton: boolean; + showNextButton: boolean; + onPreviousClick(callback?: () => void): void; + onNextClick(callback?: () => void): void; dir?: string; - localeUtils?: LocaleUtils; - locale?: string; + labels: { previousMonth: string; nextMonth: string; }; + localeUtils: LocaleUtils; + locale: string; } export interface WeekdayElementProps { - weekday?: number; - className?: string; - localeUtils?: LocaleUtils; - locale?: string; + weekday: number; + className: string; + localeUtils: LocaleUtils; + locale: string; } export interface ClassNames { @@ -89,7 +93,7 @@ declare namespace DayPicker { export interface FunctionModifier { (date: Date): boolean; } - export type Modifier = RangeModifier | BeforeModifier | AfterModifier | FunctionModifier; + export type Modifier = Date | RangeModifier | BeforeModifier | AfterModifier | FunctionModifier; export interface Modifiers { today: Modifier | Modifier[]; @@ -99,7 +103,9 @@ declare namespace DayPicker { export interface Props { canChangeMonth?: boolean; - captionElement?: React.ReactElement; + captionElement?: React.ReactElement> | + React.ComponentClass | + React.SFC; className?: string; classNames?: ClassNames; containerProps?: React.HTMLAttributes; @@ -115,7 +121,9 @@ declare namespace DayPicker { modifiers?: Partial; month?: Date; months?: [string, string, string, string, string, string, string, string, string, string, string, string]; - navbarElement?: React.ReactElement; + navbarElement?: React.ReactElement> | + React.ComponentClass | + React.SFC; numberOfMonths?: number; onBlur?(e: React.FocusEvent): void; onCaptionClick?(month: Date, e: React.MouseEvent): void; @@ -133,7 +141,9 @@ declare namespace DayPicker { reverseMonths?: boolean; selectedDays?: Modifier | Modifier[]; toMonth?: Date; - weekdayElement?: React.ReactElement; + weekdayElement?: React.ReactElement> | + React.ComponentClass | + React.SFC; weekdaysLong?: [string, string, string, string, string, string, string]; weekdaysShort?: [string, string, string, string, string, string, string]; } From c0b6319ccf49e2ac3107bfb906456489ab30f9d4 Mon Sep 17 00:00:00 2001 From: cwmoo740 Date: Thu, 9 Mar 2017 15:22:54 -0500 Subject: [PATCH 429/797] react-day-picker update tests to include new use of Element or React.SFC for captionElement --- react-day-picker/react-day-picker-tests.tsx | 23 ++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/react-day-picker/react-day-picker-tests.tsx b/react-day-picker/react-day-picker-tests.tsx index deecb3e21a..8c2755f9b5 100644 --- a/react-day-picker/react-day-picker-tests.tsx +++ b/react-day-picker/react-day-picker-tests.tsx @@ -8,7 +8,7 @@ function isSunday(day: Date) { function MyComponent() { return ( ); } @@ -26,10 +26,27 @@ class Caption extends React.Component { } return ( -
    onClick(date, e) }> +
    { localeUtils.formatMonthTitle(date, locale) }
    ); } } -}/> + + + +type CaptionElementProps = Partial; +class CaptionElement extends React.Component { + render() { + const { date, locale, localeUtils, onClick } = this.props; + if (!date || !locale || !localeUtils || !onClick) { + return
    ; + } + return ( +
    + { localeUtils.formatMonthTitle(date, locale) } +
    + ) + } +} + }/> From d4b99f6dcaae5ff5b9d0aaf93c917b00c336d362 Mon Sep 17 00:00:00 2001 From: Matt C Date: Thu, 23 Feb 2017 12:40:50 +1100 Subject: [PATCH 430/797] [redux-form] Added an optional "forceUnregisterOnUnmount" property to the "reduxForm()" "Config" interface, as it is present in the redux-form API. --- redux-form/lib/reduxForm.d.ts | 6 ++++++ redux-form/redux-form-tests.tsx | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/redux-form/lib/reduxForm.d.ts b/redux-form/lib/reduxForm.d.ts index 82efbd9cff..bcfafe2e3a 100644 --- a/redux-form/lib/reduxForm.d.ts +++ b/redux-form/lib/reduxForm.d.ts @@ -65,6 +65,12 @@ export interface Config { */ destroyOnUnmount?: boolean; + /** + * Whether or not to force unregistration of fields -- use in conjunction + * with destroyOnUnmount. + */ + forceUnregisterOnUnmount?: boolean; + /** * A function that takes the entire Redux state and returns the state slice * which corresponds to where the redux-form reducer was mounted. This diff --git a/redux-form/redux-form-tests.tsx b/redux-form/redux-form-tests.tsx index e660b6b0b5..f37e1e9815 100644 --- a/redux-form/redux-form-tests.tsx +++ b/redux-form/redux-form-tests.tsx @@ -56,3 +56,22 @@ const MyStatelessFunctionalComponent: React.SFC = () =>
    ; reduxForm({ form: 'mySFCForm' })(MyStatelessFunctionalComponent); + +class MyReusableForm extends Component { + render() { + return ( +
    + +
    + ); + } +} + +reduxForm({ + form: 'forceUnregisterOnMountForm', + forceUnregisterOnUnmount: true +}); From 3186a2ba273c41c91bde9f4adff3067ae1c901f7 Mon Sep 17 00:00:00 2001 From: voxmatt Date: Thu, 9 Mar 2017 16:52:56 -0800 Subject: [PATCH 431/797] fleshing out the relayProp --- react-relay/index.d.ts | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/react-relay/index.d.ts b/react-relay/index.d.ts index 9c45ed9c7c..8170e03190 100644 --- a/react-relay/index.d.ts +++ b/react-relay/index.d.ts @@ -31,6 +31,24 @@ declare module "react-relay" { response: any } + type RelayMutationStatus = + 'UNCOMMITTED' | // Transaction hasn't yet been sent to the server. Transaction can be committed or rolled back. + 'COMMIT_QUEUED' | // Transaction was committed but another transaction with the same collision key is pending, so the transaction has been queued to send to the server. + 'COLLISION_COMMIT_FAILED' | //Transaction was queued for commit but another transaction with the same collision key failed. All transactions in the collision queue, including this one, have been failed. Transaction can be recommitted or rolled back. + 'COMMITTING' | // Transaction is waiting for the server to respond. + 'COMMIT_FAILED'; + + class RelayMutationTransaction { + applyOptimistic(): RelayMutationTransaction; + commit(): RelayMutationTransaction; + recommit(): void; + rollback(): void; + getError(): Error; + getStatus(): RelayMutationStatus; + getHash(): string; + getID(): string; + } + interface RelayMutationRequest { getQueryString(): string getVariables(): RelayVariables @@ -104,7 +122,7 @@ declare module "react-relay" { renderFailure?(error: Error, retry: Function): JSX.Element } - type ReadyStateEvent = + type ReadyStateEvent = 'ABORT' | 'CACHE_RESTORED_REQUIRED' | 'CACHE_RESTORE_FAILED' | @@ -128,7 +146,12 @@ declare module "react-relay" { } interface RelayProp { - variables: any - setVariables(variables: Object, onReadyStateChange?: OnReadyStateChange): void + route: { name: string; }; // incomplete, also has params and queries + variables: any; + pendingVariables?: any; + setVariables(variables: Object, onReadyStateChange?: OnReadyStateChange): void; + forceFetch(variables: Object, onReadyStateChange?: OnReadyStateChange): void; + hasOptimisticUpdate(record: any): boolean; + getPendingTransactions(record: any): RelayMutationTransaction[]; } } From 4cc74c831a3f186cf42e417a462257f97fa526e3 Mon Sep 17 00:00:00 2001 From: voxmatt Date: Thu, 9 Mar 2017 17:22:18 -0800 Subject: [PATCH 432/797] fixing tests --- react-relay/index.d.ts | 4 ++-- react-relay/react-relay-tests.tsx | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/react-relay/index.d.ts b/react-relay/index.d.ts index 8170e03190..5b40145d18 100644 --- a/react-relay/index.d.ts +++ b/react-relay/index.d.ts @@ -151,7 +151,7 @@ declare module "react-relay" { pendingVariables?: any; setVariables(variables: Object, onReadyStateChange?: OnReadyStateChange): void; forceFetch(variables: Object, onReadyStateChange?: OnReadyStateChange): void; - hasOptimisticUpdate(record: any): boolean; - getPendingTransactions(record: any): RelayMutationTransaction[]; + hasOptimisticUpdate(record?: any): boolean; + getPendingTransactions(record?: any): RelayMutationTransaction[]; } } diff --git a/react-relay/react-relay-tests.tsx b/react-relay/react-relay-tests.tsx index 7160e60b0a..fa27f10c01 100644 --- a/react-relay/react-relay-tests.tsx +++ b/react-relay/react-relay-tests.tsx @@ -74,10 +74,16 @@ class StubbedArtwork extends React.Component { const props = { artwork: { title: "CHAMPAGNE FORMICA FLAG" }, relay: { + route: { + name: "champagne" + }, variables: { artworkID: "champagne-formica-flag", }, setVariables: () => {}, + forceFetch: () => {}, + hasOptimisticUpdate: () => false, + getPendingTransactions: (): Relay.RelayMutationTransaction[] => undefined, } } return From 498bf589489249b77f4259a95fe9dd97a670aab6 Mon Sep 17 00:00:00 2001 From: voxmatt Date: Thu, 9 Mar 2017 17:26:33 -0800 Subject: [PATCH 433/797] adding in commitUpdate while I'm at it --- react-relay/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/react-relay/index.d.ts b/react-relay/index.d.ts index 5b40145d18..0f6dbba024 100644 --- a/react-relay/index.d.ts +++ b/react-relay/index.d.ts @@ -153,5 +153,6 @@ declare module "react-relay" { forceFetch(variables: Object, onReadyStateChange?: OnReadyStateChange): void; hasOptimisticUpdate(record?: any): boolean; getPendingTransactions(record?: any): RelayMutationTransaction[]; + commitUpdate?: (mutation: Mutation, callbacks?: StoreUpdateCallbacks) => any; } } From 1c48132fce7744107626d69210e1a0d80d2b90cb Mon Sep 17 00:00:00 2001 From: xaviergonz Date: Fri, 10 Mar 2017 06:19:27 +0100 Subject: [PATCH 434/797] material-ui - export DialogProps interface (#15092) --- 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 529b9fe9fe..6f0adff4a2 100644 --- a/material-ui/index.d.ts +++ b/material-ui/index.d.ts @@ -946,7 +946,7 @@ declare namespace __MaterialUI { ref?: string; text: string; } - interface DialogProps extends React.DOMAttributes<{}>, React.Props { + export interface DialogProps extends React.DOMAttributes<{}>, React.Props { actions?: Array>; /** @deprecated use a custom `actions` property instead */ actionFocus?: string; From a08cfaa635c71c61487a34efc5b8f3ce16469a92 Mon Sep 17 00:00:00 2001 From: Cameron Little Date: Thu, 9 Mar 2017 21:22:51 -0800 Subject: [PATCH 435/797] Add imagesloaded `once` event listener and config to ctor (#15091) Documented at http://imagesloaded.desandro.com/#vanilla-javascript --- imagesloaded/imagesloaded-tests.ts | 12 ++++++++++-- imagesloaded/index.d.ts | 13 ++++++++++--- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/imagesloaded/imagesloaded-tests.ts b/imagesloaded/imagesloaded-tests.ts index 3f5ead2831..385df7b052 100644 --- a/imagesloaded/imagesloaded-tests.ts +++ b/imagesloaded/imagesloaded-tests.ts @@ -1,5 +1,3 @@ - - function test_ctor() { // element imagesLoaded(document.querySelector('#container'), function(instance) { @@ -12,6 +10,14 @@ function test_ctor() { // multiple elements var posts = document.querySelectorAll('.post'); imagesLoaded(posts, function() { console.log('all images are loaded'); }); + + // options + imagesLoaded('#container', { background: true }, function() { + console.log('all images are loaded'); + }); + imagesLoaded('#container', { background: '.item' }, function() { + console.log('all images are loaded'); + }); } function test_events_basic() { @@ -25,6 +31,8 @@ function test_events_basic() { imgLoad.on('always', onAlways); // unbind with .off() imgLoad.off('always', onAlways); + // bind once with .once() + imgLoad.once('always', onAlways); } function test_events_full() { diff --git a/imagesloaded/index.d.ts b/imagesloaded/index.d.ts index 507f082367..9a48a18e19 100644 --- a/imagesloaded/index.d.ts +++ b/imagesloaded/index.d.ts @@ -1,9 +1,9 @@ -// Type definitions for imagesLoaded 3.1.8 +// Type definitions for imagesLoaded 4.1.1 // Project: https://github.com/desandro/imagesloaded -// Definitions by: Chris Charabaruk +// Definitions by: Chris Charabaruk , Cameron Little // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// declare namespace ImagesLoaded { type ElementSelector = Element | NodeList | Array | string; @@ -30,14 +30,21 @@ declare namespace ImagesLoaded { // event listeners on(event: string, listener: ImagesLoadedListener): void; off(event: string, listener: ImagesLoadedListener): void; + once(event: string, listener: ImagesLoadedListener): void; + } + + interface ImagesLoadedOptions { + background: true | string; } interface ImagesLoadedConstructor { /** * Creates a new ImagesLoaded object with the provided callback * @param elem Element, NodeList, Element array, or selector string for images to watch + * @param options object that can tell imagesloaded to watch background images as well * @param callback function triggered after all images have been loaded */ + (elem: ElementSelector, options: ImagesLoadedOptions, callback?: ImagesLoadedCallback): ImagesLoaded; (elem: ElementSelector, callback?: ImagesLoadedCallback): ImagesLoaded; } } From 241e444a432a6a9b20876cd92bc293419fe67f72 Mon Sep 17 00:00:00 2001 From: Andrew Lively Date: Fri, 10 Mar 2017 00:23:19 -0500 Subject: [PATCH 436/797] Allow for requestTimeout in ConnectionConfig (#15089) requestTimeout is used by [mssql](https://github.com/patriksimek/node-mssql) --- knex/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/knex/index.d.ts b/knex/index.d.ts index 3e7dc595f4..0627498962 100644 --- a/knex/index.d.ts +++ b/knex/index.d.ts @@ -472,6 +472,7 @@ declare namespace Knex { domain?: string; instanceName?: string; debug?: boolean; + requestTimeout?: number; } // Config object for mariasql: https://github.com/mscdex/node-mariasql#client-methods From b657030e9c5f6181d8e2bf5fff55993204bbbeda Mon Sep 17 00:00:00 2001 From: Phat Tran Ky Date: Fri, 10 Mar 2017 12:24:29 +0700 Subject: [PATCH 437/797] fix mapbox_gl CirclePaint option name (#15088) --- mapbox-gl/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mapbox-gl/index.d.ts b/mapbox-gl/index.d.ts index 2e75704dde..64e8b8e573 100644 --- a/mapbox-gl/index.d.ts +++ b/mapbox-gl/index.d.ts @@ -978,7 +978,7 @@ declare namespace mapboxgl { "circle-translate-anchor"?: "map" | "viewport"; "circle-pitch-scale"?: "map" | "viewport"; "circle-stroke-width"?: number | StyleFunction; - "circle-stoke-color"?: string | StyleFunction; + "circle-stroke-color"?: string | StyleFunction; "circle-stroke-opactiy"?: number | StyleFunction; } } From 743e9958ff1c6008350ffcfcd69cade52628dad7 Mon Sep 17 00:00:00 2001 From: Matt Behrens Date: Fri, 10 Mar 2017 00:25:01 -0500 Subject: [PATCH 438/797] `net.Server` is missing `listening` boolean (#15087) cf. https://nodejs.org/api/net.html#net_server_listening --- node/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/node/index.d.ts b/node/index.d.ts index 175cc4081e..18b12ce5d2 100644 --- a/node/index.d.ts +++ b/node/index.d.ts @@ -2065,6 +2065,7 @@ declare module "net" { unref(): Server; maxConnections: number; connections: number; + listening: boolean; /** * events.EventEmitter From 1aad431d7d85d5cd3bbbd3ca043f0997e666e3e7 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 9 Mar 2017 21:25:49 -0800 Subject: [PATCH 439/797] node: Set "lib" to "es5" (#15093) --- node/index.d.ts | 11 +++++++++++ node/node-tests.ts | 4 ++-- node/tsconfig.json | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/node/index.d.ts b/node/index.d.ts index 18b12ce5d2..ca6e83a267 100644 --- a/node/index.d.ts +++ b/node/index.d.ts @@ -40,6 +40,17 @@ interface WeakMapConstructor { } interface SetConstructor { } interface WeakSetConstructor { } +// Forward-declare needed types from lib.es2015.d.ts (in case users are using `--lib es5`) +interface Iterable {} +interface Iterator { + next(value?: any): IteratorResult; +} +interface IteratorResult {} +interface SymbolConstructor { + readonly iterator: symbol; +} +declare var Symbol: SymbolConstructor; + /************************************************ * * * GLOBAL * diff --git a/node/node-tests.ts b/node/node-tests.ts index 7a50504d5b..04166bc006 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -520,7 +520,7 @@ function stream_readable_pipe_test() { assert(typeof r.bytesRead === 'number'); assert(typeof r.path === 'string'); - assert(typeof rs.path === 'Buffer'); + assert(rs.path instanceof Buffer); r.pipe(z).pipe(w); @@ -2159,7 +2159,7 @@ namespace v8_tests { const heapStats = v8.getHeapStatistics(); const heapSpaceStats = v8.getHeapSpaceStatistics(); - + const zapsGarbage: number = heapStats.does_zap_garbage; v8.setFlagsFromString('--collect_maps'); diff --git a/node/tsconfig.json b/node/tsconfig.json index 640b4f775e..5914d22a4c 100644 --- a/node/tsconfig.json +++ b/node/tsconfig.json @@ -6,7 +6,7 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es6" + "es5" ], "noImplicitAny": true, "noImplicitThis": true, From 722258f19aa2bde859332e224297e0156123513d Mon Sep 17 00:00:00 2001 From: buzzjuh Date: Fri, 10 Mar 2017 06:26:21 +0100 Subject: [PATCH 440/797] added typings for openlayers intersection filter (#15086) --- openlayers/index.d.ts | 115 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 109 insertions(+), 6 deletions(-) diff --git a/openlayers/index.d.ts b/openlayers/index.d.ts index 2d042b8af2..2b721ab7ca 100644 --- a/openlayers/index.d.ts +++ b/openlayers/index.d.ts @@ -2716,7 +2716,110 @@ declare module ol { } module filter { - interface Filter { } + /** + * Create a `` operator to test whether a geometry-valued property + * intersects a given geometry. + * + * @param {!string} geometryName Geometry name to use. + * @param {!ol.geom.Geometry} geometry Geometry. + * @param {string=} opt_srsName SRS name. No srsName attribute will be + * set on geometries when this is not provided. + * @returns {!ol.format.filter.Intersects} `` operator. + * @api + */ + function intersects(geometryName: string, geometry: ol.geom.Geometry, opt_srsName?: string): ol.format.filter.Intersects; + + /** + * @classdesc + * Abstract class; normally only used for creating subclasses and not instantiated in apps. + * Base class for WFS GetFeature filters. + * + * @constructor + * @param {!string} tagName The XML tag name for this filter. + * @struct + * @api + */ + class Filter { + /** + * @classdesc + * Abstract class; normally only used for creating subclasses and not instantiated in apps. + * Base class for WFS GetFeature filters. + * + * @constructor + * @param {!string} tagName The XML tag name for this filter. + * @struct + * @api + */ + constructor(tagName: string); + + /** + * The XML tag name for a filter. + * @returns {!string} Name. + */ + getTagName(): string; + } + + /** + * @classdesc + * Represents a spatial operator to test whether a geometry-valued property + * relates to a given geometry. + * + * @constructor + * @param {!string} tagName The XML tag name for this filter. + * @param {!string} geometryName Geometry name to use. + * @param {!ol.geom.Geometry} geometry Geometry. + * @param {string=} opt_srsName SRS name. No srsName attribute will be + * set on geometries when this is not provided. + * @extends {ol.format.filter.Filter} + * @api + */ + class Spatial extends ol.format.filter.Filter { + /** + * @classdesc + * Represents a spatial operator to test whether a geometry-valued property + * relates to a given geometry. + * + * @constructor + * @param {!string} tagName The XML tag name for this filter. + * @param {!string} geometryName Geometry name to use. + * @param {!ol.geom.Geometry} geometry Geometry. + * @param {string=} opt_srsName SRS name. No srsName attribute will be + * set on geometries when this is not provided. + * @extends {ol.format.filter.Filter} + * @api + */ + constructor(tagName: string, geometryName: string, geometry: ol.geom.Geometry, opt_srsName?: string); + } + + /** + * @classdesc + * Represents a `` operator to test whether a geometry-valued property + * intersects a given geometry. + * + * @constructor + * @param {!string} geometryName Geometry name to use. + * @param {!ol.geom.Geometry} geometry Geometry. + * @param {string=} opt_srsName SRS name. No srsName attribute will be + * set on geometries when this is not provided. + * @extends {ol.format.filter.Spatial} + * @api + */ + class Intersects extends ol.format.filter.Spatial { + /** + * @classdesc + * Represents a `` operator to test whether a geometry-valued property + * intersects a given geometry. + * + * @constructor + * @param {!string} geometryName Geometry name to use. + * @param {!ol.geom.Geometry} geometry Geometry. + * @param {string=} opt_srsName SRS name. No srsName attribute will be + * set on geometries when this is not provided. + * @extends {ol.format.filter.Spatial} + * @api + */ + constructor(geometryName: string, geometry: ol.geom.Geometry, opt_srsName?: string); + } } /** @@ -7355,7 +7458,7 @@ declare module ol { * `'top-center'`, `'top-right'` * @enum {string} */ - type OverlayPositioning = "bottom-left" | "bottom-center" | "bottom-right" | "center-left" | "center-center" | "center-right" | "top-left" | "top-center" | "top-right"; + type OverlayPositioning = "bottom-left" | "bottom-center" | "bottom-right" | "center-left" | "center-center" | "center-right" | "top-left" | "top-center" | "top-right"; /** * @classdesc @@ -10531,7 +10634,7 @@ declare module ol { * @api */ setGeometry(geometry: (string | ol.geom.Geometry | ol.StyleGeometryFunction)): void; - + /** * Set the image style. * @param {ol.style.Image} image Image style. @@ -10545,7 +10648,7 @@ declare module ol { * @api */ setStroke(stroke: ol.style.Stroke): void; - + /** * Set the text style. * @param {ol.style.Text} text Text style. @@ -11696,7 +11799,7 @@ declare module ol { /** * Animate the view. The view's center, zoom (or resolution), and * rotation can be animated for smooth transitions between view states. - * @param {olx.AnimateOptions} var_args Animation options. + * @param {olx.AnimateOptions} var_args Animation options. * @param {olx.AnimateOptions | (completed: boolean) => void } restArgs * @api experimental */ @@ -13797,7 +13900,7 @@ declare module olx { zoom?: number; zoomFactor?: number; } - + /** * Object literal with options for the {@link ol.Map#forEachFeatureAtPixel} and * {@link ol.Map#hasFeatureAtPixel} methods. From 53cfab7d4030686891e921e34f19717ccc479541 Mon Sep 17 00:00:00 2001 From: Kay S Date: Fri, 10 Mar 2017 06:27:17 +0100 Subject: [PATCH 441/797] Fixed null check errors (#15082) --- node-forge/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node-forge/index.d.ts b/node-forge/index.d.ts index 900fdfc2f9..586827253a 100644 --- a/node-forge/index.d.ts +++ b/node-forge/index.d.ts @@ -261,7 +261,7 @@ declare module "node-forge" { safeBags: Bag[]; }]; getBags: (filter: BagsFilter) => { - [key: string]: Bag[]; + [key: string]: Bag[]|undefined; localKeyId?: Bag[]; friendlyName?: Bag[]; }; From 77efe1d518743598212ed41cbc0b40b482dc9a51 Mon Sep 17 00:00:00 2001 From: Marcus Longmuir Date: Fri, 10 Mar 2017 05:32:48 +0000 Subject: [PATCH 442/797] google-protobuf - abstract Message (#15069) * google-protobuf - abstract Message * Added return types to tests * Fixed Object usage --- google-protobuf/google-protobuf-tests.ts | 6 +++--- google-protobuf/index.d.ts | 14 +++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/google-protobuf/google-protobuf-tests.ts b/google-protobuf/google-protobuf-tests.ts index 796969b2b3..76d4f19fcc 100644 --- a/google-protobuf/google-protobuf-tests.ts +++ b/google-protobuf/google-protobuf-tests.ts @@ -24,12 +24,12 @@ class MySimple extends jspb.Message { static repeatedFields_ = [3]; - toObject(opt_includeInstance: boolean) { + toObject(opt_includeInstance: boolean): {} { return MySimple.toObject(opt_includeInstance, this); }; - static toObject(includeInstance: boolean, msg: MySimple) { - const obj = { + static toObject(includeInstance: boolean, msg: MySimple): {} { + const obj: {} = { myString: jspb.Message.getFieldWithDefault(msg, 1, ""), myBool: jspb.Message.getFieldWithDefault(msg, 2, false), someLabelsList: jspb.Message.getField(msg, 3), diff --git a/google-protobuf/index.d.ts b/google-protobuf/index.d.ts index f40780ed8a..cf6a7e218a 100644 --- a/google-protobuf/index.d.ts +++ b/google-protobuf/index.d.ts @@ -9,7 +9,7 @@ type RepeatedFieldType = ScalarFieldType[] | Uint8Array[]; type AnyFieldType = ScalarFieldType | RepeatedFieldType | Uint8Array; type FieldValue = (string|number|boolean|Uint8Array|any/*This should be Array, but that isn't allowed*/|undefined) -export class Message { +export abstract class Message { getJsPbMessageId(): (string | undefined); static initialize(msg: Message, data: Message.MessageArray, @@ -112,6 +112,18 @@ export class Message { toMessage: Message): void; static registerMessageType(id: number, constructor: typeof Message): void; + + abstract serializeBinary(): Uint8Array; + abstract toObject(includeInstance?: boolean): {}; + + // These are `abstract static`, but that isn't allowed. Subclasses of Message will have these methods and properties + // and not having them on Message makes using this class for its intended purpose quite difficult. + static deserializeBinary(bytes: Uint8Array): Message; + static deserializeBinaryFromReader(message: Message, reader: BinaryReader): Message; + static serializeBinaryToWriter(message: Message, writer: BinaryWriter): void; + static toObject(includeInstance: boolean, msg: Message): {}; + static extensions: {[key: number]: ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: ExtensionFieldBinaryInfo}; } export namespace Message { From 390f797c4fded45831d2f8b6f5ce0eb7b4d4ae96 Mon Sep 17 00:00:00 2001 From: Julien CROUZET Date: Fri, 10 Mar 2017 06:37:27 +0100 Subject: [PATCH 443/797] MediaSession API (#15059) * MediaSession API * Make window and navigator properties optional --- wicg-mediasession/index.d.ts | 58 ++++++++++++++++++++ wicg-mediasession/tsconfig.json | 23 ++++++++ wicg-mediasession/tslint.json | 1 + wicg-mediasession/wicg-mediasession-tests.ts | 36 ++++++++++++ 4 files changed, 118 insertions(+) create mode 100644 wicg-mediasession/index.d.ts create mode 100644 wicg-mediasession/tsconfig.json create mode 100644 wicg-mediasession/tslint.json create mode 100644 wicg-mediasession/wicg-mediasession-tests.ts diff --git a/wicg-mediasession/index.d.ts b/wicg-mediasession/index.d.ts new file mode 100644 index 0000000000..389d2d2b5b --- /dev/null +++ b/wicg-mediasession/index.d.ts @@ -0,0 +1,58 @@ +// Type definitions for Media Session API 1.0 +// Project: https://wicg.github.io/mediasession/ +// Definitions by: Julien CROUZET +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface Navigator { + readonly mediaSession?: MediaSession; +} + +interface Window { + MediaSession?: MediaSession; +} + +type MediaSessionPlaybackState = 'none' | 'paused' | 'playing'; + +type MediaSessionAction = 'play' | 'pause' | 'seekbackward' | 'seekforward' | 'previoustrack' | 'nexttrack'; + +interface MediaSession { + // Current media session playback state. + playbackState: MediaSessionPlaybackState; + // Current media session meta data. + metadata?: MediaMetadata; + + // Set/Unset actions handlers. + setActionHandler(action: MediaSessionAction, listener?: () => void): void; +} + +interface MediaImage { + // URL from which the user agent can fetch the image’s data. + src: string; + // Specify the MediaImage object’s sizes. It follows the spec of sizes attribute in HTML link element. + sizes?: string; + // A hint as to the media type of the image. + type?: string; +} + +interface MediaMetadataInit { + // Media's title. + title?: string; + // Media's artist. + artist?: string; + // Media's album. + album?: string; + // Media's artwork. + artwork?: MediaImage[]; +} + +declare class MediaMetadata { + constructor(init?: MediaMetadataInit); + // Media's title. + title: string; + // Media's artist. + artist: string; + // Media's album. + album: string; + // Media's artwork. + artwork: MediaImage[]; +} diff --git a/wicg-mediasession/tsconfig.json b/wicg-mediasession/tsconfig.json new file mode 100644 index 0000000000..381f1027e4 --- /dev/null +++ b/wicg-mediasession/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "wicg-mediasession-tests.ts" + ] +} diff --git a/wicg-mediasession/tslint.json b/wicg-mediasession/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/wicg-mediasession/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } diff --git a/wicg-mediasession/wicg-mediasession-tests.ts b/wicg-mediasession/wicg-mediasession-tests.ts new file mode 100644 index 0000000000..78731a3222 --- /dev/null +++ b/wicg-mediasession/wicg-mediasession-tests.ts @@ -0,0 +1,36 @@ + +const tracks: string[] = ['chapter1.mp3', 'chapter2.mp3', 'chapter3.mp3']; +let trackId = 0; + +const audio: HTMLAudioElement = document.createElement('audio'); +audio.src = tracks[trackId]; + +function updatePlayingMedia(): void { + audio.src = tracks[trackId]; +} + +if ('mediaSession' in navigator && navigator.mediaSession) { + navigator.mediaSession.setActionHandler('previoustrack', (): void => { + trackId = (trackId + tracks.length - 1) % tracks.length; + updatePlayingMedia(); + }); + + navigator.mediaSession.setActionHandler('nexttrack', (): void => { + trackId = (trackId + 1) % tracks.length; + updatePlayingMedia(); + }); + + navigator.mediaSession.metadata = new MediaMetadata({ + title: 'Episode Title', + artist: 'Podcast Host', + album: 'Podcast Title', + artwork: [ + {src: 'podcast.jpg', sizes: '128x128', type: 'image/jpeg'}, + {src: 'podcast_hd.jpg', sizes: '256x256'}, + {src: 'podcast_xhd.jpg', sizes: '1024x1024', type: 'image/jpeg'}, + {src: 'podcast.png', sizes: '128x128', type: 'image/png'}, + {src: 'podcast_hd.png', sizes: '256x256', type: 'image/png'}, + {src: 'podcast.ico', sizes: '128x128 256x256', type: 'image/x-icon'} + ] + }); +} From 6dc2139daf62aa2aed75e8e76ed8560cc484a9f9 Mon Sep 17 00:00:00 2001 From: Retsam Date: Fri, 10 Mar 2017 00:40:03 -0500 Subject: [PATCH 444/797] Add support for `tapCatch` to bluebird typings (#15046) * Add typings for tapCatch * Add tests for tapCatch * Add Promise.version to typings * Bump the version in the description * Add alias for tapCatch to bluebird-global --- bluebird-global/index.d.ts | 3 ++- bluebird/bluebird-tests.ts | 34 +++++++++++++++++++++++++++------- bluebird/index.d.ts | 25 +++++++++++++++++++------ 3 files changed, 48 insertions(+), 14 deletions(-) diff --git a/bluebird-global/index.d.ts b/bluebird-global/index.d.ts index caf873510d..e4c4920501 100644 --- a/bluebird-global/index.d.ts +++ b/bluebird-global/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bluebird 3.0 +// Type definitions for bluebird 3.5 // Project: https://github.com/petkaantonov/bluebird // Definitions by: d-ph // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -76,6 +76,7 @@ declare global { spread: typeof Bluebird.prototype.spread; suppressUnhandledRejections: typeof Bluebird.prototype.suppressUnhandledRejections; tap: typeof Bluebird.prototype.tap; + tapCatch: typeof Bluebird.prototype.tapCatch; // then: typeof Bluebird.prototype.then; thenReturn: typeof Bluebird.prototype.thenReturn; thenThrow: typeof Bluebird.prototype.thenThrow; diff --git a/bluebird/bluebird-tests.ts b/bluebird/bluebird-tests.ts index ea1ea69882..c08a7bdc6b 100644 --- a/bluebird/bluebird-tests.ts +++ b/bluebird/bluebird-tests.ts @@ -151,6 +151,10 @@ var BlueBird: typeof Promise; // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +var version: string = Promise.version; + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + var nodeCallbackFunc = (callback: (err: any, result: string) => void) => {} var nodeCallbackFuncErrorOnly = (callback: (err: any) => void) => {} @@ -336,14 +340,12 @@ fooOrBarProm = fooProm.caught(Promise.CancellationError, (reason: any) => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -{ - class CustomError extends Error { - public customField: number; - } - fooProm = fooProm.catch(CustomError, reason => { - let a: number = reason.customField - }) +class CustomError extends Error { + public customField: number; } +fooProm = fooProm.catch(CustomError, reason => { + let a: number = reason.customField +}) { class CustomErrorWithConstructor extends Error { @@ -433,6 +435,24 @@ fooProm = fooProm.tap(() => { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +fooProm = fooProm.tapCatch((err) => { + return "foo"; +}); + +fooProm = fooProm.tapCatch(err => { + return Promise.resolve("foo"); +}); + +fooProm.tapCatch(CustomError, (err: CustomError) => { + return err.customField; +}); + +fooProm.tapCatch((e: any) => e instanceof CustomError, (err: CustomError) => { + return err.customField; +}); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + fooProm = fooProm.delay(num); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bluebird/index.d.ts b/bluebird/index.d.ts index 2faa74e285..ecacedfd0d 100644 --- a/bluebird/index.d.ts +++ b/bluebird/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for bluebird 3.0.0 +// Type definitions for bluebird 3.5.0 // Project: https://github.com/petkaantonov/bluebird // Definitions by: Leonard Hecker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -68,19 +68,19 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection boolean, onReject: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; caught(predicate: (error: any) => boolean, onReject: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - + catch(predicate: (error: any) => boolean, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; caught(predicate: (error: any) => boolean, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; - + catch(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; caught(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; catch(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | Bluebird.Thenable): Bluebird; caught(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | Bluebird.Thenable): Bluebird; - + catch(predicate: Object, onReject: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; caught(predicate: Object, onReject: (error: any) => R | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; - + catch(predicate: Object, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; caught(predicate: Object, onReject: (error: any) => U | Bluebird.Thenable): Bluebird; @@ -114,6 +114,14 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection(onFulFill: (value: R) => Bluebird.Thenable): Bluebird; tap(onFulfill: (value: R) => U): Bluebird; + /** + * Like `.catch()` but rethrows the error + */ + tapCatch(onReject: (error?: any) => U | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; + tapCatch(ErrorClass: new (...args: any[]) => E, onReject: (error: E) => U | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; + tapCatch(predicate: (error?: any) => boolean, onReject: (error?: any) => U | Bluebird.Thenable | void | Bluebird.Thenable): Bluebird; + + /** * Same as calling `Promise.delay(ms, this)`. */ @@ -321,7 +329,7 @@ declare class Bluebird implements Bluebird.Thenable, Bluebird.Inspection implements Bluebird.Thenable, Bluebird.Inspection Date: Fri, 10 Mar 2017 00:41:02 -0500 Subject: [PATCH 445/797] Fix error about required parameter (#14989) See the docs: https://helmetjs.github.io/docs/ (maxAge is not a required parameter) --- helmet/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helmet/index.d.ts b/helmet/index.d.ts index 9e5f30f554..1dc8882608 100644 --- a/helmet/index.d.ts +++ b/helmet/index.d.ts @@ -81,7 +81,7 @@ declare namespace helmet { } export interface IHelmetHstsConfiguration { - maxAge: number; + maxAge?: number; includeSubdomains?: boolean; preload?: boolean; setIf?: IHelmetSetIfFunction, From 14cee370fa78349a3ec04e3ebb371bc01484a1f2 Mon Sep 17 00:00:00 2001 From: KentarouTakeda Date: Fri, 10 Mar 2017 15:04:07 +0900 Subject: [PATCH 446/797] Add type definitions for 'memcached' (#14988) --- memcached/index.d.ts | 322 ++++++++++++++++++++++++++ memcached/memcached-tests.ts | 429 +++++++++++++++++++++++++++++++++++ memcached/tsconfig.json | 21 ++ memcached/tslint.json | 6 + 4 files changed, 778 insertions(+) create mode 100644 memcached/index.d.ts create mode 100644 memcached/memcached-tests.ts create mode 100644 memcached/tsconfig.json create mode 100644 memcached/tslint.json diff --git a/memcached/index.d.ts b/memcached/index.d.ts new file mode 100644 index 0000000000..23d892309b --- /dev/null +++ b/memcached/index.d.ts @@ -0,0 +1,322 @@ +// Type definitions for memcached 2.2 +// Project: https://github.com/3rd-Eden/memcached +// Definitions by: KentarouTakeda +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import events = require("events"); +export = Memcached; + +declare class Memcached extends events.EventEmitter { + + static config: Memcached.options; + + /** + * Connect to a single server. + * @param location Server location e.g. "127.0.0.1:11211" + * @param options options + */ + constructor(location: string, options?: Memcached.options); + + /** + * Connect to a cluster of Memcached servers. + * @param location Server locations e.g. ["127.0.0.1:11211","127.0.0.1:11212"] + * @param options options + */ + constructor(location: string[], options?: Memcached.options); + + /** + * Connect to servers with weight. + * @param location Server locations e.g. {"127.0.0.1:11211": 1,"127.0.0.1:11212": 2} + * @param options options + */ + constructor(location: {[server: string]: number}, options ?: Memcached.options); + + /** + * Touches the given key. + * @param key The key + * @param lifetime After how long should the key expire measured in seconds + * @param cb + */ + touch(key: string, lifetime: number, cb: (this: Memcached.CommandData, err: any) => void): void; + + /** + * Get the value for the given key. + * @param key The key + * @param cb + */ + get(key: string, cb: (this: Memcached.CommandData, err: any, data: any) => void): void; + + /** + * Get the value and the CAS id. + * @param key The key + * @param cb + */ + gets(key: string, cb: (this: Memcached.CommandData, err: any, data: {[key: string]: any, cas: string}) => void): void; + + /** + * Retrieves a bunch of values from multiple keys. + * @param keys all the keys that needs to be fetched + * @param cb + */ + getMulti(keys: string[], cb: (this: undefined, err: any, data: {[key: string]: any}) => void): void; + + /** + * Stores a new value in Memcached. + * + * @param key The key + * @param value Either a buffer, JSON, number or string that you want to store. + * @param lifetime + * @param cb + */ + set(key: string, value: any, lifetime: number, cb: (this: Memcached.CommandData, err: any, result: boolean) => void): void; + + /** + * Replaces the value in memcached. + * @param key The key + * @param value Either a buffer, JSON, number or string that you want to store. + * @param lifetime + * @param cb + */ + replace(key: string, value: any, lifetime: number, cb: (this: Memcached.CommandData, err: any, result: boolean) => void): void; + + /** + * Add the value, only if it's not in memcached already. + * @param key The key + * @param value Either a buffer, JSON, number or string that you want to store. + * @param lifetime + * @param cb + */ + add(key: string, value: any, lifetime: number, cb: (this: Memcached.CommandData, err: any, result: boolean) => void): void; + + /** + * Add the value, only if it matches the given CAS value. + * @param key The key + * @param value Either a buffer, JSON, number or string that you want to store. + * @param cas + * @param lifetime + * @param cb + */ + cas(key: string, value: any, cas: string, lifetime: number, cb: (this: Memcached.CommandData, err: any, result: boolean) => void): void; + + /** + * Add the given value string to the value of an existing item. + * @param key The key + * @param value Either a buffer, JSON, number or string that you want to store. + * @param cb + */ + append(key: string, value: any, cb: (this: Memcached.CommandData, err: any, result: boolean) => void): void; + + /** + * Add the given value string to the value of an existing item. + * @param key The key + * @param value Either a buffer, JSON, number or string that you want to store. + * @param cb + */ + prepend(key: string, value: any, cb: (this: Memcached.CommandData, err: any, result: boolean) => void): void; + + /** + * Increment a given key. + * @param key The key + * @param amount The increment + * @param cb + */ + incr(key: string, amount: number, cb: (this: Memcached.CommandData, err: any, result: boolean|number) => void): void; + + /** + * Decrement a given key. + * @param key The key + * @param amount The decrement + * @param cb + */ + decr(key: string, amount: number, cb: (this: Memcached.CommandData, err: any, result: boolean|number) => void): void; + + /** + * Remove the key from memcached. + * @param key The key + * @param cb + */ + del(key: string, cb: (this: Memcached.CommandData, err: any, result: boolean) => void): void; + + /** + * Retrieves the version number of your server. + * @param cb + */ + version(cb: (err: any, version: Memcached.VersionData[]) => void): void; + + /** + * Retrieves your stats settings. + * @param cb + */ + settings(cb: (err: any, settings: Memcached.StatusData[]) => void): void; + + /** + * Retrieves stats from your memcached server. + * @param cb + */ + stats(cb: (err: any, stats: Memcached.StatusData[]) => void): void; + + /** + * Retrieves stats slabs information. + * @param cb + */ + slabs(cb: (err: any, stats: Memcached.StatusData[]) => void): void; + + /** + * Retrieves stats items information. + * @param cb + */ + items(cb: (err: any, stats: Memcached.StatusData[]) => void): void; + + /** + * Inspect cache, see examples for a detailed explanation. + * @param server + * @param slabid + * @param number + * @param cb + */ + cachedump(server: string, slabid: number, number: number, cb: (err: any, cachedump: Memcached.CacheDumpData|Memcached.CacheDumpData[]) => void): void; + + /** + * Flushes the memcached server. + * @param cb + */ + flush(cb: (this: undefined, err: any, results: boolean[]) => void): void; + + /** + * a issue occurred on one a server, we are going to attempt a retry next. + */ + on(event: "issue", cb: (err: Memcached.IssueData) => void): this; + + /** + * a server has been marked as failure or dead. + */ + on(event: "failure", cb: (err: Memcached.IssueData) => void): this; + + /** + * we are going to attempt to reconnect the to the failed server. + */ + on(event: "reconnecting", cb: (err: Memcached.IssueData) => void): this; + + /** + * successfully reconnected to the memcached server. + */ + on(event: "reconnect", cb: (err: Memcached.IssueData) => void): this; + + /** + * removing the server from our consistent hashing. + */ + on( event: "remove", cb: (err: Memcached.IssueData) => void): this; + + /** + * Closes all active memcached connections. + */ + end(): void; +} + +declare namespace Memcached { + export interface IssueData { + server: string; + tokens: [string, string]; + messages: string[]; + failures ?: number; + totalFailures ?: number; + totalReconnectsAttempted ?: number; + totalReconnectsSuccess ?: number; + totalReconnectsFailed ?: number; + totalDownTime ?: number; + } + + export interface CommandData { + start: number; + execution: number; + callback: (...args : any[]) => any; + type: string; + command: string; + validate: Array<[string, (...args : any[]) => any]>; + cas ?: string; + redundancyEnabled ?: boolean; + key ?: string; + value ?: any; + lifetime ?: number; + } + + export interface StatusData { + server ?: string; + [key: string]: string|boolean|number|undefined; + } + + export interface VersionData extends StatusData { + version: string; + major: string; + minor: string; + bugfix: string; + } + + export interface CacheDumpData { + key: string; + b: number; + s: number; + } + + export interface options { + /** + * 250, the maximum key size allowed. + */ + maxKeySize ?: number; + /** + * 2592000, the maximum expiration time of keys (in seconds). + */ + maxExpiration ?: number; + /** + * 1048576, the maximum size of a value. + */ + maxValue ?: number; + /** + * 10, the maximum size of the connection pool. + */ + poolSize ?: number; + /** + * md5, the hashing algorithm used to generate the hashRing values. + */ + algorithm ?: string; + /** + * 18000000, the time between reconnection attempts (in milliseconds). + */ + reconnect ?: number; + /** + * 5000, the time after which Memcached sends a connection timeout (in milliseconds). + */ + timeout ?: number; + /** + * 5, the number of socket allocation retries per request. + */ + retries ?: number; + /** + * 5, the number of failed-attempts to a server before it is regarded as 'dead'. + */ + failures ?: number; + /** + * 30000, the time between a server failure and an attempt to set it up back in service. + */ + retry ?: number; + /** + * false, if true, authorizes the automatic removal of dead servers from the pool. + */ + remove ?: boolean; + /** + * undefined, an array of server_locations to replace servers that fail and that are removed from the consistent hashing scheme. + */ + failOverServers ?: string|string[]; + /** + * true, whether to use md5 as hashing scheme when keys exceed maxKeySize. + */ + keyCompression ?: boolean; + /** + * 5000, the idle timeout for the connections. + */ + idle ?: number; + } +} diff --git a/memcached/memcached-tests.ts b/memcached/memcached-tests.ts new file mode 100644 index 0000000000..7671bebcb6 --- /dev/null +++ b/memcached/memcached-tests.ts @@ -0,0 +1,429 @@ +import Memcached = require('memcached'); +import assert = require('assert'); + +namespace main { + function isString(expected?: string): void { + if (expected !== undefined && typeof expected !== 'string') { + throw new Error(); + } + }; + function isArray(expected?: any[]): void { + if (expected !== undefined && !Array.isArray(expected)) { + throw new Error(); + } + }; + function isNumber(expected?: number): void { + if (expected !== undefined && typeof expected !== 'number') { + throw new Error(); + } + }; + function isBoolean(expected?: boolean): void { + if (expected !== undefined && typeof expected !== 'boolean') { + throw new Error(); + } + }; + function isFunction(expected?: (...args : any[]) => void): void { + if (expected !== undefined && typeof expected !== 'function') { + throw new Error(); + } + }; + function isVoid(expected?: undefined): void { + if (expected !== undefined) { + throw new Error(); + } + }; + + namespace test_global_options { + Memcached.config.maxKeySize = 250; + Memcached.config.maxExpiration = 2592000; + Memcached.config.maxValue = 1048576; + Memcached.config.poolSize = 10; + Memcached.config.algorithm = 'md5'; + Memcached.config.reconnect = 1000; + Memcached.config.timeout = 100; + Memcached.config.retries = 1; + Memcached.config.failures = 5; + Memcached.config.retry = 100; + Memcached.config.remove = false; + Memcached.config.failOverServers = undefined; + Memcached.config.keyCompression = true; + Memcached.config.idle = 5000; + } + + namespace test_constructor_with_string { + const location = '127.0.0.1:11211'; + + const memcached = new Memcached(location); + memcached.end(); + } + + namespace test_constructor_with_array { + const location = [ + '127.0.0.1:11211', + '127.0.0.1:11212', + '127.0.0.1:11213' + ]; + + const memcached = new Memcached(location); + memcached.end(); + } + + namespace test_constructor_with_object { + const location = { + '127.0.0.1:11211': 1, + '127.0.0.1:11212': 2, + '127.0.0.1:11213': 3 + }; + + const memcached = new Memcached(location); + memcached.end(); + } + + namespace test_constructor_with_options { + const location = '127.0.0.1:11211'; + const options: Memcached.options = { + maxKeySize: 250, + maxExpiration: 2592000, + maxValue: 1048576, + poolSize: 10, + algorithm: 'md5', + reconnect: 18000000, + timeout: 5000, + retries: 5, + failures: 5, + retry: 30000, + remove: false, + failOverServers: undefined, + keyCompression: true, + idle: 5000, + }; + + const memcached = new Memcached(location, options); + memcached.end(); + } + + const memcached = new Memcached('127.0.0.1:11211'); + + namespace test_events { + function isIssue(expected: Memcached.IssueData) { + isString(expected.server); + isArray(expected.tokens); + isArray(expected.messages); + isNumber(expected.failures); + isNumber(expected.totalFailures); + isNumber(expected.totalReconnectsAttempted); + isNumber(expected.totalReconnectsSuccess); + isNumber(expected.totalReconnectsFailed); + isNumber(expected.totalDownTime); + } + memcached.on('issue', err => isIssue(err)); + memcached.on('failure', err => isIssue(err)); + memcached.on('reconnecting', err => isIssue(err)); + memcached.on('reconnect', err => isIssue(err)); + memcached.on('remove', err => isIssue(err)); + } + + function isCommandData(expected: Memcached.CommandData) { + isNumber(expected.start); + isNumber(expected.execution); + isFunction(expected.callback); + isString(expected.type); + isString(expected.command); + isArray(expected.validate); + isBoolean(expected.redundancyEnabled); + isString(expected.key); + isNumber(expected.lifetime); + isString(expected.cas); + } + namespace test_set { + memcached.set('key', 'value', 3600, function(err) { + isCommandData(this); + }); + } + namespace test_touch { + memcached.touch('key', 3600, function(err) { + isCommandData(this); + }); + } + namespace test_get { + memcached.get('key', function(err, data) { + isCommandData(this); + }); + } + namespace test_getMulti { + memcached.getMulti(['foo', 'bar'], function(err, data) { + isVoid(this); + assert(typeof data, 'object'); + }); + } + namespace test_cas { + const promises = []; + const key = 'caskey'; + const value = 'casvalue'; + + Promise.resolve() + .then(() => new Promise(resolve => { + memcached.set(key, value, 0, function() { + isCommandData(this); + resolve(); + }); + })) + .then(() => new Promise(resolve => { + memcached.gets(key, function(err, data) { + isCommandData(this); + memcached.cas(key, value, data.cas, 0, function(err, result) { + isCommandData(this); + assert(result); + resolve(); + }); + }); + })) + .then(() => new Promise(resolve => { + memcached.cas(key, value, '99', 0, function(err, result) { + isCommandData(this); + assert(!result); + resolve(); + }); + })) + ; + + } + namespace test_replace { + const promises = []; + const key = 'replacekey'; + const value = 'replacevalue'; + + Promise.resolve() + .then(() => new Promise(resolve => { + memcached.set(key, value, 0, () => { + resolve(); + }); + })) + .then(() => new Promise(resolve => { + memcached.replace(key, value, 0, function(err, result) { + assert(result); + isCommandData(this); + resolve(); + }); + })) + .then(() => new Promise(resolve => { + memcached.replace('noexistss', value, 0, function(err, result) { + assert(!result); + isCommandData(this); + resolve(); + }); + })) + ; + } + namespace test_add { + const promises = []; + const key = 'addkey'; + const value = 'addvalue'; + + Promise.resolve() + .then(() => new Promise(resolve => { + memcached.add(key, value, 0, function(err, result) { + assert(result); + isCommandData(this); + resolve(); + }); + })) + .then(() => new Promise(resolve => { + memcached.add(key, value, 0, function(err, result) { + assert(!result); + isCommandData(this); + resolve(); + }); + })) + ; + } + namespace test_append { + const promises = []; + const key = 'appendkey'; + const value = 'appendvalue'; + + Promise.resolve() + .then(() => new Promise(resolve => { + memcached.set(key, value, 0, (err, result) => { + isBoolean(result); + resolve(); + }); + })) + .then(() => new Promise(resolve => { + memcached.append(key, value, (err, result) => { + isBoolean(result); + resolve(); + }); + })) + ; + } + namespace test_prepend { + const promises = []; + const key = 'prependkey'; + const value = 'prependvalue'; + Promise.resolve() + .then(() => new Promise(resolve => { + memcached.set(key, value, 0, (err, result) => { + isBoolean(result); + resolve(); + }); + })) + .then(() => new Promise(resolve => { + memcached.prepend(key, value, function(err, result) { + isBoolean(result); + isCommandData(this); + resolve(); + }); + })) + ; + } + namespace test_incr { + const promises = []; + const key = 'incrkey'; + const value = 2; + + Promise.resolve() + .then(() => new Promise(resolve => { + memcached.set(key, value, 0, (err, result) => { + isBoolean(result); + resolve(); + }); + })) + .then(() => new Promise(resolve => { + memcached.incr(key, value, function(err, result) { + assert.deepStrictEqual(result, 4); + isCommandData(this); + resolve(); + }); + })) + .then(() => new Promise(resolve => { + memcached.incr('noexists', value, function(err, result) { + assert.deepStrictEqual(result, false); + isCommandData(this); + resolve(); + }); + })) + ; + } + namespace test_decr { + const promises = []; + const key = 'decrkey'; + const value = 2; + Promise.resolve() + .then(() => new Promise(resolve => { + memcached.set(key, value, 0, function(err, result) { + isCommandData(this); + isBoolean(result); + resolve(); + }); + })) + .then(() => new Promise(resolve => { + memcached.decr(key, value, function(err, result) { + assert.deepStrictEqual(result, 0); + isCommandData(this); + resolve(); + }); + })) + .then(() => new Promise(resolve => { + memcached.decr('noexists', value, function(err, result) { + assert.deepStrictEqual(result, false); + isCommandData(this); + resolve(); + }); + })) + ; + } + namespace test_decr { + const promises = []; + const key = 'delkey'; + const value = 'delvalue'; + Promise.resolve() + .then(() => new Promise(resolve => { + memcached.set(key, value, 0, (err, result) => { + isBoolean(result); + resolve(); + }); + })) + .then(() => new Promise(resolve => { + memcached.del(key, function(err, result) { + isBoolean(result); + isCommandData(this); + resolve(); + }); + })) + ; + } + + namespace test_version { + memcached.version((err, data) => { + for (const version of data) { + isString(version.server); + isString(version.version); + isString(version.major); + isString(version.minor); + isString(version.bugfix); + } + }); + } + namespace test_stats { + memcached.stats((err : any, data: Memcached.StatusData[]) => { + isArray(data); + for (const stat of data) { + isString(stat.server); + } + }); + }; + namespace test_settings { + memcached.settings((err : any, data: Memcached.StatusData[]) => { + isArray(data); + for (const setting of data) { + isString(setting.server); + } + }); + }; + namespace test_slabs { + memcached.slabs((err : any, data: Memcached.StatusData[]) => { + isArray(data); + for (const setting of data) { + isString(setting.server); + } + }); + }; + let promise: Promise; + namespace test_items { + promise = new Promise(resolve => { + memcached.items((err, data) => { + isArray(data); + for (const setting of data) { + isString(setting.server); + } + resolve(data); + }); + }); + }; + namespace test_cachedump { + promise.then(data => { + for (const node of data) { + const server = node.server; + delete node.server; + Object.keys(node).forEach(slabid => { + memcached.cachedump(server, Number(slabid), node[slabid].number, (err, data) => { + if (!Array.isArray(data)) data = [data]; + data.forEach(cache => { + isNumber(cache.b); + isNumber(cache.s); + isString(cache.key); + }); + }); + }); + } + }); + }; + + namespace test_flush { + memcached.flush(function(err, results) { + isVoid(this); + isArray(results); + }); + }; +} diff --git a/memcached/tsconfig.json b/memcached/tsconfig.json new file mode 100644 index 0000000000..263ad39c54 --- /dev/null +++ b/memcached/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "strictNullChecks": true, + "noImplicitReturns": true, + "noImplicitAny": true, + "noImplicitThis": true, + "lib": ["es6"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "module": "commonjs", + "target": "es5", + "sourceMap": false, + "baseUrl": "../", + "typeRoots": ["../"] + }, + "files": [ + "index.d.ts", + "memcached-tests.ts" + ] +} diff --git a/memcached/tslint.json b/memcached/tslint.json new file mode 100644 index 0000000000..68d10d72a6 --- /dev/null +++ b/memcached/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "unified-signatures": false + } +} From 6f867e078c1c8c81e8a985b400fe7cd1d8b4572e Mon Sep 17 00:00:00 2001 From: Dasa Paddock Date: Thu, 9 Mar 2017 22:05:22 -0800 Subject: [PATCH 447/797] Update for ArcGIS API for JavaScript version 3.20 (#14987) --- arcgis-js-api/v3/index.d.ts | 59 ++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 14 deletions(-) diff --git a/arcgis-js-api/v3/index.d.ts b/arcgis-js-api/v3/index.d.ts index c32749eb26..40875ddd48 100644 --- a/arcgis-js-api/v3/index.d.ts +++ b/arcgis-js-api/v3/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ArcGIS API for JavaScript 3.19 +// Type definitions for ArcGIS API for JavaScript 3.20 // Project: https://developers.arcgis.com/javascript/3/ // Definitions by: Esri // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -21,7 +21,6 @@ declare module "esri" { import Color = require("esri/Color"); import LocationProviderBase = require("esri/tasks/locationproviders/LocationProviderBase"); import PictureMarkerSymbol = require("esri/symbols/PictureMarkerSymbol"); - import RouteParameters = require("esri/tasks/RouteParameters"); import SimpleLineSymbol = require("esri/symbols/SimpleLineSymbol"); import Font = require("esri/symbols/Font"); import ArcGISDynamicMapServiceLayer = require("esri/layers/ArcGISDynamicMapServiceLayer"); @@ -263,6 +262,12 @@ declare module "esri" { /** The symbol in which the BlendRenderer is applied. */ symbol: Symbol; } + export interface BookmarkItemOptions { + /** The extent for the specified bookmark item. */ + extent?: Extent; + /** The name for the bookmark item. */ + name?: string; + } export interface BookmarksOptions { /** An array of BookmarkItem objects or a json object with the BookmarkItem format to initially display in the bookmark widget. */ bookmarks?: BookmarkItem[]; @@ -282,8 +287,14 @@ declare module "esri" { latitudeFieldName?: string; /** The longitude field name. */ longitudeFieldName?: string; + /** Opacity or transparency of layer. */ + opacity?: number; /** An array of strings which correspond to fields to include in the CSVLayer. */ outFields?: string[]; + /** Refresh interval of the layer in minutes. */ + refreshInterval?: number; + /** Visibility of the layer. */ + visible?: boolean; } export interface ChooseBestFacilitiesOptions { /** The URL to the analysis service, for example "http://analysis.arcgis.com/arcgis/rest/services/tasks/GPServer". */ @@ -624,8 +635,8 @@ declare module "esri" { canModifyStops?: boolean; /** Center the map at the start of the selected route segment. */ centerAtSegmentStart?: boolean; - /** The returned directions object from the routing solve result. */ - directions?: any; + /** The locale used for the directions. */ + directionsLanguage?: string; /** Length units. */ directionsLengthUnits?: string; /** Enable the dragging of stop locations on the map. */ @@ -658,8 +669,6 @@ declare module "esri" { printTemplate?: string; /** When true, the route will return to start point. */ returnToStart?: boolean; - /** Specify the input parameters for the route task. */ - routeParams?: RouteParameters; /** Define the symbol used to draw the route on the map. */ routeSymbol?: SimpleLineSymbol; /** Specify the service that will be used to calculate directions. */ @@ -672,6 +681,8 @@ declare module "esri" { segmentSymbol?: SimpleLineSymbol; /** Defines whether the Directions widget will show the map-click-active toggle button. */ showActivateButton?: boolean; + /** Indicates whether to expose barriers when using the widget. */ + showBarriersButton?: boolean; /** If true, the Clear button is shown. */ showClearButton?: boolean; /** If true, the toggle button group allowing user to choose between Miles and Kilometers is shown. */ @@ -1076,6 +1087,8 @@ declare module "esri" { export interface GeoRSSLayerOptions { /** The template used to display popup window for identify operation. */ infoTemplate?: InfoTemplate; + /** Opacity or transparency of layer. */ + opacity?: number; /** The output spatial reference for the GeoRSSLayer. */ outSpatialReference?: SpatialReference; /** The default symbol use to display point features. */ @@ -1084,6 +1097,8 @@ declare module "esri" { polygonSymbol?: Symbol; /** The default symbol used to display polyline features. */ polylineSymbol?: Symbol; + /** Refresh interval of the layer in minutes. */ + refreshInterval?: number; } export interface GeocoderOptions { /** By default, the Geocoder widget uses the Esri World Locator to find search locations. */ @@ -3235,7 +3250,7 @@ declare module "esri/arcgis/Portal" { tags: string[]; /** The url to the thumbnail image for the user. */ thumbnailUrl: string; - /** The url for the user content. */ + /** The URL for the user content. */ userContentUrl: string; /** The username for the user. */ username: string; @@ -3554,16 +3569,15 @@ declare module "esri/dijit/BasemapToggle" { } declare module "esri/dijit/BookmarkItem" { - import Extent = require("esri/geometry/Extent"); + import esri = require("esri"); /** Defines a bookmark for use in the Bookmark widget. */ class BookmarkItem { /** * Creates a new BookmarkItem. - * @param name The name for the bookmark item. - * @param extent The extent for the specified bookmark item. + * @param params See options list for parameters. */ - constructor(name: string, extent: Extent); + constructor(params?: esri.BookmarkItemOptions); } export = BookmarkItem; } @@ -3815,7 +3829,6 @@ declare module "esri/dijit/Directions" { import esri = require("esri"); import DirectionsFeatureSet = require("esri/tasks/DirectionsFeatureSet"); import Graphic = require("esri/graphic"); - import RouteParameters = require("esri/tasks/RouteParameters"); import RouteTask = require("esri/tasks/RouteTask"); import Point = require("esri/geometry/Point"); import RouteResult = require("esri/tasks/RouteResult"); @@ -3832,14 +3845,14 @@ declare module "esri/dijit/Directions" { mergedRouteGraphic: Graphic; /** If specified, this specifies the portal where the produced route layers are going to be stored and accessed. */ portalUrl: string; - /** Routing parameters for the widget. */ - routeParams: RouteParameters; /** Routing task for the widget. */ routeTask: RouteTask; /** Read-only: The Service Description object returned by the Route REST Endpoint. */ serviceDescription: any; /** Indicates whether the Directions widget will display the map-click-active toggle button. */ showActivateButton: boolean; + /** Indicates whether to expose barriers when using the widget. */ + showBarriersButton: boolean; /** If true, the Clear button is shown. */ showClearButton: boolean; /** If true, the toggle button group allowing user to choose between Miles and Kilometers is shown. */ @@ -9230,8 +9243,14 @@ declare module "esri/layers/CSVLayer" { latitudeFieldName: string; /** The longitude field name. */ longitudeFieldName: string; + /** Opacity or transparency of layer. */ + opacity: number; + /** Refresh interval of the layer in minutes. */ + refreshInterval: number; /** The url to a CSV resource. */ url: string; + /** Visibility of the layer. */ + visible: boolean; /** * Creates a CSV layer. * @param url URL to a CSV resource. @@ -9938,6 +9957,10 @@ declare module "esri/layers/GeoRSSLayer" { items: Graphic[]; /** The name of the layer. */ name: string; + /** Opacity or transparency of layer. */ + opacity: number; + /** Refresh interval of the layer in minutes. */ + refreshInterval: number; /** The publicly accessible URL to a GeoRSS file. */ url: string; /** @@ -11703,6 +11726,7 @@ declare module "esri/layers/pixelfilters/StretchFilter" { declare module "esri/map" { import esri = require("esri"); import Attribution = require("esri/dijit/Attribution"); + import Color = require("esri/Color"); import Extent = require("esri/geometry/Extent"); import GraphicsLayer = require("esri/layers/GraphicsLayer"); import InfoWindowBase = require("esri/InfoWindowBase"); @@ -11721,6 +11745,8 @@ declare module "esri/map" { attribution: Attribution; /** Value is true when the map automatically resizes if the browser window or ContentPane widget enclosing the map is resized. */ autoResize: boolean; + /** The background color "behind" the map. */ + backgroundColor: Color; /** An array of IDs corresponding to the layers that make up the map's current basemap. */ basemapLayerIds: string[]; /** The current extent of the map in map units. */ @@ -11924,6 +11950,11 @@ declare module "esri/map" { * @param immediate By default, the actual resize logic is delayed internally in order to throttle spurious resize events dispatched by some browsers. */ resize(immediate?: boolean): void; + /** + * Change the background color of the map. + * @param color Color specified using either a named string (e.g. + */ + setBackgroundColor(color: Color | string): void; /** * Change the map's current basemap. * @param basemap A valid basemap name. From 5dac16e51d76093cb918d6c161e65ea11f0c6895 Mon Sep 17 00:00:00 2001 From: flx-l Date: Fri, 10 Mar 2017 07:06:20 +0100 Subject: [PATCH 448/797] fix(gridstack): Make the properties of IGridstackOptions optional (#14980) --- gridstack/index.d.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/gridstack/index.d.ts b/gridstack/index.d.ts index 75056999e2..12c3600f6a 100644 --- a/gridstack/index.d.ts +++ b/gridstack/index.d.ts @@ -181,61 +181,61 @@ interface IGridstackOptions { /** * if true the resizing handles are shown even if the user is not hovering over the widget (default: false) */ - alwaysShowResizeHandle: boolean; + alwaysShowResizeHandle?: boolean; /** * turns animation on (default: true) */ - animate: boolean; + animate?: boolean; /** * if false gridstack will not initialize existing items (default: true) */ - auto: boolean; + auto?: boolean; /** * one cell height (default: 60) */ - cellHeight: number; + cellHeight?: number; /** * allows to override jQuery UI draggable options. (default: { handle: '.grid-stack-item-content', scroll: true, appendTo: 'body' }) */ - draggable: {}; + draggable?: {}; /** * draggable handle selector (default: '.grid-stack-item-content') */ - handle: string; + handle?: string; /** * maximum rows amount.Default is 0 which means no maximum rows */ - height: number; + height?: number; /** * enable floating widgets (default: false) See example */ - float: boolean; + float?: boolean; /** * widget class (default: 'grid-stack-item') */ - itemClass: string; + itemClass?: string; /** * minimal width.If window width is less, grid will be shown in one - column mode (default: 768) */ - minWidth: number; + minWidth?: number; /** * class for placeholder (default: 'grid-stack-placeholder') */ - placeholderClass: string; + placeholderClass?: string; /** * allows to override jQuery UI resizable options. (default: { autoHide: true, handles: 'se' }) */ - resizable: {}; + resizable?: {}; /** * makes grid static (default false).If true widgets are not movable/ resizable.You don't even need jQueryUI draggable/resizable. A CSS class grid-stack-static is also added to the container. */ - staticGrid: boolean; + staticGrid?: boolean; /** * vertical gap size (default: 20) */ - verticalMargin: number; + verticalMargin?: number; /** * amount of columns (default: 12) */ - width: number; + width?: number; } From 8d1b4a6eb163f414857136c6549fc6219105a87d Mon Sep 17 00:00:00 2001 From: Jan Alonzo Date: Fri, 10 Mar 2017 17:07:05 +1100 Subject: [PATCH 449/797] Add type definitions for 'leven' (#14975) * Add type definitions for 'leven' * Fix lint issues * set strictNullChecks = true --- leven/index.d.ts | 8 ++++++++ leven/leven-tests.ts | 8 ++++++++ leven/tsconfig.json | 20 ++++++++++++++++++++ leven/tslint.json | 1 + 4 files changed, 37 insertions(+) create mode 100644 leven/index.d.ts create mode 100644 leven/leven-tests.ts create mode 100644 leven/tsconfig.json create mode 100644 leven/tslint.json diff --git a/leven/index.d.ts b/leven/index.d.ts new file mode 100644 index 0000000000..baea8fa6b4 --- /dev/null +++ b/leven/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for leven 2.1 +// Project: https://github.com/sindresorhus/leven +// Definitions by: Jan Alonzo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function leven(a: string, b: string): number; + +export = leven; diff --git a/leven/leven-tests.ts b/leven/leven-tests.ts new file mode 100644 index 0000000000..4e87d3d90e --- /dev/null +++ b/leven/leven-tests.ts @@ -0,0 +1,8 @@ + +import leven = require('leven'); + +leven('baz', 'bar'); +// => "1" + +leven('foo', 'bar'); +// => "3" \ No newline at end of file diff --git a/leven/tsconfig.json b/leven/tsconfig.json new file mode 100644 index 0000000000..cddcbe652b --- /dev/null +++ b/leven/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "leven-tests.ts" + ] +} \ No newline at end of file diff --git a/leven/tslint.json b/leven/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/leven/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 123ff1c182d24a8319a10fb33cac3f480b5d2909 Mon Sep 17 00:00:00 2001 From: Saviio Date: Fri, 10 Mar 2017 14:07:33 +0800 Subject: [PATCH 450/797] fix type `Axis` (#14973) Now `SortableContainer` allow to receive Axis with 'xy', Please see https://github.com/clauderic/react-sortable-hoc/blob/master/src/SortableContainer/index.js#L53. --- react-sortable-hoc/index.d.ts | 2 +- react-sortable-hoc/react-sortable-hoc-tests.tsx | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/react-sortable-hoc/index.d.ts b/react-sortable-hoc/index.d.ts index 64a17f4800..a9ef36379c 100644 --- a/react-sortable-hoc/index.d.ts +++ b/react-sortable-hoc/index.d.ts @@ -7,7 +7,7 @@ declare module 'react-sortable-hoc' { import React = require('react'); - export type Axis = 'x' | 'y'; + export type Axis = 'x' | 'y' | 'xy'; export type Offset = number | string; diff --git a/react-sortable-hoc/react-sortable-hoc-tests.tsx b/react-sortable-hoc/react-sortable-hoc-tests.tsx index 0e90f9aa0a..8f10b69a17 100644 --- a/react-sortable-hoc/react-sortable-hoc-tests.tsx +++ b/react-sortable-hoc/react-sortable-hoc-tests.tsx @@ -8,6 +8,7 @@ interface SortableItemProps { interface SortableListProps { items: Array; + axis: 'x' | 'y' | 'xy' } type SortableComponentState = SortableListProps; @@ -40,12 +41,15 @@ class SortableComponent extends React.Component { public constructor() { super(); - this.state = { items: ['Item 1', 'Item 2', 'Item 3', 'Item 4', 'Item 5', 'Item 6'] }; + this.state = { + items: ['Item 1', 'Item 2', 'Item 3', 'Item 4', 'Item 5', 'Item 6'], + axis: 'x' + }; this._onSortEnd = this._handleSotEnd.bind(this); } public render(): JSX.Element { - return ; + return ; } } From 2f73151f6072d49fc99ed2aa3d721b2fc92a2519 Mon Sep 17 00:00:00 2001 From: Yuichi Shundo Date: Fri, 10 Mar 2017 15:08:19 +0900 Subject: [PATCH 451/797] add sitemap2 (#14972) --- sitemap2/index.d.ts | 52 ++++++++++++++++++++++++++++++++++++++ sitemap2/sitemap2-tests.ts | 51 +++++++++++++++++++++++++++++++++++++ sitemap2/tsconfig.json | 22 ++++++++++++++++ sitemap2/tslint.json | 1 + 4 files changed, 126 insertions(+) create mode 100644 sitemap2/index.d.ts create mode 100644 sitemap2/sitemap2-tests.ts create mode 100644 sitemap2/tsconfig.json create mode 100644 sitemap2/tslint.json diff --git a/sitemap2/index.d.ts b/sitemap2/index.d.ts new file mode 100644 index 0000000000..75108ff603 --- /dev/null +++ b/sitemap2/index.d.ts @@ -0,0 +1,52 @@ +// Type definitions for sitemap2 1.0 +// Project: https://github.com/vlkosinov/sitemap2 +// Definitions by: Yuichi Shundo +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare var sitemap2: Sitemap; + +export = sitemap2; + +declare interface Sitemap { + new (conf?: SitemapConfig): Sitemap; + + addUrl(urlData: UrlData | UrlData[] | string | string[]): this + addSitemap(sm: Sitemap): this; + toXML(): SitemapXml[]; + + hostName: string; + fileName: string; + limit: number; + urls: string[]; + childrens: Sitemap[]; +} + +declare interface SitemapConfig { + hostName?: string; + fileName?: string; + limit?: number; + cacheTime?: number; + xslUrl?: string; + urls?: string[]; + childrens?: Sitemap[]; +} + +declare interface UrlData { + url: string; + chengefreq?: string; + priority?: number | string; + lastmod?: Date; + lastmodWithTime?: boolean; + lastmodInISO?: boolean; + video?: { + title: string; + description: string; + thumbnail_loc: string; + content_loc: string; + } +} + +declare interface SitemapXml { + fileName: string; + xml: string; +} diff --git a/sitemap2/sitemap2-tests.ts b/sitemap2/sitemap2-tests.ts new file mode 100644 index 0000000000..235cbb93a4 --- /dev/null +++ b/sitemap2/sitemap2-tests.ts @@ -0,0 +1,51 @@ +import Sitemap = require('sitemap2'); + +let sitemap = new Sitemap({ + hostName: ('https://example.com/'), + fileName: 'sitemap.xml', + limit: 50000, + cacheTime: 1000, +}); + +sitemap.addUrl('https://example.com/'); +sitemap.addUrl(['https://example.com/']); +sitemap.addUrl({ + url: 'https://example.com/', + chengefreq: 'chengefreq', + priority: 0.6, + lastmod: new Date(), + lastmodWithTime: true, + lastmodInISO: false, + video: { + title: 'title', + description: 'description', + content_loc: 'content_loc', + thumbnail_loc: 'thumbnail_loc' + }, +}); +sitemap.addUrl([ + { + url: 'https://example.com/', + chengefreq: 'chengefreq', + priority: 0.6, + lastmod: new Date(), + lastmodWithTime: true, + lastmodInISO: false, + video: { + title: 'title', + description: 'description', + content_loc: 'content_loc', + thumbnail_loc: 'thumbnail_loc' + }, + }, + { + url: 'http://example.com/' + } +]); + +let sitemap2 = new Sitemap(); +sitemap.addSitemap(sitemap2); + +const xmlList = sitemap.toXML(); +var str = xmlList[0].fileName; +var str = xmlList[0].xml; diff --git a/sitemap2/tsconfig.json b/sitemap2/tsconfig.json new file mode 100644 index 0000000000..6fd2aba277 --- /dev/null +++ b/sitemap2/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", + "sitemap2-tests.ts" + ] +} \ No newline at end of file diff --git a/sitemap2/tslint.json b/sitemap2/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/sitemap2/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file From a4f4d71344229c5cbbd397334a5a6c7757061bd2 Mon Sep 17 00:00:00 2001 From: Armando Meziat Date: Fri, 10 Mar 2017 03:14:53 -0300 Subject: [PATCH 452/797] Added optimize-css-assets-webpack-plugin definitions (#14966) --- optimize-css-assets-webpack-plugin/index.d.ts | 23 +++++++++++++++++++ ...ptimize-css-assets-webpack-plugin-tests.ts | 6 +++++ .../tsconfig.json | 22 ++++++++++++++++++ .../tslint.json | 1 + 4 files changed, 52 insertions(+) create mode 100644 optimize-css-assets-webpack-plugin/index.d.ts create mode 100644 optimize-css-assets-webpack-plugin/optimize-css-assets-webpack-plugin-tests.ts create mode 100644 optimize-css-assets-webpack-plugin/tsconfig.json create mode 100644 optimize-css-assets-webpack-plugin/tslint.json diff --git a/optimize-css-assets-webpack-plugin/index.d.ts b/optimize-css-assets-webpack-plugin/index.d.ts new file mode 100644 index 0000000000..af484b05d2 --- /dev/null +++ b/optimize-css-assets-webpack-plugin/index.d.ts @@ -0,0 +1,23 @@ +// Type definitions for optimize-css-assets-webpack-plugin 1.3 +// Project: https://github.com/NMFR/optimize-css-assets-webpack-plugin +// Definitions by: Armando Meziat +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin } from 'webpack'; + +export = OptimizeCssAssetsPlugin; + +declare namespace OptimizeCssAssetsPlugin { + + export interface Options { + assetNameRegExp?: RegExp; + cssProcessor?: any; + cssProcessorOptions?: any; + canPrint?: boolean; + } + +} + +declare class OptimizeCssAssetsPlugin extends Plugin { + constructor(options?: OptimizeCssAssetsPlugin.Options); +} diff --git a/optimize-css-assets-webpack-plugin/optimize-css-assets-webpack-plugin-tests.ts b/optimize-css-assets-webpack-plugin/optimize-css-assets-webpack-plugin-tests.ts new file mode 100644 index 0000000000..74cf685649 --- /dev/null +++ b/optimize-css-assets-webpack-plugin/optimize-css-assets-webpack-plugin-tests.ts @@ -0,0 +1,6 @@ +import * as OptimizeCssAssets from 'optimize-css-assets-webpack-plugin'; + +const ocap: OptimizeCssAssets = new OptimizeCssAssets({ + assetNameRegExp: /\.min\.css$/, + canPrint: true +}); diff --git a/optimize-css-assets-webpack-plugin/tsconfig.json b/optimize-css-assets-webpack-plugin/tsconfig.json new file mode 100644 index 0000000000..8693d603ec --- /dev/null +++ b/optimize-css-assets-webpack-plugin/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", + "optimize-css-assets-webpack-plugin-tests.ts" + ] +} diff --git a/optimize-css-assets-webpack-plugin/tslint.json b/optimize-css-assets-webpack-plugin/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/optimize-css-assets-webpack-plugin/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From f817f2f75e2afd8dbb07a7f41296efdc34cc6654 Mon Sep 17 00:00:00 2001 From: evenflow58 Date: Fri, 10 Mar 2017 01:15:18 -0500 Subject: [PATCH 453/797] Add spyOnProperty to jasmine (#14965) * Add spyOnProperty * Incremented version in header --- jasmine/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jasmine/index.d.ts b/jasmine/index.d.ts index e18361dec4..c0db55d100 100644 --- a/jasmine/index.d.ts +++ b/jasmine/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Jasmine 2.5 +// Type definitions for Jasmine 2.5.2 // Project: http://jasmine.github.io/ // Definitions by: Boris Yankov , Theodore Brown , David Pärsson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -38,6 +38,8 @@ interface DoneFn extends Function { declare function spyOn(object: T, method: keyof T): jasmine.Spy; +declare function spyOnProperty(object: T, property: keyof T, accessType: string): jasmine.Spy; + declare function runs(asyncMethod: Function): void; declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void; declare function waits(timeout?: number): void; @@ -455,6 +457,7 @@ declare namespace jasmine { addBeforesAndAftersToQueue(): void; explodes(): void; spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy; + spyOnProperty(object: any, property: string, accessType: string): Spy; removeAllSpies(): void; throwOnExpectationFailure: boolean; } From 932a3777390cf3fbacb285ef51f0935d7ddad98d Mon Sep 17 00:00:00 2001 From: hn3000 Date: Fri, 10 Mar 2017 07:16:13 +0100 Subject: [PATCH 454/797] declare array properties as arrays, not tuples (#14964) see https://github.com/Microsoft/TypeScript/issues/3428 also fix a typo in "Security" (was Secuirty) --- swagger-schema-official/index.d.ts | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/swagger-schema-official/index.d.ts b/swagger-schema-official/index.d.ts index 172fca0d4e..f0f2e60183 100644 --- a/swagger-schema-official/index.d.ts +++ b/swagger-schema-official/index.d.ts @@ -96,13 +96,13 @@ export interface Operation { description?: string; externalDocs?: ExternalDocs; operationId?: string; - produces?: [string]; - consumes?: [string]; - parameters?: [Parameter]; - schemes?: [string]; + produces?: string[]; + consumes?: string[]; + parameters?: Parameter[]; + schemes?: string[]; deprecated?: boolean; - security?: [Secuirty]; - tags?: [string]; + security?: Security[]; + tags?: string[]; } // ----------------------------- Response ------------------------------------ @@ -132,14 +132,14 @@ interface BaseSchema { uniqueItems?: boolean; maxProperties?: number; minProperties?: number; - enum?: [string|boolean|number|{}]; + enum?: (string|boolean|number|{})[]; type?: string; - items?: Schema|[Schema]; + items?: Schema|Schema[]; } export interface Schema extends BaseSchema { $ref?: string; - allOf?: [Schema]; + allOf?: Schema[]; additionalProperties?: boolean; properties?: {[propertyName: string]: Schema}; discriminator?: string; @@ -147,7 +147,7 @@ export interface Schema extends BaseSchema { xml?: XML; externalDocs?: ExternalDocs; example?: {[exampleName: string]: {}}; - required?: [string]; + required?: string[]; } export interface XML { @@ -184,25 +184,25 @@ export interface OAuth2ImplicitSecurity extends BaseOAuthSecuirty { export interface OAuth2PasswordSecurity extends BaseOAuthSecuirty { tokenUrl: string; - scopes?: [OAuthScope]; + scopes?: OAuthScope[]; } export interface OAuth2ApplicationSecurity extends BaseOAuthSecuirty { tokenUrl: string; - scopes?: [OAuthScope]; + scopes?: OAuthScope[]; } export interface OAuth2AccessCodeSecurity extends BaseOAuthSecuirty { tokenUrl: string; authorizationUrl: string; - scopes?: [OAuthScope]; + scopes?: OAuthScope[]; } export interface OAuthScope { [scopeName: string]: string; } -type Secuirty = +type Security = BasicAuthenticationSecurity | OAuth2AccessCodeSecurity | OAuth2ApplicationSecurity | @@ -217,14 +217,14 @@ export interface Spec { externalDocs?: ExternalDocs; host?: string; basePath?: string; - schemes?: [string]; - consumes?: [string]; - produces?: [string]; + schemes?: string[]; + consumes?: string[]; + produces?: string[]; paths: {[pathName: string]: Path}; definitions?: {[definitionsName: string]: Schema }; parameters?: {[parameterName: string]: BodyParameter|QueryParameter}; responses?: {[responseName: string]: Response }; - security?: [Secuirty]; - securityDefinitions?: { [securityDefinitionName: string]: Secuirty}; - tags?: [Tag]; + security?: Security[]; + securityDefinitions?: { [securityDefinitionName: string]: Security}; + tags?: Tag[]; } From 5455f4cd35f95d53744db1e17cddfeb603de568f Mon Sep 17 00:00:00 2001 From: Krzysztof Rzymkowski Date: Fri, 10 Mar 2017 07:18:54 +0100 Subject: [PATCH 455/797] lodash - fix tslint warrnings in v3 tests (#14962) --- lodash/v3/lodash-tests.ts | 62 ++++++++++++++------------------------- 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/lodash/v3/lodash-tests.ts b/lodash/v3/lodash-tests.ts index 8793d38779..023e5df57e 100644 --- a/lodash/v3/lodash-tests.ts +++ b/lodash/v3/lodash-tests.ts @@ -80,7 +80,7 @@ var keys: IKey[] = [ class Dog { constructor(public name: string) { } - public bark() { + bark() { console.log('Woof, woof!'); } } @@ -4064,21 +4064,15 @@ namespace TestFind { result = _(dictionary).find<{a: number}, TResult>({a: 42}); } -result = _.findWhere([1, 2, 3, 4], function (num) { - return num % 2 == 0; -}); +result = _.findWhere([1, 2, 3, 4], num => num % 2 == 0); result = _.findWhere(foodsCombined, { 'type': 'vegetable' }); result = _.findWhere(foodsCombined, 'organic'); -result = _.findLast([1, 2, 3, 4], function (num) { - return num % 2 == 0; -}); +result = _.findLast([1, 2, 3, 4], num => num % 2 == 0); result = _.findLast(foodsCombined, { 'type': 'vegetable' }); result = _.findLast(foodsCombined, 'organic'); -result = _([1, 2, 3, 4]).findLast(function (num) { - return num % 2 == 0; -}); +result = _([1, 2, 3, 4]).findLast(num => num % 2 == 0); result = _(foodsCombined).findLast({ 'type': 'vegetable' }); result = _(foodsCombined).findLast('organic'); @@ -4850,56 +4844,44 @@ interface ABC { c: number; } -result = _.reduce([1, 2, 3], function (sum: number, num: number) { - return sum + num; -}); -result = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, function (r: ABC, num: number, key: string) { +result = _.reduce([1, 2, 3], (sum: number, num: number) => sum + num); +result = _.reduce({ 'a': 1, 'b': 2, 'c': 3 }, (r: ABC, num: number, key: string) => { r[key] = num * 3; return r; }, {}); -result = _.foldl([1, 2, 3], function (sum: number, num: number) { - return sum + num; -}); -result = _.foldl({ 'a': 1, 'b': 2, 'c': 3 }, function (r: ABC, num: number, key: string) { +result = _.foldl([1, 2, 3], (sum: number, num: number) => sum + num); +result = _.foldl({ 'a': 1, 'b': 2, 'c': 3 }, (r: ABC, num: number, key: string) => { r[key] = num * 3; return r; }, {}); -result = _.inject([1, 2, 3], function (sum: number, num: number) { - return sum + num; -}); -result = _.inject({ 'a': 1, 'b': 2, 'c': 3 }, function (r: ABC, num: number, key: string) { +result = _.inject([1, 2, 3], (sum: number, num: number) => sum + num); +result = _.inject({ 'a': 1, 'b': 2, 'c': 3 }, (r: ABC, num: number, key: string) => { r[key] = num * 3; return r; }, {}); -result = _([1, 2, 3]).reduce(function (sum: number, num: number) { - return sum + num; -}); -result = _({ 'a': 1, 'b': 2, 'c': 3 }).reduce(function (r: ABC, num: number, key: string) { +result = _([1, 2, 3]).reduce((sum: number, num: number) => sum + num); +result = _({ 'a': 1, 'b': 2, 'c': 3 }).reduce((r: ABC, num: number, key: string) => { r[key] = num * 3; return r; }, {}); -result = _([1, 2, 3]).foldl(function (sum: number, num: number) { - return sum + num; -}); -result = _({ 'a': 1, 'b': 2, 'c': 3 }).foldl(function (r: ABC, num: number, key: string) { +result = _([1, 2, 3]).foldl((sum: number, num: number) => sum + num); +result = _({ 'a': 1, 'b': 2, 'c': 3 }).foldl((r: ABC, num: number, key: string) => { r[key] = num * 3; return r; }, {}); -result = _([1, 2, 3]).inject(function (sum: number, num: number) { - return sum + num; -}); -result = _({ 'a': 1, 'b': 2, 'c': 3 }).inject(function (r: ABC, num: number, key: string) { +result = _([1, 2, 3]).inject((sum: number, num: number) => sum + num); +result = _({ 'a': 1, 'b': 2, 'c': 3 }).inject((r: ABC, num: number, key: string) => { r[key] = num * 3; return r; }, {}); -result = _.reduceRight([[0, 1], [2, 3], [4, 5]], function (a: number[], b: number[]) { return a.concat(b); }, []); -result = _.foldr([[0, 1], [2, 3], [4, 5]], function (a: number[], b: number[]) { return a.concat(b); }, []); +result = _.reduceRight([[0, 1], [2, 3], [4, 5]], (a: number[], b: number[]) => a.concat(b), []); +result = _.foldr([[0, 1], [2, 3], [4, 5]], (a: number[], b: number[]) => a.concat(b), []); // _.reject namespace TestReject { @@ -5455,9 +5437,9 @@ namespace TestSortBy { } } -result = _.sortByAll(stoogesAges, function(stooge) { return Math.sin(stooge.age); }, function(stooge) { return stooge.name.slice(1); }); +result = _.sortByAll(stoogesAges, (stooge) => Math.sin(stooge.age), (stooge) => stooge.name.slice(1)); result = _.sortByAll(stoogesAges, ['name', 'age']); -result = _.sortByAll(stoogesAges, 'name', function(stooge) { return Math.sin(stooge.age); }); +result = _.sortByAll(stoogesAges, 'name', (stooge) => Math.sin(stooge.age)); result = _(foodsOrganic).sortByAll('organic', (food) => food.name, { organic: true }).value(); @@ -6317,7 +6299,7 @@ namespace TestOnce { } } -var greetPartial = function (greeting: string, name: string) { return greeting + ' ' + name; }; +var greetPartial = (greeting: string, name: string) => greeting + ' ' + name; var hi = _.partial(greetPartial, 'hi'); hi('moe'); @@ -10384,7 +10366,7 @@ namespace TestNoConflict { // _.noop namespace TestNoop { { - let result: void; + let result: void; // tslint:disable-line:void-return result = _.noop(); result = _.noop(1); From c928fee373c4ba6da8d30e63f65db57ba88cb86d Mon Sep 17 00:00:00 2001 From: Krzysztof Rzymkowski Date: Fri, 10 Mar 2017 07:20:03 +0100 Subject: [PATCH 456/797] lodash - _.filter(): predicate can be a RegExp (#14961) --- lodash/index.d.ts | 10 +++++----- lodash/lodash-tests.ts | 9 +++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lodash/index.d.ts b/lodash/index.d.ts index e473545d33..da5710a7de 100644 --- a/lodash/index.d.ts +++ b/lodash/index.d.ts @@ -6707,7 +6707,7 @@ declare namespace _ { */ filter( collection: List|Dictionary, - predicate: string + predicate: string|RegExp ): T[]; /** @@ -6740,7 +6740,7 @@ declare namespace _ { * @see _.filter */ filter( - predicate: string + predicate: string|RegExp ): LoDashImplicitArrayWrapper; /** @@ -6761,7 +6761,7 @@ declare namespace _ { * @see _.filter */ filter( - predicate: string + predicate: string|RegExp ): LoDashImplicitArrayWrapper; /** @@ -6791,7 +6791,7 @@ declare namespace _ { * @see _.filter */ filter( - predicate: string + predicate: string|RegExp ): LoDashExplicitArrayWrapper; /** @@ -6812,7 +6812,7 @@ declare namespace _ { * @see _.filter */ filter( - predicate: string + predicate: string|RegExp ): LoDashExplicitArrayWrapper; /** diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 8ccd742a0e..8accba65c0 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -3625,14 +3625,17 @@ namespace TestFilter { result = _.filter(array, listIterator); result = _.filter(array, ''); + result = _.filter(array, /./); result = _.filter(array, {a: 42}); result = _.filter(list, listIterator); result = _.filter(list, ''); + result = _.filter(list, /./); result = _.filter(list, {a: 42}); result = _.filter(dictionary, dictionaryIterator); result = _.filter(dictionary, ''); + result = _.filter(dictionary, /./); result = _.filter(dictionary, {a: 42}); } @@ -3647,14 +3650,17 @@ namespace TestFilter { result = _(array).filter(listIterator); result = _(array).filter(''); + result = _(array).filter(/./); result = _(array).filter({a: 42}); result = _(list).filter(listIterator); result = _(list).filter(''); + result = _(list).filter(/./); result = _(list).filter({a: 42}); result = _(dictionary).filter(dictionaryIterator); result = _(dictionary).filter(''); + result = _(dictionary).filter(/./); result = _(dictionary).filter({a: 42}); } @@ -3669,14 +3675,17 @@ namespace TestFilter { result = _(array).chain().filter(listIterator); result = _(array).chain().filter(''); + result = _(array).chain().filter(/./); result = _(array).chain().filter({a: 42}); result = _(list).chain().filter(listIterator); result = _(list).chain().filter(''); + result = _(list).chain().filter(/./); result = _(list).chain().filter({a: 42}); result = _(dictionary).chain().filter(dictionaryIterator); result = _(dictionary).chain().filter(''); + result = _(dictionary).chain().filter(/./); result = _(dictionary).chain().filter({a: 42}); } } From 2c7960b0c7e54187090f31dbf01abf4b05329668 Mon Sep 17 00:00:00 2001 From: Evgeny Tomsen Date: Fri, 10 Mar 2017 07:20:49 +0100 Subject: [PATCH 457/797] type definitions for line-by-line (#14960) --- line-by-line/index.d.ts | 56 ++++++++++++++++++++++++++++++ line-by-line/line-by-line-tests.ts | 12 +++++++ line-by-line/tsconfig.json | 23 ++++++++++++ line-by-line/tslint.json | 1 + 4 files changed, 92 insertions(+) create mode 100644 line-by-line/index.d.ts create mode 100644 line-by-line/line-by-line-tests.ts create mode 100644 line-by-line/tsconfig.json create mode 100644 line-by-line/tslint.json diff --git a/line-by-line/index.d.ts b/line-by-line/index.d.ts new file mode 100644 index 0000000000..69fbacf728 --- /dev/null +++ b/line-by-line/index.d.ts @@ -0,0 +1,56 @@ +// Type definitions for line-by-line 0.1 +// Project: https://github.com/Osterjour/line-by-line +// Definitions by: Evgeny Tomsen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +import { EventEmitter } from "events"; + +export = LineByLineReader; + +interface LineByLineReader extends EventEmitter { + /** + * subscribe to an event emitted by reader + * @param event {@link LineByLineReaderEvent} + * @param listener A void function with one param + */ + on(event: LineByLineReaderEvent, listener: (value: any) => void): this; + /** + * Pauses the reader + */ + pause(): void; + /** + * Resumes the reader + */ + resume(): void; + /** + * Finishes the reader + */ + end(): void; + /** + * Closes the file stream + */ + close(): void; +} + +interface LineByLineReaderOptions { + encoding?: string; + skipEmptyLines?: boolean; + start?: number +} + +interface LineByLineReaderConstructor { + /** + * Constructs a new LineByLineReader object + * @param filename filename to read + * @param options Optional. {@link LineByLineReaderOptions} + */ + new (filename: string, options?: LineByLineReaderOptions): LineByLineReader; + readonly prototype: LineByLineReader; +} + +type LineByLineReaderEvent = "line" | "end" | "error"; + +declare const LineByLineReader: LineByLineReaderConstructor; \ No newline at end of file diff --git a/line-by-line/line-by-line-tests.ts b/line-by-line/line-by-line-tests.ts new file mode 100644 index 0000000000..37631beead --- /dev/null +++ b/line-by-line/line-by-line-tests.ts @@ -0,0 +1,12 @@ +import * as LineByLineReader from "line-by-line"; + +let reader: LineByLineReader = new LineByLineReader("index.d.ts"); +reader.on("line", (line: any) => { + console.log(line); +}); +reader.on("end", () => { + console.log("end"); +}); +reader.on("error", (err: any) => { + throw("Error reading file"); +}); \ No newline at end of file diff --git a/line-by-line/tsconfig.json b/line-by-line/tsconfig.json new file mode 100644 index 0000000000..a0f6fb9b81 --- /dev/null +++ b/line-by-line/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "line-by-line-tests.ts" + ] +} \ No newline at end of file diff --git a/line-by-line/tslint.json b/line-by-line/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/line-by-line/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file From 9dc918dbf0d3876bee5e2eed6d2eea70c71cc9de Mon Sep 17 00:00:00 2001 From: Marc Neumann Date: Fri, 10 Mar 2017 01:24:00 -0500 Subject: [PATCH 458/797] Added type declarations for node-xmpp-core. (#14958) --- node-xmpp-core/index.d.ts | 97 ++++++++++++++++++++++++++ node-xmpp-core/node-xmpp-core-tests.ts | 6 ++ node-xmpp-core/tsconfig.json | 22 ++++++ node-xmpp-core/tslint.json | 3 + 4 files changed, 128 insertions(+) create mode 100644 node-xmpp-core/index.d.ts create mode 100644 node-xmpp-core/node-xmpp-core-tests.ts create mode 100644 node-xmpp-core/tsconfig.json create mode 100644 node-xmpp-core/tslint.json diff --git a/node-xmpp-core/index.d.ts b/node-xmpp-core/index.d.ts new file mode 100644 index 0000000000..dd2b89ca22 --- /dev/null +++ b/node-xmpp-core/index.d.ts @@ -0,0 +1,97 @@ +// Type definitions for node-xmpp-core 5.0 +// Project: github.com/node-xmpp/node-xmpp/ +// Definitions by: PJakcson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 +/// +import {Element} from 'ltx'; +import {EventEmitter} from 'events'; + +// fixme: not ideal +export {createElement, Element, escapeXML, escapeXMLText} from 'ltx'; + +export declare class Connection extends EventEmitter { + constructor(opts?: any); +} + +export declare namespace SRV { + /** + * returns a lazy iterator which can be restarted via connection.connect() + */ + function connect(opts?: any): any; +} + +export declare class Stanza extends Element { + from: string; + to: string; + id: string; + type: string; + + constructor(name: string, attrs?: any); +} + +/** + * JSX compatible API, use this function as pragma + * https://facebook.github.io/jsx/ + * Returns a Stanza if name is presence, message or iq an ltx Element otherwise. + * + * @param {string} name name of the element + * @param {any} attrs attribute key/value pairs + * @return {Element} Stanza or Element + */ +export declare function createStanza(name: string, attrs?: any): Element; + +export declare class IQ extends Stanza { + constructor(attrs?: any); +} + +export declare class Message extends Stanza { + constructor(attrs?: any); +} + +export declare class Presence extends Stanza { + constructor(attrs?: any); +} + +export declare class JID { + local: string; + domain: string; + resource: string; + + constructor(local: string, domain?: string, resource?: string); + + parseJID(jid: string): void; + + toString(unescape?: any): string; + + /** + * Convenience method to distinguish users + **/ + bare(): JID; + + /** + * Comparison function + **/ + equals(other: JID): boolean; + + /** + * http://xmpp.org/rfcs/rfc6122.html#addressing-localpart + **/ + setLocal(local: string, escape?: any): void; + + getLocal(unescape?: any): string; + + /** + * http://xmpp.org/rfcs/rfc6122.html#addressing-domain + */ + setDomain(value: string): void; + + getDomain(): string; + + /** + * http://xmpp.org/rfcs/rfc6122.html#addressing-resourcepart + */ + setResource(value: string): void; + + getResource(): string; +} diff --git a/node-xmpp-core/node-xmpp-core-tests.ts b/node-xmpp-core/node-xmpp-core-tests.ts new file mode 100644 index 0000000000..ebb27f3b17 --- /dev/null +++ b/node-xmpp-core/node-xmpp-core-tests.ts @@ -0,0 +1,6 @@ +import {Connection} from './index'; + +const con = new Connection(); +con.on('online', () => { + con.eventNames(); +}); diff --git a/node-xmpp-core/tsconfig.json b/node-xmpp-core/tsconfig.json new file mode 100644 index 0000000000..61048d84cb --- /dev/null +++ b/node-xmpp-core/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", + "node-xmpp-core-tests.ts" + ] +} diff --git a/node-xmpp-core/tslint.json b/node-xmpp-core/tslint.json new file mode 100644 index 0000000000..ec365f164b --- /dev/null +++ b/node-xmpp-core/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} From c12c733253041b94e92da17862f1d17c4c74016f Mon Sep 17 00:00:00 2001 From: Armando Meziat Date: Fri, 10 Mar 2017 03:26:02 -0300 Subject: [PATCH 459/797] Added autoprefixer definitions (#14956) * Added autoprefixer definitions * Added package.json --- autoprefixer/autoprefixer-tests.ts | 17 ++++++++++++++++ autoprefixer/index.d.ts | 32 ++++++++++++++++++++++++++++++ autoprefixer/package.json | 5 +++++ autoprefixer/tsconfig.json | 22 ++++++++++++++++++++ autoprefixer/tslint.json | 1 + 5 files changed, 77 insertions(+) create mode 100644 autoprefixer/autoprefixer-tests.ts create mode 100644 autoprefixer/index.d.ts create mode 100644 autoprefixer/package.json create mode 100644 autoprefixer/tsconfig.json create mode 100644 autoprefixer/tslint.json diff --git a/autoprefixer/autoprefixer-tests.ts b/autoprefixer/autoprefixer-tests.ts new file mode 100644 index 0000000000..47ef1cbc08 --- /dev/null +++ b/autoprefixer/autoprefixer-tests.ts @@ -0,0 +1,17 @@ +import * as autopref from 'autoprefixer'; + +const ap: autopref.Transformer = autopref({ + browsers: ['> 5%', 'last 2 versions'], + env: '', + cascade: true, + add: true, + remove: true, + supports: true, + flexbox: true, + grid: true, + stats: {}, +}); +const ap2: autopref.Transformer = autopref({ + flexbox: 'no-2009', +}); +const info: string = ap.info(); diff --git a/autoprefixer/index.d.ts b/autoprefixer/index.d.ts new file mode 100644 index 0000000000..0a01c34d9a --- /dev/null +++ b/autoprefixer/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for autoprefixer 6.7 +// Project: https://github.com/postcss/autoprefixer +// Definitions by: Armando Meziat +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { Plugin, Transformer as PostcssTransformer } from 'postcss'; + +declare namespace autoprefixer { + + export interface Options { + browsers?: string[]; + env?: string; + cascade?: boolean; + add?: boolean; + remove?: boolean; + supports?: boolean; + flexbox?: boolean | 'no-2009'; + grid?: boolean; + stats?: any; + } + + export interface Transformer extends PostcssTransformer { + info(): string; + } + + export interface Autoprefixer extends Plugin { + (opts?: Options): Transformer; + } +} + +declare const autoprefixer: autoprefixer.Autoprefixer; +export = autoprefixer; diff --git a/autoprefixer/package.json b/autoprefixer/package.json new file mode 100644 index 0000000000..aa284a6db8 --- /dev/null +++ b/autoprefixer/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "postcss": "^5.2.15" + } +} diff --git a/autoprefixer/tsconfig.json b/autoprefixer/tsconfig.json new file mode 100644 index 0000000000..244c865adf --- /dev/null +++ b/autoprefixer/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", + "autoprefixer-tests.ts" + ] +} diff --git a/autoprefixer/tslint.json b/autoprefixer/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/autoprefixer/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 2efe76ecf083dc17028648a6e9de5cea2543cc93 Mon Sep 17 00:00:00 2001 From: Jakub Date: Fri, 10 Mar 2017 07:28:42 +0100 Subject: [PATCH 460/797] angular.forEach obj parameter in callback function (#14953) --- angular/angular-tests.ts | 3 ++- angular/index.d.ts | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/angular/angular-tests.ts b/angular/angular-tests.ts index 4e1f33ce47..b4e394aa37 100644 --- a/angular/angular-tests.ts +++ b/angular/angular-tests.ts @@ -587,7 +587,8 @@ namespace TestPromise { function test_angular_forEach() { const values: { [key: string]: string } = { name: 'misko', gender: 'male' }; const log: string[] = []; - angular.forEach(values, (value, key) => { + angular.forEach(values, (value, key, obj) => { + obj[key] = value; this.push(key + ': ' + value); }, log); // expect(log).toEqual(['name: misko', 'gender: male']); diff --git a/angular/index.d.ts b/angular/index.d.ts index bbbbdb021a..05b6ce92ff 100644 --- a/angular/index.d.ts +++ b/angular/index.d.ts @@ -97,7 +97,7 @@ declare namespace angular { * @param iterator Iterator function. * @param context Object to become context (this) for the iterator function. */ - forEach(obj: T[], iterator: (value: T, key: number) => any, context?: any): any; + forEach(obj: T[], iterator: (value: T, key: number, obj: T[]) => void, context?: any): T[]; /** * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional. * @@ -107,7 +107,7 @@ declare namespace angular { * @param iterator Iterator function. * @param context Object to become context (this) for the iterator function. */ - forEach(obj: { [index: string]: T; }, iterator: (value: T, key: string) => any, context?: any): any; + forEach(obj: { [index: string]: T; }, iterator: (value: T, key: string, obj: { [index: string]: T; }) => void, context?: any): { [index: string]: T; }; /** * Invokes the iterator function once for each item in obj collection, which can be either an object or an array. The iterator function is invoked with iterator(value, key), where value is the value of an object property or an array element and key is the object property key or array element index. Specifying a context for the function is optional. * @@ -117,7 +117,7 @@ declare namespace angular { * @param iterator Iterator function. * @param context Object to become context (this) for the iterator function. */ - forEach(obj: any, iterator: (value: any, key: any) => any, context?: any): any; + forEach(obj: any, iterator: (value: any, key: any, obj: any) => void, context?: any): any; fromJson(json: string): any; identity(arg?: T): T; From f99aecfaef99e8a1e38dc7a2bf120d35d88af9e7 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Fri, 10 Mar 2017 07:31:15 +0100 Subject: [PATCH 461/797] feat(htmlhint): initial implementation (#14950) --- htmlhint/htmlhint-tests.ts | 17 +++++++++++++++++ htmlhint/index.d.ts | 32 ++++++++++++++++++++++++++++++++ htmlhint/tsconfig.json | 23 +++++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 htmlhint/htmlhint-tests.ts create mode 100644 htmlhint/index.d.ts create mode 100644 htmlhint/tsconfig.json diff --git a/htmlhint/htmlhint-tests.ts b/htmlhint/htmlhint-tests.ts new file mode 100644 index 0000000000..1a44c78888 --- /dev/null +++ b/htmlhint/htmlhint-tests.ts @@ -0,0 +1,17 @@ +import { HTMLHint, RuleSet } from "htmlhint"; + +const htmlHintRules: RuleSet = { + "tagname-lowercase": true, + "attr-lowercase": true, + "attr-value-double-quotes": true, + "doctype-first": true, + "tag-pair": true, + "spec-char-escape": true, + "id-unique": true, + "src-not-empty": true, + "attr-no-duplication": true, + "title-require": true +}; + +const result = HTMLHint.verify('', htmlHintRules); +const formatted = HTMLHint.format(result, { indent: 2 }); diff --git a/htmlhint/index.d.ts b/htmlhint/index.d.ts new file mode 100644 index 0000000000..7908eaaddb --- /dev/null +++ b/htmlhint/index.d.ts @@ -0,0 +1,32 @@ +// Type definitions for HTMLHint 0.9 +// Project: https://github.com/yaniswang/HTMLHint +// Definitions by: Alan Agius +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface LintResult { + evidence: string; + line: number; + col: number; + message: string; + rule: Rule; +} + +export interface FormatOptions { + indent?: number; + colors?: boolean; +} + +export interface Rule { + id: string; + description: string; + link: string; +} + +export interface RuleSet { + [id: string]: boolean; +} + +export namespace HTMLHint { + function verify(fileContent: string, ruleSet?: RuleSet): LintResult[]; + function format(arrMessages: LintResult[], options?: FormatOptions): string[]; +} diff --git a/htmlhint/tsconfig.json b/htmlhint/tsconfig.json new file mode 100644 index 0000000000..1ae3c23f81 --- /dev/null +++ b/htmlhint/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "htmlhint-tests.ts" + ] +} From d16834af9d1cc616f76f5395dc79bd4c9a86e717 Mon Sep 17 00:00:00 2001 From: Calvin Jeong Date: Fri, 10 Mar 2017 19:31:37 +1300 Subject: [PATCH 462/797] Add definition for `TubeBufferGeometry` (#14949) Docs: https://threejs.org/docs/?q=tube#Reference/Geometries/TubeBufferGeometry --- three/index.d.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/three/index.d.ts b/three/index.d.ts index 8700df1cbe..46975498c3 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -6462,6 +6462,21 @@ declare namespace THREE { static FrenetFrames(path: Path, segments: number, closed: boolean): void; } + export class TubeBufferGeometry extends BufferGeometry { + constructor(path: Curve, segments?: number, radius?: number, radiusSegments?: number, closed?: boolean); + + parameters: { + path: Curve; + segments: number; + radius: number; + radialSegments: number; + closed: boolean; + }; + tangents: Vector3[]; + normals: Vector3[]; + binormals: Vector3[]; + } + export class WireframeGeometry extends BufferGeometry { constructor(geometry: Geometry | BufferGeometry); } From 085b1c40d7329a08e0e6bf2a49203c767c3db699 Mon Sep 17 00:00:00 2001 From: andwi Date: Fri, 10 Mar 2017 07:38:43 +0100 Subject: [PATCH 463/797] tmhDynamicLocaleService.set should return a promise (#14946) --- angular-dynamic-locale/angular-dynamic-locale-tests.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/angular-dynamic-locale/angular-dynamic-locale-tests.ts b/angular-dynamic-locale/angular-dynamic-locale-tests.ts index fd88de0d25..1e30aafd94 100644 --- a/angular-dynamic-locale/angular-dynamic-locale-tests.ts +++ b/angular-dynamic-locale/angular-dynamic-locale-tests.ts @@ -15,6 +15,9 @@ class LocaleTestController { var newLocale = "mt" tmhDynamicLocaleService.set(newLocale); + + newLocale = "en"; + tmhDynamicLocaleService.set(newLocale).then((value) => {}); } } From 0a8a04eaaadf74d7430314cfe8ec33a5bf2b3c33 Mon Sep 17 00:00:00 2001 From: Yannick Beauchamp-H Date: Fri, 10 Mar 2017 01:42:08 -0500 Subject: [PATCH 464/797] Add NanoScroller typings (#14944) --- nanoscroller/index.d.ts | 126 +++++++++++++++++++++++++++++ nanoscroller/nanoscroller-tests.ts | 8 ++ nanoscroller/tsconfig.json | 23 ++++++ nanoscroller/tslint.json | 1 + 4 files changed, 158 insertions(+) create mode 100644 nanoscroller/index.d.ts create mode 100644 nanoscroller/nanoscroller-tests.ts create mode 100644 nanoscroller/tsconfig.json create mode 100644 nanoscroller/tslint.json diff --git a/nanoscroller/index.d.ts b/nanoscroller/index.d.ts new file mode 100644 index 0000000000..ede65fc283 --- /dev/null +++ b/nanoscroller/index.d.ts @@ -0,0 +1,126 @@ +// Type definitions for nanoScroller 0.8 +// Project: http://jamesflorentino.github.io/nanoScrollerJS/ +// Definitions by: Yannick Beauchamp-Hurtubise +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace JQueryNanoScroller { + interface NanoScrollerOptions { + /** + * To scroll at the top or bottom. + */ + scroll?: 'top' | 'bottom'; + /** + * To scroll at the top with an offset value. + */ + scrollTop?: number; + /** + * To scroll at the bottom with an offset value. + */ + scrollBottom?: number; + /** + * To scroll to an element. + */ + scrollTo?: JQuery; + /** + * To stop the operation. + * This option will tell the plugin to disable all event bindings and hide the gadget scrollbar from the UI. + */ + stop?: boolean; + /** + * Destroys nanoScroller and restores browser's native scrollbar. + */ + destroy?: boolean; + /** + * To flash the scrollbar gadget for an amount of time defined in plugin settings (defaults to 1,5s). + * Useful if you want to show the user that there is more content waiting for him. + */ + flash?: boolean; + /** + * Set to true if you want to use native scrolling in iOS 5+. + * This will disable your custom nanoScroller scrollbar in iOS 5+ and use the native one instead. + * While the native iOS scrollbar usually works much better, there could possibly be bugs in certain situations. + * @default false + */ + iOSNativeScrolling?: boolean; + /** + * Sets the minimum height of the slider element. + * @default 20 + */ + sliderMinHeight?: number; + /** + * Sets the maximum height of the slider element. + * @default null + */ + sliderMaxHeight?: number | null; + /** + * Set to true to prevent page scrolling when top or bottom inside the content div is reached. + * @default false + */ + preventPageScrolling?: boolean; + /** + * Set to true to disable the resize from nanoscroller. + * Useful if you want total control of the resize event. + * If you set this option to true remember to call the reset method so that the scroll don't have strange behavior. + * @default false + */ + disableResize?: boolean; + /** + * Set to true to stop the scrollbar from auto-hiding itself. + * @default false + */ + alwaysVisible?: boolean; + /** + * Use this setting to specify the scrollbar hide delay in milliseconds if you have enabled the flash option. + * @default 1500 + */ + flashDelay?: number; + /** + * A classname for scrollbar track element. + * If you change this setting, you also have to change it in the plugin's CSS file. + * @default 'nano-pane' + */ + paneClass?: string; + /** + * A classname for scrollbar thumb element. + * If you change this setting, you also have to change it in the plugin's CSS file. + * @default 'nano-slider' + */ + sliderClass?: string; + /** + * A classname for your content div. + * If you change this setting, you also have to change it in the plugin's CSS file. + * @default 'nano-content' + */ + contentClass?: string; + /** + * A classname for scrollbar enabled mode. + * If you change this setting, you also have to change it in the plugin's CSS file. + * @default 'has-scrollbar' + */ + enabledClass?: string; + /** + * A classname for scrollbar flashed mode. + * If you change this setting, you also have to change it in the plugin's CSS file. + * @default 'flashed' + */ + flashedClass?: string; + /** + * + * If you change this setting, you also have to change it in the plugin's CSS file. + * @default 'active' + */ + activeClass?: string; + /** + * Set the tab order of the scrollable content. + * Set to -1 to skip over the scrollable content when tabbing. + * @default 0 + */ + tabIndex?: number; + } +} + +interface JQuery { + nanoScroller(options?: JQueryNanoScroller.NanoScrollerOptions): JQuery; +} diff --git a/nanoscroller/nanoscroller-tests.ts b/nanoscroller/nanoscroller-tests.ts new file mode 100644 index 0000000000..3b9eeea820 --- /dev/null +++ b/nanoscroller/nanoscroller-tests.ts @@ -0,0 +1,8 @@ +/// + +$('.nano').nanoScroller(); + +$('.nano').nanoScroller({ + scroll: 'bottom', + flash: true +}); diff --git a/nanoscroller/tsconfig.json b/nanoscroller/tsconfig.json new file mode 100644 index 0000000000..9727a9e274 --- /dev/null +++ b/nanoscroller/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "nanoscroller-tests.ts" + ] +} \ No newline at end of file diff --git a/nanoscroller/tslint.json b/nanoscroller/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/nanoscroller/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file From a4b8206d4b1af56924163808248d9f5dea4dfead Mon Sep 17 00:00:00 2001 From: Yuya Tanaka Date: Fri, 10 Mar 2017 15:42:58 +0900 Subject: [PATCH 465/797] [react-mdl] Add MDLComponent class (#14939) --- react-mdl/index.d.ts | 2 ++ react-mdl/react-mdl-tests.tsx | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/react-mdl/index.d.ts b/react-mdl/index.d.ts index 9f962d0156..6265f11ec1 100644 --- a/react-mdl/index.d.ts +++ b/react-mdl/index.d.ts @@ -615,4 +615,6 @@ declare namespace __ReactMDL { title?: string; } class Tooltip extends __MDLComponent { } + + class MDLComponent extends React.Component<{ recursive?: boolean }, {}> { } } diff --git a/react-mdl/react-mdl-tests.tsx b/react-mdl/react-mdl-tests.tsx index 88ef81a7a4..9243eaa32c 100644 --- a/react-mdl/react-mdl-tests.tsx +++ b/react-mdl/react-mdl-tests.tsx @@ -22,7 +22,8 @@ import {Chip, ChipContact, Switch, Tabs, Tab, Textfield, - Tooltip} from 'react-mdl'; + Tooltip, + MDLComponent} from 'react-mdl'; // all tests are from the examples provided here: https://tleunen.github.io/react-mdl/ @@ -1071,3 +1072,14 @@ React.createClass({ ); } }); + +// MDLComponent tests +React.createClass({ + render: function() { + return ( + +
    + + ) + } +}); From 35a2d1886b1053338bceb3ff8220533d456ed1e5 Mon Sep 17 00:00:00 2001 From: Kalle Ott Date: Fri, 10 Mar 2017 07:44:30 +0100 Subject: [PATCH 466/797] new type definitions fro react-virtualized-v9.1.0 (#14938) * replaced and extended type definitions for react-virtualized * update for v9.2.1 * removed unnecessary reference comment --- react-virtualized/index.d.ts | 734 ++++++++++++------ react-virtualized/react-virtualized-tests.tsx | 424 +++++++--- 2 files changed, 811 insertions(+), 347 deletions(-) diff --git a/react-virtualized/index.d.ts b/react-virtualized/index.d.ts index 963af32a27..1994466f8c 100644 --- a/react-virtualized/index.d.ts +++ b/react-virtualized/index.d.ts @@ -1,224 +1,522 @@ -// Type definitions for react-virtualized 8.9.0 +// Type definitions for react-virtualized 9.2.1 // Project: https://github.com/bvaughn/react-virtualized -// Definitions by: Andrew de Waal +// Definitions by: Kalle Ott // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -/// +import * as React from "react"; -declare module "react-virtualized" { - import * as React from "react"; - - /* - * Components - */ - - interface VirtualScrollProps { - className?: string; - autoHeight?: boolean; - estimatedRowSize?: number; - height: number; - noRowsRenderer?: Function; - onRowsRendered?: (info: { overscanStartIndex: number, overscanStopIndex: number, startIndex: number, stopIndex: number }) => void; - onScroll?: (info: { clientHeight: number, scrollHeight: number, scrollTop: number }) => void; - overscanRowCount?: number; - rowHeight: number | ((info: { index: number }) => number); - rowRenderer: (info: { index: number, isScrolling: boolean }) => React.ReactNode; - rowClassName?: string | ((info: { index: number }) => string); - rowCount: number; - rowStyle?: React.CSSProperties | ((info: { index: number }) => React.CSSProperties); - scrollToAlignment?: string; - scrollToIndex?: number; - scrollTop?: number; - style?: React.CSSProperties; - tabIndex?: number; - width: number; - } - export class VirtualScroll extends React.Component { } - - type CollectionProps = any; - export class Collection extends React.Component { } - - type FlexTableProps = any; - export class FlexTable extends React.Component { } - - type FlexColumnProps = any; - export class FlexColumn extends React.Component { } - - type SortDirectionProps = any; - export class SortDirection extends React.Component { } - - type GridProps = any; - export class Grid extends React.Component { } - - interface ListProps { - className?: string; - autoHeight?: boolean; - estimatedRowSize?: number; - height: number; - noRowsRenderer?: Function; - onRowsRendered?: (info: { overscanStartIndex: number, overscanStopIndex: number, startIndex: number, stopIndex: number }) => void; - onScroll?: (info: { clientHeight: number, scrollHeight: number, scrollTop: number }) => void; - overscanRowCount?: number; - rowHeight: number | ((info: { index: number }) => number); - rowRenderer: (info: { index: number, isScrolling: boolean }) => React.ReactNode; - rowCount: number; - scrollToAlignment?: string; - scrollToIndex?: number; - scrollTop?: number; - style?: React.CSSProperties; - tabIndex?: number; - width: number; - } - export class List extends React.Component { } - - // https://github.com/bvaughn/react-virtualized/blob/master/docs/Column.md - interface ColumnProps { - cellDataGetter?: (info: { columnData: any, dataKey: string, rowData: any }) => any; - cellRenderer?: (info: { cellData: any, columnData: any, dataKey: string, isScrolling: boolean, rowData: any, rowIndex: number }) => any; - className?: string; - columnData?: any; - dataKey: any; - disableSort?: boolean; - flexGrow?: number; - flexShrink?: number; - headerClassName?: string; - headerRenderer?: (info: { columnData: any, dataKey: string, disableSort: boolean, label: string, sortBy: string, sortDirection: string }) => any; - label?: string; - maxWidth?: number; - minWidth?: number; - style?: React.CSSProperties; - width: number; - } - - export class Column extends React.Component { } - - // ref: https://github.com/bvaughn/react-virtualized/blob/master/docs/Table.md - interface TableProps { - autoHeight?: boolean; - children?: React.ReactNode; - className?: string; - disableHeader?: boolean; - estimatedRowSize?: number; - gridClassName?: string; - gridStyle?: any; - headerClassName?: string; - headerHeight: number; - headerStyle?: any; - height: number; - id?: string; - noRowsRender?: () => void; - onHeaderClick?: (dataKey: string, columnData: any) => void; - onRowClick?: (info: { index: number }) => void; - onRowDoubleClick?: (info: { index: number }) => void; - onRowMouseOut?: (info: { index: number }) => void; - onRowMouseOver?: (info: { index: number }) => void; - onRowsRendered?: (info: { index: number }) => void; - overscanRowCount?: number; - onScroll?: (info: { clientHeight: number, scrollHeight: number, scrollTop: number }) => void; - rowClassName?: string | ((info: { index: number }) => string); - rowCount: number; - rowGetter?: (info: { index: number }) => any; - rowHeight: number | ((info: { index: number }) => number); - rowRenderer?: (info: { index: number, isScrolling: boolean }) => React.ReactNode; - rowStyle?: React.CSSProperties | ((info: { index: number }) => React.CSSProperties); - scrollToAlignment?: string; - scrollToIndex?: number; - scrollTop?: number; - sort?: (info: { sortBy: string, sortDirection: 'ASC' | 'DESC' }) => void; - sortBy?: string; - sortDirection?: 'ASC' | 'DESC'; - style?: React.CSSProperties; - tabIndex?: number; - width: number; - } - - export class Table extends React.Component { } - - /* - * Higher-Order Components - */ - - interface AutoSizerProps { - disableHeight?: boolean; - disableWidth?: boolean; - onResize?: (info: { height: number, width: number }) => any; - } - export class AutoSizer extends React.Component { } - - interface ArrowKeyStepperProps { - children?: React.StatelessComponent<{ - onSectionRendered: Function, - scrollToColumn: number, - scrollToRow: number - }>; - className?: string; - columnCount: number; - rowCount: number; - } - export class ArrowKeyStepper extends React.Component { } - - interface CellMeasurerProps { - cellRenderer: (info: { columnIndex: number, rowIndex: number }) => React.ReactNode; - cellSizeCache?: { - clearAllColumnWidths(): void; - clearAllRowHeights(): void; - clearColumnWidth(index: number): void; - clearRowHeight(index: number): void; - getColumnWidth(index: number): number; - getRowHeight(index: number): number; - hasColumnWidth(index: number): boolean; - hasRowHeight(index: number): boolean; - setColumnWidth(index: number, width: number): void; - setRowHeight(index: number, height: number): void; - }; - children?: React.StatelessComponent<{ - getColumnWidth: () => number, - getRowHeight: () => number, - resetMeasurements: () => any, - resetMeasurementsForColumn: (index: number) => any, - resetMeasurementsForRow: (index: number) => any, - }>; - columnCount: number; - container?: React.ReactType; - height?: number; - rowCount: number; - width?: number; - } - export class CellMeasurer extends React.Component { } - - interface ColumnSizerProps { - children?: React.StatelessComponent<{ adjustedWidth: number, getColumnWidth: () => number, registerChild: any }>; - columnMaxWidth?: number; - columnMinWidth?: number; - columnCount?: number; - width: number; - } - export class ColumnSizer extends React.Component { } - - type InfiniteLoaderProps = any; - export class InfiniteLoader extends React.Component { } - - type ScrollSyncProps = any; - export class ScrollSync extends React.Component { } - - export module WindowScroller { - export type OnResizeArg = { - height: number; - } - export type OnScrollArg = { - scrollTop: number; - } - export type RenderCallbackArg = { - height: number; - scrollTop: number; - isScrolling: boolean; - } - export type Props = { - onScroll?: (arg: OnScrollArg) => void; - onResize?: (arg: OnResizeArg) => void; - // TODO `children` should be typed here - }; - } - export class WindowScroller extends React.Component { } +export interface ArrowKeyStepperProps { + children?: React.StatelessComponent<{ + onSectionRendered: Function, + scrollToColumn: number, + scrollToRow: number + }>; + className?: string; + columnCount: number; + rowCount: number; } +export class ArrowKeyStepper extends React.PureComponent { } + +export interface AutoSizerProps { + disableHeight?: boolean; + disableWidth?: boolean; + onResize?: (info: { height: number, width: number }) => any; +} +export class AutoSizer extends React.PureComponent { } + +export interface CellMeasurerProps { + cellRenderer: (info: { columnIndex: number, rowIndex: number }) => React.ReactNode; + cellSizeCache?: { + clearAllColumnWidths(): void; + clearAllRowHeights(): void; + clearColumnWidth(index: number): void; + clearRowHeight(index: number): void; + getColumnWidth(index: number): number; + getRowHeight(index: number): number; + hasColumnWidth(index: number): boolean; + hasRowHeight(index: number): boolean; + setColumnWidth(index: number, width: number): void; + setRowHeight(index: number, height: number): void; + }; + children?: React.StatelessComponent<{ + getColumnWidth: () => number, + getRowHeight: () => number, + resetMeasurements: () => any, + resetMeasurementsForColumn: (index: number) => any, + resetMeasurementsForRow: (index: number) => any, + }>; + columnCount: number; + container?: React.ReactType; + height?: number; + rowCount: number; + width?: number; +} +export class CellMeasurer extends React.PureComponent { } + +export type KeyMapper = ( + rowIndex: number, + columnIndex: number +) => any; +export type Map = { [key: string]: T }; +export type Cache = Map; +export type IndexParam = { + index: number +}; + +export type CellMeasurerCacheParams = { + defaultHeight?: number, + defaultWidth?: number, + fixedHeight?: boolean, + fixedWidth?: boolean, + minHeight?: number, + minWidth?: number, + keyMapper?: KeyMapper +} +export class CellMeasurerCache { + _cellHeightCache: Cache; + _cellWidthCache: Cache; + _columnWidthCache: Cache; + _defaultHeight?: number; + _defaultWidth?: number; + _minHeight?: number; + _minWidth?: number; + _keyMapper: KeyMapper; + _rowHeightCache: Cache; + _hasFixedHeight: boolean; + _hasFixedWidth: boolean; + constructor(params: CellMeasurerCacheParams); + clear( + rowIndex: number, + columnIndex: number + ): void; + clearAll(): void; + columnWidth: (params: IndexParam) => number | undefined; + hasFixedHeight(): boolean; + hasFixedWidth(): boolean; + getHeight( + rowIndex: number, + columnIndex: number + ): number | undefined; + getWidth( + rowIndex: number, + columnIndex: number + ): number | undefined; + has( + rowIndex: number, + columnIndex: number + ): boolean; + rowHeight: (params: IndexParam) => number | undefined; + set( + rowIndex: number, + columnIndex: number, + width: number, + height: number + ): void; + _updateCachedColumnAndRowSizes( + rowIndex: number, + columnIndex: number + ): void; +} + +export type CollectionCellSizeAndPosition = { height: number, width: number, x: number, y: number }; +export type CollectionCellSizeAndPositionGetter = (params: IndexParam) => CollectionCellSizeAndPosition; + +export type CollectionCellGroupRendererParams = { + cellSizeAndPositionGetter: CollectionCellSizeAndPositionGetter, + indices: number[], + cellRenderer: CollectionCellRenderer +} +export type CollectionCellGroupRenderer = (params: CollectionCellGroupRendererParams) => React.ReactNode[]; +export type CollectionCellRendererParams = { + index: number, + key: string, + style?: React.CSSProperties +} +export type CollectionCellRenderer = (params: CollectionCellRendererParams) => React.ReactNode; +export type CollectionProps = { + 'aria-label'?: string; + cellCount: number; + cellGroupRenderer?: CollectionCellGroupRenderer, + cellRenderer: CollectionCellRenderer, + cellSizeAndPositionGetter: CollectionCellSizeAndPositionGetter, + sectionSize?: number; +}; +export class Collection extends React.PureComponent { } + +export interface ColumnSizerProps { + children?: React.StatelessComponent<{ adjustedWidth: number, getColumnWidth: () => number, registerChild: any }>; + columnMaxWidth?: number; + columnMinWidth?: number; + columnCount?: number; + width: number; +} +export class ColumnSizer extends React.PureComponent { } + +export type CellDataGetterParams = { + columnData?: any, + dataKey: string, + rowData: any +}; +export type CellRendererParams = { + cellData?: any, + columnData?: any, + dataKey: string, + rowData: any, + rowIndex: number +}; +export type HeaderRendererParams = { + columnData?: any, + dataKey: string, + disableSort?: boolean, + label?: string, + sortBy?: string, + sortDirection?: SortDirectionType +}; +export type HeaderRowRendererParams = { + className: string, + columns: React.ReactNode[], + style: React.CSSProperties, + scrollbarWidth: number, + height: number, + width: number +}; +export type RowRendererParams = { + className: string, + columns: Array, + index: number, + isScrolling: boolean, + onRowClick?: Function, + onRowDoubleClick?: Function, + onRowMouseOver?: Function, + onRowMouseOut?: Function, + rowData: any, + style: any +}; + +export type TableCellDataGetter = (params: CellDataGetterParams) => any; +export type TableCellRenderer = (params: CellRendererParams) => React.ReactNode; +export type TableHeaderRenderer = (params: HeaderRendererParams) => React.ReactNode; +export type TableHeaderRowRenderer = (params: HeaderRowRendererParams) => React.ReactNode; +export type TableRowRenderer = (params: RowRendererParams) => React.ReactNode; + +// https://github.com/bvaughn/react-virtualized/blob/master/docs/Column.md +export interface ColumnProps { + cellDataGetter?: TableCellDataGetter; + cellRenderer?: TableCellRenderer; + className?: string; + columnData?: any; + dataKey: any; + disableSort?: boolean; + flexGrow?: number; + flexShrink?: number; + headerClassName?: string; + headerRenderer?: TableHeaderRenderer; + label?: string; + maxWidth?: number; + minWidth?: number; + style?: React.CSSProperties; + width: number; +} +export class Column extends React.Component { } + +// ref: https://github.com/bvaughn/react-virtualized/blob/master/docs/Table.md +export interface TableProps { + autoHeight?: boolean; + children?: React.ReactChildren; + className?: string; + disableHeader?: boolean; + estimatedRowSize?: number; + gridClassName?: string; + gridStyle?: any; + headerClassName?: string; + headerHeight: number; + headerStyle?: any; + height: number; + id?: string; + noRowsRender?: () => void; + onHeaderClick?: (dataKey: string, columnData: any) => void; + onRowClick?: (info: IndexParam) => void; + onRowDoubleClick?: (info: IndexParam) => void; + onRowMouseOut?: (info: IndexParam) => void; + onRowMouseOver?: (info: IndexParam) => void; + onRowsRendered?: (info: IndexParam) => void; + overscanRowCount?: number; + onScroll?: (info: { clientHeight: number, scrollHeight: number, scrollTop: number }) => void; + rowClassName?: string | ((info: IndexParam) => string); + rowCount: number; + rowGetter?: (info: IndexParam) => any; + rowHeight: number | ((info: IndexParam) => number); + rowRenderer?: TableRowRenderer; + headerRowRenderer?: TableHeaderRowRenderer; + rowStyle?: React.CSSProperties | ((info: IndexParam) => React.CSSProperties); + scrollToAlignment?: string; + scrollToIndex?: number; + scrollTop?: number; + sort?: (info: { sortBy: string, sortDirection: SortDirectionType }) => void; + sortBy?: string; + sortDirection?: SortDirectionType; + style?: React.CSSProperties; + tabIndex?: number; + width: number; +} +export class Table extends React.PureComponent { } + +export const defaultTableCellDataGetter: TableCellDataGetter; +export const defaultTableCellRenderer: TableCellRenderer; +export const defaultTableHeaderRenderer: () => React.ReactElement[]; +export const defaultTableHeaderRowRenderer: TableHeaderRowRenderer; +export const defaultTableRowRenderer: TableRowRenderer; + +interface ISortDirection { + /** + * Sort items in ascending order. + * This means arranging from the lowest value to the highest (e.g. a-z, 0-9). + */ + ASC: 'ASC', + + /** + * Sort items in descending order. + * This means arranging from the highest value to the lowest (e.g. z-a, 9-0). + */ + DESC: 'DESC' +} + +export const SortDirection: ISortDirection + +export type SortDirectionType = 'ASC' | 'DESC' + +export const SortIndicator: React.StatelessComponent<{ sortDirection: SortDirectionType }> + + +export type DefaultCellRangeRendererParams = { + cellCache: Object, + cellRenderer: Function, + columnSizeAndPositionManager: Object, + columnStartIndex: number, + columnStopIndex: number, + horizontalOffsetAdjustment: number, + isScrolling: boolean, + rowSizeAndPositionManager: Object, + rowStartIndex: number, + rowStopIndex: number, + scrollLeft: number, + scrollTop: number, + styleCache: Object, + verticalOffsetAdjustment: number, + visibleColumnIndices: Object, + visibleRowIndices: Object +}; +export function defaultCellRangeRenderer(params: DefaultCellRangeRendererParams): React.ReactElement; + + +export type GridCellRendererParams = { + columnIndex: number; + isScrolling: boolean; + isVisible: boolean; + key: string; + parent: Grid | List | Table; + rowIndex: number; + style: React.CSSProperties; +}; +export type GridCellRenderer = (params: GridCellRendererParams) => React.ReactNode; + +export type ConfigureParams = { + cellCount: number, + estimatedCellSize: number +}; +export type ContainerSizeAndOffset = { + containerSize: number, + offset: number +}; +export type SizeAndPositionData = { + offset: number, + size: number +}; +export type GetVisibleCellRangeParams = { + containerSize: number, + offset: number +}; +export type VisibleCellRange = { + start: number; + stop: number; +} + +export type CellSizeAndPositionManager = { + areOffsetsAdjusted(): boolean; + configure({ + cellCount, + estimatedCellSize + }: ConfigureParams): void; + getCellCount(): number; + getEstimatedCellSize(): number; + getLastMeasuredIndex(): number; + getOffsetAdjustment({ + containerSize, + offset // safe + }: ContainerSizeAndOffset): number; + /** + * This method returns the size and position for the cell at the specified index. + * It just-in-time calculates (or used cached values) for cells leading up to the index. + */ + getSizeAndPositionOfCell(index: number): SizeAndPositionData; + getSizeAndPositionOfLastMeasuredCell(): SizeAndPositionData; + /** + * Total size of all cells being measured. + * This value will be completedly estimated initially. + * As cells as measured the estimate will be updated. + */ + getTotalSize(): number; + /** + * Determines a new offset that ensures a certain cell is visible, given the current offset. + * If the cell is already visible then the current offset will be returned. + * If the current offset is too great or small, it will be adjusted just enough to ensure the specified index is visible. + * + * @param align Desired alignment within container; one of "auto" (default), "start", or "end" + * @param containerSize Size (width or height) of the container viewport + * @param currentOffset Container's current (x or y) offset + * @param totalSize Total size (width or height) of all cells + * @return Offset to use to ensure the specified cell is visible + */ + getUpdatedOffsetForIndex(params: { + align: string, + containerSize: number, + currentOffset: number, + targetIndex: number + }): number; + getVisibleCellRange(params: GetVisibleCellRangeParams): VisibleCellRange; + /** + * Clear all cached values for cells after the specified index. + * This method should be called for any cell that has changed its size. + * It will not immediately perform any calculations; they'll be performed the next time getSizeAndPositionOfCell() is called. + */ + resetCell(index: number): void +} + +export type GridCellRangeRendererParams = { + cellCache: Map, + cellRenderer: GridCellRenderer, + columnSizeAndPositionManager: CellSizeAndPositionManager, + columnStartIndex: number, + columnStopIndex: number, + isScrolling: boolean, + rowSizeAndPositionManager: CellSizeAndPositionManager, + rowStartIndex: number, + rowStopIndex: number, + scrollLeft: number, + scrollTop: number +} +export type GridCellRangeRenderer = (params: GridCellRangeRendererParams) => React.ReactNode[]; +// TODO add proper typing +export type GridProps = { + 'aria-label'?: string; + autoContainerWidth?: boolean; + autoHeight?: boolean; + cellRenderer: GridCellRenderer; + cellRangeRenderer?: GridCellRangeRenderer; + className?: string; + columnCount: number; + columnWidth: number | ((params: IndexParam) => number); + containerStyle?: React.CSSProperties; + deferredMeasurementCache?: Object; + estimatedColumnSize?: number; + estimatedRowSize?: number; + getScrollbarSize?: () => number; + height: number; + id?: string; + noContentRenderer?: () => React.ReactNode; + onScroll?: (params: { clientHeight: number, clientWidth: number, scrollHeight: number, scrollLeft: number, scrollTop: number, scrollWidth: number }) => any; + onSectionRendered?: (params: { columnStartIndex: number, columnStopIndex: number, rowStartIndex: number, rowStopIndex: number }) => any; + overscanColumnCount?: number; + overscanIndicesGetter?: (params: { + cellCount: number, + overscanCellsCount: number, + scrollDirection: number, + startIndex: number, + stopIndex: number + }) => { overscanStartIndex: number, overscanStopIndex: number }; + overscanRowCount?: number; + rowHeight: number | ((params: IndexParam) => number); + rowCount: number; + scrollingResetTimeInterval?: number; + scrollLeft?: number; + scrollToAlignment?: 'auto' | 'end' | 'start' | 'center'; + scrollToColumn?: number; + scrollTop?: number; + scrollToRow?: number; + style?: React.CSSProperties; + tabIndex?: number; + width: number; +}; +export class Grid extends React.PureComponent { } + +export type InfiniteLoaderProps = { + children?: React.StatelessComponent<{ + onRowsRendered: (params: { startIndex: number, stopIndex: number }) => void, + registerChild: (registeredChild: any) => void + }>; + isRowLoaded: (params: IndexParam) => boolean; + loadMoreRows: (params: { startIndex: number, stopIndex: number }) => Promise; + minimumBatchSize?: number; + rowCount?: number; + threshold?: number; +}; +export class InfiniteLoader extends React.PureComponent { } +export type ListRowRenderer = (params: GridCellRendererParams & { index: number, style: React.CSSProperties }) => React.ReactNode; +export interface ListProps { + className?: string; + autoHeight?: boolean; + estimatedRowSize?: number; + height: number; + noRowsRenderer?: Function; + onRowsRendered?: (info: { overscanStartIndex: number, overscanStopIndex: number, startIndex: number, stopIndex: number }) => void; + onScroll?: (info: { clientHeight: number, scrollHeight: number, scrollTop: number }) => void; + overscanRowCount?: number; + rowHeight: number | ((info: IndexParam) => number); + rowRenderer: ListRowRenderer; + rowCount: number; + scrollToAlignment?: string; + scrollToIndex?: number; + scrollTop?: number; + style?: React.CSSProperties; + tabIndex?: number; + width: number; +} +export class List extends React.PureComponent { } + +export interface MultiGridProps { + fixedColumnCount: number; + fixedRowCount: number; + style: React.CSSProperties; + styleBottomLeftGrid: React.CSSProperties; + styleBottomRightGrid: React.CSSProperties; + styleTopLeftGrid: React.CSSProperties; + styleTopRightGrid: React.CSSProperties; +} +export class MultiGrid extends React.PureComponent { } + +export type ScrollSyncProps = { + children?: React.StatelessComponent<{ + clientHeight: number, + clientWidth: number, + onScroll: (params: { clientHeight: number, clientWidth: number, scrollHeight: number, scrollLeft: number, scrollTop: number, scrollWidth: number }) => void, + scrollHeight: number, + scrollLeft: number, + scrollTop: number, + scrollWidth: number + }>; +}; +export class ScrollSync extends React.PureComponent { } +export type WindowScrollerRenderCallBackParams = { + height: number, + isScrolling: boolean, + scrollTop: number +}; + +export type WindowScrollerProps = { + children?: React.StatelessComponent; + onResize?: (prams: { height: number }) => void; + onScroll?: (params: { scrollTop: number }) => void; + scrollElement?: HTMLElement; +} +export class WindowScroller extends React.PureComponent { } diff --git a/react-virtualized/react-virtualized-tests.tsx b/react-virtualized/react-virtualized-tests.tsx index 7da7e26c88..1ab6654c18 100644 --- a/react-virtualized/react-virtualized-tests.tsx +++ b/react-virtualized/react-virtualized-tests.tsx @@ -1,17 +1,10 @@ -/// -/// -/// - import * as React from "react"; import * as ReactDOM from "react-dom"; import { Collection, - FlexTable, - FlexColumn, SortDirection, Grid, - VirtualScroll, ArrowKeyStepper, AutoSizer, CellMeasurer, @@ -19,6 +12,7 @@ import { InfiniteLoader, ScrollSync, WindowScroller, + WindowScrollerRenderCallBackParams, List, Column, Table, @@ -46,44 +40,8 @@ function CollectionTest() { x: datum.x, y: datum.y }; - } } - height={300} - width={300} - />, - document.getElementById("example") - ); -} - - -function FlexTableTest() { - const list = [ - { name: 'Brian Vaughn', description: 'Software engineer' } - // And so on... - ]; - - // Render your table - ReactDOM.render( - list[index] - } - > - - - , + }} + />, document.getElementById("example") ); } @@ -105,7 +63,7 @@ function GridTest() { columnCount={list[0].length} rowCount={list.length} cellRenderer={({ columnIndex, isScrolling, rowIndex }) => list[rowIndex][columnIndex]} - />, + />, document.getElementById('example') ); } @@ -113,7 +71,7 @@ function GridTest() { function ListTest() { // List data const list = [ - {name: 'Brian Vaughn', occupation: 'Software Engineer', location: 'San Jose, CA, 95125' /* ... */} + { name: 'Brian Vaughn', occupation: 'Software Engineer', location: 'San Jose, CA, 95125' /* ... */ } // And so on... ]; @@ -125,7 +83,7 @@ function ListTest() { rowHeight={30} rowCount={list.length} rowRenderer={({ index, isScrolling }) => list[index]} - />, + />, document.getElementById('example') ); } @@ -159,26 +117,6 @@ function TableTest() { ); } -function VirtualScrollTest() { - // List data as an array of strings - const list = [ - 'Brian Vaughn' - // And so on... - ]; - - // Render your list - ReactDOM.render( - list[index]} - />, - document.getElementById('example') - ); -} - function ArrowKeyStepperTest() { const columnCount = 12; const rowCount = 3; @@ -187,13 +125,18 @@ function ArrowKeyStepperTest() { {({ onSectionRendered, scrollToColumn, scrollToRow }) => ( null} columnCount={columnCount} onSectionRendered={onSectionRendered} rowCount={rowCount} scrollToColumn={scrollToColumn} scrollToRow={scrollToRow} - /> - ) } + /> + )} , document.getElementById('example') ); @@ -205,21 +148,46 @@ function AutoSizerTest() { 'Brian Vaughn' // And so on... ]; + const _rowRenderer = ({ index, key, style }) => { + + const row = list[index]; + + return ( +
    + {row} +
    + ) + } // Render your list ReactDOM.render( - {({ height, width }) => ( - ( + list[index] // Could also be a DOM element - } - /> - ) } + rowHeight={30} + rowRenderer={({ index, key, style }) => { + const row = list[index]; + + return ( +
    + {row} +
    + ) + }} + width={width} + /> + )}
    , document.getElementById('example') ); @@ -239,7 +207,7 @@ function CellMeasurerTest() { columnCount={columnCount} height={fixedRowHeight} rowCount={rowCount} - > + > {({ getColumnWidth }) => ( - ) } + /> + )} , document.getElementById('example') ); @@ -263,7 +231,7 @@ function ColumnSizerTest() { columnMinWidth={50} columnCount={12} width={120} - > + > {({ adjustedWidth, getColumnWidth, registerChild }) => ( - ) } + /> + )} , document.getElementById('example') ); @@ -288,75 +256,273 @@ function InfiniteLoaderTest() { return !!list[index]; } - function loadMoreRows({ startIndex, stopIndex }) { - return list.push('test'); + function loadMoreRows({ startIndex, stopIndex }: { startIndex: number, stopIndex: number }) { + return new Promise(resolve => resolve(list.push('test'))); } + function rowRenderer({ index, key, style }) { + const content = list[index]; + + return ( +
    + {content} +
    + ) + } + + // Render your list ReactDOM.render( + > {({ onRowsRendered, registerChild }) => ( - list[index] // Could also be a DOM element - } - /> - ) } + + {({ width }) => ( + + )} + + )} , document.getElementById('example') ); } function ScrollSyncTest() { + function hexToRgb(hex) { + const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex) + return result ? { + r: parseInt(result[1], 16), + g: parseInt(result[2], 16), + b: parseInt(result[3], 16) + } : null + } + + const LEFT_COLOR_FROM = hexToRgb('#471061') + const LEFT_COLOR_TO = hexToRgb('#BC3959') + const TOP_COLOR_FROM = hexToRgb('#000000') + const TOP_COLOR_TO = hexToRgb('#333333') + const columnWidth = 20; + const rowHeight = 10; + const overscanColumnCount = 10; + const overscanRowCount = 10; + const height = 10; + const rowCount = 100; + const columnCount = 100; + + + function mixColors(color1, color2, amount) { + const weight1 = amount + const weight2 = 1 - amount + + const r = Math.round(weight1 * color1.r + weight2 * color2.r) + const g = Math.round(weight1 * color1.g + weight2 * color2.g) + const b = Math.round(weight1 * color1.b + weight2 * color2.b) + + return { r, g, b } + }; + + function renderLeftHeaderCell({ columnIndex, key, rowIndex, style }) { + return ( +
    + {`C${columnIndex}`} +
    + ) + }; + function renderLeftSideCell({ columnIndex, key, rowIndex, style }) { + const rowClass = rowIndex % 2 === 0 + ? columnIndex % 2 === 0 ? 'styles.evenRow' : 'styles.oddRow' + : columnIndex % 2 !== 0 ? 'styles.evenRow' : 'styles.oddRow' + const classNames = [rowClass, 'styles.cell'].join(' ') + + return ( +
    + {`R${rowIndex}, C${columnIndex}`} +
    + ) + }; + + function renderHeaderCell({ columnIndex, key, rowIndex, style }) { + if (columnIndex < 1) { + return + } + + return renderLeftHeaderCell({ columnIndex, key, rowIndex, style }) + }; + + function renderBodyCell({ columnIndex, key, rowIndex, style }) { + if (columnIndex < 1) { + return + } + + return renderLeftSideCell({ columnIndex, key, rowIndex, style }) + } + return ( - {({ clientHeight, clientWidth, onScroll, scrollHeight, scrollLeft, scrollTop, scrollWidth }) => ( -
    -
    - "test"} - rowCount={42} - height={12} - width={12} - rowHeight={120} - scrollTop={scrollTop}/> - /> + {({ clientHeight, clientWidth, onScroll, scrollHeight, scrollLeft, scrollTop, scrollWidth }) => { + const x = scrollLeft / (scrollWidth - clientWidth) + const y = scrollTop / (scrollHeight - clientHeight) + + const leftBackgroundColor = mixColors(LEFT_COLOR_FROM, LEFT_COLOR_TO, y) + const leftColor = '#ffffff' + const topBackgroundColor = mixColors(TOP_COLOR_FROM, TOP_COLOR_TO, x) + const topColor = '#ffffff' + const middleBackgroundColor = mixColors(leftBackgroundColor, topBackgroundColor, 0.5) + const middleColor = '#ffffff' + + return ( +
    +
    + +
    +
    + +
    +
    + + {({ width }) => ( +
    +
    + +
    +
    + +
    +
    + )} +
    +
    -
    - -
    -
    - ) } + ) + }} ); } function WindowScrollerTest() { - const onScroll = function({scrollTop}: WindowScroller.OnScrollArg) {}; - const onResize = function({height}: WindowScroller.OnResizeArg) {}; + const onScroll = function ({scrollTop}: { scrollTop: number }) { }; + const onResize = function ({height}: { height: number }) { }; + const list = [ + { name: 'Brian Vaughn', description: 'Software engineer' } + // And so on... + ]; ReactDOM.render( - {({ height, isScrolling, scrollTop }: WindowScroller.RenderCallbackArg) => ( - 'test'} - scrollTop={scrollTop} - width={120}/> - ) } + {({ height, isScrolling, scrollTop }) => ( + + {({ width }) => ( + list[index].name} + scrollTop={scrollTop} + width={width} + /> + )} + + )} , document.getElementById('example') ); From 7b9040fa32df72a37aad8b3c3252da7815b97489 Mon Sep 17 00:00:00 2001 From: Dan Foley Date: Fri, 10 Mar 2017 06:45:12 +0000 Subject: [PATCH 467/797] react-big-calendar - Including missing props for the Calendar component. (#14937) * Including missing props for the Calendar component. * Updated the test to reflect the changes to the d.ts * Updating the version. --- react-big-calendar/index.d.ts | 12 +++++++----- react-big-calendar/react-big-calendar-tests.tsx | 10 ++++++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/react-big-calendar/index.d.ts b/react-big-calendar/index.d.ts index c55a3c126c..75508cae5e 100644 --- a/react-big-calendar/index.d.ts +++ b/react-big-calendar/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-big-calendar 0.11 +// Type definitions for react-big-calendar 0.12.3 // Project: https://github.com/intljusticemission/react-big-calendar // Definitions by: Piotr Witek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -26,10 +26,10 @@ declare module 'react-big-calendar' { step?: number; rtl?: boolean; eventPropGetter?: (event: Object, start: stringOrDate, end: stringOrDate, isSelected: boolean) => void; - titleAccessor?: string; - allDayAccessor?: boolean; - startAccessor?: stringOrDate; - endAccessor?: stringOrDate; + titleAccessor?: string | ((row: Object) => string); + allDayAccessor?: string | ((row: Object) => boolean); + startAccessor?: string | ((row: Object) => Date); + endAccessor?: string | ((row: Object) => Date); min?: stringOrDate; max?: stringOrDate; scrollToTime?: stringOrDate; @@ -38,6 +38,8 @@ declare module 'react-big-calendar' { messages?: Object; timeslots?: number; defaultView?: string; + className?: string; + elementProps?: React.HTMLAttributes; } class BigCalendar extends React.Component { diff --git a/react-big-calendar/react-big-calendar-tests.tsx b/react-big-calendar/react-big-calendar-tests.tsx index 9e492462ae..2ca939c0a6 100644 --- a/react-big-calendar/react-big-calendar-tests.tsx +++ b/react-big-calendar/react-big-calendar-tests.tsx @@ -58,10 +58,10 @@ const FullAPIExample = React.createClass({ step={20} rtl={true} eventPropGetter={(event, start, end, isSelected) => { } } - titleAccessor={'string'} - allDayAccessor={true} - startAccessor={new Date()} - endAccessor={new Date()} + titleAccessor={'title'} + allDayAccessor={(row:any) => !!row.allDay} + startAccessor={'start'} + endAccessor={(row:any) => row.end || row.start} min={new Date()} max={new Date()} scrollToTime={new Date()} @@ -70,6 +70,8 @@ const FullAPIExample = React.createClass({ messages={{}} timeslots={24} defaultView={'month'} + className={'my-calendar'} + elementProps={{id: 'myCalendar'}} /> ); } From 1177bba21505bd8b68235c212fced6b087878c93 Mon Sep 17 00:00:00 2001 From: nrdstrm Date: Fri, 10 Mar 2017 07:45:47 +0100 Subject: [PATCH 468/797] Add property `autoload` to `ReactAsyncSelectProps`. (#14936) --- react-select/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/react-select/index.d.ts b/react-select/index.d.ts index 5393888f3b..c011b78e0e 100644 --- a/react-select/index.d.ts +++ b/react-select/index.d.ts @@ -397,6 +397,11 @@ declare namespace ReactSelectClass { export interface ReactAsyncSelectProps extends ReactSelectProps { + /** + * Whether to auto-load the default async options set. + */ + autoload?: boolean; + /** * object to use to cache results; can be null to disable cache */ From 68f87621d2c73b4f2c376071cd1683d6e9c307da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn?= Date: Fri, 10 Mar 2017 07:46:14 +0100 Subject: [PATCH 469/797] Update optics agent to 1.1 (#14935) --- optics-agent/index.d.ts | 11 ++++++++++- optics-agent/optics-agent-tests.ts | 8 +++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/optics-agent/index.d.ts b/optics-agent/index.d.ts index ba1e930739..4d27ac71ae 100644 --- a/optics-agent/index.d.ts +++ b/optics-agent/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for optics-agent 1.0 +// Type definitions for optics-agent 1.1 // Project: https://github.com/apollostack/optics-agent-js#readme // Definitions by: Crevil // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,6 +6,7 @@ import { GraphQLSchema } from "graphql"; import { Request, Response } from "express"; import { Server } from "hapi"; +import { Context } from "koa"; export interface Options { /** @@ -57,6 +58,11 @@ export interface Options { * Send the query variables along with traces. Defaults to true. */ reportVariables?: boolean; + + /** + * Send statistics when the process exits. Defaults to true. + */ + shutdownGracefully?: boolean; } export class Agent { @@ -64,6 +70,7 @@ export class Agent { configureAgent(options: Options): Agent; instrumentSchema(schema: GraphQLSchema): void; + koaMiddleware(): (context: Context, next: () => Promise) => void; middleware(): (req: Request, res: Response, next?: any) => void; instrumentHapiServer(server: Server): void; context(req: Request): any; @@ -71,6 +78,7 @@ export class Agent { export function configureAgent(options: Options): Agent; export function instrumentSchema(schema: GraphQLSchema): void; +export function koaMiddleware(): (context: Context, next: () => Promise) => void; export function middleware(): (req: Request, res: Response, next?: any) => void; export function instrumentHapiServer(server: Server): void; export function context(req: Request): any; @@ -78,6 +86,7 @@ export function context(req: Request): any; export default { configureAgent, instrumentSchema, + koaMiddleware, middleware, instrumentHapiServer, context, diff --git a/optics-agent/optics-agent-tests.ts b/optics-agent/optics-agent-tests.ts index 758b374efa..cb4cb60051 100644 --- a/optics-agent/optics-agent-tests.ts +++ b/optics-agent/optics-agent-tests.ts @@ -4,12 +4,14 @@ import OpticsAgent, { middleware, instrumentHapiServer, context, + Options, } from 'optics-agent'; import { GraphQLSchema } from 'graphql'; import * as express from 'express'; import * as hapi from 'hapi'; +import * as KoaServer from 'koa'; -const configOptions = { +const configOptions: Options = { apiKey: "", reportTraces: false, reportVariables: false, @@ -18,6 +20,7 @@ const configOptions = { endpointUrl: "", proxyUrl: "", reportIntervalMs: 1, + shutdownGracefully: false, }; OpticsAgent.configureAgent(configOptions); @@ -27,6 +30,9 @@ expressServer.use(OpticsAgent.middleware()); const hapiServer = new hapi.Server(); OpticsAgent.instrumentHapiServer(hapiServer); +const koaServer = new KoaServer(); +koaServer.use(OpticsAgent.koaMiddleware()); + const req = {} as express.Request; OpticsAgent.context(req); From fe0272f2003be421710f57f017c5f47c5dbaa8ac Mon Sep 17 00:00:00 2001 From: Stefan Dobrev Date: Fri, 10 Mar 2017 08:47:11 +0200 Subject: [PATCH 470/797] [react-native] Update TextInput onChange (#14933) Add missing properties for `TextInput`'s `onChange` callback. You can find more information about them in this source code: https://github.com/facebook/react-native/blob/481f560f64806ba3324cf722d6bf8c3f36ac74a5/Libraries/Text/RCTTextView.m#L464-L469 --- react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react-native/index.d.ts b/react-native/index.d.ts index d18d311fa3..0330d39a90 100644 --- a/react-native/index.d.ts +++ b/react-native/index.d.ts @@ -1098,7 +1098,7 @@ declare module "react" { /** * Callback that is called when the text input's text changes. */ - onChange?: (event: { nativeEvent: { text: string } }) => void + onChange?: (event: { nativeEvent: { text: string, contentSize: { width: number, height: number }, target: number, eventCount: number } }) => void /** * Callback that is called when the text input's text changes. From 63fb2e895a01bf3d9d2e2546a83d96f906e66a71 Mon Sep 17 00:00:00 2001 From: Michael Mrowetz Date: Fri, 10 Mar 2017 15:48:39 +0900 Subject: [PATCH 471/797] add har-format - typings for HAR files (#14932) * Add type definition for `HAR` - HTTP Archive 1.2 * fix formating --- har-format/har-format-tests.ts | 101 ++++ har-format/index.d.ts | 811 +++++++++++++++++++++++++++++++++ har-format/tsconfig.json | 22 + har-format/tslint.json | 1 + 4 files changed, 935 insertions(+) create mode 100644 har-format/har-format-tests.ts create mode 100644 har-format/index.d.ts create mode 100644 har-format/tsconfig.json create mode 100644 har-format/tslint.json diff --git a/har-format/har-format-tests.ts b/har-format/har-format-tests.ts new file mode 100644 index 0000000000..9a226d150c --- /dev/null +++ b/har-format/har-format-tests.ts @@ -0,0 +1,101 @@ +import * as harFormat from "har-format"; + +const testCreator: harFormat.Creator = { + name: "WebInspector", + version: "537.36" +}; + +const testPageTiming: harFormat.PageTiming = { + onContentLoad: 1995.6460000003062, + onLoad: 4262.566999999763 +}; + +const testPage: harFormat.Page = { + startedDateTime: "2017-02-11T09:36:22.868Z", + id: "page_1", + title: "https://github.com/", + pageTimings: testPageTiming +}; + +const testHeader: harFormat.Header = { + name: "Accept", + value: "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8" +}; + +const testRequest: harFormat.Request = { + method: "GET", + url: "https://github.com/", + httpVersion: "HTTP/1.1", + headers: [testHeader], + queryString: [], + cookies: [], + headersSize: 425, + bodySize: 0 +}; + +const testHeaders: harFormat.Header = { + name: "Content-Encoding", + value: "gzip" +}; + +const testCookie: harFormat.Cookie = { + name: "logged_in", + value: "no", + path: "/", + domain: ".github.com", + expires: "2037-02-11T09:36:23.000Z", + httpOnly: true, + secure: true +}; + +const testContent: harFormat.Content = { + size: 26915, + mimeType: "text/html", + compression: 18635 +}; + +const testResponse: harFormat.Response = { + status: 200, + statusText: "OK", + httpVersion: "HTTP/1.1", + headers: [testHeaders], + cookies: [testCookie], + content: testContent, + redirectURL: "", + headersSize: 2084, + bodySize: 8280, + _transferSize: 10364 +}; + +const testTimings: harFormat.Timings = { + blocked: 0.439999999798602, + dns: 39.6150000005946, + connect: 483.8799999997718, + send: 0.06899999971199122, + wait: 287.516999999753, + receive: 5.289000000629585, + ssl: 244.02999999983808 +}; + +const testEntry: harFormat.Entry = { + startedDateTime: "2017-02-11T09:36:22.868Z", + time: 816.8100000002596, + request: testRequest, + response: testResponse, + cache: {}, + timings: testTimings, + serverIPAddress: "192.30.253.113", + connection: "26487", + pageref: "page_1" +}; + +const testLog: harFormat.Log = { + version: "1.2", + creator: testCreator, + pages: [testPage], + entries: [testEntry] +}; + +const harFile: harFormat.Har = { + log: testLog +}; diff --git a/har-format/index.d.ts b/har-format/index.d.ts new file mode 100644 index 0000000000..7aaf479891 --- /dev/null +++ b/har-format/index.d.ts @@ -0,0 +1,811 @@ +// Type definitions for HAR 1.2 +// Project: https://w3c.github.io/web-performance/specs/HAR/Overview.html +// Definitions by: Michael Mrowetz +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +/** + * HTTP Archive 1.2 + * + * http://www.softwareishard.com/blog/har-12-spec + */ +export interface Har { + /** This object represents the root of exported data. */ + "log": Log; +} +/** + * This object (`log`) represents the root of exported data. + * + * http://www.softwareishard.com/blog/har-12-spec/#log + */ +export interface Log { + /** + * Version number of the format. + * + * _If empty, string "1.1" is assumed by default._ + */ + version: string; + /** Name and version info of the log creator application. */ + creator: Creator; + /** Name and version info of used browser. */ + browser?: Browser; + /** + * List of all exported (tracked) pages. + * + * _Leave out this field if the application + * does not support grouping by pages._ + * + * There is one `` object for every exported web page and one + * `` object for every HTTP request. + * In case when an HTTP trace tool isn't able to group requests by a page, + * the `` object is empty and individual requests doesn't have a + * parent page. + */ + pages?: Page[]; + /** List of all exported (tracked) requests. */ + entries: Entry[]; + /** A comment provided by the user or the application. */ + comment?: string; +} +/** + * Infos about application/browser used to export the log. + * + * `Creator` and `Browser` objects share the same structure. + * + * http://www.softwareishard.com/blog/har-12-spec/#creator + */ +export interface Creator { + /** Name of the application/browser used to export the log. */ + name: string; + /** Version of the application/browser used to export the log. */ + version: string; + /** A comment provided by the user or the application. */ + comment?: string; +} +/** + * Infos about application/browser used to export the log. + * + * `Browser` and `Creator` objects share the same structure. + * + * http://www.softwareishard.com/blog/har-12-spec/#browser + */ +export interface Browser { + /** Name of the application/browser used to export the log. */ + name: string; + /** Version of the application/browser used to export the log. */ + version: string; + /** A comment provided by the user or the application. */ + comment?: string; +} +/** + * This object represents list of exported pages. + * + * http://www.softwareishard.com/blog/har-12-spec/#pages + */ +export interface Page { + /** Date and time stamp for the beginning of the page load + * + * (ISO 8601 - `YYYY-MM-DDThh:mm:ss.sTZD`, + * e.g. `2009-07-24T19:20:30.45+01:00`). + */ + startedDateTime: string; + /** + * Unique identifier of a page within the `` (HAR doc). + * Entries use it to refer the parent page. + */ + id: string; + /** Page title. */ + title: string; + /** Detailed timing info about page load */ + pageTimings: PageTiming; + /** A comment provided by the user or the application */ + comment?: string; + /** _non-standard_ */ + /** _non-standard_ */ + _adult_site?: number; + /** _non-standard_ */ + _aft?: number; + /** _non-standard_ */ + _base_page_cdn?: string; + /** _non-standard_ */ + _base_page_redirects?: number; + /** _non-standard_ */ + _base_page_ttfb?: number; + /** _non-standard_ */ + _browser_main_memory_kb?: number; + /** _non-standard_ */ + _browser_name?: string; + /** _non-standard_ */ + _browser_other_private_memory_kb?: number; + /** _non-standard_ */ + _browser_process_count?: number; + /** _non-standard_ */ + _browser_version?: string; + /** _non-standard_ */ + _browser_working_set_kb?: number; + /** _non-standard_ */ + _bytesIn?: number; + /** _non-standard_ */ + _bytesInDoc?: number; + /** _non-standard_ */ + _bytesOut?: number; + /** _non-standard_ */ + _bytesOutDoc?: number; + /** _non-standard_ */ + _cached?: number; + /** _non-standard_ */ + _certificate_bytes?: number; + /** _non-standard_ */ + _connections?: number; + /** _non-standard_ */ + _date?: number; + /** _non-standard_ */ + _docCPUms?: number; + /** _non-standard_ */ + _docCPUpct?: number; + /** _non-standard_ */ + _docTime?: number; + /** _non-standard_ */ + _domContentLoadedEventEnd?: number; + /** _non-standard_ */ + _domContentLoadedEventStart?: number; + /** _non-standard_ */ + _domElements?: number; + /** _non-standard_ */ + _domInteractive?: number; + /** _non-standard_ */ + _domLoading?: number; + /** _non-standard_ */ + _domTime?: number; + /** _non-standard_ */ + _effectiveBps?: number; + /** _non-standard_ */ + _effectiveBpsDoc?: number; + /** _non-standard_ */ + _eventName?: string; + /** _non-standard_ */ + _firstPaint?: number; + /** _non-standard_ */ + _fixed_viewport?: number; + /** _non-standard_ */ + _fullyLoaded?: number; + /** _non-standard_ */ + _fullyLoadedCPUms?: number; + /** _non-standard_ */ + _fullyLoadedCPUpct?: number; + /** _non-standard_ */ + _gzip_savings?: number; + /** _non-standard_ */ + _gzip_total?: number; + /** _non-standard_ */ + _image_savings?: number; + /** _non-standard_ */ + _image_total?: number; + /** _non-standard_ */ + _isResponsive?: number; + /** _non-standard_ */ + _lastVisualChange?: number; + /** _non-standard_ */ + _loadEventEnd?: number; + /** _non-standard_ */ + _loadEventStart?: number; + /** _non-standard_ */ + _loadTime?: number; + /** _non-standard_ */ + _minify_savings?: number; + /** _non-standard_ */ + _minify_total?: number; + /** _non-standard_ */ + _optimization_checked?: number; + /** _non-standard_ */ + _pageSpeedVersion?: string; + /** _non-standard_ */ + _render?: number; + /** _non-standard_ */ + _requests?: number; + /** _non-standard_ */ + _requestsDoc?: number; + /** _non-standard_ */ + _requestsFull?: number; + /** _non-standard_ */ + _responses_200?: number; + /** _non-standard_ */ + _responses_404?: number; + /** _non-standard_ */ + _responses_other?: number; + /** _non-standard_ */ + _result?: number; + /** _non-standard_ */ + _run?: number; + /** _non-standard_ */ + _score_cache?: number; + /** _non-standard_ */ + _score_cdn?: number; + /** _non-standard_ */ + _score_combine?: number; + /** _non-standard_ */ + _score_compress?: number; + /** _non-standard_ */ + _score_cookies?: number; + /** _non-standard_ */ + _score_etags?: number; + /** _non-standard_ */ + _score_gzip?: number; + /** _non-standard_ */ + "_score_keep-alive"?: number; + /** _non-standard_ */ + _score_minify?: number; + /** _non-standard_ */ + _score_progressive_jpeg?: number; + /** _non-standard_ */ + _server_count?: number; + /** _non-standard_ */ + _server_rtt?: number; + /** _non-standard_ */ + _SpeedIndex?: number; + /** _non-standard_ */ + _step?: number; + /** _non-standard_ */ + _title?: string; + /** _non-standard_ */ + _titleTime?: number; + /** _non-standard_ */ + _TTFB?: number; + /** _non-standard_ */ + _URL?: string; + /** _non-standard_ */ + _visualComplete?: number; +} +/** + * This object describes timings for various events (states) fired during the + * page load. + * + * All times are specified in milliseconds. + * + * If a time info is not available appropriate field is set to `-1`. + * + * http://www.softwareishard.com/blog/har-12-spec/#pageTimings + */ +export interface PageTiming { + /** Content of the page loaded. Number of milliseconds since page load + * started (`page.startedDateTime`). + * + * Use `-1` if the timing does not apply to the current request. + */ + onContentLoad?: number; + /** Page is loaded (`onLoad` event fired). Number of milliseconds since + * page load started (`page.startedDateTime`). + * + * Use `-1` if the timing does not apply to the current request. + */ + onLoad?: number; + /** A comment provided by the user or the application */ + comment?: string; + _startRender?: number; +} +/** + * This object represents an array with all exported HTTP requests. Sorting + * entries by `startedDateTime` (starting from the oldest) is preferred way how + * to export data since it can make importing faster. + * However the reader application should always make sure the array is sorted + * (if required for the import). + * + * http://www.softwareishard.com/blog/har-12-spec/#entries + */ +export interface Entry { + /** + * Reference to the parent page. Leave out this field if the application + * does not support grouping by pages. + */ + pageref?: string; + /** + * Date and time stamp of the request start + * + * (ISO 8601 - `YYYY-MM-DDThh:mm:ss.sTZD`). + */ + startedDateTime: string; + /** + * Total elapsed time of the request in milliseconds. + * + * This is the sum of all timings available in the timings object + * (i.e. not including `-1` values). + */ + time: number; + /** Detailed info about the request. */ + request: Request; + /** Detailed info about the response. */ + response: Response; + /** Info about cache usage. */ + cache: Cache; + /** Detailed timing info about request/response round trip. */ + timings: Timings; + /** + * IP address of the server that was connected + * (result of DNS resolution). + */ + serverIPAddress?: string; + /** + * Unique ID of the parent TCP/IP connection, can be the client or server + * port number. + * + * Note that a port number doesn't have to be unique identifier + * in cases where the port is shared for more connections. + * + * If the port isn't available for the application, any other unique + * connection ID can be used instead (e.g. connection index). Leave out + * this field if the application doesn't support this info. + */ + connection?: string; + /** A comment provided by the user or the application */ + comment?: string; + /** _non-standard_ */ + _all_end?: number | string; + /** _non-standard_ */ + _all_ms?: number | string; + /** _non-standard_ */ + _all_start?: number | string; + /** _non-standard_ */ + _bytesIn?: number | string; + /** _non-standard_ */ + _bytesOut?: number | string; + /** _non-standard_ */ + _cacheControl?: string; + /** _non-standard_ */ + _cache_time?: number | string; + /** _non-standard_ */ + _cdn_provider?: string; + /** _non-standard_ */ + _certificate_bytes?: number | string; + /** _non-standard_ */ + _client_port?: number | string; + /** _non-standard_ */ + _connect_end?: number | string; + /** _non-standard_ */ + _connect_ms?: number | string; + /** _non-standard_ */ + _connect_start?: number | string; + /** _non-standard_ */ + _contentEncoding?: string; + /** _non-standard_ */ + _contentType?: string; + /** _non-standard_ */ + _dns_end?: number | string; + /** _non-standard_ */ + _dns_ms?: number | string; + /** _non-standard_ */ + _dns_start?: number | string; + /** _non-standard_ */ + _download_end?: number | string; + /** _non-standard_ */ + _download_ms?: number | string; + /** _non-standard_ */ + _download_start?: number | string; + /** _non-standard_ */ + _expires?: string; + /** _non-standard_ */ + _full_url?: string; + /** _non-standard_ */ + _gzip_save?: number | string; + /** _non-standard_ */ + _gzip_total?: number | string; + /** _non-standard_ */ + _host?: string; + /** _non-standard_ */ + _http2_stream_dependency?: number | string; + /** _non-standard_ */ + _http2_stream_exclusive?: number | string; + /** _non-standard_ */ + _http2_stream_id?: number | string; + /** _non-standard_ */ + _http2_stream_weight?: number | string; + /** _non-standard_ */ + _image_save?: number | string; + /** _non-standard_ */ + _image_total?: number | string; + /** _non-standard_ */ + _index?: number; + /** _non-standard_ */ + _initiator?: string; + /** _non-standard_ */ + _initiator_column?: string; + /** _non-standard_ */ + _initiator_detail?: string; + /** _non-standard_ */ + _initiator_function?: string; + /** _non-standard_ */ + _initiator_line?: string; + /** _non-standard_ */ + _initiator_type?: string; + /** _non-standard_ */ + _ip_addr?: string; + /** _non-standard_ */ + _is_secure?: number | string; + /** _non-standard_ */ + _jpeg_scan_count?: number | string; + /** _non-standard_ */ + _load_end?: number | string; + /** _non-standard_ */ + _load_ms?: number | string; + /** _non-standard_ */ + _load_start?: number | string; + /** _non-standard_ */ + _method?: string; + /** _non-standard_ */ + _minify_save?: number | string; + /** _non-standard_ */ + _minify_total?: number | string; + /** _non-standard_ */ + _number?: number; + /** _non-standard_ */ + _objectSize?: number | string; + /** _non-standard_ */ + _objectSizeUncompressed?: number | string; + /** _non-standard_ */ + _priority?: string; + /** _non-standard_ */ + _protocol?: number | string; + /** _non-standard_ */ + _request_id?: number | string; + /** _non-standard_ */ + _responseCode?: number | string; + /** _non-standard_ */ + _score_cache?: number | string; + /** _non-standard_ */ + _score_cdn?: number | string; + /** _non-standard_ */ + _score_combine?: number | string; + /** _non-standard_ */ + _score_compress?: number | string; + /** _non-standard_ */ + _score_cookies?: number | string; + /** _non-standard_ */ + _score_etags?: number | string; + /** _non-standard_ */ + _score_gzip?: number | string; + /** _non-standard_ */ + "_score_keep-alive"?: number | string; + /** _non-standard_ */ + _score_minify?: number | string; + /** _non-standard_ */ + _score_progressive_jpeg?: number; + /** _non-standard_ */ + _server_count?: number | string; + /** _non-standard_ */ + _server_rtt?: number | string; + /** _non-standard_ */ + _socket?: number | string; + /** _non-standard_ */ + _ssl_end?: number | string; + /** _non-standard_ */ + _ssl_ms?: number | string; + /** _non-standard_ */ + _ssl_start?: number | string; + /** _non-standard_ */ + _ttfb_end?: number | string; + /** _non-standard_ */ + _ttfb_ms?: number | string; + /** _non-standard_ */ + _ttfb_start?: number | string; + /** _non-standard_ */ + _type?: number | string; + /** _non-standard_ */ + _url?: string; + /** _non-standard_ */ + _was_pushed?: number | string; + /** _non-standard_ */ + _initialPriority?: string; +} +/** + * This object contains detailed info about performed request. + * + * http://www.softwareishard.com/blog/har-12-spec/#request + */ +export interface Request { + /** Request method (`GET`, `POST`, ...). */ + method: string; + /** Absolute URL of the request (fragments are not included). */ + url: string; + /** Request HTTP Version. */ + httpVersion: string; + /** List of cookie objects. */ + cookies: Cookie[]; + /** List of header objects. */ + headers: Header[]; + /** List of query parameter objects. */ + queryString: QueryString[]; + /** Posted data info. */ + postData?: PostData; + /** + * Total number of bytes from the start of the HTTP request message until + * (and including) the double CRLF before the body. + * + * Set to `-1` if the info is not available. + */ + headersSize: number; + /** + * Size of the request body (POST data payload) in bytes. + * + * Set to `-1` if the info is not available. + */ + bodySize: number; + /** A comment provided by the user or the application */ + comment?: string; +} +/** + * This object contains detailed info about the response. + * + * http://www.softwareishard.com/blog/har-12-spec/#response + */ +export interface Response { + /** Response status. */ + status: number; + /** Response status description. */ + statusText: string; + /** Response HTTP Version. */ + httpVersion: string; + /** List of cookie objects. */ + cookies: Cookie[]; + /** List of header objects. */ + headers: Header[]; + /** Details about the response body. */ + content: Content; + /** Redirection target URL from the Location response header. */ + redirectURL: string; + /** + * Total number of bytes from the start of the HTTP response message until + * (and including) the double CRLF before the body. + * + * Set to `-1` if the info is not available. + * + * _The size of received response-headers is computed only from headers + * that are really received from the server. Additional headers appended by + * the browser are not included in this number, but they appear in the list + * of header objects._ + */ + headersSize: number; + /** Size of the received response body in bytes. + * + * - Set to zero in case of responses coming from the cache (`304`). + * - Set to `-1` if the info is not available. + */ + bodySize: number; + /** A comment provided by the user or the application */ + comment?: string; + /** _non-standard_ */ + _transferSize?: number; +} +/** + * This object contains list of all cookies (used in `request` and `response` + * objects). + * + * http://www.softwareishard.com/blog/har-12-spec/#cookies + */ +export interface Cookie { + /** The name of the cookie. */ + name: string; + /** The cookie value. */ + value: string; + /** The path pertaining to the cookie. */ + path?: string; + /** The host of the cookie. */ + domain?: string; + /** + * Cookie expiration time. + * (ISO 8601 - `YYYY-MM-DDThh:mm:ss.sTZD`, + * e.g. `2009-07-24T19:20:30.123+02:00`). + */ + expires?: string | Date | null; + /** Set to true if the cookie is HTTP only, false otherwise. */ + httpOnly?: boolean; + /** True if the cookie was transmitted over ssl, false otherwise. */ + secure?: boolean; + /** A comment provided by the user or the application */ + comment?: string; +} + +/** + * This object represents a headers (used in `request` and `response` objects). + * + * http://www.softwareishard.com/blog/har-12-spec/#headers + */ +export interface Header { + name: string; + value: string; + /** A comment provided by the user or the application */ + comment?: string; +} +/** + * This object represents a parameter & value parsed from a query string, + * if any (embedded in `request` object). + * + * http://www.softwareishard.com/blog/har-12-spec/#queryString + */ +export interface QueryString { + name: string; + value: string; + /** A comment provided by the user or the application */ + comment?: string; +} +/** + * This object describes posted data, if any (embedded in `request` object). + * + * http://www.softwareishard.com/blog/har-12-spec/#postData + */ +export interface PostData { + /** Mime type of posted data. */ + mimeType: string; + /** List of posted parameters (in case of URL encoded parameters). + * + * _`text` and `params` fields are mutually exclusive._ + */ + params: Param[]; + /** Plain text posted data + * + * _`params` and `text` fields are mutually exclusive._ + */ + text: string; + /** A comment provided by the user or the application */ + comment?: string; +} +/** + * List of posted parameters, if any (embedded in `postData` object). + * + * http://www.softwareishard.com/blog/har-12-spec/#params + */ +export interface Param { + /** name of a posted parameter. */ + name: string; + /** value of a posted parameter or content of a posted file */ + value?: string; + /** name of a posted file. */ + fileName?: string; + /** content type of a posted file. */ + contentType?: string; + /** A comment provided by the user or the application */ + comment?: string; +} +/** + * This object describes details about response content + * (embedded in `response` object). + * + * http://www.softwareishard.com/blog/har-12-spec/#content + */ +export interface Content { + /** + * Length of the returned content in bytes. + * + * Should be equal to `response.bodySize` if there is no compression and + * bigger when the content has been compressed. + */ + size: number; + /** + * Number of bytes saved. Leave out this field if the information is not + * available. + */ + compression?: number; + /** + * MIME type of the response text (value of the Content-Type response + * header). + * + * The charset attribute of the MIME type is included (if available). + */ + mimeType: string; + /** + * Response body sent from the server or loaded from the browser cache. + * + * This field is populated with textual content only. + * + * The text field is either HTTP decoded text or a encoded (e.g. `base64`) + * representation of the response body. + * + * Leave out this field if the information is not available. + */ + text?: string; + /** + * Encoding used for response text field e.g `base64`. + * + * Leave out this field if the text field is HTTP decoded + * (decompressed & unchunked), than trans-coded from its original character + * set into UTF-8. + */ + encoding?: string; + /** A comment provided by the user or the application */ + comment?: string; +} +/** + * This objects contains info about a request coming from browser cache. + * + * http://www.softwareishard.com/blog/har-12-spec/#cache + */ +export interface Cache { + /** + * State of a cache entry before the request. + * + * Leave out this field if the information is not available. + */ + beforeRequest?: CacheDetails; + /** + * State of a cache entry after the request. + * + * Leave out this field if the information is not available. + */ + afterRequest?: CacheDetails; + /** A comment provided by the user or the application */ + comment?: string; +} +export interface CacheDetails { + /** Expiration time of the cache entry. + * + * _(Format not documente but assumingly ISO 8601 - + * `YYYY-MM-DDThh:mm:ss.sTZD`)_ + */ + expires?: string; + /** The last time the cache entry was opened. + * * + * _(Format not documente but assumingly ISO 8601 - + * `YYYY-MM-DDThh:mm:ss.sTZD`)_ + */ + lastAccess: string; + /** Etag */ + eTag: string; + /** The number of times the cache entry has been opened. */ + hitCount: number; + /** A comment provided by the user or the application */ + comment?: string; +} +/** + * This object describes various phases within request-response round trip. + * + * All times are specified in milliseconds. + * + * http://www.softwareishard.com/blog/har-12-spec/#timings + */ +export interface Timings { + /** + * Time spent in a queue waiting for a network connection. + * + * Use `-1` if the timing does not apply to the current request. + */ + blocked?: number; + /** + * DNS resolution time. The time required to resolve a host name. + * + * Use `-1` if the timing does not apply to the current request. + */ + dns?: number; + /** + * Time required to create TCP connection. + * + * Use `-1` if the timing does not apply to the current request. + */ + connect?: number; + /** + * Time required to send HTTP request to the server. + * + * _Not optional and must have non-negative values._ + */ + send?: number; + /** + * Waiting for a response from the server. + * + * _Not optional and must have non-negative values._ + */ + wait: number; + /** + * Time required to read entire response from the server (or cache). + * + * _Not optional and must have non-negative values._ + */ + receive: number; + /** + * Time required for SSL/TLS negotiation. + * + * If this field is defined then the time is also included in the connect + * field (to ensure backward compatibility with HAR 1.1). + * + * Use `-1` if the timing does not apply to the current request. + */ + ssl?: number; + /** A comment provided by the user or the application */ + comment?: string; +} diff --git a/har-format/tsconfig.json b/har-format/tsconfig.json new file mode 100644 index 0000000000..7a22f7eb17 --- /dev/null +++ b/har-format/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", + "har-format-tests.ts" + ] +} \ No newline at end of file diff --git a/har-format/tslint.json b/har-format/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/har-format/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From f49a53f9a4f5c30e581b2bd73d3c832081cda801 Mon Sep 17 00:00:00 2001 From: Joshua Rosen Date: Thu, 9 Mar 2017 22:49:16 -0800 Subject: [PATCH 472/797] material-ui: Add missing MuiTheme.button.textTransform property (#14931) --- material-ui/index.d.ts | 1 + material-ui/material-ui-tests.tsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/material-ui/index.d.ts b/material-ui/index.d.ts index 6f0adff4a2..f2285f4809 100644 --- a/material-ui/index.d.ts +++ b/material-ui/index.d.ts @@ -174,6 +174,7 @@ declare namespace __MaterialUI { height?: number; minWidth?: number; iconButtonSize?: number; + textTransform?: string; }; card?: { titleColor?: string; diff --git a/material-ui/material-ui-tests.tsx b/material-ui/material-ui-tests.tsx index f2acb7922f..06f75abe9a 100644 --- a/material-ui/material-ui-tests.tsx +++ b/material-ui/material-ui-tests.tsx @@ -285,6 +285,9 @@ const lightBaseTheme = { desktopSubheaderHeight: 48, desktopToolbarHeight: 56, }, + button: { + textTransform: "lowercase" + }, fontFamily: 'Roboto, sans-serif', palette: { primary1Color: cyan500, From 0796946a6656080a6921685810b1e83c54eaf34d Mon Sep 17 00:00:00 2001 From: Roy Miloh Date: Fri, 10 Mar 2017 08:50:54 +0200 Subject: [PATCH 473/797] chance: make pickset's count optional (#14928) * chance: make count's pick and pickset optional * remove optional count from pick --- chance/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chance/index.d.ts b/chance/index.d.ts index 7ce79b431f..10538b747c 100644 --- a/chance/index.d.ts +++ b/chance/index.d.ts @@ -129,7 +129,7 @@ declare namespace Chance { * @deprecated Use pickset */ pick(arr: T[], count: number): T[]; - pickset(arr: T[], count: number): T[]; + pickset(arr: T[], count?: number): T[]; set: Setter; shuffle(arr: T[]): T[]; From 585e1143101e71d639cd422bcb8caeb81eb83a85 Mon Sep 17 00:00:00 2001 From: Eric Byers Date: Fri, 10 Mar 2017 00:51:45 -0600 Subject: [PATCH 474/797] Add declarations for module graphite-udp (#14927) * Adding graphite-udp typings * Cleaning up linting errors * Removing the namespacing that is not needed * Adding missing constructor typing, capitilizing the interface * Callback is optional --- graphite-udp/graphite-udp-tests.ts | 43 +++++++++++++ graphite-udp/index.d.ts | 97 ++++++++++++++++++++++++++++++ graphite-udp/tsconfig.json | 22 +++++++ graphite-udp/tslint.json | 1 + 4 files changed, 163 insertions(+) create mode 100644 graphite-udp/graphite-udp-tests.ts create mode 100644 graphite-udp/index.d.ts create mode 100644 graphite-udp/tsconfig.json create mode 100644 graphite-udp/tslint.json diff --git a/graphite-udp/graphite-udp-tests.ts b/graphite-udp/graphite-udp-tests.ts new file mode 100644 index 0000000000..c61ad172cd --- /dev/null +++ b/graphite-udp/graphite-udp-tests.ts @@ -0,0 +1,43 @@ +import graphite = require('graphite-udp'); + +// Test creation of client directly. +let client = new graphite.Client(); +client.put('test', 1); +client.add('test', 1); +client.close(); + +// Create client with helper +let client2 = graphite.createClient(); +client2.put('test2', 1); +client2.add('test2', 1); +client2.close(); + +// Test creation with options. +graphite.createClient({ + host: '127.0.0.1', + port: 2003, + type: 'udp4', + maxPacketSize: 4096, + prefix: 'prefix', + suffix: 'suffix', + interval: 60 * 1000, + verbose: true, + callback: (error: Error, metrics: any): void => { + + } +}); + +// Test creation options with class directly. +new graphite.Client({ + host: '127.0.0.1', + port: 2003, + type: 'udp4', + maxPacketSize: 4096, + prefix: 'prefix', + suffix: 'suffix', + interval: 60 * 1000, + verbose: true, + callback: (error: Error, metrics: any): void => { + + } +}); diff --git a/graphite-udp/index.d.ts b/graphite-udp/index.d.ts new file mode 100644 index 0000000000..218888b39a --- /dev/null +++ b/graphite-udp/index.d.ts @@ -0,0 +1,97 @@ +// Type definitions for graphite-udp 1.2 +// Project: https://github.com/fermads/graphite-udp +// Definitions by: Eric Byers +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + + +interface ClientOptions { + /** + * graphite server host or ip + * Defaults to 127.0.0.1 + */ + host?: string; + + /** + * graphite server udp port + * Defaults to 2003 + */ + port?: number; + + /** + * udp type (udp4 or udp6) + * Defaults to udp4 + */ + type?: 'udp4' | 'udp6'; + + /** + * split into smaller UDP packets + * Defaults to 4096 + */ + maxPacketSize?: number; + + /** + * Prefix for each metric name + * Defaults to '' + */ + prefix?: string; + + /** + * Suffix for each metrtic name + * Defaults to '' + */ + suffix?: string; + + /** + * Interval to group metrics by in milliseconds + * Defaults to 5000 (5s) + */ + interval?: number; + + /** + * log messages to console + * Defaults to false + */ + verbose?: boolean; + + /** + * called when metrics are sent + * Defaults to null + * + * @param {error} Error + * @param {metrics} + * @return void + */ + callback?: (error: Error, metrics: any) => void; +} + +export class Client { + + constructor(clientOptions?: ClientOptions); + + /** + * During the interval time option, if 2 or more metrics with the same name are sent, metrics will be added (summed) + * + * @param {name} + * @param {value} number + * @return void + */ + add(name: string, value: number): void; + + /** + * During the interval time option, if 2 or more metrics with the same name are sent, the last one will be used + * + * @param {name} metric name (my.test.metric) + * @param {value} number + * @return void + */ + put(name: string, value: number): void; + + /** + * Close the underlying UDP client socket + * + * @return void + */ + close(): void; +} + +export function createClient(clientOptions?: ClientOptions): Client; diff --git a/graphite-udp/tsconfig.json b/graphite-udp/tsconfig.json new file mode 100644 index 0000000000..50f3e17459 --- /dev/null +++ b/graphite-udp/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", + "graphite-udp-tests.ts" + ] +} diff --git a/graphite-udp/tslint.json b/graphite-udp/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/graphite-udp/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 58c44d684fdbe4a7d153f56e7ce7306353032ddd Mon Sep 17 00:00:00 2001 From: jhaislip Date: Fri, 10 Mar 2017 01:52:07 -0500 Subject: [PATCH 475/797] fixed return type (#14923) Corrected return type for transform and inverseTransform methods of Matrix class. --- paper/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper/index.d.ts b/paper/index.d.ts index e463d730c0..41b958fd50 100644 --- a/paper/index.d.ts +++ b/paper/index.d.ts @@ -285,7 +285,7 @@ declare module 'paper' { * Transforms a point and returns the result. * @param point - the point to be transformed */ - transform(point: Point): Matrix; + transform(point: Point): Point; /** * Transforms an array of coordinates by this matrix and stores the results into the destination array, which is also returned. @@ -299,7 +299,7 @@ declare module 'paper' { * Inverse transforms a point and returns the result. * @param point - the point to be transformed */ - inverseTransform(point: Point): Matrix; + inverseTransform(point: Point): Point; /** * Attempts to decompose the affine transformation described by this matrix into scaling, rotation and shearing, and returns an object with these properties if it succeeded, null otherwise. From 104013561b622d730de29fc139570cca39dc8390 Mon Sep 17 00:00:00 2001 From: James F McMahon Date: Fri, 10 Mar 2017 00:52:33 -0600 Subject: [PATCH 476/797] Remove jsonschema (#14930) Added to the main repo as of https://github.com/tdegrunt/jsonschema/commit/e575b64c277ae6aaf8b9a6599298a91373b82270 --- jsonschema/index.d.ts | 104 --------------------------------- jsonschema/jsonschema-tests.ts | 5 -- jsonschema/tsconfig.json | 22 ------- notNeededPackages.json | 8 ++- 4 files changed, 7 insertions(+), 132 deletions(-) delete mode 100644 jsonschema/index.d.ts delete mode 100644 jsonschema/jsonschema-tests.ts delete mode 100644 jsonschema/tsconfig.json diff --git a/jsonschema/index.d.ts b/jsonschema/index.d.ts deleted file mode 100644 index 8d182b50b9..0000000000 --- a/jsonschema/index.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -// Type definitions for jsonschema -// Project: https://github.com/tdegrunt/jsonschema -// Definitions by: Vlado Tešanovic , kinesivan -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module "jsonschema" { - - export interface IJSONSchemaResult { - errors: Array; - instance: any; - arguments: Array<{}>; - propertyPath: string; - name: string; - schema: {}; - valid: boolean; - throwError: any; - disableFormat: boolean; - } - - export interface IJSONSchemaValidationError { - message: string; - property: string; - stack: string; - schema: {}; - name: string; - instance: any; - argument: {}; - } - - export interface IJSONSchemaOptions { - propertyName?: string; - base?: string; - } - - /** - * How to; - * - * const v: Validator = new Validator(); - * - * const schema: {} = { - * "type": "object", - * "properties": { - * "key": { - * "type": "string", - * "required": true - * }, - * "value": { - * "type": "string", - * "required": true - * } - * } - * }; - * - * const validationResults: { errors: Array } = - * v.validate({ key: "Name", value: "A10" }, {"type": "string"}); - * - */ - export class Validator { - - /** - * Creates a new Validator object - * @name Validator - * @constructor - */ - new(): this; - - /** - * Validates instance against the provided schema - * @param instance - * @param schema - * @param [options] - * @param [ctx] - * @return {Array} - */ - validate(instance: any, schema: {}, options?: IJSONSchemaOptions, ctx?: {}): IJSONSchemaResult; - - /** - * Adds a schema with a certain urn to the Validator instance. - * @param schema - * @param urn - * @return {Object} - */ - addSchema(schema: {}, urn: string): {}; - - /** - * Add Sub schema to existing one - * @param baseuri - * @param schema - */ - addSubSchema(baseuri: string, schema: {}): {} - - /** - * Sets all the schemas of the Validator instance. - * @param schemas - */ - setSchemas (schemas: Array<{}>): void; - - /** - * Returns the schema of a certain urn - * @param urn - */ - getSchema(urn: string): {}; - } -} - diff --git a/jsonschema/jsonschema-tests.ts b/jsonschema/jsonschema-tests.ts deleted file mode 100644 index 83e81b2027..0000000000 --- a/jsonschema/jsonschema-tests.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Validator, IJSONSchemaValidationError } from "jsonschema"; - -const v: Validator = new Validator(); - -const validationResults: { errors: Array } = v.validate("Smith", {"type": "string"}); diff --git a/jsonschema/tsconfig.json b/jsonschema/tsconfig.json deleted file mode 100644 index d2f3e4dcab..0000000000 --- a/jsonschema/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "jsonschema-tests.ts" - ] -} \ No newline at end of file diff --git a/notNeededPackages.json b/notNeededPackages.json index 27b2764051..c8b59ea072 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -306,6 +306,12 @@ "sourceRepoURL": "https://github.com/ascoders/gaea-model", "asOfVersion": "0.0.0" }, + { + "libraryName": "jsonschema", + "typingsPackageName": "jsonschema", + "sourceRepoURL": "https://github.com/tdegrunt/jsonschema", + "asOfVersion": "1.1.1" + }, { "libraryName": "Raven JS", "typingsPackageName": "raven-js", @@ -319,4 +325,4 @@ "asOfVersion": "1.0.0" } ] -} +} \ No newline at end of file From 7349795a8022c9e19ee66ba99f23878e22f2bbbe Mon Sep 17 00:00:00 2001 From: denisname Date: Fri, 10 Mar 2017 07:54:36 +0100 Subject: [PATCH 477/797] bootstrap.v3.datetimepicker: timeZone, strictNullChecks, ... (#14922) * Improve typing Add timeZone Add moment.MomentBuiltinFormat to format and extraFormats Add missing widgetParent methods Validate for strictNullChecks (date and widgetParent) * Add tslint.json * Correct linting errors * Non-arrow functions are forbidden * Error parsing header. Expected: foo MAJOR.MINOR ('v' not allowed) * Avoid using the Function type. Prefer a specific function type, like `() => void`. * Exceeds maximum line length of 200 * These overloads can be combined into one signature with an optional parameter. * These overloads can be combined into one signature taking ... * Fix event type for "dp.update" off * Correct parseInputDate typing The parseInputDate function may be called with a date or moment object too, see: date, disabledDates, defaultDate, enabledDates, maxDate, minDate, viewDate. * Linting: quotemark double Use consistent quotation mark --- .../bootstrap.v3.datetimepicker-tests.ts | 177 ++++++++++++++++-- bootstrap.v3.datetimepicker/index.d.ts | 90 ++++----- bootstrap.v3.datetimepicker/tsconfig.json | 2 +- bootstrap.v3.datetimepicker/tslint.json | 6 + 4 files changed, 218 insertions(+), 57 deletions(-) create mode 100644 bootstrap.v3.datetimepicker/tslint.json diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts index 4306bf97c7..3373bdb9e8 100644 --- a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts +++ b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts @@ -1,26 +1,177 @@ /// -import * as moment from 'moment'; +import * as moment from "moment"; + +const dp = $("#picker").datetimepicker().data("DateTimePicker"); function test_cases() { - $('#datetimepicker').datetimepicker(); - $('#datetimepicker').datetimepicker({ - minDate: '2012-12-31' + $("#datetimepicker").datetimepicker(); + $("#datetimepicker").datetimepicker({ + minDate: "2012-12-31" }); - $('#datetimepicker').data("DateTimePicker").maxDate('2012-12-31'); + $("#datetimepicker").data("DateTimePicker").maxDate("2012-12-31"); - var startDate = moment(new Date(2012, 1, 20)); - var endDate = moment(new Date(2012, 1, 25)); - $('#datetimepicker2') + let startDate = moment(new Date(2012, 1, 20)); + const endDate = moment(new Date(2012, 1, 25)); + + $("#datetimepicker2") .datetimepicker() - .on("dp.change", function (ev) { + .on("dp.change", ev => { if (ev.date.valueOf() > endDate.valueOf()) { - $('#alert').show().find('strong').text('The start date must be before the end date.'); + $("#alert").show().find("strong").text("The start date must be before the end date."); } else { - $('#alert').hide(); + $("#alert").hide(); startDate = ev.date; - $('#date-start-display').text($('#date-start').data('date')); + $("#date-start-display").text($("#date-start").data("date")); } + }) + .on("dp.error", ev => { + console.log(`Error: ${ev.date.format("YYYY-MM-DD")}`); + }) + .on("dp.update", ev => { + console.log(`Change: ${ev.change}, ${ev.viewDate.format("YYYY-MM-DD")}`); }); -} \ No newline at end of file +} + +function test_date() { + let momentObj = moment("20111031", "YYYYMMDD"); + + dp.date(null); + dp.date("1969-07-21"); + dp.date(new Date()); + dp.date(momentObj); + + momentObj = dp.date(); +} + +function test_format() { + let boolFormat = false; + let strFormat = "YYYY-MM-DD"; + let momentFormat = moment.ISO_8601; + + $("#picker").datetimepicker({ + format: boolFormat + }); + + $("#picker").datetimepicker({ + format: strFormat + }); + + $("#picker").datetimepicker({ + format: momentFormat + }); + + dp.format(boolFormat); + boolFormat = dp.format() as boolean; + + dp.format(strFormat); + strFormat = dp.format() as string; + + dp.format(momentFormat); + momentFormat = dp.format() as moment.MomentBuiltinFormat; +} + +function test_extraFormats() { + let boolFormat = false; + let strFormats = ["YYYYMMDD", "YYYY/MM/DD"]; + let mixFormats = ["YYYYMMDD", moment.ISO_8601]; + + $("#picker").datetimepicker({ + extraFormats: boolFormat + }); + + $("#picker").datetimepicker({ + extraFormats: strFormats + }); + + $("#picker").datetimepicker({ + extraFormats: mixFormats + }); + + dp.extraFormats(boolFormat); + boolFormat = dp.extraFormats() as boolean; + + dp.extraFormats(strFormats); + strFormats = dp.extraFormats() as string[]; + + dp.extraFormats(mixFormats); + mixFormats = dp.extraFormats() as Array<(string | moment.MomentBuiltinFormat)>; +} + +function test_timeZone() { + let nullTz = null; + let strFormats = "Africa/Abidjan"; + + $("#picker").datetimepicker({ + timeZone: nullTz + }); + + $("#picker").datetimepicker({ + timeZone: strFormats + }); + + dp.timeZone(nullTz); + nullTz = dp.timeZone() as null; + + dp.timeZone(strFormats); + strFormats = dp.timeZone() as string; +} + + +function test_widgetParent() { + let nullW: null = null; + let str: string = "myId"; + let jquery = $("#element"); + + $("#picker").datetimepicker({ + widgetParent: nullW + }); + + $("#picker").datetimepicker({ + widgetParent: str + }); + + $("#picker").datetimepicker({ + widgetParent: jquery + }); + + dp.widgetParent(nullW); + nullW = dp.widgetParent() as null; + + dp.widgetParent(str); + str = dp.widgetParent() as string; + + dp.widgetParent(jquery); + jquery = dp.widgetParent() as JQuery; +} + +function inputParser(inputDate: string | Date | moment.Moment) { + const relativeDatePattern = /[0-9]+\s+(days ago)/; + + if (moment.isMoment(inputDate) || inputDate instanceof Date) { + return moment(inputDate); + } else { + const relativeDate = inputDate.match(relativeDatePattern); + if (relativeDate !== null) { + const subDays = +relativeDate[0].replace("days ago", "").trim(); + return moment().subtract(subDays, "day"); + } else { + return moment(); + } + } +}; + +function test_parseInputDate() { + let undef: undefined; + let parser: BootstrapV3DatetimePicker.InputParser; + + $("#picker").datetimepicker(); + + $("#picker").datetimepicker({ + parseInputDate: inputParser + }); + + undef = dp.parseInputDate() as undefined; + parser = dp.parseInputDate() as BootstrapV3DatetimePicker.InputParser; +} diff --git a/bootstrap.v3.datetimepicker/index.d.ts b/bootstrap.v3.datetimepicker/index.d.ts index 565ad9a356..d8ec008dca 100644 --- a/bootstrap.v3.datetimepicker/index.d.ts +++ b/bootstrap.v3.datetimepicker/index.d.ts @@ -1,21 +1,23 @@ -// Type definitions for Bootstrap 3 Datepicker v4.17.37 +// Type definitions for Bootstrap 3 Datepicker 4.17 // Project: http://eonasdan.github.io/bootstrap-datetimepicker // Definitions by: Katona Péter // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // based on the previous version created by Jesica N. Fera /** - * bootstrap-datetimepicker.js 4.17.37 Copyright (c) 2015 Jonathan Peterson + * bootstrap-datetimepicker.js 4.17.45 Copyright (c) 2015 Jonathan Peterson * Available via the MIT license. * see: http://eonasdan.github.io/bootstrap-datetimepicker or https://github.com/Eonasdan/bootstrap-datetimepicker for details. */ /// -import * as moment from 'moment'; +import * as moment from "moment"; export as namespace BootstrapV3DatetimePicker; +type InputParser = (input: string | Date | moment.Moment) => moment.Moment; + export interface Datetimepicker { /**Clears the datepicker by setting the value to null */ clear(): void; @@ -30,7 +32,7 @@ export interface Datetimepicker { * Emits: * - dp.change - In case newDate is different from current moment */ - date(date: moment.Moment | Date | string): void; + date(date: moment.Moment | Date | string | null): void; /**Destroys the widget and removes all attached event listeners */ destroy(): void; /**Disables the input element, the component is attached to, by adding a disabled="true" attribute to it. If the widget was visible before that call it is hidden. @@ -149,21 +151,23 @@ export interface Datetimepicker { * Like en/disabledDates, the en/disabledHours options are mutually exclusive and will reset one of the options back to false. */ enabledHours(value: boolean | Array): void; /**Returns a boolean or array with the options.extraFormats option configuration */ - extraFormats(): boolean | Array; + extraFormats(): boolean | Array; /**Takes an array of valid input moment format options, or boolean:false */ - extraFormats(formats: boolean | Array): void; + extraFormats(formats: boolean | Array): void; /**Returns the options.focusOnShow option. */ focusOnShow(): boolean; /**If false, the textbox will not be given focus when the picker is shown */ focusOnShow(value: boolean): void; /**Returns the component's options.format string */ - format(): boolean | string; + format(): boolean | string | moment.MomentBuiltinFormat; /**Takes a moment.js format string and sets the components options.format. * This is used for displaying and also for parsing input strings either from the input element the component is attached to or the date() function. * The parameter can also be a boolean:false in which case the format is set to the locale's L LT. * Note: this is also used to determine if the TimePicker sub component will display the hours in 12 or 24 format. (if "a" or "h" exists in the passed string then a 12 hour mode is set) + * Throws: + * - TypeError - if format is boolean:true */ - format(format: boolean | string): void; + format(format: boolean | string | moment.MomentBuiltinFormat): void; /**Returns options.icons */ icons(): Icons; /**Takes an Object of strings. @@ -224,11 +228,11 @@ export interface Datetimepicker { */ minDate(date: moment.Moment | Date | string | boolean): void; /**Returns the options.parseInputDate option */ - parseInputDate(): Function; + parseInputDate(): InputParser | undefined; /**Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". * {@link http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#parseinputdate} */ - parseInputDate(value: (input: string) => moment.Moment): void; + parseInputDate(value: InputParser): void; /**Returns the options.showClear option. */ showClear(): boolean; /**Set if the clear date button will appear on the widget */ @@ -249,12 +253,19 @@ export interface Datetimepicker { stepping(): number; /**This will be the amount the up/down arrows move the minute value with a time picker. */ stepping(step: number): void; + /** Returns a string of options.timeZone */ + timeZone(): string | null; + /** Takes a null or a string of a valid timezone. + * Throws: + * - TypeError - if tooltips parameter is not a string or null + */ + timeZone(timeZone: string | null): void; /**Returns the options.toolbarplacement option. */ toolbarPlacement(): string; /**Changes the placement of the toolbar where the today, clear, component switch icon are located. * See valid values at DatetimepickerOptions.toolbarplacement * Throws: - * - TypeError if the parameter is not a valid value + * - TypeError - if the parameter is not a valid value */ toolbarPlacement(value: string): void; /**Returns the options.tooltips option */ @@ -267,10 +278,12 @@ export interface Datetimepicker { /**Returns the options.useCurrent option configuration */ useCurrent(): boolean | string; /**Takes a boolean or string. - * If a boolean true is passed and the components model moment is not set (either through setDate or through a valid value on the input element the component is attached to) then the first time the user opens the datetimepicker widget the value is initialized to the current moment of the action. + * If a boolean true is passed and the components model moment is not set (either through setDate or through a valid value on the input element the component is attached to) + * then the first time the user opens the datetimepicker widget the value is initialized to the current moment of the action. * If a false boolean is passed then no initialization happens on the input element. * You can select the granularity on the initialized moment by passing one of the following strings ("year", "month", "day", "hour", "minute") in the variable. - * If for example you pass "day" to the useCurrent function and the input field is empty the first time the user opens the datetimepicker widget the input text will be initialized to the current datetime with day granularity (ie if currentTime = 2014-08-10 13:32:33 the input value will be initialized to 2014-08-10 00:00:00) + * If for example you pass "day" to the useCurrent function and the input field is empty the first time the user opens the datetimepicker widget the input text will be + * initialized to the current datetime with day granularity (ie if currentTime = 2014-08-10 13:32:33 the input value will be initialized to 2014-08-10 00:00:00) * Note: If the options.defaultDate is set or the input element the component is attached to has already a value that takes precedence and the functionality of useCurrent is not triggered! */ useCurrent(value: boolean | string): void; @@ -289,6 +302,10 @@ export interface Datetimepicker { * - TypeError - if the parameter is not a string or not a valid value */ viewMode(value: string): void; + /**Returns a $(element) variable with the currently set options.widgetParent option. */ + widgetParent(): string | JQuery | null + /**Takes a string or $(element) value. */ + widgetParent(widgetParent: string | JQuery | null): void; /**Returns the options.widgetPositioning object */ widgetPositioning(): WidgetPositioningOptions; /**WidgetPositioning defines where the dropdown with the widget will appear relative to the input element the component is attached to. @@ -364,7 +381,7 @@ export interface DatetimepickerOptions { /**Allows for several input formats to be valid. See: https://github.com/Eonasdan/bootstrap-datetimepicker/pull/666 * @default: false */ - extraFormats?: boolean | Array; + extraFormats?: boolean | Array; /**If false, the textbox will not be given focus when the picker is shown * @default: true */ @@ -372,7 +389,7 @@ export interface DatetimepickerOptions { /**See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker. * @default: false */ - format?: boolean | string; + format?: boolean | string | moment.MomentBuiltinFormat; /**Change the default icons for the pickers functions. */ icons?: Icons; /**Allow date picker show event to fire even when the associated input element has the readonly="readonly"property. @@ -416,7 +433,7 @@ export interface DatetimepickerOptions { /**Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". * {@link http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#parseinputdate} */ - parseInputDate?: (input: string) => moment.Moment; + parseInputDate?: InputParser; /**Show the "Clear" button in the icon toolbar. * Clicking the "Clear" button will set the calendar to null. * @default: false @@ -440,6 +457,11 @@ export interface DatetimepickerOptions { * @default: 1 */ stepping?: number; + /** + * Timezone to use, if moment-timezone is loaded. If null or empty string, ignore timezones. + * @default: "" + */ + timeZone?: string | null; /**Changes the placement of the icon toolbar. * @default: "default" */ @@ -466,7 +488,7 @@ export interface DatetimepickerOptions { /**On picker show, places the widget at the identifier (string) or jQuery object if the element has css position: "relative" * @default: null */ - widgetParent?: string | JQuery; + widgetParent?: string | JQuery | null; widgetPositioning?: WidgetPositioningOptions; } @@ -540,12 +562,12 @@ export interface UpdateEvent extends JQueryEventObject { viewDate: moment.Moment; } +type EventName = "dp.show" | "dp.hide" | "dp.error"; declare global { interface JQuery { - datetimepicker(): JQuery; - datetimepicker(options: DatetimepickerOptions): JQuery; + datetimepicker(options?: DatetimepickerOptions): JQuery; data(key: "DateTimePicker"): Datetimepicker; @@ -556,36 +578,18 @@ declare global { off(events: "dp.change", handler: (eventobject: ChangeEvent) => any): JQuery; off(events: "dp.change", selector?: string, handler?: (eventobject: ChangeEvent) => any): JQuery; + on(events: EventName , handler: (eventObject: Event) => any): JQuery; + on(events: EventName, selector: string, handler: (eventobject: Event) => any): JQuery; + on(events: EventName, selector: string, data: any, handler?: (eventobject: Event) => any): JQuery; - on(events: "dp.show", handler: (eventObject: Event) => any): JQuery; - on(events: "dp.show", selector: string, handler: (eventobject: Event) => any): JQuery; - on(events: "dp.show", selector: string, data: any, handler?: (eventobject: Event) => any): JQuery; - - off(events: "dp.show", handler: (eventobject: Event) => any): JQuery; - off(events: "dp.show", selector?: string, handler?: (eventobject: Event) => any): JQuery; - - - on(events: "dp.hide", handler: (eventObject: Event) => any): JQuery; - on(events: "dp.hide", selector: string, handler: (eventobject: Event) => any): JQuery; - on(events: "dp.hide", selector: string, data: any, handler?: (eventobject: Event) => any): JQuery; - - off(events: "dp.hide", handler: (eventobject: Event) => any): JQuery; - off(events: "dp.hide", selector?: string, handler?: (eventobject: Event) => any): JQuery; - - - on(events: "dp.error", handler: (eventObject: Event) => any): JQuery; - on(events: "dp.error", selector: string, handler: (eventobject: Event) => any): JQuery; - on(events: "dp.error", selector: string, data: any, handler?: (eventobject: Event) => any): JQuery; - - off(events: "dp.error", handler: (eventobject: Event) => any): JQuery; - off(events: "dp.error", selector?: string, handler?: (eventobject: Event) => any): JQuery; - + off(events: EventName, handler: (eventobject: Event) => any): JQuery; + off(events: EventName, selector?: string, handler?: (eventobject: Event) => any): JQuery; on(events: "dp.update", handler: (eventObject: UpdateEvent) => any): JQuery; on(events: "dp.update", selector: string, handler: (eventobject: UpdateEvent) => any): JQuery; on(events: "dp.update", selector: string, data: any, handler?: (eventobject: UpdateEvent) => any): JQuery; - off(events: "dp.update", handler: (eventobject: Event) => any): JQuery; + off(events: "dp.update", handler: (eventobject: UpdateEvent) => any): JQuery; off(events: "dp.update", selector?: string, handler?: (eventobject: UpdateEvent) => any): JQuery; } } diff --git a/bootstrap.v3.datetimepicker/tsconfig.json b/bootstrap.v3.datetimepicker/tsconfig.json index 27ff9874c6..a405cd85dc 100644 --- a/bootstrap.v3.datetimepicker/tsconfig.json +++ b/bootstrap.v3.datetimepicker/tsconfig.json @@ -11,7 +11,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" diff --git a/bootstrap.v3.datetimepicker/tslint.json b/bootstrap.v3.datetimepicker/tslint.json new file mode 100644 index 0000000000..341858d283 --- /dev/null +++ b/bootstrap.v3.datetimepicker/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "quotemark": [true, "double", "avoid-escape"] + } +} \ No newline at end of file From 6dd1b35059cd06fff67abd999fd50cb244eedc2f Mon Sep 17 00:00:00 2001 From: yoneal Date: Fri, 10 Mar 2017 14:55:17 +0800 Subject: [PATCH 478/797] Convert formats to an interface type (#14920) This will allow plugins like nconf-yaml to use declaration merging to add other file formats --- nconf/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nconf/index.d.ts b/nconf/index.d.ts index 3a9a06edb4..ff72f3e568 100644 --- a/nconf/index.d.ts +++ b/nconf/index.d.ts @@ -40,10 +40,11 @@ export declare function path(key: any): any[]; export declare function loadFiles(files: any, callback?: ICallbackFunction): void; export declare function loadFilesSync(files: any, callback?: ICallbackFunction): void; -export declare var formats: { +export interface IFormats { json: IFormat; ini: IFormat; -}; +} +export declare var formats: IFormats; export interface IFormat { stringify: (obj: any, replacer: any, spacing?: any) => string; From 29af632b69cf4974407e43c4b100c54f24da2f87 Mon Sep 17 00:00:00 2001 From: Martin Probst Date: Fri, 10 Mar 2017 07:55:40 +0100 Subject: [PATCH 479/797] angular: specify what locals $controller requires (#14919) * Specify/hint what locals $controller requires `$controller` must at least get a `$scope` and a `$element` object. * Fix whitespace --- angular/index.d.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/angular/index.d.ts b/angular/index.d.ts index 05b6ce92ff..5d47751844 100644 --- a/angular/index.d.ts +++ b/angular/index.d.ts @@ -1332,9 +1332,19 @@ declare namespace angular { // see http://docs.angularjs.org/api/ng.$controller // see http://docs.angularjs.org/api/ng.$controllerProvider /////////////////////////////////////////////////////////////////////////// + + /** + * The minimal local definitions required by $controller(ctrl, locals) calls. + */ + interface IControllerLocals { + $scope: ng.IScope; + $element: JQuery; + } + interface IControllerService { // Although the documentation doesn't state this, locals are optional (controllerConstructor: new (...args: any[]) => T, locals?: any, later?: boolean, ident?: string): T; + (controllerConstructor: Function, locals?: IControllerLocals, later?: boolean, ident?: string): T; (controllerConstructor: Function, locals?: any, later?: boolean, ident?: string): T; (controllerName: string, locals?: any, later?: boolean, ident?: string): T; } From 3326972199b04cd095b0f99aad3d3ad7544da9e2 Mon Sep 17 00:00:00 2001 From: Benni Date: Fri, 10 Mar 2017 07:56:26 +0100 Subject: [PATCH 480/797] Added missing definitions for TinyMce (#14918) * Added definitions for TinyMce except the 'ui' namespace. * Fixed lint warnings * Refactoring: new => class definition with constructor --- tinymce/index.d.ts | 1437 +++++++++++++++++++++++++++++++++++++- tinymce/tinymce-tests.ts | 19 +- 2 files changed, 1423 insertions(+), 33 deletions(-) diff --git a/tinymce/index.d.ts b/tinymce/index.d.ts index f760671a8e..b82f90a46e 100644 --- a/tinymce/index.d.ts +++ b/tinymce/index.d.ts @@ -5,40 +5,1425 @@ // Work In Progress -declare namespace TinyMCE { - export interface Observable { - off: (name?: string, callback?: () => void) => any; - on: (name: string, callback: () => void) => any; - fire: (name: string, args?: any, bubble?: boolean) => Event; +declare namespace TinyMce { + + export interface Static extends TinyMce.EditorManager { + + DOM: TinyMce.dom.DOMUtils; + + PluginManager: TinyMce.AddOnManager; + + ScriptLoader: TinyMce.dom.ScriptLoader; + + ThemeManager: TinyMce.AddOnManager; + + create(s: string, p: {}, root?: {}): void; + + createNS(n: string, o: {}): {}; + + each(o: {}, cb: () => void, s?: {}): void; + + explode(s: string, d: string): void; + + grep(a: any[], f: () => void): any[]; + + inArray(item: any, arr: any[]): number; + + is(obj: {}, type?: string): boolean; + + isArray(obj: {}): boolean; + + makeMap(items: any[], delim?: string, map?: {}): {}; + + map(array: any[], callback: () => void): any[]; + + resolve(n: string, o?: {}): {}; + + toArray(obj: {}): any[]; + + trim(s: string): string; + + walk(o: {}, f: () => void, n?: string, s?: string): void; } - export interface Editor extends Observable { - destroy: (automatic: boolean) => void; - remove: () => void; - hide: () => void; - show: () => void; - getContent: (args?: any) => string; - setContent: (content: string, args?: any) => string; - focus: (skip_focus?: boolean) => void; + export interface Settings { + + auto_focus?: string; + + cache_suffix?: string; + + content_security_policy?: string; + + external_plugins?: {}; + + hidden_input?: boolean; + + init_instance_callback?: (editor: TinyMce.Editor) => void; + + plugins?: string | string[]; + + selector?: string; + + setup?: (edtor: TinyMce.Editor) => void; + + target?: Element; + + color_picker_callback?: (callback: (hexColor: string) => void, value: string) => void; + + elementpath?: boolean; + + event_root?: boolean; + + fixed_toolbar_container?: string; + + height?: number; + + inline?: boolean; + + insert_button_items?: string; + + insert_toolbar?: string; + + max_height?: number; + + max_width?: number; + + menu?: settings.Menu; + + menubar?: string | boolean; + + min_height?: number; + + min_width?: number; + + preview_styles?: boolean | string; + + removed_menuitems?: string; + + resize?: boolean | string; + + selection_toolbar?: string; + + skin_url?: string; + + skin?: string; + + statusbar?: boolean; + + theme_url?: string; + + theme?: string; + + toolbar?: boolean | string | string[]; + + width?: number; + + body_class?: string; + + body_id?: string; + + content_css?: string; + + content_style?: string; + + visual_anchor_class?: string; + + visual_table_class?: string; + + visual?: boolean; + + allow_conditional_comments?: boolean; + + allow_html_in_named_anchor?: boolean; + + allow_unsafe_link_target?: boolean; + + convert_fonts_to_spans?: boolean; + + custom_elements?: string; + + doctype?: string; + + element_format?: string; + + encoding?: string; + + entities?: string; + + entity_encoding?: string; + + extended_valid_elements?: string; + + fix_list_elements?: boolean; + + force_hex_style_colors?: boolean; + + forced_root_block?: string; + + forced_root_block_attrs?: {}; + + invalid_elements?: string; + + invalid_styles?: string | {}; + + keep_styles?: boolean; + + protect?: RegExp[]; + + remove_trailing_brs?: boolean; + + schema?: string; + + valid_children?: string; + + valid_classes?: string | {}; + + valid_elements?: string; + + valid_styles?: {}; + + block_formats?: string; + + font_formats?: string; + + fontsize_formats?: string; + + formats?: {}; + + removeFormat?: Array<{}>; + + indentation?: string; + + style_formats?: Array<{}>; + + style_formats_autohide?: boolean; + + style_formats_merge?: boolean; + + browser_spellcheck?: boolean; + + gecko_spellcheck?: boolean; + + automatic_uploads?: boolean; + + file_browser_callback?: (field_name: string, url: string, type: string, win: Window) => void; + + file_browser_callback_types?: string; + + file_picker_callback?: (callback: (filename: string, metadata: {}) => void, valud: string, meta: {}) => void; + + file_picker_types?: string; + + images_dataimg_filter?: (img: any) => void; + + images_reuse_filename?: boolean; + + images_upload_base_path?: string; + + images_upload_credentials?: boolean; + + images_upload_handler?: (blobInfo: any, success: (msg: string) => void, failure: (msg: string) => void) => void; + + images_upload_url?: string; + + directionality?: string; + + language?: string; + + language_url?: string; + + allow_script_urls?: boolean; + + convert_urls?: boolean; + + document_base_url?: string; + + relative_urls?: boolean; + + remove_script_host?: boolean; + + urlconverter_callback?: (url: string, node: HTMLElement, on_save: boolean, name: string) => void; + + anchor_bottom?: string; + + anchor_top?: string; + + br_in_pre?: boolean; + + custom_undo_redo_levels?: number; + + end_container_on_empty_block?: boolean; + + nowrap?: boolean; + + object_resizing?: boolean | string; + + type_ahead_urls?: boolean; + + } + + export namespace settings { + + export interface Menu { + file: MenuItem; + edit: MenuItem; + insert: MenuItem; + view: MenuItem; + format: MenuItem; + table: MenuItem; + tools: MenuItem; + } + + export interface MenuItem { + title: string; + items: string; + } + } + + export interface AddOnManager { + + add(id: string, addOn: (editor: TinyMce.Editor, url: string) => void): Theme | Plugin; + + addComponents(pluginName: string, scripts: string[]): void; + + get(name: string): Theme | Plugin; + + load(name: string, addOnUrl: string, success?: () => void, scope?: {}, failure?: () => void): void; + + requireLangPack(name: string, languages?: string): void; + } + + export interface Editor extends util.Observable { + + $: dom.DomQuery; + + baseURI: util.URI; + + contentCSS: string[]; + + contentStyles: string[]; + + documentBaseURI: util.URI; + + dom: dom.DOMUtils; + + formatter: Formatter; + + id: string; + + initialized: boolean; + + notificationManager: notificationManager; + + parser: html.DomParser; + + schema: html.Schema; + + selection: dom.Selection; + + serializer: dom.Serializer; + + settings: Settings; + + theme: Theme; + undoManager: UndoManager; - settings: any; - getDoc: () => Document; - editorUpload: any; + + WindowManager: WindowManager; + + addButton(name: string, settings: {}): void; + + addCommand(name: string, callback: (ui: boolean, value: {}) => boolean, scope?: {}): void; + + addContextToolbar(predicate: () => void, items: string): void; + + addMenuItem(name: string, settings: {}): void; + + addQueryStateHandler(name: string, callback: () => boolean, scope?: {}): void; + + addQueryValueHandler(name: string, callback: () => {}, scope?: {}): void; + + addShortcut(pattern: string, desc: string, cmdFunc: string, sc?: {}): boolean; + + addSidebar(name: string, settings: {}): void; + + addVisual(elm?: Element): void; + + convertURL(url: string, name: string, elm: string): string; + + destroy(automatic?: boolean): void; + + execCallback(name: string): {}; + + execCommand(cmd: string, ui: boolean, value?: any, args?: {}): void; + + focus(skipFocus: boolean): void; + + getBody(): HTMLBodyElement; + + getContainer(): Element; + + getContent(args?: {}): string; + + getContentAreaContainer(): Element; + + getDoc(): Document; + + getElement(): Element; + + getLang(name: string, defaultVal?: string): void; + + getParam(name: string, defaultVal?: string, type?: string): string; + + getWin(): Window; + + hasEventListeners(name: string): boolean; + + hide(): void; + + init(): void; + + insertContent(content: string, args?: {}): void; + + isDirty(): boolean; + + isHidden(): boolean; + + load(args?: {}): string; + + nodeChanged(args?: {}): void; + + queryCommandState(cmd: string): boolean; + + queryCommandSupported(cmd: string): boolean; + + queryCommandValue(cmd: string): {}; + + remove(): void; + + render(): void; + + save(args: {}): string; + + setContent(content: string, args?: {}): string; + + setDirty(state: boolean): void; + + setMode(mode: string): void; + + setProgressState(state: boolean, time: number): boolean; + + show(): void; + + translate(text: string): string; + + uploadImages(callback: () => void): Promise; + } + + export interface EditorCommands { + + addCommands(command_list: {}, type?: string): void; + + execCommand(command: string, ui?: boolean, value?: {}, args?: {}): boolean; + + queryCommandState(command: string): boolean | number; + + queryCommandSupported(command: string): boolean; + + queryCommandValue(command: string): {}; + } + + export interface EditorManager extends util.Observable { + + $: dom.DomQuery; + + activeEditor: TinyMce.Editor; + + baseURI: TinyMce.util.URI; + + baseURL: string; + + documentBaseURL: string; + + editors: TinyMce.Editor[]; + + i18n: {}; + + majorVersion: string; + + minorVersion: string; + + releaseDate: string; + + suffix: string; + + add(editor: TinyMce.Editor): TinyMce.Editor; + + addI18n(code: string, items: {}): void; + + createEditor(id: string, settings: {}): TinyMce.Editor; + + execCommand(cmd: string, ui?: boolean, value?: string): boolean; + + get(id: string): TinyMce.Editor; + + init(settings: Settings): Promise; + + overrideDefaults(defaultSettings: {}): void; + + remove(selector: TinyMce.Editor): TinyMce.Editor; + + setActive(editor: TinyMce.Editor): void; + + translate(text: string): string; + + triggerSave(): void; + } + + export interface Env { + + android: boolean; + + ceFalse: boolean; + + contentEditable: boolean; + + documentMode: boolean; + + fileApi: boolean; + + gecko: boolean; + + iOS: boolean; + + ie: boolean; + + mac: boolean; + + noCaretAfter: boolean; + + opera: boolean; + + range: boolean; + + transparentSrc: boolean; + + webKit: boolean; + } + + export namespace Events { + + export interface Event { + + type: string; + + target: string; + + isDefaultPrevented(): boolean; + + isImmediatePropagationStopped(): boolean; + + isPropagationStopped(): boolean; + + preventDefault(): void; + + stopImmediatePropagation(): void; + + stopPropagation(): void; + } + + export interface FocusBlurEvent extends Event { + + blurredEditor: Editor; + } + + export interface ContentEvent extends Event { + + format: string; + + set: boolean; + + content: string; + } + + export interface ProcessEvent extends Event { + + content: string; + + forced_root_block: string; + + format: string; + + get: boolean; + + get_inner: boolean; + + node: Node; + + selection: true; + } + + export interface NodeChangeEvent extends Event { + + element: Node; + + parents: Node[]; + + selectionChange: boolean; + } + + export interface UndoRedoEvent extends Event { + + level: {}; + } + + export interface ChangeEvent extends Event { + + lastLevel: {}; + + level: {}; + } + + export interface CommandEvent extends Event { + + command: string; + + ui: boolean; + + value: string; + } + } + + export interface FocusManager { + + isEditorUIElement(elm: Element): boolean; + } + + export class FocusManager implements FocusManager { + + constructor(editorManager: TinyMce.EditorManager); + } + + export interface Formatter { + + apply(name: string, vars?: {}, node?: html.Node): void; + + canApply(name: string): boolean; + + formatChanged(formats: string, callback: () => void, similar: boolean): void; + + get(name?: string): any[] | {}; + + getCssText(format: string): string; + + match(name: string, vars?: {}, node?: html.Node): boolean; + + matchAll(names: any[], vars?: {}): any[]; + + matchNode(node: html.Node, name: string, vars: {}, similar: boolean): {}; + + register(name: {}, format?: {}): void; + + remove(name: string, vars?: {}, node?: html.Node): void; + + toggle(name: string, vars?: {}, node?: html.Node): void; + + unregister(name: string): void; + } + + export class Formatter implements Formatter { + + constructor(ed: Editor); + } + + export interface Shortcuts { + + add(pattern: string, desc: string, cmdFunc: () => void | string, scope?: {}): boolean; + + remove(pattern: string): boolean; + } + + export interface Theme { + + renderUI(obj: {}): {}; } export interface UndoManager { - undo: () => any; - clear: () => void; - hasUndo: () => boolean; + + add(level?: {}, event?: DocumentEvent): {}; + + beforeChange(): void; + + clear(): void; + + extra(callback1: () => void, callback2: () => void): void; + + hasRedo(): boolean; + + hasUndo(): boolean; + + redo(): {}; + + transact(callback: () => void): {}; + + undo(): {}; } - export interface Static extends Observable { - init: (settings: any) => void; - execCommand: (c: string, u: boolean, v: string) => boolean; - activeEditor: Editor; - get: (id: string) => Editor; - triggerSave: () => void; + export interface WindowManager { + + alert(message: string, callback: () => void, scope?: {}): void; + + close(): void; + + confirm(message: string, callback: () => void, scope?: {}): void; + + getParams(): {}; + + getWindows(): Window[]; + + open(args: {}, params: {}): void; + + setParams(params: {}): void; + } + + export interface notificationManager { + + close(): void; + + getNotifications(): Array<{}>; + + open(args?: {}): void; + } + + export namespace dom { + + export interface BookmarkManager { + + getBookmark(type?: number, normalized?: boolean): {}; + + isBookmarkNode(node: HTMLElement): boolean; + + moveToBookmark(bookmark: {}): boolean; + } + + export interface DOMUtils { + + add(parentElm: string, name: string, attrs?: {}, html?: string, create?: boolean): Element | T[]; + + addClass(elm: string, cls: string): string | T[]; + + addStyle(cssText: string): void; + + bind(target: Element, name: string, func: () => void, scope?: {}): () => void; + + create(name: string, attrs?: {}, html?: string): Element; + + createFragment(html: string): DocumentFragment; + + createHTML(name: string, attrs?: {}, html?: string): string; + + createRng(): Range; + + decode(s: string): string; + + destroy(): void; + + encode(text: string): string; + + findCommonAncestor(a: Element, b: Element): Element; + + fire(target: Node, name: string, evt: {}): Event; + + get(n: string): Element; + + getAttrib(elm: string, name: string, defaultVal: string): string; + + getAttribs(elm?: HTMLElement): NodeList; + + getNext(node: Node, selector: string): Node; + + getOuterHTML(elm: string): string; + + getParent(node: Node, selector: () => void, root?: Node): Node; + + getParents(node: Node, selector: () => void, root?: Node): T[]; + + getPos(elm: Element, rootElm?: Element): {}; + + getPrev(node: Node, selector: string): Node; + + getRect(elm: Element): {}; + + getRoot(): Element; + + getSize(elm: Element): {}; + + getStyle(elm: string, name: string, computed: boolean): string; + + getViewPort(win?: Window): {}; + + hasClass(elm: string, cls: string): boolean; + + hide(elm: string): void; + + insertAfter(node: Element, referenceNode: Element): Element | T[]; + + is(elm: Node, selector: string): void; + + isBlock(node: Node): boolean; + + isEmpty(elements?: {}): boolean; + + isHidden(elm: string): boolean; + + loadCSS(url: string): void; + + nodeIndex(node: Node, normalized?: boolean): number; + + parseStyle(cssText: string): {}; + + remove(node: string, keepChildren?: boolean): Element | T[]; + + removeAllAttribs(e: Element): void; + + removeClass(elm: string, cls: string): string | T[]; + + rename(elm: Element, name: string): Element; + + replace(newElm: Element, oldElm: Element, keepChildren?: boolean): void; + + run(elm: string, func: () => void, scope?: {}): {} | T[]; + + select(selector: string, scope?: {}): T[]; + + serializeStyle(styles: {}, name?: string): string; + + setAttrib(elm: Element, name: string, value: string): void; + + setAttribs(elm: Element, attrs: {}): void; + + setHTML(elm: Element, html: string): void; + + setOuterHTML(elm: Element, html: {}): void; + + setStyle(elm: string, name: string, value: string): void; + + setStyles(elm: Element, styles: {}): void; + + show(elm: string): void; + + split(parentElm: Element, splitElm: Element, replacementElm?: Element): Element; + + toHex(rgbVal: string): string; + + toggleClass(elm: Element, cls: string, state?: string): void; + + unbind(target: Element, name: string, func: () => void): boolean | T[]; + + uniqueId(prefix?: string): string; + } + + export class DOMUtils implements DOMUtils { + + constructor(doc: Document, settings?: {}); + } + + export interface DomQuery { + + add(items: T[], sort?: boolean): DomQuery; + + addClass(className: string): DomQuery; + + after(content: string): DomQuery; + + append(content: string): DomQuery; + + appendTo(val: string): DomQuery; + + attr(name: string, value?: string): DomQuery | string; + + before(content: string): DomQuery; + + children(node: Element | string): DomQuery; + + clone(): DomQuery; + + closest(selector: string): DomQuery; + + contents(node: Element | string): DomQuery; + + css(name: string, value?: string): DomQuery | string; + + each(callback: () => void): DomQuery; + + each(obj: {}, callback: () => void): void; + + empty(): DomQuery; + + eq(index: number): DomQuery; + + extend(target: {}, object: {}): {}; + + filter(selector: string): DomQuery; + + find(selector: string): DomQuery; + + first(): DomQuery; + + grep(array: T[], callback: () => void): T[]; + + hasClass(className: string): boolean; + + hide(): DomQuery; + + html(value?: string): DomQuery | string; + + inArray(item: {}, array: T[]): number; + + is(selector: string): boolean; + + isArray(array: {}): boolean; + + last(): DomQuery; + + makeArray(object: {}): T[]; + + next(node: Element | string): DomQuery; + + nextUntil(node: Element | string, until: string): DomQuery; + + off(name?: string, callback?: () => void): DomQuery; + + offset(offset?: {}): {} | DomQuery; + + on(name: string, callback: () => void): DomQuery; + + parent(node: Element | string): DomQuery; + + parents(node: Element | string): DomQuery; + + parentsUntil(node: Element | string, until: string): DomQuery; + + prepend(content: string): DomQuery; + + prependTo(val: string): DomQuery; + + prev(node: Element | string): DomQuery; + + prevUntil(node: Element | string, until: string): DomQuery; + + remove(): DomQuery; + + removeAttr(name: string): DomQuery | string; + + removeClass(className: string): DomQuery; + + replaceWith(content: string): DomQuery; + + show(): DomQuery; + + slice(start: number, end?: number): DomQuery; + + text(value?: string): DomQuery | string; + + toArray(): T[]; + + toggleClass(className: string, state?: boolean): DomQuery; + + trigger(name: string): DomQuery; + + trim(str: string): string; + + unwrap(): DomQuery; + + wrap(content: string): DomQuery; + + wrapAll(content: string): DomQuery; + + wrapInner(content: string): DomQuery; + } + + export class DomQuery implements DomQuery { + + constructor(selector?: string, context?: Document); + } + + export interface EventUtils { + + bind(target: {}, names: string, callback: () => void, scope: {}): () => void; + + clean(target: {}): EventUtils; + + fire(target: {}, name: string, args?: {}): EventUtils; + + unbind(target: {}, names?: string, callback?: () => void): EventUtils; + } + + export interface RangeUtils { + + compareRanges(rng1: Range, rng2: Range): boolean; + + getCaretRangeFromPoint(clientX: number, clientY: number, doc: Document): Range; + } + + export interface ScriptLoader { + + add(url: string, success?: () => void, scope?: {}, failure?: () => void): void; + + isDone(url: string): boolean; + + load(url: string, callback1?: () => void, callback2?: () => void): void; + + loadQueue(success?: () => void, failure?: () => void, scope?: {}): void; + + loadScripts(scripts: string[], callback1?: () => void, scope?: {}, callback2?: () => void): void; + + markDone(url: string): void; + } + + export interface Selection { + + collapse(toStart?: boolean): void; + + getBookmark(type?: number, normalized?: boolean): {}; + + getContent(args?: {}): string; + + getEnd(real?: boolean): Element; + + getNode(): Element; + + getRng(w3c: boolean): Range; + + getSel(): Selection; + + getStart(real?: boolean): Element; + + isCollapsed(): boolean; + + moveToBookmark(bookmark: {}): boolean; + + select(node: Element, content?: boolean): Element; + + selectorChanged(selector: string, callback: () => void): void; + + setContent(content: string, args?: {}): void; + + setCursorLocation(node?: html.Node, offset?: number): void; + + setNode(elm: Element): Element; + + setRng(rng: Range, forward?: boolean): void; + } + + export class Selection implements Selection { + + constructor(dom: DOMUtils, win: Window, editor: Editor, serializer: Serializer); + } + + export interface Serializer { + + addAttributeFilter(callback: () => void): void; + + addNodeFilter(callback: () => void): void; + + addRules(rules: string): void; + + addTempAttr(name: string): void; + + serialize(node: HTMLElement, args: {}): void; + + setRules(rules: string): void; + + } + + export class Serializer implements Serializer { + + constructor(settings: {}, editor?: Editor); + } + + export interface TreeWalker { + + current(): html.Node; + + next(): html.Node; + + prev(): html.Node; + } + } + + export class TreeWalker implements TreeWalker { + + constructor(startNode: html.Node, rootNode: html.Node); + } + + export namespace geom { + + export interface Rect { + + clamp(rect: Rect, clampRect: Rect, fixedSize: boolean): Rect; + + create(x: number, y: number, w: number, h: number): Rect; + + findBestRelativePosition(rect: Rect, targetRect: Rect, constrainRect: Rect, rels: any[]): void; + + fromClientRect(clientRect: ClientRect): Rect; + + inflate(rect: Rect, w: number, h: number): Rect; + + intersect(rect: Rect, cropRect: Rect): Rect; + + relativePosition(rect: Rect, targetRect: Rect, rel: string): void; + } + } + + export namespace html { + + export interface DomParser { + + addAttributeFilter(attributes: string, callback: () => void): void; + + addNodeFilter(attributes: string, callback: () => void): void; + + filterNode(node: TinyMce.html.Node): TinyMce.html.Node; + + parse(html: string, args?: {}): TinyMce.html.Node; + } + + export class DomParser implements DomParser { + + constructor(settings: {}, schema: TinyMce.html.Schema); + } + + export interface Entities { + + decode(text: string): string; + + encodeAllRaw(text: string): string; + + encodeNamed(text: string, attr?: boolean, entities?: {}): string; + + encodeNumeric(text: string, attr?: boolean): string; + + encodeRaw(text: string, attr?: boolean): string; + + getEncodeFunc(name: string, entities?: string): () => void; + } + + export interface Node { + + append(node: TinyMce.html.Node): TinyMce.html.Node; + + attr(name: string, value?: string): string | TinyMce.html.Node; + + clone(): TinyMce.html.Node; + + create(name: string, attrs: {}): void; + + empty(): TinyMce.html.Node; + + getAll(name: string): TinyMce.html.Node[]; + + insert(node: TinyMce.html.Node, ref_node: TinyMce.html.Node, before?: boolean): TinyMce.html.Node; + + isEmpty(elements: {}): boolean; + + remove(): TinyMce.html.Node; + + replace(node: TinyMce.html.Node): TinyMce.html.Node; + + unwrap(): void; + + walk(prev?: boolean): TinyMce.html.Node; + + wrap(wrapperNode: TinyMce.html.Node): TinyMce.html.Node; + } + + export class Node implements Node { + + constructor(name: string, type: number); + } + + export interface SaxParser { + + parse(html: string): void; + } + + export class SaxParser implements SaxParser { + + constructor(settings: {}, schema: TinyMce.html.Schema); + } + + export interface Schema { + + addCustomElements(custom_elements: string): void; + + addValidChildren(valid_children: string): void; + + addValidElements(valid_elements: string): void; + + getBlockElements(): {}; + + getBoolAttrs(): {}; + + getCustomElements(): {}; + + getElementRule(name: string): {}; + + getInvalidStyles(): void; + + getMoveCaretBeforeOnEnterElements(): {}; + + getNonEmptyElements(): {}; + + getSelfClosingElements(): {}; + + getShortEndedElements(): {}; + + getSpecialElements(): {}; + + getTextBlockElements(): {}; + + getTextInlineElements(): {}; + + getValidClasses(): void; + + getValidStyles(): void; + + getWhiteSpaceElements(): {}; + + isValid(name: string, attr?: string): boolean; + + isValidChild(name: string, child: string): boolean; + + setValidElements(valid_elements: string): void; + } + + export class Schema implements Schema { + + constructor(settings: {}); + } + + export interface Serializer { + + serialize(node: TinyMce.html.Node): string; + } + + export class Serializer implements Serializer { + + constructor(settings: {}, schema: TinyMce.html.Schema); + } + + export interface Styles { + + parse(css: string): {}; + + serialize(styles: {}, elementName: string): string; + + toHex(color: string): string; + } + + export interface Writer { + + cdata(text: string): void; + + doctype(text: string): void; + + end(name: string): void; + + getContent(): string; + + pi(name: string, text: string): void; + + reset(): void; + + start(name: string, attrs?: any[], empty?: boolean): void; + + text(text: string, raw: boolean): void; + } + } + + export class Writer implements Writer { + + constructor(settings: {}); + } + + export namespace util { + + export interface Color { + + parse(value: {}): TinyMce.util.Color; + + toHex(): string; + + toHsv(): {}; + + toRgb(): {}; + } + + export class Color implements Color { + + constructor(value: string | {}); + } + + export interface Delay { + + clearInterval(interval: number): void; + + clearTimeout(timeout: number): void; + + debounce(callback: () => void, time: number): () => void; + + requestAnimationFrame(callback: () => void, element?: HTMLElement): void; + + setEditorInterval(callback: () => void, time: number): number; + + setEditorTimeout(editor: TinyMce.Editor, callback: () => void, time: number): number; + + setInterval(callback: () => void, time: number): number; + + setTimeout(callback: () => void, time: number): number; + } + + export interface EventDispatcher { + + fire(name: string, args?: {}): {}; + + has(name: string): boolean; + + isNative(name: string): boolean; + + off(name: string, callback?: () => void): {}; + + on(name: string, callback: () => void, first?: boolean): {}; + + once(name: string, callback: () => void, first: boolean): {}; + } + + export interface i18n { + + rtl: boolean; + + add(code: string, items: Array<{}>): void; + + getCode(): string; + + setCode(newCode: string): void; + + translate(text: string): string; + } + + export interface JSON { + + parse(s: string): {}; + + serialize(obj: {}, quote?: string): string; + } + + export interface JSONRequest { + + send(args: {}): void; + + sendRPC(o: {}): void; + } + + export interface LocalStorage { + + length: number; + + clear(): void; + + getItem(key: string): string; + + key(index: number): string; + + removeItem(key: string): void; + + setItem(key: string, value: string): void; + } + + export interface Observable { + + fire(name: string, args?: {}, bubble?: boolean): {}; + + hasEventListeners(name: string): boolean; + + off(name?: string, callback?: () => void): {}; + + on(name: string, callback: (event: any) => void, first?: boolean): {}; + + once(name: string, callback: (event: any) => void): {}; + } + + export interface Tools { + + create(s: string, p: {}, root?: {}): void; + + createNS(n: string, o?: {}): {}; + + each(o: {}, cb: () => void, s?: {}): void; + + explode(s: string, d: string): void; + + grep(a: T[], f: () => void): T[]; + + inArray(item: T, arr: T[]): number; + + is(obj: {}, type: string): boolean; + + isArray(obj: {}): boolean; + + makeMap(items: T[], delim?: string, map?: {}): {}; + + map(array: T[], callback: (c: T) => S): S[]; + + resolve(n: string, o?: {}): {}; + + toArray(obj: {}): T[]; + + trim(s: string): string; + + walk(o: {}, f: () => void, n?: string, s?: string): void; + } + + export interface URI { + + getURI(noProtoHost: boolean): URI; + + isSameOrigin(uri: TinyMce.util.URI): boolean; + + setPath(path: string): void; + + toAbsPath(base: string, path: string): void; + + toAbsolute(uri: string, noHost: boolean): string; + + toRelPath(base: string, path: string): void; + + toRelative(uri: string): string; + } + + export class URI implements URI { + + constructor(url: string, settings?: {}); + } + + export interface XHR { + + fire(name: string, args?: {}, bubble?: boolean): {}; + + hasEventListeners(name: string): boolean; + + off(name?: string, callback?: () => void): {}; + + on(name: string, callback: () => void, first?: boolean): {}; + + once(name: string, callback: () => void): {}; + + send(settings: {}): void; + } + } } -declare var tinymce: TinyMCE.Static; +declare var tinymce: TinyMce.Static; diff --git a/tinymce/tinymce-tests.ts b/tinymce/tinymce-tests.ts index 3b3f3386f1..18dd5cfbc7 100644 --- a/tinymce/tinymce-tests.ts +++ b/tinymce/tinymce-tests.ts @@ -1,12 +1,17 @@ tinymce.init( { - selector: '.tinymce-editable', - height: 145, + selector: 'textarea', + height: 500, + menubar: false, plugins: [ - 'autolink table contextmenu paste code link textcolor colorpicker image imagetools' + 'advlist autolink lists link image charmap print preview anchor', + 'searchreplace visualblocks code fullscreen', + 'insertdatetime media table contextmenu paste code' ], - menubar: 'edit insert table tools', - toolbar: 'undo redo | styleselect bold italic forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | link image', - content_css: 'page.css' + toolbar: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image', + content_css: '//www.tinymce.com/css/codepen.min.css' } -); \ No newline at end of file +); + + +let t = new TinyMce.util.Color('#FFFFFF'); From 44449d5481a1bec25d9f61bfee04722bb7f8ccaf Mon Sep 17 00:00:00 2001 From: Kang Date: Fri, 10 Mar 2017 15:58:22 +0900 Subject: [PATCH 481/797] Fixed ES6 import error. (#14917) Fixed this error message "resolves to a non-module entity and cannot be imported using this construct." --- file-type/index.d.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/file-type/index.d.ts b/file-type/index.d.ts index a1bc0d8466..3a88fe0a94 100644 --- a/file-type/index.d.ts +++ b/file-type/index.d.ts @@ -5,11 +5,13 @@ /// -interface FileTypeResult { - ext: string - mime: string +export = FileType; + +declare function FileType(buf: Buffer): FileType.FileTypeResult; + +declare namespace FileType { + export interface FileTypeResult { + ext: string; + mime: string; + } } - -declare function FileType(buf: Buffer): FileTypeResult - -export = FileType From 3c07598678e48c8985341bab45d58fbe52c8aa98 Mon Sep 17 00:00:00 2001 From: Anurag Rao Date: Fri, 10 Mar 2017 12:29:11 +0530 Subject: [PATCH 482/797] Moving __DEV__ to global namespace (#14916) --- react-native/index.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/react-native/index.d.ts b/react-native/index.d.ts index 0330d39a90..950451e574 100644 --- a/react-native/index.d.ts +++ b/react-native/index.d.ts @@ -8323,11 +8323,11 @@ declare module "react" { declare global { const global: React.GlobalStatic; function require(name: string): any; -} -/** - * This variable is set to true when react-native is running in Dev mode - * Typical usage: - * if (__DEV__) console.log('Running in dev mode') - */ -declare var __DEV__: boolean + /** + * This variable is set to true when react-native is running in Dev mode + * Typical usage: + * if (__DEV__) console.log('Running in dev mode') + */ + var __DEV__: boolean +} From b50995f7df8ee58e46f4c64dc229ead49b4b59bd Mon Sep 17 00:00:00 2001 From: Calvin Jeong Date: Fri, 10 Mar 2017 19:59:35 +1300 Subject: [PATCH 483/797] Add a definition for `Box3.expandByObject()` in three.js (#14915) Not a documented method yet, but have been included in the latest build (r84) of the library. See mrdoob/three.js#10474 for more info. From 279736f8b2ce760ece5a76ff7c9ccd5de6f75e09 Mon Sep 17 00:00:00 2001 From: Diogo Sant'Ana Date: Fri, 10 Mar 2017 03:59:49 -0300 Subject: [PATCH 484/797] Add fromLabel and toLabel to Locale (#14914) Add fromLabel and toLabel to Locale to daterangepicker --- daterangepicker/index.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/daterangepicker/index.d.ts b/daterangepicker/index.d.ts index 7929474994..d78e06dd97 100644 --- a/daterangepicker/index.d.ts +++ b/daterangepicker/index.d.ts @@ -140,6 +140,14 @@ declare namespace daterangepicker { * Text for apply label. */ applyLabel?: string; + /** + * Text for fromLabel label. + */ + fromLabel?: string; + /** + * Text for toLabel label. + */ + toLabel?: string; /** * Format of the date string. example: 'YYYY-MM-DD' */ From 951a105ad7c3492861201c2aa1331d8913af3c10 Mon Sep 17 00:00:00 2001 From: Ryan Price Date: Fri, 10 Mar 2017 02:00:40 -0500 Subject: [PATCH 485/797] Add react-tether definition (#14913) --- react-tether/index.d.ts | 25 +++++++++++++++++++++++++ react-tether/react-tether-tests.tsx | 16 ++++++++++++++++ react-tether/tsconfig.json | 25 +++++++++++++++++++++++++ react-tether/tslint.json | 2 ++ 4 files changed, 68 insertions(+) create mode 100644 react-tether/index.d.ts create mode 100644 react-tether/react-tether-tests.tsx create mode 100644 react-tether/tsconfig.json create mode 100644 react-tether/tslint.json diff --git a/react-tether/index.d.ts b/react-tether/index.d.ts new file mode 100644 index 0000000000..14344c5476 --- /dev/null +++ b/react-tether/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for react-tether 0.5 +// Project: https://github.com/souporserious/react-tether +// Definitions by: Ryan Price +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +export default TetherComponent; +export as namespace ReactTether; + +import * as React from 'react'; +import * as Tether from 'tether'; + +declare class TetherComponent extends React.Component { } + +declare namespace ReactTether { + export interface TetherComponentProps extends React.Props, Tether.ITetherOptions { + renderElementTag?: string; + renderElementTo?: string | {appendChild: (element: HTMLElement) => void}; + id?: string; + className?: string; + style?: React.CSSProperties; + onUpdate?: () => void; + onRepositioned?: () => void; + } +} diff --git a/react-tether/react-tether-tests.tsx b/react-tether/react-tether-tests.tsx new file mode 100644 index 0000000000..666329621e --- /dev/null +++ b/react-tether/react-tether-tests.tsx @@ -0,0 +1,16 @@ +import TetherComponent from "react-tether"; +import * as React from "react"; + +const ReactTetherAllOptions: JSX.Element = + {}} + onRepositioned={() => {}} + renderElementTag="div" + renderElementTo=".container" + />; + +const ReactTetherRequiredOptions: JSX.Element = + ; \ No newline at end of file diff --git a/react-tether/tsconfig.json b/react-tether/tsconfig.json new file mode 100644 index 0000000000..f2138b25c9 --- /dev/null +++ b/react-tether/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "jsx": "react", + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-tether-tests.tsx" + ] +} + diff --git a/react-tether/tslint.json b/react-tether/tslint.json new file mode 100644 index 0000000000..ccdb64abf2 --- /dev/null +++ b/react-tether/tslint.json @@ -0,0 +1,2 @@ +{ "extends": "../tslint.json" } + From 5eff71dd9c1c3c8da50003007ed6136401804271 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 10 Mar 2017 16:03:22 +0900 Subject: [PATCH 486/797] add new options to introjs (#14912) --- intro.js/index.d.ts | 4 ++++ intro.js/intro.js-tests.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/intro.js/index.d.ts b/intro.js/index.d.ts index d7893018c2..b0925cd41a 100644 --- a/intro.js/index.d.ts +++ b/intro.js/index.d.ts @@ -21,6 +21,8 @@ declare namespace IntroJs { prevLabel?: string; skipLabel?: string; doneLabel?: string; + hidePrev?: boolean; + hideNext?: boolean; tooltipPosition?: string; tooltipClass?: string; highlightClass?: string; @@ -33,10 +35,12 @@ declare namespace IntroJs { showProgress?: boolean; scrollToElement?: boolean; overlayOpacity?: number; + scrollPadding?: number; positionPrecedence?: string[]; disableInteraction?: boolean; hintPosition?: string; hintButtonLabel?: string; + hintAnimation?: boolean; steps?: Step[]; hints?: Hint[]; } diff --git a/intro.js/intro.js-tests.ts b/intro.js/intro.js-tests.ts index 0d79c1bd21..19267a94a3 100644 --- a/intro.js/intro.js-tests.ts +++ b/intro.js/intro.js-tests.ts @@ -8,6 +8,10 @@ intro.setOption('doneLabel', 'Next page'); intro.setOption('overlayOpacity', 50); intro.setOption('showProgress', true); intro.setOptions({ + hidePrev: true, + hideNext: false, + scrollPadding: 30, + hintAnimation: false, steps: [ { intro: "Hello world!" From 572f175d05b1209ec49755949785cd2a2d65da0e Mon Sep 17 00:00:00 2001 From: Bill Kim Date: Fri, 10 Mar 2017 02:03:57 -0500 Subject: [PATCH 487/797] adding keyed partitioner so can overrwrite prototype (#14911) * adding keyed partitioner to can overrwrite prototype * adding close to client/producers * adding myself to Defintitions by * not exporting KeyedPartitioner, passing into HLP and producer --- kafka-node/index.d.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kafka-node/index.d.ts b/kafka-node/index.d.ts index 018b1a6f9e..a9992ccc52 100644 --- a/kafka-node/index.d.ts +++ b/kafka-node/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for kafka-node 1.3.3 // Project: https://github.com/SOHU-Co/kafka-node/ -// Definitions by: Daniel Imrie-Situnayake +// Definitions by: Daniel Imrie-Situnayake , Bill // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -9,22 +9,26 @@ export declare class Client { constructor(connectionString: string, clientId: string, options?: ZKOptions); close(callback?: Function): void; topicExists(topics: Array, callback: Function): void; + refreshMetadata(topics: Array, cb?: (error: any, data: any) => any): void; + close(cb: (error: any) => any): void; } export declare class Producer { - constructor(client: Client); + constructor(client: Client, options?: any, customPartitioner?: any); on(eventName: string, cb: () => any): void; on(eventName: string, cb: (error: any) => any): void; send(payloads: Array, cb: (error: any, data: any) => any): void; createTopics(topics: Array, async: boolean, cb?: (error: any, data: any) => any): void; + close(cb: (error: any) => any): void; } export declare class HighLevelProducer { - constructor(client: Client, options?: any); + constructor(client: Client, options?: any, customPartitioner?: any); on(eventName: string, cb: () => any): void; on(eventName: string, cb: (error: any) => any): void; send(payloads: Array, cb: (error: any, data: any) => any): void; createTopics(topics: Array, async: boolean, cb?: (error: any, data: any) => any): void; + close(cb: (error: any) => any): void; } export declare class Consumer { @@ -96,7 +100,7 @@ export interface ZKOptions { export interface ProduceRequest { topic: string; messages: any; // Array | Array | string | KeyedMessage - key?: string; + key?: any; partition?: number; attributes?: number; } From 99a966dddd29b044334eb851f26e6c5877f388c6 Mon Sep 17 00:00:00 2001 From: Ryan Price Date: Fri, 10 Mar 2017 02:06:07 -0500 Subject: [PATCH 488/797] tether attachment is not optional (#14910) --- tether-drop/tether-drop-tests.ts | 2 +- tether/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tether-drop/tether-drop-tests.ts b/tether-drop/tether-drop-tests.ts index cdfdf030f4..b6069bc76b 100644 --- a/tether-drop/tether-drop-tests.ts +++ b/tether-drop/tether-drop-tests.ts @@ -10,7 +10,7 @@ var d = new Drop({ constrainToWindow: true, constrainToScrollParent: true, classes: "", - tetherOptions: {}, + tetherOptions: {attachment: "bottom left"}, remove: true, target: yellowBox, beforeClose: () => true, diff --git a/tether/index.d.ts b/tether/index.d.ts index 302801f8aa..4a5b1cc2fd 100644 --- a/tether/index.d.ts +++ b/tether/index.d.ts @@ -21,7 +21,7 @@ declare class Tether { declare namespace Tether { interface ITetherOptions { - attachment?: string; + attachment: string; bodyElement?: HTMLElement; classes?: {[className: string]: boolean}; classPrefix?: string; From 8c005f6db9f37eb3cfff09ab0f6333766afe9b90 Mon Sep 17 00:00:00 2001 From: Chaz Clark Date: Fri, 10 Mar 2017 02:06:31 -0500 Subject: [PATCH 489/797] Add overlayStyle prop to RaisedButtonProps. (#14909) This is available per Material-UI docs to allow for styling the raised button's overlay. --- 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 f2285f4809..2268215ae1 100644 --- a/material-ui/index.d.ts +++ b/material-ui/index.d.ts @@ -689,6 +689,7 @@ declare namespace __MaterialUI { onMouseUp?: React.MouseEventHandler<{}>; onTouchEnd?: React.TouchEventHandler<{}>; onTouchStart?: React.TouchEventHandler<{}>; + overlayStyle?: React.CSSProperties; primary?: boolean; rippleStyle?: React.CSSProperties; secondary?: boolean; From 0bd7a61bdfcc8252a39dc308ab9935dd3f2b8cc8 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 9 Mar 2017 23:07:42 -0800 Subject: [PATCH 490/797] Cleaned up docs for sinon-as-promised (#14908) --- sinon-as-promised/index.d.ts | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/sinon-as-promised/index.d.ts b/sinon-as-promised/index.d.ts index ab75217011..5efe4df979 100644 --- a/sinon-as-promised/index.d.ts +++ b/sinon-as-promised/index.d.ts @@ -6,17 +6,22 @@ import * as s from "sinon"; declare module "sinon" { - interface SinonStub { - - /** - * When called, the stub will return a "thenable" object which will return a promise for the provided value. Any Promises/A+ compliant library will handle this object properly. - */ - resolves(value:any):SinonStub; - - /** - * When called, the stub will return a thenable which ill return a reject promise with the provided err. If err is a string, it will be set as the message on an Error object. - */ - rejects(err:any):SinonStub; - } + interface SinonStub { + /** + * Causes the stub to resolve with the provided value. + * + * @param value Resolve value. + * @remarks Any Promises/A+ compliant library will handle this object properly. + */ + resolves(value: T): SinonStub; + /** + * Causes the stub to reject with the provided error. + * + * @param error Rejection error. + * @returns A thenable which will return a rejected promise with the provided error. + * @remarks If error is a string, it will be set as the message on an Error object. + */ + rejects(error: any): SinonStub; + } } From ff4dd92b0e626505c2efb4d45cbe944e3b8e7838 Mon Sep 17 00:00:00 2001 From: vilicvane Date: Fri, 10 Mar 2017 15:19:23 +0800 Subject: [PATCH 491/797] use PromiseLike instead of PromisesAPlus.Thenable (#14902) * use PromiseLike instead of PromisesAPlus.Thenable `PromisesAPlus.Thenable` is not compatible with TypeScript 2.2 `await` (though it should also been updated), but as there are already a bunch of declarations using `PromiseLike`... * update test --- chai-as-promised/chai-as-promised-tests.ts | 6 +- chai-as-promised/index.d.ts | 153 ++++++++++----------- 2 files changed, 78 insertions(+), 81 deletions(-) diff --git a/chai-as-promised/chai-as-promised-tests.ts b/chai-as-promised/chai-as-promised-tests.ts index 0fde03dfa3..7e22c575aa 100644 --- a/chai-as-promised/chai-as-promised-tests.ts +++ b/chai-as-promised/chai-as-promised-tests.ts @@ -1,5 +1,3 @@ - -/// /// import chai = require('chai'); @@ -12,7 +10,7 @@ class TestClass {} // ReSharper disable WrongExpressionStatement // BDD API (expect) -var thenableNum: PromisesAPlus.Thenable; +var thenableNum: PromiseLike; thenableNum = chai.expect(thenableNum).to.eventually.equal(3); thenableNum = chai.expect(thenableNum).to.eventually.have.property('foo'); thenableNum = chai.expect(thenableNum).to.become(3); @@ -56,7 +54,7 @@ Q.all([ ]).should.notify(() => console.log('done')); // Assert API -var thenableVoid: PromisesAPlus.Thenable; +var thenableVoid: PromiseLike; thenableVoid = chai.assert.eventually.equal(thenableNum, 4, 'Message'); thenableVoid = chai.assert.isFulfilled(thenableNum, "optional message"); thenableVoid = chai.assert.becomes(thenableNum, "foo", "optional message"); diff --git a/chai-as-promised/index.d.ts b/chai-as-promised/index.d.ts index b4f3ca405d..4c36eccb61 100644 --- a/chai-as-promised/index.d.ts +++ b/chai-as-promised/index.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// declare module 'chai-as-promised' { function chaiAsPromised(chai: any, utils: any): void; @@ -27,7 +26,7 @@ declare namespace Chai { // Eventually does not have .then(), but PromisedAssertion have. interface Eventually extends PromisedLanguageChains, PromisedNumericComparison, PromisedTypeComparison { // From chai-as-promised - become(expected: PromisesAPlus.Thenable): PromisedAssertion; + become(expected: PromiseLike): PromisedAssertion; fulfilled: PromisedAssertion; rejected: PromisedAssertion; rejectedWith(expected: any, message?: string | RegExp): PromisedAssertion; @@ -74,7 +73,7 @@ declare namespace Chai { members: PromisedMembers; } - interface PromisedAssertion extends Eventually, PromisesAPlus.Thenable { + interface PromisedAssertion extends Eventually, PromiseLike { } interface PromisedLanguageChains { @@ -181,111 +180,111 @@ declare namespace Chai { // For Assert API interface Assert { eventually: PromisedAssert; - isFulfilled(promise: PromisesAPlus.Thenable, message?: string): PromisesAPlus.Thenable; - becomes(promise: PromisesAPlus.Thenable, expected: any, message?: string): PromisesAPlus.Thenable; - doesNotBecome(promise: PromisesAPlus.Thenable, expected: any, message?: string): PromisesAPlus.Thenable; - isRejected(promise: PromisesAPlus.Thenable, message?: string): PromisesAPlus.Thenable; - isRejected(promise: PromisesAPlus.Thenable, expected: any, message?: string): PromisesAPlus.Thenable; - isRejected(promise: PromisesAPlus.Thenable, match: RegExp, message?: string): PromisesAPlus.Thenable; - notify(fn: Function): PromisesAPlus.Thenable; + isFulfilled(promise: PromiseLike, message?: string): PromiseLike; + becomes(promise: PromiseLike, expected: any, message?: string): PromiseLike; + doesNotBecome(promise: PromiseLike, expected: any, message?: string): PromiseLike; + isRejected(promise: PromiseLike, message?: string): PromiseLike; + isRejected(promise: PromiseLike, expected: any, message?: string): PromiseLike; + isRejected(promise: PromiseLike, match: RegExp, message?: string): PromiseLike; + notify(fn: Function): PromiseLike; } export interface PromisedAssert { - fail(actual?: any, expected?: any, msg?: string, operator?: string): PromisesAPlus.Thenable; + fail(actual?: any, expected?: any, msg?: string, operator?: string): PromiseLike; - ok(val: any, msg?: string): PromisesAPlus.Thenable; - notOk(val: any, msg?: string): PromisesAPlus.Thenable; + ok(val: any, msg?: string): PromiseLike; + notOk(val: any, msg?: string): PromiseLike; - equal(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; - notEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; + equal(act: any, exp: any, msg?: string): PromiseLike; + notEqual(act: any, exp: any, msg?: string): PromiseLike; - strictEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; - notStrictEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; + strictEqual(act: any, exp: any, msg?: string): PromiseLike; + notStrictEqual(act: any, exp: any, msg?: string): PromiseLike; - deepEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; - notDeepEqual(act: any, exp: any, msg?: string): PromisesAPlus.Thenable; + deepEqual(act: any, exp: any, msg?: string): PromiseLike; + notDeepEqual(act: any, exp: any, msg?: string): PromiseLike; - isTrue(val: any, msg?: string): PromisesAPlus.Thenable; - isFalse(val: any, msg?: string): PromisesAPlus.Thenable; + isTrue(val: any, msg?: string): PromiseLike; + isFalse(val: any, msg?: string): PromiseLike; - isNull(val: any, msg?: string): PromisesAPlus.Thenable; - isNotNull(val: any, msg?: string): PromisesAPlus.Thenable; + isNull(val: any, msg?: string): PromiseLike; + isNotNull(val: any, msg?: string): PromiseLike; - isUndefined(val: any, msg?: string): PromisesAPlus.Thenable; - isDefined(val: any, msg?: string): PromisesAPlus.Thenable; + isUndefined(val: any, msg?: string): PromiseLike; + isDefined(val: any, msg?: string): PromiseLike; - isFunction(val: any, msg?: string): PromisesAPlus.Thenable; - isNotFunction(val: any, msg?: string): PromisesAPlus.Thenable; + isFunction(val: any, msg?: string): PromiseLike; + isNotFunction(val: any, msg?: string): PromiseLike; - isObject(val: any, msg?: string): PromisesAPlus.Thenable; - isNotObject(val: any, msg?: string): PromisesAPlus.Thenable; + isObject(val: any, msg?: string): PromiseLike; + isNotObject(val: any, msg?: string): PromiseLike; - isArray(val: any, msg?: string): PromisesAPlus.Thenable; - isNotArray(val: any, msg?: string): PromisesAPlus.Thenable; + isArray(val: any, msg?: string): PromiseLike; + isNotArray(val: any, msg?: string): PromiseLike; - isString(val: any, msg?: string): PromisesAPlus.Thenable; - isNotString(val: any, msg?: string): PromisesAPlus.Thenable; + isString(val: any, msg?: string): PromiseLike; + isNotString(val: any, msg?: string): PromiseLike; - isNumber(val: any, msg?: string): PromisesAPlus.Thenable; - isNotNumber(val: any, msg?: string): PromisesAPlus.Thenable; + isNumber(val: any, msg?: string): PromiseLike; + isNotNumber(val: any, msg?: string): PromiseLike; - isBoolean(val: any, msg?: string): PromisesAPlus.Thenable; - isNotBoolean(val: any, msg?: string): PromisesAPlus.Thenable; + isBoolean(val: any, msg?: string): PromiseLike; + isNotBoolean(val: any, msg?: string): PromiseLike; - typeOf(val: any, type: string, msg?: string): PromisesAPlus.Thenable; - notTypeOf(val: any, type: string, msg?: string): PromisesAPlus.Thenable; + typeOf(val: any, type: string, msg?: string): PromiseLike; + notTypeOf(val: any, type: string, msg?: string): PromiseLike; - instanceOf(val: any, type: Function, msg?: string): PromisesAPlus.Thenable; - notInstanceOf(val: any, type: Function, msg?: string): PromisesAPlus.Thenable; + instanceOf(val: any, type: Function, msg?: string): PromiseLike; + notInstanceOf(val: any, type: Function, msg?: string): PromiseLike; - include(exp: string, inc: any, msg?: string): PromisesAPlus.Thenable; - include(exp: any[], inc: any, msg?: string): PromisesAPlus.Thenable; + include(exp: string, inc: any, msg?: string): PromiseLike; + include(exp: any[], inc: any, msg?: string): PromiseLike; - notInclude(exp: string, inc: any, msg?: string): PromisesAPlus.Thenable; - notInclude(exp: any[], inc: any, msg?: string): PromisesAPlus.Thenable; + notInclude(exp: string, inc: any, msg?: string): PromiseLike; + notInclude(exp: any[], inc: any, msg?: string): PromiseLike; - match(exp: any, re: RegExp, msg?: string): PromisesAPlus.Thenable; - notMatch(exp: any, re: RegExp, msg?: string): PromisesAPlus.Thenable; + match(exp: any, re: RegExp, msg?: string): PromiseLike; + notMatch(exp: any, re: RegExp, msg?: string): PromiseLike; - property(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable; - notProperty(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable; - deepProperty(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable; - notDeepProperty(obj: Object, prop: string, msg?: string): PromisesAPlus.Thenable; + property(obj: Object, prop: string, msg?: string): PromiseLike; + notProperty(obj: Object, prop: string, msg?: string): PromiseLike; + deepProperty(obj: Object, prop: string, msg?: string): PromiseLike; + notDeepProperty(obj: Object, prop: string, msg?: string): PromiseLike; - propertyVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable; - propertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable; + propertyVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; + propertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; - deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable; - deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromisesAPlus.Thenable; + deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; + deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): PromiseLike; - lengthOf(exp: any, len: number, msg?: string): PromisesAPlus.Thenable; + lengthOf(exp: any, len: number, msg?: string): PromiseLike; //alias frenzy - throw(fn: Function, msg?: string): PromisesAPlus.Thenable; - throw(fn: Function, regExp: RegExp): PromisesAPlus.Thenable; - throw(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable; - throw(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable; + throw(fn: Function, msg?: string): PromiseLike; + throw(fn: Function, regExp: RegExp): PromiseLike; + throw(fn: Function, errType: Function, msg?: string): PromiseLike; + throw(fn: Function, errType: Function, regExp: RegExp): PromiseLike; - throws(fn: Function, msg?: string): PromisesAPlus.Thenable; - throws(fn: Function, regExp: RegExp): PromisesAPlus.Thenable; - throws(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable; - throws(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable; + throws(fn: Function, msg?: string): PromiseLike; + throws(fn: Function, regExp: RegExp): PromiseLike; + throws(fn: Function, errType: Function, msg?: string): PromiseLike; + throws(fn: Function, errType: Function, regExp: RegExp): PromiseLike; - Throw(fn: Function, msg?: string): PromisesAPlus.Thenable; - Throw(fn: Function, regExp: RegExp): PromisesAPlus.Thenable; - Throw(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable; - Throw(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable; + Throw(fn: Function, msg?: string): PromiseLike; + Throw(fn: Function, regExp: RegExp): PromiseLike; + Throw(fn: Function, errType: Function, msg?: string): PromiseLike; + Throw(fn: Function, errType: Function, regExp: RegExp): PromiseLike; - doesNotThrow(fn: Function, msg?: string): PromisesAPlus.Thenable; - doesNotThrow(fn: Function, regExp: RegExp): PromisesAPlus.Thenable; - doesNotThrow(fn: Function, errType: Function, msg?: string): PromisesAPlus.Thenable; - doesNotThrow(fn: Function, errType: Function, regExp: RegExp): PromisesAPlus.Thenable; + doesNotThrow(fn: Function, msg?: string): PromiseLike; + doesNotThrow(fn: Function, regExp: RegExp): PromiseLike; + doesNotThrow(fn: Function, errType: Function, msg?: string): PromiseLike; + doesNotThrow(fn: Function, errType: Function, regExp: RegExp): PromiseLike; - operator(val: any, operator: string, val2: any, msg?: string): PromisesAPlus.Thenable; - closeTo(act: number, exp: number, delta: number, msg?: string): PromisesAPlus.Thenable; + operator(val: any, operator: string, val2: any, msg?: string): PromiseLike; + closeTo(act: number, exp: number, delta: number, msg?: string): PromiseLike; - sameMembers(set1: any[], set2: any[], msg?: string): PromisesAPlus.Thenable; - includeMembers(set1: any[], set2: any[], msg?: string): PromisesAPlus.Thenable; + sameMembers(set1: any[], set2: any[], msg?: string): PromiseLike; + includeMembers(set1: any[], set2: any[], msg?: string): PromiseLike; - ifError(val: any, msg?: string): PromisesAPlus.Thenable; + ifError(val: any, msg?: string): PromiseLike; } } From 1f7df95edbd642715d537a46212f3f540ae0d558 Mon Sep 17 00:00:00 2001 From: Sergei Dorogin Date: Fri, 10 Mar 2017 10:20:21 +0300 Subject: [PATCH 492/797] Historyjs: added missed methods, arguments and fields (#14899) * Historyjs: changed: * pushState: added queue arg (optional) * replaceState: added queue arg (optional) * getState: added friendly, create args (optional) added: * method getStateId * method getStateById * method setTitle * method clearQueue * method clearAllIntervals * method getRootUrl * field emulated HistroyState: added: * field hashedUrl * field cleanUrl * history.js: added missed return types --- history.js/index.d.ts | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/history.js/index.d.ts b/history.js/index.d.ts index 5a24bd5d73..13d66b8cf6 100644 --- a/history.js/index.d.ts +++ b/history.js/index.d.ts @@ -20,9 +20,11 @@ interface Historyjs { enabled: boolean; - pushState(data: any, title: string, url: string): void; - replaceState(data: any, title: string, url: string): void; - getState(): HistoryState; + pushState(data: any, title: string, url: string, queue?: boolean): boolean; + replaceState(data: any, title: string, url: string, queue?: boolean): boolean; + getState(friendly?: boolean, create?: boolean): HistoryState; + getStateId (passedState: HistoryState): string; + getStateById (id: string): HistoryState; getStateByIndex(index: number): HistoryState; getCurrentIndex(): number; getHash(): string; @@ -37,12 +39,30 @@ interface Historyjs { debug(...messages: any[]): void; options: HistoryOptions; + + /** + * History.setTitle(title) + * Applies the title to the document + * @param {HistoryState} newState + * @return {Boolean} + */ + setTitle (newState: HistoryState): boolean + clearQueue(): Historyjs; + clearAllIntervals(): void; + getRootUrl(): string; + + emulated: { + hashChange?: any; + pushState?: any; + } } interface HistoryState { data?: any; title?: string; url: string; + hashedUrl?: string; + cleanUrl?: string; } interface HistoryOptions { @@ -56,6 +76,4 @@ interface HistoryOptions { initialTitle?: string; html4Mode?: boolean; delayInit?: number; - - } From 637e92c863a3b575b2865d37a59786b28193bee0 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 9 Mar 2017 23:21:23 -0800 Subject: [PATCH 493/797] ng-stomp: Fix in typescript@next (#14898) * Don't use a global `Headers` interface or it will be merged with the one in `lib.d.ts` --- ng-stomp/index.d.ts | 41 ++++++++++------------ ng-stomp/ng-stomp-tests.ts | 72 +++++++++++++++----------------------- ng-stomp/tslint.json | 6 ++++ 3 files changed, 53 insertions(+), 66 deletions(-) create mode 100644 ng-stomp/tslint.json diff --git a/ng-stomp/index.d.ts b/ng-stomp/index.d.ts index d686031bbf..3a91a64844 100644 --- a/ng-stomp/index.d.ts +++ b/ng-stomp/index.d.ts @@ -1,36 +1,31 @@ -// Type definitions for ngStomp +// Type definitions for ngStomp 0.2 // Project: https://github.com/beevelop/ng-stomp // Definitions by: Lukasz Potapczuk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + /// - interface ngStomp { - sock:any; - stomp:any; - debug:any; - off: any; + sock: any; + stomp: any; + debug: any; + off: any; - setDebug:(callback:Function)=> void; - - connect: (endpoint:string, headers?:Headers)=> angular.IHttpPromise; - - disconnect: (callback:()=>void) => angular.IHttpPromise; - - subscribe: (destination:string, callback:(payload:string, headers:Headers, res:Function)=>void, headers?:Headers, scope?:any) => any; - - unsubscribe: () => any; - - send: (destination:string, body:any, headers:Headers)=> any; - - } - - interface Headers { - [key: string]: any; - } + setDebug(callback: Function): void; + connect(endpoint: string, headers?: ngStomp.Headers): angular.IHttpPromise; + disconnect(callback: () => void): angular.IHttpPromise; + subscribe(destination: string, callback: (payload: string, headers: ngStomp.Headers, res: Function) => void, headers?: ngStomp.Headers, scope?: any): any; + unsubscribe(): any; + send(destination: string, body: any, headers: ngStomp.Headers): any; +} +declare namespace ngStomp { + interface Headers { + [key: string]: any; + } +} diff --git a/ng-stomp/ng-stomp-tests.ts b/ng-stomp/ng-stomp-tests.ts index b579a3aa06..c1b662d1a5 100644 --- a/ng-stomp/ng-stomp-tests.ts +++ b/ng-stomp/ng-stomp-tests.ts @@ -1,48 +1,34 @@ -/// +class test { + constructor(private ngstomp: ngStomp) { + const connectHeaders = { + Auth: "user", + Accept: "lol" + }; -namespace ngStompTesting { + ngstomp.connect('/endpoint', connectHeaders) + // frame = CONNECTED headers + .then(function (frame) { + this.subscription = ngstomp.subscribe('/dest', function (payload, headers, res) { + this.payload = payload; + }, { + headers: "are awesome" + }); - "use strict"; - var ngStompTest = "ngStompTest"; + // Unsubscribe + this.subscription.unsubscribe(); - class test { - constructor(private ngstomp:ngStomp) { - var connectHeaders ={ - "Auth": "user", - "Accept": "lol" - }; + // Send message + ngstomp.send('/dest', { + message: 'body' + }, { + priority: 9, + custom: 42 //Custom Headers + }); - ngstomp.connect('/endpoint', connectHeaders) - - - // frame = CONNECTED headers - .then(function (frame) { - - this.subscription = ngstomp.subscribe('/dest', function (payload, headers, res) { - this.payload = payload; - }, { - "headers": "are awesome" - }); - - // Unsubscribe - this.subscription.unsubscribe(); - - // Send message - ngstomp.send('/dest', { - message: 'body' - }, { - priority: 9, - custom: 42 //Custom Headers - }); - - // Disconnect - ngstomp.disconnect(function () { - - }); - }); - } - - } - - angular.module("app").controller(ngStompTest, test); + // Disconnect + ngstomp.disconnect(() => {}); + }); + } } + +angular.module("app").controller("ngStompTest", test); diff --git a/ng-stomp/tslint.json b/ng-stomp/tslint.json new file mode 100644 index 0000000000..2ab0c36fa8 --- /dev/null +++ b/ng-stomp/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "forbidden-types": false + } +} \ No newline at end of file From f630485bb188f5e5625c5b9f1921a19b8ddac5b3 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 9 Mar 2017 23:21:45 -0800 Subject: [PATCH 494/797] Fix more lint errors in tests (#14903) --- is-array/is-array-tests.ts | 2 +- jimp/jimp-tests.ts | 65 +-- jquery.tools/jquery.tools-tests.ts | 11 +- ltx/ltx-tests.ts | 4 +- node-xmpp-client/node-xmpp-client-tests.ts | 6 +- phonon/phonon-tests.ts | 408 +++++++++--------- promised-temp/promised-temp-tests.ts | 3 +- .../protractor-browser-logs-tests.ts | 22 +- xmpp-jid/xmpp-jid-tests.ts | 2 +- 9 files changed, 258 insertions(+), 265 deletions(-) diff --git a/is-array/is-array-tests.ts b/is-array/is-array-tests.ts index 9a8e252e05..327c2ea3d0 100644 --- a/is-array/is-array-tests.ts +++ b/is-array/is-array-tests.ts @@ -7,7 +7,7 @@ isArray(true); isArray([]); isArray({}); -var x = {} +var x = {}; if (isArray(x)) { x.push(0); } diff --git a/jimp/jimp-tests.ts b/jimp/jimp-tests.ts index fd1ed1d2b7..a312cd4586 100644 --- a/jimp/jimp-tests.ts +++ b/jimp/jimp-tests.ts @@ -1,4 +1,4 @@ -import Jimp = require('jimp') +import Jimp = require('jimp'); // All code below is from node-jimp document Jimp.read("lenna.png", (err, data) => { @@ -36,20 +36,20 @@ Jimp.read("http://www.example.com/path/to/lenna.jpg", (err, image) => { // do stuff with the image (if no exception) }); -var image = new Jimp(1, 2) -var w = 0 -var h = 0 -var x = 0 -var y = 0 -var f = 0 -var src = '' -var horz = Jimp.HORIZONTAL_ALIGN_CENTER -var vert = Jimp.VERTICAL_ALIGN_BOTTOM -var deg = 90 -var val = 0.5 -var hex = 0xFFFFFFFF -var r = 0 -var n = 1 +var image = new Jimp(1, 2); +var w = 0; +var h = 0; +var x = 0; +var y = 0; +var f = 0; +var src = ''; +var horz = Jimp.HORIZONTAL_ALIGN_CENTER; +var vert = Jimp.VERTICAL_ALIGN_BOTTOM; +var deg = 90; +var val = 0.5; +var hex = 0xFFFFFFFF; +var r = 0; +var n = 1; /* Resize */ image.contain(w, h); // scale the image to the given width and height, some parts of the image may be letter boxed image.cover(w, h); // scale the image to the given width and height, some parts of the image may be clipped @@ -72,6 +72,7 @@ image.mask(src, x, y); // masks the image with another Jimp image at x, /* Flip and rotate */ image.flip(horz, vert); // flip the image horizontally or vertically image.mirror(horz, vert); // an alias for flip + // rotate the image clockwise by a number of degrees. // Optionally, a resize mode can be passed. // If `false` is passed as the second parameter, @@ -92,7 +93,7 @@ image.normalize(); // normalize the channels in an image image.fade(f); // an alternative to opacity, fades the image by a factor 0 - 1. 0 will haven no effect. 1 will turn the image image.opacity(f); // multiply the alpha channel by each pixel by the factor f, 0 - 1 image.opaque(); // set the alpha channel on every pixel to fully opaque -image.background(hex); // set the default new pixel colour (e.g. 0xFFFFFFFF or 0x00000000) for by some operations (e.g. image.contain and +image.background(hex); // set the default new pixel colour (e.g. 0xFFFFFFFF or 0x00000000) for by some operations (e.g. image.contain and /* Blurs */ image.gaussian(r); // Gaussian blur the image by r pixels (VERY slow) @@ -111,15 +112,15 @@ image.resize(250, 250, Jimp.RESIZE_BEZIER); image.contain(250, 250, Jimp.HORIZONTAL_ALIGN_LEFT | Jimp.VERTICAL_ALIGN_TOP); -var path = '' -var str = '' -var width = 0 +var path = ''; +var str = ''; +var width = 0; Jimp.loadFont(path).then(font => { // load font from .fnt file image.print(font, x, y, str); // print a message on an image image.print(font, x, y, str, width); // print a message on an image with text wrapped at width }); -var cb = (err: Error, data: any) => {} +var cb = (err: Error, data: any) => {}; Jimp.loadFont(path, cb); // using a callback pattern Jimp.loadFont(Jimp.FONT_SANS_32_BLACK).then(font => { @@ -129,16 +130,16 @@ Jimp.loadFont(Jimp.FONT_SANS_32_BLACK).then(font => { image.write(path, cb); // Node-style callback will be fired when write is successful var file = "new_name." + image.getExtension(); -image.write(file) +image.write(file); -var mime = 'image/png' +var mime = 'image/png'; image.getBuffer(mime, cb); // Node-style callback will be fired with result image.getBase64(mime, cb); // Node-style callback will be fired with result image.quality(n); // set the quality of saved JPEG, 0 - 100 -var bool = true -var number = 0 +var bool = true; +var number = 0; image.rgba(bool); // set whether PNGs are saved as RGBA (true, default) or RGB (false) image.filterType(number); // set the filter type for the saved PNG image.deflateLevel(number); // set the deflate level for the saved PNG @@ -149,11 +150,11 @@ image.color([ { apply: 'lighten', params: [ 50 ] }, { apply: 'xor', params: [ '#06D' ] } ]); - image.convolution([ +image.convolution([ [-2, -1, 0], [-1, 1, 1], [ 0, 1, 2] - ]) +]); image.scan(0, 0, image.bitmap.width, image.bitmap.height, function(x, y, idx) { // x, y is the position of this pixel on the image // idx is the position start position of this rgba tuple in the bitmap Buffer @@ -170,9 +171,9 @@ image.scan(0, 0, image.bitmap.width, image.bitmap.height, function(x, y, idx) { image.getPixelColor(x, y); // returns the colour of that pixel e.g. 0xFFFFFFFF image.setPixelColor(hex, x, y); // sets the colour of that pixel -var g = 0 -var b = 0 -var a = 0 +var g = 0; +var b = 0; +var a = 0; Jimp.rgbaToInt(r, g, b, a); // e.g. converts 255, 255, 255, 255 to 0xFFFFFFFF Jimp.intToRGBA(hex); // e.g. converts 0xFFFFFFFF to {r: 255, g: 255, b: 255, a:255} @@ -187,11 +188,11 @@ var image = new Jimp(256, 256, 0xFF0000FF, (err, image) => { image.hash(); // aHgG4GgoFjA image.hash(2); // 1010101011010000101010000100101010010000011001001001010011100100 -var image1 = new Jimp(0, 1) -var image2 = new Jimp(0, 1) +var image1 = new Jimp(0, 1); +var image2 = new Jimp(0, 1); Jimp.distance(image1, image2); // returns a number 0-1, where 0 means the two images are perceived to be identical -var threshold = 0 +var threshold = 0; var diff = Jimp.diff(image1, image2, threshold); // threshold ranges 0-1 (default: 0.1) diff.image; // a Jimp image showing differences diff.percent; // the proportion of different pixels (0-1), where 0 means the images are pixel identical diff --git a/jquery.tools/jquery.tools-tests.ts b/jquery.tools/jquery.tools-tests.ts index f8a4e39f90..0a435ccf02 100644 --- a/jquery.tools/jquery.tools-tests.ts +++ b/jquery.tools/jquery.tools-tests.ts @@ -40,7 +40,7 @@ $("#prompt form").submit(function(this: JQuery, e: JQueryEventObject) {   // close the overlay triggers.eq(1).overlay().close(); - //or more straightforward: + // or more straightforward: triggers.data('overlay').close();   // get user input @@ -53,7 +53,7 @@ $("#prompt form").submit(function(this: JQuery, e: JQueryEventObject) { return e.preventDefault(); }); -$.tools.overlay.addEffect('', function() {}, function() {}); +$.tools.overlay.addEffect('', () => {}, () => {}); /* custom effects */ $.tools.overlay.addEffect("myEffect", function(position, done) { @@ -101,8 +101,7 @@ $(function() { mask: 'darkred', effect: 'apple',   - onBeforeLoad: function() { -  + onBeforeLoad() { // grab wrapper element inside content var wrap = this.getOverlay().find(".contentWrap");   @@ -113,7 +112,7 @@ $(function() { }); }); -$(function() { +$(() => { // positions for each overlay var positions = [ [0, 530], @@ -169,7 +168,7 @@ $.tools.overlay.addEffect("drop", function(css, done) { /* closing animation */ }, function(done) { this.getOverlay().animate( - {top:'-=55', opacity:0, width:'-=20'}, 300, 'drop', + { top: '-=55', opacity: 0, width: '-=20' }, 300, 'drop', function(this: JQuery) { $(this).hide(); done.call(null); diff --git a/ltx/ltx-tests.ts b/ltx/ltx-tests.ts index a207efb4b7..9e924cbe60 100644 --- a/ltx/ltx-tests.ts +++ b/ltx/ltx-tests.ts @@ -2,13 +2,13 @@ import * as ltx from './index'; ltx.parse(''); -let p = new ltx.Parser(); +const p = new ltx.Parser(); p.on('tree', (ignored: any) => {}); p.on('error', (ignored: any) => {}); -let el = new ltx.Element('root').c('children'); +const el = new ltx.Element('root').c('children'); el.c('child', {age: 5}).t('Hello').up() .c('child', {age: 7}).t('Hello').up() .c('child', {age: 99}).t('Hello').up(); diff --git a/node-xmpp-client/node-xmpp-client-tests.ts b/node-xmpp-client/node-xmpp-client-tests.ts index 734067738e..0f7a4205ac 100644 --- a/node-xmpp-client/node-xmpp-client-tests.ts +++ b/node-xmpp-client/node-xmpp-client-tests.ts @@ -1,6 +1,6 @@ import {Client} from './index'; -let client = new Client({ +const client = new Client({ jid: 'user@example.com', password: 'password' }); @@ -10,10 +10,10 @@ client.connect(); client.on('online', () => {}); client.on('stanza', stanza => { - let _ = stanza; + const _ = stanza; }); -let stanza = new Client.Stanza('chat', {}) +const stanza = new Client.Stanza('chat', {}) .c('show').t('chat').up() .c('status').t('message'); client.send(stanza); diff --git a/phonon/phonon-tests.ts b/phonon/phonon-tests.ts index 0d5df50b4e..b817fef45b 100644 --- a/phonon/phonon-tests.ts +++ b/phonon/phonon-tests.ts @@ -19,23 +19,22 @@ phonon.options({ }); phonon.navigator().on({ - page: 'pagename', - content: 'content.html', - preventClose: false, - readyDelay: 1 -}, function(activity) { - activity.onCreate(function() {}); - activity.onReady(function() {}); - activity.onTransitionEnd(function() {}); - activity.onClose(function(self) {}); - activity.onHidden(function() {}); - activity.onHashChanged(function(req1, req2) {}); - activity.onTabChanged(function() {}) + page: 'pagename', + content: 'content.html', + preventClose: false, + readyDelay: 1 +}, activity => { + activity.onCreate(() => {}); + activity.onReady(() => {}); + activity.onTransitionEnd(() => {}); + activity.onClose(self => {}); + activity.onHidden(() => {}); + activity.onHashChanged((req1, req2) => {}); + activity.onTabChanged(() => {}); }); -phonon.navigator().onPage('home').addEvent('create', function () { -}); -phonon.navigator().onPage('home').addEvent('close', function (api) { +phonon.navigator().onPage('home').addEvent('create', () => {}); +phonon.navigator().onPage('home').addEvent('close', api => { api.close(); }); @@ -47,11 +46,11 @@ page = phonon.navigator().previousPage; let ev = document.createEvent(''); -document.on('pagecreated', function(event) { - console.log('global state pagecreated: ' + event.detail.page) +document.on('pagecreated', event => { + console.log('global state pagecreated: ' + event.detail.page); }); -document.on('pagehash', function(event) { - console.log('global state pagehash: ' + event.detail.page) +document.on('pagehash', event => { + console.log('global state pagehash: ' + event.detail.page); console.log(event.detail.req[0]); console.log(event.detail.req[1]); console.log(event.detail.req[2]); @@ -60,13 +59,13 @@ document.on('pagehash', function(event) { // Code examples from http://phonon.quarkdev.com/docs/i18n let element = document.createElement(''); phonon.i18n().bind(); -phonon.i18n().bind(function() {}); +phonon.i18n().bind(() => {}); phonon.i18n().bind(element); -phonon.i18n().bind(element, function() {}); +phonon.i18n().bind(element, () => {}); -phonon.i18n().getAll(function(json) {}); -phonon.i18n().get('my_key', function(value) {}); -phonon.i18n().get(['my_key_1', 'my_key_two'], function(values) {}); +phonon.i18n().getAll(json => {}); +phonon.i18n().get('my_key', value => {}); +phonon.i18n().get(['my_key_1', 'my_key_two'], values => {}); phonon.updateLocale('new-language'); phonon.i18n().setPreference("fr"); @@ -86,10 +85,10 @@ var req = phonon.ajax({ 'header-name1': 'value1', 'header-name2': 'value2' }, - success: function(res, xhr) { + success(res, xhr) { console.log(res); }, - error: function(res, flagError, xhr) { + error(res, flagError, xhr) { console.error(flagError); console.log(res); } @@ -104,14 +103,14 @@ let browsername: string = phonon.browser.name; let browserVersion: string = phonon.browser.version; // Code examples from http://phonon.quarkdev.com/docs/events -element.on('tap', function() {}); -phonon.onReady(function() {}); -document.querySelectorAll('.elements').on('tap', function() {}); +element.on('tap', () => {}); +phonon.onReady(() => {}); +document.querySelectorAll('.elements').on('tap', () => {}); -element.off('tap', function() {}); -document.querySelectorAll('.elements').off('tap', function() {}); +element.off('tap', () => {}); +document.querySelectorAll('.elements').off('tap', () => {}); -document.on('pageopened', function(evt) { +document.on('pageopened', evt => { console.log(evt.detail.page + ' is opened'); }); @@ -128,22 +127,22 @@ phonon.sidePanel('#side-panel-id').close(); // Code examples from http://phonon.quarkdev.com/docs/dialogs let pAlert = phonon.alert("text", "title", true, "textOk"); -pAlert.on('confirm', function() {}); +pAlert.on('confirm', () => {}); var pconfirm = phonon.confirm("text", "title", true, "textOk", "textCancel"); -pconfirm.on('confirm', function() {}) -pconfirm.on('cancel', function() {}); +pconfirm.on('confirm', () => {}); +pconfirm.on('cancel', () => {}); let pPrompt = phonon.prompt("text", "title", true, "textOk", "textCancel"); -pPrompt.on('confirm', function(inputValue) {}) -pPrompt.on('cancel', function() {}); +pPrompt.on('confirm', inputValue => {}); +pPrompt.on('cancel', () => {}); phonon.indicator("title", true); let myDialog = phonon.dialog('#my-dialog'); myDialog.open(); myDialog.close(); -myDialog.on('confirm', function() {}); +myDialog.on('confirm', () => {}); // Code examples from http://phonon.quarkdev.com/docs/notifications let notif = phonon.notif('Hello', 3000, true, 'CANCEL'); @@ -168,7 +167,7 @@ popover.setList([ value: 'tg' } ]); -popover.setList(['a', 'b', 'c'], function (item) { +popover.setList(['a', 'b', 'c'], item => { var text = typeof item === 'string' ? item : item.text; var value = typeof item === 'string' ? item : item.value; return '
  • ' + text + '
  • '; @@ -180,18 +179,18 @@ popover.attachButton(element, true); popover.openFrom('.button-for-popover'); popover.openFrom(element); -popover.onItemChanged(function (data) { - console.log('onItemChanged') - console.error(data) +popover.onItemChanged(data => { + console.log('onItemChanged'); + console.error(data); }); -element.on('itemchanged', function(event) { +element.on('itemchanged', event => { console.log(event.detail); }); popover = phonon.popover() .setList(['a', 'b', 'c']) .attachButton('.my-button', true) - .onItemChanged(function (data) { + .onItemChanged(data => { console.log(data); }).openFrom('.my-button'); @@ -220,39 +219,39 @@ phonon.options({ let app = phonon.navigator(); app.on({page: 'home', preventClose: false, content: null}); -app.on({page: 'pagetwo', preventClose: true, content: 'pagetwo.html', readyDelay: 1}, function(activity) { +app.on({page: 'pagetwo', preventClose: true, content: 'pagetwo.html', readyDelay: 1}, activity => { let action: string | null = null; - var onAction = function(evt: any) { + var onAction = (evt: any) => { var target = evt.target; action = 'ok'; - if(target.getAttribute('data-order') === 'order') { + if (target.getAttribute('data-order') === 'order') { phonon.alert('Thank you for your order!', 'Dear customer'); } else { phonon.alert('Your order has been canceled.', 'Dear customer'); } }; - activity.onCreate(function() { - let order = document.querySelector('.order'); + activity.onCreate(() => { + const order = document.querySelector('.order'); if (order != null) { order.on('tap', onAction); } - let cancel = document.querySelector('.cancel'); + const cancel = document.querySelector('.cancel'); if (cancel != null) { cancel.on('tap', onAction); } }); - activity.onClose(function(self) { - if(action !== null) { + activity.onClose(self => { + if (action !== null) { self.close(); } else { phonon.alert('Before leaving this page, you must perform an action.', 'Action required'); } }); - activity.onHidden(function() { + activity.onHidden(() => { action = null; }); - activity.onHashChanged(function(pizza) { - let pizzaElt = document.querySelector('.pizza'); + activity.onHashChanged(pizza => { + const pizzaElt = document.querySelector('.pizza'); if (pizzaElt != null) { pizzaElt.textContent = pizza; } @@ -262,66 +261,66 @@ app.start(); // Code example from http://phonon.quarkdev.com/App/public/phonon/kitchen-sink/index.html phonon.options({ - navigator: { - defaultPage: 'home', - animatePages: true, - templateRootDirectory: 'contents/', - enableBrowserBackButton: true // should be disabled on Cordova - }, - i18n: { - directory: 'lang/', - localeFallback: 'en', - localePreferred: 'en-US' - } + navigator: { + defaultPage: 'home', + animatePages: true, + templateRootDirectory: 'contents/', + enableBrowserBackButton: true // should be disabled on Cordova + }, + i18n: { + directory: 'lang/', + localeFallback: 'en', + localePreferred: 'en-US' + } }); var app2 = phonon.navigator(); app2.on({page: 'home', content: 'home.html'}); -app2.on({page: 'pagedialog', content: 'pagedialog.html'}, function(activity) { - activity.onCreate(function() { - let showAlert = document.querySelector('#show-alert'); - if (showAlert) { - showAlert.on('tap', function() { - phonon.alert('Example', 'Hello'); - }); - } +app2.on({page: 'pagedialog', content: 'pagedialog.html'}, activity => { + activity.onCreate(() => { + const showAlert = document.querySelector('#show-alert'); + if (showAlert) { + showAlert.on('tap', () => { + phonon.alert('Example', 'Hello'); + }); + } - let showConfirm = document.querySelector('#show-confirm'); - if (showConfirm) { - showConfirm.on('tap', function() { - let confirm = phonon.confirm('Example', 'Hello'); - confirm.on('confirm', function() { - phonon.alert('Confirmed!'); - }); - confirm.on('cancel', function(value) { - phonon.alert('Canceled!'); - }); - }); - } + const showConfirm = document.querySelector('#show-confirm'); + if (showConfirm) { + showConfirm.on('tap', () => { + const confirm = phonon.confirm('Example', 'Hello'); + confirm.on('confirm', () => { + phonon.alert('Confirmed!'); + }); + confirm.on('cancel', value => { + phonon.alert('Canceled!'); + }); + }); + } - let showPrompt = document.querySelector('#show-prompt'); - if (showPrompt) { - showPrompt.on('tap', function() { - var prompt = phonon.prompt('Example', 'Hello'); - prompt.on('confirm', function(value) { - phonon.alert(value, 'Inserted Value'); + const showPrompt = document.querySelector('#show-prompt'); + if (showPrompt) { + showPrompt.on('tap', () => { + var prompt = phonon.prompt('Example', 'Hello'); + prompt.on('confirm', value => { + phonon.alert(value, 'Inserted Value'); + }); + prompt.on('cancel', () => { + phonon.alert('Prompt Canceled'); + }); }); - prompt.on('cancel', function() { - phonon.alert('Prompt Canceled'); - }); - }); - } + } - let showIndicator = document.querySelector('#show-indicator'); - if (showIndicator) { - showIndicator.on('tap', function() { - let indicator = phonon.indicator('Please wait 3 seconds', false); - window.setTimeout(function() { - indicator.close(); - }, 3000); - }); - } - }); + const showIndicator = document.querySelector('#show-indicator'); + if (showIndicator) { + showIndicator.on('tap', () => { + const indicator = phonon.indicator('Please wait 3 seconds', false); + window.setTimeout(() => { + indicator.close(); + }, 3000); + }); + } + }); }); app2.on({page: 'pageform', content: 'pageform.html'}); @@ -331,69 +330,66 @@ app2.on({page: 'pagegrid', content: 'pagegrid.html'}); app2.on({page: 'pagelist', content: 'pagelist.html'}); app2.on({page: 'pageaccordion', content: 'pageaccordion.html'}); -app2.on({page: 'pagenotif', content: 'pagenotif.html', readyDelay: 500}, function(activity) { +app2.on({page: 'pagenotif', content: 'pagenotif.html', readyDelay: 500}, activity => { + activity.onCreate(() => { + const showAutoNotif = document.querySelector('#show-auto-notif'); + if (showAutoNotif) { + showAutoNotif.on('tap', () => { + phonon.notif('HELLO', 3000, false); + }); + } - activity.onCreate(function() { - let showAutoNotif = document.querySelector('#show-auto-notif'); - if (showAutoNotif) { - showAutoNotif.on('tap', function() { - phonon.notif('HELLO', 3000, false); - }); - } + const showNotif = document.querySelector('#show-notif'); + if (showNotif) { + showNotif.on('tap', () => { + phonon.notif('#notif-example').show(); + }); + } - let showNotif = document.querySelector('#show-notif'); - if (showNotif) { - showNotif.on('tap', function() { - phonon.notif('#notif-example').show(); - }); - } + const showNotifButton = document.querySelector('#show-notif-button'); + if (showNotifButton) { + showNotifButton.on('tap', () => { + phonon.notif('HELLO', 3000, true, 'Bye'); + }); + } + }); - let showNotifButton = document.querySelector('#show-notif-button'); - if (showNotifButton) { - showNotifButton.on('tap', function() { - phonon.notif('HELLO', 3000, true, 'Bye'); - }); - } - }); - - activity.onReady(function() { - phonon.notif('Welcome!', 3000, true); - - }); + activity.onReady(() => { + phonon.notif('Welcome!', 3000, true); + }); }); app2.on({page: 'pagepanel', content: 'pagepanel.html'}); app2.on({page: 'pagepopover', content: 'pagepopover.html'}); -app2.on({page: 'pagepreloader', content: 'pagepreloader.html'}, function(activity) { +app2.on({page: 'pagepreloader', content: 'pagepreloader.html'}, activity => { + activity.onReady(() => { + const myCircle = document.querySelector('#my-circle'); + if (myCircle) { + phonon.preloader(myCircle).show(); + } + const myDeterminate = document.querySelector('#my-determinate'); + if (myDeterminate) { + phonon.preloader(myDeterminate).show(); + } + }); - activity.onReady(function() { - let myCircle = document.querySelector('#my-circle'); - if (myCircle) { - phonon.preloader(myCircle).show(); - } - let myDeterminate = document.querySelector('#my-determinate'); - if (myDeterminate) { - phonon.preloader(myDeterminate).show(); - } - }); - - activity.onHidden(function() { - let myCircle = document.querySelector('#my-circle'); - if (myCircle) { - phonon.preloader(myCircle).hide(); - } - let myDeterminate = document.querySelector('#my-determinate'); - if (myDeterminate) { - phonon.preloader(myDeterminate).hide(); - } - }); + activity.onHidden(() => { + const myCircle = document.querySelector('#my-circle'); + if (myCircle) { + phonon.preloader(myCircle).hide(); + } + const myDeterminate = document.querySelector('#my-determinate'); + if (myDeterminate) { + phonon.preloader(myDeterminate).hide(); + } + }); }); app2.on({page: 'pagesidepanel', content: 'pagesidepanel.html'}); app2.on({page: 'pagetable', content: 'pagetable.html'}); -app2.on({page: 'pagetabs', content: 'pagetabs.html'}, function(activity) { - activity.onTabChanged(function(tabNumber) { - let tab = document.querySelector('.tab-number'); +app2.on({page: 'pagetabs', content: 'pagetabs.html'}, activity => { + activity.onTabChanged(tabNumber => { + const tab = document.querySelector('.tab-number'); if (tab) { tab.innerHTML = tabNumber + ""; } @@ -417,29 +413,27 @@ phonon.options({ }, i18n: null }); -phonon.navigator().on({ page: 'home' }, function(activity) { - activity.onReady(function(){ - // input where user typed words to query - let input = document.querySelector( '#searchJS' ); +phonon.navigator().on({ page: 'home' }, activity => { + activity.onReady(() => { + // input where user typed words to query + const input = document.querySelector( '#searchJS' ); let list = ''; // external autocomplete var req = phonon.ajax({ method: "GET", - url: 'https://restcountries.eu/rest/v1/lang/en', - dataType: "json", - success: function( res, xhr ){ - list = res.map( function(i: any){ - return i.name; - }); - // initialize autocomplete + url: 'https://restcountries.eu/rest/v1/lang/en', + dataType: "json", + success(res, xhr) { + list = res.map((i: any) => i.name); + // initialize autocomplete if (input) { - phonon.autocomplete( input, {list:list} ); + phonon.autocomplete(input, {list}); } - }, - error: function( res, flagError, xhr ){ + }, + error(res, flagError, xhr) { console.error(flagError); - console.log(res); - } + console.log(res); + } }); }); }); @@ -457,23 +451,23 @@ phonon.options({ }); let app3 = phonon.navigator(); -app3.on({page: 'home', content: null}, function(activity) { - activity.onCreate(function() { +app3.on({page: 'home', content: null}, activity => { + activity.onCreate(() => { let element = document.querySelector('#show-alert'); if (element) { - element.on('tap', function() { + element.on('tap', () => { phonon.alert('Example', 'Hello'); }); } element = document.querySelector('#show-confirm'); if (element) { - element.on('tap', function() { + element.on('tap', () => { var confirm = phonon.confirm('Example', 'Hello'); - confirm.on('confirm', function() { + confirm.on('confirm', () => { phonon.alert('Confirmed!'); }); - confirm.on('cancel', function(value) { + confirm.on('cancel', value => { phonon.alert('Canceled!'); }); }); @@ -481,12 +475,12 @@ app3.on({page: 'home', content: null}, function(activity) { element = document.querySelector('#show-prompt'); if (element) { - element.on('tap', function() { + element.on('tap', () => { var prompt = phonon.prompt('Example', 'Hello'); - prompt.on('confirm', function(value) { + prompt.on('confirm', value => { phonon.alert(value, 'Inserted Value'); }); - prompt.on('cancel', function() { + prompt.on('cancel', () => { phonon.alert('Prompt Canceled'); }); }); @@ -494,11 +488,11 @@ app3.on({page: 'home', content: null}, function(activity) { element = document.querySelector('#show-indicator'); if (element) { - element.on('tap', function() { + element.on('tap', () => { var indicator = phonon.indicator('Please wait 3 seconds', false); - window.setTimeout(function() { + window.setTimeout(() => { indicator.close(); - },3000); + }, 3000); }); } }); @@ -516,27 +510,27 @@ let elSetEnUs = document.querySelector('.set-en-us'); let defaultLocale = 'fr'; function setupHTML() { - let pref = (phonon.i18n().getPreference() ? phonon.i18n().getPreference() : 'not used'); - if (elPrefLang) { - elPrefLang.textContent = 'Preferred language : ' + pref; - } - if (elLang) { - elLang.textContent = 'Locale language : ' + phonon.i18n().getLocale(); - } - if (elDefault) { - elDefault.textContent = 'Default language : ' + defaultLocale; - } + const pref = (phonon.i18n().getPreference() ? phonon.i18n().getPreference() : 'not used'); + if (elPrefLang) { + elPrefLang.textContent = 'Preferred language : ' + pref; + } + if (elLang) { + elLang.textContent = 'Locale language : ' + phonon.i18n().getLocale(); + } + if (elDefault) { + elDefault.textContent = 'Default language : ' + defaultLocale; + } - // The parameter is optional, if you pass nothing, i18n will bind all the document - phonon.i18n().bind(); + // The parameter is optional, if you pass nothing, i18n will bind all the document + phonon.i18n().bind(); } -var setPreference = function (evt: any) { - var target = evt.target; - var lang = target.getAttribute('data-l'); - if(lang) { - phonon.updateLocale(lang); - } +var setPreference = (evt: any) => { + var target = evt.target; + var lang = target.getAttribute('data-l'); + if (lang) { + phonon.updateLocale(lang); + } }; if (elSetFr) { @@ -553,9 +547,9 @@ phonon.options({ defaultPage: 'home', }, i18n: { - directory: 'res/lang/', - localeFallback: defaultLocale, - localePreferred: 'en' + directory: 'res/lang/', + localeFallback: defaultLocale, + localePreferred: 'en' } }); setupHTML(); diff --git a/promised-temp/promised-temp-tests.ts b/promised-temp/promised-temp-tests.ts index 2b77184e25..ebe0a51517 100644 --- a/promised-temp/promised-temp-tests.ts +++ b/promised-temp/promised-temp-tests.ts @@ -9,8 +9,7 @@ function testCleanup() { temp.cleanup().then((result: boolean | Stats) => { if (typeof result === "boolean") { const x = result === true; - } - else { + } else { const { files, dirs } = result; files.toPrecision(4); } diff --git a/protractor-browser-logs/protractor-browser-logs-tests.ts b/protractor-browser-logs/protractor-browser-logs-tests.ts index 8e2e0ac015..75af9eb039 100644 --- a/protractor-browser-logs/protractor-browser-logs-tests.ts +++ b/protractor-browser-logs/protractor-browser-logs-tests.ts @@ -4,7 +4,7 @@ import * as webdriver from 'selenium-webdriver'; import Entry = webdriver.logging.Entry; function colored(entries: Entry[]) { - let colors: any = { INFO: 35 /* magenta */, WARNING: 33 /* yellow */, SEVERE: 31 /* red */}; + const colors: any = { INFO: 35 /* magenta */, WARNING: 33 /* yellow */, SEVERE: 31 /* red */}; entries.forEach((entry: Entry) => { console.log('\u001b[' + (colors[entry.level.name] || 37) + 'm' + [entry.level.name, entry.message].join(': ') + '\u001b[39m'); }); @@ -17,7 +17,7 @@ function testCreateFunction() { } function testLogLevels() { - let logs = browserLogs(browser); + const logs = browserLogs(browser); logs.ignore(logs.ERROR); logs.expect(logs.WARNING); @@ -27,48 +27,48 @@ function testLogLevels() { } function testPredicateFunctions() { - let logs = browserLogs(browser); + const logs = browserLogs(browser); logs.ignore(logs.or(logs.ERROR, logs.WARNING)); logs.expect(logs.and(logs.DEBUG, logs.INFO)); } function testRegExp() { - let logs = browserLogs(browser); + const logs = browserLogs(browser); logs.ignore(/foo/i); logs.expect(new RegExp('/foo/i')); } function testString() { - let logs = browserLogs(browser); + const logs = browserLogs(browser); logs.ignore('foo'); logs.expect('foo'); } function testMatchFunction() { - let logs = browserLogs(browser); - let filter = (entry: Entry) => entry.message === "foo"; + const logs = browserLogs(browser); + const filter = (entry: Entry) => entry.message === "foo"; logs.ignore(filter); logs.expect(filter); } function testReset() { - let logs = browserLogs(browser); + const logs = browserLogs(browser); logs.reset(); } function testLogs() { - let logs = browserLogs(browser); + const logs = browserLogs(browser); - let entries: Entry[] = logs.logs(); + const entries: Entry[] = logs.logs(); } function testVerify() { - let logs = browserLogs(browser); + const logs = browserLogs(browser); logs.verify(); } diff --git a/xmpp-jid/xmpp-jid-tests.ts b/xmpp-jid/xmpp-jid-tests.ts index 6b33b2c349..2514d5fb8a 100644 --- a/xmpp-jid/xmpp-jid-tests.ts +++ b/xmpp-jid/xmpp-jid-tests.ts @@ -36,5 +36,5 @@ addr.getResource(); // rabbithole addr.toString(); // alice@wonderland.net/rabbithole addr.bare(); // returns a JID without resource -let some_jid = new JID('is', 'a', 'test'); +const some_jid = new JID('is', 'a', 'test'); addr.equals(some_jid); // returns true if the two JIDs are equal, false otherwise From 62c57736f132e94682649f77b02391e47be5986e Mon Sep 17 00:00:00 2001 From: Anton Kandybo Date: Fri, 10 Mar 2017 09:22:10 +0200 Subject: [PATCH 495/797] Added ProgressPlugin definition (#14897) --- webpack/index.d.ts | 4 ++++ webpack/webpack-tests.ts | 1 + 2 files changed, 5 insertions(+) diff --git a/webpack/index.d.ts b/webpack/index.d.ts index 0eb787a9b0..28d1b33b40 100644 --- a/webpack/index.d.ts +++ b/webpack/index.d.ts @@ -747,6 +747,10 @@ declare namespace webpack { constructor(request: any); } + class ProgressPlugin extends Plugin { + constructor(options?: (percentage: number, msg: string) => void); + } + class ProvidePlugin extends Plugin { constructor(definitions: {[key: string]: any}); } diff --git a/webpack/webpack-tests.ts b/webpack/webpack-tests.ts index 483e175f38..ce9d42d71b 100644 --- a/webpack/webpack-tests.ts +++ b/webpack/webpack-tests.ts @@ -400,6 +400,7 @@ plugin = new webpack.WatchIgnorePlugin(paths); plugin = new webpack.LoaderOptionsPlugin({ debug: true }); +plugin = new webpack.ProgressPlugin((percent: number, message: string) => {}); // // http://webpack.github.io/docs/node.js-api.html From 5720c5ef6b8e9b4e939ce0b6e41d79d1356e0509 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Fri, 10 Mar 2017 08:22:49 +0100 Subject: [PATCH 496/797] feat(stylelint): add typings for `stylelint` (#14896) * feat(stylelint): add typings for `stylelint` * fix(styelint): fix lint issues * set `strictNullChecks` to true * remove redundent namespace * rename iterfaces * update tests * feat(stylelint): add formatters * fix naming convention --- stylelint/index.d.ts | 44 ++++++++++++++++++++++++++++++++++++ stylelint/stylelint-tests.ts | 18 +++++++++++++++ stylelint/tsconfig.json | 23 +++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 stylelint/index.d.ts create mode 100644 stylelint/stylelint-tests.ts create mode 100644 stylelint/tsconfig.json diff --git a/stylelint/index.d.ts b/stylelint/index.d.ts new file mode 100644 index 0000000000..2ec479d2e1 --- /dev/null +++ b/stylelint/index.d.ts @@ -0,0 +1,44 @@ +// Type definitions for stylelint 7.9 +// Project: https://github.com/stylelint/stylelint +// Definitions by: Alan Agius +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface LinterOptions { + code?: string; + codeFilename?: string; + config?: JSON; + configBasedir?: string; + configFile?: string; + configOverrides?: JSON; + files?: string | string[]; + formatter?: "json" | "string" | "verbose"; + ignoreDisables?: boolean; + reportNeedlessDisables?: boolean; + ignorePath?: boolean; + syntax?: "scss" | "less" | "sugarss"; + customSyntax?: string; +} + +export interface LinterResult { + errored: boolean; + output: string; + postcssResults: any[]; + results: LintResult[]; +} + +export interface LintResult { + source: string; + errored: boolean | undefined; + ignored: boolean | undefined; + warnings: string[]; + deprecations: string[]; + invalidOptionWarnings: any[]; +} + +export namespace formatters { + function json(results: LintResult[]): string; + function string(results: LintResult[]): string; + function verbose(results: LintResult[]): string; +} + +export function lint(options?: LinterOptions): Promise; diff --git a/stylelint/stylelint-tests.ts b/stylelint/stylelint-tests.ts new file mode 100644 index 0000000000..0eeb0bdec8 --- /dev/null +++ b/stylelint/stylelint-tests.ts @@ -0,0 +1,18 @@ +import { LinterOptions, lint, LintResult, LinterResult } from "stylelint"; + +const options: LinterOptions = { + code: "div { color: red }", + files: ["**/**.scss"], + formatter: "json", + ignoreDisables: true, + reportNeedlessDisables: true, + ignorePath: true, + syntax: "scss" +}; + +lint(options).then((x: LinterResult) => { + const err: boolean = x.errored; + const output: string = x.output; + const postcssResults: any[] = x.postcssResults; + const results: LintResult[] = x.results; +}); diff --git a/stylelint/tsconfig.json b/stylelint/tsconfig.json new file mode 100644 index 0000000000..d57b85c2b3 --- /dev/null +++ b/stylelint/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "stylelint-tests.ts" + ] +} From 603a182210c675f00c62d39b320b2f1d251aec6d Mon Sep 17 00:00:00 2001 From: Sergei Dorogin Date: Fri, 10 Mar 2017 10:23:26 +0300 Subject: [PATCH 497/797] handlebars: added partials/decorators fields and registerDecorator/unregisterDecorator methods (#14895) --- handlebars/index.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/handlebars/index.d.ts b/handlebars/index.d.ts index 96b0491040..d3ab2c80e3 100644 --- a/handlebars/index.d.ts +++ b/handlebars/index.d.ts @@ -10,6 +10,9 @@ declare namespace Handlebars { export function registerPartial(name: string, str: any): void; export function unregisterHelper(name: string): void; export function unregisterPartial(name: string): void; + export function registerDecorator(name: string, fn: Function): void; + export function unregisterDecorator(name: string): void; + export function K(): void; export function createFrame(object: any): any; export function Exception(message: string): void; @@ -26,7 +29,9 @@ declare namespace Handlebars { export var Utils: typeof hbs.Utils; export var logger: Logger; export var templates: HandlebarsTemplates; - export var helpers: any; + export var helpers: { [name: string]: Function }; + export var partials: { [name: string]: any }; + export var decorators: { [name: string]: Function }; export function registerDecorator(name: string, fn: Function): void; export function registerDecorator(obj: {[name: string] : Function}): void; From 389dc0cb777d2d2cfeb2bdd2b2239dfd6c729e17 Mon Sep 17 00:00:00 2001 From: Peter Briers Date: Fri, 10 Mar 2017 08:26:24 +0100 Subject: [PATCH 498/797] defaults should be a static member (#14893) --- chart.js/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart.js/index.d.ts b/chart.js/index.d.ts index 08781f4463..425bf96b81 100644 --- a/chart.js/index.d.ts +++ b/chart.js/index.d.ts @@ -20,7 +20,7 @@ declare class Chart { getElementsAtEvent: (e: any) => {}[]; getDatasetAtEvent: (e: any) => {}[]; - defaults: { + static defaults: { global: Chart.ChartOptions; } } From 27eae2e5992d30161c44e013cce8ec7cb7baee63 Mon Sep 17 00:00:00 2001 From: prezi-csoszig Date: Fri, 10 Mar 2017 08:27:38 +0100 Subject: [PATCH 499/797] In pdfkit/index.d.ts fixing bufferedPageRange (#14890) PdfKit document has method bufferedPageRange() instead of bufferedPageRanges(). @see https://github.com/devongovett/pdfkit/blob/v0.8.0/docs/guide.pdf Page 5 @see https://github.com/devongovett/pdfkit/blob/63d6e5020f0b3efa3005286476a29905f8d5e843/lib/document.coffee#L107 --- pdfkit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdfkit/index.d.ts b/pdfkit/index.d.ts index 8bd1c7014e..053aa7f029 100644 --- a/pdfkit/index.d.ts +++ b/pdfkit/index.d.ts @@ -269,7 +269,7 @@ declare namespace PDFKit { new (options?: PDFDocumentOptions): PDFDocument; addPage(options?: PDFDocumentOptions): PDFDocument; - bufferedPageRanges(): { start: number; count: number }; + bufferedPageRange(): { start: number; count: number }; switchToPage(n?: number): PDFPage; flushPages(): void; ref(data: {}): PDFKitReference; From 16a70ebb0d516ae625d1c4f405027f67a0fc78d4 Mon Sep 17 00:00:00 2001 From: Mantas Marcinkus Date: Fri, 10 Mar 2017 07:29:32 +0000 Subject: [PATCH 500/797] Creating rc-slider typescript definition file (#14887) * Initial * Rc-slider typings * Adhering to linting rules * linting rules * Tests * Fixing tests and missed commit stuff * Referencing react instead of importing it * Undoing last change * Marks types fixed * Test fix * Review changes. Added tests to Handle --- rc-slider/README.md | 13 +++ rc-slider/index.d.ts | 156 ++++++++++++++++++++++++++++++++++ rc-slider/rc-slider-tests.tsx | 48 +++++++++++ rc-slider/tsconfig.json | 24 ++++++ rc-slider/tslint.json | 3 + 5 files changed, 244 insertions(+) create mode 100644 rc-slider/README.md create mode 100644 rc-slider/index.d.ts create mode 100644 rc-slider/rc-slider-tests.tsx create mode 100644 rc-slider/tsconfig.json create mode 100644 rc-slider/tslint.json diff --git a/rc-slider/README.md b/rc-slider/README.md new file mode 100644 index 0000000000..7000e34358 --- /dev/null +++ b/rc-slider/README.md @@ -0,0 +1,13 @@ +# Installation +> `npm install --save @types/rc-select` + +# Summary +This package contains type definitions for rc-slider (https://github.com/react-component/slider). + +Additional Details + * Last updated: Tue, 24 Feb 2017 + * Dependencies: react + * Global values: none + +# Credits +These definitions were written by Marcinkus Mantas diff --git a/rc-slider/index.d.ts b/rc-slider/index.d.ts new file mode 100644 index 0000000000..704412eda6 --- /dev/null +++ b/rc-slider/index.d.ts @@ -0,0 +1,156 @@ +// Type definitions for rc-slider 6.1 +// Project: https://github.com/react-component/slider +// Definitions by: Marcinkus Mantas +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +import * as React from 'react'; + +declare namespace RcSliderClass { + export interface Marks { + [number: number]: JSX.Element | string | { style: any, label: string | JSX.Element }; + } + + export interface CommonApiProps { + /** + * Additional CSS class for the root DOM node + * @default '' + */ + className?: string; + /** + * The minimum value of the slider + * @default 0 + */ + min?: number; + /** + * The maximum value of the slider + * @default 100 + */ + max?: number; + /** + * Marks on the slider. The key determines the position, and the value determines what will show. + * If you want to set the style of a specific mark point, the value should be an object which contains style and label properties. + * @default '{}' | {number: { style, label }} + */ + marks?: Marks; + /** + * Value to be added or subtracted on each step the slider makes. Must be greater than zero, and max - min should be evenly divisible by the step value. + * @default 1 + */ + step?: number; + /** + * If vertical is true, the slider will be vertical. + * @default false + */ + vertical?: boolean; + /** + * A handle generator which could be used to customized handle. + */ + handle?(props: any): React.ReactNode; + /** + * If the value is true, it means a continuous value interval, otherwise, it is a independent value. + * @default true + */ + included?: boolean; + /** + * If true, handles can't be moved. + * @default false + */ + disabled?: boolean; + /** + * When the step value is greater than 1, you can set the dots to true if you want to render the slider with dots. + * @default false + */ + dots?: boolean; + /** + * onBeforeChange will be triggered when ontouchstart or onmousedown is triggered. + */ + onBeforeChange?: (value: any) => any | undefined; + /** + * onChange will be triggered while the value of Slider changing. + */ + onChange?: (value: any) => any | undefined; + /** + * onAfterChange will be triggered when ontouchend or onmouseup is triggered. + */ + onAfterChange?: (value: any) => any | undefined; + + /** + * @deprecated in version ^6.0.0. Use rc-tooltip + * Tooltip transition class name + */ + tipTransitionName?: string; + + /** + * @deprecated in version ^6.0.0. Use rc-tooltip + * Tooltip formatter + */ + tipFormatter?: ((value: any) => any | undefined) | null; + } + + interface SliderProps extends CommonApiProps { + /** + * Set initial value of slider. + * @default 0 + */ + defaultValue?: number; + /** + * Set current value of slider. + */ + value?: number; + } + + + export interface RangeProps extends CommonApiProps { + /** + * Set initial positions of handles. + * @default [0,0] + */ + defaultValue?: number[]; + /** + * Set current positions of handles. + */ + value?: number[]; + /** + * Determine how many ranges to render, and multiple handles will be rendered (number + 1). + * @default 1 + */ + count?: number; + /** + * allowCross could be set as true to allow those handles to cross. + * @default true + */ + allowCross?: boolean; + /** + * pushable could be set as true to allow pushing of surrounding handles when moving an handle. When set to a number, the number will be the minimum ensured distance between handles. + * @default true + */ + pushable?: boolean; + } + + export interface HandleProps extends CommonApiProps { + /** + * Class name + */ + className: string; + /** + * Styling if true, then bottom: {offset} else left: {offset} + * @default False + */ + vertical: boolean; + /** + * Styling option offset + */ + offset: number; + } +} + +declare class RcSliderClass extends React.Component { } + +declare namespace RcSliderClass { + class Range extends React.Component { } + class Handle extends React.Component { } +} + + +export = RcSliderClass; diff --git a/rc-slider/rc-slider-tests.tsx b/rc-slider/rc-slider-tests.tsx new file mode 100644 index 0000000000..f6e2442558 --- /dev/null +++ b/rc-slider/rc-slider-tests.tsx @@ -0,0 +1,48 @@ +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +import * as Slider from 'rc-slider'; +import { Range, Handle } from 'rc-slider'; + +ReactDOM.render( + , + document.querySelector('.app') +); + +ReactDOM.render( + , + document.querySelector('.another-app') +); +ReactDOM.render( + { return }} + included={true} + disabled={false} + dots={true} + onBeforeChange={() => { }} + onChange={() => { }} + onAfterChange={() => { }} + defaultValue={0.1} + value={0.1} + />, + document.querySelector('.another-app') +); + +ReactDOM.render( + , + document.querySelector('.app') +); \ No newline at end of file diff --git a/rc-slider/tsconfig.json b/rc-slider/tsconfig.json new file mode 100644 index 0000000000..d6a3a4e288 --- /dev/null +++ b/rc-slider/tsconfig.json @@ -0,0 +1,24 @@ + { + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "rc-slider-tests.tsx" + ] +} \ No newline at end of file diff --git a/rc-slider/tslint.json b/rc-slider/tslint.json new file mode 100644 index 0000000000..fdc7cdc370 --- /dev/null +++ b/rc-slider/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "../tslint.json" +} \ No newline at end of file From ddef2004bc26a72452a8ccd50f00741ad955e2ca Mon Sep 17 00:00:00 2001 From: Edward Hinkle Date: Thu, 9 Mar 2017 23:31:52 -0800 Subject: [PATCH 501/797] xml2js - Prevent error when using Parser's event emitter (#14884) * Make Parser extend event emitter Fixing error: error TS2339: Property 'on' does not exist on type 'Parser'. * Update authorship * Add test for event emitter --- xml2js/index.d.ts | 6 ++++-- xml2js/xml2js-tests.ts | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/xml2js/index.d.ts b/xml2js/index.d.ts index 6dd10acce4..12d2488cbe 100644 --- a/xml2js/index.d.ts +++ b/xml2js/index.d.ts @@ -1,12 +1,14 @@ // Type definitions for node-xml2js // Project: https://github.com/Leonidas-from-XIV/node-xml2js -// Definitions by: Michel Salib , Jason McNeil , Christopher Currens +// Definitions by: Michel Salib , Jason McNeil , Christopher Currens , Edward Hinkle // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// export = xml2js; +import * as events from 'events' + declare namespace xml2js { function parseString(xml: convertableToString, callback: (err: any, result: any) => void): void; function parseString(xml: convertableToString, options: OptionsV2, callback: (err: any, result: any) => void): void; @@ -21,7 +23,7 @@ declare namespace xml2js { buildObject(rootObj: any): string; } - class Parser { + class Parser extends events.EventEmitter { constructor(options?: OptionsV2); parseString(str: convertableToString, cb?: Function): void; reset(): void; diff --git a/xml2js/xml2js-tests.ts b/xml2js/xml2js-tests.ts index 62324b6908..8ee7b7ce25 100644 --- a/xml2js/xml2js-tests.ts +++ b/xml2js/xml2js-tests.ts @@ -69,6 +69,11 @@ var outString = builder.buildObject({ var parser = new xml2js.Parser(); +parser.on('end', (result: any) => { + console.log("Parser Finished"); + return; +}); + var v1Defaults = xml2js.defaults['0.1']; v1Defaults.async = true; From 99197751bd418c2b5e5d2c6b88dc8f9286316775 Mon Sep 17 00:00:00 2001 From: YYC <395976266@qq.com> Date: Fri, 10 Mar 2017 15:36:37 +0800 Subject: [PATCH 502/797] feat: update wonder-commonlib,wonder-frp dts file; add wonder.js dts file (#14873) * feat: update wonder-commonlib,wonder-frp dts file feat: add wonder.js dts file * fix: change module to "commonjs" * fix: try pass ci --- wonder-commonlib/index.d.ts | 304 +- wonder-commonlib/wonder-commonlib-tests.ts | 4 +- wonder-frp/index.d.ts | 1366 +++++---- wonder-frp/wonder-frp-tests.ts | 4 +- wonder.js/index.d.ts | 2955 ++++++++++++++++++++ wonder.js/tsconfig.json | 23 + wonder.js/wonder.js-tests.ts | 4 + 7 files changed, 3902 insertions(+), 758 deletions(-) create mode 100644 wonder.js/index.d.ts create mode 100644 wonder.js/tsconfig.json create mode 100644 wonder.js/wonder.js-tests.ts diff --git a/wonder-commonlib/index.d.ts b/wonder-commonlib/index.d.ts index 1cad038d52..267d86538d 100644 --- a/wonder-commonlib/index.d.ts +++ b/wonder-commonlib/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for wonder-commonlib 0.1.1 +// Type definitions for wonder-commonlib 0.2.0 // Project: https://github.com/yyc-git/Wonder-CommonLib // Definitions by: YYC // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,96 +6,31 @@ /// -declare module wdCb { - class JudgeUtils { - static isArray(arr: any): boolean; - static isArrayExactly(arr: any): boolean; - static isNumber(num: any): boolean; - static isNumberExactly(num: any): boolean; - static isString(str: any): boolean; - static isStringExactly(str: any): boolean; - static isBoolean(bool: any): boolean; - static isDom(obj: any): boolean; - static isObject(obj: any): boolean; - static isDirectObject(obj: any): boolean; - static isHostMethod(object: any, property: any): boolean; - static isNodeJs(): boolean; - static isFunction(func: any): boolean; - } +// Generated by dts-bundle v0.7.2 + +declare module 'wonder-commonlib/dist/es2015' { + export { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export { $BREAK, $REMOVE } from "wonder-commonlib/dist/es2015/global/Const"; + export { root } from "wonder-commonlib/dist/es2015/global/Variable"; + export { Hash } from "wonder-commonlib/dist/es2015/Hash"; + export { List } from "wonder-commonlib/dist/es2015/List"; + export { Log } from "wonder-commonlib/dist/es2015/Log"; + export { Queue } from "wonder-commonlib/dist/es2015/Queue"; + export { Stack } from "wonder-commonlib/dist/es2015/Stack"; + export { AjaxUtils } from "wonder-commonlib/dist/es2015/utils/AjaxUtils"; + export { ArrayUtils } from "wonder-commonlib/dist/es2015/utils/ArrayUtils"; + export { ConvertUtils } from "wonder-commonlib/dist/es2015/utils/ConvertUtils"; + export { DomQuery } from "wonder-commonlib/dist/es2015/utils/DomQuery"; + export { EventUtils } from "wonder-commonlib/dist/es2015/utils/EventUtils"; + export { ExtendUtils } from "wonder-commonlib/dist/es2015/utils/ExtendUtils"; + export { FunctionUtils } from "wonder-commonlib/dist/es2015/utils/FunctionUtils"; + export { JudgeUtils } from "wonder-commonlib/dist/es2015/utils/JudgeUtils"; + export { PathUtils } from "wonder-commonlib/dist/es2015/utils/PathUtils"; } -declare var global:NodeJS.Global,window:Window; - -declare module wdCb { - var root: any; -} - -declare module wdCb { -} - -declare module wdCb { - const $BREAK: { - break: boolean; - }; - const $REMOVE: any; -} - -declare module wdCb { - class Log { - static info: { - INVALID_PARAM: string; - helperFunc: (...args: any[]) => string; - assertion: (...args: any[]) => any; - FUNC_INVALID: (...args: any[]) => any; - FUNC_MUST: (...args: any[]) => any; - FUNC_MUST_BE: (...args: any[]) => any; - FUNC_MUST_NOT_BE: (...args: any[]) => any; - FUNC_SHOULD: (...args: any[]) => any; - FUNC_SHOULD_NOT: (...args: any[]) => any; - FUNC_SUPPORT: (...args: any[]) => any; - FUNC_NOT_SUPPORT: (...args: any[]) => any; - FUNC_MUST_DEFINE: (...args: any[]) => any; - FUNC_MUST_NOT_DEFINE: (...args: any[]) => any; - FUNC_UNKNOW: (...args: any[]) => any; - FUNC_EXPECT: (...args: any[]) => any; - FUNC_UNEXPECT: (...args: any[]) => any; - FUNC_EXIST: (...args: any[]) => any; - FUNC_NOT_EXIST: (...args: any[]) => any; - FUNC_ONLY: (...args: any[]) => any; - FUNC_CAN_NOT: (...args: any[]) => any; - }; - static log(...messages: any[]): void; - static assert(cond: any, ...messages: any[]): void; - static error(cond: any, ...message: any[]): any; - static warn(...message: any[]): void; - private static _exec(consoleMethod, args, sliceBegin?); - } -} - -declare module wdCb { - class List { - protected children: Array; - getCount(): number; - hasChild(child: any): boolean; - hasChildWithFunc(func: Function): boolean; - getChildren(): T[]; - getChild(index: number): T; - addChild(child: T): this; - addChildren(arg: Array | List | any): this; - setChildren(children: Array): this; - unShiftChild(child: T): void; - removeAllChildren(): this; - forEach(func: Function, context?: any): this; - toArray(): T[]; - protected copyChildren(): T[]; - protected removeChildHelper(arg: any): Array; - private _forEach(arr, func, context?); - private _removeChild(arr, func); - } -} - -declare module wdCb { - class Collection extends List { +declare module 'wonder-commonlib/dist/es2015/Collection' { + import { List } from "wonder-commonlib/dist/es2015/List"; + export class Collection extends List { static create(children?: any[]): Collection; constructor(children?: Array); clone(): any; @@ -109,17 +44,28 @@ declare module wdCb { sort(func: (a: T, b: T) => any, isSortSelf?: boolean): Collection; map(func: (value: T, index: number) => any): Collection; removeRepeatItems(): Collection; - hasRepeatItems(): false; + hasRepeatItems(): boolean; } } -declare module wdCb { - class Hash { +declare module 'wonder-commonlib/dist/es2015/global/Const' { + export const $BREAK: { + break: boolean; + }; + export const $REMOVE: any; +} + +declare module 'wonder-commonlib/dist/es2015/global/Variable' { + export var root: any; +} + +declare module 'wonder-commonlib/dist/es2015/Hash' { + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export class Hash { static create(children?: {}): Hash; constructor(children?: { [s: string]: T; }); - private _children; getChildren(): { [s: string]: T; }; @@ -151,8 +97,60 @@ declare module wdCb { } } -declare module wdCb { - class Queue extends List { +declare module 'wonder-commonlib/dist/es2015/List' { + export class List { + protected children: Array; + getCount(): number; + hasChild(child: any): boolean; + hasChildWithFunc(func: Function): boolean; + getChildren(): T[]; + getChild(index: number): T; + addChild(child: T): this; + addChildren(arg: Array | List | any): this; + setChildren(children: Array): this; + unShiftChild(child: T): void; + removeAllChildren(): this; + forEach(func: Function, context?: any): this; + toArray(): T[]; + protected copyChildren(): T[]; + protected removeChildHelper(arg: any): Array; + } +} + +declare module 'wonder-commonlib/dist/es2015/Log' { + export class Log { + static info: { + INVALID_PARAM: string; + helperFunc: (...args: any[]) => string; + assertion: (...args: any[]) => any; + FUNC_INVALID: (...args: any[]) => any; + FUNC_MUST: (...args: any[]) => any; + FUNC_MUST_BE: (...args: any[]) => any; + FUNC_MUST_NOT_BE: (...args: any[]) => any; + FUNC_SHOULD: (...args: any[]) => any; + FUNC_SHOULD_NOT: (...args: any[]) => any; + FUNC_SUPPORT: (...args: any[]) => any; + FUNC_NOT_SUPPORT: (...args: any[]) => any; + FUNC_MUST_DEFINE: (...args: any[]) => any; + FUNC_MUST_NOT_DEFINE: (...args: any[]) => any; + FUNC_UNKNOW: (...args: any[]) => any; + FUNC_EXPECT: (...args: any[]) => any; + FUNC_UNEXPECT: (...args: any[]) => any; + FUNC_EXIST: (...args: any[]) => any; + FUNC_NOT_EXIST: (...args: any[]) => any; + FUNC_ONLY: (...args: any[]) => any; + FUNC_CAN_NOT: (...args: any[]) => any; + }; + static log(...messages: any[]): void; + static assert(cond: any, ...messages: any[]): void; + static error(cond: any, ...message: any[]): any; + static warn(...message: any[]): void; + } +} + +declare module 'wonder-commonlib/dist/es2015/Queue' { + import { List } from "wonder-commonlib/dist/es2015/List"; + export class Queue extends List { static create(children?: any[]): Queue; constructor(children?: Array); readonly front: T; @@ -163,8 +161,10 @@ declare module wdCb { } } -declare module wdCb { - class Stack extends List { +declare module 'wonder-commonlib/dist/es2015/Stack' { + import { List } from "wonder-commonlib/dist/es2015/List"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export class Stack extends List { static create(children?: any[]): Stack; constructor(children?: Array); readonly top: T; @@ -182,71 +182,33 @@ declare module wdCb { sort(func: (a: T, b: T) => any, isSortSelf?: boolean): Collection; map(func: (value: T, index: number) => any): Collection; removeRepeatItems(): Collection; - hasRepeatItems(): false; + hasRepeatItems(): boolean; } } -declare module wdCb { - class AjaxUtils { +declare module 'wonder-commonlib/dist/es2015/utils/AjaxUtils' { + export class AjaxUtils { static ajax(conf: any): void; - private static _createAjax(error); - private static _isLocalFile(status); - private static _isSoundFile(dataType); } } -declare module wdCb { - class ArrayUtils { +declare module 'wonder-commonlib/dist/es2015/utils/ArrayUtils' { + export class ArrayUtils { static removeRepeatItems(arr: Array, isEqual?: (a: any, b: any) => boolean): any[]; static contain(arr: Array, ele: any): boolean; } } -declare module wdCb { - class ConvertUtils { +declare module 'wonder-commonlib/dist/es2015/utils/ConvertUtils' { + export class ConvertUtils { static toString(obj: any): string; - private static _convertCodeToString(fn); } } -declare module wdCb { - class EventUtils { - static bindEvent(context: any, func: any): (event: any) => any; - static addEvent(dom: any, eventName: any, handler: any): void; - static removeEvent(dom: any, eventName: any, handler: any): void; - } -} - -declare module wdCb { - class ExtendUtils { - static extendDeep(parent: any, child?: any, filter?: (val: any, i: any) => boolean): any; - static extend(destination: any, source: any): any; - static copyPublicAttri(source: any): {}; - } -} - -declare module wdCb { - class PathUtils { - static basename(path: string, ext?: string): string; - static changeExtname(pathStr: string, extname: string): string; - static changeBasename(pathStr: string, basename: string, isSameExt?: boolean): string; - static extname(path: string): string; - static dirname(path: string): string; - private static _splitPath(fileName); - } -} - -declare module wdCb { - class FunctionUtils { - static bind(object: any, func: Function): () => any; - } -} - -declare module wdCb { - class DomQuery { +declare module 'wonder-commonlib/dist/es2015/utils/DomQuery' { + export class DomQuery { static create(eleStr: string): any; static create(dom: HTMLElement): any; - private _doms; constructor(eleStr: string); constructor(dom: HTMLElement); get(index: any): HTMLElement; @@ -258,14 +220,56 @@ declare module wdCb { attr(name: string): any; attr(name: string, value: string): any; text(str?: string): string; - private _isDomEleStr(eleStr); - private _buildDom(eleStr); - private _buildDom(dom); - private _createElement(eleStr); } } -declare module "wonder-commonlib" { - export = wdCb; +declare module 'wonder-commonlib/dist/es2015/utils/EventUtils' { + export class EventUtils { + static bindEvent(context: any, func: any): (event: any) => any; + static addEvent(dom: any, eventName: any, handler: any): void; + static removeEvent(dom: any, eventName: any, handler: any): void; + } +} + +declare module 'wonder-commonlib/dist/es2015/utils/ExtendUtils' { + export class ExtendUtils { + static extendDeep(parent: any, child?: any, filter?: (val: any, i: any) => boolean): any; + static extend(destination: any, source: any): any; + static copyPublicAttri(source: any): {}; + } +} + +declare module 'wonder-commonlib/dist/es2015/utils/FunctionUtils' { + export class FunctionUtils { + static bind(object: any, func: Function): () => any; + } +} + +declare module 'wonder-commonlib/dist/es2015/utils/JudgeUtils' { + export class JudgeUtils { + static isArray(arr: any): boolean; + static isArrayExactly(arr: any): boolean; + static isNumber(num: any): boolean; + static isNumberExactly(num: any): boolean; + static isString(str: any): boolean; + static isStringExactly(str: any): boolean; + static isBoolean(bool: any): boolean; + static isDom(obj: any): boolean; + static isObject(obj: any): boolean; + static isDirectObject(obj: any): boolean; + static isHostMethod(object: any, property: any): boolean; + static isNodeJs(): boolean; + static isFunction(func: any): boolean; + } +} + +declare module 'wonder-commonlib/dist/es2015/utils/PathUtils' { + export class PathUtils { + static basename(path: string, ext?: string): string; + static changeExtname(pathStr: string, extname: string): string; + static changeBasename(pathStr: string, basename: string, isSameExt?: boolean): string; + static extname(path: string): string; + static dirname(path: string): string; + } } diff --git a/wonder-commonlib/wonder-commonlib-tests.ts b/wonder-commonlib/wonder-commonlib-tests.ts index c22d61c11d..852f768f01 100644 --- a/wonder-commonlib/wonder-commonlib-tests.ts +++ b/wonder-commonlib/wonder-commonlib-tests.ts @@ -1,6 +1,6 @@ -import wdCb = require("wonder-commonlib"); +import {Collection} from "wonder-commonlib/dist/es2015/Collection"; -var list = wdCb.Collection.create(); +var list = Collection.create(); list.addChild(1); diff --git a/wonder-frp/index.d.ts b/wonder-frp/index.d.ts index 00910bc80d..e68e019ead 100644 --- a/wonder-frp/index.d.ts +++ b/wonder-frp/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for wonder-frp 0.1.1 +// Type definitions for wonder-frp 0.2.0 // Project: https://github.com/yyc-git/Wonder-FRP // Definitions by: YYC // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,173 +6,119 @@ /// /// -declare module wdFrp { - class JudgeUtils extends wdCb.JudgeUtils { +// Generated by dts-bundle v0.7.2 +// Dependencies for this module: +// ../../wonder-commonlib/dist/es2015/utils/JudgeUtils +// ../../wonder-commonlib/dist/es2015/Collection + +declare module 'wonder-frp/dist/es2015' { + export { JudgeUtils } from "wonder-frp/dist/es2015/JudgeUtils"; + export { fromNodeCallback, fromStream, fromReadableStream, fromWritableStream, fromTransformStream } from "wonder-frp/dist/es2015/binding/nodejs/NodeOperator"; + export { Entity } from "wonder-frp/dist/es2015/core/Entity"; + export { Main } from "wonder-frp/dist/es2015/core/Main"; + export { Observer } from "wonder-frp/dist/es2015/core/Observer"; + export { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + export { Stream } from "wonder-frp/dist/es2015/core/Stream"; + export { assert, requireCheck, ensure, requireGetter, requireSetter, ensureGetter, ensureSetter, invariant } from "wonder-frp/dist/es2015/definition/typescript/decorator/contract"; + export { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export { InnerSubscription } from "wonder-frp/dist/es2015/Disposable/InnerSubscription"; + export { InnerSubscriptionGroup } from "wonder-frp/dist/es2015/Disposable/InnerSubscriptionGroup"; + export { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export { FilterState } from "wonder-frp/dist/es2015/enum/FilterState"; + export { createStream, fromArray, fromPromise, fromEventPattern, interval, intervalRequest, timeout, empty, callFunc, judge, defer, just } from "wonder-frp/dist/es2015/global/Operator"; + export { root } from "wonder-frp/dist/es2015/global/Variable"; + export { AnonymousObserver } from "wonder-frp/dist/es2015/observer/AnonymousObserver"; + export { AutoDetachObserver } from "wonder-frp/dist/es2015/observer/AutoDetachObserver"; + export { ConcatObserver } from "wonder-frp/dist/es2015/observer/ConcatObserver"; + export { DoObserver } from "wonder-frp/dist/es2015/observer/DoObserver"; + export { FilterObserver } from "wonder-frp/dist/es2015/observer/FilterObserver"; + export { FilterWithStateObserver } from "wonder-frp/dist/es2015/observer/FilterWithStateObserver"; + export { IgnoreElementsObserver } from "wonder-frp/dist/es2015/observer/IgnoreElementsObserver"; + export { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export { ISubjectObserver } from "wonder-frp/dist/es2015/observer/ISubjectObserver"; + export { MapObserver } from "wonder-frp/dist/es2015/observer/MapObserver"; + export { MergeAllObserver } from "wonder-frp/dist/es2015/observer/MergeAllObserver"; + export { MergeObserver } from "wonder-frp/dist/es2015/observer/MergeObserver"; + export { SkipUntilOtherObserver } from "wonder-frp/dist/es2015/observer/SkipUntilOtherObserver"; + export { SkipUntilSourceObserver } from "wonder-frp/dist/es2015/observer/SkipUntilSourceObserver"; + export { SubjectObserver } from "wonder-frp/dist/es2015/observer/SubjectObserver"; + export { TakeUntilObserver } from "wonder-frp/dist/es2015/observer/TakeUntilObserver"; + export { AnonymousStream } from "wonder-frp/dist/es2015/stream/AnonymousStream"; + export { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + export { ConcatStream } from "wonder-frp/dist/es2015/stream/ConcatStream"; + export { DeferStream } from "wonder-frp/dist/es2015/stream/DeferStream"; + export { DoStream } from "wonder-frp/dist/es2015/stream/DoStream"; + export { FilterStream } from "wonder-frp/dist/es2015/stream/FilterStream"; + export { FilterWithStateStream } from "wonder-frp/dist/es2015/stream/FilterWithStateStream"; + export { FromArrayStream } from "wonder-frp/dist/es2015/stream/FromArrayStream"; + export { FromEventPatternStream } from "wonder-frp/dist/es2015/stream/FromEventPatternStream"; + export { FromPromiseStream } from "wonder-frp/dist/es2015/stream/FromPromiseStream"; + export { IgnoreElementsStream } from "wonder-frp/dist/es2015/stream/IgnoreElementsStream"; + export { IntervalRequestStream } from "wonder-frp/dist/es2015/stream/IntervalRequestStream"; + export { IntervalStream } from "wonder-frp/dist/es2015/stream/IntervalStream"; + export { MapStream } from "wonder-frp/dist/es2015/stream/MapStream"; + export { MergeAllStream } from "wonder-frp/dist/es2015/stream/MergeAllStream"; + export { MergeStream } from "wonder-frp/dist/es2015/stream/MergeStream"; + export { RepeatStream } from "wonder-frp/dist/es2015/stream/RepeatStream"; + export { SkipUntilStream } from "wonder-frp/dist/es2015/stream/SkipUntilStream"; + export { TakeUntilStream } from "wonder-frp/dist/es2015/stream/TakeUntilStream"; + export { TimeoutStream } from "wonder-frp/dist/es2015/stream/TimeoutStream"; + export { GeneratorSubject } from "wonder-frp/dist/es2015/subject/GeneratorSubject"; + export { Subject } from "wonder-frp/dist/es2015/subject/Subject"; + export { ActionType } from "wonder-frp/dist/es2015/testing/ActionType"; + export { MockObserver } from "wonder-frp/dist/es2015/testing/MockObserver"; + export { MockPromise } from "wonder-frp/dist/es2015/testing/MockPromise"; + export { Record } from "wonder-frp/dist/es2015/testing/Record"; + export { TestScheduler } from "wonder-frp/dist/es2015/testing/TestScheduler"; + export { TestStream } from "wonder-frp/dist/es2015/testing/TestStream"; + //import "./extend/root"; + //import "./global/init"; +} + +declare module 'wonder-frp/dist/es2015/JudgeUtils' { + import { JudgeUtils as JudgeUtils$ } from "wonder-commonlib/dist/es2015/utils/JudgeUtils"; + import { Entity } from "wonder-frp/dist/es2015/core/Entity"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class JudgeUtils extends JudgeUtils$ { static isPromise(obj: any): boolean; static isEqual(ob1: Entity, ob2: Entity): boolean; static isIObserver(i: IObserver): () => any; } } -declare module wdFrp { - var fromNodeCallback: (func: Function, context?: any) => (...funcArgs: any[]) => AnonymousStream; - var fromStream: (stream: any, finishEventName?: string) => AnonymousStream; - var fromReadableStream: (stream: any) => AnonymousStream; - var fromWritableStream: (stream: any) => AnonymousStream; - var fromTransformStream: (stream: any) => AnonymousStream; +declare module 'wonder-frp/dist/es2015/binding/nodejs/NodeOperator' { + import { AnonymousStream } from "wonder-frp/dist/es2015/stream/AnonymousStream"; + export var fromNodeCallback: (func: Function, context?: any) => (...funcArgs: any[]) => AnonymousStream; + export var fromStream: (stream: any, finishEventName?: string) => AnonymousStream; + export var fromReadableStream: (stream: any) => AnonymousStream; + export var fromWritableStream: (stream: any) => AnonymousStream; + export var fromTransformStream: (stream: any) => AnonymousStream; } -declare module wdFrp { - abstract class Entity { +declare module 'wonder-frp/dist/es2015/core/Entity' { + export abstract class Entity { static UID: number; - private _uid; uid: string; constructor(uidPre: string); } } -declare module wdFrp { - class Main { +declare module 'wonder-frp/dist/es2015/core/Main' { + export class Main { static isTest: boolean; } } -declare module wdFrp { - function assert(cond: boolean, message?: string): void; - function require(InFunc: any): (target: any, name: any, descriptor: any) => any; - function ensure(OutFunc: any): (target: any, name: any, descriptor: any) => any; - function requireGetter(InFunc: any): (target: any, name: any, descriptor: any) => any; - function requireSetter(InFunc: any): (target: any, name: any, descriptor: any) => any; - function ensureGetter(OutFunc: any): (target: any, name: any, descriptor: any) => any; - function ensureSetter(OutFunc: any): (target: any, name: any, descriptor: any) => any; - function invariant(func: any): (target: any) => void; -} - -declare module wdFrp { - interface IDisposable { - dispose(): void; - } -} - -declare module wdFrp { - class SingleDisposable extends Entity implements IDisposable { - static create(disposeHandler?: Function): SingleDisposable; - private _disposeHandler; - private _isDisposed; - constructor(disposeHandler: Function); - setDisposeHandler(handler: Function): void; - dispose(): void; - } -} - -declare module wdFrp { - class GroupDisposable extends Entity implements IDisposable { - static create(disposable?: IDisposable): GroupDisposable; - private _group; - private _isDisposed; - constructor(disposable?: IDisposable); - add(disposable: IDisposable): this; - remove(disposable: IDisposable): this; - dispose(): void; - } -} - -declare module wdFrp { - interface IObserver extends IDisposable { - next(value: any): any; - error(error: any): any; - completed(): any; - } -} - -declare module wdFrp { - class InnerSubscription implements IDisposable { - static create(subject: Subject | GeneratorSubject, observer: Observer): InnerSubscription; - private _subject; - private _observer; - constructor(subject: Subject | GeneratorSubject, observer: Observer); - dispose(): void; - } -} - -declare module wdFrp { - class InnerSubscriptionGroup implements IDisposable { - static create(): InnerSubscriptionGroup; - private _container; - addChild(child: IDisposable): void; - dispose(): void; - } -} - -declare var global:NodeJS.Global,window:Window; -declare module wdFrp { - var root: any; -} - -declare module wdFrp { -} - -declare module wdFrp { -} - -declare module wdFrp { -} - -declare module wdFrp { - abstract class Stream extends Entity { - scheduler: Scheduler; - subscribeFunc: (observer: IObserver) => Function | void; - constructor(subscribeFunc: any); - abstract subscribe(arg1: Function | Observer | Subject, onError?: Function, onCompleted?: Function): IDisposable; - buildStream(observer: IObserver): IDisposable; - do(onNext?: Function, onError?: Function, onCompleted?: Function): DoStream; - map(selector: Function): MapStream; - flatMap(selector: Function): MergeAllStream; - concatMap(selector: Function): any; - mergeAll(): MergeAllStream; - concatAll(): any; - skipUntil(otherStream: Stream): SkipUntilStream; - takeUntil(otherStream: Stream): TakeUntilStream; - take(count?: number): AnonymousStream; - takeLast(count?: number): AnonymousStream; - takeWhile(predicate: (value: any, index: number, source: Stream) => boolean, thisArg?: this): AnonymousStream; - lastOrDefault(defaultValue?: any): AnonymousStream; - filter(predicate: (value: any) => boolean, thisArg?: this): any; - filterWithState(predicate: (value: any) => boolean, thisArg?: this): any; - concat(streamArr: Array): any; - concat(...otherStream: any[]): any; - merge(maxConcurrent: number): any; - merge(streamArr: Array): any; - merge(...otherStreams: any[]): any; - repeat(count?: number): RepeatStream; - ignoreElements(): IgnoreElementsStream; - protected handleSubject(subject: any): boolean; - private _isSubject(subject); - private _setSubject(subject); - } -} - -declare module wdFrp { - class Scheduler { - static create(...args: any[]): Scheduler; - private _requestLoopId; - requestLoopId: any; - publishRecursive(observer: IObserver, initial: any, action: Function): void; - publishInterval(observer: IObserver, initial: any, interval: number, action: Function): number; - publishIntervalRequest(observer: IObserver, action: Function): void; - publishTimeout(observer: IObserver, time: number, action: Function): number; - } -} - -declare module wdFrp { - abstract class Observer extends Entity implements IObserver { - private _isDisposed; +declare module 'wonder-frp/dist/es2015/core/Observer' { + import { Entity } from "wonder-frp/dist/es2015/core/Entity"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export abstract class Observer extends Entity implements IObserver { isDisposed: boolean; protected onUserNext: Function; protected onUserError: Function; protected onUserCompleted: Function; - private _isStop; - private _disposable; constructor(observer: IObserver); constructor(onNext: Function, onError: Function, onCompleted: Function); next(value: any): any; @@ -186,26 +132,627 @@ declare module wdFrp { } } -declare module wdFrp { - class Subject implements IObserver { - static create(): Subject; - private _source; - source: Stream; - private _observer; - subscribe(arg1?: Function | Observer, onError?: Function, onCompleted?: Function): IDisposable; - next(value: any): void; - error(error: any): void; - completed(): void; - start(): void; - remove(observer: Observer): void; +declare module 'wonder-frp/dist/es2015/core/Scheduler' { + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class Scheduler { + static create(...args: any[]): Scheduler; + requestLoopId: any; + publishRecursive(observer: IObserver, initial: any, action: Function): void; + publishInterval(observer: IObserver, initial: any, interval: number, action: Function): number; + publishIntervalRequest(observer: IObserver, action: Function): void; + publishTimeout(observer: IObserver, time: number, action: Function): number; + } +} + +declare module 'wonder-frp/dist/es2015/core/Stream' { + import { Entity } from "wonder-frp/dist/es2015/core/Entity"; + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { Subject } from "wonder-frp/dist/es2015/subject/Subject"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export abstract class Stream extends Entity { + scheduler: Scheduler; + subscribeFunc: (observer: IObserver) => Function | void; + constructor(subscribeFunc: any); + abstract subscribe(arg1: Function | Observer | Subject, onError?: Function, onCompleted?: Function): IDisposable; + buildStream(observer: IObserver): IDisposable; + do(onNext?: Function, onError?: Function, onCompleted?: Function): any; + map(selector: Function): any; + flatMap(selector: Function): any; + concatMap(selector: Function): any; + mergeAll(): any; + concatAll(): any; + skipUntil(otherStream: Stream): any; + takeUntil(otherStream: Stream): any; + take(count?: number): any; + takeLast(count?: number): any; + takeWhile(predicate: (value: any, index: number, source: Stream) => boolean, thisArg?: this): any; + lastOrDefault(defaultValue?: any): any; + filter(predicate: (value: any) => boolean, thisArg?: this): any; + filterWithState(predicate: (value: any) => boolean, thisArg?: this): any; + concat(streamArr: Array): any; + concat(...otherStream: any[]): any; + merge(maxConcurrent: number): any; + merge(streamArr: Array): any; + merge(...otherStreams: any[]): any; + repeat(count?: number): any; + ignoreElements(): any; + protected handleSubject(subject: any): boolean; + } +} + +declare module 'wonder-frp/dist/es2015/definition/typescript/decorator/contract' { + export function assert(cond: boolean, message?: string): void; + export function requireCheck(InFunc: any): (target: any, name: any, descriptor: any) => any; + export function ensure(OutFunc: any): (target: any, name: any, descriptor: any) => any; + export function requireGetter(InFunc: any): (target: any, name: any, descriptor: any) => any; + export function requireSetter(InFunc: any): (target: any, name: any, descriptor: any) => any; + export function ensureGetter(OutFunc: any): (target: any, name: any, descriptor: any) => any; + export function ensureSetter(OutFunc: any): (target: any, name: any, descriptor: any) => any; + export function invariant(func: any): (target: any) => void; +} + +declare module 'wonder-frp/dist/es2015/Disposable/GroupDisposable' { + import { Entity } from "wonder-frp/dist/es2015/core/Entity"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class GroupDisposable extends Entity implements IDisposable { + static create(disposable?: IDisposable): GroupDisposable; + constructor(disposable?: IDisposable); + add(disposable: IDisposable): this; + remove(disposable: IDisposable): this; dispose(): void; } } -declare module wdFrp { - class GeneratorSubject extends Entity implements IObserver { +declare module 'wonder-frp/dist/es2015/Disposable/IDisposable' { + export interface IDisposable { + dispose(): void; + } +} + +declare module 'wonder-frp/dist/es2015/Disposable/InnerSubscription' { + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + import { Subject } from "wonder-frp/dist/es2015/subject/Subject"; + import { GeneratorSubject } from "wonder-frp/dist/es2015/subject/GeneratorSubject"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + export class InnerSubscription implements IDisposable { + static create(subject: Subject | GeneratorSubject, observer: Observer): InnerSubscription; + constructor(subject: Subject | GeneratorSubject, observer: Observer); + dispose(): void; + } +} + +declare module 'wonder-frp/dist/es2015/Disposable/InnerSubscriptionGroup' { + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class InnerSubscriptionGroup implements IDisposable { + static create(): InnerSubscriptionGroup; + addChild(child: IDisposable): void; + dispose(): void; + } +} + +declare module 'wonder-frp/dist/es2015/Disposable/SingleDisposable' { + import { Entity } from "wonder-frp/dist/es2015/core/Entity"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class SingleDisposable extends Entity implements IDisposable { + static create(disposeHandler?: Function): SingleDisposable; + constructor(disposeHandler: Function); + setDisposeHandler(handler: Function): void; + dispose(): void; + } +} + +declare module 'wonder-frp/dist/es2015/enum/FilterState' { + export enum FilterState { + TRIGGER = 0, + ENTER = 1, + LEAVE = 2, + } +} + +declare module 'wonder-frp/dist/es2015/global/Operator' { + import { AnonymousStream } from "wonder-frp/dist/es2015/stream/AnonymousStream"; + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { FromArrayStream } from "wonder-frp/dist/es2015/stream/FromArrayStream"; + import { FromPromiseStream } from "wonder-frp/dist/es2015/stream/FromPromiseStream"; + import { FromEventPatternStream } from "wonder-frp/dist/es2015/stream/FromEventPatternStream"; + import { IntervalStream } from "wonder-frp/dist/es2015/stream/IntervalStream"; + import { IntervalRequestStream } from "wonder-frp/dist/es2015/stream/IntervalRequestStream"; + import { TimeoutStream } from "wonder-frp/dist/es2015/stream/TimeoutStream"; + import { DeferStream } from "wonder-frp/dist/es2015/stream/DeferStream"; + export class Operator { + static empty(): AnonymousStream; + static createStream(subscribeFunc: any): AnonymousStream; + static fromArray(array: Array, scheduler?: Scheduler): FromArrayStream; + } + export var createStream: typeof Operator.createStream; + export var empty: typeof Operator.empty; + export var fromArray: typeof Operator.fromArray; + export var fromPromise: (promise: any, scheduler?: Scheduler) => FromPromiseStream; + export var fromEventPattern: (addHandler: Function, removeHandler: Function) => FromEventPatternStream; + export var interval: (interval: any, scheduler?: Scheduler) => IntervalStream; + export var intervalRequest: (scheduler?: Scheduler) => IntervalRequestStream; + export var timeout: (time: any, scheduler?: Scheduler) => TimeoutStream; + export var callFunc: (func: Function, context?: any) => AnonymousStream; + export var judge: (condition: Function, thenSource: Function, elseSource: Function) => any; + export var defer: (buildStreamFunc: Function) => DeferStream; + export var just: (returnValue: any) => AnonymousStream; +} + +declare module 'wonder-frp/dist/es2015/global/Variable' { + export var root: any; +} + +declare module 'wonder-frp/dist/es2015/observer/AnonymousObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + export class AnonymousObserver extends Observer { + static create(onNext: Function, onError: Function, onCompleted: Function): AnonymousObserver; + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/AutoDetachObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class AutoDetachObserver extends Observer { + static create(observer: IObserver): any; + static create(onNext: Function, onError: Function, onCompleted: Function): any; + dispose(): void; + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/ConcatObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class ConcatObserver extends Observer { + static create(currentObserver: IObserver, startNextStream: Function): ConcatObserver; + protected currentObserver: any; + constructor(currentObserver: IObserver, startNextStream: Function); + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/DoObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class DoObserver extends Observer { + static create(currentObserver: IObserver, prevObserver: IObserver): DoObserver; + constructor(currentObserver: IObserver, prevObserver: IObserver); + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/FilterObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + export class FilterObserver extends Observer { + static create(prevObserver: IObserver, predicate: (value: any, index?: number, source?: Stream) => boolean, source: Stream): FilterObserver; + constructor(prevObserver: IObserver, predicate: (value: any) => boolean, source: Stream); + protected prevObserver: IObserver; + protected source: Stream; + protected i: number; + protected predicate: (value: any, index?: number, source?: Stream) => boolean; + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/FilterWithStateObserver' { + import { FilterObserver } from "wonder-frp/dist/es2015/observer/FilterObserver"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + export class FilterWithStateObserver extends FilterObserver { + static create(prevObserver: IObserver, predicate: (value: any, index?: number, source?: Stream) => boolean, source: Stream): FilterWithStateObserver; + protected onNext(value: any): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/IgnoreElementsObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class IgnoreElementsObserver extends Observer { + static create(currentObserver: IObserver): IgnoreElementsObserver; + constructor(currentObserver: IObserver); + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/IObserver' { + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export interface IObserver extends IDisposable { + next(value: any): any; + error(error: any): any; + completed(): any; + } +} + +declare module 'wonder-frp/dist/es2015/observer/ISubjectObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + export interface ISubjectObserver { + addChild(observer: Observer): any; + removeChild(observer: Observer): any; + } +} + +declare module 'wonder-frp/dist/es2015/observer/MapObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class MapObserver extends Observer { + static create(currentObserver: IObserver, selector: Function): MapObserver; + constructor(currentObserver: IObserver, selector: Function); + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/MergeAllObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class MergeAllObserver extends Observer { + static create(currentObserver: IObserver, streamGroup: Collection, groupDisposable: GroupDisposable): MergeAllObserver; + constructor(currentObserver: IObserver, streamGroup: Collection, groupDisposable: GroupDisposable); + done: boolean; + currentObserver: IObserver; + protected onNext(innerSource: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/MergeObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class MergeObserver extends Observer { + static create(currentObserver: IObserver, maxConcurrent: number, streamGroup: Collection, groupDisposable: GroupDisposable): MergeObserver; + constructor(currentObserver: IObserver, maxConcurrent: number, streamGroup: Collection, groupDisposable: GroupDisposable); + done: boolean; + currentObserver: IObserver; + activeCount: number; + q: Array; + handleSubscribe(innerSource: any): void; + protected onNext(innerSource: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/SkipUntilOtherObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SkipUntilStream } from "wonder-frp/dist/es2015/stream/SkipUntilStream"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class SkipUntilOtherObserver extends Observer { + static create(prevObserver: IObserver, skipUntilStream: SkipUntilStream): SkipUntilOtherObserver; + otherDisposable: IDisposable; + constructor(prevObserver: IObserver, skipUntilStream: SkipUntilStream); + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/SkipUntilSourceObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SkipUntilStream } from "wonder-frp/dist/es2015/stream/SkipUntilStream"; + export class SkipUntilSourceObserver extends Observer { + static create(prevObserver: IObserver, skipUntilStream: SkipUntilStream): SkipUntilSourceObserver; + constructor(prevObserver: IObserver, skipUntilStream: SkipUntilStream); + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/SubjectObserver' { + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + export class SubjectObserver implements IObserver { + observers: Collection; + isEmpty(): boolean; + next(value: any): void; + error(error: any): void; + completed(): void; + addChild(observer: Observer): void; + removeChild(observer: Observer): void; + dispose(): void; + setDisposable(disposable: IDisposable): void; + } +} + +declare module 'wonder-frp/dist/es2015/observer/TakeUntilObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class TakeUntilObserver extends Observer { + static create(prevObserver: IObserver): TakeUntilObserver; + constructor(prevObserver: IObserver); + protected onNext(value: any): void; + protected onError(error: any): void; + protected onCompleted(): void; + } +} + +declare module 'wonder-frp/dist/es2015/stream/AnonymousStream' { + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { Subject } from "wonder-frp/dist/es2015/subject/Subject"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class AnonymousStream extends Stream { + static create(subscribeFunc: Function): AnonymousStream; + constructor(subscribeFunc: Function); + buildStream(observer: IObserver): IDisposable; + subscribe(subject: Subject): IDisposable; + subscribe(observer: IObserver): IDisposable; + subscribe(onNext: (value: any) => void): IDisposable; + subscribe(onNext: (value: any) => void, onError: (e: any) => void): IDisposable; + subscribe(onNext: (value: any) => void, onError: (e: any) => void, onComplete: () => void): IDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/BaseStream' { + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { Subject } from "wonder-frp/dist/es2015/subject/Subject"; + export abstract class BaseStream extends Stream { + abstract subscribeCore(observer: IObserver): IDisposable; + subscribe(arg1: Function | Observer | Subject, onError?: any, onCompleted?: any): IDisposable; + buildStream(observer: IObserver): IDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/ConcatStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class ConcatStream extends BaseStream { + static create(sources: Array): ConcatStream; + constructor(sources: Array); + subscribeCore(observer: IObserver): GroupDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/DeferStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class DeferStream extends BaseStream { + static create(buildStreamFunc: Function): DeferStream; + constructor(buildStreamFunc: Function); + subscribeCore(observer: IObserver): GroupDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/DoStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class DoStream extends BaseStream { + static create(source: Stream, onNext?: Function, onError?: Function, onCompleted?: Function): DoStream; + constructor(source: Stream, onNext: Function, onError: Function, onCompleted: Function); + subscribeCore(observer: IObserver): IDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/FilterStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class FilterStream extends BaseStream { + static create(source: Stream, predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any): FilterStream; + constructor(source: Stream, predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any); + predicate: (value: any, index?: number, source?: Stream) => boolean; + subscribeCore(observer: IObserver): IDisposable; + internalFilter(predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any): Stream; + protected createObserver(observer: IObserver): Observer; + protected createStreamForInternalFilter(source: Stream, innerPredicate: any, thisArg: any): Stream; + } +} + +declare module 'wonder-frp/dist/es2015/stream/FilterWithStateStream' { + import { FilterStream } from "wonder-frp/dist/es2015/stream/FilterStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { FilterWithStateObserver } from "wonder-frp/dist/es2015/observer/FilterWithStateObserver"; + export class FilterWithStateStream extends FilterStream { + static create(source: Stream, predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any): FilterWithStateStream; + protected createObserver(observer: IObserver): FilterWithStateObserver; + protected createStreamForInternalFilter(source: Stream, innerPredicate: any, thisArg: any): Stream; + } +} + +declare module 'wonder-frp/dist/es2015/stream/FromArrayStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export class FromArrayStream extends BaseStream { + static create(array: Array, scheduler: Scheduler): FromArrayStream; + constructor(array: Array, scheduler: Scheduler); + subscribeCore(observer: IObserver): SingleDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/FromEventPatternStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export class FromEventPatternStream extends BaseStream { + static create(addHandler: Function, removeHandler: Function): FromEventPatternStream; + constructor(addHandler: Function, removeHandler: Function); + subscribeCore(observer: IObserver): SingleDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/FromPromiseStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export class FromPromiseStream extends BaseStream { + static create(promise: any, scheduler: Scheduler): FromPromiseStream; + constructor(promise: any, scheduler: Scheduler); + subscribeCore(observer: IObserver): SingleDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/IgnoreElementsStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class IgnoreElementsStream extends BaseStream { + static create(source: Stream): IgnoreElementsStream; + constructor(source: Stream); + subscribeCore(observer: IObserver): IDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/IntervalRequestStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export class IntervalRequestStream extends BaseStream { + static create(scheduler: Scheduler): IntervalRequestStream; + constructor(scheduler: Scheduler); + subscribeCore(observer: IObserver): SingleDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/IntervalStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export class IntervalStream extends BaseStream { + static create(interval: number, scheduler: Scheduler): IntervalStream; + constructor(interval: number, scheduler: Scheduler); + initWhenCreate(): void; + subscribeCore(observer: IObserver): SingleDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/MapStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class MapStream extends BaseStream { + static create(source: Stream, selector: Function): MapStream; + constructor(source: Stream, selector: Function); + subscribeCore(observer: IObserver): IDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/MergeAllStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class MergeAllStream extends BaseStream { + static create(source: Stream): MergeAllStream; + constructor(source: Stream); + subscribeCore(observer: IObserver): GroupDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/MergeStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class MergeStream extends BaseStream { + static create(source: Stream, maxConcurrent: number): MergeStream; + constructor(source: Stream, maxConcurrent: number); + subscribeCore(observer: IObserver): GroupDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/RepeatStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class RepeatStream extends BaseStream { + static create(source: Stream, count: number): RepeatStream; + constructor(source: Stream, count: number); + subscribeCore(observer: IObserver): GroupDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/SkipUntilStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class SkipUntilStream extends BaseStream { + static create(source: Stream, otherSteam: Stream): SkipUntilStream; + isOpen: boolean; + constructor(source: Stream, otherStream: Stream); + subscribeCore(observer: IObserver): GroupDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/TakeUntilStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { GroupDisposable } from "wonder-frp/dist/es2015/Disposable/GroupDisposable"; + export class TakeUntilStream extends BaseStream { + static create(source: Stream, otherSteam: Stream): TakeUntilStream; + constructor(source: Stream, otherStream: Stream); + subscribeCore(observer: IObserver): GroupDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/stream/TimeoutStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export class TimeoutStream extends BaseStream { + static create(time: number, scheduler: Scheduler): TimeoutStream; + constructor(time: number, scheduler: Scheduler); + subscribeCore(observer: IObserver): SingleDisposable; + } +} + +declare module 'wonder-frp/dist/es2015/subject/GeneratorSubject' { + import { Entity } from "wonder-frp/dist/es2015/core/Entity"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class GeneratorSubject extends Entity implements IObserver { static create(): GeneratorSubject; - private _isStart; isStart: boolean; constructor(); observer: any; @@ -228,426 +775,39 @@ declare module wdFrp { } } -declare module wdFrp { - class AnonymousObserver extends Observer { - static create(onNext: Function, onError: Function, onCompleted: Function): AnonymousObserver; - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class AutoDetachObserver extends Observer { - static create(observer: IObserver): any; - static create(onNext: Function, onError: Function, onCompleted: Function): any; - dispose(): void; - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class MapObserver extends Observer { - static create(currentObserver: IObserver, selector: Function): MapObserver; - private _currentObserver; - private _selector; - constructor(currentObserver: IObserver, selector: Function); - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class DoObserver extends Observer { - static create(currentObserver: IObserver, prevObserver: IObserver): DoObserver; - private _currentObserver; - private _prevObserver; - constructor(currentObserver: IObserver, prevObserver: IObserver); - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class MergeAllObserver extends Observer { - static create(currentObserver: IObserver, streamGroup: wdCb.Collection, groupDisposable: GroupDisposable): MergeAllObserver; - constructor(currentObserver: IObserver, streamGroup: wdCb.Collection, groupDisposable: GroupDisposable); - done: boolean; - currentObserver: IObserver; - private _streamGroup; - private _groupDisposable; - protected onNext(innerSource: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class MergeObserver extends Observer { - static create(currentObserver: IObserver, maxConcurrent: number, streamGroup: wdCb.Collection, groupDisposable: GroupDisposable): MergeObserver; - constructor(currentObserver: IObserver, maxConcurrent: number, streamGroup: wdCb.Collection, groupDisposable: GroupDisposable); - done: boolean; - currentObserver: IObserver; - activeCount: number; - q: Array; - private _maxConcurrent; - private _groupDisposable; - private _streamGroup; - handleSubscribe(innerSource: any): void; - protected onNext(innerSource: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - private _isReachMaxConcurrent(); - } -} - -declare module wdFrp { - class TakeUntilObserver extends Observer { - static create(prevObserver: IObserver): TakeUntilObserver; - private _prevObserver; - constructor(prevObserver: IObserver); - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class SkipUntilSourceObserver extends Observer { - static create(prevObserver: IObserver, skipUntilStream: SkipUntilStream): SkipUntilSourceObserver; - private _prevObserver; - private _skipUntilStream; - constructor(prevObserver: IObserver, skipUntilStream: SkipUntilStream); - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class SkipUntilOtherObserver extends Observer { - static create(prevObserver: IObserver, skipUntilStream: SkipUntilStream): SkipUntilOtherObserver; - otherDisposable: IDisposable; - private _prevObserver; - private _skipUntilStream; - constructor(prevObserver: IObserver, skipUntilStream: SkipUntilStream); - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class ConcatObserver extends Observer { - static create(currentObserver: IObserver, startNextStream: Function): ConcatObserver; - protected currentObserver: any; - private _startNextStream; - constructor(currentObserver: IObserver, startNextStream: Function); - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - interface ISubjectObserver { - addChild(observer: Observer): any; - removeChild(observer: Observer): any; - } -} - -declare module wdFrp { - class SubjectObserver implements IObserver { - observers: wdCb.Collection; - private _disposable; - isEmpty(): boolean; +declare module 'wonder-frp/dist/es2015/subject/Subject' { + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Stream } from "wonder-frp/dist/es2015/core/Stream"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { IDisposable } from "wonder-frp/dist/es2015/Disposable/IDisposable"; + export class Subject implements IObserver { + static create(): Subject; + source: Stream; + subscribe(arg1?: Function | Observer, onError?: Function, onCompleted?: Function): IDisposable; next(value: any): void; error(error: any): void; completed(): void; - addChild(observer: Observer): void; - removeChild(observer: Observer): void; + start(): void; + remove(observer: Observer): void; dispose(): void; - setDisposable(disposable: IDisposable): void; } } -declare module wdFrp { - class IgnoreElementsObserver extends Observer { - static create(currentObserver: IObserver): IgnoreElementsObserver; - private _currentObserver; - constructor(currentObserver: IObserver); - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; +declare module 'wonder-frp/dist/es2015/testing/ActionType' { + export enum ActionType { + NEXT = 0, + ERROR = 1, + COMPLETED = 2, } } -declare module wdFrp { - class FilterObserver extends Observer { - static create(prevObserver: IObserver, predicate: (value: any, index?: number, source?: Stream) => boolean, source: Stream): FilterObserver; - constructor(prevObserver: IObserver, predicate: (value: any) => boolean, source: Stream); - protected prevObserver: IObserver; - protected source: Stream; - protected i: number; - protected predicate: (value: any, index?: number, source?: Stream) => boolean; - protected onNext(value: any): void; - protected onError(error: any): void; - protected onCompleted(): void; - } -} - -declare module wdFrp { - class FilterWithStateObserver extends FilterObserver { - static create(prevObserver: IObserver, predicate: (value: any, index?: number, source?: Stream) => boolean, source: Stream): FilterWithStateObserver; - private _isTrigger; - protected onNext(value: any): void; - } -} - -declare module wdFrp { - abstract class BaseStream extends Stream { - abstract subscribeCore(observer: IObserver): IDisposable; - subscribe(arg1: Function | Observer | Subject, onError?: any, onCompleted?: any): IDisposable; - buildStream(observer: IObserver): IDisposable; - } -} - -declare module wdFrp { - class DoStream extends BaseStream { - static create(source: Stream, onNext?: Function, onError?: Function, onCompleted?: Function): DoStream; - private _source; - private _observer; - constructor(source: Stream, onNext: Function, onError: Function, onCompleted: Function); - subscribeCore(observer: IObserver): IDisposable; - } -} - -declare module wdFrp { - class MapStream extends BaseStream { - static create(source: Stream, selector: Function): MapStream; - private _source; - private _selector; - constructor(source: Stream, selector: Function); - subscribeCore(observer: IObserver): IDisposable; - } -} - -declare module wdFrp { - class FromArrayStream extends BaseStream { - static create(array: Array, scheduler: Scheduler): FromArrayStream; - private _array; - constructor(array: Array, scheduler: Scheduler); - subscribeCore(observer: IObserver): SingleDisposable; - } -} - -declare module wdFrp { - class FromPromiseStream extends BaseStream { - static create(promise: any, scheduler: Scheduler): FromPromiseStream; - private _promise; - constructor(promise: any, scheduler: Scheduler); - subscribeCore(observer: IObserver): SingleDisposable; - } -} - -declare module wdFrp { - class FromEventPatternStream extends BaseStream { - static create(addHandler: Function, removeHandler: Function): FromEventPatternStream; - private _addHandler; - private _removeHandler; - constructor(addHandler: Function, removeHandler: Function); - subscribeCore(observer: IObserver): SingleDisposable; - } -} - -declare module wdFrp { - class AnonymousStream extends Stream { - static create(subscribeFunc: Function): AnonymousStream; - constructor(subscribeFunc: Function); - subscribe(subject: Subject): IDisposable; - subscribe(observer: IObserver): IDisposable; - subscribe(onNext: (value: any) => void): IDisposable; - subscribe(onNext: (value: any) => void, onError: (e: any) => void): IDisposable; - subscribe(onNext: (value: any) => void, onError: (e: any) => void, onComplete: () => void): IDisposable; - } -} - -declare module wdFrp { - class IntervalStream extends BaseStream { - static create(interval: number, scheduler: Scheduler): IntervalStream; - private _interval; - constructor(interval: number, scheduler: Scheduler); - initWhenCreate(): void; - subscribeCore(observer: IObserver): SingleDisposable; - } -} - -declare module wdFrp { - class IntervalRequestStream extends BaseStream { - static create(scheduler: Scheduler): IntervalRequestStream; - private _isEnd; - constructor(scheduler: Scheduler); - subscribeCore(observer: IObserver): SingleDisposable; - } -} - -declare module wdFrp { - class TimeoutStream extends BaseStream { - static create(time: number, scheduler: Scheduler): TimeoutStream; - private _time; - constructor(time: number, scheduler: Scheduler); - subscribeCore(observer: IObserver): SingleDisposable; - } -} - -declare module wdFrp { - class MergeAllStream extends BaseStream { - static create(source: Stream): MergeAllStream; - constructor(source: Stream); - private _source; - private _observer; - subscribeCore(observer: IObserver): GroupDisposable; - } -} - -declare module wdFrp { - class MergeStream extends BaseStream { - static create(source: Stream, maxConcurrent: number): MergeStream; - constructor(source: Stream, maxConcurrent: number); - private _source; - private _maxConcurrent; - subscribeCore(observer: IObserver): GroupDisposable; - } -} - -declare module wdFrp { - class TakeUntilStream extends BaseStream { - static create(source: Stream, otherSteam: Stream): TakeUntilStream; - private _source; - private _otherStream; - constructor(source: Stream, otherStream: Stream); - subscribeCore(observer: IObserver): GroupDisposable; - } -} - -declare module wdFrp { - class SkipUntilStream extends BaseStream { - static create(source: Stream, otherSteam: Stream): SkipUntilStream; - isOpen: boolean; - private _source; - private _otherStream; - constructor(source: Stream, otherStream: Stream); - subscribeCore(observer: IObserver): GroupDisposable; - } -} - -declare module wdFrp { - class ConcatStream extends BaseStream { - static create(sources: Array): ConcatStream; - private _sources; - constructor(sources: Array); - subscribeCore(observer: IObserver): GroupDisposable; - } -} - -declare module wdFrp { - class RepeatStream extends BaseStream { - static create(source: Stream, count: number): RepeatStream; - private _source; - private _count; - constructor(source: Stream, count: number); - subscribeCore(observer: IObserver): GroupDisposable; - } -} - -declare module wdFrp { - class IgnoreElementsStream extends BaseStream { - static create(source: Stream): IgnoreElementsStream; - private _source; - constructor(source: Stream); - subscribeCore(observer: IObserver): IDisposable; - } -} - -declare module wdFrp { - class DeferStream extends BaseStream { - static create(buildStreamFunc: Function): DeferStream; - private _buildStreamFunc; - constructor(buildStreamFunc: Function); - subscribeCore(observer: IObserver): GroupDisposable; - } -} - -declare module wdFrp { - class FilterStream extends BaseStream { - static create(source: Stream, predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any): FilterStream; - constructor(source: Stream, predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any); - predicate: (value: any, index?: number, source?: Stream) => boolean; - private _source; - subscribeCore(observer: IObserver): IDisposable; - internalFilter(predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any): Stream; - protected createObserver(observer: IObserver): Observer; - protected createStreamForInternalFilter(source: Stream, innerPredicate: any, thisArg: any): Stream; - private _innerPredicate(predicate, self); - } -} - -declare module wdFrp { - class FilterWithStateStream extends FilterStream { - static create(source: Stream, predicate: (value: any, index?: number, source?: Stream) => boolean, thisArg: any): FilterWithStateStream; - protected createObserver(observer: IObserver): FilterWithStateObserver; - protected createStreamForInternalFilter(source: Stream, innerPredicate: any, thisArg: any): Stream; - } -} - -declare module wdFrp { - var createStream: (subscribeFunc: any) => AnonymousStream; - var fromArray: (array: any[], scheduler?: Scheduler) => FromArrayStream; - var fromPromise: (promise: any, scheduler?: Scheduler) => FromPromiseStream; - var fromEventPattern: (addHandler: Function, removeHandler: Function) => FromEventPatternStream; - var interval: (interval: any, scheduler?: Scheduler) => IntervalStream; - var intervalRequest: (scheduler?: Scheduler) => IntervalRequestStream; - var timeout: (time: any, scheduler?: Scheduler) => TimeoutStream; - var empty: () => AnonymousStream; - var callFunc: (func: Function, context?: any) => AnonymousStream; - var judge: (condition: Function, thenSource: Function, elseSource: Function) => any; - var defer: (buildStreamFunc: Function) => DeferStream; - var just: (returnValue: any) => AnonymousStream; -} - -declare module wdFrp { - enum FilterState { - TRIGGER = 0, - ENTER = 1, - LEAVE = 2, - } -} - -declare module wdFrp { - class Record { - static create(time: number, value: any, actionType?: ActionType, comparer?: Function): Record; - private _time; - time: number; - private _value; - value: number; - private _actionType; - actionType: ActionType; - private _comparer; - constructor(time: any, value: any, actionType: ActionType, comparer: Function); - equals(other: any): any; - } -} - -declare module wdFrp { - class MockObserver extends Observer { +declare module 'wonder-frp/dist/es2015/testing/MockObserver' { + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { TestScheduler } from "wonder-frp/dist/es2015/testing/TestScheduler"; + import { Record } from "wonder-frp/dist/es2015/testing/Record"; + export class MockObserver extends Observer { static create(scheduler: TestScheduler): MockObserver; - private _messages; messages: [Record]; - private _scheduler; constructor(scheduler: TestScheduler); protected onNext(value: any): void; protected onError(error: any): void; @@ -657,39 +817,50 @@ declare module wdFrp { } } -declare module wdFrp { - class MockPromise { +declare module 'wonder-frp/dist/es2015/testing/MockPromise' { + import { TestScheduler } from "wonder-frp/dist/es2015/testing/TestScheduler"; + import { Record } from "wonder-frp/dist/es2015/testing/Record"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + export class MockPromise { static create(scheduler: TestScheduler, messages: [Record]): MockPromise; - private _messages; - private _scheduler; constructor(scheduler: TestScheduler, messages: [Record]); then(successCb: Function, errorCb: Function, observer: IObserver): void; } } -declare module wdFrp { - class TestScheduler extends Scheduler { +declare module 'wonder-frp/dist/es2015/testing/Record' { + import { ActionType } from "wonder-frp/dist/es2015/testing/ActionType"; + export class Record { + static create(time: number, value: any, actionType?: ActionType, comparer?: Function): Record; + time: number; + value: number; + actionType: ActionType; + constructor(time: any, value: any, actionType: ActionType, comparer: Function); + equals(other: any): any; + } +} + +declare module 'wonder-frp/dist/es2015/testing/TestScheduler' { + import { Scheduler } from "wonder-frp/dist/es2015/core/Scheduler"; + import { Record } from "wonder-frp/dist/es2015/testing/Record"; + import { MockObserver } from "wonder-frp/dist/es2015/testing/MockObserver"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { Observer } from "wonder-frp/dist/es2015/core/Observer"; + import { TestStream } from "wonder-frp/dist/es2015/testing/TestStream"; + import { MockPromise } from "wonder-frp/dist/es2015/testing/MockPromise"; + export class TestScheduler extends Scheduler { static next(tick: any, value: any): Record; static error(tick: any, error: any): Record; static completed(tick: any): Record; static create(isReset?: boolean): TestScheduler; constructor(isReset: boolean); - private _clock; clock: number; - private _isReset; - private _isDisposed; - private _timerMap; - private _streamMap; - private _subscribedTime; - private _disposedTime; - private _observer; setStreamMap(observer: IObserver, messages: [Record]): void; remove(observer: Observer): void; publishRecursive(observer: MockObserver, initial: any, recursiveFunc: Function): void; publishInterval(observer: IObserver, initial: any, interval: number, action: Function): number; publishIntervalRequest(observer: IObserver, action: Function): number; publishTimeout(observer: IObserver, time: number, action: Function): number; - private _setClock(); startWithTime(create: Function, subscribedTime: number, disposedTime: number): MockObserver; startWithSubscribe(create: any, subscribedTime?: number): MockObserver; startWithDispose(create: any, disposedTime?: number): MockObserver; @@ -699,33 +870,20 @@ declare module wdFrp { createObserver(): MockObserver; createResolvedPromise(time: number, value: any): MockPromise; createRejectPromise(time: number, error: any): MockPromise; - private _getMinAndMaxTime(); - private _exec(time, map); - private _runStream(time); - private _runAt(time, callback); - private _tick(time); } } -declare module wdFrp { - enum ActionType { - NEXT = 0, - ERROR = 1, - COMPLETED = 2, - } -} - -declare module wdFrp { - class TestStream extends BaseStream { +declare module 'wonder-frp/dist/es2015/testing/TestStream' { + import { BaseStream } from "wonder-frp/dist/es2015/stream/BaseStream"; + import { Record } from "wonder-frp/dist/es2015/testing/Record"; + import { TestScheduler } from "wonder-frp/dist/es2015/testing/TestScheduler"; + import { IObserver } from "wonder-frp/dist/es2015/observer/IObserver"; + import { SingleDisposable } from "wonder-frp/dist/es2015/Disposable/SingleDisposable"; + export class TestStream extends BaseStream { static create(messages: [Record], scheduler: TestScheduler): TestStream; scheduler: TestScheduler; - private _messages; constructor(messages: [Record], scheduler: TestScheduler); subscribeCore(observer: IObserver): SingleDisposable; } } -declare module "wonder-frp" { - export = wdFrp; -} - diff --git a/wonder-frp/wonder-frp-tests.ts b/wonder-frp/wonder-frp-tests.ts index 3efceed43f..ef7ea2672b 100644 --- a/wonder-frp/wonder-frp-tests.ts +++ b/wonder-frp/wonder-frp-tests.ts @@ -1,5 +1,5 @@ -import wdFrp = require("wonder-frp"); +import {fromArray} from "wonder-frp/dist/es2015/global/Operator"; -wdFrp.fromArray([1,2,3]) +fromArray([1,2,3]) .subscribe(function(){ }); diff --git a/wonder.js/index.d.ts b/wonder.js/index.d.ts new file mode 100644 index 0000000000..839fc0fb8c --- /dev/null +++ b/wonder.js/index.d.ts @@ -0,0 +1,2955 @@ +// Type definitions for wonder.js 0.1.0 +// Project: https://github.com/yyc-git/Wonder.js +// Definitions by: YYC +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + + +// Generated by dts-bundle v0.7.2 +// Dependencies for this module: +// ../../wonder-commonlib/dist/es2015/Hash +// ../../wonder-commonlib/dist/es2015/Collection +// ../../wonder-frp/dist/es2015/stream/FromEventPatternStream +// ../../wonder-commonlib/dist/es2015/utils/ArrayUtils +// ../../wonder-commonlib/dist/es2015/utils/JudgeUtils +// ../../wonder-commonlib/dist/es2015/Log + +declare module 'wonder.js/dist/es2015' { + export { Camera } from "wonder.js/dist/es2015/component/camera/Camera"; + export { BasicCameraController } from "wonder.js/dist/es2015/component/camera/controller/basic/BasicCameraController"; + export { CameraController } from "wonder.js/dist/es2015/component/camera/controller/CameraController"; + export { PerspectiveCamera } from "wonder.js/dist/es2015/component/camera/PerspectiveCamera"; + export { ComponentInitOrderTable } from "wonder.js/dist/es2015/component/data/ComponentInitOrderTable"; + export { BoxGeometry } from "wonder.js/dist/es2015/component/geometry/BoxGeometry"; + export { BasicBufferContainer } from "wonder.js/dist/es2015/component/geometry/data/BasicBufferContainer"; + export { BasicGeometryData } from "wonder.js/dist/es2015/component/geometry/data/BasicGeometryData"; + export { BufferContainer } from "wonder.js/dist/es2015/component/geometry/data/BufferContainer"; + export { CommonBufferContainer } from "wonder.js/dist/es2015/component/geometry/data/CommonBufferContainer"; + export { GeometryData } from "wonder.js/dist/es2015/component/geometry/data/GeometryData"; + export { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + export { GeometryUtils } from "wonder.js/dist/es2015/component/geometry/GeometryUtils"; + export { MeshRenderer } from "wonder.js/dist/es2015/component/renderer/MeshRenderer"; + export { RendererComponent } from "wonder.js/dist/es2015/component/renderer/RendererComponent"; + export { ETransformState } from "wonder.js/dist/es2015/component/transform/ETransformState"; + export { ThreeDTransform } from "wonder.js/dist/es2015/component/transform/ThreeDTransform"; + export { Transform } from "wonder.js/dist/es2015/component/transform/Transform"; + export { DebugConfig } from "wonder.js/dist/es2015/config/DebugConfig"; + export { Component } from "wonder.js/dist/es2015/core/Component"; + export { Director } from "wonder.js/dist/es2015/core/Director"; + export { Entity } from "wonder.js/dist/es2015/core/Entity"; + export { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + export { ComponentManager } from "wonder.js/dist/es2015/core/entityObject/manager/ComponentManager"; + export { EntityObjectManager } from "wonder.js/dist/es2015/core/entityObject/manager/EntityObjectManager"; + export { BufferTable, BufferTableKey } from "wonder.js/dist/es2015/core/entityObject/scene/cache/BufferTable"; + export { ProgramTable } from "wonder.js/dist/es2015/core/entityObject/scene/cache/ProgramTable"; + export { GameObjectScene } from "wonder.js/dist/es2015/core/entityObject/scene/gameObjectScene/GameObjectScene"; + export { Scene } from "wonder.js/dist/es2015/core/entityObject/scene/Scene"; + export { SceneDispatcher } from "wonder.js/dist/es2015/core/entityObject/scene/SceneDispatcher"; + export { Main } from "wonder.js/dist/es2015/core/Main"; + export { MainData } from "wonder.js/dist/es2015/core/data/MainData"; + export { cacheGetter, cache, cacheBufferForBufferContainer, cacheBufferForBufferContainerWithFuncParam } from "wonder.js/dist/es2015/definition/typescript/decorator/cache"; + export { cloneAttributeAsBasicType, cloneAttributeAsCloneable, cloneAttributeAsCustomType, CloneUtils, CloneType } from "wonder.js/dist/es2015/definition/typescript/decorator/clone"; + export { assert, describe, it, requireCheck, ensure, requireGetterAndSetter, requireGetter, requireSetter, ensureGetterAndSetter, ensureGetter, ensureSetter, invariant } from "wonder.js/dist/es2015/definition/typescript/decorator/contract"; + export { execOnlyOnce } from "wonder.js/dist/es2015/definition/typescript/decorator/control"; + export { registerClass } from "wonder.js/dist/es2015/definition/typescript/decorator/registerClass"; + export { singleton } from "wonder.js/dist/es2015/definition/typescript/decorator/singleton"; + export { virtual } from "wonder.js/dist/es2015/definition/typescript/decorator/virtual"; + export { root } from "wonder.js/dist/es2015/definition/Variable"; + export { DeviceManager, EDepthFunction, ESide, EPolygonOffsetMode, EBlendFunc, EBlendEquation, EBlendType, ECanvasType } from "wonder.js/dist/es2015/device/DeviceManager"; + export { EScreenSize } from "wonder.js/dist/es2015/device/EScreenSize"; + export { GPUDetector, EGPUPrecision } from "wonder.js/dist/es2015/device/GPUDetector"; + export { CustomEventBinder } from "wonder.js/dist/es2015/event/binder/CustomEventBinder"; + export { CustomEventRegister } from "wonder.js/dist/es2015/event/binder/CustomEventRegister"; + export { DomEventBinder } from "wonder.js/dist/es2015/event/binder/DomEventBinder"; + export { DomEventRegister } from "wonder.js/dist/es2015/event/binder/DomEventRegister"; + export { EventBinder } from "wonder.js/dist/es2015/event/binder/EventBinder"; + export { EventRegister } from "wonder.js/dist/es2015/event/binder/EventRegister"; + export { CustomEventDispatcher } from "wonder.js/dist/es2015/event/dispatcher/CustomEventDispatcher"; + export { DomEventDispatcher } from "wonder.js/dist/es2015/event/dispatcher/DomEventDispatcher"; + export { EventDispatcher } from "wonder.js/dist/es2015/event/dispatcher/EventDispatcher"; + export { EEngineEvent } from "wonder.js/dist/es2015/event/EEngineEvent"; + export { EventManager } from "wonder.js/dist/es2015/event/EventManager"; + export { EventBinderFactory } from "wonder.js/dist/es2015/event/factory/EventBinderFactory"; + export { EventDispatcherFactory } from "wonder.js/dist/es2015/event/factory/EventDispatcherFactory"; + export { EventHandlerFactory } from "wonder.js/dist/es2015/event/factory/EventHandlerFactory"; + export { CustomEventHandler } from "wonder.js/dist/es2015/event/handler/CustomEventHandler"; + export { DomEventHandler } from "wonder.js/dist/es2015/event/handler/DomEventHandler"; + export { EventHandler } from "wonder.js/dist/es2015/event/handler/EventHandler"; + export { KeyboardEventHandler } from "wonder.js/dist/es2015/event/handler/KeyboardEventHandler"; + export { MouseEventHandler } from "wonder.js/dist/es2015/event/handler/MouseEventHandler"; + export { PointEventHandler } from "wonder.js/dist/es2015/event/handler/PointEventHandler"; + export { TouchEventHandler } from "wonder.js/dist/es2015/event/handler/TouchEventHandler"; + export { CustomEvent } from "wonder.js/dist/es2015/event/object/CustomEvent"; + export { DomEvent } from "wonder.js/dist/es2015/event/object/DomEvent"; + export { EEventPhase } from "wonder.js/dist/es2015/event/object/EEventPhase"; + export { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + export { EMouseButton } from "wonder.js/dist/es2015/event/object/EMouseButton"; + export { Event } from "wonder.js/dist/es2015/event/object/Event"; + export { EEventName, EventNameHandler } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + export { EventTable } from "wonder.js/dist/es2015/event/object/EventTable"; + export { KeyboardEvent } from "wonder.js/dist/es2015/event/object/KeyboardEvent"; + export { MouseEvent } from "wonder.js/dist/es2015/event/object/MouseEvent"; + export { MousePointEvent } from "wonder.js/dist/es2015/event/object/MousePointEvent"; + export { PointEvent } from "wonder.js/dist/es2015/event/object/PointEvent"; + export { TouchEvent } from "wonder.js/dist/es2015/event/object/TouchEvent"; + export { TouchPointEvent } from "wonder.js/dist/es2015/event/object/TouchPointEvent"; + export { CustomEventListenerMap } from "wonder.js/dist/es2015/event/structure/CustomEventListenerMap"; + export { DomEventListenerMap } from "wonder.js/dist/es2015/event/structure/DomEventListenerMap"; + export { EventListenerMap } from "wonder.js/dist/es2015/event/structure/EventListenerMap"; + export { EventUtils } from "wonder.js/dist/es2015/event/utils/EventUtils"; + export { BasicMaterial } from "wonder.js/dist/es2015/material/BasicMaterial"; + export { EngineMaterial } from "wonder.js/dist/es2015/material/EngineMaterial"; + export { Material } from "wonder.js/dist/es2015/material/Material"; + export { ShaderManager } from "wonder.js/dist/es2015/material/ShaderManager"; + export { StandardBasicMaterial } from "wonder.js/dist/es2015/material/StandardBasicMaterial"; + export { DEG_TO_RAD, RAD_TO_DEG } from "wonder.js/dist/es2015/math/Global"; + export { Matrix3 } from "wonder.js/dist/es2015/math/Matrix3"; + export { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + export { Quaternion } from "wonder.js/dist/es2015/math/Quaternion"; + export { Vector2 } from "wonder.js/dist/es2015/math/Vector2"; + export { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + export { Vector4 } from "wonder.js/dist/es2015/math/Vector4"; + export { ArrayBuffer } from "wonder.js/dist/es2015/renderer/buffer/ArrayBuffer"; + export { Buffer } from "wonder.js/dist/es2015/renderer/buffer/Buffer"; + export { BufferDataTable } from "wonder.js/dist/es2015/renderer/buffer/BufferDataTable"; + export { CommonBuffer } from "wonder.js/dist/es2015/renderer/buffer/CommonBuffer"; + export { EBufferDataType } from "wonder.js/dist/es2015/renderer/buffer/EBufferDataType"; + export { EBufferType } from "wonder.js/dist/es2015/renderer/buffer/EBufferType"; + export { EBufferUsage } from "wonder.js/dist/es2015/renderer/buffer/EBufferUsage"; + export { ElementBuffer } from "wonder.js/dist/es2015/renderer/buffer/ElementBuffer"; + export { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + export { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + export { SingleDrawCommand } from "wonder.js/dist/es2015/renderer/command/SingleDrawCommand"; + export { EDrawMode } from "wonder.js/dist/es2015/renderer/EDrawMode"; + export { GlUtils } from "wonder.js/dist/es2015/renderer/GlUtils"; + export { GLSLDataSender } from "wonder.js/dist/es2015/renderer/program/GLSLDataSender"; + export { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + export { Renderer } from "wonder.js/dist/es2015/renderer/renderer/Renderer"; + export { WebGLRenderer } from "wonder.js/dist/es2015/renderer/renderer/WebGLRenderer"; + export { BasicMaterialColorShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/basic/BasicMaterialColorShaderLib"; + export { BasicShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/basic/BasicShaderLib"; + export { EndBasicShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/basic/EndBasicShaderLib"; + export { CommonShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/common/CommonShaderLib"; + export { EndShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/common/EndShaderLib"; + export { VerticeCommonShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/common/VerticeCommonShaderLib"; + export { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + export { ShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/ShaderLib"; + export { CommonShader } from "wonder.js/dist/es2015/renderer/shader/shader/CommonShader"; + export { EngineShader } from "wonder.js/dist/es2015/renderer/shader/shader/EngineShader"; + export { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + export { EngineShaderSourceBuilder } from "wonder.js/dist/es2015/renderer/shader/sourceBuilder/EngineShaderSourceBuilder"; + export { ShaderSourceBuilder } from "wonder.js/dist/es2015/renderer/shader/sourceBuilder/ShaderSourceBuilder"; + export { EVariableCategory } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableCategory"; + export { EVariableSemantic } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableSemantic"; + export { EVariableType } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableType"; + export { VariableLib } from "wonder.js/dist/es2015/renderer/shader/variable/VariableLib"; + export { VariableNameTable } from "wonder.js/dist/es2015/renderer/shader/variable/VariableNameTable"; + export { VariableTypeTable } from "wonder.js/dist/es2015/renderer/shader/variable/VariableTypeTable"; + export { BasicState } from "wonder.js/dist/es2015/renderer/state/BasicState"; + export { WebGLState } from "wonder.js/dist/es2015/renderer/state/WebGLState"; + export { Color } from "wonder.js/dist/es2015/structure/Color"; + export { Face3 } from "wonder.js/dist/es2015/structure/Face3"; + export { Point } from "wonder.js/dist/es2015/structure/Point"; + export { RectRegion } from "wonder.js/dist/es2015/structure/RectRegion"; + export { ViewWebGL } from "wonder.js/dist/es2015/structure/View"; + export { ArrayUtils } from "wonder.js/dist/es2015/utils/ArrayUtils"; + export { BufferUtils } from "wonder.js/dist/es2015/utils/BufferUtils"; + export { ClassUtils } from "wonder.js/dist/es2015/utils/ClassUtils"; + export { JudgeUtils } from "wonder.js/dist/es2015/utils/JudgeUtils"; + export { Log } from "wonder.js/dist/es2015/utils/Log"; + export { MathUtils } from "wonder.js/dist/es2015/utils/MathUtils"; + export { RenderUtils } from "wonder.js/dist/es2015/utils/RenderUtils"; + export { ShaderLibUtils } from "wonder.js/dist/es2015/utils/ShaderLibUtils"; + export { SortUtils } from "wonder.js/dist/es2015/utils/SortUtils"; + export { CommonTimeController } from "wonder.js/dist/es2015/utils/time/CommonTimeController"; + export { DirectorTimeController } from "wonder.js/dist/es2015/utils/time/DirectorTimeController"; + export { TimeController } from "wonder.js/dist/es2015/utils/time/TimeController"; + export { CompileConfig } from "wonder.js/dist/es2015/config/CompileConfig"; +} + +declare module 'wonder.js/dist/es2015/component/camera/Camera' { + import { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + export abstract class Camera { + readonly cameraToWorldMatrix: Matrix4; + worldToCameraMatrix: Matrix4; + near: number; + far: number; + pMatrix: Matrix4; + entityObject: GameObject; + protected pMatrixDirty: boolean; + init(): void; + dispose(): void; + clone(): this; + update(elapsed: number): void; + protected abstract updateProjectionMatrix(): any; + protected getInvViewProjMat(): Matrix4; + } +} + +declare module 'wonder.js/dist/es2015/component/camera/controller/basic/BasicCameraController' { + import { CameraController } from "wonder.js/dist/es2015/component/camera/controller/CameraController"; + import { Camera } from "wonder.js/dist/es2015/component/camera/Camera"; + export class BasicCameraController extends CameraController { + static create(cameraComponent: Camera): BasicCameraController; + } +} + +declare module 'wonder.js/dist/es2015/component/camera/controller/CameraController' { + import "wonder-frp/dist/es2015/stream/MergeAllStream"; + import { Component } from "wonder.js/dist/es2015/core/Component"; + import { Camera } from "wonder.js/dist/es2015/component/camera/Camera"; + import { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + export abstract class CameraController extends Component { + constructor(cameraComponent: Camera); + readonly cameraToWorldMatrix: Matrix4; + readonly worldToCameraMatrix: Matrix4; + pMatrix: Matrix4; + entityObject: GameObject; + camera: Camera; + init(): void; + update(elapsed: number): void; + dispose(): void; + clone(): this; + protected bindClearCacheEvent(): void; + protected disposeClearCacheEvent(): void; + } +} + +declare module 'wonder.js/dist/es2015/component/camera/PerspectiveCamera' { + import { Camera } from "wonder.js/dist/es2015/component/camera/Camera"; + export class PerspectiveCamera extends Camera { + static create(): PerspectiveCamera; + fovy: number; + aspect: number; + zoomIn(speed: number, min?: number): void; + zoomOut(speed: number, max?: number): void; + protected updateProjectionMatrix(): void; + } +} + +declare module 'wonder.js/dist/es2015/component/data/ComponentInitOrderTable' { + import { Component } from "wonder.js/dist/es2015/core/Component"; + export class ComponentInitOrderTable { + static getOrder(component: Component): 4 | 5; + } +} + +declare module 'wonder.js/dist/es2015/component/geometry/BoxGeometry' { + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + import { Face3 } from "wonder.js/dist/es2015/structure/Face3"; + export class BoxGeometry extends Geometry { + static create(): BoxGeometry; + width: number; + height: number; + depth: number; + widthSegments: number; + heightSegments: number; + depthSegments: number; + computeData(): { + vertices: any[]; + faces: Face3[]; + }; + } +} + +declare module 'wonder.js/dist/es2015/component/geometry/data/BasicBufferContainer' { + import { CommonBufferContainer } from "wonder.js/dist/es2015/component/geometry/data/CommonBufferContainer"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + export class BasicBufferContainer extends CommonBufferContainer { + static create(entityObject: GameObject): BasicBufferContainer; + } +} + +declare module 'wonder.js/dist/es2015/component/geometry/data/BasicGeometryData' { + import { GeometryData } from "wonder.js/dist/es2015/component/geometry/data/GeometryData"; + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + export class BasicGeometryData extends GeometryData { + static create(geometry: Geometry): BasicGeometryData; + } +} + +declare module 'wonder.js/dist/es2015/component/geometry/data/BufferContainer' { + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + import { GeometryData } from "wonder.js/dist/es2015/component/geometry/data/GeometryData"; + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + import { Buffer } from "wonder.js/dist/es2015/renderer/buffer/Buffer"; + import { EBufferDataType } from "wonder.js/dist/es2015/renderer/buffer/EBufferDataType"; + import { EBufferType } from "wonder.js/dist/es2015/renderer/buffer/EBufferType"; + import { EBufferUsage } from "wonder.js/dist/es2015/renderer/buffer/EBufferUsage"; + export abstract class BufferContainer { + constructor(entityObject: GameObject); + geometryData: GeometryData; + protected entityObject: GameObject; + protected container: Hash; + createBuffersFromGeometryData(): void; + removeCache(type: EBufferDataType): any; + removeCache(name: string): any; + getChild(type: EBufferDataType): any; + getChild(type: EBufferDataType, dataName: string): any; + init(): void; + dispose(): void; + protected abstract getVertice(type: EBufferDataType): any; + protected createOnlyOnceAndUpdateArrayBuffer(bufferAttriName: string, data: Array, size: number, type?: EBufferType, offset?: number, usage?: EBufferUsage): void; + protected createOnlyOnceAndUpdateElememntBuffer(bufferAttriName: string, data: Array, type?: EBufferType, offset?: number, usage?: EBufferUsage): void; + protected hasData(data: Array | null): boolean; + } +} + +declare module 'wonder.js/dist/es2015/component/geometry/data/CommonBufferContainer' { + import { BufferContainer } from "wonder.js/dist/es2015/component/geometry/data/BufferContainer"; + import { BasicGeometryData } from "wonder.js/dist/es2015/component/geometry/data/BasicGeometryData"; + import { ArrayBuffer } from "wonder.js/dist/es2015/renderer/buffer/ArrayBuffer"; + import { EBufferDataType } from "wonder.js/dist/es2015/renderer/buffer/EBufferDataType"; + export abstract class CommonBufferContainer extends BufferContainer { + geometryData: BasicGeometryData; + protected getVertice(type: EBufferDataType): ArrayBuffer; + } +} + +declare module 'wonder.js/dist/es2015/component/geometry/data/GeometryData' { + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + import { Face3 } from "wonder.js/dist/es2015/structure/Face3"; + export abstract class GeometryData { + constructor(geometry: Geometry); + vertices: Array; + readonly indices: Array; + faces: Array; + protected geometry: Geometry; + dispose(): void; + protected onChangeFace(): void; + } +} + +declare module 'wonder.js/dist/es2015/component/geometry/Geometry' { + import { Component } from "wonder.js/dist/es2015/core/Component"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + import { BufferContainer } from "wonder.js/dist/es2015/component/geometry/data/BufferContainer"; + import { EDrawMode } from "wonder.js/dist/es2015/renderer/EDrawMode"; + import { GeometryData } from "wonder.js/dist/es2015/component/geometry/data/GeometryData"; + import { BasicGeometryData } from "wonder.js/dist/es2015/component/geometry/data/BasicGeometryData"; + import { Face3 } from "wonder.js/dist/es2015/structure/Face3"; + export abstract class Geometry extends Component { + material: Material; + readonly geometryData: GeometryData; + entityObject: GameObject; + buffers: BufferContainer; + drawMode: EDrawMode; + abstract computeData(): GeometryDataType; + init(): void; + dispose(): void; + createBuffersFromGeometryData(): void; + protected createBufferContainer(): BufferContainer; + protected createGeometryData(computedData: GeometryDataType): GeometryData; + protected createBasicGeometryData(computedData: GeometryDataType): BasicGeometryData; + } + export type GeometryDataType = { + vertices: Array; + faces?: Array; + }; +} + +declare module 'wonder.js/dist/es2015/component/geometry/GeometryUtils' { + import { Face3 } from "wonder.js/dist/es2015/structure/Face3"; + import { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + export class GeometryUtils { + static convertToFaces(indices: Array, normals?: Array): Array; + static hasData(data: any): boolean; + static getThreeComponent(sourceData: Array, index: number): Vector3; + static iterateThreeComponent(dataArr: Array, iterator: (v: Vector3) => void): void; + static setThreeComponent(targetData: Array, sourceData: Vector3, index: number): any; + static setThreeComponent(targetData: Array, sourceData: Array, index: number): any; + } +} + +declare module 'wonder.js/dist/es2015/component/renderer/MeshRenderer' { + import { RendererComponent } from "wonder.js/dist/es2015/component/renderer/RendererComponent"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + import { Renderer } from "wonder.js/dist/es2015/renderer/renderer/Renderer"; + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + export class MeshRenderer extends RendererComponent { + static create(): MeshRenderer; + entityObject: GameObject; + render(renderer: Renderer, target: GameObject, camera: GameObject): void; + protected createDrawCommand(target: GameObject, geometry: Geometry, camera: GameObject): QuadCommand; + } +} + +declare module 'wonder.js/dist/es2015/component/renderer/RendererComponent' { + import { Component } from "wonder.js/dist/es2015/core/Component"; + import { Renderer } from "wonder.js/dist/es2015/renderer/renderer/Renderer"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + export abstract class RendererComponent extends Component { + abstract render(renderer: Renderer, target: EntityObject, camera: GameObject): any; + } +} + +declare module 'wonder.js/dist/es2015/component/transform/ETransformState' { + export enum ETransformState { + ISTRANSLATE, + ISROTATE, + ISSCALE, + ISLOCALTRANSLATE, + ISLOCALROTATE, + ISLOCALSCALE, + } +} + +declare module 'wonder.js/dist/es2015/component/transform/ThreeDTransform' { + import { Transform } from "wonder.js/dist/es2015/component/transform/Transform"; + import { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + import { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + import { Quaternion } from "wonder.js/dist/es2015/math/Quaternion"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { Matrix3 } from "wonder.js/dist/es2015/math/Matrix3"; + import { ETransformState } from "wonder.js/dist/es2015/component/transform/ETransformState"; + export class ThreeDTransform extends Transform { + static create(): ThreeDTransform; + localToWorldMatrix: Matrix4; + readonly normalMatrix: Matrix3; + position: Vector3; + rotation: Quaternion; + scale: Vector3; + eulerAngles: Vector3; + localPosition: Vector3; + localRotation: Quaternion; + localEulerAngles: Vector3; + localScale: Vector3; + readonly up: Vector3; + readonly right: Vector3; + readonly forward: any; + dirtyWorld: boolean; + protected p_parent: ThreeDTransform; + protected children: Collection; + sync(): void; + translateLocal(translation: Vector3): any; + translateLocal(x: number, y: number, z: number): any; + translate(translation: Vector3): any; + translate(x: number, y: number, z: number): any; + rotate(eulerAngles: Vector3): any; + rotate(x: number, y: number, z: number): any; + rotateLocal(eulerAngles: Vector3): any; + rotateLocal(x: number, y: number, z: number): any; + rotateAround(angle: number, center: Vector3, axis: Vector3): any; + rotateAround(angle: number, centerX: number, centerY: number, centerZ: number, axisX: number, axisY: number, axisZ: number): any; + lookAt(target: Vector3): any; + lookAt(targetX: number, targetY: number, targetZ: number): any; + lookAt(target: Vector3, up: Vector3): any; + lookAt(targetX: number, targetY: number, targetZ: number, upX: number, upY: number, upZ: number): any; + protected clearCache(): void; + protected handleWhenSetTransformState(transformState?: ETransformState): void; + } +} + +declare module 'wonder.js/dist/es2015/component/transform/Transform' { + import { Component } from "wonder.js/dist/es2015/core/Component"; + import { ETransformState } from "wonder.js/dist/es2015/component/transform/ETransformState"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export abstract class Transform extends Component { + protected p_parent: Transform; + parent: Transform; + isTransform: boolean; + isTranslate: boolean; + isRotate: boolean; + isScale: boolean; + isLocalTranslate: boolean; + isLocalRotate: boolean; + isLocalScale: boolean; + dirtyLocal: boolean; + protected children: Collection; + init(): void; + dispose(): void; + addChild(child: Transform): void; + removeChild(child: Transform): void; + setChildrenTransformState(state: boolean): any; + setChildrenTransformState(transformState: ETransformState, state: boolean): any; + protected abstract clearCache(): void; + protected handleWhenSetTransformState(transformState?: ETransformState): void; + protected setParent(parent: Transform): void; + protected getMatrix(syncMethod: string, matrixAttriName: string): T; + } +} + +declare module 'wonder.js/dist/es2015/config/DebugConfig' { + export var DebugConfig: { + isTest: boolean; + debugCollision: boolean; + showDebugPanel: boolean; + }; +} + +declare module 'wonder.js/dist/es2015/core/Component' { + import { Entity } from "wonder.js/dist/es2015/core/Entity"; + import { Transform } from "wonder.js/dist/es2015/component/transform/Transform"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export abstract class Component extends Entity { + readonly transform: Transform; + entityObject: EntityObject; + init(): void; + dispose(): void; + clone(): any; + addToObject(entityObject: EntityObject, isShareComponent?: boolean): void; + addToComponentContainer(): void; + removeFromObject(entityObject: EntityObject): void; + removeFromComponentContainer(): void; + } +} + +declare module 'wonder.js/dist/es2015/core/Director' { + import "wonder-frp/dist/es2015/stream/ConcatStream"; + import "wonder-frp/dist/es2015/stream/IgnoreElementsStream"; + import "wonder-frp/dist/es2015/extend/root"; + import { SceneDispatcher } from "wonder.js/dist/es2015/core/entityObject/scene/SceneDispatcher"; + import { Renderer } from "wonder.js/dist/es2015/renderer/renderer/Renderer"; + export class Director { + static getInstance(): any; + readonly gameTime: number; + readonly fps: number; + readonly isNormal: boolean; + readonly isStop: boolean; + readonly isPause: boolean; + readonly isTimeChange: boolean; + readonly elapsed: number; + readonly view: any; + scene: SceneDispatcher; + renderer: Renderer; + initWhenCreate(): void; + start(): void; + stop(): void; + pause(): void; + resume(): void; + getDeltaTime(): number; + } +} + +declare module 'wonder.js/dist/es2015/core/Entity' { + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export abstract class Entity { + constructor(); + uid: number; + data: any; + addTag(tag: string): void; + removeTag(tag: string): void; + getTagList(): Collection; + hasTag(tag: string): boolean; + containTag(tag: string): boolean; + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/EntityObject' { + import { Entity } from "wonder.js/dist/es2015/core/Entity"; + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { CustomEventRegisterData } from "wonder.js/dist/es2015/event/binder/CustomEventRegister"; + import { ComponentManager } from "wonder.js/dist/es2015/core/entityObject/manager/ComponentManager"; + import { Component } from "wonder.js/dist/es2015/core/Component"; + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + import { Renderer } from "wonder.js/dist/es2015/renderer/renderer/Renderer"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + import { Transform } from "wonder.js/dist/es2015/component/transform/Transform"; + export abstract class EntityObject extends Entity { + bubbleParent: EntityObject; + componentDirty: boolean; + readonly transform: Transform; + name: string; + parent: EntityObject; + customEventMap: Hash>; + protected componentManager: ComponentManager; + initWhenCreate(): void; + clone(config?: CloneEntityObjectConfigData): any; + init(): this; + dispose(): void; + hasChild(child: EntityObject): boolean; + addChild(child: EntityObject): EntityObject; + getChildren(): Collection; + removeChild(child: EntityObject): EntityObject; + forEach(func: (entityObject: EntityObject, index: number) => void): this; + getComponent(_class: any): T; + hasComponent(component: Component): boolean; + hasComponent(_class: Function): boolean; + addComponent(component: Component, isShareComponent?: boolean): this; + removeComponent(component: Component): any; + removeComponent(_class: Function): any; + forEachComponent(func: (component: Component) => void): this; + render(renderer: Renderer, camera: GameObject): void; + update(elapsed: number): void; + clearCache(): void; + getGeometry(): Geometry; + protected abstract createTransform(): Transform; + protected afterInitChildren(): void; + protected getRenderList(): Collection; + } + export type CloneEntityObjectConfigData = { + cloneChildren?: boolean; + shareGeometry?: boolean; + cloneGeometry?: boolean; + }; +} + +declare module 'wonder.js/dist/es2015/core/entityObject/gameObject/GameObject' { + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { ThreeDTransform } from "wonder.js/dist/es2015/component/transform/ThreeDTransform"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export class GameObject extends EntityObject { + static create(): GameObject; + transform: ThreeDTransform; + parent: GameObject; + renderGroup: number; + renderPriority: number; + isVisible: boolean; + protected children: Collection; + initWhenCreate(): void; + protected createTransform(): ThreeDTransform; + protected getRenderList(): Collection; + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/manager/ComponentManager' { + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { Transform } from "wonder.js/dist/es2015/component/transform/Transform"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { RendererComponent } from "wonder.js/dist/es2015/component/renderer/RendererComponent"; + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + import { Component } from "wonder.js/dist/es2015/core/Component"; + export class ComponentManager { + static create(entityObject: EntityObject): ComponentManager; + constructor(entityObject: EntityObject); + transform: Transform; + init(): void; + dispose(): void; + removeAllComponent(): Collection; + getComponent(_class: any): T; + getComponents(): Collection; + findComponentByUid(uid: number): any; + forEachComponent(func: (component: Component) => void): this; + hasComponent(component: Component): boolean; + hasComponent(_class: Function): boolean; + addComponent(component: Component, isShareComponent?: boolean): this; + removeComponent(component: Component): any; + removeComponent(_class: Function): any; + getComponentCount(_class: Function): number; + getGeometry(): Geometry; + getRendererComponent(): RendererComponent; + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/manager/EntityObjectManager' { + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export class EntityObjectManager { + static create(entityObject: EntityObject): EntityObjectManager; + constructor(entityObject: EntityObject); + init(): void; + dispose(): void; + hasChild(child: EntityObject): boolean; + addChild(child: EntityObject): this; + addChildren(children: EntityObject): any; + addChildren(children: Array): any; + addChildren(children: Collection): any; + forEach(func: (entityObject: EntityObject, index: number) => void): this; + filter(func: (entityObject: EntityObject) => boolean): Collection; + sort(func: (a: EntityObject, b: EntityObject) => any, isSortSelf?: boolean): Collection; + getChildren(): Collection; + getAllChildren(): Collection; + getChild(index: number): any; + findChildByUid(uid: number): any; + findChildByTag(tag: string): any; + findChildByName(name: string): any; + findChildrenByName(name: string): Collection; + removeChild(child: EntityObject): this; + removeAllChildren(): void; + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/scene/cache/BufferTable' { + import { ElementBuffer } from "wonder.js/dist/es2015/renderer/buffer/ElementBuffer"; + import { Buffer } from "wonder.js/dist/es2015/renderer/buffer/Buffer"; + export class BufferTable { + static lastBindedArrayBufferListUidStr: string; + static lastBindedElementBuffer: ElementBuffer; + static bindIndexBuffer(indexBuffer: ElementBuffer): void; + static hasBuffer(key: string): boolean; + static addBuffer(key: string, buffer: Buffer): void; + static getBuffer(key: string): T; + static dispose(): void; + static clearAll(): void; + static resetBindedArrayBuffer(): void; + static resetBindedElementBuffer(): void; + } + export enum BufferTableKey { + PROCEDURAL_VERTEX, + PROCEDURAL_INDEX, + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/scene/cache/ProgramTable' { + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + export class ProgramTable { + static lastUsedProgram: Program; + static hasProgram(key: string): boolean; + static addProgram(key: string, program: Program): void; + static getProgram(key: string): Program; + static dispose(): void; + static clearAll(): void; + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/scene/gameObjectScene/GameObjectScene' { + import { Scene } from "wonder.js/dist/es2015/core/entityObject/scene/Scene"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { Renderer } from "wonder.js/dist/es2015/renderer/renderer/Renderer"; + export class GameObjectScene extends Scene { + static create(): GameObjectScene; + currentCamera: any; + addChild(child: GameObject): GameObject; + update(elapsed: number): void; + render(renderer: Renderer): void; + protected getRenderList(): Collection; + protected createTransform(): any; + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/scene/Scene' { + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export abstract class Scene extends EntityObject { + } +} + +declare module 'wonder.js/dist/es2015/core/entityObject/scene/SceneDispatcher' { + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + import { GameObjectScene } from "wonder.js/dist/es2015/core/entityObject/scene/gameObjectScene/GameObjectScene"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export class SceneDispatcher extends EntityObject { + static create(): SceneDispatcher; + currentCamera: GameObject; + name: string; + gameObjectScene: GameObjectScene; + addChild(child: EntityObject): EntityObject; + dispose(): void; + hasChild(child: EntityObject): boolean; + addChildren(children: EntityObject): any; + addChildren(children: Array): any; + addChildren(children: Collection): any; + getChildren(): Collection; + protected createTransform(): any; + } +} + +declare module 'wonder.js/dist/es2015/core/Main' { + import { EScreenSize } from "wonder.js/dist/es2015/device/EScreenSize"; + export class Main { + static setConfig({canvasId, isTest, screenSize, useDevicePixelRatio, contextConfig}: { + canvasId?: null; + isTest?: boolean; + screenSize?: EScreenSize; + useDevicePixelRatio?: boolean; + contextConfig?: { + options: { + alpha: boolean; + depth: boolean; + stencil: boolean; + antialias: boolean; + premultipliedAlpha: boolean; + preserveDrawingBuffer: boolean; + }; + }; + }): typeof Main; + static init(): typeof Main; + } +} + +declare module 'wonder.js/dist/es2015/core/data/MainData' { + import { EScreenSize } from "wonder.js/dist/es2015/device/EScreenSize"; + import { RectRegion } from "wonder.js/dist/es2015/structure/RectRegion"; + export class MainData { + static isTest: boolean; + static screenSize: EScreenSize & RectRegion; + } + export type ContextConfigData = { + options: { + alpha: boolean; + depth: boolean; + stencil: boolean; + antialias: boolean; + premultipliedAlpha: boolean; + preserveDrawingBuffer: boolean; + }; + }; +} + +declare module 'wonder.js/dist/es2015/definition/typescript/decorator/cache' { + export function cacheGetter(judgeFunc: () => boolean, returnCacheValueFunc: () => any, setCacheFunc: (returnVal: any) => void): (target: any, name: any, descriptor: any) => any; + export function cache(judgeFunc: any, returnCacheValueFunc: any, setCacheFunc: any): (target: any, name: any, descriptor: any) => any; + export function cacheBufferForBufferContainer(): (target: any, name: any, descriptor: any) => any; + export function cacheBufferForBufferContainerWithFuncParam(setDataNameFuncName: string): (target: any, name: any, descriptor: any) => any; +} + +declare module 'wonder.js/dist/es2015/definition/typescript/decorator/clone' { + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export function cloneAttributeAsBasicType(configData?: CloneAttributeAsBasicTypeConfigData): (target: any, memberName: string | symbol) => void; + export function cloneAttributeAsCloneable(configData?: CloneAttributeAsCloneableConfigData): (target: any, memberName: string | symbol) => void; + export function cloneAttributeAsCustomType(cloneFunc: (source: any, target: any, memberName: string, cloneData: any) => void, configData?: CloneAttributeAsCustomTypeConfigData): (target: any, memberName: string | symbol) => void; + export class CloneUtils { + static clone(sourceInstance: T, cloneData?: any, createDataArr?: Array, target?: any): T; + static cloneArray(arr: Array | null, isDeep?: boolean): any; + static markNotClone(entityObject: EntityObject): void; + static isNotClone(entityObject: EntityObject): boolean; + } + export type CloneAttributeAsBasicTypeConfigData = { + order?: number; + }; + export type CloneAttributeAsCloneableConfigData = { + order?: number; + }; + export type CloneAttributeAsCustomTypeConfigData = { + order?: number; + }; + export enum CloneType { + CLONEABLE = 0, + BASIC = 1, + CUSTOM = 2, + } +} + +declare module 'wonder.js/dist/es2015/definition/typescript/decorator/contract' { + export function assert(cond: boolean, message?: string): void; + export function describe(message: string, func: Function, preCondition?: Function, context?: any): void; + export function it(message: string, func: Function, context?: any): void; + export function requireCheck(inFunc: any): (target: any, name: any, descriptor: any) => any; + export function ensure(outFunc: any): (target: any, name: any, descriptor: any) => any; + export function requireGetterAndSetter(inGetterFunc: any, inSetterFunc: any): (target: any, name: any, descriptor: any) => any; + export function requireGetter(inFunc: any): (target: any, name: any, descriptor: any) => any; + export function requireSetter(inFunc: any): (target: any, name: any, descriptor: any) => any; + export function ensureGetterAndSetter(outGetterFunc: any, outSetterFunc: any): (target: any, name: any, descriptor: any) => any; + export function ensureGetter(outFunc: any): (target: any, name: any, descriptor: any) => any; + export function ensureSetter(outFunc: any): (target: any, name: any, descriptor: any) => any; + export function invariant(func: any): (target: any) => void; +} + +declare module 'wonder.js/dist/es2015/definition/typescript/decorator/control' { + export function execOnlyOnce(flagName: string): (target: any, name: any, descriptor: any) => any; +} + +declare module 'wonder.js/dist/es2015/definition/typescript/decorator/registerClass' { + export function registerClass(className: string): (_class: any) => void; +} + +declare module 'wonder.js/dist/es2015/definition/typescript/decorator/singleton' { + export function singleton(isInitWhenCreate?: boolean): (target: any) => void; +} + +declare module 'wonder.js/dist/es2015/definition/typescript/decorator/virtual' { + export function virtual(target: any, name: any, descriptor: any): any; +} + +declare module 'wonder.js/dist/es2015/definition/Variable' { + export var root: any; +} + +declare module 'wonder.js/dist/es2015/device/DeviceManager' { + import { Vector2 } from "wonder.js/dist/es2015/math/Vector2"; + import { IView } from "wonder.js/dist/es2015/structure/View"; + import { ContextConfigData } from "wonder.js/dist/es2015/core/data/MainData"; + import { RectRegion } from "wonder.js/dist/es2015/structure/RectRegion"; + export class DeviceManager { + static getInstance(): any; + scissorTest: boolean; + setScissor(x: number, y: number, width: number, height: number): void; + setViewport(x: number, y: number, width: number, height: number): void; + getViewport(): RectRegion; + depthTest: boolean; + depthFunc: EDepthFunction; + side: ESide; + polygonOffset: Vector2; + polygonOffsetMode: EPolygonOffsetMode; + depthWrite: boolean; + blend: boolean; + alphaToCoverage: boolean; + view: IView; + gl: WebGLRenderingContext; + contextConfig: ContextConfigData; + setBlendFunc(blendSrc: EBlendFunc, blendDst: EBlendFunc): void; + setBlendEquation(blendEquation: EBlendEquation): void; + setBlendFuncSeparate(blendFuncSeparate: Array): void; + setBlendEquationSeparate(blendEquationSeparate: Array): void; + setColorWrite(writeRed: any, writeGreen: any, writeBlue: any, writeAlpha: any): void; + clear(options: any): void; + createGL(canvasId: string, contextConfig: ContextConfigData, useDevicePixelRatio: boolean): void; + setScreen(): void; + setHardwareScaling(level: number): void; + setPixelRatio(pixelRatio: number): void; + getPixelRatio(): number; + } + export enum EDepthFunction { + NEVER, + ALWAYS, + LESS, + LEQUAL, + EQUAL, + GEQUAL, + GREATER, + NOTEQUAL, + } + export enum ESide { + NONE = 0, + BOTH = 1, + BACK = 2, + FRONT = 3, + } + export enum EPolygonOffsetMode { + NONE = 0, + IN = 1, + OUT = 2, + CUSTOM = 3, + } + export enum EBlendFunc { + ZERO, + ONE, + SRC_COLOR, + ONE_MINUS_SRC_COLOR, + DST_COLOR, + ONE_MINUS_DST_COLOR, + SRC_ALPHA, + SRC_ALPHA_SATURATE, + ONE_MINUS_SRC_ALPHA, + DST_ALPHA, + ONE_MINUS_DST_ALPH, + } + export enum EBlendEquation { + ADD, + SUBTRACT, + REVERSE_SUBTRAC, + } + export enum EBlendType { + NONE = 0, + NORMAL = 1, + ADDITIVE = 2, + ADDITIVEALPHA = 3, + MULTIPLICATIVE = 4, + PREMULTIPLIED = 5, + } + export enum ECanvasType { + TwoDUI, + } + export type CanvasMapData = { + canvas: HTMLCanvasElement; + context: CanvasRenderingContext2D; + }; +} + +declare module 'wonder.js/dist/es2015/device/EScreenSize' { + export enum EScreenSize { + FULL = 0, + } +} + +declare module 'wonder.js/dist/es2015/device/GPUDetector' { + export class GPUDetector { + static getInstance(): any; + readonly gl: any; + maxTextureUnit: number; + maxTextureSize: number; + maxCubemapTextureSize: number; + maxAnisotropy: number; + maxBoneCount: number; + extensionCompressedTextureS3TC: any; + extensionTextureFilterAnisotropic: any; + extensionInstancedArrays: any; + extensionUintIndices: boolean; + extensionDepthTexture: boolean; + extensionVAO: any; + extensionStandardDerivatives: boolean; + precision: number; + detect(): void; + } + export enum EGPUPrecision { + HIGHP = 0, + MEDIUMP = 1, + LOWP = 2, + } +} + +declare module 'wonder.js/dist/es2015/event/binder/CustomEventBinder' { + import { EventBinder } from "wonder.js/dist/es2015/event/binder/EventBinder"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export class CustomEventBinder extends EventBinder { + static getInstance(): any; + on(eventName: EEventName | string, handler: Function): void; + on(eventName: EEventName | string, handler: Function, priority: number): void; + on(target: EntityObject, eventName: EEventName | string, handler: Function): void; + on(target: EntityObject, eventName: EEventName | string, handler: Function, priority: number): void; + off(): void; + off(eventName: EEventName | string): void; + off(target: EntityObject): void; + off(eventName: EEventName | string, handler: Function): void; + off(target: EntityObject, eventName: EEventName | string): void; + off(target: EntityObject, eventName: EEventName | string, handler: Function): void; + } +} + +declare module 'wonder.js/dist/es2015/event/binder/CustomEventRegister' { + import { EventRegister } from "wonder.js/dist/es2015/event/binder/EventRegister"; + import { CustomEventListenerMap } from "wonder.js/dist/es2015/event/structure/CustomEventListenerMap"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export class CustomEventRegister extends EventRegister { + static getInstance(): any; + protected listenerMap: CustomEventListenerMap; + register(eventName: EEventName, handler: Function, originHandler: Function, domHandler: Function, priority: number): any; + register(target: EntityObject, eventName: EEventName, handler: Function, originHandler: Function, domHandler: Function, priority: number): any; + remove(eventName: EEventName): any; + remove(target: EntityObject): any; + remove(eventName: EEventName, handler: Function): any; + remove(uid: number, eventName: EEventName): any; + remove(target: EntityObject, eventName: EEventName): any; + remove(target: EntityObject, eventName: EEventName, handler: Function): any; + setBubbleParent(target: EntityObject, parent: EntityObject): void; + } + export type CustomEventRegisterData = { + target: EntityObject; + originHandler: Function; + handler: Function; + domHandler: Function; + priority: number; + }; +} + +declare module 'wonder.js/dist/es2015/event/binder/DomEventBinder' { + import { EventBinder } from "wonder.js/dist/es2015/event/binder/EventBinder"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + export class DomEventBinder extends EventBinder { + static getInstance(): any; + on(eventName: EEventName | string, handler: Function): void; + on(eventName: EEventName | string, handler: Function, priority: number): void; + on(dom: HTMLElement, eventName: EEventName | string, handler: Function): void; + on(dom: HTMLElement, eventName: EEventName | string, handler: Function, priority: number): void; + off(): void; + off(eventName: EEventName | string): void; + off(dom: HTMLElement): void; + off(eventName: EEventName | string, handler: Function): void; + off(dom: HTMLElement, eventName: EEventName): void; + off(dom: HTMLElement, eventName: EEventName, handler: Function): void; + } +} + +declare module 'wonder.js/dist/es2015/event/binder/DomEventRegister' { + import { EventRegister } from "wonder.js/dist/es2015/event/binder/EventRegister"; + import { DomEventListenerMap } from "wonder.js/dist/es2015/event/structure/DomEventListenerMap"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export class DomEventRegister extends EventRegister { + static getInstance(): any; + protected listenerMap: DomEventListenerMap; + register(dom: HTMLElement, eventName: EEventName, eventData: Hash, handler: Function, originHandler: Function, domHandler: Function, priority: number): void; + remove(eventName: EEventName): any; + remove(eventName: EEventName, handler: Function): any; + remove(dom: HTMLElement, eventName: EEventName): any; + remove(dom: HTMLElement, eventName: EEventName, handler: Function): any; + isBinded(dom: HTMLElement, eventName: EEventName): boolean; + getDomHandler(dom: HTMLElement, eventName: EEventName): Function; + } + export type DomEventRegisterData = { + dom?: HTMLElement; + target?: EntityObject; + eventData: Hash; + originHandler: Function; + handler: Function; + domHandler: Function; + priority: number; + }; +} + +declare module 'wonder.js/dist/es2015/event/binder/EventBinder' { + export abstract class EventBinder { + abstract on(...args: any[]): void; + abstract off(...args: any[]): void; + } +} + +declare module 'wonder.js/dist/es2015/event/binder/EventRegister' { + import { EventListenerMap } from "wonder.js/dist/es2015/event/structure/EventListenerMap"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export abstract class EventRegister { + protected abstract listenerMap: EventListenerMap; + abstract register(...args: any[]): void; + abstract remove(...args: any[]): any; + getEventRegisterDataList(eventName: EEventName): any; + getEventRegisterDataList(currentTarget: EntityObject, eventName: EEventName): any; + getEventRegisterDataList(dom: HTMLElement, eventName: EEventName): any; + forEachAll(func: (list: Collection, eventName: EEventName) => void): void; + forEachEventName(func: (list: Collection, eventName: EEventName) => void): void; + clear(): void; + getChild(target: EntityObject): any; + getChild(dom: HTMLElement): any; + getChild(target: EntityObject, eventName: EEventName): any; + getChild(dom: HTMLElement, eventName: EEventName): any; + } + export type EventRegisterData = { + originHandler: Function; + handler: Function; + domHandler: Function; + priority: number; + }; +} + +declare module 'wonder.js/dist/es2015/event/dispatcher/CustomEventDispatcher' { + import { EventDispatcher } from "wonder.js/dist/es2015/event/dispatcher/EventDispatcher"; + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export class CustomEventDispatcher extends EventDispatcher { + static getInstance(): any; + trigger(event: Event): boolean; + trigger(event: Event, userData: any): boolean; + trigger(target: EntityObject, event: Event): boolean; + trigger(target: EntityObject, event: Event, notSetTarget: boolean): boolean; + trigger(target: EntityObject, event: Event, userData: any): boolean; + trigger(target: EntityObject, event: Event, userData: any, notSetTarget: boolean): boolean; + emit(target: EntityObject, eventObject: Event, userData?: any): void; + broadcast(target: EntityObject, eventObject: Event, userData?: any): void; + } +} + +declare module 'wonder.js/dist/es2015/event/dispatcher/DomEventDispatcher' { + import { EventDispatcher } from "wonder.js/dist/es2015/event/dispatcher/EventDispatcher"; + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + export class DomEventDispatcher extends EventDispatcher { + static getInstance(): any; + trigger(event: Event): void; + trigger(dom: HTMLElement, event: Event): void; + } +} + +declare module 'wonder.js/dist/es2015/event/dispatcher/EventDispatcher' { + export abstract class EventDispatcher { + abstract trigger(...args: any[]): any; + } +} + +declare module 'wonder.js/dist/es2015/event/EEngineEvent' { + export enum EEngineEvent { + STARTLOOP, + ENDLOOP, + POINT_TAP, + POINT_DOWN, + POINT_UP, + POINT_MOVE, + POINT_OVER, + POINT_OUT, + POINT_SCALE, + POINT_DRAG, + TRANSFORM_TRANSLATE, + TRANSFORM_ROTATE, + TRANSFORM_SCALE, + } +} + +declare module 'wonder.js/dist/es2015/event/EventManager' { + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { EEngineEvent } from "wonder.js/dist/es2015/event/EEngineEvent"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + import { FromEventPatternStream } from "wonder-frp/dist/es2015/stream/FromEventPatternStream"; + export class EventManager { + static on(eventName: EEventName | EEngineEvent | string, handler: Function): void; + static on(eventName: EEventName | EEngineEvent | string, handler: Function, priority: number): void; + static on(target: EntityObject, eventName: EEventName | EEngineEvent | string, handler: Function): void; + static on(dom: HTMLElement, eventName: EEventName | EEngineEvent | string, handler: Function): void; + static on(target: EntityObject, eventName: EEventName | EEngineEvent | string, handler: Function, priority: number): void; + static on(dom: HTMLElement, eventName: EEventName | EEngineEvent | string, handler: Function, priority: number): void; + static off(): void; + static off(eventName: EEventName | EEngineEvent | string): void; + static off(target: EntityObject): void; + static off(dom: HTMLElement): void; + static off(eventName: EEventName | EEngineEvent | string, handler: Function): void; + static off(target: EntityObject, eventName: EEventName | EEngineEvent | string): void; + static off(dom: HTMLElement, eventName: EEventName): void; + static off(target: EntityObject, eventName: EEventName | EEngineEvent | string, handler: Function): void; + static off(dom: HTMLElement, eventName: EEventName, handler: Function): void; + static trigger(event: Event): void; + static trigger(event: Event, userData: any): void; + static trigger(target: EntityObject, event: Event): void; + static trigger(dom: HTMLElement, event: Event): void; + static trigger(target: EntityObject, event: Event, userData: any): void; + static trigger(target: EntityObject, event: Event, userData: any, notSetTarget: boolean): void; + static broadcast(target: EntityObject, event: Event): any; + static broadcast(target: EntityObject, event: Event, userData: any): any; + static emit(target: EntityObject, event: Event): any; + static emit(target: EntityObject, event: Event, userData: any): any; + static fromEvent(eventName: EEventName | EEngineEvent | string): FromEventPatternStream; + static fromEvent(eventName: EEventName | EEngineEvent | string, priority: number): FromEventPatternStream; + static fromEvent(target: EntityObject, eventName: EEventName | EEngineEvent | string): FromEventPatternStream; + static fromEvent(dom: HTMLElement, eventName: EEventName | EEngineEvent | string): FromEventPatternStream; + static fromEvent(target: EntityObject, eventName: EEventName | EEngineEvent | string, priority: number): FromEventPatternStream; + static fromEvent(dom: HTMLElement, eventName: EEventName | EEngineEvent | string, priority: number): FromEventPatternStream; + static setBubbleParent(target: EntityObject, parent: any): void; + } +} + +declare module 'wonder.js/dist/es2015/event/factory/EventBinderFactory' { + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + export class EventBinderFactory { + static createEventBinder(eventName: EEventName): any; + } +} + +declare module 'wonder.js/dist/es2015/event/factory/EventDispatcherFactory' { + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + export class EventDispatcherFactory { + static createEventDispatcher(event: Event): any; + } +} + +declare module 'wonder.js/dist/es2015/event/factory/EventHandlerFactory' { + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + export class EventHandlerFactory { + static createEventHandler(eventType: EEventType): any; + } +} + +declare module 'wonder.js/dist/es2015/event/handler/CustomEventHandler' { + import { EventHandler } from "wonder.js/dist/es2015/event/handler/EventHandler"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + export class CustomEventHandler extends EventHandler { + static getInstance(): any; + on(eventName: string, handler: Function, priority: number): void; + on(target: EntityObject, eventName: string, handler: Function, priority: number): void; + off(eventName: string): void; + off(uid: number, eventName: string): void; + off(eventName: string, handler: Function): void; + off(target: EntityObject, eventName: string, handler: Function): void; + trigger(event: Event): boolean; + trigger(event: Event, userData: any): boolean; + trigger(target: EntityObject, event: Event, notSetTarget: boolean): boolean; + trigger(target: EntityObject, event: Event, userData: any, notSetTarget: boolean): boolean; + } +} + +declare module 'wonder.js/dist/es2015/event/handler/DomEventHandler' { + import { EventHandler } from "wonder.js/dist/es2015/event/handler/EventHandler"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + import { IEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + export abstract class DomEventHandler extends EventHandler { + off(): void; + off(eventName: EEventName): void; + off(eventName: EEventName, handler: Function): void; + off(dom: HTMLElement, eventName: EEventName): void; + off(dom: HTMLElement, eventName: EEventName, handler: Function): void; + trigger(event: Event): void; + trigger(dom: HTMLElement, event: Event): void; + protected abstract triggerDomEvent(dom: HTMLElement, event: IEventData, eventName: EEventName): any; + protected abstract addEngineHandler(eventName: EEventName, handler: Function): any; + protected abstract getDefaultDom(): HTMLElement; + protected abstract createEventData(): Hash; + protected clearHandler(): void; + protected buildDomHandler(dom: HTMLElement, eventName: EEventName): (event: any) => any; + protected handler(dom: HTMLElement, eventName: EEventName, handler: Function, priority: number): void; + } +} + +declare module 'wonder.js/dist/es2015/event/handler/EventHandler' { + export abstract class EventHandler { + abstract on(...args: any[]): any; + abstract off(...args: any[]): any; + abstract trigger(...args: any[]): any; + } +} + +declare module 'wonder.js/dist/es2015/event/handler/KeyboardEventHandler' { + import { DomEventHandler } from "wonder.js/dist/es2015/event/handler/DomEventHandler"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { KeyboardEvent } from "wonder.js/dist/es2015/event/object/KeyboardEvent"; + import { IKeyboardEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + export class KeyboardEventHandler extends DomEventHandler { + static getInstance(): any; + on(eventName: EEventName, handler: (event: KeyboardEvent) => void, priority: number): any; + on(dom: HTMLElement, eventName: EEventName, handler: (event: KeyboardEvent) => void, priority: number): any; + protected triggerDomEvent(dom: HTMLElement, event: IKeyboardEventData, eventName: EEventName): void; + protected getDefaultDom(): HTMLElement; + protected addEngineHandler(eventName: EEventName, handler: (event: KeyboardEvent) => void): any; + protected createEventData(): Hash; + } +} + +declare module 'wonder.js/dist/es2015/event/handler/MouseEventHandler' { + import { PointEventHandler } from "wonder.js/dist/es2015/event/handler/PointEventHandler"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { MouseEvent } from "wonder.js/dist/es2015/event/object/MouseEvent"; + import { IMouseEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + export class MouseEventHandler extends PointEventHandler { + static getInstance(): any; + protected addEngineHandler(eventName: EEventName, handler: (event: MouseEvent) => void): any; + protected createEventObject(dom: HTMLElement, event: IMouseEventData, eventName: EEventName): MouseEvent; + } +} + +declare module 'wonder.js/dist/es2015/event/handler/PointEventHandler' { + import { DomEventHandler } from "wonder.js/dist/es2015/event/handler/DomEventHandler"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { DomEvent } from "wonder.js/dist/es2015/event/object/DomEvent"; + import { IEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + import { MouseEvent } from "wonder.js/dist/es2015/event/object/MouseEvent"; + import { TouchEvent } from "wonder.js/dist/es2015/event/object/TouchEvent"; + export abstract class PointEventHandler extends DomEventHandler { + on(eventName: EEventName, handler: (event: DomEvent) => void, priority: number): any; + on(dom: HTMLElement, eventName: EEventName, handler: (event: DomEvent) => void, priority: number): any; + protected abstract createEventObject(dom: HTMLElement, event: IEventData, eventName: EEventName): DomEvent; + protected getDefaultDom(): HTMLElement; + protected triggerDomEvent(dom: HTMLElement, event: IEventData, eventName: EEventName): void; + protected createEventData(): Hash; + protected handleMove(handler: (event: MouseEvent | TouchEvent) => void): (event: MouseEvent | TouchEvent, eventData: Hash) => void; + } +} + +declare module 'wonder.js/dist/es2015/event/handler/TouchEventHandler' { + import { PointEventHandler } from "wonder.js/dist/es2015/event/handler/PointEventHandler"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { TouchEvent } from "wonder.js/dist/es2015/event/object/TouchEvent"; + import { ITouchEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + export class TouchEventHandler extends PointEventHandler { + static getInstance(): any; + protected addEngineHandler(eventName: EEventName, handler: (event: TouchEvent) => void): any; + protected createEventObject(dom: HTMLElement, event: ITouchEventData, eventName: EEventName): TouchEvent; + } +} + +declare module 'wonder.js/dist/es2015/event/object/CustomEvent' { + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + import { DomEvent } from "wonder.js/dist/es2015/event/object/DomEvent"; + export class CustomEvent extends Event { + static create(eventName: string): any; + static create(eventName: string, userData: any): any; + constructor(eventName: string); + constructor(eventName: string, userData: any); + readonly type: EEventType; + userData: any; + copyPublicAttri(destination: any, source: any): any; + clone(): CustomEvent; + getDataFromDomEvent(event: DomEvent): void; + } +} + +declare module 'wonder.js/dist/es2015/event/object/DomEvent' { + import { Event } from "wonder.js/dist/es2015/event/object/Event"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { CustomEvent } from "wonder.js/dist/es2015/event/object/CustomEvent"; + export abstract class DomEvent extends Event { + constructor(event: any, eventName: EEventName); + event: any; + preventDefault(): void; + getDataFromCustomEvent(event: CustomEvent): void; + } +} + +declare module 'wonder.js/dist/es2015/event/object/EEventPhase' { + export enum EEventPhase { + BROADCAST = 0, + EMIT = 1, + } +} + +declare module 'wonder.js/dist/es2015/event/object/EEventType' { + export enum EEventType { + MOUSE = 0, + TOUCH = 1, + POINT = 2, + KEYBOARD = 3, + CUSTOM = 4, + } +} + +declare module 'wonder.js/dist/es2015/event/object/EMouseButton' { + export enum EMouseButton { + LEFT = 0, + RIGHT = 1, + CENTER = 2, + } +} + +declare module 'wonder.js/dist/es2015/event/object/Event' { + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + import { EEngineEvent } from "wonder.js/dist/es2015/event/EEngineEvent"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { EEventPhase } from "wonder.js/dist/es2015/event/object/EEventPhase"; + export abstract class Event { + protected constructor(eventName: EEventName); + readonly abstract type: EEventType; + name: string | EEventName | EEngineEvent; + target: HTMLElement | EntityObject; + currentTarget: HTMLElement | EntityObject; + isStopPropagation: boolean; + phase: EEventPhase; + abstract clone(): any; + stopPropagation(): void; + protected copyMember(destination: Event, source: Event, memberArr: [any]): Event; + } +} + +declare module 'wonder.js/dist/es2015/event/object/EventNameHandler' { + export enum EEventName { + CLICK, + MOUSEOVER, + MOUSEUP, + MOUSEOUT, + MOUSEMOVE, + MOUSEDOWN, + MOUSEWHEEL, + MOUSEDRAG, + TOUCHUP, + TOUCHMOVE, + TOUCHDOWN, + KEYDOWN, + KEYUP, + KEYPRESS, + } + export class EventNameHandler { + static handleEventName(domEventName: EEventName): any; + } +} + +declare module 'wonder.js/dist/es2015/event/object/EventTable' { + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + export class EventTable { + static getEventType(eventName: EEventName): EEventType; + } +} + +declare module 'wonder.js/dist/es2015/event/object/KeyboardEvent' { + import { DomEvent } from "wonder.js/dist/es2015/event/object/DomEvent"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { IKeyboardEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + export class KeyboardEvent extends DomEvent { + static create(event: any, eventName: EEventName): KeyboardEvent; + event: IKeyboardEventData; + readonly ctrlKey: number; + readonly altKey: number; + readonly shiftKey: number; + readonly metaKey: number; + readonly keyCode: number; + readonly key: any; + readonly type: EEventType; + keyState: any; + clone(): KeyboardEvent; + } +} + +declare module 'wonder.js/dist/es2015/event/object/MouseEvent' { + import { DomEvent } from "wonder.js/dist/es2015/event/object/DomEvent"; + import { IMouseEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { Point } from "wonder.js/dist/es2015/structure/Point"; + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + export class MouseEvent extends DomEvent { + static create(event: IMouseEventData, eventName: EEventName): MouseEvent; + event: IMouseEventData; + location: Point; + locationInView: Point; + button: number; + readonly wheel: number; + readonly movementDelta: { + x: any; + y: any; + }; + readonly type: EEventType; + lastX: number; + lastY: number; + clone(): MouseEvent; + } +} + +declare module 'wonder.js/dist/es2015/event/object/MousePointEvent' { + import { PointEvent } from "wonder.js/dist/es2015/event/object/PointEvent"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { MouseEvent } from "wonder.js/dist/es2015/event/object/MouseEvent"; + import { Point } from "wonder.js/dist/es2015/structure/Point"; + export class MousePointEvent extends PointEvent { + static create(eventName: EEventName): MousePointEvent; + eventObj: MouseEvent; + location: Point; + locationInView: Point; + button: number; + readonly wheel: number; + readonly movementDelta: { + x: any; + y: any; + }; + getDataFromEventObj(e: MouseEvent): void; + clone(): any; + } +} + +declare module 'wonder.js/dist/es2015/event/object/PointEvent' { + import { DomEvent } from "wonder.js/dist/es2015/event/object/DomEvent"; + import { IPointEventData } from "wonder.js/dist/es2015/event/interface/IEventData"; + import { Point } from "wonder.js/dist/es2015/structure/Point"; + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + import { MouseEvent } from "wonder.js/dist/es2015/event/object/MouseEvent"; + import { TouchEvent } from "wonder.js/dist/es2015/event/object/TouchEvent"; + export abstract class PointEvent extends DomEvent { + event: IPointEventData; + abstract location: Point; + abstract locationInView: Point; + abstract button: number | null; + readonly abstract wheel: number | null; + readonly abstract movementDelta: Point; + lastX: number; + lastY: number; + readonly type: EEventType; + eventObj: MouseEvent | TouchEvent; + abstract getDataFromEventObj(eventObj: TouchEvent | MouseEvent): void; + protected cloneHelper(eventObj: PointEvent): PointEvent; + } +} + +declare module 'wonder.js/dist/es2015/event/object/TouchEvent' { + import { DomEvent } from "wonder.js/dist/es2015/event/object/DomEvent"; + import { ITouchEventData, ITouchData } from "wonder.js/dist/es2015/event/interface/IEventData"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { Point } from "wonder.js/dist/es2015/structure/Point"; + import { EEventType } from "wonder.js/dist/es2015/event/object/EEventType"; + export class TouchEvent extends DomEvent { + static create(event: ITouchEventData, eventName: EEventName): TouchEvent; + event: ITouchEventData; + location: Point; + readonly touchData: ITouchData; + locationInView: Point; + readonly movementDelta: { + x: any; + y: any; + }; + readonly type: EEventType; + lastX: number; + lastY: number; + clone(): TouchEvent; + } +} + +declare module 'wonder.js/dist/es2015/event/object/TouchPointEvent' { + import { PointEvent } from "wonder.js/dist/es2015/event/object/PointEvent"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { TouchEvent } from "wonder.js/dist/es2015/event/object/TouchEvent"; + import { Point } from "wonder.js/dist/es2015/structure/Point"; + export class TouchPointEvent extends PointEvent { + static create(eventName: EEventName): TouchPointEvent; + eventObj: TouchEvent; + location: Point; + locationInView: Point; + readonly wheel: any; + readonly movementDelta: { + x: any; + y: any; + }; + button: number; + getDataFromEventObj(e: TouchEvent): void; + clone(): any; + } +} + +declare module 'wonder.js/dist/es2015/event/structure/CustomEventListenerMap' { + import { EventListenerMap } from "wonder.js/dist/es2015/event/structure/EventListenerMap"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { CustomEventRegisterData } from "wonder.js/dist/es2015/event/binder/CustomEventRegister"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + export class CustomEventListenerMap extends EventListenerMap { + static create(): CustomEventListenerMap; + hasChild(target: EntityObject): boolean; + appendChild(eventName: EEventName, data: any): any; + appendChild(target: EntityObject, eventName: EEventName, data: any): any; + forEachAll(func: (list: Collection, eventName: EEventName) => void): void; + forEachEventName(func: (list: Collection, eventName: EEventName) => void): void; + clear(): void; + getChild(eventName: EEventName): Collection; + getChild(target: EntityObject): Collection; + getChild(target: EntityObject, eventName: EEventName): Collection; + removeChild(eventName: EEventName): void; + removeChild(target: EntityObject): void; + removeChild(eventName: EEventName, handler: Function): void; + removeChild(uid: number, eventName: EEventName): void; + removeChild(target: EntityObject, eventName: EEventName): void; + removeChild(target: EntityObject, eventName: EEventName, handler: Function): void; + protected buildFirstLevelKey(target: EntityObject): any; + protected buildFirstLevelKey(uid: number): any; + } +} + +declare module 'wonder.js/dist/es2015/event/structure/DomEventListenerMap' { + import { EventListenerMap } from "wonder.js/dist/es2015/event/structure/EventListenerMap"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { DomEventRegisterData } from "wonder.js/dist/es2015/event/binder/DomEventRegister"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + export class DomEventListenerMap extends EventListenerMap { + static create(): DomEventListenerMap; + hasChild(dom: HTMLElement, eventName: EEventName): boolean; + appendChild(dom: HTMLElement, eventName: EEventName, data: any): void; + forEachAll(func: (list: Collection, eventName: EEventName) => void): void; + forEachEventName(func: (list: Collection, eventName: EEventName) => void): void; + clear(): void; + getChild(dom: HTMLElement): Collection; + getChild(dom: HTMLElement, eventName: EEventName): Collection; + removeChild(eventName: EEventName): Collection; + removeChild(eventName: EEventName, handler: Function): Collection; + removeChild(dom: HTMLElement, eventName: EEventName): Collection; + removeChild(dom: HTMLElement, eventName: EEventName, handler: Function): Collection; + protected buildFirstLevelKey(dom: HTMLElement): string; + } + export type DomEventOffData = { + dom: HTMLElement; + eventName: EEventName; + domHandler: Function; + }; +} + +declare module 'wonder.js/dist/es2015/event/structure/EventListenerMap' { + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { EEventName } from "wonder.js/dist/es2015/event/object/EventNameHandler"; + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export abstract class EventListenerMap { + abstract getChild(...args: any[]): Collection; + abstract removeChild(...args: any[]): any; + abstract hasChild(...args: any[]): boolean; + abstract appendChild(...args: any[]): void; + abstract forEachAll(func: (list: Collection, eventName: EEventName) => void): void; + abstract forEachEventName(func: (list: Collection, eventName: EEventName) => void): void; + abstract clear(): void; + protected abstract buildFirstLevelKey(target: EntityObject | HTMLElement): string; + protected buildSecondLevelKey(eventName: EEventName): string; + } +} + +declare module 'wonder.js/dist/es2015/event/utils/EventUtils' { + import { EntityObject } from "wonder.js/dist/es2015/core/entityObject/EntityObject"; + export class EventUtils { + static isEvent(arg: any): boolean; + static isEntityObject(arg: EntityObject): boolean; + } +} + +declare module 'wonder.js/dist/es2015/material/BasicMaterial' { + import { StandardBasicMaterial } from "wonder.js/dist/es2015/material/StandardBasicMaterial"; + export class BasicMaterial extends StandardBasicMaterial { + static create(): BasicMaterial; + } +} + +declare module 'wonder.js/dist/es2015/material/EngineMaterial' { + import { Material } from "wonder.js/dist/es2015/material/Material"; + import { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + export abstract class EngineMaterial extends Material { + init(): void; + protected addShaderLib(): void; + protected createShader(): Shader; + } +} + +declare module 'wonder.js/dist/es2015/material/Material' { + import { Color } from "wonder.js/dist/es2015/structure/Color"; + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + export abstract class Material { + readonly program: Program; + color: Color; + readonly shader: Shader; + geometry: Geometry; + clone(): this; + initWhenCreate(): void; + init(): void; + dispose(): void; + updateShader(quadCmd: QuadCommand): void; + protected abstract createShader(): Shader; + } +} + +declare module 'wonder.js/dist/es2015/material/ShaderManager' { + import { Material } from "wonder.js/dist/es2015/material/Material"; + import { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + export class ShaderManager { + static create(material: Material): ShaderManager; + constructor(material: Material); + readonly shader: Shader; + setShader(shader: Shader): void; + init(): void; + dispose(): void; + update(quadCmd: QuadCommand): void; + } +} + +declare module 'wonder.js/dist/es2015/material/StandardBasicMaterial' { + import { EngineMaterial } from "wonder.js/dist/es2015/material/EngineMaterial"; + export abstract class StandardBasicMaterial extends EngineMaterial { + opacity: number; + alphaTest: number; + protected addExtendShaderLib(): void; + protected addShaderLib(): void; + } +} + +declare module 'wonder.js/dist/es2015/math/Global' { + export const DEG_TO_RAD: number; + export const RAD_TO_DEG: number; +} + +declare module 'wonder.js/dist/es2015/math/Matrix3' { + import { Vector2 } from "wonder.js/dist/es2015/math/Vector2"; + export class Matrix3 { + static create(mat: Float32Array): Matrix3; + static create(): Matrix3; + constructor(mat: Float32Array); + constructor(); + a: number; + c: number; + b: number; + d: number; + tx: number; + ty: number; + values: Float32Array; + setIdentity(): Matrix3; + invert(): Matrix3; + multiplyScalar(s: number): this; + multiplyVector2(vector: Vector2): Vector2; + multiplyPoint(vector: Vector2): Vector2; + multiply(matrix: Matrix3): this; + transpose(): Matrix3; + clone(): Matrix3; + cloneToArray(array: Float32Array, offset?: number): Matrix3; + set(matrix: Matrix3): this; + setTS(t: Vector2, s: Vector2): void; + rotate(angle: number): this; + setRotation(angle: number): this; + translate(x: number, y: number): void; + setPosition(x: number, y: number): void; + scale(x: number, y: number): this; + setScale(x: number, y: number): this; + getTranslation(): Vector2; + getScale(): Vector2; + getRotation(): number; + getSkew(): Vector2; + } +} + +declare module 'wonder.js/dist/es2015/math/Matrix4' { + import { Matrix3 } from "wonder.js/dist/es2015/math/Matrix3"; + import { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + import { Vector4 } from "wonder.js/dist/es2015/math/Vector4"; + import { Quaternion } from "wonder.js/dist/es2015/math/Quaternion"; + export class Matrix4 { + static create(mat: Float32Array): Matrix4; + static create(): Matrix4; + constructor(mat: Float32Array); + constructor(); + values: Float32Array; + push(): void; + pop(): void; + set(initialM11: number, initialM12: number, initialM13: number, initialM14: number, initialM21: number, initialM22: number, initialM23: number, initialM24: number, initialM31: number, initialM32: number, initialM33: number, initialM34: number, initialM41: number, initialM42: number, initialM43: number, initialM44: number): any; + set(matrix: Matrix4): any; + setIdentity(): Matrix4; + invert(): Matrix4; + invertTo3x3(): Matrix3; + transpose(): Matrix4; + setTranslate(x: any, y: any, z: any): Matrix4; + translate(x: any, y: any, z: any): Matrix4; + setRotate(angle: number, x: number, y: number, z: number): Matrix4; + rotate(angle: any, vector3: Vector3): Matrix4; + rotate(angle: any, x: any, y: any, z: any): Matrix4; + setScale(x: any, y: any, z: any): Matrix4; + scale(x: any, y: any, z: any): Matrix4; + setLookAt(eye: Vector3, center: Vector3, up: Vector3): Matrix4; + setLookAt(eyeX: number, eyeY: number, eyeZ: number, centerX: number, centerY: number, centerZ: number, upX: number, upY: number, upZ: number): Matrix4; + lookAt(eye: Vector3, center: Vector3, up: Vector3): Matrix4; + lookAt(eyeX: number, eyeY: number, eyeZ: number, centerX: number, centerY: number, centerZ: number, upX: number, upY: number, upZ: number): Matrix4; + setOrtho(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4; + ortho(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4; + setPerspective(fovy: number, aspect: number, near: number, far: number): Matrix4; + perspective(fovy: number, aspect: number, near: number, far: number): Matrix4; + applyMatrix(other: Matrix4, notChangeSelf?: boolean): Matrix4; + multiply(matrix: Matrix4): Matrix4; + multiply(matrix1: Matrix4, matrix2: Matrix4): Matrix4; + multiplyVector4(vector: Vector4): Vector4; + multiplyVector3(vector: Vector3): Vector3; + multiplyPoint(vector: Vector3): Vector3; + clone(): Matrix4; + cloneToArray(array: Float32Array, offset?: number): Matrix4; + getX(): Vector3; + getY(): Vector3; + getZ(): Vector3; + getTranslation(): Vector3; + getScale(): Vector3; + getRotation(): Quaternion; + getEulerAngles(): any; + setTRS(t: Vector3, r: Quaternion, s: Vector3): this; + } +} + +declare module 'wonder.js/dist/es2015/math/Quaternion' { + import { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + import { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + export class Quaternion { + static create(x?: number, y?: number, z?: number, w?: number): Quaternion; + constructor(x?: number, y?: number, z?: number, w?: number); + x: number; + y: number; + z: number; + w: number; + setFromEulerAngles(eulerAngles: Vector3): this; + multiply(rhs: Quaternion): any; + multiply(rhs1: Quaternion, rhs2: Quaternion): any; + setFromMatrix(matrix: Matrix4): this; + setFromAxisAngle(angle: number, axis: Vector3): this; + invert(): this; + conjugate(): this; + clone(): Quaternion; + normalize(): this; + length(): any; + multiplyVector3(vector: Vector3): Vector3; + set(x: number, y: number, z: number, w: number): void; + sub(quat: Quaternion): this; + getEulerAngles(): any; + slerp(left: Quaternion, right: Quaternion, amount: number): Quaternion; + } +} + +declare module 'wonder.js/dist/es2015/math/Vector2' { + export class Vector2 { + static create(x: any, y: any): Vector2; + static create(): Vector2; + constructor(x: any, y: any); + constructor(); + x: number; + y: number; + values: Float32Array; + set(x: number, y: number): void; + add(v: Vector2): this; + mul(v: Vector2): this; + isEqual(v: Vector2): boolean; + clone(): Vector2; + } +} + +declare module 'wonder.js/dist/es2015/math/Vector3' { + import { Vector4 } from "wonder.js/dist/es2015/math/Vector4"; + import { Matrix3 } from "wonder.js/dist/es2015/math/Matrix3"; + import { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + export class Vector3 { + static up: any; + static forward: any; + static right: any; + static create(x: number, y: number, z: number): Vector3; + static create(): Vector3; + constructor(x: number, y: number, z: number); + constructor(); + x: number; + y: number; + z: number; + values: Float32Array; + normalize(): Vector3; + isZero(): boolean; + scale(scalar: number): any; + scale(x: number, y: number, z: number): any; + set(v: Vector3): any; + set(x: number, y: number, z: number): any; + sub(v: Vector3): Vector3; + sub2(v1: Vector3, v2: Vector3): this; + add(v: Vector3): this; + add2(v1: Vector3, v2: Vector3): this; + mul(v: Vector3): this; + mul2(v1: Vector3, v2: Vector3): this; + reverse(): Vector3; + clone(): Vector3; + toVector4(): Vector4; + length(): any; + cross(lhs: Vector3, rhs: Vector3): this; + lerp(lhs: Vector3, rhs: Vector3, alpha: number): this; + dot(rhs: any): number; + calAngleCos(v1: Vector3): number; + min(v: Vector3): this; + max(v: Vector3): this; + isEqual(v: Vector3): boolean; + toArray(): number[]; + applyMatrix3(m: Matrix3): this; + applyMatrix4(m: Matrix4): this; + distanceTo(v: Vector3): any; + distanceToSquared(v: Vector3): number; + } +} + +declare module 'wonder.js/dist/es2015/math/Vector4' { + import { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + export class Vector4 { + static create(x: any, y: any, z: any, w: any): any; + static create(): any; + constructor(x: any, y: any, z: any, w: any); + constructor(); + x: number; + y: number; + z: number; + w: number; + values: Float32Array; + normalize(): Vector4; + isEqual(v: Vector4): boolean; + clone(): Vector4; + toVector3(): Vector3; + lengthManhattan(): any; + multiplyScalar(scalar: number): this; + dot(v: Vector4): number; + set(x: number, y: number, z: number, w: number): void; + protected copyHelper(vector4: Vector4): any; + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/ArrayBuffer' { + import { CommonBuffer } from "wonder.js/dist/es2015/renderer/buffer/CommonBuffer"; + import { EBufferType } from "wonder.js/dist/es2015/renderer/buffer/EBufferType"; + import { EBufferUsage } from "wonder.js/dist/es2015/renderer/buffer/EBufferUsage"; + export class ArrayBuffer extends CommonBuffer { + static create(data: Array, size: number, type?: EBufferType, usage?: EBufferUsage): ArrayBuffer; + size: number; + data: Float32Array; + initWhenCreate(data: Array, size: number, type: EBufferType, usage: EBufferUsage): any; + resetData(data: Array, size?: number, type?: EBufferType, offset?: number): this; + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/Buffer' { + import { Entity } from "wonder.js/dist/es2015/core/Entity"; + export abstract class Buffer extends Entity { + buffer: any; + abstract resetData(data: any, ...args: any[]): void; + dispose(): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/BufferDataTable' { + import { EBufferDataType } from "wonder.js/dist/es2015/renderer/buffer/EBufferDataType"; + export class BufferDataTable { + static getGeometryDataName(type: EBufferDataType): string; + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/CommonBuffer' { + import { Buffer } from "wonder.js/dist/es2015/renderer/buffer/Buffer"; + import { EBufferType } from "wonder.js/dist/es2015/renderer/buffer/EBufferType"; + import { EBufferUsage } from "wonder.js/dist/es2015/renderer/buffer/EBufferUsage"; + export abstract class CommonBuffer extends Buffer { + type: EBufferType; + count: number; + usage: EBufferUsage; + protected resetBufferData(glBufferTargetStr: string, typedData: any, offset?: number): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/EBufferDataType' { + export enum EBufferDataType { + VERTICE, + INDICE, + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/EBufferType' { + export enum EBufferType { + BYTE, + UNSIGNED_BYTE, + SHORT, + UNSIGNED_SHORT, + INT, + UNSIGNED_INT, + FLOAT, + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/EBufferUsage' { + export enum EBufferUsage { + STREAM_DRAW, + STATIC_DRAW, + DYNAMIC_DRAW, + } +} + +declare module 'wonder.js/dist/es2015/renderer/buffer/ElementBuffer' { + import { CommonBuffer } from "wonder.js/dist/es2015/renderer/buffer/CommonBuffer"; + import { EBufferType } from "wonder.js/dist/es2015/renderer/buffer/EBufferType"; + import { EBufferUsage } from "wonder.js/dist/es2015/renderer/buffer/EBufferUsage"; + export class ElementBuffer extends CommonBuffer { + static create(data: Array, type?: EBufferType, usage?: EBufferUsage): ElementBuffer; + readonly typeSize: number; + data: Uint16Array | Uint32Array; + initWhenCreate(data: Array, type: EBufferType, usage: EBufferUsage): any; + resetData(data: Array, type?: EBufferType, offset?: number): this; + } +} + +declare module 'wonder.js/dist/es2015/renderer/command/QuadCommand' { + import { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + import { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + import { BufferContainer } from "wonder.js/dist/es2015/component/geometry/data/BufferContainer"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + export abstract class QuadCommand extends RenderCommand { + readonly program: Program; + readonly mvpMatrix: Matrix4; + readonly vpMatrix: Matrix4; + mMatrix: Matrix4; + vMatrix: Matrix4; + pMatrix: Matrix4; + buffers: BufferContainer; + material: Material; + target: GameObject; + sortId: number; + execute(): void; + protected abstract draw(material: Material): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/command/RenderCommand' { + import { WebGLState } from "wonder.js/dist/es2015/renderer/state/WebGLState"; + import { EDrawMode } from "wonder.js/dist/es2015/renderer/EDrawMode"; + import { ElementBuffer } from "wonder.js/dist/es2015/renderer/buffer/ElementBuffer"; + import { ArrayBuffer } from "wonder.js/dist/es2015/renderer/buffer/ArrayBuffer"; + export abstract class RenderCommand { + webglState: WebGLState; + drawMode: EDrawMode; + abstract execute(): void; + init(): void; + dispose(): void; + protected drawElements(indexBuffer: ElementBuffer): void; + protected drawArray(vertexBuffer: ArrayBuffer): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/command/SingleDrawCommand' { + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { Matrix3 } from "wonder.js/dist/es2015/math/Matrix3"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + export class SingleDrawCommand extends QuadCommand { + static create(): SingleDrawCommand; + normalMatrix: Matrix3; + protected draw(material: Material): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/EDrawMode' { + export enum EDrawMode { + POINTS, + LINES, + LINE_LOOP, + LINE_STRIP, + TRIANGLES, + TRIANGLE_STRIP, + TRANGLE_FAN, + } +} + +declare module 'wonder.js/dist/es2015/renderer/GlUtils' { + export class GlUtils { + static drawElements(mode: any, count: number, type: any, offset: number): void; + static drawArrays(mode: any, first: number, count: number): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/program/GLSLDataSender' { + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { ArrayBuffer } from "wonder.js/dist/es2015/renderer/buffer/ArrayBuffer"; + import { Color } from "wonder.js/dist/es2015/structure/Color"; + import { Matrix3 } from "wonder.js/dist/es2015/math/Matrix3"; + import { Matrix4 } from "wonder.js/dist/es2015/math/Matrix4"; + export class GLSLDataSender { + static create(program: Program): GLSLDataSender; + constructor(program: Program); + sendFloat1(name: string, data: any): void; + sendFloat2(name: string, data: any): void; + sendFloat3(name: string, data: any): void; + sendFloat4(name: string, data: any): void; + sendVector2(name: string, data: any): void; + sendVector3(name: string, data: any): void; + sendVector4(name: string, data: any): void; + sendColor3(name: string, data: Color): void; + sendNum1(name: string, data: number): void; + sendMatrix3(name: string, data: Matrix3): void; + sendMatrix4(name: string, data: Matrix4): void; + sendMatrix4Array(name: string, data: Array | Float32Array): void; + sendSampleArray(name: string, data: Array): void; + getUniformLocation(name: string): any; + addBufferToToSendList(pos: number, buffer: ArrayBuffer): void; + sendAllBufferData(): void; + clearBufferList(): void; + sendBuffer(pos: number, buffer: ArrayBuffer): void; + disableVertexAttribArray(): void; + clearAllCache(): void; + dispose(): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/program/Program' { + import { Entity } from "wonder.js/dist/es2015/core/Entity"; + import { EVariableType } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableType"; + import { ArrayBuffer } from "wonder.js/dist/es2015/renderer/buffer/ArrayBuffer"; + import { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + export class Program extends Entity { + static create(): Program; + glProgram: any; + use(): void; + getAttribLocation(name: string): any; + getUniformLocation(name: string): any; + sendUniformData(name: string, type: EVariableType, data: any): void; + sendAttributeBuffer(name: string, type: EVariableType, buffer: ArrayBuffer): void; + sendStructureData(name: string, type: EVariableType, data: any): void; + sendFloat1(name: string, data: any): void; + sendFloat2(name: string, data: any): void; + sendFloat3(name: string, data: any): void; + sendFloat4(name: string, data: any): void; + sendVector2(name: string, data: any): void; + sendVector3(name: string, data: any): void; + sendVector4(name: string, data: any): void; + sendColor3(name: string, data: any): void; + sendNum1(name: string, data: any): void; + sendMatrix3(name: string, data: any): void; + sendMatrix4(name: string, data: any): void; + sendMatrix4Array(name: string, data: Float32Array): void; + sendSampleArray(name: string, data: any): void; + sendAllBufferData(): void; + initWithShader(shader: Shader): this; + dispose(): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/renderer/Renderer' { + import { WebGLState } from "wonder.js/dist/es2015/renderer/state/WebGLState"; + import { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + export abstract class Renderer { + webglState: WebGLState; + abstract addCommand(command: RenderCommand): void; + abstract hasCommand(): boolean; + abstract render(): void; + abstract clear(): void; + init(): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/renderer/WebGLRenderer' { + import { Renderer } from "wonder.js/dist/es2015/renderer/renderer/Renderer"; + import { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + import { Color } from "wonder.js/dist/es2015/structure/Color"; + export class WebGLRenderer extends Renderer { + static create(): WebGLRenderer; + addCommand(command: RenderCommand): void; + hasCommand(): boolean; + clear(): void; + render(): void; + init(): void; + setClearColor(color: Color): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/basic/BasicMaterialColorShaderLib' { + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { BasicMaterial } from "wonder.js/dist/es2015/material/BasicMaterial"; + import { GLSLChunk } from "wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk"; + export class BasicMaterialColorShaderLib extends EngineShaderLib { + static create(): BasicMaterialColorShaderLib; + vsChunk: GLSLChunk; + fsChunk: GLSLChunk; + sendShaderVariables(program: Program, cmd: QuadCommand, material: BasicMaterial): void; + setShaderDefinition(cmd: QuadCommand, material: BasicMaterial): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/basic/BasicShaderLib' { + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { BasicMaterial } from "wonder.js/dist/es2015/material/BasicMaterial"; + import { GLSLChunk } from "wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk"; + export class BasicShaderLib extends EngineShaderLib { + static create(): BasicShaderLib; + vsChunk: GLSLChunk; + fsChunk: GLSLChunk; + sendShaderVariables(program: Program, cmd: QuadCommand, material: BasicMaterial): void; + setShaderDefinition(cmd: QuadCommand, material: BasicMaterial): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/basic/EndBasicShaderLib' { + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { StandardBasicMaterial } from "wonder.js/dist/es2015/material/StandardBasicMaterial"; + import { GLSLChunk } from "wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk"; + export class EndBasicShaderLib extends EngineShaderLib { + static create(): EndBasicShaderLib; + vsChunk: GLSLChunk; + fsChunk: GLSLChunk; + setShaderDefinition(cmd: QuadCommand, material: StandardBasicMaterial): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/common/CommonShaderLib' { + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { EngineMaterial } from "wonder.js/dist/es2015/material/EngineMaterial"; + import { GLSLChunk } from "wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk"; + export class CommonShaderLib extends EngineShaderLib { + static create(): CommonShaderLib; + vsChunk: GLSLChunk; + fsChunk: GLSLChunk; + sendShaderVariables(program: Program, cmd: QuadCommand, material: EngineMaterial): void; + setShaderDefinition(cmd: QuadCommand, material: EngineMaterial): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/common/EndShaderLib' { + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { EngineMaterial } from "wonder.js/dist/es2015/material/EngineMaterial"; + import { GLSLChunk } from "wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk"; + export class EndShaderLib extends EngineShaderLib { + static create(): EndShaderLib; + vsChunk: GLSLChunk; + fsChunk: GLSLChunk; + sendShaderVariables(program: Program, cmd: QuadCommand, material: EngineMaterial): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/common/VerticeCommonShaderLib' { + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { EngineMaterial } from "wonder.js/dist/es2015/material/EngineMaterial"; + import { GLSLChunk } from "wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk"; + export class VerticeCommonShaderLib extends EngineShaderLib { + static create(): VerticeCommonShaderLib; + vsChunk: GLSLChunk; + fsChunk: GLSLChunk; + sendShaderVariables(program: Program, cmd: QuadCommand, material: EngineMaterial): void; + setShaderDefinition(cmd: QuadCommand, material: EngineMaterial): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib' { + import { ShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/ShaderLib"; + import { EngineShader } from "wonder.js/dist/es2015/renderer/shader/shader/EngineShader"; + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + import { ShaderVariable } from "wonder.js/dist/es2015/renderer/shader/variable/VariableLib"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { GLSLChunk } from "wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk"; + export abstract class EngineShaderLib extends ShaderLib { + shader: EngineShader; + abstract vsChunk: GLSLChunk; + abstract fsChunk: GLSLChunk; + attributes: Hash; + uniforms: Hash; + vsSourceTop: string; + vsSourceDefine: string; + vsSourceVarDeclare: string; + vsSourceFuncDeclare: string; + vsSourceFuncDefine: string; + vsSourceBody: string; + vsSource: string; + fsSourceTop: string; + fsSourceDefine: string; + fsSourceVarDeclare: string; + fsSourceFuncDeclare: string; + fsSourceFuncDefine: string; + fsSourceBody: string; + fsSource: string; + vsSourceDefineList: Collection; + fsSourceDefineList: Collection; + vsSourceExtensionList: Collection; + fsSourceExtensionList: Collection; + setShaderDefinition(cmd: RenderCommand, material: Material): void; + protected sendAttributeBuffer(program: Program, name: string, data: any): void; + protected sendUniformData(program: Program, name: string, data: any): void; + protected getVsChunk(): any; + protected getVsChunk(chunk: GLSLChunk): any; + protected getFsChunk(): any; + protected getFsChunk(chunk: GLSLChunk): any; + protected setVsSource(vs: GLSLChunk | string, operator?: string): void; + protected setFsSource(fs: GLSLChunk | string, operator?: string): void; + protected addAttributeVariable(variableArr: Array): void; + protected addUniformVariable(variableArr: Array): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/lib/ShaderLib' { + import { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + export abstract class ShaderLib { + shader: Shader; + sendShaderVariables(program: Program, cmd: RenderCommand, material: Material): void; + init(): void; + dispose(): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/shader/CommonShader' { + import { EngineShader } from "wonder.js/dist/es2015/renderer/shader/shader/EngineShader"; + import { QuadCommand } from "wonder.js/dist/es2015/renderer/command/QuadCommand"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + export class CommonShader extends EngineShader { + static create(): CommonShader; + update(cmd: QuadCommand, material: Material): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/shader/EngineShader' { + import { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + import { EngineShaderSourceBuilder } from "wonder.js/dist/es2015/renderer/shader/sourceBuilder/EngineShaderSourceBuilder"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + import { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + import { ShaderSourceBuilder } from "wonder.js/dist/es2015/renderer/shader/sourceBuilder/ShaderSourceBuilder"; + export abstract class EngineShader extends Shader { + protected sourceBuilder: EngineShaderSourceBuilder; + protected libs: Collection; + protected buildDefinitionData(cmd: RenderCommand, material: Material): void; + protected createShaderSourceBuilder(): ShaderSourceBuilder; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/shader/Shader' { + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + import { Program } from "wonder.js/dist/es2015/renderer/program/Program"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { ShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/ShaderLib"; + import { ShaderSourceBuilder } from "wonder.js/dist/es2015/renderer/shader/sourceBuilder/ShaderSourceBuilder"; + import { RenderCommand } from "wonder.js/dist/es2015/renderer/command/RenderCommand"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + import { EVariableType } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableType"; + export abstract class Shader { + attributes: Hash; + uniforms: Hash; + vsSource: string; + fsSource: string; + readonly dirty: boolean; + readonly program: Program; + libDirty: boolean; + definitionDataDirty: boolean; + protected libs: Collection; + protected sourceBuilder: ShaderSourceBuilder; + abstract update(cmd: RenderCommand, material: Material): any; + createVsShader(): any; + createFsShader(): any; + init(material: Material): void; + dispose(): void; + hasLib(lib: ShaderLib): any; + hasLib(_class: Function): any; + addLib(lib: ShaderLib): void; + addShaderLibToTop(lib: ShaderLib): void; + getLib(libClass: Function): ShaderLib; + getLibs(): Collection; + removeLib(lib: ShaderLib): any; + removeLib(func: Function): any; + removeAllLibs(): void; + sortLib(func: (a: ShaderLib, b: ShaderLib) => any): void; + protected abstract createShaderSourceBuilder(): ShaderSourceBuilder; + protected abstract buildDefinitionData(cmd: RenderCommand, material: Material): void; + protected judgeRefreshShader(cmd: RenderCommand, material: Material): void; + } + export type ShaderData = { + type: EVariableType; + value?: any; + textureId?: string; + }; +} + +declare module 'wonder.js/dist/es2015/renderer/shader/sourceBuilder/EngineShaderSourceBuilder' { + import { ShaderSourceBuilder, SourceDefine } from "wonder.js/dist/es2015/renderer/shader/sourceBuilder/ShaderSourceBuilder"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { EngineShaderLib } from "wonder.js/dist/es2015/renderer/shader/lib/EngineShaderLib"; + export class EngineShaderSourceBuilder extends ShaderSourceBuilder { + static create(): EngineShaderSourceBuilder; + vsSourceTop: string; + vsSourceDefine: string; + vsSourceVarDeclare: string; + vsSourceFuncDeclare: string; + vsSourceFuncDefine: string; + vsSourceBody: string; + fsSourceTop: string; + fsSourceDefine: string; + fsSourceVarDeclare: string; + fsSourceFuncDeclare: string; + fsSourceFuncDefine: string; + fsSourceBody: string; + vsSourceDefineList: Collection; + fsSourceDefineList: Collection; + vsSourceExtensionList: Collection; + fsSourceExtensionList: Collection; + build(libs: Collection): void; + clearShaderDefinition(): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/sourceBuilder/ShaderSourceBuilder' { + import { Hash } from "wonder-commonlib/dist/es2015/Hash"; + import { ShaderData } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + export abstract class ShaderSourceBuilder { + attributes: Hash; + uniforms: Hash; + vsSource: string; + fsSource: string; + abstract build(...args: any[]): void; + abstract clearShaderDefinition(): void; + dispose(): void; + protected convertAttributesData(): void; + } + export type SourceDefine = { + name: string; + value: any; + }; +} + +declare module 'wonder.js/dist/es2015/renderer/shader/variable/EVariableCategory' { + export enum EVariableCategory { + ENGINE, + CUSTOM, + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/variable/EVariableSemantic' { + export enum EVariableSemantic { + POSITION, + NORMAL, + TEXCOORD, + TANGENT, + COLOR, + MODEL, + VIEW, + PROJECTION, + MODEL_VIEW, + MODEL_VIEW_PROJECTION, + MODEL_INVERSE, + VIEW_INVERSE, + PROJECTION_INVERSE, + MODEL_VIEW_INVERSE, + MODEL_VIEW_PROJECTION_INVERSE, + MODEL_INVERSE_TRANSPOSE, + MODEL_VIEW_INVERSE_TRANSPOSE, + VIEWPORT, + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/variable/EVariableType' { + export enum EVariableType { + FLOAT_1, + FLOAT_2, + FLOAT_3, + FLOAT_4, + VECTOR_2, + VECTOR_3, + VECTOR_4, + COLOR_3, + FLOAT_MAT3, + FLOAT_MAT4, + BUFFER, + SAMPLER_CUBE, + SAMPLER_2D, + NUMBER_1, + STRUCTURE, + STRUCTURES, + SAMPLER_ARRAY, + FLOAT_MAT4_ARRAY, + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/variable/VariableLib' { + import { EVariableType } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableType"; + export class VariableLib { + static a_position: ShaderVariable; + static a_positionVec2: ShaderVariable; + static a_currentFramePosition: ShaderVariable; + static a_nextFramePosition: ShaderVariable; + static a_normal: ShaderVariable; + static a_currentFrameNormal: ShaderVariable; + static a_nextFrameNormal: ShaderVariable; + static a_color: ShaderVariable; + static a_texCoord: ShaderVariable; + static a_tangent: ShaderVariable; + static u_color: ShaderVariable; + static u_mMatrix: ShaderVariable; + static u_vMatrix: ShaderVariable; + static u_pMatrix: ShaderVariable; + static u_mvpMatrix: ShaderVariable; + static u_vpMatrix: ShaderVariable; + static u_normalMatrix: ShaderVariable; + static u_samplerCube0: ShaderVariable; + static u_sampler2D0: ShaderVariable; + static u_sampler2D1: ShaderVariable; + static u_lightMapSampler: ShaderVariable; + static u_diffuseMapSampler: ShaderVariable; + static u_diffuseMap1Sampler: ShaderVariable; + static u_diffuseMap2Sampler: ShaderVariable; + static u_diffuseMap3Sampler: ShaderVariable; + static u_specularMapSampler: ShaderVariable; + static u_emissionMapSampler: ShaderVariable; + static u_normalMapSampler: ShaderVariable; + static u_reflectionMapSampler: ShaderVariable; + static u_refractionMapSampler: ShaderVariable; + static u_cameraPos: ShaderVariable; + static u_refractionRatio: ShaderVariable; + static u_reflectivity: ShaderVariable; + static u_map0SourceRegion: ShaderVariable; + static u_map1SourceRegion: ShaderVariable; + static u_diffuseMapSourceRegion: ShaderVariable; + static u_map0RepeatRegion: ShaderVariable; + static u_map1RepeatRegion: ShaderVariable; + static u_diffuseMapRepeatRegion: ShaderVariable; + static u_combineMode: ShaderVariable; + static u_mixRatio: ShaderVariable; + static u_lightMapIntensity: ShaderVariable; + static u_diffuse: ShaderVariable; + static u_specular: ShaderVariable; + static u_emission: ShaderVariable; + static u_shininess: ShaderVariable; + static u_lightModel: ShaderVariable; + static u_isBothSide: ShaderVariable; + static u_opacity: ShaderVariable; + static u_ambient: ShaderVariable; + static u_directionLights: ShaderVariable; + static u_pointLights: ShaderVariable; + static u_vpMatrixFromLight: ShaderVariable; + static u_lightPos: ShaderVariable; + static u_farPlane: ShaderVariable; + static u_interpolation: ShaderVariable; + static u_tilesHeightNumber: ShaderVariable; + static u_tilesWidthNumber: ShaderVariable; + static u_amplitude: ShaderVariable; + static u_jointColor: ShaderVariable; + static u_time: ShaderVariable; + static u_speed: ShaderVariable; + static u_shift: ShaderVariable; + static u_alphaThreshold: ShaderVariable; + static u_fireColor: ShaderVariable; + static u_layerHeightDatas: ShaderVariable; + static u_layerSampler2Ds: ShaderVariable; + static u_herb1Color: ShaderVariable; + static u_herb2Color: ShaderVariable; + static u_herb3Color: ShaderVariable; + static u_groundColor: ShaderVariable; + static u_ampScale: ShaderVariable; + static u_woodColor: ShaderVariable; + static u_roadColor: ShaderVariable; + static u_skyColor: ShaderVariable; + static u_cloudColor: ShaderVariable; + static u_brickColor: ShaderVariable; + static u_waveData: ShaderVariable; + static u_windMatrix: ShaderVariable; + static u_bumpMapSampler: ShaderVariable; + static u_bumpMap1Sampler: ShaderVariable; + static u_bumpMap2Sampler: ShaderVariable; + static u_bumpMap3Sampler: ShaderVariable; + static u_levelData: ShaderVariable; + static a_mVec4_0: ShaderVariable; + static a_mVec4_1: ShaderVariable; + static a_mVec4_2: ShaderVariable; + static a_mVec4_3: ShaderVariable; + static a_normalVec4_0: ShaderVariable; + static a_normalVec4_1: ShaderVariable; + static a_normalVec4_2: ShaderVariable; + static u_isRenderListEmpty: ShaderVariable; + static u_isReflectionRenderListEmpty: ShaderVariable; + static u_isRefractionRenderListEmpty: ShaderVariable; + static u_bitmapSampler: ShaderVariable; + static a_page: ShaderVariable; + static u_pageSampler2Ds: ShaderVariable; + static u_mixMapSampler: ShaderVariable; + static u_diffuseMap1RepeatRegion: ShaderVariable; + static u_diffuseMap2RepeatRegion: ShaderVariable; + static u_diffuseMap3RepeatRegion: ShaderVariable; + static u_grassMapDatas: ShaderVariable; + static a_quadIndex: ShaderVariable; + static u_grassMapSampler: ShaderVariable; + static u_windData: ShaderVariable; + static a_vertexIndex: ShaderVariable; + static u_grassRangeWidth: ShaderVariable; + static u_grassRangeHeight: ShaderVariable; + static u_terrainRangeWidth: ShaderVariable; + static u_terrainRangeHeight: ShaderVariable; + static u_terrainMinHeight: ShaderVariable; + static u_terrainMaxHeight: ShaderVariable; + static u_terrainSubdivisions: ShaderVariable; + static u_terrainScaleY: ShaderVariable; + static u_terrainPositionY: ShaderVariable; + static u_heightMapSampler: ShaderVariable; + static u_lightColor: ShaderVariable; + static a_jointIndice: ShaderVariable; + static a_jointWeight: ShaderVariable; + static u_jointMatrices: ShaderVariable; + } + export type ShaderVariable = { + type: EVariableType; + value: any; + }; +} + +declare module 'wonder.js/dist/es2015/renderer/shader/variable/VariableNameTable' { + export class VariableNameTable { + static getVariableName(name: string): string; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/variable/VariableTypeTable' { + import { EVariableType } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableType"; + export class VariableTypeTable { + static getVariableType(type: EVariableType): string; + } +} + +declare module 'wonder.js/dist/es2015/renderer/state/BasicState' { + import { WebGLState } from "wonder.js/dist/es2015/renderer/state/WebGLState"; + import { Material } from "wonder.js/dist/es2015/material/Material"; + export class BasicState extends WebGLState { + static create(): BasicState; + setState(material: Material): void; + } +} + +declare module 'wonder.js/dist/es2015/renderer/state/WebGLState' { + import { Material } from "wonder.js/dist/es2015/material/Material"; + export abstract class WebGLState { + abstract setState(material: Material): void; + } +} + +declare module 'wonder.js/dist/es2015/structure/Color' { + import { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + export class Color { + static create(colorVal?: string): Color; + dirty: boolean; + r: number; + g: number; + b: number; + a: number; + initWhenCreate(colorVal?: string): void; + toVector3(): Vector3; + toVector4(): any; + toString(): string; + clone(): Color; + isEqual(color: Color): boolean; + } +} + +declare module 'wonder.js/dist/es2015/structure/Face3' { + import { Vector3 } from "wonder.js/dist/es2015/math/Vector3"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export class Face3 { + static create(aIndex: number, bIndex: number, cIndex: number, faceNormal?: Vector3, vertexNormals?: Collection): Face3; + constructor(aIndex: number, bIndex: number, cIndex: number, faceNormal: Vector3, vertexNormals: Collection); + faceNormal: Vector3; + aIndex: number; + bIndex: number; + cIndex: number; + vertexNormals: Collection; + clone(): this; + hasFaceNormal(): boolean; + hasVertexNormal(): boolean; + } +} + +declare module 'wonder.js/dist/es2015/structure/Point' { + export class Point { + x: number; + y: number; + constructor(x?: number, y?: number); + static create(x?: number, y?: number): Point; + } +} + +declare module 'wonder.js/dist/es2015/structure/RectRegion' { + import { Vector4 } from "wonder.js/dist/es2015/math/Vector4"; + export class RectRegion extends Vector4 { + width: number; + height: number; + clone(): RectRegion; + isNotEmpty(): boolean; + } +} + +declare module 'wonder.js/dist/es2015/structure/View' { + import { ContextConfigData } from "wonder.js/dist/es2015/core/data/MainData"; + export class ViewWebGL implements IView { + static create(view: any): ViewWebGL; + constructor(dom: any); + readonly offset: { + x: any; + y: any; + }; + readonly dom: any; + width: number; + height: number; + styleWidth: string; + styleHeight: string; + x: number; + y: number; + initCanvas(): void; + getContext(contextConfig: ContextConfigData): WebGLRenderingContext; + } + export interface IView { + offset: { + x: number; + y: number; + }; + x: number; + y: number; + width: number; + height: number; + styleWidth: string; + styleHeight: string; + dom: any; + getContext(contextConfig: ContextConfigData): WebGLRenderingContext; + initCanvas(): void; + } +} + +declare module 'wonder.js/dist/es2015/utils/ArrayUtils' { + import { ArrayUtils as ArrayUtils$ } from "wonder-commonlib/dist/es2015/utils/ArrayUtils"; + export class ArrayUtils extends ArrayUtils$ { + static hasRepeatItems(arr: Array): boolean; + static contain(arr: Array, item: any): boolean; + } +} + +declare module 'wonder.js/dist/es2015/utils/BufferUtils' { + import { EVariableType } from "wonder.js/dist/es2015/renderer/shader/variable/EVariableType"; + import { ArrayBuffer } from "wonder.js/dist/es2015/renderer/buffer/ArrayBuffer"; + export class BufferUtils { + static convertArrayToArrayBuffer(type: EVariableType, value: Array): ArrayBuffer; + } +} + +declare module 'wonder.js/dist/es2015/utils/ClassUtils' { + export class ClassUtils { + static getClassNameByInstance(obj: any): any; + static addClass(className: string, _class: any): void; + static addClassNameAttributeToClass(className: string, _class: any): void; + static getClass(className: string): any; + } +} + +declare module 'wonder.js/dist/es2015/utils/JudgeUtils' { + import { JudgeUtils as JudgeUtils$ } from "wonder-commonlib/dist/es2015/utils/JudgeUtils"; + import { Entity } from "wonder.js/dist/es2015/core/Entity"; + import { Component } from "wonder.js/dist/es2015/core/Component"; + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + export class JudgeUtils extends JudgeUtils$ { + static isView(obj: any): boolean; + static isEqual(target1: any, target2: any): boolean; + static isPowerOfTwo(value: number): boolean; + static isFloatArray(data: any): boolean; + static isInterface(target: any, memberOfInterface: string): boolean; + static isSelf(self: Entity, entityObject: Entity): boolean; + static isComponenet(component: Component): boolean; + static isDom(obj: any): boolean; + static isCollection(list: Collection): boolean; + static isClass(objInstance: any, className: string): boolean; + } +} + +declare module 'wonder.js/dist/es2015/utils/Log' { + import { Log as Log$ } from "wonder-commonlib/dist/es2015/Log"; + export class Log extends Log$ { + } +} + +declare module 'wonder.js/dist/es2015/utils/MathUtils' { + export class MathUtils { + static clamp(num: number, below: number, up: number): number; + static bigThan(num: number, below: number): number; + static generateZeroToOne(): number; + static generateMinToMax(min: number, max: number): number; + static generateInteger(min: number, max: number): number; + static mod(a: number, b: number): number; + static maxFloorIntegralMultiple(a: number, b: number): number; + } +} + +declare module 'wonder.js/dist/es2015/utils/RenderUtils' { + import { Collection } from "wonder-commonlib/dist/es2015/Collection"; + import { GameObject } from "wonder.js/dist/es2015/core/entityObject/gameObject/GameObject"; + export class RenderUtils { + static getGameObjectRenderList(sourceList: Collection): Collection; + } +} + +declare module 'wonder.js/dist/es2015/utils/ShaderLibUtils' { + import { Geometry } from "wonder.js/dist/es2015/component/geometry/Geometry"; + import { Shader } from "wonder.js/dist/es2015/renderer/shader/shader/Shader"; + export class ShaderLibUtils { + static addVerticeShaderLib(geometry: Geometry, shader: Shader): void; + } +} + +declare module 'wonder.js/dist/es2015/utils/SortUtils' { + export class SortUtils { + static insertSort(targetArr: Array, compareFunc: (a: any, b: any) => boolean, isChangeSelf?: boolean): Array; + static quickSort(targetArr: Array, compareFunc: (a: any, b: any) => boolean, isChangeSelf?: boolean): Array; + } +} + +declare module 'wonder.js/dist/es2015/utils/time/CommonTimeController' { + import { TimeController } from "wonder.js/dist/es2015/utils/time/TimeController"; + export class CommonTimeController extends TimeController { + static create(): CommonTimeController; + protected getNow(): any; + } +} + +declare module 'wonder.js/dist/es2015/utils/time/DirectorTimeController' { + import { TimeController } from "wonder.js/dist/es2015/utils/time/TimeController"; + export class DirectorTimeController extends TimeController { + static create(): DirectorTimeController; + gameTime: number; + fps: number; + isTimeChange: boolean; + deltaTime: number; + tick(time: number): void; + start(): void; + resume(): void; + protected getNow(): any; + } +} + +declare module 'wonder.js/dist/es2015/utils/time/TimeController' { + export abstract class TimeController { + elapsed: number; + pauseElapsed: number; + pauseTime: number; + startTime: number; + start(): void; + stop(): void; + pause(): void; + resume(): void; + computeElapseTime(time: number): number; + protected abstract getNow(): any; + } +} + +declare module 'wonder.js/dist/es2015/config/CompileConfig' { + export var CompileConfig: { + isCompileTest: boolean; + closeContractTest: boolean; + }; +} + +declare module 'wonder.js/dist/es2015/event/interface/IEventData' { + export interface IEventData { + returnValue: boolean; + preventDefault: () => void; + } + export interface IKeyboardEventData extends IEventData { + ctrlKey: number; + altKey: number; + shiftKey: number; + metaKey: number; + keyCode: number; + } + export interface IMouseEventData extends IEventData { + clientX: number; + clientY: number; + pageX: number; + pageY: number; + button: number; + detail?: number; + wheelDelta?: number; + movementX?: number; + webkitMovementX?: number; + mozMovementX?: number; + movementY?: number; + webkitMovementY?: number; + mozMovementY?: number; + target: HTMLElement; + currentTarget: HTMLElement; + } + export interface ITouchEventData extends IEventData { + touches: Array; + changedTouches: Array; + targetTouches: Array; + target: HTMLElement; + currentTarget: HTMLElement | null; + } + export interface ITouchData { + clientX: number; + clientY: number; + identifier: number; + pageX: number; + pageY: number; + screenX: number; + screenY: number; + radiusX: number; + radiusY: number; + rotationAngle: number; + force: number; + target: HTMLElement; + } + export interface IPointEventData extends IEventData { + clientX: number; + clientY: number; + pageX: number; + pageY: number; + button?: number; + detail?: number; + wheelDelta?: number; + movementX?: number; + webkitMovementX?: number; + mozMovementX?: number; + movementY?: number; + webkitMovementY?: number; + mozMovementY?: number; + target: HTMLElement; + currentTarget: HTMLElement | null; + } +} + +declare module 'wonder.js/dist/es2015/renderer/shader/chunk/ShaderChunk' { + export const empty: GLSLChunk; + export const NULL: number; + export const basic_materialColor_fragment: GLSLChunk; + export const end_basic_fragment: GLSLChunk; + export const common_define: GLSLChunk; + export const common_fragment: GLSLChunk; + export const common_function: GLSLChunk; + export const common_vertex: GLSLChunk; + export const highp_fragment: GLSLChunk; + export const lowp_fragment: GLSLChunk; + export const mediump_fragment: GLSLChunk; + export type GLSLChunk = { + top?: string; + define?: string; + varDeclare?: string; + funcDeclare?: string; + funcDefine?: string; + body?: string; + }; +} + diff --git a/wonder.js/tsconfig.json b/wonder.js/tsconfig.json new file mode 100644 index 0000000000..0fdebb2ebc --- /dev/null +++ b/wonder.js/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "wonder.js-tests.ts" + ] +} \ No newline at end of file diff --git a/wonder.js/wonder.js-tests.ts b/wonder.js/wonder.js-tests.ts new file mode 100644 index 0000000000..eb486e6a48 --- /dev/null +++ b/wonder.js/wonder.js-tests.ts @@ -0,0 +1,4 @@ +import {Director} from "wonder.js/dist/es2015/core/Director"; + +console.log(Director.getInstance()); + From afb8c9e50ae5a062181b7e705e51900e226a745f Mon Sep 17 00:00:00 2001 From: Karol Janyst Date: Fri, 10 Mar 2017 16:37:16 +0900 Subject: [PATCH 503/797] Add boolean to value types (#14874) --- react-select/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react-select/index.d.ts b/react-select/index.d.ts index c011b78e0e..beed5858ff 100644 --- a/react-select/index.d.ts +++ b/react-select/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-select v1.0.0 +// Type definitions for react-select 1.0 // Project: https://github.com/JedWatson/react-select // Definitions by: ESQUIBET Hugo , Gilad Gray , Izaak Baker , Tadas Dailyda , Mark Vujevits , Mike Deverell // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -23,7 +23,7 @@ declare namespace ReactSelectClass { /** Text for rendering */ label?: string; /** Value for searching */ - value?: string | number; + value?: string | number | boolean; /** * Allow this option to be cleared * @default true From a971970e9309319a194bad5962a47a526907ee75 Mon Sep 17 00:00:00 2001 From: Umar Nizamani Date: Fri, 10 Mar 2017 08:37:58 +0100 Subject: [PATCH 504/797] Updated Cheerio definitions to 0.22 (#14878) --- cheerio/cheerio-tests.ts | 8 ++++++++ cheerio/index.d.ts | 14 ++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/cheerio/cheerio-tests.ts b/cheerio/cheerio-tests.ts index 5b1f6511ec..1c0848eef7 100644 --- a/cheerio/cheerio-tests.ts +++ b/cheerio/cheerio-tests.ts @@ -55,6 +55,10 @@ var $multiEl = $('selector', 'selector', 'selector'); $el.attr('id'); $el.attr('id', 'favorite').html(); +// props +$el.prop('style') +$el.prop('style', 'none').html() + // data $el.data(); $el.data('apple-color'); @@ -86,6 +90,7 @@ $el.is(() => { */ // serializeArray $('').serializeArray(); +$('
    ').serialize(); /** * Traversing @@ -217,6 +222,9 @@ $el.eq(0).addBack('.class').length * Manipulation */ +$('
  • Plum
  • ').appendTo($el) +$el.prependTo($('
  • Plum
  • ')) + // .append( content, [content, ...] ) $el.append('
  • Plum
  • ').html(); $el.append('
  • Plum
  • ', '
  • Plum
  • ').html(); diff --git a/cheerio/index.d.ts b/cheerio/index.d.ts index e94eb1a68c..f3615674f5 100644 --- a/cheerio/index.d.ts +++ b/cheerio/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for Cheerio v0.17.0 +// Type definitions for Cheerio v0.22.0 // Project: https://github.com/cheeriojs/cheerio -// Definitions by: Bret Little , VILIC VANE , Wayne Maurer +// Definitions by: Bret Little , VILIC VANE , Wayne Maurer , Umar Nizamani // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface Cheerio { @@ -47,10 +47,11 @@ interface Cheerio { is(func: (index: number, element: CheerioElement) => boolean): boolean; // Form + serialize(): string; serializeArray(): {name: string, value: string}[]; // Traversing - + find(selector: string): Cheerio; find(element: Cheerio): Cheerio; @@ -60,6 +61,9 @@ interface Cheerio { parentsUntil(element: CheerioElement, filter?: string): Cheerio; parentsUntil(element: Cheerio, filter?: string): Cheerio; + prop(name: string): any; + prop(name: string, value: any): Cheerio; + closest(): Cheerio; closest(selector: string): Cheerio; @@ -126,6 +130,8 @@ interface Cheerio { addBack(filter: string):Cheerio; // Manipulation + appendTo(target: Cheerio) : Cheerio + prependTo(target: Cheerio) : Cheerio append(content: string, ...contents: any[]): Cheerio; append(content: Document, ...contents: any[]): Cheerio; @@ -266,4 +272,4 @@ declare var cheerio:CheerioAPI; declare module "cheerio" { export = cheerio; -} +} \ No newline at end of file From 8d1cf56e258d0f4a25f564fc6e82fdd305a3f16a Mon Sep 17 00:00:00 2001 From: Christian Kotzbauer Date: Fri, 10 Mar 2017 08:38:54 +0100 Subject: [PATCH 505/797] updated extended-listbox to 2.0.0 (#14879) --- extended-listbox/extended-listbox-tests.ts | 54 +--------------------- extended-listbox/index.d.ts | 37 +-------------- 2 files changed, 2 insertions(+), 89 deletions(-) diff --git a/extended-listbox/extended-listbox-tests.ts b/extended-listbox/extended-listbox-tests.ts index 0ca2f862b1..dfa51ffebf 100644 --- a/extended-listbox/extended-listbox-tests.ts +++ b/extended-listbox/extended-listbox-tests.ts @@ -1,5 +1,4 @@ - - +/// var $test = $("#test"); @@ -126,54 +125,3 @@ instance.onItemEnterPressed((event: ListboxEvent) => { instance.onItemDoubleClicked((event: ListboxEvent) => { console.log(event.args); }); - - - -/////// LEGACY API /////// - -// Add string item -instance.target.listbox("addItem", "Test2"); - - -// Add item -var item: ListboxItem = {}; -item.selected = true; -item.disabled = false; -item.childItems = ["Test4"]; -item.groupHeader = false; -item.id = "ouetioreit"; -item.index = 0; -item.text = "Test3"; -var id: string = instance.target.listbox("addItem", item); - - -// Remove item -instance.target.listbox("removeItem", id); - - -// Get item -var i: ListboxItem = instance.target.listbox("getItem", id); - - -// Get items -var allItems: ListboxItem[] = instance.target.listbox("getItems"); - - -// Move item up -var newIndex: number = instance.target.listbox("moveItemUp", i.id); - - -// Move item down -newIndex = instance.target.listbox("moveItemDown", i.id); - - -// Clear selection -instance.target.listbox("clearSelection"); - - -// Enable -instance.target.listbox("enable", false); - - -// Destroy -instance.target.listbox("destroy"); diff --git a/extended-listbox/index.d.ts b/extended-listbox/index.d.ts index eb5f0eec04..3f3527b903 100644 --- a/extended-listbox/index.d.ts +++ b/extended-listbox/index.d.ts @@ -1,10 +1,8 @@ -// Type definitions for extended-listbox 1.1.x +// Type definitions for extended-listbox 2.0.x // Project: https://github.com/code-chris/extended-listbox // Definitions by: Christian Kotzbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - interface ListboxItem { /** display text */ text?: string; @@ -147,37 +145,4 @@ interface JQuery { /** constructs a new instance of Listbox on the given DOM item */ listbox(options: ListBoxOptions): ExtendedListboxInstance|ExtendedListboxInstance[]; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'addItem'): string; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'removeItem'): void; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'destroy'): void; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'getItem'): ListboxItem; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'getItems'): ListboxItem[]; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'moveItemUp'): number; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'moveItemDown'): number; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'clearSelection'): void; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: 'enable'): void; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: string): any; - - /** @deprecated: use method in ExtendedListboxInstance */ - listbox(methodName: string, methodParameter: any): any; } From ea797116776923778906e56929b626727e09bdf4 Mon Sep 17 00:00:00 2001 From: Christian Kotzbauer Date: Fri, 10 Mar 2017 08:39:31 +0100 Subject: [PATCH 506/797] Added aurelia-knockout 2.0.0 (#14880) * added aurelia-knockout 2.0.0 * fixed tslint errors in aurelia-knockout --- aurelia-knockout/aurelia-knockout-tests.ts | 11 +++++++++++ aurelia-knockout/index.d.ts | 19 ++++++++++++++++++ aurelia-knockout/tsconfig.json | 23 ++++++++++++++++++++++ aurelia-knockout/tslint.json | 1 + 4 files changed, 54 insertions(+) create mode 100644 aurelia-knockout/aurelia-knockout-tests.ts create mode 100644 aurelia-knockout/index.d.ts create mode 100644 aurelia-knockout/tsconfig.json create mode 100644 aurelia-knockout/tslint.json diff --git a/aurelia-knockout/aurelia-knockout-tests.ts b/aurelia-knockout/aurelia-knockout-tests.ts new file mode 100644 index 0000000000..6944ab5889 --- /dev/null +++ b/aurelia-knockout/aurelia-knockout-tests.ts @@ -0,0 +1,11 @@ + +export class ViewModel { + + constructor(private knockoutBindable: KnockoutBindable) { + } + + activate(settings: any): void { + this.knockoutBindable.applyBindableValues(settings, this); + this.knockoutBindable.applyBindableValues(settings, this, true); + } +} diff --git a/aurelia-knockout/index.d.ts b/aurelia-knockout/index.d.ts new file mode 100644 index 0000000000..2ccec60b46 --- /dev/null +++ b/aurelia-knockout/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for aurelia-knockout 2.0 +// Project: https://github.com/code-chris/aurelia-knockout +// Definitions by: Christian Kotzbauer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare interface KnockoutBindable { + + /** + * Applys all values from a data object (usually the activation data) to the corresponding instance fields + * in the current view model if they are marked as @bindable. By default all matching values from the data object + * are applied. To only apply observable values set the last parameter to `true`. Subscriptions are created + * for all Knockout observables in the data object to update the view-model values respectively. + * + * @param data - the data object + * @param target - the target view model + * @param applyOnlyObservables - `true` if only observable values should be applied, false by default. + */ + applyBindableValues(data: any, target: any, applyOnlyObservables?: boolean): void; +} diff --git a/aurelia-knockout/tsconfig.json b/aurelia-knockout/tsconfig.json new file mode 100644 index 0000000000..aa45dc1157 --- /dev/null +++ b/aurelia-knockout/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "aurelia-knockout-tests.ts" + ] +} diff --git a/aurelia-knockout/tslint.json b/aurelia-knockout/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/aurelia-knockout/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 79246be8c7c62b02adcc42cd88d05f9d2186158f Mon Sep 17 00:00:00 2001 From: Wayne Date: Fri, 10 Mar 2017 02:40:14 -0500 Subject: [PATCH 507/797] Add declaration for csvtojson (#14881) * Added declaration for csvtojson * Updated indent formatting to meet DT standards * Fixed tslint issues * Fixed issue with Converter class incorrectly extending Transform --- csvtojson/csvtojson-tests.ts | 114 +++++++++++++++ csvtojson/index.d.ts | 276 +++++++++++++++++++++++++++++++++++ csvtojson/tsconfig.json | 22 +++ csvtojson/tslint.json | 1 + 4 files changed, 413 insertions(+) create mode 100644 csvtojson/csvtojson-tests.ts create mode 100644 csvtojson/index.d.ts create mode 100644 csvtojson/tsconfig.json create mode 100644 csvtojson/tslint.json diff --git a/csvtojson/csvtojson-tests.ts b/csvtojson/csvtojson-tests.ts new file mode 100644 index 0000000000..4368d00494 --- /dev/null +++ b/csvtojson/csvtojson-tests.ts @@ -0,0 +1,114 @@ +import csv = require('csvtojson'); +import fs = require('fs'); + +// From documentation on project home page -> https://github.com/Keyang/node-csvtojson + +///////////////////////////// +// From CSV String +const csvStr: string = `1,2,3 +4,5,6 +7,8,9`; + +// event emitter version using factory function +csv({ noheader: true }) + .fromString(csvStr) + .on('csv', (csvRow: string[]) => { // this func will be called 3 times + console.log(csvRow); // => [1,2,3] , [4,5,6] , [7,8,9] + }) + .on('done', () => { + //parsing finished + }); + +// event emitter version using Converter class +new csv.Converter({ noheader: true }) + .fromString(csvStr) + .on('csv', (csvRow: string[]) => { // this func will be called 3 times + console.log(csvRow); // => [1,2,3] , [4,5,6] , [7,8,9] + }) + .on('done', () => { + //parsing finished + }); + +// callback version using Converter class +new csv.Converter({ noheader: true }) + .fromString(csvStr, (err, result) => { + console.log(JSON.stringify(result)); + }); + +// callback version using factory function +csv({ noheader: true }) + .fromString(csvStr, (err, result) => { + console.log(JSON.stringify(result)); + }); + +///////////////////////////// +// From CSV File +const filePath = './test.csv'; + +// event emitter version using factory function +csv() + .fromFile(filePath) + .on('json', (jsonObj: any) => { + console.log(JSON.stringify(jsonObj)); + }) + .on('done', (error: any) => { + console.log('end'); + }); + +// event emitter version using Converter class +new csv.Converter() + .fromFile(filePath) + .on('json', (jsonObj: any) => { + console.log(JSON.stringify(jsonObj)); + }) + .on('done', (error: any) => { + console.log('end'); + }); + +// callback version using factory function +csv() + .fromFile(filePath, (err, result) => { + console.log(JSON.stringify(result)); + }); + +// callback version using Converter class +new csv.Converter() + .fromFile(filePath, (err, result) => { + console.log(JSON.stringify(result)); + }); + +///////////////////////////// +// From CSV Stream + +const stream = fs.createReadStream(filePath); + +// event emitter version using factory function +csv().fromStream(stream) + .on('json', (jsonObj: any) => { + console.log(JSON.stringify(jsonObj)); + }) + .on('done', (error: any) => { + console.log('end'); + }); + +// event emitter version using Converter class +new csv.Converter() + .fromStream(stream) + .on('json', (jsonObj: any) => { + console.log(JSON.stringify(jsonObj)); + }) + .on('done', (error: any) => { + console.log('end'); + }); + +// callback version using factory function +csv() + .fromStream(stream, (err, result) => { + console.log(JSON.stringify(result)); + }); + +// callback version using Converter class +new csv.Converter() + .fromStream(stream, (err, result) => { + console.log(JSON.stringify(result)); + }); diff --git a/csvtojson/index.d.ts b/csvtojson/index.d.ts new file mode 100644 index 0000000000..9ba01212c7 --- /dev/null +++ b/csvtojson/index.d.ts @@ -0,0 +1,276 @@ +// Type definitions for csvtojson 1.1 +// Project: https://github.com/Keyang/node-csvtojson +// Definitions by: Eric Byers , Wayne Carson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import * as stream from 'stream'; + +declare namespace csvtojson { + + /** + * Stream options + */ + type StreamOptions = stream.TransformOptions; + + /** + * Converter options + */ + interface ConverterOptions { + + /** + * Delimiter used for seperating columns. Use "auto" if delimiter is unknown in advance, + * in this case, delimiter will be auto-detected (by best attempt). Use an array to give + * a list of potential delimiters e.g. [",","|","$"]. (default: ",") + */ + delimiter?: string | string[]; + + /** + * If a column contains delimiter, it is able to use quote character to surround the column + * content. e.g. "hello, world" wont be split into two columns while parsing. Set to "off" + * will ignore all quotes. (default: " (double quote)) + */ + quote?: string; + + /** + * Indicate if parser trim off spaces surrounding column content. e.g. " content " will be + * trimmed to "content". (default: true) + */ + trim?: boolean; + + /** + * This parameter turns on and off whether check field type. (default: true) + */ + checkType?: boolean; + + /** + * Stringify the stream output to JSON array. This is useful when pipe output to a file + * which expects stringified JSON array. (default: false and only stringified JSON (without []) + * will be pushed to downstream) + */ + toArrayString?: boolean; + + /** + * Ignore the empty value in CSV columns. If a column value is not giving, set this to true to + * skip them. (default: false) + */ + ignoreEmpty?: boolean; + + /** + * Number of worker processes. The worker process will use multi-cores to help process CSV data. + * Set to number of cores to improve the performance of processing large CSV file. Keep 1 for + * small csv files. (default: 1) + */ + workerNum?: number; + + /** + * Indicating CSV data has no header row and first row is data row. (default: false) + */ + noheader?: boolean; + + /** + * An array to specify the headers of CSV data. If noheader is false, this value will override + * CSV header row. Example: ["my field","name"] (default: null) + */ + headers?: string[]; + + /** + * Don't interpret dots (.) and square brackets in header fields as nested object or array identifiers + * at all (treat them like regular characters for JSON field identifiers). (default: false) + */ + flatKeys?: boolean; + + /** + * The max character a CSV row could have. 0 means infinite. If max number exceeded, parser will emit + * "error" of "row_exceed". if a possibly corrupted CSV data provided, give it a number like 65535 + * so the parser wont consume memory. (default: 0) + */ + maxRowLength?: number; + + /** + * Whether or not to check if the column number of a row is the same as headers. If column number + * mismatched headers number, an error of "mismatched_column" will be emitted. (default: false) + */ + checkColumn?: boolean; + + /** + * End of line character. If omitted, parser will attempt retrieve it from first chunk of CSV data. + * If no valid eol found, then operation system eol will be used. + */ + eol?: string; + + /** + * Escape character used in quoted column. Default is double quote (") according to RFC4108. Change + * to back slash (\) or other chars for your own case. (default: " (double quote)) + */ + escape?: string; + + /** + * This parameter instructs the parser to include only those columns as specified by an array of + * column indexes. Example: [0,2,3] will parse and include only columns 0, 2, and 3 in the JSON output. + */ + includeColumns?: number[]; + + /** + * This parameter instructs the parser to ignore columns as specified by an array of column indexes. + * Example: [1,3,5] will ignore columns 1, 3, and 5 and will not return them in the JSON output. + */ + ignoreColumns?: number[]; + + /** + * Deprecated. Use workerNum instead. + */ + fork?: number; + } + + /** + * Callback function for handling result of parse. + */ + type ParseResultHandler = (err: any, result: any) => void; + + /** + * Event handler for "json" events. + */ + type JsonEventHandler = (jsonObj: any, rowNumber: number) => void; + + /** + * Event handler for "csv" events. + */ + type CsvEventHandler = (csvRow: string[], rowNumber: number) => void; + + /** + * Event handler for "data" events. + */ + type DataEventHandler = (data: any) => void; + + /** + * Event handler for "error" events. + */ + type ErrorEventHandler = (err: any) => void; + + /** + * Event handler for "record_parsed" events. + */ + type RecordParsedEventHandler = (jsonObj: any, csvRoe: string[], rowNumber: number) => void; + + /** + * Event handler for "end" events. + */ + type EndEventHandler = () => void; + + /** + * Event handler for "end_parsed" events. + */ + type EndParsedEventHandler = (jsonObjArray: any[]) => void; + + /** + * Event handler for "done" events. + */ + type DoneEventHandler = (err: any) => void; + + /** + * Converts provided CSV input to a JSON object. + */ + class Converter extends stream.Transform { + + /** + * Initializes a new instance of a Converter + * @param {ConverterOptions} options converter options + * @param {StreamOptions} streamOptions stream options + */ + constructor(options?: ConverterOptions, streamOptions?: StreamOptions); + + /** + * Reads in a CSV from a string. + * @param {string} str the string to convert + * @return {Converter} returns this object for chaining + */ + fromString(str: string): this + + /** + * Reads in a CSV from a string. + * @param {string} str the string to convert + * @param {ParseResultHandler} callback callback function to handle result or error + */ + fromString(str: string, callback: ParseResultHandler): void; + + /** + * Reads in a CSV from a file. + * @param {string} filePath the path to the CSV file + * @return {Converter} returns this object for chaining + */ + fromFile(filePath: string): this + + /** + * Reads in a CSV from a file. + * @param {string} filePath the path to the CSV file + * @param {ParseResultHandler} callback callback function to handle result or error + */ + fromFile(filePath: string, callback: ParseResultHandler): void; + + /** + * Reads in a CSV from a stream. + * @param {Stream} stream the stream + * @return {Converter} returns this object for chaining + */ + fromStream(stream: NodeJS.ReadableStream): this + + /** + * Reads in a CSV from a stream. + * @param {Stream} stream the stream + * @param {ParseResultHandler} callback callback function to handle result or error + */ + fromStream(stream: stream.Stream, callback: ParseResultHandler): void; + + /** + * Adds a listener function to the end of the listeners array for an event. + * Available events: + * - json + * - csv + * - data + * - error + * - record_parsed + * - end + * - end_parsed + * - done + * @param {Event} event name of event + * @param {Function} listener listener function + * @return {this} returns this object for chaining + */ + // tslint:disable-next-line:forbidden-types + on(event: string, listener: Function | JsonEventHandler | CsvEventHandler | DataEventHandler | ErrorEventHandler + | RecordParsedEventHandler | EndEventHandler | EndParsedEventHandler | DoneEventHandler): this; + + /** + * Transform objects after CSV parsing but before result being emitted or pushed downstream. + * @param {Function} callback transform function + * @return {this} returns this object for chaining + */ + transf(callback: (jsonObj: any, csvRow: string[], rowNumber: number) => void): this; + + /** + * The function in preRawData will be called directly with the string from upper stream. + * @param {Function} callback callback function + * @return {this} returns this object for chaining + */ + preRawData(callback: (csvRawData: string, cb: (newData: any) => void) => void): this; + + /** + * The function is called each time a file line being found in csv stream. + * @param {Function} callback callback function + * @return {this} returns this object for chaining + */ + preFileLine(callback: (line: string, rowNumber: number) => string): this; + } +} + +/** + * Factory function which creates an instance of a Converter object. + * @param {ConverterOptions} options converter options + * @param {StreamOptions} streamOptions stream options + * @return {csvtojson.Converter} Converter object + */ +declare function csvtojson(options?: csvtojson.ConverterOptions, streamOptions?: csvtojson.StreamOptions): csvtojson.Converter; + +export = csvtojson; diff --git a/csvtojson/tsconfig.json b/csvtojson/tsconfig.json new file mode 100644 index 0000000000..81ec6a66a2 --- /dev/null +++ b/csvtojson/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", + "csvtojson-tests.ts" + ] +} diff --git a/csvtojson/tslint.json b/csvtojson/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/csvtojson/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From b00b86d7197ed3217557fc6e88657c19a8b67f55 Mon Sep 17 00:00:00 2001 From: Anton Kandybo Date: Fri, 10 Mar 2017 09:57:24 +0200 Subject: [PATCH 508/797] Enable dt-header tslint rule --- compression-webpack-plugin/tslint.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/compression-webpack-plugin/tslint.json b/compression-webpack-plugin/tslint.json index 02312e1c7d..70cee1ba88 100644 --- a/compression-webpack-plugin/tslint.json +++ b/compression-webpack-plugin/tslint.json @@ -1,7 +1,4 @@ { - "extends": "../tslint.json", - "rules": { - "dt-header": false - } - } + "extends": "../tslint.json" +} \ No newline at end of file From 9e069e784e7a5bc12f1abacd71b319a9f02f1c8b Mon Sep 17 00:00:00 2001 From: Anton Kandybo Date: Fri, 10 Mar 2017 10:13:16 +0200 Subject: [PATCH 509/797] Using require syntax in tests --- .../compression-webpack-plugin-tests.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compression-webpack-plugin/compression-webpack-plugin-tests.ts b/compression-webpack-plugin/compression-webpack-plugin-tests.ts index 4ee93c78b7..3939bf5847 100644 --- a/compression-webpack-plugin/compression-webpack-plugin-tests.ts +++ b/compression-webpack-plugin/compression-webpack-plugin-tests.ts @@ -1,5 +1,5 @@ -import { Configuration } from 'webpack' -import * as CompressionPlugin from 'compression-webpack-plugin' +import { Configuration } from 'webpack'; +import CompressionPlugin = require('compression-webpack-plugin'); const c: Configuration = { plugins: [ From 911335f7fe972e349f402ce229627095b38ab020 Mon Sep 17 00:00:00 2001 From: Anton Kandybo Date: Fri, 10 Mar 2017 10:14:53 +0200 Subject: [PATCH 510/797] Remove patch version --- compression-webpack-plugin/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compression-webpack-plugin/index.d.ts b/compression-webpack-plugin/index.d.ts index cf65f55300..536a77b8e9 100644 --- a/compression-webpack-plugin/index.d.ts +++ b/compression-webpack-plugin/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for compression-webpack-plugin 0.3.2 +// Type definitions for compression-webpack-plugin 0.3 // Project: https://github.com/webpack-contrib/compression-webpack-plugin // Definitions by: Anton Kandybo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 75c72afe968d4df30a27f600183144cb301320f3 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 10 Mar 2017 07:08:34 -0800 Subject: [PATCH 511/797] fine-uploader: Provides its own types (#14983) --- fine-uploader/index.d.ts | 346 ----------------------------- fine-uploader/test/blobs.ts | 9 - fine-uploader/test/callbacks.ts | 59 ----- fine-uploader/test/camera.ts | 14 -- fine-uploader/test/chunking.ts | 26 --- fine-uploader/test/core.ts | 17 -- fine-uploader/test/cors.ts | 13 -- fine-uploader/test/deleteFile.ts | 28 --- fine-uploader/test/extraButtons.ts | 23 -- fine-uploader/test/form.ts | 13 -- fine-uploader/test/message.ts | 21 -- fine-uploader/test/method.ts | 140 ------------ fine-uploader/test/paste.ts | 14 -- fine-uploader/test/request.ts | 32 --- fine-uploader/test/resume.ts | 15 -- fine-uploader/test/retry.ts | 15 -- fine-uploader/test/scaling.ts | 29 --- fine-uploader/test/session.ts | 26 --- fine-uploader/test/text.ts | 13 -- fine-uploader/test/validation.ts | 22 -- fine-uploader/test/workarounds.ts | 13 -- fine-uploader/tsconfig.json | 42 ---- fine-uploader/tslint.json | 1 - notNeededPackages.json | 6 + 24 files changed, 6 insertions(+), 931 deletions(-) delete mode 100644 fine-uploader/index.d.ts delete mode 100644 fine-uploader/test/blobs.ts delete mode 100644 fine-uploader/test/callbacks.ts delete mode 100644 fine-uploader/test/camera.ts delete mode 100644 fine-uploader/test/chunking.ts delete mode 100644 fine-uploader/test/core.ts delete mode 100644 fine-uploader/test/cors.ts delete mode 100644 fine-uploader/test/deleteFile.ts delete mode 100644 fine-uploader/test/extraButtons.ts delete mode 100644 fine-uploader/test/form.ts delete mode 100644 fine-uploader/test/message.ts delete mode 100644 fine-uploader/test/method.ts delete mode 100644 fine-uploader/test/paste.ts delete mode 100644 fine-uploader/test/request.ts delete mode 100644 fine-uploader/test/resume.ts delete mode 100644 fine-uploader/test/retry.ts delete mode 100644 fine-uploader/test/scaling.ts delete mode 100644 fine-uploader/test/session.ts delete mode 100644 fine-uploader/test/text.ts delete mode 100644 fine-uploader/test/validation.ts delete mode 100644 fine-uploader/test/workarounds.ts delete mode 100644 fine-uploader/tsconfig.json delete mode 100644 fine-uploader/tslint.json diff --git a/fine-uploader/index.d.ts b/fine-uploader/index.d.ts deleted file mode 100644 index dab4e720ea..0000000000 --- a/fine-uploader/index.d.ts +++ /dev/null @@ -1,346 +0,0 @@ -// Type definitions for FineUploader for 5.11 -// Project: http://fineuploader.com/ -// Definitions by: Bradford Wagner -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace qq { - interface BlobsOptions { - defaultName?: string; - } - - interface CameraOptions { - button?: HTMLElement; - ios?: boolean; - } - - interface ChunkingOptions { - concurrent?: ChunkingConcurrentOptions; - enabled?: boolean; // default false - mandatory?: boolean; // default false - partSize?: number; // default 2,000,000 - paramNames?: ChunkingParamNames; - success?: ChunkingSuccess; - } - - interface ChunkingConcurrentOptions { - enabled?: boolean; // default false - } - - interface ChunkingParamNames { - chunkSize?: string; // default: qqchunksize - partByteOffset?: string; // default: qqpartbyteoffset - partIndex?: string; // default: qqpartindex - totalParts?: string; // default: qqtotalparts - } - - interface ChunkingSuccess { - endpoint?: string | null; // default: null - } - - interface CorsOptions { - allowXdr?: boolean; // default: false - expected?: boolean; // default: false - sendCredentials: boolean; // default: false - } - - interface DeleteFileOptions { - customHeader?: H; // default: {} - enabled?: boolean; // default false - endpoint?: string; // default: /server/upload - method?: string; // default: DELETE - params?: P; // default: {} - } - - interface ExtraButtonsOptions { - element: HTMLElement | undefined; // default: undefined - fileInputTitle?: string; // default: file input - folders?: boolean; // default: false - multiple?: boolean; // default: true - validation?: V; // default: 'validation' - } - - interface FormOptions { - element?: string | HTMLElement; // default: qq-form - autoUpload?: boolean; // default: false - interceptSubmit?: boolean; // default: true - } - - interface MessagesOptions { - emptyError?: string; // default: {file} is empty, please select files again without it. - maxHeightImageError?: string; // default: Image is too tall. - maxWidthImageError?: string; // default: Image is too wide. - minHeightImageError?: string; // default: Image is not tall enough. - minWidthImageError?: string; // default: Image is not wide enough. - minSizeError?: string; // default: {file} is too small, minimum file size is {minSizeLimit}. - noFilesError?: string; // default: No files to upload. - onLeave?: string; // default: The files are being uploaded, if you leave now the upload will be canceled. - retryFailTooManyItemsError?: string; // default: Too many items ({netItems}) would be uploaded. Item limit is {itemLimit}. - typeError?: string; // default: {file} has an invalid extension. Valid extension(s): {extensions}. - // tslint:disable-next-line:max-line-length - unsupportedBrowserIos8Safari?: string; // default: Unrecoverable error - this browser does not permit file uploading of any kind due to serious bugs in iOS8 Safari. Please use iOS8 Chrome until Apple fixes these issues. - } - - interface PasteOptions { - defaultName?: string; // default: pasted_image - targetElement?: HTMLElement | null; // default: null - } - - interface ResumeOptions { - recordsExpireIn?: number; // default: 7 - enabled?: boolean; // default: false - paramNames?: ResumeParamNameOptions; - } - - interface ResumeParamNameOptions { - resuming: string; // default: qqresume - } - - interface RetryOptions { - autoAttemptDelay?: number; // default: 5 - enableAuto?: boolean; // default: false - maxAutoAttempts?: number; // default: 3 - preventRetryResponseProperty?: string; // default: preventRetry - } - - interface RequestOptions { - customHeaders?: H; // default: {} - endpoint?: string; // default: /server/upload - filenameParam?: string; // default: qqfilename - forceMultipart?: boolean; // default: true - inputName?: string; // default: qqfile - method?: string; // default: POST - params?: P; // default: {} - paramsInBody?: boolean; // default: true - uuid?: string; // default: qquuid - totalFileSizeName?: string; // default: qqtotalfilesize - } - - interface ScalingOptions { - customResizer?: ( - blob: File | Blob, - height: number, - image: HTMLImageElement, - sourceCanvas: HTMLCanvasElement, - targetCanvas: HTMLCanvasElement, - width: number) => Promise | undefined; // default: undefined - defaultQuality?: number; // default: 80 - defaultType?: string | null; // default: null - failureText?: string; // default: Failed to scale - includeExif?: boolean; // default: false - orient?: boolean; // default: true - sendOriginal?: boolean; // default: false - sizes?: Size[]; // default: [] - } - - /** - * From Documentation: - * An array containing size objects that describe scaled versions of each submitted image that should be generated and uploaded. - * A size object should usually contain a name String property (which will be appended to the file name of the scaled file), and must always contain a maxSize integer property. - * A type MIME string property is optional. - */ - interface Size { - name: string; - maxSize: number; - type?: string; - } - - interface SessionOptions { - customHeaders?: H; // default: {} - endpoint?: string | null; // default: null - params?: P; // default: {} - refreshOnReset?: boolean; // default: true - } - - interface TextOptions { - defaultResponseError?: string; // default: Upload failure reason unknown - fileInputTitle?: string; // default: file input - sizeSymbols?: string[]; // default: ['kB', 'MB', 'GB', 'TB', 'PB', 'EB'] - } - - interface ValidationOptions { - acceptFiles?: MimeType[] | null; // default: null - allowedExtensions?: string[]; // default: [] - itemLimit?: number; // default: 0 - minSizeLimit?: number; // default: 0 - sizeLimit?: number; // default: 0 - stopOnFirstInvalidFile?: boolean; // default: true - image?: ValidationImageOptions; - } - - interface ValidationImageOptions { - maxHeight?: number; // default: 0 - maxWidth?: number; // default: 0 - minWidth?: number; // default: 0 - minHeight?: number; // default: 0 - } - - interface WorkaroundOptions { - iosEmptyVideos?: boolean; // default: true - ios8BrowserCrash?: boolean; // default: false - ios8SafariUploads?: boolean; // default: true - } - - interface ChunkData { - partIndex: number; - startByte: number; - endByte: number; - totalParts: number; - } - - interface ValidateMetadata { - name: string; - size?: number; - } - - interface CallbackOptions { - onAutoRetry?: (id: number, name: string, attemptNumber: number) => void; - onCancel?: (id: number, name: string) => void; - onComplete?: (id: number, name: string, responseJSON: T, xhr: XMLHttpRequest) => void; // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onAllComplete?: (succeeded: number[], failed: number[]) => void; - onDelete?: (id: number) => void; - onDeleteComplete?: (id: number, xhr: XMLHttpRequest, isError: boolean) => void; // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onError?: (id: number, name: string, errorReason: string, xhr: XMLHttpRequest) => void; // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onManualRetry?: (id: number, name: string) => boolean; // return false to prevent this and all future retries - onPasteReceived?: (blob: Blob) => void; - onProgress?: (id: number, name: string, uploadedBytes: number, totalBytes: number) => void; - onResume?: (id: number, name: string, chunkData: T) => void; - onSessionRequestComplete?: (response: T[], success: boolean, xhrOrXdr: XMLHttpRequest) => void; // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onStatusChange?: (id: number, oldStatus: string, newStatus: string) => void; - onSubmit?: (id: number, name: string) => void; - onSubmitDelete?: (id: number) => void; - onSubmitted?: (id: number, name: string) => void; - onTotalProgress?: (totalUploadedBytes: number, totalBytes: number) => void; - onUpload?: (id: number, name: string) => void; - onUploadChunk?: (id: number, name: string, chunkData: ChunkData) => void; - // ignore xhr: XDomainRequest as it is not compatible for all versions of TypeScript - onUploadChunkSuccess?: (id: number, chunkData: ChunkData, responseJSON: T, xhr: XMLHttpRequest) => void; - onValidate?: (data: ValidateMetadata, buttonContainer: HTMLElement) => void; - onValidateBatch?: (fileOrBlobDataArray: ValidateMetadata[], buttomContainer: HTMLElement) => void; - } - - interface BasicOptions { - // core options - autoUpload?: boolean; // default true - button?: HTMLElement; - debug?: boolean; - disableCancelForFormUploads?: boolean; - formatFileName?: (rawFileName: string) => string; // rawFilename to display filename - maxConnections?: number; - multiple?: boolean; - - blobs?: BlobsOptions; - camera?: CameraOptions; - chunking?: ChunkingOptions; - cors?: CorsOptions; - deleteFile?: DeleteFileOptions; - extraButtons?: ExtraButtonsOptions; - form?: FormOptions; - messages?: MessagesOptions; - paste?: PasteOptions; - resume?: ResumeOptions; - retry?: RetryOptions; - request?: RequestOptions; - scaling?: ScalingOptions; - session?: SessionOptions; - text?: TextOptions; - validation?: ValidationOptions; - workarounds?: WorkaroundOptions; - - callbacks?: CallbackOptions; - } - - interface BlobWrapper { - blob: Blob; - name: string; - } - - interface CanvasWrapper { - canvas: HTMLCanvasElement; - name: string; - quality: number; // 1-100 - type: MimeType; - } - - interface ResizeInfo { - blob: File | Blob; - height: number; - image: HTMLImageElement; - sourceCanvas: HTMLCanvasElement; - targetCanvas: HTMLCanvasElement; - width: number; - } - - interface ResumableItem { - name: string; - uuid: string; - partIdx: number; - } - - interface FilterOption { - id?: number; - uuid?: string; - originalName?: string; - name?: string; - status?: string; - size?: number; - } - - interface ScaleImageOptions { - maxSize: number; - orient?: boolean; // default: true - type?: string; // default: type or reference image - quality?: number; // 0-100 - default: 80 - includeExif?: boolean; // default: false - customResizer?: (resizeInfo: ResizeInfo) => Promise; - } - - class FineUploaderBasic { - constructor(options: BasicOptions) - - addFiles(files: File[] | HTMLInputElement[] | Blob[] | BlobWrapper[] | HTMLCanvasElement[] | CanvasWrapper[] | FileList, params: T, endpoint: string): void; - addInitialFiles(initialFiles: T[]): void; - cancel(id: number): void; - cancelAll(): void; - clearStoredFiles(): void; - continueUpload(id: number): boolean; // true if successful - deleteFile(id: number): void; - - /** - * TODO: need someone who has used this to update the returned promise related fields - */ - drawThumbnail(id: number, targetContainer: HTMLElement, maxSize: number, fromServer: boolean, customResizer: (resizeInfo: ResizeInfo) => Promise): Promise - getButton(id: number): HTMLElement; - getFile(id: number): File | Blob; - getInProgress(): number; - getName(id: number): string; - getParentId(scaledFileId: number): number; - getRemainingAllowedItems(): number; - getResumableFilesData(): ResumableItem[]; - getSize(id: number): number; - getUploads(filter: FilterOption): T | T[]; - getUuid(id: number): string; - log(message: string, level: string): void; - pauseUpload(id: number): boolean; // true if successful - reset(): void; - retry(id: number): void; - scaleImage(id: number, options: ScaleImageOptions): Promise; - setCustomHeaders(customHeaders: H, id: number): void; - setEndpoint(path: string, identifier: number | HTMLElement): void; - setDeleteFileCustomHeaders(customHeaders: H, id: number): void; - setDeleteFileEndpoint(path: string, identifier: number | HTMLElement): void; - setDeleteFileParams

    (params: P, id: number): void; - setItemLimit(newItemLimit: number): void; - setForm(formElementOrId: HTMLFormElement | string): void; - setName(id: number, name: string): void; - setParams

    (params: P, id: number): void; - setUuid(id: number, uuid: string): void; - uploadStoredFiles(): void; // throws NoFilesError - - // ui - addExtraDropzone(element: HTMLElement): void; - getDropTarget(id: number): HTMLElement; - getId(element: HTMLElement): number; - getItemByFileId(id: number): HTMLElement; - removeExtraDropzone(element: HTMLElement): void; - } -} diff --git a/fine-uploader/test/blobs.ts b/fine-uploader/test/blobs.ts deleted file mode 100644 index 99e5355460..0000000000 --- a/fine-uploader/test/blobs.ts +++ /dev/null @@ -1,9 +0,0 @@ -function testBlob() { - const config: qq.BasicOptions = { - blobs: { - defaultName: "hi.png" - } - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/callbacks.ts b/fine-uploader/test/callbacks.ts deleted file mode 100644 index eba85ad2a0..0000000000 --- a/fine-uploader/test/callbacks.ts +++ /dev/null @@ -1,59 +0,0 @@ -class CallbacksTest { - constructor(private opts: qq.CallbackOptions) { - - } - - testCallbacks() { - const opts = this.opts; - - interface CustomType { - myTypeOfClass: string; - } - - opts.onAutoRetry = (id, name, attemptNumber) => {}; - - opts.onCancel = (id, name) => {}; - - opts.onComplete = (id: number, name: string, responseJSON: CustomType, xhr: XMLHttpRequest) => {}; - - opts.onAllComplete = (succeeded, failed) => {}; - - opts.onDelete = (id) => {}; - - opts.onDeleteComplete = (id, xhr, isError) => {}; - - opts.onError = (id, name, errorReason, xhr) => {}; - - opts.onManualRetry = (id, name) => { - return true; - }; - - opts.onPasteReceived = (blob) => {}; - - opts.onProgress = (id, name, uploadedBytes, totalBytes) => {}; - - opts.onResume = (id: number, name: string, chunkData: CustomType) => {}; - - opts.onSessionRequestComplete = (response: CustomType[], success: boolean, xhrOrXdr: XMLHttpRequest) => {}; - - opts.onStatusChange = (id, oldStatus, newStatus) => {}; - - opts.onSubmit = (id, name) => {}; - - opts.onSubmitDelete = (id) => {}; - - opts.onSubmitted = (id, name) => {}; - - opts.onTotalProgress = (totalUploadedBytes, totalBytes) => {}; - - opts.onUpload = (id, name) => {}; - - opts.onUploadChunk = (id, name, chunkData) => {}; - - opts.onUploadChunkSuccess = (id: number, chunkData: qq.ChunkData, responseJSON: CustomType, xhr: XMLHttpRequest) => {}; - - opts.onValidate = (data, buttonContainer) => {}; - - opts.onValidateBatch = (fileOrBlobDataArray, buttonContaine) => {}; - } -} diff --git a/fine-uploader/test/camera.ts b/fine-uploader/test/camera.ts deleted file mode 100644 index b42a080778..0000000000 --- a/fine-uploader/test/camera.ts +++ /dev/null @@ -1,14 +0,0 @@ -function cameraTest() { - const cameraButton = new HTMLButtonElement(); - - const cameraOptions: qq.CameraOptions = { - button: cameraButton, - ios: false - }; - - const config: qq.BasicOptions = { - camera: cameraOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/chunking.ts b/fine-uploader/test/chunking.ts deleted file mode 100644 index 386dd67738..0000000000 --- a/fine-uploader/test/chunking.ts +++ /dev/null @@ -1,26 +0,0 @@ -function chunkingTest() { - - const chunkingOptions: qq.ChunkingOptions = { - concurrent: { - enabled: false - }, - enabled: true, - mandatory: true, - partSize: 1000000, - paramNames: { - chunkSize: "chunkSize", - partByteOffset: "partByteOffset", - partIndex: "partIndex", - totalParts: "totalParts" - }, - success: { - endpoint: "/some/web/endpoint/yaySuccesss" - } - }; - - const config: qq.BasicOptions = { - chunking: chunkingOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/core.ts b/fine-uploader/test/core.ts deleted file mode 100644 index dbc06e95d6..0000000000 --- a/fine-uploader/test/core.ts +++ /dev/null @@ -1,17 +0,0 @@ -function testCore() { - const button: HTMLElement = new HTMLButtonElement(); - - const config: qq.BasicOptions = { - autoUpload: true, - button, - debug: true, - disableCancelForFormUploads: true, - formatFileName: (rawFileName: string) => { - return "hi"; - }, - maxConnections: 10, - multiple: true - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/cors.ts b/fine-uploader/test/cors.ts deleted file mode 100644 index 771b210208..0000000000 --- a/fine-uploader/test/cors.ts +++ /dev/null @@ -1,13 +0,0 @@ -function corsTest() { - const corsOptions: qq.CorsOptions = { - allowXdr: true, - expected: true, - sendCredentials: true - }; - - const config: qq.BasicOptions = { - cors: corsOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/deleteFile.ts b/fine-uploader/test/deleteFile.ts deleted file mode 100644 index 49c3e68890..0000000000 --- a/fine-uploader/test/deleteFile.ts +++ /dev/null @@ -1,28 +0,0 @@ -function deleteFileTest() { - interface CustomHeader { - myOption: string; - } - - interface CustomParams { - myParam: string; - } - - const deleteFileOptions: qq.DeleteFileOptions = { - customHeader: { - myOption: "ewwww" - }, - enabled: true, - endpoint: "/my/server/location/delete", - method: "POST", - params: { - myParam: "u" - } - }; - - - const config: qq.BasicOptions = { - deleteFile: deleteFileOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/extraButtons.ts b/fine-uploader/test/extraButtons.ts deleted file mode 100644 index eef709bea8..0000000000 --- a/fine-uploader/test/extraButtons.ts +++ /dev/null @@ -1,23 +0,0 @@ -function extraButtons() { - interface Validation { - myValue: string; - } - - const element: HTMLElement = new HTMLElement(); - - const extraButtonOptions: qq.ExtraButtonsOptions = { - element, - fileInputTitle: "inputTitle", - folders: true, - multiple: false, - validation: { - myValue: "ew" - } - }; - - const config: qq.BasicOptions = { - extraButtons: extraButtonOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/form.ts b/fine-uploader/test/form.ts deleted file mode 100644 index ccc08b69a1..0000000000 --- a/fine-uploader/test/form.ts +++ /dev/null @@ -1,13 +0,0 @@ -function formTest() { - const formOptions: qq.FormOptions = { - element: "qq-form", - autoUpload: true, - interceptSubmit: true - }; - - const config: qq.BasicOptions = { - form: formOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/message.ts b/fine-uploader/test/message.ts deleted file mode 100644 index 726584bf7b..0000000000 --- a/fine-uploader/test/message.ts +++ /dev/null @@ -1,21 +0,0 @@ -function messageTest() { - const messageOptions: qq.MessagesOptions = { - emptyError: "emptyError", - maxHeightImageError: "maxHeightImageError", - maxWidthImageError: "error occurred", - minHeightImageError: "error occurred", - minWidthImageError: "error occurred", - minSizeError: "error occurred", - noFilesError: "error occurred", - onLeave: "error occurred", - retryFailTooManyItemsError: "error occurred", - typeError: "error occurred", - unsupportedBrowserIos8Safari: "error occurred" - }; - - const config: qq.BasicOptions = { - messages: messageOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/method.ts b/fine-uploader/test/method.ts deleted file mode 100644 index 1adb13db81..0000000000 --- a/fine-uploader/test/method.ts +++ /dev/null @@ -1,140 +0,0 @@ -class TestMethods { - constructor(private uploader: qq.FineUploaderBasic) { - } - - testAddFiles() { - interface ParamType { - field: string; - } - - const params: ParamType = { - field: 'hiiiii' - }; - - this.uploader.addFiles( - new FileList(), - params, - "/my/happy/endpoint" - ); - } - - testAddInitialFiles() { - interface InitialFiles { - myField: number; - } - - const initialFiles: InitialFiles[] = [{ - myField: 1324 - }]; - - this.uploader.addInitialFiles(initialFiles); - } - - testDrawThumbnail() { - const promise: Promise = this.uploader.drawThumbnail( - 1234, - new HTMLElement(), - 1234565, - false, - (resizeInfo) => { - return new Promise(() => { - return new Blob(); - }); - } - ); - } - - testGetUploads() { - interface ResponseType { - hi: string; - } - const response: ResponseType | ResponseType[] = this.uploader.getUploads({ - status: "proggresssssssesees" - }); - } - - testSetCustomHeaders() { - interface CustomHeader { - customField: number; - } - - this.uploader.setCustomHeaders({ - customField: 1234 - }, 1234); - } - - testSetDeleteCustomHeaders() { - interface CustomHeader { - customField: number; - } - - this.uploader.setDeleteFileCustomHeaders({ - customField: 1234 - }, 1234); - } - - testSetDeleteFileParams() { - interface CustomParams { - paramField: boolean; - } - this.uploader.setDeleteFileParams({ - paramField: false - }, 1234); - } - - testSetParams() { - interface CustomParams { - customParams: number; - } - - this.uploader.setParams({ - customParams: 1234 - }, 1234); - } - - bulkTests() { - this.uploader.cancel(1); - this.uploader.cancelAll(); - this.uploader.clearStoredFiles(); - const shouldContinue: boolean = this.uploader.continueUpload(1234); - this.uploader.deleteFile(1234); - const elem: HTMLElement = this.uploader.getButton(1234); - const fileOrBlob: File | Blob = this.uploader.getFile(1234); - let num: number = this.uploader.getInProgress(); - let s: string = this.uploader.getName(1234); - num = this.uploader.getParentId(1234); - num = this.uploader.getRemainingAllowedItems(); - const resumables: qq.ResumableItem[] = this.uploader.getResumableFilesData(); - num = this.uploader.getSize(1234); - s = this.uploader.getUuid(1234); - this.uploader.log("why am i doing this?", "info"); - const b: boolean = this.uploader.pauseUpload(1234); - this.uploader.reset(); - this.uploader.retry(1234); - const blobPromise: Promise = this.uploader.scaleImage(1234, { - maxSize: 20, - orient: false, - type: "png", - quality: 10, - includeExif: false, - }); - this.uploader.setEndpoint("/my/path/is/my/own", 1234); - this.uploader.setEndpoint("/my/path/is/my/own", new HTMLElement()); - this.uploader.setDeleteFileEndpoint("/some/path", 1234); - this.uploader.setDeleteFileEndpoint("/some/path", new HTMLElement()); - this.uploader.setItemLimit(1234); - this.uploader.setForm(new HTMLFormElement()); - this.uploader.setForm("myFormElement"); - this.uploader.setName(1234, "myCustomName"); - this.uploader.setUuid(1234, "12341234"); - this.uploader.uploadStoredFiles(); - } - - uiTests() { - this.uploader.addExtraDropzone(new HTMLElement()); - let elem: HTMLElement = this.uploader.getDropTarget(1234); - const n: number = this.uploader.getId(elem); - elem = this.uploader.getItemByFileId(n); - this.uploader.removeExtraDropzone(elem); - } -} diff --git a/fine-uploader/test/paste.ts b/fine-uploader/test/paste.ts deleted file mode 100644 index 9b3c7d9007..0000000000 --- a/fine-uploader/test/paste.ts +++ /dev/null @@ -1,14 +0,0 @@ -function pasteTest() { - const targetElement: HTMLElement = new HTMLElement(); - - const pasteOptions: qq.PasteOptions = { - defaultName: "pasted_image", - targetElement - }; - - const config: qq.BasicOptions = { - paste: pasteOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/request.ts b/fine-uploader/test/request.ts deleted file mode 100644 index 54b29c9be9..0000000000 --- a/fine-uploader/test/request.ts +++ /dev/null @@ -1,32 +0,0 @@ -function requestTest() { - interface CustomHeader { - customHeader: string; - } - - interface CustomParam { - customParam: boolean; - } - - const requestOptions: qq.RequestOptions = { - customHeaders: { - customHeader: "my custom header hehehehee" - }, - endpoint: "/my/custom/endpoint", - filenameParam: "newFilenameParam", - forceMultipart: true, - inputName: "filenameParamMapping", - method: "POST", - params: { - customParam: false - }, - paramsInBody: false, - uuid: "asdf123456", - totalFileSizeName: "totalFileSize" - }; - - const config: qq.BasicOptions = { - request: requestOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} \ No newline at end of file diff --git a/fine-uploader/test/resume.ts b/fine-uploader/test/resume.ts deleted file mode 100644 index dc588d19f5..0000000000 --- a/fine-uploader/test/resume.ts +++ /dev/null @@ -1,15 +0,0 @@ -function resumeTest() { - const resumeOptions: qq.ResumeOptions = { - recordsExpireIn: 10, - enabled: true, - paramNames: { - resuming: "ew you" - } - }; - - const config: qq.BasicOptions = { - resume: resumeOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/retry.ts b/fine-uploader/test/retry.ts deleted file mode 100644 index 85c9f71af3..0000000000 --- a/fine-uploader/test/retry.ts +++ /dev/null @@ -1,15 +0,0 @@ -function retryTest() { - - const retryOptions: qq.RetryOptions = { - autoAttemptDelay: 1, - enableAuto: true, - maxAutoAttempts: 32, - preventRetryResponseProperty: "preventRetry" - }; - - const config: qq.BasicOptions = { - retry: retryOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} \ No newline at end of file diff --git a/fine-uploader/test/scaling.ts b/fine-uploader/test/scaling.ts deleted file mode 100644 index 5e8ff3dc51..0000000000 --- a/fine-uploader/test/scaling.ts +++ /dev/null @@ -1,29 +0,0 @@ -function scalingTest() { - const scalingOptions: qq.ScalingOptions = { - customResizer: (blob, height, image, sourceCanvas, targetCanvas, width) => { - const promise = new Promise(() => { - return blob; - }); - return promise; - }, - defaultQuality: 10, - defaultType: "JPEG", - failureText: "you have failed me for the last time", - includeExif: true, - orient: false, - sendOriginal: true, - sizes: [ - { - maxSize: 10, - name: "i am added to name", - type: "mime type" - } - ] - }; - - const config: qq.BasicOptions = { - scaling: scalingOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/session.ts b/fine-uploader/test/session.ts deleted file mode 100644 index 7d8d6069b9..0000000000 --- a/fine-uploader/test/session.ts +++ /dev/null @@ -1,26 +0,0 @@ -function sessionTest() { - interface CustomHeader { - customHeader: string; - } - - interface CustomParam { - customParam: boolean; - } - - const sessionOptions: qq.SessionOptions = { - customHeaders: { - customHeader: "customHeader" - }, - endpoint: "/mysession/endpoint", - params: { - customParam: false - }, - refreshOnReset: false - }; - - const config: qq.BasicOptions = { - session: sessionOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/text.ts b/fine-uploader/test/text.ts deleted file mode 100644 index e83ddb4bcf..0000000000 --- a/fine-uploader/test/text.ts +++ /dev/null @@ -1,13 +0,0 @@ -function textTest() { - const textOptions: qq.TextOptions = { - defaultResponseError: "you have failed me for the last time", - fileInputTitle: "file input title", - sizeSymbols: ['kb'] - }; - - const config: qq.BasicOptions = { - text: textOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/validation.ts b/fine-uploader/test/validation.ts deleted file mode 100644 index 60324157f9..0000000000 --- a/fine-uploader/test/validation.ts +++ /dev/null @@ -1,22 +0,0 @@ -function validationTest() { - - const validationOptions: qq.ValidationOptions = { - acceptFiles: [new MimeType()], - allowedExtensions: ['csv, xls'], - itemLimit: 5, - sizeLimit: 10000000, - stopOnFirstInvalidFile: false, - image: { - maxHeight: 10, - maxWidth: 10, - minHeight: 1, - minWidth: 1 - } - }; - - const config: qq.BasicOptions = { - validation: validationOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/test/workarounds.ts b/fine-uploader/test/workarounds.ts deleted file mode 100644 index 42fa5ceee7..0000000000 --- a/fine-uploader/test/workarounds.ts +++ /dev/null @@ -1,13 +0,0 @@ -function workaroundsTest() { - const workaroundOptions: qq.WorkaroundOptions = { - iosEmptyVideos: false, - ios8BrowserCrash: false, - ios8SafariUploads: false - }; - - const config: qq.BasicOptions = { - workarounds: workaroundOptions - }; - - const uploader = new qq.FineUploaderBasic(config); -} diff --git a/fine-uploader/tsconfig.json b/fine-uploader/tsconfig.json deleted file mode 100644 index c02e485091..0000000000 --- a/fine-uploader/tsconfig.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "files": [ - "index.d.ts", - "test/blobs.ts", - "test/camera.ts", - "test/chunking.ts", - "test/core.ts", - "test/cors.ts", - "test/deleteFile.ts", - "test/extraButtons.ts", - "test/form.ts", - "test/message.ts", - "test/paste.ts", - "test/resume.ts", - "test/retry.ts", - "test/request.ts", - "test/scaling.ts", - "test/session.ts", - "test/text.ts", - "test/validation.ts", - "test/workarounds.ts", - "test/method.ts", - "test/callbacks.ts" - ], - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - } -} \ No newline at end of file diff --git a/fine-uploader/tslint.json b/fine-uploader/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/fine-uploader/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/notNeededPackages.json b/notNeededPackages.json index c8b59ea072..fce0ef50f0 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -323,6 +323,12 @@ "typingsPackageName": "antd", "sourceRepoURL": "https://github.com/ant-design/ant-design", "asOfVersion": "1.0.0" + }, + { + "libraryName": "FineUploader", + "typingsPackageName": "fine-uploader", + "sourceRepoURL": "http://fineuploader.com/", + "asOfVersion": "5.14.0" } ] } \ No newline at end of file From 1c2f3aec5d538a64d980bd94b71913467ad4dde8 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 10 Mar 2017 07:23:35 -0800 Subject: [PATCH 512/797] Fix chai-enzyme tests (#15106) --- chai-enzyme/chai-enzyme-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chai-enzyme/chai-enzyme-tests.tsx b/chai-enzyme/chai-enzyme-tests.tsx index 7e7ef027ed..a75e99c756 100644 --- a/chai-enzyme/chai-enzyme-tests.tsx +++ b/chai-enzyme/chai-enzyme-tests.tsx @@ -34,7 +34,7 @@ expect(wrapper).to.have.ref("test"); expect(wrapper).to.be.selected(); expect(wrapper).to.have.tagName("div"); expect(wrapper).to.have.text(""); -expect(wrapper).to.have.Type(Test); +expect(wrapper).to.have.type(Test); expect(wrapper).to.have.value("test"); expect(wrapper).to.have.attr("test", "test"); expect(wrapper).to.have.data("test", "Test"); From 51b64c3c15bdcc72c124b940f9dd6792da992116 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 10 Mar 2017 07:46:20 -0800 Subject: [PATCH 513/797] Remove unnecessary references in test files. (#14900) --- acorn/acorn-tests.ts | 2 - amplify/amplify-tests.ts | 3 - .../angular-bootstrap-calendar-tests.ts | 3 - .../angular-feature-flags-tests.ts | 2 - angular-hotkeys/angular-hotkeys-tests.ts | 2 - angular-jwt/angular-jwt-tests.ts | 2 - angular-modal/angular-modal-tests.ts | 2 - archiver/archiver-tests.ts | 3 - atom/atom-tests.ts | 1 - auth0/auth0-tests.ts | 2 - autosize/autosize-tests.ts | 2 - aws-lambda/aws-lambda-tests.ts | 2 - babel-template/babel-template-tests.ts | 3 - babel-traverse/babel-traverse-tests.ts | 2 - babylon/babylon-tests.ts | 5 - .../backbone.layoutmanager-tests.ts | 4 +- backbone/backbone-tests.ts | 2 - bardjs/bardjs-tests.ts | 3 - batch-stream/batch-stream-tests.ts | 2 - .../bazinga-translator-tests.ts | 2 - bezier-js/bezier-js-tests.ts | 2 - bingmaps/bingmaps-tests.ts | 7 - bit-array/bit-array-tests.ts | 2 - blob-stream/blob-stream-tests.ts | 3 - blue-tape/blue-tape-tests.ts | 1 - bluebird-retry/bluebird-retry-tests.ts | 2 - bootpag/bootpag-tests.ts | 2 - .../bootstrap-datepicker-tests.ts | 1 - .../bootstrap-maxlength-tests.ts | 2 - bootstrap-notify/bootstrap-notify-tests.ts | 3 - bootstrap-select/bootstrap-select-tests.ts | 2 - bootstrap-slider/bootstrap-slider-tests.ts | 3 - bootstrap-switch/bootstrap-switch-tests.ts | 7 +- .../bootstrap-touchspin-tests.ts | 5 +- .../bootstrap-validator-tests.ts | 2 - .../bootstrap.v3.datetimepicker-tests.ts | 2 - bootstrap/bootstrap-tests.ts | 3 - browser-resolve/browser-resolve-tests.ts | 2 - .../business-rules-engine-tests.ts | 1 - cachefactory/cachefactory-tests.ts | 2 - cal-heatmap/cal-heatmap-tests.ts | 2 - cassandra-driver/cassandra-driver-tests.ts | 2 - cbor/cbor-tests.ts | 2 - chai-as-promised/chai-as-promised-tests.ts | 2 - chai-enzyme/chai-enzyme-tests.tsx | 4 - chai-spies/chai-spies-tests.ts | 3 - chocolatechipjs/chocolatechipjs-tests.ts | 15 +- cliff/cliff-tests.ts | 1 - co-body/co-body-tests.ts | 3 - coinstring/coinstring-tests.ts | 3 - connect-redis/connect-redis-tests.ts | 2 - cookies/cookies-tests.ts | 2 - .../cordova-plugin-battery-status-tests.ts | 2 - .../cordova-plugin-camera-tests.ts | 2 - .../cordova-plugin-contacts-tests.ts | 2 - .../cordova-plugin-device-motion-tests.ts | 2 - ...cordova-plugin-device-orientation-tests.ts | 2 - .../cordova-plugin-device-tests.ts | 2 - .../cordova-plugin-dialogs-tests.ts | 2 - .../cordova-plugin-file-transfer-tests.ts | 2 - .../cordova-plugin-file-tests.ts | 1 - .../cordova-plugin-globalization-tests.ts | 2 - .../cordova-plugin-inappbrowser-tests.ts | 2 - .../cordova-plugin-keyboard-tests.ts | 2 - .../cordova-plugin-media-capture-tests.ts | 2 - .../cordova-plugin-media-tests.ts | 2 - ...ordova-plugin-network-information-tests.ts | 2 - .../cordova-plugin-splashscreen-tests.ts | 2 - .../cordova-plugin-statusbar-tests.ts | 3 - .../cordova-plugin-vibration-tests.ts | 2 - .../cordova-plugin-websql-tests.ts | 3 - cryptojs/test/md5-tests.ts | 3 - .../css-modules-require-hook-tests.ts | 1 - csv-stringify/csv-stringify-tests.ts | 2 - cybozulabs-md5/cybozulabs-md5-tests.ts | 2 - d3.cloud.layout/d3.cloud.layout-tests.ts | 78 ++++---- d3kit/d3kit-tests.ts | 6 +- d3kit/v1/d3kit-tests.ts | 3 - .../datatables.net-buttons-tests.ts | 4 - .../datatables.net-fixedheader-tests.ts | 3 - .../datatables.net-select-tests.ts | 3 - datatables.net/datatables.net-tests.ts | 3 - dw-bxslider-4/dw-bxslider-4-tests.ts | 3 - dynatable/dynatable-tests.ts | 2 - ecurve/ecurve-tests.ts | 2 - ej.web.all/ej.web.all-tests.ts | 178 +++++++++--------- ej.web.all/index.d.ts | 2 +- .../electron-devtools-installer-tests.ts | 2 - ember/v1/ember-tests.ts | 3 - esprima/esprima-tests.ts | 3 - falcor-express/falcor-express-tests.ts | 4 - fancybox/fancybox-tests.ts | 3 - featherlight/featherlight-tests.ts | 2 - fixed-data-table/fixed-data-table-tests.tsx | 3 - flickity/flickity-tests.ts | 8 +- foundation-sites/foundation-sites-tests.ts | 8 - foundation/foundation-tests.ts | 3 - from/from-tests.ts | 3 - fs-ext/fs-ext-tests.ts | 9 +- .../fs-extra-promise-es6-tests.ts | 4 +- fs-extra-promise/fs-extra-promise-tests.ts | 3 - fs-extra/fs-extra-tests.ts | 3 - ftp/ftp-tests.ts | 9 +- fullcalendar/fullcalendar-tests.ts | 3 +- fullcalendar/v1/fullcalendar-tests.ts | 4 +- gijgo/gijgo-tests.ts | 1 - gldatepicker/gldatepicker-tests.ts | 2 - gm/gm-tests.ts | 3 - .../gregorian-calendar-tests.ts | 3 - gridfs-stream/gridfs-stream-tests.ts | 4 - gulp-babel/gulp-babel-tests.ts | 2 - gulp-cheerio/gulp-cheerio-tests.ts | 4 - gulp-dtsm/gulp-dtsm-tests.ts | 3 - gulp-help/gulp-help-tests.ts | 4 - gulp-html-replace/gulp-html-replace-tests.ts | 4 - gulp-useref/gulp-useref-tests.ts | 2 - hammerjs/v1/hammerjs-tests.ts | 3 - hystrixjs/hystrixjs-tests.ts | 3 - .../i18next-browser-languagedetector-tests.ts | 2 - .../i18next-xhr-backend-tests.ts | 3 - ibm-mobilefirst/ibm-mobilefirst-tests.ts | 4 +- .../imagemagick-native-tests.ts | 3 - imagemagick/imagemagick-tests.ts | 3 - jasmine-expect/jasmine-expect-tests.ts | 3 - jasmine-jquery/jasmine-jquery-tests.ts | 4 - jasmine-matchers/jasmine-matchers-tests.ts | 3 - joi/v6/joi-tests.ts | 1 - jqgrid/jqgrid-tests.ts | 2 - jqrangeslider/jqrangeslider-tests.ts | 6 +- jquery-ajax-chain/jquery-ajax-chain-tests.ts | 5 +- jquery-alertable/jquery-alertable-tests.ts | 3 - .../jquery-backstretch-tests.ts | 2 - jquery-cropbox/jquery-cropbox-tests.ts | 8 +- .../jquery-easy-loading-tests.ts | 3 - .../jquery-handsontable-tests.ts | 3 - .../jquery-jsonrpcclient-tests.ts | 2 - jquery-mockjax/jquery-mockjax-tests.ts | 1 - jquery-steps/index.d.ts | 5 +- jquery-steps/jquery-steps-tests.ts | 3 - jquery-timeentry/jquery-timeentry-tests.ts | 2 - jquery-urlparam/jquery-urlparam-tests.ts | 3 - jquery.ajaxfile/jquery.ajaxfile-tests.ts | 4 - .../jquery.are-you-sure-tests.ts | 7 - jquery.base64/jquery.base64-tests.ts | 3 - jquery.cleditor/jquery.cleditor-tests.ts | 2 - jquery.color/jquery.color-tests.ts | 2 - jquery.colorbox/jquery.colorbox-tests.ts | 2 - jquery.cookie/jquery.cookie-tests.ts | 2 - .../jquery.customselect-tests.ts | 3 - jquery.cycle/jquery.cycle-tests.ts | 8 +- jquery.cycle2/jquery.cycle2-tests.ts | 2 - jquery.finger/jquery.finger-tests.ts | 2 - jquery.flagstrap/jquery.flagstrap-tests.ts | 15 +- jquery.form/jquery.form-tests.ts | 152 ++++++++------- jquery.jnotify/jquery.jnotify-tests.ts | 2 - jquery.joyride/jquery.joyride-tests.ts | 3 - jquery.jsignature/jquery.jsignature-tests.ts | 6 +- jquery.leanmodal/jquery.leanmodal-tests.ts | 3 - .../jquery.livestampjs-tests.ts | 1 - jquery.menuaim/jquery.menuaim-tests.ts | 2 - jquery.mmenu/jquery.mmenu-tests.ts | 4 - jquery.payment/index.d.ts | 2 + jquery.payment/jquery.payment-tests.ts | 3 - .../jquery.pjax.falsandtru-tests.ts | 3 - jquery.pjax/jquery.pjax-tests.ts | 3 - .../jquery.placeholder-tests.ts | 2 - jquery.pnotify/jquery.pnotify-tests.ts | 3 - .../jquery.prettyphoto-tests.ts | 5 - jquery.qrcode/jquery.qrcode-tests.ts | 2 - jquery.rowgrid/jquery.rowgrid-tests.ts | 6 +- jquery.scrollto/jquery.scrollto-tests.ts | 2 - .../jquery.simplemodal-tests.ts | 2 - .../jquery.simplepagination-tests.ts | 2 - jquery.slimscroll/jquery.slimscroll-tests.ts | 2 - .../jquery.tagsmanager-tests.ts | 3 - jquery.timeago/jquery.timeago-tests.ts | 2 - jquery.timepicker/jquery.timepicker-tests.ts | 2 - jquery.timer/jquery.timer-tests.ts | 51 +++-- jquery.tipsy/jquery.tipsy-tests.ts | 2 - jquery.tools/jquery.tools-tests.ts | 2 - .../jquery.total-storage-tests.ts | 7 - jquery.transit/jquery.transit-tests.ts | 2 - .../jquery.ui.datetimepicker-tests.ts | 5 +- jquery.validation/jquery.validation-tests.ts | 5 +- jquery.watermark/jquery.watermark-tests.ts | 2 - jquery.window/jquery.window-tests.ts | 8 +- jquerymobile/jquerymobile-tests.ts | 3 - jqueryui/jqueryui-tests.ts | 3 - jsonwebtoken/jsonwebtoken-tests.ts | 12 +- jsrender/jsrender-tests.ts | 2 - jsx-chai/jsx-chai-tests.ts | 2 - kendo-ui/kendo-ui-tests.ts | 3 - klaw/klaw-tests.ts | 3 - .../knockout-amd-helpers-tests.ts | 3 - .../knockout-transformations-tests.ts | 3 - knockout.kogrid/knockout.kogrid-tests.ts | 52 +++-- knockout.mapping/knockout.mapping-tests.ts | 3 - .../knockout.projections-tests.ts | 5 - knockout.punches/knockout.punches-tests.ts | 3 - knockstrap/knockstrap-tests.ts | 6 - ko.plus/ko.plus-tests.ts | 29 +-- koa-logger/koa-logger-tests.ts | 2 - kolite/kolite-tests.ts | 3 - kue/kue-tests.ts | 2 - leaflet-curve/leaflet-curve-tests.ts | 2 - leaflet-draw/leaflet-draw-tests.ts | 2 - libpq/libpq-tests.ts | 1 - magicsuggest/magicsuggest-tests.ts | 2 - mailcheck/mailcheck-tests.ts | 2 - markitup/markitup-tests.ts | 3 - maskedinput/maskedinput-tests.ts | 7 - material-ui/material-ui-tests.tsx | 5 - mcustomscrollbar/mcustomscrollbar-tests.ts | 3 - md5/md5-tests.ts | 10 +- meteor-roles/meteor-roles-tests.ts | 3 - metismenu/metismenu-tests.ts | 2 - mssql/mssql-tests.ts | 2 - mu2/mu2-tests.ts | 3 - multiparty/multiparty-tests.ts | 2 - mz/mz-tests.ts | 3 - n3/n3-tests.ts | 4 +- ng-command/ng-command-tests.ts | 2 - ng-dialog/ng-dialog-tests.ts | 1 - ng-grid/ng-grid-tests.ts | 2 - ng-notify/ng-notify-tests.ts | 2 - ngprogress-lite/ngprogress-lite-tests.ts | 3 - node-hue-api/node-hue-api-tests.ts | 2 - node-int64/node-int64-tests.ts | 4 - .../node-mysql-wrapper-tests.ts | 4 - nouislider/v7/nouislider-tests.ts | 3 - npm/npm-tests.ts | 3 - on-finished/on-finished-tests.ts | 2 - onoff/onoff-tests.ts | 2 - openui5/openui5-tests.ts | 4 - oracledb/oracledb-tests.ts | 2 - owlcarousel/owlcarousel-tests.ts | 3 - passport-beam/passport-beam-tests.ts | 2 - passport-http/passport-http-tests.ts | 2 - paymentrequest/paymentrequest-tests.ts | 2 - peerjs/peerjs-tests.ts | 2 - phantomcss/index.d.ts | 2 +- phantomcss/phantomcss-tests.ts | 10 +- phonon/phonon-tests.ts | 2 - piwik-tracker/piwik-tracker-tests.ts | 20 +- pkcs11js/pkcs11js-tests.ts | 2 - pouchdb-find/pouchdb-find-tests.ts | 2 - .../pouchdb-replication-tests.ts | 2 - project-oxford/project-oxford-tests.ts | 3 - promised-temp/promised-temp-tests.ts | 3 - promptly/promptly-tests.ts | 2 - radius/radius-tests.ts | 3 - rangyinputs/rangyinputs-tests.ts | 2 - raty/raty-tests.ts | 4 - rc-select/rc-select-tests.ts | 9 +- react-bootstrap/react-bootstrap-tests.tsx | 6 - react-datagrid/react-datagrid-tests.tsx | 3 - .../react-dnd-html5-backend-tests.ts | 2 - react-dnd/UNUSED_FILES.txt | 1 - react-dnd/react-dnd-test-backend.d.ts | 20 -- react-dnd/react-dnd-tests.ts | 15 +- react-dropzone/react-dropzone-tests.tsx | 2 - react-helmet/react-helmet-tests.tsx | 3 - react-infinite/react-infinite-tests.tsx | 3 - .../react-input-calendar-tests.tsx | 3 - react-intl/react-intl-tests.tsx | 2 - react-intl/v1/react-intl-tests.tsx | 2 - react-mixin/react-mixin-tests.tsx | 3 - react-native/test/animated.tsx | 2 - react-native/test/index.tsx | 11 +- .../react-onclickoutside-tests.tsx | 5 - .../react-props-decorators-tests.ts | 3 - .../react-router-bootstrap-tests.tsx | 10 +- react-scroll/react-scroll-tests.tsx | 2 - react-spinkit/react-spinkit-tests.tsx | 3 - react-tabs/react-tabs-tests.ts | 4 - react-tagcloud/react-tagcloud-tests.tsx | 5 - react-widgets/react-widgets-tests.tsx | 9 +- readdir-stream/readdir-stream-tests.ts | 3 - redux-debounced/redux-debounced-tests.ts | 2 - .../redux-devtools-dock-monitor-tests.tsx | 2 - .../redux-devtools-log-monitor-tests.tsx | 2 - redux-devtools/redux-devtools-tests.tsx | 3 - resolve/resolve-tests.ts | 2 - rx.wamp/rx.wamp-tests.ts | 3 - s3-upload-stream/s3-upload-stream-tests.ts | 3 - sax/sax-tests.ts | 2 - seamless/seamless-tests.ts | 2 - select2/select2-tests.ts | 3 - selectize/selectize-tests.ts | 3 - shelljs/shelljs-tests.ts | 6 - sinon-as-promised/sinon-as-promised-tests.ts | 2 - sinon-mongoose/sinon-mongoose-tests.ts | 2 - slick-carousel/slick-carousel-tests.ts | 4 - slickgrid/test/index.ts | 3 - socket.io-redis/socket.io-redis-tests.ts | 2 - socket.io.users/socket.io.users-tests.ts | 4 - source-list-map/source-list-map-tests.ts | 1 - spectrum/spectrum-tests.ts | 3 - split/split-tests.ts | 3 - sql.js/sql.js-tests.ts | 3 - ss-utils/ss-utils-tests.ts | 15 +- static-eval/static-eval-tests.ts | 2 - stream-to-array/stream-to-array-tests.ts | 3 - stylus/stylus-tests.ts | 10 +- superagent/superagent-tests.ts | 3 - .../supertest-as-promised-tests.ts | 6 +- tapable/tapable-tests.ts | 2 - tape/tape-tests.ts | 3 - tar/tar-tests.ts | 2 - tether-drop/tether-drop-tests.ts | 1 - .../test/canvas/canvas_camera_orthographic.ts | 3 - three/test/canvas/canvas_geometry_cube.ts | 3 - .../canvas/canvas_interactive_cubes_tween.ts | 2 - .../test/canvas/canvas_lights_pointlights.ts | 3 - three/test/canvas/canvas_materials.ts | 3 - three/test/canvas/canvas_particles_floor.ts | 3 - three/test/css3d/css3d_periodictable.ts | 2 - three/test/css3d/css3d_sprites.ts | 2 - three/test/examples/controls/vrcontrols.ts | 2 - three/test/examples/ctm/ctmloader.ts | 2 - three/test/examples/detector.ts | 4 - three/test/examples/effects/vreffect.ts | 2 - three/test/examples/octree.ts | 2 - three/test/math/test_unit_math.ts | 3 - three/test/webgl/webgl_animation_cloth.ts | 3 - .../webgl/webgl_animation_skinning_morph.ts | 3 - three/test/webgl/webgl_buffergeometry.ts | 3 - three/test/webgl/webgl_camera.ts | 3 - three/test/webgl/webgl_custom_attributes.ts | 3 - three/test/webgl/webgl_geometries.ts | 3 - three/test/webgl/webgl_helpers.ts | 3 - three/test/webgl/webgl_interactive_cubes.ts | 3 - .../webgl_interactive_raycasting_points.ts | 3 - three/test/webgl/webgl_lensflares.ts | 3 - three/test/webgl/webgl_lights_hemisphere.ts | 3 - three/test/webgl/webgl_lines_colors.ts | 3 - three/test/webgl/webgl_loader_awd.ts | 3 - three/test/webgl/webgl_materials.ts | 3 - three/test/webgl/webgl_morphtargets.ts | 3 - three/test/webgl/webgl_points_billboards.ts | 3 - three/test/webgl/webgl_postprocessing.ts | 3 - three/test/webgl/webgl_shader.ts | 3 - three/test/webgl/webgl_sprites.ts | 3 - through2/through2-tests.ts | 3 - through2/v0/through2-tests.ts | 3 - typeahead/typeahead-tests.ts | 2 - uuid-1345/uuid-1345-tests.ts | 3 - valerie/valerie-tests.ts | 12 -- validator/validator-tests.ts | 3 - vex-js/vex-js-tests.ts | 1 - vinyl/vinyl-tests.ts | 4 - voronoi-diagram/voronoi-diagram-tests.ts | 2 - wake_on_lan/wake_on_lan-tests.ts | 3 - webgme/webgme-tests.ts | 72 ++++--- webpack-sources/webpack-sources-tests.ts | 2 - x-editable/x-editable-tests.ts | 7 - xmlpoke/xmlpoke-tests.ts | 4 - xrm/v7/xrm-tests.ts | 2 - 358 files changed, 392 insertions(+), 1381 deletions(-) delete mode 100644 react-dnd/UNUSED_FILES.txt delete mode 100644 react-dnd/react-dnd-test-backend.d.ts diff --git a/acorn/acorn-tests.ts b/acorn/acorn-tests.ts index bda6844c84..72ca71d2f6 100644 --- a/acorn/acorn-tests.ts +++ b/acorn/acorn-tests.ts @@ -1,5 +1,3 @@ -/// - import acorn = require('acorn'); import * as ESTree from 'estree'; diff --git a/amplify/amplify-tests.ts b/amplify/amplify-tests.ts index edf2988122..b4f98ccd5b 100644 --- a/amplify/amplify-tests.ts +++ b/amplify/amplify-tests.ts @@ -1,6 +1,3 @@ - -/// - import amplify = require("amplify"); // Copied examples directly from AmplifyJs site diff --git a/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts b/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts index 4ff5b4cf19..1efc5d0391 100644 --- a/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts +++ b/angular-bootstrap-calendar/angular-bootstrap-calendar-tests.ts @@ -1,6 +1,3 @@ -/// -/// - var myApp = angular.module('testModule'); interface MyAppScope extends ng.IScope { diff --git a/angular-feature-flags/angular-feature-flags-tests.ts b/angular-feature-flags/angular-feature-flags-tests.ts index 8ca17e4962..ac956dd657 100644 --- a/angular-feature-flags/angular-feature-flags-tests.ts +++ b/angular-feature-flags/angular-feature-flags-tests.ts @@ -1,5 +1,3 @@ -/// - import * as angular from "angular"; let myApp = angular.module('myApp', ['feature-flags']); diff --git a/angular-hotkeys/angular-hotkeys-tests.ts b/angular-hotkeys/angular-hotkeys-tests.ts index 1f87ecefdf..c0bd9b974d 100644 --- a/angular-hotkeys/angular-hotkeys-tests.ts +++ b/angular-hotkeys/angular-hotkeys-tests.ts @@ -1,5 +1,3 @@ -/// - var scope: ng.IScope; var hotkeyProvider: ng.hotkeys.HotkeysProvider; var hotkeyObj: ng.hotkeys.Hotkey; diff --git a/angular-jwt/angular-jwt-tests.ts b/angular-jwt/angular-jwt-tests.ts index b20b2eea9d..88b177ba74 100644 --- a/angular-jwt/angular-jwt-tests.ts +++ b/angular-jwt/angular-jwt-tests.ts @@ -1,5 +1,3 @@ -/// - var app = angular.module("angular-jwt-tests", ["angular-jwt"]); var $jwtHelper: ng.jwt.IJwtHelper; diff --git a/angular-modal/angular-modal-tests.ts b/angular-modal/angular-modal-tests.ts index 5be313840b..edb4d7e6ef 100644 --- a/angular-modal/angular-modal-tests.ts +++ b/angular-modal/angular-modal-tests.ts @@ -1,5 +1,3 @@ -/// - var btfModal: angularModal.AngularModalFactory; // Using template URL diff --git a/archiver/archiver-tests.ts b/archiver/archiver-tests.ts index d79b29f079..f186fb9bcb 100644 --- a/archiver/archiver-tests.ts +++ b/archiver/archiver-tests.ts @@ -1,6 +1,3 @@ - -/// - import Archiver = require('archiver'); import FS = require('fs'); diff --git a/atom/atom-tests.ts b/atom/atom-tests.ts index 37b2fb314c..1b141fb492 100644 --- a/atom/atom-tests.ts +++ b/atom/atom-tests.ts @@ -1,5 +1,4 @@ /// -/// import path = require("path"); import _atom = require("atom"); diff --git a/auth0/auth0-tests.ts b/auth0/auth0-tests.ts index 502a72eec1..24a4aad87d 100644 --- a/auth0/auth0-tests.ts +++ b/auth0/auth0-tests.ts @@ -1,5 +1,3 @@ -/// - import * as auth0 from 'auth0'; const management = new auth0.ManagementClient({ diff --git a/autosize/autosize-tests.ts b/autosize/autosize-tests.ts index a7eea57a62..fa0988be24 100644 --- a/autosize/autosize-tests.ts +++ b/autosize/autosize-tests.ts @@ -1,5 +1,3 @@ -/// - // from a NodeList autosize(document.querySelectorAll('textarea')); diff --git a/aws-lambda/aws-lambda-tests.ts b/aws-lambda/aws-lambda-tests.ts index fb09beda8a..7b0fe45180 100644 --- a/aws-lambda/aws-lambda-tests.ts +++ b/aws-lambda/aws-lambda-tests.ts @@ -1,5 +1,3 @@ -/// - var str: string = "any string"; var date: Date = new Date(); var anyObj: any = { abc: 123 }; diff --git a/babel-template/babel-template-tests.ts b/babel-template/babel-template-tests.ts index b5d4547188..31e3bd44d9 100644 --- a/babel-template/babel-template-tests.ts +++ b/babel-template/babel-template-tests.ts @@ -1,7 +1,4 @@ - /// -/// - // Example from https://github.com/babel/babel/tree/master/packages/babel-template import template = require('babel-template'); diff --git a/babel-traverse/babel-traverse-tests.ts b/babel-traverse/babel-traverse-tests.ts index 3779852c5f..98afbbc0a7 100644 --- a/babel-traverse/babel-traverse-tests.ts +++ b/babel-traverse/babel-traverse-tests.ts @@ -1,5 +1,3 @@ - -/// /// diff --git a/babylon/babylon-tests.ts b/babylon/babylon-tests.ts index bb95625935..769d635e89 100644 --- a/babylon/babylon-tests.ts +++ b/babylon/babylon-tests.ts @@ -1,8 +1,3 @@ - -/// -/// - - // Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babylon import * as babylon from "babylon"; declare function assert(expr: boolean): void; diff --git a/backbone.layoutmanager/backbone.layoutmanager-tests.ts b/backbone.layoutmanager/backbone.layoutmanager-tests.ts index fe11ce9b18..edddb8352b 100644 --- a/backbone.layoutmanager/backbone.layoutmanager-tests.ts +++ b/backbone.layoutmanager/backbone.layoutmanager-tests.ts @@ -1,5 +1,3 @@ -/// - import * as Backbone from 'backbone'; // Example code. @@ -26,7 +24,7 @@ class View extends Backbone.Layout { "mouseleave": "removeElement" } } - + wrapElement(): void { this.$el.wrap(""); } diff --git a/backbone/backbone-tests.ts b/backbone/backbone-tests.ts index accdb93979..c074ac57e5 100644 --- a/backbone/backbone-tests.ts +++ b/backbone/backbone-tests.ts @@ -1,5 +1,3 @@ -/// - function test_events() { var object = new Backbone.Events(); diff --git a/bardjs/bardjs-tests.ts b/bardjs/bardjs-tests.ts index 2d312634ca..91172b7255 100644 --- a/bardjs/bardjs-tests.ts +++ b/bardjs/bardjs-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as angular from 'angular'; import 'angular-mocks'; diff --git a/batch-stream/batch-stream-tests.ts b/batch-stream/batch-stream-tests.ts index d3195466e8..4554530072 100644 --- a/batch-stream/batch-stream-tests.ts +++ b/batch-stream/batch-stream-tests.ts @@ -1,5 +1,3 @@ -/// - import fs = require('fs'); import BatchStream = require('batch-stream'); diff --git a/bazinga-translator/bazinga-translator-tests.ts b/bazinga-translator/bazinga-translator-tests.ts index 8c5d1dafa8..3856ff22a1 100644 --- a/bazinga-translator/bazinga-translator-tests.ts +++ b/bazinga-translator/bazinga-translator-tests.ts @@ -1,5 +1,3 @@ -/// - Translator.fallback = 'en'; Translator.defaultDomain = 'messages'; diff --git a/bezier-js/bezier-js-tests.ts b/bezier-js/bezier-js-tests.ts index f5fba4d947..003b6e1c45 100644 --- a/bezier-js/bezier-js-tests.ts +++ b/bezier-js/bezier-js-tests.ts @@ -1,5 +1,3 @@ -/// - function test() { var bezierjs: typeof BezierJs; diff --git a/bingmaps/bingmaps-tests.ts b/bingmaps/bingmaps-tests.ts index 239e33094a..e83ff89aba 100644 --- a/bingmaps/bingmaps-tests.ts +++ b/bingmaps/bingmaps-tests.ts @@ -1,10 +1,3 @@ -/// -/// -/// -/// -/// -/// - namespace BingMapsTests { // An interactive set of Bing Maps AJAX control usages can be found at http://www.bingmapsportal.com/isdk/ajaxv7 diff --git a/bit-array/bit-array-tests.ts b/bit-array/bit-array-tests.ts index 7c1ff57b1b..7d50de143c 100644 --- a/bit-array/bit-array-tests.ts +++ b/bit-array/bit-array-tests.ts @@ -1,5 +1,3 @@ -/// - import BitArray = require("bit-array"); const a = new BitArray(32); diff --git a/blob-stream/blob-stream-tests.ts b/blob-stream/blob-stream-tests.ts index b9174859f9..40f9888788 100644 --- a/blob-stream/blob-stream-tests.ts +++ b/blob-stream/blob-stream-tests.ts @@ -1,6 +1,3 @@ - -/// - var bl = require('blob-stream'); var blob = bl.toBlob(); diff --git a/blue-tape/blue-tape-tests.ts b/blue-tape/blue-tape-tests.ts index 92b2641115..c34bc6e32c 100644 --- a/blue-tape/blue-tape-tests.ts +++ b/blue-tape/blue-tape-tests.ts @@ -1,4 +1,3 @@ -/// /// import tape = require('blue-tape'); diff --git a/bluebird-retry/bluebird-retry-tests.ts b/bluebird-retry/bluebird-retry-tests.ts index b63b360160..eb3260a007 100644 --- a/bluebird-retry/bluebird-retry-tests.ts +++ b/bluebird-retry/bluebird-retry-tests.ts @@ -1,5 +1,3 @@ - -/// import Promise = require('bluebird'); import retry = require('bluebird-retry'); diff --git a/bootpag/bootpag-tests.ts b/bootpag/bootpag-tests.ts index 6a5503f9f8..a0a2a78cc3 100644 --- a/bootpag/bootpag-tests.ts +++ b/bootpag/bootpag-tests.ts @@ -1,5 +1,3 @@ -/// - var pagerSelector = ".bootpager"; var $pager = $(pagerSelector); diff --git a/bootstrap-datepicker/bootstrap-datepicker-tests.ts b/bootstrap-datepicker/bootstrap-datepicker-tests.ts index cedc28c93c..372967ec21 100644 --- a/bootstrap-datepicker/bootstrap-datepicker-tests.ts +++ b/bootstrap-datepicker/bootstrap-datepicker-tests.ts @@ -1,4 +1,3 @@ -/// function tests_simple() { $('#datepicker').datepicker(); $('#datepicker').datepicker({ diff --git a/bootstrap-maxlength/bootstrap-maxlength-tests.ts b/bootstrap-maxlength/bootstrap-maxlength-tests.ts index 32255bc66b..92c3f1b57e 100644 --- a/bootstrap-maxlength/bootstrap-maxlength-tests.ts +++ b/bootstrap-maxlength/bootstrap-maxlength-tests.ts @@ -1,5 +1,3 @@ -/// - // Examples from the projects github page $('input[maxlength]').maxlength(); diff --git a/bootstrap-notify/bootstrap-notify-tests.ts b/bootstrap-notify/bootstrap-notify-tests.ts index 5ae4f2ffc1..2977d39abf 100644 --- a/bootstrap-notify/bootstrap-notify-tests.ts +++ b/bootstrap-notify/bootstrap-notify-tests.ts @@ -1,6 +1,3 @@ - -/// - //Test for bootstrap-notify v3.1.3 //Copied example directly from Bootstrap-notify site diff --git a/bootstrap-select/bootstrap-select-tests.ts b/bootstrap-select/bootstrap-select-tests.ts index e2e8c88560..55900b3ab7 100644 --- a/bootstrap-select/bootstrap-select-tests.ts +++ b/bootstrap-select/bootstrap-select-tests.ts @@ -1,5 +1,3 @@ -/// - $(".selectpicker").selectpicker({ actionsBox: true, container: "body", diff --git a/bootstrap-slider/bootstrap-slider-tests.ts b/bootstrap-slider/bootstrap-slider-tests.ts index 98701cedc3..df143d4c72 100644 --- a/bootstrap-slider/bootstrap-slider-tests.ts +++ b/bootstrap-slider/bootstrap-slider-tests.ts @@ -1,6 +1,3 @@ -/// - - $(function() { // examples from http://seiyria.github.io/bootstrap-slider/ diff --git a/bootstrap-switch/bootstrap-switch-tests.ts b/bootstrap-switch/bootstrap-switch-tests.ts index 539399a78e..65fafff2e9 100644 --- a/bootstrap-switch/bootstrap-switch-tests.ts +++ b/bootstrap-switch/bootstrap-switch-tests.ts @@ -1,9 +1,6 @@ -/// - - function test_cases() { $('#switch').bootstrapSwitch(); - + $('#switch').bootstrapSwitch({ state: false }); @@ -15,7 +12,7 @@ function test_cases() { //var mySwitch = $('#switch').get(0); //mySwitch.toggleAnimate(); - + $('#switch').bootstrapSwitch('state', true, true); $('#switch').bootstrapSwitch('state') === true; diff --git a/bootstrap-touchspin/bootstrap-touchspin-tests.ts b/bootstrap-touchspin/bootstrap-touchspin-tests.ts index c8a6a713f9..7d1ea73437 100644 --- a/bootstrap-touchspin/bootstrap-touchspin-tests.ts +++ b/bootstrap-touchspin/bootstrap-touchspin-tests.ts @@ -1,6 +1,3 @@ -/// - - $(function () { // Example 1 from http://www.virtuosoft.eu/code/bootstrap-touchspin/ $("input[name='demo1']").TouchSpin({ @@ -26,7 +23,7 @@ $(function () { $("input[name='demo_vertical']").TouchSpin({ verticalbuttons: true }); - + // Example 4 from http://www.virtuosoft.eu/code/bootstrap-touchspin/ $("input[name='demo_vertical2']").TouchSpin({ verticalbuttons: true, diff --git a/bootstrap-validator/bootstrap-validator-tests.ts b/bootstrap-validator/bootstrap-validator-tests.ts index 07d4753ed1..e43a094184 100644 --- a/bootstrap-validator/bootstrap-validator-tests.ts +++ b/bootstrap-validator/bootstrap-validator-tests.ts @@ -1,5 +1,3 @@ -/// - $('#myForm').validator(); $('#myForm').validator('update'); $('#myForm').validator('validate'); diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts index 3373bdb9e8..575f72b7cb 100644 --- a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts +++ b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts @@ -1,5 +1,3 @@ -/// - import * as moment from "moment"; const dp = $("#picker").datetimepicker().data("DateTimePicker"); diff --git a/bootstrap/bootstrap-tests.ts b/bootstrap/bootstrap-tests.ts index cef85d5d42..cd786b41a7 100644 --- a/bootstrap/bootstrap-tests.ts +++ b/bootstrap/bootstrap-tests.ts @@ -1,6 +1,3 @@ -/// - - $('body').off('.data-api'); $('body').off('.alert.data-api'); diff --git a/browser-resolve/browser-resolve-tests.ts b/browser-resolve/browser-resolve-tests.ts index 2225f7754c..7d08de726f 100644 --- a/browser-resolve/browser-resolve-tests.ts +++ b/browser-resolve/browser-resolve-tests.ts @@ -1,5 +1,3 @@ -/// - import * as browserResolve from 'browser-resolve'; function basic_test_async(callback: (err?: Error, resolved?: string) => void) { diff --git a/business-rules-engine/business-rules-engine-tests.ts b/business-rules-engine/business-rules-engine-tests.ts index 3ffbe2948c..4ae31155f2 100644 --- a/business-rules-engine/business-rules-engine-tests.ts +++ b/business-rules-engine/business-rules-engine-tests.ts @@ -1,4 +1,3 @@ -/// import * as Validators from 'business-rules-engine/node-validators'; import Validation = require("business-rules-engine"); diff --git a/cachefactory/cachefactory-tests.ts b/cachefactory/cachefactory-tests.ts index 73397dd8bf..32eeb63257 100644 --- a/cachefactory/cachefactory-tests.ts +++ b/cachefactory/cachefactory-tests.ts @@ -1,5 +1,3 @@ -/// - CacheFactory.get('test'); CacheFactory.createCache('test', { diff --git a/cal-heatmap/cal-heatmap-tests.ts b/cal-heatmap/cal-heatmap-tests.ts index 47020b811c..ff0e3c0d06 100644 --- a/cal-heatmap/cal-heatmap-tests.ts +++ b/cal-heatmap/cal-heatmap-tests.ts @@ -1,6 +1,4 @@ - /// -/// var cal = new CalHeatMap(); cal.init(); diff --git a/cassandra-driver/cassandra-driver-tests.ts b/cassandra-driver/cassandra-driver-tests.ts index 9feee249ac..e5d8f2ab60 100644 --- a/cassandra-driver/cassandra-driver-tests.ts +++ b/cassandra-driver/cassandra-driver-tests.ts @@ -1,5 +1,3 @@ -/// - import * as cassandra from 'cassandra-driver'; import * as util from 'util'; diff --git a/cbor/cbor-tests.ts b/cbor/cbor-tests.ts index e1a7abb9cf..eb84201b97 100644 --- a/cbor/cbor-tests.ts +++ b/cbor/cbor-tests.ts @@ -1,5 +1,3 @@ -/// - import cbor = require('cbor'); import assert = require('assert'); import fs = require('fs'); diff --git a/chai-as-promised/chai-as-promised-tests.ts b/chai-as-promised/chai-as-promised-tests.ts index 7e22c575aa..d9f681769b 100644 --- a/chai-as-promised/chai-as-promised-tests.ts +++ b/chai-as-promised/chai-as-promised-tests.ts @@ -1,5 +1,3 @@ -/// - import chai = require('chai'); import chaiAsPromised = require('chai-as-promised'); import Q = require('q'); diff --git a/chai-enzyme/chai-enzyme-tests.tsx b/chai-enzyme/chai-enzyme-tests.tsx index a75e99c756..8fc64e2711 100644 --- a/chai-enzyme/chai-enzyme-tests.tsx +++ b/chai-enzyme/chai-enzyme-tests.tsx @@ -1,7 +1,3 @@ -/// -/// -/// - import * as React from "react"; import * as chaiEnzyme from "chai-enzyme"; import { expect } from "chai"; diff --git a/chai-spies/chai-spies-tests.ts b/chai-spies/chai-spies-tests.ts index 7ac0610e4d..326b1e0137 100644 --- a/chai-spies/chai-spies-tests.ts +++ b/chai-spies/chai-spies-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as chai from 'chai'; import * as spies from 'chai-spies'; import * as Mocha from 'mocha'; diff --git a/chocolatechipjs/chocolatechipjs-tests.ts b/chocolatechipjs/chocolatechipjs-tests.ts index 465ea2b0a9..7036358aed 100644 --- a/chocolatechipjs/chocolatechipjs-tests.ts +++ b/chocolatechipjs/chocolatechipjs-tests.ts @@ -1,4 +1,3 @@ -/// // ChocolateChipStatic -- DOM creation, etc. $(function() { alert('Ready to do stuff!'); @@ -282,7 +281,7 @@ fetch('../controllers/php-post.php', { }, body: formData }) -.then($.json) +.then($.json) .then(function(data: any): any { if(data.email_check == "valid"){ $("#message_ajax").html("

    " + data.email + " is a valid e-mail address. Thank you, " + data.name + ".
    "); @@ -300,12 +299,12 @@ interface putData { var putData = $('#fileText').val(); fetch('../controllers/php-put.php', { method: 'put', - headers: { - "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" + headers: { + "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" }, body: putData }) -.then($.json) +.then($.json) .then(function(data:any): any { console.dir(data.base); $("#message_ajax").append('

    ' + data.result + '

    '); @@ -324,12 +323,12 @@ interface deleteData { var file = $('#fileName').val(); fetch('../controllers/php-delete.php', { method: 'delete', - headers: { - "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" + headers: { + "Content-type": "application/x-www-form-urlencoded; charset=UTF-8" }, body: file }) -.then($.json) +.then($.json) .then(function(data: any): any { $("#message_ajax").html("
    DELETE was sent to the server successfully.
    "); $("#message_ajax").append('

    ' + data.result + '

    '); diff --git a/cliff/cliff-tests.ts b/cliff/cliff-tests.ts index 9217d9a38a..e69de29bb2 100644 --- a/cliff/cliff-tests.ts +++ b/cliff/cliff-tests.ts @@ -1 +0,0 @@ -/// \ No newline at end of file diff --git a/co-body/co-body-tests.ts b/co-body/co-body-tests.ts index 6011632399..944cadd394 100644 --- a/co-body/co-body-tests.ts +++ b/co-body/co-body-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as koa from 'koa'; import * as parse from 'co-body'; diff --git a/coinstring/coinstring-tests.ts b/coinstring/coinstring-tests.ts index ab11a44fb7..1cc3fb9a42 100644 --- a/coinstring/coinstring-tests.ts +++ b/coinstring/coinstring-tests.ts @@ -1,8 +1,5 @@ -/// - import cs = require('coinstring'); - var privateKeyHex = "1184cd2cdd640ca42cfc3a091c51d549b2f016d454b2774019c2b2d2e08529fd"; var privateKeyHexBuf = new Buffer(privateKeyHex, 'hex'); var version = 0x80; // Bitcoin private key diff --git a/connect-redis/connect-redis-tests.ts b/connect-redis/connect-redis-tests.ts index ed21f3b4be..3c50074117 100644 --- a/connect-redis/connect-redis-tests.ts +++ b/connect-redis/connect-redis-tests.ts @@ -1,5 +1,3 @@ -/// - import * as connectRedis from "connect-redis"; import * as session from "express-session"; diff --git a/cookies/cookies-tests.ts b/cookies/cookies-tests.ts index 30e07d3000..5a2ad1e4a7 100644 --- a/cookies/cookies-tests.ts +++ b/cookies/cookies-tests.ts @@ -1,5 +1,3 @@ -/// - import * as Cookies from 'cookies'; import * as http from 'http'; diff --git a/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts b/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts index 4dafa2e966..1c62521293 100644 --- a/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts +++ b/cordova-plugin-battery-status/cordova-plugin-battery-status-tests.ts @@ -1,5 +1,3 @@ -/// - window.addEventListener('batterystatus', (ev: BatteryStatusEvent) => { console.log('Battery level is ' + ev.level); }); diff --git a/cordova-plugin-camera/cordova-plugin-camera-tests.ts b/cordova-plugin-camera/cordova-plugin-camera-tests.ts index 00edf02b0a..2f1b661775 100644 --- a/cordova-plugin-camera/cordova-plugin-camera-tests.ts +++ b/cordova-plugin-camera/cordova-plugin-camera-tests.ts @@ -1,5 +1,3 @@ -/// - navigator.camera.getPicture( (data: string) => { alert('Got photo!'); }, (message: string)=> { alert('Failed!: ' + message); }, diff --git a/cordova-plugin-contacts/cordova-plugin-contacts-tests.ts b/cordova-plugin-contacts/cordova-plugin-contacts-tests.ts index c50912c3ba..26243ab43a 100644 --- a/cordova-plugin-contacts/cordova-plugin-contacts-tests.ts +++ b/cordova-plugin-contacts/cordova-plugin-contacts-tests.ts @@ -1,5 +1,3 @@ -/// - var contact: Contact = navigator.contacts.create({ nickname: 'John Smith', displayName: 'John Smith', diff --git a/cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts b/cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts index 17b1e49930..1b335beaf7 100644 --- a/cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts +++ b/cordova-plugin-device-motion/cordova-plugin-device-motion-tests.ts @@ -1,5 +1,3 @@ -/// - navigator.accelerometer.getCurrentAcceleration( (acc: Acceleration) => { console.log('X: ' + acc.x + 'Y: ' + acc.y + 'Z: ' + acc.z); }, () => { alert('Error!'); }); diff --git a/cordova-plugin-device-orientation/cordova-plugin-device-orientation-tests.ts b/cordova-plugin-device-orientation/cordova-plugin-device-orientation-tests.ts index 097a66e99e..ab025d5fbf 100644 --- a/cordova-plugin-device-orientation/cordova-plugin-device-orientation-tests.ts +++ b/cordova-plugin-device-orientation/cordova-plugin-device-orientation-tests.ts @@ -1,5 +1,3 @@ -/// - navigator.compass.getCurrentHeading( (heading: CompassHeading)=> { console.log('Got heading to ' + heading.magneticHeading); }, (error: CompassError)=> { alert('Error! ' + error.code); }, diff --git a/cordova-plugin-device/cordova-plugin-device-tests.ts b/cordova-plugin-device/cordova-plugin-device-tests.ts index 450eadb1f0..cb894785c2 100644 --- a/cordova-plugin-device/cordova-plugin-device-tests.ts +++ b/cordova-plugin-device/cordova-plugin-device-tests.ts @@ -1,3 +1 @@ -/// - console.log(JSON.stringify(device)); \ No newline at end of file diff --git a/cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts b/cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts index dd9396f36f..498d7d1000 100644 --- a/cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts +++ b/cordova-plugin-dialogs/cordova-plugin-dialogs-tests.ts @@ -1,4 +1,2 @@ -/// - navigator.notification.alert('Alert!', () => { alert('You\'re alerted'); }, 'Alert', 'Ok'); navigator.notification.confirm('Are you ok?', (choice: number) => { alert('Your choice is ' + choice); }); diff --git a/cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts b/cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts index 4050b2c4aa..eec24db2e0 100644 --- a/cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts +++ b/cordova-plugin-file-transfer/cordova-plugin-file-transfer-tests.ts @@ -1,5 +1,3 @@ -/// - var file = new FileTransfer(); file.onprogress = (ev: ProgressEvent) => { diff --git a/cordova-plugin-file/cordova-plugin-file-tests.ts b/cordova-plugin-file/cordova-plugin-file-tests.ts index bd9d7de672..37538434e3 100644 --- a/cordova-plugin-file/cordova-plugin-file-tests.ts +++ b/cordova-plugin-file/cordova-plugin-file-tests.ts @@ -1,5 +1,4 @@ /// -/// function fsaccessor(fs: FileSystem) { console.log('FS root is: ' + fs.root.name); diff --git a/cordova-plugin-globalization/cordova-plugin-globalization-tests.ts b/cordova-plugin-globalization/cordova-plugin-globalization-tests.ts index 0a58703a32..4b80f2ff72 100644 --- a/cordova-plugin-globalization/cordova-plugin-globalization-tests.ts +++ b/cordova-plugin-globalization/cordova-plugin-globalization-tests.ts @@ -1,5 +1,3 @@ -/// - navigator.globalization.dateToString(new Date(), (date) => { console.log(JSON.stringify(date)); }, (error) => { alert(error.message); }, diff --git a/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts b/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts index 43b0d28153..cef288c921 100644 --- a/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts +++ b/cordova-plugin-inappbrowser/cordova-plugin-inappbrowser-tests.ts @@ -1,5 +1,3 @@ -/// - // InAppBrowser plugin //---------------------------------------------------------------------- diff --git a/cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts b/cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts index 3dce2776bf..767eaa6ed2 100644 --- a/cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts +++ b/cordova-plugin-keyboard/cordova-plugin-keyboard-tests.ts @@ -1,5 +1,3 @@ -/// - Keyboard.shrinkView(true); Keyboard.shrinkView(false); Keyboard.hideFormAccessoryBar(true); diff --git a/cordova-plugin-media-capture/cordova-plugin-media-capture-tests.ts b/cordova-plugin-media-capture/cordova-plugin-media-capture-tests.ts index 8bd56c714f..91fdefa74f 100644 --- a/cordova-plugin-media-capture/cordova-plugin-media-capture-tests.ts +++ b/cordova-plugin-media-capture/cordova-plugin-media-capture-tests.ts @@ -1,5 +1,3 @@ -/// - console.log('Supported audio modes are: ' + JSON.stringify(navigator.device.capture.supportedAudioModes)); navigator.device.capture.captureAudio( diff --git a/cordova-plugin-media/cordova-plugin-media-tests.ts b/cordova-plugin-media/cordova-plugin-media-tests.ts index 76e39c8d7b..1c00c850e5 100644 --- a/cordova-plugin-media/cordova-plugin-media-tests.ts +++ b/cordova-plugin-media/cordova-plugin-media-tests.ts @@ -1,5 +1,3 @@ -/// - // Media and Media Capture //---------------------------------------------------------------------- diff --git a/cordova-plugin-network-information/cordova-plugin-network-information-tests.ts b/cordova-plugin-network-information/cordova-plugin-network-information-tests.ts index 702aeb5714..0c4bfd7a2d 100644 --- a/cordova-plugin-network-information/cordova-plugin-network-information-tests.ts +++ b/cordova-plugin-network-information/cordova-plugin-network-information-tests.ts @@ -1,5 +1,3 @@ -/// - var connType = navigator.connection.type; if (connType == Connection.WIFI) { console.log('Congratulations, you\'re with fast Internet!'); diff --git a/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts b/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts index d24720eb1d..5938396ad4 100644 --- a/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts +++ b/cordova-plugin-splashscreen/cordova-plugin-splashscreen-tests.ts @@ -1,4 +1,2 @@ -/// - navigator.splashscreen.show(); navigator.splashscreen.hide(); \ No newline at end of file diff --git a/cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts b/cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts index 9d22ca912c..623211d6c6 100644 --- a/cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts +++ b/cordova-plugin-statusbar/cordova-plugin-statusbar-tests.ts @@ -1,6 +1,3 @@ -/// - - var statusBar: StatusBar = window.StatusBar; statusBar.overlaysWebView(true); statusBar.overlaysWebView(false); diff --git a/cordova-plugin-vibration/cordova-plugin-vibration-tests.ts b/cordova-plugin-vibration/cordova-plugin-vibration-tests.ts index b34cd23675..33cdb43436 100644 --- a/cordova-plugin-vibration/cordova-plugin-vibration-tests.ts +++ b/cordova-plugin-vibration/cordova-plugin-vibration-tests.ts @@ -1,5 +1,3 @@ -/// - var notification: Notification; notification.vibrate(100); diff --git a/cordova-plugin-websql/cordova-plugin-websql-tests.ts b/cordova-plugin-websql/cordova-plugin-websql-tests.ts index 8679b3d5c3..c6299a489c 100644 --- a/cordova-plugin-websql/cordova-plugin-websql-tests.ts +++ b/cordova-plugin-websql/cordova-plugin-websql-tests.ts @@ -1,6 +1,3 @@ -/// - - var db = window.openDatabase('Test', '0.1', 'test', 1024 * 1024 * 5); db.transaction( (tx: SqlTransaction) => { diff --git a/cryptojs/test/md5-tests.ts b/cryptojs/test/md5-tests.ts index d44496aae5..4063750d7d 100644 --- a/cryptojs/test/md5-tests.ts +++ b/cryptojs/test/md5-tests.ts @@ -1,6 +1,3 @@ -/// - - YUI.add('algo-md5-test', function (Y) { var C = CryptoJS; diff --git a/css-modules-require-hook/css-modules-require-hook-tests.ts b/css-modules-require-hook/css-modules-require-hook-tests.ts index 0e2e366f96..ea80474dc5 100644 --- a/css-modules-require-hook/css-modules-require-hook-tests.ts +++ b/css-modules-require-hook/css-modules-require-hook-tests.ts @@ -1,4 +1,3 @@ -/// /// import * as hook from 'css-modules-require-hook'; diff --git a/csv-stringify/csv-stringify-tests.ts b/csv-stringify/csv-stringify-tests.ts index bd6873affb..a05f35d368 100644 --- a/csv-stringify/csv-stringify-tests.ts +++ b/csv-stringify/csv-stringify-tests.ts @@ -1,5 +1,3 @@ -/// - import stringify = require("csv-stringify"); let stream: stringify.Stringifier; diff --git a/cybozulabs-md5/cybozulabs-md5-tests.ts b/cybozulabs-md5/cybozulabs-md5-tests.ts index 7572ed9124..2163b6e8c9 100644 --- a/cybozulabs-md5/cybozulabs-md5-tests.ts +++ b/cybozulabs-md5/cybozulabs-md5-tests.ts @@ -1,5 +1,3 @@ -/// - var hash: string; hash = CybozuLabs.MD5.calc("abc"); hash = CybozuLabs.MD5.calc("abc", CybozuLabs.MD5.BY_ASCII); diff --git a/d3.cloud.layout/d3.cloud.layout-tests.ts b/d3.cloud.layout/d3.cloud.layout-tests.ts index b2e0349cd4..862b7f0d82 100644 --- a/d3.cloud.layout/d3.cloud.layout-tests.ts +++ b/d3.cloud.layout/d3.cloud.layout-tests.ts @@ -1,42 +1,40 @@ -/// +interface ICompTextSize{ + text:string; + size:number; + x?:number; + y?:number; + rotate?:number; +} - interface ICompTextSize{ - text:string; - size:number; - x?:number; - y?:number; - rotate?:number; - } +var fill = d3.scale.category20(); +d3.layout.cloud().size([300, 300]) + .words([ + "Hello", "world", "normally", "you", "want", "more", "words", + "than", "this"].map(function(d:string) { + return {text: d, size: 10 + Math.random() * 90}; + })) + .padding(5) + .rotate(function() { return ~~(Math.random() * 2) * 90; }) + .font("Impact") + .fontSize(function(d:ICompTextSize) { return d.size; }) + .on("end", draw) + .start(); - - var fill = d3.scale.category20(); - d3.layout.cloud().size([300, 300]) - .words([ - "Hello", "world", "normally", "you", "want", "more", "words", - "than", "this"].map(function(d:string) { - return {text: d, size: 10 + Math.random() * 90}; - })) - .padding(5) - .rotate(function() { return ~~(Math.random() * 2) * 90; }) - .font("Impact") - .fontSize(function(d:ICompTextSize) { return d.size; }) - .on("end", draw) - .start(); - function draw(words:ICompTextSize[]) { - d3.select("body").append("svg") - .attr("width", 300) - .attr("height", 300) - .append("g") - .attr("transform", "translate(150,150)") - .selectAll("text") - .data(words) - .enter().append("text") - .style("font-size", function(d:ICompTextSize) { return d.size + "px"; }) - .style("font-family", "Impact") - .style("fill", function(d:ICompTextSize, i:number) { return fill(i); }) - .attr("text-anchor", "middle") - .attr("transform", function(d:ICompTextSize) { - return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; - }) - .text(function(d:ICompTextSize) { return d.text; }); - } +function draw(words:ICompTextSize[]) { + d3.select("body").append("svg") + .attr("width", 300) + .attr("height", 300) + .append("g") + .attr("transform", "translate(150,150)") + .selectAll("text") + .data(words) + .enter().append("text") + .style("font-size", function(d:ICompTextSize) { return d.size + "px"; }) + .style("font-family", "Impact") + .style("fill", function(d:ICompTextSize, i:number) { return fill(i); }) + .attr("text-anchor", "middle") + .attr("transform", function(d:ICompTextSize) { + return "translate(" + [d.x, d.y] + ")rotate(" + d.rotate + ")"; + }) + .text(function(d:ICompTextSize) { return d.text; }); +} diff --git a/d3kit/d3kit-tests.ts b/d3kit/d3kit-tests.ts index c8a447ecda..e1a92d41b9 100644 --- a/d3kit/d3kit-tests.ts +++ b/d3kit/d3kit-tests.ts @@ -1,5 +1,3 @@ -/// - function test_abstract_chart() { let el: Element, chart: d3kit.AbstractChart, @@ -86,8 +84,8 @@ function test_svgchart() { options: d3kit.ChartOptions, margins: d3kit.ChartMargin, offsets: [number, number], - svg: d3.Selection, - rootg: d3.Selection, + svg: d3.Selection, + rootg: d3.Selection, layers: d3kit.LayerOrganizer; // create a div, append to body, return Node as type Element diff --git a/d3kit/v1/d3kit-tests.ts b/d3kit/v1/d3kit-tests.ts index d49891822b..9ffb7ca2ba 100644 --- a/d3kit/v1/d3kit-tests.ts +++ b/d3kit/v1/d3kit-tests.ts @@ -1,9 +1,6 @@ -/// /// /// -/* jshint expr: true */ - var expect = chai.expect; describe('Skeleton', function(){ var element: Element, $element: d3.Selection, $svg: d3.Selection, skeleton: d3kit.Skeleton; diff --git a/datatables.net-buttons/datatables.net-buttons-tests.ts b/datatables.net-buttons/datatables.net-buttons-tests.ts index 2dcdd26ff4..6acbbeaf8a 100644 --- a/datatables.net-buttons/datatables.net-buttons-tests.ts +++ b/datatables.net-buttons/datatables.net-buttons-tests.ts @@ -1,7 +1,3 @@ -/// -/// - - $(document).ready(function () { var config: DataTables.Settings = diff --git a/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts b/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts index 949bca825c..561b968ba9 100644 --- a/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts +++ b/datatables.net-fixedheader/datatables.net-fixedheader-tests.ts @@ -1,6 +1,3 @@ -/// -/// - $(document).ready(() => { var config: DataTables.Settings = { // FixedHeader extension options diff --git a/datatables.net-select/datatables.net-select-tests.ts b/datatables.net-select/datatables.net-select-tests.ts index aa1851931c..5d8fdd8dc6 100644 --- a/datatables.net-select/datatables.net-select-tests.ts +++ b/datatables.net-select/datatables.net-select-tests.ts @@ -1,6 +1,3 @@ -/// -/// - $(document).ready(() => { var config: DataTables.Settings = { // Select extension options diff --git a/datatables.net/datatables.net-tests.ts b/datatables.net/datatables.net-tests.ts index 0134581ee1..c4a8fcaf3e 100644 --- a/datatables.net/datatables.net-tests.ts +++ b/datatables.net/datatables.net-tests.ts @@ -1,6 +1,3 @@ -/// - - $(document).ready(function () { //#region "Language" diff --git a/dw-bxslider-4/dw-bxslider-4-tests.ts b/dw-bxslider-4/dw-bxslider-4-tests.ts index e20f748a5d..57092d642f 100644 --- a/dw-bxslider-4/dw-bxslider-4-tests.ts +++ b/dw-bxslider-4/dw-bxslider-4-tests.ts @@ -1,6 +1,3 @@ -/// - - // examples from http://bxslider.com/examples $(document).ready(function() { diff --git a/dynatable/dynatable-tests.ts b/dynatable/dynatable-tests.ts index acba41092a..e727c209c1 100644 --- a/dynatable/dynatable-tests.ts +++ b/dynatable/dynatable-tests.ts @@ -1,5 +1,3 @@ -/// - // Using the global setup option // ============================= $.dynatableSetup({ features: { pushState: false }, dataset: { perPageDefault: 5, perPageOptions: [2, 5, 10] } }); diff --git a/ecurve/ecurve-tests.ts b/ecurve/ecurve-tests.ts index c2214c6905..ced84ef8aa 100644 --- a/ecurve/ecurve-tests.ts +++ b/ecurve/ecurve-tests.ts @@ -1,5 +1,3 @@ -/// - import ecurve = require('ecurve'); import crypto = require('crypto'); diff --git a/ej.web.all/ej.web.all-tests.ts b/ej.web.all/ej.web.all-tests.ts index 63928f47cc..eaf6c2b4e3 100644 --- a/ej.web.all/ej.web.all-tests.ts +++ b/ej.web.all/ej.web.all-tests.ts @@ -1,7 +1,3 @@ -/// -/// - - /* tslint:disable */ module AccordionComponent { @@ -24,7 +20,7 @@ module AccordionComponent { }); } - + module AutocompleteComponent{ var carList = [ @@ -48,15 +44,15 @@ module AutocompleteComponent{ "Triumph Spitfire", "Toyota 2000GT", "Volvo P1800", "Volkswagen Shirako" ]; - $(function () { - var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { + $(function () { + var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { width: "100%", watermarkText: "Select a car", dataSource: carList, enableAutoFill: true, showPopupButton: true, multiSelectMode: "delimiter" - }); + }); }); } @@ -154,7 +150,7 @@ module ButtonComponent { }); }); } - + @@ -170,7 +166,7 @@ module ChartComponent { range: { min: 25, max: 50, interval: 5 }, labelFormat: "{value}%", title: { text: "Efficiency" }, - + }, commonSeriesOptions: { @@ -185,28 +181,28 @@ module ChartComponent { }, visible: true }, - border : {width: 2} - }, - series: + border : {width: 2} + }, + series: [ { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], name: 'India' - }, + }, { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], name: 'Germany' }, { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], name: 'England' - }, + }, { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], name: 'France' } ], @@ -294,7 +290,7 @@ module circulargaugecomponent { backgroundColor: "#f5b43f", border: { color: "#f5b43f" } }] - }] + }] }); }); } @@ -381,7 +377,7 @@ $(function () { createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) ] }); - + }); function createNode(option: ej.datavisualization.Diagram.Node) { @@ -406,7 +402,7 @@ function createLabel(options : any) { return options; } - + module DialogComponent { $(function () { @@ -456,7 +452,7 @@ module digitalgaugecomponent { } - + @@ -476,12 +472,12 @@ module DropDownListComponent { enableFilterSearch: true, caseSensitiveSearch: true, enableIncrementalSearch: true, - enablePopupResize: true, + enablePopupResize: true, delimiterChar: ";", multiSelectMode: ej.MultiSelectMode.Delimiter, maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", + minPopupHeight: "150px", + maxPopupWidth: "500px", minPopupWidth: "350px", showCheckbox: true, showRoundedCorner: true @@ -517,7 +513,7 @@ module GanttComponent { dataSource: (window).projectData, allowColumnResize: true, allowSorting: true, - allowSelection: true, + allowSelection: true, enableContextMenu: true, taskIdMapping: "taskID", allowDragAndDrop: true, @@ -558,7 +554,7 @@ module GanttComponent { treeColumnIndex: 1, isResponsive: true, }); -}); +}); } @@ -674,7 +670,7 @@ module KanbanComponent { }); } - + module lineargaugecomponent { @@ -700,14 +696,14 @@ module lineargaugecomponent { backgroundColor: "#E94649", border: { color: "#E94649" }, startWidth: 4, endWidth: 4 }] - }] + }] }); }); } - - + + module ListBoxComponent { $(function () { @@ -717,12 +713,12 @@ module ListBoxComponent { }); } - + module ListviewComponent { $(function () { var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, + enableCheckMark: true, width: 400 }); }); @@ -987,7 +983,7 @@ module MenuComponent { - + module NavigationDrawerComponent { $(function () { @@ -1027,7 +1023,7 @@ module PivotChartOlap { $(function () { var sample = new ej.PivotChart($("#PivotChart"),{ dataSource: { - data: "http://bi.syncfusion.com/olap/msmdpump.dll", + data: "http://bi.syncfusion.com/olap/msmdpump.dll", catalog: "Adventure Works DW 2008 SE", cube: "Adventure Works", rows: [ @@ -1195,7 +1191,7 @@ module PivotGaugeOlap { length: 120, width: 7 }, - { + { type: "marker", markerType: "diamond", distanceFromScale: 5, @@ -1224,7 +1220,7 @@ module PivotGaugeOlap { distanceFromScale: -5, backgroundColor: "#fc0606", border: { color: "#fc0606" } - }, + }, { distanceFromScale: -5 }], @@ -1242,7 +1238,7 @@ module PivotGaugeOlap { }] }] }); - }); + }); } @@ -1316,7 +1312,7 @@ module PivotGaugeRelational { length: 120, width: 7 }, - { + { type: "marker", markerType: "diamond", distanceFromScale: 5, @@ -1345,7 +1341,7 @@ module PivotGaugeRelational { distanceFromScale: -5, backgroundColor: "#fc0606", border: { color: "#fc0606" } - }, + }, { distanceFromScale: -5 }], @@ -1363,7 +1359,7 @@ module PivotGaugeRelational { }] }] }); - }); + }); } @@ -1398,7 +1394,7 @@ module PivotGridOlap { ], filters:[] }, - enableGroupingBar: true, + enableGroupingBar: true, pivotTableFieldListID:"PivotSchemaDesigner" }); $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); @@ -1449,7 +1445,7 @@ module PivotGridRelational { fieldCaption: "State" } ], - columns: + columns: [{ fieldName: "Product", fieldCaption: "Product" @@ -1467,10 +1463,10 @@ module PivotGridRelational { ], filters:[] }, - enableGroupingBar: true, + enableGroupingBar: true, pivotTableFieldListID:"PivotSchemaDesigner" }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); } @@ -1611,7 +1607,7 @@ function redo(e: any) { } - + module RadialSliderComponent { $(function () { @@ -1644,7 +1640,7 @@ module rangecomponent { fill: '#69D2E7' } ]; - } + } }); }); @@ -1696,7 +1692,7 @@ module RatingComponent { shapeWidth: 25, showTooltip: true }); - + var sample2 = new ej.Rating($("#halfRating"),{ precision: ej.Rating.Precision.Half, value: 3.5, @@ -1727,7 +1723,7 @@ module RatingComponent { shapeHeight: 25, shapeWidth: 25, showTooltip: true - }); + }); }); } @@ -1760,7 +1756,7 @@ module RibbonComponent { toolTip: "Pin the Ribbon" }, applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } }, tabs: [{ id: "home", text: "HOME", groups: [{ @@ -1837,7 +1833,7 @@ module RibbonComponent { width: 60, isBig: false } - }] + }] }, { text: "Font", alignType: "rows", content: [{ @@ -2116,7 +2112,7 @@ module RibbonComponent { groups: [{ id: "zoomin", text: "Zoom In", - toolTip: "Zoom In", + toolTip: "Zoom In", buttonSettings: { width: 58, contentType: ej.ContentType.TextAndImage, @@ -2127,7 +2123,7 @@ module RibbonComponent { { id: "zoomout", text: "Zoom Out", - toolTip: "Zoom Out", + toolTip: "Zoom Out", buttonSettings: { width: 70, contentType: ej.ContentType.TextAndImage, @@ -2138,7 +2134,7 @@ module RibbonComponent { { id: "fullscreen", text: "Full Screen", - toolTip: "Full Screen", + toolTip: "Full Screen", buttonSettings: { width: 73, contentType: ej.ContentType.TextAndImage, @@ -2367,7 +2363,7 @@ module RibbonComponent { } ] } - ], + ], create: function createControl(args) { var ribbon = $("#defaultRibbon").data("ejRibbon"); $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); @@ -2383,7 +2379,7 @@ function colorHandler(args:any) { - + module RotatorComponent { $(function () { @@ -2546,7 +2542,7 @@ module ScheduleComponent { } }); }); -} +} @@ -2729,9 +2725,9 @@ module piesparkline4 { }); } - - + + module SplitterComponent { @@ -2766,7 +2762,7 @@ $(function () { pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" }, sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { + loadComplete: () => { var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; if (!(spreadsheet).isImport) { spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); @@ -2790,13 +2786,13 @@ var default_data: Array = [ { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, - + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, - + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, @@ -2805,13 +2801,13 @@ var default_data: Array = [ { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, - + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, - + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, @@ -2821,7 +2817,7 @@ var default_data: Array = [ module sunburstcomponent { $(function () { var sunburstsample = new ej.SunburstChart($("#Sunburst"), { - valueMemberPath: "EmployeesCount", + valueMemberPath: "EmployeesCount", levels: [ {groupMemberPath: "Country"}, {groupMemberPath: "JobDescription"}, @@ -2860,8 +2856,8 @@ module TabComponent { module TagCloudComponent { - - + + var websiteCollection = [ { text: "Google", url: "http://www.google.com", frequency: 12 }, { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, @@ -2892,7 +2888,7 @@ module TagCloudComponent { text: "text", url: "url", frequency: "frequency" } }); - + }); } @@ -2932,7 +2928,7 @@ module EditorComponent { - + module TileViewComponent { $(function () { @@ -2943,38 +2939,38 @@ module TileViewComponent { imageUrl:'content/images/tile/windows/people_1.png' }); var tile2 = new ej.Tile($("#tile2"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/alerts.png', - + imageUrl:'content/images/tile/windows/alerts.png', + }); var tile3 = new ej.Tile($("#tile3"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/bing.png', + imageUrl:'content/images/tile/windows/bing.png', }); var tile4 = new ej.Tile($("#tile4"), { tileSize:"small", - imageUrl:'content/images/tile/windows/camera.png', + imageUrl:'content/images/tile/windows/camera.png', }); var tile5 = new ej.Tile($("#tile5"), { - imagePosition:"center", + imagePosition:"center", tileSize:"small", - imageUrl:'content/images/tile/windows/messages.png', + imageUrl:'content/images/tile/windows/messages.png', }); var tile6 = new ej.Tile($("#tile6"), { - imagePosition:"center", + imagePosition:"center", tileSize:"medium", - imageUrl:'content/images/tile/windows/games.png', + imageUrl:'content/images/tile/windows/games.png', caption:{text:"Play"} }); - var tile7 = new ej.Tile($("#tile7"), { + var tile7 = new ej.Tile($("#tile7"), { tileSize:"medium", imageUrl:'content/images/tile/windows/map.png', caption:{text:"Maps"} }); var tile8 = new ej.Tile($("#tile8"), { - imagePosition:"fill", + imagePosition:"fill", tileSize:"wide", imageUrl:'content/images/tile/windows/sports.png', caption:{text:"Sports"} @@ -3026,7 +3022,7 @@ module TimePickerComponent { module ToolbarComponent { - + $(function () { var sample = new ej.Toolbar($("#editingToolbar"),{ width: "100%", @@ -3045,7 +3041,7 @@ module ToolbarComponent { module TooltipComponent { - + $(function () { var sample1 = new ej.Tooltip($("#link1"),{ @@ -3140,7 +3136,7 @@ module TreeGridComponent { isResponsive: true, }); }); -} +} @@ -3185,7 +3181,7 @@ module treemapcomponent { - + module TreeViewComponent { $(function () { @@ -3202,7 +3198,7 @@ module TreeViewComponent { module UploadboxComponent { - + $(function () { var sample = new ej.Uploadbox($("#UploadDefault"),{ saveUrl: "uploadbox/saveFiles.ashx", diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index 356eb6af40..5d3a48af93 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// /*! * filename: ej.web.all.d.ts diff --git a/electron-devtools-installer/electron-devtools-installer-tests.ts b/electron-devtools-installer/electron-devtools-installer-tests.ts index a923e2b20e..a453221698 100644 --- a/electron-devtools-installer/electron-devtools-installer-tests.ts +++ b/electron-devtools-installer/electron-devtools-installer-tests.ts @@ -1,5 +1,3 @@ -/// - import installExtension, { EMBER_INSPECTOR, REACT_DEVELOPER_TOOLS, BACKBONE_DEBUGGER, JQUERY_DEBUGGER, diff --git a/ember/v1/ember-tests.ts b/ember/v1/ember-tests.ts index 25ca3e3cc5..103fb0146e 100644 --- a/ember/v1/ember-tests.ts +++ b/ember/v1/ember-tests.ts @@ -1,6 +1,3 @@ -/// - - var App : any; App = Em.Application.create(); diff --git a/esprima/esprima-tests.ts b/esprima/esprima-tests.ts index d7c748d3b8..60b54e0679 100644 --- a/esprima/esprima-tests.ts +++ b/esprima/esprima-tests.ts @@ -1,6 +1,3 @@ -/// - - import esprima = require('esprima'); import * as ESTree from 'estree'; diff --git a/falcor-express/falcor-express-tests.ts b/falcor-express/falcor-express-tests.ts index f4a4ed8b52..c76a61f901 100644 --- a/falcor-express/falcor-express-tests.ts +++ b/falcor-express/falcor-express-tests.ts @@ -1,7 +1,3 @@ - -/// -/// - import express = require('express'); import Router = require('falcor-router'); import falcorExpress = require('falcor-express') diff --git a/fancybox/fancybox-tests.ts b/fancybox/fancybox-tests.ts index 2d5743c950..eac3f31771 100644 --- a/fancybox/fancybox-tests.ts +++ b/fancybox/fancybox-tests.ts @@ -1,6 +1,3 @@ -/// - - $('.fancybox').fancybox(); $('.fancybox').fancybox({ padding: 0, diff --git a/featherlight/featherlight-tests.ts b/featherlight/featherlight-tests.ts index 4d609d3475..e241a30990 100644 --- a/featherlight/featherlight-tests.ts +++ b/featherlight/featherlight-tests.ts @@ -1,7 +1,5 @@ // Tests by: Kaur Kuut -/// - // Every option as default var defaultOptions = { namespace: 'featherlight', diff --git a/fixed-data-table/fixed-data-table-tests.tsx b/fixed-data-table/fixed-data-table-tests.tsx index 7dfac22230..f57ff3d946 100644 --- a/fixed-data-table/fixed-data-table-tests.tsx +++ b/fixed-data-table/fixed-data-table-tests.tsx @@ -1,6 +1,3 @@ - -/// - import * as React from "react"; import {Table, Cell, Column, CellProps} from "fixed-data-table"; diff --git a/flickity/flickity-tests.ts b/flickity/flickity-tests.ts index b98315285f..b4ecf51997 100644 --- a/flickity/flickity-tests.ts +++ b/flickity/flickity-tests.ts @@ -4,11 +4,9 @@ // Definitions: https://github.com/clmcgrath/ /// -/// //jQuery tests - var $flickity: JQuery = $("#flickity-selector").flickity( { initialIndex: 0, @@ -105,15 +103,15 @@ flikty2.destroy(); flikty2.reloadCells(); //event handlers -flikty2.on(FlickityEvents.cellSelect, (evt, ele) => { +flikty2.on("cellSelect", (evt, ele) => { //do something }); -flikty2.off(FlickityEvents.cellSelect, (evt, ele, pntr, vctr) => { +flikty2.off("cellSelect", (evt, ele, pntr, vctr) => { //do something }); -flikty2.once(FlickityEvents.cellSelect, (evt, ele, pntr) => { +flikty2.once("cellSelect", (evt, ele, pntr) => { //do something }); diff --git a/foundation-sites/foundation-sites-tests.ts b/foundation-sites/foundation-sites-tests.ts index 4932f01624..2e90071c7d 100644 --- a/foundation-sites/foundation-sites-tests.ts +++ b/foundation-sites/foundation-sites-tests.ts @@ -1,11 +1,3 @@ -// Tests for type definitions for Foundation Sites v6.0.4 -// Project: http://foundation.zurb.com/ -// Definitions by: Sam Vloeberghs -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - - $(document).foundation(); $(document).foundation('method5'); $(document).foundation(['method', 'method2']); diff --git a/foundation/foundation-tests.ts b/foundation/foundation-tests.ts index 913bd0ee1b..33f8530589 100644 --- a/foundation/foundation-tests.ts +++ b/foundation/foundation-tests.ts @@ -1,6 +1,3 @@ -/// - - function empty_callback() : void {} function plugin_list() { diff --git a/from/from-tests.ts b/from/from-tests.ts index b46bdf66f1..e73a4915a0 100644 --- a/from/from-tests.ts +++ b/from/from-tests.ts @@ -1,6 +1,3 @@ - -/// - import from = require('from'); var rs: NodeJS.ReadableStream; diff --git a/fs-ext/fs-ext-tests.ts b/fs-ext/fs-ext-tests.ts index baba88f092..0c774589bc 100644 --- a/fs-ext/fs-ext-tests.ts +++ b/fs-ext/fs-ext-tests.ts @@ -1,19 +1,16 @@ - -/// - import fs = require('fs-ext'); var num:number; var str:string; -//from node.js 'fs' module +//from node.js 'fs' module fs.appendFileSync(str, "data"); -fs.flock(num, str, (err)=>{ +fs.flock(num, str, (err)=>{ }); fs.flockSync(num, str); -fs.fcntl(num, str, num, (err, res)=>{ +fs.fcntl(num, str, num, (err, res)=>{ }); fs.fcntl(num, str, (err, res)=>{ }); diff --git a/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts b/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts index 12623c54b1..46e623207a 100644 --- a/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts +++ b/fs-extra-promise-es6/fs-extra-promise-es6-tests.ts @@ -1,5 +1,3 @@ -/// - import fs = require('fs-extra-promise-es6'); import stream = require('stream'); @@ -145,7 +143,7 @@ strArr = fs.readdirSync(path); fs.close(fd, errorCallback); fs.closeSync(fd); fs.open(path, flags, modeStr, (err: Error, fd: number) => { - + }); num = fs.openSync(path, flags, modeStr); fs.utimes(path, atime, mtime, errorCallback); diff --git a/fs-extra-promise/fs-extra-promise-tests.ts b/fs-extra-promise/fs-extra-promise-tests.ts index 112a27109c..28bdd26120 100644 --- a/fs-extra-promise/fs-extra-promise-tests.ts +++ b/fs-extra-promise/fs-extra-promise-tests.ts @@ -1,6 +1,3 @@ - -/// - import fs = require('fs-extra-promise'); import stream = require('stream'); diff --git a/fs-extra/fs-extra-tests.ts b/fs-extra/fs-extra-tests.ts index 896d6411f7..f06ec098a8 100644 --- a/fs-extra/fs-extra-tests.ts +++ b/fs-extra/fs-extra-tests.ts @@ -1,6 +1,3 @@ - -/// - import fs = require('fs-extra'); import * as Path from 'path' diff --git a/ftp/ftp-tests.ts b/ftp/ftp-tests.ts index 6e5e7d37a9..4d78104940 100644 --- a/ftp/ftp-tests.ts +++ b/ftp/ftp-tests.ts @@ -1,6 +1,3 @@ - -/// - import Client = require("ftp"); import fs = require("fs"); @@ -8,8 +5,8 @@ var c = new Client(); c.on('ready', (): void => { c.get('foo.txt', function(err: Error, stream: NodeJS.ReadableStream): void { if (err) throw err; - stream.once('close', function(): void { - c.end(); + stream.once('close', function(): void { + c.end(); }); stream.pipe(fs.createWriteStream('foo.local-copy.txt')); }); @@ -25,4 +22,4 @@ c.connect({ }); - + diff --git a/fullcalendar/fullcalendar-tests.ts b/fullcalendar/fullcalendar-tests.ts index 7640c85db6..63328a9cef 100644 --- a/fullcalendar/fullcalendar-tests.ts +++ b/fullcalendar/fullcalendar-tests.ts @@ -1,5 +1,4 @@ -/// -/// +/// import * as FullCalendar from 'fullcalendar'; import * as moment from 'moment'; diff --git a/fullcalendar/v1/fullcalendar-tests.ts b/fullcalendar/v1/fullcalendar-tests.ts index 56a9eb0024..ede55bc0b1 100644 --- a/fullcalendar/v1/fullcalendar-tests.ts +++ b/fullcalendar/v1/fullcalendar-tests.ts @@ -1,6 +1,4 @@ -/// -/// -/// +/// // All examples from http://arshaw.com/fullcalendar/docs/ diff --git a/gijgo/gijgo-tests.ts b/gijgo/gijgo-tests.ts index 5731732295..6e624ad4f6 100644 --- a/gijgo/gijgo-tests.ts +++ b/gijgo/gijgo-tests.ts @@ -1,5 +1,4 @@ /// -/// // Grid $(() => { diff --git a/gldatepicker/gldatepicker-tests.ts b/gldatepicker/gldatepicker-tests.ts index d133a5f823..974c1da8a7 100644 --- a/gldatepicker/gldatepicker-tests.ts +++ b/gldatepicker/gldatepicker-tests.ts @@ -1,5 +1,3 @@ -/// - $('input').glDatePicker(); $('#example2').glDatePicker( { diff --git a/gm/gm-tests.ts b/gm/gm-tests.ts index 2189d9064d..e8bf5787cd 100644 --- a/gm/gm-tests.ts +++ b/gm/gm-tests.ts @@ -1,6 +1,3 @@ - -/// - import gm = require('gm'); import stream = require('stream'); diff --git a/gregorian-calendar/gregorian-calendar-tests.ts b/gregorian-calendar/gregorian-calendar-tests.ts index a7b11cf21d..096933ed2b 100644 --- a/gregorian-calendar/gregorian-calendar-tests.ts +++ b/gregorian-calendar/gregorian-calendar-tests.ts @@ -1,9 +1,6 @@ -/// - import GregorianCalendar = require('gregorian-calendar'); import GregorianCalendarFormat = require('gregorian-calendar-format'); - let cal = new GregorianCalendar(); cal.set(2016, 7, 27, 0, 0, 0, 0); diff --git a/gridfs-stream/gridfs-stream-tests.ts b/gridfs-stream/gridfs-stream-tests.ts index 1ed4e97006..8086245722 100644 --- a/gridfs-stream/gridfs-stream-tests.ts +++ b/gridfs-stream/gridfs-stream-tests.ts @@ -1,7 +1,3 @@ - - -/// - // Samples from: // https://github.com/aheckmann/gridfs-stream diff --git a/gulp-babel/gulp-babel-tests.ts b/gulp-babel/gulp-babel-tests.ts index b705c68850..4cd6ff0467 100644 --- a/gulp-babel/gulp-babel-tests.ts +++ b/gulp-babel/gulp-babel-tests.ts @@ -1,5 +1,3 @@ -/// - import babel = require('gulp-babel'); var x: NodeJS.ReadWriteStream = babel(); diff --git a/gulp-cheerio/gulp-cheerio-tests.ts b/gulp-cheerio/gulp-cheerio-tests.ts index 464abccead..e2d3bfe267 100644 --- a/gulp-cheerio/gulp-cheerio-tests.ts +++ b/gulp-cheerio/gulp-cheerio-tests.ts @@ -1,7 +1,3 @@ - - -/// - import cheerio = require('gulp-cheerio'); import gulp = require('gulp'); import Vinyl = require('vinyl'); diff --git a/gulp-dtsm/gulp-dtsm-tests.ts b/gulp-dtsm/gulp-dtsm-tests.ts index 54e12eff6a..dafc6b3468 100644 --- a/gulp-dtsm/gulp-dtsm-tests.ts +++ b/gulp-dtsm/gulp-dtsm-tests.ts @@ -1,6 +1,3 @@ - -/// - import * as dtsm from 'gulp-dtsm'; import * as gulp from 'gulp'; diff --git a/gulp-help/gulp-help-tests.ts b/gulp-help/gulp-help-tests.ts index 5d11bc23b7..ae7d0846e7 100644 --- a/gulp-help/gulp-help-tests.ts +++ b/gulp-help/gulp-help-tests.ts @@ -1,7 +1,3 @@ -/// - -'use strict'; - import gulpHelp = require('gulp-help'); var gulp = gulpHelp(require('gulp')); diff --git a/gulp-html-replace/gulp-html-replace-tests.ts b/gulp-html-replace/gulp-html-replace-tests.ts index 568fb481fd..9a21a53b84 100644 --- a/gulp-html-replace/gulp-html-replace-tests.ts +++ b/gulp-html-replace/gulp-html-replace-tests.ts @@ -1,7 +1,3 @@ - - -/// - import * as gulp from 'gulp'; import * as htmlreplace from 'gulp-html-replace'; diff --git a/gulp-useref/gulp-useref-tests.ts b/gulp-useref/gulp-useref-tests.ts index 1f1a152be0..9f2bd409d5 100644 --- a/gulp-useref/gulp-useref-tests.ts +++ b/gulp-useref/gulp-useref-tests.ts @@ -1,5 +1,3 @@ -/// - import * as gulp from 'gulp'; import * as useref from 'gulp-useref'; diff --git a/hammerjs/v1/hammerjs-tests.ts b/hammerjs/v1/hammerjs-tests.ts index bb006241fe..60d990c0bd 100644 --- a/hammerjs/v1/hammerjs-tests.ts +++ b/hammerjs/v1/hammerjs-tests.ts @@ -1,6 +1,3 @@ -/// - - // plugin check if (!Hammer.HAS_TOUCHEVENTS && !Hammer.HAS_POINTEREVENTS) { Hammer.plugins.fakeMultitouch(); diff --git a/hystrixjs/hystrixjs-tests.ts b/hystrixjs/hystrixjs-tests.ts index b7f10a27d8..676015be06 100644 --- a/hystrixjs/hystrixjs-tests.ts +++ b/hystrixjs/hystrixjs-tests.ts @@ -1,6 +1,3 @@ - -/// - import hystrixjs = require('hystrixjs'); import q = require('q'); diff --git a/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts b/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts index bca7aee3b7..9f36a7d538 100644 --- a/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts +++ b/i18next-browser-languagedetector/i18next-browser-languagedetector-tests.ts @@ -1,5 +1,3 @@ -/// - import * as i18next from 'i18next'; import LngDetector from 'i18next-browser-languagedetector'; diff --git a/i18next-xhr-backend/i18next-xhr-backend-tests.ts b/i18next-xhr-backend/i18next-xhr-backend-tests.ts index b4e71467f1..9c12809271 100644 --- a/i18next-xhr-backend/i18next-xhr-backend-tests.ts +++ b/i18next-xhr-backend/i18next-xhr-backend-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as i18next from 'i18next'; import XHR from 'i18next-xhr-backend'; diff --git a/ibm-mobilefirst/ibm-mobilefirst-tests.ts b/ibm-mobilefirst/ibm-mobilefirst-tests.ts index 92dbee824d..498c9c3d7f 100644 --- a/ibm-mobilefirst/ibm-mobilefirst-tests.ts +++ b/ibm-mobilefirst/ibm-mobilefirst-tests.ts @@ -1,5 +1,3 @@ -/// - // Tests // Test WL.Client @@ -126,7 +124,7 @@ WL.SimpleDialog.show( WL.Logger.debug("First button pressed"); } }]); - + // Test WL.TabBar // iOS var creditTab = WL.TabBar.addItem("CREDIT", function() { diff --git a/imagemagick-native/imagemagick-native-tests.ts b/imagemagick-native/imagemagick-native-tests.ts index c872634ab2..94d8fd05bb 100644 --- a/imagemagick-native/imagemagick-native-tests.ts +++ b/imagemagick-native/imagemagick-native-tests.ts @@ -1,6 +1,3 @@ - -/// - import imagemagick = require('imagemagick-native'); import fs = require('fs'); diff --git a/imagemagick/imagemagick-tests.ts b/imagemagick/imagemagick-tests.ts index 87ead6307a..5bc9d9cc93 100644 --- a/imagemagick/imagemagick-tests.ts +++ b/imagemagick/imagemagick-tests.ts @@ -1,6 +1,3 @@ - -/// - import imagemagick = require('imagemagick'); import child_process = require('child_process'); diff --git a/jasmine-expect/jasmine-expect-tests.ts b/jasmine-expect/jasmine-expect-tests.ts index 7753cc7381..e64f9198bf 100644 --- a/jasmine-expect/jasmine-expect-tests.ts +++ b/jasmine-expect/jasmine-expect-tests.ts @@ -1,6 +1,3 @@ -/// - - // Taken directly from the test directory of the original repo declare var describeWhenNotArray: (arr: string) => void; diff --git a/jasmine-jquery/jasmine-jquery-tests.ts b/jasmine-jquery/jasmine-jquery-tests.ts index 67b349d45e..2e507d85fd 100644 --- a/jasmine-jquery/jasmine-jquery-tests.ts +++ b/jasmine-jquery/jasmine-jquery-tests.ts @@ -1,7 +1,3 @@ -/// -/// - - describe("Jasmine jQuery extension", () => { it("Adds jQuery matchers", () => { expect($('
    ')).toBe('div'); diff --git a/jasmine-matchers/jasmine-matchers-tests.ts b/jasmine-matchers/jasmine-matchers-tests.ts index dc92e809dc..4ef032062d 100644 --- a/jasmine-matchers/jasmine-matchers-tests.ts +++ b/jasmine-matchers/jasmine-matchers-tests.ts @@ -14,9 +14,6 @@ The above copyright notice and this permission notice shall be included in all c 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. */ -/// - - describe('toBeArray', function () { describe('matches', function () { it('should pass for []', function () { diff --git a/joi/v6/joi-tests.ts b/joi/v6/joi-tests.ts index 265bbd045c..03ca5ffac0 100644 --- a/joi/v6/joi-tests.ts +++ b/joi/v6/joi-tests.ts @@ -1,4 +1,3 @@ -/// /// import Joi = require('joi'); diff --git a/jqgrid/jqgrid-tests.ts b/jqgrid/jqgrid-tests.ts index 7354f527dc..832a94d909 100644 --- a/jqgrid/jqgrid-tests.ts +++ b/jqgrid/jqgrid-tests.ts @@ -2,8 +2,6 @@ // Definitions by: Lokesh Peta // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - var mydata: any[] = []; $('#jqGrid') diff --git a/jqrangeslider/jqrangeslider-tests.ts b/jqrangeslider/jqrangeslider-tests.ts index 1af815806f..cb6b417656 100644 --- a/jqrangeslider/jqrangeslider-tests.ts +++ b/jqrangeslider/jqrangeslider-tests.ts @@ -1,5 +1,3 @@ -/// - // Arrows $("#arrowsExample").rangeSlider({ arrows: false }); $("#arrowsExample").editRangeSlider({ arrows: false }); @@ -133,7 +131,7 @@ $("#rulersExample").rangeSlider({ next: function(val){ return val + 10; }, stop: function(val){ return false; }, label: function(val){ return val; }, - format: function(tickContainer, tickStart, tickEnd){ + format: function(tickContainer, tickStart, tickEnd){ tickContainer.addClass("myCustomClass"); } }, @@ -179,7 +177,7 @@ $("#rangeExample").dateRangeSlider({ // Symmetric Positionning $("#symmetricExample").rangeSlider({ symmetricPositionning: true, - range: {min: 0} + range: {min: 0} }); // Type $("#typeExample").editRangeSlider({type: "number"}); diff --git a/jquery-ajax-chain/jquery-ajax-chain-tests.ts b/jquery-ajax-chain/jquery-ajax-chain-tests.ts index e5cbb8a26f..56ea354543 100644 --- a/jquery-ajax-chain/jquery-ajax-chain-tests.ts +++ b/jquery-ajax-chain/jquery-ajax-chain-tests.ts @@ -1,6 +1,3 @@ -/// -/// - function test_public_methods(): void { let ajaxChain: ajaxChain.JQueryAjaxChain, @@ -171,7 +168,7 @@ function test_optional_parameters(): void { }, hasCache: function (xmlResponse): XMLDocument { - + let $tempXmlResponse: JQuery, itemId: String; diff --git a/jquery-alertable/jquery-alertable-tests.ts b/jquery-alertable/jquery-alertable-tests.ts index a61dca01b4..61d6e2c06c 100644 --- a/jquery-alertable/jquery-alertable-tests.ts +++ b/jquery-alertable/jquery-alertable-tests.ts @@ -1,6 +1,3 @@ -/// -/// - // // Examples from https://github.com/claviska/jquery-alertable // diff --git a/jquery-backstretch/jquery-backstretch-tests.ts b/jquery-backstretch/jquery-backstretch-tests.ts index 7220458769..22835b4e43 100644 --- a/jquery-backstretch/jquery-backstretch-tests.ts +++ b/jquery-backstretch/jquery-backstretch-tests.ts @@ -1,5 +1,3 @@ -/// - var backstretch = jQuery.backstretch(['image.png'], { centeredX: false, centeredY: false, diff --git a/jquery-cropbox/jquery-cropbox-tests.ts b/jquery-cropbox/jquery-cropbox-tests.ts index ddc5389625..eadb754088 100644 --- a/jquery-cropbox/jquery-cropbox-tests.ts +++ b/jquery-cropbox/jquery-cropbox-tests.ts @@ -1,5 +1,3 @@ -/// - var cropboxWithDefaultSettings = $("#element").cropbox(); var cropboxOptions: jQueryCropBox.CropboxOptions = { @@ -38,7 +36,7 @@ cropboxWithOptions.getBlob(); cropboxWithOptions.remove(); cropboxWithOptions.on("cropbox",(e: Event, data: any, img: jQueryCropBox.Cropbox) => { - - //DoStuff - + + //DoStuff + }); diff --git a/jquery-easy-loading/jquery-easy-loading-tests.ts b/jquery-easy-loading/jquery-easy-loading-tests.ts index 7a59d3d617..ece98fd6d0 100644 --- a/jquery-easy-loading/jquery-easy-loading-tests.ts +++ b/jquery-easy-loading/jquery-easy-loading-tests.ts @@ -1,6 +1,3 @@ - -/// - function test_options() { const jqElement: JQuery = $("body").loading({ diff --git a/jquery-handsontable/jquery-handsontable-tests.ts b/jquery-handsontable/jquery-handsontable-tests.ts index 267ab30d8a..a2e10b4827 100644 --- a/jquery-handsontable/jquery-handsontable-tests.ts +++ b/jquery-handsontable/jquery-handsontable-tests.ts @@ -1,6 +1,3 @@ -/// - - var data = [ ["", "Maserati", "Mazda", "Mercedes", "Mini", "Mitsubishi"], ["2009", 0, 2941, 4303, 354, 5814], diff --git a/jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts b/jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts index f680dbb688..0e42508202 100644 --- a/jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts +++ b/jquery-jsonrpcclient/jquery-jsonrpcclient-tests.ts @@ -1,5 +1,3 @@ -/// - var foo = new $.JsonRpcClient({ ajaxUrl: '/backend/jsonrpc' }); foo.call( 'bar', ['A parameter', 'B parameter'], diff --git a/jquery-mockjax/jquery-mockjax-tests.ts b/jquery-mockjax/jquery-mockjax-tests.ts index 7688645f8e..3090a1c3cc 100644 --- a/jquery-mockjax/jquery-mockjax-tests.ts +++ b/jquery-mockjax/jquery-mockjax-tests.ts @@ -1,4 +1,3 @@ -/// /// class Tests { diff --git a/jquery-steps/index.d.ts b/jquery-steps/index.d.ts index 6abe640417..7670245480 100644 --- a/jquery-steps/index.d.ts +++ b/jquery-steps/index.d.ts @@ -1,8 +1,9 @@ // Type definitions for jQuery Steps v1.1.1 // Project: http://www.jquery-steps.com/ -// Definitions by: Joseph Blank +// Definitions by: Joseph Blank , Nicholas Wong // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Updated by: Nicholas Wong + +/// interface JQuery { steps(param?: JQuerySteps.Settings): JQuerySteps.JQuerySteps; diff --git a/jquery-steps/jquery-steps-tests.ts b/jquery-steps/jquery-steps-tests.ts index 35346d1f7b..6659212e20 100644 --- a/jquery-steps/jquery-steps-tests.ts +++ b/jquery-steps/jquery-steps-tests.ts @@ -1,6 +1,3 @@ -/// -/// - var labels: JQuerySteps.LabelSettings = { cancel: 'Cancel', current: 'Current:', diff --git a/jquery-timeentry/jquery-timeentry-tests.ts b/jquery-timeentry/jquery-timeentry-tests.ts index ccfe0794a3..8910487c65 100644 --- a/jquery-timeentry/jquery-timeentry-tests.ts +++ b/jquery-timeentry/jquery-timeentry-tests.ts @@ -1,5 +1,3 @@ -/// - var selector = '#example'; // basic diff --git a/jquery-urlparam/jquery-urlparam-tests.ts b/jquery-urlparam/jquery-urlparam-tests.ts index a8ca144bb3..8d855e0e35 100644 --- a/jquery-urlparam/jquery-urlparam-tests.ts +++ b/jquery-urlparam/jquery-urlparam-tests.ts @@ -1,4 +1 @@ -/// - - console.log($.urlParam('variable')); diff --git a/jquery.ajaxfile/jquery.ajaxfile-tests.ts b/jquery.ajaxfile/jquery.ajaxfile-tests.ts index 364220325a..73bc6662dc 100644 --- a/jquery.ajaxfile/jquery.ajaxfile-tests.ts +++ b/jquery.ajaxfile/jquery.ajaxfile-tests.ts @@ -1,7 +1,3 @@ - -/// -/// - function testRawApi(){ var inputElement:HTMLInputElement = null; var resultPromise = AjaxFile.send({ diff --git a/jquery.are-you-sure/jquery.are-you-sure-tests.ts b/jquery.are-you-sure/jquery.are-you-sure-tests.ts index cd400f90c1..37cb487602 100644 --- a/jquery.are-you-sure/jquery.are-you-sure-tests.ts +++ b/jquery.are-you-sure/jquery.are-you-sure-tests.ts @@ -1,10 +1,3 @@ -// Type definitions for jquery.are-you-sure.js -// Project: https://github.com/codedance/jquery.AreYouSure -// Definitions by: Jon Egerton -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - //Use defaults $("test").areYouSure(); diff --git a/jquery.base64/jquery.base64-tests.ts b/jquery.base64/jquery.base64-tests.ts index 447a917620..c9c6955716 100644 --- a/jquery.base64/jquery.base64-tests.ts +++ b/jquery.base64/jquery.base64-tests.ts @@ -1,6 +1,3 @@ -/// - - var encoded = $.base64.encode(""); $.base64.decode(encoded); diff --git a/jquery.cleditor/jquery.cleditor-tests.ts b/jquery.cleditor/jquery.cleditor-tests.ts index 7fe997c4c5..b4f4917551 100644 --- a/jquery.cleditor/jquery.cleditor-tests.ts +++ b/jquery.cleditor/jquery.cleditor-tests.ts @@ -1,5 +1,3 @@ -/// - // cribbed from http://premiumsoftware.net/CLEditor/GettingStarted $(document).ready(function () { $("#input").cleditor(); }); diff --git a/jquery.color/jquery.color-tests.ts b/jquery.color/jquery.color-tests.ts index c94a1cffed..e1439f4cd4 100644 --- a/jquery.color/jquery.color-tests.ts +++ b/jquery.color/jquery.color-tests.ts @@ -1,5 +1,3 @@ -/// - var color = $.Color("rgba(255, 255, 255, 0.4)"); var color1 = $.Color({red: 255, green: 255, blue: 255}); var color2 = $.Color({hue: 359, saturation: 0.5, lightness: 0.5}); diff --git a/jquery.colorbox/jquery.colorbox-tests.ts b/jquery.colorbox/jquery.colorbox-tests.ts index 66d54240db..3c05f213c9 100644 --- a/jquery.colorbox/jquery.colorbox-tests.ts +++ b/jquery.colorbox/jquery.colorbox-tests.ts @@ -1,5 +1,3 @@ -/// - //Image gallery var gallery : JQuery = $('a.gallery').colorbox({ rel: 'gal' }); diff --git a/jquery.cookie/jquery.cookie-tests.ts b/jquery.cookie/jquery.cookie-tests.ts index e93d29110c..998d7bf2df 100644 --- a/jquery.cookie/jquery.cookie-tests.ts +++ b/jquery.cookie/jquery.cookie-tests.ts @@ -1,5 +1,3 @@ -/// - class TestObject { text: string; value: number; diff --git a/jquery.customselect/jquery.customselect-tests.ts b/jquery.customselect/jquery.customselect-tests.ts index b0dc9554a9..5cb28a9f05 100644 --- a/jquery.customselect/jquery.customselect-tests.ts +++ b/jquery.customselect/jquery.customselect-tests.ts @@ -1,6 +1,3 @@ -/// - - class CustomSelectOptions implements JQueryCustomSelectOption { "customClass": string; "mapClass": boolean; diff --git a/jquery.cycle/jquery.cycle-tests.ts b/jquery.cycle/jquery.cycle-tests.ts index e93be101f6..df8ed24b22 100644 --- a/jquery.cycle/jquery.cycle-tests.ts +++ b/jquery.cycle/jquery.cycle-tests.ts @@ -1,5 +1,3 @@ -/// - // As basic as it can be $('#element').cycle(); @@ -284,7 +282,7 @@ $('#s2').cycle({ $('#slideshow2').cycle({ fx: 'scrollLeft,scrollDown,scrollRight,scrollUp', randomizeEffects: false, - easing: 'easeInBack' // easing supported via the easing plugin + easing: 'easeInBack' // easing supported via the easing plugin }); // Another Advanced "pager" Demo @@ -294,7 +292,7 @@ $('#slideshow').cycle({ timeout: 0, pager: '#nav', pagerAnchorBuilder: function (idx, slide) { - // return selector string for existing anchor + // return selector string for existing anchor return '#nav li:eq(' + idx + ') a'; } }); @@ -304,7 +302,7 @@ $('#slideshow').cycle({ slideExpr: 'img' }); // Defeating IE's ClearType bug $('#slideshow').cycle({ - cleartype: false // disable cleartype corrections + cleartype: false // disable cleartype corrections }); // Using the 'nowrap' option (manual slideshow) diff --git a/jquery.cycle2/jquery.cycle2-tests.ts b/jquery.cycle2/jquery.cycle2-tests.ts index 0e16629a3e..9d88e92532 100644 --- a/jquery.cycle2/jquery.cycle2-tests.ts +++ b/jquery.cycle2/jquery.cycle2-tests.ts @@ -1,5 +1,3 @@ -/// - // basic $('#element').cycle(); diff --git a/jquery.finger/jquery.finger-tests.ts b/jquery.finger/jquery.finger-tests.ts index 3f35e7322c..c4734610b2 100644 --- a/jquery.finger/jquery.finger-tests.ts +++ b/jquery.finger/jquery.finger-tests.ts @@ -1,5 +1,3 @@ -/// - $.Finger.doubleTapInterval = 400; $.Finger.flickDuration = 250; $.Finger.pressDuration = 100; diff --git a/jquery.flagstrap/jquery.flagstrap-tests.ts b/jquery.flagstrap/jquery.flagstrap-tests.ts index 3bfcf0294e..6d262dc17f 100644 --- a/jquery.flagstrap/jquery.flagstrap-tests.ts +++ b/jquery.flagstrap/jquery.flagstrap-tests.ts @@ -1,14 +1,11 @@ -/// -/// - class TestObject { - + } $(function () { - // basic test - // written in according to basic example from documentation - var htmlSelect = '
    ' + + // basic test + // written in according to basic example from documentation + var htmlSelect = '' + '
    ' + '
    ' + '
    ' + @@ -21,7 +18,7 @@ $(function () { console.log('characters count: ' + $('#flagstrap').html().length + '\n' + $('#flagstrap').html()); // options test - // options -> data attributes + // options -> data attributes // written in according to options -> data attributes example from documentation htmlSelect = '' + '
    ' + @@ -42,7 +39,7 @@ $(function () { console.log('\n\ncharacters count: ' + $('#flagstrap2').html().length + '\n' + $('#flagstrap2').html()); // options test - // options -> instance options + // options -> instance options // written in according to options -> instance options example from documentation htmlSelect = '' + '
    ' + diff --git a/jquery.form/jquery.form-tests.ts b/jquery.form/jquery.form-tests.ts index f115a97f57..c4d3d636bf 100644 --- a/jquery.form/jquery.form-tests.ts +++ b/jquery.form/jquery.form-tests.ts @@ -1,5 +1,3 @@ -/// - // Basic usage jQuery('#myFormId').ajaxForm(); @@ -30,112 +28,112 @@ jQuery.fn.ajaxSubmit.debug = true; // ajaxForm -// bind form using 'ajaxForm' +// bind form using 'ajaxForm' $('#myForm1').ajaxForm({ - target: '#output1', // target element(s) to be updated with server response + target: '#output1', // target element(s) to be updated with server response beforeSubmit: function (formData, jqForm, options) { // pre-submit callback - // formData is an array; here we use $.param to convert it to a string to display it - // but the form plugin does this for you automatically when it submits the data + // formData is an array; here we use $.param to convert it to a string to display it + // but the form plugin does this for you automatically when it submits the data var queryString = $.param(formData); - // jqForm is a jQuery object encapsulating the form element. To access the - // DOM element for the form do this: - // var formElement = jqForm[0]; + // jqForm is a jQuery object encapsulating the form element. To access the + // DOM element for the form do this: + // var formElement = jqForm[0]; alert('About to submit: \n\n' + queryString); - // here we could return false to prevent the form from being submitted; - // returning anything other than false will allow the form submit to continue + // here we could return false to prevent the form from being submitted; + // returning anything other than false will allow the form submit to continue return true; }, success: function (responseText, statusText, xhr) { // post-submit callback - // for normal html responses, the first argument to the success callback - // is the XMLHttpRequest object's responseText property - - // if the ajaxForm method was passed an Options Object with the dataType - // property set to 'xml' then the first argument to the success callback - // is the XMLHttpRequest object's responseXML property - - // if the ajaxForm method was passed an Options Object with the dataType - // property set to 'json' then the first argument to the success callback - // is the json data object returned by the server - + // for normal html responses, the first argument to the success callback + // is the XMLHttpRequest object's responseText property + + // if the ajaxForm method was passed an Options Object with the dataType + // property set to 'xml' then the first argument to the success callback + // is the XMLHttpRequest object's responseXML property + + // if the ajaxForm method was passed an Options Object with the dataType + // property set to 'json' then the first argument to the success callback + // is the json data object returned by the server + alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + '\n\nThe output div should have already been updated with the responseText.'); } - // other available options: - //url: url // override for form's 'action' attribute - //type: type // 'get' or 'post', override for form's 'method' attribute - //dataType: null // 'xml', 'script', or 'json' (expected server response type) - //clearForm: true // clear all form fields after successful submit - //resetForm: true // reset the form after successful submit + // other available options: + //url: url // override for form's 'action' attribute + //type: type // 'get' or 'post', override for form's 'method' attribute + //dataType: null // 'xml', 'script', or 'json' (expected server response type) + //clearForm: true // clear all form fields after successful submit + //resetForm: true // reset the form after successful submit - // $.ajax options can be used here too, for example: - //timeout: 3000 + // $.ajax options can be used here too, for example: + //timeout: 3000 }); // ajaxSubmit $('#myForm2').ajaxSubmit({ - target: '#output2', // target element(s) to be updated with server response + target: '#output2', // target element(s) to be updated with server response beforeSubmit: function (formData, jqForm, options) { // pre-submit callback - // formData is an array; here we use $.param to convert it to a string to display it - // but the form plugin does this for you automatically when it submits the data + // formData is an array; here we use $.param to convert it to a string to display it + // but the form plugin does this for you automatically when it submits the data var queryString = $.param(formData); - // jqForm is a jQuery object encapsulating the form element. To access the - // DOM element for the form do this: - // var formElement = jqForm[0]; + // jqForm is a jQuery object encapsulating the form element. To access the + // DOM element for the form do this: + // var formElement = jqForm[0]; alert('About to submit: \n\n' + queryString); - // here we could return false to prevent the form from being submitted; - // returning anything other than false will allow the form submit to continue + // here we could return false to prevent the form from being submitted; + // returning anything other than false will allow the form submit to continue return true; }, success: function showResponse(responseText, statusText, xhr) { // post-submit callback - // for normal html responses, the first argument to the success callback - // is the XMLHttpRequest object's responseText property + // for normal html responses, the first argument to the success callback + // is the XMLHttpRequest object's responseText property - // if the ajaxSubmit method was passed an Options Object with the dataType - // property set to 'xml' then the first argument to the success callback - // is the XMLHttpRequest object's responseXML property + // if the ajaxSubmit method was passed an Options Object with the dataType + // property set to 'xml' then the first argument to the success callback + // is the XMLHttpRequest object's responseXML property - // if the ajaxSubmit method was passed an Options Object with the dataType - // property set to 'json' then the first argument to the success callback - // is the json data object returned by the server + // if the ajaxSubmit method was passed an Options Object with the dataType + // property set to 'json' then the first argument to the success callback + // is the json data object returned by the server alert('status: ' + statusText + '\n\nresponseText: \n' + responseText + '\n\nThe output div should have already been updated with the responseText.'); } - // other available options: - //url: url // override for form's 'action' attribute - //type: type // 'get' or 'post', override for form's 'method' attribute - //dataType: null // 'xml', 'script', or 'json' (expected server response type) - //clearForm: true // clear all form fields after successful submit - //resetForm: true // reset the form after successful submit + // other available options: + //url: url // override for form's 'action' attribute + //type: type // 'get' or 'post', override for form's 'method' attribute + //dataType: null // 'xml', 'script', or 'json' (expected server response type) + //clearForm: true // clear all form fields after successful submit + //resetForm: true // reset the form after successful submit - // $.ajax options can be used here too, for example: - //timeout: 3000 + // $.ajax options can be used here too, for example: + //timeout: 3000 }); // Validation $('#myForm2').ajaxForm({ beforeSubmit: function (formData, jqForm, options) { - // formData is an array of objects representing the name and value of each field - // that will be sent to the server; it takes the following form: - // - // [ - // { name: username, value: valueOfUsernameInput }, - // { name: password, value: valueOfPasswordInput } - // ] - // - // To validate, we can examine the contents of this array to see if the - // username and password fields have values. If either value evaluates - // to false then we return false from this method. + // formData is an array of objects representing the name and value of each field + // that will be sent to the server; it takes the following form: + // + // [ + // { name: username, value: valueOfUsernameInput }, + // { name: password, value: valueOfPasswordInput } + // ] + // + // To validate, we can examine the contents of this array to see if the + // username and password fields have values. If either value evaluates + // to false then we return false from this method. for (var i = 0; i < formData.length; i++) { if (!formData[i].value) { @@ -150,13 +148,13 @@ $('#myForm2').ajaxForm({ // JSON $('#jsonForm').ajaxForm({ - // dataType identifies the expected content type of the server response + // dataType identifies the expected content type of the server response dataType: 'json', - // success identifies the function to invoke when the server response - // has been received + // success identifies the function to invoke when the server response + // has been received success: function (data) { - // 'data' is the json object returned from the server + // 'data' is the json object returned from the server alert(data.message); } }); @@ -164,14 +162,14 @@ $('#jsonForm').ajaxForm({ // XML $('#xmlForm').ajaxForm({ - // dataType identifies the expected content type of the server response + // dataType identifies the expected content type of the server response dataType: 'xml', - // success identifies the function to invoke when the server response - // has been received + // success identifies the function to invoke when the server response + // has been received success: function (responseXML) { - // 'responseXML' is the XML document returned by the server; we use - // jQuery to extract the content of the message node from the XML doc + // 'responseXML' is the XML document returned by the server; we use + // jQuery to extract the content of the message node from the XML doc var message = $('message', responseXML).text(); alert(message); } @@ -180,11 +178,11 @@ $('#xmlForm').ajaxForm({ // HTML $('#htmlForm').ajaxForm({ - // target identifies the element(s) to update with the server response + // target identifies the element(s) to update with the server response target: '#htmlExampleTarget', - // success identifies the function to invoke when the server response - // has been received; here we apply a fade-in effect to the new content + // success identifies the function to invoke when the server response + // has been received; here we apply a fade-in effect to the new content success: function () { $('#htmlExampleTarget').fadeIn('slow'); } diff --git a/jquery.jnotify/jquery.jnotify-tests.ts b/jquery.jnotify/jquery.jnotify-tests.ts index b5ad3927e2..f38a99760a 100644 --- a/jquery.jnotify/jquery.jnotify-tests.ts +++ b/jquery.jnotify/jquery.jnotify-tests.ts @@ -1,5 +1,3 @@ -/// - $(document).ready(function () { $('#StatusBar').jnotifyInizialize({ oneAtTime: true diff --git a/jquery.joyride/jquery.joyride-tests.ts b/jquery.joyride/jquery.joyride-tests.ts index f0a51b5270..c7324dd6c9 100644 --- a/jquery.joyride/jquery.joyride-tests.ts +++ b/jquery.joyride/jquery.joyride-tests.ts @@ -1,6 +1,3 @@ -/// - - var options: JoyrideOptions; options.autoStart = true; options.postStepCallback = (index, tip)=> { diff --git a/jquery.jsignature/jquery.jsignature-tests.ts b/jquery.jsignature/jquery.jsignature-tests.ts index 5ec4bc486d..58d73fe24b 100644 --- a/jquery.jsignature/jquery.jsignature-tests.ts +++ b/jquery.jsignature/jquery.jsignature-tests.ts @@ -1,8 +1,6 @@ -/// - /* * Taken from the tests section on jSignature - */ + */ $(document).ready(function () { var $sigdiv = $('#signature'); @@ -10,7 +8,7 @@ $(document).ready(function () { $sigdiv.jSignature(); $sigdiv.jSignature("reset"); - + var data = $sigdiv.jSignature("getData", "svgbase64"); $sigdiv.jSignature("setData", "data:" + data); diff --git a/jquery.leanmodal/jquery.leanmodal-tests.ts b/jquery.leanmodal/jquery.leanmodal-tests.ts index fb6c4ae344..1884cb25d9 100644 --- a/jquery.leanmodal/jquery.leanmodal-tests.ts +++ b/jquery.leanmodal/jquery.leanmodal-tests.ts @@ -1,6 +1,3 @@ -/// - - class LeanModalOptions implements JQueryLeanModalOption { top : number; overlay : number; diff --git a/jquery.livestampjs/jquery.livestampjs-tests.ts b/jquery.livestampjs/jquery.livestampjs-tests.ts index dc713819c9..6b5bd01835 100644 --- a/jquery.livestampjs/jquery.livestampjs-tests.ts +++ b/jquery.livestampjs/jquery.livestampjs-tests.ts @@ -1,4 +1,3 @@ -/// import * as moment from 'moment'; $('#test1').livestamp(new Date('June 18, 1987')); diff --git a/jquery.menuaim/jquery.menuaim-tests.ts b/jquery.menuaim/jquery.menuaim-tests.ts index e2a1b36aff..01baa59e03 100644 --- a/jquery.menuaim/jquery.menuaim-tests.ts +++ b/jquery.menuaim/jquery.menuaim-tests.ts @@ -1,5 +1,3 @@ -/// - $('div').menuAim({ activate: function () { }, deactivate: function () { }, diff --git a/jquery.mmenu/jquery.mmenu-tests.ts b/jquery.mmenu/jquery.mmenu-tests.ts index 385f479507..a08f4371ec 100644 --- a/jquery.mmenu/jquery.mmenu-tests.ts +++ b/jquery.mmenu/jquery.mmenu-tests.ts @@ -1,7 +1,3 @@ -/// -/// - - // -------------------------------------------------------- // ---------------- TEST DEFAULT OPTIONS ------------------ // -------------------------------------------------------- diff --git a/jquery.payment/index.d.ts b/jquery.payment/index.d.ts index 341e695a9a..88ecd255a5 100644 --- a/jquery.payment/index.d.ts +++ b/jquery.payment/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Eric J. Smith , John Rutherford // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + declare namespace JQueryPayment { interface Payment { diff --git a/jquery.payment/jquery.payment-tests.ts b/jquery.payment/jquery.payment-tests.ts index db02b96d90..9eaad853cb 100644 --- a/jquery.payment/jquery.payment-tests.ts +++ b/jquery.payment/jquery.payment-tests.ts @@ -1,6 +1,3 @@ -/// -/// - $.payment.cards.push({ // Card type, as returned by $.payment.cardType. type: 'mastercard', diff --git a/jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts b/jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts index 8bfb91a27e..b215b02b35 100644 --- a/jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts +++ b/jquery.pjax.falsandtru/jquery.pjax.falsandtru-tests.ts @@ -1,6 +1,3 @@ - -/// - function test_pjax() { $.pjax(); } diff --git a/jquery.pjax/jquery.pjax-tests.ts b/jquery.pjax/jquery.pjax-tests.ts index 25422922d8..91cc9391a2 100644 --- a/jquery.pjax/jquery.pjax-tests.ts +++ b/jquery.pjax/jquery.pjax-tests.ts @@ -1,6 +1,3 @@ - -/// - function test_fn_pjax() { $(document).pjax("a"); $(document).pjax("a", "#pjax-container"); diff --git a/jquery.placeholder/jquery.placeholder-tests.ts b/jquery.placeholder/jquery.placeholder-tests.ts index edaf3ea111..04c526b352 100644 --- a/jquery.placeholder/jquery.placeholder-tests.ts +++ b/jquery.placeholder/jquery.placeholder-tests.ts @@ -1,5 +1,3 @@ -/// - $('input').placeholder(); // specify custom class diff --git a/jquery.pnotify/jquery.pnotify-tests.ts b/jquery.pnotify/jquery.pnotify-tests.ts index 41cd7d3fda..f1b8ffb73e 100644 --- a/jquery.pnotify/jquery.pnotify-tests.ts +++ b/jquery.pnotify/jquery.pnotify-tests.ts @@ -1,6 +1,3 @@ -/// - - function test_pnotify() { diff --git a/jquery.prettyphoto/jquery.prettyphoto-tests.ts b/jquery.prettyphoto/jquery.prettyphoto-tests.ts index 4fcbf9ecdf..888d68ada4 100644 --- a/jquery.prettyphoto/jquery.prettyphoto-tests.ts +++ b/jquery.prettyphoto/jquery.prettyphoto-tests.ts @@ -1,8 +1,3 @@ -// Tests for prettyPhoto library - -/// - - // JQUERY $('#id').prettyPhoto(); diff --git a/jquery.qrcode/jquery.qrcode-tests.ts b/jquery.qrcode/jquery.qrcode-tests.ts index a634bd6f07..d007b203da 100644 --- a/jquery.qrcode/jquery.qrcode-tests.ts +++ b/jquery.qrcode/jquery.qrcode-tests.ts @@ -1,5 +1,3 @@ -/// - // Examples from website (note: the examples use color instead of fill, which is not supported) $('.container').qrcode(); diff --git a/jquery.rowgrid/jquery.rowgrid-tests.ts b/jquery.rowgrid/jquery.rowgrid-tests.ts index ba3e5f822d..3f1427c94a 100644 --- a/jquery.rowgrid/jquery.rowgrid-tests.ts +++ b/jquery.rowgrid/jquery.rowgrid-tests.ts @@ -1,12 +1,10 @@ -/// - /* * Test different options */ var options = { - minMargin: 10, - maxMargin: 35, + minMargin: 10, + maxMargin: 35, itemSelector: ".item" }; diff --git a/jquery.scrollto/jquery.scrollto-tests.ts b/jquery.scrollto/jquery.scrollto-tests.ts index 303ce0cd01..fcdc2f50bb 100644 --- a/jquery.scrollto/jquery.scrollto-tests.ts +++ b/jquery.scrollto/jquery.scrollto-tests.ts @@ -1,5 +1,3 @@ -/// - $('div').scrollTo(340); $('div').scrollTo('+=340px', { axis: 'y' }); diff --git a/jquery.simplemodal/jquery.simplemodal-tests.ts b/jquery.simplemodal/jquery.simplemodal-tests.ts index 8e73e057cc..0784f0eeeb 100644 --- a/jquery.simplemodal/jquery.simplemodal-tests.ts +++ b/jquery.simplemodal/jquery.simplemodal-tests.ts @@ -1,7 +1,5 @@ // Tests taken from documentation: http://www.ericmmartin.com/projects/simplemodal/ -/// - // Chained call with no options $("#sample").modal(); diff --git a/jquery.simplepagination/jquery.simplepagination-tests.ts b/jquery.simplepagination/jquery.simplepagination-tests.ts index b35a6f42a0..075fe02628 100644 --- a/jquery.simplepagination/jquery.simplepagination-tests.ts +++ b/jquery.simplepagination/jquery.simplepagination-tests.ts @@ -1,5 +1,3 @@ -/// - var selector = '#elementId'; $(function () { diff --git a/jquery.slimscroll/jquery.slimscroll-tests.ts b/jquery.slimscroll/jquery.slimscroll-tests.ts index 0d4be5af94..a0368d07e9 100644 --- a/jquery.slimscroll/jquery.slimscroll-tests.ts +++ b/jquery.slimscroll/jquery.slimscroll-tests.ts @@ -1,5 +1,3 @@ -/// - $("div").slimScroll(); $("div").slimScroll({ diff --git a/jquery.tagsmanager/jquery.tagsmanager-tests.ts b/jquery.tagsmanager/jquery.tagsmanager-tests.ts index 33af6a8b7b..26a75e8310 100644 --- a/jquery.tagsmanager/jquery.tagsmanager-tests.ts +++ b/jquery.tagsmanager/jquery.tagsmanager-tests.ts @@ -1,6 +1,3 @@ -/// - - var options: ITagsManagerOptions = { prefilled: ["Pisa", "Rome"], CapitalizeFirstLetter: true, diff --git a/jquery.timeago/jquery.timeago-tests.ts b/jquery.timeago/jquery.timeago-tests.ts index 2a852331be..f77b40b121 100644 --- a/jquery.timeago/jquery.timeago-tests.ts +++ b/jquery.timeago/jquery.timeago-tests.ts @@ -1,5 +1,3 @@ -/// - // Basic usage var jQueryElement: JQuery = jQuery("abbr.timeago").timeago(); diff --git a/jquery.timepicker/jquery.timepicker-tests.ts b/jquery.timepicker/jquery.timepicker-tests.ts index cbb14dfe7c..52329cf11a 100644 --- a/jquery.timepicker/jquery.timepicker-tests.ts +++ b/jquery.timepicker/jquery.timepicker-tests.ts @@ -1,5 +1,3 @@ -/// - var beforeShowCallback, onSelectCallback, onCloseCallback, onHourShow, onMinuteShow; $('#timepicker').timepicker({ timeSeparator: ':', diff --git a/jquery.timer/jquery.timer-tests.ts b/jquery.timer/jquery.timer-tests.ts index e5d1cdaa3a..1c6653bfdb 100644 --- a/jquery.timer/jquery.timer-tests.ts +++ b/jquery.timer/jquery.timer-tests.ts @@ -1,31 +1,28 @@ -/// +// Create the timer +$("body").timer( + function () { + console.log("This function just got called"); + }, 10000, true +); +$("body").timer.set({ time: 5000 }); // Change the time from 10000 millseconds to 5000 milliseconds +$("body").timer.toggle(false); // Reset the timer +$("body").timer.stop(); // Stop the timer +$("body").timer.play(); // Start / play the timer - // Create the timer - $("body").timer( - function () { - console.log("This function just got called"); - }, 10000, true - ); +// #region Outputting if timer is active or not +var isTimerActive = $("body").timer.isActive; // Define boolean isActive as isTimerActive +if (isTimerActive == true){ + console.log("Timer is active!"); +} +else{ + console.log("Timer is not active!"); +} +// #endregion - $("body").timer.set({ time: 5000 }); // Change the time from 10000 millseconds to 5000 milliseconds - $("body").timer.toggle(false); // Reset the timer - $("body").timer.stop(); // Stop the timer - $("body").timer.play(); // Start / play the timer +// #region Get time remaining +console.log("Time remaining on timer: " + $("body").timer.remaining.toString); +// #endregion - // #region Outputting if timer is active or not - var isTimerActive = $("body").timer.isActive; // Define boolean isActive as isTimerActive - if (isTimerActive == true){ - console.log("Timer is active!"); - } - else{ - console.log("Timer is not active!"); - } - // #endregion - - // #region Get time remaining - console.log("Time remaining on timer: " + $("body").timer.remaining.toString); - // #endregion - - $("body").timer.stop(); // Stop the timer once more for the purpose of the tests (to test once()) - $("body").timer.once(1000); // Run the timer ONCE in 1 second \ No newline at end of file +$("body").timer.stop(); // Stop the timer once more for the purpose of the tests (to test once()) +$("body").timer.once(1000); // Run the timer ONCE in 1 second \ No newline at end of file diff --git a/jquery.tipsy/jquery.tipsy-tests.ts b/jquery.tipsy/jquery.tipsy-tests.ts index e307e5d364..09ba7f2d68 100644 --- a/jquery.tipsy/jquery.tipsy-tests.ts +++ b/jquery.tipsy/jquery.tipsy-tests.ts @@ -1,5 +1,3 @@ -/// - // basic $('#example-1').tipsy(); diff --git a/jquery.tools/jquery.tools-tests.ts b/jquery.tools/jquery.tools-tests.ts index 0a435ccf02..443425e76b 100644 --- a/jquery.tools/jquery.tools-tests.ts +++ b/jquery.tools/jquery.tools-tests.ts @@ -1,5 +1,3 @@ -/// - /* from documentation at http://jquerytools.github.io/documentation/overlay/index.html */ $("img[rel]").overlay(); diff --git a/jquery.total-storage/jquery.total-storage-tests.ts b/jquery.total-storage/jquery.total-storage-tests.ts index 0a23dd67cf..37ebb1ca73 100644 --- a/jquery.total-storage/jquery.total-storage-tests.ts +++ b/jquery.total-storage/jquery.total-storage-tests.ts @@ -1,10 +1,3 @@ -// Type definitions for jQueryTotalStorage 1.1.2 -// Project: https://github.com/Upstatement/jquery-total-storage -// Definitions by: Jeremy Brooks -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - //direct call $.totalStorage("test_key1", "test_value"); var val1:string = $.totalStorage("test_key"); diff --git a/jquery.transit/jquery.transit-tests.ts b/jquery.transit/jquery.transit-tests.ts index 2a672ec979..4f3b41f228 100644 --- a/jquery.transit/jquery.transit-tests.ts +++ b/jquery.transit/jquery.transit-tests.ts @@ -1,5 +1,3 @@ -/// - class TransitOptions implements JQueryTransitOptions { opacity: number; duration: number; diff --git a/jquery.ui.datetimepicker/jquery.ui.datetimepicker-tests.ts b/jquery.ui.datetimepicker/jquery.ui.datetimepicker-tests.ts index 44996637da..00ba4fe297 100644 --- a/jquery.ui.datetimepicker/jquery.ui.datetimepicker-tests.ts +++ b/jquery.ui.datetimepicker/jquery.ui.datetimepicker-tests.ts @@ -1,9 +1,6 @@ -/// - - // basic no options $('#datetimepicker').datetimepicker({ - + }); // basic with some options diff --git a/jquery.validation/jquery.validation-tests.ts b/jquery.validation/jquery.validation-tests.ts index 0b2de520f2..68062d6e1c 100644 --- a/jquery.validation/jquery.validation-tests.ts +++ b/jquery.validation/jquery.validation-tests.ts @@ -1,6 +1,4 @@ -/// -/// - +/// function test_validate() { $("#commentForm").validate(); @@ -264,4 +262,3 @@ function test_static_methods() { jQuery.validator.format('{0} {1}', 'a', 2); jQuery.validator.format('{0} {1}', ['a', 2]); } - \ No newline at end of file diff --git a/jquery.watermark/jquery.watermark-tests.ts b/jquery.watermark/jquery.watermark-tests.ts index 225ba0a482..e92ec0df11 100644 --- a/jquery.watermark/jquery.watermark-tests.ts +++ b/jquery.watermark/jquery.watermark-tests.ts @@ -1,5 +1,3 @@ -/// - $('#inputId').watermark('Required information'); $('#inputId').watermark('Required information', { className: 'myClassName' }); $('#inputId').watermark('Search', { useNative: false }); diff --git a/jquery.window/jquery.window-tests.ts b/jquery.window/jquery.window-tests.ts index 4b1b9b6eb2..15021cad7d 100644 --- a/jquery.window/jquery.window-tests.ts +++ b/jquery.window/jquery.window-tests.ts @@ -1,5 +1,3 @@ -/// - function example_1() { $.window({ title: "Cyclops Studio", @@ -20,13 +18,13 @@ function example_2() { function example_3() { // prepare customerized static attributes, see static attributes - // Note: you should call this method before starting to create window instances, or windows might display wrong. + // Note: you should call this method before starting to create window instances, or windows might display wrong. $.window.prepare({ dock: 'bottom', // change the dock direction: 'left', 'right', 'top', 'bottom' animationSpeed: 200, // set animation speed minWinLong: 180 // set minimized window long dimension width in pixel }); - + // limit window within body $.window({ icon: 'http://www.fstoke.me/favicon.ico', @@ -51,7 +49,7 @@ function example_3() { x: 80, y: 80 }); - + // assign the dock area $.window.prepare({ dock: 'bottom', // change the dock direction: 'left', 'right', 'top', 'bottom' diff --git a/jquerymobile/jquerymobile-tests.ts b/jquerymobile/jquerymobile-tests.ts index 105edc3f88..e7fbf3bfff 100644 --- a/jquerymobile/jquerymobile-tests.ts +++ b/jquerymobile/jquerymobile-tests.ts @@ -1,6 +1,3 @@ -/// - - function test_api() { $.mobile.changePage("about/us.html", { transition: "slideup" }); $.mobile.changePage("searchresults.php", { diff --git a/jqueryui/jqueryui-tests.ts b/jqueryui/jqueryui-tests.ts index 2cce742f86..5755738622 100644 --- a/jqueryui/jqueryui-tests.ts +++ b/jqueryui/jqueryui-tests.ts @@ -1,6 +1,3 @@ -/// - - function test_draggable() { $("#draggable").draggable({ axis: "y" }); diff --git a/jsonwebtoken/jsonwebtoken-tests.ts b/jsonwebtoken/jsonwebtoken-tests.ts index 4a939becbc..e591f31159 100644 --- a/jsonwebtoken/jsonwebtoken-tests.ts +++ b/jsonwebtoken/jsonwebtoken-tests.ts @@ -1,10 +1,8 @@ -/** - * Test suite created by Maxime LUCE - * +/** + * Test suite created by Maxime LUCE + * * Created by using code samples from https://github.com/auth0/node-jsonwebtoken. - */ - -/// + */ import jwt = require("jsonwebtoken"); import fs = require("fs"); @@ -49,7 +47,7 @@ jwt.verify(token, 'shhhhh', function(err, decoded) { // invalid token jwt.verify(token, 'wrong-secret', function(err, decoded) { - // err + // err // decoded undefined }); diff --git a/jsrender/jsrender-tests.ts b/jsrender/jsrender-tests.ts index d728f968ae..7b5bf5a525 100644 --- a/jsrender/jsrender-tests.ts +++ b/jsrender/jsrender-tests.ts @@ -1,5 +1,3 @@ -/// - $.views.converters("upper", function(val) { return val.toUpperCase(); }); diff --git a/jsx-chai/jsx-chai-tests.ts b/jsx-chai/jsx-chai-tests.ts index d421ae0874..48c49e7b25 100644 --- a/jsx-chai/jsx-chai-tests.ts +++ b/jsx-chai/jsx-chai-tests.ts @@ -1,5 +1,3 @@ -/// - import chai = require('chai'); import jsxChai = require('jsx-chai'); diff --git a/kendo-ui/kendo-ui-tests.ts b/kendo-ui/kendo-ui-tests.ts index d1cc528edb..0b79f87954 100644 --- a/kendo-ui/kendo-ui-tests.ts +++ b/kendo-ui/kendo-ui-tests.ts @@ -1,6 +1,3 @@ -/// - - var is = { string: (msg: string) => { return true; diff --git a/klaw/klaw-tests.ts b/klaw/klaw-tests.ts index 312af220ff..acd8b2fcbf 100644 --- a/klaw/klaw-tests.ts +++ b/klaw/klaw-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as klaw from "klaw"; const path = require('path'); diff --git a/knockout-amd-helpers/knockout-amd-helpers-tests.ts b/knockout-amd-helpers/knockout-amd-helpers-tests.ts index d2773dee12..5b9c2983b5 100644 --- a/knockout-amd-helpers/knockout-amd-helpers-tests.ts +++ b/knockout-amd-helpers/knockout-amd-helpers-tests.ts @@ -1,8 +1,5 @@ // Tests for knockout.projections.d.ts -/// - - //The baseDir is used in building the path to use in the require statement. If your modules live in the modules directory, then you can specify it globally here. ko.bindingHandlers.module.baseDir = "blub"; diff --git a/knockout-transformations/knockout-transformations-tests.ts b/knockout-transformations/knockout-transformations-tests.ts index c8e93fc20e..6725f4f209 100644 --- a/knockout-transformations/knockout-transformations-tests.ts +++ b/knockout-transformations/knockout-transformations-tests.ts @@ -1,6 +1,3 @@ -/// - - // Test map var sourceItems: KnockoutObservableArray = ko.observableArray([1, 2, 3, 4, 5]); var squares: KnockoutObservableArray = sourceItems.map(function (x) { return x * x; }); diff --git a/knockout.kogrid/knockout.kogrid-tests.ts b/knockout.kogrid/knockout.kogrid-tests.ts index 8abe83d36d..ba36e78e9f 100644 --- a/knockout.kogrid/knockout.kogrid-tests.ts +++ b/knockout.kogrid/knockout.kogrid-tests.ts @@ -1,33 +1,27 @@ -/// +export interface IGridItem { + name: string; +} +export class Tests { + public items: KnockoutObservableArray; + public selectedItems: KnockoutObservableArray; + public gridOptionsAlarms: kg.GridOptions; -namespace KoGridTests -{ - export interface IGridItem { - name: string; - } + constructor() { + this.items = ko.observableArray(); + this.selectedItems = ko.observableArray(); + this.gridOptionsAlarms = this.createDefaultGridOptions(this.items, this.selectedItems); + } - export class Tests { - public items: KnockoutObservableArray; - public selectedItems: KnockoutObservableArray; - public gridOptionsAlarms: kg.GridOptions; - - constructor() { - this.items = ko.observableArray(); - this.selectedItems = ko.observableArray(); - this.gridOptionsAlarms = this.createDefaultGridOptions(this.items, this.selectedItems); - } - - public createDefaultGridOptions(dataArray: KnockoutObservableArray, selectedItems: KnockoutObservableArray): kg.GridOptions { - return { - data: dataArray, - displaySelectionCheckbox: false, - footerVisible: false, - multiSelect: false, - showColumnMenu: false, - plugins: null, - selectedItems: selectedItems - }; - } - } + public createDefaultGridOptions(dataArray: KnockoutObservableArray, selectedItems: KnockoutObservableArray): kg.GridOptions { + return { + data: dataArray, + displaySelectionCheckbox: false, + footerVisible: false, + multiSelect: false, + showColumnMenu: false, + plugins: null, + selectedItems: selectedItems + }; + } } diff --git a/knockout.mapping/knockout.mapping-tests.ts b/knockout.mapping/knockout.mapping-tests.ts index 7b1a9aca8d..6262f36275 100644 --- a/knockout.mapping/knockout.mapping-tests.ts +++ b/knockout.mapping/knockout.mapping-tests.ts @@ -1,6 +1,3 @@ - -/// - var inputJSON = '{ name: "foo" }'; var inputData = { name: 'foo' }; var inputModel = { name: 'bar' }; diff --git a/knockout.projections/knockout.projections-tests.ts b/knockout.projections/knockout.projections-tests.ts index c0899c81ee..bc8a505484 100644 --- a/knockout.projections/knockout.projections-tests.ts +++ b/knockout.projections/knockout.projections-tests.ts @@ -1,8 +1,3 @@ -// Tests for knockout.projections.d.ts - -/// - - // Test map var sourceItems = ko.observableArray([1, 2, 3, 4, 5]); var squares = sourceItems.map(function (x) { return x * x; }); diff --git a/knockout.punches/knockout.punches-tests.ts b/knockout.punches/knockout.punches-tests.ts index 1de89ca570..2eccd25d37 100644 --- a/knockout.punches/knockout.punches-tests.ts +++ b/knockout.punches/knockout.punches-tests.ts @@ -1,6 +1,3 @@ -/// - - function test_enable() { ko.punches.enableAll(); } diff --git a/knockstrap/knockstrap-tests.ts b/knockstrap/knockstrap-tests.ts index 2033252de2..2fb58fbaf7 100644 --- a/knockstrap/knockstrap-tests.ts +++ b/knockstrap/knockstrap-tests.ts @@ -1,9 +1,3 @@ -/// -/// -/// - - - // test unique id var adaskoUnitqueId: string = ko.utils.uniqueId('adaskothebeast'); diff --git a/ko.plus/ko.plus-tests.ts b/ko.plus/ko.plus-tests.ts index cbb86d3122..d3472c0d82 100644 --- a/ko.plus/ko.plus-tests.ts +++ b/ko.plus/ko.plus-tests.ts @@ -1,30 +1,9 @@ - -/// - -// Tests for ko.plus.d.ts -// Project: https://github.com/stevegreatrex/ko.plus -// Definitions by: Howard Richards -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* - Version 1.0 - initial commit - - Version 1.1 - added test for makeEditable - - Version 1.2 - amended callback on commmand.fail() method - accepts response, - status and message values - - Note: Typescript version 1.4 or higher is required for union types - and type declarations -*/ - function CommandTests() { - // initalize command with an execute method var cmd1 = ko.command(() => { return "Hello cmd1"; }); - + // initialize command and add done and fail callbacks var cmd2 = ko.command(() => { return "Hello cmd2"; @@ -56,7 +35,7 @@ function CommandTests() { // test execute the command cmd1(); - + // test properties of the commmand var isRunning = cmd1.isRunning(); var failed = cmd1.failed(); @@ -75,7 +54,7 @@ function EditableTests() { var edit3 = ko.editable({ test: true }); // with anything var edit4 = ko.editable(1); // with union types - var edit5 = ko.editable("test"); + var edit5 = ko.editable("test"); ko.editable.makeEditable(this); @@ -119,7 +98,7 @@ function EditableArrayTests() { function SortableTests() { - // sorting is added via an extender, there are no .d.ts + // sorting is added via an extender, there are no .d.ts // types for this at present var sort1 = ko.observableArray([1, 2, 3]).extend({ sortable: true }); diff --git a/koa-logger/koa-logger-tests.ts b/koa-logger/koa-logger-tests.ts index f2d17ba090..502c33255d 100644 --- a/koa-logger/koa-logger-tests.ts +++ b/koa-logger/koa-logger-tests.ts @@ -1,5 +1,3 @@ -/// - import * as koa from 'koa'; import * as logger from 'koa-logger'; diff --git a/kolite/kolite-tests.ts b/kolite/kolite-tests.ts index 539c284861..2ce3cbd0f0 100644 --- a/kolite/kolite-tests.ts +++ b/kolite/kolite-tests.ts @@ -1,6 +1,3 @@ -/// -/// - function test_activityDefaults() { ko.bindingHandlers.activity.defaultOptions = { activityClass: 'fa fa-spinner fa-spin', diff --git a/kue/kue-tests.ts b/kue/kue-tests.ts index a66dc4384c..aa61ff2f6a 100644 --- a/kue/kue-tests.ts +++ b/kue/kue-tests.ts @@ -1,5 +1,3 @@ -/// - import kue = require('kue'); // create our job queue diff --git a/leaflet-curve/leaflet-curve-tests.ts b/leaflet-curve/leaflet-curve-tests.ts index ec2461cbd2..3d8b319e63 100644 --- a/leaflet-curve/leaflet-curve-tests.ts +++ b/leaflet-curve/leaflet-curve-tests.ts @@ -1,5 +1,3 @@ -/// - var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmAttrib = '© OpenStreetMap contributors', osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}), diff --git a/leaflet-draw/leaflet-draw-tests.ts b/leaflet-draw/leaflet-draw-tests.ts index 4260eac263..6373687a03 100644 --- a/leaflet-draw/leaflet-draw-tests.ts +++ b/leaflet-draw/leaflet-draw-tests.ts @@ -1,5 +1,3 @@ -/// - var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', osmAttrib = '© OpenStreetMap contributors', osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}), diff --git a/libpq/libpq-tests.ts b/libpq/libpq-tests.ts index 8a9aced3c3..5736577e67 100644 --- a/libpq/libpq-tests.ts +++ b/libpq/libpq-tests.ts @@ -1,4 +1,3 @@ -/// /// import {Buffer} from 'buffer'; diff --git a/magicsuggest/magicsuggest-tests.ts b/magicsuggest/magicsuggest-tests.ts index 46cb799d25..96a513a7b9 100644 --- a/magicsuggest/magicsuggest-tests.ts +++ b/magicsuggest/magicsuggest-tests.ts @@ -1,5 +1,3 @@ -/// - function basicTest() { $('#magicSuggest').magicSuggest(); } diff --git a/mailcheck/mailcheck-tests.ts b/mailcheck/mailcheck-tests.ts index 07fc473893..971ecf8218 100644 --- a/mailcheck/mailcheck-tests.ts +++ b/mailcheck/mailcheck-tests.ts @@ -1,5 +1,3 @@ -/// - import MC = require('mailcheck'); var domains = ['gmail.com', 'aol.com']; diff --git a/markitup/markitup-tests.ts b/markitup/markitup-tests.ts index f8b12d3c00..b8a7675529 100644 --- a/markitup/markitup-tests.ts +++ b/markitup/markitup-tests.ts @@ -1,6 +1,3 @@ -/// - - // https://github.com/markitup/1.x/blob/master/markitup/sets/default/set.js var mySettings = { onShiftEnter: { diff --git a/maskedinput/maskedinput-tests.ts b/maskedinput/maskedinput-tests.ts index 6d620ce1b9..99c1ecb8bb 100644 --- a/maskedinput/maskedinput-tests.ts +++ b/maskedinput/maskedinput-tests.ts @@ -1,10 +1,3 @@ -// Type definitions for Masked Input plugin for jQuery -// Project: http://digitalbush.com/projects/masked-input-plugin -// Definitions by: Lokesh Peta -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/// - $("#test").mask("9:000"); $("#test").mask("9:000", { numeric: true }); diff --git a/material-ui/material-ui-tests.tsx b/material-ui/material-ui-tests.tsx index 06f75abe9a..0ea5a72352 100644 --- a/material-ui/material-ui-tests.tsx +++ b/material-ui/material-ui-tests.tsx @@ -1,8 +1,3 @@ -/// -/// -/// -/// - import * as React from 'react'; import {Component, PropTypes} from 'react'; import * as ReactDOM from 'react-dom'; diff --git a/mcustomscrollbar/mcustomscrollbar-tests.ts b/mcustomscrollbar/mcustomscrollbar-tests.ts index aecb236286..f00cd5a491 100644 --- a/mcustomscrollbar/mcustomscrollbar-tests.ts +++ b/mcustomscrollbar/mcustomscrollbar-tests.ts @@ -1,6 +1,3 @@ -/// - - class SimpleTest { element: JQuery; diff --git a/md5/md5-tests.ts b/md5/md5-tests.ts index 427a93486a..924c9b8d91 100644 --- a/md5/md5-tests.ts +++ b/md5/md5-tests.ts @@ -1,5 +1,3 @@ -/// - import fs = require("fs"); import md5 = require("md5"); /** @@ -7,7 +5,7 @@ import md5 = require("md5"); * md5(message) * message -- String or Buffer * returns String - * + * * Usage **************************************************** * var md5 = require('md5'); * @@ -15,10 +13,10 @@ import md5 = require("md5"); **************************************************** * This will print the following * 78e731027d8fd50ed642340b7c9a63b3 - * + * * It supports buffers, too - **************************************************** - * var fs = require('fs'); * + **************************************************** + * var fs = require('fs'); * * var md5 = require('md5'); * * * * fs.readFile('example.txt', function(err, buf) { * diff --git a/meteor-roles/meteor-roles-tests.ts b/meteor-roles/meteor-roles-tests.ts index 8f73f13208..50552c82ff 100644 --- a/meteor-roles/meteor-roles-tests.ts +++ b/meteor-roles/meteor-roles-tests.ts @@ -1,6 +1,3 @@ -/// - - import * as _ from 'underscore'; /** diff --git a/metismenu/metismenu-tests.ts b/metismenu/metismenu-tests.ts index eb17270021..64aa809cf7 100644 --- a/metismenu/metismenu-tests.ts +++ b/metismenu/metismenu-tests.ts @@ -1,5 +1,3 @@ -/// - $('#menu').metisMenu(); $('.metismenu').metisMenu({toggle: false}); diff --git a/mssql/mssql-tests.ts b/mssql/mssql-tests.ts index 52ae6f953c..764f6da8e1 100644 --- a/mssql/mssql-tests.ts +++ b/mssql/mssql-tests.ts @@ -1,5 +1,3 @@ -/// - import sql = require('mssql'); interface Entity{ diff --git a/mu2/mu2-tests.ts b/mu2/mu2-tests.ts index dc960f20d7..d85e1463b9 100644 --- a/mu2/mu2-tests.ts +++ b/mu2/mu2-tests.ts @@ -1,6 +1,3 @@ - -/// - import mu2 = require('mu2'); import stream = require('stream'); diff --git a/multiparty/multiparty-tests.ts b/multiparty/multiparty-tests.ts index be49092189..839ca92882 100644 --- a/multiparty/multiparty-tests.ts +++ b/multiparty/multiparty-tests.ts @@ -1,5 +1,3 @@ - -/// import multiparty = require('multiparty'); import http = require('http'); import util = require('util'); diff --git a/mz/mz-tests.ts b/mz/mz-tests.ts index 8246eecbab..7eda9f28bf 100644 --- a/mz/mz-tests.ts +++ b/mz/mz-tests.ts @@ -1,7 +1,4 @@ /// -/// - - import assert = require('assert') import fs = require('mz/fs') diff --git a/n3/n3-tests.ts b/n3/n3-tests.ts index a7e529bc7d..13247dfdb2 100644 --- a/n3/n3-tests.ts +++ b/n3/n3-tests.ts @@ -1,5 +1,3 @@ -/// - import * as N3 from "n3"; import * as fs from "fs"; import * as stream from "stream"; @@ -26,7 +24,7 @@ function test_serialize() { }); } -/** +/** The following tests are taken from ... https://github.com/RubenVerborgh/N3.js/blob/master/README.md */ diff --git a/ng-command/ng-command-tests.ts b/ng-command/ng-command-tests.ts index c6eb344ed7..32f9bef158 100644 --- a/ng-command/ng-command-tests.ts +++ b/ng-command/ng-command-tests.ts @@ -1,5 +1,3 @@ -/// - var app = angular.module('testModule', ['ng-command']); class CommandTestController { diff --git a/ng-dialog/ng-dialog-tests.ts b/ng-dialog/ng-dialog-tests.ts index 6c867f422d..b66ed173b7 100644 --- a/ng-dialog/ng-dialog-tests.ts +++ b/ng-dialog/ng-dialog-tests.ts @@ -1,4 +1,3 @@ -/// import * as angular from 'angular'; var app = angular.module('testModule', ['ngDialog']); diff --git a/ng-grid/ng-grid-tests.ts b/ng-grid/ng-grid-tests.ts index f14e9cb540..c6331fdc15 100644 --- a/ng-grid/ng-grid-tests.ts +++ b/ng-grid/ng-grid-tests.ts @@ -1,5 +1,3 @@ -/// - var options1: ngGrid.IGridOptions = { data: [{ 'Name': 'Bob' }, { 'Name': 'Jane' }] }; diff --git a/ng-notify/ng-notify-tests.ts b/ng-notify/ng-notify-tests.ts index e140cb6130..9f81d25e87 100644 --- a/ng-notify/ng-notify-tests.ts +++ b/ng-notify/ng-notify-tests.ts @@ -1,5 +1,3 @@ -/// - class NgNotifyTestController { static $inject = ['$scope', 'ngNotify']; diff --git a/ngprogress-lite/ngprogress-lite-tests.ts b/ngprogress-lite/ngprogress-lite-tests.ts index c7df7f9b6b..c4b903d78b 100644 --- a/ngprogress-lite/ngprogress-lite-tests.ts +++ b/ngprogress-lite/ngprogress-lite-tests.ts @@ -1,6 +1,3 @@ -/// - - var app = angular.module('testApp', ['ngProgressLite']); app.config( diff --git a/node-hue-api/node-hue-api-tests.ts b/node-hue-api/node-hue-api-tests.ts index 44903fa4da..44e24da9b1 100644 --- a/node-hue-api/node-hue-api-tests.ts +++ b/node-hue-api/node-hue-api-tests.ts @@ -1,5 +1,3 @@ -/// - import hue = require('node-hue-api'); hue.nupnpSearch().then(function (bridges) { diff --git a/node-int64/node-int64-tests.ts b/node-int64/node-int64-tests.ts index 16df3a00ca..3235efa3d8 100644 --- a/node-int64/node-int64-tests.ts +++ b/node-int64/node-int64-tests.ts @@ -1,9 +1,5 @@ -/// - // Play example copy - - // First, let's illustrate the problem ... (0x123456789).toString(16); //!! '123456789' // <- what we expect. diff --git a/node-mysql-wrapper/node-mysql-wrapper-tests.ts b/node-mysql-wrapper/node-mysql-wrapper-tests.ts index 5b67969ffe..2811292fe6 100644 --- a/node-mysql-wrapper/node-mysql-wrapper-tests.ts +++ b/node-mysql-wrapper/node-mysql-wrapper-tests.ts @@ -1,7 +1,3 @@ - -/// -/// - var express = require('express'); var app = express(); var server = require('http').createServer(app); diff --git a/nouislider/v7/nouislider-tests.ts b/nouislider/v7/nouislider-tests.ts index 0bb6023774..08f9ebd74d 100644 --- a/nouislider/v7/nouislider-tests.ts +++ b/nouislider/v7/nouislider-tests.ts @@ -1,6 +1,3 @@ - -/// - //basic var basicSlider = $("
    ").noUiSlider({ start: 80, diff --git a/npm/npm-tests.ts b/npm/npm-tests.ts index ccebbdb35a..8ca5f01887 100644 --- a/npm/npm-tests.ts +++ b/npm/npm-tests.ts @@ -4,9 +4,6 @@ * Created by using code samples from https://github.com/npm/npm#using-npm-programmatically. */ -/// - - import npm = require("npm"); npm.load({}, function (er) { diff --git a/on-finished/on-finished-tests.ts b/on-finished/on-finished-tests.ts index 57040531fc..081e2cd37b 100644 --- a/on-finished/on-finished-tests.ts +++ b/on-finished/on-finished-tests.ts @@ -1,5 +1,3 @@ -/// - import events = require('events'); import onFinished = require('on-finished'); diff --git a/onoff/onoff-tests.ts b/onoff/onoff-tests.ts index cd39dc4a8d..21b47e7f99 100644 --- a/onoff/onoff-tests.ts +++ b/onoff/onoff-tests.ts @@ -1,5 +1,3 @@ - -/// import * as onoff from 'onoff'; var led:onoff.Gpio = new onoff.Gpio(17, 'out'); diff --git a/openui5/openui5-tests.ts b/openui5/openui5-tests.ts index 8dc19922ee..bb411a9a1e 100644 --- a/openui5/openui5-tests.ts +++ b/openui5/openui5-tests.ts @@ -1,7 +1,3 @@ -/// -/// -/// - sap.ui.getCore().attachInit(function () { new sap.m.Text({ text: "Hello World" diff --git a/oracledb/oracledb-tests.ts b/oracledb/oracledb-tests.ts index 15446df243..b4d1cf5fe9 100644 --- a/oracledb/oracledb-tests.ts +++ b/oracledb/oracledb-tests.ts @@ -1,5 +1,3 @@ -/// - import * as OracleDB from 'oracledb'; OracleDB.getConnection( diff --git a/owlcarousel/owlcarousel-tests.ts b/owlcarousel/owlcarousel-tests.ts index 3d9ed9a69b..0d2e1b6118 100644 --- a/owlcarousel/owlcarousel-tests.ts +++ b/owlcarousel/owlcarousel-tests.ts @@ -1,6 +1,3 @@ -/// - - $(".className").owlCarousel(); $(".className").owlCarousel({ diff --git a/passport-beam/passport-beam-tests.ts b/passport-beam/passport-beam-tests.ts index edfa3f1396..4448dad045 100644 --- a/passport-beam/passport-beam-tests.ts +++ b/passport-beam/passport-beam-tests.ts @@ -1,5 +1,3 @@ -/// - /** * Created by AtlasDev on 4/10/2016. */ diff --git a/passport-http/passport-http-tests.ts b/passport-http/passport-http-tests.ts index 22a486e6ec..4a70d30b89 100644 --- a/passport-http/passport-http-tests.ts +++ b/passport-http/passport-http-tests.ts @@ -1,5 +1,3 @@ -/// - /** * Created by Christophe Vidal */ diff --git a/paymentrequest/paymentrequest-tests.ts b/paymentrequest/paymentrequest-tests.ts index 62c2721bfb..c8772b115c 100644 --- a/paymentrequest/paymentrequest-tests.ts +++ b/paymentrequest/paymentrequest-tests.ts @@ -1,5 +1,3 @@ -/// - /// Code examples derived from /// https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/ diff --git a/peerjs/peerjs-tests.ts b/peerjs/peerjs-tests.ts index 373df3ba2f..2246e6a8fd 100644 --- a/peerjs/peerjs-tests.ts +++ b/peerjs/peerjs-tests.ts @@ -1,5 +1,3 @@ -/// - var peerByOption: PeerJs.Peer = new Peer({ key: 'peerKey', debug: 3, diff --git a/phantomcss/index.d.ts b/phantomcss/index.d.ts index 451c250372..688c706199 100644 --- a/phantomcss/index.d.ts +++ b/phantomcss/index.d.ts @@ -3,8 +3,8 @@ // Definitions by: Amaury Bauzac // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -import { Casper } from 'casperjs'; /// +import { Casper } from 'casperjs'; declare global { namespace PhantomCSS { diff --git a/phantomcss/phantomcss-tests.ts b/phantomcss/phantomcss-tests.ts index 8478bbd323..ee16832fae 100644 --- a/phantomcss/phantomcss-tests.ts +++ b/phantomcss/phantomcss-tests.ts @@ -1,7 +1,3 @@ - -/// -/// - // phantomCSS 0.11.1 is based on resemblejs 1.2.1, phantomJS 1.9.2 , casperJS 1.1.0-DEV var options: PhantomCSS.PhantomCSSOptions = { @@ -39,8 +35,8 @@ var options: PhantomCSS.PhantomCSSOptions = { }); }, - fileNameGetter: function(root:string,filename:string){ - + fileNameGetter: function(root:string,filename:string){ + return root+filename; }, @@ -65,7 +61,7 @@ declare var phantomcss:PhantomCSS.PhantomCSS; phantomcss.turnOffAnimations(); phantomcss.init(options); -phantomcss.compareAll('exclude.test'); +phantomcss.compareAll('exclude.test'); phantomcss.compareMatched('include.test', 'exclude.test'); phantomcss.compareMatched( new RegExp('include.test'), new RegExp('exclude.test')); phantomcss.compareSession(); diff --git a/phonon/phonon-tests.ts b/phonon/phonon-tests.ts index b817fef45b..6b9851b642 100644 --- a/phonon/phonon-tests.ts +++ b/phonon/phonon-tests.ts @@ -1,5 +1,3 @@ -/// - // Code examples from http://phonon.quarkdev.com/docs/navigator phonon.options({ navigator: { diff --git a/piwik-tracker/piwik-tracker-tests.ts b/piwik-tracker/piwik-tracker-tests.ts index 3e7506d5fd..f1545a843a 100644 --- a/piwik-tracker/piwik-tracker-tests.ts +++ b/piwik-tracker/piwik-tracker-tests.ts @@ -1,22 +1,20 @@ -/// - // Example code taken from https://www.npmjs.com/package/piwik-tracker var PiwikTracker = require('piwik-tracker'); - -// Initialize with your site ID and Piwik URL + +// Initialize with your site ID and Piwik URL var piwik = new PiwikTracker(1, 'http://mywebsite.com/piwik.php'); - -// Optional: Respond to tracking errors + +// Optional: Respond to tracking errors piwik.on('error', function(err : Error) { console.log('error tracking request: ', err) }) - -// Track a request URL: -// Either as a simple string … + +// Track a request URL: +// Either as a simple string … piwik.track('http://example.com/track/this/url'); - -// … or provide further options: + +// … or provide further options: piwik.track({ url: 'http://example.com/track/this/url', action_name: 'This will be shown in your dashboard', diff --git a/pkcs11js/pkcs11js-tests.ts b/pkcs11js/pkcs11js-tests.ts index 52ffd4e8f8..30501be11f 100644 --- a/pkcs11js/pkcs11js-tests.ts +++ b/pkcs11js/pkcs11js-tests.ts @@ -1,5 +1,3 @@ -/// - import * as pkcs11js from "pkcs11js"; const libPath = "C:\\tmp\\rtpkcs11ecp.dll"; diff --git a/pouchdb-find/pouchdb-find-tests.ts b/pouchdb-find/pouchdb-find-tests.ts index 8d677276fc..bebdc58cc1 100644 --- a/pouchdb-find/pouchdb-find-tests.ts +++ b/pouchdb-find/pouchdb-find-tests.ts @@ -1,5 +1,3 @@ -/// - namespace PouchDBFindTests { function testFind() { diff --git a/pouchdb-replication/pouchdb-replication-tests.ts b/pouchdb-replication/pouchdb-replication-tests.ts index 6ff426bd0c..3cb6d6bc17 100644 --- a/pouchdb-replication/pouchdb-replication-tests.ts +++ b/pouchdb-replication/pouchdb-replication-tests.ts @@ -1,5 +1,3 @@ -/// - namespace PouchDBReplicationTests { /** @todo make some real tests */ diff --git a/project-oxford/project-oxford-tests.ts b/project-oxford/project-oxford-tests.ts index d04a77a762..ea2849d986 100644 --- a/project-oxford/project-oxford-tests.ts +++ b/project-oxford/project-oxford-tests.ts @@ -1,6 +1,3 @@ - -/// -/// /// import oxford = require("project-oxford"); diff --git a/promised-temp/promised-temp-tests.ts b/promised-temp/promised-temp-tests.ts index ebe0a51517..ec14855d8b 100644 --- a/promised-temp/promised-temp-tests.ts +++ b/promised-temp/promised-temp-tests.ts @@ -1,6 +1,3 @@ - -/// - import * as fs from "fs"; import temp from 'promised-temp'; import { AffixOptions, OpenFile, Stats } from "promised-temp"; diff --git a/promptly/promptly-tests.ts b/promptly/promptly-tests.ts index 05b8bf70ed..fbd1fd5bb7 100644 --- a/promptly/promptly-tests.ts +++ b/promptly/promptly-tests.ts @@ -1,5 +1,3 @@ -/// - import promptly = require('promptly'); process.stdin diff --git a/radius/radius-tests.ts b/radius/radius-tests.ts index c3b50db8ec..36e9ea618d 100644 --- a/radius/radius-tests.ts +++ b/radius/radius-tests.ts @@ -1,6 +1,3 @@ - -/// - import radius = require('radius'); var radius_secret: string = "shhhh" diff --git a/rangyinputs/rangyinputs-tests.ts b/rangyinputs/rangyinputs-tests.ts index cb627d85b1..14f769a9fe 100644 --- a/rangyinputs/rangyinputs-tests.ts +++ b/rangyinputs/rangyinputs-tests.ts @@ -1,5 +1,3 @@ -/// - let $obj: JQuery = $('meh'); let selection: RangyInputs.Selection = $obj.getSelection(); diff --git a/raty/raty-tests.ts b/raty/raty-tests.ts index bb2f731038..51b510b0a3 100644 --- a/raty/raty-tests.ts +++ b/raty/raty-tests.ts @@ -1,7 +1,3 @@ -/// - - - var $element: JQuery = $('
    '); $element.raty(); diff --git a/rc-select/rc-select-tests.ts b/rc-select/rc-select-tests.ts index f2ec85ae09..976d789c2c 100644 --- a/rc-select/rc-select-tests.ts +++ b/rc-select/rc-select-tests.ts @@ -1,10 +1,7 @@ - -/// - import React = require('react'); import RcSelect = require('rc-select'); -class Component extends React.Component { +class Component extends React.Component { private onChange(value: any) { console.log('selected', value); @@ -54,7 +51,7 @@ class Component extends React.Component { className: "option", disabled: true, key: "option-0", - value: "option-0" + value: "option-0" }; private createOptions(count: number) { @@ -75,7 +72,7 @@ class Component extends React.Component { let options = this.createOptions(10); - let optionGroup = React.createElement(RcSelect.OptGroup, this.defaultOptGroupProps, options); + let optionGroup = React.createElement(RcSelect.OptGroup, this.defaultOptGroupProps, options); let select = React.createElement(RcSelect.default, this.defaultSelectProps, optionGroup); diff --git a/react-bootstrap/react-bootstrap-tests.tsx b/react-bootstrap/react-bootstrap-tests.tsx index 987203fbf8..432636559b 100644 --- a/react-bootstrap/react-bootstrap-tests.tsx +++ b/react-bootstrap/react-bootstrap-tests.tsx @@ -1,9 +1,3 @@ -// React-Bootstrap Test -// ================================================================================ -/// - -// Imports -// -------------------------------------------------------------------------------- import * as React from 'react'; import { Component, CSSProperties } from 'react'; import { diff --git a/react-datagrid/react-datagrid-tests.tsx b/react-datagrid/react-datagrid-tests.tsx index 061be471f4..bdbca39f01 100644 --- a/react-datagrid/react-datagrid-tests.tsx +++ b/react-datagrid/react-datagrid-tests.tsx @@ -1,6 +1,3 @@ - -/// - import * as React from "react"; import ReactDataGrid = require("react-datagrid"); diff --git a/react-dnd-html5-backend/react-dnd-html5-backend-tests.ts b/react-dnd-html5-backend/react-dnd-html5-backend-tests.ts index 83ee1bc9ba..68703d062d 100644 --- a/react-dnd-html5-backend/react-dnd-html5-backend-tests.ts +++ b/react-dnd-html5-backend/react-dnd-html5-backend-tests.ts @@ -1,5 +1,3 @@ -"use strict"; - // Test adapted from the ReactDnD chess game tutorial: // http://gaearon.github.io/react-dnd/docs-tutorial.html diff --git a/react-dnd/UNUSED_FILES.txt b/react-dnd/UNUSED_FILES.txt deleted file mode 100644 index ff694923a2..0000000000 --- a/react-dnd/UNUSED_FILES.txt +++ /dev/null @@ -1 +0,0 @@ -react-dnd-test-backend.d.ts \ No newline at end of file diff --git a/react-dnd/react-dnd-test-backend.d.ts b/react-dnd/react-dnd-test-backend.d.ts deleted file mode 100644 index 095c890483..0000000000 --- a/react-dnd/react-dnd-test-backend.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -// Type definitions for React DnD HTML 5 Backend v2.0.0 -// Project: https://github.com/gaearon/react-dnd -// Definitions by: Asana -// Definitions: https://github.com/borisyankov/DefinitelyTyped - -declare module "react-dnd-test-backend" { - class TestBackend { - setup(): void; - teardown(): void; - connectDragSource(): void; - connectDropTarget(): void; - simulateBeginDrag(sourceIds: __ReactDnd.Identifier[], options?: {}): void; - simulatePublishDragSource(): void; - simulateHover(targetIds: __ReactDnd.Identifier[], options?: {}): void; - simulateDrop(): void; - simulateEndDrag(): void; - } - - export { TestBackend as default }; -} diff --git a/react-dnd/react-dnd-tests.ts b/react-dnd/react-dnd-tests.ts index fdef2b727c..0aabefd26e 100644 --- a/react-dnd/react-dnd-tests.ts +++ b/react-dnd/react-dnd-tests.ts @@ -1,6 +1,3 @@ -/// -"use strict"; - // Test adapted from the ReactDnD chess game tutorial: // http://gaearon.github.io/react-dnd/docs-tutorial.html @@ -14,7 +11,17 @@ import DropTarget = ReactDnd.DropTarget; import DragLayer = ReactDnd.DragLayer; import DragDropContext = ReactDnd.DragDropContext; import HTML5Backend, { getEmptyImage, NativeTypes } from "react-dnd-html5-backend"; -import TestBackend from "react-dnd-test-backend"; +declare class TestBackend { + setup(): void; + teardown(): void; + connectDragSource(): void; + connectDropTarget(): void; + simulateBeginDrag(sourceIds: __ReactDnd.Identifier[], options?: {}): void; + simulatePublishDragSource(): void; + simulateHover(targetIds: __ReactDnd.Identifier[], options?: {}): void; + simulateDrop(): void; + simulateEndDrag(): void; +} // Game Component // ---------------------------------------------------------------------- diff --git a/react-dropzone/react-dropzone-tests.tsx b/react-dropzone/react-dropzone-tests.tsx index 322fd82e8c..ec6d5fa763 100644 --- a/react-dropzone/react-dropzone-tests.tsx +++ b/react-dropzone/react-dropzone-tests.tsx @@ -1,5 +1,3 @@ -/// -/// import * as React from 'react'; import * as Dropzone from 'react-dropzone'; diff --git a/react-helmet/react-helmet-tests.tsx b/react-helmet/react-helmet-tests.tsx index 3a4a3f09d7..e6b78955b3 100644 --- a/react-helmet/react-helmet-tests.tsx +++ b/react-helmet/react-helmet-tests.tsx @@ -1,6 +1,3 @@ - -/// - import * as React from 'react'; import * as Helmet from 'react-helmet'; diff --git a/react-infinite/react-infinite-tests.tsx b/react-infinite/react-infinite-tests.tsx index 807fc67498..ea68999afc 100644 --- a/react-infinite/react-infinite-tests.tsx +++ b/react-infinite/react-infinite-tests.tsx @@ -1,6 +1,3 @@ -/// -/// - import * as React from 'react'; import Infinite = require('react-infinite'); diff --git a/react-input-calendar/react-input-calendar-tests.tsx b/react-input-calendar/react-input-calendar-tests.tsx index aaab1dc398..4cd465d9c5 100644 --- a/react-input-calendar/react-input-calendar-tests.tsx +++ b/react-input-calendar/react-input-calendar-tests.tsx @@ -1,6 +1,3 @@ -/// -/// - import * as ReactInputCalendar from 'react-input-calendar'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; diff --git a/react-intl/react-intl-tests.tsx b/react-intl/react-intl-tests.tsx index 400879677f..d3477aaa11 100644 --- a/react-intl/react-intl-tests.tsx +++ b/react-intl/react-intl-tests.tsx @@ -3,8 +3,6 @@ * Updated by Fedor Nezhivoi */ -/// - import * as React from "react" import * as reactMixin from "react-mixin" diff --git a/react-intl/v1/react-intl-tests.tsx b/react-intl/v1/react-intl-tests.tsx index 6abebe36cd..c7834b6583 100644 --- a/react-intl/v1/react-intl-tests.tsx +++ b/react-intl/v1/react-intl-tests.tsx @@ -2,8 +2,6 @@ * Created by Bruno Grieder */ -/// - import * as React from 'react' import * as reactMixin from 'react-mixin' diff --git a/react-mixin/react-mixin-tests.tsx b/react-mixin/react-mixin-tests.tsx index 04f6f4b202..f275869a9e 100644 --- a/react-mixin/react-mixin-tests.tsx +++ b/react-mixin/react-mixin-tests.tsx @@ -1,6 +1,3 @@ - -/// - import reactMixin = require('react-mixin'); import * as React from 'react'; diff --git a/react-native/test/animated.tsx b/react-native/test/animated.tsx index 632f2c0151..3b3457384c 100644 --- a/react-native/test/animated.tsx +++ b/react-native/test/animated.tsx @@ -1,5 +1,3 @@ -/// - import * as React from 'react-native' import { diff --git a/react-native/test/index.tsx b/react-native/test/index.tsx index 6e05cdeabe..32bcbe931b 100644 --- a/react-native/test/index.tsx +++ b/react-native/test/index.tsx @@ -1,8 +1,4 @@ - /* - -Note: This must be compiled with the target set to ES6 - The content of index.io.js could be something like 'use strict'; @@ -12,13 +8,8 @@ The content of index.io.js could be something like AppRegistry.registerComponent('MopNative', () => Welcome); - For a list of complete Typescript examples: check https://github.com/bgrieder/RNTSExplorer - - */ - -/// - +*/ import * as React from 'react-native' import { diff --git a/react-onclickoutside/react-onclickoutside-tests.tsx b/react-onclickoutside/react-onclickoutside-tests.tsx index dabba332b1..fc782bb68c 100644 --- a/react-onclickoutside/react-onclickoutside-tests.tsx +++ b/react-onclickoutside/react-onclickoutside-tests.tsx @@ -1,8 +1,3 @@ -// React onClickOutside Test -// ================================================================================ - -// Imports -// -------------------------------------------------------------------------------- import * as React from "react" import { Component, StatelessComponent, MouseEvent } from "react" import { render } from "react-dom" diff --git a/react-props-decorators/react-props-decorators-tests.ts b/react-props-decorators/react-props-decorators-tests.ts index 562d4f3d12..654c2df98f 100644 --- a/react-props-decorators/react-props-decorators-tests.ts +++ b/react-props-decorators/react-props-decorators-tests.ts @@ -1,6 +1,3 @@ - -/// - import * as React from 'react'; import { propTypes, defaultProps } from 'react-props-decorators'; diff --git a/react-router-bootstrap/react-router-bootstrap-tests.tsx b/react-router-bootstrap/react-router-bootstrap-tests.tsx index d4f8733c03..7816933fe6 100644 --- a/react-router-bootstrap/react-router-bootstrap-tests.tsx +++ b/react-router-bootstrap/react-router-bootstrap-tests.tsx @@ -1,16 +1,8 @@ -// React-Router-Bootstrap Test -// ================================================================================ -/// -/// - -// Imports -// -------------------------------------------------------------------------------- import * as React from 'react'; import { Component, CSSProperties } from 'react'; import { Button } from 'react-bootstrap'; import { LinkContainer, IndexLinkContainer } from 'react-router-bootstrap' - export class ReactRouterBootstrapTest extends Component { callback() { alert('Callback: ' + JSON.stringify(arguments)); @@ -20,7 +12,7 @@ export class ReactRouterBootstrapTest extends Component { let style: CSSProperties = { padding: '50px' }; return (
    - +
    diff --git a/react-scroll/react-scroll-tests.tsx b/react-scroll/react-scroll-tests.tsx index b5d2fb2245..63db573722 100644 --- a/react-scroll/react-scroll-tests.tsx +++ b/react-scroll/react-scroll-tests.tsx @@ -1,5 +1,3 @@ -/// - import * as React from 'react'; import { Link, Element, scroller } from 'react-scroll'; diff --git a/react-spinkit/react-spinkit-tests.tsx b/react-spinkit/react-spinkit-tests.tsx index a163400601..8ceb7b0a89 100644 --- a/react-spinkit/react-spinkit-tests.tsx +++ b/react-spinkit/react-spinkit-tests.tsx @@ -1,6 +1,3 @@ - -/// - import * as Spinner from 'react-spinkit'; import * as React from 'react'; diff --git a/react-tabs/react-tabs-tests.ts b/react-tabs/react-tabs-tests.ts index b067987518..9998bcafbd 100644 --- a/react-tabs/react-tabs-tests.ts +++ b/react-tabs/react-tabs-tests.ts @@ -1,7 +1,3 @@ - -/// -/// - import React = require("react"); import ReactDOM = require("react-dom"); import { Tabs, TabList, Tab, TabPanel } from "react-tabs"; diff --git a/react-tagcloud/react-tagcloud-tests.tsx b/react-tagcloud/react-tagcloud-tests.tsx index d0594314bc..552cc20e2d 100644 --- a/react-tagcloud/react-tagcloud-tests.tsx +++ b/react-tagcloud/react-tagcloud-tests.tsx @@ -1,8 +1,3 @@ -/// -/// - - - // simple cloud import * as React from "react"; import * as ReactDOM from "react-dom"; diff --git a/react-widgets/react-widgets-tests.tsx b/react-widgets/react-widgets-tests.tsx index a108d8e513..0f66458c36 100644 --- a/react-widgets/react-widgets-tests.tsx +++ b/react-widgets/react-widgets-tests.tsx @@ -1,8 +1,3 @@ - -/// -/// - - import * as React from "react" import * as ReactDOM from "react-dom" @@ -45,10 +40,10 @@ class Test extends React.Component, {}> { itemComponent={itemComponent} />
    diff --git a/readdir-stream/readdir-stream-tests.ts b/readdir-stream/readdir-stream-tests.ts index f0a2dba78b..d808bc5b6d 100644 --- a/readdir-stream/readdir-stream-tests.ts +++ b/readdir-stream/readdir-stream-tests.ts @@ -1,6 +1,3 @@ - -/// - import readdir = require('readdir-stream'); var rs: NodeJS.ReadableStream; diff --git a/redux-debounced/redux-debounced-tests.ts b/redux-debounced/redux-debounced-tests.ts index f33050e394..ad83e40bc5 100644 --- a/redux-debounced/redux-debounced-tests.ts +++ b/redux-debounced/redux-debounced-tests.ts @@ -1,5 +1,3 @@ -/// - import { applyMiddleware } from 'redux'; import createDebounce from 'redux-debounced'; diff --git a/redux-devtools-dock-monitor/redux-devtools-dock-monitor-tests.tsx b/redux-devtools-dock-monitor/redux-devtools-dock-monitor-tests.tsx index 5a99ba665a..7e33588a41 100644 --- a/redux-devtools-dock-monitor/redux-devtools-dock-monitor-tests.tsx +++ b/redux-devtools-dock-monitor/redux-devtools-dock-monitor-tests.tsx @@ -1,5 +1,3 @@ -/// - import * as React from 'react' import DockMonitor from 'redux-devtools-dock-monitor' diff --git a/redux-devtools-log-monitor/redux-devtools-log-monitor-tests.tsx b/redux-devtools-log-monitor/redux-devtools-log-monitor-tests.tsx index 48a655bea2..477f4bbc55 100644 --- a/redux-devtools-log-monitor/redux-devtools-log-monitor-tests.tsx +++ b/redux-devtools-log-monitor/redux-devtools-log-monitor-tests.tsx @@ -1,5 +1,3 @@ -/// - import * as React from 'react' import LogMonitor from 'redux-devtools-log-monitor' diff --git a/redux-devtools/redux-devtools-tests.tsx b/redux-devtools/redux-devtools-tests.tsx index 10e20b7e87..695fbe60ff 100644 --- a/redux-devtools/redux-devtools-tests.tsx +++ b/redux-devtools/redux-devtools-tests.tsx @@ -1,6 +1,3 @@ -/// -/// - import * as React from 'react' import { compose, createStore, Reducer, Store, StoreEnhancerStoreCreator } from 'redux' import { Provider } from 'react-redux' diff --git a/resolve/resolve-tests.ts b/resolve/resolve-tests.ts index 3cac830c58..1f9f50b5ee 100644 --- a/resolve/resolve-tests.ts +++ b/resolve/resolve-tests.ts @@ -1,5 +1,3 @@ -/// - import * as fs from 'fs'; import * as resolve from 'resolve'; diff --git a/rx.wamp/rx.wamp-tests.ts b/rx.wamp/rx.wamp-tests.ts index 2b6d4c95bc..3bd6ddbffb 100644 --- a/rx.wamp/rx.wamp-tests.ts +++ b/rx.wamp/rx.wamp-tests.ts @@ -1,6 +1,3 @@ - -/// - import * as autobahn from "autobahn"; import {IWampEvent} from "rx.wamp"; diff --git a/s3-upload-stream/s3-upload-stream-tests.ts b/s3-upload-stream/s3-upload-stream-tests.ts index ef03000ad2..0f02beb63f 100644 --- a/s3-upload-stream/s3-upload-stream-tests.ts +++ b/s3-upload-stream/s3-upload-stream-tests.ts @@ -1,6 +1,3 @@ -/// -/// - import * as fs from 'fs'; import * as S3Stream from 's3-upload-stream'; import * as AWS from 'aws-sdk'; diff --git a/sax/sax-tests.ts b/sax/sax-tests.ts index 4d9a90293d..5b11ab425e 100644 --- a/sax/sax-tests.ts +++ b/sax/sax-tests.ts @@ -1,5 +1,3 @@ -/// - import sax = require("sax"); import fs = require("fs"); diff --git a/seamless/seamless-tests.ts b/seamless/seamless-tests.ts index 4aa1ab3aba..40ba1868be 100644 --- a/seamless/seamless-tests.ts +++ b/seamless/seamless-tests.ts @@ -1,5 +1,3 @@ -/// - /* Create Parent Seamless IFrame */ $('#myiframe').seamless(); $('#myiframe').seamless({ diff --git a/select2/select2-tests.ts b/select2/select2-tests.ts index ade378ee71..c10b482cab 100644 --- a/select2/select2-tests.ts +++ b/select2/select2-tests.ts @@ -1,6 +1,3 @@ -/// - - $("#e9").select2(); $("#e2").select2({ placeholder: "Select a State", diff --git a/selectize/selectize-tests.ts b/selectize/selectize-tests.ts index b2ec9e0a29..10b12c91f2 100644 --- a/selectize/selectize-tests.ts +++ b/selectize/selectize-tests.ts @@ -1,6 +1,3 @@ -/// - - var $input = $(".test-input").selectize(); var testApi = $input[0].selectize; diff --git a/shelljs/shelljs-tests.ts b/shelljs/shelljs-tests.ts index 6c155e5aee..03f439af02 100644 --- a/shelljs/shelljs-tests.ts +++ b/shelljs/shelljs-tests.ts @@ -1,11 +1,5 @@ -// Tests for shelljs.d.ts -// Project: http://shelljs.org -// Definitions by: Niklas Mollenhauer -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Tests taken from documentation samples. -/// - import shell = require("shelljs"); if (!shell.which("git")) diff --git a/sinon-as-promised/sinon-as-promised-tests.ts b/sinon-as-promised/sinon-as-promised-tests.ts index 10602a3e8d..4663c1df12 100644 --- a/sinon-as-promised/sinon-as-promised-tests.ts +++ b/sinon-as-promised/sinon-as-promised-tests.ts @@ -1,5 +1,3 @@ -/// - function testResolve() { sinon.stub().resolves('test val'); } diff --git a/sinon-mongoose/sinon-mongoose-tests.ts b/sinon-mongoose/sinon-mongoose-tests.ts index b58a4e5e58..c64030240e 100644 --- a/sinon-mongoose/sinon-mongoose-tests.ts +++ b/sinon-mongoose/sinon-mongoose-tests.ts @@ -1,5 +1,3 @@ -/// - function testChain() { sinon.stub().chain('exec'); } diff --git a/slick-carousel/slick-carousel-tests.ts b/slick-carousel/slick-carousel-tests.ts index 5cb75a619d..3cf05a2e0c 100644 --- a/slick-carousel/slick-carousel-tests.ts +++ b/slick-carousel/slick-carousel-tests.ts @@ -1,7 +1,3 @@ -/// -/// - - // -------------------------------------------------------- // ------------------- WEBSITE EXAMPLE -------------------- // ---------- http://kenwheeler.github.io/slick/ ---------- diff --git a/slickgrid/test/index.ts b/slickgrid/test/index.ts index e6570c2985..d87bc2240c 100644 --- a/slickgrid/test/index.ts +++ b/slickgrid/test/index.ts @@ -1,6 +1,3 @@ -/// - - interface MyData extends Slick.SlickData { title: string; duration: string; diff --git a/socket.io-redis/socket.io-redis-tests.ts b/socket.io-redis/socket.io-redis-tests.ts index 28b0f9873f..6ced0b31de 100644 --- a/socket.io-redis/socket.io-redis-tests.ts +++ b/socket.io-redis/socket.io-redis-tests.ts @@ -1,5 +1,3 @@ -/// - import socketIO = require('socket.io'); import ioRedis = require('socket.io-redis'); import redis = require('redis'); diff --git a/socket.io.users/socket.io.users-tests.ts b/socket.io.users/socket.io.users-tests.ts index 565f6a7d7b..24557ef6c5 100644 --- a/socket.io.users/socket.io.users-tests.ts +++ b/socket.io.users/socket.io.users-tests.ts @@ -1,7 +1,3 @@ -/// - -/// - var express = require('express'); var app = express(); var httpServer = require('http').createServer(app); diff --git a/source-list-map/source-list-map-tests.ts b/source-list-map/source-list-map-tests.ts index 5fe932efc5..8c367d582c 100644 --- a/source-list-map/source-list-map-tests.ts +++ b/source-list-map/source-list-map-tests.ts @@ -1,4 +1,3 @@ -/// import * as slm from 'source-list-map'; const node = new slm.CodeNode('hello'); diff --git a/spectrum/spectrum-tests.ts b/spectrum/spectrum-tests.ts index e9bf388bbe..e52bd36ce9 100644 --- a/spectrum/spectrum-tests.ts +++ b/spectrum/spectrum-tests.ts @@ -1,6 +1,3 @@ -/// - - $("#picker").spectrum(); $("#picker").spectrum({ diff --git a/split/split-tests.ts b/split/split-tests.ts index 204a044b68..98308fbc10 100644 --- a/split/split-tests.ts +++ b/split/split-tests.ts @@ -1,6 +1,3 @@ - -/// - import stream = require("stream"); import split = require("split"); diff --git a/sql.js/sql.js-tests.ts b/sql.js/sql.js-tests.ts index 0829f7692a..52f44c7438 100644 --- a/sql.js/sql.js-tests.ts +++ b/sql.js/sql.js-tests.ts @@ -1,6 +1,3 @@ -/// - - import fs = require("fs"); import * as SQL from "sql.js"; diff --git a/ss-utils/ss-utils-tests.ts b/ss-utils/ss-utils-tests.ts index 71934fed54..9bbd30da9a 100644 --- a/ss-utils/ss-utils-tests.ts +++ b/ss-utils/ss-utils-tests.ts @@ -1,6 +1,3 @@ -/// - - declare var EventSource : ssutils.IEventSourceStatic; function test_ssutils() { @@ -13,7 +10,7 @@ function test_ssutils() { onHeartbeat: function(msg:ssutils.SSEHeartbeat, e:MessageEvent){}, onJoin: function(msg:ssutils.SSEJoin) {}, onLeave: function(msg:ssutils.SSELeave) {}, - onUpdate: function(msg:ssutils.SSEUpdate) {} + onUpdate: function(msg:ssutils.SSEUpdate) {} }, receivers: { tv: { @@ -26,7 +23,7 @@ function test_ssutils() { announce: function (msg:string) {} }) .on('customEvent', function (e, msg, msgEvent) { }); - + $.ss.handlers["changeChannel"]("home"); } @@ -39,7 +36,7 @@ function test_jQuery_functions(){ overrideMessages: true, messages: {"NotFound": "Not Found"}, errorFilter: function(errorMsg, errorCode, type){} - }); + }); $("form").applyValues({ "Key": "Value" }); @@ -58,8 +55,8 @@ function test_ssutils_Static(){ dateFmt = $.ss.dfmt(new Date(2001,1,1)); dateFmt = $.ss.dfmthm(new Date(2001,1,1)); dateFmt = $.ss.tfmt12(new Date(2001,1,1)); - var parts:string[] = $.ss.splitOnFirst("A;B;C",";"); - parts = $.ss.splitOnLast("A;B;C", ";"); + var parts:string[] = $.ss.splitOnFirst("A;B;C",";"); + parts = $.ss.splitOnLast("A;B;C", ";"); var selectedText = $.ss.getSelection(); var qs:{ [index: string]: string } = $.ss.queryString("http://google.com?a=b&c=d"); var relativePath = $.ss.createUrl("/path/to/{File}", {File:"file.js"}); @@ -69,7 +66,7 @@ function test_ssutils_Static(){ $.ss.normalize({"AA":1,"bB":2,"C":{"A":11,"B":22},"D":[1,2],"E":[{"A":111,"B":222}]}, true); $.ss.parseResponseStatus('{"message":"test"}'); $.ss.postJSON("/path/to/url", {json:"data"}, function(r:any) {}); - + $.ss.listenOn = "click onmousedown"; $.ss.eventReceivers = { "document": document }; $.ss.handlers["changeChannel"]("home"); diff --git a/static-eval/static-eval-tests.ts b/static-eval/static-eval-tests.ts index d4307c50f4..bfe30f723f 100644 --- a/static-eval/static-eval-tests.ts +++ b/static-eval/static-eval-tests.ts @@ -1,5 +1,3 @@ -/// - import evaluate = require('static-eval'); import esprima = require('esprima'); import * as ESTree from 'estree'; diff --git a/stream-to-array/stream-to-array-tests.ts b/stream-to-array/stream-to-array-tests.ts index c011f3e542..6b3ccc84fb 100644 --- a/stream-to-array/stream-to-array-tests.ts +++ b/stream-to-array/stream-to-array-tests.ts @@ -1,6 +1,3 @@ - -/// - import toArray = require('stream-to-array'); var rs: NodeJS.ReadableStream; diff --git a/stylus/stylus-tests.ts b/stylus/stylus-tests.ts index 7c5a8b1e45..248b6a9a04 100644 --- a/stylus/stylus-tests.ts +++ b/stylus/stylus-tests.ts @@ -1,13 +1,9 @@ -/** - * Test suite created by Maxime LUCE - * +/** + * Test suite created by Maxime LUCE + * * Created by using code samples from https://github.com/LearnBoost/stylus/blob/master/docs/js.md. */ -/// - - - import stylus = require("stylus"); var str = "This is a stylus test"; diff --git a/superagent/superagent-tests.ts b/superagent/superagent-tests.ts index 3252b01c96..3b8539ffe5 100644 --- a/superagent/superagent-tests.ts +++ b/superagent/superagent-tests.ts @@ -1,6 +1,3 @@ - -/// - // via: http://visionmedia.github.io/superagent/ import * as request from 'superagent'; diff --git a/supertest-as-promised/supertest-as-promised-tests.ts b/supertest-as-promised/supertest-as-promised-tests.ts index 35cbc68388..23e47ee319 100644 --- a/supertest-as-promised/supertest-as-promised-tests.ts +++ b/supertest-as-promised/supertest-as-promised-tests.ts @@ -29,12 +29,8 @@ request(app) // ... }); -describe("GET /kittens", () => { - it("should work", () => { - return request(app).get("/kittens").expect(200); - }); -}); +request(app).get("/kittens").expect(200); // Agents var agent = request.agent(app); diff --git a/tapable/tapable-tests.ts b/tapable/tapable-tests.ts index fce410defa..60e299b4a0 100644 --- a/tapable/tapable-tests.ts +++ b/tapable/tapable-tests.ts @@ -1,5 +1,3 @@ -/// - import Tapable = require('tapable'); class DllPlugin { diff --git a/tape/tape-tests.ts b/tape/tape-tests.ts index cc51d27ba1..9884ece458 100644 --- a/tape/tape-tests.ts +++ b/tape/tape-tests.ts @@ -1,6 +1,3 @@ - -/// - import tape = require("tape"); var name: string; diff --git a/tar/tar-tests.ts b/tar/tar-tests.ts index 08f304add9..d80e068ace 100644 --- a/tar/tar-tests.ts +++ b/tar/tar-tests.ts @@ -4,8 +4,6 @@ * Created by using code samples from https://github.com/npm/node-tar. */ -/// - import tar = require("tar"); import fs = require("fs"); diff --git a/tether-drop/tether-drop-tests.ts b/tether-drop/tether-drop-tests.ts index b6069bc76b..91df27a484 100644 --- a/tether-drop/tether-drop-tests.ts +++ b/tether-drop/tether-drop-tests.ts @@ -1,4 +1,3 @@ -/// import Drop = require("tether-drop"); var yellowBox = document.querySelector(".yellow"); diff --git a/three/test/canvas/canvas_camera_orthographic.ts b/three/test/canvas/canvas_camera_orthographic.ts index 78476a95b5..2beabf21f9 100644 --- a/three/test/canvas/canvas_camera_orthographic.ts +++ b/three/test/canvas/canvas_camera_orthographic.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/canvas_camera_orthographic.html () => { diff --git a/three/test/canvas/canvas_geometry_cube.ts b/three/test/canvas/canvas_geometry_cube.ts index 46f26b10c5..767ece34b0 100644 --- a/three/test/canvas/canvas_geometry_cube.ts +++ b/three/test/canvas/canvas_geometry_cube.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/canvas_geometry_cube.html () => { diff --git a/three/test/canvas/canvas_interactive_cubes_tween.ts b/three/test/canvas/canvas_interactive_cubes_tween.ts index 6d4cd3fce1..c7427cb07b 100644 --- a/three/test/canvas/canvas_interactive_cubes_tween.ts +++ b/three/test/canvas/canvas_interactive_cubes_tween.ts @@ -1,5 +1,3 @@ -/// -/// /// // https://github.com/mrdoob/three.js/blob/master/examples/canvas_interactive_cubes_tween.html diff --git a/three/test/canvas/canvas_lights_pointlights.ts b/three/test/canvas/canvas_lights_pointlights.ts index 6c028abcf8..55e91d27c8 100644 --- a/three/test/canvas/canvas_lights_pointlights.ts +++ b/three/test/canvas/canvas_lights_pointlights.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/canvas_lights_pointlights.html () => { diff --git a/three/test/canvas/canvas_materials.ts b/three/test/canvas/canvas_materials.ts index 21ca2b3ee1..9af83aff5d 100644 --- a/three/test/canvas/canvas_materials.ts +++ b/three/test/canvas/canvas_materials.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/canvas_materials.html () => { diff --git a/three/test/canvas/canvas_particles_floor.ts b/three/test/canvas/canvas_particles_floor.ts index 71e121e8d0..00d97b8e30 100644 --- a/three/test/canvas/canvas_particles_floor.ts +++ b/three/test/canvas/canvas_particles_floor.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/canvas_particles_floor.html () => { diff --git a/three/test/css3d/css3d_periodictable.ts b/three/test/css3d/css3d_periodictable.ts index 342455ff48..2d68cd2f53 100644 --- a/three/test/css3d/css3d_periodictable.ts +++ b/three/test/css3d/css3d_periodictable.ts @@ -1,6 +1,4 @@ -/// /// -/// // https://github.com/mrdoob/three.js/blob/master/examples/css3d_periodictable.html diff --git a/three/test/css3d/css3d_sprites.ts b/three/test/css3d/css3d_sprites.ts index 49177a9453..41cf22ad47 100644 --- a/three/test/css3d/css3d_sprites.ts +++ b/three/test/css3d/css3d_sprites.ts @@ -1,5 +1,3 @@ -/// -/// /// // https://github.com/mrdoob/three.js/blob/master/examples/css3d_sprites.html diff --git a/three/test/examples/controls/vrcontrols.ts b/three/test/examples/controls/vrcontrols.ts index 1d6e932a0e..2dbc5817da 100644 --- a/three/test/examples/controls/vrcontrols.ts +++ b/three/test/examples/controls/vrcontrols.ts @@ -1,5 +1,3 @@ -/// - var _vrControls = new THREE.VRControls(new THREE.Camera()); _vrControls.update(); diff --git a/three/test/examples/ctm/ctmloader.ts b/three/test/examples/ctm/ctmloader.ts index e35cffb6a4..68e4e28fc0 100644 --- a/three/test/examples/ctm/ctmloader.ts +++ b/three/test/examples/ctm/ctmloader.ts @@ -1,5 +1,3 @@ -/// - let _ctmloader = new THREE.CTMLoader(); _ctmloader.load('https://github.com/mrdoob/three.js/blob/master/examples/models/ctm/ben.ctm', (geo: any) => { console.log(geo.position); diff --git a/three/test/examples/detector.ts b/three/test/examples/detector.ts index b0960c723c..6260f34300 100644 --- a/three/test/examples/detector.ts +++ b/three/test/examples/detector.ts @@ -1,7 +1,3 @@ -/// -/// - - () => { if ( !Detector.canvas || !Detector.webgl || !Detector.workers || !Detector.fileapi ){ var errorElement = Detector.getWebGLErrorMessage(); diff --git a/three/test/examples/effects/vreffect.ts b/three/test/examples/effects/vreffect.ts index 67917a94ae..454d15fdf7 100644 --- a/three/test/examples/effects/vreffect.ts +++ b/three/test/examples/effects/vreffect.ts @@ -1,5 +1,3 @@ -/// - var _vrEffect: THREE.VREffect; _vrEffect = new THREE.VREffect(new THREE.WebGLRenderer({antialias: true}), (error) => { diff --git a/three/test/examples/octree.ts b/three/test/examples/octree.ts index de7de86ac7..d37ef7ba75 100644 --- a/three/test/examples/octree.ts +++ b/three/test/examples/octree.ts @@ -1,5 +1,3 @@ -/// - let _octree = new THREE.Octree({ underferred: false, depthMax: Infinity, diff --git a/three/test/math/test_unit_math.ts b/three/test/math/test_unit_math.ts index c70868b3d8..4a8e0a8c14 100644 --- a/three/test/math/test_unit_math.ts +++ b/three/test/math/test_unit_math.ts @@ -1,6 +1,3 @@ -/// -/// - declare function test(desc: string, body: () => void): void; declare function ok(cond: any, desc?: string): void; declare function deepEqual(a: T, b: T, desc?: string): void; diff --git a/three/test/webgl/webgl_animation_cloth.ts b/three/test/webgl/webgl_animation_cloth.ts index fff733c9c0..0c0ec76ace 100644 --- a/three/test/webgl/webgl_animation_cloth.ts +++ b/three/test/webgl/webgl_animation_cloth.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_animation_cloth.html () => { diff --git a/three/test/webgl/webgl_animation_skinning_morph.ts b/three/test/webgl/webgl_animation_skinning_morph.ts index df085e9ac4..fcea4bba08 100644 --- a/three/test/webgl/webgl_animation_skinning_morph.ts +++ b/three/test/webgl/webgl_animation_skinning_morph.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_sprites.html () => { diff --git a/three/test/webgl/webgl_buffergeometry.ts b/three/test/webgl/webgl_buffergeometry.ts index a747a17d50..0d4f1ee5dd 100644 --- a/three/test/webgl/webgl_buffergeometry.ts +++ b/three/test/webgl/webgl_buffergeometry.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_buffergeometry.html () => { diff --git a/three/test/webgl/webgl_camera.ts b/three/test/webgl/webgl_camera.ts index 66b60a7826..804aba771f 100644 --- a/three/test/webgl/webgl_camera.ts +++ b/three/test/webgl/webgl_camera.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_camera.html () => { diff --git a/three/test/webgl/webgl_custom_attributes.ts b/three/test/webgl/webgl_custom_attributes.ts index 89c25e62cf..c3a5bc6a36 100644 --- a/three/test/webgl/webgl_custom_attributes.ts +++ b/three/test/webgl/webgl_custom_attributes.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_custom_attributes.html () => { diff --git a/three/test/webgl/webgl_geometries.ts b/three/test/webgl/webgl_geometries.ts index 9b23dcfa1f..89e0af480c 100644 --- a/three/test/webgl/webgl_geometries.ts +++ b/three/test/webgl/webgl_geometries.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_geometries.html () => { diff --git a/three/test/webgl/webgl_helpers.ts b/three/test/webgl/webgl_helpers.ts index db8cba89a7..6b955968f4 100644 --- a/three/test/webgl/webgl_helpers.ts +++ b/three/test/webgl/webgl_helpers.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_helpers.html () => { diff --git a/three/test/webgl/webgl_interactive_cubes.ts b/three/test/webgl/webgl_interactive_cubes.ts index 74493a5285..87a9796813 100644 --- a/three/test/webgl/webgl_interactive_cubes.ts +++ b/three/test/webgl/webgl_interactive_cubes.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_interactive_cubes.html () => { diff --git a/three/test/webgl/webgl_interactive_raycasting_points.ts b/three/test/webgl/webgl_interactive_raycasting_points.ts index 6fdb24b6cc..ced8feb6c6 100644 --- a/three/test/webgl/webgl_interactive_raycasting_points.ts +++ b/three/test/webgl/webgl_interactive_raycasting_points.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_sprites.html () => { diff --git a/three/test/webgl/webgl_lensflares.ts b/three/test/webgl/webgl_lensflares.ts index 1d100507a0..1d42762571 100644 --- a/three/test/webgl/webgl_lensflares.ts +++ b/three/test/webgl/webgl_lensflares.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_lensflares.html () => { diff --git a/three/test/webgl/webgl_lights_hemisphere.ts b/three/test/webgl/webgl_lights_hemisphere.ts index 46dd9f7157..108419f4ad 100644 --- a/three/test/webgl/webgl_lights_hemisphere.ts +++ b/three/test/webgl/webgl_lights_hemisphere.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_lights_hemisphere.html () => { diff --git a/three/test/webgl/webgl_lines_colors.ts b/three/test/webgl/webgl_lines_colors.ts index 6b359b2d65..c7d68849f2 100644 --- a/three/test/webgl/webgl_lines_colors.ts +++ b/three/test/webgl/webgl_lines_colors.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_lines_colors.html () => { diff --git a/three/test/webgl/webgl_loader_awd.ts b/three/test/webgl/webgl_loader_awd.ts index 01f21a985e..d1752056fa 100644 --- a/three/test/webgl/webgl_loader_awd.ts +++ b/three/test/webgl/webgl_loader_awd.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_loader_awd.html () => { diff --git a/three/test/webgl/webgl_materials.ts b/three/test/webgl/webgl_materials.ts index f60da797ce..94f91b2fef 100644 --- a/three/test/webgl/webgl_materials.ts +++ b/three/test/webgl/webgl_materials.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_materials.html () => { diff --git a/three/test/webgl/webgl_morphtargets.ts b/three/test/webgl/webgl_morphtargets.ts index 5368dccb91..4dda732da7 100644 --- a/three/test/webgl/webgl_morphtargets.ts +++ b/three/test/webgl/webgl_morphtargets.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_morphtargets.html () => { diff --git a/three/test/webgl/webgl_points_billboards.ts b/three/test/webgl/webgl_points_billboards.ts index 11aa04270b..06fefa6744 100644 --- a/three/test/webgl/webgl_points_billboards.ts +++ b/three/test/webgl/webgl_points_billboards.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_particles_billboards.html () => { diff --git a/three/test/webgl/webgl_postprocessing.ts b/three/test/webgl/webgl_postprocessing.ts index 8c298d66a6..0c768eccea 100644 --- a/three/test/webgl/webgl_postprocessing.ts +++ b/three/test/webgl/webgl_postprocessing.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_postprocessing.html () => { diff --git a/three/test/webgl/webgl_shader.ts b/three/test/webgl/webgl_shader.ts index 249851d534..4a954d36ac 100644 --- a/three/test/webgl/webgl_shader.ts +++ b/three/test/webgl/webgl_shader.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_shader.html () => { diff --git a/three/test/webgl/webgl_sprites.ts b/three/test/webgl/webgl_sprites.ts index 8e71285fac..103d3065c3 100644 --- a/three/test/webgl/webgl_sprites.ts +++ b/three/test/webgl/webgl_sprites.ts @@ -1,6 +1,3 @@ -/// -/// - // https://github.com/mrdoob/three.js/blob/master/examples/webgl_sprites.html () => { diff --git a/through2/through2-tests.ts b/through2/through2-tests.ts index 0cc698d1d3..70a66e4b0e 100644 --- a/through2/through2-tests.ts +++ b/through2/through2-tests.ts @@ -1,6 +1,3 @@ - -/// - import stream = require('stream'); import through2 = require('through2'); diff --git a/through2/v0/through2-tests.ts b/through2/v0/through2-tests.ts index 9308908648..ae1c43a135 100644 --- a/through2/v0/through2-tests.ts +++ b/through2/v0/through2-tests.ts @@ -1,6 +1,3 @@ - -/// - import through2 = require('through2'); var rws: NodeJS.ReadWriteStream; diff --git a/typeahead/typeahead-tests.ts b/typeahead/typeahead-tests.ts index 4f50cb57e2..61d48b6aa9 100644 --- a/typeahead/typeahead-tests.ts +++ b/typeahead/typeahead-tests.ts @@ -1,5 +1,3 @@ -/// - function test_typeahead() { var options: Twitter.Typeahead.Options = {}; var dataset: Twitter.Typeahead.Dataset = { source: null }; diff --git a/uuid-1345/uuid-1345-tests.ts b/uuid-1345/uuid-1345-tests.ts index e3eef2c939..da0876de89 100644 --- a/uuid-1345/uuid-1345-tests.ts +++ b/uuid-1345/uuid-1345-tests.ts @@ -1,6 +1,3 @@ -/// - -'use strict'; import * as UUID from 'uuid-1345'; var uuid:string; diff --git a/valerie/valerie-tests.ts b/valerie/valerie-tests.ts index 227afc246b..b4f6efcdc9 100644 --- a/valerie/valerie-tests.ts +++ b/valerie/valerie-tests.ts @@ -1,15 +1,3 @@ - -/// - -// Tests for valerie.d.ts -// Project: https://github.com/davewatts/valerie -// Definitions by: Howard Richards -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -/* - Checks the .d.ts definition work. Not a fully comprehensive set of tests yet. -*/ - /** * Simple enum for enum test */ diff --git a/validator/validator-tests.ts b/validator/validator-tests.ts index c4cee64661..48621f1acd 100644 --- a/validator/validator-tests.ts +++ b/validator/validator-tests.ts @@ -1,8 +1,5 @@ -/// - import * as validator from 'validator'; - /************************************************ * * * IMPORT TESTS * diff --git a/vex-js/vex-js-tests.ts b/vex-js/vex-js-tests.ts index d4af6e9e6a..2f89745157 100644 --- a/vex-js/vex-js-tests.ts +++ b/vex-js/vex-js-tests.ts @@ -1,4 +1,3 @@ -/// import vex = require("vex-js"); var vexContent = vex.open({ diff --git a/vinyl/vinyl-tests.ts b/vinyl/vinyl-tests.ts index bb705b7b2b..f9e71dd532 100644 --- a/vinyl/vinyl-tests.ts +++ b/vinyl/vinyl-tests.ts @@ -1,8 +1,4 @@ /// -/// -/// - -'use strict'; import * as fs from 'fs'; import * as path from 'path'; diff --git a/voronoi-diagram/voronoi-diagram-tests.ts b/voronoi-diagram/voronoi-diagram-tests.ts index 31b261e1ce..97f04a37de 100644 --- a/voronoi-diagram/voronoi-diagram-tests.ts +++ b/voronoi-diagram/voronoi-diagram-tests.ts @@ -1,5 +1,3 @@ -/// - import voronoi = require("voronoi-diagram"); const x: voronoi.Point = [1, 2]; diff --git a/wake_on_lan/wake_on_lan-tests.ts b/wake_on_lan/wake_on_lan-tests.ts index 3403d5c9fe..e8391a5765 100644 --- a/wake_on_lan/wake_on_lan-tests.ts +++ b/wake_on_lan/wake_on_lan-tests.ts @@ -1,6 +1,3 @@ - -/// - import wol = require('wake_on_lan'); wol.wake("20:DE:20:DE:20:DE"); diff --git a/webgme/webgme-tests.ts b/webgme/webgme-tests.ts index d009e936e4..e6f315a3ef 100644 --- a/webgme/webgme-tests.ts +++ b/webgme/webgme-tests.ts @@ -1,13 +1,9 @@ - -/// -/// - /** * In actual usage the MetaDataStr would most likely * be initialized with an import... - * + * import MetaDataStr = require("text!metadata.json"); - * + * * Which would require a declaration, like... * `text.d.ts` * @@ -26,7 +22,7 @@ import * as fs from "fs"; import * as stream from "stream"; import * as Common from "webgme/common"; -/** +/** * The following items are not created directly by the * plugin driver. * @@ -41,14 +37,14 @@ let destinationNode = new Common.Node(); /** * These tests are derived from... * https://github.com/webgme/webgme/wiki/GME-Core-API - * - * Nearly all core functions takes a CoreNode as its first argument. - * When using the Core API externally each CoreNode corresponds - * to one node/model in the project tree. - * To access data from the node the Core API should be used - * and the properties on the CoreNode itself should + * + * Nearly all core functions takes a CoreNode as its first argument. + * When using the Core API externally each CoreNode corresponds + * to one node/model in the project tree. + * To access data from the node the Core API should be used + * and the properties on the CoreNode itself should * not be accessed or modified directly. - * + * * Below follows a handpicked selection of basic core functions. */ @@ -111,7 +107,7 @@ function test_core_containment_traversal() { }); } -/** +/** * https://github.com/webgme/webgme/wiki/GME-Core-API#containment-methods */ function test_core_containment_methods() { @@ -158,7 +154,7 @@ function test_core_containment_methods() { // Here we have access to the node. }); - // Loading an entire sub-tree of nodes + // Loading an entire sub-tree of nodes // N.B. this requires all nodes to be loaded at the same time. // For larger models core.traverse is preferred. self.core.loadSubTree(node, (err, nodes) => { @@ -176,7 +172,7 @@ function test_core_containment_methods() { function test_core_pointers_connections() { - // + // let isConn = self.core.isConnection(connNode); // Get the path of the node that is pointed to, via 'src', from connNode. @@ -215,16 +211,16 @@ function test_core_pointers_connections() { /** * https://github.com/webgme/webgme/wiki/GME-Blob-Storage-API - * - * File-like objects/artifacts - * (which are neither a meta archetype model, nor an instance model) - * are stored separately from the WebGME meta-models and models. - * An example of such an artifact would be a resource - * file that is associated with a model + * + * File-like objects/artifacts + * (which are neither a meta archetype model, nor an instance model) + * are stored separately from the WebGME meta-models and models. + * An example of such an artifact would be a resource + * file that is associated with a model * (e.g., data for an instance model, or a generated artifact from analyzing a model). - * - * One reason for treating these objects differently is that they do not conform to the data model, - * and they might not be well-suited for storage in a database + * + * One reason for treating these objects differently is that they do not conform to the data model, + * and they might not be well-suited for storage in a database * (the Blob is suited to handle binary objects of any size and structure). */ @@ -242,22 +238,22 @@ function test_client_creating_an_instance() { /** * https://github.com/webgme/webgme/wiki/GME-Blob-Storage-API - * - * File-like objects/artifacts - * (which are neither a meta archetype model, nor an instance model) - * are stored separately from the WebGME meta-models and models. - * An example of such an artifact would be a resource - * file that is associated with a model + * + * File-like objects/artifacts + * (which are neither a meta archetype model, nor an instance model) + * are stored separately from the WebGME meta-models and models. + * An example of such an artifact would be a resource + * file that is associated with a model * (e.g., data for an instance model, or a generated artifact from analyzing a model). - * - * One reason for treating these objects differently is that they do not conform to the data model, - * and they might not be well-suited for storage in a database + * + * One reason for treating these objects differently is that they do not conform to the data model, + * and they might not be well-suited for storage in a database * (the Blob is suited to handle binary objects of any size and structure). */ -/** +/** * The following items are not created directly by the * plugin driver. * @@ -338,7 +334,7 @@ type DictionaryAny = { [key: string]: any }; /** * Visit the node and perform the function. * Related example using traverse. -* https://github.com/webgme/xmi-tools/blob/master/src/plugins/XMIExporter/XMIExporter.js#L430 +* https://github.com/webgme/xmi-tools/blob/master/src/plugins/XMIExporter/XMIExporter.js#L430 */ function test_core_containment_traversal_complete() { const BLANK = ""; @@ -382,7 +378,7 @@ function test_core_containment_traversal_complete() { /** * A filter mechanism to effectively eliminate containment branches. - * Any path included in the prune-list will be the root of a + * Any path included in the prune-list will be the root of a * pruned subtree. */ let pruneList: string[] = []; diff --git a/webpack-sources/webpack-sources-tests.ts b/webpack-sources/webpack-sources-tests.ts index 622f12cb8e..16c915516b 100644 --- a/webpack-sources/webpack-sources-tests.ts +++ b/webpack-sources/webpack-sources-tests.ts @@ -1,5 +1,3 @@ -/// - import { CachedSource, ConcatSource, diff --git a/x-editable/x-editable-tests.ts b/x-editable/x-editable-tests.ts index c4c03a46be..3c121b8528 100644 --- a/x-editable/x-editable-tests.ts +++ b/x-editable/x-editable-tests.ts @@ -1,10 +1,3 @@ -// Type definitions for X-Editable v1.5.1 -// Project: http://vitalets.github.io/x-editable/index.html -// Definitions by: Chris Kirby -// Definitions: https://github.com/sirkirby/DefinitelyTyped - -/// - // server post and response $('#username').editable({ success: function(response : any, newValue : any) { diff --git a/xmlpoke/xmlpoke-tests.ts b/xmlpoke/xmlpoke-tests.ts index 3c82b846a6..aba04c0962 100644 --- a/xmlpoke/xmlpoke-tests.ts +++ b/xmlpoke/xmlpoke-tests.ts @@ -1,7 +1,3 @@ -/// - -// tsc xmlpoke-tests.ts && node xmlpoke-tests.js - import * as xmlpoke from 'xmlpoke'; import * as assert from 'assert'; diff --git a/xrm/v7/xrm-tests.ts b/xrm/v7/xrm-tests.ts index 1b82805648..1c8288fae4 100644 --- a/xrm/v7/xrm-tests.ts +++ b/xrm/v7/xrm-tests.ts @@ -1,5 +1,3 @@ -/// - /// Demonstrate usage in the browser's window object window.Xrm.Utility.alertDialog( "message", () => {} ); From f0b18c41f7d00a0c7cc09541e7337c40f1381478 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 10 Mar 2017 07:56:11 -0800 Subject: [PATCH 514/797] mobservable provides its own types (#14776) --- mendixmodelsdk/index.d.ts | 182 ++++++++++++++++++++++++++++++- mobservable/index.d.ts | 178 ------------------------------ mobservable/mobservable-tests.ts | 56 ---------- mobservable/tsconfig.json | 25 ----- mobservable/tslint.json | 6 - notNeededPackages.json | 6 + 6 files changed, 187 insertions(+), 266 deletions(-) delete mode 100644 mobservable/index.d.ts delete mode 100644 mobservable/mobservable-tests.ts delete mode 100644 mobservable/tsconfig.json delete mode 100644 mobservable/tslint.json diff --git a/mendixmodelsdk/index.d.ts b/mendixmodelsdk/index.d.ts index 29192f4bc4..d75cdb97aa 100644 --- a/mendixmodelsdk/index.d.ts +++ b/mendixmodelsdk/index.d.ts @@ -207,8 +207,188 @@ limitations under the License. */ +// Outdated mobservable typings. +// TODO: Use the types bundled with mobservable. Or use mobx. + +interface _IMobservableStatic { + /** + * Turns an object, array or function into a reactive structure. + * @param value the value which should become observable. + */ + makeReactive: IMakeReactive; + + /** + * Extends an object with reactive capabilities. + * @param target the object to which reactive properties should be added + * @param properties the properties that should be added and made reactive + * @returns targer + */ + extendReactive(target: Object, properties: Object):Object; + + /** + * Returns true if the provided value is reactive. + * @param value object, function or array + * @param propertyName if propertyName is specified, checkes whether value.propertyName is reactive. + */ + isReactive(value: any, propertyName?:string): boolean; + + /** + * Can be used in combination with makeReactive / extendReactive. + * Enforces that a reference to 'value' is stored as property, + * but that 'value' itself is not turned into something reactive. + * Future assignments to the same property will inherit this behavior. + * @param value initial value of the reactive property that is being defined. + */ + asReference(value: any):{value:T}; + + /** + * ES6 / Typescript decorator which can to make class properties and getter functions reactive. + */ + observable(target: Object, key: string):any; // decorator / annotation + + /** + * Creates a reactive view and keeps it alive, so that the view is always + * updated if one of the dependencies changes, even when the view is not further used by something else. + * @param func The reactive view + * @param scope (optional) + * @returns disposer function, which can be used to stop the view from being updated in the future. + */ + observe(func: Mobservable.Lambda, scope?: any): Mobservable.Lambda; + + /** + * Deprecated, use mobservable.observe instead. + */ + sideEffect(func: Mobservable.Lambda, scope?: any): Mobservable.Lambda; + + /** + * Similar to 'observer', observes the given predicate until it returns true. + * Once it returns true, the 'effect' function is invoked an the observation is cancelled. + * @param predicate + * @param effect + * @param scope (optional) + * @returns disposer function to prematurely end the observer. + */ + observeUntil(predicate: ()=>boolean, effect: Mobservable.Lambda, scope?: any): Mobservable.Lambda; + + /** + * During a transaction no views are updated until the end of the transaction. + * The transaction will be run synchronously nonetheless. + * @param action a function that updates some reactive state + * @returns any value that was returned by the 'action' parameter. + */ + transaction(action: ()=>T): T; + + /** + * Converts a reactive structure into a non-reactive structure. + * Basically a deep-clone. + */ + toJSON(value: T): T; + + /** + * Sets the reporting level Defaults to 1. Use 0 for production or 2 for increased verbosity. + */ + logLevel: number; // 0 = production, 1 = development, 2 = debugging + + extras: { + getDependencyTree(thing:any, property?:string): Mobservable.IDependencyTree; + + getObserverTree(thing:any, property?:string): Mobservable.IObserverTree; + + trackTransitions(extensive?:boolean, onReport?:(lines:Mobservable.ITransitionEvent) => void) : Mobservable.Lambda; + } +} + +interface IMakeReactive { + (value: T[], opts?: Mobservable.IMakeReactiveOptions): Mobservable.IObservableArray; + (value: ()=>T, opts?: Mobservable.IMakeReactiveOptions): Mobservable.IObservableValue; + (value: T, opts?: Mobservable.IMakeReactiveOptions): Mobservable.IObservableValue; + (value: Object, opts?: Mobservable.IMakeReactiveOptions): T; +} + +interface IMobservableStatic extends _IMobservableStatic, IMakeReactive { +} + +declare namespace Mobservable { + interface IMakeReactiveOptions { + as?: string /* "auto" | "reference" | TODO: see #8 "structure" */ + scope?: Object, + context?: Object, + recurse?: boolean; + name?: string; + // protected: boolean TODO: see #9 + } + + export interface IContextInfoStruct { + object: Object; + name: string; + } + + export type IContextInfo = IContextInfoStruct | string; + + interface Lambda { + (): void; + name?: string; + } + + interface IObservable { + observe(callback: (...args: any[])=>void, fireImmediately?: boolean): Lambda; + } + + interface IObservableValue extends IObservable { + (): T; + (value: T):void; + observe(callback: (newValue: T, oldValue: T)=>void, fireImmediately?: boolean): Lambda; + } + + interface IObservableArray extends IObservable, Array { + spliceWithArray(index: number, deleteCount?: number, newItems?: T[]): T[]; + observe(listener: (changeData: IArrayChange|IArraySplice)=>void, fireImmediately?: boolean): Lambda; + clear(): T[]; + replace(newItems: T[]): T[]; + find(predicate: (item: T,index: number,array: IObservableArray)=>boolean,thisArg?: any,fromIndex?: number): T; + remove(value: T): boolean; + } + + interface IArrayChange { + type: string; // Always: 'update' + object: IObservableArray; + index: number; + oldValue: T; + } + + interface IArraySplice { + type: string; // Always: 'splice' + object: IObservableArray; + index: number; + removed: T[]; + addedCount: number; + } + + interface IDependencyTree { + id: number; + name: string; + context: any; + dependencies?: IDependencyTree[]; + } + + interface IObserverTree { + id: number; + name: string; + context: any; + observers?: IObserverTree[]; + listeners?: number; // amount of functions manually attached using an .observe method + } + + interface ITransitionEvent { + id: number; + name: string; + context: Object; + state: string; + changed: boolean; + newValue: string; + } +} -/// declare module "mendixmodelsdk" { namespace sdk { namespace internal { diff --git a/mobservable/index.d.ts b/mobservable/index.d.ts deleted file mode 100644 index 719eddaf31..0000000000 --- a/mobservable/index.d.ts +++ /dev/null @@ -1,178 +0,0 @@ -// Type definitions for mobservable 0.6 -// Project: https://mweststrate.github.io/mobservable -// Definitions by: Michel Weststrate -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace Mobservable { - interface Static extends MakeReactive { - /** - * Turns an object, array or function into a reactive structure. - * @param value the value which should become observable. - */ - makeReactive: MakeReactive; - - /** - * Extends an object with reactive capabilities. - * @param target the object to which reactive properties should be added - * @param properties the properties that should be added and made reactive - * @returns targer - */ - extendReactive(target: Object, properties: Object): Object; - - /** - * Returns true if the provided value is reactive. - * @param value object, function or array - * @param propertyName if propertyName is specified, checkes whether value.propertyName is reactive. - */ - isReactive(value: any, propertyName?: string): boolean; - - /** - * Can be used in combination with makeReactive / extendReactive. - * Enforces that a reference to 'value' is stored as property, - * but that 'value' itself is not turned into something reactive. - * Future assignments to the same property will inherit this behavior. - * @param value initial value of the reactive property that is being defined. - */ - asReference(value: any): {value: T}; - - /** - * ES6 / Typescript decorator which can to make class properties and getter functions reactive. - */ - observable(target: Object, key: string): any; // decorator / annotation - - /** - * Creates a reactive view and keeps it alive, so that the view is always - * updated if one of the dependencies changes, even when the view is not further used by something else. - * @param func The reactive view - * @param scope (optional) - * @returns disposer function, which can be used to stop the view from being updated in the future. - */ - observe(func: Mobservable.Lambda, scope?: any): Mobservable.Lambda; - - /** - * Deprecated, use mobservable.observe instead. - */ - sideEffect(func: Mobservable.Lambda, scope?: any): Mobservable.Lambda; - - /** - * Similar to 'observer', observes the given predicate until it returns true. - * Once it returns true, the 'effect' function is invoked an the observation is cancelled. - * @param predicate - * @param effect - * @param scope (optional) - * @returns disposer function to prematurely end the observer. - */ - observeUntil(predicate: () => boolean, effect: Mobservable.Lambda, scope?: any): Mobservable.Lambda; - - /** - * During a transaction no views are updated until the end of the transaction. - * The transaction will be run synchronously nonetheless. - * @param action a function that updates some reactive state - * @returns any value that was returned by the 'action' parameter. - */ - transaction(action: () => T): T; - - /** - * Converts a reactive structure into a non-reactive structure. - * Basically a deep-clone. - */ - toJSON(value: T): T; - - /** - * Sets the reporting level Defaults to 1. Use 0 for production or 2 for increased verbosity. - */ - logLevel: number; // 0 = production, 1 = development, 2 = debugging - - extras: { - getDependencyTree(thing: any, property?: string): Mobservable.DependencyTree; - - getObserverTree(thing: any, property?: string): Mobservable.ObserverTree; - - trackTransitions(extensive?: boolean, onReport?: (lines: Mobservable.TransitionEvent) => void): Mobservable.Lambda; - }; - } - - interface MakeReactive { - (value: T[], opts?: Mobservable.MakeReactiveOptions): Mobservable.ObservableArray; - (value: () => T, opts?: Mobservable.MakeReactiveOptions): Mobservable.ObservableValue; - (value: T, opts?: Mobservable.MakeReactiveOptions): Mobservable.ObservableValue; - (value: Object, opts?: Mobservable.MakeReactiveOptions): T; - } - - interface MakeReactiveOptions { - as?: string; /* "auto" | "reference" | TODO: see #8 "structure" */ - scope?: Object; - context?: Object; - recurse?: boolean; - name?: string; - // protected: boolean TODO: see #9 - } - - type ContextInfo = { object: Object; name: string } | string; - - interface Lambda { - (): void; - name?: string; - } - - interface Observable { - observe(callback: (...args: any[]) => void, fireImmediately?: boolean): Lambda; - } - - interface ObservableValue extends Observable { - (): T; - (value: T): void; - observe(callback: (newValue: T, oldValue: T) => void, fireImmediately?: boolean): Lambda; - } - - interface ObservableArray extends Observable, Array { - spliceWithArray(index: number, deleteCount?: number, newItems?: T[]): T[]; - observe(listener: (changeData: ArrayChange|ArraySplice) => void, fireImmediately?: boolean): Lambda; - clear(): T[]; - replace(newItems: T[]): T[]; - find(predicate: (item: T, index: number, array: ObservableArray) => boolean, thisArg?: any, fromIndex?: number): T; - remove(value: T): boolean; - } - - interface ArrayChange { - type: string; // Always: 'update' - object: ObservableArray; - index: number; - oldValue: T; - } - - interface ArraySplice { - type: string; // Always: 'splice' - object: ObservableArray; - index: number; - removed: T[]; - addedCount: number; - } - - interface DependencyTree { - id: number; - name: string; - context: any; - dependencies?: DependencyTree[]; - } - - interface ObserverTree { - id: number; - name: string; - context: any; - observers?: ObserverTree[]; - listeners?: number; // amount of functions manually attached using an .observe method - } - - interface TransitionEvent { - id: number; - name: string; - context: Object; - state: string; - changed: boolean; - newValue: string; - } -} - -declare const Mobservable: Mobservable.Static; -export = Mobservable; diff --git a/mobservable/mobservable-tests.ts b/mobservable/mobservable-tests.ts deleted file mode 100644 index 060f0d14b3..0000000000 --- a/mobservable/mobservable-tests.ts +++ /dev/null @@ -1,56 +0,0 @@ -import mobservable = require('mobservable'); -import {observable} from "mobservable"; - -var v = mobservable(3); -v.observe(() => {}); - -var a = mobservable([1, 2, 3]); - -class Order { - @observable price: number = 3; - @observable amount: number = 2; - @observable orders: string[] = []; - - @observable get total() { - return this.amount * this.price * (1 + this.orders.length); - } -} - -export function testObservable() { - var a = mobservable(3); - var b = mobservable(() => a() * 2); -} - -export function testAnnotations() { - var order1totals: number[] = []; - var order1 = new Order(); - var order2 = new Order(); - - var disposer = mobservable.observe(() => { - order1totals.push(order1.total); - }); - - order2.price = 4; - order1.amount = 1; - - order2.orders.push('bla'); - - order1.orders.splice(0, 0, 'boe', 'hoi'); - - disposer(); - order1.orders.pop(); -}; - -export function testTyping() { - var ar: mobservable.ObservableArray = mobservable.makeReactive([1, 2]); - ar.observe((d: mobservable.ArrayChange | mobservable.ArraySplice) => { - console.log(d.type); - }); - - var ar2: mobservable.ObservableArray = mobservable([1, 2]); - ar2.observe((d: mobservable.ArrayChange | mobservable.ArraySplice) => { - console.log(d.type); - }); - - var x: mobservable.ObservableValue = mobservable(3); -} \ No newline at end of file diff --git a/mobservable/tsconfig.json b/mobservable/tsconfig.json deleted file mode 100644 index cee6db4b01..0000000000 --- a/mobservable/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es6", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "experimentalDecorators": true, - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "mobservable-tests.ts" - ] -} \ No newline at end of file diff --git a/mobservable/tslint.json b/mobservable/tslint.json deleted file mode 100644 index f05741c59b..0000000000 --- a/mobservable/tslint.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../tslint.json", - "rules": { - "forbidden-types": false - } -} diff --git a/notNeededPackages.json b/notNeededPackages.json index fce0ef50f0..f0619f8e79 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -329,6 +329,12 @@ "typingsPackageName": "fine-uploader", "sourceRepoURL": "http://fineuploader.com/", "asOfVersion": "5.14.0" + }, + { + "libraryName": "mobservable", + "typingsPackageName": "mobservable", + "sourceRepoURL": "github.com/mweststrate/mobservable", + "asOfVersion": "1.2.5" } ] } \ No newline at end of file From e466571159287b9cbab031fc0b4f919a95694c12 Mon Sep 17 00:00:00 2001 From: voxmatt Date: Fri, 10 Mar 2017 10:29:12 -0800 Subject: [PATCH 515/797] a bunch of updates in response to code review --- react-relay/index.d.ts | 16 +++++++++------- react-relay/react-relay-tests.tsx | 1 + 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/react-relay/index.d.ts b/react-relay/index.d.ts index 0f6dbba024..961acbccc2 100644 --- a/react-relay/index.d.ts +++ b/react-relay/index.d.ts @@ -7,6 +7,8 @@ declare module "react-relay" { import * as React from "react"; + type ClientMutationID = string; + /** Fragments are a hash of functions */ interface Fragments { [query: string]: ((variables?: RelayVariables) => string) @@ -40,13 +42,13 @@ declare module "react-relay" { class RelayMutationTransaction { applyOptimistic(): RelayMutationTransaction; - commit(): RelayMutationTransaction; + commit(): RelayMutationTransaction | null; recommit(): void; rollback(): void; getError(): Error; getStatus(): RelayMutationStatus; getHash(): string; - getID(): string; + getID(): ClientMutationID; } interface RelayMutationRequest { @@ -147,12 +149,12 @@ declare module "react-relay" { interface RelayProp { route: { name: string; }; // incomplete, also has params and queries - variables: any; - pendingVariables?: any; + variables: Object; + pendingVariables?: Object | null; setVariables(variables: Object, onReadyStateChange?: OnReadyStateChange): void; forceFetch(variables: Object, onReadyStateChange?: OnReadyStateChange): void; - hasOptimisticUpdate(record?: any): boolean; - getPendingTransactions(record?: any): RelayMutationTransaction[]; - commitUpdate?: (mutation: Mutation, callbacks?: StoreUpdateCallbacks) => any; + hasOptimisticUpdate(record: Object): boolean; + getPendingTransactions(record: Object): RelayMutationTransaction[]; + commitUpdate: (mutation: Mutation, callbacks?: StoreUpdateCallbacks) => any; } } diff --git a/react-relay/react-relay-tests.tsx b/react-relay/react-relay-tests.tsx index fa27f10c01..091909cabd 100644 --- a/react-relay/react-relay-tests.tsx +++ b/react-relay/react-relay-tests.tsx @@ -84,6 +84,7 @@ class StubbedArtwork extends React.Component { forceFetch: () => {}, hasOptimisticUpdate: () => false, getPendingTransactions: (): Relay.RelayMutationTransaction[] => undefined, + commitUpdate: () => {}, } } return From e31e8a857b42de4d54fd27780b12431cc1e7c92c Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Fri, 10 Mar 2017 14:14:59 -0800 Subject: [PATCH 516/797] Fix the `cookie` module definition (#15111) --- cookie/cookie-tests.ts | 4 +- cookie/index.d.ts | 118 ++++++++++++++++++++++++++++++++++++----- 2 files changed, 106 insertions(+), 16 deletions(-) diff --git a/cookie/cookie-tests.ts b/cookie/cookie-tests.ts index 2581a5c372..dd5be0f850 100644 --- a/cookie/cookie-tests.ts +++ b/cookie/cookie-tests.ts @@ -17,7 +17,7 @@ function test_parse(): void { } function test_options(): void { - var serializeOptions: CookieSerializeOptions = { + var serializeOptions: cookie.CookieSerializeOptions = { encode: (x: string) => x, path: '/', expires: new Date(), @@ -27,7 +27,7 @@ function test_options(): void { httpOnly: false }; - var parseOptios: CookieParseOptions = { + var parseOptios: cookie.CookieParseOptions = { decode: (x: string) => x }; } diff --git a/cookie/index.d.ts b/cookie/index.d.ts index 950796fa22..507eaee01d 100644 --- a/cookie/index.d.ts +++ b/cookie/index.d.ts @@ -1,28 +1,118 @@ -// Type definitions for cookie v0.1.2 +// Type definitions for cookie v0.3.0 // Project: https://github.com/jshttp/cookie // Definitions by: Pine Mizune // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface CookieSerializeOptions { - encode?: (val: string) => string; - path?: string; - expires?: Date; - maxAge?: number; + /** + * Specifies the value for the Domain Set-Cookie attribute. By default, no + * domain is set, and most clients will consider the cookie to apply to only + * the current domain. + */ domain?: string; - secure?: boolean; + /** + * Specifies a function that will be used to encode a cookie's value. Since + * value of a cookie has a limited character set (and must be a simple + * string), this function can be used to encode a value into a string suited + * for a cookie's value. + * + * The default function is the global `encodeURIComponent`, which will + * encode a JavaScript string into UTF-8 byte sequences and then URL-encode + * any that fall outside of the cookie range. + */ + encode?: (val: string) => string; + /** + * Specifies the `Date` object to be the value for the `Expires` + * `Set-Cookie` attribute. By default, no expiration is set, and most + * clients will consider this a "non-persistent cookie" and will delete it + * on a condition like exiting a web browser application. + * + * *Note* the cookie storage model specification states that if both + * `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is + * possible not all clients by obey this, so if both are set, they should + * point to the same date and time. + */ + expires?: Date; + /** + * Specifies the boolean value for the `HttpOnly` `Set-Cookie` attribute. + * When truthy, the `HttpOnly` attribute is set, otherwise it is not. By + * default, the `HttpOnly` attribute is not set. + * + * *Note* be careful when setting this to true, as compliant clients will + * not allow client-side JavaScript to see the cookie in `document.cookie`. + */ httpOnly?: boolean; + /** + * Specifies the number (in seconds) to be the value for the `Max-Age` + * `Set-Cookie` attribute. The given number will be converted to an integer + * by rounding down. By default, no maximum age is set. + * + * *Note* the cookie storage model specification states that if both + * `expires` and `maxAge` are set, then `maxAge` takes precedence, but it is + * possible not all clients by obey this, so if both are set, they should + * point to the same date and time. + */ + maxAge?: number; + /** + * Specifies the value for the `Path` `Set-Cookie` attribute. By default, + * the path is considered the "default path". + */ + path?: string; + /** + * Specifies the boolean or string to be the value for the `SameSite` + * `Set-Cookie` attribute. + * + * - `true` will set the `SameSite` attribute to `Strict` for strict same + * site enforcement. + * - `false` will not set the `SameSite` attribute. + * - `'lax'` will set the `SameSite` attribute to Lax for lax same site + * enforcement. + * - `'strict'` will set the `SameSite` attribute to Strict for strict same + * site enforcement. + */ + sameSite?: boolean | 'lax' | 'strict'; + /** + * Specifies the boolean value for the `Secure` `Set-Cookie` attribute. When + * truthy, the `Secure` attribute is set, otherwise it is not. By default, + * the `Secure` attribute is not set. + * + * *Note* be careful when setting this to `true`, as compliant clients will + * not send the cookie back to the server in the future if the browser does + * not have an HTTPS connection. + */ + secure?: boolean; } interface CookieParseOptions { + /** + * Specifies a function that will be used to decode a cookie's value. Since + * the value of a cookie has a limited character set (and must be a simple + * string), this function can be used to decode a previously-encoded cookie + * value into a JavaScript string or other object. + * + * The default function is the global `decodeURIComponent`, which will decode + * any URL-encoded sequences into their byte representations. + * + * *Note* if an error is thrown from this function, the original, non-decoded + * cookie value will be returned as the cookie's value. + */ decode?: (val: string) => string; } -interface CookieStatic { - serialize(name: string, val: string, options?: CookieSerializeOptions): string; - parse(str: string, options?: CookieParseOptions): { [key: string]: string }; -} +/** + * Parse an HTTP Cookie header string and returning an object of all cookie + * name-value pairs. + * + * @param str the string representing a `Cookie` header value + * @param options object containing parsing options + */ +export function parse(str: string, options?: CookieParseOptions): { [key: string]: string }; -declare module "cookie" { - var cookie: CookieStatic; - export = cookie; -} +/** + * Serialize a cookie name-value pair into a `Set-Cookie` header string. + * + * @param name the name for the cookie + * @param val value to set the cookie to + * @param options object containing serialization options + */ +export function serialize(name: string, val: string, options?: CookieSerializeOptions): string; From 8dd753de5a1e97fe75d9d25df3d78c227c409309 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 10 Mar 2017 14:16:40 -0800 Subject: [PATCH 517/797] core-js: Lint and use "lib" to eliminate unnecessary code. (#15108) --- core-js/core-js-tests.ts | 10 +- core-js/index.d.ts | 937 ++------------------------------------- core-js/tsconfig.json | 5 +- core-js/tslint.json | 6 + 4 files changed, 56 insertions(+), 902 deletions(-) create mode 100644 core-js/tslint.json diff --git a/core-js/core-js-tests.ts b/core-js/core-js-tests.ts index 42cd770b86..0614b117b9 100644 --- a/core-js/core-js-tests.ts +++ b/core-js/core-js-tests.ts @@ -8,7 +8,7 @@ let s: string; let i: number; let b: boolean; let f: () => void; -let o: Object; +let o: {}; let r: RegExp; let sym: symbol; let e: Error; @@ -21,7 +21,7 @@ let arrayOfPoint3D: Point3D[]; let arrayOfSymbol: symbol[]; let arrayOfPropertyKey: PropertyKey[]; let arrayOfAny: any[]; -let arrayOfStringAny: [string, any][]; +let arrayOfStringAny: Array<[string, any]>; let arrayLikeOfAny: ArrayLike; let iterableOfPoint: Iterable; let iterableOfStringPoint: Iterable<[string, Point]>; @@ -57,7 +57,7 @@ let dictOfAny: Dict; // ############################################################################################# // ECMAScript 6: Object & Function -// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of, +// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of, // es6.object.to-string, es6.function.name and es6.function.has-instance. // ############################################################################################# @@ -88,8 +88,8 @@ arrayOfPoint = Array.of(point, point); // ############################################################################################# // ECMAScript 6: String & RegExp -// Modules: es6.string.from-code-point, es6.string.raw, es6.string.code-point-at, -// es6.string.ends-with, es6.string.includes, es6.string.repeat, +// Modules: es6.string.from-code-point, es6.string.raw, es6.string.code-point-at, +// es6.string.ends-with, es6.string.includes, es6.string.repeat, // es6.string.starts-with, and es6.regexp // ############################################################################################# diff --git a/core-js/index.d.ts b/core-js/index.d.ts index a0a10708d9..4191cd11aa 100644 --- a/core-js/index.d.ts +++ b/core-js/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for core-js v0.9.7 +// Type definitions for core-js 0.9 // Project: https://github.com/zloirock/core-js/ // Definitions by: Ron Buckton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. @@ -18,539 +19,12 @@ See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -declare type PropertyKey = string | number | symbol; - -// ############################################################################################# -// ECMAScript 6: Object & Function -// Modules: es6.object.assign, es6.object.is, es6.object.set-prototype-of, -// es6.object.to-string, es6.function.name and es6.function.has-instance. -// ############################################################################################# - -interface ObjectConstructor { - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source The source object from which to copy properties. - */ - assign(target: T, source: U): T & U; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - */ - assign(target: T, source1: U, source2: V): T & U & V; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param source1 The first source object from which to copy properties. - * @param source2 The second source object from which to copy properties. - * @param source3 The third source object from which to copy properties. - */ - assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; - - /** - * Copy the values of all of the enumerable own properties from one or more source objects to a - * target object. Returns the target object. - * @param target The target object to copy to. - * @param sources One or more source objects from which to copy properties - */ - assign(target: any, ...sources: any[]): any; - - /** - * Returns true if the values are the same value, false otherwise. - * @param value1 The first value. - * @param value2 The second value. - */ - is(value1: any, value2: any): boolean; - - /** - * Sets the prototype of a specified object o to object proto or null. Returns the object o. - * @param o The object to change its prototype. - * @param proto The value of the new prototype or null. - * @remarks Requires `__proto__` support. - */ - setPrototypeOf(o: any, proto: any): any; -} - -interface Function { - /** - * Returns the name of the function. Function names are read-only and can not be changed. - */ - name: string; - - /** - * Determines if a constructor object recognizes an object as one of the - * constructor’s instances. - * @param value The object to test. - */ - [Symbol.hasInstance](value: any): boolean; -} - -// ############################################################################################# -// ECMAScript 6: Array -// Modules: es6.array.from, es6.array.of, es6.array.copy-within, es6.array.fill, es6.array.find, -// and es6.array.find-index -// ############################################################################################# - -interface Array { - /** - * Returns the value of the first element in the array where predicate is true, and undefined - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns undefined. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; - - /** - * Returns the index of the first element in the array where predicate is true, and -1 - * otherwise. - * @param predicate find calls predicate once for each element of the array, in ascending - * order, until it finds one where predicate returns true. If such an element is found, find - * immediately returns that element value. Otherwise, find returns -1. - * @param thisArg If provided, it will be used as the this value for each invocation of - * predicate. If it is not provided, undefined is used instead. - */ - findIndex(predicate: (value: T) => boolean, thisArg?: any): number; - - /** - * Returns the this object after filling the section identified by start and end with value - * @param value value to fill array section with - * @param start index to start filling the array at. If start is negative, it is treated as - * length+start where length is the length of the array. - * @param end index to stop filling the array at. If end is negative, it is treated as - * length+end. - */ - fill(value: T, start?: number, end?: number): T[]; - - /** - * Returns the this object after copying a section of the array identified by start and end - * to the same array starting at position target - * @param target If target is negative, it is treated as length+target where length is the - * length of the array. - * @param start If start is negative, it is treated as length+start. If end is negative, it - * is treated as length+end. - * @param end If not specified, length of the this object is used as its default value. - */ - copyWithin(target: number, start: number, end?: number): T[]; - - [Symbol.unscopables]: any; -} - -interface ArrayConstructor { - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - * @param mapfn A mapping function to call on every element of the array. - * @param thisArg Value of 'this' used to invoke the mapfn. - */ - from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - - /** - * Creates an array from an array-like object. - * @param arrayLike An array-like object to convert to an array. - */ - from(arrayLike: ArrayLike): Array; - - /** - * Creates an array from an iterable object. - * @param iterable An iterable object to convert to an array. - */ - from(iterable: Iterable): Array; - - /** - * Returns a new array from a set of elements. - * @param items A set of elements to include in the new array object. - */ - of(...items: T[]): Array; -} - -// ############################################################################################# -// ECMAScript 6: String & RegExp -// Modules: es6.string.from-code-point, es6.string.raw, es6.string.code-point-at, -// es6.string.ends-with, es6.string.includes, es6.string.repeat, -// es6.string.starts-with, and es6.regexp -// ############################################################################################# - -interface String { - /** - * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point - * value of the UTF-16 encoded code point starting at the string element at position pos in - * the String resulting from converting this object to a String. - * If there is no element at that position, the result is undefined. - * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. - */ - codePointAt(pos: number): number; - - /** - * Returns true if searchString appears as a substring of the result of converting this - * object to a String, at one or more positions that are - * greater than or equal to position; otherwise, returns false. - * @param searchString search string - * @param position If position is undefined, 0 is assumed, so as to search all of the String. - */ - includes(searchString: string, position?: number): boolean; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * endPosition – length(this). Otherwise returns false. - */ - endsWith(searchString: string, endPosition?: number): boolean; - - /** - * Returns a String value that is made from count copies appended together. If count is 0, - * T is the empty String is returned. - * @param count number of copies to append - */ - repeat(count: number): string; - - /** - * Returns true if the sequence of elements of searchString converted to a String is the - * same as the corresponding elements of this object (converted to a String) starting at - * position. Otherwise returns false. - */ - startsWith(searchString: string, position?: number): boolean; -} - -interface StringConstructor { - /** - * Return the String value whose elements are, in order, the elements in the List elements. - * If length is 0, the empty string is returned. - */ - fromCodePoint(...codePoints: number[]): string; - - /** - * String.raw is intended for use as a tag function of a Tagged Template String. When called - * as such the first argument will be a well formed template call site object and the rest - * parameter will contain the substitution values. - * @param template A well-formed template string call site representation. - * @param substitutions A set of substitution values. - */ - raw(template: TemplateStringsArray, ...substitutions: any[]): string; -} - -interface RegExp { - /** - * Returns a string indicating the flags of the regular expression in question. This field is read-only. - * The characters in this string are sequenced and concatenated in the following order: - * - * - "g" for global - * - "i" for ignoreCase - * - "m" for multiline - * - "u" for unicode - * - "y" for sticky - * - * If no flags are set, the value is the empty string. - */ - flags: string; -} - -// ############################################################################################# -// ECMAScript 6: Number & Math -// Modules: es6.number.constructor, es6.number.statics, and es6.math -// ############################################################################################# - -interface NumberConstructor { - /** - * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 - * that is representable as a Number value, which is approximately: - * 2.2204460492503130808472633361816 x 10â€âˆ’â€16. - */ - EPSILON: number; - - /** - * Returns true if passed value is finite. - * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a - * number. Only finite values of the type number, result in true. - * @param number A numeric value. - */ - isFinite(number: number): boolean; - - /** - * Returns true if the value passed is an integer, false otherwise. - * @param number A numeric value. - */ - isInteger(number: number): boolean; - - /** - * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a - * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter - * to a number. Only values of the type number, that are also NaN, result in true. - * @param number A numeric value. - */ - isNaN(number: number): boolean; - - /** - * Returns true if the value passed is a safe integer. - * @param number A numeric value. - */ - isSafeInteger(number: number): boolean; - - /** - * The value of the largest integer n such that n and n + 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1. - */ - MAX_SAFE_INTEGER: number; - - /** - * The value of the smallest integer n such that n and n − 1 are both exactly representable as - * a Number value. - * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). - */ - MIN_SAFE_INTEGER: number; - - /** - * Converts a string to a floating-point number. - * @param string A string that contains a floating-point number. - */ - parseFloat(string: string): number; - - /** - * Converts A string to an integer. - * @param s A string to convert into a number. - * @param radix A value between 2 and 36 that specifies the base of the number in numString. - * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. - * All other strings are considered decimal. - */ - parseInt(string: string, radix?: number): number; -} - -interface Math { - /** - * Returns the number of leading zero bits in the 32-bit binary representation of a number. - * @param x A numeric expression. - */ - clz32(x: number): number; - - /** - * Returns the result of 32-bit multiplication of two numbers. - * @param x First number - * @param y Second number - */ - imul(x: number, y: number): number; - - /** - * Returns the sign of the x, indicating whether x is positive, negative or zero. - * @param x The numeric expression to test - */ - sign(x: number): number; - - /** - * Returns the base 10 logarithm of a number. - * @param x A numeric expression. - */ - log10(x: number): number; - - /** - * Returns the base 2 logarithm of a number. - * @param x A numeric expression. - */ - log2(x: number): number; - - /** - * Returns the natural logarithm of 1 + x. - * @param x A numeric expression. - */ - log1p(x: number): number; - - /** - * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of - * the natural logarithms). - * @param x A numeric expression. - */ - expm1(x: number): number; - - /** - * Returns the hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - cosh(x: number): number; - - /** - * Returns the hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - sinh(x: number): number; - - /** - * Returns the hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - tanh(x: number): number; - - /** - * Returns the inverse hyperbolic cosine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - acosh(x: number): number; - - /** - * Returns the inverse hyperbolic sine of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - asinh(x: number): number; - - /** - * Returns the inverse hyperbolic tangent of a number. - * @param x A numeric expression that contains an angle measured in radians. - */ - atanh(x: number): number; - - /** - * Returns the square root of the sum of squares of its arguments. - * @param values Values to compute the square root for. - * If no arguments are passed, the result is +0. - * If there is only one argument, the result is the absolute value. - * If any argument is +Infinity or -Infinity, the result is +Infinity. - * If any argument is NaN, the result is NaN. - * If all arguments are either +0 or −0, the result is +0. - */ - hypot(...values: number[]): number; - - /** - * Returns the integral part of the a numeric expression, x, removing any fractional digits. - * If x is already an integer, the result is x. - * @param x A numeric expression. - */ - trunc(x: number): number; - - /** - * Returns the nearest single precision float representation of a number. - * @param x A numeric expression. - */ - fround(x: number): number; - - /** - * Returns an implementation-dependent approximation to the cube root of number. - * @param x A numeric expression. - */ - cbrt(x: number): number; -} - // ############################################################################################# // ECMAScript 6: Symbols // Modules: es6.symbol // ############################################################################################# -interface Symbol { - /** Returns a string representation of an object. */ - toString(): string; - - [Symbol.toStringTag]: string; -} - interface SymbolConstructor { - /** - * A reference to the prototype. - */ - prototype: Symbol; - - /** - * Returns a new unique Symbol value. - * @param description Description of the new Symbol object. - */ - (description?: string|number): symbol; - - /** - * Returns a Symbol object from the global symbol registry matching the given key if found. - * Otherwise, returns a new symbol with this key. - * @param key key to search for. - */ - for(key: string): symbol; - - /** - * Returns a key from the global symbol registry matching the given Symbol if found. - * Otherwise, returns a undefined. - * @param sym Symbol to find the key for. - */ - keyFor(sym: symbol): string; - - // Well-known Symbols - - /** - * A method that determines if a constructor object recognizes an object as one of the - * constructor’s instances. Called by the semantics of the instanceof operator. - */ - hasInstance: symbol; - - /** - * A Boolean value that if true indicates that an object should flatten to its array elements - * by Array.prototype.concat. - */ - isConcatSpreadable: symbol; - - /** - * A method that returns the default iterator for an object. Called by the semantics of the - * for-of statement. - */ - iterator: symbol; - - /** - * A regular expression method that matches the regular expression against a string. Called - * by the String.prototype.match method. - */ - match: symbol; - - /** - * A regular expression method that replaces matched substrings of a string. Called by the - * String.prototype.replace method. - */ - replace: symbol; - - /** - * A regular expression method that returns the index within a string that matches the - * regular expression. Called by the String.prototype.search method. - */ - search: symbol; - - /** - * A function valued property that is the constructor function that is used to create - * derived objects. - */ - species: symbol; - - /** - * A regular expression method that splits a string at the indices that match the regular - * expression. Called by the String.prototype.split method. - */ - split: symbol; - - /** - * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive - * abstract operation. - */ - toPrimitive: symbol; - - /** - * A String value that is used in the creation of the default string description of an object. - * Called by the built-in method Object.prototype.toString. - */ - toStringTag: symbol; - - /** - * An Object whose own property names are property names that are excluded from the with - * environment bindings of the associated objects. - */ - unscopables: symbol; - /** * Non-standard. Use simple mode for core-js symbols. See https://github.com/zloirock/core-js/#caveats-when-using-symbol-polyfill */ @@ -562,193 +36,6 @@ interface SymbolConstructor { userSetter(): void; } -declare var Symbol: SymbolConstructor; - -interface Object { - /** - * Determines whether an object has a property with the specified name. - * @param v A property name. - */ - hasOwnProperty(v: PropertyKey): boolean; - - /** - * Determines whether a specified property is enumerable. - * @param v A property name. - */ - propertyIsEnumerable(v: PropertyKey): boolean; -} - -interface ObjectConstructor { - /** - * Returns an array of all symbol properties found directly on object o. - * @param o Object to retrieve the symbols from. - */ - getOwnPropertySymbols(o: any): symbol[]; - - /** - * Gets the own property descriptor of the specified object. - * An own property descriptor is one that is defined directly on the object and is not - * inherited from the object's prototype. - * @param o Object that contains the property. - * @param p Name of the property. - */ - getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor; - - /** - * Adds a property to an object, or modifies attributes of an existing property. - * @param o Object on which to add or modify the property. This can be a native JavaScript - * object (that is, a user-defined object or a built in object) or a DOM object. - * @param p The property name. - * @param attributes Descriptor for the property. It can be for a data property or an accessor - * property. - */ - defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any; -} - -interface Math { - [Symbol.toStringTag]: string; -} - -interface JSON { - [Symbol.toStringTag]: string; -} - -// ############################################################################################# -// ECMAScript 6: Collections -// Modules: es6.map, es6.set, es6.weak-map, and es6.weak-set -// ############################################################################################# - -interface Map { - clear(): void; - delete(key: K): boolean; - forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): Map; - size: number; -} - -interface MapConstructor { - new (): Map; - new (iterable: Iterable<[K, V]>): Map; - prototype: Map; -} - -declare var Map: MapConstructor; - -interface Set { - add(value: T): Set; - clear(): void; - delete(value: T): boolean; - forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; - has(value: T): boolean; - size: number; -} - -interface SetConstructor { - new (): Set; - new (iterable: Iterable): Set; - prototype: Set; -} - -declare var Set: SetConstructor; - -interface WeakMap { - delete(key: K): boolean; - get(key: K): V; - has(key: K): boolean; - set(key: K, value?: V): WeakMap; -} - -interface WeakMapConstructor { - new (): WeakMap; - new (iterable: Iterable<[K, V]>): WeakMap; - prototype: WeakMap; -} - -declare var WeakMap: WeakMapConstructor; - -interface WeakSet { - add(value: T): WeakSet; - delete(value: T): boolean; - has(value: T): boolean; -} - -interface WeakSetConstructor { - new (): WeakSet; - new (iterable: Iterable): WeakSet; - prototype: WeakSet; -} - -declare var WeakSet: WeakSetConstructor; - -// ############################################################################################# -// ECMAScript 6: Iterators -// Modules: es6.string.iterator, es6.array.iterator, es6.map, es6.set, web.dom.iterable -// ############################################################################################# - -interface IteratorResult { - done: boolean; - value?: T; -} - -interface Iterator { - next(value?: any): IteratorResult; - return?(value?: any): IteratorResult; - throw?(e?: any): IteratorResult; -} - -interface Iterable { - [Symbol.iterator](): Iterator; -} - -interface IterableIterator extends Iterator { - [Symbol.iterator](): IterableIterator; -} - -interface String { - /** Iterator */ - [Symbol.iterator](): IterableIterator; -} - -interface Array { - /** Iterator */ - [Symbol.iterator](): IterableIterator; - - /** - * Returns an array of key, value pairs for every entry in the array - */ - entries(): IterableIterator<[number, T]>; - - /** - * Returns an list of keys in the array - */ - keys(): IterableIterator; - - /** - * Returns an list of values in the array - */ - values(): IterableIterator; -} - -interface Map { - entries(): IterableIterator<[K, V]>; - keys(): IterableIterator; - values(): IterableIterator; - [Symbol.iterator](): IterableIterator<[K, V]>; -} - -interface Set { - entries(): IterableIterator<[T, T]>; - keys(): IterableIterator; - values(): IterableIterator; - [Symbol.iterator](): IterableIterator; -} - -interface NodeList { - [Symbol.iterator](): IterableIterator; -} - interface $for extends IterableIterator { of(callbackfn: (value: T, key: any) => void, thisArg?: any): void; array(): T[]; @@ -759,135 +46,6 @@ interface $for extends IterableIterator { declare function $for(iterable: Iterable): $for; -// ############################################################################################# -// ECMAScript 6: Promises -// Modules: es6.promise -// ############################################################################################# - -interface PromiseLike { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; -} - -/** - * Represents the completion of an asynchronous operation - */ -interface Promise { - /** - * Attaches callbacks for the resolution and/or rejection of the Promise. - * @param onfulfilled The callback to execute when the Promise is resolved. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of which ever callback is executed. - */ - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; - then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): Promise; - - /** - * Attaches a callback for only the rejection of the Promise. - * @param onrejected The callback to execute when the Promise is rejected. - * @returns A Promise for the completion of the callback. - */ - catch(onrejected?: (reason: any) => T | PromiseLike): Promise; - catch(onrejected?: (reason: any) => void): Promise; -} - -interface PromiseConstructor { - /** - * A reference to the prototype. - */ - prototype: Promise; - - /** - * Creates a new Promise. - * @param executor A callback used to initialize the promise. This callback is passed two arguments: - * a resolve callback used resolve the promise with a value or the result of another promise, - * and a reject callback used to reject the promise with a provided reason or error. - */ - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; - - /** - * Creates a Promise that is resolved with an array of results when all of the provided Promises - * resolve, or rejected when any Promise is rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>; - all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>; - all(values: Iterable>): Promise; - - /** - * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved - * or rejected. - * @param values An array of Promises. - * @returns A new Promise. - */ - race(values: Iterable>): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new rejected promise for the provided reason. - * @param reason The reason the promise was rejected. - * @returns A new rejected Promise. - */ - reject(reason: any): Promise; - - /** - * Creates a new resolved promise for the provided value. - * @param value A promise. - * @returns A promise whose internal state matches the provided promise. - */ - resolve(value: T | PromiseLike): Promise; - - /** - * Creates a new resolved promise . - * @returns A resolved promise. - */ - resolve(): Promise; -} - -declare var Promise: PromiseConstructor; - -// ############################################################################################# -// ECMAScript 6: Reflect -// Modules: es6.reflect -// ############################################################################################# - -declare namespace Reflect { - function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; - function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any; - function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; - function deleteProperty(target: any, propertyKey: PropertyKey): boolean; - function enumerate(target: any): IterableIterator; - function get(target: any, propertyKey: PropertyKey, receiver?: any): any; - function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; - function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: PropertyKey): boolean; - function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; - function preventExtensions(target: any): boolean; - function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; - function setPrototypeOf(target: any, proto: any): boolean; -} - // ############################################################################################# // ECMAScript 7 // Modules: es7.array.includes, es7.string.at, es7.string.pad-start, es7.string.pad-end, @@ -895,19 +53,11 @@ declare namespace Reflect { // es7.map.to-json, and es7.set.to-json // ############################################################################################# -interface Array { - includes(value: T, fromIndex?: number): boolean; -} - interface String { at(index: number): string; - padStart(length: number, fillStr?: string): string; - padEnd(length: number, fillStr?: string): string; } -interface ObjectConstructor { - values(object: any): any[]; - entries(object: any): [string, any][]; +interface Object { getOwnPropertyDescriptors(object: any): PropertyDescriptorMap; } @@ -942,7 +92,7 @@ interface ArrayConstructor { * Combines two or more arrays. * @param items Additional items to add to the end of array1. */ - concat(array: ArrayLike, ...items: (T[]| T)[]): T[]; + concat(array: ArrayLike, ...items: Array): T[]; /** * Adds all the elements of an array separated by the specified separator string. * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. @@ -969,19 +119,13 @@ interface ArrayConstructor { */ sort(array: ArrayLike, compareFn?: (a: T, b: T) => number): T[]; - /** - * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. - * @param start The zero-based location in the array from which to start removing elements. - */ - splice(array: ArrayLike, start: number): T[]; - /** * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements. * @param start The zero-based location in the array from which to start removing elements. * @param deleteCount The number of elements to remove. * @param items Elements to insert into the array in place of the deleted elements. */ - splice(array: ArrayLike, start: number, deleteCount: number, ...items: T[]): T[]; + splice(array: ArrayLike, start: number, deleteCount?: number, ...items: T[]): T[]; /** * Inserts new elements at the start of an array. @@ -1005,14 +149,16 @@ interface ArrayConstructor { /** * Determines whether all the members of an array satisfy the specified test. - * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. + * @param callbackfn A function that accepts up to three arguments. + * The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ every(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; /** * Determines whether the specified callback function returns true for any element of an array. - * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. + * @param callbackfn A function that accepts up to three arguments. + * The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array. * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. */ some(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; @@ -1039,30 +185,38 @@ interface ArrayConstructor { filter(array: ArrayLike, callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): T[]; /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * Calls the specified callback function for all the elements in an array. + * The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. + * The first call to the callbackfn function provides this value as an argument instead of an array value. */ reduce(array: ArrayLike, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; /** - * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * Calls the specified callback function for all the elements in an array. + * The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. + * The first call to the callbackfn function provides this value as an argument instead of an array value. */ reduce(array: ArrayLike, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. + * The first call to the callbackfn function provides this value as an argument instead of an array value. */ reduceRight(array: ArrayLike, callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; /** - * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. + * Calls the specified callback function for all the elements in an array, in descending order. + * The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. - * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. + * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. + * The first call to the callbackfn function provides this value as an argument instead of an array value. */ reduceRight(array: ArrayLike, callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; @@ -1090,7 +244,7 @@ interface ArrayConstructor { * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ - find(array: ArrayLike, predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; + find(array: ArrayLike, predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): T; /** * Returns the index of the first element in the array where predicate is true, and undefined @@ -1125,8 +279,8 @@ interface ArrayConstructor { copyWithin(array: ArrayLike, target: number, start: number, end?: number): T[]; includes(array: ArrayLike, value: T, fromIndex?: number): boolean; - turn(array: ArrayLike, callbackfn: (memo: U, value: T, index: number, array: Array) => void, memo?: U): U; - turn(array: ArrayLike, callbackfn: (memo: Array, value: T, index: number, array: Array) => void, memo?: Array): Array; + turn(array: ArrayLike, callbackfn: (memo: U, value: T, index: number, array: T[]) => void, memo?: U): U; + turn(array: ArrayLike, callbackfn: (memo: T[], value: T, index: number, array: T[]) => void, memo?: T[]): T[]; } // ############################################################################################# @@ -1180,7 +334,7 @@ declare var log: Log; interface Dict { [key: string]: T; [key: number]: T; - //[key: symbol]: T; + // [key: symbol]: T; } interface DictConstructor { @@ -1257,12 +411,12 @@ interface Array { /** * Non-standard. */ - turn(callbackfn: (memo: U, value: T, index: number, array: Array) => void, memo?: U): U; + turn(callbackfn: (memo: U, value: T, index: number, array: T[]) => void, memo?: U): U; /** * Non-standard. */ - turn(callbackfn: (memo: Array, value: T, index: number, array: Array) => void, memo?: Array): Array; + turn(callbackfn: (memo: T[], value: T, index: number, array: T[]) => void, memo?: T[]): T[]; } // ############################################################################################# @@ -1313,10 +467,9 @@ declare namespace core { function get(target: any, propertyKey: PropertyKey, receiver?: any): any; function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; function getPrototypeOf(target: any): any; - function has(target: any, propertyKey: string): boolean; - function has(target: any, propertyKey: symbol): boolean; + function has(target: any, propertyKey: string | symbol): boolean; function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; + function ownKeys(target: any): PropertyKey[]; function preventExtensions(target: any): boolean; function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; function setPrototypeOf(target: any, proto: any): boolean; @@ -1324,10 +477,8 @@ declare namespace core { var Object: { getPrototypeOf(o: any): any; - getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor; getOwnPropertyNames(o: any): string[]; create(o: any, properties?: PropertyDescriptorMap): any; - defineProperty(o: any, p: string, attributes: PropertyDescriptor): any; defineProperties(o: any, properties: PropertyDescriptorMap): any; seal(o: T): T; freeze(o: T): T; @@ -1357,21 +508,18 @@ declare namespace core { }; var Array: { - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - from(iterable: Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): Array; - from(arrayLike: ArrayLike): Array; - from(iterable: Iterable): Array; - of(...items: T[]): Array; + from(arrayLike: ArrayLike | Iterable, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; + from(arrayLike: ArrayLike | Iterable): T[]; + of(...items: T[]): T[]; push(array: ArrayLike, ...items: T[]): number; pop(array: ArrayLike): T; - concat(array: ArrayLike, ...items: (T[]| T)[]): T[]; + concat(array: ArrayLike, ...items: Array): T[]; join(array: ArrayLike, separator?: string): string; reverse(array: ArrayLike): T[]; shift(array: ArrayLike): T; slice(array: ArrayLike, start?: number, end?: number): T[]; sort(array: ArrayLike, compareFn?: (a: T, b: T) => number): T[]; - splice(array: ArrayLike, start: number): T[]; - splice(array: ArrayLike, start: number, deleteCount: number, ...items: T[]): T[]; + splice(array: ArrayLike, start: number, deleteCount?: number, ...items: T[]): T[]; unshift(array: ArrayLike, ...items: T[]): number; indexOf(array: ArrayLike, searchElement: T, fromIndex?: number): number; lastIndexOf(array: ArrayLike, earchElement: T, fromIndex?: number): number; @@ -1387,13 +535,13 @@ declare namespace core { entries(array: ArrayLike): IterableIterator<[number, T]>; keys(array: ArrayLike): IterableIterator; values(array: ArrayLike): IterableIterator; - find(array: ArrayLike, predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; + find(array: ArrayLike, predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): T; findIndex(array: ArrayLike, predicate: (value: T) => boolean, thisArg?: any): number; fill(array: ArrayLike, value: T, start?: number, end?: number): T[]; copyWithin(array: ArrayLike, target: number, start: number, end?: number): T[]; includes(array: ArrayLike, value: T, fromIndex?: number): boolean; - turn(array: ArrayLike, callbackfn: (memo: Array, value: T, index: number, array: Array) => void, memo?: Array): Array; - turn(array: ArrayLike, callbackfn: (memo: U, value: T, index: number, array: Array) => void, memo?: U): U; + turn(array: ArrayLike, callbackfn: (memo: T[], value: T, index: number, array: T[]) => void, memo?: T[]): T[]; + turn(array: ArrayLike, callbackfn: (memo: U, value: T, index: number, array: T[]) => void, memo?: U): U; }; var String: { @@ -1782,8 +930,7 @@ declare module "core-js/fn/function/has-instance" { var hasInstance: (value: any) => boolean; export = hasInstance; } -declare module "core-js/fn/function/name" -{ +declare module "core-js/fn/function/name" { } declare module "core-js/fn/function/part" { var part: typeof core.Function.part; diff --git a/core-js/tsconfig.json b/core-js/tsconfig.json index b37502a626..8c7007b563 100644 --- a/core-js/tsconfig.json +++ b/core-js/tsconfig.json @@ -2,8 +2,9 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "es5", - "dom" + "es2017", + "dom", + "dom.iterable" ], "noImplicitAny": true, "noImplicitThis": true, diff --git a/core-js/tslint.json b/core-js/tslint.json new file mode 100644 index 0000000000..0f47deabb4 --- /dev/null +++ b/core-js/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "../tslint.json", + "rules": { + "forbidden-types": false + } +} \ No newline at end of file From 468026989e4bfb7ce52b708c9cdb6cca0b9c589c Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 10 Mar 2017 14:16:54 -0800 Subject: [PATCH 518/797] openfin: Remove BOM (#15107) --- openfin/openfin-tests.ts | 2 +- openfin/v15/openfin-tests.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/openfin/openfin-tests.ts b/openfin/openfin-tests.ts index 63a53f7cb5..cb08f60a62 100644 --- a/openfin/openfin-tests.ts +++ b/openfin/openfin-tests.ts @@ -1,4 +1,4 @@ -function test_application() { +function test_application() { let application: fin.OpenFinApplication; // constructor application = new fin.desktop.Application({ diff --git a/openfin/v15/openfin-tests.ts b/openfin/v15/openfin-tests.ts index 69b024ce90..c3c1ef1cc6 100644 --- a/openfin/v15/openfin-tests.ts +++ b/openfin/v15/openfin-tests.ts @@ -1,4 +1,3 @@ - function test_application() { let application: fin.OpenFinApplication; // constructor From f4fdcaca9c94f90442dcedb0c8a84399c47e731f Mon Sep 17 00:00:00 2001 From: denisname Date: Fri, 10 Mar 2017 23:21:11 +0100 Subject: [PATCH 519/797] jQuery improve typing (#15102) * jQuery improve typing Each callback returns nothing or boolean Each return its first argument isArray, isFunction and isWindow as type guards type has a more strict return type make unique generic functions * Add libs in angular-oauth2 tsconfig * Linting angular-oauth2 --- angular-oauth2/angular-oauth2-tests.ts | 2 +- angular-oauth2/tsconfig.json | 4 ++ jquery/index.d.ts | 35 +++++++------ jquery/jquery-tests.ts | 70 ++++++++++++++++++++------ 4 files changed, 78 insertions(+), 33 deletions(-) diff --git a/angular-oauth2/angular-oauth2-tests.ts b/angular-oauth2/angular-oauth2-tests.ts index 2b2328d5ee..042fe537aa 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.OAuthProvider){ + .config(['OAuthProvider', (OAuthProvider: angular.oauth2.OAuthProvider) => { OAuthProvider.configure({ baseUrl: 'https://api.website.com', clientId: 'CLIENT_ID', diff --git a/angular-oauth2/tsconfig.json b/angular-oauth2/tsconfig.json index 717721bf79..e8a5250748 100644 --- a/angular-oauth2/tsconfig.json +++ b/angular-oauth2/tsconfig.json @@ -2,6 +2,10 @@ "compilerOptions": { "module": "commonjs", "target": "es6", + "lib": [ + "es6", + "dom" + ], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, diff --git a/jquery/index.d.ts b/jquery/index.d.ts index 3a785530aa..0a47546193 100644 --- a/jquery/index.d.ts +++ b/jquery/index.d.ts @@ -1166,25 +1166,28 @@ interface JQueryStatic { * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. * * @param collection The object or array to iterate over. - * @param callback The function that will be executed on every object. + * @param callback The function that will be executed on every object. Will break the loop by returning false. + * @returns the first argument, the object that is iterated. * @see {@link https://api.jquery.com/jQuery.each/#jQuery-each-array-callback} */ each( collection: T[], - callback: (indexInArray: number, valueOfElement: T) => any - ): any; + callback: (indexInArray: number, valueOfElement: T) => boolean | void + ): T[]; /** * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. * * @param collection The object or array to iterate over. - * @param callback The function that will be executed on every object. + * @param callback The function that will be executed on every object. Will break the loop by returning false. + * @returns the first argument, the object that is iterated. * @see {@link https://api.jquery.com/jQuery.each/#jQuery-each-object-callback} */ - each( - collection: any, - callback: (indexInArray: any, valueOfElement: any) => any - ): any; + each( + collection: T, + // TODO: `(keyInObject: keyof T, valueOfElement: T[keyof T])`, when TypeScript 2.1 allowed in repository + callback: (keyInObject: string, valueOfElement: any) => boolean | void + ): T; /** * Merge the contents of two or more objects together into the first object. @@ -1240,7 +1243,7 @@ interface JQueryStatic { * @param obj Object to test whether or not it is an array. * @see {@link https://api.jquery.com/jQuery.isArray/} */ - isArray(obj: any): boolean; + isArray(obj: any): obj is Array; /** * Check to see if an object is empty (contains no enumerable properties). * @@ -1254,7 +1257,7 @@ interface JQueryStatic { * @param obj Object to test whether or not it is a function. * @see {@link https://api.jquery.com/jQuery.isFunction/} */ - isFunction(obj: any): boolean; + isFunction(obj: any): obj is Function; /** * Determines whether its argument is a number. * @@ -1275,7 +1278,7 @@ interface JQueryStatic { * @param obj Object to test whether or not it is a window. * @see {@link https://api.jquery.com/jQuery.isWindow/} */ - isWindow(obj: any): boolean; + isWindow(obj: any): obj is Window; /** * Check to see if a DOM node is within an XML document (or is an XML document). * @@ -1360,7 +1363,7 @@ interface JQueryStatic { * @param obj Object to get the internal JavaScript [[Class]] of. * @see {@link https://api.jquery.com/jQuery.type/} */ - type(obj: any): string; + type(obj: any): "array" | "boolean" | "date" | "error" | "function" | "null" | "number" | "object" | "regexp" | "string" | "symbol" | "undefined"; /** * Sorts an array of DOM elements, in place, with the duplicates removed. Note that this only works on arrays of DOM elements, not strings or numbers. @@ -1368,7 +1371,7 @@ interface JQueryStatic { * @param array The Array of DOM elements. * @see {@link https://api.jquery.com/jQuery.unique/} */ - unique(array: Element[]): Element[]; + unique(array: T[]): T[]; /** * Parses a string into an array of DOM nodes. @@ -3301,10 +3304,10 @@ interface JQuery { /** * Iterate over a jQuery object, executing a function for each matched element. * - * @param func A function to execute for each matched element. + * @param func A function to execute for each matched element. Can stop the loop by returning false. * @see {@link https://api.jquery.com/each/} */ - each(func: (index: number, elem: Element) => any): JQuery; + each(func: (index: number, elem: Element) => boolean | void): JQuery; /** * Retrieve one of the elements matched by the jQuery object. @@ -3457,7 +3460,7 @@ interface JQuery { * @param func A function used as a test for each element in the set. this is the current DOM element. * @see {@link https://api.jquery.com/filter/#filter-function} */ - filter(func: (index: number, element: Element) => any): JQuery; + filter(func: (index: number, element: Element) => boolean): JQuery; /** * Reduce the set of matched elements to those that match the selector or pass the function's test. * diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index e11a8b806f..d2d58aa2a2 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -100,16 +100,18 @@ function test_ajax() { if (getAllResponseHeaders()) { return getAllResponseHeaders(); } - var allHeaders = ""; - $(["Cache-Control", "Content-Language", "Content-Type", - "Expires", "Last-Modified", "Pragma"]).each(function (i, header_name) { - if (xhr.getResponseHeader(header_name)) { - allHeaders += header_name + ": " + xhr.getResponseHeader(header_name) + "\n"; - } - return allHeaders; - }); + var allHeaders = ""; + var headersFieldNames = ["Cache-Control", "Content-Language", "Content-Type", + "Expires", "Last-Modified", "Pragma"]; + $(headersFieldNames).each(function (i, header_name) { + if (xhr.getResponseHeader(header_name)) { + allHeaders += header_name + ": " + xhr.getResponseHeader(header_name) + "\n"; + } + }); + return allHeaders; }; + return xhr; }; $.ajax({ @@ -1392,9 +1394,24 @@ function test_detach() { } function test_each() { - $.each([52, 97], function (index, value) { + var numArray: number[]; + numArray = $.each([1, 2, 3, 4], function (index: number, value: number) { alert(index + ': ' + value); }); + numArray = $.each([1, 2, 3, 4], function (index: number, value: number) { + alert(index + ': ' + value); + return value < 2; + }); + + var res: {one: number, 2: string}; + res = $.each({ one: 1, 2: "two" }, function(key: string, value: any) { + alert(key + ': ' + value); + }); + res = $.each({ one: 1, 2: "two" }, function(key: string, value: any) { + alert(key + ': ' + value); + return key === "2"; + }); + var map = { 'flammable': 'inflammable', 'duh': 'no duh' @@ -1404,8 +1421,7 @@ function test_each() { }); var arr = ["one", "two", "three", "four", "five"]; var obj = { one: 1, two: 2, three: 3, four: 4, five: 5 }; - // TODO: Should not need explicit type annotation https://github.com/Microsoft/TypeScript/issues/10072 - jQuery.each(arr, function () { + jQuery.each(arr, function () { $("#" + this).text("Mine is " + this + "."); return (this != "three"); }); @@ -1482,9 +1498,10 @@ function test_error() { $(this).hide(); }) .attr("src", "missing.png"); + jQuery.error("Oups"); jQuery.error = (message?: string) => { console.error(message); return this; - } + }; } function test_eventParams() { @@ -1516,7 +1533,7 @@ function test_eventParams() { function propStopped(e) { var msg = ""; if (e.isPropagationStopped()) { - msg = "called" + msg = "called"; } else { msg = "not called"; } @@ -1703,11 +1720,11 @@ function test_fadeToggle() { function test_filter() { $('li').filter(':even').css('background-color', 'red'); $('li').filter(function (index) { - return index % 3 == 2; + return index % 3 === 2; }).css('background-color', 'red'); $("div").css("background", "#b4b0da") .filter(function (index) { - return index == 1 || $(this).attr("id") == "fourth"; + return index === 1 || $(this).attr("id") === "fourth"; }) .css("border", "3px double red"); $("div").filter(document.getElementById("unique")); @@ -1879,7 +1896,7 @@ function test_getJSON() { function (data) { $.each(data.items, function (i, item) { $("").attr("src", item.media.m).appendTo("#images"); - if (i == 3) return false; + if (i === "3") return false; }); }); $.getJSON("test.js", function (json) { @@ -2524,6 +2541,17 @@ function test_is() { }); } +function test_isTypeGuards() { + var foo: number[] | ((x: string) => number) | Window; + if (jQuery.isArray(foo)) { + foo.push(1515); + } else if (jQuery.isWindow(foo)) { + foo.close(); + } else if (jQuery.isFunction(foo)) { + foo("hello world"); + } +} + function test_isArray() { $("b").append("" + $.isArray([])); } @@ -2582,6 +2610,16 @@ function test_isXMLDoc() { jQuery.isXMLDoc(document.body); } +function test_unique() { + jQuery.unique($('div.foo, div.bar').get()); + jQuery.unique($('div.foo, div.bar').toArray()); + + var divs: HTMLDivElement[]; + var unique: HTMLDivElement[]; + unique = jQuery.unique(divs); + unique = jQuery.unique(divs); +} + function test_jQuery() { $('div.foo'); $('div.foo').click(function () { From fdffd336315881eefd466a6524ddc66e637a42c6 Mon Sep 17 00:00:00 2001 From: Conrad Wahlen Date: Fri, 10 Mar 2017 23:21:43 +0100 Subject: [PATCH 520/797] setFromSpherical return type corrected (#15101) --- three/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/three/index.d.ts b/three/index.d.ts index 46975498c3..ff962d17b7 100644 --- a/three/index.d.ts +++ b/three/index.d.ts @@ -4240,7 +4240,7 @@ declare namespace THREE { distanceToSquared(v: Vector3): number; distanceToManhattan(v: Vector3): number; - setFromSpherical(s: Spherical): Matrix3; + setFromSpherical(s: Spherical): Vector3; setFromMatrixPosition(m: Matrix4): Vector3; setFromMatrixScale(m: Matrix4): Vector3; setFromMatrixColumn(matrix: Matrix4, index: number): Vector3; From 0a5c482bc7b4a830644c6103640d391749517fae Mon Sep 17 00:00:00 2001 From: voxmatt Date: Fri, 10 Mar 2017 14:23:33 -0800 Subject: [PATCH 521/797] fixing tests and removing Object references --- react-relay/index.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/react-relay/index.d.ts b/react-relay/index.d.ts index 961acbccc2..a693527e3e 100644 --- a/react-relay/index.d.ts +++ b/react-relay/index.d.ts @@ -15,7 +15,7 @@ declare module "react-relay" { } interface CreateContainerOpts { - initialVariables?: Object + initialVariables?: any fragments: Fragments prepareVariables?(prevVariables: RelayVariables): RelayVariables } @@ -148,13 +148,13 @@ declare module "react-relay" { } interface RelayProp { - route: { name: string; }; // incomplete, also has params and queries - variables: Object; - pendingVariables?: Object | null; - setVariables(variables: Object, onReadyStateChange?: OnReadyStateChange): void; - forceFetch(variables: Object, onReadyStateChange?: OnReadyStateChange): void; - hasOptimisticUpdate(record: Object): boolean; - getPendingTransactions(record: Object): RelayMutationTransaction[]; + readonly route: { name: string; }; // incomplete, also has params and queries + readonly variables: any; + readonly pendingVariables?: any | null; + setVariables(variables: any, onReadyStateChange?: OnReadyStateChange): void; + forceFetch(variables: any, onReadyStateChange?: OnReadyStateChange): void; + hasOptimisticUpdate(record: any): boolean; + getPendingTransactions(record: any): RelayMutationTransaction[]; commitUpdate: (mutation: Mutation, callbacks?: StoreUpdateCallbacks) => any; } } From 5383957c388e0c7b69e72bed7b4ac935d2a00a3e Mon Sep 17 00:00:00 2001 From: Knuddels Date: Fri, 10 Mar 2017 23:30:12 +0100 Subject: [PATCH 522/797] fixed missing static modifier (#15098) --- knuddels-userapps-api/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knuddels-userapps-api/index.d.ts b/knuddels-userapps-api/index.d.ts index b388301f68..52183f832f 100644 --- a/knuddels-userapps-api/index.d.ts +++ b/knuddels-userapps-api/index.d.ts @@ -1541,7 +1541,7 @@ declare class KnuddelsServer { * Liefert ein ExternalServerAccess-Objekt, mit dem * andere Server angesteuert werden können. */ - getExternalServerAccess(): ExternalServerAccess; + static getExternalServerAccess(): ExternalServerAccess; /** * Aktualisiert die Liste der genutzten Hooks. Werden zur Laufzeit chatCommands oder App-Hooks (wie mayJoinChannel) dynamisch erzeugt oder gelöscht, so muss danach refreshHooks() * aufgerufen werden, damit diese Änderung wirksam wird. From 4b0194180f145b06c30ea76f36fb31ae06974fbb Mon Sep 17 00:00:00 2001 From: Andrey Kurdyumov Date: Sat, 11 Mar 2017 04:43:27 +0600 Subject: [PATCH 523/797] Add fitlers paramters to react-bootstrap-table (#14861) --- react-bootstrap-table/index.d.ts | 27 ++++++++- .../react-bootstrap-table-tests.tsx | 55 ++++++++++++++++++- 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/react-bootstrap-table/index.d.ts b/react-bootstrap-table/index.d.ts index 566019ab94..82384f0d9f 100644 --- a/react-bootstrap-table/index.d.ts +++ b/react-bootstrap-table/index.d.ts @@ -356,7 +356,7 @@ export interface Options { /** Background color on expanded rows. */ - expandRowBgColor?: string; + expandRowBgColor?: string; /** Assign a callback function which will be called when mouse enter into the table. */ @@ -568,6 +568,11 @@ export interface Editable { cols?: number; rows?: number; } +export type SetFilterCallback = (targetValue: any) => boolean; +export interface ApplyFilterParameter { + callback: SetFilterCallback; +} + export type FilterType = 'TextFilter' | 'RegexFilter' | 'SelectFilter' | 'NumberFilter' | 'DateFilter' | 'CustomFilter'; export interface Filter { /** @@ -590,6 +595,26 @@ export interface Filter { * Only work on NumberFilter. Accept an array which conatin the filter condition, like: ['<','>','='] */ numberComparators?: string[]; + + /** + * Options for the filter. + */ + options?: any; + + /** + * Comparison condition for the NumberFilter + */ + condition?: string; + + /** + * Get element which represent filter. + */ + getElement?: (filterHandler: (parameters?: ApplyFilterParameter) => void, filterParameters: any) => JSX.Element; + + /** + * Parameters for custom filter + */ + customFilterParameters?: any; } export interface TableHeaderColumn extends ComponentClass { } diff --git a/react-bootstrap-table/react-bootstrap-table-tests.tsx b/react-bootstrap-table/react-bootstrap-table-tests.tsx index 47682dd36a..2151f14c78 100644 --- a/react-bootstrap-table/react-bootstrap-table-tests.tsx +++ b/react-bootstrap-table/react-bootstrap-table-tests.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import { render } from 'react-dom'; -import { BootstrapTable, TableHeaderColumn } from 'react-bootstrap-table'; +import { BootstrapTable, TableHeaderColumn, ApplyFilterParameter } from 'react-bootstrap-table'; var products = [{ id: 1, @@ -27,3 +27,56 @@ render( , document.getElementById("app") ); + +const qualityType = { + 0: 'good', + 1: 'bad', + 2: 'unknown' +}; + +function enumFormatter(cell: any, row: any, enumObject: any) { + return enumObject[cell]; +} + +class SelectFilterWithDefaultValue extends React.Component { + render() { + return ( + + Product ID + Product Name + Product Quality + + ); + } +} + +class TextFilterWithCondition extends React.Component { + render() { + return ( + + Product ID + Product Name + Product Price + + ); + } +} + +function getCustomFilter(filterHandler: (parameters?: ApplyFilterParameter) => void, customFilterParameters: any) { + return ( +
    + ); +} + +class CustomFilter extends React.Component { + render() { + return ( + + Product ID + Product Name + Product Is In Stock + + ); + } +} From 62fdb1966ea605cf9a670d27f28c6d91f684e12d Mon Sep 17 00:00:00 2001 From: Michael McMullin Date: Fri, 10 Mar 2017 22:45:32 +0000 Subject: [PATCH 524/797] Add support for PlaceResult.opening_hours (#14859) --- googlemaps/index.d.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/googlemaps/index.d.ts b/googlemaps/index.d.ts index 60e0a92dfc..765b974bf6 100644 --- a/googlemaps/index.d.ts +++ b/googlemaps/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Google Maps JavaScript API 3.26 // Project: https://developers.google.com/maps/ -// Definitions by: Folia A/S , Chris Wrench , Kiarash Ghiaseddin , Grant Hutchins , Denis Atyasov +// Definitions by: Folia A/S , Chris Wrench , Kiarash Ghiaseddin , Grant Hutchins , Denis Atyasov , Michael McMullin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /* @@ -2224,6 +2224,22 @@ declare namespace google.maps { types: string[]; } + export interface OpeningHours { + open_now: boolean, + periods: OpeningPeriod[], + weekday_text: string[] + } + + export interface OpeningPeriod { + open: OpeningHoursTime, + close?: OpeningHoursTime + } + + export interface OpeningHoursTime { + day: number, + time: string + } + export interface PredictionTerm { offset: number; value: string; @@ -2290,6 +2306,7 @@ declare namespace google.maps { icon: string; international_phone_number: string; name: string; + opening_hours: OpeningHours; permanently_closed: boolean; photos: PlacePhoto[]; place_id: string; From 565751df4d8dcbf0af8a2fc40ce0fdd1526bdd9f Mon Sep 17 00:00:00 2001 From: Rich Buggy Date: Sat, 11 Mar 2017 09:46:22 +1100 Subject: [PATCH 525/797] Added SNS Message event and allow boolean/number vaues in Proxy Lambda header response (#14858) --- aws-lambda/aws-lambda-tests.ts | 35 ++++++++++++++++++++++++++++- aws-lambda/index.d.ts | 41 +++++++++++++++++++++++++++++++--- 2 files changed, 72 insertions(+), 4 deletions(-) diff --git a/aws-lambda/aws-lambda-tests.ts b/aws-lambda/aws-lambda-tests.ts index 7b0fe45180..1ffdb2980b 100644 --- a/aws-lambda/aws-lambda-tests.ts +++ b/aws-lambda/aws-lambda-tests.ts @@ -11,6 +11,12 @@ var clientContextClient: AWSLambda.ClientContextClient; var context: AWSLambda.Context; var identity: AWSLambda.CognitoIdentity; var proxyResult: AWSLambda.ProxyResult; +var snsEvt: AWSLambda.SNSEvent; +var snsEvtRecs: Array; +var snsEvtRec: AWSLambda.SNSEventRecord; +var snsMsg: AWSLambda.SNSMessage; +var snsMsgAttr: AWSLambda.SNSMessageAttribute; +var snsMsgAttrs: AWSLambda.SNSMessageAttributes; /* API Gateway Event */ str = apiGwEvt.body; @@ -42,9 +48,36 @@ str = apiGwEvt.requestContext.resourceId; str = apiGwEvt.requestContext.resourcePath; str = apiGwEvt.resource; +/* SNS Event */ +snsEvtRecs = snsEvt.Records; + +str = snsEvtRec.EventSource; +str = snsEvtRec.EventSubscriptionArn; +str = snsEvtRec.EventVersion; +snsMsg = snsEvtRec.Sns; + +str = snsMsg.SignatureVersion; +str = snsMsg.Timestamp; +str = snsMsg.Signature; +str = snsMsg.SigningCertUrl; +str = snsMsg.MessageId; +str = snsMsg.Message; +snsMsgAttrs = snsMsg.MessageAttributes; +str = snsMsg.Type; +str = snsMsg.UnsubscribeUrl; +str = snsMsg.TopicArn; +str = snsMsg.Subject; + +snsMsgAttrs["example"] = snsMsgAttr; + +str = snsMsgAttr.Type; +str = snsMsgAttr.Value; + /* Lambda Proxy Result */ num = proxyResult.statusCode; -str = proxyResult.headers["example"]; +proxyResult.headers["example"] = str; +proxyResult.headers["example"] = b; +proxyResult.headers["example"] = num; str = proxyResult.body /* Context */ diff --git a/aws-lambda/index.d.ts b/aws-lambda/index.d.ts index e8b70db7bd..83579b4d0d 100644 --- a/aws-lambda/index.d.ts +++ b/aws-lambda/index.d.ts @@ -39,6 +39,41 @@ interface APIGatewayEvent { resource: string; } +// SNS "event" +interface SNSMessageAttribute { + Type: string; + Value: string; +} + +interface SNSMessageAttributes { + [name: string]: SNSMessageAttribute; +} + +interface SNSMessage { + SignatureVersion: string; + Timestamp: string; + Signature: string; + SigningCertUrl: string; + MessageId: string; + Message: string; + MessageAttributes: SNSMessageAttributes; + Type: string; + UnsubscribeUrl: string; + TopicArn: string; + Subject: string; +} + +interface SNSEventRecord { + EventVersion: string; + EventSubscriptionArn: string; + EventSource: string; + Sns: SNSMessage; +} + +interface SNSEvent { + Records: Array; +} + // Context // http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html interface Context { @@ -97,7 +132,7 @@ interface ClientContextEnv { interface ProxyResult { statusCode: number; headers?: { - [header: string]: string; + [header: string]: boolean | number | string; }, body: string; } @@ -110,8 +145,8 @@ interface ProxyResult { * @param context – runtime information of the Lambda function that is executing. * @param callback – optional callback to return information to the caller, otherwise return value is null. */ -export type Handler = (event: any, context: Context, callback?: Callback) => void; -export type ProxyHandler = (event: APIGatewayEvent, context: Context, callback?: ProxyCallback) => void; +export type Handler = (event: any, context: Context, callback?: Callback) => void; +export type ProxyHandler = (event: APIGatewayEvent, context: Context, callback?: ProxyCallback) => void; /** * Optional callback parameter. From ade29a018c3115f2898fbe643290cf958c9f6f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Marenco?= Date: Fri, 10 Mar 2017 17:46:52 -0500 Subject: [PATCH 526/797] Add customEditor property (#14857) Hi! I was having this issue while using the library: ``` ERROR in [at-loader] frontend/src/components/modals/Upload.tsx:538:40 TS2339: Property 'customEditor' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes>...'. ``` It seems it is missing from the Definition file, so I just added it :). Hope it helps! --- react-bootstrap-table/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/react-bootstrap-table/index.d.ts b/react-bootstrap-table/index.d.ts index 82384f0d9f..9adfacf8c8 100644 --- a/react-bootstrap-table/index.d.ts +++ b/react-bootstrap-table/index.d.ts @@ -475,6 +475,13 @@ export interface TableHeaderColumnProps extends Props { This function taking one arguments: order which present the sort order currently. */ caretRender?: Function; + /** + Give an Object like following to able to customize your own editing component. + This Object should contain these two property: + getElement(REQUIRED): Accept a callback function and take two arguments: onUpdate and props. + customEditorParameters: Another extra data for custom cell edit component. + */ + customEditor?: {getElement: (onUpdate: any, props: any) => ReactElement, customEditorParameters?: Object} ; /** To customize the column. This callback function should return a String or a React Component. In addition, this function taking two argument: cell and row. From 20b7ef9c56451b7acec11bb261e191a8e0777f8a Mon Sep 17 00:00:00 2001 From: Derek Finlinson Date: Fri, 10 Mar 2017 15:47:39 -0700 Subject: [PATCH 527/797] Add setVisible to iFrame control (#14855) --- xrm/index.d.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/xrm/index.d.ts b/xrm/index.d.ts index 02bce0468e..67c5a8e778 100644 --- a/xrm/index.d.ts +++ b/xrm/index.d.ts @@ -1188,6 +1188,19 @@ declare namespace Xrm getVisible(): boolean; } + /** + * Interface for UI elements which can have the visibility value updated. + */ + export interface UiCanSetVisibleElement + { + /** + * Sets the visibility state. + * + * @param {boolean} visible true to show, false to hide. + */ + setVisible( visible: boolean ): void; + } + /** * Base interface for standard UI elements. */ @@ -2522,7 +2535,7 @@ declare namespace Xrm * * @sa FramedControl */ - export interface IframeControl extends FramedControl + export interface IframeControl extends FramedControl, UiCanSetVisibleElement { /** * Gets initial URL defined for the Iframe. From 3cfb266458c7bc4d05625b436164915ed494dd64 Mon Sep 17 00:00:00 2001 From: Matej Matiasko Date: Fri, 10 Mar 2017 23:52:32 +0100 Subject: [PATCH 528/797] Make success callback possible - cors (#14849) --- cors/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cors/index.d.ts b/cors/index.d.ts index ecad80d187..6c1fc3e4c3 100644 --- a/cors/index.d.ts +++ b/cors/index.d.ts @@ -10,7 +10,7 @@ import express = require('express'); type CustomOrigin = ( requestOrigin: string, - callback: (err: Error, allow?: boolean) => void + callback: (err: Error | null, allow?: boolean) => void ) => void; declare namespace e { From e849164bf3f4dbb27abab3819bbc2490c8922407 Mon Sep 17 00:00:00 2001 From: Adrian Ehrsam Date: Fri, 10 Mar 2017 23:53:22 +0100 Subject: [PATCH 529/797] Adds typing for navigo (npm package) (#14848) * Added typings for navigo * add missing header --- navigo/index.d.ts | 49 ++++++++++++++++ navigo/navigo-tests.ts | 123 +++++++++++++++++++++++++++++++++++++++++ navigo/tsconfig.json | 22 ++++++++ navigo/tslint.json | 1 + 4 files changed, 195 insertions(+) create mode 100644 navigo/index.d.ts create mode 100644 navigo/navigo-tests.ts create mode 100644 navigo/tsconfig.json create mode 100644 navigo/tslint.json diff --git a/navigo/index.d.ts b/navigo/index.d.ts new file mode 100644 index 0000000000..35c9f009f6 --- /dev/null +++ b/navigo/index.d.ts @@ -0,0 +1,49 @@ +// Type definitions for navigo 4.0 +// Project: https://github.com/krasimir/navigo +// Definitions by: Adrian Ehrsam +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface NavigoHooks { + before?: ((done: (suppress?: boolean) => void) => void); + after?: () => void; +} +type RouteHandler = ((parametersObj: any, query: string) => void) | { as: string; uses: (parametersObj: any) => void }; + +declare class Navigo { + + /** + * Constructs the router + * @param root The main URL of your application. + * @param useHash If useHash set to true then the router uses an old routing approach with hash in the URL. Navigo anyways falls back to this mode if there is no History API supported. + */ + constructor(root?: string | null, useHash?: boolean); + + + on(location: string, handler: RouteHandler, hooks?: NavigoHooks): Navigo; + on(location: RegExp, handler: (...parameters: string[]) => void, hooks?: NavigoHooks): Navigo; + on(routes: { [key: string]: RouteHandler }): Navigo; + + on(rootHandler: RouteHandler, hooks?: NavigoHooks): Navigo; + + notFound(handler: ((query: string) => void), hooks?: NavigoHooks): void; + + navigate(path: string, absolute?: boolean): void; + + updatePageLinks(): void; + + generate(path: string, params?: any): string; + + resolve(currentURL?: string): boolean; + + link(path: string): string; + + disableIfAPINotAvailable(): void; + + pause(): void; + + resume(): void; + + destroy(): void; +} +export = Navigo; +export as namespace Navigo; \ No newline at end of file diff --git a/navigo/navigo-tests.ts b/navigo/navigo-tests.ts new file mode 100644 index 0000000000..73ea91f416 --- /dev/null +++ b/navigo/navigo-tests.ts @@ -0,0 +1,123 @@ +import Navigo = require("navigo"); + +var root = null; +var useHash = false; + +var router = new Navigo(root, useHash); + +router + .on('/products/list', () => { + // display all the products + }) + .resolve(); + +router + .on(() => { + // show home page here + }) + .resolve(); + +router + .on({ + '/products/list': () => { + // do something + }, + '/products': () => { + // do something + } + }) + .resolve(); + +router + .on({ + 'products/:id': () => { + // do something + }, + 'products': () => { + // do something + }, + '*': () => { + // do something + } + }) + .resolve(); + + +router + .on('/user/:id/:action', (params: { id: string; action: string }) => { + // If we have http://site.com/user/42/save as a url then + // params.id = 42 + // params.action = save + }) + .resolve(); + +router + .on('/user/:id/:action', (params: { id: string; action: string }, query: string) => { + // If we have http://site.com/user/42/save?answer=42 as a url then + // params.id = 42 + // params.action = save + // query = answer=42 + }) + .resolve(); + +router.notFound((query: string) => { + // ... +}); + +router + .on(/users\/(\d+)\/(\w+)\/?/, (id: string, action: string) => { + // If we have http://site.com/user/42/save as a url then + // id = 42 + // action = save + }) + .resolve(); + +router + .on('/user/*', () => { + // This function will be called on every + // URL that starts with /user + }) + .resolve(); + +router.notFound(() => { + // called when there is path specified but + // there is no route matching +}); + +router.navigate('/products/list'); + +router.navigate('http://site.com/products/list', true); + +router = new Navigo('http://site.com/', true); +var handler = () => { + // do something +}; +router.on({ + '/trip/:tripId/edit': { as: 'trip.edit', uses: handler }, + '/trip/save': { as: 'trip.save', uses: handler }, + '/trip/:action/:tripId': { as: 'trip.action', uses: handler } +}); +var a: string = (router.generate('trip.edit', { tripId: 42 })); // --> /trip/42/edit +a = (router.generate('trip.action', { tripId: 42, action: 'save' })); // --> /trip/save/42 +a = (router.generate('trip.save')); // --> /trip/save + +router.pause(); +router.navigate('/en/products'); +router.resume(); // or .pause(false) + +router.on( + '/user/edit', + () => { + // show user edit page + }, + { + before: (done) => { + // doing some async operation + done(false); + done(); + }, + after: () => { + // do something + } + } +); diff --git a/navigo/tsconfig.json b/navigo/tsconfig.json new file mode 100644 index 0000000000..18a90350c6 --- /dev/null +++ b/navigo/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es5" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "navigo-tests.ts" + ] +} \ No newline at end of file diff --git a/navigo/tslint.json b/navigo/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/navigo/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 0e2384e4d350a397fd56a43017578f0664818d3f Mon Sep 17 00:00:00 2001 From: Klaus Sevensleeper Date: Fri, 10 Mar 2017 23:53:54 +0100 Subject: [PATCH 530/797] support strictNullChecks (#14844) better reflect the documented and implemented API --- query-string/index.d.ts | 2 +- query-string/query-string-tests.ts | 2 +- query-string/tsconfig.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/query-string/index.d.ts b/query-string/index.d.ts index 9cd6d8df1e..dcc9bfafb5 100644 --- a/query-string/index.d.ts +++ b/query-string/index.d.ts @@ -13,7 +13,7 @@ declare module "query-string" { * Leading ? or # are ignored, so you can pass location.search or location.hash directly. * @param str */ - export function parse(str: string): { [key: string]: string | string[] }; + export function parse(str: string): { [key: string]: string | string[] | null }; /** * Stringify an object into a query string, sorting the keys. diff --git a/query-string/query-string-tests.ts b/query-string/query-string-tests.ts index c39c2f4982..c5ec7b624d 100644 --- a/query-string/query-string-tests.ts +++ b/query-string/query-string-tests.ts @@ -21,7 +21,7 @@ namespace stringify_tests { } namespace parse_tests { - let result: { [key: string]: string | string[] }; + let result: { [key: string]: string | string[] | null }; result = qs.parse('?foo=bar'); result = qs.parse('#foo=bar'); result = qs.parse('&foo=bar&foo=baz'); diff --git a/query-string/tsconfig.json b/query-string/tsconfig.json index c0a4860fb8..3dd890dac3 100644 --- a/query-string/tsconfig.json +++ b/query-string/tsconfig.json @@ -6,7 +6,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "baseUrl": "../", "typeRoots": [ "../" From 82bfe951e14affdf3adb685d55e37f542fa16841 Mon Sep 17 00:00:00 2001 From: Iain McGinniss Date: Fri, 10 Mar 2017 14:56:19 -0800 Subject: [PATCH 531/797] Fix definition to be compatible with TS 2.2 (#14837) TS 2.2 provides definitions for the fetch API directly in the dom library, and those definitions are slightly different from those that were provided in @types/whatwg-fetch. This change updates the webappsec-credential-management definitions to be compatible with TS 2.2, and drops the dependency on @types/whatwg-fetch. --- webappsec-credential-management/index.d.ts | 228 ++++++++++++++++----- 1 file changed, 172 insertions(+), 56 deletions(-) diff --git a/webappsec-credential-management/index.d.ts b/webappsec-credential-management/index.d.ts index 0c1c2b5e2d..491efb3829 100644 --- a/webappsec-credential-management/index.d.ts +++ b/webappsec-credential-management/index.d.ts @@ -1,10 +1,150 @@ -// Type definitions for W3C (WebAppSec) Credential Management API, Level 1, 0.0 +// Type definitions for W3C (WebAppSec) Credential Management API Level 1, 0.1 // Project: https://github.com/w3c/webappsec-credential-management // Definitions by: Iain McGinniss // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + // Spec: http://www.w3.org/TR/2016/WD-credential-management-1-20160425/ -/// +/* ************************ FETCH API DEFINITIONS ****************************** + * TS 2.2 introduced definitions for the fetch API in the dom library, but + * prior to that it was necessary to use the types defined in + * @types/whatwg-fetch. In order to support all versions of TS 2.x, the + * definitions for fetch from TS 2.2 dom are duplicated here. As long as these + * remain identical to the definitions in dom 2.2+, they cause no issues. + * + * One caveat to "identical" here is that type definitions cannot be duplicated, + * and so the "RequestInfo" type has been substituted for its expansion in + * the below definitions: + * + * type RequestInfo = Request|string; + * ************************************************************************** */ + +interface Request extends Object, Body { + readonly cache: string; + readonly credentials: string; + readonly destination: string; + readonly headers: Headers; + readonly integrity: string; + readonly keepalive: boolean; + readonly method: string; + readonly mode: string; + readonly redirect: string; + readonly referrer: string; + readonly referrerPolicy: string; + readonly type: string; + readonly url: string; + clone(): Request; +} + +declare var Request: { + prototype: Request; + new(input: Request | string, init?: RequestInit): Request; +}; + +interface Headers { + append(name: string, value: string): void; + delete(name: string): void; + forEach(callback: ForEachCallback): void; + get(name: string): string | null; + has(name: string): boolean; + set(name: string, value: string): void; +} + +declare var Headers: { + prototype: Headers; + new(init?: any): Headers; +}; + +interface Response extends Object, Body { + readonly body: ReadableStream | null; + readonly headers: Headers; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly type: string; + readonly url: string; + clone(): Response; +} + +declare var Response: { + prototype: Response; + new(body?: any, init?: ResponseInit): Response; +}; + +interface ResponseInit { + status?: number; + statusText?: string; + headers?: any; +} + +interface ReadableStream { + readonly locked: boolean; + cancel(): Promise; + getReader(): ReadableStreamReader; +} + +declare var ReadableStream: { + prototype: ReadableStream; + new(): ReadableStream; +}; + +interface ReadableStreamReader { + cancel(): Promise; + read(): Promise; + releaseLock(): void; +} + +declare var ReadableStreamReader: { + prototype: ReadableStreamReader; + new(): ReadableStreamReader; +}; + +interface Body { + readonly bodyUsed: boolean; + arrayBuffer(): Promise; + blob(): Promise; + json(): Promise; + text(): Promise; +} + +interface URLSearchParams { + /** + * Appends a specified key/value pair as a new search parameter. + */ + append(name: string, value: string): void; + /** + * Deletes the given search parameter, and its associated value, from the list of all search parameters. + */ + delete(name: string): void; + /** + * Returns the first value associated to the given search parameter. + */ + get(name: string): string | null; + /** + * Returns all the values association with a given search parameter. + */ + getAll(name: string): string[]; + /** + * Returns a Boolean indicating if such a search parameter exists. + */ + has(name: string): boolean; + /** + * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. + */ + set(name: string, value: string): void; +} + +declare var URLSearchParams: { + prototype: URLSearchParams; + /** + * Constructor returning a URLSearchParams object. + */ + new (init?: string | URLSearchParams): URLSearchParams; +}; + +interface GlobalFetch { + fetch(input: Request|string, init?: RequestInit): Promise; +} /* ************************* FETCH MODIFICATIONS ******************************* * The credential management spec modifies fetch(), by adding a new @@ -16,78 +156,54 @@ * See: https://www.w3.org/TR/credential-management-1/#monkey-patching * ************************************************************************** */ -interface Window { - fetch(url: CMRequestInfo, init?: CMRequestInit): Promise; -} +declare function fetch( + input: Request|string, + init?: RequestInit|CMRequestInit): + Promise; -type CMRequestInfo = CMRequest|string; +interface GlobalFetch { + // variant for navigator.credentials monkey patching + fetch(url: Request|string, init?: CMRequestInit): Promise; +} /** - * Variant of {@link Request} that permits a {@code 'password'} value in the - * {@code credentials} property. + * Original definition from TS 2.2 dom. */ -interface CMRequest extends Body { - // the only modified property from RequestCredentials: - credentials: CMRequestCredentials; - - method: string; - url: string; - headers: Headers; - - type: RequestType; - destination: RequestDestination; - referrer: string; - referrerPolicy: ReferrerPolicy; - mode: RequestMode; - - cache: RequestCache; - redirect: RequestRedirect; - integrity: string; - - clone(): Request; +interface RequestInit { + method?: string; + headers?: any; + body?: any; + referrer?: string; + referrerPolicy?: string; + mode?: string; + credentials?: string; + cache?: string; + redirect?: string; + integrity?: string; + keepalive?: boolean; + window?: any; } -type CMRequestCredentials = RequestCredentials|'password'; - /** * Variant of {@link RequestInit} that permits a {@link PasswordCredential} to * be used in the {@code credentials} property. All other properties are * identical to {@link RequestInit}. */ interface CMRequestInit { - credentials?: PasswordCredential|CMRequestCredentials; - method?: string; - headers?: HeadersInit; - body?: BodyInit; + headers?: any; + body?: any; referrer?: string; - referrerPolicy?: ReferrerPolicy; - mode?: RequestMode; - - cache?: RequestCache; - redirect?: RequestRedirect; + referrerPolicy?: string; + mode?: string; + credentials?: PasswordCredential|string; + cache?: string; + redirect?: string; integrity?: string; + keepalive?: boolean; window?: any; } -/** - * URLSearchParams is not yet included in the core lib.d.ts declarations, so we - * include it here. - * The official definition should be included in TypeScript 2.2, at which point - * this can be removed. - * - * @see {@link https://github.com/Microsoft/TypeScript/issues/12517} - */ -declare class URLSearchParams { - constructor(init?: string|URLSearchParams); - append(name: string, value: string): void; - delete(name: string): void; - get(name: string): string|null; - getAll(name: string): string[]; - has(name: string): boolean; - set(name: string, value: string): void; -} - /* ***************** CREDENTIAL MANAGEMENT API DEFINITONS ******************* */ /** From a871ef4a1053ebd54b39c9924598d5dc54ff3710 Mon Sep 17 00:00:00 2001 From: mleko Date: Sat, 11 Mar 2017 00:01:02 +0100 Subject: [PATCH 532/797] Add qrcode.react definition (#14833) * Add qrcode.react definition * Remove patch version * Update to comply with contribution rules --- qrcode.react/index.d.ts | 22 ++++++++++++++++++++++ qrcode.react/qrcode.react-tests.tsx | 12 ++++++++++++ qrcode.react/tsconfig.json | 24 ++++++++++++++++++++++++ qrcode.react/tslint.json | 1 + 4 files changed, 59 insertions(+) create mode 100644 qrcode.react/index.d.ts create mode 100644 qrcode.react/qrcode.react-tests.tsx create mode 100644 qrcode.react/tsconfig.json create mode 100644 qrcode.react/tslint.json diff --git a/qrcode.react/index.d.ts b/qrcode.react/index.d.ts new file mode 100644 index 0000000000..c7a6b85d72 --- /dev/null +++ b/qrcode.react/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for qrcode.react 0.6 +// Project: https://github.com/zpao/qrcode.react +// Definitions by: Mleko +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// + +declare namespace qrcode { + export interface QRCodeProps { + value: string; + size?: number; + bgColor?: string; + fgColor?: string; + level?: "L"|"M"|"Q"|"H"; + } + + export type QRCode = React.ComponentClass; +} + +declare const qrcode: qrcode.QRCode; +export = qrcode; diff --git a/qrcode.react/qrcode.react-tests.tsx b/qrcode.react/qrcode.react-tests.tsx new file mode 100644 index 0000000000..ffae551b01 --- /dev/null +++ b/qrcode.react/qrcode.react-tests.tsx @@ -0,0 +1,12 @@ +import * as QRCode from "qrcode.react"; +import * as React from "react"; + +const qrcodes = [ + , + , + , + , + , + , + , +]; diff --git a/qrcode.react/tsconfig.json b/qrcode.react/tsconfig.json new file mode 100644 index 0000000000..c9938f0730 --- /dev/null +++ b/qrcode.react/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", + "qrcode.react-tests.tsx" + ] +} diff --git a/qrcode.react/tslint.json b/qrcode.react/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/qrcode.react/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From fd21da7d92a8b4f873ba000b2d566c712243198e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Menezes?= Date: Fri, 10 Mar 2017 20:02:04 -0300 Subject: [PATCH 533/797] Add gulp-batch declaration files (#14832) --- gulp-batch/gulp-batch-tests.ts | 8 ++++++++ gulp-batch/index.d.ts | 8 ++++++++ gulp-batch/tsconfig.json | 22 ++++++++++++++++++++++ gulp-batch/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 gulp-batch/gulp-batch-tests.ts create mode 100644 gulp-batch/index.d.ts create mode 100644 gulp-batch/tsconfig.json create mode 100644 gulp-batch/tslint.json diff --git a/gulp-batch/gulp-batch-tests.ts b/gulp-batch/gulp-batch-tests.ts new file mode 100644 index 0000000000..a1e305c03b --- /dev/null +++ b/gulp-batch/gulp-batch-tests.ts @@ -0,0 +1,8 @@ +import * as gulp from "gulp"; +import * as batch from "gulp-batch"; + +gulp.task('default', function() { + gulp.watch([ 'lib/**', 'test/**' ], batch((events: any, cb: any) => { + events.on('data', console.log).on('end', cb); + })); +}); diff --git a/gulp-batch/index.d.ts b/gulp-batch/index.d.ts new file mode 100644 index 0000000000..a3be8e252e --- /dev/null +++ b/gulp-batch/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for gulp-batch 1.0 +// Project: https://github.com/floatdrop/gulp-batch +// Definitions by: Alvaro Menezes , Vinicius Salomao +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function batch(opts?: any, cb?: any, errorHandler?: any): (event: any) => void; +declare namespace batch { } +export = batch; diff --git a/gulp-batch/tsconfig.json b/gulp-batch/tsconfig.json new file mode 100644 index 0000000000..eb09ea4f9c --- /dev/null +++ b/gulp-batch/tsconfig.json @@ -0,0 +1,22 @@ +{ + "files": [ + "index.d.ts", + "gulp-batch-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} \ No newline at end of file diff --git a/gulp-batch/tslint.json b/gulp-batch/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/gulp-batch/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From 12b1792ca088d1bcdd912988b88f552614005931 Mon Sep 17 00:00:00 2001 From: thisboyiscrazy Date: Fri, 10 Mar 2017 18:03:15 -0500 Subject: [PATCH 534/797] nedb-logger (#14826) * nedb-logger * nedb-logger --- nedb-logger/index.d.ts | 20 ++++++++++ nedb-logger/nedb-logger-tests.ts | 64 ++++++++++++++++++++++++++++++++ nedb-logger/tsconfig.json | 22 +++++++++++ nedb-logger/tslint.json | 1 + 4 files changed, 107 insertions(+) create mode 100644 nedb-logger/index.d.ts create mode 100644 nedb-logger/nedb-logger-tests.ts create mode 100644 nedb-logger/tsconfig.json create mode 100644 nedb-logger/tslint.json diff --git a/nedb-logger/index.d.ts b/nedb-logger/index.d.ts new file mode 100644 index 0000000000..4c47ee0dad --- /dev/null +++ b/nedb-logger/index.d.ts @@ -0,0 +1,20 @@ +// Type definitions for NeDB Logger 1.8 +// Project: https://github.com/louischatriot/nedb-logger +// Definitions by: Joe vanderstelt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = NeDBLoggerDataStore; +export as namespace NedbLogger; + +declare namespace NeDBLoggerDataStore { } +declare class NeDBLoggerDataStore { + + constructor(path?: string | {filename: string}); + + /** + * Insert a new document + * @param {Function} cb Optional callback, signature: err, insertedDoc + */ + insert(newDoc: T, cb?: (err: Error, document: T) => void): void; + +} diff --git a/nedb-logger/nedb-logger-tests.ts b/nedb-logger/nedb-logger-tests.ts new file mode 100644 index 0000000000..b6665ad44d --- /dev/null +++ b/nedb-logger/nedb-logger-tests.ts @@ -0,0 +1,64 @@ +/** + * Created by Joe Vanderstelt 2017-02-22. + */ + +/// + + +import * as es6styleimport from 'nedb-logger'; + +import Q = require('q'); +import nedblogger = require('nedb-logger'); + +class BaseCollection { + + private dataStore: nedblogger; + + constructor(dataStore: nedblogger) { + + this.dataStore = dataStore; + } + + insert(document: T): Q.Promise { + + var deferred = Q.defer(); + + this.dataStore.insert(document, function(err: Error, newDoc: T) { // Callback is optional + // newDoc is the newly inserted document, including its _id + if (err) { + deferred.reject(err); + } else { + deferred.resolve(newDoc); + } + }); + + return deferred.promise; + } + +} + +// Type 1: Persistent datastore with manual loading + +import Datastore = require('nedb-logger'); +var db = new Datastore({filename: 'path/to/datafile'}); + +var doc: any = { + hello: 'world' + , n: 5 + , today: new Date() + , nedbIsAwesome: true + , notthere: null + , notToBeSaved: undefined // Will not be saved + , fruits: ['apple', 'orange', 'pear'] + , infos: {name: 'nedb'} +}; + +db.insert(doc, function(err: Error, newDoc: any) { // Callback is optional + // newDoc is the newly inserted document, including its _id + // newDoc has no key called notToBeSaved since its value was undefined +}); + +db.insert([{a: 5}, {a: 42}], function(err: Error, newdocs: any[]) { + // Two documents were inserted in the database + // newDocs is an array with these documents, augmented with their _id +}); diff --git a/nedb-logger/tsconfig.json b/nedb-logger/tsconfig.json new file mode 100644 index 0000000000..917e72a038 --- /dev/null +++ b/nedb-logger/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", + "nedb-logger-tests.ts" + ] +} \ No newline at end of file diff --git a/nedb-logger/tslint.json b/nedb-logger/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/nedb-logger/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file From 75ffb8e47dfe51b8d4c1c33410e542f433c557c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksandar=20Rodi=C4=87?= Date: Sat, 11 Mar 2017 00:09:55 +0100 Subject: [PATCH 535/797] Changing 'scope' definition (#14810) current definition ```ts scope(options?: string | string[] | ScopeOptions | WhereOptions): this; ``` doesn't allow are valid calls. example from [documentation](http://docs.sequelizejs.com/en/latest/docs/scopes/): ```ts Project.scope('random', { method: ['accessLevel', 19]}).findAll(); ``` changing it to ```ts scope(options?: string | ScopeOptions | WhereOptions | Array): this; ``` should fix the issue since, according to the docs ```ts // These two are equivalent Project.scope('deleted', 'activeUsers').findAll(); Project.scope(['deleted', 'activeUsers']).findAll(); ``` --- sequelize/index.d.ts | 2 +- sequelize/sequelize-tests.ts | 5 ++++- sequelize/v3/index.d.ts | 2 +- sequelize/v3/sequelize-tests.ts | 5 ++++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sequelize/index.d.ts b/sequelize/index.d.ts index ec41863261..c3dd68ec98 100644 --- a/sequelize/index.d.ts +++ b/sequelize/index.d.ts @@ -3671,7 +3671,7 @@ declare namespace sequelize { * @return Model A reference to the model, with the scope(s) applied. Calling scope again on the returned * model will clear the previous scope. */ - scope(options?: string | string[] | ScopeOptions | WhereOptions): this; + scope(options?: string | ScopeOptions | WhereOptions | Array): this; /** * Search for multiple instances. diff --git a/sequelize/sequelize-tests.ts b/sequelize/sequelize-tests.ts index 71e6203a82..ceff709a6b 100644 --- a/sequelize/sequelize-tests.ts +++ b/sequelize/sequelize-tests.ts @@ -853,11 +853,14 @@ User.schema( 'special' ).create( { age : 3 }, { logging : function( ) {} } ); User.getTableName(); User.addScope('lowAccess', { where : { parent_id : 2 } }); -User.addScope('lowAccess', function() { } ); User.addScope('lowAccess', { where : { parent_id : 2 } }, { override: true }); +User.addScope('lowAccessWithParam', function(id: number) { + return { where : { parent_id : id } } +} ); User.scope( 'lowAccess' ).count(); User.scope( { where : { parent_id : 2 } } ); +User.scope( [ 'lowAccess', { method: ['lowAccessWithParam', 2] }, { where : { parent_id : 2 } } ] ) User.findAll(); User.findAll( { where : { data : { employment : null } } } ); diff --git a/sequelize/v3/index.d.ts b/sequelize/v3/index.d.ts index fb73cd94bf..edb1bb2a6d 100644 --- a/sequelize/v3/index.d.ts +++ b/sequelize/v3/index.d.ts @@ -3648,7 +3648,7 @@ declare namespace sequelize { * @return Model A reference to the model, with the scope(s) applied. Calling scope again on the returned * model will clear the previous scope. */ - scope(options?: string | string[] | ScopeOptions | WhereOptions): this; + scope(options?: string | ScopeOptions | WhereOptions | Array): this; /** * Search for multiple instances. diff --git a/sequelize/v3/sequelize-tests.ts b/sequelize/v3/sequelize-tests.ts index ef90600e91..83c4536a71 100644 --- a/sequelize/v3/sequelize-tests.ts +++ b/sequelize/v3/sequelize-tests.ts @@ -840,11 +840,14 @@ User.schema( 'special' ).create( { age : 3 }, { logging : function( ) {} } ); User.getTableName(); User.addScope('lowAccess', { where : { parent_id : 2 } }); -User.addScope('lowAccess', function() { } ); User.addScope('lowAccess', { where : { parent_id : 2 } }, { override: true }); +User.addScope('lowAccessWithParam', function(id: number) { + return { where : { parent_id : id } } +} ); User.scope( 'lowAccess' ).count(); User.scope( { where : { parent_id : 2 } } ); +User.scope( [ 'lowAccess', { method: ['lowAccessWithParam', 2] }, { where : { parent_id : 2 } } ] ) User.findAll(); User.findAll( { where : { data : { employment : null } } } ); From a43da75444d2aae17adabcfc6c8809586afcb658 Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Fri, 10 Mar 2017 17:17:36 -0600 Subject: [PATCH 536/797] allow numbers as the right hand side of a join equality (#14823) --- knex/index.d.ts | 2 +- knex/knex-tests.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/knex/index.d.ts b/knex/index.d.ts index 0627498962..660a8dfcb2 100644 --- a/knex/index.d.ts +++ b/knex/index.d.ts @@ -165,7 +165,7 @@ declare namespace Knex { interface Join { (raw: Raw): QueryBuilder; - (tableName: string, columns: { [key: string]: string | Raw }): QueryBuilder; + (tableName: string, columns: { [key: string]: string | number | Raw }): QueryBuilder; (tableName: string, callback: Function): QueryBuilder; (tableName: TableName, raw: Raw): QueryBuilder; (tableName: TableName, column1: string, column2: string): QueryBuilder; diff --git a/knex/knex-tests.ts b/knex/knex-tests.ts index 420aafd724..3d02a7924b 100644 --- a/knex/knex-tests.ts +++ b/knex/knex-tests.ts @@ -188,6 +188,10 @@ knex('users') .join('contacts', 'users.id', '=', 'contacts.user_id') .select('users.id', 'contacts.phone'); +knex('users') + .join('contacts', { 'users.id': 12355 }) + .select('users.id', 'contacts.phone'); + knex('users') .join('contacts', 'users.id', 'contacts.user_id') .select('users.id', 'contacts.phone'); From 253d42273d6d5d1bbf35c020f7dc05d1ce6cdd0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alu=C3=ADsio=20Augusto=20Silva=20Gon=C3=A7alves?= Date: Fri, 10 Mar 2017 20:18:53 -0300 Subject: [PATCH 537/797] Add type definitions for 'printf' (#14821) * Add definitions for 'printf' * Add "lib" to tsconfig.json * Fix link --- printf/index.d.ts | 10 ++++++++++ printf/printf-tests.ts | 9 +++++++++ printf/tsconfig.json | 22 ++++++++++++++++++++++ printf/tslint.json | 1 + 4 files changed, 42 insertions(+) create mode 100644 printf/index.d.ts create mode 100644 printf/printf-tests.ts create mode 100644 printf/tsconfig.json create mode 100644 printf/tslint.json diff --git a/printf/index.d.ts b/printf/index.d.ts new file mode 100644 index 0000000000..e136eed929 --- /dev/null +++ b/printf/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for printf 0.2 +// Project: https://github.com/adaltas/node-printf +// Definitions by: Aluísio Augusto Silva Gonçalves +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export = printf; +declare function printf(format: string, ...args: any[]): string; +declare function printf(writeStream: NodeJS.WritableStream, format: string, ...args: any[]): void; diff --git a/printf/printf-tests.ts b/printf/printf-tests.ts new file mode 100644 index 0000000000..d116d45f76 --- /dev/null +++ b/printf/printf-tests.ts @@ -0,0 +1,9 @@ +import printf = require("printf"); + +printf('%c', 0x7f).charCodeAt(0); +printf('%2$s: %1$O', {hello: 'Node'}, 'Test'); +printf('%(temperature)s %(crevace)ss', { + temperature: 'Hot', + crevace: 'Pocket', +}); +printf(process.stdout, '%2$s: %1$O', {hello: 'Node'}, 'Test'); diff --git a/printf/tsconfig.json b/printf/tsconfig.json new file mode 100644 index 0000000000..e937977428 --- /dev/null +++ b/printf/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", + "printf-tests.ts" + ] +} diff --git a/printf/tslint.json b/printf/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/printf/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } From f38e6124589657e0f50a93f292d142a81c392d75 Mon Sep 17 00:00:00 2001 From: Aluan Haddad Date: Fri, 10 Mar 2017 18:25:58 -0500 Subject: [PATCH 538/797] =?UTF-8?q?SystemJS:=20refined=20typeof=20'transpi?= =?UTF-8?q?ler'=20option,=20added=20plugin-typescript=20specific=20?= =?UTF-8?q?=E2=80=A6=20(#14801)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * SystemJS: refined typeof 'transpiler' option, added plugin-typescript specific flags to typescriptOptions Refined typeof 'transpiler' option to only allow `false` as opposed to `boolean`. Added the `typescriptOptions` properties that are specific to plugin-typescript to typescriptOptions object. * lint and fix warnings --- systemjs/index.d.ts | 56 ++++++++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/systemjs/index.d.ts b/systemjs/index.d.ts index 876e4fdb4d..cf37862975 100644 --- a/systemjs/index.d.ts +++ b/systemjs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for SystemJS 0.20.5 +// Type definitions for SystemJS 0.20 // Project: https://github.com/systemjs/systemjs // Definitions by: Ludovic HENIN , Nathan Walker , Giedrius Grabauskas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,9 +6,13 @@ declare namespace SystemJSLoader { - type ModulesList = { [bundleName: string]: Array }; + interface ModulesList { + [bundleName: string]: string[]; + } - type PackageList = { [packageName: string]: T }; + interface PackageList { + [packageName: string]: T; + } /** * The following module formats are supported: @@ -27,7 +31,7 @@ declare namespace SystemJSLoader { * Represents a module name for System.import that must resolve to either Traceur, Babel or TypeScript. * When set to traceur, babel or typescript, loading will be automatically configured as far as possible. */ - type Transpiler = "plugin-traceur" | "plugin-babel" | "plugin-typescript" | "traceur" | "babel" | "typescript" | boolean; + type Transpiler = "plugin-traceur" | "plugin-babel" | "plugin-typescript" | "traceur" | "babel" | "typescript" | false; type ConfigMap = PackageList>; @@ -49,7 +53,7 @@ declare namespace SystemJSLoader { * Dependencies to load before this module. Goes through regular paths and map normalization. * Only supported for the cjs, amd and global formats. */ - deps?: Array; + deps?: string[]; /** * A map of global names to module names that should be defined only for the execution of this module. @@ -225,13 +229,29 @@ declare namespace SystemJSLoader { * Sets the TypeScript transpiler options. */ //TODO: Import Typescript.CompilerOptions - typescriptOptions?: any; + typescriptOptions?: { + /** + * A boolean flag which instructs the plugin to load configuration from "tsconfig.json". + * To override the location of the file set this option to the path of the configuration file, + * which will be resolved using normal SystemJS resolution. + * Note: This setting is specific to plugin-typescript. + */ + tsconfig?: boolean | string, + /** + * A flag which controls whether the files are type-checked or simply transpiled. + * Set this option to "strict" to have the builds fail when compiler errors are encountered. + * Note: The strict option only affects builds and bundles via the SystemJS or JSPM Builder. + * Note: This setting is specific to plugin-typescript. + */ + typeCheck?: boolean | "strict", + [key: string]: any + }; } interface SystemJSSystemFields { env: string; loaderErrorStack: boolean; - packageConfigPaths: Array; + packageConfigPaths: string[]; pluginFirst: boolean; version: string; warnings: boolean; @@ -241,12 +261,12 @@ declare namespace SystemJSLoader { /** * For backwards-compatibility with AMD environments, set window.define = System.amdDefine. */ - amdDefine: Function; + amdDefine: (...args: any[]) => void; /** * For backwards-compatibility with AMD environments, set window.require = System.amdRequire. */ - amdRequire: Function; + amdRequire: (deps: string[], callback: (...modules: any[]) => void) => void; /** * SystemJS configuration helper function. @@ -257,7 +277,7 @@ declare namespace SystemJSLoader { /** * This represents the System base class, which can be extended or reinstantiated to create a custom System instance. */ - constructor: new() => System; + constructor: new () => System; /** * Deletes a module from the registry by normalized name. @@ -273,7 +293,7 @@ declare namespace SystemJSLoader { /** * Returns a clone of the internal SystemJS configuration in use. */ - getConfig(): Config + getConfig(): Config; /** * Returns whether a given module exists in the registry by normalized module name. @@ -303,15 +323,15 @@ declare namespace SystemJSLoader { /** * Declaration function for defining modules of the System.register polyfill module format. */ - register(name: string, deps: Array, declare: Function): void; - register(deps: Array, declare: Function): void; + register(name: string, deps: string[], declare: (...modules: any[]) => any): void; + register(deps: string[], declare: (...modules: any[]) => any): void; /** * Companion module format to System.register for non-ES6 modules. * Provides a

    This namespace declares an unspecified number of objects: _1, _2, _3, ..., which are - * used to specify placeholders in calls to function {@link std.bind}.